Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
16885b3e
Commit
16885b3e
authored
Oct 09, 2018
by
Purves, Murray
Browse files
Fixing byte skip in PCF header read
parent
caebf42a
Changes
1
Hide whitespace changes
Inline
Side-by-side
radixio/spectrumpcfstream.i.hh
View file @
16885b3e
...
...
@@ -179,6 +179,9 @@ bool SpectrumPCFStream<data_type>::read_from(const std::string &file)
radix_line
(
" No deviation pairs present"
);
// Set SRSI to correct value
mData
->
setSrsi
(
2
);
// Need to rewind to 256 bytes (start of spectrum header data)
stream
.
skipBytes
(
-
30
);
}
// Set deviation pairs
mData
->
setDeviationPairEnergies
(
deviationPairEnergies
);
...
...
@@ -204,7 +207,7 @@ bool SpectrumPCFStream<data_type>::read_from(const std::string &file)
// Using a delimiter character
radix_line
(
" Splitting using delimiter ("
<<
delim
<<
")..."
);
std
::
vector
<
std
::
string
>
bufferItems
=
split_string
(
std
::
string
(
1
,
delim
),
trim_string
(
buffer
));
split_string
(
std
::
string
(
1
,
delim
),
trim_string
(
buffer
)
,
true
);
if
(
bufferItems
.
size
()
>
0
)
{
title
=
trim_string
(
bufferItems
[
0
]);
...
...
@@ -475,11 +478,7 @@ bool SpectrumPCFStream<data_type>::write_to(const std::string &file) const
{
// Don't write deviation pairs
radix_line
(
" No deviation pairs found:"
);
// Skip to 512 bytes (start of spectral data)
stream
.
write
(
make_length
(
" "
,
512
-
stream
.
bytesWritten
()).
c_str
(),
512
-
stream
.
bytesWritten
());
// Add bytes written directly to eafstream count
stream
.
setBytesWritten
(
512
);
// Don't need to skip anything - spectrum header data starts at 256 bytes
}
// Write spectrum data
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment