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

Merge branch 'sa/master' into 'master'

Added Logo GUI

See merge request source/tmtc!5
parents fdb013e8 2b7a7d07
No related branches found
No related tags found
No related merge requests found
SOURCEbadge.png

313 KiB

...@@ -25,7 +25,11 @@ limitations under the License. ...@@ -25,7 +25,11 @@ limitations under the License.
@manual @manual
Run this file with the -h flag to display options. Run this file with the -h flag to display options.
""" """
import sys
from multiprocessing import Process from multiprocessing import Process
from PyQt5.QtWidgets import QApplication
from tmtc_core.utility.obsw_logger import set_tmtc_logger, get_logger from tmtc_core.utility.obsw_logger import set_tmtc_logger, get_logger
from config.obsw_config import set_globals from config.obsw_config import set_globals
...@@ -61,8 +65,12 @@ def run_tmtc_client(use_gui: bool): ...@@ -61,8 +65,12 @@ def run_tmtc_client(use_gui: bool):
tmtc_handler.initialize() tmtc_handler.initialize()
tmtc_handler.perform_operation() tmtc_handler.perform_operation()
else: else:
app = QApplication([])
tmtc_gui = TmTcFrontend() tmtc_gui = TmTcFrontend()
tmtc_gui.start_ui() tmtc_gui.start_ui()
sys.exit(app.exec_())
# tmtc_handler_task = TmTcHandler.prepare_tmtc_handler_start() # tmtc_handler_task = TmTcHandler.prepare_tmtc_handler_start()
# tmtc_frontend = TmTcFrontend() # tmtc_frontend = TmTcFrontend()
# tmtc_frontend_task = tmtc_frontend.prepare_start(tmtc_frontend) # tmtc_frontend_task = tmtc_frontend.prepare_start(tmtc_frontend)
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
from multiprocessing import Process from multiprocessing import Process
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import *
from PyQt5.QtGui import QPixmap
import sys
from core.tmtc_backend import TmTcHandler from core.tmtc_backend import TmTcHandler
from tmtc_core.tc.obsw_pus_tc_base import PusTelecommand from tmtc_core.tc.obsw_pus_tc_base import PusTelecommand
from tmtc_core.utility.obsw_logger import get_logger from tmtc_core.utility.obsw_logger import get_logger
...@@ -23,7 +25,7 @@ LOGGER = get_logger() ...@@ -23,7 +25,7 @@ LOGGER = get_logger()
TODO: Make it look nicer. Add SOURCE or KSat logo. 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 # 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"] serviceList = [ 2, 3, 5, 8, 9, 17, 20, 200, "Dummy", "GPS0", "GPS1" ] # , "Error"]
...@@ -40,6 +42,7 @@ class TmTcFrontend: ...@@ -40,6 +42,7 @@ class TmTcFrontend:
is_busy: bool is_busy: bool
def __init__(self): def __init__(self):
super(TmTcFrontend, self).__init__()
self.tmtc_handler = TmTcHandler() self.tmtc_handler = TmTcHandler()
# TODO: Perform initialization on button press with specified ComIF # TODO: Perform initialization on button press with specified ComIF
# Also, when changing ComIF, ensure that old ComIF is closed (e.g. with printout) # Also, when changing ComIF, ensure that old ComIF is closed (e.g. with printout)
...@@ -113,11 +116,17 @@ class TmTcFrontend: ...@@ -113,11 +116,17 @@ class TmTcFrontend:
self.single_command_button.setEnabled(state) self.single_command_button.setEnabled(state)
def start_ui(self): def start_ui(self):
app = QApplication([])
win = QWidget() win = QWidget(self)
self.setCentralWidget(win)
grid = QGridLayout() grid = QGridLayout()
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)
label.setScaledContents(True)
row = 0 row = 0
grid.addWidget(QLabel("Configuration:"), row, 0, 1, 2) grid.addWidget(QLabel("Configuration:"), row, 0, 1, 2)
row += 1 row += 1
...@@ -284,14 +293,13 @@ class TmTcFrontend: ...@@ -284,14 +293,13 @@ class TmTcFrontend:
row += 1 row += 1
win.setLayout(grid) win.setLayout(grid)
win.resize(900, 800) self.resize(900, 800)
win.show() self.show()
# resize table columns to fill the window width # resize table columns to fill the window width
#for i in range(0, 5): #for i in range(0, 5):
# self.commandTable.setColumnWidth(i, int(self.commandTable.width() / 5) - 3) # self.commandTable.setColumnWidth(i, int(self.commandTable.width() / 5) - 3)
app.exec_()
class SingleCommandTable(QTableWidget): class SingleCommandTable(QTableWidget):
def __init__(self): def __init__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment