1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System.Collections.ObjectModel;
- using Aitex.Core.UI.MVVM;
- using MECF.Framework.Common.IOCore;
- using MECF.Framework.Simulator.Core.IoProviders;
- using EfemDualSimulator.Instances;
- namespace EfemDualSimulator.Views
- {
- public class IoViewModel : TimerViewModelBase
- {
- public SimulatorModulePlc PlcModule { get; set; }
- public SimulatorIO PlcSystem { get; set; }
- public ObservableCollection<NotifiableIoItem> DIs { get; set; }
- public ObservableCollection<NotifiableIoItem> DOs { get; set; }
- public ObservableCollection<NotifiableIoItem> AIs { get; set; }
- public ObservableCollection<NotifiableIoItem> AOs { get; set; }
- public IoViewModel(int port, string source, string ioMapPathFile, string module) : base(nameof(IoViewModel))
- {
- if (string.IsNullOrEmpty(module) )
- {
- PlcSystem = new SimulatorIO(port, source, ioMapPathFile);
- DIs = PlcSystem.DiItemList;
- DOs = PlcSystem.DoItemList;
- AIs = PlcSystem.AiItemList;
- AOs = PlcSystem.AoItemList;
- }
- else
- {
- PlcModule = new SimulatorModulePlc(port, source, ioMapPathFile, module);
- DIs = PlcModule.DiItemList;
- DOs = PlcModule.DoItemList;
- AIs = PlcModule.AiItemList;
- AOs = PlcModule.AoItemList;
- }
- }
- protected override void Poll()
- {
- }
- }
- }
|