diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-04 17:56:32 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-04 17:56:32 +0200 |
| commit | c63050d1b7f34c5e3c49bbe23e059ebe403e8b20 (patch) | |
| tree | 4034da7ff03b1ac63f176a7e8b0664097cf9c3e3 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs | |
| parent | 89831e736d0262038a8aa7e0385ebdfe83d196c2 (diff) | |
| parent | 6150db333d81879d3aba19613cca67cb92b22774 (diff) | |
| download | Tango-c63050d1b7f34c5e3c49bbe23e059ebe403e8b20.tar.gz Tango-c63050d1b7f34c5e3c49bbe23e059ebe403e8b20.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs | 28 |
1 files changed, 28 insertions, 0 deletions
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 70073ad62..ef6fc816b 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 @@ -209,6 +209,34 @@ namespace Tango.MachineStudio.RML.ViewModels .WithMediaProperties() .BuildAsync(); + if (ActiveRML.ProcessParametersTablesGroups.ToList().Count == 0) + { + if (!_notification.ShowQuestion("Could not find any process group for the selected RML. Would you like to create one?")) + { + _notification.ShowError("Cannot load an RML with no process group."); + IsFree = true; + return; + } + else + { + ProcessParametersTablesGroup group = new ProcessParametersTablesGroup(); + group.Name = "Active Group"; + group.Active = true; + group.ProcessParametersTables.Add(new ProcessParametersTable() + { + Name = "Process Table 1", + }); + + group.Rml = ActiveRML; + + _active_context.ProcessParametersTablesGroups.Add(group); + _active_context.ProcessParametersTables.Add(group.ProcessParametersTables[0]); + await _active_context.SaveChangesAsync(); + LoadActiveRML(ActiveRML.Guid); + return; + } + } + ActiveProcessParametersGroup = ActiveRML.ProcessParametersTablesGroups.ToList().FirstOrDefault(); ActiveProcessParametersTableView = CollectionViewSource.GetDefaultView(ActiveProcessParametersGroup.ProcessParametersTables); ActiveProcessParametersTableView.SortDescriptions.Add(new SortDescription(nameof(ProcessParametersTable.TableIndex), ListSortDirection.Ascending)); |
