예제 #1
0
        public void StartApplication()
        {
            controllerWindow            = new ControllerWindow();
            controllerWindow.controller = this;

            pg  = new DAQMxPatternGenerator((string)Environs.Hardware.Boards["multiDAQ"]);
            apg = new DAQMxAnalogPatternGenerator();

            camera = (CameraControllable)Activator.GetObject(typeof(CameraControllable),
                                                             "tcp://localhost:1172/controller.rem");

            tstage = (TranslationStageControllable)Activator.GetObject(typeof(CameraControllable),
                                                                       "tcp://localhost:1172/controller.rem");

            experimentReporter = (ExperimentReportable)Activator.GetObject(typeof(ExperimentReportable),
                                                                           "tcp://localhost:1172/controller.rem");


            ioHelper = new MMDataIOHelper(motMasterDataPath,
                                          (string)Environs.Hardware.GetInfo("Element"));

            ScriptLookupAndDisplay();

            Application.Run(controllerWindow);
        }
        public override void AcquisitionStarting()
        {
            //remoting connection
            camera = (CameraControllable)Activator.GetObject(typeof(CameraControllable),
                                                             "tcp://localhost:1178/controller.rem");

            // configure the analog input
            inputTask1 = new Task("analog gatherer 1 -" /*+ (string)settings["channel"]*/);
            inputTask2 = new Task("analog gatherer 2 -" /*+ (string)settings["channel"]*/);


            // new analog channel, range -10 to 10 volts
            //			if (!Environs.Debug)
            //			{
            string channelList = (string)settings["channel"];

            string[] channels = channelList.Split(new char[] { ',' });

            foreach (string channel in channels)
            {
                ((AnalogInputChannel)Environs.Hardware.AnalogInputChannels[channel]).AddToTask(
                    inputTask1,
                    (double)settings["inputRangeLow"],
                    (double)settings["inputRangeHigh"]
                    );
                ((AnalogInputChannel)Environs.Hardware.AnalogInputChannels[channel]).AddToTask(
                    inputTask2,
                    (double)settings["inputRangeLow"],
                    (double)settings["inputRangeHigh"]
                    );
            }

            // internal clock, finite acquisition
            inputTask1.Timing.ConfigureSampleClock(
                "",
                (int)settings["sampleRate"],
                SampleClockActiveEdge.Rising,
                SampleQuantityMode.FiniteSamples,
                (int)settings["gateLength"]);
            inputTask2.Timing.ConfigureSampleClock(
                "",
                (int)settings["sampleRate"],
                SampleClockActiveEdge.Rising,
                SampleQuantityMode.FiniteSamples,
                (int)settings["gateLength"]);


            // trigger off PFI0 (with the standard routing, that's the same as trig1, pin 11)
            inputTask1.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger(
                (string)Environs.Hardware.GetInfo("analogTrigger0"),
                DigitalEdgeStartTriggerEdge.Rising);
            // trigger off PFI1 (with the standard routing, that's the same as trig2, pin 10)
            inputTask2.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger(
                (string)Environs.Hardware.GetInfo("analogTrigger1"),
                DigitalEdgeStartTriggerEdge.Rising);

            inputTask1.Control(TaskAction.Verify);
            inputTask2.Control(TaskAction.Verify);

            reader1 = new AnalogMultiChannelReader(inputTask1.Stream);
            reader2 = new AnalogMultiChannelReader(inputTask2.Stream);

            //   camera.PrepareRemoteCameraControl();
        }
예제 #3
0
        public void StartApplication()
        {
            controllerWindow = new ControllerWindow();
            controllerWindow.controller = this;

            pg = new DAQMxPatternGenerator((string)Environs.Hardware.Boards["multiDAQ"]);
            apg = new DAQMxAnalogPatternGenerator();

            camera = (CameraControllable)Activator.GetObject(typeof(CameraControllable),
                "tcp://localhost:1172/controller.rem");

            tstage = (TranslationStageControllable)Activator.GetObject(typeof(CameraControllable),
                "tcp://localhost:1172/controller.rem");

            experimentReporter = (ExperimentReportable)Activator.GetObject(typeof(ExperimentReportable),
                "tcp://localhost:1172/controller.rem");

            ioHelper = new MMDataIOHelper(motMasterDataPath,
                    (string)Environs.Hardware.GetInfo("Element"));

            ScriptLookupAndDisplay();

            Application.Run(controllerWindow);
        }
        public override void AcquisitionStarting()
        {
            //remoting connection
            camera = (CameraControllable)Activator.GetObject(typeof(CameraControllable),
              "tcp://localhost:1178/controller.rem");

            // configure the analog input
            inputTask1 = new Task("analog gatherer 1 -" /*+ (string)settings["channel"]*/);
            inputTask2 = new Task("analog gatherer 2 -" /*+ (string)settings["channel"]*/);

            // new analog channel, range -10 to 10 volts
            //			if (!Environs.Debug)
            //			{
            string channelList = (string)settings["channel"];
            string[] channels = channelList.Split(new char[] { ',' });

            foreach (string channel in channels)
            {
                ((AnalogInputChannel)Environs.Hardware.AnalogInputChannels[channel]).AddToTask(
                    inputTask1,
                    (double)settings["inputRangeLow"],
                    (double)settings["inputRangeHigh"]
                    );
                ((AnalogInputChannel)Environs.Hardware.AnalogInputChannels[channel]).AddToTask(
                    inputTask2,
                    (double)settings["inputRangeLow"],
                    (double)settings["inputRangeHigh"]
                    );
            }

            // internal clock, finite acquisition
            inputTask1.Timing.ConfigureSampleClock(
                "",
                (int)settings["sampleRate"],
                SampleClockActiveEdge.Rising,
                SampleQuantityMode.FiniteSamples,
                (int)settings["gateLength"]);
            inputTask2.Timing.ConfigureSampleClock(
                "",
                (int)settings["sampleRate"],
                SampleClockActiveEdge.Rising,
                SampleQuantityMode.FiniteSamples,
                (int)settings["gateLength"]);

            // trigger off PFI0 (with the standard routing, that's the same as trig1, pin 11)
            inputTask1.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger(
                (string)Environs.Hardware.GetInfo("analogTrigger0"),
                DigitalEdgeStartTriggerEdge.Rising);
            // trigger off PFI1 (with the standard routing, that's the same as trig2, pin 10)
            inputTask2.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger(
                (string)Environs.Hardware.GetInfo("analogTrigger1"),
                DigitalEdgeStartTriggerEdge.Rising);

            inputTask1.Control(TaskAction.Verify);
            inputTask2.Control(TaskAction.Verify);

            reader1 = new AnalogMultiChannelReader(inputTask1.Stream);
            reader2 = new AnalogMultiChannelReader(inputTask2.Stream);

             //   camera.PrepareRemoteCameraControl();
        }