1
/*=========================================================================
3
Program: Image Guided Surgery Software Toolkit
4
Module: $RCSfile: igstkMedSafeTrackerConfiguration.cxx,v $
6
Date: $Date: 2009-01-30 20:48:01 $
7
Version: $Revision: 1.1 $
9
Copyright (c) ISC Insight Software Consortium. All rights reserved.
10
See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
PURPOSE. See the above copyright notices for more information.
16
=========================================================================*/
18
#include "igstkMedSafeTrackerConfiguration.h"
22
//maximal refresh rate for the 3D Guidance MedSafe system possible
23
//with the short/mid range transmitters
24
const double MedSafeTrackerConfiguration::MAXIMAL_REFERESH_RATE = 350;
26
const unsigned MedSafeTrackerConfiguration::MAXIMAL_PORT_NUMBER = 4;
28
MedSafeTrackerConfiguration::MedSafeTrackerConfiguration()
30
this->m_Frequency = this->MAXIMAL_REFERESH_RATE;
34
MedSafeTrackerConfiguration::~MedSafeTrackerConfiguration()
40
MedSafeTrackerConfiguration::GetMaximalRefreshRate()
42
return this->MAXIMAL_REFERESH_RATE;
47
MedSafeTrackerConfiguration::InternalAddTool(
48
const TrackerToolConfiguration *tool, bool isReference )
50
AddToolFailureEvent fe;
51
const MedSafeToolConfiguration *wiredTool =
52
dynamic_cast<const MedSafeToolConfiguration *>( tool );
55
if( wiredTool == NULL )
57
fe.Set( "Given tool configuration type not compatible with tracker type." );
58
this->InvokeEvent( fe );
61
//check for valid bird name???
63
if( wiredTool->GetPortNumber()==0 ||
64
wiredTool->GetPortNumber()> this->MAXIMAL_PORT_NUMBER )
66
fe.Set( "Specified physical port number is invalid." );
67
this->InvokeEvent( fe );
71
//copy the tool and add it as a standard or dynamic reference tool
72
MedSafeToolConfiguration *newTool =
73
new MedSafeToolConfiguration( *wiredTool );
77
this->m_TrackerToolList.insert(std::pair<std::string, TrackerToolConfiguration *>
78
(newTool->GetToolName(), newTool) );
82
delete this->m_ReferenceTool;
83
this->m_ReferenceTool = newTool;
85
this->InvokeEvent( AddToolSuccessEvent() );
89
MedSafeToolConfiguration::MedSafeToolConfiguration() : m_PortNumber( 1 )
94
MedSafeToolConfiguration::MedSafeToolConfiguration( const
95
MedSafeToolConfiguration &other ) : TrackerToolConfiguration( other )
97
this->m_PortNumber = other.m_PortNumber;
101
MedSafeToolConfiguration::~MedSafeToolConfiguration()
107
MedSafeToolConfiguration::GetToolTypeAsString()
109
return "MedSafeToolConfiguration";
112
} // end of name space