aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-06-02 14:35:58 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-06-02 14:35:58 +0000
commitf97a4e53dcd9321cfe4d026f8efac3a3fea1cb6a (patch)
tree87447df391296618793c1bd99761d9ec1d681a64 /lib
parent7ee3f3b8aaf43c8c712ce1c4c1d8b8c52e692e12 (diff)
downloadenigma2-f97a4e53dcd9321cfe4d026f8efac3a3fea1cb6a.tar.gz
enigma2-f97a4e53dcd9321cfe4d026f8efac3a3fea1cb6a.zip
dont use and show input power measurement (for rotor running detection),
when the hardware doesn't support it
Diffstat (limited to 'lib')
-rw-r--r--lib/dvb/dvb.cpp9
-rw-r--r--lib/dvb/dvb.h1
-rw-r--r--lib/dvb/sec.h2
-rw-r--r--lib/python/Components/SystemInfo.py3
-rw-r--r--lib/python/Screens/Satconfig.py56
5 files changed, 48 insertions, 23 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index f5eadda0..41c4f3ca 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -748,6 +748,15 @@ error:
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:
diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h
index c71a4d1b..d2148bc9 100644
--- a/lib/dvb/dvb.h
+++ b/lib/dvb/dvb.h
@@ -215,6 +215,7 @@ public:
#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);
diff --git a/lib/dvb/sec.h b/lib/dvb/sec.h
index 9522426b..2241e00e 100644
--- a/lib/dvb/sec.h
+++ b/lib/dvb/sec.h
@@ -270,6 +270,7 @@ private:
eSmartPtrList<eDVBRegisteredFrontend> &m_avail_frontends;
bool m_rotorMoving;
int m_not_linked_slot_mask;
+ bool m_canMeasureInputPower;
#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();
+ bool canMeasureInputPower() { return m_canMeasureInputPower; }
};
#endif
diff --git a/lib/python/Components/SystemInfo.py b/lib/python/Components/SystemInfo.py
index 844c9544..c3c8ff36 100644
--- a/lib/python/Components/SystemInfo.py
+++ b/lib/python/Components/SystemInfo.py
@@ -1,3 +1,5 @@
+from enigma import eDVBResourceManager
+
SystemInfo = { }
#FIXMEE...
@@ -9,3 +11,4 @@ def getNumVideoDecoders():
return idx
SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
+SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py
index e32c45fb..5415ae05 100644
--- a/lib/python/Screens/Satconfig.py
+++ b/lib/python/Screens/Satconfig.py
@@ -1,5 +1,6 @@
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
@@ -29,18 +30,22 @@ class NimSetup(Screen, ConfigListScreen):
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"
@@ -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.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":