Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
Power System Simulation and Optimization
DPsim
DPsim
Commits
8620d8d1
Commit
8620d8d1
authored
Oct 21, 2020
by
Jan Dinkelbach
Committed by
Markus Mirz
Nov 21, 2020
Browse files
use cout instead of to_string for logging of phasors and complex numbers for better accuracy
parent
04703fd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
models/Include/cps/Logger.h
View file @
8620d8d1
...
...
@@ -81,11 +81,15 @@ namespace CPS {
}
static
String
phasorToString
(
const
Complex
&
num
)
{
return
std
::
to_string
(
Math
::
abs
(
num
))
+
"<"
+
std
::
to_string
(
Math
::
phaseDeg
(
num
));
std
::
stringstream
ss
;
ss
<<
std
::
defaultfloat
<<
Math
::
abs
(
num
)
<<
"<"
<<
Math
::
phaseDeg
(
num
);
return
ss
.
str
();
}
static
String
complexToString
(
const
Complex
&
num
)
{
return
std
::
to_string
(
num
.
real
())
+
"+j"
+
std
::
to_string
(
num
.
imag
());
std
::
stringstream
ss
;
ss
<<
std
::
defaultfloat
<<
num
.
real
()
<<
"+j"
<<
num
.
imag
();
return
ss
.
str
();
}
static
String
getCSVColumnNames
(
std
::
vector
<
String
>
names
);
...
...
Write
Preview
Supports
Markdown
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