def __init__(self, guimgr): super(AwLgsvlSimulatorWidget, self).__init__() self.process = QtCore.QProcess(self) self.console = AwProcessViewer(self.process) self.button = QtWidgets.QPushButton("Launch Simulator") self.button.setCheckable(True) self.button.toggled.connect(self.launch_lgsvm) self.server_addr = QtWidgets.QLineEdit() self.server_port = QtWidgets.QLineEdit() self.client_addr = QtWidgets.QLineEdit() self.client_port = QtWidgets.QLineEdit() self.server_addr.setText("10.100.2.1") self.server_port.setText("5000") for host in QtNetwork.QNetworkInterface.allAddresses(): if not host.isLoopback(): if host.protocol() == QtNetwork.QAbstractSocket.IPv4Protocol: self.client_addr.setText(host.toString()) self.client_port.setText("9090") layout = QtWidgets.QGridLayout() layout.addWidget(QtWidgets.QLabel("Server Address"), 0, 0) layout.addWidget(QtWidgets.QLabel("Server Port"), 1, 0) layout.addWidget(QtWidgets.QLabel("Client Address"), 2, 0) layout.addWidget(QtWidgets.QLabel("Client Port"), 3, 0) layout.addWidget(self.server_addr, 0, 1) layout.addWidget(self.server_port, 1, 1) layout.addWidget(self.client_addr, 2, 1) layout.addWidget(self.client_port, 3, 1) layout.addWidget(self.button, 4, 0, 1, 2) layout.addWidget(self.console, 5, 0, 1, 2) self.setLayout(layout)
def __init__(self, frame_editor): self.editor = frame_editor self.editor.observers.append(self) self.old_frame = None self.layout = QtWidgets.QGridLayout() self.widget = QWidget() self.widget.setLayout(self.layout) self.mesh_label = QtWidgets.QLineEdit("File:") self.mesh_label.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed) self.mesh_button = QtWidgets.QPushButton("Open") self.mesh_button.clicked.connect(lambda: self.btn_open_mesh_clicked()) self.diameter_label = QtWidgets.QLabel("Diameter:") self.diameter_spinbox = QtWidgets.QDoubleSpinBox() self.diameter_spinbox.editingFinished.connect( lambda: self.diameter_changed()) self.length_label = QtWidgets.QLabel("Length:") self.length_spinbox = QtWidgets.QDoubleSpinBox() self.length_spinbox.editingFinished.connect( lambda: self.length_changed()) self.width_label = QtWidgets.QLabel("Width:") self.width_spinbox = QtWidgets.QDoubleSpinBox() self.width_spinbox.editingFinished.connect( lambda: self.width_changed()) self.height_label = QtWidgets.QLabel("Height:") self.height_spinbox = QtWidgets.QDoubleSpinBox() self.height_spinbox.editingFinished.connect( lambda: self.height_changed()) self.color_label = QtWidgets.QLabel() self.color_label.setAutoFillBackground(True) self.update_color_label(None) self.color_button = QtWidgets.QPushButton("Set Color") self.color_button.clicked.connect(lambda: self.btn_color_clicked()) self.layout.addWidget(self.mesh_label, 0, 0) self.layout.addWidget(self.mesh_button, 0, 1) self.layout.addWidget(self.diameter_label, 1, 0) self.layout.addWidget(self.diameter_spinbox, 1, 1) self.layout.addWidget(self.length_label, 2, 0) self.layout.addWidget(self.length_spinbox, 2, 1) self.layout.addWidget(self.width_label, 3, 0) self.layout.addWidget(self.width_spinbox, 3, 1) self.layout.addWidget(self.height_label, 4, 0) self.layout.addWidget(self.height_spinbox, 4, 1) self.layout.addWidget(self.color_label, 5, 0) self.layout.addWidget(self.color_button, 5, 1) print("init") self.update_widget(None)
def __init__(self): super(PluginEditWidget, self).__init__() self.fields = collections.OrderedDict() self.setLayout(QtWidgets.QGridLayout()) for col,text in enumerate(PluginEditWidget.header): self.layout().addWidget(QtWidgets.QLabel(text), 0, col) self.export = QtWidgets.QPushButton("Export") self.export.clicked.connect(self.export_yaml)
def __init__(self, guimgr): super(AwRosbagSimulatorWidget, self).__init__() self.rosbag_mode_proc = QtCore.QProcess(self) self.rosbag_info_proc = QtCore.QProcess(self) self.rosbag_play_proc = QtCore.QProcess(self) self.rosbag_file = widgets.AwFileSelect(self) self.rosbag_info = QtWidgets.QPushButton("Info") self.rosbag_text = QtWidgets.QLabel("No information") self.rosbag_enable = QtWidgets.QCheckBox() self.rosbag_label = QtWidgets.QLabel("Simulation Mode") self.rosbag_play = QtWidgets.QPushButton("Play") self.rosbag_stop = QtWidgets.QPushButton("Stop") self.rosbag_pause = QtWidgets.QPushButton("Pause") self.rosbag_state = QtWidgets.QLabel() #self.rosbag_stime = QtWidgets.QLineEdit() #start time #repeat #rate self.rosbag_enable.stateChanged.connect(self.simulation_mode_changed) self.rosbag_info.clicked.connect(self.rosbag_info_requested) self.rosbag_info_proc.finished.connect(self.rosbag_info_completed) self.rosbag_play.clicked.connect(self.rosbag_started) self.rosbag_stop.clicked.connect(self.rosbag_stopped) self.rosbag_play_proc.finished.connect(self.rosbag_finished) self.rosbag_play_proc.readyReadStandardOutput.connect( self.rosbag_output) self.rosbag_pause.setCheckable(True) self.rosbag_pause.toggled.connect(self.rosbag_paused) self.setStyleSheet( "QCheckBox::indicator { width: 28px; height: 28px; }") self.rosbag_label.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) self.rosbag_text.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) layout = QtWidgets.QGridLayout() layout.addWidget(self.rosbag_enable, 0, 0) layout.addWidget(self.rosbag_label, 0, 1) layout.addWidget(self.rosbag_play, 0, 2) layout.addWidget(self.rosbag_stop, 0, 3) layout.addWidget(self.rosbag_pause, 0, 4) layout.addWidget(self.rosbag_state, 1, 0, 1, 5) layout.addWidget(self.rosbag_file.path, 2, 0, 1, 3) layout.addWidget(self.rosbag_file.button, 2, 3) layout.addWidget(self.rosbag_info, 2, 4) layout.addWidget(self.rosbag_text, 3, 0, 1, 5) self.setLayout(layout) self.simulation_mode_disabled()