终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

54 satır
1.7 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.ObjectModel;
  8. using BPASmartClient.JXJFoodSmallStation.Model;
  9. using BPASmartClient.Helper;
  10. using Microsoft.Toolkit.Mvvm.Input;
  11. using BPASmartClient.CustomResource.UserControls.MessageShow;
  12. using BPASmartClient.CustomResource.UserControls;
  13. using System.Diagnostics;
  14. using BPASmartClient.JXJFoodSmallStation.Model.Siemens;
  15. using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC;
  16. namespace BPASmartClient.JXJFoodSmallStation.ViewModel
  17. {
  18. public class ManualCommViewModel : ObservableObject
  19. {
  20. public ManualCommViewModel()
  21. {
  22. for (int i = 0; i < 8; i++)
  23. {
  24. if (i < 4)
  25. {
  26. PlcInfo.Add(new PlcManualComm()
  27. {
  28. SerialNum = PlcInfo.Count + 1,
  29. Address = "DB3.DBD" + (10 + 4 * i),
  30. Describe = $"托盘1_{i + 1}#桶位置反馈",
  31. });
  32. }
  33. else
  34. {
  35. PlcInfo.Add(new PlcManualComm()
  36. {
  37. SerialNum = PlcInfo.Count + 1,
  38. Address = "DB3.DBD" + (10 + 4 * i),
  39. Describe = $"托盘2_{i-3}#桶位置反馈",
  40. });
  41. }
  42. }
  43. }
  44. public ObservableCollection<PlcManualComm> PlcInfo { get; set; } = new ObservableCollection<PlcManualComm>();
  45. public RelayCommand<object> SetParCommand { get; set; }
  46. public RelayCommand Connect { get; set; }
  47. }
  48. }