Skip to content

Commit

Permalink
operator gMainWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
ma4848 committed Jan 18, 2025
1 parent 482fd16 commit 7c3b218
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/surface/gui/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from gui.gui_node import GUINode
from PyQt6.QtGui import QIcon

#revert back to QWidget
#restart changing back to QMainWindow


class App(QMainWindow):
"""Main app window."""
Expand Down
35 changes: 29 additions & 6 deletions src/surface/gui/gui/operator_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@

from PyQt6.QtGui import QIcon

#operator works with QMainWindow
#change all "self" to wid
#set wid as central widget at the end


class OperatorApp(App):
def __init__(self) -> None:
super().__init__('operator_gui_node')

wid = QWidget()

self.setWindowTitle('Operator GUI - CWRUbotix ROV 2024')
self.setWindowIconText("hgfvdgshklghpidn")
wid.setWindowIconText("hgfvdgshklghpidn")
icon = QIcon('control48.png')
self.app.setWindowIcon(QIcon('control48.png'))
self.setWindowIcon(QIcon('control48.png'))





Expand All @@ -31,8 +39,8 @@ def __init__(self) -> None:
# wid.setLayout(layout)

# Main tab
wid = QWidget()
self.setCentralWidget(wid)


main_tab = QWidget()
main_layout = QHBoxLayout()
main_tab.setLayout(main_layout)
Expand All @@ -43,8 +51,21 @@ def __init__(self) -> None:
main_layout.addLayout(left_pane)
main_layout.addLayout(right_pane)

self.float_comm: FloatComm = FloatComm()
left_pane.addWidget(self.float_comm)

# wid = QWidget()
# self.setCentralWidget(wid)
# main_tab = QWidget()
# main_layout = QHBoxLayout()
# main_tab.setLayout(main_layout)

# left_pane = QVBoxLayout()
# right_pane = QVBoxLayout()

# main_layout.addLayout(left_pane)
# main_layout.addLayout(right_pane)

wid.float_comm: FloatComm = FloatComm()
left_pane.addWidget(wid.float_comm)

logger = Logger()
left_pane.addWidget(logger)
Expand All @@ -67,6 +88,8 @@ def __init__(self) -> None:
tabs.addTab(GeneralDebugTab(), 'General Debug')
root_layout.addWidget(tabs)

self.setCentralWidget(wid)


def run_gui_operator() -> None:
OperatorApp().run_gui()
5 changes: 3 additions & 2 deletions src/surface/gui/gui/pilot_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ def __init__(self) -> None:
super().__init__('pilot_gui_node')

wid = QWidget()
self.setCentralWidget(wid)
#self.setCentralWidget(wid)

main_layout = QVBoxLayout()
wid.setLayout(main_layout)
self.setLayout(main_layout)


simulation_param = self.node.declare_parameter('simulation', value=False)
Expand Down

0 comments on commit 7c3b218

Please sign in to comment.