Commit ca908dd9 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Initial support for paramless TC

parent 848fe6e9
......@@ -2,6 +2,7 @@
This diff is collapsed.
......@@ -17,13 +17,14 @@
import os
import ctypes
from PySide.QtGui import QDockWidget
from PySide.QtCore import Slot, Qt
from PySide.QtGui import QDockWidget, QPushButton, QGridLayout
from PySide.QtCore import Slot, Qt, QFile
from PySide.QtUiTools import QUiLoader
import asn1_value_editor
from standalone_editor import asn1sccToasn1ValueEditorTypes
import vn
import resources
import opengeode
except ImportError:
......@@ -68,6 +69,7 @@ class sdlHandler(object):
self.dock_state = None
self.asn1_editor = None
self.tree_items = {}
self.dock_simu = self.start_simu()
def dll(self):
......@@ -105,6 +107,8 @@ class sdlHandler(object):
item = asn1sccToasn1ValueEditorTypes(dataview, var, sort)
self.tree_items[var] = self.asn1_editor.setAsn1Model(item, row)
row += 1
# In the simulation panel, set the buttons to send paramless TC/timers
def startStop(self):
......@@ -113,9 +117,11 @@ class sdlHandler(object):
if self.running:
def change_state(self, new_state):
......@@ -156,3 +162,39 @@ class sdlHandler(object):
as_pyside = vn.fromValueNotationToPySide(var, gser)
#print "PYSIDE:", as_pyside
self.asn1_editor.updateVariable(as_pyside, root=self.tree_items[var])
def start_simu(self):
Set up the simulation bay, from simulation.ui file
This panel handles parameterless signals and
the simulation console'''
ui = QFile(':/simulation.ui')
loader = QUiLoader()
widgets = loader.load(ui, parent=self.parent)
dock = QDockWidget('Simulation bay', self.parent)
dock.resize(400, 400)
self.parent.addDockWidget(Qt.RightDockWidgetArea, dock)
return dock
def set_paramless_tc(self):
''' Once the DLL is loaded set the buttons to send paramless TC '''
widget = self.dock_simu.widget()
tc_area = widget.findChild(QGridLayout, 'tc_grid')
# Find parameterless input signals and create buttons
buttons = {}
for each in self.proc.input_signals:
if 'type' not in each:
buttons[each['name']] = QPushButton(each['name'])
for each in self.proc.timers:
buttons[each] = QPushButton(each+' timeout')
for name, button in buttons.viewitems():
tc = getattr(self.dll, '{}_{}'.format(self.proc.processName,
button.pressed.connect(lambda: tc)
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<widget class="QDialog" name="MainEditor">
<property name="geometry">
<property name="windowTitle">
<string>Edit ASN.1 value</string>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<widget class="QLabel" name="label_2">
<property name="text">
<widget class="QTextEdit" name="log">
<property name="readOnly">
<widget class="QLabel" name="label_3">
<property name="text">
<widget class="QLineEdit" name="lineEdit"/>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Send parameterless telecommands and timers</string>
<item row="1" column="0">
<layout class="QGridLayout" name="tc_grid"/>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment