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
09d70590
Commit
09d70590
authored
9 years ago
by
Elliot Oram
Browse files
Options
Downloads
Patches
Plain Diff
Set initial values for FWHM in Lorentz fits
Refs #12669
parent
0915098d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
+19
-3
19 additions, 3 deletions
...Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
with
19 additions
and
3 deletions
Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
+
19
−
3
View file @
09d70590
...
@@ -1353,12 +1353,15 @@ QStringList ConvFit::getFunctionParameters(QString functionName) {
...
@@ -1353,12 +1353,15 @@ QStringList ConvFit::getFunctionParameters(QString functionName) {
* @param functionName Name of new fit function
* @param functionName Name of new fit function
*/
*/
void
ConvFit
::
fitFunctionSelected
(
const
QString
&
functionName
)
{
void
ConvFit
::
fitFunctionSelected
(
const
QString
&
functionName
)
{
//remove previous parameters from tree
m_cfTree
->
removeProperty
(
m_properties
[
"FitFunction1"
]);
m_cfTree
->
removeProperty
(
m_properties
[
"FitFunction1"
]);
m_cfTree
->
removeProperty
(
m_properties
[
"FitFunction2"
]);
m_cfTree
->
removeProperty
(
m_properties
[
"FitFunction2"
]);
int
fitFunctionIndex
=
m_uiForm
.
cbFitType
->
currentIndex
();
// Add new parameter elements
// Add new parameter elements
int
fitFunctionIndex
=
m_uiForm
.
cbFitType
->
currentIndex
();
QStringList
parameters
=
getFunctionParameters
(
functionName
);
QStringList
parameters
=
getFunctionParameters
(
functionName
);
//Two Loremtzians Fit
if
(
fitFunctionIndex
==
2
)
{
if
(
fitFunctionIndex
==
2
)
{
m_properties
[
"FitFunction1"
]
=
m_grpManager
->
addProperty
(
"Lorentzian 1"
);
m_properties
[
"FitFunction1"
]
=
m_grpManager
->
addProperty
(
"Lorentzian 1"
);
m_cfTree
->
addProperty
(
m_properties
[
"FitFunction1"
]);
m_cfTree
->
addProperty
(
m_properties
[
"FitFunction1"
]);
...
@@ -1372,6 +1375,7 @@ void ConvFit::fitFunctionSelected(const QString &functionName) {
...
@@ -1372,6 +1375,7 @@ void ConvFit::fitFunctionSelected(const QString &functionName) {
QString
propName
;
QString
propName
;
// No fit function parameters required for Zero
// No fit function parameters required for Zero
if
(
parameters
[
0
].
compare
(
"Zero"
)
!=
0
)
{
if
(
parameters
[
0
].
compare
(
"Zero"
)
!=
0
)
{
//Two Lorentzians Fit
if
(
fitFunctionIndex
==
2
)
{
if
(
fitFunctionIndex
==
2
)
{
int
count
=
0
;
int
count
=
0
;
propName
=
"Lorentzian 1"
;
propName
=
"Lorentzian 1"
;
...
@@ -1381,7 +1385,13 @@ void ConvFit::fitFunctionSelected(const QString &functionName) {
...
@@ -1381,7 +1385,13 @@ void ConvFit::fitFunctionSelected(const QString &functionName) {
}
}
QString
name
=
propName
+
"."
+
*
it
;
QString
name
=
propName
+
"."
+
*
it
;
m_properties
[
name
]
=
m_dblManager
->
addProperty
(
*
it
);
m_properties
[
name
]
=
m_dblManager
->
addProperty
(
*
it
);
m_dblManager
->
setValue
(
m_properties
[
name
],
0.0
);
if
(
QString
(
*
it
).
compare
(
"FWHM"
)
==
0
)
{
m_dblManager
->
setValue
(
m_properties
[
name
],
0.0175
);
}
else
{
m_dblManager
->
setValue
(
m_properties
[
name
],
0.0
);
}
m_dblManager
->
setDecimals
(
m_properties
[
name
],
NUM_DECIMALS
);
m_dblManager
->
setDecimals
(
m_properties
[
name
],
NUM_DECIMALS
);
if
(
count
<
3
)
{
if
(
count
<
3
)
{
m_properties
[
"FitFunction1"
]
->
addSubProperty
(
m_properties
[
name
]);
m_properties
[
"FitFunction1"
]
->
addSubProperty
(
m_properties
[
name
]);
...
@@ -1399,7 +1409,13 @@ void ConvFit::fitFunctionSelected(const QString &functionName) {
...
@@ -1399,7 +1409,13 @@ void ConvFit::fitFunctionSelected(const QString &functionName) {
for
(
auto
it
=
parameters
.
begin
();
it
!=
parameters
.
end
();
++
it
)
{
for
(
auto
it
=
parameters
.
begin
();
it
!=
parameters
.
end
();
++
it
)
{
QString
name
=
propName
+
"."
+
*
it
;
QString
name
=
propName
+
"."
+
*
it
;
m_properties
[
name
]
=
m_dblManager
->
addProperty
(
*
it
);
m_properties
[
name
]
=
m_dblManager
->
addProperty
(
*
it
);
m_dblManager
->
setValue
(
m_properties
[
name
],
0.0
);
if
(
QString
(
*
it
).
compare
(
"FWHM"
)
==
0
)
{
m_dblManager
->
setValue
(
m_properties
[
name
],
0.0175
);
}
else
{
m_dblManager
->
setValue
(
m_properties
[
name
],
0.0
);
}
m_dblManager
->
setDecimals
(
m_properties
[
name
],
NUM_DECIMALS
);
m_dblManager
->
setDecimals
(
m_properties
[
name
],
NUM_DECIMALS
);
m_properties
[
"FitFunction1"
]
->
addSubProperty
(
m_properties
[
name
]);
m_properties
[
"FitFunction1"
]
->
addSubProperty
(
m_properties
[
name
]);
}
}
...
...
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