Skip to content
Permalink
Browse files

Change FullMultiType to HotSwitchableMultiType

And other changes e.g. remove and add "nothing" for configMode in a
different way
  • Loading branch information...
Littlesat
Littlesat committed Feb 11, 2019
1 parent 42dc1d7 commit 1aede1df161f31946eb78a05f20fd531d9694fc5
Showing with 53 additions and 32 deletions.
  1. +38 −19 lib/python/Components/NimManager.py
  2. +15 −13 lib/python/Screens/Satconfig.py
@@ -520,7 +520,7 @@ def __init__(self, slot, type, description, has_outputs = True, internally_conne
self.multi_type[str(types.index(type))] = type

def isCompatible(self, what):
if self.isFullMultiType():
if self.isHotSwitchableMultiType():
return self.canBeCompatible(what)
else:
return self.isSupported() and what in self.compatible[self.getType()]
@@ -530,7 +530,7 @@ def canBeCompatible(self, what):

def getType(self):
try:
if self.isFullMultiType():
if self.isHotSwitchableMultiType():
return "DVB-S2X" #return dvb-s2x when we have full multitype as this enables all DVB-S2X features
elif self.isMultiType():
return self.multi_type.get(self.config.multiType.value, None)
@@ -580,9 +580,9 @@ def removeInternalLink(self):
open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w").write("external")

def isMultiType(self):
return not self.isFullMultiType() and bool(len(self.multi_type))
return not self.isHotSwitchableMultiType() and bool(len(self.multi_type))

def isFullMultiType(self):
def isHotSwitchableMultiType(self):
all_tuner_capabilities = set([y for x in [self.compatible[x] for x in self.multi_type.values()] for y in x])
return "DVB-S" in all_tuner_capabilities and ("DVB-C" in all_tuner_capabilities or "DVB-T" in all_tuner_capabilities)

@@ -622,7 +622,7 @@ def isNotFirstFBCTuner(self):
return self.isFBCTuner() and self.slot % 8 and True

def getFriendlyType(self):
return (" + ".join(self.multi_type.values()) if self.isFullMultiType() else self.getType()) or _("empty")
return (" + ".join(self.multi_type.values()) if self.isHotSwitchableMultiType() else self.getType()) or _("empty")

def getFullDescription(self):
return self.empty and _("(empty)") or "%s (%s)" % (self.description, self.isSupported() and self.friendly_type or _("not supported"))
@@ -1550,7 +1550,15 @@ def tunerTypeChanged(nimmgr, fe_id, configElement, initial=False):
if "nothing" not in config.Nims[fe_id].configMode.choices.choices.keys():
config.Nims[fe_id].configMode.choices.choices.update({"nothing": _("disabled")})
config.Nims[fe_id].configMode.value = "nothing"
q=q

def tunerConfigChanged(nim, configElement):
if nim.configModeDVBS.value or nim.configModeDVBC.value of nim.configModeDVBT.value or nim.configModeDVBATSC.value:
if nim.configMode = "nothing":
nim.configMode = "simple"
else:
if "nothing" not in nim.configMode.choices.choices.keys():
nim.configMode.choices.choices.update({"nothing": _("disabled")})
nim.configMode.value = "nothing"

empty_slots = 0
for slot in nimmgr.nim_slots:
@@ -1564,35 +1572,44 @@ def tunerTypeChanged(nimmgr, fe_id, configElement, initial=False):

if slot.isCompatible("DVB-S"):
createSatConfig(nim, x, empty_slots)
config_mode_choices = ([("nothing", _("disabled"))] if not slot.isMultiType() else []) + [("simple", _("simple")), ("advanced", _("advanced"))]
config_mode_choices = {"nothing": _("disabled"), "simple": _("simple"), "advanced", _("advanced")}
if len(nimmgr.getNimListOfType(slot.type, exception = x)) > 0:
config_mode_choices.append(("equal", _("equal to")))
config_mode_choices.append(("satposdepends", _("second cable of motorized LNB")))
config_mode_choices.update({"equal": _("equal to")})
config_mode_choices.update({"satposdepends": _("second cable of motorized LNB")})
if len(nimmgr.canConnectTo(x)) > 0:
config_mode_choices.append(("loopthrough", _("loopthrough to")))
config_mode_choices.update({"loopthrough": ("loopthrough to")})
nim.advanced = ConfigNothing()
tmp = ConfigSelection(config_mode_choices, slot.isFBCLink() and "nothing" or "simple")
tmp.slot_id = x
tmp.addNotifier(configModeChanged, initial_call = False)
nim.configMode = tmp
if slot.isHotSwitchableMultiType():
nim.configModeDVBS = ConfigYesNo()
nim.configModeDVBS.addnotifier(boundFunction(tunerConfigChanged, nim), initial_call=False)
if slot.isCompatible("DVB-C"):
nim.configModeDVBC = ConfigYesNo()
if not slot.isFullMultiType():
if slot.isHotSwitchableMultiType():
nim.configModeDVBC = ConfigYesNo()
nim.configModeDVBC.addnotifier(boundFunction(tunerConfigChanged, nim), initial_call=False)
if not slot.isHotSwitchableMultiType():
nim.configMode = ConfigSelection(choices={"enabled": _("enabled"), "nothing": _("disabled")}, default="nothing")
createCableConfig(nim, x)
if slot.isCompatible("DVB-T"):
nim.configModeDVBT = ConfigYesNo()
if not slot.isFullMultiType():
if slot.isHotSwitchableMultiType():
nim.configModeDVBT = ConfigYesNo()
nim.configModeDVBT.addnotifier(boundFunction(tunerConfigChanged, nim), initial_call=False)
if not slot.isHotSwitchableMultiType():
nim.configMode = ConfigSelection(choices={"enabled": _("enabled"), "nothing": _("disabled")}, default="nothing")
createTerrestrialConfig(nim, x)
if slot.isCompatible("ATSC"):
nim.configModeDVBATSC = ConfigYesNo()
if not slot.isFullMultiType():
if slot.isHotSwitchableMultiType():
nim.configModeDVBATSC = ConfigYesNo()
nim.configModeDVBATSC.addnotifier(boundFunction(tunerConfigChanged, nim), initial_call=False)
if not slot.isHotSwitchableMultiType():
nim.configMode = ConfigSelection(choices={"enabled": _("enabled"), "nothing": _("disabled")}, default="nothing")
createATSCConfig(nim, x)
else:
if not hasattr(nim, "configMode"):
empty_slots += 1
nim.configMode = ConfigSelection(choices = { "nothing": _("disabled") }, default="nothing")
nim.configMode = ConfigSelection(choices = {"nothing": _("disabled")}, default="nothing")
if slot.type is not None:
print "[InitNimManager] pls add support for this frontend type!", slot.type
nimmgr.sec = SecConfigure(nimmgr)
@@ -1624,6 +1641,8 @@ def tunerTypeChanged(nimmgr, fe_id, configElement, initial=False):

if slot.isMultiType() and not hasattr(nim, "multiType"):
nim.multiType = ConfigSelection([(id, slot.getMultiTypeList()[id]) for id in slot.getMultiTypeList().keys()] + [("", _("disabled"))], "0")
nim.multiType.addNotifier(boundFunction(tunerTypeChanged, nimmgr, x - empty_slots), initial_call=True)
nim.multiType.addNotifier(boundFunction(tunerTypeChanged, nimmgr, x - empty_slots))
if slot.isHotSwitchableMultiType():
eDVBResourceManager.getInstance().setFrontendType(nimmgr.nim_slots[fe_id].frontend_id, "DVB-S2X") #for hotswitchable multitype we need to set the frontend type to DVB-S2

nimmanager = NimManager()
@@ -132,7 +132,7 @@ def createSetup(self):
self.forcetoneburst = None
self.terrestrialRegionsEntry = None
self.cableRegionsEntry = None
self.indent = " %s" if self.nim.isFullMultiType() else "%s"
self.indent = " %s" if self.nim.isHotSwitchableMultiType() else "%s"
if not hasattr(self, "terrestrialCountriesEntry"):
self.terrestrialCountriesEntry = None
if not hasattr(self, "cableCountriesEntry"):
@@ -145,10 +145,12 @@ def createSetup(self):
secondary_multitype = self.nim.multi_type.get(self.nimConfig.multiType.value[-1], None)

if self.nim.isCompatible("DVB-S"):
if self.nim.isFullMultiType():
self.configMode = getConfigListEntry(_("Configure DVB-S"), self.nimConfig.configMode, _("Select 'Yes' when you want to configure this tuner for DVB-S"))
else:
self.configMode = getConfigListEntry(self.indent % _("Configuration mode"), self.nimConfig.configMode, _("Select 'FBC SCR' if this tuner will connect to a SCR (Unicable/JESS) device. For all other setups select 'FBC automatic'.") if self.nim.isFBCLink() else _("Configure this tuner using simple or advanced options, or loop it through to another tuner, or copy a configuration from another tuner, or disable it."))
if self.nim.isHotSwitchableMultiType():
self.configModeDVBS = getConfigListEntry(_("Configure DVB-S"), self.nimConfig.configModeDVBS, _("Select 'Yes' when you want to configure this tuner for DVB-S"))
self.list.append(self.configModeDVBS)
if self.nim.isMultiType() or self.nim.isHotSwitchableMultiType():
self.nimConfig.configMode.choices.choices.pop("nothing", None)
self.configMode = getConfigListEntry(self.indent % _("Configuration mode"), self.nimConfig.configMode, _("Select 'FBC SCR' if this tuner will connect to a SCR (Unicable/JESS) device. For all other setups select 'FBC automatic'.") if self.nim.isFBCLink() else _("Configure this tuner using simple or advanced options, or loop it through to another tuner, or copy a configuration from another tuner, or disable it."))
self.list.append(self.configMode)
if self.nimConfig.configMode.value == "simple": #simple setup
self.diseqcModeEntry = getConfigListEntry(self.indent % pgettext("Satellite configuration mode", "Mode"), self.nimConfig.diseqcMode, _("Select how the satellite dish is set up. i.e. fixed dish, single LNB, DiSEqC switch, positioner, etc."))
@@ -209,13 +211,13 @@ def createSetup(self):
self.t2mirawmode = getConfigListEntry(self.indent % _("T2MI RAW Mode"), self.nimConfig.t2miRawMode, _("With T2MI RAW mode disabled (default) we can use single T2MI PLP de-encapsulation. With T2MI RAW mode enabled we can use astra-sm to analyze T2MI"))
self.list.append(self.t2mirawmode)
if self.nim.isCompatible("DVB-C"):
if self.nim.isFullMultiType():
if self.nim.isHotSwitchableMultiType():
self.configModeDVBC = getConfigListEntry(_("Configure DVB-C"), self.nimConfig.configModeDVBC, _("Select 'Yes' when you want to configure this tuner for DVB-C"))
self.list.append(self.configModeDVBC)
elif not self.nim.isMultiType():
self.configMode = getConfigListEntry(self.indent % _("Configuration mode"), self.nimConfig.configMode, _("Select 'enabled' if this tuner has a signal cable connected, otherwise select 'nothing connected'."))
self.list.append(self.configMode)
if self.nimConfig.configModeDVBC.value if self.nim.isFullMultiType() else self.nimConfig.configMode.value != "nothing":
if self.nimConfig.configModeDVBC.value if self.nim.isHotSwitchableMultiType() else self.nimConfig.configMode.value != "nothing":
self.list.append(getConfigListEntry(self.indent % _("Network ID"), self.nimConfig.cable.scan_networkid, _("This setting depends on your cable provider and location. If you don't know the correct setting refer to the menu in the official cable receiver, or get it from your cable provider, or seek help via internet forum.")))
self.cableScanType=getConfigListEntry(self.indent % _("Used service scan type"), self.nimConfig.cable.scan_type, _("Select 'provider' to scan from the predefined list of cable multiplexes. Select 'bands' to only scan certain parts of the spectrum. Select 'steps' to scan in steps of a particular frequency bandwidth."))
self.list.append(self.cableScanType)
@@ -274,13 +276,13 @@ def updateCableProvider(configEntry):
self.list.append(getConfigListEntry(self.indent % (_("Scan additional SR")), self.nimConfig.cable.scan_sr_ext1, _("This field allows you to search an additional symbol rate up to %s.") % ("7320")))
self.list.append(getConfigListEntry(self.indent % (_("Scan additional SR")), self.nimConfig.cable.scan_sr_ext2, _("This field allows you to search an additional symbol rate up to %s.") % ("7320")))
if self.nim.isCompatible("DVB-T"):
if self.nim.isFullMultiType():
if self.nim.isHotSwitchableMultiType():
self.configModeDVBT = getConfigListEntry(_("Configure DVB-T"), self.nimConfig.configModeDVBT, _("Select 'Yes' when you want to configure this tuner for DVB-T"))
self.list.append(self.configModeDVBT)
elif not self.nim.isMultiType():
self.configMode = getConfigListEntry(self.indent % _("Configuration mode"), self.nimConfig.configMode, _("Select 'enabled' if this tuner has a signal cable connected, otherwise select 'nothing connected'."))
self.list.append(self.configMode)
if self.nimConfig.configModeDVBT.value if self.nim.isFullMultiType() else self.nimConfig.configMode.value != "nothing":
if self.nimConfig.configModeDVBT.value if self.nim.isHotSwitchableMultiType() else self.nimConfig.configMode.value != "nothing":
# country/region tier one
if self.terrestrialCountriesEntry is None:
terrestrialcountrycodelist = nimmanager.getTerrestrialsCountrycodeList()
@@ -306,13 +308,13 @@ def updateTerrestrialProvider(configEntry):
self.list.append(self.terrestrialRegionsEntry)
self.list.append(getConfigListEntry(self.indent % _("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V, _("Enable this setting if your aerial system needs power")))
if self.nim.isCompatible("ATSC"):
if self.nim.isFullMultiType():
if self.nim.isHotSwitchableMultiType():
self.configModeDVBATSC = getConfigListEntry(_("Configure DVB-ATSC"), self.nimConfig.configModeDVBATSC, _("Select 'Yes' when you want to configure this tuner for DVB-ATSC"))
self.list.append(self.configModeDVBATSC)
elif not self.nim.isMultiType():
self.configMode = getConfigListEntry(self.indent % _("Configuration mode"), self.nimConfig.configMode, _("Select 'enabled' if this tuner has a signal cable connected, otherwise select 'nothing connected'."))
self.list.append(self.configMode)
if self.nimConfig.configModeDVBATSC.value if self.nim.isFullMultiType() else self.nimConfig.configMode.value != "nothing":
if self.nimConfig.configModeDVBATSC.value if self.nim.isHotSwitchableMultiType() else self.nimConfig.configMode.value != "nothing":
self.list.append(getConfigListEntry(self.indent % _("ATSC provider"), self.nimConfig.atsc, _("Select your ATSC provider.")))

if self.nimConfig.configMode.value != "nothing" and config.usage.setup_level.index > 1:
@@ -330,7 +332,7 @@ def newConfig(self):
InitNimManager(nimmanager, update_slots)
self.nim = nimmanager.nim_slots[self.slotid]
self.nimConfig = self.nim.config
if self["config"].getCurrent() in (self.configMode, self.configModeDVBC, self.configModeDVBT, self.configModeDVBATSC, self.diseqcModeEntry, self.advancedSatsEntry, self.advancedLnbsEntry, self.advancedDiseqcMode, self.advancedUsalsEntry,\
if self["config"].getCurrent() in (self.configMode, self.configModeDVBS, self.configModeDVBC, self.configModeDVBT, self.configModeDVBATSC, self.diseqcModeEntry, self.advancedSatsEntry, self.advancedLnbsEntry, self.advancedDiseqcMode, self.advancedUsalsEntry,\
self.advancedLof, self.advancedPowerMeasurement, self.turningSpeed, self.advancedType, self.advancedSCR, self.advancedPosition, self.advancedFormat, self.advancedManufacturer,\
self.advancedUnicable, self.advancedConnected, self.toneburst, self.committedDiseqcCommand, self.uncommittedDiseqcCommand, self.singleSatEntry, self.commandOrder,\
self.showAdditionalMotorOptions, self.cableScanType, self.multiType, self.cableConfigScanDetails, self.terrestrialCountriesEntry, self.cableCountriesEntry, \
@@ -845,7 +847,7 @@ def updateList(self, index=None):
text = _("Enabled")
if x.isMultiType():
text = "%s (%s)\n%s" % (_("Switchable tuner types:"), ','.join(x.getMultiTypeList().values()), text)
elif x.isFullMultiType():
elif x.isHotSwitchableMultiType():
text = "%s (%s)\n%s" % (_("Multitype tuner"), ','.join(x.getMultiTypeList().values()), text)
if not x.isSupported():
text = _("Tuner is not supported")

0 comments on commit 1aede1d

Please sign in to comment.
You can’t perform that action at this time.