Example #1
0
        protected override bool StartTest()
        {
            bool retValue = false;

            try
            {
                var program01 = CPARDevice.CreateRampProgram(PrimaryChannel, DELTA_PRESSURE, PRESSURE_LIMIT);
                var program02 = SECOND_CUFF ? CPARDevice.CreateRampProgram(SecondaryChannel, DELTA_PRESSURE, PRESSURE_LIMIT) :
                                CPARDevice.CreateEmptyProgram(SecondaryChannel);
                DeviceManager.Execute(program01);
                DeviceManager.Execute(program02);
                StartDevice(GetStopCriterion());

                result = new StimulusResponseResult()
                {
                    Name        = Name,
                    ID          = ID,
                    Index       = Index,
                    Conditioned = false,
                    VAS_PDT     = VAS_PDT
                };
                initializing = true;
                retValue     = true;
            }
            catch (Exception e)
            {
                Log.Debug(e.Message);
            }

            return(retValue);
        }
Example #2
0
        protected override bool StartTest()
        {
            bool retValue            = false;
            var  stimulatingPressure = P_STIMULATE.Calculate();

            try
            {
                DeviceManager.Execute(CPARDevice.CreatePulseProgram(0, NO_OF_STIMULI, T_ON, T_OFF, stimulatingPressure, P_STATIC));
                DeviceManager.Execute(SECOND_CUFF ? CPARDevice.CreatePulseProgram(1, NO_OF_STIMULI, T_ON, T_OFF, stimulatingPressure, P_STATIC) :
                                      CPARDevice.CreateEmptyProgram(1));
                StartDevice(StartStimulation.StopCriterion.STOP_CRITERION_ON_BUTTON);
                Log.Debug("TS STARTED [NO: {0}, T_ON: {1}, T_OFF: {2}", NO_OF_STIMULI, T_ON, T_OFF);

                result = new TemporalSummationResult(NO_OF_STIMULI)
                {
                    Name        = Name,
                    ID          = ID,
                    Index       = Index,
                    Conditioned = false,
                    T_OFF       = T_OFF,
                    T_ON        = T_ON,
                    NominalStimulatingPressure = stimulatingPressure
                };

                initializing = true;
                retValue     = true;
            }
            catch (Exception e)
            {
                Log.Debug(e.Message);
            }

            return(retValue);
        }
        protected override bool StartTest()
        {
            bool retValue            = false;
            var  stimulatingPressure = Pressure.Calculate();

            try
            {
                DeviceManager.Execute(CPARDevice.CreateStaticProgram(PrimaryChannel, StimulusDuration, stimulatingPressure));
                DeviceManager.Execute(SECOND_CUFF ? CPARDevice.CreateStaticProgram(SecondaryChannel, StimulusDuration, stimulatingPressure) :
                                      CPARDevice.CreateEmptyProgram(SecondaryChannel));
                StartDevice(StartStimulation.StopCriterion.STOP_CRITERION_ON_BUTTON);
                Log.Debug("STATIC TS STARTED [Pressure: {0}, Duration: {1}, Both Cuffs: {2}", stimulatingPressure, StimulusDuration, SECOND_CUFF);

                result = new StaticTemporalSummationResult()
                {
                    NominalStimulatingPressure = stimulatingPressure
                };

                initializing = true;
                retValue     = true;
            }
            catch (Exception e)
            {
                Log.Debug(e.Message);
            }

            return(retValue);
        }
        private void Stimulate()
        {
            if (result != null)
            {
                if (currentStimulus < result.Responses.Length)
                {
                    var r = result.Responses[currentStimulus];

                    DeviceManager.Execute(CPARDevice.CreatePulseProgram(0, 1, r.T_ON, r.T_OFF, r.Pressure, P_STATIC));
                    DeviceManager.Execute(SECOND_CUFF ? CPARDevice.CreatePulseProgram(1, 1, r.T_ON, r.T_OFF, r.Pressure, P_STATIC) :
                                          CPARDevice.CreateEmptyProgram(1));
                    ForceStartDevice(ForceStartStimulation.StopCriterion.STOP_CRITERION_ON_BUTTON);
                    Log.Debug("TS STARTED [NO: {0}, T_ON: {1}, T_OFF: {2}", currentStimulus, r.T_ON, r.T_OFF);
                    initializing = true;
                }
            }
        }
Example #5
0
        private void Stimulate()
        {
            if (state == StartleState.READY)
            {
                if (probeNumber < Probes.Length)
                {
                    var probe = Probes[probeNumber];

                    try
                    {
                        double Tdelay = probe.T_DELAY;

                        if (result.Probes[probeNumber].IsStartle)
                        {
                            var program01 = CPARDevice.CreateStartleProbe(0,
                                                                          stimulatingPressure,
                                                                          startlePressure,
                                                                          probe.T_ON,
                                                                          probe.T_DELAY,
                                                                          probe.T_STARTLE,
                                                                          probe.T_RESPONSE);
                            var program02 = SECOND_CUFF ? CPARDevice.CreateStartleProbe(1,
                                                                                        stimulatingPressure,
                                                                                        startlePressure,
                                                                                        probe.T_ON,
                                                                                        probe.T_DELAY,
                                                                                        probe.T_STARTLE,
                                                                                        probe.T_RESPONSE) :
                                            CPARDevice.CreateEmptyProgram(1);
                            DeviceManager.Execute(program01);
                            DeviceManager.Execute(program02);
                            Log.Status("STARTLE PROBE: Tdelay {0}, Pressure: {1:0.0}kPa/{2:0.0}kPa", Tdelay, stimulatingPressure, startlePressure);
                        }
                        else
                        {
                            var program01 = CPARDevice.CreateNormalProbe(0, stimulatingPressure, probe.T_ON, probe.T_RESPONSE);
                            var program02 = SECOND_CUFF ? CPARDevice.CreateNormalProbe(1, stimulatingPressure, probe.T_ON, probe.T_RESPONSE) :
                                            CPARDevice.CreateEmptyProgram(1);
                            DeviceManager.Execute(program01);
                            DeviceManager.Execute(program02);
                            Log.Status("NORMAL PROBE Pressure: {0:0.0}kPa", stimulatingPressure);
                        }

                        StartDevice(Communication.Functions.StartStimulation.StopCriterion.STOP_CRITERION_ON_BUTTON);
                        state = StartleState.STIMULATING;
                        count = 0;
                    }
                    catch (Exception e)
                    {
                        Log.Debug(e.Message);
                    }
                }
                else
                {
                    Log.Debug("Attempted to start a probe that does not exists, ending test");
                    Pending();
                }
            }
            else
            {
                Log.Debug("StartleTest: Attempted to start a stimulation while not in the READY state [State = {0}]", state.ToString());
            }
        }