Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
bf46b5de
Commit
bf46b5de
authored
Dec 11, 2019
by
Anthony Lim
Browse files
refs #26904 clang for rename/restructure of ALF view
parent
c0d047d4
Changes
13
Hide whitespace changes
Inline
Side-by-side
qt/scientific_interfaces/Direct/ALFCustomInstrumentModel.cpp
View file @
bf46b5de
...
...
@@ -25,7 +25,8 @@ using namespace Mantid::API;
namespace
MantidQt
{
namespace
CustomInterfaces
{
ALFCustomInstrumentModel
::
ALFCustomInstrumentModel
()
:
m_numberOfTubesInAverage
(
0
)
{
ALFCustomInstrumentModel
::
ALFCustomInstrumentModel
()
:
m_numberOfTubesInAverage
(
0
)
{
m_tmpName
=
"ALF_tmp"
;
m_instrumentName
=
"ALF"
;
m_wsName
=
"ALFData"
;
...
...
@@ -38,7 +39,8 @@ ALFCustomInstrumentModel::ALFCustomInstrumentModel() : m_numberOfTubesInAverage(
* @param name:: string name for ALF data
* @return std::pair<int,std::string>:: the run number and status
*/
std
::
pair
<
int
,
std
::
string
>
ALFCustomInstrumentModel
::
loadData
(
const
std
::
string
&
name
)
{
std
::
pair
<
int
,
std
::
string
>
ALFCustomInstrumentModel
::
loadData
(
const
std
::
string
&
name
)
{
auto
alg
=
AlgorithmManager
::
Instance
().
create
(
"Load"
);
alg
->
initialize
();
alg
->
setProperty
(
"Filename"
,
name
);
...
...
@@ -162,7 +164,8 @@ bool ALFCustomInstrumentModel::hasTubeBeenExtracted(const std::string &name) {
return
AnalysisDataService
::
Instance
().
doesExist
(
EXTRACTEDWS
+
name
);
}
bool
ALFCustomInstrumentModel
::
extractTubeConditon
(
std
::
map
<
std
::
string
,
bool
>
tabBools
)
{
bool
ALFCustomInstrumentModel
::
extractTubeConditon
(
std
::
map
<
std
::
string
,
bool
>
tabBools
)
{
try
{
bool
ifCurve
=
(
tabBools
.
find
(
"plotStored"
)
->
second
||
...
...
@@ -173,7 +176,8 @@ bool ALFCustomInstrumentModel::extractTubeConditon(std::map<std::string, bool> t
}
}
bool
ALFCustomInstrumentModel
::
averageTubeConditon
(
std
::
map
<
std
::
string
,
bool
>
tabBools
)
{
bool
ALFCustomInstrumentModel
::
averageTubeConditon
(
std
::
map
<
std
::
string
,
bool
>
tabBools
)
{
try
{
bool
ifCurve
=
(
tabBools
.
find
(
"plotStored"
)
->
second
||
...
...
qt/scientific_interfaces/Direct/ALFCustomInstrumentModel.h
View file @
bf46b5de
...
...
@@ -7,9 +7,9 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_ALFVIEWMODEL_H_
#define MANTIDQT_CUSTOMINTERFACES_ALFVIEWMODEL_H_
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentModel.h"
#include
"MantidAPI/CompositeFunction.h"
#include
"MantidAPI/FunctionFactory.h"
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentModel.h"
#include
<map>
#include
<string>
...
...
@@ -17,7 +17,8 @@
namespace
MantidQt
{
namespace
CustomInterfaces
{
class
ALFCustomInstrumentModel
:
public
MantidWidgets
::
BaseCustomInstrumentModel
{
class
ALFCustomInstrumentModel
:
public
MantidWidgets
::
BaseCustomInstrumentModel
{
public:
ALFCustomInstrumentModel
();
...
...
qt/scientific_interfaces/Direct/ALFCustomInstrumentPresenter.cpp
View file @
bf46b5de
...
...
@@ -7,8 +7,8 @@
#include
"ALFCustomInstrumentPresenter.h"
#include
"ALFCustomInstrumentModel.h"
#include
"ALFCustomInstrumentView.h"
#include
"MantidQtWidgets/InstrumentView/PlotFitAnalysisPanePresenter.h"
#include
"MantidAPI/FileFinder.h"
#include
"MantidQtWidgets/InstrumentView/PlotFitAnalysisPanePresenter.h"
#include
<functional>
#include
<tuple>
...
...
@@ -16,8 +16,9 @@
namespace
MantidQt
{
namespace
CustomInterfaces
{
ALFCustomInstrumentPresenter
::
ALFCustomInstrumentPresenter
(
ALFCustomInstrumentView
*
view
,
ALFCustomInstrumentModel
*
model
,
MantidWidgets
::
PlotFitAnalysisPanePresenter
*
analysisPane
)
ALFCustomInstrumentPresenter
::
ALFCustomInstrumentPresenter
(
ALFCustomInstrumentView
*
view
,
ALFCustomInstrumentModel
*
model
,
MantidWidgets
::
PlotFitAnalysisPanePresenter
*
analysisPane
)
:
BaseCustomInstrumentPresenter
(
view
,
model
,
analysisPane
->
getView
()),
m_view
(
view
),
m_model
(
model
),
m_analysisPane
(
analysisPane
),
m_extractSingleTubeObserver
(
nullptr
),
m_averageTubeObserver
(
nullptr
)
{
...
...
@@ -35,7 +36,9 @@ void ALFCustomInstrumentPresenter::setUpInstrumentAnalysisSplitter() {
m_view
->
setupAnalysisPane
(
m_analysisPane
->
getView
());
}
void
ALFCustomInstrumentPresenter
::
loadSideEffects
()
{
m_analysisPane
->
clearCurrentWS
();
}
void
ALFCustomInstrumentPresenter
::
loadSideEffects
()
{
m_analysisPane
->
clearCurrentWS
();
}
typedef
std
::
pair
<
std
::
string
,
std
::
vector
<
std
::
function
<
bool
(
std
::
map
<
std
::
string
,
bool
>
)
>>>
...
...
@@ -75,7 +78,8 @@ ALFCustomInstrumentPresenter::setupALFInstrument() {
// set up single tube extract
std
::
function
<
void
()
>
extractSingleTubeBinder
=
std
::
bind
(
&
ALFCustomInstrumentPresenter
::
extractSingleTube
,
this
);
// binder for slot
std
::
bind
(
&
ALFCustomInstrumentPresenter
::
extractSingleTube
,
this
);
// binder for slot
m_extractSingleTubeObserver
->
setSlot
(
extractSingleTubeBinder
);
// add slot to observer
std
::
tuple
<
std
::
string
,
Observer
*>
tmp
=
std
::
make_tuple
(
...
...
qt/scientific_interfaces/Direct/ALFCustomInstrumentPresenter.h
View file @
bf46b5de
...
...
@@ -25,8 +25,9 @@ class MANTIDQT_DIRECT_DLL ALFCustomInstrumentPresenter
Q_OBJECT
public:
ALFCustomInstrumentPresenter
(
ALFCustomInstrumentView
*
view
,
ALFCustomInstrumentModel
*
model
,
MantidWidgets
::
PlotFitAnalysisPanePresenter
*
analysisPane
);
ALFCustomInstrumentPresenter
(
ALFCustomInstrumentView
*
view
,
ALFCustomInstrumentModel
*
model
,
MantidWidgets
::
PlotFitAnalysisPanePresenter
*
analysisPane
);
~
ALFCustomInstrumentPresenter
()
{
delete
m_extractSingleTubeObserver
;
delete
m_averageTubeObserver
;
...
...
qt/scientific_interfaces/Direct/ALFCustomInstrumentView.cpp
View file @
bf46b5de
...
...
@@ -15,7 +15,8 @@
namespace
MantidQt
{
namespace
CustomInterfaces
{
ALFCustomInstrumentView
::
ALFCustomInstrumentView
(
const
std
::
string
&
instrument
,
QWidget
*
parent
)
ALFCustomInstrumentView
::
ALFCustomInstrumentView
(
const
std
::
string
&
instrument
,
QWidget
*
parent
)
:
MantidWidgets
::
BaseCustomInstrumentView
(
instrument
,
parent
),
m_extractSingleTubeObservable
(
nullptr
),
m_averageTubeObservable
(
nullptr
),
m_extractAction
(
nullptr
),
m_averageAction
(
nullptr
),
...
...
@@ -72,7 +73,8 @@ void ALFCustomInstrumentView::observeAverageTube(Observer *listner) {
m_averageTubeObservable
->
attach
(
listner
);
}
void
ALFCustomInstrumentView
::
addObserver
(
std
::
tuple
<
std
::
string
,
Observer
*>
&
listener
)
{
void
ALFCustomInstrumentView
::
addObserver
(
std
::
tuple
<
std
::
string
,
Observer
*>
&
listener
)
{
if
(
std
::
get
<
0
>
(
listener
)
==
"singleTube"
)
{
observeExtractSingleTube
(
std
::
get
<
1
>
(
listener
));
}
else
if
(
std
::
get
<
0
>
(
listener
)
==
"averageTube"
)
{
...
...
@@ -80,7 +82,8 @@ void ALFCustomInstrumentView::addObserver(std::tuple<std::string, Observer *> &l
}
}
void
ALFCustomInstrumentView
::
setupAnalysisPane
(
MantidWidgets
::
PlotFitAnalysisPaneView
*
analysis
)
{
void
ALFCustomInstrumentView
::
setupAnalysisPane
(
MantidWidgets
::
PlotFitAnalysisPaneView
*
analysis
)
{
// keep a copy here so we can use a custom class
m_analysisPane
=
analysis
;
// just adds it to the view
...
...
qt/scientific_interfaces/Direct/ALFCustomInstrumentView.h
View file @
bf46b5de
...
...
@@ -7,10 +7,10 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_ALFCustomInstrumentView_H_
#define MANTIDQT_CUSTOMINTERFACES_ALFCustomInstrumentView_H_
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentView.h"
#include
"DllConfig.h"
#include
"MantidQtWidgets/Common/MWRunFiles.h"
#include
"MantidQtWidgets/Common/ObserverPattern.h"
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentView.h"
#include
"MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneView.h"
#include
<QObject>
...
...
@@ -26,7 +26,7 @@ class ALFCustomInstrumentView : public MantidWidgets::BaseCustomInstrumentView {
public:
explicit
ALFCustomInstrumentView
(
const
std
::
string
&
instrument
,
QWidget
*
parent
=
nullptr
);
QWidget
*
parent
=
nullptr
);
void
observeExtractSingleTube
(
Observer
*
listner
);
void
observeAverageTube
(
Observer
*
listner
);
...
...
qt/scientific_interfaces/Direct/ALFView.cpp
View file @
bf46b5de
...
...
@@ -26,12 +26,14 @@ ALFView::ALFView(QWidget *parent)
m_analysisPane
(
nullptr
)
{
m_model
=
new
ALFCustomInstrumentModel
();
m_view
=
new
ALFCustomInstrumentView
(
m_model
->
getInstrument
(),
this
);
auto
analysisView
=
new
MantidWidgets
::
PlotFitAnalysisPaneView
(
-
15.0
,
15.0
,
m_view
);
auto
analysisView
=
new
MantidWidgets
::
PlotFitAnalysisPaneView
(
-
15.0
,
15.0
,
m_view
);
auto
analysisModel
=
new
MantidWidgets
::
PlotFitAnalysisPaneModel
();
m_analysisPane
=
new
MantidWidgets
::
PlotFitAnalysisPanePresenter
(
analysisView
,
analysisModel
);
m_analysisPane
=
new
MantidWidgets
::
PlotFitAnalysisPanePresenter
(
analysisView
,
analysisModel
);
m_presenter
=
new
ALFCustomInstrumentPresenter
(
m_view
,
m_model
,
m_analysisPane
);
m_presenter
=
new
ALFCustomInstrumentPresenter
(
m_view
,
m_model
,
m_analysisPane
);
}
void
ALFView
::
initLayout
()
{
this
->
setCentralWidget
(
m_view
);
}
...
...
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/BaseCustomInstrumentPresenter.h
View file @
bf46b5de
...
...
@@ -7,9 +7,9 @@
#ifndef MANTIDQT_INSTRUMENTVIEW_BASECUSTOMINSTRUMENTPRESENTER_H_
#define MANTIDQT_INSTRUMENTVIEW_BASECUSTOMINSTRUMENTPRESENTER_H_
#include
"DllOption.h"
#include
"MantidQtWidgets/Common/ObserverPattern.h"
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentModel.h"
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentView.h"
#include
"MantidQtWidgets/Common/ObserverPattern.h"
#include
<string>
...
...
@@ -23,7 +23,7 @@ class EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW BaseCustomInstrumentPresenter
public:
BaseCustomInstrumentPresenter
(
BaseCustomInstrumentView
*
view
,
BaseCustomInstrumentModel
*
model
,
QWidget
*
analysisView
);
QWidget
*
analysisView
);
~
BaseCustomInstrumentPresenter
()
{
delete
m_loadRunObserver
;
};
typedef
std
::
pair
<
...
...
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/BaseCustomInstrumentView.h
View file @
bf46b5de
...
...
@@ -21,12 +21,13 @@
namespace
MantidQt
{
namespace
MantidWidgets
{
class
EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW
BaseCustomInstrumentView
:
public
QSplitter
{
class
EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW
BaseCustomInstrumentView
:
public
QSplitter
{
Q_OBJECT
public:
explicit
BaseCustomInstrumentView
(
const
std
::
string
&
instrument
,
QWidget
*
parent
=
nullptr
);
QWidget
*
parent
=
nullptr
);
std
::
string
getFile
();
void
setRunQuietly
(
const
std
::
string
&
runNumber
);
void
observeLoadRun
(
Observer
*
listener
)
{
...
...
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPanePresenter.h
View file @
bf46b5de
...
...
@@ -7,10 +7,10 @@
#ifndef MANTIDQT_INSTRUMENTVIEW_PLOTFITANALYSISPANEPRESENTER_H_
#define MANTIDQT_INSTRUMENTVIEW_PLOTFITANALYSISPANEPRESENTER_H_
#include
"MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneModel.h"
#include
"MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneView.h"
#include
"DllOption.h"
#include
"MantidQtWidgets/Common/ObserverPattern.h"
#include
"MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneModel.h"
#include
"MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneView.h"
#include
<string>
namespace
MantidQt
{
...
...
qt/widgets/instrumentview/src/BaseCustomInstrumentPresenter.cpp
View file @
bf46b5de
...
...
@@ -5,9 +5,9 @@
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentPresenter.h"
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentView.h"
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentModel.h"
#include
"MantidAPI/FileFinder.h"
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentModel.h"
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentView.h"
#include
<functional>
#include
<tuple>
...
...
@@ -17,7 +17,7 @@ namespace MantidWidgets {
BaseCustomInstrumentPresenter
::
BaseCustomInstrumentPresenter
(
BaseCustomInstrumentView
*
view
,
BaseCustomInstrumentModel
*
model
,
QWidget
*
analysisPaneView
)
QWidget
*
analysisPaneView
)
:
m_view
(
view
),
m_model
(
model
),
m_currentRun
(
0
),
m_currentFile
(
""
),
m_loadRunObserver
(
nullptr
),
m_analysisPaneView
(
analysisPaneView
)
{
m_loadRunObserver
=
new
VoidObserver
();
...
...
@@ -110,5 +110,5 @@ BaseCustomInstrumentPresenter::setupInstrument() {
return
std
::
make_pair
(
setUpContextConditions
,
customInstrumentOptions
);
}
}
// namespace MantdWidgets
}
// namespace Mant
i
dWidgets
}
// namespace MantidQt
qt/widgets/instrumentview/src/BaseCustomInstrumentView.cpp
View file @
bf46b5de
...
...
@@ -7,7 +7,7 @@
#include
"MantidQtWidgets/InstrumentView/BaseCustomInstrumentView.h"
#include
"MantidQtWidgets/Common/HelpWindow.h"
#include
"MantidQtWidgets/InstrumentView/InstrumentWidgetPickTab.h"
// change to BaseCustomInstrumentView etc.
// change to BaseCustomInstrumentView etc.
#include
<QMessageBox>
#include
<QSizePolicy>
#include
<QSpacerItem>
...
...
@@ -17,8 +17,8 @@
namespace
MantidQt
{
namespace
MantidWidgets
{
BaseCustomInstrumentView
::
BaseCustomInstrumentView
(
const
std
::
string
&
instrument
,
QWidget
*
parent
)
BaseCustomInstrumentView
::
BaseCustomInstrumentView
(
const
std
::
string
&
instrument
,
QWidget
*
parent
)
:
QSplitter
(
Qt
::
Vertical
,
parent
),
m_helpPage
(
""
),
m_loadRunObservable
(
nullptr
),
m_files
(
nullptr
),
m_instrument
(
QString
::
fromStdString
(
instrument
)),
...
...
qt/widgets/instrumentview/src/PlotFitAnalysisPanePresenter.cpp
View file @
bf46b5de
...
...
@@ -15,7 +15,7 @@ namespace MantidWidgets {
PlotFitAnalysisPanePresenter
::
PlotFitAnalysisPanePresenter
(
PlotFitAnalysisPaneView
*
view
,
PlotFitAnalysisPaneModel
*
model
)
:
m_fitObserver
(
nullptr
),
m_view
(
view
),
m_model
(
model
),
m_currentName
(
""
){
:
m_fitObserver
(
nullptr
),
m_view
(
view
),
m_model
(
model
),
m_currentName
(
""
)
{
m_fitObserver
=
new
VoidObserver
();
m_view
->
observeFitButton
(
m_fitObserver
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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