change iFrontendInformation api
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 15 Jan 2007 15:51:19 +0000 (15:51 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 15 Jan 2007 15:51:19 +0000 (15:51 +0000)
getFrontendData(bool) is now splitted in three seperate calls
getFrontendData() returns the frontend number and frontend type in a dict
getFrontendStatus() return signal quality, signal power, bit error rate,
lock state, sync state, frontend state in a dict
getTransponderData(bool) when the bool is true it returns a dict with the
original tuned transponder data, when false the transponderdata read out
from the frontend driver
getAll(bool) is a sum of the three single calls and the direct replacement
of the old getFrontendData call

12 files changed:
lib/dvb/frontend.cpp
lib/dvb/frontend.h
lib/dvb/idvb.h
lib/python/Components/Sources/FrontendStatus.py
lib/python/Components/TunerInfo.py
lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
lib/python/Screens/ScanSetup.py
lib/python/Screens/ServiceInfo.py
lib/service/iservice.h
lib/service/servicedvb.cpp
lib/service/servicedvb.h

index d8301db..3ae9473 100644 (file)
@@ -971,17 +971,97 @@ void fillDictWithTerrestrialData(ePyObject dict, const FRONTENDPARAMETERS &parm)
        PutToDict(dict, "hierarchy_information", tmp);
 }
 
        PutToDict(dict, "hierarchy_information", tmp);
 }
 
-PyObject *eDVBFrontend::readTransponderData(bool original)
+void eDVBFrontend::getFrontendStatus(ePyObject dest)
 {
 {
-       ePyObject ret=PyDict_New();
+       if (dest && PyDict_Check(dest))
+       {
+               const char *tmp = "UNKNOWN";
+               switch(m_state)
+               {
+                       case stateIdle:
+                               tmp="IDLE";
+                               break;
+                       case stateTuning:
+                               tmp="TUNING";
+                               break;
+                       case stateFailed:
+                               tmp="FAILED";
+                               break;
+                       case stateLock:
+                               tmp="LOCKED";
+                               break;
+                       case stateLostLock:
+                               tmp="LOSTLOCK";
+                               break;
+                       default:
+                               break;
+               }
+               PutToDict(dest, "tuner_state", tmp);
+               PutToDict(dest, "tuner_locked", readFrontendData(locked));
+               PutToDict(dest, "tuner_synced", readFrontendData(synced));
+               PutToDict(dest, "tuner_bit_error_rate", readFrontendData(bitErrorRate));
+               PutToDict(dest, "tuner_signal_power", readFrontendData(signalPower));
+               PutToDict(dest, "tuner_signal_quality", readFrontendData(signalQuality));
+       }
+}
 
 
-       if (ret)
+void eDVBFrontend::getTransponderData(ePyObject dest, bool original)
+{
+       if (m_fd != -1 && dest && PyDict_Check(dest))
        {
        {
-               bool read=m_fd != -1;
-               const char *tmp=0;
+               switch(m_type)
+               {
+                       case feSatellite:
+                       case feCable:
+                       case feTerrestrial:
+                       {
+                               FRONTENDPARAMETERS front;
+                               if (!original && ioctl(m_fd, FE_GET_FRONTEND, &front)<0)
+                                       eDebug("FE_GET_FRONTEND (%m)");
+                               else
+                               {
+                                       const FRONTENDPARAMETERS &parm = original ? this->parm : front;
+                                       const char *tmp = "INVERSION_AUTO";
+                                       switch(parm_inversion)
+                                       {
+                                               case INVERSION_ON:
+                                                       tmp = "INVERSION_ON";
+                                                       break;
+                                               case INVERSION_OFF:
+                                                       tmp = "INVERSION_OFF";
+                                                       break;
+                                               default:
+                                                       break;
+                                       }
+                                       if (tmp)
+                                               PutToDict(dest, "inversion", tmp);
 
 
-               PutToDict(ret, "tuner_number", m_fe);
+                                       switch(m_type)
+                                       {
+                                               case feSatellite:
+                                                       fillDictWithSatelliteData(dest, original?parm:front, this);
+                                                       break;
+                                               case feCable:
+                                                       fillDictWithCableData(dest, original?parm:front);
+                                                       break;
+                                               case feTerrestrial:
+                                                       fillDictWithTerrestrialData(dest, original?parm:front);
+                                                       break;
+                                       }
+                               }
+                       }
+                       default:
+                               break;
+               }
+       }
+}
 
 
+void eDVBFrontend::getFrontendData(ePyObject dest)
+{
+       if (dest && PyDict_Check(dest))
+       {
+               const char *tmp=0;
+               PutToDict(dest, "tuner_number", m_fe);
                switch(m_type)
                {
                        case feSatellite:
                switch(m_type)
                {
                        case feSatellite:
@@ -995,83 +1075,10 @@ PyObject *eDVBFrontend::readTransponderData(bool original)
                                break;
                        default:
                                tmp = "UNKNOWN";
                                break;
                        default:
                                tmp = "UNKNOWN";
-                               read=false;
                                break;
                }
                                break;
                }
-               PutToDict(ret, "tuner_type", tmp);
-
-               if (read)
-               {
-                       FRONTENDPARAMETERS front;
-
-                       tmp = "UNKNOWN";
-                       switch(m_state)
-                       {
-                               case stateIdle:
-                                       tmp="IDLE";
-                                       break;
-                               case stateTuning:
-                                       tmp="TUNING";
-                                       break;
-                               case stateFailed:
-                                       tmp="FAILED";
-                                       break;
-                               case stateLock:
-                                       tmp="LOCKED";
-                                       break;
-                               case stateLostLock:
-                                       tmp="LOSTLOCK";
-                                       break;
-                               default:
-                                       break;
-                       }
-                       PutToDict(ret, "tuner_state", tmp);
-
-                       PutToDict(ret, "tuner_locked", readFrontendData(locked));
-                       PutToDict(ret, "tuner_synced", readFrontendData(synced));
-                       PutToDict(ret, "tuner_bit_error_rate", readFrontendData(bitErrorRate));
-                       PutToDict(ret, "tuner_signal_power", readFrontendData(signalPower));
-                       PutToDict(ret, "tuner_signal_quality", readFrontendData(signalQuality));
-
-                       if (!original && ioctl(m_fd, FE_GET_FRONTEND, &front)<0)
-                               eDebug("FE_GET_FRONTEND (%m)");
-                       else
-                       {
-                               const FRONTENDPARAMETERS &parm = original ? this->parm : front;
-                               tmp = "INVERSION_AUTO";
-                               switch(parm_inversion)
-                               {
-                                       case INVERSION_ON:
-                                               tmp = "INVERSION_ON";
-                                               break;
-                                       case INVERSION_OFF:
-                                               tmp = "INVERSION_OFF";
-                                               break;
-                                       default:
-                                               break;
-                               }
-                               if (tmp)
-                                       PutToDict(ret, "inversion", tmp);
-
-                               switch(m_type)
-                               {
-                                       case feSatellite:
-                                               fillDictWithSatelliteData(ret, original?parm:front, this);
-                                               break;
-                                       case feCable:
-                                               fillDictWithCableData(ret, original?parm:front);
-                                               break;
-                                       case feTerrestrial:
-                                               fillDictWithTerrestrialData(ret, original?parm:front);
-                                               break;
-                               }
-                       }
-               }
+               PutToDict(dest, "tuner_type", tmp);
        }
        }
-       else
-               Py_RETURN_NONE;
-
-       return ret;
 }
 
 #ifndef FP_IOCTL_GET_ID
 }
 
 #ifndef FP_IOCTL_GET_ID
index df028c1..cfe25d1 100644 (file)
@@ -110,7 +110,9 @@ public:
        RESULT setData(int num, int val);
 
        int readFrontendData(int type); // bitErrorRate, signalPower, signalQuality, locked, synced
        RESULT setData(int num, int val);
 
        int readFrontendData(int type); // bitErrorRate, signalPower, signalQuality, locked, synced
-       PyObject *readTransponderData(bool original);
+       void getFrontendStatus(ePyObject dest);
+       void getTransponderData(ePyObject dest, bool original);
+       void getFrontendData(ePyObject dest);
 
        int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm);
        int getID() { return m_fe; }
 
        int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm);
        int getID() { return m_fe; }
index d5f399c..36b2bea 100644 (file)
@@ -465,7 +465,9 @@ public:
        virtual RESULT setSecSequence(const eSecCommandList &list)=0;
 #endif
        virtual int readFrontendData(int type)=0;
        virtual RESULT setSecSequence(const eSecCommandList &list)=0;
 #endif
        virtual int readFrontendData(int type)=0;
-       virtual PyObject *readTransponderData(bool original)=0;
+       virtual void getFrontendStatus(SWIG_PYOBJECT(ePyObject) dest)=0;
+       virtual void getTransponderData(SWIG_PYOBJECT(ePyObject) dest, bool original)=0;
+       virtual void getFrontendData(SWIG_PYOBJECT(ePyObject) dest)=0;
 #ifndef SWIG
        virtual RESULT getData(int num, int &data)=0;
        virtual RESULT setData(int num, int val)=0;
 #ifndef SWIG
        virtual RESULT getData(int num, int &data)=0;
        virtual RESULT setData(int num, int val)=0;
index 352b9fd..d931177 100644 (file)
@@ -16,25 +16,27 @@ class FrontendStatus(Source):
                self.snr = self.agc = self.ber = self.lock = None
 
        def updateFrontendStatus(self):
                self.snr = self.agc = self.ber = self.lock = None
 
        def updateFrontendStatus(self):
-               feinfo = self.getFrontendInfo()
-               if feinfo is None:
+               print "updateFrontendStatus"
+               status = self.getFrontendStatus()
+               if not status:
                        self.invalidate()
                else:
                        self.invalidate()
                else:
-                       (self.snr, self.agc, self.ber, self.lock) = \
-                               [feinfo.getFrontendInfo(x) \
-                                       for x in [iFrontendInformation.signalPower, 
-                                               iFrontendInformation.signalQuality, 
-                                               iFrontendInformation.bitErrorRate, 
-                                               iFrontendInformation.lockState] ]
-
+                       self.snr = status.get("tuner_signal_power")
+                       self.agc = status.get("tuner_signal_quality")
+                       self.ber = status.get("tuner_bit_error_rate")
+                       self.lock = status.get("tuner_locked")
                self.changed((self.CHANGED_ALL, ))
 
                self.changed((self.CHANGED_ALL, ))
 
-       def getFrontendInfo(self):
+       def getFrontendStatus(self):
                if self.frontend_source:
                if self.frontend_source:
-                       return self.frontend_source()
+                       frontend = self.frontend_source()
+                       if frontend:
+                               dict = { }
+                               frontend.getFrontendStatus(dict)
                elif self.service_source:
                        service = self.service_source()
                elif self.service_source:
                        service = self.service_source()
-                       return service and service.frontendInfo()
+                       feinfo = service and service.frontendInfo()
+                       return feinfo and feinfo.getFrontendStatus()
                else:
                        return None
 
                else:
                        return None
 
index 490b9be..2495022 100644 (file)
@@ -9,7 +9,6 @@ class TunerInfo(GUIComponent):
        AGC = 1
        BER = 2
        LOCK = 3
        AGC = 1
        BER = 2
        LOCK = 3
-       
        SNR_PERCENTAGE = 0
        AGC_PERCENTAGE = 1
        BER_VALUE = 2
        SNR_PERCENTAGE = 0
        AGC_PERCENTAGE = 1
        BER_VALUE = 2
@@ -18,34 +17,35 @@ class TunerInfo(GUIComponent):
        BER_BAR = 5
        LOCK_STATE = 6
        SYNC_STATE = 7
        BER_BAR = 5
        LOCK_STATE = 6
        SYNC_STATE = 7
-       def __init__(self, type, servicefkt = None, frontendfkt = None):
+
+       def __init__(self, type, servicefkt = None, frontendfkt = None, statusDict = None):
                GUIComponent.__init__(self)
                self.instance = None
                self.message = None
                self.value = None
                GUIComponent.__init__(self)
                self.instance = None
                self.message = None
                self.value = None
-               
                self.servicefkt = servicefkt
                self.frontendfkt = frontendfkt
                self.servicefkt = servicefkt
                self.frontendfkt = frontendfkt
+               self.statusDict = statusDict
                self.type = type
                self.update()
                self.type = type
                self.update()
-       
+
        def setText(self, text):
                self.message = text
                if self.instance:
                        self.instance.setText(self.message)
        def setText(self, text):
                self.message = text
                if self.instance:
                        self.instance.setText(self.message)
-       
+
        def setValue(self, value):
                self.value = value
                if self.instance:
                        self.instance.setValue(self.value)              
        def setValue(self, value):
                self.value = value
                if self.instance:
                        self.instance.setValue(self.value)              
-                       
+
        def calc(self,val):
                if not val:
                        return 0
                if val < 2500:
                        return (long)(log(val)/log(2))
                return val*100/65535
        def calc(self,val):
                if not val:
                        return 0
                if val < 2500:
                        return (long)(log(val)/log(2))
                return val*100/65535
-       
+
        def update(self):
                if self.type == self.SNR_PERCENTAGE or self.type == self.SNR_BAR:
                        value = self.getValue(self.SNR) * 100 / 65536
        def update(self):
                if self.type == self.SNR_PERCENTAGE or self.type == self.SNR_BAR:
                        value = self.getValue(self.SNR) * 100 / 65536
@@ -69,9 +69,18 @@ class TunerInfo(GUIComponent):
                                self.setText(_("locked"))
                        else:
                                self.setText(_("not locked"))
                                self.setText(_("locked"))
                        else:
                                self.setText(_("not locked"))
-                               
+
        def getValue(self, what):
        def getValue(self, what):
-               if self.servicefkt is not None:
+               if self.statusDict:
+                       if what == self.SNR:
+                               return self.statusDict.get("tuner_signal_power", 0)
+                       elif what == self.AGC:
+                               return self.statusDict.get("tuner_signal_quality", 0)
+                       elif what == self.BER:
+                               return self.statusDict.get("tuner_bit_error_rate", 0)
+                       elif what == self.LOCK:
+                               return self.statusDict.get("tuner_locked", 0)
+               elif self.servicefkt:
                        service = self.servicefkt()
                        if service is not None:
                                feinfo = service.frontendInfo()
                        service = self.servicefkt()
                        if service is not None:
                                feinfo = service.frontendInfo()
@@ -84,7 +93,7 @@ class TunerInfo(GUIComponent):
                                                return feinfo.getFrontendInfo(iFrontendInformation.bitErrorRate)
                                        elif what == self.LOCK:
                                                return feinfo.getFrontendInfo(iFrontendInformation.lockState)
                                                return feinfo.getFrontendInfo(iFrontendInformation.bitErrorRate)
                                        elif what == self.LOCK:
                                                return feinfo.getFrontendInfo(iFrontendInformation.lockState)
-               elif self.frontendfkt is not None:
+               elif self.frontendfkt:
                        frontend = self.frontendfkt()
                        if frontend:
                                if what == self.SNR:
                        frontend = self.frontendfkt()
                        if frontend:
                                if what == self.SNR:
@@ -96,7 +105,7 @@ class TunerInfo(GUIComponent):
                                elif what == self.LOCK:
                                        return frontend.readFrontendData(iFrontendInformation.lockState)
                return 0
                                elif what == self.LOCK:
                                        return frontend.readFrontendData(iFrontendInformation.lockState)
                return 0
-                               
+
        def createWidget(self, parent):
                if self.SNR_PERCENTAGE <= self.type <= self.BER_VALUE or self.type == self.LOCK_STATE:
                        return eLabel(parent)
        def createWidget(self, parent):
                if self.SNR_PERCENTAGE <= self.type <= self.BER_VALUE or self.type == self.LOCK_STATE:
                        return eLabel(parent)
@@ -104,7 +113,7 @@ class TunerInfo(GUIComponent):
                        self.g = eSlider(parent)
                        self.g.setRange(0, 100)
                        return self.g
                        self.g = eSlider(parent)
                        self.g.setRange(0, 100)
                        return self.g
-               
+
        def postWidgetCreate(self, instance):
                if self.message is not None:
                        instance.setText(self.message)
        def postWidgetCreate(self, instance):
                if self.message is not None:
                        instance.setText(self.message)
index 49ce9a7..40688df 100644 (file)
@@ -61,8 +61,9 @@ class PositionerSetup(Screen):
                                        del session.pip
                                        if not self.openFrontend():
                                                self.frontend = None # in normal case this should not happen
                                        del session.pip
                                        if not self.openFrontend():
                                                self.frontend = None # in normal case this should not happen
-                                               self.getFrontend = None
-               
+
+               self.frontendStatus = { }
+
                self.diseqc = Diseqc(self.frontend)
                self.tuner = Tuner(self.frontend)
                self.tuner.tune((0,0,0,0,0,0))
                self.diseqc = Diseqc(self.frontend)
                self.tuner = Tuner(self.frontend)
                self.tuner.tune((0,0,0,0,0,0))
@@ -89,13 +90,13 @@ class PositionerSetup(Screen):
                self["agc"] = Label()
                self["ber"] = Label()
                self["lock"] = Label()
                self["agc"] = Label()
                self["ber"] = Label()
                self["lock"] = Label()
-               self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, frontendfkt = self.getFrontend)
-               self["agc_percentage"] = TunerInfo(TunerInfo.AGC_PERCENTAGE, frontendfkt = self.getFrontend)
-               self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE, frontendfkt = self.getFrontend)
-               self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR, frontendfkt = self.getFrontend)
-               self["agc_bar"] = TunerInfo(TunerInfo.AGC_BAR, frontendfkt = self.getFrontend)
-               self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR, frontendfkt = self.getFrontend)
-               self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE, frontendfkt = self.getFrontend)
+               self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, statusDict = self.frontendStatus)
+               self["agc_percentage"] = TunerInfo(TunerInfo.AGC_PERCENTAGE, statusDict = self.frontendStatus)
+               self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE, statusDict = self.frontendStatus)
+               self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR, statusDict = self.frontendStatus)
+               self["agc_bar"] = TunerInfo(TunerInfo.AGC_BAR, statusDict = self.frontendStatus)
+               self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR, statusDict = self.frontendStatus)
+               self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE, statusDict = self.frontendStatus)
 
                self["frequency"] = Label()
                self["symbolrate"] = Label()
 
                self["frequency"] = Label()
                self["symbolrate"] = Label()
@@ -139,9 +140,6 @@ class PositionerSetup(Screen):
                else:
                        self.restartPrevService(False)
 
                else:
                        self.restartPrevService(False)
 
-       def getFrontend(self):
-               return self.frontend
-
        def openFrontend(self):
                res_mgr = eDVBResourceManager.getInstance()
                if res_mgr:
        def openFrontend(self):
                res_mgr = eDVBResourceManager.getInstance()
                if res_mgr:
@@ -324,6 +322,8 @@ class PositionerSetup(Screen):
                self.tuner.retune()
 
        def updateStatus(self):
                self.tuner.retune()
 
        def updateStatus(self):
+               if self.frontend:
+                       self.frontend.getFrontendStatus(self.frontendStatus)
                self["snr_percentage"].update()
                self["agc_percentage"].update()
                self["ber_value"].update()
                self["snr_percentage"].update()
                self["agc_percentage"].update()
                self["ber_value"].update()
@@ -332,10 +332,10 @@ class PositionerSetup(Screen):
                self["ber_bar"].update()
                self["lock_state"].update()
                transponderdata = self.tuner.getTransponderData()
                self["ber_bar"].update()
                self["lock_state"].update()
                transponderdata = self.tuner.getTransponderData()
-               self["frequency_value"].setText(str(transponderdata["frequency"]))
-               self["symbolrate_value"].setText(str(transponderdata["symbol_rate"]))
-               self["fec_value"].setText(str(transponderdata["fec_inner"]))
-               if transponderdata["tuner_locked"] == 1 and self.isMoving and self.stopOnLock:
+               self["frequency_value"].setText(str(transponderdata.get("frequency")))
+               self["symbolrate_value"].setText(str(transponderdata.get("symbol_rate")))
+               self["fec_value"].setText(str(transponderdata.get("fec_inner")))
+               if self.frontendStatus.get("tuner_locked", 0) == 1 and self.isMoving and self.stopOnLock:
                        self.diseqccommand("stop")
                        self.isMoving = False
                        self.stopOnLock = False
                        self.diseqccommand("stop")
                        self.isMoving = False
                        self.stopOnLock = False
@@ -407,9 +407,10 @@ class Tuner:
                        self.frontend.tune(self.lastparm)
 
        def getTransponderData(self):
                        self.frontend.tune(self.lastparm)
 
        def getTransponderData(self):
+               ret = { }
                if self.frontend:
                if self.frontend:
-                       return self.frontend.readTransponderData(True)
-               return None
+                       self.frontend.getTransponderData(ret, True)
+               return ret
 
 tuning = None
 
 
 tuning = None
 
@@ -573,3 +574,4 @@ def PositionerSetupStart(menuid):
 
 def Plugins(**kwargs):
        return PluginDescriptor(name=_("Positioner setup"), description="Setup your positioner", where = PluginDescriptor.WHERE_SETUP, fnc=PositionerSetupStart)
 
 def Plugins(**kwargs):
        return PluginDescriptor(name=_("Positioner setup"), description="Setup your positioner", where = PluginDescriptor.WHERE_SETUP, fnc=PositionerSetupStart)
+       
\ No newline at end of file
index b7c9ae7..6e4e27b 100644 (file)
@@ -73,13 +73,11 @@ class Satfinder(ScanSetup):
                        print "getResourceManager instance failed"
                return False
 
                        print "getResourceManager instance failed"
                return False
 
-       def getFrontend(self):
-               return self.frontend
-
        def __init__(self, session, feid):
                self.initcomplete = False
                self.feid = feid
                self.oldref = None
        def __init__(self, session, feid):
                self.initcomplete = False
                self.feid = feid
                self.oldref = None
+               self.frontendStatus = { }
                
                if not self.openFrontend():
                        self.oldref = session.nav.getCurrentlyPlayingServiceReference()
                
                if not self.openFrontend():
                        self.oldref = session.nav.getCurrentlyPlayingServiceReference()
@@ -90,7 +88,6 @@ class Satfinder(ScanSetup):
                                        del session.pip
                                        if not self.openFrontend():
                                                self.frontend = None # in normal case this should not happen
                                        del session.pip
                                        if not self.openFrontend():
                                                self.frontend = None # in normal case this should not happen
-                                               self.getFrontend = None
                
                ScanSetup.__init__(self, session)
                self.tuner = Tuner(self.frontend)
                
                ScanSetup.__init__(self, session)
                self.tuner = Tuner(self.frontend)
@@ -99,13 +96,13 @@ class Satfinder(ScanSetup):
                self["agc"] = Label()
                self["ber"] = Label()
                self["lock"] = Label()
                self["agc"] = Label()
                self["ber"] = Label()
                self["lock"] = Label()
-               self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, frontendfkt = self.getFrontend)
-               self["agc_percentage"] = TunerInfo(TunerInfo.AGC_PERCENTAGE, frontendfkt = self.getFrontend)
-               self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE, frontendfkt = self.getFrontend)
-               self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR, frontendfkt = self.getFrontend)
-               self["agc_bar"] = TunerInfo(TunerInfo.AGC_BAR, frontendfkt = self.getFrontend)
-               self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR, frontendfkt = self.getFrontend)
-               self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE, frontendfkt = self.getFrontend)
+               self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, statusDict = self.frontendStatus)
+               self["agc_percentage"] = TunerInfo(TunerInfo.AGC_PERCENTAGE, statusDict = self.frontendStatus)
+               self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE, statusDict = self.frontendStatus)
+               self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR, statusDict = self.frontendStatus)
+               self["agc_bar"] = TunerInfo(TunerInfo.AGC_BAR, statusDict = self.frontendStatus)
+               self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR, statusDict = self.frontendStatus)
+               self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE, statusDict = self.frontendStatus)
                
                self["introduction"].setText("")
                
                
                self["introduction"].setText("")
                
@@ -115,6 +112,10 @@ class Satfinder(ScanSetup):
                self.initcomplete = True
 
        def updateStatus(self):
                self.initcomplete = True
 
        def updateStatus(self):
+               if self.frontend:
+                       self.frontend.getFrontendStatus(self.frontendStatus)
+               else:
+                       self.frontendStatus.clear()
                self["snr_percentage"].update()
                self["agc_percentage"].update()
                self["ber_value"].update()
                self["snr_percentage"].update()
                self["agc_percentage"].update()
                self["ber_value"].update()
index f9c25c7..a3baf70 100644 (file)
@@ -135,7 +135,7 @@ class ScanSetup(ConfigListScreen, Screen):
                frontendData = None
                if self.service is not None:
                        self.feinfo = self.service.frontendInfo()
                frontendData = None
                if self.service is not None:
                        self.feinfo = self.service.frontendInfo()
-                       frontendData = self.feinfo and self.feinfo.getFrontendData(True)
+                       frontendData = self.feinfo and self.feinfo.getAll(True)
                self.createConfig(frontendData)
                del self.feinfo
                del self.service
                self.createConfig(frontendData)
                del self.feinfo
                del self.service
index fa94815..af53621 100644 (file)
@@ -161,7 +161,7 @@ class ServiceInfo(Screen):
        
        def showFrontendData(self, real):
                if self.type == TYPE_SERVICE_INFO:
        
        def showFrontendData(self, real):
                if self.type == TYPE_SERVICE_INFO:
-                       frontendData = self.feinfo and self.feinfo.getFrontendData(real)
+                       frontendData = self.feinfo and self.feinfo.getAll(real)
                        Labels = self.getFEData(frontendData)
                        self.fillList(Labels)
        
                        Labels = self.getFEData(frontendData)
                        self.fillList(Labels)
        
index 015ef87..feaa771 100644 (file)
@@ -367,7 +367,10 @@ class iFrontendInformation: public iFrontendInformation_ENUMS, public iObject
 #endif
 public:
        virtual int getFrontendInfo(int w)=0;
 #endif
 public:
        virtual int getFrontendInfo(int w)=0;
-       virtual PyObject *getFrontendData(bool original=false)=0;
+       virtual PyObject *getFrontendData()=0;
+       virtual PyObject *getFrontendStatus()=0;
+       virtual PyObject *getTransponderData(bool original)=0;
+       virtual PyObject *getAll(bool original)=0; // a sum of getFrontendData/Status/TransponderData
 };
 SWIG_TEMPLATE_TYPEDEF(ePtr<iFrontendInformation>, iFrontendInformationPtr);
 
 };
 SWIG_TEMPLATE_TYPEDEF(ePtr<iFrontendInformation>, iFrontendInformationPtr);
 
index 238f838..9d9f2d1 100644 (file)
@@ -1770,19 +1770,54 @@ int eDVBServiceBase::getFrontendInfo(int w)
        return fe->readFrontendData(w);
 }
 
        return fe->readFrontendData(w);
 }
 
-PyObject *eDVBServiceBase::getFrontendData(bool original)
+PyObject *eDVBServiceBase::getFrontendData()
 {
 {
-       ePyObject ret;
+       ePyObject ret = PyDict_New();
+       if (ret)
+       {
+               eUsePtr<iDVBChannel> channel;
+               if(!m_service_handler.getChannel(channel))
+               {
+                       ePtr<iDVBFrontend> fe;
+                       if(!channel->getFrontend(fe))
+                               fe->getFrontendData(ret);
+               }
+       }
+       else
+               Py_RETURN_NONE;
+       return ret;
+}
 
 
-       eUsePtr<iDVBChannel> channel;
-       if(!m_service_handler.getChannel(channel))
+PyObject *eDVBServiceBase::getFrontendStatus()
+{
+       ePyObject ret = PyDict_New();
+       if (ret)
+       {
+               eUsePtr<iDVBChannel> channel;
+               if(!m_service_handler.getChannel(channel))
+               {
+                       ePtr<iDVBFrontend> fe;
+                       if(!channel->getFrontend(fe))
+                               fe->getFrontendStatus(ret);
+               }
+       }
+       else
+               Py_RETURN_NONE;
+       return ret;
+}
+
+PyObject *eDVBServiceBase::getTransponderData(bool original)
+{
+       ePyObject ret = PyDict_New();
+       if (ret)
        {
        {
-               ePtr<iDVBFrontend> fe;
-               if(!channel->getFrontend(fe))
+               eUsePtr<iDVBChannel> channel;
+               if(!m_service_handler.getChannel(channel))
                {
                {
-                       ret = fe->readTransponderData(original);
-                       if (ret)
+                       ePtr<iDVBFrontend> fe;
+                       if(!channel->getFrontend(fe))
                        {
                        {
+                               fe->getTransponderData(ret, original);
                                ePtr<iDVBFrontendParameters> feparm;
                                channel->getCurrentFrontendParameters(feparm);
                                if (feparm)
                                ePtr<iDVBFrontendParameters> feparm;
                                channel->getCurrentFrontendParameters(feparm);
                                if (feparm)
@@ -1808,11 +1843,30 @@ PyObject *eDVBServiceBase::getFrontendData(bool original)
                        }
                }
        }
                        }
                }
        }
-       if (!ret)
+       else
                Py_RETURN_NONE;
        return ret;
 }
 
                Py_RETURN_NONE;
        return ret;
 }
 
+PyObject *eDVBServiceBase::getAll(bool original)
+{
+       ePyObject ret = getTransponderData(original);
+       if (ret != Py_None)
+       {
+               eUsePtr<iDVBChannel> channel;
+               if(!m_service_handler.getChannel(channel))
+               {
+                       ePtr<iDVBFrontend> fe;
+                       if(!channel->getFrontend(fe))
+                       {
+                               fe->getFrontendData(ret);
+                               fe->getFrontendStatus(ret);
+                       }
+               }
+       }
+       return ret;
+}
+
 int eDVBServicePlay::getNumberOfSubservices()
 {
        ePtr<eServiceEvent> evt;
 int eDVBServicePlay::getNumberOfSubservices()
 {
        ePtr<eServiceEvent> evt;
index c765e0e..34ed972 100644 (file)
@@ -75,7 +75,10 @@ protected:
 public:
                // iFrontendInformation
        int getFrontendInfo(int w);
 public:
                // iFrontendInformation
        int getFrontendInfo(int w);
-       PyObject *getFrontendData(bool);
+       PyObject *getFrontendData();
+       PyObject *getFrontendStatus();
+       PyObject *getTransponderData(bool);
+       PyObject *getAll(bool original); // a sum of getFrontendData/Status/TransponderData
 };
 
 class eSubtitleWidget; 
 };
 
 class eSubtitleWidget;