Basic Electrophysiology Relacs Plugins  0.9.8
Public Slots | Public Member Functions | Protected Member Functions | List of all members
AmplifierControl Class Reference

#include <amplifiercontrol.h>

Inheritance diagram for AmplifierControl:
Inheritance graph
[legend]
Collaboration diagram for AmplifierControl:
Collaboration graph
[legend]

Public Slots

void startResistance (void)
 
void doResistance (void)
 
void stopResistance (void)
 
void startBuzz (void)
 
void doBuzz (void)
 
void stopBuzz (void)
 
void activateBridgeMode (bool activate=true)
 
void activateCurrentClampMode (bool activate=true)
 
void activateDynamicClampMode (bool activate=true)
 
void activateVoltageClampMode (bool activate=true)
 
void manualSelection (bool activate=true)
 
void setSyncPulse (double durationus)
 
void setSyncMode (int mode)
 
- Public Slots inherited from Control
virtual void saveDoxygenOptions (void)
 
virtual void saveWidget (void)
 
- Public Slots inherited from ConfigDialog
virtual void dialog (void)
 
virtual void help (void)
 
virtual void notifyDialog (const Options &opt)
 

Public Member Functions

 AmplifierControl (void)
 
virtual void keyPressEvent (QKeyEvent *e)
 
virtual void keyReleaseEvent (QKeyEvent *e)
 
virtual void initDevices (void)
 
virtual void notify (void)
 
virtual void modeChanged (void)
 
- Public Member Functions inherited from Control
 Control (const string &name, const string &pluginset="", const string &author="unknown", const string &version="unknown", const string &date=__DATE__)
 
virtual ~Control (void)
 
virtual void setName (const string &name)
 
void start (void)
 
virtual void requestStop (void)
 
bool wait (double time=-1.0)
 
virtual void addActions (QMenu *menu, bool doxydoc)
 
 RELACSPlugin (const string &configident="", int configgroup=0, const string &name="", const string &pluginset="", const string &author="unknown", const string &version="unknown", const string &date=__DATE__)
 
virtual ~RELACSPlugin (void)
 
QWidget * widget (void)
 
void setWidget (QWidget *widget)
 
void setLayout (QLayout *layout)
 
int desktopWidth (void) const
 
int desktopHeight (void) const
 
string pluginSet (void) const
 
string uniqueName (void) const
 
void setShortUniqueName (void)
 
void setLongUniqueName (void)
 
void updateUniqueName (void)
 
const Optionssettings (void) const
 
Optionssettings (void)
 
void setSettings (void)
 
virtual void notifyMetaData (void)
 
virtual void notifyStimulusData (void)
 
void setRELACSWidget (RELACSWidget *rw)
 
virtual string helpFileName (void) const
 
const InListtraces (void) const
 
const InDatatrace (int index) const
 
const InDatatrace (const string &ident) const
 
int traceIndex (const string &ident) const
 
string traceNames (void) const
 
string rawTraceNames (void) const
 
const EventListevents (void) const
 
const EventDataevents (int index) const
 
const EventDataevents (const string &ident) const
 
const EventDatastimulusEvents (void) const
 
const EventDatarestartEvents (void) const
 
const EventDatarecordingEvents (void) const
 
int traceInputTrace (int trace) const
 
int traceInputTrace (const string &ident) const
 
int traceInputEvent (int trace) const
 
int traceInputEvent (const string &ident) const
 
int eventInputTrace (int event) const
 
int eventInputTrace (const string &ident) const
 
int eventInputEvent (int event) const
 
int eventInputEvent (const string &ident) const
 
double signalTime (void) const
 
double currentTime (void) const
 
double currentTimeRaw (void) const
 
void addTracesEvents (deque< InList * > &data, deque< EventList * > &events)
 
void setTracesEvents (const InList &data, const EventList &event)
 
void assignTracesEvents (const InList &data, const EventList &events)
 
void assignTracesEvents (void)
 
void updateDerivedTracesEvents (void)
 
int getData (double mintracetime=0.0, double prevsignal=-1000.0)
 
int outTracesSize (void) const
 
int outTraceIndex (const string &name) const
 
string outTraceName (int index) const
 
string outTraceNames (void) const
 
const TraceSpecoutTrace (int index) const
 
const TraceSpecoutTrace (const string &name) const
 
void setSignalDelay (int device, double delay)
 
bool acquisition (void) const
 
bool simulation (void) const
 
bool analysis (void) const
 
bool idle (void) const
 
string modeStr (void) const
 
OptionsrelacsSettings (void)
 
const OptionsrelacsSettings (void) const
 
void lockRelacsSettings (void) const
 
void unlockRelacsSettings (void) const
 
QMutex * relacsSettingsMutex (void)
 
string path (void) const
 
string addPath (const string &file) const
 
string defaultPath (void) const
 
string addDefaultPath (const string &file) const
 
bool saving (void) const
 
OptionsstimulusData (void)
 
const OptionsstimulusData (void) const
 
int stimulusDataTraceFlag (void) const
 
void lockStimulusData (void) const
 
void unlockStimulusData (void) const
 
QMutex * stimulusDataMutex (void)
 
MetaDatametaData (void)
 
const MetaDatametaData (void) const
 
void lockMetaData (void) const
 
void unlockMetaData (void) const
 
QMutex * metaDataMutex (void)
 
AllDevicesdevices (void) const
 
Devicedevice (const string &ident)
 
void updateDeviceMenu (void)
 
DigitalIOdigitalIO (const string &ident)
 
Triggertrigger (const string &ident)
 
Attenuateattenuator (const string &name)
 
Filterfilter (const string &name)
 
FilterfilterTrace (int index)
 
FilterfilterTrace (const string &name)
 
OptionsfilterOpts (const string &name)
 
OptionsfilterTraceOpts (int index)
 
OptionsfilterTraceOpts (const string &name)
 
void lockFilter (const string &name)
 
void lockFilterTrace (int index)
 
void lockFilterTrace (const string &name)
 
void unlockFilter (const string &name)
 
void unlockFilterTrace (int index)
 
void unlockFilterTrace (const string &name)
 
void autoConfigureFilter (Filter *filter, double tbegin, double tend)
 
void autoConfigureFilter (Filter *filter, double duration)
 
void autoConfigureFilter (double tbegin, double tend)
 
void autoConfigureFilter (double duration)
 
Filterdetector (const string &name)
 
FilterdetectorEvents (int index)
 
FilterdetectorEvents (const string &name)
 
OptionsdetectorOpts (const string &name)
 
OptionsdetectorEventsOpts (int index)
 
OptionsdetectorEventsOpts (const string &name)
 
void lockDetector (const string &name)
 
void lockDetectorEvents (int index)
 
void lockDetectorEvents (const string &name)
 
void unlockDetector (const string &name)
 
void unlockDetectorEvents (int index)
 
void unlockDetectorEvents (const string &name)
 
void autoConfigureDetector (Filter *detector, double tbegin, double tend)
 
void autoConfigureDetector (Filter *detector, double duration)
 
void autoConfigureDetectors (double tbegin, double tend)
 
void autoConfigureDetectors (double duration)
 
double sessionTime (void) const
 
string sessionTimeStr (void) const
 
bool sessionRunning (void) const
 
int reproCount (void) const
 
virtual void sessionStarted (void)
 
virtual void sessionStopped (bool saved)
 
bool globalKeyEvents (void)
 
void setGlobalKeyEvents (bool global=true)
 
- Public Member Functions inherited from ConfigDialog
 ConfigDialog (const string &configident="", int configgroup=0, const string &name="", const string &author="", const string &version="", const string &date=__DATE__)
 
virtual ~ConfigDialog (void)
 
string name (void) const
 
string author (void) const
 
virtual void setAuthor (const string &author)
 
string version (void) const
 
virtual void setVersion (const string &version)
 
string date (void) const
 
virtual void setDate (const string &date)
 
virtual OptWidgetdialogOptions (OptDialog *od, string *tabhotkeys=0)
 
virtual void dialogButtons (OptDialog *od)
 
virtual void dialogEmptyMessage (OptDialog *od)
 
int dialogSelectMask (void) const
 
void setDialogSelectMask (int mask)
 
void addDialogSelectMask (int mask)
 
int dialogReadOnlyMask (void) const
 
void setDialogReadOnlyMask (int mask)
 
void addDialogReadOnlyMask (int mask)
 
int dialogStyle (void) const
 
void setDialogStyle (int style)
 
void addDialogStyle (int style)
 
string dialogCaption (void) const
 
void setDialogCaption (const string &caption)
 
bool dialogHeader (void) const
 
void setDialogHeader (bool d)
 
string headerBackgroundColor (void) const
 
void setHeaderBackgroundColor (const string &color)
 
string headerForegroundColor (void) const
 
void setHeaderForegroundColor (const string &color)
 
string headerImageFile (void) const
 
void setHeaderImageFile (const string &file)
 
virtual void dialogHeaderWidget (OptDialog *od)
 
bool dialogHelp (void) const
 
void setDialogHelp (bool d)
 
string helpCaption (void) const
 
void setHelpCaption (const string &caption)
 
string helpPath (int inx=0) const
 
int helpPathes (void) const
 
void clearHelpPathes (void)
 
void setHelpPath (const string &path)
 
void addHelpPath (const string &path)
 
bool dialogOpen (void) const
 
bool helpOpen (void) const
 
QWidget * mainWidget (void)
 
virtual void setMainWidget (QWidget *widget)
 
void lock () const
 
void unlock () const
 
bool tryLock (int timeout=1)
 
QMutex * mutex (void)
 
- Public Member Functions inherited from ConfigClass
 ConfigClass (const string &ident, int group=0, int mode=0xffff, int selectmask=0)
 
 ConfigClass (const ConfigClass &C)
 
virtual ~ConfigClass (void)
 
const string & configIdent (void) const
 
void setConfigIdent (const string &ident)
 
int configGroup (void) const
 
void setConfigGroup (int group)
 
int configMode (void) const
 
void setConfigMode (int mode)
 
void addConfigMode (int mode)
 
void delConfigMode (int mode)
 
int configSelectMask (void) const
 
void setConfigSelectMask (int mask)
 
void addConfig (void)
 
void readConfig (void)
 
virtual void readConfig (StrQueue &sq)
 
virtual void saveConfig (ofstream &str)
 
virtual int configSize (void) const
 
virtual void config (void)
 
virtual void preConfig (void)
 
- Public Member Functions inherited from Traces
 Traces (void)
 
- Public Member Functions inherited from StandardTraces
 StandardTraces (void)
 

Protected Member Functions

void clearSyncPulse (void)
 
void measureResistance (void)
 
virtual void customEvent (QEvent *qce)
 
- Protected Member Functions inherited from Control
virtual void main (void)
 
bool interrupt (void) const
 
bool waitOnData (double time=MAXDOUBLE)
 
bool waitOnReProSleep (double time=MAXDOUBLE)
 
bool waitOnReProFinished (double time=MAXDOUBLE)
 
bool waitOnSessionStart (double time=MAXDOUBLE)
 
bool waitOnSessionPrestop (double time=MAXDOUBLE)
 
bool waitOnSessionStop (double time=MAXDOUBLE)
 
bool sleep (double t)
 
void timeStamp (void)
 
bool sleepOn (double t)
 
virtual void setPluginSet (const string &pluginset)
 
void printlog (const string &s) const
 
void warning (const string &s, double timeout=0.0)
 
void info (const string &s, double timeout=0.0)
 
void postCustomEvent (int type=0)
 
int maxVoltages (const InData &data, vector< double > &ranges) const
 
int maxValues (const InData &data, vector< double > &ranges) const
 
void setGain (const InData &data, int gainindex)
 
void adjustGain (const InData &data, double maxvalue)
 
void adjustGain (const InData &data, double minvalue, double maxvalue)
 
void adjust (const InData &data, double tbegin, double tend, double threshold)
 
void adjust (const InData &data, double duration, double threshold)
 
int activateGains (void)
 
Controlcontrol (int index)
 
Controlcontrol (const string &name)
 
OptionscontrolOpts (int index)
 
OptionscontrolOpts (const string &name)
 
void lockControl (int index)
 
void lockControl (const string &name)
 
void unlockControl (int index)
 
void unlockControl (const string &name)
 
Modelmodel (void)
 
OptionsmodelOpts (void)
 
void lockModel (void)
 
void unlockModel (void)
 
ReProsrepros (void)
 
OptionsreprosDialogOpts (void)
 
ReProrepro (int index)
 
ReProrepro (const string &name)
 
OptionsreproOpts (int index)
 
OptionsreproOpts (const string &name)
 
void lockRePro (int index)
 
void lockRePro (const string &name)
 
void unlockRePro (int index)
 
void unlockRePro (const string &name)
 
ReProcurrentRePro (void)
 
OptionscurrentReProOpts (void)
 
void lockCurrentRePro (void)
 
void unlockCurrentRePro (void)
 
virtual bool eventFilter (QObject *obj, QEvent *event)
 
void setWaitMouseCursor (void)
 
void restoreMouseCursor (void)
 
- Protected Member Functions inherited from ConfigDialog
void setDialogOpen (bool open=true)
 
void setHelpOpen (bool open=true)
 

Additional Inherited Members

- Public Types inherited from ConfigClass
enum  Action
 
- Signals inherited from ConfigDialog
void dialogAccepted (void)
 
void dialogAction (int r)
 
void dialogClosed (int r)
 
- Static Public Member Functions inherited from ConfigClass
static void setConfigureClasses (ConfigureClasses *cfg)
 
- Static Public Member Functions inherited from Traces
static void initialize (const RELACSPlugin *rp, const InList &data, const EventList &events)
 
static string spikeTraceNames (void)
 
static string spikeEventNames (void)
 
static string currentTraceNames (void)
 
static string potentialTraceNames (void)
 
static string nerveTraceNames (void)
 
static string nerveEventNames (void)
 
static string currentOutputNames (void)
 
static string potentialOutputNames (void)
 
- Static Public Attributes inherited from Control
static const int DeviceId
 
static const int AnalogInputId
 
static const int AnalogOutputId
 
static const int DigitalIOId
 
static const int TriggerId
 
static const int AttenuatorId
 
static const int AttenuateId
 
static const int ModelId
 
static const int FilterId
 
static const int ReProId
 
static const int ControlId
 
static const int Core
 
static const int Plugins
 
- Static Public Attributes inherited from Traces
static int SpikeTraces = 0
 
static int SpikeTrace [MaxTraces] = { -1, -1, -1, -1 }
 
static int SpikeEvents [MaxTraces] = { -1, -1, -1, -1 }
 
static int CurrentTraces = 0
 
static int CurrentTrace [MaxTraces] = { -1, -1, -1, -1 }
 
static int PotentialTraces = 0
 
static int PotentialTrace [MaxTraces] = { -1, -1, -1, -1 }
 
static int NerveTraces = 0
 
static int NerveTrace [MaxTraces] = { -1, -1, -1, -1 }
 
static int NerveEvents [MaxTraces] = { -1, -1, -1, -1 }
 
static int CurrentOutputs = 0
 
static int CurrentOutput [MaxTraces] = { -1, -1, -1, -1 }
 
static int PotentialOutputs = 0
 
static int PotentialOutput [MaxTraces] = { -1, -1, -1, -1 }
 
- Protected Slots inherited from Control
void startTheSession (void)
 
void stopTheSession (void)
 
void toggleSession (void)
 
void removeFocus (void)
 
void muteAudioMonitor (void)
 
void unmuteAudioMonitor (void)
 
void widgetDestroyed (QObject *obj)
 
- Protected Slots inherited from ConfigDialog
void notificationFromDialog (const Parameter &p)
 
virtual void dClosed (int r)
 
virtual void hClosed (int r)
 
- Static Protected Member Functions inherited from StandardTraces
static void clearIndices (int *traceindices, int n=-1)
 
static void initStandardTraces (const InList &data, int *ntraces, int *traceindices, const string *names, string &namelist, bool alpha=false)
 
static void initStandardEventTraces (const InList &data, const EventList &events, int *ntraces, int *traceindices, int *eventindices, const string *tracenames, const string *eventnames, string &tracenamelist, string &eventnamelist, bool alpha=false)
 
static void initStandardOutputs (const RELACSPlugin *rp, int *ntraces, int *traceindices, const string *names, string &namelist, bool alpha=false)
 
- Protected Attributes inherited from Control
RELACSWidgetRW
 
- Protected Attributes inherited from ConfigDialog
Options DialogOptions
 
- Static Protected Attributes inherited from StandardTraces
static const int MaxTraces
 

Detailed Description

[Control] Controls an amplifier: buzzer and resistance measurement.

Author
Jan Benda
Version
3.0 (Oct 5, 2015)
Options
  • initmode=Bridge: Initial mode of the amplifier (string)
  • resistancecurrent=1nA: The average current of the amplifier used for measuring electrode resistance (number)
  • adjust=false: Adjust input gain for resistance measurement (boolean)
  • maxresistance=100MOhm: Maximum resistance to be expected for scaling voltage trace (number)
  • buzzpulse=500ms: Duration of buzz pulse (number)
  • showbridge=true: Make bridge mode for amplifier selectable (boolean)
  • showcc=false: Make current clamp mode for amplifier selectable (boolean)
  • showdc=false: Make dynamic clamp mode for amplifier selectable (boolean)
  • showvc=false: Make voltage clamp mode for amplifier selectable (boolean)
  • showmanual=false: Make manual mode for amplifier selectable (boolean)
  • syncpulse=10us: Duration of SEC current injection (number)
  • syncmode=0samples: Interval is average over (integer);
Key shortcuts
  • Z: Buzz
  • .: Buzz
  • O: Measure resistance ("O" is the shortcut of "Ohm"!)
  • ALT-B: Switch amplifier to bridge mode
  • ALT-C: Switch amplifier to current-clamp mode
  • ALT-Y: Switch amplifier to dynamic-clamp mode
  • ALT-V: Switch amplifier to voltage-clamp mode
  • ALT-A: Switch to manual selection of amplifier mode
Use a presenter to control RELACS
You can map key presses of a presenter to keys RELACS understands as follows:
  • Look in /lib/udev/hwdb.d/60-keyboard.hwdb for your presenter/keyboard
  • Copy the lines to a file 70-keyboard-relacs.hwdb in /etc/udev/hwdb.d/
  • Edit these lines according to your needs. Each line maps a scancode (as hex-value) to a keycode (lower case). For example, the four buttons of a Logitech R400 can be remapped as follows:
    # Logitech Presenter R400
    keyboard:usb:v046DpC52Dd*dc*dsc*dp*ic*isc*ip*in00*
    KEYBOARD_KEY_7004B=space
    KEYBOARD_KEY_7004E=f1
    KEYBOARD_KEY_70029=dot
    KEYBOARD_KEY_7003E=dot
    KEYBOARD_KEY_70037=v
    With this, the "arrow left" terminates the running repro gracefully by sending "space". "arrow right" starts the macro bound to the "F1" key, the "start presentation" button activates the buzzer, and the "blank screen" button centers the traces in the plot.
  • inform your system about the new key bindings (as root):
    # udevadm hwdb --update
  • and then you need to reboot (!) so that these key mappings take into effect
  • to find out what scancodes your device emits use (as root)
    # evtest
  • possible keycodes are listed at http://hal.freedesktop.org/quirk/quirk-keymap-list.txt or in the header file /usr/include/linux/input.h (the long section with the #define KEY_1 etc.

Constructor & Destructor Documentation

AmplifierControl ( void  )

Member Function Documentation

void keyPressEvent ( QKeyEvent *  e)
virtual

Reimplemented from Control.

References AmplifierControl::startResistance().

void keyReleaseEvent ( QKeyEvent *  e)
virtual
void initDevices ( void  )
virtual
void notify ( void  )
virtual
void modeChanged ( void  )
virtual

If idle() sets manual mode selection for the amplifier.

Reimplemented from Control.

References Control::idle(), and AmplifierControl::manualSelection().

void startResistance ( void  )
slot
void doResistance ( void  )
slot

Start measuring electrode resistance.

Referenced by AmplifierControl::startResistance().

void stopResistance ( void  )
slot
void startBuzz ( void  )
slot

Mute audio monitor and call doBuzz() a little bit delayed.

References AmplifierControl::doBuzz(), and Control::muteAudioMonitor().

Referenced by AmplifierControl::initDevices().

void doBuzz ( void  )
slot

Start buzzing the electrode.

References AmplifierControl::stopBuzz().

Referenced by AmplifierControl::startBuzz().

void stopBuzz ( void  )
slot

Stop buzzing the electrode.

References Control::unmuteAudioMonitor().

Referenced by AmplifierControl::doBuzz().

void activateBridgeMode ( bool  activate = true)
slot
void activateCurrentClampMode ( bool  activate = true)
slot
void activateDynamicClampMode ( bool  activate = true)
slot
void activateVoltageClampMode ( bool  activate = true)
slot
void manualSelection ( bool  activate = true)
slot
void setSyncPulse ( double  durationus)
slot

Set duration of the synchronization pulse to durationus microseconds.

References Control::lockStimulusData(), Control::stimulusData(), and Control::unlockStimulusData().

Referenced by AmplifierControl::initDevices().

void setSyncMode ( int  mode)
slot

Set mode of the synchronization pulse to mode.

References Control::lockStimulusData(), Control::stimulusData(), and Control::unlockStimulusData().

Referenced by AmplifierControl::initDevices().

void clearSyncPulse ( void  )
protected
void measureResistance ( void  )
protected
void customEvent ( QEvent *  qce)
protectedvirtual

Reimplemented from Control.


The documentation for this class was generated from the following files: