CustusX  2023.01.05-dev+develop.0da12
An IGT application
ProbeXmlConfigParserMock.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
13 
14 #include <QStringList>
15 #include <iostream>
16 
17 ProbeXmlConfigParserMock::ProbeXmlConfigParserMock(QString& pathToXml, bool provideRTSource) :
18  mFileName(pathToXml),
19  mProvideRTSource(provideRTSource)
20 {}
21 
23 {
24 }
25 
27 {
28  return mFileName;
29 }
30 
31 void ProbeXmlConfigParserMock::removeConfig(QString scanner, QString probe, QString rtsource, QString configId)
32 {}
33 
35 {}
36 
38 {
39  QStringList retval;
40  retval << "DummyScanner";
41  return retval;
42 }
43 
44 QStringList ProbeXmlConfigParserMock::getProbeList(QString scanner)
45 {
46  QStringList retval;
47  retval << "DummyProbe";
48  return retval;
49 }
50 
51 
52 QStringList ProbeXmlConfigParserMock::getRtSourceList(QString scanner, QString probe)
53 {
54  QStringList retval;
55  if (mProvideRTSource)
56  retval << "DummySource";
57  return retval;
58 }
59 
60 QStringList ProbeXmlConfigParserMock::getConfigIdList(QString scanner, QString probe, QString rtsource)
61 {
62  QStringList retval;
63  QString retString = scanner + " " + probe + " " + rtsource;
64  retval << retString;
65  return retval;
66 }
67 
68 ProbeXmlConfigParser::Configuration ProbeXmlConfigParserMock::getConfiguration(QString scanner, QString probe, QString rtsource, QString configId)
69 {
70  Configuration retval;
71  retval.mName = "Dummy config";
72  retval.mUsScanner = scanner;
73  retval.mUsProbe = probe;
74  retval.mRtSource = rtsource;
75  retval.mConfigId = configId;
76  retval.mNotes = "Found no notes.";
77  retval.mTemporalCalibration = 0;
78  retval.mEmpty = false;
79  return retval;
80 }
81 
82 
< a easy-to-work-with struct for a specific xml configuration
ProbeXmlConfigParserMock(QString &pathToXml, bool provideRTSource=true)
virtual QStringList getRtSourceList(QString scanner, QString probe)
get a list of rt sources for that scanner/probe combo
virtual void saveCurrentConfig(ProbeXmlConfigParser::Configuration config)
virtual ProbeXmlConfigParser::Configuration getConfiguration(QString scanner, QString probe, QString rtsource, QString configId)
get a easy-to-work-with struct of a specific config
virtual QStringList getProbeList(QString scanner)
get a list of all probes for that scanner
virtual QStringList getScannerList()
get a list of all scanner in the xml
virtual QStringList getConfigIdList(QString scanner, QString probe, QString rtSource)
get a list of config ids for that scanner/probe/rsource combo
double mTemporalCalibration
delay in timestamping in grabber source relative to master clock.
QString mName
Name of config set.
virtual void removeConfig(QString scanner, QString probe, QString rtsource, QString configId)