コード例 #1
0
 public async Task DisconnectFromInstrument()
 {
     if (InstrumentCommunicator != null)
     {
         await InstrumentCommunicator.Disconnect();
     }
 }
コード例 #2
0
        private async Task RunSyncTest()
        {
            await Task.Run(async() =>
            {
                if (!RunningTest)
                {
                    Log.Info("Syncing Volume...");
                    await InstrumentCommunicator.Disconnect();

                    VolumeTest.PulseACount = 0;
                    VolumeTest.PulseBCount = 0;

                    _outputBoard.StartMotor();

                    do
                    {
                        VolumeTest.PulseACount += FirstPortAInputBoard.ReadInput();
                        VolumeTest.PulseBCount += FirstPortBInputBoard.ReadInput();
                    } while (VolumeTest.UncPulseCount < 1);

                    _outputBoard.StopMotor();
                    Thread.Sleep(500);
                }
            });
        }
コード例 #3
0
        public override async Task StartVolumeTest()
        {
            if (!RunningTest)
            {
                await InstrumentCommunicator.Connect();

                VolumeTest.Items = await InstrumentCommunicator.GetItemValues(InstrumentCommunicator.ItemDetails.VolumeItems());

                await InstrumentCommunicator.Disconnect();

                VolumeTest.PulseACount = 0;
                VolumeTest.PulseBCount = 0;

                await RunningVolumeTest();
            }
        }
コード例 #4
0
        public override async Task StartVolumeTest()
        {
            if (!RunningTest)
            {
                await RunSyncTest();

                if (_tachometerCommunicator != null)
                {
                    await _tachometerCommunicator?.ResetTach();
                }

                await InstrumentCommunicator.Connect();

                VolumeTest.Items = await InstrumentCommunicator.GetItemValues(InstrumentCommunicator.ItemDetails.VolumeItems());

                await InstrumentCommunicator.Disconnect();

                await RunningVolumeTest();
            }
        }