From 305a8e79c4b80f0c8578605ceff9514dd04d99d7 Mon Sep 17 00:00:00 2001 From: Roy Date: Thu, 20 Jul 2023 20:52:11 +0300 Subject: JOB RESUME BASICS --- .../PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index f4a3f643d..10f417edc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -109,6 +109,14 @@ namespace Tango.PPC.UI.Printing job.SpoolType = spoolType; + if (printConfig.GlobalStartPosition > 0) + { + config.ResumeConfig = new AdditionalJobConfiguration.ResumeConfiguration(); + config.ResumeConfig.FirstUnitStartPosition = printConfig.FirstUnitStartPosition; + config.ResumeConfig.GlobalStartPosition = printConfig.GlobalStartPosition; + config.ResumeConfig.RemainingUnits = printConfig.RemainingUnits; + } + handler = await _machineProvider.MachineOperator.Print(job, config); _notificationProvider.ReleaseGlobalBusyMessage(); } -- cgit v1.3.1 From abbfd75f45b636c3976f6769bbdc4615d88b16f8 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 25 Jul 2023 14:18:41 +0300 Subject: Added FirmwareVersion and arranged the about list Related Work Items: #8638 --- .../Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs | 2 +- .../Dialogs/GeneralInformationView.xaml | 145 ++++++++++++++++++--- .../Dialogs/GeneralInformationViewVM.cs | 80 +++++++++++- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Tango.Emulations/Emulators/MachineEmulator.cs | 35 ++++- 5 files changed, 236 insertions(+), 28 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs index b2dcffcdd..28184eee1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Resume/JobResumeDB.cs @@ -32,7 +32,7 @@ namespace Tango.PPC.Jobs.Resume { String dbFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "Job Resume v2"); Directory.CreateDirectory(dbFolder); - _db = new LiteDatabase($"Filename={Path.Combine(dbFolder, "job_resume.db")}"); + _db = new LiteDatabase($"Filename={Path.Combine(dbFolder, "job_resume.db")};connection=shared"); _collection = _db.GetCollection("JobResume"); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml index 8ae0f4354..fe9875009 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml @@ -6,7 +6,7 @@ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="750" Height="700" d:DataContext="{d:DesignInstance Type=local:GeneralInformationViewVM, IsDesignTimeCreatable=False}"> + Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="750" Height="1000" d:DataContext="{d:DesignInstance Type=local:GeneralInformationViewVM, IsDesignTimeCreatable=False}"> @@ -16,11 +16,12 @@ - General Information + - - + + Machine information: + @@ -41,6 +42,32 @@ + + + + Machine S/N: + + + + + + + + + + + + + Site: + + + + + + + + + @@ -55,31 +82,44 @@ + + + + IP Address: + + + + + + + + - Application Version: + Up Time: - + + - Site: + Total Dye Time: - + @@ -87,90 +127,153 @@ - Machine S/N: + Total Dye Meters: - + + +
+
+
+ Installed Software & Firmware: + + + + + + + + + + + + + + + - Firmware Version: + Application Version: - + - Up Time: + Main Firmware: - + + - IP Address: + Head Firmware: - + + + + + Dryer Firmware: + + + + + + + + - Total Dye Time: + Mid-tanks Firmware: - + + + + + Lubricant Firmware: + + + + + + + + - Total Dye Meters: + Dispensers Firmware: - + + + + + Winders Firmware: + + + + + + + +
-
+
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs index 7f810b2f3..1fd826af2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs @@ -23,7 +23,7 @@ using System.Net.Sockets; using System.Text; using System.Threading.Tasks; using System.Timers; - +using Tango.PMR.FirmwareUpgrade; namespace Tango.PPC.UI.Dialogs { @@ -87,6 +87,53 @@ namespace Tango.PPC.UI.Dialogs get { return _upTime; } set { _upTime = value; RaisePropertyChangedAuto(); } } + private string _headFirmware; + + public string HeadFirmware + { + get { return _headFirmware; } + set { _headFirmware = value; RaisePropertyChangedAuto(); } + } + + private string _dryerFirmware; + + public string DryerFirmware + { + get { return _dryerFirmware; } + set { _dryerFirmware = value; RaisePropertyChangedAuto(); } + } + + private string _MidtanksFirmware; + + public string MidtanksFirmware + { + get { return _MidtanksFirmware; } + set { _MidtanksFirmware = value; RaisePropertyChangedAuto(); } + } + + private string _lubricantFirmware; + + public string LubricantFirmware + { + get { return _lubricantFirmware; } + set { _lubricantFirmware = value; RaisePropertyChangedAuto(); } + } + + private string _dispensersFWFirmware; + + public string DispensersFWFirmware + { + get { return _dispensersFWFirmware; } + set { _dispensersFWFirmware = value; RaisePropertyChangedAuto(); } + } + + private string _windersFWFirmware; + + public string WindersFWFirmware + { + get { return _windersFWFirmware; } + set { _windersFWFirmware = value; RaisePropertyChangedAuto(); } + } public GeneralInformationViewVM( IMachineProvider provider, IPPCApplicationManager appManager) { @@ -98,6 +145,11 @@ namespace Tango.PPC.UI.Dialogs InitTotalDyeProp(); UpTime = DateTime.Now - ApplicationManager.StartUpDate; } + public override void OnShow() + { + base.OnShow(); + GetFirmwareVersionDescriptors(); + } public async void InitSite() { @@ -157,6 +209,32 @@ namespace Tango.PPC.UI.Dialogs TotalDyeMeters = "error!"; } } + + public async void GetFirmwareVersionDescriptors() + { + try + { + var descriptors = await MachineProvider.MachineOperator.GetFirmwareVersionDescriptors(); + + HeadFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.HeadCardSw); + DryerFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.DryerCardSw); + MidtanksFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.MidTankCardSw); + LubricantFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.LubricantCardSw); + DispensersFWFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.PumpCardSw); + WindersFWFirmware = GetVersionByFileDescriptor(descriptors, VersionFileDestination.WinderCardSw); + } + catch (Exception ex) + { + LogManager.Log(ex, "GetFirmwareVersionDescriptors"); + } + } + private String GetVersionByFileDescriptor(List descriptors, VersionFileDestination dtype) + { + var descriptor = descriptors.Where(x => x.Destination == VersionFileDestination.HeadCardSw).FirstOrDefault(); + return descriptor != null ? descriptor.Version : ""; + } + + } } 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. --> - + diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 31a7bfcdb..01a32b2b7 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -172,20 +172,21 @@ namespace Tango.Emulations.Emulators } for (int i = 0; i < 4; i++) { - if( i == 2) + if (i == 2) { MachineStatus.WindersInError.Add(false); MachineStatus.DancersInError.Add(true); MachineStatus.BtsrsInError.Add(true); } - else { + else + { MachineStatus.WindersInError.Add(false); MachineStatus.DancersInError.Add(false); MachineStatus.BtsrsInError.Add(false); } } - EventsStates = MachineEventState.GetAllEventsStates(); + EventsStates = MachineEventState.GetAllEventsStates(); _valveStates = new List(); _blower_states = new List(); @@ -228,7 +229,7 @@ namespace Tango.Emulations.Emulators }); } var tunnel = _heater_states.FirstOrDefault(x => x.HeaterType == HeaterType.ETunnelHeater); - if(tunnel != null) + if (tunnel != null) { tunnel.IsRampingUp = true; tunnel.CurrentValue = 108.5; @@ -526,6 +527,9 @@ namespace Tango.Emulations.Emulators case MessageType.InitiateInkFillingRequest: HandleInitiateInkFillingRequest(MessageFactory.ParseTangoMessageFromContainer(container)); break; + case MessageType.GetVersionDescriptorsRequest: + HandleGetVersionDescriptorsRequest(MessageFactory.ParseTangoMessageFromContainer(container)); + break; } } @@ -840,9 +844,16 @@ namespace Tango.Emulations.Emulators double dryerLength = _machineType == MachineType.Ts1800 ? (job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS) : job.ProcessParameters.DryerBufferLength; //TODO Handle First Unit Length Decrease In Emulator! + double firstUnitStartPosition = request.Message.FirstUnitStartPosition; for (int i = 0; i < units; i++) { + //double unit_length = job.Length; + + if (i == 0 && firstUnitStartPosition > 0) + { + unit_length = unit_length - firstUnitStartPosition; + } while (progress < unit_length + (i == units - 1 ? dryerLength : 0) && !_cancelJob) { @@ -1928,6 +1939,22 @@ namespace Tango.Emulations.Emulators await Transporter.SendResponse(new InitiateInkFillingResponse(), request.Container.Token); } + private async void HandleGetVersionDescriptorsRequest(TangoMessage request) + { + GetVersionDescriptorsResponse response = new GetVersionDescriptorsResponse(); + + foreach (var destination in Enum.GetValues(typeof(PMR.FirmwareUpgrade.VersionFileDestination)).Cast().ToList()) + { + VersionFileDescriptor result = new VersionFileDescriptor(); + result.Destination = destination; + result.Version = "123456VP"; + + + response.Descriptors.Add(result); + } + await Transporter.SendResponse(response, request.Container.Token); + } + #endregion #region Public Methods -- cgit v1.3.1 From f4122102df68ce9be7eb76c41ef100e5c6f83f9f Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 25 Jul 2023 14:50:10 +0300 Subject: Power down progress bar value set to integer Related Work Items: #8639 --- Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml index b08aab298..1e864c7e3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml @@ -16,7 +16,7 @@ - % + % Machine is turning Off -- cgit v1.3.1