aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2024-05-21 20:31:36 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2024-05-21 20:31:36 +0300
commit4c3be889e920102408b0927c5f595ada5a6a544f (patch)
tree71213b906a9762faff2ff49029c5ecdda9d7dc94 /Software/Visual_Studio/PPC/Tango.PPC.Common
parentc33507b4aa109a1f2f2d7bd3483c468cc50b19b6 (diff)
downloadTango-4c3be889e920102408b0927c5f595ada5a6a544f.tar.gz
Tango-4c3be889e920102408b0927c5f595ada5a6a544f.zip
Fixed spool count on job from CSV.
Added auto power off selection settings. Fixed issue with power off on firmware reset.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs19
2 files changed, 28 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
index 7f67a4444..7a5a14ede 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
@@ -442,10 +442,18 @@ namespace Tango.PPC.Common.Connection
/// <summary>
/// Called when the machine has connected.
/// </summary>
- protected virtual void OnMachineConnected()
+ protected async virtual void OnMachineConnected()
{
IsConnected = true;
+
MachineConnected?.Invoke(this, new EventArgs());
+
+ try
+ {
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
+ await MachineOperator.SetPowerDownTime((int)settings.PowerSavingMode);
+ }
+ catch { }
}
/// <summary>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
index 03215553b..711443da5 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.ServiceModel;
using System.Text;
@@ -22,6 +23,18 @@ namespace Tango.PPC.Common
ExternalTCP,
}
+ public enum PowerDownMinutes
+ {
+ [Description("30 Minutes")]
+ Minimum = 30,
+ [Description("1 Hour")]
+ Default = 60,
+ [Description("2 Hours")]
+ Maximum = 240,
+ [Description("Never")]
+ Never = 0,
+ }
+
/// <summary>
/// Represents the main PPC settings.
/// </summary>
@@ -385,10 +398,16 @@ namespace Tango.PPC.Common
}
/// <summary>
+ /// Gets or sets the device power saving mode.
+ /// </summary>
+ public PowerDownMinutes PowerSavingMode { get; set; }
+
+ /// <summary>
/// Initializes a new instance of the <see cref="PPCSettings"/> class.
/// </summary>
public PPCSettings()
{
+ PowerSavingMode = PowerDownMinutes.Default;
EmulatorMode = EmulatorMode.InMemory;
LubricationLevels = new List<RmlLubricationLevel>();
JobUploadStrategy = JobUploadStrategy.JobDescriptionFile;