Exemplo n.º 1
0
        public int ShotSequence(int startTime, int numberOfOnOffShots, int padShots, int padStart, int flashlampPulseInterval,
                                int valvePulseLength, int valveToQ, int flashToQ, int flashlampPulseLength, int aomStart1, int aomDuration1,
                                int aomStart2, int aomDuration2, int delayToDetectorTrigger,
                                int ttlSwitchPort, int ttlSwitchLine, int switchLineDuration, int switchLineDelay, bool modulation)
        {
            int time;

            if (padStart == 0)
            {
                time = startTime;
            }
            else
            {
                time = startTime + padStart;
            }
            for (int i = 0; i < numberOfOnOffShots; i++)
            {
                int switchChannel = PatternBuilder32.ChannelFromNIPort(ttlSwitchPort, ttlSwitchLine);
                // first the pulse with the switch line high
                Pulse(time, valveToQ + switchLineDelay, switchLineDuration, switchChannel);
                Shot(time, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, delayToDetectorTrigger, "detector");
                time += flashlampPulseInterval;
                for (int p = 0; p < padShots; p++)
                {
                    FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                    time += flashlampPulseInterval;
                }
                // now with the switch line low, if modulation is true (otherwise another with line high)
                if (modulation)
                {
                    Shot(time, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, delayToDetectorTrigger, "detectorprime");
                    time += flashlampPulseInterval;
                    for (int p = 0; p < padShots; p++)
                    {
                        FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                        time += flashlampPulseInterval;
                    }
                }
                else
                {
                    Pulse(time, valveToQ + switchLineDelay, switchLineDuration, switchChannel);
                    Shot(time, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, delayToDetectorTrigger, "detector");
                    time += flashlampPulseInterval;
                    for (int p = 0; p < padShots; p++)
                    {
                        FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                        time += flashlampPulseInterval;
                    }
                }
            }

            return(time);
        }
Exemplo n.º 2
0
        public int ShotSequence(int startTime, int numberOfOnOffShots, int padShots, int padStart, int flashlampPulseInterval,
                                int valvePulseLength, int valveToQ, int flashToQ, int flashlampPulseLength, int aomStart1, int aomDuration1,
                                int aomStart2, int aomDuration2, int aom2Duration1, int delayToDetectorTrigger,
                                int ttlSwitchPort, int ttlSwitchLine, int switchLineDuration, int switchLineDelay, int chirpStart, int chirpDuration, bool modulation)
        {
            int time;

            if (padStart == 0)
            {
                time = startTime;
            }
            else
            {
                time = startTime + 0 * padStart;
            }
            for (int i = 0; i < numberOfOnOffShots; i++)
            {
                int switchChannel = PatternBuilder32.ChannelFromNIPort(ttlSwitchPort, ttlSwitchLine);
                // first the pulse with the switch line high
                Pulse(time, valveToQ + switchLineDelay, switchLineDuration, switchChannel);
                Shot(time, flashlampPulseInterval, switchLineDelay, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, aom2Duration1, delayToDetectorTrigger, chirpStart, chirpDuration, "detector", true);
                if (i < 1)
                {
                    //if (i < 2)
                    //{
                    //    AddEdge(((DigitalOutputChannel)Environs.Hardware.DigitalOutputChannels["aom2"]).BitNumber, time + switchLineDelay, true);
                    //    //AddEdge(((DigitalOutputChannel)Environs.Hardware.DigitalOutputChannels["aom2"]).BitNumber, time + 2 * (flashlampPulseInterval + switchLineDelay) - 1000, false);
                    //}
                    time += flashlampPulseInterval;
                }

                for (int p = 0; p < padShots; p++)
                {
                    FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                    time += flashlampPulseInterval;
                }
                // now with the switch line low, if modulation is true (otherwise another with line high)
                if (modulation)
                {
                    Shot(time, flashlampPulseInterval, switchLineDelay, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, aom2Duration1, delayToDetectorTrigger, chirpStart, chirpDuration, "detectorprime", false);
                    time += flashlampPulseInterval;
                    for (int p = 0; p < padShots; p++)
                    {
                        FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                        time += flashlampPulseInterval;
                    }
                }
                else
                {
                    Pulse(time, valveToQ + switchLineDelay, switchLineDuration, switchChannel);
                    Shot(time, flashlampPulseInterval, switchLineDelay, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, aom2Duration1, delayToDetectorTrigger, chirpStart, chirpDuration, "detector", false);
                    time += flashlampPulseInterval;
                    for (int p = 0; p < padShots; p++)
                    {
                        FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                        time += flashlampPulseInterval;
                    }
                }

                //AddEdge(((DigitalOutputChannel)Environs.Hardware.DigitalOutputChannels["aom2"]).BitNumber, time-1000, false);



                //// first the pulse with the switch line high
                //Pulse(time, valveToQ + switchLineDelay, switchLineDuration, switchChannel);
                //Shot(time, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, aom2Duration1, delayToDetectorTrigger, chirpStart, chirpDuration, "detector");
                //time += flashlampPulseInterval;
                //for (int p = 0; p < padShots; p++)
                //{
                //    FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                //    time += flashlampPulseInterval;
                //}
                //// now with the switch line low, if modulation is true (otherwise another with line high)
                //if (modulation)
                //{
                //    Shot(time, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, aom2Duration1, delayToDetectorTrigger, chirpStart, chirpDuration, "detectorprime");
                //    time += flashlampPulseInterval;
                //    for (int p = 0; p < padShots; p++)
                //    {
                //        FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                //        time += flashlampPulseInterval;
                //    }
                //}
                //else
                //{
                //    Pulse(time, valveToQ + switchLineDelay, switchLineDuration, switchChannel);
                //    Shot(time, valvePulseLength, valveToQ, flashToQ, flashlampPulseLength, aomStart1, aomDuration1, aomStart2, aomDuration2, aom2Duration1, delayToDetectorTrigger, chirpStart, chirpDuration, "detector");
                //    time += flashlampPulseInterval;
                //    for (int p = 0; p < padShots; p++)
                //    {
                //        FlashlampPulse(time, valveToQ, flashToQ, flashlampPulseLength);
                //        time += flashlampPulseInterval;
                //    }
                //}
            }

            return(time);
        }