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
45d8492f
Commit
45d8492f
authored
Jul 17, 2019
by
Steffen Vogel
🎅🏼
Browse files
use path::string() instead of path::native() which is unsupported on Windows
Former-commit-id:
01afaa8a
parent
029bbc72
Changes
4
Hide whitespace changes
Inline
Side-by-side
Examples/Cxx/CIM/dpsim-cim.cpp
View file @
45d8492f
...
...
@@ -33,7 +33,7 @@ int main(int argc, char *argv[]) {
String
simName
=
"dpsim"
;
CIMReader
reader
(
simName
);
SystemTopology
sys
=
reader
.
loadCIM
(
args
.
sysFreq
,
args
.
posit
i
onal
,
args
.
solver
.
domain
);
SystemTopology
sys
=
reader
.
loadCIM
(
args
.
sysFreq
,
args
.
positonal
Paths
()
,
args
.
solver
.
domain
);
Simulation
sim
(
simName
,
sys
,
args
.
timeStep
,
args
.
duration
,
args
.
solver
.
domain
,
args
.
solver
.
type
);
...
...
Include/dpsim/Utils.h
View file @
45d8492f
...
...
@@ -90,6 +90,7 @@ public:
DPsim
::
Timer
::
StartClock
::
time_point
startTime
;
std
::
list
<
String
>
positional
;
std
::
list
<
fs
::
path
>
positonalPaths
()
const
;
std
::
map
<
String
,
Real
>
options
;
};
...
...
Source/Python/LoadCim.cpp
View file @
45d8492f
...
...
@@ -50,7 +50,7 @@ PyObject* Python::LoadCim(PyObject* self, PyObject* args, PyObject *kwargs) {
CPS
::
Real
frequency
=
50
;
PyObject
*
filenames
;
PyBytesObject
*
filename
;
std
::
list
<
String
>
cimFiles
;
std
::
list
<
fs
::
path
>
cimFiles
;
int
logLevel
=
(
int
)
CPS
::
Logger
::
Level
::
INFO
;
const
char
*
name
;
...
...
@@ -65,7 +65,7 @@ PyObject* Python::LoadCim(PyObject* self, PyObject* args, PyObject *kwargs) {
PyErr_SetString
(
PyExc_TypeError
,
"First argument must be filename or list of filenames"
);
return
nullptr
;
}
cimFiles
.
push
_back
(
PyBytes_AsString
((
PyObject
*
)
filename
));
cimFiles
.
emplace
_back
(
PyBytes_AsString
((
PyObject
*
)
filename
));
Py_DECREF
(
filename
);
}
}
...
...
Source/Utils.cpp
View file @
45d8492f
...
...
@@ -246,6 +246,16 @@ void CommandLineArgs::showCopyright() {
std
::
cout
<<
" Steffen Vogel <StVogel@eonerc.rwth-aachen.de>"
<<
std
::
endl
;
}
std
::
list
<
fs
::
path
>
CommandLineArgs
::
positonalPaths
()
const
{
std
::
list
<
fs
::
path
>
paths
;
for
(
auto
p
:
positional
)
{
paths
.
emplace_back
(
p
);
}
return
paths
;
}
std
::
vector
<
std
::
string
>
DPsim
::
Utils
::
tokenize
(
std
::
string
s
,
char
delimiter
)
{
std
::
vector
<
std
::
string
>
tokens
;
...
...
@@ -306,7 +316,7 @@ fs::path DPsim::Utils::findFile(const fs::path &name, const fs::path &hint, cons
}
}
throw
std
::
runtime_error
(
fmt
::
format
(
"File not found: {}"
,
name
.
native
()));
throw
std
::
runtime_error
(
fmt
::
format
(
"File not found: {}"
,
name
.
string
()));
}
std
::
list
<
fs
::
path
>
DPsim
::
Utils
::
findFiles
(
std
::
list
<
fs
::
path
>
filennames
,
const
fs
::
path
&
hint
,
const
std
::
string
&
useEnv
)
{
...
...
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