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
99bc6cf8
Commit
99bc6cf8
authored
6 years ago
by
Leal, Ricardo
Browse files
Options
Downloads
Patches
Plain Diff
Moved the place where sample closeGroup was called
parent
84786630
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/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
+24
-20
24 additions, 20 deletions
...work/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
with
24 additions
and
20 deletions
Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
+
24
−
20
View file @
99bc6cf8
...
...
@@ -638,32 +638,36 @@ void LoadEventNexus::loadEntryMetadata(const std::string &nexusfilename, T WS,
// appropriate state
try
{
file
.
openGroup
(
"sample"
,
"NXsample"
);
if
(
exists
(
file
,
"name"
))
{
file
.
openData
(
"name"
);
const
auto
info
=
file
.
getInfo
();
std
::
string
name
;
if
(
info
.
type
==
::
NeXus
::
CHAR
)
{
if
(
info
.
dims
.
size
()
==
1
)
{
name
=
file
.
getStrData
();
}
else
{
// something special for 2-d array
const
int64_t
total_length
=
std
::
accumulate
(
info
.
dims
.
begin
(),
info
.
dims
.
end
(),
static_cast
<
int64_t
>
(
1
),
std
::
multiplies
<
int64_t
>
());
boost
::
scoped_array
<
char
>
val_array
(
new
char
[
total_length
]);
file
.
getData
(
val_array
.
get
());
file
.
closeData
();
name
=
std
::
string
(
val_array
.
get
(),
total_length
);
try
{
if
(
exists
(
file
,
"name"
))
{
file
.
openData
(
"name"
);
const
auto
info
=
file
.
getInfo
();
std
::
string
name
;
if
(
info
.
type
==
::
NeXus
::
CHAR
)
{
if
(
info
.
dims
.
size
()
==
1
)
{
name
=
file
.
getStrData
();
}
else
{
// something special for 2-d array
const
int64_t
total_length
=
std
::
accumulate
(
info
.
dims
.
begin
(),
info
.
dims
.
end
(),
static_cast
<
int64_t
>
(
1
),
std
::
multiplies
<
int64_t
>
());
boost
::
scoped_array
<
char
>
val_array
(
new
char
[
total_length
]);
file
.
getData
(
val_array
.
get
());
file
.
closeData
();
name
=
std
::
string
(
val_array
.
get
(),
total_length
);
}
}
}
file
.
closeData
();
file
.
closeData
();
if
(
!
name
.
empty
())
{
WS
->
mutableSample
().
setName
(
name
);
if
(
!
name
.
empty
())
{
WS
->
mutableSample
().
setName
(
name
);
}
}
}
catch
(
::
NeXus
::
Exception
&
)
{
// let it drop on floor if an exception occurs while reading sample
}
file
.
closeGroup
();
}
catch
(
::
NeXus
::
Exception
&
)
{
//
let it d
rop
on floor
//
If an exception occurs while opening the g
ro
u
p
"sample"
}
// get the duration
...
...
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