aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-12-04 17:46:26 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-12-04 17:46:26 +0200
commit95cabc98a8cd6baebc697c179be9fb68913ac483 (patch)
treeb9f839821e3f8087b968fef5c34660b122ec6d1f /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
parent5513ba4c2db05de40d9adfac645d7e77c35c71f7 (diff)
downloadTango-95cabc98a8cd6baebc697c179be9fb68913ac483.tar.gz
Tango-95cabc98a8cd6baebc697c179be9fb68913ac483.zip
Fixed issue with LeastParameterTables index.
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.cs28
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));