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
57bc998d
Commit
57bc998d
authored
9 years ago
by
Anton Piccardo-Selg
Browse files
Options
Downloads
Patches
Plain Diff
Refs #13872 md frame factory with horace style
parent
29bee706
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/Geometry/src/MDGeometry/MDFrameFactory.cpp
+8
-4
8 additions, 4 deletions
Framework/Geometry/src/MDGeometry/MDFrameFactory.cpp
Framework/Geometry/test/MDFrameFactoryTest.h
+4
-0
4 additions, 0 deletions
Framework/Geometry/test/MDFrameFactoryTest.h
with
12 additions
and
4 deletions
Framework/Geometry/src/MDGeometry/MDFrameFactory.cpp
+
8
−
4
View file @
57bc998d
...
...
@@ -3,7 +3,7 @@
#include
"MantidKernel/MDUnit.h"
#include
"MantidKernel/UnitLabelTypes.h"
#include
"MantidGeometry/MDGeometry/MDFrame.h"
#include
<boost/regex.hpp>
namespace
Mantid
{
namespace
Geometry
{
...
...
@@ -58,9 +58,13 @@ bool HKLFrameFactory::canInterpret(const MDFrameArgument &argument) const {
auto
unitFactoryChain
=
Kernel
::
makeMDUnitFactoryChain
();
auto
mdUnit
=
unitFactoryChain
->
create
(
argument
.
unitString
);
// We expect units to be RLU or A^-1
const
bool
compatibleUnit
=
(
mdUnit
->
getUnitLabel
()
==
Units
::
Symbol
::
InverseAngstrom
||
mdUnit
->
getUnitLabel
()
==
Units
::
Symbol
::
RLU
);
auto
isInverseAngstrom
=
mdUnit
->
getUnitLabel
()
==
Units
::
Symbol
::
InverseAngstrom
;
auto
isRLU
=
mdUnit
->
getUnitLabel
()
==
Units
::
Symbol
::
RLU
;
boost
::
regex
pattern
(
"in.*A.*
\\
^-1"
);
auto
isHoraceStyle
=
boost
::
regex_match
(
mdUnit
->
getUnitLabel
().
ascii
(),
pattern
);
const
bool
compatibleUnit
=
isInverseAngstrom
||
isRLU
||
isHoraceStyle
;
// Check both the frame name and the unit name
return
argument
.
frameString
==
HKL
::
HKLName
&&
compatibleUnit
;
}
...
...
This diff is collapsed.
Click to expand it.
Framework/Geometry/test/MDFrameFactoryTest.h
+
4
−
0
View file @
57bc998d
...
...
@@ -104,6 +104,10 @@ public:
TSM_ASSERT
(
"Should offer to produce HKL products"
,
factory
.
canInterpret
(
MDFrameArgument
(
HKL
::
HKLName
,
Units
::
Symbol
::
RLU
)));
TSM_ASSERT
(
"Should offer to produce HKL products"
,
factory
.
canInterpret
(
MDFrameArgument
(
HKL
::
HKLName
,
"in 1.684 A^-1"
)));
}
void
test_HKLFrameFactory_create_inverse_angstroms
()
{
...
...
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