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
|
||||
from villas.node.node import Node as VILLASnode
|
||||
|
||||
# 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():
|
||||
return {
|
||||
'type': 'shmem',
|
||||
'in': {
|
||||
'name': '/dpsim1-villas',
|
||||
'hooks': [
|
||||
{'type': 'stats'}
|
||||
{
|
||||
'type': 'stats'
|
||||
}
|
||||
],
|
||||
'signals': {
|
||||
'count': 30,
|
||||
'type': 'float'
|
||||
}
|
||||
'signals': get_dpsim_shmem_interface_signals()
|
||||
},
|
||||
'out': {
|
||||
'name': '/villas-dpsim1'
|
||||
|
|
Loading…
Add table
Reference in a new issue