Visual improvements for csv graphs

This commit is contained in:
Martin Zietz
2021-02-09 12:21:07 +01:00
parent 792848dda2
commit a0bab62ebc
4 changed files with 82 additions and 61 deletions
+16 -15
View File
@@ -364,16 +364,17 @@ def set_current_vec(vector): # sets needed currents on each axis for given vect
def devices_ok(xy_off=False, z_off=False, arduino_off=False):
# ToDo: comments
try:
if not xy_off:
if g.XY_DEVICE is not None:
g.X_AXIS.update_status_info()
if g.X_AXIS.connected != "Connected":
return False
else:
# check if all devices are connected, return True if yes
# checks for individual devices can be disabled by parameters above (default not disabled)
try: # handle errors while checking connections
if not xy_off: # if check for this device is not disabled
if g.XY_DEVICE is not None: # has the handle for this device been set?
g.X_AXIS.update_status_info() # update info --> this actually communicates with the device
if g.X_AXIS.connected != "Connected": # if not connected
return False # return and exit function
else: # if handle has not been set the device is inactive --> not ok
return False
if not z_off:
if not z_off: # same as above
if g.Z_DEVICE is not None:
g.Z_AXIS.update_status_info()
if g.Z_AXIS.connected != "Connected":
@@ -381,12 +382,12 @@ def devices_ok(xy_off=False, z_off=False, arduino_off=False):
else:
return False
if not arduino_off:
g.ARDUINO.update_status_info()
if not arduino_off: # check not disabled
g.ARDUINO.update_status_info() # update status info --> attempts communication
if g.ARDUINO.connected != "Connected":
return False
except Exception as e:
messagebox.showerror("Error!", "Error while checking devices: \n%s" % e)
return False
else:
except Exception as e: # if an error is encountered while checking the devices
messagebox.showerror("Error!", "Error while checking devices: \n%s" % e) # show error pop-up
return False # clearly something is not ok
else: # if nothing has triggered so far all devices are ok --> return True
return True