终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SystemSetViewModel.cs 1.7 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using BPASmartClient.Helper;
  8. using BPASmartClient.Model;
  9. using Microsoft.Toolkit.Mvvm.ComponentModel;
  10. using Microsoft.Toolkit.Mvvm.Input;
  11. namespace BPASmartClient.ViewModel
  12. {
  13. public class SystemSetViewModel : ObservableObject
  14. {
  15. public SystemSetViewModel()
  16. {
  17. if (SaveInfoCommand == null)
  18. {
  19. //SaveInfoCommand = new Action(() =>
  20. //{
  21. // List<ushort> values = new List<ushort>();
  22. // values.Clear();
  23. // List<bool> bools = new List<bool>();
  24. // bools.Clear();
  25. // for (int i = 0; i < Json<KeepDataBase>.Data.parSets.Count; i++)
  26. // {
  27. // values.Clear();
  28. // values.Add(Json<KeepDataBase>.Data.parSets[i].Minute);
  29. // values.Add(Json<KeepDataBase>.Data.parSets[i].Second);
  30. // bools.Add(Json<KeepDataBase>.Data.parSets[i].IsShield);
  31. // //ModbusTcpHelper.GetInstance.Write((ushort)ModbusTcpHelper.GetInstance.GetWordAddress($"VW{116 + (i * 6)}"), WriteType.HoldingRegisters, values.ToArray());
  32. // }
  33. // //ModbusTcpHelper.GetInstance.Write((ushort)ModbusTcpHelper.GetInstance.GetBoolAddress("M260.0"), WriteType.Coils, bools.ToArray());
  34. //});
  35. }
  36. }
  37. //public ObservableCollection<ParSet> parSets { get; set; } = Json<KeepDataBase>.Data.parSets;
  38. public Action SaveInfoCommand { get; set; }
  39. }
  40. }