Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
opensand
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
7
Issues
7
List
Board
Labels
Milestones
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
opensand
opensand
Commits
142c3ef9
Commit
142c3ef9
authored
Dec 06, 2018
by
Joaquin Muguerza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force a fixed precision for float probe outputs
parent
38b66e62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
Probe.cpp
opensand-output/src/Probe.cpp
+24
-0
Probe.h
opensand-output/src/Probe.h
+1
-1
No files found.
opensand-output/src/Probe.cpp
View file @
142c3ef9
...
...
@@ -90,6 +90,30 @@ bool Probe<float>::getData(unsigned char* buffer, size_t len) const
return
true
;
}
template
<>
string
Probe
<
float
>::
getStrData
()
const
{
std
::
stringstream
strs
;
strs
.
setf
(
std
::
ios_base
::
fixed
);
strs
.
precision
(
12
);
float
val
=
this
->
get
();
strs
<<
val
;
return
strs
.
str
();
}
template
<>
string
Probe
<
double
>::
getStrData
()
const
{
std
::
stringstream
strs
;
strs
.
setf
(
std
::
ios_base
::
fixed
);
strs
.
precision
(
12
);
float
val
=
this
->
get
();
strs
<<
val
;
return
strs
.
str
();
}
template
<>
bool
Probe
<
double
>::
getData
(
unsigned
char
*
buffer
,
size_t
len
)
const
{
...
...
opensand-output/src/Probe.h
View file @
142c3ef9
...
...
@@ -71,7 +71,7 @@ public:
bool
getData
(
unsigned
char
*
buffer
,
size_t
len
)
const
;
string
getStrData
()
const
;
string
getStrData
()
const
;
private
:
Probe
(
uint8_t
id
,
const
string
&
name
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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