aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
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
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')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs9
-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.cs39
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml33
-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
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
7 files changed, 111 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
index c3d6136af..8f886e073 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
@@ -1049,6 +1049,15 @@ namespace Tango.PPC.Jobs.ViewModels
job.WindingMethodGuid = Adapter.WindingMethods.FirstOrDefault().Guid;
job.SpoolTypeGuid = Settings.SpoolTypeGuid != null ? Settings.SpoolTypeGuid : Adapter.SpoolTypes.FirstOrDefault().Guid;
+ if (BuildProvider.IsEureka)
+ {
+ job.EnableInterSegment = false;
+ job.InterSegmentLength = 0;
+ job.NumberOfSpools = 4;
+ job.NumberOfUnits = 1;
+ }
+
+
foreach (var segment in segments)
{
segment.Job = job;
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 30e2bf8c2..d6bacb50c 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_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</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 6787136be..594d3f5c9 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
@@ -44,6 +44,16 @@ namespace Tango.PPC.MachineSettings.ViewModels
#region Classes
+ public class PowerDownTime
+ {
+ public PowerDownMinutes Minutes { get; set; }
+
+ public String Name
+ {
+ get { return Minutes.ToDescription(); }
+ }
+ }
+
public class RmlLubricationLevelSettings : RmlLubricationLevel
{
public String Name { get; set; }
@@ -282,6 +292,15 @@ namespace Tango.PPC.MachineSettings.ViewModels
set { _manualFineTuningLength = value; RaisePropertyChangedAuto(); }
}
+ public List<PowerDownTime> PowerDownTimes { get; set; }
+
+ private PowerDownTime _selectedPowerDownTime;
+ public PowerDownTime SelectedPowerDownTime
+ {
+ get { return _selectedPowerDownTime; }
+ set { _selectedPowerDownTime = value; RaisePropertyChangedAuto(); }
+ }
+
#endregion
@@ -310,6 +329,14 @@ namespace Tango.PPC.MachineSettings.ViewModels
SaveCommand = new RelayCommand(Save);
DiscardCommand = new RelayCommand(Discard);
SynchronizeCommand = new RelayCommand(Synchronize, () => !MachineDataSynchronizer.IsSynchronizing && IsFree);
+
+ PowerDownTimes = new List<PowerDownTime>()
+ {
+ new PowerDownTime() { Minutes = PowerDownMinutes.Minimum },
+ new PowerDownTime() { Minutes = PowerDownMinutes.Default },
+ new PowerDownTime() { Minutes = PowerDownMinutes.Maximum },
+ new PowerDownTime() { Minutes = PowerDownMinutes.Never },
+ };
}
private void Discard()
@@ -342,6 +369,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
Settings.LubricationLevels = LubricationLevels.Where(x => x.LubricationLevel != LubricationLevel.Standard).Select(x => x.ToRmlLubricationLevel()).ToList();
Settings.DefaultTabColorSpace = DefaultTabColorSpace;
Settings.FineTuningTrialLengthMeters = FineTuningLength;
+ Settings.PowerSavingMode = SelectedPowerDownTime.Minutes;
MachineDataSynchronizer.IsEnabled = SynchronizeJobs || SynchronizeDiagnostics;
@@ -359,6 +387,15 @@ namespace Tango.PPC.MachineSettings.ViewModels
await MachineProvider.MachineOperator.SetSpoolType((PMR.Printing.JobSpoolType)SelectedSpoolType.Code);
}
+ if (MachineProvider.IsConnected)
+ {
+ try
+ {
+ await MachineProvider.MachineOperator.SetPowerDownTime((int)Settings.PowerSavingMode);
+ }
+ catch { }
+ }
+
if (_previousTimeZone.ToStringSafe() != SelectedTimeZone.ToStringSafe())
{
if (await NotificationProvider.ShowQuestion("Changing the time zone requires the application to restart. Do you wish to restart the application?"))
@@ -524,6 +561,8 @@ namespace Tango.PPC.MachineSettings.ViewModels
ExternalBridgePassword = Settings.ExternalBridgePassword;
+ SelectedPowerDownTime = PowerDownTimes.FirstOrDefault(x => x.Minutes == Settings.PowerSavingMode);
+
_enableRemoteAssistance = RemoteAssistanceProvider.IsEnabled;
RaisePropertyChanged(nameof(EnableRemoteAssistance));
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 7de2818f8..a1414f60c 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
@@ -14,6 +14,7 @@
xmlns:global="clr-namespace:Tango.PPC.MachineSettings"
xmlns:integrationPMR="clr-namespace:Tango.PMR.Integration;assembly=Tango.PMR"
xmlns:lubrication="clr-namespace:Tango.PPC.Common.Lubrication;assembly=Tango.PPC.Common"
+ xmlns:common="clr-namespace:Tango.PPC.Common;assembly=Tango.PPC.Common"
xmlns:local="clr-namespace:Tango.PPC.MachineSettings.Views"
mc:Ignorable="d"
d:DesignHeight="4500" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
@@ -25,6 +26,13 @@
<x:Type TypeName="lubrication:LubricationLevel"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
+
+ <ObjectDataProvider x:Key="PowerDownTimes" MethodName="GetValues"
+ ObjectType="{x:Type sys:Enum}">
+ <ObjectDataProvider.MethodParameters>
+ <x:Type TypeName="common:PowerDownMinutes"/>
+ </ObjectDataProvider.MethodParameters>
+ </ObjectDataProvider>
</UserControl.Resources>
@@ -355,6 +363,31 @@
</StackPanel>
</touch:TouchExpander>
+ <!--POWER SAVER-->
+ <touch:TouchExpander Margin="0 20 0 0" Header="Power Saving" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <StackPanel>
+ <controls:TableGrid Margin="10" RowHeight="60" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}">
+ <TextBlock VerticalAlignment="Center">
+ <Run>
+ Automatically turn off the machine on idle time after
+ </Run>
+ </TextBlock>
+
+ <touch:TouchComboBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="250" ItemsSource="{Binding PowerDownTimes}" SelectedItem="{Binding SelectedPowerDownTime}" ValuePath="Minutes" DisplayMemberPath="Name">
+
+ </touch:TouchComboBox>
+
+ </controls:TableGrid>
+
+ <!--<DockPanel Margin="10 -50 0 0">
+ <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon>
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">
+ You can activate the screen anytime by pressing
+ </TextBlock>
+ </DockPanel>-->
+ </StackPanel>
+ </touch:TouchExpander>
+
<!--TECHNICIAN-->
<touch:TouchExpander Visibility="{Binding ApplicationManager.IsInTechnicianMode,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 20 0 0" Header="Advanced" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}">
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;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>