add a very complex advanced sat config
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Fri, 30 Dec 2005 17:28:59 +0000 (17:28 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Fri, 30 Dec 2005 17:28:59 +0000 (17:28 +0000)
data/skin.xml
lib/python/Components/NimManager.py
lib/python/Screens/Satconfig.py

index 3d9d046..3d63c60 100644 (file)
                        <widget name="entries" position="20,70" size="320,150" scrollbarMode="showOnDemand" />
                        <widget name="bottom" position="20,230" size="320,25" font="Regular;23" />
                </screen>
-               <screen name="NimSetup" position="130,165" size="440,250" title="Satconfig">
-                       <widget name="config" position="20,10" size="400,220" />
-               </screen>
-               <screen name="Satconfig" position="140,125" size="460,280" title="Satconfig">
-                       <widget name="config" position="10,50" size="420,150" scrollbarMode="showOnDemand" />
+               <screen name="NimSetup" position="70,70" size="580,480" title="Satconfig">
+                       <widget name="config" position="20,10" size="560,450" scrollbarMode="showOnDemand" />
                </screen>
                <screen name="ScanSetup" position="90,100" size="520,400" title="Service scan">
                        <widget name="config" position="20,10" size="460,350" scrollbarMode="showOnDemand" />
index c5b1b22..ebe1798 100644 (file)
@@ -454,6 +454,49 @@ def InitNimManager(nimmgr):
                        nim.diseqcC.addNotifier(boundFunction(nimPortCChanged,x))
                        nim.diseqcD.addNotifier(boundFunction(nimPortDChanged,x))
                        nim.linkedTo.addNotifier(boundFunction(nimLinkedToChanged,x))
+                       
+                       # advanced config:
+                       nim.advanced = ConfigSubsection()
+                       nim.advanced.sats = configElement(cname + "advanced.sats", configSatlist, 192, nimmgr.satList);
+                       nim.advanced.sat = {}
+                       lnbs = ["not available"]
+                       for y in range(1, 33):
+                               lnbs.append("LNB " + str(y))
+                       for x in nimmgr.satList:
+                               nim.advanced.sat[x[1]] = ConfigSubsection()
+                               nim.advanced.sat[x[1]].voltage = configElement(cname + "advanced.sat" + str(x[1]) + ".voltage", configSelection, 0, (("polarization", _("Polarization")), ("13V", _("13 V")), ("18V", _("18 V"))))
+                               nim.advanced.sat[x[1]].tonemode = configElement(cname + "advanced.sat" + str(x[1]) + ".tonemode", configSelection, 0, (("band", _("Band")), ("on", _("On")), ("off", _("Off"))))
+                               nim.advanced.sat[x[1]].usals = configElement(cname + "advanced.sat" + str(x[1]) + ".usals", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
+                               nim.advanced.sat[x[1]].rotorposition = configElement(cname + "advanced.sat" + str(x[1]) + ".rotorposition", configSequence, [1], configsequencearg.get("INTEGER", (1, 255)))
+                               nim.advanced.sat[x[1]].lnb = configElement(cname + "advanced.sat" + str(x[1]) + ".lnb", configSelection, 0, lnbs)
+                       
+                       nim.advanced.lnb = [0]
+                       for x in range(1, 33):
+                               nim.advanced.lnb.append(ConfigSubsection())
+                               nim.advanced.lnb[x].lof = configElement(cname + "advanced.lnb" + str(x) + ".lof", configSelection, 0, (("universal_lnb", _("Universal LNB")), ("c_band", _("C-Band")), ("user_defined", _("User defined"))))
+                               nim.advanced.lnb[x].lofl = configElement(cname + "advanced.lnb" + str(x) + ".lofl", configSequence, [9750], configsequencearg.get("INTEGER", (0, 99999)))
+                               nim.advanced.lnb[x].lofh = configElement(cname + "advanced.lnb" + str(x) + ".lofh", configSequence, [10600], configsequencearg.get("INTEGER", (0, 99999)))
+                               nim.advanced.lnb[x].threshold = configElement(cname + "advanced.lnb" + str(x) + ".threshold", configSequence, [11750], configsequencearg.get("INTEGER", (0, 99999)))
+                               nim.advanced.lnb[x].output_12v = configElement(cname + "advanced.lnb" + str(x) + ".output_12v", configSelection, 0, (("0V", _("0 V")), ("12V", _("12 V"))))
+                               nim.advanced.lnb[x].increased_voltage = configElement(cname + "advanced.lnb" + str(x) + ".increased_voltage", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
+                               nim.advanced.lnb[x].toneburst = configElement(cname + "advanced.lnb" + str(x) + ".toneburst", configSelection, 0, (("none", _("None")), ("A", _("A")), ("B", _("B"))))
+                               nim.advanced.lnb[x].diseqcMode = configElement(cname + "advanced.lnb" + str(x) + ".diseqcMode", configSelection, 0, (("none", _("None")), ("1_0", _("1.0")), ("1_1", _("1.1")), ("1_2", _("1.2"))))
+                               nim.advanced.lnb[x].commitedDiseqcCommand = configElement(cname + "advanced.lnb" + str(x) + ".commitedDiseqcCommand", configSelection, 0, (("none", _("None")), ("AA", _("AA")), ("AB", _("AB")), ("BA", _("BA")), ("BB", _("BB"))))
+                               nim.advanced.lnb[x].fastDiseqc = configElement(cname + "advanced.lnb" + str(x) + ".fastDiseqc", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
+                               nim.advanced.lnb[x].sequenceRepeat = configElement(cname + "advanced.lnb" + str(x) + ".sequenceRepeat", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
+                               nim.advanced.lnb[x].commandOrder1_0 = configElement(cname + "advanced.lnb" + str(x) + ".commandOrder1_0", configSelection, 0, ("committed, toneburst", "toneburst, committed"))
+                               nim.advanced.lnb[x].commandOrder = configElement(cname + "advanced.lnb" + str(x) + ".commandOrder", configSelection, 0, ("committed, toneburst", "toneburst, committed", "committed, uncommitted, toneburst", "toneburst, committed, uncommitted", "uncommitted, committed, toneburst", "toneburst, uncommitted, commmitted"))
+                               disCmd = ["none"]
+                               for y in range(1, 17):
+                                       disCmd.append("Input " + str(y))
+                               nim.advanced.lnb[x].uncommittedDiseqcCommand = configElement(cname + "advanced.lnb" + str(x) + ".uncommittedDiseqcCommand", configSelection, 0, disCmd)
+                               nim.advanced.lnb[x].diseqcRepeats = configElement(cname + "advanced.lnb" + str(x) + ".diseqcRepeats", configSelection, 0, (("none", _("None")), ("one", _("One")), ("two", _("Two")), ("three", _("Three"))))
+                               nim.advanced.lnb[x].longitude = configElement(cname + "advanced.lnb" + str(x) + ".longitude", configSequence, [5,100], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
+                               nim.advanced.lnb[x].longitudeOrientation = configElement(cname + "advanced.lnb" + str(x) + ".longitudeOrientation", configSelection, 0, (_("East"), _("West")))
+                               nim.advanced.lnb[x].latitude = configElement(cname + "advanced.lnb" + str(x) + ".latitude", configSequence, [50,767], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
+                               nim.advanced.lnb[x].latitudeOrientation = configElement(cname + "advanced.lnb" + str(x) + ".latitudeOrientation", configSelection, 0, (("north", _("North")), ("south", _("South"))))
+                               nim.advanced.lnb[x].powerMeasurement = configElement(cname + "advanced.lnb" + str(x) + ".powerMeasurement", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
+                               nim.advanced.lnb[x].powerThreshold = configElement(cname + "advanced.lnb" + str(x) + ".powerThreshold", configSequence, [50], configsequencearg.get("INTEGER", (0, 100)))
                elif slot.nimType == nimmgr.nimType["DVB-C"]:
                        nim.cable = configElement(cname + "cable", configSelection, 0, nimmgr.cablesList);
                elif slot.nimType == nimmgr.nimType["DVB-T"]:
index c188540..5192858 100644 (file)
@@ -31,9 +31,18 @@ class NimSetup(Screen):
                        pass
        
        def createSetup(self):
+               print "Creating setup"
                self.list = [ ]
+
+               self.configMode = None
                self.diseqcModeEntry = None
-               
+               self.advancedSatsEntry = None
+               self.advancedLnbsEntry = None
+               self.advancedDiseqcMode = None
+               self.advancedUsalsEntry = None
+               self.advancedLof = None
+               self.advancedPowerMeasurement = None
+
                if (nimmanager.getNimType(self.nim.slotid) == nimmanager.nimType["DVB-S"]):
                        self.configMode = getConfigListEntry(_("Configuration Mode"), config.Nims[self.nim.slotid].configMode)
                        self.list.append(self.configMode)
@@ -51,7 +60,55 @@ class NimSetup(Screen):
                                pass
                        elif currentConfigSelectionElement(config.Nims[self.nim.slotid].configMode) == "loopthrough": # linked
                                pass
-               
+                       elif currentConfigSelectionElement(config.Nims[self.nim.slotid].configMode) == "advanced": # advanced
+                               # SATs
+                               self.advancedSatsEntry = getConfigListEntry(_("Satellite"), config.Nims[self.nim.slotid].advanced.sats)
+                               self.list.append(self.advancedSatsEntry)
+                               currSat = config.Nims[self.nim.slotid].advanced.sat[nimmanager.satList[config.Nims[self.nim.slotid].advanced.sats.value][1]]
+                               currLnb = config.Nims[self.nim.slotid].advanced.lnb[currSat.lnb.value]
+                               
+                               self.list.append(getConfigListEntry(_("Voltage mode"), currSat.voltage))
+                               self.list.append(getConfigListEntry(_("Tone mode"), currSat.tonemode))
+                               if (currLnb != 0 and currentConfigSelectionElement(currLnb.diseqcMode) == "1_2"):
+                                       self.advancedUsalsEntry = getConfigListEntry(_("Use usals for this sat"), currSat.usals)
+                                       self.list.append(self.advancedUsalsEntry)
+                                       if (currentConfigSelectionElement(currSat.usals) == "no"):
+                                               self.list.append(getConfigListEntry(_("Stored position"), currSat.rotorposition))
+                               
+                               # LNBs
+                               self.advancedLnbsEntry = getConfigListEntry(_("LNB"), currSat.lnb)
+                               self.list.append(self.advancedLnbsEntry)
+                               if currLnb != 0:
+                                       self.advancedDiseqcMode = getConfigListEntry(_("DiSEqC mode"), currLnb.diseqcMode)
+                                       self.list.append(self.advancedDiseqcMode)
+                                       if currentConfigSelectionElement(currLnb.diseqcMode) != "none":
+                                               self.list.append(getConfigListEntry(_("Committed DiSEqC command"), currLnb.commitedDiseqcCommand))
+                                               self.list.append(getConfigListEntry(_("Fast DiSEqC"), currLnb.fastDiseqc))
+                                               self.list.append(getConfigListEntry(_("Sequence repeat"), currLnb.sequenceRepeat))
+                                               if currentConfigSelectionElement(currLnb.diseqcMode) == "1_0":
+                                                       self.list.append(getConfigListEntry(_("Command order"), currLnb.commandOrder1_0))
+                                               else:
+                                                       self.list.append(getConfigListEntry(_("Command order"), currLnb.commandOrder))
+                                                       self.list.append(getConfigListEntry(_("Uncommitted DiSEqC command"), currLnb.uncommittedDiseqcCommand))
+                                                       self.list.append(getConfigListEntry(_("DiSEqC repeats"), currLnb.diseqcRepeats))
+                                               if currentConfigSelectionElement(currLnb.diseqcMode) == "1_2":
+                                                       self.list.append(getConfigListEntry(_("Longitude"), currLnb.longitude))
+                                                       self.list.append(getConfigListEntry("", currLnb.longitudeOrientation))
+                                                       self.list.append(getConfigListEntry(_("Latitude"), currLnb.latitude))
+                                                       self.list.append(getConfigListEntry("", currLnb.latitudeOrientation))
+                                                       self.advancedPowerMeasurement = getConfigListEntry("Use Power Measurement", currLnb.powerMeasurement)
+                                                       self.list.append(self.advancedPowerMeasurement)
+                                                       if currentConfigSelectionElement(currLnb.powerMeasurement) == "yes":
+                                                               self.list.append(getConfigListEntry("Power Threshold in mA", currLnb.powerThreshold))
+                                       self.advancedLof = getConfigListEntry(_("LOF"), currLnb.lof)
+                                       self.list.append(self.advancedLof)
+                                       if currentConfigSelectionElement(currLnb.lof) == "user_defined":
+                                               self.list.append(getConfigListEntry(_("LOF/L"), currLnb.lofl))
+                                               self.list.append(getConfigListEntry(_("LOF/H"), currLnb.lofh))
+                                               self.list.append(getConfigListEntry(_("Threshold"), currLnb.threshold))
+                                       self.list.append(getConfigListEntry(_("12V Output"), currLnb.output_12v))
+                                       self.list.append(getConfigListEntry(_("Increased voltage"), currLnb.increased_voltage))
+                                       self.list.append(getConfigListEntry(_("Toneburst"), currLnb.toneburst))
                elif (nimmanager.getNimType(self.nim.slotid) == nimmanager.nimType["DVB-C"]):
                        self.list.append(getConfigListEntry(_("Cable provider"), config.Nims[self.nim.slotid].cable))
                elif (nimmanager.getNimType(self.nim.slotid) == nimmanager.nimType["DVB-T"]):
@@ -61,12 +118,11 @@ class NimSetup(Screen):
                self["config"].list = self.list
                self["config"].l.setList(self.list)
                
-       def newConfig(self):    
-               if self["config"].getCurrent() == self.configMode:
-                       self.createSetup()
-               if self["config"].getCurrent() == self.diseqcModeEntry:
-                       self.createSetup()
-               
+       def newConfig(self):
+               checkList = (self.configMode, self.diseqcModeEntry, self.advancedSatsEntry, self.advancedLnbsEntry, self.advancedDiseqcMode, self.advancedUsalsEntry, self.advancedLof, self.advancedPowerMeasurement)
+               for x in checkList:
+                       if self["config"].getCurrent() == x:
+                               self.createSetup()                      
        def keyLeft(self):
                self["config"].handleKey(config.key["prevElement"])
                self.newConfig()