Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 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);
     }
 }
Ejemplo n.º 7
0
 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);
     }
 }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
                }
            }
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        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);
        }
Ejemplo n.º 14
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;
 }
Ejemplo n.º 15
0
 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;
 }
Ejemplo n.º 16
0
 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;
     }
 }