diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-05-15 22:05:35 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-05-15 22:05:35 +0300 |
| commit | fd061c7cb7f243d562913d496223830bcf83b7a9 (patch) | |
| tree | 06d00b6b9cfec13c7021e907a4b567b45da09c8f | |
| parent | 700a9ea9e2c9d95f0c5739c58974eafaff2ebeb9 (diff) | |
| download | Tango-fd061c7cb7f243d562913d496223830bcf83b7a9.tar.gz Tango-fd061c7cb7f243d562913d496223830bcf83b7a9.zip | |
Dryer Target Value, Firmware Version Descriptors fixes.
3 files changed, 18 insertions, 16 deletions
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 1fd826af2..1ec2c16dc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs @@ -230,7 +230,7 @@ namespace Tango.PPC.UI.Dialogs } private String GetVersionByFileDescriptor(List<VersionFileDescriptor> descriptors, VersionFileDestination dtype) { - var descriptor = descriptors.Where(x => x.Destination == VersionFileDestination.HeadCardSw).FirstOrDefault(); + var descriptor = descriptors.Where(x => x.Destination == dtype).FirstOrDefault(); return descriptor != null ? descriptor.Version : ""; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs index beba47246..24ad6576d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs @@ -44,7 +44,7 @@ namespace Tango.PPC.UI.Models { DryerZone3 = new MachineOverviewItem(); DryerAir = new MachineOverviewItem(); - DryerAir.MaxValue = DryerAirMaxValue; + DryerAir.MaxValue = DryerAirMaxValue; Tunnel = new MachineOverviewItem(); PumpsPressure = new MachineOverviewItem(); PumpsPressure.MaxValue = 6; @@ -61,7 +61,7 @@ namespace Tango.PPC.UI.Models //Dryer Air var dryerAirState = diagnostics.Monitors.EuSpare1.FirstOrDefault(); - UpdateDryerAirItem(dryerAirState); + UpdateDryerAirItem(dryerAirState, processParameters != null ? processParameters.ESpare1 : DryerAirMaxValue); //diagnostics.HeatersStates.FirstOrDefault(x => x.HeaterType == HeaterType.DryerAirHeater); @@ -96,7 +96,7 @@ namespace Tango.PPC.UI.Models //Lubricant var lubricantValue = diagnostics.Monitors.EuLubricantCurrent.FirstOrDefault(); - UpdateLubricantItem( rml, lubricantValue); + UpdateLubricantItem(rml, lubricantValue); } private void UpdateHeaterItem(MachineOverviewItem item, HeaterState state) @@ -104,8 +104,8 @@ namespace Tango.PPC.UI.Models if (state != null) { - if (state.IsRampingUp && - (state.SetPoint != 0 + if (state.IsRampingUp && + (state.SetPoint != 0 && (state.CurrentValue <= (state.SetPoint - 10)))) { item.Status = "Heating Up"; @@ -121,12 +121,12 @@ namespace Tango.PPC.UI.Models item.Color = Colors.Green; item.DisplayValue = $" {state.SetPoint}"; item.DisplayMaxValue = ""; - if(state.SetPoint == 0 && state.CurrentValue == 0) + if (state.SetPoint == 0 && state.CurrentValue == 0) { item.MaxValue = 10; } else - { + { item.MaxValue = state.SetPoint; } item.Value = state.CurrentValue; @@ -138,7 +138,7 @@ namespace Tango.PPC.UI.Models item.DisplayValue = $"{state.CurrentValue.ToString("N1")}"; item.DisplayMaxValue = $"/{state.SetPoint}"; item.MaxValue = state.SetPoint; - item.Value = state.CurrentValue > state.SetPoint? state.SetPoint : state.CurrentValue; + item.Value = state.CurrentValue > state.SetPoint ? state.SetPoint : state.CurrentValue; } else { @@ -150,15 +150,15 @@ namespace Tango.PPC.UI.Models } } - private void UpdateDryerAirItem(double currentvalue) + private void UpdateDryerAirItem(double currentvalue, double targetValue) { - if (currentvalue < DryerAirMaxValue) + if (currentvalue < targetValue) { DryerAir.Status = "Heating Up"; DryerAir.Color = Colors.Orange; DryerAir.DisplayValue = currentvalue.ToString("N1"); } - else if (currentvalue >= DryerAirMaxValue) + else if (currentvalue >= targetValue) { DryerAir.Status = "Operational"; DryerAir.Color = Colors.Green; @@ -189,13 +189,13 @@ namespace Tango.PPC.UI.Models if (rml != null) { var rmlLubrication = Settings.LubricationLevels.FirstOrDefault(x => x.RmlGuid == rml.Guid); - if (( rml.Lubricant == false) + if ((rml.Lubricant == false) || (rmlLubrication != null && rmlLubrication.LubricationLevel == Common.Lubrication.LubricationLevel.No)) { Lubricant.Status = "NotActive"; Lubricant.DisplayValue = "None"; Lubricant.Color = Colors.Gray; - + return; } Lubricant.Status = "Active"; diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index bacce5f5e..a65f6931a 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -1949,12 +1949,14 @@ namespace Tango.Emulations.Emulators { GetVersionDescriptorsResponse response = new GetVersionDescriptorsResponse(); + int v = 1; + foreach (var destination in Enum.GetValues(typeof(PMR.FirmwareUpgrade.VersionFileDestination)).Cast<PMR.FirmwareUpgrade.VersionFileDestination>().ToList()) { VersionFileDescriptor result = new VersionFileDescriptor(); result.Destination = destination; - result.Version = "123456VP"; - + result.Version = $"0.0.0.{v}"; + v++; response.Descriptors.Add(result); } |
