diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-08-04 15:27:45 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-08-04 15:27:45 +0300 |
| commit | df9efa378c7741e325b0de775cf7b33634b9f8b3 (patch) | |
| tree | 6b21faff08f9fbbf1e6e158ccab4ea3f81b60371 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | db9119d86fa9e2efd2c3dfab8ac2c49c2ee4da70 (diff) | |
| download | Tango-df9efa378c7741e325b0de775cf7b33634b9f8b3.tar.gz Tango-df9efa378c7741e325b0de775cf7b33634b9f8b3.zip | |
Implemented Blowers, Break Sensors in Machine Versions Module.
Removed all unnecessary Observable entities extension methods.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
7 files changed, 219 insertions, 15 deletions
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 569359066..85480a4b8 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 @@ -979,7 +979,7 @@ namespace Tango.MachineStudio.Developer.ViewModels if (SelectedGroupHistory != null) { LogManager.Log(String.Format("Parameters group {0} selected from history.", SelectedGroupHistory.Name)); - RmlProcessParametersTableGroup = SelectedGroupHistory.CloneGroup(); + RmlProcessParametersTableGroup = SelectedGroupHistory.Clone(); } } @@ -1329,7 +1329,7 @@ namespace Tango.MachineStudio.Developer.ViewModels if (RmlProcessParametersTableGroup != null) { - RmlProcessParametersTableGroup = RmlProcessParametersTableGroup.CloneGroup(); + RmlProcessParametersTableGroup = RmlProcessParametersTableGroup.Clone(); RmlProcessParametersTableGroup.ProcessParametersTables = RmlProcessParametersTableGroup.ProcessParametersTables.OrderBy(x => x.TableIndex).ToObservableCollection(); } @@ -1385,7 +1385,7 @@ namespace Tango.MachineStudio.Developer.ViewModels foreach (var table in RmlProcessParametersTableGroup.ProcessParametersTables) { - var newTable = table.CloneEntity(); + var newTable = table.Clone(); newTable.TableIndex = index++; newTable.ProcessParametersTablesGroup = group; tables.Add(newTable); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Images/blower.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Images/blower.png Binary files differnew file mode 100644 index 000000000..a3797b514 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Images/blower.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Images/break.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Images/break.png Binary files differnew file mode 100644 index 000000000..67bd5982e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Images/break.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj index 270915bd2..13f075684 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj @@ -166,10 +166,16 @@ <ItemGroup> <Resource Include="Images\speed.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\break.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\blower.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs index f91badebe..3dd4e62a3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs @@ -96,6 +96,34 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels set { _selectedSpeedSensorTypes = value; RaisePropertyChangedAuto(); } } + private SelectedObjectCollection<HardwareBlowerType> _blowerTypes; + public SelectedObjectCollection<HardwareBlowerType> BlowerTypes + { + get { return _blowerTypes; } + set { _blowerTypes = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection<HardwareBlowerType> _selectedBlowerTypes; + public ObservableCollection<HardwareBlowerType> SelectedBlowerTypes + { + get { return _selectedBlowerTypes; } + set { _selectedBlowerTypes = value; RaisePropertyChangedAuto(); } + } + + private SelectedObjectCollection<HardwareBreakSensorType> _breakSensorTypes; + public SelectedObjectCollection<HardwareBreakSensorType> BreakSensorTypes + { + get { return _breakSensorTypes; } + set { _breakSensorTypes = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection<HardwareBreakSensorType> _selectedBreakSensorTypes; + public ObservableCollection<HardwareBreakSensorType> SelectedBreakSensorTypes + { + get { return _selectedBreakSensorTypes; } + set { _selectedBreakSensorTypes = value; RaisePropertyChangedAuto(); } + } + private HardwareVersion _selectedVersion; public HardwareVersion SelectedVersion { @@ -159,7 +187,7 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels CurrentVersion = new HardwareVersion(); CreateTemplate(CurrentVersion); - CopyParametersCommand = new RelayCommand(CopyParameters,(x) => SelectedVersion != null && SelectedHardwareObjectType != null); + CopyParametersCommand = new RelayCommand(CopyParameters, (x) => SelectedVersion != null && SelectedHardwareObjectType != null); CloneCommand = new RelayCommand(CloneCurrentVersion, () => SelectedVersion != null); } @@ -188,6 +216,14 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels { target = CurrentVersion.HardwareSpeedSensors.SingleOrDefault(x => x.HardwareSpeedSensorType == source); } + else if (source is HardwareBlowerType) + { + target = CurrentVersion.HardwareBlowers.SingleOrDefault(x => x.HardwareBlowerType == source); + } + else if (source is HardwareBreakSensorType) + { + target = CurrentVersion.HardwareBreakSensors.SingleOrDefault(x => x.HardwareBreakSensorType == source); + } target.MapPrimitivesTo(SelectedHardwareObject); } @@ -276,6 +312,38 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels SelectedHardwareObject = hardwareObj; } } + else if (SelectedHardwareObjectType is SelectedObject<HardwareBlowerType>) + { + var type = (SelectedHardwareObjectType as SelectedObject<HardwareBlowerType>).Data; + var hardwareObj = CurrentVersion.HardwareBlowers.SingleOrDefault(x => x.HardwareBlowerType == type); + + if (hardwareObj != null) + { + SelectedHardwareObject = hardwareObj; + } + else + { + hardwareObj = new HardwareBlower() { HardwareBlowerType = type }; + CurrentVersion.HardwareBlowers.Add(hardwareObj); + SelectedHardwareObject = hardwareObj; + } + } + else if (SelectedHardwareObjectType is SelectedObject<HardwareBreakSensorType>) + { + var type = (SelectedHardwareObjectType as SelectedObject<HardwareBreakSensorType>).Data; + var hardwareObj = CurrentVersion.HardwareBreakSensors.SingleOrDefault(x => x.HardwareBreakSensorType == type); + + if (hardwareObj != null) + { + SelectedHardwareObject = hardwareObj; + } + else + { + hardwareObj = new HardwareBreakSensor() { HardwareBreakSensorType = type }; + CurrentVersion.HardwareBreakSensors.Add(hardwareObj); + SelectedHardwareObject = hardwareObj; + } + } } } @@ -288,6 +356,8 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels SelectedPidControlTypes = new ObservableCollection<HardwarePidControlType>(); SelectedWinderTypes = new ObservableCollection<HardwareWinderType>(); SelectedSpeedSensorTypes = new ObservableCollection<HardwareSpeedSensorType>(); + SelectedBlowerTypes = new ObservableCollection<HardwareBlowerType>(); + SelectedBreakSensorTypes = new ObservableCollection<HardwareBreakSensorType>(); } else { @@ -296,6 +366,8 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels SelectedPidControlTypes = version.HardwarePidControls.Select(x => x.HardwarePidControlType).ToObservableCollection(); SelectedWinderTypes = version.HardwareWinders.Select(x => x.HardwareWinderType).ToObservableCollection(); SelectedSpeedSensorTypes = version.HardwareSpeedSensors.Select(x => x.HardwareSpeedSensorType).ToObservableCollection(); + SelectedBlowerTypes = version.HardwareBlowers.Select(x => x.HardwareBlowerType).ToObservableCollection(); + SelectedBreakSensorTypes = version.HardwareBreakSensors.Select(x => x.HardwareBreakSensorType).ToObservableCollection(); } MotorTypes = new SelectedObjectCollection<HardwareMotorType>(Adapter.HardwareMotorTypes, SelectedMotorTypes); @@ -303,6 +375,8 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels PidControlTypes = new SelectedObjectCollection<HardwarePidControlType>(Adapter.HardwarePidControlTypes, SelectedPidControlTypes); WinderTypes = new SelectedObjectCollection<HardwareWinderType>(Adapter.HardwareWinderTypes, SelectedWinderTypes); SpeedSensorTypes = new SelectedObjectCollection<HardwareSpeedSensorType>(Adapter.HardwareSpeedSensorTypes, SelectedSpeedSensorTypes); + BlowerTypes = new SelectedObjectCollection<HardwareBlowerType>(Adapter.HardwareBlowerTypes, SelectedBlowerTypes); + BreakSensorTypes = new SelectedObjectCollection<HardwareBreakSensorType>(Adapter.HardwareBreakSensorTypes, SelectedBreakSensorTypes); } private void OnSelectedVersionChanged() @@ -363,6 +437,8 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels realVersion.HardwarePidControls.ToList().Where(x => !SelectedPidControlTypes.Contains(x.HardwarePidControlType)).ToList().ForEach(x => realVersion.HardwarePidControls.Remove(x)); realVersion.HardwareWinders.ToList().Where(x => !SelectedWinderTypes.Contains(x.HardwareWinderType)).ToList().ForEach(x => realVersion.HardwareWinders.Remove(x)); realVersion.HardwareSpeedSensors.ToList().Where(x => !SelectedSpeedSensorTypes.Contains(x.HardwareSpeedSensorType)).ToList().ForEach(x => realVersion.HardwareSpeedSensors.Remove(x)); + realVersion.HardwareBlowers.ToList().Where(x => !SelectedBlowerTypes.Contains(x.HardwareBlowerType)).ToList().ForEach(x => realVersion.HardwareBlowers.Remove(x)); + realVersion.HardwareBreakSensors.ToList().Where(x => !SelectedBreakSensorTypes.Contains(x.HardwareBreakSensorType)).ToList().ForEach(x => realVersion.HardwareBreakSensors.Remove(x)); } else { @@ -376,12 +452,16 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels realVersion.HardwarePidControls.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); realVersion.HardwareWinders.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); realVersion.HardwareSpeedSensors.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); + realVersion.HardwareBlowers.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); + realVersion.HardwareBreakSensors.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); realVersion.HardwareDancers.Clear(); realVersion.HardwareMotors.Clear(); realVersion.HardwarePidControls.Clear(); realVersion.HardwareWinders.Clear(); realVersion.HardwareSpeedSensors.Clear(); + realVersion.HardwareBlowers.Clear(); + realVersion.HardwareBreakSensors.Clear(); foreach (var type in SelectedDancerTypes) { @@ -472,6 +552,42 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels }); } } + + foreach (var type in SelectedBlowerTypes) + { + var item = CurrentVersion.HardwareBlowers.SingleOrDefault(x => x.HardwareBlowerType == type); + if (item != null) + { + item.HardwareVersionGuid = realVersion.Guid; + realVersion.HardwareBlowers.Add(item); + } + else + { + realVersion.HardwareBlowers.Add(new HardwareBlower() + { + HardwareVersionGuid = realVersion.Guid, + HardwareBlowerType = type + }); + } + } + + foreach (var type in SelectedBreakSensorTypes) + { + var item = CurrentVersion.HardwareBreakSensors.SingleOrDefault(x => x.HardwareBreakSensorType == type); + if (item != null) + { + item.HardwareVersionGuid = realVersion.Guid; + realVersion.HardwareBreakSensors.Add(item); + } + else + { + realVersion.HardwareBreakSensors.Add(new HardwareBreakSensor() + { + HardwareVersionGuid = realVersion.Guid, + HardwareBreakSensorType = type + }); + } + } } @@ -499,7 +615,7 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels { using (_notification.PushTaskItem("Cloning hardware configuration...")) { - await Task.Factory.StartNew(() => + await Task.Factory.StartNew(() => { var realVersion = CurrentVersion.Clone(); realVersion.Name = name; @@ -510,18 +626,24 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels realVersion.HardwarePidControls.ToList().Where(x => !SelectedPidControlTypes.Contains(x.HardwarePidControlType)).ToList().ForEach(x => realVersion.HardwarePidControls.Remove(x)); realVersion.HardwareWinders.ToList().Where(x => !SelectedWinderTypes.Contains(x.HardwareWinderType)).ToList().ForEach(x => realVersion.HardwareWinders.Remove(x)); realVersion.HardwareSpeedSensors.ToList().Where(x => !SelectedSpeedSensorTypes.Contains(x.HardwareSpeedSensorType)).ToList().ForEach(x => realVersion.HardwareSpeedSensors.Remove(x)); + realVersion.HardwareBlowers.ToList().Where(x => !SelectedBlowerTypes.Contains(x.HardwareBlowerType)).ToList().ForEach(x => realVersion.HardwareBlowers.Remove(x)); + realVersion.HardwareBreakSensors.ToList().Where(x => !SelectedBreakSensorTypes.Contains(x.HardwareBreakSensorType)).ToList().ForEach(x => realVersion.HardwareBreakSensors.Remove(x)); realVersion.HardwareMotors.ToList().ForEach(x => x.HardwareVersionGuid = realVersion.Guid); realVersion.HardwareDancers.ToList().ForEach(x => x.HardwareVersionGuid = realVersion.Guid); realVersion.HardwarePidControls.ToList().ForEach(x => x.HardwareVersionGuid = realVersion.Guid); realVersion.HardwareWinders.ToList().ForEach(x => x.HardwareVersionGuid = realVersion.Guid); realVersion.HardwareSpeedSensors.ToList().ForEach(x => x.HardwareVersionGuid = realVersion.Guid); + realVersion.HardwareBlowers.ToList().ForEach(x => x.HardwareVersionGuid = realVersion.Guid); + realVersion.HardwareBreakSensors.ToList().ForEach(x => x.HardwareVersionGuid = realVersion.Guid); realVersion.HardwareMotors.ToList().ForEach(x => x.HardwareVersion = realVersion); realVersion.HardwareDancers.ToList().ForEach(x => x.HardwareVersion = realVersion); realVersion.HardwarePidControls.ToList().ForEach(x => x.HardwareVersion = realVersion); realVersion.HardwareWinders.ToList().ForEach(x => x.HardwareVersion = realVersion); realVersion.HardwareSpeedSensors.ToList().ForEach(x => x.HardwareVersion = realVersion); + realVersion.HardwareBlowers.ToList().ForEach(x => x.HardwareVersion = realVersion); + realVersion.HardwareBreakSensors.ToList().ForEach(x => x.HardwareVersion = realVersion); Adapter.Context.HardwareVersions.Add(realVersion); realVersion.Save(Adapter.Context); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml index e22b0e71a..86e0da5b5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml @@ -263,6 +263,82 @@ </DataTemplate> </ListBox.ItemTemplate> </ListBox> + + <StackPanel Orientation="Horizontal" Margin="0 20 0 0"> + <Image VerticalAlignment="Center" Source="../Images/blower.png" Width="32"></Image> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">BLOWERS</TextBlock> + </StackPanel> + <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding BlowerTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}"> + <ListBox.ItemTemplate> + <DataTemplate DataType="{x:Type entities:HardwareBlowerType}"> + <DockPanel> + <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}"> + <Button.Style> + <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwareBlowerType}"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Button.Style> + <Button.Content> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock> + <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" /> + </StackPanel> + </Button.Content> + </Button> + <StackPanel Orientation="Horizontal"> + <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock> + </StackPanel> + </DockPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + + <StackPanel Orientation="Horizontal" Margin="0 20 0 0"> + <Image VerticalAlignment="Center" Source="../Images/break.png" Width="32"></Image> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">BREAK SENSORS</TextBlock> + </StackPanel> + <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding BreakSensorTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}"> + <ListBox.ItemTemplate> + <DataTemplate DataType="{x:Type entities:HardwareBreakSensorType}"> + <DockPanel> + <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}"> + <Button.Style> + <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwareBreakSensorType}"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Button.Style> + <Button.Content> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock> + <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" /> + </StackPanel> + </Button.Content> + </Button> + <StackPanel Orientation="Horizontal"> + <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock> + </StackPanel> + </DockPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> </StackPanel> </ScrollViewer> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index 3a0191be4..0bd8f8133 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -176,8 +176,8 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { if (SelectedMachine != null) { - Machine = SelectedMachine.CloneEntity(); - Configuration = Machine.Configuration.CloneConfiguration(); + Machine = SelectedMachine.Clone(); + Configuration = Machine.Configuration.Clone(); History = SelectedMachine.MachinesConfigurations.Select(x => x.Configuration).ToObservableCollection(); } else @@ -193,7 +193,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { if (SelectedHistoryConfiguration != null) { - Configuration = SelectedHistoryConfiguration.CloneConfiguration(); + Configuration = SelectedHistoryConfiguration.Clone(); } } @@ -552,7 +552,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels await Machine.SaveAsync(Adapter.Context); Machine = Adapter.Machines.SingleOrDefault(x => x.Guid == Machine.Guid); - Configuration = Machine.Configuration.CloneConfiguration(); + Configuration = Machine.Configuration.Clone(); } } else @@ -586,11 +586,11 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels await machine.SaveAsync(Adapter.Context); Machine = Adapter.Machines.SingleOrDefault(x => x.Guid == machine.Guid); - Configuration = Machine.Configuration.CloneConfiguration(); + Configuration = Machine.Configuration.Clone(); } SetHistory(Machine); - Machine = Machine.CloneEntity(); + Machine = Machine.Clone(); } } catch (Exception ex) @@ -621,7 +621,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { if (Machine.MachineVersion != null) { - Configuration = Machine.MachineVersion.DefaultConfiguration.CloneConfiguration(); + Configuration = Machine.MachineVersion.DefaultConfiguration.Clone(); } else { @@ -642,7 +642,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { if (vm.SelectedVersion != null) { - vm.SelectedVersion.DefaultConfiguration = Configuration.CloneConfiguration(); + vm.SelectedVersion.DefaultConfiguration = Configuration.Clone(); vm.SelectedVersion.DefaultConfigurationGuid = vm.SelectedVersion.DefaultConfiguration.Guid; await vm.SelectedVersion.SaveAsync(Adapter.Context); } @@ -652,7 +652,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels newVersion.Version = vm.Version; newVersion.Name = vm.VersionName; - newVersion.DefaultConfiguration = Configuration.CloneConfiguration(); + newVersion.DefaultConfiguration = Configuration.Clone(); newVersion.DefaultConfigurationGuid = newVersion.DefaultConfiguration.Guid; await newVersion.SaveAsync(Adapter.Context); } |
