Skip to content

Commit

Permalink
Topic name dialog fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-figure authored and juanlofer-eprosima committed Nov 17, 2023
1 parent ec97096 commit 24ce009
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions controller/controller_tool/tool/src/py/ControllerGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,33 +90,39 @@ def __init__(self, current_command_topic, current_status_topic):
"""Construct the dialog to set the DDS command and status topic names."""
super().__init__()

self.command_topic_label = QLabel('Enter command topic name:')
self.command_topic_label = QLabel('Command topic:')
self.command_topic_label.setFixedWidth(120)
self.command_text_box = QLineEdit(self)
self.command_text_box.setText(current_command_topic)
self.command_text_box.setMinimumWidth(250)

self.status_topic_label = QLabel('Enter status topic name:')
self.status_topic_label = QLabel('Status topic:')
self.status_topic_label.setFixedWidth(120)
self.status_text_box = QLineEdit(self)
self.status_text_box.setText(current_status_topic)
self.status_text_box.setMinimumWidth(250)

self.buttonBox = QDialogButtonBox(
QDialogButtonBox.StandardButton.Save
| QDialogButtonBox.StandardButton.Cancel)
self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.reject)

command_layout = QVBoxLayout()
command_layout.addWidget(self.command_topic_label)
command_layout.addWidget(self.command_text_box)
self.command_layout = QHBoxLayout()
self.command_layout.addWidget(self.command_topic_label)
self.command_layout.addWidget(self.command_text_box)

status_layout = QVBoxLayout()
status_layout.addWidget(self.status_topic_label)
status_layout.addWidget(self.status_text_box)
self.status_layout = QHBoxLayout()
self.status_layout.addWidget(self.status_topic_label)
self.status_layout.addWidget(self.status_text_box)

horiznontal_layout = QHBoxLayout()
horiznontal_layout.addLayout(command_layout)
horiznontal_layout.addLayout(status_layout)
layout = QVBoxLayout()
layout.addLayout(self.command_layout)
layout.addLayout(self.status_layout)
layout.addWidget(self.buttonBox)
layout.setSizeConstraint(QVBoxLayout.SizeConstraint.SetFixedSize)

self.setLayout(horiznontal_layout)
self.setLayout(layout)

def get_command_topic(self):
"""Return DDS command topic from the text box."""
Expand All @@ -143,6 +149,10 @@ def __init__(self, main_window):
dds_domain_action.triggered.connect(self.main_window.dds_domain_dialog)
file_menu.addAction(dds_domain_action)

topic_name_action = QAction('DDS Topics', self)
topic_name_action.triggered.connect(self.main_window.topic_name_dialog)
file_menu.addAction(topic_name_action)

docs_action = QAction('Documentation', self)
docs_action.triggered.connect(
lambda: QDesktopServices.openUrl(
Expand Down Expand Up @@ -233,7 +243,7 @@ def restart_controller(self, dds_domain=0, command_topic='/ddsrecorder/command',
# Reset status
self.update_status(RecorderStatus.CLOSED)
# Create DDS entities in new domain
self.dds_controller.init_dds(dds_domain)
self.dds_controller.init_dds(dds_domain, command_topic, status_topic)
self.dds_domain = dds_domain
self.command_topic = command_topic
self.status_topic = status_topic
Expand Down

0 comments on commit 24ce009

Please sign in to comment.