diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-07-25 14:18:41 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-07-25 14:18:41 +0300 |
| commit | abbfd75f45b636c3976f6769bbdc4615d88b16f8 (patch) | |
| tree | 0acc58b5e10bd7dc6d5f28c37d38f7ce283a5b7f /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs | |
| parent | 13012a106aac961eaba844b2f525287a0e021b2d (diff) | |
| download | Tango-abbfd75f45b636c3976f6769bbdc4615d88b16f8.tar.gz Tango-abbfd75f45b636c3976f6769bbdc4615d88b16f8.zip | |
Added FirmwareVersion and arranged the about list
Related Work Items: #8638
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs | 80 |
1 files changed, 79 insertions, 1 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 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<VersionFileDescriptor> descriptors, VersionFileDestination dtype) + { + var descriptor = descriptors.Where(x => x.Destination == VersionFileDestination.HeadCardSw).FirstOrDefault(); + return descriptor != null ? descriptor.Version : ""; + } + + } } |
