/// /// Copyright (c) 2016 Sensus Metering Systems /// using System; using System.Collections.Generic; using log4net; using TBF.Boxes; using TBF.BenchControl.Keithley.RS232; namespace TBF.BenchControl.Keithley.TempMeter { public class TempMeter : ComponentBase, GenericDevices.ITempMeter { private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter)); public override string ToString() { return string.Format("Keithley.TempMeter({0})", Cfg.ToString(1)); } readonly TempMeterCfg tempMtrCfg; /// configuration public readonly Multimeter Multimeter; /// parent component public int Idx0 { get { return tempMtrCfg.Idx0; } } /// 0..3 public TempMeter() { } public TempMeter(TempMeterCfg cfg, IList components) : base(cfg) { tempMtrCfg = cfg; Multimeter = (Multimeter)TbfComponents.FindComponent(cfg.ParentName, components); if (Multimeter == null) throw new Exception("Cannot find " + Name + " parent"); log.Debug(this.ToString()); } /// /// Events: TempDone, Error /// /// Reference to a variable for the temperature in Celsius /// ReadTempOp instance reference casted to IOperaton public IOperation ReadTempOp(ref FloatBox temp) { return new ReadTempOp(this, ref temp); } /// /// Events: tempDone, Error /// /// Reference to a variable for the temperature in Celsius /// Event returned when measurement done /// ReadTempOp instance reference casted to IOperaton public IOperation ReadTempOp(ref FloatBox temp, Event tempDone) { return new ReadTempOp(this, ref temp, tempDone); } } }