Commit 9eb17650 authored by Maxime Perrotin's avatar Maxime Perrotin

Add UserWidgets to give user customisation power

parent a5a6d3a7
#!/usr/bin/python
# -*- coding: utf-8 -*-
''' User can customise the TASTE auto-generated GUIs using by modifying this
module.
There are two base class: TC and TM
TC correspond to ASN.1 messages sent from the GUI to the application
and TM is the opposite.
Creat subclasses, they will be dynamically loaded and the widget will
be placed in a docking window.
(c) 2016 European Space Agency
Author: Maxime Perrotin
'''
import sys
from PySide.QtCore import (QObject, Signal, Slot, Qt, QRectF, QPointF, QPoint)
from PySide.QtGui import QWidget
__author__ = "Maxime Perrotin"
__license__ = "LGPL"
__version__ = "1.0"
__url__ = "http://taste.tuxfamily.org"
#__all__ = ['']
class TM(QWidget):
''' Subclasses of TM will receive ASN.1 data from the GUI whenever a
value is updated (through a Qt slot)
'''
def __init__(self, asn1_type=None, parent=None):
''' Initialisation of the Widget '''
pass
@Slot
def update(self, value):
''' Receive ASN.1 value - Specify actual type in subclasses (Slot)'''
pass
class TC(QWidget):
''' Subclasses of TC can be used to provide ASN.1 data to the main GUI
and to automatically send it to the application.
Example of uses: Buttons, SQL interface...
Define your widget and send signals at will.
'''
send = Signal()
update = Signal() # User to specify type
def __init__(self, asn1_type=None, parent=None):
''' Initialisation of the Widget '''
pass
if __name__ == '__main__':
print 'This module can only be imported from the main TASTE guis
sys.exit(-1)
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