00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00033
00034 #ifndef GROOVX_VISX_TCLPKG_TH_CC_UTC20050628171009_DEFINED
00035 #define GROOVX_VISX_TCLPKG_TH_CC_UTC20050628171009_DEFINED
00036
00037 #include "visx/tclpkg-th.h"
00038
00039 #include "nub/objfactory.h"
00040
00041 #include "tcl/objpkg.h"
00042 #include "tcl/pkg.h"
00043
00044 #include "visx/timinghandler.h"
00045 #include "visx/timinghdlr.h"
00046 #include "visx/trialevent.h"
00047
00048 #include "rutz/trace.h"
00049
00050 namespace
00051 {
00052 unsigned int addNewEvent(nub::ref<TimingHdlr> th, const char* event_type,
00053 int msec, TimingHdlr::TimePoint time_point)
00054 {
00055 return th->addEventByName(event_type, time_point, msec);
00056 }
00057 }
00058
00059 extern "C"
00060 int Timinghdlr_Init(Tcl_Interp* interp)
00061 {
00062 GVX_TRACE("Timinghdlr_Init");
00063
00064 GVX_PKG_CREATE(pkg, interp, "TimingHdlr", "4.$Revision: 10065 $");
00065 tcl::def_creator<TimingHdlr>(pkg);
00066 pkg->inherit_pkg("io");
00067 tcl::def_basic_type_cmds<TimingHdlr>(pkg, SRC_POS);
00068
00069 pkg->def( "addImmediateEvent", "th_id event_type msec_delay",
00070 rutz::bind_last(&addNewEvent, TimingHdlr::IMMEDIATE),
00071 SRC_POS );
00072 pkg->def( "addStartEvent", "th_id event_type msec_delay",
00073 rutz::bind_last(&addNewEvent, TimingHdlr::FROM_START),
00074 SRC_POS );
00075 pkg->def( "addResponseEvent", "th_id event_type msec_delay",
00076 rutz::bind_last(&addNewEvent, TimingHdlr::FROM_RESPONSE),
00077 SRC_POS );
00078 pkg->def( "addAbortEvent", "th_id event_type msec_delay",
00079 rutz::bind_last(&addNewEvent, TimingHdlr::FROM_ABORT),
00080 SRC_POS );
00081
00082 pkg->def( "addImmediateEvent", "th_id event_id",
00083 rutz::bind_last(rutz::mem_func(&TimingHdlr::addEvent),
00084 TimingHdlr::IMMEDIATE),
00085 SRC_POS );
00086 pkg->def( "addStartEvent", "th_id event_id",
00087 rutz::bind_last(rutz::mem_func(&TimingHdlr::addEvent),
00088 TimingHdlr::FROM_START),
00089 SRC_POS );
00090 pkg->def( "addResponseEvent", "th_id event_id",
00091 rutz::bind_last(rutz::mem_func(&TimingHdlr::addEvent),
00092 TimingHdlr::FROM_RESPONSE),
00093 SRC_POS );
00094 pkg->def( "addAbortEvent", "th_id event_id",
00095 rutz::bind_last(rutz::mem_func(&TimingHdlr::addEvent),
00096 TimingHdlr::FROM_ABORT),
00097 SRC_POS );
00098
00099 pkg->namesp_alias("Th");
00100
00101 GVX_PKG_RETURN(pkg);
00102 }
00103
00104 extern "C"
00105 int Timinghandler_Init(Tcl_Interp* interp)
00106 {
00107 GVX_TRACE("Timinghandler_Init");
00108
00109 GVX_PKG_CREATE(pkg, interp, "TimingHandler", "4.$Revision: 10065 $");
00110 tcl::def_creator<TimingHandler>(pkg);
00111 pkg->inherit_pkg("io");
00112 tcl::def_basic_type_cmds<TimingHandler>(pkg, SRC_POS);
00113
00114 pkg->def_get_set("abortWait",
00115 &TimingHandler::getAbortWait,
00116 &TimingHandler::setAbortWait,
00117 SRC_POS);
00118 pkg->def_get_set("interTrialInterval",
00119 &TimingHandler::getInterTrialInterval,
00120 &TimingHandler::setInterTrialInterval,
00121 SRC_POS);
00122 pkg->def_get_set("stimDur",
00123 &TimingHandler::getStimDur,
00124 &TimingHandler::setStimDur,
00125 SRC_POS);
00126 pkg->def_get_set("timeout",
00127 &TimingHandler::getTimeout,
00128 &TimingHandler::setTimeout,
00129 SRC_POS);
00130
00131 pkg->namesp_alias("SimpleTh");
00132
00133 GVX_PKG_RETURN(pkg);
00134 }
00135
00136 static const char __attribute__((used)) vcid_groovx_visx_tclpkg_th_cc_utc20050628171009[] = "$Id: tclpkg-th.cc 10065 2007-04-12 05:54:56Z rjpeters $ $HeadURL: file:
00137 #endif // !GROOVX_VISX_TCLPKG_TH_CC_UTC20050628171009_DEFINED