Bladeren bron

change JCB Admx -44, artnet_loop(single)

micha 4 dagen geleden
bovenliggende
commit
8cce521ae7
2 gewijzigde bestanden met toevoegingen van 9 en 5 verwijderingen
  1. 1 1
      _LibreLightDesk.py
  2. 8 4
      _console.py

+ 1 - 1
_LibreLightDesk.py

@@ -1841,7 +1841,7 @@ def mc_fix_loop():
     c=0
     while 1:
         try:
-            if c >= 1:
+            if c >= 10:
                 c=0
                 for nr in EXEC.val_exec: 
                     get_exec_btn_cfg(nr)

+ 8 - 4
_console.py

@@ -100,7 +100,7 @@ def cprint(*text,color="blue",space=" ",end="\n"):
     print(txt,end=end)
     #return txt
 
-def artnet_loop():
+def artnet_loop(single=0):
     #artnet = ANN.ArtNetNode(to="127.0.0.1",port=6555,univ=12)
     #artnet = ANN.ArtNetNode(to="127.0.0.1",port=6555,univ=0)
     artnet = ANN.ArtNetNode(to="10.10.10.255",univ=0)
@@ -113,6 +113,8 @@ def artnet_loop():
         #artnet._test_frame()
         artnet.next()
         time.sleep(0.001)
+        if single:
+            break
 
 
 class CLOCK():
@@ -150,6 +152,7 @@ class CLOCK_REAL():
         print( "runtime:{:0.2f} tick_timer:{:0.2f} drift:{:0.2f}".format(run_time,tick_time,run_time-tick_time))
     def loop(self):
         pass
+
 #clock = CLOCK()
 clock = CLOCK_REAL()
 if __run_main:
@@ -1299,11 +1302,11 @@ def JCB(data,sock=None): #json client input
 
     c = clock.time() 
     c = float(c)
-    out = {}
 
     process_flash(jdatas)
     calc_jitter(jdatas,t_start)
 
+    out = {}
     for cmds in jdatas:
         #master_fx = MASTER_FX()
         out = _parse_cmds(cmds,clock=c)
@@ -1326,8 +1329,9 @@ def JCB(data,sock=None): #json client input
             line_size += sys.getsizeof(row)
 
             #print("_id",_id)
-            Admx = row["DMXCH"]
-            #print("Admx",Admx)
+            Admx = row.get("DMXCH",-44) #["DMXCH"]
+            if Admx == -44:
+                print("Admx",Admx)
 
             if "attr" in row:
                 if row["attr"] not in attr_count: