Commit ca908dd9 authored by Maxime Perrotin's avatar Maxime Perrotin

Initial support for paramless TC

parent 848fe6e9
......@@ -2,6 +2,7 @@
<qresource>
<file>logging.ui</file>
<file>plotDialog.ui</file>
<file>simulation.ui</file>
<file>singleEditor.ui</file>
<file>tasteLogo_white.png</file>
<file>InterfaceEnum.i</file>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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
try:
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()
@property
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
self.set_paramless_tc()
@Slot()
def startStop(self):
......@@ -113,9 +117,11 @@ class sdlHandler(object):
if self.running:
self.dock.show()
self.dock_state.show()
self.dock_simu.show()
else:
self.dock.hide()
self.dock_state.hide()
self.dock_simu.hide()
@Slot(unicode)
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.setFloating(True)
dock.resize(400, 400)
dock.setObjectName('Simulation')
self.parent.addDockWidget(Qt.RightDockWidgetArea, dock)
dock.setAllowedAreas(Qt.NoDockWidgetArea)
dock.setWidget(widgets)
dock.hide()
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_area.addWidget(button)
tc = getattr(self.dll, '{}_{}'.format(self.proc.processName,
name))
button.pressed.connect(lambda: tc)
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainEditor</class>
<widget class="QDialog" name="MainEditor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>471</width>
<height>425</height>
</rect>
</property>
<property name="windowTitle">
<string>Edit ASN.1 value</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Log</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="log">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Console</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Send parameterless telecommands and timers</string>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="tc_grid"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
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