Ejemplo n.º 1
0
 void OnDoneReadingData(object sender, DataAquiredEventArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action<object, DataAquiredEventArgs>(OnDoneReadingData), sender, e);
     }
     else
     {
         this.stopRealTimeButton.Enabled = false;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// On data acquisition update the UI with the trace.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnDataAquisition(object sender, DataAquiredEventArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action<object, DataAquiredEventArgs>(OnDataAquisition), sender, e);
     }
     else
     {
         this.stopRealTimeButton.Enabled = true;
         //
         // Check the attribute of the first channel received (all of the channels received are suppose to be of the same attribute). 
         // This will help us decide which UI Tab should be updated.
         //
         if (e.DataChannels[0].GetType().GetCustomAttributes(false)[0] is DAQAttribute)
         {
             GraphAndFileNumberUpdate(e.DataChannels as List<IDataChannel>, this.channelsListView, this.traceWaveformGraph, e.FileNumber, this.fileNumberNumericUpDown);
         }
         else if (e.DataChannels[0].GetType().GetCustomAttributes(false)[0] is IVAttribute)
         {
             GraphAndFileNumberUpdate(e.DataChannels as List<IDataChannel>, this.ivChannelsListView, this.ivWaveformGraph, e.FileNumber, this.ivFileNumberNumericUpDown);
         }
         else
         {
             GraphAndFileNumberUpdate(e.DataChannels as List<IDataChannel>, this.calibrationChannelsListView, this.calibrationWaveformGraph, e.FileNumber, this.calibrationCycleNumberNumericUpDown);
         }
     }
 }