scan mode
This commit is contained in:
@ -135,6 +135,31 @@ class LaserController:
|
|||||||
Uses TASK_ENABLE (0x7777) command with TaskType.
|
Uses TASK_ENABLE (0x7777) command with TaskType.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
# First, send initial control parameters to set the device to starting values
|
||||||
|
logger.info("Setting initial control parameters before scan...")
|
||||||
|
initial_params = {
|
||||||
|
'Temp_1': parameters.min_temp_1,
|
||||||
|
'Temp_2': parameters.min_temp_2,
|
||||||
|
'Iset_1': parameters.min_current_1,
|
||||||
|
'Iset_2': parameters.min_current_2,
|
||||||
|
'ProportionalCoeff_1': self.proportional_coeff_1,
|
||||||
|
'ProportionalCoeff_2': self.proportional_coeff_2,
|
||||||
|
'IntegralCoeff_1': self.integral_coeff_1,
|
||||||
|
'IntegralCoeff_2': self.integral_coeff_2,
|
||||||
|
'Message_ID': self.message_id
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info(f"Initial parameters: T1={initial_params['Temp_1']}°C, T2={initial_params['Temp_2']}°C, "
|
||||||
|
f"I1={initial_params['Iset_1']} mA, I2={initial_params['Iset_2']} mA")
|
||||||
|
|
||||||
|
# Send initial control parameters
|
||||||
|
dev.send_control_parameters(self.prt, initial_params)
|
||||||
|
logger.info("Initial control parameters sent successfully")
|
||||||
|
|
||||||
|
# Small delay to allow device to process
|
||||||
|
import time
|
||||||
|
time.sleep(0.2)
|
||||||
|
|
||||||
# Determine which parameter to scan
|
# Determine which parameter to scan
|
||||||
if parameters.enable_c1:
|
if parameters.enable_c1:
|
||||||
task_type = cmd.TaskType.ChangeCurrentLD1.value
|
task_type = cmd.TaskType.ChangeCurrentLD1.value
|
||||||
|
|||||||
Reference in New Issue
Block a user