终端一体化运控平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

40 rindas
1.3 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. PlcDataColl.Add(new VarMonitor() { SerialNum = PlcDataColl.Count , Address="",});
  23. SetParCommand = new RelayCommand<object>((o) =>
  24. {
  25. if (o != null && o is string address)
  26. {
  27. var res = PlcDataColl.FirstOrDefault(p =>p.Address == address);
  28. }
  29. });
  30. }
  31. public static ObservableCollection<VarMonitor> PlcDataColl { get; set; } = new ObservableCollection<VarMonitor>();
  32. public RelayCommand<object> SetParCommand { get; set; }
  33. public RelayCommand Connect { get; set; }
  34. }
  35. }