Exemple #1
0
 internal File2Dig(string digfile, int STIM_SAMPLING_FREQ, Int32 BUFFSIZE,
                   Task buffLoadTask, Task masterTask, string masterLoad, ulong numEventPerLoad, Logger debugger, bool robust)
 {
     this.digfile  = digfile;
     this.BUFFSIZE = BUFFSIZE;
     //this.digitalOutputTask = digitalOutputTask;
     this.buffLoadTask = buffLoadTask;
     //this.digitalOutputWriter = digitalOutputWriter;
     this.STIM_SAMPLING_FREQ = STIM_SAMPLING_FREQ;
     this.numEventPerLoad    = numEventPerLoad;
     this.lastLoad           = false;
     this.debugger           = debugger;
     this.masterTask         = masterTask;
     this.masterLoad         = masterLoad;
     // Instatiate a DigitalBuffer object
     digbuff = new DigitalBuffer(BUFFSIZE, STIM_SAMPLING_FREQ, (int)numEventPerLoad, robust);
 }
        private StreamReader oldigfile; // The stream reader for the .olstim file being used

        #endregion Fields

        #region Constructors

        internal File2Dig(string digfile, int STIM_SAMPLING_FREQ, Int32 BUFFSIZE, 
            Task buffLoadTask, Task masterTask, string masterLoad, ulong numEventPerLoad, Logger debugger, bool robust)
        {
            this.digfile = digfile;
            this.BUFFSIZE = BUFFSIZE;
            //this.digitalOutputTask = digitalOutputTask;
            this.buffLoadTask = buffLoadTask;
            //this.digitalOutputWriter = digitalOutputWriter;
            this.STIM_SAMPLING_FREQ = STIM_SAMPLING_FREQ;
            this.numEventPerLoad = numEventPerLoad;
            this.lastLoad = false;
            this.debugger = debugger;
            this.masterTask = masterTask;
            this.masterLoad = masterLoad;
            // Instatiate a DigitalBuffer object
            digbuff = new DigitalBuffer(BUFFSIZE, STIM_SAMPLING_FREQ, (int)numEventPerLoad, robust);
        }
Exemple #3
0
 internal void connectBuffer(DigitalBuffer diggy)
 {
     auxBuff.grabPartner(diggy);
 }
        /// <summary>
        /// Neurorighter's stimulus/generic output server. Used in open-loop and closed-loop experiments where just-in-time buffering of output signals is required.
        /// </summary>
        /// <param name="INNERBUFFSIZE"> The size of one half of the double output buffer in samples</param>
        /// <param name="STIM_SAMPLING_FREQ">The DAC sampling frequency in Hz for all forms of output</param>
        /// <param name="masterTask">The NI Task to which all of the output clocks are synchronized to</param>
        /// <param name="debugger"> NR's real-time debugger</param>
        /// <param name="robust">used to determine if the StimServer will be recover from failures</param>
        internal StimSrv(int INNERBUFFSIZE, int STIM_SAMPLING_FREQ, Task masterTask, Logger debugger, bool robust)
        {
            this.masterTask = masterTask;
            this.INNERBUFFSIZE = INNERBUFFSIZE;
            this.STIM_SAMPLING_FREQ = STIM_SAMPLING_FREQ;
            int sampblanking = 2;
            int queueThreshold = -1;//no queue thresholds for closed loop
            //create buffers
            auxOut = new AuxBuffer(INNERBUFFSIZE, STIM_SAMPLING_FREQ, queueThreshold, robust);
            digitalOut = new DigitalBuffer(INNERBUFFSIZE, STIM_SAMPLING_FREQ, queueThreshold, robust);
            auxOut.grabPartner(digitalOut);
            digitalOut.grabPartner(auxOut);
            stimOut = new StimBuffer(INNERBUFFSIZE, STIM_SAMPLING_FREQ, sampblanking, queueThreshold, robust);
            this.debugger = debugger;

            this.sampleFrequencyHz = Convert.ToDouble(STIM_SAMPLING_FREQ);
            this.dacPollingPeriodSec = Properties.Settings.Default.DACPollingPeriodSec;
            this.dacPollingPeriodSamples = Convert.ToInt32(dacPollingPeriodSec * STIM_SAMPLING_FREQ);
        }
 internal void connectBuffer(DigitalBuffer diggy)
 {
     auxBuff.grabPartner(diggy);
 }