Relacs  0.9.8
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Trigger Class Referenceabstract

#include <trigger.h>

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

Classes

struct  HoopParams
 

Public Types

enum  BelowActions { BelowIgnore = 0x0000, BelowSet = 0x0001, BelowReset = 0x0002, BelowMask = BelowIgnore | BelowSet | BelowReset }
 
enum  AboveActions { AboveIgnore = 0x0000, AboveSet = 0x0100, AboveReset = 0x0200, AboveMask = AboveIgnore | AboveSet | AboveReset }
 
- Public Types inherited from Device
enum  DeviceTypes {
  MiscellaneousType = 0, AnalogInputType = 1, AnalogOutputType = 2, DigitalIOType = 3,
  TriggerType = 4, AttenuatorType = 5, AttenuateType = 6, ManipulatorType = 7,
  TemperatureType = 8, CameraType = 9
}
 
- Public Types inherited from Options
enum  SaveFlags {
  NoName = 1, NoType = 2, NoInclude = 4, SwitchNameType = 8,
  Embrace = 16, PrintRequest = 32, FirstOnly = 64, PrintType = 128,
  PrintStyle = 256, DontCloseSection = 512, AlwaysQuote = 1024, EscapeQuotes = 2048
}
 
typedef deque< Parameter >
::iterator 
iterator
 
typedef deque< Parameter >
::const_iterator 
const_iterator
 
typedef deque< Options * >
::iterator 
section_iterator
 
typedef deque< Options * >
::const_iterator 
const_section_iterator
 

Public Member Functions

 Trigger (void)
 
 Trigger (const string &deviceclass)
 
void setCrossing (int mode, double level)
 
void setRising (double level)
 
void setFalling (double level)
 
void setCrossing (int amode, double alevel, int bmode, double blevel)
 
void setRisingHysteresis (double alevel, double blevel)
 
void setFallingHysteresis (double alevel, double blevel)
 
void setWindow (double alevel, double blevel)
 
void setPeakTrough (double threshold, int peakamode, int troughamode, double alevel, int peakbmode, int troughbmode, double blevel)
 
void setPeak (double threshold)
 
void setTrough (double threshold)
 
void setPeak (double threshold, double level)
 
void setTrough (double threshold, double level)
 
void setPeak (double threshold, double alevel, double blevel)
 
void setTrough (double threshold, double alevel, double blevel)
 
int set (void)
 
int addHoop (double delay, double width)
 
void clear (void)
 
void setSettings (void)
 
virtual int activate (void)=0
 
virtual int disable (void)=0
 
virtual int reset (void)
 
- Public Member Functions inherited from Device
 Device (int type=MiscellaneousType)
 
 Device (const string &deviceclass, int type=MiscellaneousType)
 
virtual ~Device (void)
 
virtual int open (const string &device)
 
virtual int open (Device &device)
 
virtual bool isOpen (void) const =0
 
virtual void close (void)=0
 
virtual const Optionsinfo (void) const
 
virtual const Optionssettings (void) const
 
int deviceType (void) const
 
string deviceTypeStr (void) const
 
string deviceClass (void) const
 
string deviceFile (void) const
 
string deviceName (void) const
 
string deviceVendor (void) const
 
string deviceIdent (void) const
 
virtual void setDeviceIdent (const string &ident)
 
virtual void clearError (void)
 
virtual string errorStr (void) const
 
void setErrorStr (const string &strg)
 
void addErrorStr (const string &strg)
 
void setErrorStr (int errnum)
 
void addErrorStr (int errnum)
 
virtual bool success (void) const
 
virtual bool failed (void) const
 
- Public Member Functions inherited from Options
 Options (void)
 
 Options (const Options &o)
 
 Options (const Options &o, int flags)
 
 Options (const string &name, const string &type, int flags, int style)
 
 Options (const Str &opttxt, const string &assignment=":=", const string &separator=",;")
 
 Options (const StrQueue &sq, const string &assignment=":=")
 
 Options (istream &str, const string &assignment=":=", const string &comment="#", const string &stop="", string *line=0)
 
virtual ~Options (void)
 
Optionsoperator= (const Options &o)
 
Optionsassign (const Options &o)
 
Optionsappend (const Options &o)
 
Optionsadd (const Options &o)
 
Optionsinsert (const Options &o, const string &atname="")
 
Optionsassign (const Options &o, int flags)
 
Optionscopy (Options &o, int flags)
 
Optionsappend (const Options &o, int flags)
 
Optionsadd (const Options &o, int flags)
 
Optionsinsert (const Options &o, int flags, const string &atname="")
 
Parameterassign (const string &name, const string &value)
 
OptionsparentSection (void)
 
const OptionsparentSection (void) const
 
void setParentSection (Options *parentsection)
 
void resetParents (void)
 
OptionsrootSection (void)
 
const OptionsrootSection (void) const
 
string name (void) const
 
virtual void setName (const string &name)
 
virtual void setName (const string &name, const string &type)
 
string type (void) const
 
void setType (const string &type)
 
string include (void) const
 
void setInclude (const string &include)
 
void setInclude (const string &url, const string &name)
 
int flag (void) const
 
bool flag (int selectflag) const
 
OptionssetFlag (int flag)
 
OptionsaddFlag (int flag)
 
OptionsdelFlag (int flag)
 
OptionsclearFlag (void)
 
int style (void) const
 
OptionssetStyle (int style)
 
OptionsaddStyle (int style)
 
OptionsdelStyle (int style)
 
OptionsclearStyle (void)
 
bool checkType (int mask) const
 
Str warning (void) const
 
iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
section_iterator sectionsBegin (void)
 
section_iterator sectionsEnd (void)
 
const_section_iterator sectionsBegin (void) const
 
const_section_iterator sectionsEnd (void) const
 
const_iterator find (const string &pattern, int level=-1) const
 
iterator find (const string &pattern, int level=-1)
 
const_iterator rfind (const string &pattern, int level=-1) const
 
iterator rfind (const string &pattern, int level=-1)
 
const_section_iterator findSection (const string &pattern, int level=-1) const
 
section_iterator findSection (const string &pattern, int level=-1)
 
const_section_iterator rfindSection (const string &pattern, int level=-1) const
 
section_iterator rfindSection (const string &pattern, int level=-1)
 
const Parameteroperator[] (int i) const
 
Parameteroperator[] (int i)
 
const Parameteroperator[] (const string &name) const
 
Parameteroperator[] (const string &name)
 
const Optionssection (int i) const
 
Optionssection (int i)
 
const Optionssection (const string &name) const
 
Optionssection (const string &name)
 
Str request (const string &name) const
 
ParametersetRequest (const string &name, const string &request)
 
Parameter::ValueType valueType (const string &name) const
 
ParametersetValueType (const string &name, Parameter::ValueType type)
 
int flags (const string &name) const
 
bool flags (const string &name, int flag) const
 
ParametersetFlags (const string &name, int flags)
 
ParameteraddFlags (const string &name, int flags)
 
ParameterdelFlags (const string &name, int flags)
 
ParameterclearFlags (const string &name)
 
bool changed (const string &name)
 
int style (const string &name) const
 
ParametersetStyle (const string &name, int style)
 
ParameteraddStyle (const string &name, int style)
 
ParameterdelStyle (const string &name, int style)
 
Str format (const string &name) const
 
ParametersetFormat (const string &name, int width=0, int prec=-1, char fmt='g')
 
ParametersetFormat (const string &name, const string &format)
 
int formatWidth (const string &name) const
 
int size (const string &name) const
 
Parameteradd (const Parameter &np)
 
Parameterinsert (const Parameter &np, const string &atname="")
 
ParameteraddText (const string &name, const string &request, const string &dflt, int flags=0, int style=0)
 
ParameteraddText (const string &name, const string &dflt="", int flags=0, int style=0)
 
ParameterinsertText (const string &name, const string &atname, const string &request, const string &dflt, int flags=0, int style=0)
 
ParameterinsertText (const string &name, const string &atname="", const string &dflt="", int flags=0, int style=0)
 
Str text (const string &name, int index, const string &dflt="", const string &format="", const string &unit="") const
 
Str text (const string &name, const string &dflt="", const string &format="", const string &unit="") const
 
void texts (const string &name, vector< string > &s, const string &format="", const string &unit="") const
 
Str allText (const string &name, const string &dflt="", const string &format="", const string &unit="", const string &separator=", ") const
 
ParametersetText (const string &name, const string &strg)
 
ParametersetText (const string &name, const Parameter &p)
 
ParameterpushText (const string &name, const string &strg)
 
Str defaultText (const string &name, const string &format="", const string &unit="") const
 
ParametersetDefaultText (const string &name, const string &dflt)
 
ParameteraddSelection (const string &name, const string &request, const string &selection, int flags=0, int style=0)
 
ParameteraddSelection (const string &name, const string &selection="", int flags=0, int style=0)
 
ParameterinsertSelection (const string &name, const string &atname, const string &request, const string &selection, int flags=0, int style=0)
 
ParameterinsertSelection (const string &name, const string &atname="", const string &selection="", int flags=0, int style=0)
 
ParameterselectText (const string &name, const string &strg, int add=0)
 
ParameterselectText (const string &name, int index)
 
int index (const string &name) const
 
int index (const string &name, const string &strg) const
 
ParameteraddNumber (const string &name, const string &request, double dflt, double minimum, double maximum=MAXDOUBLE, double step=1.0, const string &unit="", const string &outputunit="", const string &format="", int flags=0, int style=0)
 
ParameteraddNumber (const string &name, const string &request, double dflt, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameteraddNumber (const string &name, double dflt, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameteraddNumber (const string &name, double dflt, const string &unit, int flags, int style=0)
 
ParameteraddNumber (const string &name, double dflt, double error, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameteraddNumber (const string &name, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameterinsertNumber (const string &name, const string &atname, const string &request, double dflt, double minimum, double maximum=MAXDOUBLE, double step=1.0, const string &unit="", const string &outputunit="", const string &format="", int flags=0, int style=0)
 
ParameterinsertNumber (const string &name, const string &atname, const string &request, double dflt, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameterinsertNumber (const string &name, const string &atname, double dflt, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameterinsertNumber (const string &name, const string &atname, const string &unit="", const string &format="", int flags=0, int style=0)
 
double number (const string &name, double dflt=0.0, const string &unit="", int index=0) const
 
double number (const string &name, const string &unit, double dflt=0.0, int index=0) const
 
double number (const string &name, int index, double dflt=0.0, const string &unit="") const
 
double number (const string &name, int index, const string &unit, double dflt=0.0) const
 
void numbers (const string &name, vector< double > &n, const string &unit="") const
 
double error (const string &name, const string &unit="", int index=0) const
 
double error (const string &name, int index, const string &unit="") const
 
void errors (const string &name, vector< double > &n, const string &unit="") const
 
ParametersetNumber (const string &name, double number, double error, const string &unit="")
 
ParametersetNumber (const string &name, double number, const string &unit="")
 
ParameterpushNumber (const string &name, double number, double error=-1.0, const string &unit="")
 
ParameterpushNumber (const string &name, double number, const string &unit)
 
ParametersetNumber (const string &name, const Parameter &p)
 
double defaultNumber (const string &name, const string &unit="") const
 
ParametersetDefaultNumber (const string &name, double dflt, const string &unit="")
 
double minimum (const string &name, const string &unit="") const
 
double maximum (const string &name, const string &unit="") const
 
double step (const string &name, const string &unit="") const
 
ParametersetStep (const string &name, double step, const string &unit="")
 
ParametersetMinMax (const string &name, double minimum=-MAXDOUBLE, double maximum=MAXDOUBLE, double step=1.0, const string &unit="")
 
Str unit (const string &name) const
 
Str outUnit (const string &name) const
 
ParametersetUnit (const string &name, const string &internunit, const string &outunit="")
 
ParametersetOutUnit (const string &name, const string &outputunit)
 
ParameterchangeUnit (const string &name, const string &internunit)
 
ParameteraddInteger (const string &name, const string &request, long dflt, long minimum=LONG_MIN, long maximum=LONG_MAX, long step=1, const string &unit="", const string &outputunit="", int width=0, int flags=0, int style=0)
 
ParameteraddInteger (const string &name, long dflt, const string &unit="", int width=0, int flags=0, int style=0)
 
ParameteraddInteger (const string &name, const string &unit="")
 
ParameterinsertInteger (const string &name, const string &atname, const string &request, long dflt, long minimum=LONG_MIN, long maximum=LONG_MAX, long step=1, const string &unit="", const string &outputunit="", int width=0, int flags=0, int style=0)
 
ParameterinsertInteger (const string &name, const string &atname, long dflt, const string &unit="", int width=0, int flags=0, int style=0)
 
ParameterinsertInteger (const string &name, const string &atname, const string &unit="", int width=0, int flags=0, int style=0)
 
long integer (const string &name, const string &unit="", long dflt=0, int index=0) const
 
long integer (const string &name, int index, long dflt=0, const string &unit="") const
 
long integer (const string &name, int index, const string &unit, long dflt=0) const
 
void integers (const string &name, vector< long > &n, const string &unit="") const
 
void integers (const string &name, vector< int > &n, const string &unit="") const
 
ParametersetInteger (const string &name, long number, long error, const string &unit="")
 
ParametersetInteger (const string &name, long number, const string &unit="")
 
ParameterpushInteger (const string &name, long number, long error, const string &unit="")
 
ParameterpushInteger (const string &name, long number, const string &unit="")
 
ParametersetInteger (const string &name, const Parameter &p)
 
long defaultInteger (const string &name, const string &unit="") const
 
ParametersetDefaultInteger (const string &name, long dflt, const string &unit="")
 
ParametersetMinMax (const string &name, long minimum=LONG_MIN, long maximum=LONG_MAX, long step=1, const string &unit="")
 
ParametersetMinMax (const string &name, int minimum, int maximum, int step=1, const string &unit="")
 
ParameteraddBoolean (const string &name, const string &request, bool dflt, int flags=0, int style=0)
 
ParameteraddBoolean (const char *name, const char *request, bool dflt, int flags=0, int style=0)
 
ParameteraddBoolean (const string &name, bool dflt, int flags=0, int style=0)
 
ParameteraddBoolean (const char *name, bool dflt, int flags=0, int style=0)
 
ParameterinsertBoolean (const string &name, const string &atname="", const string &request="", bool dflt=false, int flags=0, int style=0)
 
ParameterinsertBoolean (const string &name, const string &atname, int flags=0, int style=0)
 
bool boolean (const string &name, bool dflt=false, int index=0) const
 
bool boolean (const string &name, int index, bool dflt=false) const
 
void booleans (const string &name, vector< bool > &n) const
 
ParametersetBoolean (const string &name, bool b)
 
ParametersetBoolean (const string &name, const Parameter &p)
 
bool defaultBoolean (const string &name) const
 
ParametersetDefaultBoolean (const string &name, bool dflt)
 
ParameteraddDate (const string &name, const string &request, int year=0, int month=0, int day=0, int flags=0, int style=0)
 
ParameteraddDate (const string &name, int year, int month, int day, int flags=0, int style=0)
 
ParameteraddDate (const string &name, int flags=0, int style=0)
 
ParameterinsertDate (const string &name, const string &atname="", const string &request="", int year=0, int month=0, int day=0, int flags=0, int style=0)
 
ParameterinsertDate (const string &name, const string &atname, int year=0, int month=0, int day=0, int flags=0, int style=0)
 
ParameterinsertDate (const string &name, const string &atname, int flags=0, int style=0)
 
const Parameterdate (const string &name, int index, int &year, int &month, int &day) const
 
ParametersetDate (const string &name, int year, int month, int day)
 
ParametersetDate (const string &name, const string &date)
 
ParametersetDate (const string &name, const struct tm &date)
 
ParametersetDate (const string &name, const time_t &time)
 
ParametersetCurrentDate (const string &name)
 
ParametersetDate (const string &name, const Parameter &p)
 
const ParameterdefaultDate (const string &name, int index, int &year, int &month, int &day) const
 
ParametersetDefaultDate (const string &name, int year, int month, int day)
 
ParameteraddTime (const string &name, const string &request, int hour=0, int minutes=0, int seconds=0, int milliseconds=0, int flags=0, int style=0)
 
ParameteraddTime (const string &name, int hour, int minutes, int seconds, int milliseconds=0, int flags=0, int style=0)
 
ParameteraddTime (const string &name, int flags=0, int style=0)
 
ParameterinsertTime (const string &name, const string &atname="", const string &request="", int hour=0, int minutes=0, int seconds=0, int milliseconds=0, int flags=0, int style=0)
 
ParameterinsertTime (const string &name, const string &atname, int hour=0, int minutes=0, int seconds=0, int milliseconds=0, int flags=0, int style=0)
 
ParameterinsertTime (const string &name, const string &atname, int flags=0, int style=0)
 
const Parametertime (const string &name, int index, int &hour, int &minutes, int &seconds, int &milliseconds) const
 
ParametersetTime (const string &name, int hour, int minutes, int seconds, int milliseconds=0)
 
ParametersetTime (const string &name, const string &time)
 
ParametersetTime (const string &name, const struct tm &time)
 
ParametersetTime (const string &name, const time_t &time)
 
ParametersetCurrentTime (const string &name)
 
ParametersetTime (const string &name, const Parameter &p)
 
const ParameterdefaultTime (const string &name, int index, int &hour, int &minutes, int &seconds, int &milliseconds) const
 
ParametersetDefaultTime (const string &name, int hour, int minutes, int seconds, int milliseconds=0)
 
OptionsnewSection (int level, const string &name, const string &type="", int flag=0, int style=0)
 
OptionsnewSection (int level, const string &name, int flag, int style=0)
 
OptionsnewSection (const string &name, const string &type="", int flag=0, int style=0)
 
OptionsnewSection (const string &name, int flag, int style=0)
 
OptionsnewSubSection (const string &name, const string &type="", int flag=0, int style=0)
 
OptionsnewSubSection (const string &name, int flag, int style=0)
 
OptionsnewSubSubSection (const string &name, const string &type="", int flag=0, int style=0)
 
OptionsnewSubSubSection (const string &name, int flag, int style=0)
 
OptionsaddSection (const string &name, const string &type="", int flag=0, int style=0)
 
OptionsaddSection (const string &name, int flag, int style=0)
 
OptionsinsertSection (const string &name, const string &atpattern, const string &type="", int flag=0, int style=0)
 
OptionsinsertSection (const string &name, const string &atpattern, int flag, int style=0)
 
OptionsnewSection (int level, const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSection (int level, const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSection (int level, const Options &opt, const string &name, int flag, int style=0)
 
OptionsnewSection (const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSection (const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSection (const Options &opt, const string &name, int flag, int style=0)
 
OptionsnewSubSection (const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSubSection (const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSubSection (const Options &opt, const string &name, int flag, int style=0)
 
OptionsnewSubSubSection (const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSubSubSection (const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSubSubSection (const Options &opt, const string &name, int flag, int style=0)
 
OptionsaddSection (const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsaddSection (const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsaddSection (const Options &opt, const string &name, int flag, int style=0)
 
OptionsinsertSection (const Options &opt, int selectmask, const string &name, const string &atpattern, const string &type="", int flag=0, int style=0)
 
OptionsinsertSection (const Options &opt, const string &name, const string &atpattern, const string &type="", int flag=0, int style=0)
 
OptionsinsertSection (const Options &opt, const string &name, const string &atpattern, int flag, int style=0)
 
OptionsnewSection (Options *opt, bool newparent=false)
 
OptionsaddSection (Options *opt, bool newparent=false)
 
OptionsinsertSection (Options *opt, const string &atpattern, bool newparent=false)
 
OptionsnewSections (Options *opt, bool newparent=false)
 
void endSection (void)
 
void clearSections (void)
 
void setSection (Options &opt)
 
void lastSection (void)
 
int up (void)
 
int down (void)
 
ParametersetDefault (const string &name)
 
OptionssetDefaults (int flags=0)
 
ParametersetToDefault (const string &name)
 
OptionssetToDefaults (int flags=0)
 
Optionserase (iterator p)
 
Optionserase (section_iterator p)
 
Optionserase (Options *s)
 
Optionserase (const string &pattern)
 
Optionserase (int selectflag)
 
Optionspop (void)
 
OptionspopSection (void)
 
Optionsflatten (Options *root=0)
 
Optionsclear (bool revert=true)
 
int size (void) const
 
int size (int selectflag) const
 
bool empty (void) const
 
int parameterSize (void) const
 
int parameterSize (int flags) const
 
int sectionsSize (void) const
 
int sectionsSize (int flags) const
 
bool exist (const string &pattern) const
 
bool existSection (const string &pattern) const
 
OptionssetFlags (int flags, int selectflag=0)
 
OptionsaddFlags (int flags, int selectflag=0)
 
OptionsdelFlags (int flags, int selectflag=0)
 
OptionssetValueTypeFlags (int flags, int typemask)
 
OptionsaddValueTypeFlags (int flags, int typemask)
 
OptionsdelValueTypeFlags (int flags, int typemask)
 
OptionssetStyles (int style, int selectflag=0)
 
OptionsaddStyles (int style, int selectflag=0)
 
OptionsdelStyles (int style, int selectflag=0)
 
int styleSize (int style) const
 
OptionssetValueTypeStyles (int style, int typemask)
 
OptionsaddValueTypeStyles (int style, int typemask)
 
OptionsdelValueTypeStyles (int style, int typemask)
 
int nameWidth (int selectmask=0, bool detailed=false, bool escape=false) const
 
string save (int selectmask=0, int flags=0) const
 
ostream & save (ostream &str, const string &start="", int selectmask=0, int flags=0, int width=-1) const
 
ostream & save (ostream &str, const string &textformat, const string &numberformat, const string &boolformat="%i=%b", const string &dateformat="%i=%04Y-%02m-%02d", const string &timeformat="%i=%02H:%02M:%02S", const string &sectionformat="%i", int selectmask=0, const string &start="") const
 
ostream & saveXML (ostream &str, int selectmask=0, int flags=0, int level=0, int indent=4) const
 
Optionsread (const string &opttxt, int flag, const string &assignment=":=", const string &separator=",;", int *indent=0)
 
Optionsread (const string &opttxt, const string &assignment=":=", const string &separator=",;")
 
istream & read (istream &str, int flag, const string &assignment=":=", const string &comment="#", const string &stop="", Str *line=0)
 
istream & read (istream &str, const string &assignment=":=", const string &comment="#", const string &stop="", Str *line=0)
 
Optionsread (const StrQueue &sq, int flag=0, const string &assignment=":=")
 
bool read (const Parameter &p, int flag=0)
 
Optionsread (const Options &o, int flags=0, int flag=0)
 
bool readAppend (const Parameter &p)
 
OptionsreadAppend (const Options &o, int flags=0)
 
Optionsload (const Str &opttxt, const string &assignment=":=", const string &separator=",;", int *indent=0, int *indentspacing=0, int *level=0)
 
istream & load (istream &str, const string &assignment=":=", const string &comment="#", const string &stop="", string *line=0)
 
Optionsload (const StrQueue &sq, const string &assignment=":=")
 
virtual void notify (void)
 
void callNotifies (void)
 
bool setNotify (bool notify=true)
 
bool unsetNotify (void)
 
bool notifying (void) const
 

Protected Member Functions

virtual void initOptions (void)
 
- Protected Member Functions inherited from Device
void setDeviceType (int type)
 
void setDeviceClass (const string &deviceclass)
 
void setDeviceFile (const string &devicefile)
 
void setDeviceName (const string &devicename)
 
void setDeviceVendor (const string &devicevendor)
 
void addInfo (void)
 
void lock (void) const
 
void unlock (void) const
 
QMutex * mutex (void) const
 

Protected Attributes

HoopParams Hoop [MaxHoops]
 
int Hoops
 
- Protected Attributes inherited from Device
Options Info
 
Options Settings
 

Static Protected Attributes

static const int MaxHoops = 5
 

Additional Inherited Members

- Static Public Member Functions inherited from Device
static int deviceTypes (void)
 
static string deviceTypeStr (int type)
 
static string getErrorStr (int ern)
 
- Static Public Member Functions inherited from Options
static double floorLog10 (double v)
 
static double floor10 (double v, double scale=1.0)
 
static double ceil10 (double v, double scale=1.0)
 
- Static Public Attributes inherited from Device
static const int NotOpen = -1
 
static const int InvalidDevice = -2
 
static const int ReadError = -3
 
static const int WriteError = -4
 
static const int InvalidParam = -5
 
- Static Public Attributes inherited from Options
static const int NonDefault = Parameter::NonDefault
 
static const long TabSection = 0x04000000
 

Detailed Description

Virtual class for setting up an analog trigger device.

Author
Jan Benda
Version
1.0

A trigger device sets it output to high if a certain type of event was detected on its input. On a different type of input event the output is set back to low. The event types supported by the Trigger interface are threshold crossings, peaks, and troughs. By the setCrossing() and setPeakTrough() functions, these events can be associated with the actions "set output to high" (AboveSet, BelowSet), "set output to low" (AboveReset, BelowReset), or "ignore" (AboveIgnore, BelowIgnore). Always call clear() before specifying new trigger settings with setCrossing() or setPeakTrough()!

The trigger settings need to be activated by calling activate(). The trigger device can be stopped to emit trigger signals by calling disable().

Only the activate() and disable() functions need to be implemented along with the open(), isOpen(), and close() functions. Towards the end of the open() function you should call set() for setting trigger parameters from the supplied options, followed by activate().

In case you want to use a trigger device within RELACS, your DigitalIO implementation needs to provide a void default constructor (i.e. with no parameters) that does not open the device. Also, include the header file <relacs/relacsplugin.h> and make the Trigger device known to RELACS with the addTrigger( ClassNameOfYourTriggerImplementation, PluginSetName ) macro.

Member Enumeration Documentation

The actions to be taken for a trigger event that falls below the corresponding threshold level (threshold crossing from above, peak/trough below threshold).

Enumerator
BelowIgnore 

Ignore the event.

BelowSet 

Set the level of the trigger output to high.

BelowReset 

Reset the level of the trigger output to low.

BelowMask 

Bitmask for the BelowActions.

The actions to be taken for a trigger event that falls above the corresponding threshold level (threshold crossing from below, peak/trough above threshold).

Enumerator
AboveIgnore 

Ignore the event.

AboveSet 

Set the level of the trigger output to high.

AboveReset 

Reset the level of the trigger output to low.

AboveMask 

Bitmask for the AboveActions.

Constructor & Destructor Documentation

Trigger ( void  )

Construct a Trigger Device.

References Trigger::initOptions().

Trigger ( const string &  deviceclass)

Construct a Trigger Device with class deviceclass.

See Also
setDeviceClass()

References Trigger::initOptions().

Member Function Documentation

void setCrossing ( int  mode,
double  level 
)

Setup a single threshold crossing detector.

Parameters
[in]levelis the threshold level.
[in]modedetermines what to do if the signal crosses the threshold. It is a combination (OR) of one of the BelowActions and one of the AboveActions.
See Also
setRising(), setFalling(), activate()

References Trigger::HoopParams::ACrossing, Trigger::HoopParams::ALevel, Trigger::HoopParams::APeak, Trigger::HoopParams::ATrough, Trigger::HoopParams::BCrossing, Trigger::HoopParams::BLevel, Trigger::HoopParams::BPeak, Trigger::HoopParams::BTrough, Trigger::Hoop, and Trigger::Hoops.

Referenced by Trigger::setFalling(), Trigger::setFallingHysteresis(), Trigger::setRising(), Trigger::setRisingHysteresis(), and Trigger::setWindow().

void setRising ( double  level)

Setup the trigger output to be high as long as the signal is above the threshold (high mode). This is a shortcut for setCrossing( AboveSet | BelowReset, level ).

Parameters
[in]levelthe level of the threshold.
See Also
setCrossing(int,double).

References Trigger::AboveSet, Trigger::BelowReset, and Trigger::setCrossing().

Referenced by Trigger::set().

void setFalling ( double  level)

Setup the trigger output to be high as long as the signal is below the threshold (low mode). This is a shortcut for setCrossing( AboveReset | BelowSet, level ).

Parameters
[in]levelthe level of the threshold.
See Also
setCrossing(int,double).

References Trigger::AboveReset, Trigger::BelowSet, and Trigger::setCrossing().

Referenced by Trigger::set().

void setCrossing ( int  amode,
double  alevel,
int  bmode,
double  blevel 
)

Setup a two-threshold crossing detector.

Parameters
[in]alevelis the level of the lower of the two thresholds.
[in]amodedetermines what to do if the signal crosses the lower threshold. It is a combination (OR) of one of the BelowActions and one of the AboveActions.
[in]blevelis the level of the higher of the two thresholds.
[in]bmodedetermines what to do if the signal crosses the higher threshold. It is a combination (OR) of one of the BelowActions and one of the AboveActions.
See Also
setRisingHysteresis(), setFallingHysteresis(), setWindow(), activate()

References Trigger::HoopParams::ACrossing, Trigger::HoopParams::ALevel, Trigger::HoopParams::BCrossing, Trigger::HoopParams::BLevel, Trigger::Hoop, and Trigger::Hoops.

void setRisingHysteresis ( double  alevel,
double  blevel 
)

Setup the trigger output to be high if the signal is above the higher threshold. The trigger output is set low if the signal falls below the lower threshold (hysteresis high mode). This is a shortcut for setCrossing( BelowReset, alevel, AboveSet, blevel ).

Parameters
[in]alevelthe level of the lower threshold.
[in]blevelthe level of the higher threshold.
See Also
setCrossing(int,double,int,double).

References Trigger::AboveSet, Trigger::BelowReset, and Trigger::setCrossing().

Referenced by Trigger::set().

void setFallingHysteresis ( double  alevel,
double  blevel 
)

Setup the trigger output to be high if the signal is below the lower threshold. The trigger output is set low if the signal rises above the higher threshold (hysteresis low mode). This is a shortcut for setCrossing( BelowSet, alevel, AboveReset, blevel ).

Parameters
[in]alevelthe level of the lower threshold.
[in]blevelthe level of the higher threshold.
See Also
setCrossing(int,double,int,double).

References Trigger::AboveReset, Trigger::BelowSet, and Trigger::setCrossing().

Referenced by Trigger::set().

void setWindow ( double  alevel,
double  blevel 
)

Setup the trigger output to be high if the signal is inbetween the lower and the higher threshold. Above the higher threshold and below the lower threshold the trigger output is set low (middle mode or window mode). This is a shortcut for setCrossing( AboveSet | BelowReset, alevel, AboveReset | BelowSet, blevel ).

Parameters
[in]alevelthe level of the lower threshold.
[in]blevelthe level of the higher threshold.
See Also
setCrossing(int,double,int,double).

References Trigger::AboveReset, Trigger::AboveSet, Trigger::BelowReset, Trigger::BelowSet, and Trigger::setCrossing().

Referenced by Trigger::set().

void setPeakTrough ( double  threshold,
int  peakamode,
int  troughamode,
double  alevel,
int  peakbmode,
int  troughbmode,
double  blevel 
)

Setup a peak/trough detector.

Parameters
[in]thresholdis the threshold used for detecting peaks and troughs (only peaks and troughs that differ by more than threshold are detected. If threshold is zero, all peaks and troughs are detected.)
[in]alevelis the level of the lower of the two thresholds.
[in]peakamodedetermines what to do if a peak is above or below the lower threshold.
[in]troughamodedetermines what to do if a trough is above or below the lower threshold.
[in]blevelis the level of the higher of the two thresholds.
[in]peakbmodedetermines what to do if a peak is above or below the higher threshold.
[in]troughbmodedetermines what to do if a trough is above or below the higher threshold.

peakamode, troughamode, peakbmode, and troughbmode are all combinations (OR) of one of the BelowActions and one of the AboveActions.

See Also
setPeak(), setTrough(), activate()

References Trigger::HoopParams::ALevel, Trigger::HoopParams::APeak, Trigger::HoopParams::ATrough, Trigger::HoopParams::BLevel, Trigger::HoopParams::BPeak, Trigger::HoopParams::BTrough, Trigger::Hoop, Trigger::Hoops, and Trigger::HoopParams::Threshold.

Referenced by Trigger::setPeak(), and Trigger::setTrough().

void setPeak ( double  threshold)

Trigger at any detected peak. Shortcut for setPeakTrough( threshold, AboveSet | BelowSet, AboveReset | BelowReset, 0.0, 0, 0, 0.0 ).

Parameters
[in]thresholdis the threshold used for detecting peaks and troughs (only peaks and troughs that differ by more than threshold are detected.
See Also
setPeakTrough().

References Trigger::AboveReset, Trigger::AboveSet, Trigger::BelowReset, Trigger::BelowSet, and Trigger::setPeakTrough().

Referenced by Trigger::set().

void setTrough ( double  threshold)

Trigger at any detected trough. Shortcut for setPeakTrough( threshold, AboveReset | BelowReset, AboveSet | BelowSet, 0.0, 0, 0, 0.0 ).

Parameters
[in]thresholdis the threshold used for detecting peaks and troughs (only peaks and troughs that differ by more than threshold are detected.
See Also
setPeakTrough().

References Trigger::AboveReset, Trigger::AboveSet, Trigger::BelowReset, Trigger::BelowSet, and Trigger::setPeakTrough().

Referenced by Trigger::set().

void setPeak ( double  threshold,
double  level 
)

Trigger at detected peaks that are above the specified level. Shortcut for setPeakTrough( threshold, AboveSet, AboveReset | BelowReset, level, 0, 0, 0.0 ).

Parameters
[in]thresholdis the threshold used for detecting peaks and troughs (only peaks and troughs that differ by more than threshold are detected.
[in]levelthe peak must be above this level.
See Also
setPeakTrough().

References Trigger::AboveReset, Trigger::AboveSet, Trigger::BelowReset, and Trigger::setPeakTrough().

void setTrough ( double  threshold,
double  level 
)

Trigger at detected troughs that are below the specified level. Shortcut for setPeakTrough( threshold, AboveReset | BelowReset, BelowSet, level, 0, 0, 0.0 ).

Parameters
[in]thresholdis the threshold used for detecting peaks and troughs (only peaks and troughs that differ by more than threshold are detected.
[in]levelthe trough must be below this level.
See Also
setPeakTrough().

References Trigger::AboveReset, Trigger::BelowReset, Trigger::BelowSet, and Trigger::setPeakTrough().

void setPeak ( double  threshold,
double  alevel,
double  blevel 
)

Trigger at detected peaks that are above the specified level alevel and below the specified level blevel. Shortcut for setPeakTrough( threshold, AboveSet | BelowReset, AboveReset | BelowReset, alevel, AboveReset | BelowSet, 0, blevel ).

Parameters
[in]thresholdis the threshold used for detecting peaks and troughs (only peaks and troughs that differ by more than threshold are detected.
[in]alevelthe peak must be above this level.
[in]blevelthe peak must be below this level (alevel < blevel).
See Also
setPeakTrough().

References Trigger::AboveReset, Trigger::AboveSet, Trigger::BelowReset, Trigger::BelowSet, and Trigger::setPeakTrough().

void setTrough ( double  threshold,
double  alevel,
double  blevel 
)

Trigger at detected troughs that are above the specified level alevel and below the specified level blevel. Shortcut for setPeakTrough( threshold, AboveReset | BelowReset, AboveSet | BelowReset, alevel, 0, AboveReset | BelowSet, blevel ).

Parameters
[in]thresholdis the threshold used for detecting peaks and troughs (only peaks and troughs that differ by more than threshold are detected.
[in]alevelthe trough must be above this level.
[in]blevelthe trough must be below this level (alevel < blevel).
See Also
setPeakTrough().

References Trigger::AboveReset, Trigger::AboveSet, Trigger::BelowReset, Trigger::BelowSet, and Trigger::setPeakTrough().

int set ( void  )

Read parameter from opts and call the corresponding setCrossing() or setPeakTrough() function. The following parameter are used:

  • type: the type of the trigger event ("rising", "falling", "risinghysteresis", "fallinghysteresis", "window", "peak", "trough", "peakabove", "troughbelow", "peakwindow", "troughwindow", corresponding to the setRising(), setFalling(), setRisingHysteresis(), setFallingHysteresis(), setWindow(), setPeak( double ), setTrough( double ), setPeak( double, double ), setTrough( double, double ), setPeak( double, double, double ), setTrough( double, double, double ), respectively.
  • level: the level for the trigger events that take one level into account.
  • alevel: the lower level for the trigger events that take two levels into account.
  • blevel: the higher level for the trigger events that take two levels into account.
  • threshold: the threshold parameter for detecting peak and troughs.
    Returns
    0 if there aren't any parameter specified by opts,
    1 if some trigger operation was defined by opts. This function should be used in open() like
    if ( set() > 0 )

References Trigger::clear(), Options::number(), Trigger::setFalling(), Trigger::setFallingHysteresis(), Trigger::setPeak(), Trigger::setRising(), Trigger::setRisingHysteresis(), Trigger::setTrough(), Trigger::setWindow(), and Options::text().

int addHoop ( double  delay,
double  width 
)

Add a new hoop to the trigger chain. All subsequent calls to the set* functions configure the new hoop.

Parameters
[in]delaythe time relative to the first trigger event after which the trigger of this hoop has to occur.
[in]widththe time interval during which the trigger of this hoop has to occur.
Note
Since most trigger devices do not have the concept of several hoops, they might simply ignore any of the hoops except for the first one.
Returns
0 on success, -1 if there are already too many hoops defined
See Also
setCrossing(), setPeakTrough()

References Trigger::HoopParams::ACrossing, Trigger::HoopParams::ALevel, Trigger::HoopParams::APeak, Trigger::HoopParams::ATrough, Trigger::HoopParams::BCrossing, Trigger::HoopParams::BLevel, Trigger::HoopParams::BPeak, Trigger::HoopParams::BTrough, Trigger::HoopParams::Delay, Trigger::Hoop, Trigger::Hoops, Trigger::MaxHoops, Trigger::HoopParams::Threshold, and Trigger::HoopParams::Width.

void clear ( void  )

Clear all settings. The next call of a set* function will specify the first hoop.

Note
You always should call clear() before specifying new trigger settings.
The settings of the trigger device are not affected.
See Also
setCrossing(), setPeakTrough()

References Trigger::HoopParams::ACrossing, Trigger::HoopParams::ALevel, Trigger::HoopParams::APeak, Trigger::HoopParams::ATrough, Trigger::HoopParams::BCrossing, Trigger::HoopParams::BLevel, Trigger::HoopParams::BPeak, Trigger::HoopParams::BTrough, Trigger::Hoop, Trigger::Hoops, and Trigger::HoopParams::Threshold.

Referenced by Trigger::reset(), and Trigger::set().

void setSettings ( void  )

Update the settings() of the device with the current trigger parameter.

References Options::addText(), and Options::clear().

virtual int activate ( void  )
pure virtual

Call this function to transfer all settings to the trigger device and to activate them.

The implementation of this function has to read out the Hoop array and configure the device accordingly. Note that the number of configured hoops is Hoops plus one. Any functionality of this interface that is not supported by the device should be gracefully ignored. Also the settings of the device should be updated, e.g. by calling setSettings().

Returns
0 on success, negative numbers on complete failure, positive numbers if not everything is supported by the device.
virtual int disable ( void  )
pure virtual

Disable the trigger device, i.e. no more trigger events will be emitted.

Returns
0 on success, negative numbers on failure.

Referenced by Trigger::reset().

int reset ( void  )
virtual

Disables the trigger device and clears all hoops.

See Also
disable(), clear().

Reimplemented from Device.

References Trigger::clear(), and Trigger::disable().

void initOptions ( void  )
protectedvirtual

Intializes available options

Reimplemented from Device.

References Options::addNumber(), and Options::addSelection().

Referenced by Trigger::Trigger().

Member Data Documentation

const int MaxHoops = 5
staticprotected

Maximum number of supported trigger hoops.

Referenced by Trigger::addHoop().

HoopParams Hoop[MaxHoops]
protected

The parameter of the trigger hoops.

Referenced by Trigger::addHoop(), Trigger::clear(), Trigger::setCrossing(), and Trigger::setPeakTrough().

int Hoops
protected

The number of hoops minus one.

Referenced by Trigger::addHoop(), Trigger::clear(), Trigger::setCrossing(), and Trigger::setPeakTrough().


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