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
d3388b3e
Commit
d3388b3e
authored
4 years ago
by
Zhang, Chen
Browse files
Options
Downloads
Patches
Plain Diff
easy fix to make sort work for leanpws
parent
4f55a3ea
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
Framework/Crystal/src/SortPeaksWorkspace.cpp
+4
-5
4 additions, 5 deletions
Framework/Crystal/src/SortPeaksWorkspace.cpp
with
4 additions
and
5 deletions
Framework/Crystal/src/SortPeaksWorkspace.cpp
+
4
−
5
View file @
d3388b3e
...
@@ -37,10 +37,10 @@ const std::string SortPeaksWorkspace::category() const {
...
@@ -37,10 +37,10 @@ const std::string SortPeaksWorkspace::category() const {
/** Initialize the algorithm's properties.
/** Initialize the algorithm's properties.
*/
*/
void
SortPeaksWorkspace
::
init
()
{
void
SortPeaksWorkspace
::
init
()
{
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
PeaksWorkspace
>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
I
PeaksWorkspace
>>
(
"InputWorkspace"
,
""
,
Direction
::
Input
),
"InputWorkspace"
,
""
,
Direction
::
Input
),
"An input workspace."
);
"An input workspace."
);
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
PeaksWorkspace
>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
I
PeaksWorkspace
>>
(
"OutputWorkspace"
,
""
,
Direction
::
Output
),
"OutputWorkspace"
,
""
,
Direction
::
Output
),
"An output workspace."
);
"An output workspace."
);
...
@@ -58,8 +58,8 @@ void SortPeaksWorkspace::init() {
...
@@ -58,8 +58,8 @@ void SortPeaksWorkspace::init() {
void
SortPeaksWorkspace
::
exec
()
{
void
SortPeaksWorkspace
::
exec
()
{
const
std
::
string
columnToSortBy
=
getProperty
(
"ColumnNameToSortBy"
);
const
std
::
string
columnToSortBy
=
getProperty
(
"ColumnNameToSortBy"
);
const
bool
sortAscending
=
getProperty
(
"SortAscending"
);
const
bool
sortAscending
=
getProperty
(
"SortAscending"
);
PeaksWorkspace_sptr
inputWS
=
getProperty
(
"InputWorkspace"
);
I
PeaksWorkspace_sptr
inputWS
=
getProperty
(
"InputWorkspace"
);
PeaksWorkspace_sptr
outputWS
=
getProperty
(
"OutputWorkspace"
);
I
PeaksWorkspace_sptr
outputWS
=
getProperty
(
"OutputWorkspace"
);
// Try to get the column. This will throw if the column does not exist.
// Try to get the column. This will throw if the column does not exist.
inputWS
->
getColumn
(
columnToSortBy
);
inputWS
->
getColumn
(
columnToSortBy
);
...
@@ -68,7 +68,6 @@ void SortPeaksWorkspace::exec() {
...
@@ -68,7 +68,6 @@ void SortPeaksWorkspace::exec() {
outputWS
=
inputWS
->
clone
();
outputWS
=
inputWS
->
clone
();
}
}
// Perform the sorting.
std
::
vector
<
PeaksWorkspace
::
ColumnAndDirection
>
sortCriteria
;
std
::
vector
<
PeaksWorkspace
::
ColumnAndDirection
>
sortCriteria
;
sortCriteria
.
emplace_back
(
columnToSortBy
,
sortAscending
);
sortCriteria
.
emplace_back
(
columnToSortBy
,
sortAscending
);
outputWS
->
sort
(
sortCriteria
);
outputWS
->
sort
(
sortCriteria
);
...
...
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