33 QStringList selectedTools = config.
mTools;
42 foreach(QString absoluteToolPath, selectedTools)
47 tool.
mReference = (absoluteToolPath == referencePath);
49 for (
unsigned i = 0; i < config.
mToolList.size(); ++i)
58 toolStructureVector.push_back(tool);
72 retval.
mName = QFileInfo(uid).completeBaseName();
76 std::vector<ToolFileParser::TrackerInternalStructure> trackers = parser.
getTrackers();
77 for (
unsigned i = 0; i < trackers.size(); ++i)
84 for (
unsigned i = 0; i < tools.size(); ++i)
98 QStringList trackingsystemsFilter)
101 QStringList filteredTools = this->filter(allTools, applicationsFilter, trackingsystemsFilter);
102 return filteredTools;
110 QString absoluteFilePath = uid;
111 QFile file(absoluteFilePath);
112 QFileInfo info(file);
113 retval.
mName = info.dir().dirName();
131 foreach(QString path, allTools)
135 for (
unsigned i=0; i<
internal->mClinicalApplications.size(); ++i)
136 retval << internal->mClinicalApplications[i];
139 retval.removeDuplicates();
153 QStringList TrackerConfigurationImpl::filter(QStringList toolsToFilter, QStringList applicationsFilter,
154 QStringList trackingsystemsFilter)
158 foreach(QString toolFilePath, toolsToFilter)
164 QString trackerName =
enum2string(internal->mTrackerType);
165 if(!trackingsystemsFilter.contains(trackerName, Qt::CaseInsensitive))
169 bool passedApplicationFilter =
false;
170 std::vector<QString>::iterator it =
internal->mClinicalApplications.begin();
171 while(it != internal->mClinicalApplications.end() && !passedApplicationFilter)
173 QString applicationName = *it;
174 if(applicationsFilter.contains(applicationName, Qt::CaseInsensitive))
176 passedApplicationFilter =
true;
178 if(applicationsFilter.contains(
"all", Qt::CaseInsensitive))
180 passedApplicationFilter =
true;
182 if(applicationsFilter.contains(
"default", Qt::CaseInsensitive))
184 passedApplicationFilter =
true;
188 if(!passedApplicationFilter)
192 retval << toolFilePath;
211 return internal->verify();
216 return profile()->getPath() +
"/tool";
241 for (
int i=0; i< rootPaths.size(); ++i)
243 QString configFilePath = rootPaths[i] +
"/profiles";
244 foreach(QFileInfo dir,
cx::getDirs(configFilePath))
254 QStringList root =
profile()->getAllRootConfigPaths();
255 QString suffix(
"/tool/Tools/");
257 bool includeSubDirs =
true;
258 for (
int i=0; i<root.size(); ++i)
260 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
bool getApplyRefToTools()
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.