aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs21
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml3
2 files changed, 23 insertions, 1 deletions
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 768f93de1..fd31cd950 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
@@ -115,6 +115,21 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
set { _selectedSpool = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
+ private Site _selectedSite;
+ public Site SelectedSite
+ {
+ get { return _selectedSite; }
+ set { _selectedSite = value; RaisePropertyChangedAuto(); }
+ }
+
+ private List<Site> _sites;
+ public List<Site> Sites
+ {
+ get { return _sites; }
+ set { _sites = value; RaisePropertyChangedAuto(); }
+ }
+
+
private ColorCalibrationViewVM _colorCalibrationViewVM;
public ColorCalibrationViewVM ColorCalibrationViewVM
{
@@ -474,6 +489,10 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
}
}
+ Sites = await ActiveMachineAdapter.Context.Sites.ToListAsync();
+ Sites.Insert(0, new Site() { Name = "NONE", ID = -1 });
+ SelectedSite = Sites.SingleOrDefault(x => x.Guid == ActiveMachine.SiteGuid);
+
ColorCalibrationViewVM = new ColorCalibrationViewVM(_notification, ActiveMachine, _activeMachineAdapter.Context)
{
Rmls = ActiveMachineAdapter.Rmls,
@@ -487,7 +506,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
await MachineUpdatesViewVM.Init(ActiveMachine, ActiveMachineAdapter.Context);
TupViewVM.Init(ActiveMachine);
-
ActiveMachine.Configuration.HardwareVersionChanged += Configuration_HardwareVersionChanged;
View.NavigateTo(MachineDesignerNavigationView.MachineDetailsView);
@@ -651,6 +669,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
ActiveMachine.ConfigurationGuid = ActiveMachine.Configuration.Guid;
ActiveMachine.LastUpdated = DateTime.UtcNow;
ActiveMachine.ProductionDate = DateTime.UtcNow;
+ ActiveMachine.SiteGuid = SelectedSite == null ? null : (SelectedSite.ID == -1 ? null : SelectedSite.Guid);
ColorCalibrationViewVM.Save();
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
index b6c1ba974..0a0c1ecef 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
@@ -48,6 +48,9 @@
<TextBlock FontWeight="SemiBold">Organization</TextBlock>
<ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.Organizations}" SelectedItem="{Binding ActiveMachine.Organization}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox>
+ <TextBlock FontWeight="SemiBold">Site</TextBlock>
+ <ComboBox Background="Transparent" ItemsSource="{Binding Sites}" SelectedItem="{Binding SelectedSite}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox>
+
<TextBlock FontWeight="SemiBold">OS Key</TextBlock>
<TextBox Text="{Binding ActiveMachine.OsKey}"></TextBox>