public void UpdateData(Data.TimersInfo info) { if (info != null) { double total = info.Total; double active = info.Active; double idle = info.Idle; double alert = info.Alert; if (total > 0) { ActivePercentage = active / total; IdlePercentage = idle / total; AlertPercentage = alert / total; } if (active > idle && active > alert) { Status = 2; } else if (idle > alert && idle > active) { Status = 1; } else { Status = 0; } ActiveTime = TimeSpan.FromSeconds(Math.Min(active, double.MaxValue)); IdleTime = TimeSpan.FromSeconds(Math.Min(idle, double.MaxValue)); AlertTime = TimeSpan.FromSeconds(Math.Min(alert, double.MaxValue)); } }
private void UpdateDeviceData(string uniqueId, Data.TimersInfo info) { var deviceInfo = cachedDevicesInfos.Find(o => o.UniqueId == uniqueId); if (deviceInfo == null) { deviceInfo = new Data.DeviceInfo(); deviceInfo.UniqueId = uniqueId; cachedDevicesInfos.Add(deviceInfo); } deviceInfo.Timers = info; }
public void UpdateData(Data.TimersInfo info) { if (info != null) { TotalSeconds = info.Total; ProductionSeconds = info.Production; SetupSeconds = info.Setup; TeardownSeconds = info.Teardown; MaintenanceSeconds = info.Maintenance; ProcessDevelopmentSeconds = info.ProcessDevelopment; } }
public void UpdateData(Data.TimersInfo info) { if (info != null) { double total = info.Total; // Device Status double active = info.Active; double idle = info.Idle; double alert = info.Alert; if (total > 0) { ActivePercentage = (active / total) * 100; IdlePercentage = (idle / total) * 100; AlertPercentage = (alert / total) * 100; } ActiveTime = TimeSpan.FromSeconds(active); IdleTime = TimeSpan.FromSeconds(idle); AlertTime = TimeSpan.FromSeconds(alert); // Production Status double production = info.Production; double setup = info.Setup; double teardown = info.Teardown; double maintenance = info.Maintenance; double processDevelopment = info.ProcessDevelopment; if (total > 0) { ProductionPercentage = (production / total) * 100; SetupPercentage = (setup / total) * 100; TeardownPercentage = (teardown / total) * 100; MaintenancePercentage = (maintenance / total) * 100; ProcessDevelopmentPercentage = (processDevelopment / total) * 100; } ProductionTime = TimeSpan.FromSeconds(production); SetupTime = TimeSpan.FromSeconds(setup); TeardownTime = TimeSpan.FromSeconds(teardown); MaintenanceTime = TimeSpan.FromSeconds(maintenance); ProcessDevelopmentTime = TimeSpan.FromSeconds(processDevelopment); } }