IoViewModelBase.cs 1.0 KB

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