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;
155 if(applicationsFilter.contains(
"all", Qt::CaseInsensitive))
157 passedApplicationFilter =
true;
159 if(applicationsFilter.contains(
"default", Qt::CaseInsensitive))
161 passedApplicationFilter =
true;
165 if(!passedApplicationFilter)
169 retval << toolFilePath;
175 IgstkTool::InternalStructure TrackerConfigurationImpl::getToolInternal(QString toolAbsoluteFilePath)
177 IgstkTool::InternalStructure retval;
179 ToolFileParser parser(toolAbsoluteFilePath);
180 retval = parser.getTool();
188 return internal.verify();
193 return profile()->getPath() +
"/tool";
218 for (
int i=0; i< rootPaths.size(); ++i)
220 QString configFilePath = rootPaths[i] +
"/profiles";
221 foreach(QFileInfo dir,
cx::getDirs(configFilePath))
231 QStringList root =
profile()->getAllRootConfigPaths();
232 QString suffix(
"/tool/Tools/");
234 bool includeSubDirs =
true;
235 for (
int i=0; i<root.size(); ++i)
237 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)