aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-10-07 14:42:44 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-10-07 14:42:44 +0300
commit20b54cfc2b40bb69d1d6558c7fac6cc412c98da0 (patch)
tree5428e4e0428e0f9334bc76202d8a88005959e830 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician
parent0b40fe3742d90cdb7a4abab88207d0552dd4e3a7 (diff)
downloadTango-20b54cfc2b40bb69d1d6558c7fac6cc412c98da0.tar.gz
Tango-20b54cfc2b40bb69d1d6558c7fac6cc412c98da0.zip
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.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs43
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml41
2 files changed, 71 insertions, 13 deletions
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 @@
</TextBlock>
</UniformGrid>
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" TextElement.FontSize="{StaticResource TangoTitleFontSize}">
- <touch:TouchButton Command="{Binding ResetDeviceCommand}" Height="60" Content="Reset Machine">
- <touch:TouchButton.Style>
- <Style TargetType="touch:TouchButton" BasedOn="{StaticResource {x:Type touch:TouchButton}}">
- <Setter Property="Background" Value="{StaticResource TangoErrorBrush}"></Setter>
- </Style>
- </touch:TouchButton.Style>
- </touch:TouchButton>
- <touch:TouchButton Command="{Binding RestartCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Restart Device</touch:TouchButton>
- <touch:TouchButton Command="{Binding ShutdownCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Shutdown Device</touch:TouchButton>
- <touch:TouchButton Command="{Binding FactoryResetCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Factory Reset</touch:TouchButton>
- <touch:TouchButton Command="{Binding ExitToExplorerCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Exit To Shell</touch:TouchButton>
- </StackPanel>
+ <DockPanel>
+
+ <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center">
+ <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold" FontSize="{StaticResource TangoHeaderFontSize}">
+ <Run>UP TIME:</Run>
+ <Run Text="{Binding UpTime,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"></Run>
+ </TextBlock>
+
+ <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontWeight="SemiBold" FontSize="{StaticResource TangoHeaderFontSize}">
+ <Run>IP ADDRESS:</Run>
+ <Run Text="{Binding IPAddress}"></Run>
+ </TextBlock>
+ </StackPanel>
+
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" TextElement.FontSize="{StaticResource TangoTitleFontSize}">
+ <touch:TouchButton Command="{Binding ResetDeviceCommand}" Height="60" Content="Reset Machine">
+ <touch:TouchButton.Style>
+ <Style TargetType="touch:TouchButton" BasedOn="{StaticResource {x:Type touch:TouchButton}}">
+ <Setter Property="Background" Value="{StaticResource TangoErrorBrush}"></Setter>
+ </Style>
+ </touch:TouchButton.Style>
+ </touch:TouchButton>
+ <touch:TouchButton Command="{Binding RestartCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Restart Device</touch:TouchButton>
+ <touch:TouchButton Command="{Binding ShutdownCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Shutdown Device</touch:TouchButton>
+ <touch:TouchButton Command="{Binding FactoryResetCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Factory Reset</touch:TouchButton>
+ <touch:TouchButton Command="{Binding ExitToExplorerCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Exit To Shell</touch:TouchButton>
+ </StackPanel>
+ </DockPanel>
</DockPanel>
</Grid>
</Grid>