IOViewModel.cs 999 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections.ObjectModel;
  2. using Aitex.Core.UI.MVVM;
  3. using MECF.Framework.Common.IOCore;
  4. namespace MECF.Framework.Simulator.Core.IoProviders
  5. {
  6. public class IOViewModel : TimerViewModelBase
  7. {
  8. public SimulatorIO Plc { get; set; }
  9. public ObservableCollection<NotifiableIoItem> DiItemList { get; set; }
  10. public ObservableCollection<NotifiableIoItem> DoItemList { get; set; }
  11. public ObservableCollection<NotifiableIoItem> AiItemList { get; set; }
  12. public ObservableCollection<NotifiableIoItem> AoItemList { get; set; }
  13. public IOViewModel(int port, string source, string ioMapPathFile) : base(nameof(IOViewModel))
  14. {
  15. Plc = new SimulatorIO(port, source, ioMapPathFile);
  16. DiItemList = Plc.DiItemList;
  17. DoItemList = Plc.DoItemList;
  18. AiItemList = Plc.AiItemList;
  19. AoItemList = Plc.AoItemList;
  20. }
  21. protected override void Poll()
  22. {
  23. }
  24. }
  25. }