IoViewModelBase.cs 980 B

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