use dvb-t parameters
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 7 Apr 2006 16:03:49 +0000 (16:03 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 7 Apr 2006 16:03:49 +0000 (16:03 +0000)
lib/python/Screens/ScanSetup.py

index 8f02ab3..e0b5cd6 100644 (file)
@@ -147,6 +147,7 @@ class ScanSetup(Screen):
                if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
                        if currentConfigSelectionElement(config.scan.typeterrestrial) == "single_transponder":
                                self.list.append(getConfigListEntry(_("Frequency"), config.scan.ter.frequency))
                if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
                        if currentConfigSelectionElement(config.scan.typeterrestrial) == "single_transponder":
                                self.list.append(getConfigListEntry(_("Frequency"), config.scan.ter.frequency))
+                               self.list.append(getConfigListEntry(_("Network scan"), config.scan.cab.networkScan))
                                self.list.append(getConfigListEntry(_("Inversion"), config.scan.ter.inversion))
                                self.list.append(getConfigListEntry(_("Bandwidth"), config.scan.ter.bandwidth))
                                self.list.append(getConfigListEntry(_("Code rate high"), config.scan.ter.fechigh))
                                self.list.append(getConfigListEntry(_("Inversion"), config.scan.ter.inversion))
                                self.list.append(getConfigListEntry(_("Bandwidth"), config.scan.ter.bandwidth))
                                self.list.append(getConfigListEntry(_("Code rate high"), config.scan.ter.fechigh))
@@ -236,6 +237,7 @@ class ScanSetup(Screen):
                        config.scan.ter.transmission = configElement_nonSave("config.scan.ter.transmission", configSelection, 2, (("2k", "2K"), ("8k", "8K"), ("auto", _("Auto"))))
                        config.scan.ter.guard = configElement_nonSave("config.scan.ter.guard", configSelection, 4, (("1_32", "1/32"), ("1_16", "1/16"), ("1_8", "1/8"), ("1_4", "1/4"), ("auto", _("Auto"))))
                        config.scan.ter.hierarchy = configElement_nonSave("config.scan.ter.hierarchy", configSelection, 4, (("none", _("None")), ("1", "1"), ("2", "2"), ("4", "4"), ("auto", _("Auto"))))
                        config.scan.ter.transmission = configElement_nonSave("config.scan.ter.transmission", configSelection, 2, (("2k", "2K"), ("8k", "8K"), ("auto", _("Auto"))))
                        config.scan.ter.guard = configElement_nonSave("config.scan.ter.guard", configSelection, 4, (("1_32", "1/32"), ("1_16", "1/16"), ("1_8", "1/8"), ("1_4", "1/4"), ("auto", _("Auto"))))
                        config.scan.ter.hierarchy = configElement_nonSave("config.scan.ter.hierarchy", configSelection, 4, (("none", _("None")), ("1", "1"), ("2", "2"), ("4", "4"), ("auto", _("Auto"))))
+                       config.scan.ter.networkScan = configElement_nonSave("config.scan.cab.networkScan", configSelection, 0, (("no", _("no")), ("yes", _("yes"))))
 
                        config.scan.scansat = {}
                        for sat in nimmanager.satList:
 
                        config.scan.scansat = {}
                        for sat in nimmanager.satList:
@@ -293,18 +295,64 @@ class ScanSetup(Screen):
                #parm.inversion = 2             #AUTO
                tlist.append(parm)
 
                #parm.inversion = 2             #AUTO
                tlist.append(parm)
 
-       # FIXME use correct parameters
-       def addTerTransponder(self, tlist, frequency):
+       def addTerTransponder(self, tlist, frequency, 
+                       inversion=2, bandwidth = 3, fechigh = 6, feclow = 6,
+                       modulation = 2, transmission = 2, guard = 4,
+                       hierarchy = 4):
+               # WARNING: normally, enums are working directly.
+               # Don't copy this (very bad)!! Instead either fix swig (good) or
+               # move this into a central place.
+               Bw8MHz = 0
+               Bw7MHz = 1
+               Bw6MHz = 2
+               Bw5MHz = 3
+               BwAuto = 4
+               
+               f1_2 = 0
+               f2_3 = 1
+               f3_4 = 2
+               f5_6 = 3
+               f7_8 = 4
+               fAuto = 5
+               
+               TM2k = 0
+               TM8k = 1
+               TM4k = 2
+               TMAuto = 3
+               
+               GI_1_32 = 0
+               GI_1_16 = 1
+               GI_1_8 = 2
+               GI_1_4 = 3
+               GI_Auto = 4
+               
+               HNone = 0
+               H1 = 1
+               H2 = 2
+               H4 = 3
+               HAuto = 4
+
+               QPSK = 0
+               QAM16 = 1
+               QAM64 = 2
+               Auto = 3
+               
+               Off = 0
+               On = 1
+               Unknown = 2
+
                parm = eDVBFrontendParametersTerrestrial()
                
                parm.frequency = frequency * 1000000
                parm = eDVBFrontendParametersTerrestrial()
                
                parm.frequency = frequency * 1000000
-               parm.inversion = 2  # eDVBFrontendParametersTerrestrial.Inversion.Unknown;
-               parm.bandwidth = 0  #eDVBFrontendParametersTerrestrial.Bandwidth.Bw8MHz;
-               parm.code_rate_HP = parm.code_rate_LP = 6 #eDVBFrontendParametersTerrestrial.FEC.fAuto;
-               parm.modulation = 1 #eDVBFrontendParametersTerrestrial.Modulation.QAM16;
-               parm.transmission_mode = 1 # eDVBFrontendParametersTerrestrial.TransmissionMode.TM8k;
-               parm.guard_interval = 0 # eDVBFrontendParametersTerrestrial.GuardInterval.GI_1_32;
-               parm.hierarchy = 0 #eDVBFrontendParametersTerrestrial.Hierarchy.HNone;
+
+               parm.inversion = [Off, On, Unknown][inversion]
+               parm.bandwidth = [Bw8MHz, Bw7MHz, Bw6MHz, BwAuto][bandwidth] # Bw5MHz unsupported
+               parm.code_rate_HP = [fAuto, f1_2, f2_3, f3_4, f5_6, f7_8, fAuto][fechigh]
+               parm.code_rate_LP = [fAuto, f1_2, f2_3, f3_4, f5_6, f7_8, fAuto][feclow]
+               parm.modulation = [QPSK, QAM16, Auto][modulation] # QAM64 unsupported
+               parm.transmission_mode = [TM2k, TM8k, TMAuto][transmission] # TM4k unsupported
+               parm.guard_interval = [GI_1_32, GI_1_16, GI_1_8, GI_1_4, GI_Auto][guard]
+               parm.hierarchy = [HNone, H1, H2, H4, HAuto][hierarchy]
                tlist.append(parm)
 
        def keyGo(self):
                tlist.append(parm)
 
        def keyGo(self):
@@ -348,12 +396,20 @@ class ScanSetup(Screen):
                elif (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
                        if currentConfigSelectionElement(config.scan.typeterrestrial) == "single_transponder":
                                self.addTerTransponder(tlist, 
                elif (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
                        if currentConfigSelectionElement(config.scan.typeterrestrial) == "single_transponder":
                                self.addTerTransponder(tlist, 
-                                                                                 config.scan.ter.frequency.value[0])
+                                               config.scan.ter.frequency.value[0],
+                                               inversion = config.scan.ter.inversion.value,
+                                               bandwidth = config.scan.ter.bandwidth.value,
+                                               fechigh = config.scan.ter.fechigh.value,
+                                               feclow = config.scan.ter.feclow.value,
+                                               modulation = config.scan.ter.modulation.value,
+                                               transmission = config.scan.ter.transmission.value,
+                                               guard = config.scan.ter.guard.value,
+                                               hierarchy = config.scan.ter.hierarchy.value)
+                               if currentConfigSelectionElement(config.scan.ter.networkScan) == "yes":
+                                       flags |= eComponentScan.scanNetworkSearch
                        if currentConfigSelectionElement(config.scan.typeterrestrial) == "complete":
                                pass
 
                        if currentConfigSelectionElement(config.scan.typeterrestrial) == "complete":
                                pass
 
-
-
                for x in self["config"].list:
                        x[1].save()
 
                for x in self["config"].list:
                        x[1].save()