Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Achim Morschhauser
GeomagLogger
Commits
054fb1e5
Commit
054fb1e5
authored
Nov 13, 2018
by
Achim Morschhauser
Browse files
Exceptions parse_adc added
parent
0d12fd6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Obs_Calibration_Vector.cpp
View file @
054fb1e5
...
...
@@ -141,6 +141,8 @@ int Obs_Calibration_Vector::get_adc_calibrate(std::string config,
scale
=
cal
.
scale
;
offset
=
cal
.
offset
;
}
else
{
scale
=
""
;
offset
=
""
;
return
(
-
1
);
}
...
...
@@ -263,9 +265,9 @@ int Obs_Calibration_Vector::add_adc_calibrate(std::string config,
if
(
file
.
is_open
())
{
while
(
getline
(
file
,
line
)
)
{
// Parse from line
parse_adc_calibration
(
line
,
config
,
cal
)
;
// Save key-value pair
map_ADC
[
config
]
=
cal
;
if
(
parse_adc_calibration
(
line
,
config
,
cal
)
)
// Save key-value pair
map_ADC
[
config
]
=
cal
;
}
file
.
close
();
}
else
{
...
...
@@ -295,13 +297,18 @@ int Obs_Calibration_Vector::add_adc_calibrate(std::string config,
std
::
string
&
config
,
struct
adc_cal
&
cal
,
std
::
string
&
comment
)
{
size_t
pos_c
;
comment
=
""
;
// Find comment token ("#")
if
(
line
.
length
()
<=
0
)
return
(
-
1
);
pos_c
=
line
.
find
(
'#'
);
comment
=
line
.
substr
(
pos_c
);
// Proceed with uncommented part
line
=
line
.
substr
(
0
,
pos_c
);
if
(
pos_c
<
std
::
string
::
npos
){
comment
=
line
.
substr
(
pos_c
);
line
=
line
.
substr
(
0
,
pos_c
);
}
if
(
line
.
size
()
==
0
)
return
(
-
1
);
std
::
cerr
<<
"PARSE: "
<<
line
<<
std
::
endl
;
// Find configuration string
pos_c
=
line
.
find
(
','
);
config
=
line
.
substr
(
0
,
pos_c
);
...
...
usr/ADC.par
View file @
054fb1e5
...
...
@@ -3,5 +3,4 @@
# Tatuoca
OD-56A17021/0223/0,3AEC9C,00028E;
OD-56A17021/0223/1,3AEC9C,00028E;
OD-56A17021/0223/2,3AEC9C,00028E;
OD-56A17021/0223/2,3AEC9C,00028E;
\ No newline at end of file
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