diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-03-10 16:26:32 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-03-10 16:26:32 +0200 |
| commit | 6dbef47fe2ca696fcf11ce4c2d0662c28b36bf35 (patch) | |
| tree | 4acde5e7e00c919e57c8e09e30179dfb14b2e36c /Software/Visual_Studio/PPC | |
| parent | 0e4045af38f59004c537e9bf5e7f2e89f7320f1f (diff) | |
| download | Tango-6dbef47fe2ca696fcf11ce4c2d0662c28b36bf35.tar.gz Tango-6dbef47fe2ca696fcf11ce4c2d0662c28b36bf35.zip | |
FSE Remote Job Parameters.
Diffstat (limited to 'Software/Visual_Studio/PPC')
11 files changed, 161 insertions, 8 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 5f005385e..c3d6136af 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 @@ -474,6 +474,8 @@ namespace Tango.PPC.Jobs.ViewModels job.Name = "Unnamed"; job.EnableInterSegment = false; job.InterSegmentLength = 0; + job.NumberOfSpools = 4; + job.NumberOfUnits = 1; } else { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs index 8826a8be3..00b4f5ad1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs @@ -8,6 +8,7 @@ using Tango.Core; using Tango.Core.DI; using Tango.Integration.ExternalBridge; using Tango.Integration.Operation; +using Tango.PPC.Common.Build; using Tango.PPC.Common.Connection; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Shared.Jobs; @@ -27,18 +28,23 @@ namespace Tango.PPC.Common.RemoteJob private List<RunningJobUpdateClient> _clients; private JobHandler _handler; private JobDTO _currentJobDTO; + private String _rmlName; private ProcessParametersTableDTO _currentJobProcessParameters; + private IRemoteJobInputOutputProvider _inputOutputProvider; + private IBuildProvider _buildProvider; public bool Enabled { get; set; } = true; private IMachineProvider MachineProvider { get; set; } - public DefaultRemoteJobService(IPPCExternalBridgeService externalBridge, IMachineProvider machineProvider) + public DefaultRemoteJobService(IPPCExternalBridgeService externalBridge, IMachineProvider machineProvider, IBuildProvider buildProvider) { externalBridge.RegisterRequestHandler(this); MachineProvider = machineProvider; + _buildProvider = buildProvider; + _clients = new List<RunningJobUpdateClient>(); MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; } @@ -52,6 +58,14 @@ namespace Tango.PPC.Common.RemoteJob _currentJobDTO = JobDTO.FromObservable(e.Job); _currentJobProcessParameters = ProcessParametersTableDTO.FromObservable(_handler.ProcessParameters); + _rmlName = e.Job.Rml.FinalName; + + RemoteJobInputOutput inputOutput = new RemoteJobInputOutput(); + + if (_clients.Count > 0 && _buildProvider.IsEureka) + { + inputOutput = GetCurrentJobInputOutput(); + } foreach (var client in _clients.ToList()) { @@ -60,12 +74,15 @@ namespace Tango.PPC.Common.RemoteJob RemoteJobProgress progress = new RemoteJobProgress(); progress.Stage = RemoteJobStage.Started; progress.JobStatus = _handler.JobStatus; + progress.InputOutput = inputOutput; + await client.Receiver.SendGenericResponse(new RemoteJobUpdateResponse() { Job = _currentJobDTO, ProcessParameters = _currentJobProcessParameters, - Progress = progress + Progress = progress, + RmlName = _rmlName }, client.Token); client.JobSent = true; @@ -76,6 +93,16 @@ namespace Tango.PPC.Common.RemoteJob private async void JobHandler_StatusChanged(object sender, RunningJobStatus e) { + var currentProgress = GetJobProgress(_handler); + RemoteJobInputOutput inputOutput = new RemoteJobInputOutput(); + + if (_clients.Count > 0 && _buildProvider.IsEureka) + { + inputOutput = GetCurrentJobInputOutput(); + } + + currentProgress.InputOutput = inputOutput; + foreach (var client in _clients.ToList()) { if (client.JobSent) @@ -84,7 +111,8 @@ namespace Tango.PPC.Common.RemoteJob { await client.Receiver.SendGenericResponse(new RemoteJobUpdateResponse() { - Progress = GetJobProgress(_handler) + Progress = currentProgress, + RmlName = _rmlName, }, client.Token); } catch { } @@ -96,12 +124,14 @@ namespace Tango.PPC.Common.RemoteJob RemoteJobProgress progress = new RemoteJobProgress(); progress.Stage = RemoteJobStage.Started; progress.JobStatus = _handler.JobStatus; + progress.InputOutput = inputOutput; await client.Receiver.SendGenericResponse(new RemoteJobUpdateResponse() { Job = _currentJobDTO, ProcessParameters = _currentJobProcessParameters, - Progress = progress + Progress = progress, + RmlName = _rmlName }, client.Token); client.JobSent = true; @@ -128,6 +158,77 @@ namespace Tango.PPC.Common.RemoteJob } } + private RemoteJobInputOutput GetCurrentJobInputOutput() + { + var inputOutput = new RemoteJobInputOutput(); + + if (_inputOutputProvider == null && _buildProvider.IsEureka) + { + _inputOutputProvider = TangoIOC.Default.GetInstance<IRemoteJobInputOutputProvider>(); + } + + if (_inputOutputProvider != null) + { + var i = _inputOutputProvider; + + if (i.CurrentBrushStop != null) + { + var colorSpace = i.CurrentBrushStop.BrushColorSpace; + + inputOutput.ColorSpace = colorSpace; + + switch (colorSpace) + { + case BL.Enumerations.ColorSpaces.Volume: + inputOutput.Input.Add(new Tuple<string, String>("C", i.CurrentBrushStop.Cyan.ToString("0.00"))); + inputOutput.Input.Add(new Tuple<string, String>("M", i.CurrentBrushStop.Magenta.ToString("0.00"))); + inputOutput.Input.Add(new Tuple<string, String>("Y", i.CurrentBrushStop.Yellow.ToString("0.00"))); + inputOutput.Input.Add(new Tuple<string, String>("K", i.CurrentBrushStop.Black.ToString("0.00"))); + break; + case BL.Enumerations.ColorSpaces.RGB: + inputOutput.Input.Add(new Tuple<string, String>("R", i.CurrentBrushStop.Red.ToString())); + inputOutput.Input.Add(new Tuple<string, String>("G", i.CurrentBrushStop.Green.ToString())); + inputOutput.Input.Add(new Tuple<string, String>("B", i.CurrentBrushStop.Blue.ToString())); + break; + case BL.Enumerations.ColorSpaces.LAB: + inputOutput.Input.Add(new Tuple<string, String>("L", i.CurrentBrushStop.L.ToString("0.00"))); + inputOutput.Input.Add(new Tuple<string, String>("A", i.CurrentBrushStop.A.ToString("0.00"))); + inputOutput.Input.Add(new Tuple<string, String>("B", i.CurrentBrushStop.B.ToString("0.00"))); + break; + case BL.Enumerations.ColorSpaces.Catalog: + inputOutput.Input.Add(new Tuple<string, String>("Catalog", i.CurrentBrushStop.ColorCatalog.Name)); + inputOutput.Input.Add(new Tuple<string, String>("Color", i.CurrentBrushStop.ColorCatalogsItem.Name)); + break; + default: + break; + } + + try + { + inputOutput.Output.Add(new Tuple<string, string>("C", i.CyanOutput.ToString())); + inputOutput.Output.Add(new Tuple<string, string>("LC", i.LightCyanOutput.ToString())); + inputOutput.Output.Add(new Tuple<string, string>("M", i.MagentaOutput.ToString())); + inputOutput.Output.Add(new Tuple<string, string>("LM", i.LightMagentaOutput.ToString())); + inputOutput.Output.Add(new Tuple<string, string>("Y", i.YellowOutput.ToString())); + inputOutput.Output.Add(new Tuple<string, string>("LY", i.LightYellowOutput.ToString())); + inputOutput.Output.Add(new Tuple<string, string>("K", i.BlackOutput.ToString())); + } + catch + { + inputOutput.Output.Add(new Tuple<string, string>("C", "N/A")); + inputOutput.Output.Add(new Tuple<string, string>("LC", "N/A")); + inputOutput.Output.Add(new Tuple<string, string>("M", "N/A")); + inputOutput.Output.Add(new Tuple<string, string>("LM", "N/A")); + inputOutput.Output.Add(new Tuple<string, string>("Y", "N/A")); + inputOutput.Output.Add(new Tuple<string, string>("LY", "N/A")); + inputOutput.Output.Add(new Tuple<string, string>("K", "N/A")); + } + } + } + + return inputOutput; + } + private RemoteJobProgress GetJobProgress(JobHandler handler) { RemoteJobStage stage = RemoteJobStage.Running; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/IRemoteJobInputOutputProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/IRemoteJobInputOutputProvider.cs new file mode 100644 index 000000000..cc98bd419 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/IRemoteJobInputOutputProvider.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; + +namespace Tango.PPC.Common.RemoteJob +{ + public interface IRemoteJobInputOutputProvider + { + BrushStop CurrentBrushStop { get; } + + double CyanOutput { get; } + double MagentaOutput { get; } + double YellowOutput { get; } + double BlackOutput { get; } + double LightCyanOutput { get; } + double LightMagentaOutput { get; } + double LightYellowOutput { get; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index 28cbfa6bc..08ad6ec1c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -221,6 +221,7 @@ <Compile Include="RemoteJobUpload\IRemoteJobUploadService.cs" /> <Compile Include="RemoteJobUpload\RemoteJobReceivedEventArgs.cs" /> <Compile Include="RemoteJob\DefaultRemoteJobService.cs" /> + <Compile Include="RemoteJob\IRemoteJobInputOutputProvider.cs" /> <Compile Include="RemoteJob\IRemoteJobService.cs" /> <Compile Include="RemoteActions\IRemoteActionsService.cs" /> <Compile Include="RemoteNotifications\DefaultRemoteNotificationsService.cs" /> @@ -642,7 +643,7 @@ </Target> <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/Tango.PPC.Shared/Jobs/RemoteJobInputOutput.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobInputOutput.cs new file mode 100644 index 000000000..e6c39a024 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobInputOutput.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Enumerations; + +namespace Tango.PPC.Shared.Jobs +{ + public class RemoteJobInputOutput + { + public ColorSpaces ColorSpace { get; set; } + public List<Tuple<String, String>> Input { get; set; } + public List<Tuple<String, String>> Output { get; set; } + + public RemoteJobInputOutput() + { + Input = new List<Tuple<string, String>>(); + Output = new List<Tuple<string, String>>(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobProgress.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobProgress.cs index d91d612d1..d3adc7ecb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobProgress.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobProgress.cs @@ -12,10 +12,12 @@ namespace Tango.PPC.Shared.Jobs { public RemoteJobStage Stage { get; set; } public JobStatus JobStatus { get; set; } + public RemoteJobInputOutput InputOutput { get; set; } public RemoteJobProgress() { JobStatus = new JobStatus(); + InputOutput = new RemoteJobInputOutput(); } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobUpdateResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobUpdateResponse.cs index 0bb32d266..28ff50622 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobUpdateResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Jobs/RemoteJobUpdateResponse.cs @@ -11,6 +11,7 @@ namespace Tango.PPC.Shared.Jobs public class RemoteJobUpdateResponse { public JobDTO Job { get; set; } + public String RmlName { get; set; } public ProcessParametersTableDTO ProcessParameters { get; set; } public RemoteJobProgress Progress { get; set; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj index 3f7bc0cbe..6b4e448f7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj @@ -75,6 +75,7 @@ <Compile Include="Insights\InsightsMinDateResponse.cs" /> <Compile Include="Insights\InsightsRequest.cs" /> <Compile Include="Insights\InsightsResponse.cs" /> + <Compile Include="Jobs\RemoteJobInputOutput.cs" /> <Compile Include="Jobs\RemoteJobProgress.cs" /> <Compile Include="Jobs\RemoteJobStage.cs" /> <Compile Include="Jobs\RemoteJobUpdateRequest.cs" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs index 92c527134..4a67f204c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs @@ -73,7 +73,7 @@ namespace Tango.PPC.UI viewBox.Child = new Views.MainEurekaView(); var screens = System.Windows.Forms.Screen.AllScreens; - var touch_screen = screens.Last(); + var touch_screen = screens.OrderBy(x => x.Bounds.X).Last(); bool hasTouch = TouchHelper.IsTouchEnabled() || settings.ForceTouchMode; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs index 937a76f94..8507d1e39 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -30,10 +30,11 @@ using System.Windows.Media; using Tango.PPC.Common.Resume; using Tango.Core.ExtensionMethods; using Tango.PPC.Common.Printing; +using Tango.PPC.Common.RemoteJob; namespace Tango.PPC.UI.ViewModels { - public class MachineStatusViewVM : PPCViewModel + public class MachineStatusViewVM : PPCViewModel, IRemoteJobInputOutputProvider { public enum StatisticTab { 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> |
