Пример #1
0
 public TriggerProperties()
 {
     ActiveHighInput  = false;
     ActiveHighOutput = false;
     PlayInput        = false;
     PlayOutput       = false;
     RecordInput      = false;
     RecordOutput     = false;
     SignalInput      = false;
     SignalOutput     = false;
     DelaySeconds     = 0;
     DelayFrames      = 0;
     InputDeviceId    = 0;
     InputBitMask     = 0;
     OutputDeviceMask = 0;
     OutputBitMask    = 0;
     PulseLength      = 0.0f;
     PulseCycle       = 0.0f;
     PulseRepeat      = 0;
     Description      = "Trigger 0";
     TriggerId        = 0;
     //
     InputEnabled  = false;
     OutputEnabled = false;
     IsOn          = false;
     IsPrimedOnly  = false;
     NumLeft       = 0;
     ActionTime    = 0;
     AxisPort      = null;
 }
Пример #2
0
 public RecorderAxisPoint(AxisPortProperties axisPortPorperties, List <double> point,
                          bool isTarget, bool updateSeries, bool seriesResetRequired)
 {
     IsTarget                 = isTarget;
     UpdateSeries             = updateSeries;
     SeriesResetRequired      = seriesResetRequired;
     SeriesAxisPortPorperties = axisPortPorperties;
     AxisPoint                = point;
 }
Пример #3
0
 public void UpdateAxisState(AxisPortProperties ap)
 {
     if (Application.Current.Dispatcher.CheckAccess())
     {
         if (!IsClosing)
         {
             for (int k = 0; k < ap.AxesOnPort.Count; k++)
             {
                 Button b = this.FindName("AxisState" + ap.AxesOnPort[k].AxisId.ToString()) as Button;
                 if (b != null)
                 {
                     b.Background = AxisStateBrushes[(int)ap.AxesOnPort[k].AxisState];
                 }
             }
         }
     }
     else
     {
         Application.Current.Dispatcher.Invoke((Action)(() => { UpdateAxisState(ap); }));
     }
 }
Пример #4
0
 // Copies all members apart from lists, which are cleared.
 public void PartialCopy(AxisPortProperties p)
 {
     CurrentComponentState   = p.CurrentComponentState;
     NetIfIndex              = p.NetIfIndex;
     AxisPortPropertiesIndex = 0;
     DataOffset              = 0;
     DataCount             = 0;
     CurrentPVTQueueSize   = p.CurrentPVTQueueSize;
     CurrentInputTriggers  = p.CurrentInputTriggers;
     CurrentOutputTriggers = p.CurrentOutputTriggers;
     PriorInputTriggers    = p.PriorInputTriggers;
     PriorOutputTriggers   = p.PriorOutputTriggers;
     StatusReportTimeout   = p.StatusReportTimeout;
     TriggerReportTimeout  = p.TriggerReportTimeout;
     PVTMonitoringTimeout  = p.PVTMonitoringTimeout;
     IsoActualTimeout      = p.IsoActualTimeout;
     DeviceNumber          = p.DeviceNumber;
     DeviceId = p.DeviceId;
     Port     = p.Port;
     TargetOffsetTable.Clear();
     ActualOffsetTable.Clear();
 }
Пример #5
0
 // When playing cache count = total size = CurrentRelativeChartCacheIndex,
 // whereas CurrentPlayIndex is somewhere inbetween.
 // Need to show AP series up to that point.
 // When playing, updates ActualPos (AP) series only, otherwise both.
 // Uses NaN's to mask out unused series points.
 private void UpdateSeries()
 {
     try {
         while (!IsClosing && ChartPlotter != null && (AxisPointTaskQueue.Size() > 0))
         {
             RecorderAxisPoint rap = AxisPointTaskQueue.Take();
             if (rap != null && !IsClosing)
             {
                 AxisPortProperties ap = rap.SeriesAxisPortPorperties;
                 List <double>      p  = rap.AxisPoint;
                 bool isTarget         = rap.IsTarget;
                 if (rap.SeriesResetRequired)
                 {
                     ResetSeries();
                 }
                 foreach (AxisProperties a in ap.AxesOnPort)
                 {
                     if (rap.UpdateSeries)
                     {
                         if (isTarget)
                         {
                             if (a.TargetSeries != null)
                             {
                                 try {
                                     double yt = p[a.DataPVTOffset + 1];
                                     if (!Double.IsNaN(yt))
                                     {
                                         UpdateSeries(a.TargetSeries, p[0], yt);
                                     }
                                 } catch (Exception) {
                                     // Index out of range.
                                 }
                             }
                         }
                         else
                         {
                             if (a.ActualSeries != null)
                             {
                                 try {
                                     double ya = p[a.DataPVTOffset];
                                     if (!Double.IsNaN(ya))
                                     {
                                         UpdateSeries(a.ActualSeries, p[0], ya);
                                     }
                                 } catch (Exception) {
                                     // Index out of range.
                                 }
                             }
                         }
                     }
                     if (!isTarget)
                     {
                         try {
                             Recorder.UpdateAxisPosition(a.AxisId, p[a.DataPVTOffset]);
                         } catch (Exception) {
                             // Index out of range.
                         }
                     }
                 }
             }
         }
     } catch (ThreadInterruptedException) {
     } catch (Exception e) {
         if (IsClosing)
         {
             return;
         }
         // ignore.
         Log.d(TAG, "UpdateSeries exception:" + e.Message);
     }
 }