def __init__(self, parent, channel_levels, num_channels=68): frames = (make_frame(parent), make_frame(parent)) channel_levels[:]=[] self.number_labels = [] for channel in range(1, num_channels+1): # frame for this channel f = Frame(frames[channel > (num_channels/2)]) # channel number -- will turn yellow when being altered num_lab = Label(f, text=str(channel), width=3, bg='grey40', fg='white', font=stdfont, padx=0, pady=0, bd=0, height=1) num_lab.pack(side='left') self.number_labels.append(num_lab) # text description of channel Label(f, text=Patch.get_channel_name(channel), width=8, font=stdfont, anchor='w', padx=0, pady=0, bd=0, height=1, bg='black', fg='white').pack(side='left') # current level of channel, shows intensity with color l = Label(f, width=3, bg='lightBlue', font=stdfont, anchor='e', padx=1, pady=0, bd=0, height=1) l.pack(side='left') colorlabel(l) channel_levels.append(l) f.pack(side='top') self.channel_levels = channel_levels
def stageassub(self): """returns the current onstage lighting as a levels dictionary, skipping the zeros, and using names where possible""" levs=self.oldlevels return dict([(Patch.get_channel_name(i),l) for i,l in zip(range(1,len(levs)+1),levs) if l>0])
def updatestagelevels(self): self.master.after(100, self.updatestagelevels) for lev, idx in zip(self.oldlevels, xrange(0, 68 + 1)): self.stage.updatelightlevel(Patch.get_channel_name(idx + 1), lev)