+ # HACK: currently, we can only looptrough to socket A
+
+ if slot.isCompatible("DVB-S"):
+ if slot.slot == 0:
+ nim.configMode = ConfigSelection(
+ choices = {
+ "simple": _("simple"),
+ "advanced": _("advanced"),
+ "nothing": _("nothing connected"),
+ },
+ default = "simple")
+ else:
+ nim.configMode = ConfigSelection(
+ choices = {
+ "equal": _("equal to Socket A"),
+ "loopthrough": _("loopthrough to socket A"),
+ "nothing": _("nothing connected"),
+ "satposdepends": _("second cable of motorized LNB"),
+ "simple": _("simple"),
+ "advanced": _("advanced")},
+ default = "loopthrough")
+
+ #important - check if just the 2nd one is LT only and the first one is DVB-S
+ # CHECKME: is this logic correct for >2 slots?
+ if nim.configMode.value in ["loopthrough", "satposdepends", "equal"]:
+ if x == 0: # first one can never be linked to anything
+ # reset to simple
+ nim.configMode.value = "simple"
+ nim.configMode.save()
+ else:
+ #FIXME: make it better
+ for y in nimmgr.nim_slots:
+ if y.slot == 0:
+ if not y.isCompatible("DVB-S"):
+ # reset to simple
+ nim.configMode.value = "simple"
+ nim.configMode.save()
+
+ nim.diseqcMode = ConfigSelection(
+ choices = [
+ ("single", _("Single")),
+ ("toneburst_a_b", _("Toneburst A/B")),
+ ("diseqc_a_b", _("DiSEqC A/B")),
+ ("diseqc_a_b_c_d", _("DiSEqC A/B/C/D")),
+ ("positioner", _("Positioner"))],
+ default = "diseqc_a_b")
+
+ nim.diseqcA = getConfigSatlist(192, nimmgr.satList)
+ nim.diseqcB = getConfigSatlist(130, nimmgr.satList)
+ nim.diseqcC = ConfigSatlist(list = nimmgr.satList)
+ nim.diseqcD = ConfigSatlist(list = nimmgr.satList)
+ nim.positionerMode = ConfigSelection(
+ choices = [
+ ("usals", _("USALS")),
+ ("manual", _("manual"))],
+ default = "usals")
+ nim.longitude = ConfigFloat(default=[5,100], limits=[(0,359),(0,999)])
+ nim.longitudeOrientation = ConfigSelection(choices={"east": _("East"), "west": _("West")}, default = "east")
+ nim.latitude = ConfigFloat(default=[50,767], limits=[(0,359),(0,999)])
+ nim.latitudeOrientation = ConfigSelection(choices={"north": _("North"), "south": _("South")}, default="north")
+ nim.powerMeasurement = ConfigYesNo(default=True)
+ nim.powerThreshold = ConfigInteger(default=50, limits=(0, 100))
+ nim.turningSpeed = ConfigSelection(choices = [("fast", _("Fast")), ("slow", _("Slow")), ("fast epoch", _("Fast epoch")) ], default = "fast")
+ btime = datetime(1970, 1, 1, 7, 0);
+ nim.fastTurningBegin = ConfigDateTime(default = mktime(btime.timetuple()), formatstring = _("%H:%M"), increment = 900)
+ etime = datetime(1970, 1, 1, 19, 0);
+ nim.fastTurningEnd = ConfigDateTime(default = mktime(etime.timetuple()), formatstring = _("%H:%M"), increment = 900)
+ # get other frontends of the same type
+
+ satNimList = nimmgr.getNimListOfType("DVB-S", slot.slot)
+ satNimListNames = {}
+
+ for x in satNimList:
+ n = nimmgr.nim_slots[x]
+ satNimListNames["%d" % n.slot] = n.friendly_full_description
+
+ if len(satNimListNames):
+ nim.equalTo = ConfigSelection(choices = satNimListNames)
+ nim.linkedTo = ConfigSelection(choices = satNimListNames)
+ nim.satposDependsTo = ConfigSelection(choices = satNimListNames)
+
+ # advanced config:
+ nim.advanced = ConfigSubsection()
+ nim.advanced.sats = getConfigSatlist(192,nimmgr.satList)
+ nim.advanced.sat = ConfigSubDict()
+ lnbs = [("0", "not available")]
+ for y in range(1, 33):
+ lnbs.append((str(y), "LNB " + str(y)))
+
+ for x in nimmgr.satList:
+ nim.advanced.sat[x[0]] = ConfigSubsection()
+ nim.advanced.sat[x[0]].voltage = ConfigSelection(choices={"polarization": _("Polarization"), "13V": _("13 V"), "18V": _("18 V")}, default = "polarization")
+ nim.advanced.sat[x[0]].tonemode = ConfigSelection(choices={"band": _("Band"), "on": _("On"), "off": _("Off")}, default = "band")
+ nim.advanced.sat[x[0]].usals = ConfigYesNo(default=True)
+ nim.advanced.sat[x[0]].rotorposition = ConfigInteger(default=1, limits=(1, 255))
+ nim.advanced.sat[x[0]].lnb = ConfigSelection(choices = lnbs)
+
+ 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)))
+
+ ucsw = [("0", _("None"))]
+ for y in range(1, 17):
+ ucsw.append((str(y), "Input " + str(y)))
+
+ nim.advanced.lnb = ConfigSubList()
+ nim.advanced.lnb.append(ConfigNothing())
+ for x in range(1, 33):
+ 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))
+ nim.advanced.lnb[x].lofh = ConfigInteger(default=10600, limits = (0, 99999))
+ nim.advanced.lnb[x].threshold = ConfigInteger(default=11700, limits = (0, 99999))
+# 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")
+ nim.advanced.lnb[x].commitedDiseqcCommand = ConfigSelection(choices = csw)
+ nim.advanced.lnb[x].fastDiseqc = ConfigYesNo(default=False)
+ nim.advanced.lnb[x].sequenceRepeat = ConfigYesNo(default=False)
+ nim.advanced.lnb[x].commandOrder1_0 = ConfigSelection(choices = [("ct", "committed, toneburst"), ("tc", "toneburst, committed")], default = "ct")
+ nim.advanced.lnb[x].commandOrder = ConfigSelection(choices = [
+ ("ct", "committed, toneburst"),
+ ("tc", "toneburst, committed"),
+ ("cut", "committed, uncommitted, toneburst"),
+ ("tcu", "toneburst, committed, uncommitted"),
+ ("uct", "uncommitted, committed, toneburst"),
+ ("tuc", "toneburst, uncommitted, commmitted")],
+ default="ct")
+ nim.advanced.lnb[x].uncommittedDiseqcCommand = ConfigSelection(choices = ucsw)
+ nim.advanced.lnb[x].diseqcRepeats = ConfigSelection(choices = [("none", _("None")), ("one", _("One")), ("two", _("Two")), ("three", _("Three"))], default = "none")
+ nim.advanced.lnb[x].longitude = ConfigFloat(default = [5,100], limits = [(0,359),(0,999)])
+ nim.advanced.lnb[x].longitudeOrientation = ConfigSelection(choices = [("east", _("East")), ("west", _("West"))], default = "east")
+ nim.advanced.lnb[x].latitude = ConfigFloat(default = [50,767], limits = [(0,359),(0,999)])
+ nim.advanced.lnb[x].latitudeOrientation = ConfigSelection(choices = [("north", _("North")), ("south", _("South"))], default = "north")
+ nim.advanced.lnb[x].powerMeasurement = ConfigYesNo(default=True)
+ nim.advanced.lnb[x].powerThreshold = ConfigInteger(default=50, limits=(0, 100))
+ nim.advanced.lnb[x].turningSpeed = ConfigSelection(choices = [("fast", _("Fast")), ("slow", _("Slow")), ("fast epoch", _("Fast epoch"))], default = "fast")
+ btime = datetime(1970, 1, 1, 7, 0);
+ nim.advanced.lnb[x].fastTurningBegin = ConfigDateTime(default=mktime(btime.timetuple()), formatstring = _("%H:%M"), increment = 600)
+ etime = datetime(1970, 1, 1, 19, 0);
+ nim.advanced.lnb[x].fastTurningEnd = ConfigDateTime(default=mktime(etime.timetuple()), formatstring = _("%H:%M"), increment = 600)
+ elif slot.isCompatible("DVB-C"):
+ nim.configMode = ConfigSelection(
+ choices = {
+ "enabled": _("enabled"),
+ "nothing": _("nothing connected"),
+ },
+ default = "enabled")
+ list = [ ]
+ n = 0
+ for x in nimmgr.cablesList:
+ list.append((str(n), x[0]))
+ n += 1
+ nim.cable = ConfigSubsection()
+ possible_scan_types = [("bands", _("Frequency bands")), ("steps", _("Frequency steps"))]
+ if n:
+ possible_scan_types.append(("provider", _("Provider")))
+ nim.cable.scan_type = ConfigSelection(default = "bands", choices = possible_scan_types)
+ nim.cable.scan_provider = ConfigSelection(default = "0", choices = list)
+ nim.cable.scan_band_EU_VHF_I = ConfigYesNo(default = True)
+ nim.cable.scan_band_EU_MID = ConfigYesNo(default = True)
+ nim.cable.scan_band_EU_VHF_III = ConfigYesNo(default = True)
+ nim.cable.scan_band_EU_UHF_IV = ConfigYesNo(default = True)
+ nim.cable.scan_band_EU_UHF_V = ConfigYesNo(default = True)
+ nim.cable.scan_band_EU_SUPER = ConfigYesNo(default = True)
+ nim.cable.scan_band_EU_HYPER = ConfigYesNo(default = True)
+ nim.cable.scan_band_US_LOW = ConfigYesNo(default = False)
+ nim.cable.scan_band_US_MID = ConfigYesNo(default = False)
+ nim.cable.scan_band_US_HIGH = ConfigYesNo(default = False)
+ nim.cable.scan_band_US_SUPER = ConfigYesNo(default = False)
+ nim.cable.scan_band_US_HYPER = ConfigYesNo(default = False)
+ nim.cable.scan_frequency_steps = ConfigInteger(default = 1000, limits = (1000, 10000))
+ nim.cable.scan_mod_qam16 = ConfigYesNo(default = False)
+ nim.cable.scan_mod_qam32 = ConfigYesNo(default = False)
+ nim.cable.scan_mod_qam64 = ConfigYesNo(default = True)
+ nim.cable.scan_mod_qam128 = ConfigYesNo(default = False)
+ nim.cable.scan_mod_qam256 = ConfigYesNo(default = True)
+ nim.cable.scan_sr_6900 = ConfigYesNo(default = True)
+ nim.cable.scan_sr_6875 = ConfigYesNo(default = True)
+ nim.cable.scan_sr_ext1 = ConfigInteger(default = 0, limits = (0, 7230))
+ nim.cable.scan_sr_ext2 = ConfigInteger(default = 0, limits = (0, 7230))
+ elif slot.isCompatible("DVB-T"):
+ nim.configMode = ConfigSelection(
+ choices = {
+ "enabled": _("enabled"),
+ "nothing": _("nothing connected"),
+ },
+ default = "enabled")
+ list = []
+ n = 0
+ for x in nimmgr.terrestrialsList:
+ list.append((str(n), x[0]))
+ n += 1
+ nim.terrestrial = ConfigSelection(choices = list)
+ nim.terrestrial_5V = ConfigOnOff()