Commit fd3eb6ea authored by Maxime Perrotin's avatar Maxime Perrotin

Periodically poll the database for TCs

parent e29c487b
......@@ -11,7 +11,7 @@
Creat subclasses, they will be dynamically loaded and the widget will
be placed in a docking window.
(c) 2016 European Space Agency
(c) 2016-2019 European Space Agency
'''
__author__ = "Maxime Perrotin, Thanassis Tsiodras"
......@@ -23,7 +23,7 @@ import sys
import os
import importlib
from PySide.QtCore import (QObject, Signal, Slot, Qt)
from PySide.QtCore import (QObject, Signal, Slot, Qt, QTimer)
import PySide.QtGui as QtGui
# User must list explicitly the classes he wants to expose to the GUI:
......@@ -119,15 +119,20 @@ class SQLTelecommands(TC):
if self._asn1_klass is None:
print "No class", typename_sql, "found in", SQLTelecommands.dbname
self.widget = QtGui.QListWidget()
# Get the first 50 entries in the database
self.widget.addItems(['{} ({})'.format(str(x),
self.sql2asn1(x).GSER())
for x in self.getPageIndexes(0, 50)])
self.widget.itemClicked.connect(self.select)
self.setWidget(self.widget)
# parent is the ASN.1 value editor
self.parent = parent
self.setWindowTitle("Select TC from Database")
self.updateListOfTc()
def updateListOfTc(self):
# Get the first 50 entries in the database, update every 10 secs
self.widget.clear()
self.widget.addItems(['{} ({})'.format(str(x),
self.sql2asn1(x).GSER())
for x in self.getPageIndexes(0, 50)])
QTimer().singleShot(10000, self.updateListOfTc)
@staticmethod
def applicable():
......
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