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

59 line
2.0 KiB

  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 BPA.Helper;
  8. using BPASmartClient.Model;
  9. using BPASmartClient.MorkSVer3.Model;
  10. using BPA.Helper;
  11. using BPASmartClient.CustomResource.UserControls.MessageShow;
  12. using BPASmartClient.CustomResource.Pages.Model;
  13. namespace BPASmartClient.MorkSVer3.ViewModel
  14. {
  15. public class ParSetViewModel : NotifyBase
  16. {
  17. public ParSetViewModel()
  18. {
  19. SaveInfoCommand = new BPARelayCommand(SaveSettingData);
  20. //ActionManage.GetInstance.Register(SaveSettingData, "初始化设定煮面时间");
  21. }
  22. public BPARelayCommand SaveInfoCommand { get; set; }
  23. public ObservableCollection<ParSet> parSets { get; set; } = Json<MorksPar>.Data.parSets;
  24. //public ObservableCollection<ParSet> DishLibraryParSets { get; set; } = Json<MorksPar>.Data.DishLibraryParSets;
  25. private void SaveSettingData()
  26. {
  27. //List<ushort> values = new List<ushort>();
  28. //values.Clear();
  29. //List<bool> bools = new List<bool>();
  30. //bools.Clear();
  31. //for (int i = 0; i < Json<MorksPar>.Data.parSets.Count; i++)
  32. //{
  33. // values.Clear();
  34. // values.Add(Json<MorksPar>.Data.parSets[i].Minute);
  35. // values.Add(Json<MorksPar>.Data.parSets[i].Second);
  36. // bools.Add(Json<MorksPar>.Data.parSets[i].IsShield);
  37. // ActionManage.GetInstance.Send("WriteVW", new WritePar() { Address = $"VW{116 + (i * 6)}", Value = values.ToArray() });
  38. //}
  39. //ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M260.0", Value = bools.ToArray() });
  40. var result = MessageNotify.GetInstance.ShowDialog("是否保存煮面口设置信息?");
  41. if (result)
  42. {
  43. Json<MorksPar>.Save();
  44. }
  45. }
  46. }
  47. }