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","left camera mode":leftMode,"left camera lines":textboxValue3+"px","cmd":"set left lines of left camera"}},indent=2))
client.publish("microscope/light_sheet_microscope/UI/cameras",json.dumps({"type":"device","payload":{"name":"cameras","right camera mode":rightMode,"right camera lines":textboxValue4+"px","cmd":"set right camera mode and right camera lines"}},indent=2))
time.sleep(1)
client.loop_stop()
print("Right camera mode: "+rightMode)
print("Right camera lines: "+textboxValue4+"px")
config=configparser.RawConfigParser()
config.read("cameras.ini")
f=open("cameras.ini","w")
try:
config.add_section("Cameras")
config.add_section("Right camera")
exceptExceptionase:
pass
try:
config.set("Cameras","Right camera mode",rightMode)
config.set("Right camera","Mode",rightMode)
exceptExceptionase:
pass
try:
config.set("Cameras","Right camera lines",textboxValue4+"px")