aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2021-11-01 19:44:34 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2021-11-01 19:44:34 +0200
commitbab9f04ae0f251acdb759e72fb54d84d042c533e (patch)
tree6df0d31b90ee7c9c7075c0f45c5fc6a09ab1b3ab /Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings
parentd2a95e54a3ae4fb7ff8b29bd85bb221cf3769a1f (diff)
downloadTango-bab9f04ae0f251acdb759e72fb54d84d042c533e.tar.gz
Tango-bab9f04ae0f251acdb759e72fb54d84d042c533e.zip
Added Ha Amma spool support via sites.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs45
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml4
3 files changed, 42 insertions, 9 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj
index d6bacb50c..30e2bf8c2 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj
@@ -170,7 +170,7 @@
<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/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
index bba5c2e7d..c5e4d46e7 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
@@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using Tango.BL;
+using System.Data.Entity;
using Tango.BL.Builders;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
@@ -107,6 +108,13 @@ namespace Tango.PPC.MachineSettings.ViewModels
set { _rmls = value; RaisePropertyChangedAuto(); }
}
+ private ObservableCollection<SpoolType> _spoolTypes;
+ public ObservableCollection<SpoolType> SpoolTypes
+ {
+ get { return _spoolTypes; }
+ set { _spoolTypes = value; RaisePropertyChangedAuto(); }
+ }
+
private bool _enableHotSpot;
public bool EnableHotSpot
{
@@ -170,11 +178,11 @@ namespace Tango.PPC.MachineSettings.ViewModels
set { _defaultRML = value; RaisePropertyChangedAuto(); }
}
- private SpoolType _defaultSpoolType;
- public SpoolType DefaultSpoolType
+ private SpoolType _selectedSpoolType;
+ public SpoolType SelectedSpoolType
{
- get { return _defaultSpoolType; }
- set { _defaultSpoolType = value; RaisePropertyChangedAuto(); }
+ get { return _selectedSpoolType; }
+ set { _selectedSpoolType = value; RaisePropertyChangedAuto(); }
}
private bool _synchronizeJobs;
@@ -303,7 +311,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
Settings.LockScreenTimeout = TimeSpan.FromMinutes(LockScreenTimeoutMinutes);
Settings.LockScreenPassword = LockScreenPassword;
Settings.DefaultRmlGuid = DefaultRML?.Guid;
- Settings.DefaultSpoolTypeGuid = DefaultSpoolType?.Guid;
+ Settings.SpoolTypeGuid = SelectedSpoolType?.Guid;
Settings.SynchronizeJobs = SynchronizeJobs;
Settings.SynchronizeDiagnostics = SynchronizeDiagnostics;
Settings.AutoCheckForUpdates = AutoCheckForUpdates;
@@ -457,6 +465,26 @@ namespace Tango.PPC.MachineSettings.ViewModels
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
Rmls = (await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToObservableCollection();
+
+ try
+ {
+ SpoolTypes = (await db.SitesSpoolTypes.Where(x => x.SiteGuid == MachineProvider.Machine.SiteGuid).Include(x => x.SpoolType).Select(x => x.SpoolType).ToListAsync()).OrderBy(x => x.LastUpdated).ToObservableCollection();
+
+ if (SpoolTypes.Count == 0)
+ {
+ SpoolTypes = new ObservableCollection<SpoolType>();
+ var standardSpool = await db.SpoolTypes.FirstOrDefaultAsync(x => x.Code == (int)BL.Enumerations.SpoolTypes.StandardSpool);
+ if (standardSpool != null)
+ {
+ SpoolTypes.Add(standardSpool);
+ }
+ }
+
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error getting machine site spool types.");
+ }
}
}
@@ -489,7 +517,12 @@ namespace Tango.PPC.MachineSettings.ViewModels
SelectedColorSpaces = new SelectedObjectCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x.IsUserSpace()).ToObservableCollection(), Settings.SupportedColorSpaces.ToObservableCollection());
DefaultRML = Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid);
- DefaultSpoolType = Adapter.SpoolTypes.SingleOrDefault(x => x.Guid == Settings.DefaultSpoolTypeGuid);
+ SelectedSpoolType = SpoolTypes.SingleOrDefault(x => x.Guid == Settings.SpoolTypeGuid);
+
+ if (SelectedSpoolType == null)
+ {
+ SelectedSpoolType = SpoolTypes.FirstOrDefault(x => x.Code == (int)BL.Enumerations.SpoolTypes.StandardSpool);
+ }
SynchronizeJobs = Settings.SynchronizeJobs;
SynchronizeDiagnostics = Settings.SynchronizeDiagnostics;
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
index 7e67bbf99..0eb93cc45 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
@@ -154,8 +154,8 @@
<TextBlock VerticalAlignment="Bottom">Default Thread</TextBlock>
<touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Rmls}" SelectedItem="{Binding DefaultRML}" DisplayMemberPath="FinalName"></touch:TouchComboBox>
- <TextBlock VerticalAlignment="Bottom">Default Spool</TextBlock>
- <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.SpoolTypes}" SelectedItem="{Binding DefaultSpoolType}" DisplayMemberPath="Name"></touch:TouchComboBox>
+ <TextBlock VerticalAlignment="Bottom">Spool Type</TextBlock>
+ <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding SpoolTypes}" SelectedItem="{Binding SelectedSpoolType}" DisplayMemberPath="Name"></touch:TouchComboBox>
<TextBlock VerticalAlignment="Bottom">Default Segment Length</TextBlock>
<touch:TouchNumericTextBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Minimum="1" Maximum="1000" Value="{Binding Settings.DefaultSegmentLength}" HasDecimalPoint="True" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox>