Misc
This commit is contained in:
parent
ebe188592e
commit
c55e0aa6c7
6 changed files with 52 additions and 26 deletions
35
main.py
35
main.py
|
|
@ -72,6 +72,16 @@ r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0)
|
|||
# r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0, password='-+F816Y+-')
|
||||
args =[0,0]
|
||||
|
||||
os_name = sys.platform
|
||||
print(f"Système d'exploitation: {os_name}")
|
||||
# Plateformes spécifiques
|
||||
if os_name == "Windows":
|
||||
print("Plateform: Windows")
|
||||
elif os_name == "Darwin": # macOS
|
||||
print("Plateform: macOS")
|
||||
elif os_name == "Linux":
|
||||
print("Plateform: Linux")
|
||||
|
||||
|
||||
def dac_process(number, pl):
|
||||
|
||||
|
|
@ -107,11 +117,10 @@ def dac_process(number, pl):
|
|||
# Init variables
|
||||
#
|
||||
|
||||
print("Start Scene number :",gstt.SceneNumber)
|
||||
|
||||
debug = gstt.debug
|
||||
print("Debug :", debug)
|
||||
|
||||
print("Start Scene number :",gstt.SceneNumber)
|
||||
print("Laser feedbacks resetting...")
|
||||
for laserid in range(0,gstt.LaserNumber):
|
||||
|
||||
|
|
@ -480,7 +489,7 @@ if __name__ == '__main__':
|
|||
# Bug in 3.8.4 MacOS default multiprocessing start method is spawn. Spawn doesn't work properly
|
||||
set_start_method('fork')
|
||||
|
||||
print("gstt.LaserNumber", gstt.LaserNumber)
|
||||
#print("gstt.LaserNumber", gstt.LaserNumber)
|
||||
if gstt.LaserNumber == -1:
|
||||
log.infog("Autodetected DACs mode")
|
||||
commands.DAChecks()
|
||||
|
|
@ -493,7 +502,7 @@ if __name__ == '__main__':
|
|||
print("LaserNumber = ", gstt.LaserNumber)
|
||||
log.info("Starting "+str(gstt.LaserNumber) + " DACs process...")
|
||||
|
||||
# Launch one process (a tracer3 instance) by etherdream
|
||||
# Launch one process (a tracer3 instance) by laser
|
||||
dac_worker0= Process(target=dac_process, args=(0,0,))
|
||||
dac_worker0.start()
|
||||
commands.worker0 = dac_worker0
|
||||
|
|
@ -527,16 +536,18 @@ if __name__ == '__main__':
|
|||
log.info("Starting servers...")
|
||||
hostIP= get_Host_name_IP()
|
||||
if hostIP != gstt.wwwIP:
|
||||
log.err("Host IP is : "+str(hostIP))
|
||||
log.err("wwwIP in LJ.conf : "+str(gstt.wwwIP))
|
||||
log.err("Update LJ.conf : python3 configure.py")
|
||||
print("Host IP is : "+str(hostIP))
|
||||
print("wwwIP in LJ.conf : "+str(gstt.wwwIP))
|
||||
log.err("Host and wwwIP different : you must update Update LJ.conf :")
|
||||
print("python3 configure.py")
|
||||
log.err('Exiting...')
|
||||
#gstt.wwwIP = hostIP
|
||||
commands.LJautokill()
|
||||
sys.exit()
|
||||
|
||||
# Launch OSC thread listening to oscserver
|
||||
print("Launching OSC server to receive messages (UI,...)")
|
||||
print("binding at", oscserverIPin, "port",str(oscserverPORTin))
|
||||
print("OSC server to receive messages (UI,...)")
|
||||
print("binded at", oscserverIPin, "port",str(oscserverPORTin))
|
||||
oscserver.addMsgHandler( "/noteon", commands.NoteOn)
|
||||
oscserver.addMsgHandler( "/scim", commands.Scim)
|
||||
oscserver.addMsgHandler( "/line1", commands.Line1)
|
||||
|
|
@ -547,15 +558,15 @@ if __name__ == '__main__':
|
|||
|
||||
#print()
|
||||
# Websocket listening port
|
||||
print("Listening for WebUI WS...")
|
||||
print("WebUI WS server...")
|
||||
|
||||
hostIP= get_Host_name_IP()
|
||||
#hostIP= get_Host_name_IP()
|
||||
if hostIP != gstt.wwwIP:
|
||||
log.err("wwwIP in config is not set to "+str(hostIP))
|
||||
gstt.wwwIP = hostIP
|
||||
#commands.LJautokill()
|
||||
|
||||
print("binding at", gstt.wwwIP, "port",str(gstt.wsPORT))
|
||||
print("binded at", gstt.wwwIP, "port",str(gstt.wsPORT))
|
||||
wserver = WebsocketServer(gstt.wsPORT,host= gstt.wwwIP)
|
||||
plugins.Init(wserver)
|
||||
wserver.set_fn_new_client(new_client)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue