Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
d1cffd73
Commit
d1cffd73
authored
11 years ago
by
Arturs Bekasovs
Browse files
Options
Downloads
Patches
Plain Diff
Refs #8700. Namespace clean-up.
parent
11d6558e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp
+16
-14
16 additions, 14 deletions
...tid/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp
with
16 additions
and
14 deletions
Code/Mantid/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp
+
16
−
14
View file @
d1cffd73
...
@@ -42,6 +42,8 @@ namespace MantidQt
...
@@ -42,6 +42,8 @@ namespace MantidQt
namespace
MantidWidgets
namespace
MantidWidgets
{
{
using
namespace
Mantid
::
API
;
/**
/**
* Constructor
* Constructor
* @param parent :: The parent widget - must be an ApplicationWindow
* @param parent :: The parent widget - must be an ApplicationWindow
...
@@ -199,7 +201,7 @@ void MuonFitPropertyBrowser::doubleChanged(QtProperty* prop)
...
@@ -199,7 +201,7 @@ void MuonFitPropertyBrowser::doubleChanged(QtProperty* prop)
*/
*/
void
MuonFitPropertyBrowser
::
populateFunctionNames
()
void
MuonFitPropertyBrowser
::
populateFunctionNames
()
{
{
const
std
::
vector
<
std
::
string
>
names
=
Mantid
::
API
::
FunctionFactory
::
Instance
().
getKeys
();
const
std
::
vector
<
std
::
string
>
names
=
FunctionFactory
::
Instance
().
getKeys
();
m_registeredFunctions
.
clear
();
m_registeredFunctions
.
clear
();
m_registeredPeaks
.
clear
();
m_registeredPeaks
.
clear
();
m_registeredBackgrounds
.
clear
();
m_registeredBackgrounds
.
clear
();
...
@@ -209,7 +211,7 @@ void MuonFitPropertyBrowser::populateFunctionNames()
...
@@ -209,7 +211,7 @@ void MuonFitPropertyBrowser::populateFunctionNames()
QString
qfnName
=
QString
::
fromStdString
(
fnName
);
QString
qfnName
=
QString
::
fromStdString
(
fnName
);
if
(
qfnName
==
"MultiBG"
)
continue
;
if
(
qfnName
==
"MultiBG"
)
continue
;
auto
f
=
Mantid
::
API
::
FunctionFactory
::
Instance
().
createFunction
(
fnName
);
auto
f
=
FunctionFactory
::
Instance
().
createFunction
(
fnName
);
const
std
::
vector
<
std
::
string
>
categories
=
f
->
categories
();
const
std
::
vector
<
std
::
string
>
categories
=
f
->
categories
();
bool
muon
=
false
;
bool
muon
=
false
;
for
(
size_t
j
=
0
;
j
<
categories
.
size
();
++
j
)
for
(
size_t
j
=
0
;
j
<
categories
.
size
();
++
j
)
...
@@ -221,13 +223,13 @@ void MuonFitPropertyBrowser::populateFunctionNames()
...
@@ -221,13 +223,13 @@ void MuonFitPropertyBrowser::populateFunctionNames()
{
{
m_registeredFunctions
<<
qfnName
;
m_registeredFunctions
<<
qfnName
;
}
}
Mantid
::
API
::
IPeakFunction
*
pf
=
dynamic_cast
<
Mantid
::
API
::
IPeakFunction
*>
(
f
.
get
());
IPeakFunction
*
pf
=
dynamic_cast
<
IPeakFunction
*>
(
f
.
get
());
//
Mantid::API::
CompositeFunction* cf = dynamic_cast<
Mantid::API::
CompositeFunction*>(f.get());
//CompositeFunction* cf = dynamic_cast<CompositeFunction*>(f.get());
if
(
pf
)
if
(
pf
)
{
{
m_registeredPeaks
<<
qfnName
;
m_registeredPeaks
<<
qfnName
;
}
}
else
if
(
dynamic_cast
<
Mantid
::
API
::
IBackgroundFunction
*>
(
f
.
get
()))
else
if
(
dynamic_cast
<
IBackgroundFunction
*>
(
f
.
get
()))
{
{
m_registeredBackgrounds
<<
qfnName
;
m_registeredBackgrounds
<<
qfnName
;
}
}
...
@@ -274,20 +276,20 @@ void MuonFitPropertyBrowser::fit()
...
@@ -274,20 +276,20 @@ void MuonFitPropertyBrowser::fit()
funStr
=
(
m_compositeFunction
->
getFunction
(
0
))
->
asString
();
funStr
=
(
m_compositeFunction
->
getFunction
(
0
))
->
asString
();
}
}
if
(
Mantid
::
API
::
AnalysisDataService
::
Instance
().
doesExist
(
wsName
+
"_NormalisedCovarianceMatrix"
))
if
(
AnalysisDataService
::
Instance
().
doesExist
(
wsName
+
"_NormalisedCovarianceMatrix"
))
{
{
Mantid
::
API
::
FrameworkManager
::
Instance
().
deleteWorkspace
(
wsName
+
"_NormalisedCovarianceMatrix"
);
FrameworkManager
::
Instance
().
deleteWorkspace
(
wsName
+
"_NormalisedCovarianceMatrix"
);
}
}
if
(
Mantid
::
API
::
AnalysisDataService
::
Instance
().
doesExist
(
wsName
+
"_Parameters"
))
if
(
AnalysisDataService
::
Instance
().
doesExist
(
wsName
+
"_Parameters"
))
{
{
Mantid
::
API
::
FrameworkManager
::
Instance
().
deleteWorkspace
(
wsName
+
"_Parameters"
);
FrameworkManager
::
Instance
().
deleteWorkspace
(
wsName
+
"_Parameters"
);
}
}
if
(
Mantid
::
API
::
AnalysisDataService
::
Instance
().
doesExist
(
wsName
+
"_Workspace"
))
if
(
AnalysisDataService
::
Instance
().
doesExist
(
wsName
+
"_Workspace"
))
{
{
Mantid
::
API
::
FrameworkManager
::
Instance
().
deleteWorkspace
(
wsName
+
"_Workspace"
);
FrameworkManager
::
Instance
().
deleteWorkspace
(
wsName
+
"_Workspace"
);
}
}
Mantid
::
API
::
IAlgorithm_sptr
alg
=
Mantid
::
API
::
AlgorithmManager
::
Instance
().
create
(
"Fit"
);
IAlgorithm_sptr
alg
=
AlgorithmManager
::
Instance
().
create
(
"Fit"
);
alg
->
initialize
();
alg
->
initialize
();
alg
->
setPropertyValue
(
"Function"
,
funStr
);
alg
->
setPropertyValue
(
"Function"
,
funStr
);
if
(
rawData
())
if
(
rawData
())
...
@@ -332,13 +334,13 @@ void MuonFitPropertyBrowser::showEvent(QShowEvent* e)
...
@@ -332,13 +334,13 @@ void MuonFitPropertyBrowser::showEvent(QShowEvent* e)
* MatrixWorkspaces same size and that it isn't the generated raw file.
* MatrixWorkspaces same size and that it isn't the generated raw file.
* @param ws :: The workspace
* @param ws :: The workspace
*/
*/
bool
MuonFitPropertyBrowser
::
isWorkspaceValid
(
Mantid
::
API
::
Workspace_sptr
ws
)
const
bool
MuonFitPropertyBrowser
::
isWorkspaceValid
(
Workspace_sptr
ws
)
const
{
{
QString
workspaceName
(
QString
::
fromStdString
(
ws
->
name
()
)
);
QString
workspaceName
(
QString
::
fromStdString
(
ws
->
name
()
)
);
if
(
(
workspaceName
.
contains
(
"_Raw"
)
)
||
(
workspaceName
.
contains
(
"MuonAnalysis"
)
)
)
if
(
(
workspaceName
.
contains
(
"_Raw"
)
)
||
(
workspaceName
.
contains
(
"MuonAnalysis"
)
)
)
return
false
;
return
false
;
if
(
dynamic_cast
<
Mantid
::
API
::
MatrixWorkspace
*>
(
ws
.
get
())
!=
0
)
if
(
dynamic_cast
<
MatrixWorkspace
*>
(
ws
.
get
())
!=
0
)
return
true
;
return
true
;
else
else
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment