dont use and show input power measurement (for rotor running detection),
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 2 Jun 2008 14:35:58 +0000 (14:35 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 2 Jun 2008 14:35:58 +0000 (14:35 +0000)
when the hardware doesn't support it

lib/dvb/dvb.cpp
lib/dvb/dvb.h
lib/dvb/sec.h
lib/python/Components/SystemInfo.py
lib/python/Screens/Satconfig.py

index f5eadda0ed78481c791cd0162f8b2d5b34d9040b..41c4f3cad4733a1c324589904e46ca142e82049c 100644 (file)
@@ -748,6 +748,15 @@ error:
        return ret;
 }
 
        return ret;
 }
 
+bool eDVBResourceManager::canMeasureFrontendInputPower()
+{
+       for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
+       {
+               return i->m_frontend->readInputpower() >= 0;
+       }
+       return false;
+}
+
 class eDVBChannelFilePush: public eFilePushThread
 {
 public:
 class eDVBChannelFilePush: public eFilePushThread
 {
 public:
index c71a4d1b9a399f9f1d505bc9d7a86a7e0b2b66d1..d2148bc903784e2870060eef2a59a27316ae06fe 100644 (file)
@@ -215,6 +215,7 @@ public:
 #ifdef SWIG
 public:
 #endif
 #ifdef SWIG
 public:
 #endif
+       bool canMeasureFrontendInputPower();
        PSignal1<void,int> frontendUseMaskChanged;
        SWIG_VOID(RESULT) allocateRawChannel(eUsePtr<iDVBChannel> &SWIG_OUTPUT, int slot_index);
        PyObject *setFrontendSlotInformations(SWIG_PYOBJECT(ePyObject) list);
        PSignal1<void,int> frontendUseMaskChanged;
        SWIG_VOID(RESULT) allocateRawChannel(eUsePtr<iDVBChannel> &SWIG_OUTPUT, int slot_index);
        PyObject *setFrontendSlotInformations(SWIG_PYOBJECT(ePyObject) list);
index 9522426bd75022617786caa657e29d5a6ccb2767..2241e00ecfc7e04fd0adb4827488d470290c8fb9 100644 (file)
@@ -270,6 +270,7 @@ private:
        eSmartPtrList<eDVBRegisteredFrontend> &m_avail_frontends;
        bool m_rotorMoving;
        int m_not_linked_slot_mask;
        eSmartPtrList<eDVBRegisteredFrontend> &m_avail_frontends;
        bool m_rotorMoving;
        int m_not_linked_slot_mask;
+       bool m_canMeasureInputPower;
 #endif
 #ifdef SWIG
        eDVBSatelliteEquipmentControl();
 #endif
 #ifdef SWIG
        eDVBSatelliteEquipmentControl();
@@ -324,6 +325,7 @@ public:
        PyObject *get_exclusive_satellites(int tu1, int tu2);
        void setRotorMoving(bool); // called from the frontend's
        bool isRotorMoving();
        PyObject *get_exclusive_satellites(int tu1, int tu2);
        void setRotorMoving(bool); // called from the frontend's
        bool isRotorMoving();
+       bool canMeasureInputPower() { return m_canMeasureInputPower; }
 };
 
 #endif
 };
 
 #endif
index 844c9544a1fae4965bb6f31db8821ae2247a89a5..c3c8ff361022f68024f50be3780cc8005e06fa6b 100644 (file)
@@ -1,3 +1,5 @@
+from enigma import eDVBResourceManager
+
 SystemInfo = { }
 
 #FIXMEE...
 SystemInfo = { }
 
 #FIXMEE...
@@ -9,3 +11,4 @@ def getNumVideoDecoders():
        return idx
 
 SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
        return idx
 
 SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
+SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
index e32c45fbd35fec6a243cd6717a3c6a052d5858b1..5415ae05a577b4e18ca5cb3de4a9be63ad92955f 100644 (file)
@@ -1,5 +1,6 @@
 from enigma import eDVBDB
 from Screen import Screen
 from enigma import eDVBDB
 from Screen import Screen
+from Components.SystemInfo import SystemInfo
 from Components.ActionMap import ActionMap
 from Components.ConfigList import ConfigListScreen
 from Components.MenuList import MenuList
 from Components.ActionMap import ActionMap
 from Components.ConfigList import ConfigListScreen
 from Components.MenuList import MenuList
@@ -29,18 +30,22 @@ class NimSetup(Screen, ConfigListScreen):
                list.append(getConfigListEntry(" ", nim.longitudeOrientation))
                list.append(getConfigListEntry(_("Latitude"), nim.latitude))
                list.append(getConfigListEntry(" ", nim.latitudeOrientation))
                list.append(getConfigListEntry(" ", nim.longitudeOrientation))
                list.append(getConfigListEntry(_("Latitude"), nim.latitude))
                list.append(getConfigListEntry(" ", nim.latitudeOrientation))
-
-               self.advancedPowerMeasurement = getConfigListEntry(_("Use Power Measurement"), nim.powerMeasurement)
-               list.append(self.advancedPowerMeasurement)
-               if nim.powerMeasurement.value:
-                       list.append(getConfigListEntry(_("Power threshold in mA"), nim.powerThreshold))
-                       self.turningSpeed = getConfigListEntry(_("Rotor turning speed"), nim.turningSpeed)
-                       list.append(self.turningSpeed)
-                       if nim.turningSpeed.value == "fast epoch":
-                               self.turnFastEpochBegin = getConfigListEntry(_("Begin time"), nim.fastTurningBegin)
-                               self.turnFastEpochEnd = getConfigListEntry(_("End time"), nim.fastTurningEnd)
-                               list.append(self.turnFastEpochBegin)
-                               list.append(self.turnFastEpochEnd)
+               if SystemInfo["CanMeasureFrontendInputPower"]:
+                       self.advancedPowerMeasurement = getConfigListEntry(_("Use Power Measurement"), nim.powerMeasurement)
+                       list.append(self.advancedPowerMeasurement)
+                       if nim.powerMeasurement.value:
+                               list.append(getConfigListEntry(_("Power threshold in mA"), nim.powerThreshold))
+                               self.turningSpeed = getConfigListEntry(_("Rotor turning speed"), nim.turningSpeed)
+                               list.append(self.turningSpeed)
+                               if nim.turningSpeed.value == "fast epoch":
+                                       self.turnFastEpochBegin = getConfigListEntry(_("Begin time"), nim.fastTurningBegin)
+                                       self.turnFastEpochEnd = getConfigListEntry(_("End time"), nim.fastTurningEnd)
+                                       list.append(self.turnFastEpochBegin)
+                                       list.append(self.turnFastEpochEnd)
+               else:
+                       if nim.powerMeasurement.value:
+                               nim.powerMeasurement.value = False
+                               nim.powerMeasurement.save()
 
        def createSetup(self):
                print "Creating setup"
 
        def createSetup(self):
                print "Creating setup"
@@ -199,17 +204,22 @@ class NimSetup(Screen, ConfigListScreen):
                                        self.list.append(getConfigListEntry(" ", currLnb.longitudeOrientation))
                                        self.list.append(getConfigListEntry(_("Latitude"), currLnb.latitude))
                                        self.list.append(getConfigListEntry(" ", currLnb.latitudeOrientation))
                                        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 currLnb.powerMeasurement.value:
-                                               self.list.append(getConfigListEntry(_("Power threshold in mA"), currLnb.powerThreshold))
-                                               self.turningSpeed = getConfigListEntry(_("Rotor turning speed"), currLnb.turningSpeed)
-                                               self.list.append(self.turningSpeed)
-                                               if currLnb.turningSpeed.value == "fast epoch":
-                                                       self.turnFastEpochBegin = getConfigListEntry(_("Begin time"), currLnb.fastTurningBegin)
-                                                       self.turnFastEpochEnd = getConfigListEntry(_("End time"), currLnb.fastTurningEnd)
-                                                       self.list.append(self.turnFastEpochBegin)
-                                                       self.list.append(self.turnFastEpochEnd)
+                                       if SystemInfo["CanMeasureFrontendInputPower"]:
+                                               self.advancedPowerMeasurement = getConfigListEntry(_("Use Power Measurement"), currLnb.powerMeasurement)
+                                               self.list.append(self.advancedPowerMeasurement)
+                                               if currLnb.powerMeasurement.value:
+                                                       self.list.append(getConfigListEntry(_("Power threshold in mA"), currLnb.powerThreshold))
+                                                       self.turningSpeed = getConfigListEntry(_("Rotor turning speed"), currLnb.turningSpeed)
+                                                       self.list.append(self.turningSpeed)
+                                                       if currLnb.turningSpeed.value == "fast epoch":
+                                                               self.turnFastEpochBegin = getConfigListEntry(_("Begin time"), currLnb.fastTurningBegin)
+                                                               self.turnFastEpochEnd = getConfigListEntry(_("End time"), currLnb.fastTurningEnd)
+                                                               self.list.append(self.turnFastEpochBegin)
+                                                               self.list.append(self.turnFastEpochEnd)
+                                       else:
+                                               if currLnb.powerMeasurement.value:
+                                                       currLnb.powerMeasurement.value = False
+                                                       currLnb.powerMeasurement.save()
                        self.advancedLof = getConfigListEntry(_("LOF"), currLnb.lof)
                        self.list.append(self.advancedLof)
                        if currLnb.lof.value == "user_defined":
                        self.advancedLof = getConfigListEntry(_("LOF"), currLnb.lof)
                        self.list.append(self.advancedLof)
                        if currLnb.lof.value == "user_defined":