/// <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];
        }
Esempio n. 2
0
 void Awake()
 {
     motor = GetComponent <LinearMotor>();
     levelSelectMenuListener = GetComponent <LevelSelectMenuListener>();
     levelSelectMenuListener.OnLevelSelectMenuClosed.AddListener(OnMenuClosed);
     levelSelectMenuListener.OnLevelSelectMenuOpened.AddListener(OnMenuOpened);
 }
 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);
 }
Esempio n. 4
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();
 }
Esempio n. 5
0
 protected internal override void ClearAccumulatedImpulses()
 {
     LinearMotor.ClearAccumulatedImpulses();
     AngularMotor.ClearAccumulatedImpulses();
 }
Esempio n. 6
0
 protected internal override void SolveVelocityIteration()
 {
     LinearMotor.SolveVelocityIteration();
     AngularMotor.SolveVelocityIteration();
 }
Esempio n. 7
0
 protected internal override void WarmStart()
 {
     LinearMotor.WarmStart();
     AngularMotor.WarmStart();
 }
Esempio n. 8
0
 protected internal override void ComputeEffectiveMass()
 {
     LinearMotor.ComputeEffectiveMass();
     AngularMotor.ComputeEffectiveMass();
 }
Esempio n. 9
0
 protected internal override void UpdateJacobiansAndVelocityBias()
 {
     LinearMotor.UpdateJacobiansAndVelocityBias();
     AngularMotor.UpdateJacobiansAndVelocityBias();
 }
Esempio n. 10
0
 protected internal override void Preupdate(Fix64 dt, Fix64 updateRate)
 {
     LinearMotor.Preupdate(dt, updateRate);
     AngularMotor.Preupdate(dt, updateRate);
 }
Esempio n. 11
0
 public void Initialize()
 {
     OdeTests.Initialize();
     world = new World();
     motor = new LinearMotor(world);
 }
Esempio n. 12
0
 protected internal override void Preupdate(float dt, float updateRate)
 {
     LinearMotor.Preupdate(dt, updateRate);
     AngularMotor.Preupdate(dt, updateRate);
 }
Esempio n. 13
0
 public MotorStatus(LinearMotor LinearMotor)
 {
     this.LinearMotor = LinearMotor;
 }
Esempio n. 14
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;
 }
Esempio n. 15
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;
 }