示例#1
0
        private async void Calibrate()
        {
            var userinput1 = MessageBox.Show(Monitoring.mboxcalibrateZone,
                                             Monitoring.mboxcalibrateZoneTitle,
                                             MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (userinput1 == MessageBoxResult.Yes)
            {
                var ml = new CalibrateZone(_flow.Id, AmplifierCalibrationMode, PilotFrequency);
                CommunicationViewModel.AddData(ml);
                await ml.WaitAsync();

                if (CalibrateFinished != null)
                {
                    CalibrateFinished.Invoke();
                }
            }
            else
            {
                if (CalibrateUserCancel != null)
                {
                    CalibrateUserCancel.Invoke();
                }
            }
        }
示例#2
0
        private void ReceivedDemuxByte(GetDspValue d)
        {
            //set demuxer for this channel
            var data = (DspCoefficients.DemuxBytes(McuDat.DemuxAlarm[_flow.Id % 12], _flowMux[_flow.Id % 12] + 2, _flowMux[_flow.Id % 12])).ToArray();
            var q    = new DspData(data, _main.Id);

            CommunicationViewModel.AddData(q);
        }
示例#3
0
 /// <summary>
 /// Set timestamp for all units when this is not already done.
 /// Otherwise put downloaded esc timestamp in designfile.
 /// </summary>
 /// <param name="mainunits"></param>
 private static void UpdateTimestampConnectedUnits(IEnumerable <MainUnitViewModel> mainunits)
 {
     foreach (var mainUnitViewModel in mainunits)
     {
         //if no timestamp ever made avaiable, create one
         if (mainUnitViewModel.Timestamp == 0)
         {
             var d = new TimeStampUpdater(mainUnitViewModel.DataModel);
             CommunicationViewModel.AddData(d.TimeStamp());
         }
         else
         {
             mainUnitViewModel.DataModel.TimeStampWrittenToEsc = mainUnitViewModel.Timestamp;
         }
     }
 }
示例#4
0
 public static void AddData(IDispatchData data)
 {
     CommunicationViewModel.AddData(data);
 }