32 QStringList selectedTools = config.
mTools;
41 foreach(QString absoluteToolPath, selectedTools)
46 tool.
mReference = (absoluteToolPath == referencePath);
48 for (
unsigned i = 0; i < config.
mToolList.size(); ++i)
57 toolStructureVector.push_back(tool);
71 retval.
mName = QFileInfo(uid).completeBaseName();
75 std::vector<ToolFileParser::TrackerInternalStructure> trackers = parser.
getTrackers();
76 for (
unsigned i = 0; i < trackers.size(); ++i)
83 for (
unsigned i = 0; i < tools.size(); ++i)
96 QStringList trackingsystemsFilter)
99 QStringList filteredTools = this->filter(allTools, applicationsFilter, trackingsystemsFilter);
100 return filteredTools;
108 QString absoluteFilePath = uid;
109 QFile file(absoluteFilePath);
110 QFileInfo info(file);
111 retval.
mName = info.dir().dirName();
128 foreach(QString path, allTools)
132 for (
unsigned i=0; i<
internal->mClinicalApplications.size(); ++i)
133 retval << internal->mClinicalApplications[i];
136 retval.removeDuplicates();
150 QStringList TrackerConfigurationImpl::filter(QStringList toolsToFilter, QStringList applicationsFilter,
151 QStringList trackingsystemsFilter)
155 foreach(QString toolFilePath, toolsToFilter)
161 QString trackerName =
enum2string(internal->mTrackerType);
162 if(!trackingsystemsFilter.contains(trackerName, Qt::CaseInsensitive))
166 bool passedApplicationFilter =
false;
167 std::vector<QString>::iterator it =
internal->mClinicalApplications.begin();
168 while(it != internal->mClinicalApplications.end() && !passedApplicationFilter)
170 QString applicationName = *it;
171 if(applicationsFilter.contains(applicationName, Qt::CaseInsensitive))
173 passedApplicationFilter =
true;
175 if(applicationsFilter.contains(
"all", Qt::CaseInsensitive))
177 passedApplicationFilter =
true;
179 if(applicationsFilter.contains(
"default", Qt::CaseInsensitive))
181 passedApplicationFilter =
true;
185 if(!passedApplicationFilter)
189 retval << toolFilePath;
208 return internal->verify();
213 return profile()->getPath() +
"/tool";
238 for (
int i=0; i< rootPaths.size(); ++i)
240 QString configFilePath = rootPaths[i] +
"/profiles";
241 foreach(QFileInfo dir,
cx::getDirs(configFilePath))
251 QStringList root =
profile()->getAllRootConfigPaths();
252 QString suffix(
"/tool/Tools/");
254 bool includeSubDirs =
true;
255 for (
int i=0; i<root.size(); ++i)
257 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 QStringList getConfigurationsGivenApplication()
virtual QString getConfigurationApplicationsPath()
virtual QStringList getAllTools()
QString getTrackingSystemImplementation()
virtual QString getTrackingSystemImplementation()
QString getApplicationapplication()
static QStringList getSupportedTrackingSystems()
static QStringList getRootConfigPaths()
QString mFileName
absolute path and filename for the new config file
virtual QStringList getAllConfigurations()
QString mTrackingSystemImplementation
QString getAbsoluteReferenceFilePath()
static void saveConfiguration(Configuration &config)
virtual QStringList getSupportedTrackingSystems()
std::vector< ToolStructure > ToolStructureVector
virtual void setTrackingSystemImplementation(QString trackingSystemImplementation)
QFileInfoList getDirs(QString path)
QString mTrackingSystemName
virtual QStringList getToolsGivenFilter(QStringList applicationsFilter, QStringList trackingsystemsFilter)
QString mTrackingSystemImplementation
virtual QStringList getAllApplications()
std::vector< cx::ConfigurationFileParser::ToolStructure > mToolList
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
QString mTrackingSystemImplementation
QString mClinicalApplication
std::vector< QString > getAbsoluteToolFilePaths()
QString mClinical_app
the clinical application this config is made for
std::vector< ToolFileParser::TrackerInternalStructure > getTrackers()
virtual bool verifyTool(QString uid)
QString enum2string(const ENUM &val)
std::vector< ConfigurationFileParser::ToolStructure > getToolListWithMetaInformation()
virtual Configuration getConfiguration(QString uid)
virtual Tool getTool(QString uid)
Namespace for all CustusX production code.