14 #include <QStringList>
26 mInternalStructure(internalStructure),
37 mCommunication->SetPortNumber(igstk::SerialCommunication::PortNumber0);
39 mCommunication->SetBaudRate(igstk::SerialCommunication::BaudRate115200);
40 mCommunication->SetDataBits(igstk::SerialCommunication::DataBits8);
41 mCommunication->SetStopBits(igstk::SerialCommunication::StopBits1);
42 mCommunication->SetHardwareHandshake(igstk::SerialCommunication::HandshakeOff);
44 bool logging =
settings()->
value(
"IGSTKDebugLogging",
true).toBool();
56 reportError(
"Tracker is of type TRACKER_NONE, this means it's not valid.");
64 report(
"Tracker is set to Polaris");
70 report(
"Polaris Classic is not supported");
78 report(
"Tracker is set to Aurora");
84 report(
"Tracker is set to Micron, not supported");
149 for (std::map<QString, IgstkToolPtr>::iterator it = tools.begin(); it != tools.end(); ++it)
153 if (tool && tool->getPointer())
157 "Tracker is attaching a tool that is not of the correct type. Trackers type: "
161 tool->getPointer()->RequestAttachToTracker(
mTracker);
163 if (tool->isReference())
164 mTracker->RequestSetReferenceTool(tool->getPointer());
176 for (std::map<QString, IgstkToolPtr>::iterator it = tools.begin(); it != tools.end(); ++it)
180 if (tool && tool->getPointer())
182 tool->getPointer()->RequestDetachFromTracker();
220 if (igstk::TrackerOpenEvent().CheckEvent(&event))
225 else if (igstk::TrackerCloseEvent().CheckEvent(&event))
230 else if (igstk::TrackerInitializeEvent().CheckEvent(&event))
235 reportWarning(
"This never happens for some reason... check code");
237 else if (igstk::TrackerStartTrackingEvent().CheckEvent(&event))
241 else if (igstk::TrackerStopTrackingEvent().CheckEvent(&event))
245 else if (igstk::TrackerUpdateStatusEvent().CheckEvent(&event))
249 else if (igstk::TrackerToolTransformUpdateEvent().CheckEvent(&event))
254 else if (igstk::CompletedEvent().CheckEvent(&event))
260 else if (igstk::CoordinateSystemSetTransformEvent().CheckEvent(&event))
265 else if (igstk::InvalidRequestErrorEvent().CheckEvent(&event))
267 reportWarning(
mUid +
" received an invalid request. This means that the internal igstk tracker did not accept the request. Do not know which request.");
270 else if (igstk::TrackerOpenErrorEvent().CheckEvent(&event))
275 else if (igstk::TrackerCloseErrorEvent().CheckEvent(&event))
280 else if (igstk::TrackerInitializeErrorEvent().CheckEvent(&event))
285 else if (igstk::TrackerStartTrackingErrorEvent().CheckEvent(&event))
290 else if (igstk::TrackerStopTrackingErrorEvent().CheckEvent(&event))
295 else if (igstk::TrackerUpdateStatusErrorEvent().CheckEvent(&event))
301 else if (igstk::InputOutputErrorEvent().CheckEvent(&event))
307 else if (igstk::InputOutputTimeoutEvent().CheckEvent(&event))
312 else if (igstk::OpenPortErrorEvent().CheckEvent(&event))
317 else if (igstk::ClosePortErrorEvent().CheckEvent(&event))
324 event.Print(std::cout);
330 bool logging =
settings()->
value(
"IGSTKDebugLogging",
true).toBool();
333 std::ofstream* loggerFile =
new std::ofstream();
353 report(
mUid +
" is " + (value ?
"open" :
"closed") +
".");
363 report(
mUid +
" is " + (value ?
"" :
"un") +
"initialized.");
373 report(
mUid +
" is " + (value ?
"" :
"not ") +
"tracking.");
379 reportWarning(
mUid +
" experienced a unrecoverable error, reconfiguration is required.");