Skip to content

Commit

Permalink
Closes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienroy committed Feb 9, 2024
1 parent 7637b05 commit d87c537
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions shutter_lover_remote_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,18 @@ def measureThread():

if(app.serialPort != None and app.serialPort.is_open):
try:
line = app.serialPort.readline()
if(DEBUG):
print(line)
data = json.loads(line)
# Put a data in the queue
app.comque.put(data)
# Generate an event in order to notify the GUI
print("Processed data event : " + str(data))
app.ws.event_generate('<<Measure>>', when='tail')
if(app.serialPort.in_waiting > 0):
line = app.serialPort.readline()
if(DEBUG):
print(line)
data = json.loads(line)
# Put a data in the queue
app.comque.put(data)
# Generate an event in order to notify the GUI
print("Processed data event : " + str(data))
app.ws.event_generate('<<Measure>>', when='tail')
else:
time.sleep(0.1)
except JSONDecodeError:
if(DEBUG):
print("Not formated data:" + str(line))
Expand Down Expand Up @@ -422,7 +425,7 @@ def run(self):
self.portName = self.ports[0]
self.connectionCombo['values']=self.ports
self.connectionCombo.current(0)
self.connectionCombo.bind("<<comboboxSelected>>", self.on_combo_selection)
self.connectionCombo.bind("<<ComboboxSelected>>", self.on_combo_selection)
self.connectionCombo.grid(row=0, column=4, padx=5, pady=5)

# serial port status
Expand Down

0 comments on commit d87c537

Please sign in to comment.