Selaa lähdekoodia

fix: Setup width, sdl-fix hidde DIM

micha 1 vuosi sitten
vanhempi
commit
359060879b
3 muutettua tiedostoa jossa 49 lisäystä ja 21 poistoa
  1. 6 1
      _LibreLightDesk.py
  2. 1 1
      tkgui/draw.py
  3. 42 19
      tksdl/fix.py

+ 6 - 1
_LibreLightDesk.py

@@ -5135,9 +5135,14 @@ if __run_main:
 
     name = "SETUP"
     args = {"title":name +" SHOW:"+master.base.show_name,
-                "master":0,"width":435,"height":42,"left":L1+10+W1,"top":TOP,"resize":0}
+                "master":0,"width":445,"height":42,"left":L1+10+W1,"top":TOP,"resize":0}
     args["title"]  = "SETUP SHOW:"+master.base.show_name
     geo = split_window_position(pos_list,name)
+    try:
+        geo["width"] = args["width"]
+        geo["height"] = args["height"]
+    except:pass
+
     if geo:
         args.update(geo)
 

+ 1 - 1
tkgui/draw.py

@@ -621,7 +621,7 @@ def draw_setup(gui,xframe,data):
             b = tk.Button(frame,bg="grey", text=str(comm),width=4,height=2)
             ok = 1
         else: #empty
-            b = tk.Button(frame,bg="grey", text="",width=4,height=2)
+            b = tk.Button(frame,bg="grey", text="",width=5,height=2)
 
         if comm not in gui.commands.elem:
             gui.setup_elem[comm] = b

+ 42 - 19
tksdl/fix.py

@@ -187,8 +187,10 @@ def read_fix(dmx):
                         dmx_x = dmx_start-1+dmx_nr-1
                         dmx_val = dmx[str(univ_start)][dmx_x-1]
                     except:pass
-
-                k2_ATTR["VALUE2"] = dmx_val
+                if type(dmx_val) in [int,float]:
+                    k2_ATTR["VALUE2"] = dmx_val
+                else:
+                    k2_ATTR["VALUE2"] = 0
     return y
 
 def add_dmx(data,dmx):
@@ -256,7 +258,14 @@ while 1:
             iii = 0
             key=y.keys()
             key = list(key)
-            key.sort()
+            key2 = []
+            for k in key:
+                try:
+                    key2.append(int(k))
+                except:
+                    pass
+            key2.sort()
+            key = key2 #.sort()
             if len(btn1_press) == 0:
                 btn1_press = [key[0]]
             rgb = (0x00,0,0xff,0)
@@ -269,7 +278,21 @@ while 1:
 
 
             for k in key:#y.items():
+                k = str(k)
                 v = y[k]
+                attr_count = 0
+                if "ATTRIBUT" in v:
+                    for ATTR in v["ATTRIBUT"]:
+                        if ATTR.startswith("_"):
+                            continue
+                        if ATTR.endswith("-FINE"):
+                            continue
+                        if ATTR == "DIM":
+                            continue
+                        attr_count += 1
+                if attr_count <= 0:
+                    continue
+
                 #print(k,v)
                 x=mc.get(k)
                 cccount = 0
@@ -310,22 +333,24 @@ while 1:
                     bcv_g = 0
                     bcv_b = 0
                     if "RED" in v["ATTRIBUT"]:
-                        bcv_r = v["ATTRIBUT"]["RED"]["VALUE"]
+                        bcv_r = v["ATTRIBUT"]["RED"]["VALUE2"]
                     if "GREEN" in v["ATTRIBUT"]:
-                        bcv_g = v["ATTRIBUT"]["GREEN"]["VALUE"]
+                        bcv_g = v["ATTRIBUT"]["GREEN"]["VALUE2"]
                     if "BLUE" in v["ATTRIBUT"]:
-                        bcv_b = v["ATTRIBUT"]["BLUE"]["VALUE"]
-                        if bcv_r > 255:
-                            bcv_r=255
-                        if bcv_g > 255:
-                            bcv_g=255
-                        if bcv_b > 255:
-                            bcv_b=255
-                    #print([bcv_r,bcv_g,bcv_b])
-                    #bxc.btn1.color  = [255,0,0] #[bcv_r,bcv_g,bcv_b]
+                        bcv_b = v["ATTRIBUT"]["BLUE"]["VALUE2"]
+
+
+                    print( [bcv_r,bcv_g,bcv_b])
+                    if bcv_r > 255:
+                        bcv_r=255
+                    if bcv_g > 255:
+                        bcv_g=255
+                    if bcv_b > 255:
+                        bcv_b=255
+
                     bxc.btn1.color  = [bcv_r,bcv_g,bcv_b]
                     bxc.btn1.color_on  = [bcv_r,bcv_g,bcv_b]
-                    #bxc.btn4.color_on =  [bcv_r,bcv_g,bcv_b]#[0,0,255]
+
                 bxc.pos  = [85,r,20,20]
                 bxc.text = ""
 
@@ -341,10 +366,8 @@ while 1:
                     ATTR = v["ATTRIBUT"]
                     for k2 in ATTR:
                         k2_ATTR = ATTR[k2]
-                        #if k2.endswith("_color"):
-                        #    continue
-                        #if k2.endswith("-FINE"):
-                        #    continue
+                        if k2.endswith("-FINE"):
+                            continue
                         if k2.startswith("_"):
                             continue
                         k3 = k+"-"+k2