Ejemplo n.º 1
0
        public void Start()
        {
            proportionalGain = 0;
            integralGain     = 0;
//            derivativeGain = 0;

            ui            = new MainForm();
            ui.controller = this;

            // get access to ScanMaster and the DecelerationHardwareController
            RemotingHelper.ConnectScanMaster();
            RemotingHelper.ConnectMoleculeMOTHardwareControl();

            scanMaster      = new ScanMaster.Controller();
            hardwareControl = new MoleculeMOTHardwareControl.Controller();
            fitter          = new DAQ.Analyze.GaussianFitter();


            if (!Environs.Debug)
            {
                outputTask   = new Task("LaserControllerOutput");
                laserChannel =
                    (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels["laser"];
                laserChannel.AddToTask(outputTask, -10, 10);
                outputTask.Control(TaskAction.Verify);
                laserWriter = new AnalogSingleChannelWriter(outputTask.Stream);

                inputTask     = new Task("LaserControllerInput");
                cavityChannel = (AnalogInputChannel)Environs.Hardware.AnalogInputChannels["lockcavity"];
                cavityChannel.AddToTask(inputTask, -10, 10);
                cavityReader = new AnalogSingleChannelReader(inputTask.Stream);

                inputrefTask     = new Task("ReferenceLaserControllerInput");
                cavityrefChannel = (AnalogInputChannel)Environs.Hardware.AnalogInputChannels["refcavity"];
                cavityrefChannel.AddToTask(inputrefTask, -10, 10);
                cavityrefReader = new AnalogSingleChannelReader(inputrefTask.Stream);
            }

            timerDelegate        = new TimerCallback(TalkToHardwareControl);
            hardwareControlTimer = new System.Threading.Timer(timerDelegate, null, 5000, HARDWARE_CONTROL_TALK_PERIOD);

            Application.Run(ui);
        }
Ejemplo n.º 2
0
        public void Start()
        {
            proportionalGain = 0;
            integralGain = 0;
            //            derivativeGain = 0;

            ui = new MainForm();
            ui.controller = this;

            // get access to ScanMaster and the DecelerationHardwareController
            RemotingHelper.ConnectScanMaster();
            RemotingHelper.ConnectDecelerationHardwareControl();

            scanMaster = new ScanMaster.Controller();
            hardwareControl = new DecelerationHardwareControl.Controller();
            fitter = new DAQ.Analyze.GaussianFitter();

            if (!Environs.Debug)
            {
                outputTask = new Task("LaserControllerOutput");
                laserChannel =
                        (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels["laser"];
                laserChannel.AddToTask(outputTask, -10, 10);
                outputTask.Control(TaskAction.Verify);
                laserWriter = new AnalogSingleChannelWriter(outputTask.Stream);

                inputTask = new Task("LaserControllerInput");
                cavityChannel = (AnalogInputChannel)Environs.Hardware.AnalogInputChannels["lockcavity"];
                cavityChannel.AddToTask(inputTask, -10, 10);
                cavityReader = new AnalogSingleChannelReader(inputTask.Stream);

                inputrefTask = new Task("ReferenceLaserControllerInput");
                cavityrefChannel = (AnalogInputChannel)Environs.Hardware.AnalogInputChannels["refcavity"];
                cavityrefChannel.AddToTask(inputrefTask, -10, 10);
                cavityrefReader = new AnalogSingleChannelReader(inputrefTask.Stream);
            }

            timerDelegate = new TimerCallback(TalkToHardwareControl);
            hardwareControlTimer = new System.Threading.Timer(timerDelegate, null, 5000, HARDWARE_CONTROL_TALK_PERIOD);

            Application.Run(ui);
        }