Refatoring: Moved .py files into src folder. Unified some file names

This commit is contained in:
2021-07-27 15:09:24 +02:00
parent c7e793a420
commit bcfe4808c0
18 changed files with 16 additions and 20 deletions
BIN
View File
Binary file not shown.
+6 -6
View File
@@ -8,9 +8,9 @@ import traceback
from tkinter import messagebox
# import other project files
from User_Interface import ui_print
from pyps2000b import PS2000B
from Arduino import Arduino
from user_interface import ui_print
from ps2000b import PS2000B
from arduino import Arduino
import config_handling as config
import globals as g
@@ -192,8 +192,8 @@ class ArduinoCtrl(Arduino):
axis.polarity_switched = "False" # set attribute in axis object accordingly
except Exception as e: # some error occurred while trying to read status, usually arduino is disconnected
# show warning messages to alert user
ui_print("Error with Arduino:", e)
messagebox.showerror("Error with Arduino!", "Connection Error with Arduino: \n%s" % e)
ui_print("Error with arduino:", e)
messagebox.showerror("Error with arduino!", "Connection Error with arduino: \n%s" % e)
for axis in g.AXES: # set polarity switch attributes in axis objects to "Unknown"
axis.polarity_switched = "Unknown"
self.connected = "Connection Error" # update own connection status
@@ -347,7 +347,7 @@ def shut_down_all(): # safe shutdown at program end or on error
ui_print("Z PSU not connected, can't deactivate.")
message += "\nZ PSU not connected, can't deactivate."
# Shut down Arduino:
# Shut down arduino:
try:
g.ARDUINO.safe() # call safe method in ArduinoCtrl class (all relay pins to LOW)
except BaseException as e: # some error occurred
@@ -9,7 +9,7 @@ from tkinter import messagebox
import globals as g
import cage_func as func
# noinspection PyPep8Naming
import User_Interface as ui
import user_interface as ui
global CONFIG_FILE # string storing the path of the used config file
global CONFIG_OBJECT # object of type ConfigParser(), storing all configuration information
+2 -2
View File
@@ -1,5 +1,5 @@
# This file contains functions related to logging data from the program to a CSV file.
# They are mainly but not only called by the ConfigureLogging class in User_Interface.py.
# They are mainly but not only called by the ConfigureLogging class in user_interface.py.
# import packages
import pandas as pd
@@ -10,7 +10,7 @@ from tkinter import messagebox
# import other project files
import globals as g
import User_Interface as ui
import user_interface as ui
log_data = pd.DataFrame() # pandas data frame containing the logged data, in-program representation of csv/excel data
unsaved_data = False # Bool to indicate if there is unsaved data, set to True each time a datapoint is logged
+1 -1
View File
@@ -11,7 +11,7 @@ from tkinter import messagebox
import matplotlib.pyplot as plt
# import other project files:
import User_Interface as ui
import user_interface as ui
import cage_func as func
import globals as g
+2 -2
View File
@@ -44,8 +44,8 @@ default_arrays = {
}
# Dictionary for PSU serial ports:
default_ports = {
"xy_port": "COM1", # Default serial port where PSU for X- and Y-Axes is connected
"z_port": "COM2", # Default serial port where PSU for Z-Axis is connected
"xy_port": "COM8", # Default serial port where PSU for X- and Y-Axes is connected
"z_port": "COM5", # Default serial port where PSU for Z-Axis is connected
}
# Configuration for socket interface
+3 -3
View File
@@ -7,9 +7,9 @@ from tkinter import messagebox
# import other project files:
import cage_func as func
from User_Interface import HelmholtzGUI
from User_Interface import ui_print
import User_Interface as ui
from user_interface import HelmholtzGUI
from user_interface import ui_print
import user_interface as ui
import globals as g
import config_handling as config
import csv_logging as log
+1 -1
View File
@@ -1,5 +1,5 @@
import globals as g
from User_Interface import ui_print
from user_interface import ui_print
import cage_func as cage_controls
from threading import Thread
-4
View File
@@ -1,4 +0,0 @@
Date;Time;t (s);X PSU Status;Y PSU Status;Z PSU Status;X Voltage Setpoint;Y Voltage Setpoint;Z Voltage Setpoint;X Actual Voltage;Y Actual Voltage;Z Actual Voltage;X Current Setpoint;Y Current Setpoint;Z Current Setpoint;X Actual Current;Y Actual Current;Z Actual Current;X Target Field;Y Target Field;Z Target Field;X Trgt. Field Raw;Y Trgt. Field Raw;Z Trgt. Field Raw;X Target Current;Y Target Current;Z Target Current;X Inverted;Y Inverted;Z Inverted
2021-03-22;10:58:32,248216;0,0;Not Connected;Not Connected;Not Connected;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;Unknown;Unknown;Unknown
2021-03-22;10:58:33,262910;1,014694;Not Connected;Not Connected;Not Connected;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;Unknown;Unknown;Unknown
2021-03-22;10:58:34,271188;2,022972;Not Connected;Not Connected;Not Connected;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;Unknown;Unknown;Unknown
1 Date Time t (s) X PSU Status Y PSU Status Z PSU Status X Voltage Setpoint Y Voltage Setpoint Z Voltage Setpoint X Actual Voltage Y Actual Voltage Z Actual Voltage X Current Setpoint Y Current Setpoint Z Current Setpoint X Actual Current Y Actual Current Z Actual Current X Target Field Y Target Field Z Target Field X Trgt. Field Raw Y Trgt. Field Raw Z Trgt. Field Raw X Target Current Y Target Current Z Target Current X Inverted Y Inverted Z Inverted
2 2021-03-22 10:58:32,248216 0,0 Not Connected Not Connected Not Connected 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Unknown Unknown Unknown
3 2021-03-22 10:58:33,262910 1,014694 Not Connected Not Connected Not Connected 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Unknown Unknown Unknown
4 2021-03-22 10:58:34,271188 2,022972 Not Connected Not Connected Not Connected 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Unknown Unknown Unknown