diff options
Diffstat (limited to 'Software')
78 files changed, 663 insertions, 34 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 0484aed80..0e6d30aef 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 0a2fb21b2..cb15dbe51 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj index 8936a66db..d97f540b1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj @@ -118,6 +118,7 @@ <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> + <None Include="app.config" /> <None Include="packages.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config new file mode 100644 index 000000000..cacd4cd77 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index 086d6cd91..eae234a8b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -31,6 +31,9 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="DeepEqual, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\DeepEqual.1.6.0.0\lib\net40\DeepEqual.dll</HintPath> + </Reference> <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath> </Reference> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 7a1c94504..5c5531063 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -34,6 +34,8 @@ using Tango.MachineStudio.Common.Video; using Tango.Integration.Services; using Tango.MachineStudio.Developer.Navigation; using System.Data.Entity; +using Tango.MachineStudio.Common.Authentication; +using DeepEqual.Syntax; namespace Tango.MachineStudio.Developer.ViewModels { @@ -52,18 +54,24 @@ namespace Tango.MachineStudio.Developer.ViewModels private ObservablesContext _dbJobContext; private Job _jobFromList; private bool _blockInvalidateCommands; + private IAuthenticationProvider _authentication; #region Properties private ObservableCollection<ColorSpace> _colorSpaces; - + /// <summary> + /// Gets or sets the color spaces. + /// </summary> public ObservableCollection<ColorSpace> ColorSpaces { get { return _colorSpaces; } set { _colorSpaces = value; RaisePropertyChangedAuto(); } } - private ObservableCollection<Rml> _rmls; + private ObservableCollection<Rml> _rmls; + /// <summary> + /// Gets or sets the RMLS. + /// </summary> public ObservableCollection<Rml> Rmls { get { return _rmls; } @@ -172,6 +180,16 @@ namespace Tango.MachineStudio.Developer.ViewModels } } + private ObservableCollection<Job> _selectedJobs; + /// <summary> + /// Gets or sets the selected jobs. + /// </summary> + public ObservableCollection<Job> SelectedJobs + { + get { return _selectedJobs; } + set { _selectedJobs = value; RaisePropertyChangedAuto(); } + } + private Segment _selectedSegment; /// <summary> /// Gets or sets the job selected segment. @@ -182,6 +200,16 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _selectedSegment = value; RaisePropertyChangedAuto(); OnSelectedSegmentChanged(); } } + private ObservableCollection<Segment> _selectedSegments; + /// <summary> + /// Gets or sets the selected segments. + /// </summary> + public ObservableCollection<Segment> SelectedSegments + { + get { return _selectedSegments; } + set { _selectedSegments = value; RaisePropertyChangedAuto(); } + } + private BrushStop _selectedBrushStop; /// <summary> /// Gets or sets the selected segment selected brush stop. @@ -192,6 +220,16 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _selectedBrushStop = value; RaisePropertyChangedAuto(); } } + private ObservableCollection<BrushStop> _selectedBrushStops; + /// <summary> + /// Gets or sets the selected brush stops. + /// </summary> + public ObservableCollection<BrushStop> SelectedBrushStops + { + get { return _selectedBrushStops; } + set { _selectedBrushStops = value; RaisePropertyChangedAuto(); } + } + private Rml _selectedRML; /// <summary> /// Gets or sets the selected RML. @@ -457,6 +495,11 @@ namespace Tango.MachineStudio.Developer.ViewModels /// </summary> public RelayCommand LoadJobCommand { get; set; } + /// <summary> + /// Gets or sets the duplicate job command. + /// </summary> + public RelayCommand DuplicateJobCommand { get; set; } + #endregion #region Constructors @@ -482,8 +525,12 @@ namespace Tango.MachineStudio.Developer.ViewModels /// <param name="applicationManager">The application manager.</param> /// <param name="notificationProvider">The notification provider.</param> [PreferredConstructor] - public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IMainView view, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation) : this(view) + public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IMainView view, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, IAuthenticationProvider authentication) : this(view) { + SelectedJobs = new ObservableCollection<Job>(); + + _authentication = authentication; + _notification = notificationProvider; _navigation = navigation; ApplicationManager = applicationManager; @@ -509,6 +556,7 @@ namespace Tango.MachineStudio.Developer.ViewModels CloseJobCompletionStatusCommand = new RelayCommand(CloseJobCompletionStatusBar); ExitFullScreenCommand = new RelayCommand(ExitFullScreen); LoadJobCommand = new RelayCommand(LoadJob, () => SelectedJob != null); + DuplicateJobCommand = new RelayCommand(DuplicateJob, () => SelectedJob != null); ToggleCameraCommand = new RelayCommand<CaptureDevice>(ToggleCamera); @@ -547,6 +595,7 @@ namespace Tango.MachineStudio.Developer.ViewModels private void SelectedMachine_Saved(object sender, EventArgs e) { InvalidateLiquidFactorsAndProcessTables(); + SelectedMachine.Reload(); } /// <summary> @@ -640,14 +689,43 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Private Methods + private async void DuplicateJob() + { + if (SelectedJobs.Count > 0) + { + using (_notification.PushTaskItem("Cloning selected jobs...")) + { + int index = SelectedMachine.Jobs.Max(x => x.JobIndex); + + foreach (var job in SelectedJobs) + { + var cloned = job.Clone(); + cloned.JobIndex = ++index; + SelectedMachine.Jobs.Add(cloned); + } + + await SelectedMachine.SaveAsync(); + } + } + } + private async void LoadJob() { if (SelectedJob != null) { + SelectedSegments = new ObservableCollection<Segment>(); + SelectedBrushStops = new ObservableCollection<BrushStop>(); + SelectedRML = null; + SelectedSegment = null; + SelectedGroupHistory = null; + SelectedBrushStop = null; + SelectedProcessParametersTable = null; + RmlProcessParametersTableGroup = null; + using (_notification.PushTaskItem("Loading job details...")) { - await Task.Factory.StartNew(() => - { + //await Task.Factory.StartNew(() => + //{ _blockInvalidateCommands = false; _dbJobContext = ObservablesContext.CreateDefault(); @@ -675,7 +753,7 @@ namespace Tango.MachineStudio.Developer.ViewModels InvalidateRelayCommands(); InvokeUI(() => _navigation.NavigateTo(DeveloperNavigationView.JobView)); - }); + //}); } } } @@ -688,15 +766,45 @@ namespace Tango.MachineStudio.Developer.ViewModels { SelectedJob.LastUpdated = DateTime.UtcNow; SelectedJob.Rml = SelectedRML; - await SelectedJob.SaveAsync(); + await SelectedJob.SaveAsync(_dbJobContext); + _jobFromList = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == SelectedJob.Guid); await _jobFromList.Reload(); + + foreach (var segment in _jobFromList.Segments) + { + await segment.Reload(); + + foreach (var stop in segment.BrushStops) + { + await stop.Reload(); + } + } } } } private void DiscardJob() { - if (_notification.ShowQuestion("This will discard the current job changes. Are you sue?")) + //bool jobModified = !SelectedJob.WithDeepEqual(_jobFromList) + // .IgnoreSourceProperty(x => x.Machine) + // .IgnoreSourceProperty(x => x.JobRuns) + // .IgnoreSourceProperty(x => x.Parameters) + // .IgnoreSourceProperty(x => x.Rml) + // .IgnoreSourceProperty(x => x.User) + // .IgnoreSourceProperty(x => x.Segments) + // .Compare(); + + bool jobModified = !SelectedJob.CompareUsingJson(_jobFromList); + + if (jobModified) + { + if (_notification.ShowQuestion("This will discard the current job changes. Are you sue?")) + { + _dbJobContext.Dispose(); + _navigation.NavigateTo(DeveloperNavigationView.MachineJobSelectionView); + } + } + else { _dbJobContext.Dispose(); _navigation.NavigateTo(DeveloperNavigationView.MachineJobSelectionView); @@ -1012,11 +1120,18 @@ namespace Tango.MachineStudio.Developer.ViewModels /// <summary> /// Removes the selected job. /// </summary> - private void RemoveJob() + private async void RemoveJob() { if (SelectedMachine != null && SelectedJob != null) { - SelectedMachine.Jobs.Remove(SelectedJob); + if (_notification.ShowQuestion("Are you sure you want to delete the selected jobs?")) + { + SelectedJobs.ToList().ForEach(x => + { + x.DefferedDelete(); + }); + await SelectedMachine.SaveAsync(); + } } } @@ -1027,11 +1142,19 @@ namespace Tango.MachineStudio.Developer.ViewModels { if (SelectedMachine != null) { - SelectedMachine.Jobs.Add(new Job(DateTime.UtcNow) + String jobName = _notification.ShowTextInput("Please provide a job name", "Name"); + + if (!String.IsNullOrWhiteSpace(jobName)) { - Name = "Untitled Job", - CreationDate = DateTime.UtcNow, - }); + Job newJob = new Job(); + newJob.Name = jobName; + newJob.CreationDate = DateTime.UtcNow; + newJob.User = _authentication.CurrentUser; + newJob.Rml = Adapter.Rmls.FirstOrDefault(); + + SelectedJob = newJob; + LoadJob(); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index b6455175e..35a30e91e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -14,6 +14,7 @@ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views.DBViews;assembly=Tango.MachineStudio.DB" xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner" xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" @@ -230,7 +231,7 @@ <Grid Background="#96FFFFFF"> <Grid.Style> <Style TargetType="Grid"> - <Setter Property="Width" Value="300"></Setter> + <Setter Property="Width" Value="304"></Setter> <Setter Property="LayoutTransform"> <Setter.Value> <ScaleTransform ScaleY="1" ScaleX="1"></ScaleTransform> @@ -280,7 +281,7 @@ </StackPanel> </Border> - <ListBox SelectionMode="Extended" SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}" HorizontalContentAlignment="Stretch"> + <controls:MultiSelectListBox Style="{StaticResource {x:Type ListBox}}" SelectionMode="Extended" SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}" SelectedItemsList="{Binding SelectedSegments,Mode=TwoWay}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}"> @@ -345,7 +346,7 @@ </Grid> </DataTemplate> </ListBox.ItemTemplate> - </ListBox> + </controls:MultiSelectListBox> </DockPanel> <Rectangle HorizontalAlignment="Right" StrokeThickness="1" Width="3" Margin="0 0 0 0"> @@ -618,7 +619,7 @@ </Rectangle> </Grid> <Grid Margin="0 10 10 0"> - <ListBox SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding SelectedSegment.BrushStops}" SelectedItem="{Binding SelectedBrushStop}" HorizontalContentAlignment="Stretch"> + <controls:MultiSelectListBox SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding SelectedSegment.BrushStops}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}"> @@ -810,7 +811,7 @@ <Image Source="../Images/colorspace.png" Width="24"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Color Space</TextBlock> </StackPanel> - <ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name"> + <ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name" Width="100" HorizontalAlignment="Left"> <ComboBox.ItemContainerStyle> <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> <Setter Property="Background" Value="#ECECEC"></Setter> @@ -1052,7 +1053,7 @@ </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> - </ListBox> + </controls:MultiSelectListBox> </Grid> </DockPanel> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml index 998ba474d..b8d423026 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml @@ -8,6 +8,7 @@ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:observables="clr-namespace:Tango.Integration.Observables;assembly=Tango.Integration" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" @@ -85,19 +86,19 @@ <Grid DockPanel.Dock="Bottom"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20 0 0 0"> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF995A" BorderBrush="#FF995A"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF995A" BorderBrush="#FF995A" Command="{Binding DuplicateJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="ContentCopy" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DUPLICATE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW JOB</TextBlock> @@ -115,7 +116,7 @@ </Grid> <Grid Margin="0 20 0 0"> - <DataGrid CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" AutoGenerateColumns="False" Background="Transparent" ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}"> + <controls:MultiSelectDataGrid Style="{StaticResource {x:Type DataGrid}}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" AutoGenerateColumns="False" Background="Transparent" ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}" SelectedItemsList="{Binding SelectedJobs,Mode=TwoWay}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> @@ -145,7 +146,7 @@ </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> - <DataGridTemplateColumn Header="LAST MODIFIED" Width="185" CanUserSort="True" SortMemberPath="CreationDate"> + <DataGridTemplateColumn Header="LAST MODIFIED" Width="185" CanUserSort="True" SortMemberPath="LastUpdated"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" VerticalAlignment="Center" FontSize="16"></TextBlock> @@ -192,7 +193,7 @@ </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> - </DataGrid> + </controls:MultiSelectDataGrid> </Grid> </DockPanel> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config index 7994d1504..c3235a090 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="CommonServiceLocator" version="1.3" targetFramework="net46" /> + <package id="DeepEqual" version="1.6.0.0" targetFramework="net46" /> <package id="EntityFramework" version="6.0.0" targetFramework="net46" /> <package id="Google.Protobuf" version="3.4.1" targetFramework="net46" /> <package id="MahApps.Metro" version="1.5.0" targetFramework="net46" /> diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs index ad91e8117..fc05a1259 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs @@ -57,6 +57,8 @@ namespace Tango.CodeGeneration /// </summary> public String Type { get; set; } + public bool XmlIgnore { get; set; } + /// <summary> /// Gets or sets the description. /// </summary> diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index 0c81791cd..4cdb1d6fa 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -20,6 +22,8 @@ namespace Tango.Integration.Observables /// </summary> @(!prop.Construct && !prop.Complex ? "[Column(\"" + prop.FieldName + "\")]" : "") @(prop.IsForeignKey ? "[ForeignKey(\"" + prop.ForeignKeyName + "\")]" : "") + @(prop.XmlIgnore ? "[XmlIgnore]" : "") + @(prop.XmlIgnore ? "[JsonIgnore]" : "") public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name) { get { return _@(prop.Name.ToLower()); } diff --git a/Software/Visual_Studio/Tango.Core/IParameterized.cs b/Software/Visual_Studio/Tango.Core/IParameterized.cs index e6f36b4c6..242d9a147 100644 --- a/Software/Visual_Studio/Tango.Core/IParameterized.cs +++ b/Software/Visual_Studio/Tango.Core/IParameterized.cs @@ -4,6 +4,7 @@ using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Xml.Serialization; namespace Tango.Core { @@ -16,6 +17,7 @@ namespace Tango.Core /// Gets a bind-able observable collection of the component properties. /// </summary> [ParameterIgnore] + [XmlIgnore] ReadOnlyObservableCollection<ParameterItem> Parameters { get; set; } } } diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ActionType.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ActionType.cs index b3f5c7e1f..ee6767699 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ActionType.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ActionType.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Address.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Address.cs index f736572df..1617e325b 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Address.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Address.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationDisplayPanelVersion.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationDisplayPanelVersion.cs index dd3c3ce14..e508c6ce1 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationDisplayPanelVersion.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationDisplayPanelVersion.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationFirmwareVersion.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationFirmwareVersion.cs index 8d5868e2a..18b263675 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationFirmwareVersion.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationOsVersion.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationOsVersion.cs index 844a4ac99..c3c770b6a 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationOsVersion.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationOsVersion.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationVersion.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationVersion.cs index 23e530e9b..91463284b 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationVersion.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ApplicationVersion.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/BrushStop.cs index c41547588..8c9a1120f 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/BrushStop.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("SEGMENT_GUID")] [ForeignKey("Segment")] + public String SegmentGuid { get @@ -38,6 +41,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("COLOR_SPACE_GUID")] [ForeignKey("ColorSpace")] + public String ColorSpaceGuid { get @@ -457,6 +461,7 @@ namespace Tango.Integration.Observables /// Gets or sets the brushstop panton guid. /// </summary> [Column("PANTON_GUID")] + public String PantonGuid { get @@ -476,6 +481,8 @@ namespace Tango.Integration.Observables /// Gets or sets the brushstop color spaces. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual ColorSpace ColorSpace { get @@ -495,6 +502,8 @@ namespace Tango.Integration.Observables /// Gets or sets the brushstop segment. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Segment Segment { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/CartridgeType.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/CartridgeType.cs index 532f6416d..648993cfe 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/CartridgeType.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/CartridgeType.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Cat.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Cat.cs index 80d47a247..a9aa55890 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Cat.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Cat.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -38,6 +40,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("LIQUID_TYPE_GUID")] [ForeignKey("LiquidType")] + public String LiquidTypeGuid { get @@ -58,6 +61,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("RML_GUID")] [ForeignKey("Rml")] + public String RmlGuid { get @@ -97,6 +101,8 @@ namespace Tango.Integration.Observables /// Gets or sets the cat liquid types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual LiquidType LiquidType { get @@ -116,6 +122,8 @@ namespace Tango.Integration.Observables /// Gets or sets the cat rml. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Rml Rml { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Cct.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Cct.cs index 069e1df1d..9355d7b24 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Cct.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Cct.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -158,6 +160,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("RML_GUID")] [ForeignKey("Rml")] + public String RmlGuid { get @@ -177,6 +180,8 @@ namespace Tango.Integration.Observables /// Gets or sets the cct rml. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Rml Rml { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorSpace.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorSpace.cs index 79f1b5afd..b473fdecc 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorSpace.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorSpace.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Configuration.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Configuration.cs index fb993a36e..78470f2ff 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Configuration.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Configuration.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -58,6 +60,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("APPLICATION_VERSION_GUID")] [ForeignKey("ApplicationVersion")] + public String ApplicationVersionGuid { get @@ -78,6 +81,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("APPLICATION_OS_VERSION_GUID")] [ForeignKey("ApplicationOsVersion")] + public String ApplicationOsVersionGuid { get @@ -98,6 +102,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("APPLICATION_FIRMWARE_VERSION_GUID")] [ForeignKey("ApplicationFirmwareVersion")] + public String ApplicationFirmwareVersionGuid { get @@ -118,6 +123,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("APPLICATION_DISPLAY_PANEL_VERSION_GUID")] [ForeignKey("ApplicationDisplayPanelVersion")] + public String ApplicationDisplayPanelVersionGuid { get @@ -138,6 +144,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("EMBEDDED_FIRMWARE_VERSION_GUID")] [ForeignKey("EmbeddedFirmwareVersion")] + public String EmbeddedFirmwareVersionGuid { get @@ -158,6 +165,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("EMBEDDED_SOFTWARE_VERSION_GUID")] [ForeignKey("EmbeddedSoftwareVersion")] + public String EmbeddedSoftwareVersionGuid { get @@ -178,6 +186,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("HARDWARE_VERSION_GUID")] [ForeignKey("HardwareVersion")] + public String HardwareVersionGuid { get @@ -197,6 +206,8 @@ namespace Tango.Integration.Observables /// Gets or sets the configuration application display panel versions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual ApplicationDisplayPanelVersion ApplicationDisplayPanelVersion { get @@ -216,6 +227,8 @@ namespace Tango.Integration.Observables /// Gets or sets the configuration application firmware versions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual ApplicationFirmwareVersion ApplicationFirmwareVersion { get @@ -235,6 +248,8 @@ namespace Tango.Integration.Observables /// Gets or sets the configuration application os versions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual ApplicationOsVersion ApplicationOsVersion { get @@ -254,6 +269,8 @@ namespace Tango.Integration.Observables /// Gets or sets the configuration application versions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual ApplicationVersion ApplicationVersion { get @@ -273,6 +290,8 @@ namespace Tango.Integration.Observables /// Gets or sets the configuration embedded firmware versions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual EmbeddedFirmwareVersion EmbeddedFirmwareVersion { get @@ -292,6 +311,8 @@ namespace Tango.Integration.Observables /// Gets or sets the configuration embedded software versions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual EmbeddedSoftwareVersion EmbeddedSoftwareVersion { get @@ -311,6 +332,8 @@ namespace Tango.Integration.Observables /// Gets or sets the configuration hardware versions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual HardwareVersion HardwareVersion { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Contact.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Contact.cs index 78c44ba7f..b56ca2044 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Contact.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Contact.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/DispenserType.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/DispenserType.cs index 12be3f9eb..2402c2aba 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/DispenserType.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/DispenserType.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/EmbeddedFirmwareVersion.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/EmbeddedFirmwareVersion.cs index bff60e190..13ab466ca 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/EmbeddedFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/EmbeddedFirmwareVersion.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/EmbeddedSoftwareVersion.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/EmbeddedSoftwareVersion.cs index 1f39794cf..c433b0656 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/EmbeddedSoftwareVersion.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/EmbeddedSoftwareVersion.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/EventType.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/EventType.cs index 26e6c4ab4..023a33863 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/EventType.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/EventType.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/EventTypesAction.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/EventTypesAction.cs index 77da6e91b..94555000d 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/EventTypesAction.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/EventTypesAction.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("EVENT_TYPE_GUID")] [ForeignKey("EventType")] + public String EventTypeGuid { get @@ -38,6 +41,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("ACTION_TYPE_GUID")] [ForeignKey("ActionType")] + public String ActionTypeGuid { get @@ -57,6 +61,8 @@ namespace Tango.Integration.Observables /// Gets or sets the eventtypesaction action types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual ActionType ActionType { get @@ -76,6 +82,8 @@ namespace Tango.Integration.Observables /// Gets or sets the eventtypesaction event types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual EventType EventType { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/FiberShape.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/FiberShape.cs index 088561b83..c690e65da 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/FiberShape.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/FiberShape.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/FiberSynth.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/FiberSynth.cs index d5f1eaa0b..42d5b5cdc 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/FiberSynth.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/FiberSynth.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/HardwareVersion.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/HardwareVersion.cs index 033623160..2b892a1c1 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/HardwareVersion.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/IdsPack.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/IdsPack.cs index 6029fbf00..e708a33e7 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/IdsPack.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/IdsPack.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("CONFIGURATION_GUID")] [ForeignKey("Configuration")] + public String ConfigurationGuid { get @@ -38,6 +41,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("DISPENSER_TYPE_GUID")] [ForeignKey("DispenserType")] + public String DispenserTypeGuid { get @@ -58,6 +62,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("LIQUID_TYPE_GUID")] [ForeignKey("LiquidType")] + public String LiquidTypeGuid { get @@ -78,6 +83,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("CARTRIDGE_TYPE_GUID")] [ForeignKey("CartridgeType")] + public String CartridgeTypeGuid { get @@ -98,6 +104,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MID_TANK_TYPE_GUID")] [ForeignKey("MidTankType")] + public String MidTankTypeGuid { get @@ -158,6 +165,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("IDS_PACK_FORMULA_GUID")] [ForeignKey("IdsPackFormula")] + public String IdsPackFormulaGuid { get @@ -177,6 +185,8 @@ namespace Tango.Integration.Observables /// Gets or sets the idspack cartridge types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual CartridgeType CartridgeType { get @@ -196,6 +206,8 @@ namespace Tango.Integration.Observables /// Gets or sets the idspack configuration. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Configuration Configuration { get @@ -215,6 +227,8 @@ namespace Tango.Integration.Observables /// Gets or sets the idspack dispenser types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual DispenserType DispenserType { get @@ -234,6 +248,8 @@ namespace Tango.Integration.Observables /// Gets or sets the idspack ids pack formulas. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual IdsPackFormula IdsPackFormula { get @@ -253,6 +269,8 @@ namespace Tango.Integration.Observables /// Gets or sets the idspack liquid types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual LiquidType LiquidType { get @@ -272,6 +290,8 @@ namespace Tango.Integration.Observables /// Gets or sets the idspack mid tank types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual MidTankType MidTankType { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/IdsPackFormula.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/IdsPackFormula.cs index 76be59dca..dbde816e9 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/IdsPackFormula.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/IdsPackFormula.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Job.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Job.cs index 8b26a62d9..d95d44c4c 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Job.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -58,6 +60,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MACHINE_GUID")] [ForeignKey("Machine")] + public String MachineGuid { get @@ -78,6 +81,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("USER_GUID")] [ForeignKey("User")] + public String UserGuid { get @@ -98,6 +102,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("RML_GUID")] [ForeignKey("Rml")] + public String RmlGuid { get @@ -118,6 +123,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("WINDING_METHOD_GUID")] [ForeignKey("WindingMethod")] + public String WindingMethodGuid { get @@ -276,6 +282,8 @@ namespace Tango.Integration.Observables /// Gets or sets the job machine. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Machine Machine { get @@ -295,6 +303,8 @@ namespace Tango.Integration.Observables /// Gets or sets the job rml. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Rml Rml { get @@ -314,6 +324,8 @@ namespace Tango.Integration.Observables /// Gets or sets the job user. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual User User { get @@ -333,6 +345,8 @@ namespace Tango.Integration.Observables /// Gets or sets the job winding methods. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual WindingMethod WindingMethod { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/JobRun.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/JobRun.cs index 2d795b0b5..40922aa61 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/JobRun.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/JobRun.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("JOB_GUID")] [ForeignKey("Job")] + public String JobGuid { get @@ -97,6 +100,8 @@ namespace Tango.Integration.Observables /// Gets or sets the jobrun job. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Job Job { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/LinearMassDensityUnit.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/LinearMassDensityUnit.cs index 6fcf7e0f3..73f5f0f68 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/LinearMassDensityUnit.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/LinearMassDensityUnit.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/LiquidType.cs index 8c885d099..afde6e7e5 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/LiquidType.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/LiquidType.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/LiquidTypesRml.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/LiquidTypesRml.cs index 4002afa64..09e9c80a5 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/LiquidTypesRml.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/LiquidTypesRml.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("LIQUID_TYPE_GUID")] [ForeignKey("LiquidType")] + public String LiquidTypeGuid { get @@ -38,6 +41,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("RML_GUID")] [ForeignKey("Rml")] + public String RmlGuid { get @@ -77,6 +81,8 @@ namespace Tango.Integration.Observables /// Gets or sets the liquidtypesrml liquid types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual LiquidType LiquidType { get @@ -96,6 +102,8 @@ namespace Tango.Integration.Observables /// Gets or sets the liquidtypesrml rml. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Rml Rml { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Machine.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Machine.cs index fea07023f..412c72a01 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Machine.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Machine.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -78,6 +80,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("ORGANIZATION_GUID")] [ForeignKey("Organization")] + public String OrganizationGuid { get @@ -98,6 +101,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MACHINE_VERSION_GUID")] [ForeignKey("MachineVersion")] + public String MachineVersionGuid { get @@ -118,6 +122,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("CONFIGURATION_GUID")] [ForeignKey("Configuration")] + public String ConfigurationGuid { get @@ -137,6 +142,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machine configuration. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Configuration Configuration { get @@ -175,6 +182,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machine machine versions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual MachineVersion MachineVersion { get @@ -232,6 +241,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machine organization. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Organization Organization { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachineVersion.cs index fc7184be1..dedd1c628 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachineVersion.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -58,6 +60,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("DEFAULT_CONFIGURATION_GUID")] [ForeignKey("DefaultConfiguration")] + public String DefaultConfigurationGuid { get @@ -77,6 +80,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machineversion configuration. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Configuration DefaultConfiguration { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachinesConfiguration.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachinesConfiguration.cs index de79ac7af..68db1ba8f 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachinesConfiguration.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachinesConfiguration.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MACHINE_GUID")] [ForeignKey("Machine")] + public String MachineGuid { get @@ -38,6 +41,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("CONFIGURATION_GUID")] [ForeignKey("Configuration")] + public String ConfigurationGuid { get @@ -57,6 +61,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machinesconfiguration configuration. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Configuration Configuration { get @@ -76,6 +82,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machinesconfiguration machine. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Machine Machine { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachinesEvent.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachinesEvent.cs index cc4ad8961..cb4727974 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachinesEvent.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MachinesEvent.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MACHINE_GUID")] [ForeignKey("Machine")] + public String MachineGuid { get @@ -38,6 +41,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("EVENT_TYPE_GUID")] [ForeignKey("EventType")] + public String EventTypeGuid { get @@ -58,6 +62,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("USER_GUID")] [ForeignKey("User")] + public String UserGuid { get @@ -117,6 +122,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machinesevent event types. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual EventType EventType { get @@ -136,6 +143,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machinesevent machine. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Machine Machine { get @@ -155,6 +164,8 @@ namespace Tango.Integration.Observables /// Gets or sets the machinesevent user. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual User User { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaColor.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaColor.cs index 36e4108e5..eb05357ad 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaColor.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaColor.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaCondition.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaCondition.cs index 936c0170a..558296d4b 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaCondition.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaCondition.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaMaterial.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaMaterial.cs index beb27e9ea..44571b269 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaMaterial.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaMaterial.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaPurpos.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaPurpos.cs index 43448504a..cfc3166f7 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaPurpos.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MediaPurpos.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MidTankType.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MidTankType.cs index a68d18241..315aa12b1 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/MidTankType.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/MidTankType.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Organization.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Organization.cs index ca43cf4ed..014e8bc12 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Organization.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Organization.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -38,6 +40,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("CONTACT_GUID")] [ForeignKey("Contact")] + public String ContactGuid { get @@ -58,6 +61,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("ADDRESS_GUID")] [ForeignKey("Address")] + public String AddressGuid { get @@ -77,6 +81,8 @@ namespace Tango.Integration.Observables /// Gets or sets the organization address. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Address Address { get @@ -96,6 +102,8 @@ namespace Tango.Integration.Observables /// Gets or sets the organization contact. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Contact Contact { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Permission.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Permission.cs index c9c21d7ac..71fb57280 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Permission.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Permission.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ProcessParametersTable.cs index 0d6fd9480..ef41ad360 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ProcessParametersTable.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ProcessParametersTable.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -338,6 +340,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("PROCESS_PARAMETERS_TABLES_GROUP_GUID")] [ForeignKey("ProcessParametersTablesGroup")] + public String ProcessParametersTablesGroupGuid { get @@ -377,6 +380,8 @@ namespace Tango.Integration.Observables /// Gets or sets the processparameterstable process parameters tables groups. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual ProcessParametersTablesGroup ProcessParametersTablesGroup { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ProcessParametersTablesGroup.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ProcessParametersTablesGroup.cs index d553952fc..b3ccadb77 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ProcessParametersTablesGroup.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ProcessParametersTablesGroup.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("RML_GUID")] [ForeignKey("Rml")] + public String RmlGuid { get @@ -116,6 +119,8 @@ namespace Tango.Integration.Observables /// Gets or sets the processparameterstablesgroup rml. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Rml Rml { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Rml.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Rml.cs index 564738b45..e0115182b 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Rml.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -78,6 +80,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MEDIA_MATERIAL_GUID")] [ForeignKey("MediaMaterial")] + public String MediaMaterialGuid { get @@ -98,6 +101,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MEDIA_COLOR_GUID")] [ForeignKey("MediaColor")] + public String MediaColorGuid { get @@ -118,6 +122,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MEDIA_PURPOSE_GUID")] [ForeignKey("MediaPurpose")] + public String MediaPurposeGuid { get @@ -138,6 +143,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("MEDIA_CONDITION_GUID")] [ForeignKey("MediaCondition")] + public String MediaConditionGuid { get @@ -158,6 +164,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("LINEAR_MASS_DENSITY_UNIT_GUID")] [ForeignKey("LinearMassDensityUnit")] + public String LinearMassDensityUnitGuid { get @@ -178,6 +185,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("FIBER_SHAPE_GUID")] [ForeignKey("FiberShape")] + public String FiberShapeGuid { get @@ -198,6 +206,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("FIBER_SYNTH_GUID")] [ForeignKey("FiberSynth")] + public String FiberSynthGuid { get @@ -455,6 +464,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rml fiber shapes. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual FiberShape FiberShape { get @@ -474,6 +485,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rml fiber synths. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual FiberSynth FiberSynth { get @@ -512,6 +525,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rml linear mass density units. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual LinearMassDensityUnit LinearMassDensityUnit { get @@ -550,6 +565,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rml media colors. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual MediaColor MediaColor { get @@ -569,6 +586,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rml media conditions. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual MediaCondition MediaCondition { get @@ -588,6 +607,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rml media materials. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual MediaMaterial MediaMaterial { get @@ -607,6 +628,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rml media purposes. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual MediaPurpos MediaPurpose { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Role.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Role.cs index e1aef394e..69e7084ec 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Role.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Role.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/RolesPermission.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/RolesPermission.cs index 8d81ace27..51db0b1e1 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/RolesPermission.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/RolesPermission.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -18,6 +20,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("ROLE_GUID")] [ForeignKey("Role")] + public String RoleGuid { get @@ -38,6 +41,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("PERMISSION_GUID")] [ForeignKey("Permission")] + public String PermissionGuid { get @@ -57,6 +61,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rolespermission permission. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Permission Permission { get @@ -76,6 +82,8 @@ namespace Tango.Integration.Observables /// Gets or sets the rolespermission role. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Role Role { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Segment.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Segment.cs index e5c3c50c6..7344325f8 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Segment.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Segment.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -38,6 +40,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("JOB_GUID")] [ForeignKey("Job")] + public String JobGuid { get @@ -116,6 +119,8 @@ namespace Tango.Integration.Observables /// Gets or sets the segment job. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Job Job { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/SyncConfiguration.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/SyncConfiguration.cs index de686469b..0f2cc8e64 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/SyncConfiguration.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/SyncConfiguration.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechDispenser.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechDispenser.cs index ae05a2816..17a4ded28 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechDispenser.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechDispenser.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechIo.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechIo.cs index 90ac0de7c..3356b9c43 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechIo.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechIo.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMonitor.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMonitor.cs index 9ea2ad7ba..bc181defe 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMonitor.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMonitor.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs index fd872f636..e6ac4167f 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechValf.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechValf.cs index 32c86032e..5665d7391 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechValf.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechValf.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/User.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/User.cs index bab42d5ff..3acfb8fb6 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/User.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/User.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -78,6 +80,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("ORGANIZATION_GUID")] [ForeignKey("Organization")] + public String OrganizationGuid { get @@ -98,6 +101,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("CONTACT_GUID")] [ForeignKey("Contact")] + public String ContactGuid { get @@ -118,6 +122,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("ADDRESS_GUID")] [ForeignKey("Address")] + public String AddressGuid { get @@ -137,6 +142,8 @@ namespace Tango.Integration.Observables /// Gets or sets the user address. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Address Address { get @@ -156,6 +163,8 @@ namespace Tango.Integration.Observables /// Gets or sets the user contact. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Contact Contact { get @@ -213,6 +222,8 @@ namespace Tango.Integration.Observables /// Gets or sets the user organization. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Organization Organization { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/UsersRole.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/UsersRole.cs index 3b8b2194f..8b274fd33 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/UsersRole.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/UsersRole.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; @@ -38,6 +40,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("USER_GUID")] [ForeignKey("User")] + public String UserGuid { get @@ -58,6 +61,7 @@ namespace Tango.Integration.Observables /// </summary> [Column("ROLE_GUID")] [ForeignKey("Role")] + public String RoleGuid { get @@ -77,6 +81,8 @@ namespace Tango.Integration.Observables /// Gets or sets the usersrole role. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual Role Role { get @@ -96,6 +102,8 @@ namespace Tango.Integration.Observables /// Gets or sets the usersrole user. /// </summary> + [XmlIgnore] + [JsonIgnore] public virtual User User { get diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/WindingMethod.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/WindingMethod.cs index a77a42fdc..de92f2301 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/WindingMethod.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/WindingMethod.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; diff --git a/Software/Visual_Studio/Tango.Integration/Observables/IObservableEntity.cs b/Software/Visual_Studio/Tango.Integration/Observables/IObservableEntity.cs index 0439d57b0..eb16d150d 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/IObservableEntity.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/IObservableEntity.cs @@ -46,6 +46,12 @@ namespace Tango.Integration.Observables void Save(); /// <summary> + /// Saves the changes on this entity to database using the specified context. + /// </summary> + /// <param name="context">The context.</param> + void Save(DbContext context); + + /// <summary> /// Attaches this observable to the proper DbSet. /// </summary> void Attach(); @@ -62,6 +68,12 @@ namespace Tango.Integration.Observables Task SaveAsync(); /// <summary> + /// Saves the changes on this entity to database asynchronously. + /// </summary> + /// <returns></returns> + Task SaveAsync(DbContext context); + + /// <summary> /// Deletes this entity from the database. /// </summary> void Delete(); diff --git a/Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs b/Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs index 92dd88f34..d5b218453 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs @@ -18,6 +18,9 @@ using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; using System.Runtime.CompilerServices; using System.Data.Entity.Core.Objects; +using Tango.Serialization; +using System.Xml.Serialization; +using Newtonsoft.Json; namespace Tango.Integration.Observables { @@ -65,6 +68,7 @@ namespace Tango.Integration.Observables /// Gets or sets the entity last updated data and time. /// </summary> [Column("LAST_UPDATED")] + [JsonIgnore] public DateTime LastUpdated { get { return _lastUpdated; } @@ -76,6 +80,8 @@ namespace Tango.Integration.Observables /// Gets a bind-able observable collection of the component properties. /// </summary> [NotMapped] + [XmlIgnore] + [JsonIgnore] public ReadOnlyObservableCollection<ParameterItem> Parameters { get { return _parameters; } @@ -108,7 +114,7 @@ namespace Tango.Integration.Observables /// </summary> public virtual void Save() { - GetDbContextFromEntity(this).SaveChanges(); + ObservablesEntitiesAdapter.Instance.SaveChanges(); OnSaved(); } @@ -213,7 +219,7 @@ namespace Tango.Integration.Observables return null; } - + protected virtual void OnSaved() { Saved?.Invoke(this, new EventArgs()); @@ -243,6 +249,29 @@ namespace Tango.Integration.Observables return context; } + public virtual T Clone() + { + return (this as T).CloneEntity() as T; + } + + public void Save(DbContext context) + { + context.SaveChanges(); + OnSaved(); + } + + public Task SaveAsync(DbContext context) + { + return Task.Factory.StartNew(() => Save(context)); + } + + public bool CompareUsingJson(T entity) + { + String me = JsonConvert.SerializeObject(this); + String other = JsonConvert.SerializeObject(entity); + return me == other; + } + #region Operator Overloading //public static bool operator ==(ObservableEntity<T> observable1, ObservableEntity<T> observable2) diff --git a/Software/Visual_Studio/Tango.Integration/Printing/BrushStop.cs b/Software/Visual_Studio/Tango.Integration/Printing/BrushStop.cs index 6b328e1fb..ebc77e615 100644 --- a/Software/Visual_Studio/Tango.Integration/Printing/BrushStop.cs +++ b/Software/Visual_Studio/Tango.Integration/Printing/BrushStop.cs @@ -1,4 +1,5 @@ using ColorMine.ColorSpaces; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -29,6 +30,7 @@ namespace Tango.Integration.Observables /// Gets or sets the collection of this brush stop liquid volumes. /// </summary> [NotMapped] + [JsonIgnore] public ObservableCollection<LiquidVolume> LiquidVolumes { get { return _liquidVolumes; } @@ -40,6 +42,7 @@ namespace Tango.Integration.Observables /// Gets or sets the brush stop color. /// </summary> [NotMapped] + [JsonIgnore] public Color Color { get { return _color; } @@ -66,6 +69,7 @@ namespace Tango.Integration.Observables /// Gets a value indicating whether this brush stop is the first one within its segment brush stops. /// </summary> [NotMapped] + [JsonIgnore] public bool IsFirst { get { return Segment.BrushStops.IndexOf(this) == 0; } @@ -75,6 +79,7 @@ namespace Tango.Integration.Observables /// Gets a value indicating whether this brush stop is the last one within its segment brush stops. /// </summary> [NotMapped] + [JsonIgnore] public bool IsLast { get { return Segment.BrushStops.IndexOf(this) == Segment.BrushStops.Count - 1; } @@ -84,6 +89,7 @@ namespace Tango.Integration.Observables /// Gets a value indicating whether this brush stop is not the first nor last within its segment brush stops. /// </summary> [NotMapped] + [JsonIgnore] public bool IsMiddle { get { return !IsFirst && !IsLast; } @@ -93,6 +99,7 @@ namespace Tango.Integration.Observables /// Gets this brush stop offset in meters. /// </summary> [NotMapped] + [JsonIgnore] public double OffsetMeters { get @@ -167,6 +174,20 @@ namespace Tango.Integration.Observables } } + public override BrushStop Clone() + { + BrushStop cloned = base.Clone(); + return cloned; + } + + public BrushStop Clone(Segment segment) + { + BrushStop cloned = base.Clone(); + cloned.Segment = segment; + cloned.SegmentGuid = segment.Guid; + return cloned; + } + #endregion #region Private Methods diff --git a/Software/Visual_Studio/Tango.Integration/Printing/Job.cs b/Software/Visual_Studio/Tango.Integration/Printing/Job.cs index 1b479b5b9..1cc4865f2 100644 --- a/Software/Visual_Studio/Tango.Integration/Printing/Job.cs +++ b/Software/Visual_Studio/Tango.Integration/Printing/Job.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; @@ -36,6 +37,7 @@ namespace Tango.Integration.Observables /// Gets the total job segments length. /// </summary> [NotMapped] + [JsonIgnore] public double Length { get { return Segments.Sum(x => x.Length) + (EnableInterSegment ? (InterSegmentLength * (Segments.Count > 0 ? Segments.Count - 1 : Segments.Count)) : 0); } @@ -133,8 +135,24 @@ namespace Tango.Integration.Observables base.Save(); } - #endregion + public override Job Clone() + { + Job cloned = base.Clone(); + + cloned.CreationDate = DateTime.UtcNow; + cloned.LastRun = null; + cloned.Segments = Segments.Select(x => x.Clone(cloned)).ToObservableCollection(); + + return cloned; + } + public override void DefferedDelete() + { + Segments.ToList().ForEach(x => x.DefferedDelete()); + Segments.Clear(); + base.DefferedDelete(); + } + #endregion } } diff --git a/Software/Visual_Studio/Tango.Integration/Printing/LiquidVolume.cs b/Software/Visual_Studio/Tango.Integration/Printing/LiquidVolume.cs index f3e4df309..5c5b2bcb5 100644 --- a/Software/Visual_Studio/Tango.Integration/Printing/LiquidVolume.cs +++ b/Software/Visual_Studio/Tango.Integration/Printing/LiquidVolume.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -12,6 +13,7 @@ namespace Tango.Integration.Printing public class LiquidVolume : ExtendedObject { private BrushStop _brushStop; + [JsonIgnore] public BrushStop BrushStop { get { return _brushStop; } @@ -19,7 +21,7 @@ namespace Tango.Integration.Printing } private Configuration _configuration; - + [JsonIgnore] public Configuration Configuration { get { return _configuration; } @@ -27,6 +29,7 @@ namespace Tango.Integration.Printing } private IdsPack _idsPack; + [JsonIgnore] public IdsPack IdsPack { get { return _idsPack; } @@ -34,6 +37,7 @@ namespace Tango.Integration.Printing } private Rml _rml; + [JsonIgnore] public Rml RML { get { return _rml; } @@ -41,6 +45,7 @@ namespace Tango.Integration.Printing } private ProcessParametersTable _processParametersTable; + [JsonIgnore] public ProcessParametersTable ProcessParametersTable { get { return _processParametersTable; } @@ -60,7 +65,7 @@ namespace Tango.Integration.Printing } private DispenserStepDivisions _dispenserStepDivision; - + [JsonIgnore] public DispenserStepDivisions DispenserStepDivision { get { return _dispenserStepDivision; } @@ -89,6 +94,11 @@ namespace Tango.Integration.Printing RaisePropertyChanged(nameof(Volume)); } + public LiquidVolume() //For XML Serialization.. + { + + } + public LiquidVolume(Configuration configuration, IdsPack idsPack, Rml rml, ProcessParametersTable processParametersTable, BrushStop brushStop) { ProcessParametersTable = processParametersTable; @@ -105,6 +115,7 @@ namespace Tango.Integration.Printing Invalidate(); } + [JsonIgnore] public double LiquidMaxNanoliterPerCentimeter { get @@ -129,6 +140,7 @@ namespace Tango.Integration.Printing } } + [JsonIgnore] public double NanoliterPerSecond { get @@ -137,6 +149,7 @@ namespace Tango.Integration.Printing } } + [JsonIgnore] public double NanoliterPerCentimeter { get @@ -145,6 +158,7 @@ namespace Tango.Integration.Printing } } + [JsonIgnore] public double PulsePerSecond { get diff --git a/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs b/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs index 9d0edc092..6213240ed 100644 --- a/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs +++ b/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; @@ -21,6 +22,7 @@ namespace Tango.Integration.Observables private TimeSpan _remainingTime; [NotMapped] + [JsonIgnore] public TimeSpan RemainingTime { get { return _remainingTime; } @@ -29,6 +31,7 @@ namespace Tango.Integration.Observables private bool _started; [NotMapped] + [JsonIgnore] public bool Started { get { return _started; } @@ -37,12 +40,39 @@ namespace Tango.Integration.Observables private bool _completed; [NotMapped] + [JsonIgnore] public bool Completed { get { return _completed; } set { _completed = value; RaisePropertyChangedAuto(); } } + public override Segment Clone() + { + Segment cloned = base.Clone(); + + cloned.BrushStops = BrushStops.Select(x => x.Clone()).ToObservableCollection(); + + return cloned; + } + + public Segment Clone(Job job) + { + Segment cloned = base.Clone(); + cloned.BrushStops = BrushStops.Select(x => x.Clone(cloned)).ToObservableCollection(); + + cloned.Job = job; + cloned.JobGuid = job.Guid; + + return cloned; + } + + public override void DefferedDelete() + { + BrushStops.ToList().ForEach(x => x.DefferedDelete()); + BrushStops.Clear(); + base.DefferedDelete(); + } } } diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 31da09264..47188ea02 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -39,6 +39,9 @@ <Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath> </Reference> + <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> <Reference Include="PresentationCore" /> <Reference Include="PresentationFramework" /> <Reference Include="System" /> diff --git a/Software/Visual_Studio/Tango.Integration/packages.config b/Software/Visual_Studio/Tango.Integration/packages.config index 7abb06657..c2f72c92d 100644 --- a/Software/Visual_Studio/Tango.Integration/packages.config +++ b/Software/Visual_Studio/Tango.Integration/packages.config @@ -2,6 +2,7 @@ <packages> <package id="EntityFramework" version="6.0.0" targetFramework="net46" /> <package id="Google.Protobuf" version="3.4.1" targetFramework="net46" /> + <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" /> <package id="System.Reactive" version="3.1.1" targetFramework="net46" /> <package id="System.Reactive.Core" version="3.1.1" targetFramework="net46" /> <package id="System.Reactive.Interfaces" version="3.1.1" targetFramework="net46" /> diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectDataGrid.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectDataGrid.cs new file mode 100644 index 000000000..0f3032e01 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectDataGrid.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace Tango.SharedUI.Controls +{ + public class MultiSelectDataGrid : DataGrid + { + public IList SelectedItemsList + { + get { return (IList)GetValue(SelectedItemsListProperty); } + set { SetValue(SelectedItemsListProperty, value); } + } + + public static readonly DependencyProperty SelectedItemsListProperty = + DependencyProperty.Register(nameof(SelectedItemsList), typeof(IList), typeof(MultiSelectDataGrid), new PropertyMetadata(null)); + + public MultiSelectDataGrid() { } + + protected override void OnSelectionChanged(SelectionChangedEventArgs e) + { + base.OnSelectionChanged(e); + + SelectedItemsList.Clear(); + + foreach (var item in SelectedItems) + { + SelectedItemsList.Add(item); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectListBox.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectListBox.cs new file mode 100644 index 000000000..ca45540fa --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectListBox.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace Tango.SharedUI.Controls +{ + public class MultiSelectListBox : ListBox + { + public IList SelectedItemsList + { + get { return (IList)GetValue(SelectedItemsListProperty); } + set { SetValue(SelectedItemsListProperty, value); } + } + + public static readonly DependencyProperty SelectedItemsListProperty = + DependencyProperty.Register(nameof(SelectedItemsList), typeof(IList), typeof(MultiSelectListBox), new PropertyMetadata(null)); + + public MultiSelectListBox() { } + + protected override void OnSelectionChanged(SelectionChangedEventArgs e) + { + base.OnSelectionChanged(e); + + SelectedItemsList.Clear(); + + foreach (var item in SelectedItems) + { + SelectedItemsList.Add(item); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 0993f61fd..e7f53ad7a 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -78,6 +78,8 @@ <Compile Include="Controls\HiveControl.xaml.cs"> <DependentUpon>HiveControl.xaml</DependentUpon> </Compile> + <Compile Include="Controls\MultiSelectDataGrid.cs" /> + <Compile Include="Controls\MultiSelectListBox.cs" /> <Compile Include="Controls\MultiTransitionControl.xaml.cs"> <DependentUpon>MultiTransitionControl.xaml</DependentUpon> </Compile> diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs index cac1ac156..2522b7731 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs @@ -65,6 +65,7 @@ namespace Tango.DBObservablesGenerator.CLI { codeField.Type = DalNameToStandardName(field.PropertyType.Name).SingularizeMVC(); codeField.Name = codeField.Type; + codeField.XmlIgnore = true; var fk = foreignKeys.SingleOrDefault(x => x.Contains(codeField.Name)); |
