Commit 64f92c2e authored by Spencer Du's avatar Spencer Du

cameras ui update

parent 8834259f
......@@ -196,7 +196,7 @@ class Ui_MainWindow(object):
config = configparser.RawConfigParser()
f = open("cameras.ini")
f = open("cameras.ini", "w")
config.add_section("Exposure")
config.set("Exposure", "time", textboxValue + "ms")
config.write(f)
......@@ -711,6 +711,36 @@ class Ui_MainWindow(object):
self.lineEdit_6.returnPressed.connect(self.leftROI)
self.lineEdit_7.returnPressed.connect(self.heightROI)
else:
config = configparser.RawConfigParser()
config.read("cameras.ini")
client = device()
client.run()
client.loop_start()
print("\n" + "Connected to broker")
time.sleep(1)
print("Subscribing to topic", "microscope/light_sheet_microscope/UI/cameras")
client.subscribe("microscope/light_sheet_microscope/UI/cameras")
print("Publishing message to topic", "microscope/light_sheet_microscope/UI/cameras")
client.publish("microscope/light_sheet_microscope/UI/cameras", json.dumps({"type": "device", "payload":{"name": "cameras", "cmd": "cameras turning on"}}, indent=2))
time.sleep(1)
client.loop_stop()
print("Cameras turned on")
self.pushButton_11.clicked.connect(self.stop)
self.pushButton_10.setCheckable(True)
self.lineEdit.returnPressed.connect(self.exposureTime)
self.lineEdit_8.returnPressed.connect(self.delay)
self.lineEdit_2.returnPressed.connect(self.leftCamera)
self.lineEdit_3.returnPressed.connect(self.rightCamera)
self.lineEdit_4.returnPressed.connect(self.topROI)
self.lineEdit_5.returnPressed.connect(self.widthROI)
self.lineEdit_6.returnPressed.connect(self.leftROI)
self.lineEdit_7.returnPressed.connect(self.heightROI)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment