예제 #1
0
 // Cleanup
 internal void Flush()
 {
     if (spkOut != null) { spkOut.flush(); spkOut = null; }
     if (spkOutRaw != null) { spkOutRaw.flush(); spkOutRaw = null; }
     if (spkOutSalpa != null) { spkOutSalpa.flush(); spkOutSalpa = null; }
     if (rawOut != null) { rawOut.flush(); rawOut = null; }
     if (salpaOut != null) { salpaOut.flush(); salpaOut = null; }
     if (spkFiltOut != null) { spkFiltOut.flush(); spkFiltOut = null; }
     if (lfpOut != null) { lfpOut.flush(); lfpOut = null; };
     if (stimOut != null) { stimOut.flush(); stimOut = null; }
     if (auxAnalogOut != null) { auxAnalogOut.flush(); auxAnalogOut = null; };
     if (auxDigitalOut != null) { auxDigitalOut.flush(); auxDigitalOut = null; }
 }
예제 #2
0
        // For full sampled streams
        internal void Setup(string dataType, Task dataTask)
        {
            //Create the nessesary file writers
            switch (dataType)
            {
                case "raw":
                    // Check if we need to create this stream
                    if (recordRaw)
                    {
                        if (numElectrodes == 64 && Properties.Settings.Default.ChannelMapping == "invitro")
                            rawOut = new FileOutputRemapped(fid, numElectrodes,
                                dataTask.Timing.SampleClockRate, 1, dataTask,
                                "." + dataType, Properties.Settings.Default.PreAmpGain);
                        else
                            rawOut = new FileOutput(fid, numElectrodes,
                                dataTask.Timing.SampleClockRate, 1, dataTask,
                                "." + dataType, Properties.Settings.Default.PreAmpGain);
                    }
                    break;
                case "salpa":
                    // Check if we need to create this stream
                    if (recordSALPA)
                    {
                        if (numElectrodes == 64 && Properties.Settings.Default.ChannelMapping == "invitro")
                            salpaOut = new FileOutputRemapped(fid, numElectrodes,
                                dataTask.Timing.SampleClockRate, 1, dataTask,
                                "." + dataType, Properties.Settings.Default.PreAmpGain);
                        else
                            salpaOut = new FileOutput(fid, numElectrodes,
                                dataTask.Timing.SampleClockRate, 1, dataTask,
                                "." + dataType, Properties.Settings.Default.PreAmpGain);
                    }
                    break;
                case "spkflt":
                    // Check if we need to create this stream
                    if (recordSpikeFilt)
                    {
                        if (numElectrodes == 64 && Properties.Settings.Default.ChannelMapping == "invitro")
                            spkFiltOut = new FileOutputRemapped(fid, numElectrodes,
                                dataTask.Timing.SampleClockRate, 1, dataTask,
                                "." + dataType, Properties.Settings.Default.PreAmpGain);
                        else
                            spkFiltOut = new FileOutput(fid, numElectrodes,
                                dataTask.Timing.SampleClockRate, 1, dataTask,
                                "." + dataType, Properties.Settings.Default.PreAmpGain);
                    }
                    break;
                case "stim":
                    // Check if we need to create this stream
                    if (recordStim)
                    {
                        stimOut = new StimFileOutput(fid, dataTask.Timing.SampleClockRate,
                            "." + dataType);
                    }
                    break;

                case "aux":
                    // Check if we need to create this stream
                    if (recordAuxAnalog)
                    {
                        auxAnalogOut = new FileOutput(fid, dataTask.AIChannels.Count,
                            dataTask.Timing.SampleClockRate, 0, dataTask,
                            "." + dataType, 1);
                    }
                    break;

                case "dig":
                    // Check if we need to create this stream
                    if (recordAuxDig)
                    {
                        auxDigitalOut = new DigFileOutput(fid,dataTask.Timing.SampleClockRate,
                            "." + dataType);
                    }
                    break;

                default:
                    Console.WriteLine("Unknown data type specified during RecordingSetup.Setup()");
                    break;
            }
        }