|
@@ -1,5 +1,9 @@
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
+def cb_dummy(options={}):
|
|
|
+ print("cb_dummy",options)
|
|
|
+ return options
|
|
|
+
|
|
|
def ValueBuffer_create_data(val=2,_min=0,_max=255,_inc=1,cycle=[0,127,255]):
|
|
|
data = {}
|
|
|
data["value"] = val
|
|
@@ -12,6 +16,7 @@ def ValueBuffer_create_data(val=2,_min=0,_max=255,_inc=1,cycle=[0,127,255]):
|
|
|
data["cycle_idx"] = 0
|
|
|
data["format"] = "<format>{}"
|
|
|
data["name"] = "<name>"
|
|
|
+ data["callback"] = cb_dummy
|
|
|
return data
|
|
|
|
|
|
def Buffer_clean(data,default={}):
|
|
@@ -22,7 +27,7 @@ def Buffer_clean(data,default={}):
|
|
|
for k,v in a.items():
|
|
|
#print(" ",id(data),[k,v])
|
|
|
if k not in data:
|
|
|
- print("ValueBuffer_clear key does not exist; adding key ",[k]," !")
|
|
|
+ print(" ValueBuffer_clear key does not exist; adding key ",[k]," !")
|
|
|
data[k] = v
|
|
|
|
|
|
def ValueBuffer_clean(data):
|
|
@@ -265,6 +270,7 @@ class OptionBuffer():# wrap function to object
|
|
|
def dec(self):
|
|
|
return OptionBuffer_dec(self.data)
|
|
|
def val(self,val=None):
|
|
|
+ #self.data["callback"]({"val":val})
|
|
|
return OptionBuffer_val(self.data,val=val)
|
|
|
def set_init(self,val):
|
|
|
return OptionBuffer_set_init(self.data,val)
|
|
@@ -277,6 +283,7 @@ class Elem_Container():
|
|
|
self.elem = {}
|
|
|
|
|
|
ATTR_GRP = {}
|
|
|
+ATTR_GRP[" "] = [" "]
|
|
|
ATTR_GRP["POS"] = ["PAN","TILT"]
|
|
|
ATTR_GRP["RGB"] = ["RED","GREEN","BLUE","AMBER","WHITE"]
|
|
|
#ATTR_GRP["CMY"] = ["CYAN","MAGENTA","YELLOW"]
|
|
@@ -286,7 +293,7 @@ def Optionbuffer_create_ATTR_GRP(val=""):
|
|
|
options = list(ATTR_GRP.keys())
|
|
|
return OptionBuffer(val,options)
|
|
|
|
|
|
-FX_FUNC = ["SIN","COS","RAMP","RAMP2","FD","ON","STATIC"]
|
|
|
+FX_FUNC = ["SIN","COS","RAMP","RAMP2","FD","ON","STATIC","-","255"]
|
|
|
def Optionbuffer_create_FX_FUNC(val=""):
|
|
|
options = FX_FUNC
|
|
|
return OptionBuffer(val,options)
|
|
@@ -303,9 +310,9 @@ def Optionbuffer_create_ATTR(attr_grp="",val=""):
|
|
|
ob.reset()
|
|
|
return ob
|
|
|
|
|
|
-fx_func_grp = Optionbuffer_create_ATTR_GRP()
|
|
|
-fx_func_attr = Optionbuffer_create_ATTR("POS")
|
|
|
-fx_func_func = Optionbuffer_create_FX_FUNC()
|
|
|
+#fx_func_grp = Optionbuffer_create_ATTR_GRP()
|
|
|
+#fx_func_attr = Optionbuffer_create_ATTR("POS")
|
|
|
+#fx_func_func = Optionbuffer_create_FX_FUNC()
|
|
|
|
|
|
fx_prm_main = {}
|
|
|
fx_prm_move = {"SIZE":40,"SPEED":8,"OFFSET":100,"BASE":"0","START":0,"MODE":0,"MO":0,"DIR":1,"INVERT":0,"SHUFFLE":0,"WING":2,"WIDTH":100}
|
|
@@ -362,11 +369,24 @@ for i,f in fx3_grid_cfg.items():
|
|
|
k="{}{}".format(i,j+1)
|
|
|
x.append(k)
|
|
|
fx3_grid[k] = f()
|
|
|
+ fx3_grid[k].data["name"] = k #f()
|
|
|
|
|
|
x.append("\n")
|
|
|
print(":",x)
|
|
|
fx3.labels.extend(x)
|
|
|
|
|
|
+def change_grp(name,val):
|
|
|
+ t,i = name.split(":",1)
|
|
|
+ print("--- change_grp",name,val,t,i)
|
|
|
+ k2 = "ATTR:"+i
|
|
|
+ print("change_grp:",(name,val),(t,i),k2,val)
|
|
|
+
|
|
|
+ fx3_grid[k2] = Optionbuffer_create_ATTR(val) #,val)
|
|
|
+ fx3_grid[k2].data["name"] = "ATTR:"+i
|
|
|
+ #fx3_grid[k2].val(val)
|
|
|
+ print(" ",k2,fx3_grid[k2].data)
|
|
|
+
|
|
|
+
|
|
|
#print("__ "*22)
|
|
|
#fx3_grid["GRP:1"].val("RGB")
|
|
|
#print([fx3_grid["GRP:1"].val()])
|
|
@@ -378,10 +398,10 @@ for i,f in fx3_grid_cfg.items():
|
|
|
fx3.labels.extend([" "," "," "," "," ","\n"])
|
|
|
fx3.labels.extend(["\n"])
|
|
|
fx3.labels.extend([" ","START","STOP","OFF"," ","\n"])
|
|
|
-fx3.labels.extend(["SPEED:","SLOW","MID","FAST","TURBO","\n"])
|
|
|
-fx3.labels.extend(["SIZE:","MINI","SMALL","NORMAL","BIG","\n"])
|
|
|
fx3.labels.extend([" ","CIRCLE","PAN","TILT","FLAY","\n"])
|
|
|
fx3.labels.extend([" ","RED","GREEN","BLUE","MAGENTA","\n"])
|
|
|
+fx3.labels.extend(["SIZE:","MINI","SMALL","NORMAL","BIG","\n"])
|
|
|
+fx3.labels.extend(["SPEED:","SLOW","MID","FAST","TURBO","\n"])
|
|
|
|
|
|
fx_cfg = Elem_Container()
|
|
|
fx_cfg.labels =[
|