#include <igstkNDICommandInterpreter.h>
Public Types | |
enum | COMMBaudType { NDI_9600 = 0, NDI_14400 = 1, NDI_19200 = 2, NDI_38400 = 3, NDI_57600 = 4, NDI_115200 = 5 } |
COMM() baud rates. More... | |
enum | COMMDataType { NDI_8N1 = 0, NDI_8N2 = 1, NDI_8O1 = 10, NDI_8O2 = 11, NDI_8E1 = 20, NDI_8E2 = 21, NDI_7N1 = 100, NDI_7N2 = 101, NDI_7O1 = 110, NDI_7O2 = 111, NDI_7E1 = 120, NDI_7E2 = 121 } |
COMM() data bits, parity and stop bits. More... | |
enum | COMMHandshakeType { NDI_NOHANDSHAKE = 0, NDI_HANDSHAKE = 1 } |
COMM() hardware handshaking. More... | |
enum | VERModeType { NDI_CONTROL_FIRMWARE = 0, NDI_LEFT_SENSOR_FIRMWARE = 1, NDI_RIGHT_SENSOR_FIRMWARE = 2, NDI_TIU_FIRMWARE = 3, NDI_CONTROL_FIRMWARE_ENHANCED = 4 } |
VER() reply mode types. More... | |
enum | PHSRModeType { NDI_ALL_HANDLES = 0x00, NDI_STALE_HANDLES = 0x01, NDI_UNINITIALIZED_HANDLES = 0x02, NDI_UNENABLED_HANDLES = 0x03, NDI_ENABLED_HANDLES = 0x04 } |
PHSR() handle types. More... | |
enum | PENATrackingModeType { NDI_STATIC = 'S', NDI_DYNAMIC = 'D', NDI_BUTTON_BOX = 'B' } |
PENA() tracking modes. More... | |
enum | TXModeType { NDI_XFORMS_AND_STATUS = 0x0001, NDI_ADDITIONAL_INFO = 0x0002, NDI_SINGLE_STRAY = 0x0004, NDI_INCLUDE_OUT_OF_VOLUME = 0x0800, NDI_PASSIVE_STRAY = 0x1000 } |
TX() & BX() reply mode bit definitions. More... | |
enum | TXTransformType { NDI_UNOCCUPIED = 0x00, NDI_VALID = 0x01, NDI_MISSING = 0x02, NDI_DISABLED = 0x04 } |
GetTXTransform() and general-purpose transform return values. More... | |
enum | TXPortStatusType { NDI_TOOL_IN_PORT = 0x0001, NDI_SWITCH_1_ON = 0x0002, NDI_SWITCH_2_ON = 0x0004, NDI_SWITCH_3_ON = 0x0008, NDI_INITIALIZED = 0x0010, NDI_ENABLED = 0x0020, NDI_OUT_OF_VOLUME = 0x0040, NDI_PARTIALLY_IN_VOLUME = 0x0080, NDI_DISTURBANCE_DETECTED = 0x0200, NDI_SIGNAL_TOO_SMALL = 0x0400, NDI_SIGNAL_TOO_BIG = 0x0800, NDI_PROCESSING_EXCEPTION = 0x1000, NDI_PORT_HARDWARE_FAILURE = 0x2000 } |
GetTXPortStatus() return value bits. More... | |
enum | TXSystemStatusType { NDI_COMM_SYNC_ERROR = 0x0001, NDI_TOO_MUCH_EXTERNAL_INFRARED = 0x0002, NDI_COMM_CRC_ERROR = 0x0004, NDI_COMM_RECOVERABLE = 0x0008, NDI_HARDWARE_FAILURE = 0x0010, NDI_HARDWARE_CHANGE = 0x0020, NDI_PORT_OCCUPIED = 0x0040, NDI_PORT_UNOCCUPIED = 0x0080 } |
GetTXSystemStatus() return value bits. More... | |
enum | TXToolInfoType { NDI_BAD_TRANSFORM_FIT = 0x01, NDI_NOT_ENOUGH_MARKERS = 0x02, NDI_TOOL_FACE_USED = 0x70 } |
GetTXToolInfo() return value bits. More... | |
enum | TXMarkerInfoType { NDI_MARKER_MISSING = 0, NDI_MARKER_EXCEEDED_MAX_ANGLE = 1, NDI_MARKER_EXCEEDED_MAX_ERROR = 2, NDI_MARKER_USED = 3 } |
GetTXMarkerInfo() return value bits. More... | |
enum | LEDStateType { NDI_BLANK = 'B', NDI_FLASH = 'F', NDI_SOLID = 'S' } |
LED() states. More... | |
enum | PSOUTStateType { NDI_GPIO_OFF = 'O', NDI_GPIO_SOLID = 'S', NDI_GPIO_PULSE = 'P', NDI_GPIO_NO_CHANGE = 'N' } |
PSOUT() states for General Purpose Input Output (GPIO). More... | |
enum | PHINFModeType { NDI_BASIC = 0x0001, NDI_TESTING = 0x0002, NDI_PART_NUMBER = 0x0004, NDI_ACCESSORIES = 0x0008, NDI_MARKER_TYPE = 0x0010, NDI_PORT_LOCATION = 0x0020, NDI_GPIO_STATUS = 0x0040 } |
PHINF() reply mode bits. More... | |
enum | PHINFAccessoriesType { NDI_TOOL_IN_PORT_SWITCH = 0x01, NDI_SWITCH_1 = 0x02, NDI_SWITCH_2 = 0x04, NDI_SWITCH_3 = 0x08, NDI_TOOL_TRACKING_LED = 0x10, NDI_LED_1 = 0x20, NDI_LED_2 = 0x40, NDI_LED_3 = 0x80 } |
GetPHINFAccessories() return value bits. More... | |
enum | PHINFMarkerType { NDI_950NM = 0x00, NDI_850NM = 0x01, NDI_NDI_ACTIVE = 0x08, NDI_NDI_CERAMIC = 0x10, NDI_PASSIVE_ANY = 0x20, NDI_PASSIVE_SPHERE = 0x28, NDI_PASSIVE_DISC = 0x30 } |
GetPHINFMarkerType() return value. More... | |
enum | PHINFToolInfoType { NDI_TYPE_REFERENCE = 0x01, NDI_TYPE_POINTER = 0x02, NDI_TYPE_BUTTON = 0x03, NDI_TYPE_SOFTWARE = 0x04, NDI_TYPE_MICROSCOPE = 0x05, NDI_TYPE_CALIBRATION = 0x07, NDI_TYPE_DOCK = 0x08, NDI_TYPE_ISOLATION = 0x09, NDI_TYPE_CARM = 0x0A, NDI_TYPE_CATHETER = 0x0B } |
Tool type specifiers returned by GetPHINFToolType(). More... | |
enum | SSTATModeType { NDI_CONTROL = 0x0001, NDI_SENSORS = 0x0002, NDI_TIU = 0x0004 } |
SSTAT() reply format bits. More... | |
enum | SSTATControlType { NDI_EPROM_CODE_CHECKSUM = 0x01, NDI_EPROM_SYSTEM_CHECKSUM = 0x02 } |
GetSSTATControl() return value bits. More... | |
enum | STATSensorType { NDI_LEFT_ROM_CHECKSUM = 0x01, NDI_LEFT_SYNC_TYPE_1 = 0x02, NDI_LEFT_SYNC_TYPE_2 = 0x04, NDI_RIGHT_ROM_CHECKSUM = 0x10, NDI_RIGHT_SYNC_TYPE_1 = 0x20, NDI_RIGHT_SYNC_TYPE_2 = 0x40 } |
GetSSTATSensor() return value bits. More... | |
enum | STATTIUType { NDI_ROM_CHECKSUM = 0x01, NDI_OPERATING_VOLTAGES = 0x02, NDI_MARKER_SEQUENCING = 0x04, NDI_SYNC = 0x08, NDI_COOLING_FAN = 0x10, NDI_INTERNAL_ERROR = 0x20 } |
GetSSTATTIU() return value bits. More... | |
enum | IRCHKModeType { NDI_DETECTED = 0x0001, NDI_SOURCES = 0x0002 } |
IRCHK() reply mode bits. More... | |
enum | IRCHKSensorType { NDI_LEFT = 0, NDI_RIGHT = 1 } |
GetIRCHKNumberOfSources(), GetIRCHKSourceXY() sensor arguments. More... | |
enum | SFLISTModeType { NDI_FEATURE_SUMMARY = 0x00, NDI_ACTIVE_PORTS = 0x01, NDI_PASSIVE_PORTS = 0x02, NDI_VOLUMES = 0x03, NDI_TIP_PORTS = 0x04 } |
SFLIST() reply mode. More... | |
enum | SFLISTSummaryType { NDI_SUPPORTS_ACTIVE = 0x0001, NDI_SUPPORTS_PASSIVE = 0x0002, NDI_SUPPORTS_VOLUMES = 0x0004, NDI_SUPPORTS_SENSING = 0x0008 } |
SFLIST() summary bits. More... | |
typedef SerialCommunication | CommunicationType |
Some required typedefs. | |
Public Member Functions | |
igstkStandardClassTraitsMacro (NDICommandInterpreter, Object) public | |
Macro with standard traits declarations. | |
void | SetCommunication (CommunicationType *communication) |
Set the communication object that commands will be sent to. | |
CommunicationType * | GetCommunication () |
Get the communication object. | |
const char * | Command (const char *command) |
Send a text command to the device and receive a text reply. | |
void | BEEP (int n) |
Cause the device to beep. | |
void | COMM (COMMBaudType baud, COMMDataType dps, COMMHandshakeType handshake) |
Change the device communication parameters. | |
void | DSTART () |
Put the device into diagnostic mode. | |
void | DSTOP () |
Take the device out of diagnostic mode. | |
void | INIT () |
Initialize the device. | |
void | IRCHK (int mode) |
Check for sources of environmental infrared. | |
void | IRINIT () |
Initialize the diagnostic environmental infrared checking system. | |
void | LED (int ph, int led, LEDStateType state) |
Set a tool LED to a particular state. | |
void | PDIS (int ph) |
Disable transform reporting on the specified port handle. | |
void | PENA (int ph, int mode) |
Enable transform reporting on the specified port handle. | |
void | PHF (int ph) |
Free the specified port handle. | |
void | PHINF (int ph, int mode) |
Ask the device for information about a tool handle. | |
void | PHRQ (const char *num, const char *sys, const char *tool, const char *port, const char *chan) |
Request a port handle given specific tool criteria. | |
void | PHSR (PHSRModeType mode) |
List the port handles. | |
void | PINIT (int ph) |
Initialize the tool on the specified port handle. | |
void | PSOUT (int ph, int a, int b, int c) |
Set the three GPIO wire states for an AURORA tool. | |
void | PVCLR (int port) |
Clear the virtual SROM for the specified port. | |
void | PVWR (int ph, int a, const char *x) |
Write to a virtual SROM address on the specified port handle. | |
void | RESET () |
Send a serial break to reset the device. | |
void | SFLIST (SFLISTModeType mode) |
Get a feature list for this device. | |
void | SSTAT (int mode) |
Request status information from the device. | |
void | TSTART () |
Put the device into tracking mode. | |
void | TSTOP () |
Take the device out of tracking mode. | |
void | TX (int mode) |
Request tracking information from the device. | |
void | BX (int mode) |
Request tracking information from the device. | |
void | VER (VERModeType n) |
Get a string that describes the device firmware version. | |
int | GetError () const |
Get error code from the last command. | |
int | GetPHRQHandle () const |
Get the port handle returned by a PHRQ() command. | |
int | GetPHSRNumberOfHandles () const |
Get the number of port handles as returned by a PHSR() command. | |
int | GetPHSRHandle (int i) const |
Get one of the port handles returned by a PHSR() command. | |
int | GetPHSRInformation (int i) const |
Get the information for a port handle returned by a PHSR() command. | |
int | GetPHINFPortStatus () const |
Get the 8-bit status value for the port handle. | |
int | GetPHINFToolInfo (char information[32]) const |
Get a 31-byte string describing the tool. | |
int | GetPHINFToolType () const |
Get an integer that describes the tool type. | |
unsigned int | GetPHINFCurrentTest () const |
Return the results of a current test on the IREDS on an active POLARIS tool. | |
int | GetPHINFPartNumber (char part[21]) const |
Get a 20-byte string that contains the part number of the tool. | |
int | GetPHINFAccessories () const |
Get the 8-bit value specifying the tool accessories. | |
int | GetPHINFMarkerType () const |
Get an 8-bit value describing the marker type for the tool. | |
int | GetPHINFPortLocation (char location[15]) const |
Get a 14-byte description of the physical location of the tool on the system. | |
int | GetPHINFGPIOStatus () const |
Get the 8-bit GPIO status for this tool. | |
int | GetTXTransform (int ph, double transform[8]) const |
Get the transformation for the specified port. | |
int | GetTXPortStatus (int ph) const |
Get the 16-bit status value for the specified port handle. | |
unsigned int | GetTXFrame (int ph) const |
Get the camera frame number for the latest transform. | |
int | GetTXToolInfo (int ph) const |
Get additional information about the tool transformation. | |
int | GetTXMarkerInfo (int ph, int marker) const |
Get additional information about the tool markers. | |
int | GetTXSingleStray (int ph, double coord[3]) const |
Get the coordinates of a stray marker on a wired POLARIS tool. | |
int | GetTXNumberOfPassiveStrays () const |
Get the number of passive stray markers detected. | |
int | GetTXPassiveStray (int i, double coord[3]) const |
Copy the coordinates of the specified stray marker into the supplied array. | |
int | GetTXPassiveStrayOutOfVolume (int i) const |
Determine whether a passive stray is outside of the characterized volume. | |
int | GetTXSystemStatus () const |
Get an 16-bit status bitfield for the system. | |
int | GetBXTransform (int ph, double transform[8]) const |
Get the transformation for the specified port. | |
int | GetBXPortStatus (int ph) const |
Get the 16-bit status value for the specified port handle. | |
unsigned int | GetBXFrame (int ph) const |
Get the camera frame number for the latest transform. | |
int | GetBXToolInfo (int ph) const |
Get additional information about the tool transformation. | |
int | GetBXMarkerInfo (int ph, int marker) const |
Get additional information about the tool markers. | |
int | GetBXSingleStray (int ph, double coord[3]) const |
Get the coordinates of a stray marker on a wired POLARIS tool. | |
int | GetBXNumberOfPassiveStrays () const |
Get the number of passive stray markers detected. | |
int | GetBXPassiveStray (int i, double coord[3]) const |
Copy the coordinates of the specified stray marker into the supplied array. | |
int | GetBXPassiveStrayOutOfVolume (int i) const |
Determine whether a passive stray is outside of the characterized volume. | |
int | GetBXSystemStatus () const |
Get an 16-bit status bitfield for the system. | |
int | GetSSTATControl () const |
Get the status of the control processor. | |
int | GetSSTATSensors () const |
Get the status of the sensor processors. | |
int | GetSSTATTIU () const |
Get the status of the sensor processors. | |
const char * | GetVERText () const |
Get the version information returned by the VER() command. | |
int | GetIRCHKDetected () const |
Check to see whether environmental infrared was detected. | |
int | GetIRCHKNumberOfSources (int side) const |
Get the number of infrared sources seen by one of the two sensors. | |
int | GetIRCHKSourceXY (int side, int i, double xy[2]) const |
Get the coordinates of one of the infrared sources seen by one of the two sensors. | |
Static Public Member Functions | |
static const char * | ErrorString (int errnum) |
Convert an error code returned by GetError() into a string that describes the error. | |
static char * | HexEncode (char *cp, const void *data, int n) |
This function is used to convert raw binary data into a stream of hexadecimal digits that can be sent to the device. | |
static void * | HexDecode (void *data, const char *cp, int n) |
This function converts a hex-encoded string into binary data. | |
Public Attributes | |
ErrorCodeType | |
Protected Member Functions | |
NDICommandInterpreter () | |
Constructor. | |
virtual | ~NDICommandInterpreter () |
Destructor. | |
virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const |
Print object information. |
The NDICommandInterpreter serves to purposes: it formats and builds a CRC value for commands that are sent to the Polaris or Aurora, and it decomponses the replies from the Polaris or Aurora into numerical values.
The AuroraTracker and PolarisTracker classes should create a private instance of NDICommandInterpreter, and then pass their Communication objects to the NDICommandInterpreter.
Definition at line 43 of file igstkNDICommandInterpreter.h.
COMM() data bits, parity and stop bits.
NDI_8N1 | |
NDI_8N2 | |
NDI_8O1 | |
NDI_8O2 | |
NDI_8E1 | |
NDI_8E2 | |
NDI_7N1 | |
NDI_7N2 | |
NDI_7O1 | |
NDI_7O2 | |
NDI_7E1 | |
NDI_7E2 |
Definition at line 149 of file igstkNDICommandInterpreter.h.
VER() reply mode types.
Definition at line 173 of file igstkNDICommandInterpreter.h.
PHSR() handle types.
NDI_ALL_HANDLES | |
NDI_STALE_HANDLES | |
NDI_UNINITIALIZED_HANDLES | |
NDI_UNENABLED_HANDLES | |
NDI_ENABLED_HANDLES |
Definition at line 184 of file igstkNDICommandInterpreter.h.
PENA() tracking modes.
NDI_STATIC | relatively immobile tool (reference) |
NDI_DYNAMIC | dynamic tool (most tools) |
NDI_BUTTON_BOX | tool with no IREDs (foot pedal) |
Definition at line 194 of file igstkNDICommandInterpreter.h.
TX() & BX() reply mode bit definitions.
Definition at line 202 of file igstkNDICommandInterpreter.h.
GetTXTransform() and general-purpose transform return values.
NDI_UNOCCUPIED | port unoccupied or no information |
NDI_VALID | transform has been returned |
NDI_MISSING | tool is out of view or otherwise missing |
NDI_DISABLED | port is disabled or tool was unplugged |
Definition at line 212 of file igstkNDICommandInterpreter.h.
GetTXPortStatus() return value bits.
Definition at line 221 of file igstkNDICommandInterpreter.h.
GetTXSystemStatus() return value bits.
NDI_COMM_SYNC_ERROR | |
NDI_TOO_MUCH_EXTERNAL_INFRARED | |
NDI_COMM_CRC_ERROR | |
NDI_COMM_RECOVERABLE | |
NDI_HARDWARE_FAILURE | |
NDI_HARDWARE_CHANGE | |
NDI_PORT_OCCUPIED | |
NDI_PORT_UNOCCUPIED |
Definition at line 239 of file igstkNDICommandInterpreter.h.
GetTXMarkerInfo() return value bits.
NDI_MARKER_MISSING | |
NDI_MARKER_EXCEEDED_MAX_ANGLE | |
NDI_MARKER_EXCEEDED_MAX_ERROR | |
NDI_MARKER_USED |
Definition at line 260 of file igstkNDICommandInterpreter.h.
PSOUT() states for General Purpose Input Output (GPIO).
Definition at line 277 of file igstkNDICommandInterpreter.h.
PHINF() reply mode bits.
NDI_BASIC | |
NDI_TESTING | |
NDI_PART_NUMBER | |
NDI_ACCESSORIES | |
NDI_MARKER_TYPE | |
NDI_PORT_LOCATION | |
NDI_GPIO_STATUS |
Definition at line 286 of file igstkNDICommandInterpreter.h.
GetPHINFAccessories() return value bits.
Definition at line 298 of file igstkNDICommandInterpreter.h.
GetPHINFMarkerType() return value.
NDI_950NM | |
NDI_850NM | |
NDI_NDI_ACTIVE | |
NDI_NDI_CERAMIC | |
NDI_PASSIVE_ANY | |
NDI_PASSIVE_SPHERE | |
NDI_PASSIVE_DISC |
Definition at line 311 of file igstkNDICommandInterpreter.h.
Tool type specifiers returned by GetPHINFToolType().
NDI_TYPE_REFERENCE | |
NDI_TYPE_POINTER | |
NDI_TYPE_BUTTON | |
NDI_TYPE_SOFTWARE | |
NDI_TYPE_MICROSCOPE | |
NDI_TYPE_CALIBRATION | |
NDI_TYPE_DOCK | |
NDI_TYPE_ISOLATION | |
NDI_TYPE_CARM | |
NDI_TYPE_CATHETER |
Definition at line 323 of file igstkNDICommandInterpreter.h.
SSTAT() reply format bits.
NDI_CONTROL | control processor information |
NDI_SENSORS | sensor processors |
NDI_TIU | TIU processor. |
Definition at line 338 of file igstkNDICommandInterpreter.h.
GetSSTATSensor() return value bits.
NDI_LEFT_ROM_CHECKSUM | |
NDI_LEFT_SYNC_TYPE_1 | |
NDI_LEFT_SYNC_TYPE_2 | |
NDI_RIGHT_ROM_CHECKSUM | |
NDI_RIGHT_SYNC_TYPE_1 | |
NDI_RIGHT_SYNC_TYPE_2 |
Definition at line 353 of file igstkNDICommandInterpreter.h.
GetSSTATTIU() return value bits.
NDI_ROM_CHECKSUM | |
NDI_OPERATING_VOLTAGES | |
NDI_MARKER_SEQUENCING | |
NDI_SYNC | |
NDI_COOLING_FAN | |
NDI_INTERNAL_ERROR |
Definition at line 364 of file igstkNDICommandInterpreter.h.
IRCHK() reply mode bits.
NDI_DETECTED | simple yes/no whether IR detected |
NDI_SOURCES | locations of up to 20 sources per camera |
Definition at line 375 of file igstkNDICommandInterpreter.h.
GetIRCHKNumberOfSources(), GetIRCHKSourceXY() sensor arguments.
Definition at line 382 of file igstkNDICommandInterpreter.h.
SFLIST() reply mode.
Definition at line 389 of file igstkNDICommandInterpreter.h.
SFLIST() summary bits.
Definition at line 399 of file igstkNDICommandInterpreter.h.
igstk::NDICommandInterpreter::NDICommandInterpreter | ( | ) | [protected] |
Constructor.
virtual igstk::NDICommandInterpreter::~NDICommandInterpreter | ( | ) | [protected, virtual] |
Destructor.
igstk::NDICommandInterpreter::igstkStandardClassTraitsMacro | ( | NDICommandInterpreter | , | |
Object | ||||
) | [inline] |
Macro with standard traits declarations.
Device and host error codes The error code is set only by Command() or by macros and functions that call Command().
Error codes that equal to or less than 0xff are error codes reported by the device itself. Error codes greater than 0xff are errors that are reported by the host computer.
The error code is returned by NDICommandInterpreter::GetError() and the corresponding text is available by passing the code to NDICommandInterpreter::ErrorString().
< No error
< Invalid command
< Command too long
< Command too short
< Bad CRC calculated for command
< Timeout on command execution
< New communication parameters failed
< Incorrect number of command parameters
< Invalid port selected
< Invalid mode selected
< Invalid LED selected
< Invalid LED state selected
< Command invalid for current mode
< No tool plugged in selected port
< Selected port not initialized
< Selected port not enabled
< System not initialized
< Failure to stop tracking
< Failure to start tracking
< Failure to initialize tool in port
< Invalid camera parameters
< Failure to initialize
< Failure to start diagnostic mode
< Failure to stop diagnostic mode
< Failure to determine environmental IR
< Failure to read firmware version
< Internal device error
< Failure to initialize for IR diagnostics
< Failure to set marker firing signature
< Failure to search for SROM IDs
< Failure to read SROM data
< Failure to write SROM data
< Failure to select SROM
< Failure to perform tool current test
< No camera parameters for this wavelength
< Command parameter out of range
< No camera parameters for this volume
< Failure to determine supported features
< Reserved error code
< Reserved error code
< SCU has changed state
< Main processor firmware corrupt
< Memory is full
< Requested handle has not been allocated
< Requested handle has become unoccupied
< All handles have been allocated
< Incompatible firmware versions
< Invalid port description
< Requested port is already assigned
< Invalid input or output state
< Invalid operation for tool
< Feature not available
< Too much environmental infrared
< Failure to erase Flash EPROM
< Failure to write Flash EPROM
< Failure to read Flash EPROM
< Bad CRC received from device
< Error opening serial device
< Bad communication parameters for host
< device took >5 secs to reply
< Device write error
< Device read error
< device failed to reset on break
< device not found on specified port
Definition at line 48 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::SetCommunication | ( | CommunicationType * | communication | ) |
Set the communication object that commands will be sent to.
CommunicationType* igstk::NDICommandInterpreter::GetCommunication | ( | ) |
Get the communication object.
const char* igstk::NDICommandInterpreter::Command | ( | const char * | command | ) |
Send a text command to the device and receive a text reply.
command | the command to send, without the trailing CRC |
This function will automatically recogize certain commands and behave accordingly:
The GetError() function can be used to check whether an error occured.
void igstk::NDICommandInterpreter::BEEP | ( | int | n | ) | [inline] |
Cause the device to beep.
n | the number of times to beep, an integer between 1 and 9 |
Definition at line 450 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::COMM | ( | COMMBaudType | baud, | |
COMMDataType | dps, | |||
COMMHandshakeType | handshake | |||
) | [inline] |
Change the device communication parameters.
The host parameters will automatically be adjusted to match. If the specified baud rate is not supported by the serial port, then the error code will be set to NDI_BAD_COMM and the device will have to be reset before communication can continue. Most modern UNIX systems accept all baud rates except 14400, and Windows systems support all baud rates.
baud | one of NDI_9600, NDI_14400, NDI_19200, NDI_38400, NDI_57600, NDI_115200 | |
dps | should usually be NDI_8N1, the most common mode | |
handshake | one of NDI_HANDSHAKE or NDI_NOHANDSHAKE |
Definition at line 463 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::DSTART | ( | ) | [inline] |
Put the device into diagnostic mode.
This must be done prior to executing the IRCHK() command. Diagnostic mode is only useful on the POLARIS.
Definition at line 469 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::DSTOP | ( | ) | [inline] |
Take the device out of diagnostic mode.
Definition at line 473 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::INIT | ( | ) | [inline] |
Initialize the device.
The device must be initialized before any other commands are sent.
Definition at line 478 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::IRCHK | ( | int | mode | ) | [inline] |
Check for sources of environmental infrared.
This command is only valid in diagnostic mode after an IRINIT command.
mode | reply mode bits:
|
The IRCHK command is used to update the information returned by the GetIRCHKDetected() and GetIRCHKSourceXY() functions.
Definition at line 490 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::IRINIT | ( | ) | [inline] |
Initialize the diagnostic environmental infrared checking system.
This command must be called prior to using the IRCHK command.
Definition at line 495 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::LED | ( | int | ph, | |
int | led, | |||
LEDStateType | state | |||
) | [inline] |
Set a tool LED to a particular state.
ph | valid port handle in the range 0x01 to 0xFF | |
led | an integer between 1 and 3 | |
state | desired state: NDI_BLANK 'B', NDI_FLASH 'F' or NDI_SOLID 'S' This command can be used in tracking mode. |
Definition at line 505 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PDIS | ( | int | ph | ) | [inline] |
Disable transform reporting on the specified port handle.
ph | valid port handle in the range 0x01 to 0xFF |
Definition at line 510 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PENA | ( | int | ph, | |
int | mode | |||
) | [inline] |
Enable transform reporting on the specified port handle.
ph | valid port handle in the range 0x01 to 0xFF | |
mode | one of NDI_STATIC 'S', NDI_DYNAMIC 'D' or NDI_BUTTON_BOX 'B' |
Definition at line 517 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PHF | ( | int | ph | ) | [inline] |
Free the specified port handle.
ph | valid port handle in the range 0x01 to 0xFF |
Definition at line 522 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PHINF | ( | int | ph, | |
int | mode | |||
) | [inline] |
Ask the device for information about a tool handle.
ph | valid port handle in the range 0x01 to 0xFF | |
mode | a reply format mode composed of the following bits:
|
The use of the PHINF command with the appropriate reply format updates the information returned by the following commands:
This command is not available during tracking mode.
Definition at line 547 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PHRQ | ( | const char * | num, | |
const char * | sys, | |||
const char * | tool, | |||
const char * | port, | |||
const char * | chan | |||
) | [inline] |
Request a port handle given specific tool criteria.
num | 8-digit device number or wildcard "********" | |
sys | system type TIU "0" or AURORA SCU "1" or wildcard "*" | |
tool | wired "0" or wireless "1" or wildcard "*" | |
port | wired "01" to "10", wireless "0A" to "0I" or wildcard "**" | |
chan | AURORA tool channel "00" or "01" or wildcard "**" |
The use of the PHRQ command updates the information returned by the following commands:
Definition at line 561 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PHSR | ( | PHSRModeType | mode | ) | [inline] |
List the port handles.
mode | the reply mode:
|
The use of the PHSR command with the appropriate reply format updates the information returned by the following commands:
This command is not available during tracking mode.
Definition at line 583 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PINIT | ( | int | ph | ) | [inline] |
Initialize the tool on the specified port handle.
ph | valid port handle in the range 0x01 to 0xFF |
Definition at line 589 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PSOUT | ( | int | ph, | |
int | a, | |||
int | b, | |||
int | c | |||
) | [inline] |
Set the three GPIO wire states for an AURORA tool.
The states available are NDI_GPIO_NO_CHANGE, NDI_GPIO_SOLID, NDI_GPIO_PULSE, and NDI_GPIO_OFF.
ph | valid port handle in the range 0x01 to 0xFF | |
a | GPIO 1 state | |
b | GPIO 2 state | |
c | GPIO 3 state |
Definition at line 600 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PVCLR | ( | int | port | ) | [inline] |
Clear the virtual SROM for the specified port.
For a passive tool, this is equivalent to unplugging the tool. This command has been deprecated in favor of the PHF() command.
port | one of '1', '2', '3' or 'A' to 'I' |
Definition at line 607 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::PVWR | ( | int | ph, | |
int | a, | |||
const char * | x | |||
) | [inline] |
Write to a virtual SROM address on the specified port handle.
ph | valid port handle in the range 0x01 to 0xFF | |
a | an address between 0x0000 and 0x07C0 | |
x | 64-byte data array encoded as a 128-character hexadecimal string |
Definition at line 616 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::RESET | ( | ) | [inline] |
Send a serial break to reset the device.
If the reset was not successful, the error code will be set to NDI_RESET_FAIL.
Definition at line 621 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::SFLIST | ( | SFLISTModeType | mode | ) | [inline] |
Get a feature list for this device.
mode | the desired reply mode
|
The use of the SFLIST command with the appropriate reply format updates the information returned by the following commands:
Definition at line 640 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::SSTAT | ( | int | mode | ) | [inline] |
Request status information from the device.
mode | a reply format mode composed of the following bits:
|
The use of the SSTAT command with the appropriate reply format updates the information returned by the following commands:
This command is not available during tracking mode.
Definition at line 657 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::TSTART | ( | ) | [inline] |
void igstk::NDICommandInterpreter::TSTOP | ( | ) | [inline] |
void igstk::NDICommandInterpreter::TX | ( | int | mode | ) | [inline] |
Request tracking information from the device.
This command is only available in tracking mode.
mode | a reply mode containing the following bits:
|
The TX command with the appropriate reply mode is used to update the data that is returned by the following functions:
Definition at line 689 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::BX | ( | int | mode | ) | [inline] |
Request tracking information from the device.
This command is only available in tracking mode.
mode | a reply mode containing the following bits:
|
The BX command with the appropriate reply mode is used to update the data that is returned by the following functions: Note: To use the BX command, you must set the data bits parameter in the COMM command to 0 (8bits).
Definition at line 715 of file igstkNDICommandInterpreter.h.
void igstk::NDICommandInterpreter::VER | ( | VERModeType | n | ) | [inline] |
Get a string that describes the device firmware version.
n | the processor to get the firmware revision of:
|
Definition at line 727 of file igstkNDICommandInterpreter.h.
int igstk::NDICommandInterpreter::GetError | ( | ) | const |
Get error code from the last command.
An error code of NDI_OKAY signals that no error occurred. The error codes are listed in ErrorCodeType.
int igstk::NDICommandInterpreter::GetPHRQHandle | ( | ) | const |
int igstk::NDICommandInterpreter::GetPHSRNumberOfHandles | ( | ) | const |
Get the number of port handles as returned by a PHSR() command.
int igstk::NDICommandInterpreter::GetPHSRHandle | ( | int | i | ) | const |
Get one of the port handles returned by a PHSR() command.
i | a value between 0 and n where n is the value returned by GetPHSRNumberOfHandles(). |
The PHINF() command can be used to get detailed information about the port handle.
int igstk::NDICommandInterpreter::GetPHSRInformation | ( | int | i | ) | const |
Get the information for a port handle returned by a PHSR() command.
i | a value between 0 and n where n is the value returned by GetPHSRNumberOfHandles(). |
The PHINF() command can be used to get detailed information about the port handle.
int igstk::NDICommandInterpreter::GetPHINFPortStatus | ( | ) | const |
Get the 8-bit status value for the port handle.
The return value is updated only when a PHINF() command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetPHINFToolInfo | ( | char | information[32] | ) | const |
Get a 31-byte string describing the tool.
information | array that information is returned in (the resulting string is not null-terminated) |
The returned string will contain 31 bytes of information followed by a terminating null byte. If the port is unoccupied then the contents of the information string are undefined.
The first 8 bytes are a 32-bit hexidecimal number that provide a generic tool description, and the following 23 bytes provide a manufacturer-specific tool description.
The information is updated only when a PHINF() command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetPHINFToolType | ( | ) | const |
Get an integer that describes the tool type.
This method returns a value that describes the tool type, which will be one of NDI_TYPE_REFERENCE, NDI_TYPE_POINTER, NDI_TYPE_BUTTON (button box or foot pedal), NDI_TYPE_SOFTWARE (custom tool), NDI_TYPE_MICROSCOPE, NDI_TYPE_CALIBRATION, NDI_TYPE_DOCK, NDI_TYPE_ISOLATION, NDI_TYPE_CARM, or NDI_TYPE_CATHETER.
A return value of 0 indicates that no tool type information is available.
The information is updated only when a PHINF() command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.
unsigned int igstk::NDICommandInterpreter::GetPHINFCurrentTest | ( | ) | const |
Return the results of a current test on the IREDS on an active POLARIS tool.
int igstk::NDICommandInterpreter::GetPHINFPartNumber | ( | char | part[21] | ) | const |
Get a 20-byte string that contains the part number of the tool.
part | array that part number is returned in (the resulting string is not null-terminated) |
The information will include 20 bytes of information followed by a null byte.
The information is updated only when a PHINF() command is sent with the NDI_PART_NUMBER (0x0004) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetPHINFAccessories | ( | ) | const |
Get the 8-bit value specifying the tool accessories.
If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero.
The return value is updated only when a PHINF() command is sent with the NDI_ACCESSORIES (0x0008) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetPHINFMarkerType | ( | ) | const |
Get an 8-bit value describing the marker type for the tool.
The low three bits descibe the wavelength, and the high three bits are the marker type code.
The return value is updated only when a PHINF() command is sent with the NDI_MARKER_TYPE (0x0010) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetPHINFPortLocation | ( | char | location[15] | ) | const |
Get a 14-byte description of the physical location of the tool on the system.
The 15th byte will be a null byte to terminate the string.
The return value is updated only when a PHINF() command is sent with the NDI_PORT_LOCATION (0x0020) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetPHINFGPIOStatus | ( | ) | const |
Get the 8-bit GPIO status for this tool.
The return value is updated only when a PHINF() command is sent with the NDI_GPIO_STATUS (0x0040) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetTXTransform | ( | int | ph, | |
double | transform[8] | |||
) | const |
Get the transformation for the specified port.
The first four numbers are a quaternion, the next three numbers are the coodinates in millimetres, and the final number is a unitless error estimate.
ph | valid port handle in range 0x01 to 0xFF | |
transform | space for the 8 numbers in the transformation |
If NDI_VALID is not returned, then the values in the supplied transform array will be left unchanged.
The transformations for each of the port handles remain the same until the next TX() command is sent to the device.
int igstk::NDICommandInterpreter::GetTXPortStatus | ( | int | ph | ) | const |
Get the 16-bit status value for the specified port handle.
ph | valid port handle in range 0x01 to 0xFF |
unsigned int igstk::NDICommandInterpreter::GetTXFrame | ( | int | ph | ) | const |
Get the camera frame number for the latest transform.
ph | valid port handle in range 0x01 to 0xFF |
int igstk::NDICommandInterpreter::GetTXToolInfo | ( | int | ph | ) | const |
Get additional information about the tool transformation.
ph | valid port handle in range 0x01 to 0xFF |
The tool information is only updated when the TX() command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit.
int igstk::NDICommandInterpreter::GetTXMarkerInfo | ( | int | ph, | |
int | marker | |||
) | const |
Get additional information about the tool markers.
ph | valid port handle in range 0x01 to 0xFF | |
marker | one of 'A' through 'T' for the 20 markers |
The tool marker information is only updated when the TX() command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit set.
int igstk::NDICommandInterpreter::GetTXSingleStray | ( | int | ph, | |
double | coord[3] | |||
) | const |
Get the coordinates of a stray marker on a wired POLARIS tool.
This command is only meaningful for tools that have a stray marker.
ph | valid port handle in range 0x01 to 0xFF | |
coord | array to hold the three coordinates |
The stray marker position is only updated when the TX() command is called with the NDI_SINGLE_STRAY (0x0004) bit set.
int igstk::NDICommandInterpreter::GetTXNumberOfPassiveStrays | ( | ) | const |
Get the number of passive stray markers detected.
int igstk::NDICommandInterpreter::GetTXPassiveStray | ( | int | i, | |
double | coord[3] | |||
) | const |
Copy the coordinates of the specified stray marker into the supplied array.
i | a number between 0 and 49 | |
coord | array to hold the coordinates |
Use GetTXNumberOfPassiveStrays() to get the number of stray markers that are visible.
The passive stray marker coordinates are updated when a TX() command is sent with the NDI_PASSIVE_STRAY (0x1000) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetTXPassiveStrayOutOfVolume | ( | int | i | ) | const |
Determine whether a passive stray is outside of the characterized volume.
i | a number between 0 and 49 |
Use GetTXNumberOfPassiveStrays() to get the number of stray markers that are visible.
This information is updated when a TX() command is sent with the NDI_PASSIVE_STRAY (0x1000) and the NDI_INCLUDE_OUT_OF_VOLUME (0x0800) bits set in the reply mode..
int igstk::NDICommandInterpreter::GetTXSystemStatus | ( | ) | const |
Get an 16-bit status bitfield for the system.
The system stutus information is updated whenever the TX() command is called with the NDI_XFORMS_AND_STATUS (0x0001) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetBXTransform | ( | int | ph, | |
double | transform[8] | |||
) | const |
Get the transformation for the specified port.
The first four numbers are a quaternion, the next three numbers are the coodinates in millimetres, and the final number is a unitless error estimate.
ph | valid port handle in range 0x01 to 0xFF | |
transform | space for the 8 numbers in the transformation |
If NDI_VALID is not returned, then the values in the supplied transform array will be left unchanged.
The transformations for each of the port handles remain the same until the next BX() command is sent to the device.
int igstk::NDICommandInterpreter::GetBXPortStatus | ( | int | ph | ) | const |
Get the 16-bit status value for the specified port handle.
ph | valid port handle in range 0x01 to 0xFF |
unsigned int igstk::NDICommandInterpreter::GetBXFrame | ( | int | ph | ) | const |
Get the camera frame number for the latest transform.
ph | valid port handle in range 0x01 to 0xFF |
int igstk::NDICommandInterpreter::GetBXToolInfo | ( | int | ph | ) | const |
Get additional information about the tool transformation.
ph | valid port handle in range 0x01 to 0xFF |
The tool information is only updated when the BX() command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit.
int igstk::NDICommandInterpreter::GetBXMarkerInfo | ( | int | ph, | |
int | marker | |||
) | const |
Get additional information about the tool markers.
ph | valid port handle in range 0x01 to 0xFF | |
marker | one of 'A' through 'T' for the 20 markers |
The tool marker information is only updated when the BX() command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit set.
int igstk::NDICommandInterpreter::GetBXSingleStray | ( | int | ph, | |
double | coord[3] | |||
) | const |
Get the coordinates of a stray marker on a wired POLARIS tool.
This command is only meaningful for tools that have a stray marker.
ph | valid port handle in range 0x01 to 0xFF | |
coord | array to hold the three coordinates |
The stray marker position is only updated when the BX() command is called with the NDI_SINGLE_STRAY (0x0004) bit set.
int igstk::NDICommandInterpreter::GetBXNumberOfPassiveStrays | ( | ) | const |
Get the number of passive stray markers detected.
int igstk::NDICommandInterpreter::GetBXPassiveStray | ( | int | i, | |
double | coord[3] | |||
) | const |
Copy the coordinates of the specified stray marker into the supplied array.
i | a number between 0 and 19 | |
coord | array to hold the coordinates |
Use GetTXNumberOfPassiveStrays() to get the number of stray markers that are visible.
The passive stray marker coordinates are updated when a BX() command is sent with the NDI_PASSIVE_STRAY (0x1000) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetBXPassiveStrayOutOfVolume | ( | int | i | ) | const |
Determine whether a passive stray is outside of the characterized volume.
i | a number between 0 and 49 |
Use GetBXNumberOfPassiveStrays() to get the number of stray markers that are visible.
This information is updated when a BX() command is sent with the NDI_PASSIVE_STRAY (0x1000) and the NDI_INCLUDE_OUT_OF_VOLUME (0x0800) bits set in the reply mode..
int igstk::NDICommandInterpreter::GetBXSystemStatus | ( | ) | const |
Get an 16-bit status bitfield for the system.
The system stutus information is updated whenever the BX() command is called with the NDI_XFORMS_AND_STATUS (0x0001) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetSSTATControl | ( | ) | const |
Get the status of the control processor.
This information is updated only when the SSTAT() command is sent with the NDI_CONTROL (0x0001) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetSSTATSensors | ( | ) | const |
Get the status of the sensor processors.
This information is updated only when the SSTAT() command is sent with the NDI_SENSORS (0x0002) bit set in the reply mode.
int igstk::NDICommandInterpreter::GetSSTATTIU | ( | ) | const |
Get the status of the sensor processors.
This information is updated only when the SSTAT() command is sent with the NDI_TIU (0x0004) bit set in the reply mode.
const char* igstk::NDICommandInterpreter::GetVERText | ( | ) | const |
Get the version information returned by the VER() command.
int igstk::NDICommandInterpreter::GetIRCHKDetected | ( | ) | const |
Check to see whether environmental infrared was detected.
int igstk::NDICommandInterpreter::GetIRCHKNumberOfSources | ( | int | side | ) | const |
Get the number of infrared sources seen by one of the two sensors.
side | one of NDI_LEFT or NDI_RIGHT |
This information is valid only immediately after the IRCHK() command has been called with the NDI_SOURCES (0x0002) format bit set. Otherwise, the return value will be zero.
int igstk::NDICommandInterpreter::GetIRCHKSourceXY | ( | int | side, | |
int | i, | |||
double | xy[2] | |||
) | const |
Get the coordinates of one of the infrared sources seen by one of the two sensors.
side | one of NDI_LEFT or NDI_RIGHT | |
i | the source to get the coordinates for | |
xy | space to store the returned coordinates |
If there is no available information, then the xy array will be left unchanged and the value NDI_MISSING will be returned. Otherwise, the return value will be NDI_OKAY.
This information is valid only immediately after the IRCHK() command has been called with the NDI_SOURCES (0x0002) format bit set.
static const char* igstk::NDICommandInterpreter::ErrorString | ( | int | errnum | ) | [static] |
Convert an error code returned by GetError() into a string that describes the error.
An unrecognized error code will return "Unrecognized error code".
static char* igstk::NDICommandInterpreter::HexEncode | ( | char * | cp, | |
const void * | data, | |||
int | n | |||
) | [static] |
This function is used to convert raw binary data into a stream of hexadecimal digits that can be sent to the device.
The length of the output string will be twice the number of bytes in the input data, since each byte will be represented by two hexadecimal digits.
As a convenience, the return value is a pointer to the hexadecimal string. If the string must be terminated, then set cp[2*n] to 0 before calling this function, otherwise the string will be left unterminated.
static void* igstk::NDICommandInterpreter::HexDecode | ( | void * | data, | |
const char * | cp, | |||
int | n | |||
) | [static] |
This function converts a hex-encoded string into binary data.
This can be used to decode the SROM data sent from the device. The length of the input string must be twice the expected number of bytes in the output data, since each binary byte is ecoded by two hexadecimal digits.
As a convenience, the return value is a pointer to the decoded data.
virtual void igstk::NDICommandInterpreter::PrintSelf | ( | std::ostream & | os, | |
itk::Indent | indent | |||
) | const [protected, virtual] |
Definition at line 135 of file igstkNDICommandInterpreter.h.