Skip to content

Commit

Permalink
Added support for visualization save/load
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercamp committed Jan 27, 2015
1 parent bb0ff15 commit 66b022f
Show file tree
Hide file tree
Showing 19 changed files with 548 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,42 @@ public Guid PropertyID
}
}

private Guid paneID;

public Guid PaneID
{
get
{
return this.paneID;
}
set
{
this.paneID = value;
}
}

private Guid sourceID;
public virtual Guid SourceID
{
get
{
return this.sourceID;
}
set
{
this.sourceID = value;
}
}

public static implicit operator Entities.Adapters.Visualization(Entities.Visualization entity)
{
return new Visualization()
{
PropertyID = entity.PropertyID,
ID = entity.ID,
VisualizerID = entity.VisualizerID
VisualizerID = entity.VisualizerID,
PaneID = entity.PaneID,
SourceID = entity.SourceID
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ public void PrepareVisualizationPropertyConfigurations(MappingConfiguration<Visu
configuration.HasProperty(x => x.VisualizerID).HasFieldName("visualizerIDs").WithDataAccessKind(DataAccessKind.ReadWrite).ToColumn("VisualizerID").IsNotNullable().HasColumnType("uniqueidentifier").HasPrecision(0).HasScale(0);
configuration.HasProperty(x => x.ID).IsIdentity(KeyGenerator.Guid).HasFieldName("iDs").WithDataAccessKind(DataAccessKind.ReadWrite).ToColumn("ID").IsNotNullable().HasColumnType("uniqueidentifier").HasPrecision(0).HasScale(0);
configuration.HasProperty(x => x.PropertyID).HasFieldName("propertyIDs").ToColumn("PropertyID").IsNotNullable().HasColumnType("uniqueidentifier").HasPrecision(0).HasScale(0);
configuration.HasProperty(x => x.PaneID).HasFieldName("paneIDs").ToColumn("PaneID").IsNotNullable().HasColumnType("uniqueidentifier").HasPrecision(0).HasScale(0);
configuration.HasProperty(x => x.SourceID).HasFieldName("sourceIDs").ToColumn("SourceID").IsNotNullable().HasColumnType("uniqueidentifier").HasPrecision(0).HasScale(0);
}

public void PrepareVisualizationAssociationConfigurations(MappingConfiguration<Visualization> configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
<orm:field name="propertyIDs" property="PropertyID" uniqueId="cd49e96f-bb5a-4cbf-97c7-52c028222c44" type="System.Guid">
<orm:column name="PropertyID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="" />
</orm:field>
<orm:field name="paneIDs" property="PaneID" uniqueId="7e90cd0c-5414-4289-a7e5-6aaedf27edc4" type="System.Guid">
<orm:column name="PaneID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="" />
</orm:field>
<orm:field name="sourceIDs" property="SourceID" uniqueId="81027a6b-ed31-44a2-af7e-c4c587aad973" type="System.Guid">
<orm:column name="SourceID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="" />
</orm:field>
<orm:field name="visualizers" property="Visualizer" behavior="readwrite" uniqueId="3df6be04-9fe5-4594-90a6-2142bfdc0461" type="Construct.Server.Entities.Visualizer">
<orm:reference uniqueId="3cb8a87e-4622-4e55-b921-d00952cf0652" association-name="VisualizationHasVisualizer">
<orm:sharedfield name="visualizerIDs" target-class="Construct.Server.Entities.Visualizer" target-field="iDs" />
Expand Down Expand Up @@ -806,6 +812,8 @@
<orm:column name="VisualizerID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="Guid" />
<orm:column name="ID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" primary-key="true" ado-type="Guid" />
<orm:column name="PropertyID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="" />
<orm:column name="PaneID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="" />
<orm:column name="SourceID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="" />
</orm:table>
<orm:table name="Sources_Source">
<orm:column name="DataTypeSourceID" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="Guid" />
Expand Down Expand Up @@ -1391,6 +1399,8 @@
<Property Id="aa244f41-fa0d-45ee-ba78-de96c3f8751e" name="ID" type="Guid" label="ID : Guid" kind="Persistent" identity="true" fieldName="iDs" />
<Property Id="d576543b-e273-43dd-b090-b246a42cd0be" name="VisualizerID" type="Guid" label="VisualizerID : Guid" kind="Persistent" fieldName="visualizerIDs" />
<Property Id="cd49e96f-bb5a-4cbf-97c7-52c028222c44" name="PropertyID" type="Guid" label="PropertyID : Guid" fieldName="propertyIDs" />
<Property Id="7e90cd0c-5414-4289-a7e5-6aaedf27edc4" name="PaneID" type="Guid" label="PaneID : Guid" fieldName="paneIDs" />
<Property Id="81027a6b-ed31-44a2-af7e-c4c587aad973" name="SourceID" type="Guid" label="SourceID : Guid" fieldName="sourceIDs" />
<AssociationTargets>
<Association Id="3cb8a87e-4622-4e55-b921-d00952cf0652" SourceMultiplicity="ZeroOne" name="VisualizationHasVisualizer">
<DomainClassMoniker name="/EntitiesModel/Visualizer" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<EntityDiagrams>
<entityDiagramsDiagram dslVersion="2.0.0.0" absoluteBounds="0, 0, 30, 27" name="EntityDiagrams" isDefault="true">
<entityDiagramsDiagram dslVersion="2.0.0.0" absoluteBounds="0, 0, 30, 27.125" name="EntityDiagrams" isDefault="true">
<DomainModelMoniker name="/EntitiesModel" />
<nestedChildShapes>
<classShape Id="6d8d9580-bb98-4f04-b3d3-151ea60423cc" absoluteBounds="10.375, 24.375, 2.625, 2.3396761067708347">
Expand All @@ -11,12 +11,12 @@
<elementListCompartment Id="bfc02f0d-e758-4b6f-9743-7356f6c1422f" absoluteBounds="10.39, 26.172985026041665, 2.5949999999999998, 0.44169108072916674" name="NavigationCompartment" titleTextColor="Black" itemTextColor="Black" />
</nestedChildShapes>
</classShape>
<classShape Id="84650edd-3cca-48a2-8f4f-ba4cf8bd6b32" absoluteBounds="14.125, 24.375, 1.5, 2.1473746744791704">
<classShape Id="84650edd-3cca-48a2-8f4f-ba4cf8bd6b32" absoluteBounds="14.125, 24.375, 1.5, 2.5319775390625026">
<DomainClassMoniker name="/EntitiesModel/Visualization" />
<nestedChildShapes>
<elementListCompartment Id="cbaafbb8-966f-495f-a628-f30907562590" absoluteBounds="14.14, 24.884999999999998, 1.4700000000000002, 0.8262939453125" name="AttributesCompartment" titleTextColor="Black" itemTextColor="Black" />
<elementListCompartment Id="82b834be-6747-40ab-960d-d1aecd17d0f3" absoluteBounds="14.14, 25.7212939453125, 1.4700000000000002, 0.2493896484375" name="ImplementationsCompartment" titleTextColor="Black" itemTextColor="Black" />
<elementListCompartment Id="0d0dea18-98f0-46a5-bbbc-0a980d24c3de" absoluteBounds="14.14, 25.98068359375, 1.4700000000000002, 0.44169108072916674" name="NavigationCompartment" titleTextColor="Black" itemTextColor="Black" />
<elementListCompartment Id="cbaafbb8-966f-495f-a628-f30907562590" absoluteBounds="14.14, 24.884999999999998, 1.4700000000000002, 1.2108968098958333" name="AttributesCompartment" titleTextColor="Black" itemTextColor="Black" />
<elementListCompartment Id="82b834be-6747-40ab-960d-d1aecd17d0f3" absoluteBounds="14.14, 26.105896809895832, 1.4700000000000002, 0.2493896484375" name="ImplementationsCompartment" titleTextColor="Black" itemTextColor="Black" />
<elementListCompartment Id="0d0dea18-98f0-46a5-bbbc-0a980d24c3de" absoluteBounds="14.14, 26.365286458333333, 1.4700000000000002, 0.44169108072916696" name="NavigationCompartment" titleTextColor="Black" itemTextColor="Black" />
</nestedChildShapes>
</classShape>
<classShape Id="295522db-a917-4a4c-85ab-dce41c643be4" absoluteBounds="10.375, 0.5, 2.375, 2.3396761067708334">
Expand Down Expand Up @@ -303,7 +303,7 @@
<classShapeMoniker Id="97d93da9-d12f-43f3-9afc-ef72df9b7006" />
</nodes>
</associationConnector>
<associationConnector edgePoints="[(14.125 : 25.4486873372396); (13 : 25.4486873372396)]" fixedFrom="Algorithm" fixedTo="Algorithm">
<associationConnector edgePoints="[(14.125 : 25.5448380533854); (13 : 25.5448380533854)]" fixedFrom="Algorithm" fixedTo="Algorithm">
<AssociationMoniker Id="3cb8a87e-4622-4e55-b921-d00952cf0652" />
<relativeChildShapes />
<nodes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,32 @@ public virtual Guid PropertyID
}
}

private Guid paneIDs;
public virtual Guid PaneID
{
get
{
return this.paneIDs;
}
set
{
this.paneIDs = value;
}
}

private Guid sourceIDs;
public virtual Guid SourceID
{
get
{
return this.sourceIDs;
}
set
{
this.sourceIDs = value;
}
}

private Visualizer visualizers;
public virtual Visualizer Visualizer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public void AddVisualization(Entities.Adapters.Visualization visualization)
entity.ID = visualization.ID;
entity.VisualizerID = visualization.VisualizerID;
entity.PropertyID = visualization.PropertyID;
entity.PaneID = visualization.PaneID;
entity.SourceID = visualization.SourceID;

context.Add(entity);
context.SaveChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ public partial class Visualization : object, System.Runtime.Serialization.IExten
[System.Runtime.Serialization.OptionalFieldAttribute()]
private System.Guid IDField;

[System.Runtime.Serialization.OptionalFieldAttribute()]
private System.Guid PaneIDField;

[System.Runtime.Serialization.OptionalFieldAttribute()]
private System.Guid PropertyIDField;

[System.Runtime.Serialization.OptionalFieldAttribute()]
private System.Guid SourceIDField;

[System.Runtime.Serialization.OptionalFieldAttribute()]
private System.Guid VisualizerIDField;

Expand All @@ -54,6 +60,19 @@ public System.Guid ID {
}
}

[System.Runtime.Serialization.DataMemberAttribute()]
public System.Guid PaneID {
get {
return this.PaneIDField;
}
set {
if ((this.PaneIDField.Equals(value) != true)) {
this.PaneIDField = value;
this.RaisePropertyChanged("PaneID");
}
}
}

[System.Runtime.Serialization.DataMemberAttribute()]
public System.Guid PropertyID {
get {
Expand All @@ -67,6 +86,19 @@ public System.Guid PropertyID {
}
}

[System.Runtime.Serialization.DataMemberAttribute()]
public System.Guid SourceID {
get {
return this.SourceIDField;
}
set {
if ((this.SourceIDField.Equals(value) != true)) {
this.SourceIDField = value;
this.RaisePropertyChanged("SourceID");
}
}
}

[System.Runtime.Serialization.DataMemberAttribute()]
public System.Guid VisualizerID {
get {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Service" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Service" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsp:Policy wsu:Id="NetNamedPipeBinding_IModel_policy">
<wsp:ExactlyOne>
<wsp:All>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
<xs:complexType name="Visualization">
<xs:sequence>
<xs:element minOccurs="0" name="ID" type="ser:guid" />
<xs:element minOccurs="0" name="PaneID" type="ser:guid" />
<xs:element minOccurs="0" name="PropertyID" type="ser:guid" />
<xs:element minOccurs="0" name="SourceID" type="ser:guid" />
<xs:element minOccurs="0" name="VisualizerID" type="ser:guid" />
</xs:sequence>
</xs:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Xml" />
Expand All @@ -79,6 +80,10 @@
<HintPath>..\lib\RCWPF\2013.2.724.40\Telerik.Windows.Controls.Docking.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Controls.GridView, Version=2014.3.1202.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\RCWPF\2013.2.724.40\Telerik.Windows.Controls.GridView.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.Input, Version=2013.2.724.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\RCWPF\2013.2.724.40\Telerik.Windows.Controls.Input.dll</HintPath>
Expand All @@ -94,6 +99,11 @@
<HintPath>..\lib\RCWPF\2013.2.724.40\Telerik.Windows.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Documents, Version=2014.3.1202.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL" />
<Reference Include="Telerik.Windows.Documents.Core, Version=2014.3.1202.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL" />
<Reference Include="Telerik.Windows.Documents.Flow, Version=2014.3.1202.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL" />
<Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand All @@ -109,6 +119,12 @@
<Compile Include="IQueryableDataSource.cs" />
<Compile Include="ISubscribableDataSource.cs" />
<Compile Include="IVisualizer.cs" />
<Compile Include="LoadVisualizationDialog.xaml.cs">
<DependentUpon>LoadVisualizationDialog.xaml</DependentUpon>
</Compile>
<Compile Include="SaveVisualizationDialog.xaml.cs">
<DependentUpon>SaveVisualizationDialog.xaml</DependentUpon>
</Compile>
<Compile Include="VisualizationSerializationHelper.cs" />
<Compile Include="Visualizations\NumericPropertyDetails.xaml.cs">
<DependentUpon>NumericPropertyDetails.xaml</DependentUpon>
Expand All @@ -135,6 +151,14 @@
<DependentUpon>VisualizationWindow.xaml</DependentUpon>
</Compile>
<Compile Include="ChartToSessionConverter.cs" />
<Page Include="LoadVisualizationDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SaveVisualizationDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Visualizations\NumericPropertyDetails.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<telerik:RadRibbonWindow x:Class="Construct.UX.Views.Visualizations.LoadVisualizationDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="Select Visualization" Height="500" Width="800" WindowStyle="ToolWindow">
<Grid>
<telerik:RadGridView AutoGenerateColumns="False" SelectionMode="Single" x:Name="VisualizersList" Margin="0,0,0,40" SelectionChanged="VisualizersList_SelectionChanged" CanUserDeleteRows="False" CanUserInsertRows="False" ShowGroupPanel="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Name" UniqueName="Name" DataMemberBinding="{Binding Name}" SortingState="Descending" />
<telerik:GridViewDataColumn Header="Description" Width="*" DataMemberBinding="{Binding Description}" />
<telerik:GridViewColumn>
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton Content="Delete" Click="DeleteVisualizerButton_OnClick" />
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>

<Button Content="OK" Margin="0,0,90,10" Height="25" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75" Click="OkButton_Click" IsEnabled="False" x:Name="OkButton" />
<Button Content="Cancel" Margin="0,0,10,10" HorizontalAlignment="Right" Width="75" Height="25" VerticalAlignment="Bottom" Click="CancelButton_Click"/>
</Grid>
</telerik:RadRibbonWindow>
Loading

0 comments on commit 66b022f

Please sign in to comment.