Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MITKNDIPROTOCOL_H_HEADER_INCLUDED_
00020 #define MITKNDIPROTOCOL_H_HEADER_INCLUDED_
00021
00022 #include <itkObject.h>
00023 #include <itkObjectFactory.h>
00024
00025 #include <MitkIGTExports.h>
00026 #include "mitkSerialCommunication.h"
00027 #include "mitkNDIPassiveTool.h"
00028
00029 namespace mitk
00030 {
00031 class NDITrackingDevice;
00032
00039 class MitkIGT_EXPORT NDIProtocol : public itk::Object
00040 {
00041 public:
00042 mitkClassMacro(NDIProtocol, itk::Object);
00043 itkNewMacro(Self);
00044
00045 itkSetObjectMacro(TrackingDevice, NDITrackingDevice);
00046
00047 typedef mitk::SerialCommunication::PortNumber PortNumber;
00048 typedef mitk::SerialCommunication::BaudRate BaudRate;
00049 typedef mitk::SerialCommunication::DataBits DataBits;
00050 typedef mitk::SerialCommunication::Parity Parity;
00051 typedef mitk::SerialCommunication::StopBits StopBits;
00052 typedef mitk::SerialCommunication::HardwareHandshake HardwareHandshake;
00053 typedef mitk::NDIPassiveTool::TrackingPriority TrackingPriority;
00054
00057 NDIErrorCode APIREV(std::string* revision);
00058 NDIErrorCode PHINF(std::string portHandle, std::string* portInfo);
00059 NDIErrorCode PSOUT(std::string portHandle, std::string state);
00060 NDIErrorCode COMM(mitk::SerialCommunication::BaudRate baudRate, mitk::SerialCommunication::DataBits dataBits, mitk::SerialCommunication::Parity parity, mitk::SerialCommunication::StopBits stopBits, mitk::SerialCommunication::HardwareHandshake hardwareHandshake);
00061 NDIErrorCode INIT();
00062 NDIErrorCode DSTART();
00063 NDIErrorCode DSTOP();
00064 NDIErrorCode IRINIT();
00065 NDIErrorCode IRCHK(bool* IRdetected);
00066 NDIErrorCode PHSR(PHSRQueryType queryType, std::string* portHandles);
00067 NDIErrorCode PHF(std::string* portHandle);
00068 NDIErrorCode PHRQ(std::string* portHandle);
00069 NDIErrorCode PVWR(std::string* portHandle, const unsigned char* sromData, unsigned int sromDataLength);
00070 NDIErrorCode PINIT(std::string* portHandle);
00071 NDIErrorCode PENA(std::string* portHandle, TrackingPriority prio);
00072 NDIErrorCode PDIS(std::string* portHandle);
00073 NDIErrorCode IRATE(IlluminationActivationRate rate);
00074 NDIErrorCode BEEP(unsigned char count);
00075 NDIErrorCode SFLIST(std::string* info);
00076 NDIErrorCode TSTART(bool resetFrameCounter = false);
00077 NDIErrorCode TSTOP();
00078 NDIErrorCode TX(bool trackIndividualMarkers = false, MarkerPointContainerType* markerPositions = NULL);
00079 NDIErrorCode BX();
00080 NDIErrorCode POS3D(MarkerPointContainerType* markerPositions);
00081 NDIErrorCode VER(mitk::TrackingDeviceType& t);
00082 NDIErrorCode VSEL(mitk::NDITrackingVolume volume);
00083 NDIErrorCode TX1000(MarkerPointContainerType* markerPositions);
00084 unsigned int ByteToNbBitsOn(char& c) const;
00085 itkGetConstMacro(UseCRC, bool);
00086 itkSetMacro(UseCRC, bool);
00087 itkBooleanMacro(UseCRC);
00088 protected:
00089 NDIProtocol();
00090 virtual ~NDIProtocol();
00091
00097 NDIErrorCode ParseOkayError();
00098
00104 NDIErrorCode GenericCommand(const std::string command, const std::string* parameter = NULL);
00105
00109 NDIErrorCode GetErrorCode(const std::string* input);
00110
00111 NDITrackingDevice* m_TrackingDevice;
00112 bool m_UseCRC;
00113 };
00114 }
00115 #endif