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

30 lines
967 B

  1. using BPASmartClient.FoodStationTest.Model;
  2. using Microsoft.Toolkit.Mvvm.ComponentModel;
  3. using Microsoft.Toolkit.Mvvm.Input;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. namespace BPASmartClient.FoodStationTest.ViewModel
  7. {
  8. public class ManualCommViewModel : ObservableObject
  9. {
  10. public ManualCommViewModel()
  11. {
  12. PlcDataColl.Add(new VarMonitor() { SerialNum = PlcDataColl.Count, Address = "", });
  13. SetParCommand = new RelayCommand<object>((o) =>
  14. {
  15. if (o != null && o is string address)
  16. {
  17. var res = PlcDataColl.FirstOrDefault(p => p.Address == address);
  18. }
  19. });
  20. }
  21. public static ObservableCollection<VarMonitor> PlcDataColl { get; set; } = new ObservableCollection<VarMonitor>();
  22. public RelayCommand<object> SetParCommand { get; set; }
  23. public RelayCommand Connect { get; set; }
  24. }
  25. }