终端一体化运控平台
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.

преди 2 години
преди 2 години
преди 2 години
преди 2 години
преди 2 години
преди 2 години
123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using BPASmartClient.Helper;
  2. using BPASmartClient.MorkM.Model;
  3. using Microsoft.Toolkit.Mvvm.ComponentModel;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Collections.ObjectModel;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace BPASmartClient.MorkM.ViewModel
  11. {
  12. internal class ParSetViewModel: ObservableObject
  13. {
  14. public ParSetViewModel()
  15. {
  16. SaveInfoCommand = new Action(() =>
  17. {
  18. List<ushort> values = new List<ushort>();
  19. values.Clear();
  20. List<bool> bools = new List<bool>();
  21. bools.Clear();
  22. for (int i = 0; i < Json<MorksPar>.Data.parSets.Count; i++)
  23. {
  24. values.Clear();
  25. values.Add(Json<MorksPar>.Data.parSets[i].Minute);
  26. values.Add(Json<MorksPar>.Data.parSets[i].Second);
  27. bools.Add(Json<MorksPar>.Data.parSets[i].IsShield);
  28. ActionManage.GetInstance.Send("WriteVW", new WritePar() { Address = $"VW{116 + (i * 6)}", Value = values.ToArray() });
  29. }
  30. ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M260.0", Value = bools.ToArray() });
  31. Json<MorksPar>.Save();
  32. });
  33. }
  34. public Action SaveInfoCommand { get; set; }
  35. public ObservableCollection<ParSet> parSets { get; set; } = Json<MorksPar>.Data.parSets;
  36. }
  37. }