From 20b54cfc2b40bb69d1d6558c7fac6cc412c98da0 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 7 Oct 2019 14:42:44 +0300 Subject: Implemented RML import/export. Fixed issue with MS in 1920x1080. Added IP Address & Up Time to PPC. Added ExternalBridge Icon IsInSession Indication. Fixed issue with ExternalBridgeService disconnection. --- .../ViewModels/SystemViewVM.cs | 43 ++++++++++++++++++++++ .../Tango.PPC.Technician/Views/SystemView.xaml | 41 ++++++++++++++------- 2 files changed, 71 insertions(+), 13 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs index e01003c0b..444c1d09e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Management; +using System.Net; +using System.Net.Sockets; using System.Text; using System.Threading.Tasks; using System.Timers; @@ -40,6 +42,20 @@ namespace Tango.PPC.Technician.ViewModels set { _temperature = value; RaisePropertyChangedAuto(); } } + private TimeSpan _upTime; + public TimeSpan UpTime + { + get { return _upTime; } + set { _upTime = value; RaisePropertyChangedAuto(); } + } + + private String _ipAddress; + public String IPAddress + { + get { return _ipAddress; } + set { _ipAddress = value; RaisePropertyChangedAuto(); } + } + public RelayCommand ResetDeviceCommand { get; set; } public RelayCommand RestartCommand { get; set; } @@ -132,6 +148,12 @@ namespace Tango.PPC.Technician.ViewModels _statsTimer.Start(); } + public override void OnApplicationReady() + { + base.OnApplicationReady(); + IPAddress = GetIpv4Address(); + } + private void _statsTimer_Elapsed(object sender, ElapsedEventArgs e) { if (IsVisible) @@ -139,6 +161,7 @@ namespace Tango.PPC.Technician.ViewModels CPU = GetAppCPU(); RAM = GetAppRam(); //Temperature = GetTemperature(); + UpTime = DateTime.Now - ApplicationManager.StartUpDate; } } @@ -201,5 +224,25 @@ namespace Tango.PPC.Technician.ViewModels return 0; } } + + public String GetIpv4Address() + { + try + { + var host = Dns.GetHostEntry(Dns.GetHostName()); + foreach (var ip in host.AddressList) + { + if (ip.AddressFamily == AddressFamily.InterNetwork) + { + return ip.ToString(); + } + } + return "N/A"; + } + catch (Exception ex) + { + return "N/A"; + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml index f6e6370c1..f2bfcdf7d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml @@ -49,19 +49,34 @@ - - - - - - - Restart Device - Shutdown Device - Factory Reset - Exit To Shell - + + + + + UP TIME: + + + + + IP ADDRESS: + + + + + + + + + + + Restart Device + Shutdown Device + Factory Reset + Exit To Shell + + -- cgit v1.3.1