Пример #1
0
        /// <summary>
        /// Create Experimental Run.
        /// Refactor Idea: This class should not hold mca/motor/thermometer at all. It should be pass along from DAQThread as arguments.
        /// </summary>
        /// <param name="mca"></param>
        /// <param name="motor"></param>
        /// <param name="thermometer"></param>
        /// <param name="runmode"></param>
        public ExperimentalRun(DT5780 mca, LinearMotor motor, DigitalThermometer thermometer, RunMode runmode = RunMode.Experiment)
        {
            this.mca = mca;
            this.thermometer = thermometer;
            this.motor = motor;
            Timeout = 60;
            MaxSample = 0;
            Log = new ExperimentLog();
            ClearData();
            RunMode = runmode;
            Channel0PeakFinder = new PeakFinder();
            Channel1PeakFinder = new PeakFinder();
            ExperimentStatus = ExperimentStatusEnum.Prepared;
            StartActionMap = new Dictionary<RunMode, DAQThread.OnSuccessfulStartDelegate>{
                {RunMode.Experiment, OnExperimentStart},
                {RunMode.Calibrate, OnCalibrationStart},
                {RunMode.Simulated, OnSimulationStart}
            };

            StopActionMap = new Dictionary<RunMode, DAQThread.OnSuccessfulStopDelegate>{
                {RunMode.Experiment, OnExperimentEnd},
                {RunMode.Calibrate, OnCalibrationEnd},
                {RunMode.Simulated, OnSimulationEnd}
            };

            UpdateActionMap = new Dictionary<RunMode, DAQThread.UpdateProgressDelegate>{
                {RunMode.Experiment, OnExperimentUpdate},
                {RunMode.Calibrate, OnCalibrationUpdate},
                {RunMode.Simulated, OnSimulationUpdate}
            };
            InitCommand();
            Channel0FittedDataPoints = new DataPoint[0];
            Channel1FittedDataPoints = new DataPoint[0];
        }
Пример #2
0
 public void Initialize()
 {
     lin = LinearMotor.GetInstance();
     bool foundone = lin.ScanConnect();
     if (!foundone) Assert.Inconclusive("Can't connect to the linear stage.");
     lin.testmode = true;
     lin.SetMotorPower(1);
 }
Пример #3
0
 public SettingMaker(DT5780 mca, LinearMotor motor, DigitalThermometer thermometer, ObservableCollection<MCASetting> mcasettings)
 {
     this.mca = mca;
     this.motor = motor;
     this.thermometer = thermometer;
     this.MCASettings = mcasettings;
     this.MCAData = new MCAData();
     TargetPosition = -15;
     MaxSample = 0;
     Timeout = -1;
     InitCommand();
 }
Пример #4
0
 public MotorStatus(LinearMotor LinearMotor)
 {
     this.LinearMotor = LinearMotor;
 }
Пример #5
0
 public static ExperimentalRun DummyFilledData(DT5780 mca, LinearMotor motor, DigitalThermometer thermometer, double position = 0)
 {
     ExperimentalRun ret = ExperimentalRun.DummyEmptyData(mca, motor, thermometer, position);
     ret.FillWithDummyData();
     return ret;
 }
Пример #6
0
 public static ExperimentalRun DummyEmptyData(DT5780 mca, LinearMotor motor, DigitalThermometer thermometer, double position = 0)
 {
     ExperimentalRun ret = new ExperimentalRun(mca, motor, thermometer);
     ret.Log.Setting = MCASetting.LargeLYSOSetting();
     ret.Log.MotorPosition = position;
     return ret;
 }