fix
authorFelix Domke <tmbinc@elitedvb.net>
Sat, 14 Jan 2006 20:26:28 +0000 (20:26 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sat, 14 Jan 2006 20:26:28 +0000 (20:26 +0000)
lib/python/Components/ServiceScan.py

index 7cbc65dbbde16a0344ea59251d74577f4b64da89..04690b5d75d2b602cfd1919213ed59b0c7973469 100644 (file)
@@ -39,39 +39,16 @@ class ServiceScan:
                if self.state == self.Error:
                        self.text.setText(_("ERROR - failed to scan (%s)!") % (self.Errors[self.errorcode]) )
        
                if self.state == self.Error:
                        self.text.setText(_("ERROR - failed to scan (%s)!") % (self.Errors[self.errorcode]) )
        
-       def __init__(self, progressbar, text, transponders, feid, flags):
+       def __init__(self, progressbar, text, servicelist, transponders, feid, flags):
                self.progressbar = progressbar
                self.text = text
                self.scan = eComponentScan()
                self.state = self.Idle
                self.feid = feid
                self.flags = flags
                self.progressbar = progressbar
                self.text = text
                self.scan = eComponentScan()
                self.state = self.Idle
                self.feid = feid
                self.flags = flags
+               self.servicelist = servicelist
                self.scanStatusChanged()
                
                self.scanStatusChanged()
                
-#              if 1:
-#                      parm = eDVBFrontendParametersSatellite()
-#
-#                      parm.frequency = 11817000
-#                      parm.symbol_rate = 27500000
-#                      parm.polarisation = 1 # eDVBFrontendParametersSatellite.Polarisation.Vertical
-#                      parm.fec = 3 # eDVBFrontendParametersSatellite.FEC.f3_4;
-#                      parm.inversion = 1 #eDVBFrontendParametersSatellite.Inversion.Off;
-#                      parm.orbital_position = 192
-#                      self.scan.addInitial(parm)
-#              else:
-#                              # until we have a terrestrial.xml:
-#                      for x in [490000000, 530000000, 546000000, 570000000, 626000000]:
-#                              parm = eDVBFrontendParametersTerrestrial()
-#                              parm.frequency = x
-#                              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;
-#                              self.scan.addInitial(parm)
-               
                for x in transponders:
                        self.scan.addInitial(x)
                
                for x in transponders:
                        self.scan.addInitial(x)
                
@@ -79,6 +56,7 @@ class ServiceScan:
                
        def execBegin(self):
                self.scan.statusChanged.get().append(self.scanStatusChanged)
                
        def execBegin(self):
                self.scan.statusChanged.get().append(self.scanStatusChanged)
+               self.scan.newService.get().append(self.newService)
                self.state = self.Running
                err = self.scan.start(self.feid, self.flags)
                if err:
                self.state = self.Running
                err = self.scan.start(self.feid, self.flags)
                if err:
@@ -89,11 +67,15 @@ class ServiceScan:
        
        def execEnd(self):
                self.scan.statusChanged.get().remove(self.scanStatusChanged)
        
        def execEnd(self):
                self.scan.statusChanged.get().remove(self.scanStatusChanged)
+               self.scan.newService.get().remove(self.newService)
                if not self.isDone():
                        print "*** warning *** scan was not finished!"
                
                del self.scan
 
        def isDone(self):
                if not self.isDone():
                        print "*** warning *** scan was not finished!"
                
                del self.scan
 
        def isDone(self):
-               print "state is %d " % (self.state)
                return self.state == self.Done or self.state == self.Error
                return self.state == self.Done or self.state == self.Error
+
+       def newService(self):
+               newServiceName = self.scan.getLastServiceName()
+               self.servicelist.addItem(newServiceName)