Skip to content
Snippets Groups Projects
Commit b1aab2c0 authored by esarrey's avatar esarrey
Browse files

Sripts part 2

parent 4a09e338
No related branches found
No related tags found
No related merge requests found
......@@ -5,4 +5,5 @@ dlls/
*.vs
*bin/
*obj/
*.vs
\ No newline at end of file
*.vs
*build/
\ No newline at end of file
assets/icon.ico

117 KiB

assets/splash_screen.png

42.5 KiB

File moved
cd ..
C:/Users/intermagadmin/miniconda3/python.exe c:/Users/intermagadmin/Documents/minimoke/__main__.py
\ No newline at end of file
# Scripts
## Debug
The debug batch script is used for debug only, this using directly using the files in the 'src' folder.
This is useful to quickly check what you modified.
## Build
The build batch script is used to generate an executable file from the source files.
This allow to properly generate the sofware and to compile (more stable and faster).
The shorcut on the desktop directly links the built executable.
\ No newline at end of file
......@@ -23,7 +23,7 @@ class DAC:
"""
self.reserved = False
self.status_setup = False
self.constant_output = [0., 0.]
self.constant_output = 0.
self.setup_dac()
def __del__(self) -> None:
......@@ -58,7 +58,7 @@ class DAC:
Set the constant output value for the DC output.
Args:
constant (list of float): The constant output value for each output.
constant (float): The constant output value (DC Value)
"""
self.constant_output = constant
......@@ -133,7 +133,7 @@ class DAC:
output_values = np.array([self.reference_signal1_1f[0] * self.modulation_amp[0],
self.reference_signal2_1f[0] * self.modulation_amp[1],
np.full(len(self.reference_signal1_1f[0]), self.constant_output[0])])
np.full(len(self.reference_signal1_1f[0]), self.constant_output)])
self.output.write(output_values, auto_start=True)
......@@ -154,15 +154,15 @@ class DAC:
self.input.wait_until_done()
# Read the measurement from the DAC buffer
data_ai0, data_ai1 = self.input.read(number_of_samples_per_channel=len(self.reference_signal_1f[0]))
data_ai0, data_ai1 = self.input.read(number_of_samples_per_channel=len(self.reference_signal1_1f[0]))
# We use the lowest frequency to set the aquisition time in order to have an integer number of periods at this frequency
# We now crop the data for the highest frequency for the same purpose, allowing us to have a mean value for a pure sinus
# close to 0.
max_idx_hf = int(np.floor(1/np.max(self.f) * self.sampling_rate * np.floor(self.acquisition_time*np.max(self.f))))
if self.freq[1] > self.freq[0]: data_ai1 = data_ai1[max_idx_hf]
else: data_ai0 = data_ai0[max_idx_hf]
if self.f[1] > self.f[0]: data_ai1 = data_ai1[max_idx_hf]
else: data_ai0 = data_ai0[max_idx_hf]
# Stop the tasks
self.output.stop()
......
......@@ -39,7 +39,7 @@ class VoltageThread(QThread):
while True:
if not dac.reserved:
if not dac.status_setup:
dac.setup_aquisition(acquisition_time=0.5, modulation_amp=0.)
dac.setup_aquisition(acquisition_time=0.5, modulation_amp=[0.,0.])
dac.set_constant_output(0.)
dac.start_tasks()
balanced_diodes_data, intensity_diode_data = dac.read_data()
......
......@@ -26,7 +26,7 @@ class UserManualTab(TabWidget, QTextBrowser):
super().__init__(parent)
self.name = name
with open("src/user_manual.md", "r", encoding="utf-8") as file:
with open("doc/user_manual.md", "r", encoding="utf-8") as file:
content = file.read()
html = markdown.markdown(content)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment