Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
d13457cc
Commit
d13457cc
authored
Dec 11, 2019
by
Anthony Lim
Browse files
refs #26904 rename BaseInstrument* for custom instrument views
parent
a5759a43
Changes
12
Hide whitespace changes
Inline
Side-by-side
qt/scientific_interfaces/Direct/ALFView_model.h
View file @
d13457cc
...
...
@@ -7,7 +7,7 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_ALFVIEWMODEL_H_
#define MANTIDQT_CUSTOMINTERFACES_ALFVIEWMODEL_H_
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentModel.h"
#include "MantidAPI/CompositeFunction.h"
#include "MantidAPI/FunctionFactory.h"
...
...
@@ -17,7 +17,7 @@
namespace
MantidQt
{
namespace
CustomInterfaces
{
class
ALFView_model
:
public
MantidWidgets
::
BaseInstrumentModel
{
class
ALFView_model
:
public
MantidWidgets
::
Base
Custom
InstrumentModel
{
public:
ALFView_model
();
...
...
qt/scientific_interfaces/Direct/ALFView_presenter.cpp
View file @
d13457cc
...
...
@@ -18,7 +18,7 @@ namespace CustomInterfaces {
ALFView_presenter
::
ALFView_presenter
(
ALFView_view
*
view
,
ALFView_model
*
model
,
MantidWidgets
::
PlotFitAnalysisPanePresenter
*
analysisPane
)
:
BaseInstrumentPresenter
(
view
,
model
,
analysisPane
->
getView
()),
:
Base
Custom
InstrumentPresenter
(
view
,
model
,
analysisPane
->
getView
()),
m_view
(
view
),
m_model
(
model
),
m_analysisPane
(
analysisPane
),
m_extractSingleTubeObserver
(
nullptr
),
m_averageTubeObserver
(
nullptr
)
{
addInstrument
();
...
...
qt/scientific_interfaces/Direct/ALFView_presenter.h
View file @
d13457cc
...
...
@@ -7,7 +7,7 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_ALFVIEWPRESENTER_H_
#define MANTIDQT_CUSTOMINTERFACES_ALFVIEWPRESENTER_H_
#include "MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentPresenter.h"
#include "MantidQtWidgets/InstrumentView/PlotFitAnalysisPanePresenter.h"
#include "ALFView_model.h"
...
...
@@ -20,7 +20,8 @@
namespace
MantidQt
{
namespace
CustomInterfaces
{
class
MANTIDQT_DIRECT_DLL
ALFView_presenter
:
public
MantidWidgets
::
BaseInstrumentPresenter
{
class
MANTIDQT_DIRECT_DLL
ALFView_presenter
:
public
MantidWidgets
::
BaseCustomInstrumentPresenter
{
Q_OBJECT
public:
...
...
qt/scientific_interfaces/Direct/ALFView_view.cpp
View file @
d13457cc
...
...
@@ -16,7 +16,7 @@ namespace MantidQt {
namespace
CustomInterfaces
{
ALFView_view
::
ALFView_view
(
const
std
::
string
&
instrument
,
QWidget
*
parent
)
:
Base
InstrumentView
(
instrument
,
parent
),
:
MantidWidgets
::
BaseCustom
InstrumentView
(
instrument
,
parent
),
m_extractSingleTubeObservable
(
nullptr
),
m_averageTubeObservable
(
nullptr
),
m_extractAction
(
nullptr
),
m_averageAction
(
nullptr
),
m_analysisPane
(
nullptr
)
{
...
...
@@ -84,7 +84,7 @@ void ALFView_view::setupAnalysisPane(MantidWidgets::PlotFitAnalysisPaneView *ana
// keep a copy here so we can use a custom class
m_analysisPane
=
analysis
;
// just adds it to the view
BaseInstrumentView
::
setupInstrumentAnalysisSplitters
(
analysis
);
Base
Custom
InstrumentView
::
setupInstrumentAnalysisSplitters
(
analysis
);
}
void
ALFView_view
::
addSpectrum
(
std
::
string
wsName
)
{
...
...
qt/scientific_interfaces/Direct/ALFView_view.h
View file @
d13457cc
...
...
@@ -7,7 +7,7 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_ALFVIEW_VIEW_H_
#define MANTIDQT_CUSTOMINTERFACES_ALFVIEW_VIEW_H_
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentView.h"
#include "DllConfig.h"
#include "MantidQtWidgets/Common/MWRunFiles.h"
#include "MantidQtWidgets/Common/ObserverPattern.h"
...
...
@@ -21,7 +21,7 @@
namespace
MantidQt
{
namespace
CustomInterfaces
{
class
ALFView_view
:
public
MantidWidgets
::
BaseInstrumentView
{
class
ALFView_view
:
public
MantidWidgets
::
Base
Custom
InstrumentView
{
Q_OBJECT
public:
...
...
qt/widgets/instrumentview/CMakeLists.txt
View file @
d13457cc
...
...
@@ -6,9 +6,9 @@ set(
SRC_FILES
src/BankRenderingHelpers.cpp
src/BankTextureBuilder.cpp
src/BaseInstrumentModel.cpp
src/BaseInstrumentView.cpp
src/BaseInstrumentPresenter.cpp
src/Base
Custom
InstrumentModel.cpp
src/Base
Custom
InstrumentView.cpp
src/Base
Custom
InstrumentPresenter.cpp
src/BinDialog.cpp
src/CollapsiblePanel.cpp
src/DetXMLFile.cpp
...
...
@@ -58,8 +58,8 @@ set(QT5_SRC_FILES src/MiniPlotMpl.cpp)
set
(
MOC_FILES
inc/MantidQtWidgets/InstrumentView/BinDialog.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentView.h
inc/MantidQtWidgets/InstrumentView/Base
Custom
InstrumentPresenter.h
inc/MantidQtWidgets/InstrumentView/Base
Custom
InstrumentView.h
inc/MantidQtWidgets/InstrumentView/CollapsiblePanel.h
inc/MantidQtWidgets/InstrumentView/InstrumentActor.h
inc/MantidQtWidgets/InstrumentView/InstrumentTreeModel.h
...
...
@@ -91,9 +91,9 @@ set(
INC_FILES
inc/MantidQtWidgets/InstrumentView/BankRenderingHelpers.h
inc/MantidQtWidgets/InstrumentView/BankTextureBuilder.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentModel.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentView.h
inc/MantidQtWidgets/InstrumentView/Base
Custom
InstrumentModel.h
inc/MantidQtWidgets/InstrumentView/Base
Custom
InstrumentPresenter.h
inc/MantidQtWidgets/InstrumentView/Base
Custom
InstrumentView.h
inc/MantidQtWidgets/InstrumentView/BinDialog.h
inc/MantidQtWidgets/InstrumentView/CollapsiblePanel.h
inc/MantidQtWidgets/InstrumentView/ColorMap.h
...
...
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/BaseInstrumentModel.h
→
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/Base
Custom
InstrumentModel.h
View file @
d13457cc
...
...
@@ -4,8 +4,8 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTMODEL_H_
#define MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTMODEL_H_
#ifndef MANTIDQT_INSTRUMENTVIEW_BASE
CUSTOM
INSTRUMENTMODEL_H_
#define MANTIDQT_INSTRUMENTVIEW_BASE
CUSTOM
INSTRUMENTMODEL_H_
#include "DllOption.h"
...
...
@@ -15,11 +15,11 @@
namespace
MantidQt
{
namespace
MantidWidgets
{
class
EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW
BaseInstrumentModel
{
class
EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW
Base
Custom
InstrumentModel
{
public:
BaseInstrumentModel
();
~
BaseInstrumentModel
(){};
Base
Custom
InstrumentModel
();
~
Base
Custom
InstrumentModel
(){};
virtual
void
loadEmptyInstrument
();
virtual
std
::
pair
<
int
,
std
::
string
>
loadData
(
const
std
::
string
&
name
);
void
setCurrentRun
(
int
&
run
)
{
m_currentRun
=
run
;
};
...
...
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h
→
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/Base
Custom
InstrumentPresenter.h
View file @
d13457cc
...
...
@@ -4,11 +4,11 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTPRESENTER_H_
#define MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTPRESENTER_H_
#ifndef MANTIDQT_INSTRUMENTVIEW_BASE
CUSTOM
INSTRUMENTPRESENTER_H_
#define MANTIDQT_INSTRUMENTVIEW_BASE
CUSTOM
INSTRUMENTPRESENTER_H_
#include "DllOption.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentView.h"
#include "MantidQtWidgets/Common/ObserverPattern.h"
#include <string>
...
...
@@ -16,14 +16,15 @@
namespace
MantidQt
{
namespace
MantidWidgets
{
class
EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW
BaseInstrumentPresenter
class
EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW
Base
Custom
InstrumentPresenter
:
public
QObject
{
Q_OBJECT
public:
BaseInstrumentPresenter
(
BaseInstrumentView
*
view
,
BaseInstrumentModel
*
model
,
BaseCustomInstrumentPresenter
(
BaseCustomInstrumentView
*
view
,
BaseCustomInstrumentModel
*
model
,
QWidget
*
analysisView
);
~
BaseInstrumentPresenter
()
{
delete
m_loadRunObserver
;
};
~
Base
Custom
InstrumentPresenter
()
{
delete
m_loadRunObserver
;
};
typedef
std
::
pair
<
std
::
string
,
...
...
@@ -49,8 +50,8 @@ private:
virtual
void
setUpInstrumentAnalysisSplitter
();
std
::
pair
<
instrumentSetUp
,
instrumentObserverOptions
>
setupInstrument
();
BaseInstrumentView
*
m_view
;
BaseInstrumentModel
*
m_model
;
Base
Custom
InstrumentView
*
m_view
;
Base
Custom
InstrumentModel
*
m_model
;
int
m_currentRun
;
std
::
string
m_currentFile
;
VoidObserver
*
m_loadRunObserver
;
...
...
@@ -59,4 +60,4 @@ private:
}
// namespace MantidWidgets
}
// namespace MantidQt
#endif
/* MANTIDQT_INSTRUMENTVIEW_B
ASEINSTRUMENTPRESENTER
_H_ */
#endif
/* MANTIDQT_INSTRUMENTVIEW_B
aseCustomInstrumentPresenter
_H_ */
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/BaseInstrumentView.h
→
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/Base
Custom
InstrumentView.h
View file @
d13457cc
...
...
@@ -4,8 +4,8 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTVIEW_H_
#define MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTVIEW_H_
#ifndef MANTIDQT_INSTRUMENTVIEW_BASE
CUSTOM
INSTRUMENTVIEW_H_
#define MANTIDQT_INSTRUMENTVIEW_BASE
CUSTOM
INSTRUMENTVIEW_H_
#include "DllOption.h"
#include "MantidQtWidgets/Common/MWRunFiles.h"
...
...
@@ -21,11 +21,11 @@
namespace
MantidQt
{
namespace
MantidWidgets
{
class
EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW
BaseInstrumentView
:
public
QSplitter
{
class
EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW
Base
Custom
InstrumentView
:
public
QSplitter
{
Q_OBJECT
public:
explicit
BaseInstrumentView
(
const
std
::
string
&
instrument
,
explicit
Base
Custom
InstrumentView
(
const
std
::
string
&
instrument
,
QWidget
*
parent
=
nullptr
);
std
::
string
getFile
();
void
setRunQuietly
(
const
std
::
string
&
runNumber
);
...
...
@@ -67,4 +67,4 @@ private:
}
// namespace MantidWidgets
}
// namespace MantidQt
#endif
/* MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTVIEW_H_ */
#endif
/* MANTIDQT_INSTRUMENTVIEW_BASE
CUSTOM
INSTRUMENTVIEW_H_ */
qt/widgets/instrumentview/src/BaseInstrumentModel.cpp
→
qt/widgets/instrumentview/src/Base
Custom
InstrumentModel.cpp
View file @
d13457cc
...
...
@@ -5,7 +5,7 @@
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentModel.h"
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/AnalysisDataService.h"
...
...
@@ -24,11 +24,11 @@ using namespace Mantid::API;
namespace
MantidQt
{
namespace
MantidWidgets
{
BaseInstrumentModel
::
BaseInstrumentModel
()
Base
Custom
InstrumentModel
::
Base
Custom
InstrumentModel
()
:
m_currentRun
(
0
),
m_tmpName
(
"tmp"
),
m_instrumentName
(
"MUSR"
),
m_wsName
(
"testData"
)
{}
void
BaseInstrumentModel
::
loadEmptyInstrument
()
{
void
Base
Custom
InstrumentModel
::
loadEmptyInstrument
()
{
auto
alg
=
Mantid
::
API
::
AlgorithmManager
::
Instance
().
create
(
"LoadEmptyInstrument"
);
alg
->
initialize
();
...
...
@@ -43,7 +43,7 @@ void BaseInstrumentModel::loadEmptyInstrument() {
* @return std::pair<int,std::string>:: the run number and status
*/
std
::
pair
<
int
,
std
::
string
>
BaseInstrumentModel
::
loadData
(
const
std
::
string
&
name
)
{
Base
Custom
InstrumentModel
::
loadData
(
const
std
::
string
&
name
)
{
auto
alg
=
AlgorithmManager
::
Instance
().
create
(
"Load"
);
alg
->
initialize
();
alg
->
setProperty
(
"Filename"
,
name
);
...
...
@@ -58,16 +58,16 @@ BaseInstrumentModel::loadData(const std::string &name) {
return
std
::
make_pair
(
runNumber
,
message
);
}
void
BaseInstrumentModel
::
rename
()
{
void
Base
Custom
InstrumentModel
::
rename
()
{
AnalysisDataService
::
Instance
().
rename
(
m_tmpName
,
m_wsName
);
}
void
BaseInstrumentModel
::
remove
()
{
void
Base
Custom
InstrumentModel
::
remove
()
{
AnalysisDataService
::
Instance
().
remove
(
m_tmpName
);
}
std
::
string
BaseInstrumentModel
::
dataFileName
()
{
return
m_wsName
;
}
std
::
string
Base
Custom
InstrumentModel
::
dataFileName
()
{
return
m_wsName
;
}
int
BaseInstrumentModel
::
currentRun
()
{
int
Base
Custom
InstrumentModel
::
currentRun
()
{
try
{
auto
ws
=
...
...
@@ -78,7 +78,7 @@ int BaseInstrumentModel::currentRun() {
}
}
bool
BaseInstrumentModel
::
isErrorCode
(
const
int
run
)
{
bool
Base
Custom
InstrumentModel
::
isErrorCode
(
const
int
run
)
{
return
(
run
==
ERRORCODE
);
}
...
...
qt/widgets/instrumentview/src/BaseInstrumentPresenter.cpp
→
qt/widgets/instrumentview/src/Base
Custom
InstrumentPresenter.cpp
View file @
d13457cc
...
...
@@ -4,9 +4,9 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentPresenter.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentView.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentModel.h"
#include "MantidAPI/FileFinder.h"
#include <functional>
...
...
@@ -15,8 +15,8 @@
namespace
MantidQt
{
namespace
MantidWidgets
{
BaseInstrumentPresenter
::
BaseInstrumentPresenter
(
BaseInstrumentView
*
view
,
MantidWidgets
::
Base
InstrumentModel
*
model
,
Base
Custom
InstrumentPresenter
::
Base
Custom
InstrumentPresenter
(
BaseCustomInstrumentView
*
view
,
BaseCustom
InstrumentModel
*
model
,
QWidget
*
analysisPaneView
)
:
m_view
(
view
),
m_model
(
model
),
m_currentRun
(
0
),
m_currentFile
(
""
),
m_loadRunObserver
(
nullptr
),
m_analysisPaneView
(
analysisPaneView
)
{
...
...
@@ -24,28 +24,29 @@ BaseInstrumentPresenter::BaseInstrumentPresenter(BaseInstrumentView *view,
m_model
->
loadEmptyInstrument
();
}
void
BaseInstrumentPresenter
::
addInstrument
()
{
void
Base
Custom
InstrumentPresenter
::
addInstrument
()
{
auto
setUp
=
setupInstrument
();
initLayout
(
&
setUp
);
}
void
BaseInstrumentPresenter
::
initLayout
(
void
Base
Custom
InstrumentPresenter
::
initLayout
(
std
::
pair
<
instrumentSetUp
,
instrumentObserverOptions
>
*
setUp
)
{
// connect to new run
m_view
->
observeLoadRun
(
m_loadRunObserver
);
std
::
function
<
void
()
>
loadBinder
=
std
::
bind
(
&
BaseInstrumentPresenter
::
loadRunNumber
,
this
);
std
::
bind
(
&
Base
Custom
InstrumentPresenter
::
loadRunNumber
,
this
);
m_loadRunObserver
->
setSlot
(
loadBinder
);
initInstrument
(
setUp
);
setUpInstrumentAnalysisSplitter
();
m_view
->
setupHelp
();
}
void
BaseInstrumentPresenter
::
setUpInstrumentAnalysisSplitter
()
{
void
Base
Custom
InstrumentPresenter
::
setUpInstrumentAnalysisSplitter
()
{
m_view
->
setupInstrumentAnalysisSplitters
(
m_analysisPaneView
);
}
void
BaseInstrumentPresenter
::
loadAndAnalysis
(
const
std
::
string
&
pathToRun
)
{
void
BaseCustomInstrumentPresenter
::
loadAndAnalysis
(
const
std
::
string
&
pathToRun
)
{
try
{
auto
loadedResult
=
m_model
->
loadData
(
pathToRun
);
...
...
@@ -66,7 +67,7 @@ void BaseInstrumentPresenter::loadAndAnalysis(const std::string &pathToRun) {
}
}
void
BaseInstrumentPresenter
::
loadRunNumber
()
{
void
Base
Custom
InstrumentPresenter
::
loadRunNumber
()
{
auto
pathToRun
=
m_view
->
getFile
();
if
(
pathToRun
==
""
||
m_currentFile
==
pathToRun
)
{
return
;
...
...
@@ -74,7 +75,7 @@ void BaseInstrumentPresenter::loadRunNumber() {
loadAndAnalysis
(
pathToRun
);
}
void
BaseInstrumentPresenter
::
initInstrument
(
void
Base
Custom
InstrumentPresenter
::
initInstrument
(
std
::
pair
<
instrumentSetUp
,
instrumentObserverOptions
>
*
setUp
)
{
if
(
!
setUp
)
{
return
;
...
...
@@ -97,7 +98,7 @@ typedef std::vector<std::tuple<std::string, Observer *>>
instrumentObserverOptions
;
std
::
pair
<
instrumentSetUp
,
instrumentObserverOptions
>
BaseInstrumentPresenter
::
setupInstrument
()
{
Base
Custom
InstrumentPresenter
::
setupInstrument
()
{
instrumentSetUp
setUpContextConditions
;
// set up the slots for the custom context menu
...
...
qt/widgets/instrumentview/src/BaseInstrumentView.cpp
→
qt/widgets/instrumentview/src/Base
Custom
InstrumentView.cpp
View file @
d13457cc
...
...
@@ -4,10 +4,10 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/Base
Custom
InstrumentView.h"
#include "MantidQtWidgets/Common/HelpWindow.h"
#include "MantidQtWidgets/InstrumentView/InstrumentWidgetPickTab.h"
// change to BaseCustomInstrumentView etc.
#include <QMessageBox>
#include <QSizePolicy>
#include <QSpacerItem>
...
...
@@ -17,7 +17,7 @@
namespace
MantidQt
{
namespace
MantidWidgets
{
BaseInstrumentView
::
BaseInstrumentView
(
const
std
::
string
&
instrument
,
Base
Custom
InstrumentView
::
Base
Custom
InstrumentView
(
const
std
::
string
&
instrument
,
QWidget
*
parent
)
:
QSplitter
(
Qt
::
Vertical
,
parent
),
m_helpPage
(
""
),
m_loadRunObservable
(
nullptr
),
m_files
(
nullptr
),
...
...
@@ -27,7 +27,7 @@ BaseInstrumentView::BaseInstrumentView(const std::string &instrument,
this
->
addWidget
(
loadWidget
);
}
void
BaseInstrumentView
::
setUpInstrument
(
void
Base
Custom
InstrumentView
::
setUpInstrument
(
const
std
::
string
&
fileName
,
std
::
vector
<
std
::
function
<
bool
(
std
::
map
<
std
::
string
,
bool
>
)
>>
&
instrument
)
{
...
...
@@ -38,7 +38,7 @@ void BaseInstrumentView::setUpInstrument(
setInstrumentWidget
(
instrumentWidget
);
}
QWidget
*
BaseInstrumentView
::
generateLoadWidget
()
{
QWidget
*
Base
Custom
InstrumentView
::
generateLoadWidget
()
{
m_loadRunObservable
=
new
Observable
();
m_files
=
new
API
::
MWRunFiles
(
this
);
...
...
@@ -60,7 +60,7 @@ QWidget *BaseInstrumentView::generateLoadWidget() {
return
loadWidget
;
}
void
BaseInstrumentView
::
setupInstrumentAnalysisSplitters
(
void
Base
Custom
InstrumentView
::
setupInstrumentAnalysisSplitters
(
QWidget
*
analysisPane
)
{
QSplitter
*
split
=
new
QSplitter
(
Qt
::
Horizontal
);
split
->
addWidget
(
m_instrumentWidget
);
...
...
@@ -68,7 +68,7 @@ void BaseInstrumentView::setupInstrumentAnalysisSplitters(
this
->
addWidget
(
split
);
}
void
BaseInstrumentView
::
setupHelp
()
{
void
Base
Custom
InstrumentView
::
setupHelp
()
{
QWidget
*
helpWidget
=
new
QWidget
();
m_help
=
new
QPushButton
(
"?"
);
m_help
->
setMaximumWidth
(
25
);
...
...
@@ -81,7 +81,7 @@ void BaseInstrumentView::setupHelp() {
connect
(
m_help
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
openHelp
()));
}
void
BaseInstrumentView
::
openHelp
()
{
void
Base
Custom
InstrumentView
::
openHelp
()
{
if
(
m_helpPage
==
""
)
{
return
;
}
...
...
@@ -89,18 +89,18 @@ void BaseInstrumentView::openHelp() {
nullptr
,
QString
::
fromStdString
(
m_helpPage
));
}
std
::
string
BaseInstrumentView
::
getFile
()
{
std
::
string
Base
Custom
InstrumentView
::
getFile
()
{
auto
name
=
m_files
->
getFilenames
();
if
(
name
.
size
()
>
0
)
return
name
[
0
].
toStdString
();
return
""
;
}
void
BaseInstrumentView
::
setRunQuietly
(
const
std
::
string
&
runNumber
)
{
void
Base
Custom
InstrumentView
::
setRunQuietly
(
const
std
::
string
&
runNumber
)
{
m_files
->
setText
(
QString
::
fromStdString
(
runNumber
));
}
void
BaseInstrumentView
::
fileLoaded
()
{
void
Base
Custom
InstrumentView
::
fileLoaded
()
{
if
(
m_files
->
getText
().
isEmpty
())
return
;
...
...
@@ -111,11 +111,11 @@ void BaseInstrumentView::fileLoaded() {
m_loadRunObservable
->
notify
();
}
void
BaseInstrumentView
::
warningBox
(
const
std
::
string
&
message
)
{
void
Base
Custom
InstrumentView
::
warningBox
(
const
std
::
string
&
message
)
{
warningBox
(
QString
::
fromStdString
(
message
));
}
void
BaseInstrumentView
::
warningBox
(
const
QString
&
message
)
{
void
Base
Custom
InstrumentView
::
warningBox
(
const
QString
&
message
)
{
QMessageBox
::
warning
(
this
,
m_instrument
+
" view"
,
message
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment