From 9d00337c09f6c81e7a58ba38f16e3a27dc51a8b2 Mon Sep 17 00:00:00 2001 From: Marc Planard Date: Mon, 19 Aug 2024 22:47:42 +0200 Subject: [PATCH] fixes --- libs3/settings.py | 2 ++ main.py | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libs3/settings.py b/libs3/settings.py index cffc7f9..5e1ff95 100644 --- a/libs3/settings.py +++ b/libs3/settings.py @@ -32,6 +32,8 @@ def Write(): config.set(laser, 'ip', str(gstt.lasersIPS[i])) config.set(laser, 'type', str(gstt.lasertype[i])) config.set(laser, 'dac_family', str(gstt.dacfamily[i])) + if gstt.dacfamily[i] == "extern_cmd": + config.set(laser, 'cmd', str(gstt.cmd[i])) config.set(laser, 'kpps', str(gstt.kpps[i])) config.set(laser, 'intens', str(gstt.intens[i])) config.set(laser, 'red', str(gstt.red[i])) diff --git a/main.py b/main.py index ccd6a15..7d2bd95 100755 --- a/main.py +++ b/main.py @@ -528,16 +528,16 @@ if __name__ == '__main__': for lasernumber in range(0,gstt.LaserNumber): # Launch one process (a tracer3 instance) by laser if gstt.dacfamily[lasernumber] == "extern_cmd": - dac_worker0 = spawn(gstt.cmd[lasernumber]) #Process(target=spawn, args=(gstt.cmd[0],)) - dac_worker0.name = f'ExternCmd{lasernumber}' - dac_worker0.join = dac_worker0.wait + dac_worker = spawn(gstt.cmd[lasernumber]) + dac_worker.name = f'ExternCmd{lasernumber}' + dac_worker.join = dac_worker.wait else: - dac_worker0= Process(target=dac_process, args=(lasernumber,0,)) - dac_worker0.start() + dac_worker= Process(target=dac_process, args=(lasernumber,0,)) + dac_worker.start() #commands.worker0 = dac_worker0 # ??? - commands.workers.append(dac_worker0) - print("Tracer 0 : name", dac_worker0.name , "pid", dac_worker0.pid ) + commands.workers.append(dac_worker) + print(f"Tracer {lasernumber} : name", dac_worker.name , "pid", dac_worker.pid ) print("DAC Family:", gstt.dacfamily[lasernumber]); # if lasernumber >0: