#simple defaults
sec.addLNB()
tunermask = 1 << slotid
- if self.linked.has_key(slotid):
+ if self.equal.has_key(slotid):
+ tunermask |= (1 << self.equal[slotid])
+ elif self.linked.has_key(slotid):
tunermask |= (1 << self.linked[slotid])
sec.setLNBTunerMask(tunermask)
sec.setLNBLOFL(9750000)
sec.addSatellite(orbpos)
self.satList.append(orbpos)
elif (diseqcmode == 3): # diseqc 1.2
+ if self.satposdepends.has_key(slotid):
+ tunermask |= (1 << self.satposdepends[slotid])
+ sec.setLNBTunerMask(tunermask)
sec.setLatitude(latitude)
sec.setLaDirection(laDirection)
sec.setLongitude(longitude)
sec.setLoDirection(loDirection)
sec.setUseInputpower(True)
sec.setInputpowerDelta(50)
-
+
for x in self.NimManager.satList:
print "Add sat " + str(x[1])
sec.addSatellite(int(x[1]))
sec.setToneMode(0)
self.satList.append(int(x[1]))
+ def setSatposDepends(self, sec, nim1, nim2):
+ print "tuner", nim1, "depends on satpos of", nim2
+ sec.setTunerDepends(nim1, nim2)
+
def linkNIMs(self, sec, nim1, nim2):
print "link tuner", nim1, "to tuner", nim2
sec.setTunerLinked(nim1, nim2)
self.satList = []
self.linked = { }
+ self.satposdepends = { }
+ self.equal = { }
for slot in self.NimManager.nimslots:
x = slot.slotid
nim = config.Nims[x]
if slot.nimType == self.NimManager.nimType["DVB-S"]:
+ if currentConfigSelectionElement(nim.configMode) == "equal":
+ self.equal[nim.equalTo.value]=x
if currentConfigSelectionElement(nim.configMode) == "loopthrough":
self.linkNIMs(sec, x, nim.linkedTo.value)
self.linked[nim.linkedTo.value]=x
+ elif currentConfigSelectionElement(nim.configMode) == "satposdepends":
+ self.setSatposDepends(sec, x, nim.satposDependsTo.value)
+ self.satposdepends[nim.satposDependsTo.value]=x
for slot in self.NimManager.nimslots:
x = slot.slotid
nim = config.Nims[x]
if slot.nimType == self.NimManager.nimType["DVB-S"]:
print "slot: " + str(x) + " configmode: " + str(nim.configMode.value)
- if currentConfigSelectionElement(nim.configMode) == "loopthrough":
+ if currentConfigSelectionElement(nim.configMode) in [ "loopthrough", "satposdepends", "equal", "nothing" ]:
pass
elif currentConfigSelectionElement(nim.configMode) == "simple": #simple config
if currentConfigSelectionElement(nim.diseqcMode) == "single": #single
loDirection = loValue,
latitude = configsequencearg.getFloat(nim.latitude),
laDirection = laValue)
-# pass
- elif currentConfigSelectionElement(nim.configMode) == "nothing":
- pass
- else: #advanced config
+ elif currentConfigSelectionElement(nim.configMode) == "advanced": #advanced config
self.updateAdvanced(sec, x)
print "sec config completed"
sec.addLNB()
tunermask = 1 << slotid
- if self.linked.has_key(slotid):
+ if self.equal.has_key(slotid):
+ tunermask |= (1 << self.equal[slotid])
+ elif self.linked.has_key(slotid):
tunermask |= (1 << self.linked[slotid])
- sec.setLNBTunerMask(tunermask)
if currentConfigSelectionElement(currLnb.lof) == "universal_lnb":
sec.setLNBLOFL(9750000)
sec.setDiSEqCMode(diseqcParam.V1_1)
elif currentConfigSelectionElement(currLnb.diseqcMode) == "1_2":
sec.setDiSEqCMode(diseqcParam.V1_2)
+
+ if self.satposdepends.has_key(slotid): # only useable with rotors
+ tunermask |= (1 << self.satposdepends[slotid])
+
if currentConfigSelectionElement(currLnb.diseqcMode) != "none":
if currentConfigSelectionElement(currLnb.toneburst) == "none":
sec.setInputpowerDelta(currLnb.powerThreshold.value[0])
else:
sec.setUseInputpower(False)
-
+
+ sec.setLNBTunerMask(tunermask)
+
# finally add the orbital positions
for y in lnbSat[x]:
sec.addSatellite(y)
def getSatListForNim(self, slotid):
list = []
- if (self.getNimType(slotid) != self.nimType["empty/unknown"]):
+ if (self.getNimType(slotid) == self.nimType["DVB-S"]):
#print "slotid:", slotid
#print "self.satellites:", self.satList[config.Nims[slotid].diseqcA.value]
#print "diseqcA:", config.Nims[slotid].diseqcA.value
- if (config.Nims[slotid].diseqcMode.value <= 3):
- list.append(self.satList[config.Nims[slotid].diseqcA.value])
- if (0 < config.Nims[slotid].diseqcMode.value <= 3):
- list.append(self.satList[config.Nims[slotid].diseqcB.value])
- if (config.Nims[slotid].diseqcMode.value == 3):
- list.append(self.satList[config.Nims[slotid].diseqcC.value])
- list.append(self.satList[config.Nims[slotid].diseqcD.value])
- if (config.Nims[slotid].diseqcMode.value == 4):
+ configMode = currentConfigSelectionElement(config.Nims[slotid].configMode)
+ if configMode == "simple":
+ if (config.Nims[slotid].diseqcMode.value <= 3):
+ list.append(self.satList[config.Nims[slotid].diseqcA.value])
+ if (0 < config.Nims[slotid].diseqcMode.value <= 3):
+ list.append(self.satList[config.Nims[slotid].diseqcB.value])
+ if (config.Nims[slotid].diseqcMode.value == 3):
+ list.append(self.satList[config.Nims[slotid].diseqcC.value])
+ list.append(self.satList[config.Nims[slotid].diseqcD.value])
+ if (config.Nims[slotid].diseqcMode.value == 4):
+ for x in self.satList:
+ list.append(x)
+ elif configMode == "advanced":
for x in self.satList:
- list.append(x)
+ if config.Nims[slotid].advanced.sat[x[1]].lnb.value != 0:
+ list.append(x)
return list
-# #callbacks for c++ config
-# def nimConfigModeChanged(self, slotid, mode):
-# if (mode != 2): # not linked
-# print "Unlinking slot " + str(slotid)
-# # TODO call c++ to unlink nim in slot slotid
-# if (mode == 2): # linked
-# pass
-# #FIXME!!!
-# #if (len(self.getNimListOfType(self.nimType["DVB-S"], slotid)) > 0):
-# # print "Linking slot " + str(slotid) + " to " + str(nimmgr.getConfigPrefix(slotid).value)
-# # TODO call c++ to link nim in slot slotid with nim in slot nimmgr.getConfigPrefix(slotid).value
-
-# def nimLinkedToChanged(self, slotid, val):
-# print "Linking slot " + str(slotid) + " to " + str(val)
-
def nimDiseqcModeChanged(self, slotid, mode):
#print "nimDiseqcModeChanged set to " + str(mode)
pass
# def nimConfigModeChanged(slotid, configElement):
# nimmgr.nimConfigModeChanged(slotid, configElement.value)
-# def nimLinkedToChanged(slotid, configElement):
-# nimmgr.nimLinkedToChanged(slotid, configElement.value)
def nimDiseqcModeChanged(slotid, configElement):
nimmgr.nimDiseqcModeChanged(slotid, configElement.value)
if slot.nimType == nimmgr.nimType["DVB-S"]:
if slot.slotid == 0:
- nim.configMode = configElement(cname + "configMode", configSelection, 0, (("simple", _("Simple")), ("advanced", _("Advanced"))))
- else:
- nim.configMode = configElement(cname + "configMode", configSelection, 0, (("simple", _("Simple")), ("nothing", _("Nothing connected")), ("loopthrough", _("Loopthrough to Socket A")), ("advanced", _("Advanced"))))
-
+ nim.configMode = configElement(cname + "configMode", configSelection, 0, (
+ ("simple", _("Simple")), ("advanced", _("Advanced"))))
+ else:
+ nim.configMode = configElement(cname + "configMode", configSelection, 0, (
+ ("equal", _("Equal to Socket A")),
+ ("loopthrough", _("Loopthrough to Socket A")),
+ ("nothing", _("Nothing connected")),
+ ("satposdepends", _("Secondary cable from Rotor-LNB")),
+ ("simple", _("Simple")),
+ ("advanced", _("Advanced"))))
#important - check if just the 2nd one is LT only and the first one is DVB-S
- if currentConfigSelectionElement(nim.configMode) == "loopthrough": #linked
+ if currentConfigSelectionElement(nim.configMode) in ["loopthrough", "satposdepends", "equal"]:
if x == 0: #first one can never be linked to anything
nim.configMode.value = getConfigSelectionElement(nim.configMode, "simple") #reset to simple
nim.configMode.save()
satNimListNames = []
for x in satNimList:
satNimListNames.append((("Slot_" + ("A", "B", "C", "D")[x] + "_" + nimmgr.getNimName(x)), _("Slot ") + ("A", "B", "C", "D")[x] + ": " + nimmgr.getNimName(x)))
+ nim.equalTo = configElement(cname + "equalTo", configSelection, 0, satNimListNames);
nim.linkedTo = configElement(cname + "linkedTo", configSelection, 0, satNimListNames);
+ nim.satposDependsTo = configElement(cname + "satposDependsTo", configSelection, 0, satNimListNames);
#perhaps the instance of the slot is more useful?
# nim.configMode.addNotifier(boundFunction(nimConfigModeChanged,x))
nim.diseqcB.addNotifier(boundFunction(nimPortBChanged,x))
nim.diseqcC.addNotifier(boundFunction(nimPortCChanged,x))
nim.diseqcD.addNotifier(boundFunction(nimPortDChanged,x))
-# nim.linkedTo.addNotifier(boundFunction(nimLinkedToChanged,x))
# advanced config:
nim.advanced = ConfigSubsection()