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
5c83d4d9
Commit
5c83d4d9
authored
Nov 28, 2019
by
Steffen Vogel
🎅🏼
Browse files
python: fix invalid return value for Node::setInitialVoltage()
Former-commit-id:
e184629e
parent
d78bce04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Include/dpsim/Python/Node.h
View file @
5c83d4d9
...
...
@@ -53,7 +53,7 @@ namespace Python {
static
PyObject
*
voltage
(
PyObject
*
self
,
PyObject
*
args
);
static
PyObject
*
gnd
(
PyObject
*
self
,
PyObject
*
args
);
static
void
setInitialVoltage
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
);
static
PyObject
*
setInitialVoltage
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
);
static
const
char
*
name
;
static
const
char
*
doc
;
...
...
Source/Python/Node.cpp
View file @
5c83d4d9
...
...
@@ -163,7 +163,7 @@ const char* Python::Node<VarType>::docSetInitialVoltage =
"set_initial_voltage
\n
"
"Set the initial voltage at this node.
\n
"
;
template
<
typename
VarType
>
void
Python
::
Node
<
VarType
>::
setInitialVoltage
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
PyObject
*
Python
::
Node
<
VarType
>::
setInitialVoltage
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
Py_complex
initVoltage
;
CPS
::
Int
phaseIndex
;
...
...
@@ -171,10 +171,12 @@ void Python::Node<VarType>::setInitialVoltage(PyObject *self, PyObject *args, Py
static
const
char
*
kwlist
[]
=
{
"voltage"
,
"index"
,
nullptr
};
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"Di"
,
(
char
**
)
kwlist
,
&
initVoltage
,
&
phaseIndex
))
return
;
Py_RETURN_NONE
;
Python
::
Node
<
VarType
>*
pyNode
=
(
Python
::
Node
<
VarType
>*
)
self
;
pyNode
->
node
->
setInitialVoltage
(
CPS
::
Complex
(
initVoltage
.
real
,
initVoltage
.
imag
),
phaseIndex
);
Py_RETURN_NONE
;
}
template
<
typename
VarType
>
...
...
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