private async Task InitializeSlavesConnection()
        {
            IsProcessing = true;
            await ModbusTransferManager.InitializeModbusSlaveTransfers();

            IsProcessing = false;
        }
Пример #2
0
 public MainWindowViewModel()
 {
     ModbusTransferManager = new ModbusTransferManager(this);
     SlaveModules          = new List <ISlaveModule> {
         new DesignSlaveModule(),
         new DesignSlaveModule(),
         new DesignSlaveModule(),
     };
 }
        public MainWindowViewModel(CompositionContainer compositionContainer)
        {
            compositionContainer.ComposeParts(this);
            InitializeCommands();
            ModbusTransferManager = new ModbusTransferManager(this);

            ActiveMasterScadaDevices = new ObservableCollection <IMasterModuleProcess>();
            ActiveSlaveDevices       = new ObservableCollection <SlaveModuleProcessBase>();
        }
        private async Task AddNewScadaModule()
        {
            IsProcessing = true;

            var masterModuleProcess = new MasterModuleProcess(this);

            if (await ModbusTransferManager.ConnectMaster(masterModuleProcess.Identifier))
            {
                ActiveMasterScadaDevices.Add(masterModuleProcess);
            }

            IsProcessing = false;
        }
 public override void Dispose()
 {
     base.Dispose();
     ModbusTransferManager.Dispose();
 }