Skip to content

Commit

Permalink
worked out a few bugs, now disconnected, error, and normal is reflexe…
Browse files Browse the repository at this point in the history
…d by the graph color(black, orange, blue/red)
  • Loading branch information
mark11778 committed Feb 2, 2025
1 parent fb7b944 commit 1179d65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions instrumentctl/E5CN_modbus/E5CN_modbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def _read_temperature_continuously(self, unit):
with self.temperatures_lock:
self.temperatures[unit - 1] = temperature
self.log(f"Unit {unit} Temperature: {temperature} C", LogLevel.INFO)
else:
self.log(f"Unit {unit} is reading null", LogLevel.ERROR)
time.sleep(0.5) # small delay between reads
except Exception as e:
self.log(f"Error in continuous temperature reading for unit {unit}: {str(e)}", LogLevel.ERROR)
Expand Down
8 changes: 2 additions & 6 deletions subsystem/cathode_heating/cathode_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def read_temperature(self, index):
try:
# Attempt to read temperature from the connected temperature controller
temperature = self.temperature_controller.temperatures[index]
if isinstance(temperature, int):
if isinstance(temperature, float):
self.clamp_temperature_vars[index].set(f"{temperature:.2f} C")

# Check for overtemperature condition
Expand Down Expand Up @@ -983,9 +983,7 @@ def update_data(self):

temperature = self.read_temperature(i)

self.log(f"{temperature}")

if isinstance(temperature, int) is not None:
if isinstance(temperature, float):
self.clamp_temperature_vars[i].set(f"{temperature:.2f} C")
elif isinstance(temperature, str):
self.clamp_temperature_vars[i].set("-- C")
Expand All @@ -994,8 +992,6 @@ def update_data(self):
self.clamp_temperature_vars[i].set("-- C")
self.clamp_temp_labels[i].config(foreground='black')



if plot_this_cycle:
self.time_data[i] = np.append(self.time_data[i], current_time)
self.temperature_data[i][0].set_data(self.time_data[i], np.append(self.temperature_data[i][0].get_data()[1], temperature))
Expand Down

0 comments on commit 1179d65

Please sign in to comment.