|
@@ -22,12 +22,21 @@ class Remote(kcgw.KCGWidgets):
|
|
|
self.layout = QtGui.QGridLayout()
|
|
|
self.setLayout(self.layout)
|
|
|
self.start_stop_button_listen = self.createButton("Allow Remote Control", connect=self.start_stop_listen)
|
|
|
+ self.start_stop_button_send = self.createButton("Control remote Gui", connect=self.start_stop_send)
|
|
|
self.port = self.createSpinbox(1024, 65000, interval=1, start_value=1330)
|
|
|
self.port_label = self.createLabel("Port")
|
|
|
self.layout.addWidget(self.port_label, 0, 0)
|
|
|
self.layout.addWidget(self.port, 0, 1)
|
|
|
self.layout.addWidget(self.start_stop_button_listen, 1, 1)
|
|
|
|
|
|
+ self.host_label = self.createLabel("Host")
|
|
|
+ self.host_input = self.createInput()
|
|
|
+ self.layout.addWidget(self.host_label, 2, 0)
|
|
|
+ self.layout.addWidget(self.host_input, 2, 1)
|
|
|
+ self.layout.addWidget(self.port_label, 3, 0)
|
|
|
+ self.layout.addWidget(self.port, 3, 1)
|
|
|
+ self.layout.addWidget(self.start_stop_button_send, 4, 1)
|
|
|
+
|
|
|
self.rl = RemoteListener(self.host, self.port.value(), parent=self)
|
|
|
self.rl.command_received.connect(self.evaluate)
|
|
|
self.response.connect(self.rl.response)
|
|
@@ -140,6 +149,20 @@ class Remote(kcgw.KCGWidgets):
|
|
|
self.listen_process.start()
|
|
|
self.start_stop_button_listen.setText("Disallow Remote Control")
|
|
|
|
|
|
+ def start_stop_send(self):
|
|
|
+ self.send_status = not self.send_status
|
|
|
+ if not self.send_status:
|
|
|
+ board.safe_call = board.backup_safe_call
|
|
|
+ self.start_stop_button_send.setText("Control remote Gui")
|
|
|
+ else:
|
|
|
+ board.host = self.host_input.text()
|
|
|
+ board.port = self.port.value()
|
|
|
+ board.safe_call = board.safe_remote_call
|
|
|
+ Elements.setEnabled('no_board', True)
|
|
|
+ bif.bk_check_for_board()
|
|
|
+ bif._bif_status_readout()
|
|
|
+ self.start_stop_button_send.setText("Control local Gui")
|
|
|
+
|
|
|
def closeEvent(self, event):
|
|
|
global __widget_id__
|
|
|
__widget_id__ = None
|