|
Public Member Functions |
| | NDICommands (const std::string &strDevice, long nBaudeRate, int nDataBits, char cParity, int nStopBits, bool bHardwareHandShake) |
| | Constructor.
|
| | ~NDICommands () |
| | Destructor.
|
| void | initialize () |
| | Command to initialzed the Aurora/Polaris.
|
| void | trackNodes (std::deque< TransformData > &queTransformData, int *nStatus) |
| | Passes back the transforms and the system status of the Aurora/Polaris.
|
| int | getNumberOfMagneticPorts () const |
| | Indicates the number of magnetic ports.
|
| void | getOccupiedPortHandles (std::deque< std::string > &occupiedPorts) |
| | Get all occupied port handles that are not initialized or enabled.
|
| void | getFreeablePortHandles (std::deque< std::string > &occupiedPorts) |
| | Get all port handles that should be freed.
|
| void | getEnabledPortHandles (std::deque< std::string > &enabledPorts) |
| | Get enabled port handles.
|
| void | initializePort (std::string strPort) |
| | Initializes a port.
|
| void | enablePort (std::string strPort, bool bIsDynamic) |
| | Enables a port, indicating whether it is dynamic or not(static).
|
| std::string | getToolID (std::string) |
| | Get the tool Name/ID.
|
| std::string | getFirmwareVersion () |
| | Get the firmware version in one huge text string.
|
| void | enterTrackingMode () |
| | Tells the Aurora/Polaris to begin tracking.
|
| void | freeToolPort (std::string strPort) |
| | Tells the Aurora/Polaris to free a freeable port.
|
| void | voidToolTracking (std::string strPort) |
| | Tells the Aurora/Polaris to not track a tool on a port.
|
| void | setUseCRC (bool bEnable) |
| | Sets all commands to be sent with CRC info.
|
| void | setCheckCRC (bool bEnable) |
| | Sets to check all replies with their CRC info.
|
| void | reset () |
| | Resets the Aurora/Polaris to it's initial (uninitialized) event.
|
| void | changeCommSettings (long nBaudRate, int nDataBits, char cParity, int nStopBits, bool bHardwareHandshake) |
| | Sets the serial communication settings.
|
| void | exitTrackingMode (bool bExpedient) |
| | Tells the Tracker and the Aurora/Polaris to stop tracking.
|
| void | checkProcessorStatus () |
| | Checks whether the Aurora/Polaris unit is functional.
|
| void | turnOnGPIO (std::string strPort) |
| | turn on GPIO stuff (currently useless 01/19/2004) (Aurora only)
|
| void | turnOffGPIO (std::string strPort) |
| | turn off GPIO stuff (currently useless 01/19/2004) (Aurora only)
|
| std::string | getWirelessPortHandle () |
| void | sendSROMData (std::string strPort, unsigned char sROM[1024]) |
| void | setMultipliers (long rotation, long translation) |
Static Public Attributes |
| static const int | TOOL_ADDED = 0 |
| | Indicates that a tool has been added to a port.
|
| static const int | TOOL_REMOVED = 1 |
| | Indicates that a tool has been removed from a port.
|
| static const int | NORMAL_EXECUTION = 2 |
| | Indicates that no port changes had occured.
|
| static const int | INTERFERENCE = 3 |
| | Indicates that there is magnetic or IR interference.
|
| static const std::string | m_strScope = "NDICommands: " |
| | indicates the current class, used for getting information
|
| static const std::string | m_strCantInitializeNDI = "Unable to initialize the Aurora/Polaris." |
| static const std::string | m_strUnexpectedReply = "Unexpected reply received from the Aurora/Polaris: command = '%1', params = '%2', reply = '%3'." |
| static const std::string | m_strFailedToReset = "Failed to reset the Aurora/Polaris." |
| static const std::string | m_strFailedToChangeCommSettings = "Failed to change Aurora/Polaris communications settings." |
| static const std::string | m_strCommandFailed = "Aurora/Polaris command failed: command = '%1', params = '%2'." |
| static const std::string | m_strTimeout = "Command timed out." |
| static const std::string | m_strCRCError = "CRC error while communicating with the Aurora/Polaris." |
| static const std::string | m_strInvalidPort = "Invalid port specified." |
| static const std::string | m_strNoToolPluggedIn = "No tool plugged into the specified port." |
| static const std::string | m_strInvalidBaudRate = "Invalid baud rate '%1'." |
| static const std::string | m_strInvalidDataBits = "Invalid data bits '%1'." |
| static const std::string | m_strInvalidParity = "Invalid parity '%1'." |
| static const std::string | m_strInvalidStopBits = "Invalid stop bits '%1'." |
| static const std::string | m_strErrorFromNDI = "Received error code '%1' from the Aurora/Polaris." |
| static const std::string | m_strBadProcessorStatus = "One or more Aurora/Polaris processors failed the status check: code = '%1'." |
| static const std::string | m_strSynchronizationError = "Internal Aurora/Polaris synchronization error. Reset required." |
| static const std::string | m_strInvalidVolume = "Attempt to select invalid Aurora/Polaris volume." |
| static const std::string | m_strTooMuchInterference = "Too much magnetic/IR interference in the vicinity." |
Protected Member Functions |
| void | sendGPIO (std::string strOption) |
| | sends the GPIO message to the Aurora (Aurora only)
|
| const std::string | sendCommand (const std::string &strExpectedReply, const std::string &strCode, const std::string &strParams, const int nMaxRetries=5) |
| | Send a command to the Aurora/Polaris, check that the reply is the one you expected.
|
| const std::string | sendCommand (const std::string &strCode, const std::string &strParams, const int nMaxRetries=5) |
| | Send a command to the Aurora/Polaris, return the reply.
|
| const std::string | mapCommParams (long nBaudRate, int nDataBits, char cParity, int nStopBits, bool bHardwareHandshake) |
| | Maps the serial port information to something that the Aurora/Polaris can parse.
|
| float | parseTransform (const std::string strField, int *nOffset, const int nLength, const long nMultiplier) const |
| | Parse the string Transforms returned in tracking a tool.
|
| int | handleTransformStatus (const std::string &strStatus) |
| | Parse the system tranform status information to see if things happened.
|
| void | getSomePortHandles (std::deque< std::string > &occupiedPorts, std::string strOption) |
| | Get all port handles according to a requirement.
|
| const std::string | getReply () |
| | Get an expected reply from the Aurora/Polaris unit.
|
| bool | headMatches (std::string sOne, std::string sTwo) |
| | See if the head of one string matches tho other.
|
| bool | bitTest (unsigned int nBitField, int nBit) const |
| | See of the bit information of an integer according to bit position.
|
| void | handleNDIError (const std::string strErrorCode) |
| | Throws translated error messages from the cryptic Aurora/Polaris ASCII errors.
|
| std::string | getNextField (const std::string &str, int *nOffset, const std::string &strDelimiter) |
| | Grabs the fields of the string returned by the Aurora/Polaris.
|
| std::string | calcCRC16 (const char *ptr, int nLen) |
| | Calculates the CRC126 for a certain string.
|
| | NDICommands (const NDICommands &) |
| | Prevent use of copy constructor.
|
Protected Attributes |
| std::map< long, char > | mt_BaudMap |
| SerialPort | port |
| | port structure for the serial port data
|
| int | mt_pSerialIO |
| | The serial port connection.
|
| bool | mt_bUseCRC |
| | Do we generate a CRC for the command?
|
| bool | mt_bCheckCRC |
| | Do we check CRC for replies?
|
| int | m_nNumFieldGenerators |
| | The number of field generators.
|
| int | m_nNumMagneticPorts |
| | The number of passive ports.
|
Static Protected Attributes |
| static const std::string | mt_strCOMM = "COMM" |
| static const std::string | mt_strDSTART = "DSTART" |
| static const std::string | mt_strDSTOP = "DSTOP" |
| static const std::string | mt_strERROR = "ERROR" |
| static const std::string | mt_strGX |
| static const std::string | mt_strINIT = "INIT" |
| static const std::string | mt_strOKAY = "OKAY" |
| static const std::string | mt_strPENA = "PENA" |
| static const std::string | mt_strPDIS = "PDIS" |
| static const std::string | mt_strPINIT = "PINIT" |
| static const std::string | mt_strPSTAT |
| static const std::string | mt_strPURD = "PURD" |
| static const std::string | mt_strPVCLR |
| static const std::string | mt_strPHRQ = "PHRQ" |
| static const std::string | mt_strPVWR = "PVWR" |
| static const std::string | mt_strRESET = "RESET" |
| static const std::string | mt_strSFLIST = "SFLIST" |
| static const std::string | mt_strSSTAT = "SSTAT" |
| static const std::string | mt_strTSTART = "TSTART" |
| static const std::string | mt_strTSTOP = "TSTOP" |
| static const std::string | mt_strVER = "VER" |
| static const std::string | mt_strVSEL = "VSEL" |
| static const std::string | mt_strBX = "BX" |
| static const std::string | mt_strTX = "TX" |
| static const std::string | mt_strPHINF = "PHINF" |
| static const std::string | mt_strPHSR = "PHSR" |
| static const std::string | mt_strPHF = "PHF" |
| static const std::string | mt_strPSOUT = "PSOUT" |
| static const unsigned int | mt_nCommSleepInMilliseconds = 100 |
| static const int | mt_nPINITReadTimeoutInMilliSeconds = 10000 |
| static const std::string | mt_strFieldDelimiter = "\r" |
| static const int | mt_nBlockSize = 64 |
| static const int | mt_nMarkerInfoLength = 12 |
| static const std::string | mt_strDISABLED = "DISABLED" |
| static const std::string | mt_strMISSING = "MISSING" |
| static const int | mt_nRotationLength = 6 |
| static long | mt_nRotationMultiplier = 10000L |
| static const int | mt_nTranslationLength = 7 |
| static long | mt_nTranslationMultiplier = 100L |
| static const int | mt_nErrorLength = 6 |
| static const long | mt_nErrorMultiplier = 10000000L |
| static const int | mt_nFrameNumberLength = 8 |
| static const int | mt_nDefaultMaxRetries = 4 |