# uncompyle6 version 3.9.3 # Python bytecode version base 2.6 (62161) # Decompiled from: Python 3.9.25 (main, Oct 31 2025, 23:16:49) # [GCC 14.2.0] # Embedded file name: user_config_tcs.pyc # Compiled at: 2022-05-31 09:29:42 import wx, os, data_model, traceback, one_unit, ConfigParser, protocol, sys, select_keys, select_units, d_protocol, mytime from user_config_helpers import * inputSourceSelectOptions = {16: 'Signal Input ', 32: 'Gain Fader Output', 48: 'DSP Core Output', 64: 'Delay Output'} outputSourceSelectOptions = {16: 'Link Bus ', 32: 'Mixer & Gain Fader Output', 48: 'DSP Core Output', 64: 'Delay Output'} class outputConfiguration(wx.Panel): def __init__(self, parent, frame, uiNumber, panelName): self.frame = frame self.name = panelName self.uiNumber = uiNumber self.parent = parent wx.Panel.__init__(self, parent, size=(964, 500)) self.lines = {} self.Show(True) self.initFinished = False return def initMe(self, force=False): if self.IsShown() == False and force == False: return if self.initFinished == True: return 0 print mytime.displayTime(), 'uct.initMe outputConfiguration', self.name frame = self.frame uiNumber = self.uiNumber if os.name in mac_names: y = 5 else: y = 12 self.targetGain = wx.StaticText(self, -1, 'Power Level (0...10)', pos=(640, y), size=(100, 26)) self.targetGain.Wrap(100) self.lines = {} self.uiKeys = getKeys(frame, uiNumber) i = 0 self.factoryItems = 0 for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel != 1 or key.index < 128: continue targetGain = str(val[7] / 4.0) self.createLine(i) self.lines[i].key = key self.lines[i].checkBox.SetLabel('Factory') self.lines[i].targetGain.SetValue(targetGain) self.lines[i].checkBox.Enable(False) self.lines[i].targetGain.Enable(False) i += 1 self.factoryItems += 1 for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel == 1 and key.index >= 128: continue targetGain = str(val[7] / 4.0) self.createLine(i) self.lines[i].key = key self.lines[i].checkBox.SetValue(True) self.lines[i].targetGain.SetValue(targetGain) self.enable(i) i += 1 if i - self.factoryItems < 1: self.createLine(i) self.initFinished = True self.Show(True) return def createLine(self, i): if os.name in mac_names: y = 3 else: y = 4 p = wx.Panel(self, size=(964, 28)) p.Show(False) p.checkBox = wx.CheckBox(p, 10 + i, ' User', pos=(10, 2), size=(70, 20)) p.targetGain = wx.TextCtrl(p, 70 + i, '', pos=(640, 1), size=(60, 20)) p.targetGainUnit = wx.StaticText(p, -1, '', pos=(702, y), size=(30, 26)) p.SetPosition((0, 40 + 28 * i)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None p.lineNumber = i self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + i) self.lines[i] = p self.enable(i) p.Show(True) return def enable(self, i): val = self.lines[i].checkBox.GetValue() self.lines[i].targetGain.Enable(val) return def OnEnabled(self, e): i = e.GetId() - 10 self.enable(i) if i == len(self.lines) - 1 and self.lines[i].checkBox.GetValue() == True and i < 1 + self.factoryItems: if i > 0: t = self.lines[i] s = self.lines[0] t.targetGain.SetValue(s.targetGain.GetValue()) else: t = self.lines[i] t.targetGain.SetValue('0') return def evaluateLine(self, line): if line.checkBox.GetValue() == False: return else: flags = int(0) amplifierGain = 0 calibrationGain = 0 try: amplifierInputImpedance = 0 except: amplifierInputImpedance = '' hardwareOutput = 0 loadImpedance = 0 targetGain = float(line.targetGain.GetValue()) if flags > 15: print mytime.displayTime(), 'uc.oc.invalid flags:', hex(flags) flags = 0 amplifierGain *= 4 amplifierGain = int(round(amplifierGain, 0)) if amplifierGain > 255: amplifierGain = 255 if amplifierGain < 0: amplifierGain = 0 calibrationGain *= 100.0 calibrationGain += 128 calibrationGain = int(round(calibrationGain, 0)) if calibrationGain < 28: calibrationGain = 28 if calibrationGain > 228: calibrationGain = 228 try: amplifierInputImpedance /= 100 amplifierInputImpedance = int(round(amplifierInputImpedance, 0)) if amplifierInputImpedance < 1: amplifierInputImpedance = 1 if amplifierInputImpedance > 250: amplifierInputImpedance = 250 except: amplifierInputImpedance = 255 hardwareOutput -= 1 hardwareOutput = int(round(hardwareOutput, 0)) if hardwareOutput < 0: hardwareOutput = 0 if hardwareOutput > max(self.frame.frame.parent.unit_channels): hardwareOutput = max(self.frame.frame.parent.unit_channels) loadImpedance *= 4 loadImpedance = int(round(loadImpedance)) if loadImpedance > 255: loadImpedance = 255 if loadImpedance < 1: loadImpedance = 1 targetGain *= 4 targetGain = int(round(targetGain)) if targetGain > 255: targetGain = 255 if targetGain < 0: targetGain = 0 i = line.lineNumber self.lines[i].targetGain.SetValue(str(targetGain / 4.0)) try: sendString = '' + chr(self.uiNumber) sendString += chr(flags) sendString += chr(calibrationGain) sendString += chr(amplifierInputImpedance) sendString += chr(hardwareOutput) sendString += chr(loadImpedance) sendString += chr(amplifierGain) sendString += chr(targetGain) mys = 'String: ' for c in sendString: mys += hex(ord(c)) + ':' print mys return sendString except: print mytime.displayTime(), 'uc.oc.eL.failed to build string' traceback.print_exc(file=sys.stdout) return return # okay decompiling pycode/user_config_tcs.pyc