|
@@ -419,7 +419,8 @@ class Vopen():
|
|
|
pass
|
|
|
#img = self.rescale_frame2(img, 1200)
|
|
|
else:
|
|
|
- img = self.rescale_frame2(img, 200)
|
|
|
+ #img = self.rescale_frame2(img, 200)
|
|
|
+ #img = self.rescale_frame2(img, 1200)
|
|
|
|
|
|
|
|
|
# store frame into buffer list
|
|
@@ -1193,6 +1194,23 @@ class POINTER():
|
|
|
window.blit(fr,(pos[0]+2,pos[1]+2 ))
|
|
|
window.blit(fr,(130,1))
|
|
|
|
|
|
+ if 1:# lupe / looking-glass / lens
|
|
|
+ __t = 60
|
|
|
+ rgb=[255,0,0]
|
|
|
+ pos=[400,400,160,160]
|
|
|
+ draw_box_frame(window,rgb,pos,offset=1)
|
|
|
+ r_sub = grab(x=self._x-__t/2,y=self._y-__t/2,w=__t,h=__t)
|
|
|
+ if r_sub:
|
|
|
+ r_sub = pygame.transform.scale(r_sub,(160,160))
|
|
|
+ if r_sub: # target
|
|
|
+ window.blit(r_sub, (400,400))
|
|
|
+ #pos=[400+40,400+40,80,80]
|
|
|
+ pos=[400+80,400+80,80,80]
|
|
|
+ draw_box_frame(window,rgb,pos,offset=3)
|
|
|
+ draw_box_frame(window,rgb,pos,offset=2)
|
|
|
+ draw_box_frame(window,rgb,pos,offset=0)
|
|
|
+ draw_box_frame(window,rgb,pos,offset=1)
|
|
|
+
|
|
|
# fix pos
|
|
|
#txt=str(pos) #"[0, 0, 0, 0]"
|
|
|
#fr = font15.render(txt ,1, (200,200,200))
|
|
@@ -1203,6 +1221,23 @@ class POINTER():
|
|
|
window.blit(fr,(10,30))
|
|
|
fr = font15.render("Y:{:03}".format(self._y) ,1, (200,200,200))
|
|
|
window.blit(fr,(10,40))
|
|
|
+
|
|
|
+ if 1: #self._x > 30 and self._y > 230:
|
|
|
+ #from_x_min = 40 #320
|
|
|
+ #from_y_min = 236
|
|
|
+ # pointer
|
|
|
+ _x = self._x-40
|
|
|
+ _y = self._y-236
|
|
|
+ rgb = [200,200,200]
|
|
|
+ if _x < 0:
|
|
|
+ rgb = [200,0,0]
|
|
|
+ fr = font80.render("X:{:03}".format(_x) ,1, rgb)
|
|
|
+ window.blit(fr,(200,400))
|
|
|
+ rgb = [200,200,200]
|
|
|
+ if _y < 0:
|
|
|
+ rgb = [200,0,0]
|
|
|
+ fr = font80.render("Y:{:03}".format(_y) ,1, rgb)
|
|
|
+ window.blit(fr,(200,450))
|
|
|
|
|
|
p=110
|
|
|
|
|
@@ -1316,9 +1351,15 @@ if options.videoplayer:
|
|
|
|
|
|
def draw_overlay():
|
|
|
global fps,fps2
|
|
|
- pygame.draw.rect(window,[0,0,20],[0,0,MAIN_SIZE[0],57]) # background
|
|
|
- pygame.draw.rect(window,[0,0,20],[0,215,MAIN_SIZE[0],15]) # background
|
|
|
- pygame.draw.rect(window,[0,0,20],[0,398,MAIN_SIZE[0],98]) # background
|
|
|
+ # oben
|
|
|
+ pygame.draw.rect(window,[0,0,50],[0,0,MAIN_SIZE[0],57]) # background
|
|
|
+ pygame.draw.rect(window,[0,0,50],[0,215,MAIN_SIZE[0],15]) # background
|
|
|
+ # links
|
|
|
+ pygame.draw.rect(window,[0,0,50],[0,50,35,400]) # background
|
|
|
+ # mitte
|
|
|
+ pygame.draw.rect(window,[0,0,50],[0,398,MAIN_SIZE[0],98]) # background
|
|
|
+ # unten
|
|
|
+ pygame.draw.rect(window,[0,0,50],[330,398+98,MAIN_SIZE[0],98]) # background
|
|
|
fr = font15.render("DMX-FPS: {}".format(fps) ,1, (200,0,255))
|
|
|
window.blit(fr,(10,2))
|
|
|
|
|
@@ -1675,18 +1716,29 @@ def create_vpu_wall_conf():
|
|
|
print("CREATE VPU CONFIG !")
|
|
|
|
|
|
wall_data = []
|
|
|
+_last_wall_config_time = time.time()
|
|
|
def read_wall_pix(init=0):
|
|
|
+ global _last_wall_config_time
|
|
|
global wall_data, NR
|
|
|
grid = []
|
|
|
|
|
|
#if not NR and init==0:
|
|
|
# return
|
|
|
- if init == 0:
|
|
|
- if NR:
|
|
|
- if int(time.time()*100) % 20 != 0: # fast reload
|
|
|
- return
|
|
|
- elif int(time.time()*100) % 100 != 0: # slow reload
|
|
|
- return
|
|
|
+ ok = 0
|
|
|
+ if init:
|
|
|
+ ok = 1
|
|
|
+
|
|
|
+ if NR:
|
|
|
+ if time.time()-_last_wall_config_time > 3:
|
|
|
+ ok = 1
|
|
|
+ else:
|
|
|
+ if time.time()-_last_wall_config_time > 10:
|
|
|
+ ok = 1
|
|
|
+
|
|
|
+ if not ok:
|
|
|
+ return
|
|
|
+
|
|
|
+ _last_wall_config_time = time.time()
|
|
|
if not os.path.isfile(vpu_wall_conf_file):
|
|
|
create_vpu_wall_conf()
|
|
|
|
|
@@ -1729,10 +1781,20 @@ def reshape2(GRID,GRID_OUT,_x,_y,name="GRID_Z"):
|
|
|
read_wall_pix()
|
|
|
_wall_data = wall_data[:]
|
|
|
for i,_wall in enumerate(_wall_data):
|
|
|
- print(_wall)
|
|
|
+ #print(_wall)
|
|
|
if len(_wall) <=6:
|
|
|
continue
|
|
|
try:
|
|
|
+ if type(_wall[1]) is str:
|
|
|
+ continue
|
|
|
+ if type(_wall[2]) is str:
|
|
|
+ continue
|
|
|
+ if type(_wall[3]) is str:
|
|
|
+ continue
|
|
|
+ if type(_wall[4]) is str:
|
|
|
+ continue
|
|
|
+ if type(_wall[5]) is str:
|
|
|
+ continue
|
|
|
from_x=from_x_min+_wall[1]#*_w
|
|
|
from_y=from_y_min+_wall[2]#*_h
|
|
|
_a= _wall[3]
|
|
@@ -1753,6 +1815,7 @@ def reshape2(GRID,GRID_OUT,_x,_y,name="GRID_Z"):
|
|
|
sub = pygame.transform.rotate(sub,ang)
|
|
|
window.blit(sub,(target_x,target_y))
|
|
|
except Exception as e:
|
|
|
+ print(" ",_wall)
|
|
|
print("WALL err:",e)
|
|
|
|
|
|
|
|
@@ -1908,9 +1971,9 @@ def draw_kachel_nr(): #GRID,_x=0,_y=0):
|
|
|
n = 0
|
|
|
_max_row = 40
|
|
|
_y=0
|
|
|
- for i in range(8):
|
|
|
+ for i in range(8): # ROW / ZEILEN -> ->
|
|
|
_x=0
|
|
|
- for j in range(30):
|
|
|
+ for j in range(30): # COLUMS / SPALTEN | |
|
|
|
pygame.draw.rect(window,[10,20,10],[40+_x+2,60+_y+2,14,9]) #background
|
|
|
_j=j #string.ascii_uppercase[j]
|
|
|
fr = font12.render("{}:{}".format(_j+1,i+1) ,1, (200,200,55))
|
|
@@ -1919,8 +1982,8 @@ def draw_kachel_nr(): #GRID,_x=0,_y=0):
|
|
|
#window.blit(fr,(40+_x+2,60+_y+2))
|
|
|
#fr = font12.render(":{}".format(i+1) ,1, (200,200,55))
|
|
|
#window.blit(fr,(40+_x+2+6,60+_y+2))
|
|
|
- _x+=16
|
|
|
- _y +=16
|
|
|
+ _x+=16 # pix
|
|
|
+ _y +=16 # pix
|
|
|
|
|
|
grid_counter = time.time()
|
|
|
|
|
@@ -1998,6 +2061,7 @@ class FADE():
|
|
|
self.val
|
|
|
def next(self):
|
|
|
pass
|
|
|
+
|
|
|
def draw_video(VIDEO):
|
|
|
global videplayer
|
|
|
i = 0
|
|
@@ -2413,6 +2477,32 @@ dmx_raw()
|
|
|
|
|
|
thread.start_new_thread(dmx_loop,())
|
|
|
|
|
|
+def draw_output_label(CFG,value,name="GRID_XX"):
|
|
|
+ dim_raw = value
|
|
|
+
|
|
|
+ # GRID_A1_DIM_LABEL
|
|
|
+ fr = font15.render("Output:"+name,1, (255,255,255))
|
|
|
+ fr_r = fr.get_rect(center=(int(wx/2),int(0+pm_wy-p*0-10)))
|
|
|
+ window.blit(fr,(CFG["x1"],CFG["y2"]+5))
|
|
|
+
|
|
|
+ fr = font15.render("inv-dim: "+str(dim_raw) ,1, (255,255,255))
|
|
|
+ fr_r = fr.get_rect(center=(int(wx/2),int(0+pm_wy-p*0-10)))
|
|
|
+ window.blit(fr,(CFG["x1"],CFG["y2"]+15))
|
|
|
+
|
|
|
+def GRID_DIM(dim,x,y):
|
|
|
+ try:
|
|
|
+ dim = int(grid_dim_v)
|
|
|
+ if dim > 255:
|
|
|
+ dim = 255
|
|
|
+ if dim <=0:
|
|
|
+ dim = 0
|
|
|
+ except:pass
|
|
|
+ dim_raw = dim*-1
|
|
|
+ s = pygame.Surface((p*8,p*8)) # the size of your rect
|
|
|
+ s.set_alpha(dim) # alpha level
|
|
|
+ s.fill((0,0,0)) # this fills the entire surface
|
|
|
+ window.blit(s, (x,y))
|
|
|
+
|
|
|
def GRID_A1_DIM():
|
|
|
# GRID_A1 DIM
|
|
|
if options.grid_a1_idim:
|
|
@@ -2420,28 +2510,11 @@ def GRID_A1_DIM():
|
|
|
grid_dim_ch = int(options.grid_a1_idim)
|
|
|
grid_dim_v = dataA[grid_dim_ch-1]
|
|
|
dim=255
|
|
|
- try:
|
|
|
- dim = int(grid_dim_v)
|
|
|
- if dim > 255:
|
|
|
- dim = 255
|
|
|
- if dim <=0:
|
|
|
- dim = 0
|
|
|
- except:pass
|
|
|
- dim_raw = dim*-1
|
|
|
- s = pygame.Surface((p*8,p*8)) # the size of your rect
|
|
|
- s.set_alpha(dim) # alpha level
|
|
|
- s.fill((0,0,0)) # this fills the entire surface
|
|
|
- window.blit(s, (CFG["x1"],CFG["y2"]-p*8))
|
|
|
-
|
|
|
- # GRID_A1_DIM_LABEL
|
|
|
- fr = font15.render("Output:GRID_A1",1, (255,255,255))
|
|
|
- fr_r = fr.get_rect(center=(int(wx/2),int(0+pm_wy-p*0-10)))
|
|
|
- window.blit(fr,(CFG["x1"],CFG["y2"]+5))
|
|
|
-
|
|
|
- fr = font15.render("inv-dim: "+str(dim_raw) ,1, (255,255,255))
|
|
|
- fr_r = fr.get_rect(center=(int(wx/2),int(0+pm_wy-p*0-10)))
|
|
|
- window.blit(fr,(CFG["x1"],CFG["y2"]+15))
|
|
|
-
|
|
|
+ dim=grid_dim_v
|
|
|
+ dim=120
|
|
|
+ GRID_DIM(dim,x=CFG["x1"],y=CFG["y2"]-p*8)
|
|
|
+ draw_output_label(CFG,dim,name="GRID_A1_DIM")
|
|
|
+
|
|
|
def GRID_A2_DIM():
|
|
|
# GRID_A2 DIM
|
|
|
if options.grid_a2_idim:
|
|
@@ -2462,14 +2535,8 @@ def GRID_A2_DIM():
|
|
|
s.fill((0,0,0)) # this fills the entire surface
|
|
|
window.blit(s, (CFG["x1"],CFG["y2"]-p*8))
|
|
|
|
|
|
- # GRID_A2_DIM_LABEL
|
|
|
- fr = font15.render("Output:GRID_A2",1, (255,255,255))
|
|
|
- fr_r = fr.get_rect(center=(int(wx/2),int(0+pm_wy-p*0-10)))
|
|
|
- window.blit(fr,(CFG["x1"],CFG["y2"]+5))
|
|
|
+ draw_output_label(CFG,dim_raw,name="GRID_A2_DIM")
|
|
|
|
|
|
- fr = font15.render("inv-dim: "+str(dim_raw) ,1, (255,255,255))
|
|
|
- fr_r = fr.get_rect(center=(int(wx/2),int(0+pm_wy-p*0-10)))
|
|
|
- window.blit(fr,(CFG["x1"],CFG["y2"]+15))
|
|
|
t1 = Timer(143)
|
|
|
time.sleep(0.33)
|
|
|
t2 = Timer(11)
|
|
@@ -2541,9 +2608,10 @@ def main():
|
|
|
if options.countdown:
|
|
|
draw_counter(COUNTER)
|
|
|
|
|
|
- pointer.draw(0,pm_wy) #wy
|
|
|
|
|
|
pygame.draw.rect(window,[5,5,5],[0,60,MAIN_SIZE[0],p*9]) # background
|
|
|
+ draw_overlay()
|
|
|
+ pointer.draw(0,pm_wy) #wy
|
|
|
|
|
|
|
|
|
spos = [0,0,0,0]
|
|
@@ -2571,6 +2639,7 @@ def main():
|
|
|
GRID_A2_DIM()
|
|
|
|
|
|
draw_overlay()
|
|
|
+ pointer.draw(0,pm_wy) #wy
|
|
|
|
|
|
|
|
|
pygame.display.flip()
|