public bool Delete(SensorDesignatorEnum Designator) { if (!_sensors.ContainsKey(Designator)) { return(false); } _sensors.Remove(Designator); return(true); }
public bool GetReading(TriggerTypeEnum TriggerType, SensorDesignatorEnum Designator, out double Reading) { Reading = 999999; if (!_sensors.ContainsKey(Designator)) { return(false); } return(GetReading(TriggerType, this[Designator], out Reading)); }
// Indexer public SensorClass this[SensorDesignatorEnum Designator] { get { if (!_sensors.ContainsKey(Designator)) { throw new System.ArgumentException("Sensor doesn't exist", "Designator"); } return(_sensors[Designator]); } }
// Public Methods public bool Add(SensorDesignatorEnum Designator, SensorTypeEnum SensorType) { if (_sensors.ContainsKey(Designator)) { return(false); } switch (SensorType) { case SensorTypeEnum.Peak_80350A: _sensors.Add(Designator, new PeakSensor80350AClass(_parentGigatronics854x, Designator, SensorTypeEnum.Peak_80350A)); break; case SensorTypeEnum.Regular: _sensors.Add(Designator, new SensorClass(_parentGigatronics854x, Designator, SensorTypeEnum.Regular)); break; } return(true); }
// Constructor internal SensorClass(Gigatronics854x ParentGigatronics854x, SensorDesignatorEnum Designator, SensorTypeEnum Type) { _parentGigatronics854x = ParentGigatronics854x; this.Designator = Designator; this.Type = Type; Averaging = new AveragingClass(this); Offset = new OffsetClass(this); switch (this.Designator) { case SensorDesignatorEnum.A: _charDesignator = 'A'; break; case SensorDesignatorEnum.B: _charDesignator = 'B'; break; default: _charDesignator = 'A'; break; } }
// Constructor internal PeakSensor80350AClass(Gigatronics854x ParentGigatronics854x, SensorDesignatorEnum Designator, SensorTypeEnum Type) : base(ParentGigatronics854x, Designator, Type) { }