50 QStringList selectedTools = config.
mTools;
53 TRACKING_SYSTEM selectedTracker = string2enum<TRACKING_SYSTEM>(config.
mTrackingSystem);
59 foreach(QString absoluteToolPath, selectedTools)
64 tool.first = absoluteToolPath;
65 tool.second = (absoluteToolPath == referencePath);
66 toolfilesAndRefVector.push_back(tool);
80 retval.
mName = QFileInfo(uid).completeBaseName();
84 std::vector<IgstkTracker::InternalStructure> trackers = parser.
getTrackers();
85 for (
unsigned i = 0; i < trackers.size(); ++i)
92 for (
unsigned i = 0; i < tools.size(); ++i)
103 QStringList trackingsystemsFilter)
106 QStringList filteredTools = this->filter(allTools, applicationsFilter, trackingsystemsFilter);
107 return filteredTools;
115 QString absoluteFilePath = uid;
116 QFile file(absoluteFilePath);
117 QFileInfo info(file);
118 retval.
mName = info.dir().dirName();
130 QStringList TrackerConfigurationImpl::filter(QStringList toolsToFilter, QStringList applicationsFilter,
131 QStringList trackingsystemsFilter)
135 foreach(QString toolFilePath, toolsToFilter)
141 QString trackerName =
enum2string(
internal.mTrackerType);
142 if(!trackingsystemsFilter.contains(trackerName, Qt::CaseInsensitive))
146 bool passedApplicationFilter =
false;
147 std::vector<QString>::iterator it =
internal.mClinicalApplications.begin();
148 while(it !=
internal.mClinicalApplications.end() && !passedApplicationFilter)
150 QString applicationName = *it;
151 if(applicationsFilter.contains(applicationName, Qt::CaseInsensitive))
153 passedApplicationFilter =
true;
157 if(!passedApplicationFilter)
161 retval << toolFilePath;
167 IgstkTool::InternalStructure TrackerConfigurationImpl::getToolInternal(QString toolAbsoluteFilePath)
169 IgstkTool::InternalStructure retval;
171 ToolFileParser parser(toolAbsoluteFilePath);
172 retval = parser.getTool();
180 return internal.verify();
185 return profile()->getPath() +
"/tool";
210 for (
int i=0; i< rootPaths.size(); ++i)
212 QString configFilePath = rootPaths[i] +
"/profiles";
213 foreach(QFileInfo dir,
cx::getDirs(configFilePath))
223 QStringList root =
profile()->getAllRootConfigPaths();
224 QString suffix(
"/tool/Tools/");
226 bool includeSubDirs =
true;
227 for (
int i=0; i<root.size(); ++i)
229 QString toolPath = root[i]+suffix;
TrackersAndToolsMap mTrackersAndTools
the trackers and tools (relative path) that should be used in the config
cxResource_EXPORT ProfilePtr profile()
virtual Configuration getConfiguration(QString uid)
virtual QStringList getConfigurationsGivenApplication()
std::vector< ToolFileAndReference > ToolFilesAndReferenceVector
virtual QString getConfigurationApplicationsPath()
virtual QStringList getAllTools()
QString getApplicationapplication()
static QStringList getRootConfigPaths()
QString mFileName
absolute path and filename for the new config file
virtual QStringList getAllConfigurations()
QString getAbsoluteReferenceFilePath()
static void saveConfiguration(Configuration &config)
virtual QStringList getSupportedTrackingSystems()
QFileInfoList getDirs(QString path)
virtual QStringList getToolsGivenFilter(QStringList applicationsFilter, QStringList trackingsystemsFilter)
std::vector< IgstkTracker::InternalStructure > getTrackers()
Class for reading the files defining a CustusX tool.
virtual void saveConfiguration(const Configuration &config)
QStringList getAbsolutePathToXmlFiles(QString path, bool includeSubDirs)
QString mUid
absolute path and filename for the new config file
static QStringList getSupportedTrackingSystems()
QString mClinicalApplication
std::pair< QString, bool > ToolFileAndReference
std::vector< QString > getAbsoluteToolFilePaths()
QString mClinical_app
the clinical application this config is made for
virtual bool verifyTool(QString uid)
QString enum2string(const ENUM &val)
virtual Tool getTool(QString uid)