Beispiel #1
0
        protected virtual void OnBufferFull(InstrumentDatasetEventArgs e)
        {
            EventHandler <InstrumentDatasetEventArgs> handler = BufferFull;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Beispiel #2
0
        protected void OnSaveData(InstrumentDatasetEventArgs e)
        {
            EventHandler <InstrumentDatasetEventArgs> handler = SaveData;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        /**
         * Decides whether the saver-object should process the data
         * based on the settings (how often to save compared to how often data is retrieved from the device)
         * */
        protected override void updateEvents()
        {
            //Todo
            //Call the data saver(s) like this
            InstrumentDatasetEventArgs datEvent = new InstrumentDatasetEventArgs();

            datEvent.dataSet = new PSUDataset();
            datEvent.dataSet.AddData(dataSet.getLatestData());

            OnSaveData(datEvent);
        }
        protected override void updateEvents()
        {
            base.updateEvents();

            InstrumentDatasetEventArgs datEvent = new InstrumentDatasetEventArgs();

            datEvent.dataSet = new PicoTC08InstrumentDataset();
            datEvent.dataSet.AddData(currentDataset.getLatestData());

            OnSaveData(datEvent);
        }
        private void ke2700Instr_SaveData(object sender, InstrumentDatasetEventArgs e)
        {
            double[,] dat = e.dataSet.getLatestData();

            object[] args = new object[2];
            args[0] = dgvKeithley2700;
            args[1] = dat;

            BeginInvoke(new UpdateDataGridAsync(updateDataGridView), args);

            BeginInvoke(new SaveData(saveData), dat);
        }
Beispiel #6
0
        protected override void updateEvents()
        {
            base.updateEvents();

            /**
             * Decides whether the saver-object should process the data
             * based on the settings (how often to save compared to how often data is retrieved from the device)
             * */
            InstrumentDatasetEventArgs datEvent = new InstrumentDatasetEventArgs();

            datEvent.dataSet = new Keithley2700SeebeckDataset();
            datEvent.dataSet.AddData(dataSet.getLatestData());

            OnSaveData(datEvent);
        }
Beispiel #7
0
        public virtual void AddData(double[,] data)
        {
            if (currentPos >= bs)
            {
                //Make an eventArgs with the current buffer data
                InstrumentDatasetEventArgs e = new InstrumentDatasetEventArgs();
                e.dataSet = this;
                //raise the event that the buffer is being reset
                OnBufferFull(e);
                //Reset the buffer
                initArrays();

                //Reset the position
                currentPos = -1;
                latestRead = 0;
            }
        }
        /**
         * Stores the data that was just received from the PSU
         * */
        protected override void storeData(InstrumentDataset data)
        {
            base.storeData(data);
            try
            {
                InstrumentDatasetEventArgs datEvent = new InstrumentDatasetEventArgs();

                datEvent.dataSet = data;

                if (datEvent.dataSet != null)
                {
                    OnSaveData(datEvent);
                }
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #9
0
        void psu_SaveData(object sender, InstrumentDatasetEventArgs e)
        {
            PSUDataset dat = (PSUDataset)(e.dataSet);

            double[,] data = dat.getLatestData();

            updateField(txtChannel1CurrentGet, (data[(int)PSUDataArrayIndices.CurrentChan1, 0]).ToString());
            updateField(txtChannel2CurrentGet, (data[(int)PSUDataArrayIndices.CurrentChan2, 0]).ToString());

            updateField(txtChannel1VoltageGet, (data[(int)PSUDataArrayIndices.VoltageChan1, 0]).ToString());
            updateField(txtChannel2VoltageGet, (data[(int)PSUDataArrayIndices.VoltageChan2, 0]).ToString());

            if (SettingsChangedUpdate != null)
            {
                PSUChangedUpdateEventArgs args = new PSUChangedUpdateEventArgs();
                args.settingsChanged = true;
                SettingsChangedUpdate(this, args);
            }
        }
        private void picoInstrument_SaveData(object sender, InstrumentDatasetEventArgs e)
        {
            double[,] dat = e.dataSet.getLatestData();

            object[] args = new object[2];
            args[0] = datGrdPico;
            args[1] = dat;

            if (ReadingsUpdate != null)
            {
                ReadingsUpdateEventArgs ex = new ReadingsUpdateEventArgs();
                ex.readings = dat;
                //e.measurementTypes = getMeasurementTypes();
                //e.names = getMeasurementNames();
                //e.chanEnabled = getMeasurementChanEnabled();
                ReadingsUpdate(this, ex);
            }


            BeginInvoke(new UpdateDataGridAsync(updateDataGridView), args);
        }
        private void Hallprobe_SaveData(object sender, InstrumentDatasetEventArgs e)
        {
            double[,] dat = e.dataSet.getLatestData();
            if (dat != null)
            {
                //find the mean and stdev values
                double[] meanVals  = new double[dat.GetLength(0)];
                double[] stdevVals = new double[dat.GetLength(0)];
                MathFunctions.getMeanStdev(dat, ref meanVals, ref stdevVals);

                object[] args = new object[2];
                args[0] = meanVals;
                args[1] = stdevVals;

                BeginInvoke(new UpdateGUIAsync(updateGUIAsync), args);

                args    = new object[3];
                args[0] = dat;
                args[1] = meanVals;
                args[2] = stdevVals;

                BeginInvoke(new SaveData(saveData), args);
            }
        }
 protected override void OnBufferFull(InstrumentDatasetEventArgs e)
 {
     base.OnBufferFull(e);
 }
 private void dataSet_BufferFull(object sender, InstrumentDatasetEventArgs e)
 {
     throw new NotImplementedException();
 }