# 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_various.pyc # Compiled at: 2024-11-13 12:29:57 import wx, os, data_model, traceback, one_unit, ConfigParser, protocol, sys, select_keys, select_units, d_protocol, mytime from user_config_helpers import * import string print string.ascii_lowercase uiTypes = {'a': 'uiVarious1', 'b': 'uiVarious2', 'c': 'uiStackingConfiguration', 'd': 'uiHardwareGainSettings', 'e': 'uiFlash', 'f': 'uiLatency', 'g': 'uiFanControl', 'h': 'uiSensitivity', 'i': 'uiModelNumber'} blockKeysOptions = {0: 'Never', 1: 'Signal', 2: '-6 dB', 3: 'Limit'} powerGoodOptions = {2: 'D_MISO', 3: 'GPI 0', 1: 'GPI 1', 0: 'GPI 2'} generatorLevelOptions = {0: '0dBu', 1: '-6dBu', 2: '-12dBu', 3: '-24dBu'} userFlavours = {5: 'Locked', 4: 'User', 3: 'Admin', 2: 'Developer'} class FIR(wx.Panel): def __init__(self, parent, frame, uiNumber, panelName): self.frame = frame self.name = panelName self.uiType = 'uiFirFlavours' try: for c in string.ascii_lowercase: if uiNumber.find(c) >= 0: uiNumber = int(uiNumber.replace(c, '')) self.uiType = uiTypes[c] break except: pass self.uiNumber = uiNumber self.parent = parent wx.Panel.__init__(self, parent, size=(964, 600)) 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(), 'ucv.initMe FIR', self.name, self.uiType, 'force = ', force frame = self.frame uiNumber = self.uiNumber self.checkBoxes = {} self.uiKeys = getKeys(frame, uiNumber) if uiNumber == 185: flavours = eval(self.frame.frame.parent.config.get('DEFAULT', 'user_config_FIR_flavours')) self.flavours = {} self.flavourMap = {} for k in flavours: self.flavours[k] = flavours[k][0] self.flavourMap[k] = flavours[k][1] print mytime.displayTime(), 'ucv. FIR flavours:', self.flavours print mytime.displayTime(), 'ucv. FIR maps:', self.flavourMap else: self.flavours = {} numberOfFactoryKeys = 0 if uiNumber == 185: self.createFIRLine(0) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel != 1 or key.index < 128: continue self.frame.frame.clear(self.frame, 185, key=key) continue numberOfFactoryKeys = 1 self.lines[0].key = key self.lines[0].checkBox.SetLabel('Factory') self.lines[0].firFlavourChoice.SetStringSelection(self.flavours[val[5]]) self.lines[0].checkBox.Enable(False) self.lines[0].firFlavourChoice.Enable(False) if numberOfFactoryKeys > 0: self.createFIRLine(numberOfFactoryKeys) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel == 1 and key.index >= 128: continue self.lines[numberOfFactoryKeys].key = key if val[5] not in self.flavours: print mytime.displayTime(), 'ucv.Value error:', self.uiNumber, key, val else: self.lines[numberOfFactoryKeys].firFlavourChoice.SetStringSelection(self.flavours[val[5]]) self.lines[numberOfFactoryKeys].checkBox.Enable(True) self.lines[numberOfFactoryKeys].checkBox.SetValue(True) self.lines[numberOfFactoryKeys].firFlavourChoice.Enable(True) self.enable(0) if uiNumber == 189: if self.uiType == 'uiVarious1': self.qFlavours = {0: 'Default', 1: 'Varied by Gain (narrower with lower gain)', 2: 'Doubled (narrower bandwidth)'} self.createVariousLine1(1) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel == 1 and key.index >= 128: continue if val[1] != 0: continue self.lines[1].key = key self.lines[1].outLevelReference.SetValue(str(val[4] - 127) + ' dBu') if val[5] not in self.qFlavours: print mytime.displayTime(), 'ucv.Value error:', self.uiNumber, key, val else: self.lines[1].firFlavourChoice.SetStringSelection(self.qFlavours[val[5]]) stepSize = val[6] & 3 if stepSize == 0: self.lines[1].stepSizeChoice.SetStringSelection('0.25 dB') if stepSize == 1: self.lines[1].stepSizeChoice.SetStringSelection('0.5 dB') if stepSize == 3: self.lines[1].stepSizeChoice.SetStringSelection('1 dB') flags = val[7] if flags & 1: self.lines[1].showBandwidthChoice.SetStringSelection('Bandwidth') else: self.lines[1].showBandwidthChoice.SetStringSelection('Q Factor') if flags & 2: self.lines[1].muteOnMinGain.SetValue(1) else: self.lines[1].muteOnMinGain.SetValue(0) if flags & 4: self.lines[1].outLevelRelative.SetValue(1) else: self.lines[1].outLevelRelative.SetValue(0) if flags & 8: self.lines[1].alwaysEnableGain.SetValue(1) else: self.lines[1].alwaysEnableGain.SetValue(0) if flags & 16: self.lines[1].lockOnLinkLost.SetValue(1) else: self.lines[1].lockOnLinkLost.SetValue(0) if flags & 32: self.lines[1].enableSimultaneousControl.SetValue(0) else: self.lines[1].enableSimultaneousControl.SetValue(1) blockKeysLevel = (flags & 196) >> 6 self.lines[1].blockKeysLevel.SetStringSelection(blockKeysOptions[blockKeysLevel]) UVP_VD = val[6] & 252 if UVP_VD == 0: strUVP_VD = 'Default' elif UVP_VD == 255: strUVP_VD = 'Disabled' else: strUVP_VD = str(UVP_VD / 10.0) self.lines[1].uvpVD.SetValue(strUVP_VD) UVP_VCC = val[2] if UVP_VCC == 0: strUVP_VCC = 'Default' elif UVP_VCC == 255: strUVP_VCC = 'Disabled' else: strUVP_VCC = str(UVP_VCC / 10.0) self.lines[1].uvpVCC.SetValue(strUVP_VCC) UVP_VSS = val[3] if UVP_VSS == 0: strUVP_VSS = 'Default' elif UVP_VSS == 255: strUVP_VSS = 'Disabled' else: strUVP_VSS = str(-(UVP_VSS / 10.0)) self.lines[1].uvpVSS.SetValue(strUVP_VSS) self.lines[1].checkBox.SetValue(True) self.enable(1) elif self.uiType == 'uiVarious2': self.qFlavours = {0: 'Default', 1: 'Varied by Gain (narrower with lower gain)', 2: 'Doubled (narrower bandwidth)'} self.createVariousLine2(1) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel == 1 and key.index >= 128: continue if val[1] != 18: continue self.lines[1].key = key self.lines[1].outLevelReference.SetValue(str(val[3])) self.lines[1].firFlavourChoice.SetStringSelection(userFlavours[(val[2] & 3) + 2]) self.lines[1].blockKeysLevel.SetStringSelection(powerGoodOptions[val[2] >> 2 & 3]) self.lines[1].showBandwidthChoice.SetStringSelection(generatorLevelOptions[val[2] >> 4 & 3]) flags = val[7] if flags & 1: self.lines[1].enableLoadControl.SetValue(1) else: self.lines[1].enableLoadControl.SetValue(0) if flags & 2: self.lines[1].muteOnMinGain.SetValue(1) else: self.lines[1].muteOnMinGain.SetValue(0) if flags & 4: self.lines[1].outLevelRelative.SetValue(0) else: self.lines[1].outLevelRelative.SetValue(1) if flags & 8: self.lines[1].alwaysEnableGain.SetValue(1) else: self.lines[1].alwaysEnableGain.SetValue(0) if flags & 16: self.lines[1].lockOnLinkLost.SetValue(1) else: self.lines[1].lockOnLinkLost.SetValue(0) if flags & 32: self.lines[1].enableSimultaneousControl.SetValue(1) else: self.lines[1].enableSimultaneousControl.SetValue(0) if flags & 64: self.lines[1].enablePowerGood.SetValue(1) else: self.lines[1].enablePowerGood.SetValue(0) if flags & 128: self.lines[1].invertKeys.SetValue(1) else: self.lines[1].invertKeys.SetValue(0) blockKeysLevel = (flags & 196) >> 6 self.lines[1].blockKeysLevel.SetStringSelection(blockKeysOptions[blockKeysLevel]) self.lines[1].uvpVD.SetValue(str(round(20 * pow(1.027932453112032, val[4]), 1))) self.lines[1].userAccess.SetValue(str(val[5])) self.lines[1].adminAccess.SetValue(str(val[6])) self.lines[1].checkBox.SetValue(True) self.enable(1) elif self.uiType == 'uiHardwareGainSettings': self.createHardwareGainLine(0) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel == 1 and key.index >= 128: continue if val[1] != 4: continue self.lines[0].key = key self.lines[0].checkBox.Enable(True) self.lines[0].checkBox.SetValue(True) p = self.lines[0] tmp = (val[2] << 8) + val[3] p.zeroDBFSInputVoltage.SetValue(str(float(tmp) / 1000)) tmp = (val[4] << 8) + val[5] - 32767 p.dspDacGain.SetValue(str(tmp)) tmp = val[6] - 127 p.dcOffsetOut.SetValue(str(tmp)) tmp = (val[7] - 127) / 20.0 p.mixerCorrectionGain.SetValue(str(tmp)) elif self.uiType == 'uiStackingConfiguration': self.createStackingLine(0) self.createStackingLine(1) self.createStackingLine(2) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel == 1 and key.index >= 128: continue if val[1] == 1: self.lines[0].key = key self.lines[0].checkBox.Enable(True) self.lines[0].checkBox.SetValue(True) unityGainPointers = (val[2] << 16) + (val[3] << 8) + val[4] stackingGainPointers = (val[5] << 16) + (val[6] << 8) + val[7] for channel in range(8): self.lines[0].unityGainPointerChoice[channel].SetStringSelection(str(unityGainPointers >> channel * 3 & 7)) self.lines[0].stackingGainPointerChoice[channel].SetStringSelection(str(stackingGainPointers >> channel * 3 & 7)) if val[1] == 2: self.lines[1].key = key stackingMode = val[2] & 15 if stackingMode == 0: stackingMode = 'Off' if stackingMode == 1: stackingMode = 'Single' if stackingMode == 2: stackingMode = 'Dual' if stackingMode == 3: stackingMode = 'AVB Direct' p = self.lines[0] p.stackingMode.SetStringSelection(stackingMode) stackingGain = (val[3] << 8) + val[4] p.stackingGain.SetValue(str(stackingGain)) stackingHighThreshold = val[5] p.stackingHighThreshold.SetValue(str(stackingHighThreshold)) stackingKeepThreshold = (val[6] & 15) * 3 p.stackingKeepThreshold.SetValue(str(stackingKeepThreshold)) stackingLowThreshold = (val[6] >> 4 & 15) * 3 p.stackingLowThreshold.SetValue(str(stackingLowThreshold)) stackingDelay = float(((val[2] & 240) << 4) + val[7]) / 1.024 p.stackingDelay.SetValue(str(round(stackingDelay, 2))) if val[1] == 3: self.lines[2].key = key p = self.lines[0] p.risingLatency.SetValue(str(val[2])) p.fallingLatency.SetValue(str(val[3])) p.numberOfPresets.SetValue(str(val[4])) elif self.uiType == 'uiFlash': self.createFlashLine(0) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if val[1] == 6: print mytime.displayTime(), 'ucv.Flash key:', key, val p = self.lines[0] p.l1t.SetValue(hex(val[2])) p.l2t.SetValue(hex(val[3])) p.l3t.SetValue(hex(val[4])) p.l4t.SetValue(str(val[5])) p.l5t.SetValue(str(val[6] * 8)) p.l6t.SetValue(str(val[7])) p.checkBox.SetValue(1) p.key = key elif self.uiType == 'uiLatency': self.createLatencyLine(0) self.createLatencyLine(1) self.createLatencyLine(2) self.createLatencyLine(3) self.createLatencyLine(4) self.createLatencyLine(5) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if val[1] == 7: print mytime.displayTime(), 'ucv.Latency 1 key:', key, val p = self.lines[0] p.l1t.SetValue(str(val[2])) p.l2t.SetValue(str(val[3])) p.l3t.SetValue(str(val[4])) p.l4t.SetValue(str(val[5])) p.l5t.SetValue(str(val[6])) p.l6t.SetValue(str(val[7])) p.checkBox.SetValue(1) p.key = key if val[1] == 8: print mytime.displayTime(), 'ucv.Latency 2 key:', key, val p = self.lines[1] p.l1t.SetValue(str(val[2])) p.l2t.SetValue(str(val[3])) p.l3t.SetValue(str(val[4])) p.l4t.SetValue(str(val[5])) p.l5t.SetValue(str(val[6])) p.l6t.SetValue(str(val[7])) p.key = key if val[1] >= 11 and val[1] < 15: print mytime.displayTime(), 'ucv.Latency 3 key:', key, val p = self.lines[val[1] - 9] p.l1t.SetValue(str(val[2] >> 0 & 15)) p.l2t.SetValue(str(val[2] >> 4 & 15)) p.l3t.SetValue(str(val[3] >> 0 & 15)) p.l4t.SetValue(str(val[3] >> 4 & 15)) p.l5t.SetValue(str(val[4] >> 0 & 15)) p.l6t.SetValue(str(val[4] >> 4 & 15)) p.l7t.SetValue(str(val[5] >> 0 & 15)) p.l8t.SetValue(str(val[5] >> 4 & 15)) p.key = key elif self.uiType == 'uiFanControl': self.createFanControlLine(0) teller = 0 for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if val[1] == 15: if teller > 0: print 'ucv.een te veel', key self.frame.frame.clear(self, 0, key=key) continue teller += 1 print mytime.displayTime(), 'ucv.fan control key:', key, val p = self.lines[0] p.key = key p.l1t.SetValue(str(val[2])) p.l2t.SetValue(str(val[3])) p.l3t.SetValue(str(val[4])) p.l4t.SetValue(str(val[5])) p.l5t.SetValue(str(val[6])) p.l6t.SetValue(str(val[7] * 100)) p.checkBox.SetValue(1) elif self.uiType == 'uiSensitivity': self.createSensitivityLine(0) teller = 0 for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if val[1] == 16: if teller > 0: print 'ucv.een te veel', key self.frame.frame.clear(self, 0, key=key) continue teller += 1 print mytime.displayTime(), 'ucv.sensitivity key:', key, val p = self.lines[0] p.key = key p.l1t.SetValue(str(float(val[2] - 128) / 10.0)) p.l2t.SetValue(str(float(val[3] - 128) / 10.0)) p.l3t.SetValue(str(float(val[4] - 128) / 1.0)) p.l4t.SetValue(str(float(val[5] - 128) / 1.0)) p.l5t.SetValue(str(float(val[6] - 128) / 1.0)) p.l6t.SetValue(str(float(val[7] - 128) / 1.0)) p.checkBox.SetValue(1) elif self.uiType == 'uiModelNumber': self.createModelNumberLine(0) teller = 0 for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if val[1] == 17: if teller > 0: print 'ucv.een te veel', key self.frame.frame.clear(self, 0, key=key) continue teller += 1 print mytime.displayTime(), 'ucv.model number key:', key, val p = self.lines[0] p.key = key p.l1t.SetValue(str(val[2] & 31)) adcChannel = val[3] & 31 p.l2t.SetValue(str(adcChannel)) p.l3t.SetValue(str(val[4])) p.l4t.SetValue(str(val[5])) p.l5t.SetValue(str(val[6])) p.l6t.SetValue(str(val[7])) if val[2] & 32: p.modelNumberFromHwresistor.SetValue(1) if val[2] & 64: p.modelNumberFromEEPROM.SetValue(1) if val[2] & 128: p.hwResistorMapHKVersion.SetValue(1) if val[3] & 32: p.modelNumberFromEepromIfHwresistorZero.SetValue(1) p.checkBox.SetValue(1) self.numberOfFactoryKeys = numberOfFactoryKeys self.initFinished = True self.Show(True) return def createModelNumberLine(self, lineNumber): p = wx.Panel(self, size=(964, 430)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' Set Model Number programming. Uncheck and power cycle to restore default values.', pos=(10, 2), size=(700, 20)) p.l1 = wx.StaticText(p, -1, 'ADC Reference Channel', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '22', pos=(300, 32), size=(100, 20)) p.l2 = wx.StaticText(p, -1, 'ADC Model Number Resistor Channel', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '11', pos=(300, 60), size=(100, 20)) p.l3 = wx.StaticText(p, -1, 'Fixed Model Number', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '0', pos=(300, 88), size=(100, 20)) p.l4 = wx.StaticText(p, -1, 'Reserved 1', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '0', pos=(300, 116), size=(100, 20)) p.l5 = wx.StaticText(p, -1, 'Reserved 2', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '0', pos=(300, 144), size=(100, 20)) p.l6 = wx.StaticText(p, -1, 'Reserved 3', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '0', pos=(300, 172), size=(100, 20)) p.modelNumberFromHwresistor = wx.CheckBox(p, 33, ' Get model number from resistor value', pos=(30, 200)) p.modelNumberFromEEPROM = wx.CheckBox(p, 34, ' Get model number from EEPROM', pos=(30, 256)) p.hwResistorMapHKVersion = wx.CheckBox(p, 35, ' Alternate resistor mapping table', pos=(30, 228)) p.modelNumberFromEepromIfHwresistorZero = wx.CheckBox(p, 36, ' Get model number from EEPROM if resistor shorted', pos=(30, 284)) p.modelNumberFromHwresistor.SetValue(0) p.modelNumberFromEEPROM.SetValue(0) p.hwResistorMapHKVersion.SetValue(0) p.modelNumberFromEepromIfHwresistorZero.SetValue(0) p.SetPosition((0, 40 + 28 * lineNumber)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createSensitivityLine(self, lineNumber): p = wx.Panel(self, size=(964, 430)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' Set limits and calibrate digital input levels in dB. Uncheck to restore default values.', pos=(10, 2), size=(700, 20)) p.l1 = wx.StaticText(p, -1, 'AES/EBU Gain Calibration', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '0.0', pos=(300, 32), size=(100, 20)) p.l2 = wx.StaticText(p, -1, 'AVB / MILAN / Dante Gain Calibration', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '0.0', pos=(300, 60), size=(100, 20)) p.l3 = wx.StaticText(p, -1, 'PEQ Gain Upper Limit', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '12.0', pos=(300, 88), size=(100, 20)) p.l4 = wx.StaticText(p, -1, 'PEQ Gain Lower Limit', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '-12.0', pos=(300, 116), size=(100, 20)) p.l5 = wx.StaticText(p, -1, 'Input and Local Gain Upper Limit', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '12.0', pos=(300, 144), size=(100, 20)) p.l6 = wx.StaticText(p, -1, 'Input and Local Gain Lower Limit', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '-48.0', pos=(300, 172), size=(100, 20)) p.SetPosition((0, 40 + 28 * lineNumber)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createFanControlLine(self, lineNumber): p = wx.Panel(self, size=(964, 430)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' Set fan control. Uncheck and power cycle to restore default values.', pos=(10, 2), size=(700, 20)) p.l1 = wx.StaticText(p, -1, 'Turn on at (degrees C)', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '70', pos=(300, 32), size=(100, 20)) p.l2 = wx.StaticText(p, -1, '% at lowest speed', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '50', pos=(300, 60), size=(100, 20)) p.l3 = wx.StaticText(p, -1, 'Full speed at (degrees C)', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '80', pos=(300, 88), size=(100, 20)) p.l4 = wx.StaticText(p, -1, '% at full speed', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '75', pos=(300, 116), size=(100, 20)) p.l5 = wx.StaticText(p, -1, '% during idle', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '0', pos=(300, 144), size=(100, 20)) p.l6 = wx.StaticText(p, -1, 'Turn on full power burst time (ms)', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '500', pos=(300, 172), size=(100, 20)) p.SetPosition((0, 40 + 28 * lineNumber)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createLatencyLine(self, lineNumber): p = wx.Panel(self, size=(150, 430)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(self, 10 + lineNumber, ' Adjust the latency for each input and output, and the (additional!) latency when Dante is active at 48 or 96kHz', pos=(10, 2), size=(700, 20)) if lineNumber == 0: p.l1 = wx.StaticText(p, -1, 'in 1', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '', pos=(60, 32), size=(60, 20)) p.l2 = wx.StaticText(p, -1, 'in 2', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '', pos=(60, 60), size=(60, 20)) p.l3 = wx.StaticText(p, -1, 'in 3', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '', pos=(60, 88), size=(60, 20)) p.l4 = wx.StaticText(p, -1, 'in 4', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '', pos=(60, 116), size=(60, 20)) p.l5 = wx.StaticText(p, -1, 'out 1', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '', pos=(60, 144), size=(60, 20)) p.l6 = wx.StaticText(p, -1, 'out 2', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '', pos=(60, 172), size=(60, 20)) p.SetPosition((0, 40)) if lineNumber == 1: p.checkBox.Show(False) p.l1 = wx.StaticText(p, -1, 'out 3', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '', pos=(60, 32), size=(60, 20)) p.l2 = wx.StaticText(p, -1, 'out 4', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '', pos=(60, 60), size=(60, 20)) p.l3 = wx.StaticText(p, -1, 'out 5', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '', pos=(60, 88), size=(60, 20)) p.l4 = wx.StaticText(p, -1, 'out 6', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '', pos=(60, 116), size=(60, 20)) p.l5 = wx.StaticText(p, -1, 'out 7', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '', pos=(60, 144), size=(60, 20)) p.l6 = wx.StaticText(p, -1, 'out 8', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '', pos=(60, 172), size=(60, 20)) p.SetPosition((150, 40)) if lineNumber == 2: p.checkBox.Show(False) p.l1 = wx.StaticText(p, -1, 'd48 in 1', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '', pos=(80, 32), size=(60, 20)) p.l2 = wx.StaticText(p, -1, 'd48 in 2', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '', pos=(80, 60), size=(60, 20)) p.l3 = wx.StaticText(p, -1, 'd48 in 3', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '', pos=(80, 88), size=(60, 20)) p.l4 = wx.StaticText(p, -1, 'd48 in 4', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '', pos=(80, 116), size=(60, 20)) p.l5 = wx.StaticText(p, -1, 'd48 in 5', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '', pos=(80, 144), size=(60, 20)) p.l6 = wx.StaticText(p, -1, 'd48 in 6', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '', pos=(80, 172), size=(60, 20)) p.l7 = wx.StaticText(p, -1, 'd48 in 7', pos=(30, 200)) p.l7t = wx.TextCtrl(p, -1, '', pos=(80, 200), size=(60, 20)) p.l8 = wx.StaticText(p, -1, 'd48 in 8', pos=(30, 228)) p.l8t = wx.TextCtrl(p, -1, '', pos=(80, 228), size=(60, 20)) p.SetPosition((300, 40)) if lineNumber == 3: p.checkBox.Show(False) p.l1 = wx.StaticText(p, -1, 'd48 out 1', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '', pos=(85, 32), size=(60, 20)) p.l2 = wx.StaticText(p, -1, 'd48 out 2', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '', pos=(85, 60), size=(60, 20)) p.l3 = wx.StaticText(p, -1, 'd48 out 3', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '', pos=(85, 88), size=(60, 20)) p.l4 = wx.StaticText(p, -1, 'd48 out 4', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '', pos=(85, 116), size=(60, 20)) p.l5 = wx.StaticText(p, -1, 'd48 out 5', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '', pos=(85, 144), size=(60, 20)) p.l6 = wx.StaticText(p, -1, 'd48 out 6', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '', pos=(85, 172), size=(60, 20)) p.l7 = wx.StaticText(p, -1, 'd48 out 7', pos=(30, 200)) p.l7t = wx.TextCtrl(p, -1, '', pos=(85, 200), size=(60, 20)) p.l8 = wx.StaticText(p, -1, 'd48 out 8', pos=(30, 228)) p.l8t = wx.TextCtrl(p, -1, '', pos=(85, 228), size=(60, 20)) p.SetPosition((450, 40)) if lineNumber == 4: p.checkBox.Show(False) p.l1 = wx.StaticText(p, -1, 'd96 in 1', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '', pos=(80, 32), size=(60, 20)) p.l2 = wx.StaticText(p, -1, 'd96 in 2', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '', pos=(80, 60), size=(60, 20)) p.l3 = wx.StaticText(p, -1, 'd96 in 3', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '', pos=(80, 88), size=(60, 20)) p.l4 = wx.StaticText(p, -1, 'd96 in 4', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '', pos=(80, 116), size=(60, 20)) p.l5 = wx.StaticText(p, -1, 'd96 in 5', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '', pos=(80, 144), size=(60, 20)) p.l6 = wx.StaticText(p, -1, 'd96 in 6', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '', pos=(80, 172), size=(60, 20)) p.l7 = wx.StaticText(p, -1, 'd96 in 7', pos=(30, 200)) p.l7t = wx.TextCtrl(p, -1, '', pos=(80, 200), size=(60, 20)) p.l8 = wx.StaticText(p, -1, 'd96 in 8', pos=(30, 228)) p.l8t = wx.TextCtrl(p, -1, '', pos=(80, 228), size=(60, 20)) p.SetPosition((600, 40)) if lineNumber == 5: p.checkBox.Show(False) p.l1 = wx.StaticText(p, -1, 'd96 out 1', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '', pos=(85, 32), size=(60, 20)) p.l2 = wx.StaticText(p, -1, 'd96 out 2', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '', pos=(85, 60), size=(60, 20)) p.l3 = wx.StaticText(p, -1, 'd96 out 3', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '', pos=(85, 88), size=(60, 20)) p.l4 = wx.StaticText(p, -1, 'd96 out 4', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '', pos=(85, 116), size=(60, 20)) p.l5 = wx.StaticText(p, -1, 'd96 out 5', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '', pos=(85, 144), size=(60, 20)) p.l6 = wx.StaticText(p, -1, 'd96 out 6', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '', pos=(85, 172), size=(60, 20)) p.l7 = wx.StaticText(p, -1, 'd96 out 7', pos=(30, 200)) p.l7t = wx.TextCtrl(p, -1, '', pos=(85, 200), size=(60, 20)) p.l8 = wx.StaticText(p, -1, 'd96 out 8', pos=(30, 228)) p.l8t = wx.TextCtrl(p, -1, '', pos=(85, 228), size=(60, 20)) p.SetPosition((750, 40)) p.checkBox.SetValue(0) p.checkBox.Enable(True) self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) p.key = None self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createFlashLine(self, lineNumber): p = wx.Panel(self, size=(964, 430)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' Do NOT change these parameters without explicit instruction. BAD things can happen!!', pos=(10, 2), size=(700, 20)) p.l1 = wx.StaticText(p, -1, 'iDH', pos=(30, 32)) p.l1t = wx.TextCtrl(p, -1, '', pos=(100, 32), size=(100, 20)) p.l2 = wx.StaticText(p, -1, 'iDM', pos=(30, 60)) p.l2t = wx.TextCtrl(p, -1, '', pos=(100, 60), size=(100, 20)) p.l3 = wx.StaticText(p, -1, 'iDL', pos=(30, 88)) p.l3t = wx.TextCtrl(p, -1, '', pos=(100, 88), size=(100, 20)) p.l4 = wx.StaticText(p, -1, 'fID', pos=(30, 116)) p.l4t = wx.TextCtrl(p, -1, '', pos=(100, 116), size=(100, 20)) p.l5 = wx.StaticText(p, -1, 'fS', pos=(30, 144)) p.l5t = wx.TextCtrl(p, -1, '', pos=(100, 144), size=(100, 20)) p.l6 = wx.StaticText(p, -1, 'hR', pos=(30, 172)) p.l6t = wx.TextCtrl(p, -1, '', pos=(100, 172), size=(100, 20)) p.SetPosition((0, 40 + 28 * lineNumber)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createFIRLine(self, lineNumber): p = wx.Panel(self, size=(964, 80)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' User', pos=(10, 2), size=(70, 20)) p.warningLabel = wx.StaticText(p, -1, 'Warning: All FIR filters will be reset. Setting the FIR configuration to an unequal amount of taps per output will ', pos=(80, 28)) p.warningLabel2 = wx.StaticText(p, -1, 'disable FIR loading through the Loudspeaker Library functionality. ', pos=(80, 46)) p.warningLabel3 = wx.StaticText(p, -1, 'Please restart the software after changing this setting.', pos=(80, 64)) p.firFlavourChoice = wx.Choice(p, 80 + lineNumber, choices=self.flavours.values(), style=wx.BORDER_NONE, pos=(80, 0), size=(500, 26)) p.firFlavourChoice.SetStringSelection(self.flavours[0]) p.SetPosition((0, 40 + 50 * lineNumber)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.Bind(wx.EVT_CHOICE, self.OnChangeFlavour, id=80 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createVariousLine1(self, lineNumber): p = wx.Panel(self, size=(964, 300)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' Enable', pos=(10, 0), size=(70, 20)) p.qFactorLabel = wx.StaticText(p, -1, 'Filter Q Calculation', pos=(90, 2)) p.firFlavourChoice = wx.Choice(p, 80 + lineNumber, choices=self.qFlavours.values(), style=wx.BORDER_NONE, pos=(280, 0), size=(300, 26)) p.firFlavourChoice.SetStringSelection(self.qFlavours[0]) p.showBandwidthLabel = wx.StaticText(p, -1, 'Filter Width Indication', pos=(90, 30)) p.showBandwidthChoice = wx.Choice(p, 60, choices=('Q Factor', 'Bandwidth'), style=wx.BORDER_NONE, pos=(280, 28), size=(300, 26)) p.showBandwidthChoice.SetStringSelection('Q Factor') p.stepSizeLabel = wx.StaticText(p, -1, 'Display Gain Adjustment', pos=(90, 58)) p.stepSizeChoice = wx.Choice(p, 70, choices=('0.25 dB', '0.5 dB', '1 dB'), style=wx.BORDER_NONE, pos=(280, 56), size=(300, 26)) p.stepSizeChoice.SetStringSelection('1 dB') p.muteLabel = wx.StaticText(p, -1, 'Mute At Minimal Gain', pos=(90, 86)) p.muteOnMinGain = wx.CheckBox(p, -1, 'The signal will be muted when the gain is set to the minimum value', pos=(279, 86)) p.muteOnMinGain.SetValue(1) p.outLevelRefLabel = wx.StaticText(p, -1, 'Output VU Meter Reference', pos=(90, 114)) p.outLevelReference = wx.TextCtrl(p, 21, '', pos=(280, 114), size=(100, 20)) p.outLevelReference.SetValue('0 dBu') p.outLevelRelative = wx.CheckBox(p, -1, 'Relative to Limiter Threshold', pos=(390, 114)) p.outLevelRelative.SetValue(1) p.gainLabel = wx.StaticText(p, -1, 'Gain Controls', pos=(90, 142)) p.alwaysEnableGain = wx.CheckBox(p, -1, 'Enable Gain Control even if outputs are locked', pos=(279, 142)) p.alwaysEnableGain.SetValue(0) p.linkLabel = wx.StaticText(p, -1, 'Revert To user Mode', pos=(90, 170)) p.lockOnLinkLost = wx.CheckBox(p, -1, 'Set hardware to User Mode when software is disconnected', pos=(279, 170)) p.lockOnLinkLost.SetValue(0) p.dualLabel = wx.StaticText(p, -1, 'Simultaneous Control', pos=(90, 198)) p.enableSimultaneousControl = wx.CheckBox(p, -1, 'Enable front panel control while software is connected', pos=(279, 198)) p.enableSimultaneousControl.SetValue(1) p.uvplabel = wx.StaticText(p, -1, 'Under Voltage Protection', pos=(90, 226)) p.uvplabelVCC = wx.StaticText(p, -1, 'VCC', pos=(280, 226)) p.uvpVCC = wx.TextCtrl(p, -1, 'Default', pos=(320, 224), size=(60, 20)) p.uvplabelVSS = wx.StaticText(p, -1, 'VSS', pos=(390, 226)) p.uvpVSS = wx.TextCtrl(p, -1, 'Default', pos=(430, 224), size=(60, 20)) p.uvplabelVD = wx.StaticText(p, -1, 'VD', pos=(500, 226)) p.uvpVD = wx.TextCtrl(p, -1, 'Default', pos=(530, 224), size=(60, 20)) p.blockKeyslabel = wx.StaticText(p, -1, 'Disable front panel at', pos=(90, 254)) p.blockKeysLevel = wx.Choice(p, -1, choices=blockKeysOptions.values(), style=wx.BORDER_NONE, pos=(280, 252), size=(200, 26)) p.SetPosition((0, 40)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.Bind(wx.EVT_CHOICE, self.OnChangeFlavour, id=80 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createVariousLine2(self, lineNumber): p = wx.Panel(self, size=(964, 340)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' Enable', pos=(10, 0), size=(70, 20)) p.qFactorLabel = wx.StaticText(p, -1, 'Highest Restart User Level', pos=(90, 2)) p.firFlavourChoice = wx.Choice(p, 80 + lineNumber, choices=userFlavours.values(), style=wx.BORDER_NONE, pos=(280, 0), size=(300, 26)) p.firFlavourChoice.SetStringSelection('User') p.showBandwidthLabel = wx.StaticText(p, -1, 'Generator Level', pos=(90, 30)) p.showBandwidthChoice = wx.Choice(p, 60, choices=generatorLevelOptions.values(), style=wx.BORDER_NONE, pos=(280, 28), size=(300, 26)) p.showBandwidthChoice.SetStringSelection('-24dBu') p.grantUserInputAccessLabel = wx.StaticText(p, -1, 'Override Display Access', pos=(90, 58)) p.userLabel = wx.StaticText(p, -1, 'User', pos=(280, 58)) p.adminLabel = wx.StaticText(p, -1, 'Admin', pos=(400, 58)) p.userAccess = wx.TextCtrl(p, -1, '0', pos=(330, 56), size=(50, 20)) p.adminAccess = wx.TextCtrl(p, -1, '0', pos=(450, 56), size=(50, 20)) p.muteLabel = wx.StaticText(p, -1, 'Mute Default Preset', pos=(90, 86)) p.muteOnMinGain = wx.CheckBox(p, -1, 'When an empty (default) preset is loaded, all outputs will be muted', pos=(279, 86)) p.muteOnMinGain.SetValue(0) p.outLevelRefLabel = wx.StaticText(p, -1, 'Key delay LEDs', pos=(90, 114)) p.outLevelReference = wx.TextCtrl(p, 21, '', pos=(280, 114), size=(100, 20)) p.outLevelReference.SetValue('') p.gainLabel = wx.StaticText(p, -1, 'Mute On Preset Change', pos=(90, 142)) p.alwaysEnableGain = wx.CheckBox(p, -1, 'Mute the signal when changing preset', pos=(279, 142)) p.alwaysEnableGain.SetValue(0) p.linkLabel = wx.StaticText(p, -1, 'Blink Default Preset', pos=(90, 170)) p.lockOnLinkLost = wx.CheckBox(p, -1, 'Blink front panel LEDs when default preset is loaded', pos=(279, 170)) p.lockOnLinkLost.SetValue(0) p.dualLabel = wx.StaticText(p, -1, 'SLEEP during Standby', pos=(90, 198)) p.enableSimultaneousControl = wx.CheckBox(p, -1, 'Assert SLEEP pins during Standby', pos=(279, 198)) p.enableSimultaneousControl.SetValue(0) p.uvplabel = wx.StaticText(p, -1, 'Generator Frequency (Hz)', pos=(90, 226)) p.uvplabelVCC = wx.StaticText(p, -1, '', pos=(280, 226)) p.uvpVCC = wx.TextCtrl(p, -1, '', pos=(320, 224), size=(60, 20)) p.uvplabelVSS = wx.StaticText(p, -1, '', pos=(390, 226)) p.uvpVCC.Show(False) p.uvpVSS = wx.TextCtrl(p, -1, '', pos=(430, 224), size=(60, 20)) p.uvplabelVD = wx.StaticText(p, -1, '', pos=(500, 226)) p.uvpVSS.Show(False) p.uvpVD = wx.TextCtrl(p, -1, '', pos=(280, 224), size=(100, 20)) p.uvpVD.SetValue('1000') p.blockKeyslabel = wx.StaticText(p, -1, 'Power Good Input', pos=(90, 254)) p.blockKeysLevel = wx.Choice(p, -1, choices=powerGoodOptions.values(), style=wx.BORDER_NONE, pos=(280, 252), size=(200, 26)) p.enablePowerGood = wx.CheckBox(p, -1, 'Enable', pos=(500, 254)) p.enablePowerGood.SetValue(0) p.invertKeys = wx.CheckBox(p, -1, 'Hardware Keys Active High', pos=(400, 114)) p.invertKeys.SetValue(0) p.enableLoadControlLabel = wx.StaticText(p, -1, 'Enable Load Control', pos=(90, 282)) p.enableLoadControl = wx.CheckBox(p, -1, 'Do not enable without setting limits first!', pos=(279, 282)) p.enableLoadControl.SetValue(0) p.linkPresetLabel = wx.StaticText(p, -1, 'Stereo Link Default Preset', pos=(90, 310)) p.outLevelRelative = wx.CheckBox(p, -1, 'When loading an empty preset, the channels will be linked by defailt', pos=(279, 310)) p.outLevelRelative.SetValue(1) p.SetPosition((0, 40)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.Bind(wx.EVT_CHOICE, self.OnChangeFlavour, id=80 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createHardwareGainLine(self, lineNumber): p = wx.Panel(self, size=(964, 430)) p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' Do NOT change these parameters without explicit instruction. BAD things can happen!!', pos=(10, 2), size=(700, 20)) p.sMLabel = wx.StaticText(p, -1, 'zBFIV', pos=(30, 32)) p.zeroDBFSInputVoltage = wx.TextCtrl(p, 20, '', pos=(100, 32), size=(100, 20)) p.dDGLabel = wx.StaticText(p, -1, 'dDG', pos=(30, 60)) p.dspDacGain = wx.TextCtrl(p, 21, '', pos=(100, 60), size=(100, 20)) p.mCGLabel = wx.StaticText(p, -1, 'mCG', pos=(30, 88)) p.mixerCorrectionGain = wx.TextCtrl(p, 21, '', pos=(100, 88), size=(100, 20)) p.dOOLabel = wx.StaticText(p, -1, 'dOO', pos=(30, 116)) p.dcOffsetOut = wx.TextCtrl(p, 22, '', pos=(100, 116), size=(100, 20)) p.SetPosition((0, 40 + 28 * lineNumber)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def createStackingLine(self, lineNumber): p = wx.Panel(self, size=(964, 430)) if lineNumber > 0: p.lineNumber = lineNumber p.key = None p.Show(False) self.lines[lineNumber] = p return else: p.lineNumber = lineNumber p.Show(False) p.checkBox = wx.CheckBox(p, 10 + lineNumber, ' Do NOT change these parameters without explicit instruction. BAD things can happen!!', pos=(10, 2), size=(700, 20)) p.unityGainPointerChoice = {} p.stackingGainPointerChoice = {} o1 = -30 o2 = -60 o3 = -60 for channel in range(8): p.uGPLabel = wx.StaticText(p, -1, 'uGL_' + str(channel), pos=(30, 32 + channel * 28)) p.unityGainPointerChoice[channel] = wx.Choice(p, 80 + channel, choices=[_[1] for i in range(8)], style=wx.BORDER_NONE, pos=(80, 28 + channel * 28), size=(50, 26)) p.unityGainPointerChoice[channel].SetStringSelection(str(channel)) p.sGPLabel = wx.StaticText(p, -1, 'sGL_' + str(channel), pos=(o1 + 200, 32 + channel * 28)) p.stackingGainPointerChoice[channel] = wx.Choice(p, 90 + channel, choices=[_[2] for i in range(8)], style=wx.BORDER_NONE, pos=(o1 + 254, 28 + channel * 28), size=(50, 26)) p.stackingGainPointerChoice[channel].SetStringSelection(str(channel)) p.sMLabel = wx.StaticText(p, -1, 'sM', pos=(o2 + 370, 32)) p.stackingMode = wx.Choice(p, 40, choices=('Off', 'Single', 'Dual', 'AVB Direct'), style=wx.BORDER_NONE, pos=(o2 + 410, 28), size=(100, 26)) p.sGLabel = wx.StaticText(p, -1, 'sG', pos=(o2 + 370, 60)) p.stackingGain = wx.TextCtrl(p, 20 + i, '', pos=(o2 + 410, 60), size=(100, 20)) p.sHT = wx.StaticText(p, -1, 'sHT', pos=(o2 + 370, 88)) p.stackingHighThreshold = wx.TextCtrl(p, 30 + i, '', pos=(o2 + 410, 88), size=(100, 20)) p.sKT = wx.StaticText(p, -1, 'sKT', pos=(o2 + 370, 116)) p.stackingKeepThreshold = wx.TextCtrl(p, 30 + i, '', pos=(o2 + 410, 116), size=(100, 20)) p.sLT = wx.StaticText(p, -1, 'sLT', pos=(o2 + 370, 144)) p.stackingLowThreshold = wx.TextCtrl(p, 30 + i, '', pos=(o2 + 410, 144), size=(100, 20)) p.sDT = wx.StaticText(p, -1, 'sD', pos=(o2 + 370, 172)) p.stackingDelay = wx.TextCtrl(p, 30 + i, '', pos=(o2 + 410, 172), size=(100, 20)) p.rL = wx.StaticText(p, -1, 'rL', pos=(o2 + 370, 200)) p.risingLatency = wx.TextCtrl(p, 30 + i, '', pos=(o2 + 410, 200), size=(100, 20)) p.fL = wx.StaticText(p, -1, 'fL', pos=(o2 + 370, 228)) p.fallingLatency = wx.TextCtrl(p, 30 + i, '', pos=(o2 + 410, 228), size=(100, 20)) p.nOP = wx.StaticText(p, -1, 'nOP', pos=(o3 + 520, 32)) p.numberOfPresets = wx.TextCtrl(p, 30 + i, '', pos=(o3 + 560, 32), size=(100, 20)) p.SetPosition((0, 40 + 28 * lineNumber)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + lineNumber) self.lines[lineNumber] = p self.enable(lineNumber) p.Show(True) return p def OnChangeFlavour(self, e): lineNumber = e.GetId() - 80 line = self.lines[lineNumber] print mytime.displayTime(), 'ucf.Selected', line.firFlavourChoice.GetStringSelection() flavourString = line.firFlavourChoice.GetStringSelection() flavour = 0 for key in self.flavours: if self.flavours[key] == flavourString: flavour = key break return def OnEnabled(self, e): lineNumber = e.GetId() - 10 self.enable(lineNumber) return def enable(self, lineNumber): line = self.lines[lineNumber] val = line.checkBox.GetValue() try: line.firFlavourChoice.Enable(val) except: pass try: flavourString = line.firFlavourChoice.GetStringSelection() flavour = 0 for key in self.flavours: if self.flavours[key] == flavourString: flavour = key break except: pass try: try: line.stepSizeChoice.Enable(val) except: pass try: line.userLabel.Enable(val) line.adminLabel.Enable(val) line.userAccess.Enable(val) line.adminAccess.Enable(val) except: pass line.showBandwidthChoice.Enable(val) line.muteOnMinGain.Enable(val) line.outLevelRelative.Enable(val) line.outLevelReference.Enable(val) line.alwaysEnableGain.Enable(val) line.lockOnLinkLost.Enable(val) line.enableSimultaneousControl.Enable(val) line.uvplabelVD.Enable(val) line.uvpVD.Enable(val) line.uvplabelVCC.Enable(val) line.uvpVCC.Enable(val) line.uvplabelVSS.Enable(val) line.uvpVSS.Enable(val) line.blockKeysLevel.Enable(val) try: line.enablePowerGood.Enable(val) except: pass try: line.enableLoadControl.Enable(val) except: pass except: pass return def evaluateLine_latencySettings(self, line): if self.lines[0].checkBox.GetValue() == 0: return else: try: v1 = int(line.l1t.GetValue()) except: v1 = 0 try: v2 = int(line.l2t.GetValue()) except: v2 = 0 try: v3 = int(line.l3t.GetValue()) except: v3 = 0 try: v4 = int(line.l4t.GetValue()) except: v4 = 0 try: v5 = int(line.l5t.GetValue()) except: v5 = 0 try: v6 = int(line.l6t.GetValue()) except: v6 = 0 try: v7 = int(line.l7t.GetValue()) except: v7 = 0 try: v8 = int(line.l8t.GetValue()) except: v8 = 0 if line.lineNumber in (0, 1): try: sendString = '' + chr(self.uiNumber) sendString += chr(7 + line.lineNumber) sendString += chr(v1) sendString += chr(v2) sendString += chr(v3) sendString += chr(v4) sendString += chr(v5) sendString += chr(v6) mys = 'String: ' for c in sendString: mys += hex(ord(c)) + ':' print mys return sendString except: print mytime.displayTime(), 'ucf.eL.failed to build string' traceback.print_exc(file=sys.stdout) elif v1 > 15: v1 = 15 if v2 > 15: v2 = 15 if v3 > 15: v3 = 15 if v4 > 15: v4 = 15 if v5 > 15: v5 = 15 if v6 > 15: v6 = 15 if v7 > 15: v7 = 15 if v8 > 15: v8 = 15 try: sendString = '' + chr(self.uiNumber) sendString += chr(9 + line.lineNumber) sendString += chr(v1 + (v2 << 4)) sendString += chr(v3 + (v4 << 4)) sendString += chr(v5 + (v6 << 4)) sendString += chr(v7 + (v8 << 4)) sendString += chr(0) sendString += chr(0) mys = 'String: ' for c in sendString: mys += hex(ord(c)) + ':' print mys return sendString except: print mytime.displayTime(), 'ucf.eL.failed to build string' traceback.print_exc(file=sys.stdout) return def evaluateLine_firFlavour(self, line): if line.checkBox.GetValue() == 0: return else: flavourString = self.lines[self.numberOfFactoryKeys].firFlavourChoice.GetStringSelection() flavour = 0 for key in self.flavours: if self.flavours[key] == flavourString: flavour = key break try: sendString = '' + chr(self.uiNumber) sendString += chr(0) sendString += chr(0) sendString += chr(0) sendString += chr(0) sendString += chr(flavour) sendString += chr(0) sendString += chr(0) mys = 'String: ' for c in sendString: mys += hex(ord(c)) + ':' print mys map = self.flavourMap[flavour] print 'ucv.fir map:', map self.frame.frame.parent.FIR_taps = map self.frame.frame.parent.model.resetFIR() self.frame.frame.parent.current_view.renderAll() return sendString except: print mytime.displayTime(), 'ucfc.eL.failed to build string' traceback.print_exc(file=sys.stdout) return def evaluateLine_sensitivity(self, line): if self.lines[0].checkBox.GetValue() == 0: return else: try: v1 = float(line.l1t.GetValue()) if v1 > 12: v1 = 12 if v1 < -12: v1 = -12 v1 = v1 * 10 + 128 except: v1 = 128 try: v2 = float(line.l2t.GetValue()) if v2 > 12: v2 = 12 if v2 < -12: v2 = -12 v2 = v2 * 10 + 128 except: v2 = 128 try: v3 = float(line.l3t.GetValue()) if v3 > 12: v3 = 12 if v3 < -12: v3 = -12 v3 = v3 + 128 except: v3 = 128 try: v4 = float(line.l4t.GetValue()) if v4 > 12: v4 = 12 if v4 < -12: v4 = -12 v4 = v4 + 128 except: v4 = 128 try: v5 = float(line.l5t.GetValue()) if v5 > 12: v5 = 12 if v5 < -100: v5 = -100 v5 = v5 + 128 except: v5 = 128 try: v6 = float(line.l6t.GetValue()) if v6 > 12: v6 = 12 if v6 < -100: v6 = -100 v6 = v6 + 128 except: v6 = 128 if line.lineNumber in (0, 1): try: if v6 >= v5: v6 = v5 - 1 if v4 >= v3: v4 = v3 - 1 sendString = '' + chr(self.uiNumber) sendString += chr(16) sendString += chr(int(v1)) sendString += chr(int(v2)) sendString += chr(int(v3)) sendString += chr(int(v4)) sendString += chr(int(v5)) sendString += chr(int(v6)) return sendString except: print mytime.displayTime(), 'ucf.eL.failed to build string' traceback.print_exc(file=sys.stdout) return def evaluateLine_modelNumber(self, line): if self.lines[0].checkBox.GetValue() == 0: return else: try: v1 = int(line.l1t.GetValue()) if line.modelNumberFromHwresistor.GetValue(): v1 |= 32 if line.modelNumberFromEEPROM.GetValue(): v1 |= 64 if line.hwResistorMapHKVersion.GetValue(): v1 |= 128 except: v1 = 22 try: v2 = int(line.l2t.GetValue()) if line.modelNumberFromEepromIfHwresistorZero.GetValue(): v2 |= 32 except: v2 = 13 try: v3 = int(line.l3t.GetValue()) except: v3 = 0 try: v4 = int(line.l4t.GetValue()) except: v4 = 0 try: v5 = int(line.l5t.GetValue()) except: v5 = 0 try: v6 = int(line.l6t.GetValue()) except: v6 = 5 if line.lineNumber in (0, 1): try: sendString = '' + chr(self.uiNumber) sendString += chr(17) sendString += chr(v1) sendString += chr(v2) sendString += chr(v3) sendString += chr(v4) sendString += chr(v5) sendString += chr(v6) return sendString except: print mytime.displayTime(), 'ucf.eL.failed to build string' traceback.print_exc(file=sys.stdout) return def evaluateLine_fanControl(self, line): if self.lines[0].checkBox.GetValue() == 0: return else: try: v1 = int(line.l1t.GetValue()) except: v1 = 70 try: v2 = int(line.l2t.GetValue()) except: v2 = 50 try: v3 = int(line.l3t.GetValue()) except: v3 = 80 try: v4 = int(line.l4t.GetValue()) except: v4 = 75 try: v5 = int(line.l5t.GetValue()) except: v5 = 0 try: v6 = int(line.l6t.GetValue()) / 100 except: v6 = 5 if line.lineNumber in (0, 1): try: sendString = '' + chr(self.uiNumber) sendString += chr(15) sendString += chr(v1) sendString += chr(v2) sendString += chr(v3) sendString += chr(v4) sendString += chr(v5) sendString += chr(v6) return sendString except: print mytime.displayTime(), 'ucf.eL.failed to build string' traceback.print_exc(file=sys.stdout) return def evaluateLine_Various1(self, line): if line.lineNumber != 1: return else: if line.checkBox.GetValue() == 0: return flavourString = self.lines[1].firFlavourChoice.GetStringSelection() flavour = 0 for key in self.qFlavours: if self.qFlavours[key] == flavourString: flavour = key break flags = 0 showBandwidthChoice = line.showBandwidthChoice.GetStringSelection() if showBandwidthChoice == 'Bandwidth': flags |= 1 if line.muteOnMinGain.GetValue(): flags |= 2 if line.outLevelRelative.GetValue(): flags |= 4 if line.alwaysEnableGain.GetValue(): flags |= 8 if line.lockOnLinkLost.GetValue(): flags |= 16 if line.enableSimultaneousControl.GetValue() == 0: flags |= 32 blockLeysLevel = line.blockKeysLevel.GetStringSelection() for k in blockKeysOptions.keys(): if blockKeysOptions[k] == blockLeysLevel: flags |= k << 6 break stepSize = line.stepSizeChoice.GetStringSelection() if stepSize == '0.25 dB': stepSize = 0 elif stepSize == '0.5 dB': stepSize = 1 elif stepSize == '1 dB': stepSize = 3 else: stepSize = 3 try: outLevelReference = int(line.outLevelReference.GetValue().replace('dB', '').replace('u', '')) if outLevelReference > 127: outLevelReference = 127 if outLevelReference < -127: outLevelReference = -127 except: outLevelReference = 0 try: UVP_VCC = int(float(line.uvpVCC.GetValue()) * 10) if UVP_VCC > 250: UVP_VCC = 255 if UVP_VCC <= 0: UVP_VCC = 255 except: strUVP = line.uvpVCC.GetValue().strip().lower() if strUVP.find('disable') >= 0: UVP_VCC = 255 else: UVP_VCC = 0 if UVP_VCC == 0: strUVP_VCC = 'Default' elif UVP_VCC == 255: strUVP_VCC = 'Disabled' else: strUVP_VCC = str(UVP_VCC / 10.0) line.uvpVCC.SetValue(strUVP_VCC) try: UVP_VSS = int(-float(line.uvpVSS.GetValue()) * 10) if UVP_VSS > 250: UVP_VSS = 255 if UVP_VSS <= 0: UVP_VSS = 255 except: strUVP = line.uvpVSS.GetValue().strip().lower() if strUVP.find('disable') >= 0: UVP_VSS = 255 else: UVP_VSS = 0 if UVP_VSS == 0: strUVP_VSS = 'Default' elif UVP_VSS == 255: strUVP_VSS = 'Disabled' else: strUVP_VSS = str(-(UVP_VSS / 10.0)) line.uvpVSS.SetValue(strUVP_VSS) try: UVP_VD = int(float(line.uvpVD.GetValue()) * 10) if UVP_VD > 250: UVP_VD = 255 if UVP_VD <= 0: UVP_VD = 255 except: strUVP = line.uvpVD.GetValue().strip().lower() if strUVP.find('disable') >= 0: UVP_VD = 255 else: UVP_VD = 0 if UVP_VD == 0: strUVP_VD = 'Default' elif UVP_VD == 255: strUVP_VD = 'Disabled' else: strUVP_VD = str(UVP_VD / 10.0) line.uvpVD.SetValue(strUVP_VD) try: sendString = '' + chr(self.uiNumber) sendString += chr(0) sendString += chr(UVP_VCC) sendString += chr(UVP_VSS) sendString += chr(outLevelReference + 127) sendString += chr(flavour) sendString += chr(UVP_VD & 252 | stepSize) sendString += chr(flags) mys = 'String: ' for c in sendString: mys += hex(ord(c)) + ':' print mys return sendString except: print mytime.displayTime(), 'ucf.eL.failed to build string' traceback.print_exc(file=sys.stdout) return def evaluateLine_Various2(self, line): if line.lineNumber != 1: return else: if line.checkBox.GetValue() == 0: return flavourString = self.lines[1].firFlavourChoice.GetStringSelection() flavour = 0 for key in userFlavours.keys(): if userFlavours[key] == flavourString: flavour = key - 2 break flags = 0 if line.enableLoadControl.GetValue(): flags |= 1 if line.muteOnMinGain.GetValue(): flags |= 2 if line.outLevelRelative.GetValue() == 0: flags |= 4 if line.alwaysEnableGain.GetValue(): flags |= 8 if line.lockOnLinkLost.GetValue(): flags |= 16 if line.enableSimultaneousControl.GetValue(): flags |= 32 if line.enablePowerGood.GetValue(): flags |= 64 if line.invertKeys.GetValue(): flags |= 128 powerGoodPinText = line.blockKeysLevel.GetStringSelection() powerGoodPin = 0 for k in powerGoodOptions.keys(): if powerGoodOptions[k] == powerGoodPinText: powerGoodPin = k break try: indicateKeyPressLeds = int(line.outLevelReference.GetValue().replace('dB', '').replace('u', '')) if indicateKeyPressLeds > 255: indicateKeyPressLeds = 255 if indicateKeyPressLeds < 0: indicateKeyPressLeds = 0 except: indicateKeyPressLeds = 0 try: generatorLevelString = line.showBandwidthChoice.GetStringSelection() print 'ucv.gl.1', generatorLevelString generatorLevel = 3 for k in generatorLevelOptions.keys(): print 'ucv.gl.1', k, generatorLevelOptions[k] if generatorLevelOptions[k] == generatorLevelString: generatorLevel = k break except: traceback.print_exc(file=sys.stdout) generatorLevel = 3 generatorFrequency = line.uvpVD.GetValue().lower().replace('hz', '') try: generatorFrequency = float(generatorFrequency) if generatorFrequency > 20000: generatorFrequency = 20000 if generatorFrequency < 20: generatorFrequency = 20 except: generatorFrequency = 1000 generatorFrequencyLog = 0 lowerTestFrequency = 20 higherTestFrequency = 20 while higherTestFrequency < generatorFrequency: generatorFrequencyLog += 1 lowerTestFrequency = higherTestFrequency higherTestFrequency = 20 * pow(1.027932453112032, generatorFrequencyLog) if higherTestFrequency - generatorFrequency > generatorFrequency - lowerTestFrequency: generatorFrequencyLog -= 1 try: line.uvpVD.SetValue(str(round(20 * pow(1.027932453112032, generatorFrequencyLog), 1))) except: traceback.print_exc(file=sys.stdout) userAccess = 0 try: userAccess = int(line.userAccess.GetValue()) if userAccess > 255: userAccess = 255 if userAccess < 0: userAccess = 0 except: pass adminAccess = 0 try: adminAccess = int(line.adminAccess.GetValue()) if adminAccess > 255: adminAccess = 255 if adminAccess < 0: adminAccess = 0 except: pass try: sendString = '' + chr(self.uiNumber) sendString += chr(18) sendString += chr(flavour & 3 | powerGoodPin << 2 | generatorLevel << 4) sendString += chr(indicateKeyPressLeds) sendString += chr(generatorFrequencyLog) sendString += chr(userAccess) sendString += chr(adminAccess) sendString += chr(flags) mys = 'String: ' for c in sendString: mys += hex(ord(c)) + ':' print mys return sendString except: print mytime.displayTime(), 'ucf.eL.failed to build string' traceback.print_exc(file=sys.stdout) return def evaluateLine_hardwareGainSettings(self, line): if line.lineNumber != 0: return else: if line.checkBox.GetValue() == 0: return zeroDBFSInputVoltage = int(float(self.lines[0].zeroDBFSInputVoltage.GetValue()) * 1000) if zeroDBFSInputVoltage > 65535: zeroDBFSInputVoltage = 65535 if zeroDBFSInputVoltage < 1000: zeroDBFSInputVoltage = 1000 dspDacGain = int(self.lines[0].dspDacGain.GetValue()) if dspDacGain > 10000: dspDacGain = 10000 if dspDacGain < -10000: dspDacGain = -10000 dspDacGain += 32767 mixerCorrectionGain = int(float(self.lines[0].mixerCorrectionGain.GetValue()) * 20) if mixerCorrectionGain > 127: mixerCorrectionGain = 127 if mixerCorrectionGain < -127: mixerCorrectionGain = -127 mixerCorrectionGain += 127 dcOffsetOut = int(self.lines[0].dcOffsetOut.GetValue()) if dcOffsetOut > 127: dcOffsetOut = 127 if dcOffsetOut < -127: dcOffsetOut = -127 dcOffsetOut += 127 try: sendString = '' + chr(self.uiNumber) sendString += chr(4) sendString += chr(zeroDBFSInputVoltage >> 8) sendString += chr(zeroDBFSInputVoltage & 255) sendString += chr(dspDacGain >> 8) sendString += chr(dspDacGain & 255) sendString += chr(dcOffsetOut) sendString += chr(mixerCorrectionGain) mys = 'String: ' for c in sendString: mys += hex(ord(c)) + ':' print mys return sendString except: print mytime.displayTime(), 'ucf.eL.failed to build string' traceback.print_exc(file=sys.stdout) return def evaluateLine_stackingConfiguration(self, line): if self.lines[0].checkBox.GetValue() == 0: return else: if line.lineNumber == 0: unityGainPointers = 0 stackingGainPointers = 0 for channel in range(8): unityGainPointers += int(line.unityGainPointerChoice[channel].GetStringSelection()) << channel * 3 stackingGainPointers += int(line.stackingGainPointerChoice[channel].GetStringSelection()) << channel * 3 sendString = '' + chr(self.uiNumber) sendString += chr(1) sendString += chr(unityGainPointers >> 16 & 255) sendString += chr(unityGainPointers >> 8 & 255) sendString += chr(unityGainPointers >> 0 & 255) sendString += chr(stackingGainPointers >> 16 & 255) sendString += chr(stackingGainPointers >> 8 & 255) sendString += chr(stackingGainPointers >> 0 & 255) return sendString if line.lineNumber == 1: p = self.lines[0] stackingMode = p.stackingMode.GetStringSelection() if stackingMode == 'Off': stackingMode = 0 if stackingMode == 'Single': stackingMode = 1 if stackingMode == 'Dual': stackingMode = 2 if stackingMode == 'AVB Direct': stackingMode = 3 stackingGain = int(p.stackingGain.GetValue()) if stackingGain > 6000: stackingGain = 6000 if stackingGain < 0: stackingGain = 0 stackingHighThreshold = int(p.stackingHighThreshold.GetValue()) if stackingHighThreshold > 255: stackingHighThreshold = 255 if stackingHighThreshold < 0: stackingHighThreshold = 0 stackingKeepThreshold = int(p.stackingKeepThreshold.GetValue()) / 3 if stackingKeepThreshold > 15: stackingKeepThreshold = 15 if stackingKeepThreshold < 0: stackingKeepThreshold = 0 stackingLowThreshold = int(p.stackingLowThreshold.GetValue()) / 3 if stackingLowThreshold > 15: stackingLowThreshold = 15 if stackingLowThreshold < 0: stackingLowThreshold = 0 stackingDelay = int(float(p.stackingDelay.GetValue()) * 1.024) if stackingDelay > 4095: stackingDelay = 4095 if stackingDelay < 0: stackingDelay = 0 sendString = '' + chr(self.uiNumber) sendString += chr(2) sendString += chr((stackingDelay >> 4 & 240) + stackingMode) sendString += chr(stackingGain >> 8) sendString += chr(stackingGain & 255) sendString += chr(stackingHighThreshold) sendString += chr((stackingLowThreshold << 4) + stackingKeepThreshold) sendString += chr(stackingDelay & 255) return sendString if line.lineNumber == 2: p = self.lines[0] l1 = int(p.risingLatency.GetValue()) if l1 > 255: l1 = 255 if l1 < 0: l1 = 0 l2 = int(p.fallingLatency.GetValue()) if l2 > 255: l2 = 255 if l2 < 0: l2 = 0 try: nOP = int(p.numberOfPresets.GetValue()) if nOP > 250: nOP = 250 if nOP < 1: nOP = 1 except: nOP = 1 sendString = '' + chr(self.uiNumber) sendString += chr(3) sendString += chr(l1) sendString += chr(l2) sendString += chr(nOP) sendString += chr(0) sendString += chr(0) sendString += chr(0) return sendString return def evaluateLine(self, line): try: if self.uiType == 'uiFirFlavours': return self.evaluateLine_firFlavour(line) if self.uiType == 'uiVarious1': return self.evaluateLine_Various1(line) if self.uiType == 'uiStackingConfiguration': return self.evaluateLine_stackingConfiguration(line) if self.uiType == 'uiHardwareGainSettings': return self.evaluateLine_hardwareGainSettings(line) if self.uiType == 'uiLatency': return self.evaluateLine_latencySettings(line) if self.uiType == 'uiFanControl': return self.evaluateLine_fanControl(line) if self.uiType == 'uiSensitivity': return self.evaluateLine_sensitivity(line) if self.uiType == 'uiModelNumber': return self.evaluateLine_modelNumber(line) if self.uiType == 'uiVarious2': return self.evaluateLine_Various2(line) except: pass return # okay decompiling pycode/user_config_various.pyc