コード例 #1
0
 public WsServerNodeStateViewModel(IWsServerNode data)
 {
     _address     = data.Address;
     _description = data.Description;
     _minerClientWsSessionCount = data.MinerClientWsSessionCount;
     _minerStudioWsSessionCount = data.MinerStudioWsSessionCount;
     _minerClientSessionCount   = data.MinerClientSessionCount;
     _minerStudioSessionCount   = data.MinerStudioSessionCount;
     _osInfo = data.OSInfo;
     _totalPhysicalMemory     = data.TotalPhysicalMemory;
     _availablePhysicalMemory = data.AvailablePhysicalMemory;
     _cpuPerformance          = data.CpuPerformance;
     _processMemoryMb         = data.ProcessMemoryMb;
     _threadCount             = data.ThreadCount;
     _handleCount             = data.HandleCount;
     _availableFreeSpaceInfo  = data.AvailableFreeSpaceInfo;
     _cpu               = data.Cpu;
     _cpuVm             = new CpuDataViewModel(data.Cpu);
     this.RemoteDesktop = new DelegateCommand(() => {
         #region
         AppRoot.RemoteDesktop?.Invoke(new RdpInput(GetRemoteDesktopIp(), "administrator", string.Empty, string.Empty, onDisconnected: message => {
             VirtualRoot.Out.ShowError(message, autoHideSeconds: 4, toConsole: true);
         }));
         #endregion
     });
 }
コード例 #2
0
        /// <summary>
        /// process the response from server and update the properties
        /// </summary>
        protected override bool ProcessResponse(HttpResponse response)
        {
            string json = response.Result;

            // deserialize
            CpuData = JsonConvert.DeserializeObject <CpuData>(json);
            return(true);
        }
コード例 #3
0
 private void DisplayCpuRow(string id, CpuData cpu, IGridList <View> gridList, int rowIndex)
 {
     AddLabel(id, gridList, rowIndex, 0, 1);
     AddLabel(cpu.Usage.ToString(), gridList, rowIndex, 1, 1);
     AddLabel(cpu.UserUsage.ToString(), gridList, rowIndex, 2, 1);
     AddLabel(cpu.SystemUsage.ToString(), gridList, rowIndex, 3, 1);
     AddLabel(cpu.Idle.ToString(), gridList, rowIndex, 4, 1);
 }
コード例 #4
0
 public CpuMonitor()
 {
     Data = new CpuData
     {
         Temperature = new CpuData.CpuTemperature(),
         Load        = new CpuData.CpuLoad()
     };
 }
コード例 #5
0
        private void Display()
        {
            IGridList <View> gridList = piStatsGrid.Children;

            gridList.Clear();
            int rowIndex = 0;

            if (_piSystem == null)
            {
                AddLabel($"Service {_monitorTopic.Name} is not available at {_monitorTopic.Server}.", gridList, rowIndex++, 0, 5);
                AbortRefresh();
                return;
            }

            HttpResponse response = _piSystem.CpuClient.GetResponse();

            if (!response.Success)
            {
                AddLabel($"Error getting data for {_monitorTopic.Name} at {_monitorTopic.Server}", gridList, rowIndex++, 0, 5);
                GridUtil.AddLabel(response.ErrorMessage, gridList, rowIndex++, 0, 5, 10, Color.Default, false, LayoutOptions.End);
                StopRefresh();
                return;
            }
            _piSystem.MemoryClient.Get();
            CpuData    cpu    = _piSystem.CpuClient.CpuData;
            MemoryData memory = _piSystem.MemoryClient.MemoryData;

            DisplayHeaderAndValueRow("Server Address", _monitorTopic.Server, gridList, rowIndex++, 3);
            DisplayHeaderAndValueRow("CPU Core Temperature", cpu.Temperature.ToString(), gridList, rowIndex++, 3);
            AddLabel("Usage", gridList, rowIndex, 1, 1);
            AddLabel("User", gridList, rowIndex, 2, 1);
            AddLabel("System", gridList, rowIndex, 3, 1);
            AddLabel("Idle", gridList, rowIndex, 4, 1);
            rowIndex++;
            DisplayCpuRow(_monitorTopic.Name, cpu, gridList, rowIndex++);
            if (cpu.Cores != null)
            {
                foreach (var data in cpu.Cores)
                {
                    DisplayCpuRow(data.Key, data.Value, gridList, rowIndex++);
                }
            }
            DisplayHeaderAndValueRow("Total Memory (MB)", memory.Total.ToString(), gridList, rowIndex++, 2);
            DisplayMemoryRow("Used Memory (MB)", memory.Used, memory.Total, gridList, rowIndex++);
            DisplayMemoryRow("Cached Memory (MB)", memory.Cached, memory.Total, gridList, rowIndex++);
            DisplayMemoryRow("Free Memory (MB)", memory.Free, memory.Total, gridList, rowIndex++);
            DisplayMemoryRow("Available Memory (MB)", memory.Available, memory.Total, gridList, rowIndex++);

            if (_hygroThermoSensor != null)
            {
                string json = _hygroThermoSensor.Get();
                DisplayHeaderAndValueRow("Humidity (%)", _hygroThermoSensor.HygroThermoData.Humidity.ToString(), gridList, rowIndex++, 2);
                DisplayHeaderAndValueRow("Temperature (C)", _hygroThermoSensor.HygroThermoData.Temperature.ToString(), gridList, rowIndex++, 2);
            }
        }
コード例 #6
0
 public WebApiServerStateViewModel(IWebApiServerState data)
 {
     _description             = data.Description;
     _oSInfo                  = data.OSInfo;
     _totalPhysicalMemory     = data.TotalPhysicalMemory;
     _address                 = data.Address;
     _cpuPerformance          = data.CpuPerformance;
     _availablePhysicalMemory = data.AvailablePhysicalMemory;
     _cpu             = data.Cpu;
     _cpuVm           = new CpuDataViewModel(data.Cpu);
     _wsServerNodes   = data.WsServerNodes;
     _wsServerNodeVms = new ObservableCollection <WsServerNodeStateViewModel>(data.WsServerNodes.Select(a => new WsServerNodeStateViewModel(a)));
 }
コード例 #7
0
 public WsServerNodeStateViewModel(IWsServerNode data)
 {
     _address     = data.Address;
     _description = data.Description;
     _minerClientWsSessionCount = data.MinerClientWsSessionCount;
     _minerStudioWsSessionCount = data.MinerStudioWsSessionCount;
     _minerClientSessionCount   = data.MinerClientSessionCount;
     _minerStudioSessionCount   = data.MinerStudioSessionCount;
     _osInfo = data.OSInfo;
     _totalPhysicalMemory     = data.TotalPhysicalMemory;
     _availablePhysicalMemory = data.AvailablePhysicalMemory;
     _cpuPerformance          = data.CpuPerformance;
     _cpu   = data.Cpu;
     _cpuVm = new CpuDataViewModel(data.Cpu);
 }
コード例 #8
0
 public WebApiServerStateViewModel(IWebApiServerState data)
 {
     _description             = data.Description;
     _oSInfo                  = data.OSInfo;
     _totalPhysicalMemory     = data.TotalPhysicalMemory;
     _address                 = data.Address;
     _cpuPerformance          = data.CpuPerformance;
     _availablePhysicalMemory = data.AvailablePhysicalMemory;
     _processMemoryMb         = data.ProcessMemoryMb;
     _threadCount             = data.ThreadCount;
     _handleCount             = data.HandleCount;
     _availableFreeSpaceInfo  = data.AvailableFreeSpaceInfo;
     _captchaCount            = data.CaptchaCount;
     _cpu             = data.Cpu;
     _cpuVm           = new CpuDataViewModel(data.Cpu);
     _wsServerNodes   = data.WsServerNodes;
     _wsServerNodeVms = new ObservableCollection <WsServerNodeStateViewModel>(data.WsServerNodes.Select(a => new WsServerNodeStateViewModel(a)));
 }
コード例 #9
0
        private void RefreshData()
        {
            RyzenAccess.Initialize();
            Args = new uint[] { 0, 0, 0, 0, 0, 0 };
            RyzenAccess.SendPsmu(0x65, ref Args);
            int Index = 0;

            //string TestPrint = "";
            foreach (var item in Sensors)
            {
                Sensors[Index].Value = $"{ReadFloat(Address, OffsetTable[Index]):F4}";
                //Thread.Sleep(10);
                //TestPrint += (Sensors[Index].Value + Environment.NewLine);
                Index++;
            }
            CpuData.Refresh();
            RyzenAccess.Deinitialize();
            //MessageBox.Show(TestPrint);
        }
コード例 #10
0
        private void FillInTable()
        {
            Sensors.Clear();

            Sensors.Add(CreatePowerMonitoringItem("STAPM Limit", (uint)0x000));
            Sensors.Add(CreatePowerMonitoringItem("STAPM Power", (uint)0x004));
            Sensors.Add(CreatePowerMonitoringItem("Fast Limit", (uint)0x008));
            Sensors.Add(CreatePowerMonitoringItem("Current Power", (uint)0x00C));
            Sensors.Add(CreatePowerMonitoringItem("Slow Limit", (uint)0x010));
            Sensors.Add(CreatePowerMonitoringItem("Slow Power", (uint)0x014));
            Sensors.Add(CreatePowerMonitoringItem("TDC Limit", (uint)0x020));
            Sensors.Add(CreatePowerMonitoringItem("TDC Used", (uint)0x024));
            Sensors.Add(CreatePowerMonitoringItem("Soc TDC Limit", (uint)0x028));
            Sensors.Add(CreatePowerMonitoringItem("Soc TDC Used", (uint)0x02C));
            Sensors.Add(CreatePowerMonitoringItem("EDC Limit", (uint)0x030));
            Sensors.Add(CreatePowerMonitoringItem("EDC Used", (uint)0x034));
            Sensors.Add(CreatePowerMonitoringItem("Soc EDC Limit", (uint)0x038));
            Sensors.Add(CreatePowerMonitoringItem("Soc EDC Used", (uint)0x03C));
            Sensors.Add(CreatePowerMonitoringItem("Core Temperature", (uint)0x044));
            Sensors.Add(CreatePowerMonitoringItem("Gfx Temperature", (uint)0x04C));
            Sensors.Add(CreatePowerMonitoringItem("Soc Temperature", (uint)0x054));
            Sensors.Add(CreatePowerMonitoringItem("GPU  Frequency", (uint)0x5B4));
            CpuData.Update();
        }
コード例 #11
0
 public InstructionExecutionException(IEnumerable<Wren.Emulation.MasterSystem.InstructionAdvice.RecentHistory.HistoryItem> history, CpuData data, Exception innerException)
     : base("There was an error in cpu execution.", innerException)
 {
     CpuData = data;
     History = history;
 }