|
@@ -16,9 +16,14 @@ import tkinter as Tkinter
|
|
|
import _thread as thread
|
|
|
import datetime
|
|
|
|
|
|
+from cprint import cprint
|
|
|
+
|
|
|
import nodescan
|
|
|
#import nodescan2 #as nodescaner
|
|
|
|
|
|
+_file_path = "/opt/LibreLight/Xdesk/"
|
|
|
+sys.path.insert(0,"/opt/LibreLight/Xdesk/")
|
|
|
+
|
|
|
title = "TK-ArtNet-Nodscaner"
|
|
|
sys.stdout.write("\x1b]2;"+title+"\x07")
|
|
|
|
|
@@ -28,7 +33,7 @@ try:
|
|
|
mc = memcache.Client(['127.0.0.1:11211'], debug=0)
|
|
|
#mc.set("dmx-1", [1]*512)
|
|
|
except Exception as e:
|
|
|
- print("Exception",e)
|
|
|
+ cprint("Exception",e,color="red")
|
|
|
|
|
|
#lock.acquire()
|
|
|
#lock.release()
|
|
@@ -60,7 +65,7 @@ class LOCK_BUF():
|
|
|
node_list = LOCK_BUF() #[]
|
|
|
|
|
|
def fill_form(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
global node_list
|
|
|
clear_form()
|
|
|
|
|
@@ -69,14 +74,14 @@ def fill_form(event=None):
|
|
|
try:
|
|
|
csel = li_nodes.curselection()[0]
|
|
|
except Exception as e:
|
|
|
- print("ERR no node selected in node-list:",e)
|
|
|
+ cprint("ERR no node selected in node-list:",e,color="red")
|
|
|
return 0
|
|
|
print("+++",[csel,len(node_list2)])
|
|
|
|
|
|
try:
|
|
|
sel = int(li_nodes.get(csel).split()[0])-1
|
|
|
except:
|
|
|
- print("ERR no leeding number in Listbox.line" )
|
|
|
+ cprint("ERR no leeding number in Listbox.line" ,color="red")
|
|
|
return 0
|
|
|
|
|
|
if not node_list2:
|
|
@@ -107,14 +112,14 @@ def fill_form(event=None):
|
|
|
else:
|
|
|
univ = ord(node_list2[sel]["SwOut"][0:1])
|
|
|
except Exception as e:
|
|
|
- print("load Exception",e)
|
|
|
+ cprint("load Exception",e,color="red")
|
|
|
MSG["text"] = e
|
|
|
MSG["bg"] = "red"
|
|
|
e_artnet_uni1.insert("end",univ)
|
|
|
|
|
|
|
|
|
def clear_form():
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
e_ip.configure(state='normal')
|
|
|
e_ip.delete("0","end")
|
|
|
e_ip.configure(state='readonly')
|
|
@@ -127,12 +132,12 @@ def clear_form():
|
|
|
|
|
|
|
|
|
def clear_node_list():
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
li_nodes.delete("0","end")
|
|
|
|
|
|
|
|
|
def poll(delay=1,ip=""):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
|
|
|
if not ip:
|
|
|
ip = p_variable.get()
|
|
@@ -143,12 +148,12 @@ def poll(delay=1,ip=""):
|
|
|
fill_form()
|
|
|
|
|
|
def clear(event= None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
clear_node_list()
|
|
|
clear_form()
|
|
|
|
|
|
def poll_loop():
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
time.sleep(1)
|
|
|
while 1:
|
|
|
poll()
|
|
@@ -159,7 +164,7 @@ rx = nodescan.ArtNetNodes()
|
|
|
#rx = nodescan2
|
|
|
|
|
|
def scan():
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
global rx,node_list,old_tick,Scrollbar
|
|
|
print("get node from cache " )
|
|
|
li_nodes.insert("end",str("----"))
|
|
@@ -169,19 +174,20 @@ def scan():
|
|
|
try:
|
|
|
_scan()
|
|
|
except Exception as e:
|
|
|
- print("_scan Exception as",e) #,e.argv)
|
|
|
+ cprint("_scan Exception as",e,color="red") #,e.argv)
|
|
|
MSG["text"] = e
|
|
|
MSG["bg"] = "red"
|
|
|
time.sleep(0.3)
|
|
|
|
|
|
import nodescan2 #as nodescan2
|
|
|
def _scan():
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
#print(sys._getframe().f_code.co_name)
|
|
|
global rx,node_list,old_tick,Scrollbar
|
|
|
ips = nodescan2.os_list_ip() #example
|
|
|
- for i,v in ips.items():
|
|
|
- print(i,v)
|
|
|
- #get_mask(ips)
|
|
|
+ #for i,v in ips.items():
|
|
|
+ # print(" ",i,v)
|
|
|
+ # #get_mask(ips)
|
|
|
nodescan2.ArtPoll()
|
|
|
|
|
|
nodes = []
|
|
@@ -224,7 +230,12 @@ def _scan():
|
|
|
time.sleep(10)
|
|
|
|
|
|
def refresh_node_list():
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
+ refresh_node_list1()
|
|
|
+ refresh_node_list2()
|
|
|
+
|
|
|
+def refresh_node_list1():
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
#aprint(len(nodes))
|
|
|
li_node_scroll = li_nodes.yview()
|
|
|
|
|
@@ -283,7 +294,7 @@ def refresh_node_list():
|
|
|
REFRESHSTAMP = time.time()-float(node["REFRESHSTAMP"])
|
|
|
timeline +=" PING:%0.1f"% REFRESHSTAMP
|
|
|
li_nodes.insert("end",str(node_nr).rjust(3," ") +timeline )
|
|
|
- if last_change > 10:
|
|
|
+ if last_change > 20:
|
|
|
color = li_nodes.itemconfig("end", bg="ORANGE")
|
|
|
except Exception as e:
|
|
|
li_nodes.insert("end",str(e)+"\n" )
|
|
@@ -310,26 +321,157 @@ def refresh_node_list():
|
|
|
|
|
|
print("scroll:",li_node_scroll)
|
|
|
|
|
|
+def refresh_node_list2():
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
+ node_nr = 1
|
|
|
+ nodesB = {}
|
|
|
+ for node in node_list.get(): #nodes:
|
|
|
+ k = node["MAC"]
|
|
|
+ nodesB[k] = node
|
|
|
+
|
|
|
+
|
|
|
+ k_sort = list(nodesB.keys())
|
|
|
+ k_sort.sort()
|
|
|
+
|
|
|
+ node_list.set([]) # =[]
|
|
|
+ for k in k_sort:
|
|
|
+ node_list.append(nodesB[k])
|
|
|
+
|
|
|
+ out = []
|
|
|
+ for k in k_sort:
|
|
|
+
|
|
|
+ print(" ",k)
|
|
|
+ node = nodesB[k]
|
|
|
+
|
|
|
+ txt = " "*5 + "="*30
|
|
|
+ bg=""
|
|
|
+ out.append({"txt":txt,"bg":bg})
|
|
|
+
|
|
|
+ bg = "lightgrey"
|
|
|
+ txt = str(node_nr).rjust(3," ") +" "+ node["lname"]
|
|
|
+ out.append({"txt":txt,"bg":bg})
|
|
|
+
|
|
|
+ ip = str(node_nr).rjust(3," ") +" "+ node["IP"]
|
|
|
+ bg = ""
|
|
|
+ if "PortTypes" in node:
|
|
|
+ if not node["PortTypes"]:
|
|
|
+ pass
|
|
|
+ if node["PortTypes"][0] == "@":
|
|
|
+ ip += " DMX-in"
|
|
|
+ bg ="yellow"
|
|
|
+ else:
|
|
|
+ ip += " DMX-out"
|
|
|
+ bg ="lightgreen"
|
|
|
+
|
|
|
+ txt = str(node_nr).rjust(3," ") +" short Name:"+ node["sname"]
|
|
|
+ out.append({"txt":txt,"bg":bg})
|
|
|
+
|
|
|
+ txt=ip
|
|
|
+ bg = ""
|
|
|
+ out.append({"txt":txt,"bg":bg})
|
|
|
+
|
|
|
+ inout = " UNIVERS OUT="+ str(ord(node["SwOut"][0:1]))+" IN="+ str(ord(node["SwIn"][0:1]))
|
|
|
+ txt = str(node_nr).rjust(3," ") + inout
|
|
|
+ bg = ""
|
|
|
+ out.append({"txt":txt,"bg":bg})
|
|
|
+
|
|
|
+ txt = str(node_nr).rjust(3," ") +" MAC:"+ node["MAC"]
|
|
|
+ bg = ""
|
|
|
+ out.append({"txt":txt,"bg":bg})
|
|
|
+
|
|
|
+ txt = ""
|
|
|
+ bg = ""
|
|
|
+ try:
|
|
|
+ last_change=time.time()-float(node["UPDATESTAMP"])
|
|
|
+ timeline = ""
|
|
|
+ timeline += " CHANGE:%0.1f"% (last_change)
|
|
|
+ REFRESHSTAMP = time.time()-float(node["REFRESHSTAMP"])
|
|
|
+ timeline +=" PING:%0.1f"% REFRESHSTAMP
|
|
|
+
|
|
|
+ txt = str(node_nr).rjust(3," ") +timeline
|
|
|
+ if last_change > 20:
|
|
|
+ bg="ORANGE"
|
|
|
+ except Exception as e:
|
|
|
+ txt = str(e)+"\n"
|
|
|
+ bg = "red"
|
|
|
+ out.append({"txt":txt,"bg":bg})
|
|
|
+
|
|
|
+ txt=""
|
|
|
+ bg = ""
|
|
|
+ try:
|
|
|
+ if node["BOOT"]:
|
|
|
+ BOOT = time.time()-float(node["BOOT"])
|
|
|
+ else:
|
|
|
+ BOOT = 0
|
|
|
+ timeline =" BOOT:%0.1f"% BOOT
|
|
|
+
|
|
|
+ txt = str(node_nr).rjust(3," ") +timeline +" sec"
|
|
|
+ bg = ""
|
|
|
+ except Exception as e:
|
|
|
+ txt = str(e)+"\n"
|
|
|
+ bg = "red"
|
|
|
+ out.append({"txt":txt,"bg":bg})
|
|
|
+
|
|
|
+ node_nr += 1
|
|
|
|
|
|
+ out.append({"txt":"","bg":"white"})
|
|
|
+
|
|
|
+ li_node_scroll = li_nodes.yview()
|
|
|
+ li_nodes.delete("0","end")
|
|
|
+ for i in out:
|
|
|
+ #print("list:",i)
|
|
|
+ li_nodes.insert("end",i["txt"])
|
|
|
+ bg=i["bg"]
|
|
|
+ if not bg:
|
|
|
+ bg = "lightgrey"
|
|
|
+ bg = "#ddd"
|
|
|
+ li_nodes.itemconfig("end", bg=bg)
|
|
|
|
|
|
-def get_new_ip(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
- b = e_ip_new.get().replace("[","").replace("]","")
|
|
|
- return b
|
|
|
|
|
|
def get_new_ip_str(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
- x = get_new_ip()
|
|
|
- #x = x[1:-1]
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
+ x = e_ip_new.get().replace("[","").replace("]","")
|
|
|
x = x.strip()
|
|
|
- #x = x.replace(",",".")
|
|
|
x = x.replace(" ","")
|
|
|
x = x.split(",")
|
|
|
print( "get_new_ip_str",x)
|
|
|
return x
|
|
|
-
|
|
|
+
|
|
|
+def get_form(event=None):
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
+
|
|
|
+ x = e_ip_new.get().replace("[","").replace("]","")
|
|
|
+ x = x.strip()
|
|
|
+ x = x.replace(" ","")
|
|
|
+ x = x.split(",")
|
|
|
+ ip2 = ".".join(x)
|
|
|
+
|
|
|
+ ip = e_ip_new.get()
|
|
|
+ ip = ip.replace(" ","")
|
|
|
+ ip = ip.replace(",",".")
|
|
|
+ MASK = variable.get() #e_mask_new.get()
|
|
|
+ #new_mac = b"CMD MAC6 " + struct.pack("<B",(int(e_mac2.get(),16)))
|
|
|
+ mac = e_mac.get()
|
|
|
+ mac_new = e_mac2.get()
|
|
|
+ ln = e_lname.get()
|
|
|
+ sn = e_sname.get()
|
|
|
+ univ = e_artnet_uni1.get()
|
|
|
+
|
|
|
+ data={}
|
|
|
+ data["IP"] = ip
|
|
|
+ data["IP2"] = ip2
|
|
|
+ data["sname"] = sn
|
|
|
+ data["lname"] = ln
|
|
|
+ data["netmask"] = MASK
|
|
|
+ data["mac"] = mac
|
|
|
+ data["mac_new"] = mac_new
|
|
|
+ data["univ"] = univ
|
|
|
+ print("FORM:",data)
|
|
|
+ return data
|
|
|
+
|
|
|
def send_artaddr(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
+ get_form()
|
|
|
ln = e_lname.get()
|
|
|
sn = e_sname.get()
|
|
|
|
|
@@ -348,11 +490,11 @@ def send_artaddr(event=None):
|
|
|
|
|
|
|
|
|
def send_none(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
pass
|
|
|
|
|
|
def send_mac(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
#new_mac = "CMD MAC6 " + hex(e_mac2.get()) #)
|
|
|
#new_mac = "CMD MAC6 " + struct.pack("<B",(int(e_mac2.get(),16))).decode()
|
|
|
new_mac = b"CMD MAC6 " + struct.pack("<B",(int(e_mac2.get(),16)))
|
|
@@ -364,54 +506,59 @@ def send_mac(event=None):
|
|
|
cur_ip +=[int(i)]
|
|
|
print("SEND MAC:",cur_ip,new_mac)
|
|
|
nodescan.send_node_cmd(cur_ip,cmd=new_mac)
|
|
|
+ # nodescan.sock.sendto(cmddata2 ,(ip,port))
|
|
|
#poll(delay=1.5)
|
|
|
|
|
|
-def send_dmx_store(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
- cmd = "CMD DMX STORE "
|
|
|
-
|
|
|
- a = e_ip.get().replace("[","").replace("]","")
|
|
|
- cur_ip = []
|
|
|
- for i in a.split(","):
|
|
|
- cur_ip +=[int(i)]
|
|
|
- print("SEND:",cur_ip,cmd)
|
|
|
- nodescan.send_node_cmd(cur_ip,cmd)
|
|
|
- poll(delay=1.5)
|
|
|
|
|
|
-def SEND_CMD(cmd="NIX"):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+def SEND_CMD(cmd="NIX",entry=None):
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
def cb(event=None):
|
|
|
- print(sys._getframe().f_code.co_name,cmd)
|
|
|
- _send_cmd(cmd=cmd)
|
|
|
- return cb
|
|
|
-
|
|
|
-def send_cmd(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
- cmd = e_cmd.get() #"CMD DMX STORE "
|
|
|
- _send_cmd(cmd=cmd)
|
|
|
-
|
|
|
-def send_cmd2(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
- cmd = e_cmd2.get() #"CMD DMX STORE "
|
|
|
- _send_cmd(cmd=cmd)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
+ _cmd=cmd
|
|
|
+ if entry:
|
|
|
+ _cmd = entry.get() #"CMD DMX STORE "
|
|
|
+ print(" SEND_CMD.cb()",[_cmd])
|
|
|
+ if not _cmd:
|
|
|
+ cprint(" SEND_CMD: no cmd",color="red")
|
|
|
+ #_send_cmd(cmd=_cmd)
|
|
|
+ port = 7600
|
|
|
+ form = get_form()
|
|
|
+ if form["IP2"]:
|
|
|
+ _cmd2 = []
|
|
|
+ for i in _cmd:
|
|
|
+ try:
|
|
|
+ _cmd2.append(ord(i) )
|
|
|
+ except:
|
|
|
+ _cmd2.append(ord(" ") )
|
|
|
+
|
|
|
+ print(" _cmd2",_cmd2)
|
|
|
+ for i in range(31):
|
|
|
+ if len(_cmd2) < i:
|
|
|
+ _cmd2.append(0)
|
|
|
+ for i in _cmd2:
|
|
|
+ print(" ",i,i,hex(i))
|
|
|
+
|
|
|
+ _cmd2 = bytes(_cmd2)
|
|
|
+ print(" _cmd2",_cmd2)
|
|
|
+
|
|
|
+ nodescan.sock.sendto(_cmd2 ,(form["IP2"],port))
|
|
|
|
|
|
-def send_cmd3(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
- cmd = e_cmd3.get() #"CMD DMX STORE "
|
|
|
- _send_cmd(cmd=cmd)
|
|
|
+ return cb
|
|
|
|
|
|
-def send_cmd4(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
- cmd = e_cmd4.get() #"CMD DMX STORE "
|
|
|
- _send_cmd(cmd=cmd)
|
|
|
+def send_artdmx(val=127):
|
|
|
+ def cb():
|
|
|
+ form = get_form()
|
|
|
+ print(form)
|
|
|
+ import lib.ArtNetNode as an
|
|
|
+ if form["IP2"] and form["univ"]:
|
|
|
+ artnet = an.ArtNetNode(to=form["IP2"],univ=form["univ"],port=4566)
|
|
|
+ artnet.send([val]*512,port=6454)
|
|
|
+ print(artnet._data)
|
|
|
+ return cb
|
|
|
|
|
|
-def send_cmd5(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
- cmd = e_cmd5.get() #"CMD DMX STORE "
|
|
|
- _send_cmd(cmd=cmd)
|
|
|
|
|
|
def _send_cmd(event=None,cmd=""):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
#cmd = e_cmd.get() #"CMD DMX STORE "
|
|
|
cmd = cmd.split(" ")
|
|
|
value = cmd[-1]
|
|
@@ -420,13 +567,13 @@ def _send_cmd(event=None,cmd=""):
|
|
|
except:pass
|
|
|
cmd = cmd[:-1] #.append(value)
|
|
|
cmd.append(value)
|
|
|
- print("_send_cmd:",cmd)
|
|
|
+ print("_send_cmd:",[cmd])
|
|
|
cmd=" ".join(map(str,cmd) )
|
|
|
- a = e_ip.get().replace("[","").replace("]","")
|
|
|
+ a = e_ip.get()
|
|
|
if not a:
|
|
|
- print("ERR: _send_cmd STOP no Node-IP selected !! ---------")
|
|
|
- return 0
|
|
|
-
|
|
|
+ cprint(" NO NODE-IP SELECTED",color="red")
|
|
|
+ return
|
|
|
+ a = a.replace("[","").replace("]","")
|
|
|
cur_ip = []
|
|
|
sep = "xx"
|
|
|
if "," in a:
|
|
@@ -435,12 +582,7 @@ def _send_cmd(event=None,cmd=""):
|
|
|
sep = "."
|
|
|
for i in a.split(sep):
|
|
|
cur_ip +=[int(i)]
|
|
|
- print("SEND:",cur_ip,cmd)
|
|
|
- b_scan.insert("end", "SendCMD: "+str(cur_ip)+cmd+"\n")
|
|
|
- #import socket
|
|
|
- #sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
|
- #sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
|
|
- #nodescan.sock = sock
|
|
|
+ cprint("_cmd_send:",cur_ip ,"CMD:",[cmd],color="yellow")
|
|
|
nodescan.send_node_cmd(cur_ip,cmd)
|
|
|
#poll(delay=1.5)
|
|
|
|
|
@@ -477,7 +619,6 @@ def kill_librelight(event=None):
|
|
|
poll()
|
|
|
|
|
|
def start_librelight(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
#for i in ["CONSOLE.py","EDITOR.py","ASP"]:
|
|
|
for i in ["ASP"]:
|
|
|
cmd='screen -XS "{}" quit | echo ""'.format(i)
|
|
@@ -503,7 +644,6 @@ def start_librelight(event=None):
|
|
|
|
|
|
|
|
|
def set_ip(event=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
print("SET NEW IP")
|
|
|
|
|
|
cur_ip=(2,0,0,94)
|
|
@@ -535,7 +675,7 @@ def set_ip(event=None):
|
|
|
poll(delay=1.5)
|
|
|
|
|
|
def set_node_pin(evnet=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
cmd = "CMD DMX=PIN"
|
|
|
ip = get_new_ip_str()
|
|
|
print("ip",[ip])
|
|
@@ -543,14 +683,14 @@ def set_node_pin(evnet=None):
|
|
|
poll(delay=1.5)
|
|
|
|
|
|
def set_node_in(evnet=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
cmd="CMD DMX=IN"
|
|
|
ip = get_new_ip_str()
|
|
|
nodescan.send_node_cmd(ip,cmd=cmd)
|
|
|
poll(delay=1.5)
|
|
|
|
|
|
def set_node_out(evnet=None):
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
cmd="CMD DMX=OUT"
|
|
|
ip = get_new_ip_str()
|
|
|
nodescan.send_node_cmd(ip,cmd=cmd)
|
|
@@ -588,6 +728,7 @@ b_scan.configure(bg="#0f0")
|
|
|
#POLL ['2.255.255.255', 6454] OK ;
|
|
|
|
|
|
def get_ips():
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
local_ips = []
|
|
|
#local_ips.append("2.0.0.255")
|
|
|
cmd='ip a | grep " inet " | cut -d " " -f 6 | sort -h'
|
|
@@ -775,7 +916,9 @@ line_frame = Tkinter.Frame(eframe)
|
|
|
line_frame.pack(side="top",expand=0,fill="x")
|
|
|
Tkinter.Label(line_frame,text="CMD",font=font3,width=6).pack(side="left",expand=0,fill="y")
|
|
|
e_cmd = Tkinter.Entry(line_frame,font=font3,width=26)
|
|
|
-e_cmd.bind("<Return>", send_cmd )
|
|
|
+CMD="" #DMX OUT STORE"
|
|
|
+c=SEND_CMD(CMD,entry=e_cmd)
|
|
|
+e_cmd.bind("<Return>", c )
|
|
|
e_cmd.pack(side="left")
|
|
|
|
|
|
#-------------------------------------------- line
|
|
@@ -817,7 +960,29 @@ b_scan.pack(side="top",expand=1,fill="x")
|
|
|
line_frame = Tkinter.Frame(eframe1)
|
|
|
line_frame.pack(side="top",expand=0,fill="x")
|
|
|
|
|
|
+e = Tkinter.Button(line_frame,text="DMX:0",font=font3,width=16,command=send_artdmx(0),bg="orange")
|
|
|
+e.pack(side="left")
|
|
|
|
|
|
+line_frame = Tkinter.Frame(eframe1)
|
|
|
+line_frame.pack(side="top",expand=0,fill="x")
|
|
|
+
|
|
|
+e = Tkinter.Button(line_frame,text="DMX:127",font=font3,width=16,command=send_artdmx(127),bg="orange")
|
|
|
+e.pack(side="left")
|
|
|
+
|
|
|
+line_frame = Tkinter.Frame(eframe1)
|
|
|
+line_frame.pack(side="top",expand=0,fill="x")
|
|
|
+
|
|
|
+e = Tkinter.Button(line_frame,text="DMX:255",font=font3,width=16,command=send_artdmx(255),bg="orange")
|
|
|
+e.pack(side="left")
|
|
|
+
|
|
|
+line_frame = Tkinter.Frame(eframe1)
|
|
|
+line_frame.pack(side="top",expand=0,fill="x")
|
|
|
+e = Tkinter.Label(line_frame,text="",width=16)
|
|
|
+e.pack(side="left")
|
|
|
+
|
|
|
+
|
|
|
+line_frame = Tkinter.Frame(eframe1)
|
|
|
+line_frame.pack(side="top",expand=0,fill="x")
|
|
|
Tkinter.Label(line_frame,text="CMD",font=font3,width=6).pack(side="left",expand=0,fill="y")
|
|
|
e_cmd2 = Tkinter.Entry(line_frame,font=font3,width=16)
|
|
|
CMD="- DMX ERASE"
|
|
@@ -859,7 +1024,7 @@ e_cmd5.pack(side="left")
|
|
|
|
|
|
|
|
|
def network_listenet():
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
b_scan.insert("end", "log:\n" )
|
|
|
while 1:
|
|
|
#print(".")
|
|
@@ -879,23 +1044,14 @@ def network_listenet():
|
|
|
|
|
|
|
|
|
def update_idletask():
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
while 1:
|
|
|
- time.sleep(1)
|
|
|
root.update_idletasks()
|
|
|
- #print(nodescan.sock)
|
|
|
- #print(dir(nodescan.sock))
|
|
|
- #print(nodescan.sock.getsockopt())
|
|
|
- #if nodescan.sock.connected == 0:
|
|
|
- # MSG["text"] = "Nodescanner not Connected !"
|
|
|
- # MSG["bg"] = "red"
|
|
|
- #else:
|
|
|
- # MSG["text"] = ""
|
|
|
- # MSG["bg"] = "grey"
|
|
|
+ time.sleep(1)
|
|
|
|
|
|
|
|
|
def main():
|
|
|
- print(sys._getframe().f_code.co_name)
|
|
|
+ cprint(sys._getframe().f_code.co_name,color="yellow")
|
|
|
thread.start_new_thread(scan, () )
|
|
|
thread.start_new_thread(nodescan.node_cmd_recive, () )
|
|
|
thread.start_new_thread(network_listenet, () )
|