public void UpdateData(Data.StatusInfo info) { if (info != null) { if (!string.IsNullOrEmpty(info.DeviceStatus)) { switch (info.DeviceStatus.ToLower()) { case "active": StatusBrush = Brush_Functions.GetSolidBrushFromResource(this, "StatusGreen"); break; case "idle": StatusBrush = Brush_Functions.GetSolidBrushFromResource(this, "StatusOrange"); break; case "alert": StatusBrush = Brush_Functions.GetSolidBrushFromResource(this, "StatusRed"); break; default: StatusBrush = Brush_Functions.GetSolidBrushFromResource(this, "Disabled"); break; } } else { StatusBrush = Brush_Functions.GetSolidBrushFromResource(this, "Disabled"); } Connected = info.Connected == 1; if (!string.IsNullOrEmpty(info.DeviceStatus)) { DeviceStatus = info.DeviceStatus; } //if (!string.IsNullOrEmpty(info.ProductionStatus)) ProductionStatus = info.ProductionStatus; //DeviceStatusTime = TimeSpan.FromSeconds(info.DeviceStatusTimer); } }
public void UpdateData(Data.StatusInfo info) { if (info != null) { Connected = info.Connected == 1; if (!string.IsNullOrEmpty(info.DeviceStatus)) { DeviceStatus = info.DeviceStatus; } if (!string.IsNullOrEmpty(info.ProductionStatus)) { ProductionStatus = info.ProductionStatus; } DayRunTime = TimeSpan.FromSeconds(info.DayRun); DayOperatingTime = TimeSpan.FromSeconds(info.DayOperating); DayCuttingTime = TimeSpan.FromSeconds(info.DayCutting); DaySpindleTime = TimeSpan.FromSeconds(info.DaySpindle); TotalRunTime = info.TotalRun / 3600; TotalOperatingTime = info.TotalOperating / 3600; TotalCuttingTime = info.TotalCutting / 3600; TotalSpindleTime = info.TotalSpindle / 3600; } }
public void UpdateData(Data.StatusInfo info) { if (info != null) { Connected = info.Connected == 1; if (!string.IsNullOrEmpty(info.DeviceStatus)) { DeviceStatus = info.DeviceStatus; } } }
private void UpdateDeviceData(string uniqueId, Data.StatusInfo info) { var deviceInfo = cachedDevicesInfos.Find(o => o.UniqueId == uniqueId); if (deviceInfo == null) { deviceInfo = new Data.DeviceInfo(); deviceInfo.UniqueId = uniqueId; cachedDevicesInfos.Add(deviceInfo); } deviceInfo.Status = info; }
public void UpdateData(Data.StatusInfo info) { if (info != null) { Connected = info.Connected == 1; if (!string.IsNullOrEmpty(info.DeviceStatus)) { DeviceStatus = info.DeviceStatus; } if (!string.IsNullOrEmpty(info.ProductionStatus)) { ProductionStatus = info.ProductionStatus; } DeviceStatusTime = TimeSpan.FromSeconds(info.DeviceStatusTimer); } }