diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels')
2 files changed, 19 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs index f6fca0ac2..7b6b0b692 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs @@ -43,7 +43,7 @@ namespace Tango.MachineStudio.RML.ViewModels public async override void OnShow() { base.OnShow(); - LiquidTypes = (await _context.LiquidTypes.ToListAsync()).ToObservableCollection(); + LiquidTypes = (await _context.LiquidTypes.ToListAsync()).OrderBy(x => x.PreferredIndex).ToObservableCollection(); SelectedLiquidType = LiquidTypes.FirstOrDefault(); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index 1da3723d1..2fcb87c59 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -29,6 +29,7 @@ using Google.Protobuf; using Tango.ColorConversion; using Tango.CSV; using Tango.Core; +using Tango.SharedUI.Helpers; namespace Tango.MachineStudio.RML.ViewModels { @@ -282,6 +283,8 @@ namespace Tango.MachineStudio.RML.ViewModels public RelayCommand<ProcessParametersTable> RemoveProcessParametersTableCommand { get; set; } + public RelayCommand<ProcessParametersTable> CopyProcessParametersTableCommand { get; set; } + public RelayCommand AddLiquidFactorCommand { get; set; } public RelayCommand<LiquidTypesRml> RemoveLiquidFactorCommand { get; set; } @@ -329,6 +332,7 @@ namespace Tango.MachineStudio.RML.ViewModels BackToRmlsCommand = new RelayCommand(BackToRmls, () => IsFree); AddProcessParametersTableCommand = new RelayCommand(AddProcessParametersTable, () => IsFree); RemoveProcessParametersTableCommand = new RelayCommand<ProcessParametersTable>(RemoveProcessParametersTable, () => IsFree); + CopyProcessParametersTableCommand = new RelayCommand<ProcessParametersTable>(CopyProcessParametersTable, () => IsFree); AddLiquidFactorCommand = new RelayCommand(AddLiquidFactor, () => IsFree); RemoveLiquidFactorCommand = new RelayCommand<LiquidTypesRml>(RemoveLiquidFactor, () => IsFree); CreateCalibrationDataExcelTemplateCommand = new RelayCommand(CreateCalibrationDataExcelTemplate); @@ -481,6 +485,8 @@ namespace Tango.MachineStudio.RML.ViewModels { IsFree = false; + UIHelper.DoEvents(); + if (_active_context != null) { _active_context.Dispose(); @@ -1045,6 +1051,18 @@ namespace Tango.MachineStudio.RML.ViewModels } } + private void CopyProcessParametersTable(ProcessParametersTable processParametersTable) + { + var nextTable = ActiveProcessParametersGroup.ProcessParametersTables.FirstOrDefault(x => x.TableIndex == processParametersTable.TableIndex + 1); + if (nextTable != null) + { + for (int i = 0; i < processParametersTable.VisualParameters.Count; i++) + { + nextTable.VisualParameters[i].Value = processParametersTable.VisualParameters[i].Value; + } + } + } + private void CreateCalibrationDataExcelTemplate() { SaveFileDialog dlg = new SaveFileDialog(); |
