MeasurementCollection GetCollectionMaybeNull(MeasType type) { switch (type) { case (MeasType.Binary): return(binaries); case (MeasType.DoubleBitBinary): return(doubleBinaries); case (MeasType.Counter): return(counters); case (MeasType.FrozenCounter): return(frozenCounters); case (MeasType.Analog): return(analogs); case (MeasType.BinaryOutputStatus): return(binaryOutputStatii); case (MeasType.AnalogOutputStatus): return(analogOutputStatii); case (MeasType.OctetString): return(octetStrings); default: return(null); } }
public MeasurementPoco(int row, string sValue, MeasurementBase meas, UInt16 index, MeasType type) { this.sValue = sValue; this.index = index; this.flags = meas.Quality.ToString("X2"); this.timeStamp = meas.Timestamp; this.row = row; this.type = type; }
public Measurement(string displayValue, TimestampMode tsmode, MeasType type, UInt16 index, IQualityBitInfo info) { this.valueAsString = displayValue; this.timeStamp = DateTime.Now; this.tsmode = tsmode; this.type = type; this.index = index; this.info = info; this.quality = 0; }
public Measurement(string displayValue, MeasurementBase meas, TimestampMode tsmode, MeasType type, UInt16 index, IQualityBitInfo info) { this.valueAsString = displayValue; this.timeStamp = (tsmode == TimestampMode.INVALID) ? DateTime.Now : meas.Timestamp; this.tsmode = tsmode; this.type = type; this.index = index; this.info = info; this.quality = meas.Quality; }
public void SetMeasure(MeasType command) { HandlerError.ClearErrors(); try { WriteCommand(MeasureType.SetMeasure(command)); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Data Adquisition Agilent 34401A. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } }
public void SetMeasure(MeasType command, string channel) { HandlerError.ClearErrors(); try { WriteCommand(MeasureType.SetMeasure(command) + " (@" + channel + ")"); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Data Adquisition Agilent 34970A. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } }
public double GetMeasure(MeasType command, int channel) { HandlerError.ClearErrors(); double measures = 0; try { WriteCommand(MeasureType.GetMeasure(command) + " (@" + channel + ")"); ReadCommand(out measures); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Data Adquisition Agilent 34970A. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } return(measures); }
public static string SetSenSe(MeasType command) { var sType = ""; switch (command) { case MeasType.VoltDc: sType = "VOLT:DC"; break; case MeasType.VoltAc: sType = "VOLT:AC"; break; case MeasType.Res: sType = "RES 100000,10,"; break; case MeasType.Fres: sType = "FRES"; break; case MeasType.CurrDc: sType = "CURR:DC"; break; case MeasType.CurrAc: sType = "CURR:AC"; break; case MeasType.Freq: sType = "FREQ"; break; case MeasType.FreqRangLow: sType = "FREQ:RANG:LOW 3"; break; case MeasType.Per: sType = "PER"; break; } return("SENS:FUNC " + (char)34 + sType + (char)34); }
void comboBoxTypes_SelectedIndexChanged(object sender, EventArgs e) { var index = this.comboBoxTypes.SelectedIndex; if (Enum.IsDefined(typeof(MeasType), index)) { MeasType type = (MeasType)Enum.ToObject(typeof(MeasType), index); var collection = cache.GetCollection(type); if (collection != null) { if (activeCollection != null) { activeCollection.RemoveObserver(this.measurementView); } activeCollection = collection; collection.AddObserver(this.measurementView); } } }
public double GetMeasure(MeasType command) { HandlerError.ClearErrors(); double measures = 0; try { var commandstring = MeasureType.GetMeasure(command); WriteCommand(commandstring); OnMeasureTypeEvent(commandstring); ReadCommand(out measures); OnMeasureEvent(Convert.ToString(measures, CultureInfo.InvariantCulture)); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Data Adquisition Agilent 34401A. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } return(measures); }
public static string SetMeasure(MeasType command) { var sType = ""; switch (command) { case MeasType.VoltDc: sType = "VOLT:DC"; break; case MeasType.VoltAc: sType = "VOLT:AC"; break; case MeasType.Res: sType = "RES 100000,10,"; break; case MeasType.Fres: sType = "FRES"; break; case MeasType.CurrDc: sType = "CURR:DC"; break; case MeasType.CurrAc: sType = "CURR:AC"; break; case MeasType.Freq: sType = "FREQ"; break; case MeasType.Per: sType = "PER"; break; } return("CONF:" + sType); }
public static string GetMeasure(MeasType command) { var sType = ""; switch (command) { case MeasType.VoltDc: sType = "VOLT:DC?"; break; case MeasType.VoltAc: sType = "VOLT:AC?"; break; case MeasType.Res: sType = "RES? 100000,10,"; break; case MeasType.Fres: sType = "FRES?"; break; case MeasType.CurrDc: sType = "CURR:DC?"; break; case MeasType.CurrAc: sType = "CURR:AC?"; break; case MeasType.Freq: sType = "FREQ?"; break; case MeasType.Per: sType = "PER?"; break; } return("MEAS:" + sType); }
public MeasurementCollection GetCollection(MeasType type) { switch (type) { case(MeasType.Binary): return binaries; case (MeasType.DoubleBitBinary): return doubleBinaries; case (MeasType.Counter): return counters; case (MeasType.FrozenCounter): return frozenCounters; case (MeasType.Analog): return analogs; case (MeasType.BinaryOutputStatus): return binaryOutputStatii; case (MeasType.AnalogOutputStatus): return analogOutputStatii; case(MeasType.OctetString): return octetStrings; default: return null; } }