Robotcode
1.0
|
#include <TRCounter626.h>
Public Member Functions | |
TRCounter () | |
Constructor. | |
void | init (int channel=3, int board=0) |
Initialize the TR counter with defaults for IOBoard. | |
void | initSerial (LPCTSTR comport=_T("COM1"), int baud=9600, char trchar='T', int sliceNumber=0) |
Initialize the TR counter for the serial Port. | |
bool | update () |
Checks counter and sets time;. | |
void | reset () |
reset counter to zero | |
void | start () |
start the counter | |
void | stop () |
void | simulate (double lengthTR) |
stops the counter | |
int | readTR () |
Gives the TR-count. | |
int | readSlice () |
Gives the TR-count. | |
double | readTime () |
gives timing count in current TR based on | |
Public Attributes | |
double | lastTR |
length of last TR; |
TRCounter626.h Uses Counter 0B from sensoray board to count TTL pulses from the scanner can be set to simulation based on the s626 clock (1A+1B)
(c) 2007 joern Diedrichsen (j.diedrichsen@bangor.ac.uk) Tobias Wiestler Jan 2009 Extend to read the update signal from a serial port using the Serial.cpp of Ramon de Klein
TRCounter::TRCounter | ( | ) |
Constructor.
TRCounter class: Keeps track of the TRCounter either extrnally triggered or internally simulated uses Counter 0B from the first s626 manager Joern Diedrichsen, 2007 j.diedrichsen@bangor.ac.uk Tobias Wiestler Jan 2009 Extend to read the update signal from a serial port using the Serial.cpp of Ramon de Klein
----------------------------------------------------------------------- Constructor -----------------------------------------------------------------------
void TRCounter::init | ( | int | c = 3 , |
int | b = 0 |
||
) |
Initialize the TR counter with defaults for IOBoard.
----------------------------------------------------------------------- Initialize the TR Counter with the Counter on the s626 board -----------------------------------------------------------------------
void TRCounter::initSerial | ( | LPCTSTR | comport = _T("COM1") , |
int | baud = 9600 , |
||
char | trchar = 'T' , |
||
int | numSlices = 0 |
||
) |
Initialize the TR counter for the serial Port.
Initialize the TRCounter with Serial Port Action comport: "COM1" baud: 196000 trchar: Character that is sent for a TR ----------------------------------------------------------------------
bool TRCounter::update | ( | ) |
Checks counter and sets time;.
runs in different modes for simulation, serial Phillips, serial Siemens and s626 ----------------------------------------------------------------------
Handle break event
Handle CTS event
Handle DSR event
Handle error event
Handle ring event
Handle RLSD/CD event
-----------------------------
-----------------------------
Read the input character by character
-----------------------------
-----------------------------
-----------------------------
-----------------------------
not simulated: S626 counter operation
void TRCounter::reset | ( | ) |
reset counter to zero
-----------------------------------------------------------------------
< reset the counter to zero
void TRCounter::start | ( | ) |
start the counter
----------------------------------------------------------------------- isRunning = true -----------------------------------------------------------------------
void TRCounter::simulate | ( | double | lt | ) |
stops the counter
starts or stops simulating TRs
----------------------------------------------------------------------- Sets the mode either to Simulates (when lengthTR>0) or to TR counting (lengthTR<=0) -----------------------------------------------------------------------