终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
1.5 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.Toolkit.Mvvm.ComponentModel;
  7. using System.Collections.Concurrent;
  8. using System.Collections.ObjectModel;
  9. using System.Windows;
  10. using BPASmartClient.Helper;
  11. using Microsoft.Toolkit.Mvvm.Input;
  12. using BPASmartClient.JXJFoodBigStation.Model;
  13. namespace BPASmartClient.JXJFoodBigStation.ViewModel
  14. {
  15. public class HardwareStatusViewModel : ObservableObject
  16. {
  17. public HardwareStatusViewModel()
  18. {
  19. for (int i = 0; i <8; i++)
  20. {
  21. TopDeviceCurrentStatuses.Add(new DeviceCurrentStatus()
  22. {
  23. DeviceName = i.ToString(),
  24. RunStatus = false,
  25. Weight = new Random().Next(0, 100)
  26. });
  27. }
  28. for (int i = 8; i < 16; i++)
  29. {
  30. BottomDeviceCurrentStatuses.Add(new DeviceCurrentStatus()
  31. {
  32. DeviceName = i.ToString(),
  33. RunStatus = false,
  34. Weight = new Random().Next(0, 100)
  35. });
  36. }
  37. }
  38. public ObservableCollection<DeviceCurrentStatus> TopDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>();
  39. public ObservableCollection<DeviceCurrentStatus> BottomDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>();
  40. }
  41. }