Bladeren bron

refactor: Base ... _fixture_load... , Fixture-Edior error !

micha 1 jaar geleden
bovenliggende
commit
ffe8a53c79
2 gewijzigde bestanden met toevoegingen van 253 en 216 verwijderingen
  1. 207 187
      _LibreLightDesk.py
  2. 46 29
      tkgui/GUI.py

+ 207 - 187
_LibreLightDesk.py

@@ -141,7 +141,7 @@ try:
     cprint("config read")
     for line in lines:
         line=line.strip()
-        cprint("- config:",line)
+        print("   config:",line)
         row = json.loads(line) 
         _config.append(row)
 
@@ -150,7 +150,7 @@ except Exception as e:
 
 try: 
     for row in _config:
-        cprint("config:",row)
+        #print("   config:",row)
         if "POS_LEFT" in row:
            _POS_LEFT = int(row["POS_LEFT"]) 
         if "POS_TOP" in row:
@@ -317,10 +317,11 @@ def set_exec_fader(nr,val,label="",color=""):
    
 
 def set_exec_fader_all():
+    print()
     cprint( "set_exec_fader_all()",color="green")
     for nr in range(10):
         _label = PRESETS.label_presets[nr+80] # = label
-        print("_label",_label)
+        print("  _label",_label)
         set_exec_fader(nr,0,label=_label) 
         set_exec_fader_cfg(nr,0,label=_label)
 
@@ -417,7 +418,7 @@ class MC():
         index = self.mc.get("index")
         if index:
             for i in index:
-                cprint("-- key",i)
+                print("  key",i)
 
         self.fader_map = []
         for i in range(30+1):
@@ -431,7 +432,7 @@ class MC():
 
             for i,line in enumerate(lines):
                 jdata = json.loads(line)
-                cprint("-- fader_map ->>",i,jdata)
+                print("  fader_map ->>",i,jdata)
                 self.fader_map[i] = jdata
 
         except Exception as e:
@@ -1540,6 +1541,7 @@ def split_window_position(lines,_filter=""):
 
 
 def load_window_position(_filter=""):
+    print()
     global window_list_buffer
     cprint()
     cprint("load_window_position",[_filter])
@@ -1564,7 +1566,7 @@ def load_window_position(_filter=""):
 
             w = data[name][2] 
 
-            cprint("- set_win_pos","filter:",[_filter],"Name: {:<20}".format(name),w,win)
+            print("  set_win_pos","filter:",[_filter],"Name: {:<20}".format(name),w,win)
             try:
                 win.tk.geometry(w)
             except Exception as e:
@@ -1633,9 +1635,9 @@ class Xevent():
                 class cb():
                     def __init__(self,name=""):
                         self.name=name
-                        cprint("cb",name)
+                        cprint("   LOAD-SHOW.init",name)
                     def cb(self,event=None,**args):
-                        cprint("cdb",self.name,event,args)
+                        cprint("   LOAD-SHOW.cdb",self.name,event,args)
                         if self.name != "<exit>":
                             cprint("-----------------------:")
                             LOAD_SHOW_AND_RESTAT(self.name).cb()
@@ -1644,7 +1646,8 @@ class Xevent():
 
                 pw = PopupList(name,cb=cb)
                 frame = pw.sframe(line1=line1,line2=line2)
-                r = _load_show_list(frame,cb=cb)
+                #r = _load_show_list(frame,cb=cb)
+                r = frame_of_show_list(frame,cb=cb)
 
     
                 #self.elem["bg"] = "red"# "lightgrey"
@@ -1994,7 +1997,104 @@ class Element():
     def set(self,key,val):
         self.__data[key] = val
 
+def _fixture_decode_sav_line(line):
+    out = None
+
+    if line.count("\t") < 2:
+        cprint("Error line.count('\\t') < 2  (is:{})".format(line.count("\t")),color="red",end=" ")
+        cprint("file:{}".format(xfname),color="red")
+    else:
+        key,label,rdata = line.split("\t",2)
+        jdata = json.loads(rdata,object_pairs_hook=OrderedDict)
+        #out = [key,label,rdata]
+        key = int(key)
+
+        out = [key,label,jdata]
+        #print(line)
+
+    #if not out:
+    #print(line)
+    #sys.exit()
+    return out
+
+def _fixture_repair_nr0(jdata):
+    nrnull = 0
+    if "ATTRIBUT" in jdata:  # translate old FIXTURES.fixtures start with 0 to 1          
+        if nrnull:
+            cprint("DMX NR IS NULL",attr,"CHANGE +1")
+            for attr in jdata["ATTRIBUT"]:
+                if "NR" in jdata["ATTRIBUT"][attr]:
+                    nr = jdata["ATTRIBUT"][attr]["NR"]
+                    if nr >= 0:
+                        jdata["ATTRIBUT"][attr]["NR"] +=1
+    #return jdata
         
+def _clean_path(fpath):
+    _path=[]
+    for i in fpath:
+        fpath = fpath.replace(" ","_")
+        if i in string.ascii_letters+string.digits+"äöüßÖÄÜ_-":
+            _path.append(i)
+    path = "".join(_path)
+    return path
+
+def _read_init_txt(show_path):
+    fname = show_path+"init.txt"
+    show_name = None
+    msg = ""
+
+    if not os.path.isfile( fname ):
+        msg = "_read_init_txt Errror: " +fname +"\n NOT FOUND !"
+        return [None,msg]
+
+    try:
+        f = open(fname,"r")
+        for line in f.readlines():
+            line = line.strip()
+            print("  init.txt:",[line])
+            if line.startswith("#"):
+                continue
+            if not line:
+                continue
+
+            show_name = line
+            show_name = show_name.replace(".","")
+            show_name = show_name.replace("\\","")
+            show_name = show_name.replace("/","")
+    except Exception as e:
+        cprint("show name exception",color="red")
+        msg="read_init_txt Error:{}".format(e)
+    finally:
+        f.close()
+
+    return [show_name,msg]
+
+
+def _listdir(show_path):
+    #self._check()
+    show_list =  list(os.listdir( show_path ))
+    out = []
+    for fname in show_list:
+        #print(fname)
+        ctime = os.path.getmtime(show_path+fname)
+        ctime = time.strftime("%Y-%m-%d %X",  time.localtime(ctime)) #1650748726.6604707))
+        try:
+            mtime = os.path.getmtime(show_path+fname+"/patch.sav")
+            mtime = time.strftime("%Y-%m-%d %X",  time.localtime(mtime)) #1650748726.6604707))
+        except:
+            mtime = 0
+
+        if mtime:
+            out.append([fname,mtime])#,ctime])
+
+    from operator import itemgetter
+    out=sorted(out, key=itemgetter(1))
+    out.reverse()
+    return out
+
+
+
+
 class Base():
     def __init__(self):
         cprint("Base.init()",color="red")
@@ -2005,22 +2105,12 @@ class Base():
         self.show_path0 = HOME +"/LibreLight/"
         self.show_path  = self.show_path0 
         self.show_path1 = self.show_path0 + "show/"
-        try:
-            f = open(self.show_path+"init.txt","r")
-            for line in f.readlines():
-                #cprint(line)
-                if not line.startswith("#"):
-                    show_name = line.strip()
-                    show_name = show_name.replace(".","")
-                    show_name = show_name.replace("\\","")
-                    show_name = show_name.replace("/","")
-            self.show_name = show_name
-        except Exception as e:
-            cprint("show name exception",color="red")
-            msg="Error Exception:{}".format(e)
+        
+        msg = " X "
+        self.show_name,msg = _read_init_txt(self.show_path)
+        if not self.show_name:
             r=tkinter.messagebox.showwarning(message=msg,parent=None)
-        finally:
-            f.close()
+            sys.exit()
         
         fpath = self.show_path1 +show_name 
         if not os.path.isdir(fpath):
@@ -2071,31 +2161,14 @@ class Base():
             os.mkdir(self.show_path)
         pass
     def _list(self):
-        #self._check()
-        show_list =  list(os.listdir( self.show_path1 ))
-        out = []
-        for fname in show_list:
-            #print(fname)
-            ctime = os.path.getmtime(self.show_path1+fname)
-            ctime = time.strftime("%Y-%m-%d %X",  time.localtime(ctime)) #1650748726.6604707))
-            try:
-                mtime = os.path.getmtime(self.show_path1+fname+"/patch.sav")
-                mtime = time.strftime("%Y-%m-%d %X",  time.localtime(mtime)) #1650748726.6604707))
-            except:
-                mtime = 0
-
-            if mtime:
-                out.append([fname,mtime])#,ctime])
-
-        from operator import itemgetter
-        out=sorted(out, key=itemgetter(1))
-        out.reverse()
+        cprint("BASE._list()")
+        out = _listdir(self.show_path1)
         return out
 
     def _load(self,filename):
         xfname = self.show_path+"/"+str(filename)+".sav"
         cprint("load",xfname)
-
+        lines = []
         try:
             f = open(xfname,"r")
             lines = f.readlines()
@@ -2110,43 +2183,23 @@ class Base():
         labels = OrderedDict()
         i=0
         for line in lines:
-            if line.count("\t") < 2:
-                cprint("Error line.count('\\t') < 2  (is:{})".format(line.count("\t")),color="red",end=" ")
-                cprint("file:{}".format(xfname),color="red")
-                continue
-            key,label,rdata = line.split("\t",2)
-            print(line)
-            key = int(key)
+            r = _fixture_decode_sav_line(line)
 
-            jdata = json.loads(rdata,object_pairs_hook=OrderedDict)
-            nrnull = 0
+            if not r:
+                continue
 
-            if "ATTRIBUT" in jdata:  # translate old FIXTURES.fixtures start with 0 to 1          
+            key,label,jdata = r
 
-                if nrnull:
-                    cprint("DMX NR IS NULL",attr,"CHANGE +1")
-                    for attr in jdata["ATTRIBUT"]:
-                        if "NR" in jdata["ATTRIBUT"][attr]:
-                            nr = jdata["ATTRIBUT"][attr]["NR"]
-                            if nr >= 0:
-                                jdata["ATTRIBUT"][attr]["NR"] +=1
+            _fixture_repair_nr0(jdata)
 
-            data[key] = jdata
+            data[key]   = jdata
             labels[key] = label
             
         return data,labels
 
-    def _clean_path(self,fpath):
-        _path=[]
-        for i in fpath:
-            fpath = fpath.replace(" ","_")
-            if i in string.ascii_letters+string.digits+"äöüßÖÄÜ_-":
-                _path.append(i)
-        path = "".join(_path)
-        return path
 
     def build_path(self,save_as):
-        save_as = self._clean_path(save_as)
+        save_as = _clean_path(save_as)
         path = self.show_path.split("/")
         path = "/".join(path[:-2])
         fpath = path+"/"+save_as
@@ -3002,7 +3055,7 @@ class BaseCallback():
                 print("  TypeError",e)
                 self._cb() 
 
-def _load_show_list(frame,cb=None):
+def frame_of_show_list(frame,cb=None):
     c=0
     r=0
     base = Base()
@@ -3080,20 +3133,55 @@ def online_help(page):
     return _cb 
 
 
-def _import_fixture_list(frame,cb=None,master=None,bg="black"):
-    frame.configure(bg=bg)
-    c=0
-    r=0
-    base = Base()
-    for i in ["source","name","manufacturer","channel's","file","path"]: #,"create"]:
-        b = tk.Label(frame,bg="grey",text=i)
-        b.grid(row=r, column=c, sticky=tk.W) #+tk.E)
-        c+=1
-    r+=1
-    blist = [] #base._list()
 
+def index_fixtures():
+
+    p="/opt/LibreLight/Xdesk/fixtures/"
+    ls = os.listdir(p )
+    ls.sort()
+    for l in ls:
+        b = _parse_fixture_name(l)
+        b.append(p)
+        b.insert(0,"base")
+        blist.append(b)
+
+def _fixture_load_user_list():
+    blist = []
+    try:
+        p = HOME+"/LibreLight/fixtures/"
+        ls = os.listdir(p)
+        ls.sort()
+        for l in ls:
+            b = _parse_fixture_name(l)
+            b.append(p)
+            b.insert(0,"user")
+            blist.append(b)
+    except Exception as e:
+        cprint("Exce 877 ",e)
+    return blist
+
+
+
+def _fixture_load_global_list():
+    blist = []
+    try:
+        p="/opt/LibreLight/Xdesk/fixtures/"
+        ls = os.listdir(p )
+        ls.sort()
+        for l in ls:
+            b = _parse_fixture_name(l)
+            b.append(p)
+            b.insert(0,"base")
+            blist.append(b)
+    except Exception as e:
+        cprint("Exce 878 ",e)
+    return blist
+
+def _fixture_create_import_list():
     path = "/home/user/LibreLight/show"
+    blist = []
     for sname in os.listdir(path):
+        print("   ",sname)
         try:
             fname = path+"/"+sname+"/patch.sav"
             if os.path.isfile(fname):
@@ -3106,82 +3194,46 @@ def _import_fixture_list(frame,cb=None,master=None,bg="black"):
                     line = json.loads(line[2])
                     print(line)
                     name = line["NAME"]
-                    blist.append([name,fname,path])
+                    blist.append([name,fname+":"+name,path])
                     print(":",i,name,fname)
         except Exception as e:
             print("exception",e)
+    return blist
 
-    if not blist:
-        #blist.append(["MAC-500","martin","Demo"])
-        #blist.append(["MAC-2000","martin","Demo"])
-        #blist.append(["MAC-VIPER","martin","Demo"])
-        #blist.append(["SPARX-7","JB","Demo"])
-        #blist.append(["SPARX-11","JB","Demo"])
-        #blist.append(["JB-P6","JB","Demo"])
-        #blist.append(["JB-P7","JB","Demo"])
-        #blist.append(["JB-A7","JB","Demo"])
-        #blist.append(["TMH-12","Eurolight","Demo"])
-        pass
-    for i in range(19):
-        blist.append(["IMPORT-{:02}".format(i),"Eurolight","Import"])
-
-
-    if len(blist) < 30:
-        for i in range(30-len(blist)):
-            blist.append(["{:0>4}".format(len(blist)+i+1),"",""])
-
-
-    if cb is None: 
-        cb = DummyCallback #("load_show_list.cb")
-    
-    _tmp_name = ""
-    _tmp_flag = 0
-    blist=blist[:10]
-    for i in blist:
-        #print(i)
-        if i[0] != _tmp_name:
-            _tmp_flag = "#aaf"
-            if i[0] == "user":
-                _tmp_flag = "#aaf"
-            if i[0] == "base":
-                _tmp_flag = "#0f0"
-
-        c=0
-        for j in i:
-            bg="lightgrey"
-            dbg="lightgrey"
-            if i[1] > time.strftime("%Y-%m-%d %X",  time.localtime(time.time()-3600*4)):
-                dbg = "lightgreen"
-            elif i[1] > time.strftime("%Y-%m-%d %X",  time.localtime(time.time()-3600*24*7)):
-                dbg = "green"
-
-            if _tmp_flag:
-                bg = "{}".format(_tmp_flag)
-
-            if c == 1:
-                if base.show_name == i[0]:
-                    bg="green"
+def _fixture_load_import_list():
+    return _fixture_create_import_list()
+    pass
+    path = HOME+"/LibreLight/fixture.index.json"
+    if not os.path.isfile(path):
+        blist = _fixture_create_import_list()
+        f = open(path,"w")
+        for line in blist:
+            line = json.dumps(line)
+            f.writelines(line)
+        f.close()
 
-                _cb2 = BaseCallback(cb=cb,args={"file":j}).cb
+    blist = []
+    if os.path.isfile(path):
+        f = open(path,"r")
+        lines = f.readlines()
+        f.close()
+        for line in lines:
+            line = line.strip()
+            blist.append(json.loads(line))
 
-                b = tk.Button(frame,text=j,anchor="w",height=1,bg=bg,command=_cb2)
+    return blist
 
-                if base.show_name == i[0]:
-                    b.config(activebackground=bg)
-                b.grid(row=r, column=c, sticky=tk.W+tk.E)
-            else:#ief c > 0:
-                b = tk.Button(frame,text=j,anchor="w",bg=dbg,relief="sunken")
-                b.config(activebackground=dbg)
-                b.grid(row=r, column=c, sticky=tk.W+tk.E)
-            c+=1
-        r+=1
 
+def _fixture_load_data(path,number):
+    data = """1	1	{"DMX": 1, "UNIVERS": 2, "NAME": "VPU_001", "TYPE": "MOVER", "VENDOR": "AYERTON", "ATTRIBUT": {"DIM": {"NR": 1, "MASTER": "0", "MODE": "F", "VALUE": 256, "ACTIVE": 0, "FX": "", "FX2": {}}, "RED": {"NR": 2, "MASTER": "0", "MODE": "F", "VALUE": 0, "ACTIVE": 0, "FX": "", "FX2": {}}, "GREEN": {"NR": 3, "MASTER": "0", "MODE": "F", "VALUE": 0, "ACTIVE": 0, "FX": "", "FX2": {}}, "BLUE": {"NR": 4, "MASTER": "0", "MODE": "F", "VALUE": 255, "ACTIVE": 0, "FX": "", "FX2": {}}, "_ACTIVE": {"NR": 0, "ACTIVE": 0, "VALUE": 0, "FX": "", "FX2": {}}}, "ACTIVE": 0}
+"""
+    return data
 
 
 class _LOAD_FIXTURE_LIST():
     def __init__(self,mode="<name>"):
         self.mode = mode
-
+        self.data = []
     def get(self,frame,cb=None,master=None,bg="black"):
         frame.configure(bg=bg)
         c=0
@@ -3192,54 +3244,22 @@ class _LOAD_FIXTURE_LIST():
             b.grid(row=r, column=c, sticky=tk.W) #+tk.E)
             c+=1
         r+=1
-        blist = [] #base._list()
+
+        blist = self.data
 
         if self.mode == "USER":
-            try:
-                p = HOME+"/LibreLight/fixtures/"
-                ls = os.listdir(p)
-                ls.sort()
-                for l in ls:
-                    b = _parse_fixture_name(l)
-                    b.append(p)
-                    b.insert(0,"user")
-                    blist.append(b)
-            except Exception as e:
-                cprint("Exce 877 ",e)
+            r=_fixture_load_user_list() 
+            blist.extend( r )
 
         elif self.mode == "GLOBAL":
-            try:
-                p="/opt/LibreLight/Xdesk/fixtures/"
-                ls = os.listdir(p )
-                ls.sort()
-                for l in ls:
-                    b = _parse_fixture_name(l)
-                    b.append(p)
-                    b.insert(0,"base")
-                    blist.append(b)
-            except Exception as e:
-                cprint("Exce 878 ",e)
+            r=_fixture_load_global_list() 
+            blist.extend( r )
 
         elif self.mode == "IMPORT":
-            path = "/home/user/LibreLight/show"
-            for sname in os.listdir(path):
-                try:
-                    fname = path+"/"+sname+"/patch.sav"
-                    if os.path.isfile(fname):
-                        f = open(fname)
-                        lines = f.readlines()
-                        f.close()
-
-                        for line in lines:
-                            line = line.split("\t")
-                            line = json.loads(line[2])
-                            print(line)
-                            name = line["NAME"]
-                            blist.append([name,fname,path])
-                            print(":",i,name,fname)
-                except Exception as e:
-                    print("exception",e)
+            r=_fixture_load_import_list() 
+            blist.extend( r )
 
+        print("BLIST",blist)
 
         if cb is None: 
             cb = DummyCallback #("load_show_list.cb")

+ 46 - 29
tkgui/GUI.py

@@ -936,7 +936,7 @@ class GUI_FixtureEditor():
                     frameS = tk.Frame(self.frame,bg="#a0aadd",width=width,border=2)
                 self.c=0
 
-            e= ELEM_FADER(frameS,nr=j+1,cb=self._cb)
+            e= ELEM_FADER(frameS,nr=j+1,cb=self._cb,fader_cb=self._fader_cb)
             e.pack()
             #e.attr["bg"] = "red"
             self.fader_elem.append(e)
@@ -944,10 +944,28 @@ class GUI_FixtureEditor():
             frameS.pack(fill=tk.X, side=tk.TOP)
             c+=1
 
+    def _fader_cb(self,arg,name="<name>",**args):
+        print("   FixtureEditor._cb",args,arg)
+        #print("    ",name,"_cb.args >>",args,arg[1:])
+        self.count_ch()
+    
+        try:
+            a1 = arg #arg[2]
+            nr = args["nr"] #.nr
+            j=[]
+            jdata = {'VALUE': int(a1), 'args': [] , 'FADE': 0,'DMX': str(nr)}
+            print("   ",jdata)
+            j.append(jdata)
+            jclient_send(j)
+        except Exception as e:
+            print(arg,args)
+            print(e)
+
     def _cb(self,arg,name="<name>",**args):
-        print(self,"_cb")
-        print(name,"_cb.args >>",arg,args)
+        print(" FixtureEditor._cb")
+        print(" ",name,"_cb.args >>",args,arg[1:])
         self.count_ch()
+    
 
     def count_ch(self):
         #e._set_attr( "---")
@@ -1013,6 +1031,8 @@ class GUI_FixtureEditor():
         self.pw = _M.PopupList(name,width=600,cb=cb,left=_M._POS_LEFT+620,bg="#333")
         frame = self.pw.sframe(line1=line1,line2=line2) #,line3=line3)
 
+        tmp = _M._LOAD_FIXTURE_LIST(mode=mode)
+
         def cb(**args):
             print("open_fixture_list")
             self._cb(args,name="open_fixture_list") 
@@ -1021,10 +1041,11 @@ class GUI_FixtureEditor():
             #self.load_EMPTY()
             if mode == "IMPORT":
                 self.load_MH()
+                #print(tmp)
+                print(len(tmp.data))
             else:
                 self.load_DIM()
 
-        tmp = _M._LOAD_FIXTURE_LIST(mode=mode)
         r=tmp.get(frame,cb=cb,master=self,bg="#333")
 
     def close_fixture_list(self):
@@ -1208,15 +1229,11 @@ class ELEM_FADER():
         frameS.pack(fill=tk.Y, side=tk.LEFT)
         self.frame=frameS
 
-    def event(self,a1="",a2=""):
-        if self._fader_cb is not None:
+    def fader_event(self,a1="",a2=""):
+        if self._fader_cb:
             self._fader_cb(a1,a2,nr=self.nr)
-        else:
-            #print(self,"event",[self.nr,a1,a2])
-            j=[]
-            jdata = {'VALUE': int(a1), 'args': [] , 'FADE': 0,'DMX': str(self.nr)}
-            j.append(jdata)
-            jclient_send(j)
+
+    def event(self,a1="",a2=""):
         if self._cb:
             self._cb([self,"event",a1,a2])
 
@@ -1281,7 +1298,7 @@ class ELEM_FADER():
         j=0
         self.font8 = ("FreeSans",8)
         frameS=self.frame
-        self.b = tk.Scale(frameS,bg="lightblue", width=28,from_=from_,to=to,command=self.event)
+        self.b = tk.Scale(frameS,bg="lightblue", width=28,from_=from_,to=to,command=self.fader_event)
         self.b.pack(fill=tk.Y, side=tk.TOP)
         if init is not None:
             self.b.set(init)
@@ -1338,15 +1355,15 @@ class EXEC_FADER():
         frameS.pack(fill=tk.Y, side=tk.LEFT)
         self.frame=frameS
 
-    def event(self,a1="",a2=""):
-        print(self,"event",[self.nr,a1,a2],self.label["text"],self.attr["text"],self._fader_cb)
-        if self._fader_cb is not None:
+    def fader_event(self,a1="",a2=""):
+        print("   EXEC_FADER.fader_event",[self.nr,a1,a2],self.label["text"],self.attr["text"])
+        if self._fader_cb:
             self._fader_cb(a1,a2,nr=self.nr)
-        #else:
-        #    j=[]
-        #    jdata = {'VALUE': int(a1), 'args': [] , 'FADE': 0,'DMX': str(self.nr)}
-        #    j.append(jdata)
-        #    jclient_send(j)
+
+    def event(self,a1="",a2=""):
+        print("   EXEC_FADER.event",[self.nr,a1,a2],self.label["text"],self.attr["text"])
+        if self._cb:
+            self._cb(a1,a2,nr=self.nr)
 
     def set_attr(self,_event=None):
         txt= self.attr["text"]
@@ -1393,7 +1410,7 @@ class EXEC_FADER():
 
     def go(self,event=None,X=None,Y=None):
         print(self,"go()",event,self.attr["text"])
-        print(dir(event))
+        #print(dir(event))
         print(event.num,event.state,event.type)
         nr = self.id+80
         if event.state > 0:
@@ -1412,7 +1429,7 @@ class EXEC_FADER():
         j=0
         self.font8 = ("FreeSans",8)
         frameS=self.frame
-        self.b = tk.Scale(frameS,bg="lightblue", width=28,from_=from_,to=to,command=self.event)
+        self.b = tk.Scale(frameS,bg="lightblue", width=28,from_=from_,to=to,command=self.fader_event)
         self.b.pack(fill=tk.Y, side=tk.TOP)
         if init is not None:
             self.b.set(init)
@@ -1536,7 +1553,7 @@ class GUI_ExecWingLayout():
         #    print("ee",ee)
 
     def event_cb(self,a1="",a2="",nr=None,**args):
-        print("event_cb:",nr,a1,a2,args)
+        #print(" ExecWing.event_cb:",nr,a1,a2,args)
         
         nr += 1
         jdata= {"CMD":"X-MASTER","NR":nr,"VALUE":int(a1)}
@@ -1553,7 +1570,7 @@ class GUI_ExecWingLayout():
             jdata["CMD"] = "EXEC-OFFSET-MASTER"
             jdata["NR"] = nr-20 +self.start
 
-        print("event_cb",jdata)
+        print("   ExecWing.event_cb",jdata)
         j = [jdata]
         jclient_send(j)
 
@@ -1662,7 +1679,7 @@ class GUI_MasterWingLayout():
         self._event_redraw()
 
     def event_cb(self,a1="",a2="",nr=None,**args):
-        print("event_cb:",nr,a1,a2,args)
+        print(" MasterWing.event_cb:",nr,a1,a2,args)
         nr += 1
         jdata= {"CMD":"X-MASTER","NR":nr,"VALUE":int(a1)}
         if nr == 1:
@@ -1673,7 +1690,7 @@ class GUI_MasterWingLayout():
             jdata["NR"] = 1 #nr 
 
 
-        print("event_cb",jdata)
+        print(" MasterWing.event_cb",jdata)
         j = [jdata]
         jclient_send(j)
 
@@ -1736,7 +1753,7 @@ class GUI_menu():
         self.draw()
 
     def draw(self):
-        cprint("********************",self,"draw")
+        cprint("***",self,"draw")
         r=0
         c=0
         i=1
@@ -1746,7 +1763,7 @@ class GUI_menu():
         r+=1
         h = 2
         for row in self.data:
-            print("draw",row)
+            print("  draw",row)
             #row = data[i]
             if row["text"] == "---":
                 h=1