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
941fb01e
Commit
941fb01e
authored
6 years ago
by
Peterson, Peter
Browse files
Options
Downloads
Patches
Plain Diff
Name magic number
parent
40be8c27
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
Framework/DataHandling/src/PDLoadCharacterizations.cpp
+7
-4
7 additions, 4 deletions
Framework/DataHandling/src/PDLoadCharacterizations.cpp
with
7 additions
and
4 deletions
Framework/DataHandling/src/PDLoadCharacterizations.cpp
+
7
−
4
View file @
941fb01e
...
...
@@ -33,6 +33,9 @@ static const std::string ZERO("0.");
static
const
std
::
string
EXP_INI_VAN_KEY
(
"Vana"
);
static
const
std
::
string
EXP_INI_EMPTY_KEY
(
"VanaBg"
);
static
const
std
::
string
EXP_INI_CAN_KEY
(
"MTc"
);
/// the offset difference between the information in the table and the the
/// information in version=1 files
static
const
size_t
INFO_OFFSET_V1
(
6
);
// in the filenames vector, each index has a unique location
static
const
int
F_INDEX_V0
=
0
;
static
const
int
F_INDEX_V1
=
1
;
...
...
@@ -493,7 +496,7 @@ void updateRow(API::ITableWorkspace_sptr &wksp, const size_t rowNum,
wksp
->
getRef
<
std
::
string
>
(
"empty_instrument"
,
rowNum
)
=
values
[
5
];
for
(
size_t
i
=
0
;
i
<
names
.
size
();
++
i
)
{
const
auto
name
=
names
[
i
];
wksp
->
getRef
<
std
::
string
>
(
name
,
rowNum
)
=
values
[
i
+
6
];
wksp
->
getRef
<
std
::
string
>
(
name
,
rowNum
)
=
values
[
i
+
INFO_OFFSET_V1
];
}
}
}
// namespace
...
...
@@ -557,11 +560,11 @@ void PDLoadCharacterizations::readVersion1(const std::string &filename,
for
(
const
auto
&
token
:
tokenizer
)
{
valuesAsStr
.
push_back
(
token
);
}
if
(
valuesAsStr
.
size
()
<
columnNames
.
size
()
+
6
)
{
if
(
valuesAsStr
.
size
()
<
columnNames
.
size
()
+
INFO_OFFSET_V1
)
{
std
::
stringstream
msg
;
msg
<<
"Number of data columns ("
<<
valuesAsStr
.
size
()
<<
") not compatible with number of column labels ("
<<
(
columnNames
.
size
()
+
6
)
<<
")"
;
<<
(
columnNames
.
size
()
+
INFO_OFFSET_V1
)
<<
")"
;
throw
Exception
::
ParseError
(
msg
.
str
(),
filename
,
linenum
);
}
...
...
@@ -589,7 +592,7 @@ void PDLoadCharacterizations::readVersion1(const std::string &filename,
row
<<
0.
;
// wavelength_min
row
<<
0.
;
// wavelength_max
// insert all the extras
for
(
size_t
i
=
6
;
i
<
valuesAsStr
.
size
();
++
i
)
{
for
(
size_t
i
=
INFO_OFFSET_V1
;
i
<
valuesAsStr
.
size
();
++
i
)
{
row
<<
valuesAsStr
[
i
];
}
}
...
...
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