diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-06 18:01:50 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-06 18:01:50 +0300 |
| commit | d967b4b37644ab6aedac36539f8f6fa5cf3547f2 (patch) | |
| tree | 68433d120d479480c6f50f21d4dcf9d21a21bdfe /Software/Visual_Studio/PPC/Modules | |
| parent | 12d7bb4a0323fa4b037a93036cc32f1e2e7cb591 (diff) | |
| download | Tango-d967b4b37644ab6aedac36539f8f6fa5cf3547f2.tar.gz Tango-d967b4b37644ab6aedac36539f8f6fa5cf3547f2.zip | |
Working on TCC..
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
4 files changed, 43 insertions, 6 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationRequest.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationRequest.cs index ef991a7f2..6d3fe77ea 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationRequest.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Models/StorageNavigationRequest.cs @@ -14,7 +14,7 @@ namespace Tango.PPC.Storage.Models public StorageNavigationIntent Intent { get; set; } /// <summary> - /// Gets or sets the file display filter (e.g .tup|.job|.ccp). + /// Gets or sets the file display filter (e.g .tup|.job|.tcc). /// </summary> public String Filter { get; set; } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj index e524c44cb..54683b41e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj @@ -43,6 +43,7 @@ <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> + <Reference Include="System.Management" /> <Reference Include="System.Reactive.Core, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll</HintPath> </Reference> 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 5f7002e78..47d5835f5 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 @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Management; using System.Text; using System.Threading.Tasks; using System.Timers; @@ -31,6 +32,13 @@ namespace Tango.PPC.Technician.ViewModels set { _ram = value; RaisePropertyChangedAuto(); } } + private double _temperature; + public double Temperature + { + get { return _temperature; } + set { _temperature = value; RaisePropertyChangedAuto(); } + } + public RelayCommand RestartCommand { get; set; } public RelayCommand ShutdownCommand { get; set; } @@ -106,6 +114,7 @@ namespace Tango.PPC.Technician.ViewModels { CPU = GetAppCPU(); RAM = GetAppRam(); + Temperature = GetTemperature(); } } @@ -146,5 +155,27 @@ namespace Tango.PPC.Technician.ViewModels Process proc = Process.GetCurrentProcess(); return proc.PrivateMemorySize64; } + + public double GetTemperature() + { + try + { + double cpuTemp = 0; + List<double> avg = new List<double>(); + ManagementObjectSearcher mos = new ManagementObjectSearcher(@"root\WMI", "Select * From MSAcpi_ThermalZoneTemperature"); + + foreach (System.Management.ManagementObject mo in mos.Get()) + { + cpuTemp = Convert.ToDouble(Convert.ToDouble(mo.GetPropertyValue("CurrentTemperature").ToString()) - 2732) / 10; + avg.Add(cpuTemp); + } + + return avg.Average(); + } + catch + { + return 0; + } + } } } 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 dc13b2918..0b067b09b 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 @@ -32,15 +32,20 @@ <Grid Grid.Row="1" Margin="20"> <DockPanel> - <UniformGrid DockPanel.Dock="Top" Columns="2" Margin="50" TextElement.FontSize="{StaticResource TangoHeaderFontSize}"> + <UniformGrid DockPanel.Dock="Top" Columns="3" Margin="50" TextElement.FontSize="{StaticResource TangoHeaderFontSize}"> <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold"> - <Run>CPU Usage:</Run> - <Run Text="{Binding CPU,Mode=OneWay,StringFormat='0.0'}"></Run><Run>%</Run> + <Run>CPU:</Run> + <Run Text="{Binding CPU,Mode=OneWay,StringFormat='0'}"></Run><Run>%</Run> </TextBlock> <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold"> - <Run>RAM Usage:</Run> - <Run Text="{Binding RAM,Mode=OneWay,Converter={StaticResource ByteArrayToFileSizeConverter}}"></Run> + <Run>RAM:</Run> + <Run Text="{Binding RAM,Mode=OneWay,Converter={StaticResource ByteArrayToFileSizeConverter},StringFormat='0'}"></Run> + </TextBlock> + + <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold"> + <Run>TEMP:</Run> + <Run Text="{Binding Temperature,Mode=OneWay,StringFormat='0 °C'}"></Run> </TextBlock> </UniformGrid> |
