Compare commits
No commits in common. "dev/marc" and "master" have entirely different histories.
25
LJ.conf
25
LJ.conf
@ -2,7 +2,7 @@
|
|||||||
lasernumber = 1
|
lasernumber = 1
|
||||||
debug = 0
|
debug = 0
|
||||||
rediserverip = 0.0.0.0
|
rediserverip = 0.0.0.0
|
||||||
wwwip = 127.0.0.1
|
wwwip = 192.168.1.14
|
||||||
nozoscip = 127.0.0.1
|
nozoscip = 127.0.0.1
|
||||||
oscserverip = 127.0.0.1
|
oscserverip = 127.0.0.1
|
||||||
autostart = artnet
|
autostart = artnet
|
||||||
@ -10,23 +10,22 @@ wstype = ws
|
|||||||
wsport = 9001
|
wsport = 9001
|
||||||
|
|
||||||
[laser0]
|
[laser0]
|
||||||
dac_family = extern_cmd
|
|
||||||
cmd = ./tracers/lj_rust/lj_rust ./tracers/lj_rust/settings.toml
|
|
||||||
color = -1
|
color = -1
|
||||||
type = DS1000
|
type = LOCAL
|
||||||
ip = 192.168.1.35
|
dac_family = etherdream
|
||||||
kpps = 25000
|
ip = 127.0.0.1
|
||||||
|
kpps = 10000
|
||||||
|
centerx = 7.0
|
||||||
|
centery = 61.0
|
||||||
|
zoomx = 312.0
|
||||||
|
zoomy = 1039.0
|
||||||
|
sizex = 32000.0
|
||||||
|
sizey = 32000.0
|
||||||
|
finangle = -0.02263757042605427
|
||||||
intens = 255.0
|
intens = 255.0
|
||||||
red = 100
|
red = 100
|
||||||
green = 100
|
green = 100
|
||||||
blue = 100
|
blue = 100
|
||||||
centerx = -21504.0
|
|
||||||
centery = 21504.0
|
|
||||||
zoomx = 8.90625
|
|
||||||
zoomy = 20.671875
|
|
||||||
sizex = 32000.0
|
|
||||||
sizey = 32000.0
|
|
||||||
finangle = 0.0
|
|
||||||
swapx = -1
|
swapx = -1
|
||||||
swapy = -1
|
swapy = -1
|
||||||
lsteps = [ (1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)]
|
lsteps = [ (1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)]
|
||||||
|
0
configure.py
Executable file → Normal file
0
configure.py
Executable file → Normal file
@ -103,7 +103,6 @@ from libs3 import settings, plugins, homographyp,log
|
|||||||
r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0)
|
r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0)
|
||||||
#r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0, password='-+F816Y+-')
|
#r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0, password='-+F816Y+-')
|
||||||
|
|
||||||
workers = []
|
|
||||||
|
|
||||||
GenericCommands = ["start", "align", "ljclient", "scene", "addest", "deldest", "dest", "clientnumber", "vcvrack", "fft", "mitraille", "faceosc", "midigen", "viewgen", "audiogen", "noteon", "cc", "ljpong", "ljwars", "mouse", "emergency", "simu", "status", "run", "nozoid", "planet", "live", "words", "ai", "bank0", "pose", "lj", "cycl", "glyph", "pong", "maxw", "custom1", "square", "regen", "trckr", "aurora", "line1", "ForwardUI", "settings", "debug", "pl", "plugins"]
|
GenericCommands = ["start", "align", "ljclient", "scene", "addest", "deldest", "dest", "clientnumber", "vcvrack", "fft", "mitraille", "faceosc", "midigen", "viewgen", "audiogen", "noteon", "cc", "ljpong", "ljwars", "mouse", "emergency", "simu", "status", "run", "nozoid", "planet", "live", "words", "ai", "bank0", "pose", "lj", "cycl", "glyph", "pong", "maxw", "custom1", "square", "regen", "trckr", "aurora", "line1", "ForwardUI", "settings", "debug", "pl", "plugins"]
|
||||||
|
|
||||||
@ -727,23 +726,18 @@ def LJautokill():
|
|||||||
print('Shutdown order for tracer '+str(laser), 9)
|
print('Shutdown order for tracer '+str(laser), 9)
|
||||||
r.set('/order/'+str(laser), 9)
|
r.set('/order/'+str(laser), 9)
|
||||||
|
|
||||||
for (n,dac_worker) in enumerate(workers):
|
|
||||||
log.warn(f'Entering tracer{n} ...')
|
|
||||||
dac_worker.join()
|
|
||||||
|
|
||||||
lasernumber= gstt.LaserNumber -1
|
lasernumber= gstt.LaserNumber -1
|
||||||
# log.warn("Ending tracer0...")
|
log.warn("Ending tracer0...")
|
||||||
# worker0.join()
|
worker0.join()
|
||||||
# if lasernumber >0:
|
if lasernumber >0:
|
||||||
# log.warn("Ending tracer1...")
|
log.warn("Ending tracer1...")
|
||||||
# worker1.join()
|
worker1.join()
|
||||||
# if lasernumber >1:
|
if lasernumber >1:
|
||||||
# log.warn("Ending tracer2...")
|
log.warn("Ending tracer2...")
|
||||||
# worker2.join()
|
worker2.join()
|
||||||
# if lasernumber >2:
|
if lasernumber >2:
|
||||||
# log.warn("Ending tracer3...")
|
log.warn("Ending tracer3...")
|
||||||
# worker3.join()
|
worker3.join()
|
||||||
|
|
||||||
|
|
||||||
log.warn("Laser feedbacks resetting...")
|
log.warn("Laser feedbacks resetting...")
|
||||||
for laserid in range(0,lasernumber+1):
|
for laserid in range(0,lasernumber+1):
|
||||||
|
@ -65,7 +65,6 @@ dacnumber = 0
|
|||||||
kpps = [25000,25000,25000,25000]
|
kpps = [25000,25000,25000,25000]
|
||||||
lasertype = ["LOCAL","LOCAL","LOCAL","LOCAL"]
|
lasertype = ["LOCAL","LOCAL","LOCAL","LOCAL"]
|
||||||
dacfamily = ["etherdream","etherdream","etherdream","etherdream"]
|
dacfamily = ["etherdream","etherdream","etherdream","etherdream"]
|
||||||
cmd = [None,None,None,None]
|
|
||||||
intensity = [-1,-1,-1,-1]
|
intensity = [-1,-1,-1,-1]
|
||||||
intens = [-1,-1,-1,-1]
|
intens = [-1,-1,-1,-1]
|
||||||
red = [100,100,100,100]
|
red = [100,100,100,100]
|
||||||
|
@ -32,8 +32,6 @@ def Write():
|
|||||||
config.set(laser, 'ip', str(gstt.lasersIPS[i]))
|
config.set(laser, 'ip', str(gstt.lasersIPS[i]))
|
||||||
config.set(laser, 'type', str(gstt.lasertype[i]))
|
config.set(laser, 'type', str(gstt.lasertype[i]))
|
||||||
config.set(laser, 'dac_family', str(gstt.dacfamily[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, 'kpps', str(gstt.kpps[i]))
|
||||||
config.set(laser, 'intens', str(gstt.intens[i]))
|
config.set(laser, 'intens', str(gstt.intens[i]))
|
||||||
config.set(laser, 'red', str(gstt.red[i]))
|
config.set(laser, 'red', str(gstt.red[i]))
|
||||||
@ -71,8 +69,6 @@ def Read():
|
|||||||
gstt.lasersIPS[i]= config.get(laser, 'ip')
|
gstt.lasersIPS[i]= config.get(laser, 'ip')
|
||||||
gstt.lasertype[i]= config.get(laser, 'type')
|
gstt.lasertype[i]= config.get(laser, 'type')
|
||||||
gstt.dacfamily[i] = config.get(laser, 'dac_family')
|
gstt.dacfamily[i] = config.get(laser, 'dac_family')
|
||||||
if gstt.dacfamily[i] == "extern_cmd":
|
|
||||||
gstt.cmd[i] = config.get(laser, 'cmd')
|
|
||||||
gstt.kpps[i] = config.getint(laser, 'kpps')
|
gstt.kpps[i] = config.getint(laser, 'kpps')
|
||||||
gstt.intens[i] = config.getfloat(laser, 'intens')
|
gstt.intens[i] = config.getfloat(laser, 'intens')
|
||||||
gstt.red[i] = config.getint(laser, 'red')
|
gstt.red[i] = config.getint(laser, 'red')
|
||||||
@ -94,3 +90,4 @@ def Read():
|
|||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(gstt.ConfigName)
|
config.read(gstt.ConfigName)
|
||||||
|
|
||||||
|
86
main.py
86
main.py
@ -82,6 +82,7 @@ elif os_name == "Darwin": # macOS
|
|||||||
elif os_name == "Linux":
|
elif os_name == "Linux":
|
||||||
print("Plateform: Linux")
|
print("Plateform: Linux")
|
||||||
|
|
||||||
|
|
||||||
def dac_process(number, pl):
|
def dac_process(number, pl):
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@ -89,7 +90,6 @@ def dac_process(number, pl):
|
|||||||
|
|
||||||
print("Starting dac process", number)
|
print("Starting dac process", number)
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
d = tracer.DAC(number,pl)
|
d = tracer.DAC(number,pl)
|
||||||
@ -325,7 +325,7 @@ def osc_thread():
|
|||||||
#
|
#
|
||||||
def get_Host_name_IP():
|
def get_Host_name_IP():
|
||||||
try:
|
try:
|
||||||
host_name = "localhost" #socket.gethostname()
|
host_name = socket.gethostname()
|
||||||
host_ip = socket.gethostbyname(host_name)
|
host_ip = socket.gethostbyname(host_name)
|
||||||
print("Hostname : ", host_name)
|
print("Hostname : ", host_name)
|
||||||
print("IP : ", host_ip)
|
print("IP : ", host_ip)
|
||||||
@ -480,32 +480,10 @@ for sceneid in range(0,gstt.MaxScenes+1):
|
|||||||
r.set('/order/'+str(laserid), 0)
|
r.set('/order/'+str(laserid), 0)
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# For tracer as external command
|
|
||||||
#
|
|
||||||
import subprocess
|
|
||||||
import select
|
|
||||||
def spawn(cmd):
|
|
||||||
p = subprocess.Popen(cmd,
|
|
||||||
shell=True,
|
|
||||||
stdin=subprocess.DEVNULL,
|
|
||||||
stdout=subprocess.DEVNULL,
|
|
||||||
stderr=subprocess.DEVNULL)
|
|
||||||
return p
|
|
||||||
#
|
#
|
||||||
# Starts one DAC process per requested Laser
|
# Starts one DAC process per requested Laser
|
||||||
#
|
#
|
||||||
|
|
||||||
import signal
|
|
||||||
import sys
|
|
||||||
|
|
||||||
def signal_handler(sig, frame):
|
|
||||||
print('You pressed Ctrl+C!')
|
|
||||||
commands.LJautokill()
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
# Bug in 3.8.4 MacOS default multiprocessing start method is spawn. Spawn doesn't work properly
|
# Bug in 3.8.4 MacOS default multiprocessing start method is spawn. Spawn doesn't work properly
|
||||||
@ -520,44 +498,33 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
log.infog("Resquested DACs mode")
|
log.infog("Resquested DACs mode")
|
||||||
|
|
||||||
#lasernumber = gstt.LaserNumber -1
|
lasernumber = gstt.LaserNumber -1
|
||||||
print("LaserNumber = ", gstt.LaserNumber)
|
print("LaserNumber = ", gstt.LaserNumber)
|
||||||
log.info("Starting "+str(gstt.LaserNumber) + " DACs process...")
|
log.info("Starting "+str(gstt.LaserNumber) + " DACs process...")
|
||||||
|
|
||||||
commands.workers = []
|
# Launch one process (a tracer3 instance) by laser
|
||||||
for lasernumber in range(0,gstt.LaserNumber):
|
dac_worker0= Process(target=dac_process, args=(0,0,))
|
||||||
# Launch one process (a tracer3 instance) by laser
|
dac_worker0.start()
|
||||||
if gstt.dacfamily[lasernumber] == "extern_cmd":
|
commands.worker0 = dac_worker0
|
||||||
dac_worker = spawn(gstt.cmd[lasernumber])
|
print("Tracer 0 : name", dac_worker0.name , "pid", dac_worker0.pid )
|
||||||
dac_worker.name = f'ExternCmd{lasernumber}'
|
|
||||||
dac_worker.join = dac_worker.wait
|
|
||||||
else:
|
|
||||||
dac_worker= Process(target=dac_process, args=(lasernumber,0,))
|
|
||||||
dac_worker.start()
|
|
||||||
|
|
||||||
#commands.worker0 = dac_worker0 # ???
|
if lasernumber >0:
|
||||||
commands.workers.append(dac_worker)
|
dac_worker1= Process(target=dac_process, args=(1,0,))
|
||||||
print(f"Tracer {lasernumber} : name", dac_worker.name , "pid", dac_worker.pid )
|
commands.worker1 = dac_worker1
|
||||||
print("DAC Family:", gstt.dacfamily[lasernumber]);
|
print("Tracer 1 : name", dac_worker1.name , "pid", dac_worker1.pid )
|
||||||
|
dac_worker1.start()
|
||||||
|
|
||||||
# if lasernumber >0:
|
if lasernumber >1:
|
||||||
|
dac_worker2= Process(target=dac_process, args=(2,0,))
|
||||||
|
dac_worker2.start()
|
||||||
|
commands.worker2 = dac_worker2
|
||||||
|
print("Tracer 2 : name", dac_worker2.name , "pid", dac_worker2.pid )
|
||||||
|
|
||||||
# dac_worker1= Process(target=dac_process, args=(1,0,))
|
if lasernumber >2:
|
||||||
# commands.worker1 = dac_worker1
|
dac_worker3= Process(target=dac_process, args=(3,0,))
|
||||||
# print("Tracer 1 : name", dac_worker1.name , "pid", dac_worker1.pid )
|
print("Tracer 3 : name", dac_worker3.name , "pid", dac_worker3.pid )
|
||||||
# dac_worker1.start()
|
commands.worker3 = dac_worker3
|
||||||
|
dac_worker3.start()
|
||||||
# if lasernumber >1:
|
|
||||||
# dac_worker2= Process(target=dac_process, args=(2,0,))
|
|
||||||
# dac_worker2.start()
|
|
||||||
# commands.worker2 = dac_worker2
|
|
||||||
# print("Tracer 2 : name", dac_worker2.name , "pid", dac_worker2.pid )
|
|
||||||
|
|
||||||
# if lasernumber >2:
|
|
||||||
# dac_worker3= Process(target=dac_process, args=(3,0,))
|
|
||||||
# print("Tracer 3 : name", dac_worker3.name , "pid", dac_worker3.pid )
|
|
||||||
# commands.worker3 = dac_worker3
|
|
||||||
# dac_worker3.start()
|
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -575,8 +542,8 @@ if __name__ == '__main__':
|
|||||||
print("python3 configure.py")
|
print("python3 configure.py")
|
||||||
log.err('Exiting...')
|
log.err('Exiting...')
|
||||||
#gstt.wwwIP = hostIP
|
#gstt.wwwIP = hostIP
|
||||||
#commands.LJautokill()
|
commands.LJautokill()
|
||||||
#sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# Launch OSC thread listening to oscserver
|
# Launch OSC thread listening to oscserver
|
||||||
print("OSC server to receive messages (UI,...)")
|
print("OSC server to receive messages (UI,...)")
|
||||||
@ -645,3 +612,6 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
random_points = [(300.0+random.randint(-100, 100), 200.0+random.randint(-100, 100), 0), (500.0+random.randint(-100, 100), 200.0+random.randint(-100, 100), 65280), (500.0+random.randint(-100, 100), 400.0+random.randint(-100, 100), 65280), (300.0+random.randint(-100, 100), 400.0+random.randint(-100, 100), 65280), (300.0+random.randint(-100, 100), 200.0+random.randint(-100, 100), 65280)]
|
random_points = [(300.0+random.randint(-100, 100), 200.0+random.randint(-100, 100), 0), (500.0+random.randint(-100, 100), 200.0+random.randint(-100, 100), 65280), (500.0+random.randint(-100, 100), 400.0+random.randint(-100, 100), 65280), (300.0+random.randint(-100, 100), 400.0+random.randint(-100, 100), 65280), (300.0+random.randint(-100, 100), 200.0+random.randint(-100, 100), 65280)]
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user