void on_cmd_startNoiseDefR(object sender, RoutedEventArgs e)
        {
            if (experiment != null)
            {
                experiment.Dispose();
            }

            var calPath = string.Format("{0}\\{1}", AppDomain.CurrentDomain.BaseDirectory, "NoiseCalibration");
            var amplifierNoiseFilePath    = string.Format("{0}\\{1}", calPath, "AmplifierNoise.dat");
            var frequencyResponseFilePath = string.Format("{0}\\{1}", calPath, "FrequencyResponse.dat");

            var amplifierNoise    = ReadCalibrationFile(amplifierNoiseFilePath);
            var frequencyResponse = ReadCalibrationFile(frequencyResponseFilePath);


            var motorDriver           = new SerialDevice("COM5", 115200, Parity.None, 8, StopBits.One);
            IMotionController1D motor = new SA_2036U012V(motorDriver) as IMotionController1D;

            experiment = new Noise_DefinedResistance(((measurementInterface as Noise_at_DefinedResistance).DataContext as Noise_DefinedResistanceModel).ExperimentSettings.AgilentU2542AResName, motor, amplifierNoise, frequencyResponse);

            experiment.DataArrived += Noise_at_der_R_DataArrived;

            experiment.Status   += experimentStatus;
            experiment.Progress += experimentProgress;

            if (measurementInterface != null)
            {
                if (measurementInterface is Noise_at_DefinedResistance)
                {
                    experiment.Start(((measurementInterface as Noise_at_DefinedResistance).DataContext as Noise_DefinedResistanceModel).ExperimentSettings);
                }
            }
        }
        void cmdStartTransfer_Click(object sender, RoutedEventArgs e)
        {
            (measurementInterface as FET_IV).expTransfer_FET_Chart.Children.RemoveAll(typeof(LineGraph));
            (measurementInterface as FET_IV).expTransfer_FET_Chart.Legend.Visibility = System.Windows.Visibility.Visible;

            expStartInfo = (measurementInterface as FET_IV).DataContext;
            var settings = expStartInfo as FET_IVModel;

            if (driver != null)
            {
                driver.Dispose();
            }
            if (measureDevice != null)
            {
                measureDevice.Dispose();
            }

            driver        = new VisaDevice(settings.KeithleyRscName);
            measureDevice = new Keithley26xxB <Keithley2602B>(driver);

            var DrainSourceSMU = measureDevice[settings.TransferVdsChannel];
            var GateSMU        = measureDevice[settings.TransferVgChannel];

            experiment = new FET_Transfer_Experiment(DrainSourceSMU, GateSMU) as IExperiment;

            experiment.ExpStarted  += onExperimentStarted;
            experiment.DataArrived += expTransfer_FET_dataArrived;
            experiment.Progress    += experimentProgress;
            experiment.Status      += experimentStatus;

            experiment.Start(expStartInfo);
        }
        void cmdStartIV_at_defR_Click(object sender, RoutedEventArgs e)
        {
            // Has to be implemented in another section of code

            var smuDriver = new VisaDevice("GPIB0::26::INSTR") as IDeviceIO;
            var keithley  = new Keithley26xxB <Keithley2602B>(smuDriver);
            var smu       = keithley[Keithley26xxB_Channels.Channel_A];

            var motorDriver = new SerialDevice("COM1", 115200, Parity.None, 8, StopBits.One);
            var motor       = new SA_2036U012V(motorDriver) as IMotionController1D;

            experiment              = new IV_DefinedResistance(smu, motor) as IExperiment;
            experiment.DataArrived += experimentIV_at_def_R_DataArrived;

            experiment.Status   += experimentStatus;
            experiment.Progress += experimentProgress;

            if (measurementInterface != null)
            {
                if (measurementInterface is IV_at_DefinedResistance)
                {
                    experiment.Start(((measurementInterface as IV_at_DefinedResistance).DataContext as IV_DefinedResistanceModel).ExperimentSettigns);
                }
            }
        }
        void cmdStartNoise_Click(object sender, RoutedEventArgs e)
        {
            var control  = measurementInterface as FET_Noise;
            var settings = (control.DataContext as FET_NoiseModel).ExperimentSettings;

            //control.chartFETOscilloscope.Children.RemoveAll(typeof(LineGraph));
            //control.chartFETOscilloscope.Legend.Visibility = System.Windows.Visibility.Collapsed;

            //control.graphFETNoise.Children.RemoveAll(typeof(NationalInstruments.Controls.Plot));
            //var psdPlot = new NationalInstruments.Controls.Plot();
            //control.graphFETNoise.Plots.Add(psdPlot);

            //(measurementInterface as FET_Noise).chartFETNoise.Children.RemoveAll(typeof(LineGraph));
            //(measurementInterface as FET_Noise).chartFETNoise.Legend.Visibility = System.Windows.Visibility.Collapsed;

            //var psdGraph = new LineGraph(FETNoiseDataSource);
            //psdGraph.AddToPlotter(control.chartFETNoise);
            //control.chartFETNoise.Viewport.FitToView();

            if (experiment != null)
            {
                experiment.Dispose();
            }

            var calPath = string.Format("{0}\\{1}", AppDomain.CurrentDomain.BaseDirectory, "NoiseCalibration");
            var amplifierNoiseFilePath    = string.Format("{0}\\{1}", calPath, "AmplifierNoise.dat");
            var frequencyResponseFilePath = string.Format("{0}\\{1}", calPath, "FrequencyResponse.dat");

            var amplifierNoise    = ReadCalibrationFile(amplifierNoiseFilePath);
            var frequencyResponse = ReadCalibrationFile(frequencyResponseFilePath);

            experiment = new FET_Noise_Experiment(settings.AgilentU2542AResName, amplifierNoise, frequencyResponse);

            experiment.ExpStarted  += onExperimentStarted;
            experiment.DataArrived += expFET_Noise_DataArrived;
            experiment.Status      += experimentStatus;
            experiment.Progress    += experimentProgress;

            if (expStartInfo != null)
            {
                if (measurementInterface is FET_Noise)
                {
                    experiment.Start(((measurementInterface as FET_Noise).DataContext as FET_NoiseModel).ExperimentSettings);
                }
            }
        }
Esempio n. 5
0
        public MainWindow()
        {
            InitializeComponent();

            dList = new LinkedList <Point>();
            ds    = new EnumerableDataSource <Point>(dList);
            ds.SetXYMapping(p => p);

            var psdGraph = new LineGraph(ds);

            psdGraph.AddToPlotter(myChart);
            myChart.Viewport.FitToView();

            a = new DefResistanceNoise() as IExperiment;

            a.DataArrived += a_DataArrived;
            a.Start();
        }