move dvb-t 5V antenna switching to better place
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 28 Jun 2006 16:48:18 +0000 (16:48 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 28 Jun 2006 16:48:18 +0000 (16:48 +0000)
rename Service Searchin -> Satconfig to -> Nimconfig

data/menu.xml
lib/dvb/epgcache.cpp
lib/dvb/frontend.cpp
lib/python/Components/NimManager.py
lib/python/Screens/Satconfig.py
lib/python/Screens/ScanSetup.py

index db3c95ef5e1fe90b7a23b61301e4f7aba61b81e8..99f1dd8a99005216d1c126bb0ab6d489f98a745d 100644 (file)
@@ -37,7 +37,7 @@
                        </menu>-->
                        <menu text="Service Searching">
                                <id val="scan" />
                        </menu>-->
                        <menu text="Service Searching">
                                <id val="scan" />
-                               <item text="Satelliteconfig"><screen module="Satconfig" screen="NimSelection" /></item>
+                               <item text="Nimconfig"><screen module="Satconfig" screen="NimSelection" /></item>
                                <item text="Automatic Scan"><screen module="ScanSetup" screen="ScanSimple" /></item>
                                <!--<item text="Automatic Scan"><screen module="ServiceScan" /></item>-->
                                <item text="Manual Scan"><screen module="ScanSetup" /></item>
                                <item text="Automatic Scan"><screen module="ScanSetup" screen="ScanSimple" /></item>
                                <!--<item text="Automatic Scan"><screen module="ServiceScan" /></item>-->
                                <item text="Manual Scan"><screen module="ScanSetup" /></item>
index 56a6a61ccbd701020a6efe86aeb8539a44313001..7c64fb0cac05c497b5bd6fb5950b65f20a84f87e 100644 (file)
@@ -2366,8 +2366,7 @@ void eEPGCache::channel_data::readPrivateData( const __u8 *data)
                        if (!isRunning)
                                can_delete = 1;
                        m_PrevVersion = (data[5] & 0x3E) >> 1;
                        if (!isRunning)
                                can_delete = 1;
                        m_PrevVersion = (data[5] & 0x3E) >> 1;
-                       m_PrivateReader->stop();
-                       startPrivateTimer.start(UPDATE_INTERVAL, 1);
+                       startPrivateReader();
                }
        }
 }
                }
        }
 }
index 1040d7cd55ae1a1d29077ee42010c7c735bb7c14..352f3388ec66684aec4e485cf00f8a63dbcfaccf 100644 (file)
@@ -1731,17 +1731,13 @@ RESULT eDVBFrontend::tune(const iDVBFrontendParameters &where)
                res=prepare_terrestrial(feparm);
                if (!res)
                {
                res=prepare_terrestrial(feparm);
                if (!res)
                {
+                       std::string enable_5V;
+                       char configStr[255];
+                       snprintf(configStr, 255, "config.Nim%c.terrestrial_5V", 'A'+m_fe);
                        m_sec_sequence.push_back( eSecCommand(eSecCommand::START_TUNE_TIMEOUT) );
                        m_sec_sequence.push_back( eSecCommand(eSecCommand::START_TUNE_TIMEOUT) );
-                       eDVBRegisteredFrontend *linked_fe = (eDVBRegisteredFrontend*)m_data[LINKED_PREV_PTR];
-                       if (linked_fe == (eDVBRegisteredFrontend*)-1)
-                       {
-                               std::string enable_5V;
-                               ePythonConfigQuery::getConfigValue("config.terrestrial.enable_5V", enable_5V);
-                               if (enable_5V == "yes")
-                                       m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
-                               else
-                                       m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltageOff) );
-                       }
+                       ePythonConfigQuery::getConfigValue(configStr, enable_5V);
+                       if (enable_5V == "on")
+                               m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
                        else
                                m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltageOff) );
                        m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND) );
                        else
                                m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltageOff) );
                        m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND) );
index 92ef9dea45a2c7dfb8269c31be0a284768e6d0bc..5f5ae7bfeb31d714c010a633b377b81d0b96e7be 100644 (file)
@@ -641,8 +641,6 @@ class NimManager:
                pass
 
 def InitNimManager(nimmgr):
                pass
 
 def InitNimManager(nimmgr):
-       have_terrestrial_tuner = False
-       config.terrestrial = ConfigSubsection()
        config.Nims = []
        for x in range(nimmgr.nimCount):
                config.Nims.append(ConfigSubsection())
        config.Nims = []
        for x in range(nimmgr.nimCount):
                config.Nims.append(ConfigSubsection())
@@ -660,8 +658,6 @@ def InitNimManager(nimmgr):
                nimmgr.nimPortCChanged(slotid, configElement.vals[configElement.value][1])
        def nimPortDChanged(slotid, configElement):
                nimmgr.nimPortDChanged(slotid, configElement.vals[configElement.value][1])
                nimmgr.nimPortCChanged(slotid, configElement.vals[configElement.value][1])
        def nimPortDChanged(slotid, configElement):
                nimmgr.nimPortDChanged(slotid, configElement.vals[configElement.value][1])
-       def terrestrial_5v_changed(configElement):
-               configElement.save()
 
        for slot in nimmgr.nimslots:
                x = slot.slotid
 
        for slot in nimmgr.nimslots:
                x = slot.slotid
@@ -769,20 +765,15 @@ def InitNimManager(nimmgr):
                elif slot.nimType == nimmgr.nimType["DVB-C"]:
                        nim.cable = configElement(cname + "cable", configSelection, 0, nimmgr.cablesList, False);
                elif slot.nimType == nimmgr.nimType["DVB-T"]:
                elif slot.nimType == nimmgr.nimType["DVB-C"]:
                        nim.cable = configElement(cname + "cable", configSelection, 0, nimmgr.cablesList, False);
                elif slot.nimType == nimmgr.nimType["DVB-T"]:
-                       have_terrestrial_tuner = True
                        list = []
                        for x in nimmgr.terrestrialsList:
                                list.append(x[0])
                        nim.terrestrial = configElement(cname + "terrestrial", configSelection, 0, list, False);
                        list = []
                        for x in nimmgr.terrestrialsList:
                                list.append(x[0])
                        nim.terrestrial = configElement(cname + "terrestrial", configSelection, 0, list, False);
+                       nim.terrestrial_5V = configElement(cname + "terrestrial_5V", configSelection, 1, (("on", _("On")), ("off", _("Off"))), True);
                else:
                        print "pls add support for this frontend type!"         
 
                else:
                        print "pls add support for this frontend type!"         
 
-       if have_terrestrial_tuner:
-               config.terrestrial.enable_5V = configElement("config.terrestrial.enable_5V", configSelection, 1, (("yes", _("Yes")), ("no", _("No"))), True);
-               config.terrestrial.enable_5V.addNotifier(terrestrial_5v_changed)
-
        nimmgr.sec = SecConfigure(nimmgr)
 
 
        nimmgr.sec = SecConfigure(nimmgr)
 
 
-
 nimmanager = NimManager()
 nimmanager = NimManager()
index 11091f1ae985b6b584593ba40b7233c91ca08ac0..0a76e4919882e9943c93dc04fc3f8231d86d262a 100644 (file)
@@ -71,6 +71,7 @@ class NimSetup(Screen):
                elif self.nim_type == nimmanager.nimType["DVB-T"]:
                        self.have_advanced = False
                        self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
                elif self.nim_type == nimmanager.nimType["DVB-T"]:
                        self.have_advanced = False
                        self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
+                       self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
                else:
                        self.have_advanced = False
 
                else:
                        self.have_advanced = False
 
index 4eb7b8cdb6c779d7c55b0ad0326d62c32a866f81..a94645b1bb482738f5323eccdebc59765946d730 100644 (file)
@@ -259,7 +259,6 @@ class ScanSetup(Screen):
                                self.list.append(getConfigListEntry(_("Hierarchy mode"), config.scan.ter.hierarchy))
                        elif currentConfigSelectionElement(config.scan.typeterrestrial) == "complete":
                                self.list.append(getConfigListEntry(_("Clear before scan"), config.scan.clearallservices))
                                self.list.append(getConfigListEntry(_("Hierarchy mode"), config.scan.ter.hierarchy))
                        elif currentConfigSelectionElement(config.scan.typeterrestrial) == "complete":
                                self.list.append(getConfigListEntry(_("Clear before scan"), config.scan.clearallservices))
-                       self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), config.terrestrial.enable_5V))
 
 #              if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"] and currentConfigSelectionElement(config.scan.type) == "single_transponder") or \
 #                      (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"] and currentConfigSelectionElement(config.scan.typecable) == "single_transponder") or \
 
 #              if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"] and currentConfigSelectionElement(config.scan.type) == "single_transponder") or \
 #                      (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"] and currentConfigSelectionElement(config.scan.typecable) == "single_transponder") or \
@@ -693,7 +692,6 @@ class ScanSimple(Screen):
                tlist = []
 
                nimcount = nimmanager.getNimSocketCount()
                tlist = []
 
                nimcount = nimmanager.getNimSocketCount()
-               have_terrestrial = False
                if nimcount > 0:
                        nimtype = nimmanager.getNimType(0)
                        scan_possible=True
                if nimcount > 0:
                        nimtype = nimmanager.getNimType(0)
                        scan_possible=True
@@ -701,9 +699,7 @@ class ScanSimple(Screen):
                        config.scan.clearallservices = configElement_nonSave("config.scan.clearallservices", configSelection, 0, (("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))))
                        self.list.append(getConfigListEntry(_("Clear before scan"), config.scan.clearallservices))
                        nim = configElement_nonSave(0, configSelection, 0, (("yes", _("yes")), ("no", _("no"))))
                        config.scan.clearallservices = configElement_nonSave("config.scan.clearallservices", configSelection, 0, (("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))))
                        self.list.append(getConfigListEntry(_("Clear before scan"), config.scan.clearallservices))
                        nim = configElement_nonSave(0, configSelection, 0, (("yes", _("yes")), ("no", _("no"))))
-                       if nimtype == nimmanager.nimType["DVB-T"]:
-                               have_terrestrial = True
-                       elif nimtype == nimmanager.nimType["DVB-S"] and not len(nimmanager.getSatListForNim(0)):
+                       if nimtype == nimmanager.nimType["DVB-S"] and not len(nimmanager.getSatListForNim(0)):
                                scan_possible=False
                        if scan_possible:
                                self.list.append(getConfigListEntry(_("Scan NIM") + " 0 (" + nimmanager.getNimTypeName(0) + ")", nim))
                                scan_possible=False
                        if scan_possible:
                                self.list.append(getConfigListEntry(_("Scan NIM") + " 0 (" + nimmanager.getNimTypeName(0) + ")", nim))
@@ -711,11 +707,6 @@ class ScanSimple(Screen):
                if nimcount > 1 and self.ScanNimTwoNeeded():
                        nim = configElement_nonSave(1, configSelection, 0, (("yes", _("yes")), ("no", _("no"))))
                        self.list.append(getConfigListEntry(_("Scan NIM") + " 1 (" + nimmanager.getNimTypeName(1) + ")", nim))
                if nimcount > 1 and self.ScanNimTwoNeeded():
                        nim = configElement_nonSave(1, configSelection, 0, (("yes", _("yes")), ("no", _("no"))))
                        self.list.append(getConfigListEntry(_("Scan NIM") + " 1 (" + nimmanager.getNimTypeName(1) + ")", nim))
-                       if nimmanager.getNimType(1) == nimmanager.nimType["DVB-T"]:
-                               have_terrestrial = True
-
-               if have_terrestrial:
-                       self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), config.terrestrial.enable_5V))
 
                self["config"] = ConfigList(self.list)
                self["header"] = Label(_("Automatic Scan"))
 
                self["config"] = ConfigList(self.list)
                self["header"] = Label(_("Automatic Scan"))