From e6c11dc8aed12ed11dcdcba98a14071308e33e0d Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Fri, 8 Aug 2008 18:48:58 +0000 Subject: [PATCH] add support for up to 128 LNBs now its possible to configure a usals motor behind a toneburst/committed diseqc/uncommitted diseqc switch (in advanced satellite config.. choose "All Satellites X" as Satellite --- lib/python/Components/NimManager.py | 38 +++++++++++++++++++++++------ lib/python/Screens/Satconfig.py | 21 +++++++++------- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 5e66b6a6..f8dab123 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -149,7 +149,6 @@ class SecConfigure: if not self.satposdepends.has_key(connto): self.satposdepends[connto] = [] self.satposdepends[connto].append(x) - for slot in nim_slots: x = slot.slot @@ -214,14 +213,24 @@ class SecConfigure: def updateAdvanced(self, sec, slotid): lnbSat = {} - for x in range(1,33): + for x in range(1,129): lnbSat[x] = [] + + #wildcard for all satellites ( for rotor ) + for x in range(3601, 3605): + lnb = int(config.Nims[slotid].advanced.sat[x].lnb.value) + if lnb != 0: + for x in self.NimManager.satList: + print "add", x[0], "to", lnb + lnbSat[lnb].append(x[0]) + for x in self.NimManager.satList: lnb = int(config.Nims[slotid].advanced.sat[x[0]].lnb.value) if lnb != 0: print "add", x[0], "to", lnb lnbSat[lnb].append(x[0]) - for x in range(1,33): + + for x in range(1,129): if len(lnbSat[x]) > 0: currLnb = config.Nims[slotid].advanced.lnb[x] sec.addLNB() @@ -370,7 +379,7 @@ class SecConfigure: elif currSat.tonemode == "off": sec.setToneMode(switchParam.OFF) - if not currSat.usals.value: + if not currSat.usals.value and x < 125: sec.setRotorPosNum(currSat.rotorposition.value) else: sec.setRotorPosNum(0) #USALS @@ -881,10 +890,11 @@ def InitNimManager(nimmgr): # advanced config: nim.advanced = ConfigSubsection() - nim.advanced.sats = getConfigSatlist(192,nimmgr.satList) + tmp = [(3601, _('All Satellites 1'), 1), (3602, _('All Satellites 2'), 1), (3603, _('All Satellites 3'), 1), (3604, _('All Satellites 4'), 1)] + nim.advanced.sats = getConfigSatlist(192,nimmgr.satList+tmp) nim.advanced.sat = ConfigSubDict() lnbs = [("0", "not available")] - for y in range(1, 33): + for y in range(1, 125): lnbs.append((str(y), "LNB " + str(y))) for x in nimmgr.satList: @@ -895,6 +905,15 @@ def InitNimManager(nimmgr): nim.advanced.sat[x[0]].rotorposition = ConfigInteger(default=1, limits=(1, 255)) nim.advanced.sat[x[0]].lnb = ConfigSelection(choices = lnbs) + for x in range(3601, 3605): + nim.advanced.sat[x] = ConfigSubsection() + nim.advanced.sat[x].voltage = ConfigSelection(choices={"polarization": _("Polarization"), "13V": _("13 V"), "18V": _("18 V")}, default = "polarization") + nim.advanced.sat[x].tonemode = ConfigSelection(choices={"band": _("Band"), "on": _("On"), "off": _("Off")}, default = "band") + nim.advanced.sat[x].usals = ConfigYesNo(default=True) + nim.advanced.sat[x].rotorposition = ConfigInteger(default=1, limits=(1, 255)) + lnbnum = 125+x-3601 + nim.advanced.sat[x].lnb = ConfigSelection(choices = [("0", "not available"), (str(lnbnum), "LNB %d"%(lnbnum))], default="0") + csw = [("none", _("None")), ("AA", _("AA")), ("AB", _("AB")), ("BA", _("BA")), ("BB", _("BB"))] for y in range(0, 16): csw.append((str(0xF0|y), "Input " + str(y+1))) @@ -905,7 +924,7 @@ def InitNimManager(nimmgr): nim.advanced.lnb = ConfigSubList() nim.advanced.lnb.append(ConfigNothing()) - for x in range(1, 33): + for x in range(1, 129): nim.advanced.lnb.append(ConfigSubsection()) nim.advanced.lnb[x].lof = ConfigSelection(choices={"universal_lnb": _("Universal LNB"), "c_band": _("C-Band"), "user_defined": _("User defined")}, default="universal_lnb") nim.advanced.lnb[x].lofl = ConfigInteger(default=9750, limits = (0, 99999)) @@ -914,7 +933,10 @@ def InitNimManager(nimmgr): # nim.advanced.lnb[x].output_12v = ConfigSelection(choices = [("0V", _("0 V")), ("12V", _("12 V"))], default="0V") nim.advanced.lnb[x].increased_voltage = ConfigYesNo(default=False) nim.advanced.lnb[x].toneburst = ConfigSelection(choices = [("none", _("None")), ("A", _("A")), ("B", _("B"))], default = "none") - nim.advanced.lnb[x].diseqcMode = ConfigSelection(choices = [("none", _("None")), ("1_0", _("1.0")), ("1_1", _("1.1")), ("1_2", _("1.2"))], default = "none") + if x > 124: + nim.advanced.lnb[x].diseqcMode = ConfigSelection(choices = [("1_2", _("1.2"))], default = "1_2") + else: + nim.advanced.lnb[x].diseqcMode = ConfigSelection(choices = [("none", _("None")), ("1_0", _("1.0")), ("1_1", _("1.1")), ("1_2", _("1.2"))], default = "none") nim.advanced.lnb[x].commitedDiseqcCommand = ConfigSelection(choices = csw) nim.advanced.lnb[x].fastDiseqc = ConfigYesNo(default=False) nim.advanced.lnb[x].sequenceRepeat = ConfigYesNo(default=False) diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index b3e54018..37208cdc 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -205,7 +205,8 @@ class NimSetup(Screen, ConfigListScreen): self.saveAll() def fillListWithAdvancedSatEntrys(self, Sat): - currLnb = self.nimConfig.advanced.lnb[int(Sat.lnb.value)] + lnbnum = int(Sat.lnb.value) + currLnb = self.nimConfig.advanced.lnb[lnbnum] if isinstance(currLnb, ConfigNothing): currLnb = None @@ -213,17 +214,19 @@ class NimSetup(Screen, ConfigListScreen): self.list.append(getConfigListEntry(_("Voltage mode"), Sat.voltage)) self.list.append(getConfigListEntry(_("Tone mode"), Sat.tonemode)) if currLnb and currLnb.diseqcMode.value == "1_2": - self.advancedUsalsEntry = getConfigListEntry(_("Use usals for this sat"), Sat.usals) - self.list.append(self.advancedUsalsEntry) - if not Sat.usals.value: - self.list.append(getConfigListEntry(_("Stored position"), Sat.rotorposition)) + if lnbnum < 125: + self.advancedUsalsEntry = getConfigListEntry(_("Use usals for this sat"), Sat.usals) + self.list.append(self.advancedUsalsEntry) + if not Sat.usals.value: + self.list.append(getConfigListEntry(_("Stored position"), Sat.rotorposition)) # LNBs self.advancedLnbsEntry = getConfigListEntry(_("LNB"), Sat.lnb) self.list.append(self.advancedLnbsEntry) if currLnb: - self.advancedDiseqcMode = getConfigListEntry(_("DiSEqC mode"), currLnb.diseqcMode) - self.list.append(self.advancedDiseqcMode) + if lnbnum < 125: + self.advancedDiseqcMode = getConfigListEntry(_("DiSEqC mode"), currLnb.diseqcMode) + self.list.append(self.advancedDiseqcMode) if currLnb.diseqcMode.value != "none": self.list.append(getConfigListEntry(_("Toneburst"), currLnb.toneburst)) self.list.append(getConfigListEntry(_("Committed DiSEqC command"), currLnb.commitedDiseqcCommand)) @@ -282,8 +285,8 @@ class NimSetup(Screen, ConfigListScreen): self.list.append(self.configMode) self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats) self.list.append(self.advancedSatsEntry) - for x in nimmanager.satList: - Sat = self.nimConfig.advanced.sat[x[0]] + for x in self.nimConfig.advanced.sat.keys(): + Sat = self.nimConfig.advanced.sat[x] self.fillListWithAdvancedSatEntrys(Sat) self["config"].list = self.list -- 2.30.2