mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
Update Shmem_CIGRE_MV.py
This commit is contained in:
parent
7db2b0a380
commit
07d2ac98a4
1 changed files with 20 additions and 7 deletions
|
@ -1,21 +1,34 @@
|
||||||
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from villas.node.node import Node as VILLASnode
|
from villas.node.node import Node as VILLASnode
|
||||||
|
|
||||||
# This could be moved to the DPsim Python code later
|
# This could be moved to the DPsim Python code later
|
||||||
|
|
||||||
|
# It would be nice if the DPsim Shmem interface could build-up a list of actual
|
||||||
|
# signal descriptions (names, units, etc..) which attributes are exported.
|
||||||
|
# This would eliviate the user from manually configuring signal mappings
|
||||||
|
def get_dpsim_shmem_interface_signals():
|
||||||
|
signals = []
|
||||||
|
|
||||||
|
for i in range(0, 30):
|
||||||
|
signals.append({
|
||||||
|
'name': f'signal_{i}',
|
||||||
|
'type': 'float',
|
||||||
|
'unit': 'volts'
|
||||||
|
})
|
||||||
|
|
||||||
|
return signals
|
||||||
|
|
||||||
def get_dpsim_shmem_interface_config():
|
def get_dpsim_shmem_interface_config():
|
||||||
return {
|
return {
|
||||||
'type': 'shmem',
|
'type': 'shmem',
|
||||||
'in': {
|
'in': {
|
||||||
'name': '/dpsim1-villas',
|
'name': '/dpsim1-villas',
|
||||||
'hooks': [
|
'hooks': [
|
||||||
{'type': 'stats'}
|
{
|
||||||
|
'type': 'stats'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
'signals': {
|
'signals': get_dpsim_shmem_interface_signals()
|
||||||
'count': 30,
|
|
||||||
'type': 'float'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
'out': {
|
'out': {
|
||||||
'name': '/villas-dpsim1'
|
'name': '/villas-dpsim1'
|
||||||
|
|
Loading…
Add table
Reference in a new issue