Skip to content
Snippets Groups Projects
Commit 3bb6a22d authored by Robin Mueller's avatar Robin Mueller
Browse files

Merge branch 'master' into mueller/master

parents d88d43bb 320cb194
Branches
No related tags found
No related merge requests found
SOURCEbadge.png

313 KiB

......@@ -25,7 +25,11 @@ limitations under the License.
@manual
Run this file with the -h flag to display options.
"""
import sys
from multiprocessing import Process
from PyQt5.QtWidgets import QApplication
from tmtc_core.utility.obsw_logger import set_tmtc_logger, get_logger
from config.obsw_config import set_globals
......@@ -61,8 +65,11 @@ def run_tmtc_client(use_gui: bool):
tmtc_handler.initialize()
tmtc_handler.perform_operation()
else:
app = QApplication(["TMTC Commander"])
tmtc_gui = TmTcFrontend()
tmtc_gui.start_ui()
sys.exit(app.exec_())
# tmtc_handler_task = TmTcHandler.prepare_tmtc_handler_start()
# tmtc_frontend = TmTcFrontend()
# tmtc_frontend_task = tmtc_frontend.prepare_start(tmtc_frontend)
......
......@@ -10,6 +10,8 @@
from multiprocessing import Process
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QPixmap, QIcon
import sys
from core.tmtc_backend import TmTcHandler
from tmtc_core.tc.obsw_pus_tc_base import PusTelecommand
from tmtc_core.utility.obsw_logger import get_logger
......@@ -23,7 +25,8 @@ LOGGER = get_logger()
TODO: Make it look nicer. Add SOURCE or KSat logo.
"""
class TmTcFrontend:
class TmTcFrontend(QMainWindow):
# TODO: this list should probably be inside an enum in the obsw_config.py
serviceList = [ 2, 3, 5, 8, 9, 17, 20, 200, "Dummy", "GPS0", "GPS1" ] # , "Error"]
......@@ -40,6 +43,7 @@ class TmTcFrontend:
is_busy: bool
def __init__(self):
super(TmTcFrontend, self).__init__()
self.tmtc_handler = TmTcHandler()
# TODO: Perform initialization on button press with specified ComIF
# Also, when changing ComIF, ensure that old ComIF is closed (e.g. with printout)
......@@ -113,11 +117,18 @@ class TmTcFrontend:
self.single_command_button.setEnabled(state)
def start_ui(self):
app = QApplication([])
win = QWidget()
win = QWidget(self)
self.setCentralWidget(win)
grid = QGridLayout()
self.setWindowTitle("TMTC Commander")
label = QLabel(self)
pixmap = QPixmap("SOURCEbadge.png") # QPixmap is the class, easy to put pic on screen
label.setGeometry(720, 15, 110, 110)
label.setPixmap(pixmap)
self.setWindowIcon(QIcon("SOURCEbadge.png"));
label.setScaledContents(True)
row = 0
grid.addWidget(QLabel("Configuration:"), row, 0, 1, 2)
row += 1
......@@ -284,14 +295,13 @@ class TmTcFrontend:
row += 1
win.setLayout(grid)
win.resize(900, 800)
win.show()
self.resize(900, 800)
self.show()
# resize table columns to fill the window width
#for i in range(0, 5):
# self.commandTable.setColumnWidth(i, int(self.commandTable.width() / 5) - 3)
app.exec_()
class SingleCommandTable(QTableWidget):
def __init__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment