aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2010-03-30 18:25:06 +0200
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2010-03-31 23:53:21 +0200
commit85b69597116f1d9bcd52331c01f0d4fb4c6d3c60 (patch)
treeb62ee008301bf222d873224535ddad96beeb0e65 /lib
parentcd176a16cb54350617ea202de983e8d643978971 (diff)
downloadenigma2-85b69597116f1d9bcd52331c01f0d4fb4c6d3c60.tar.gz
enigma2-85b69597116f1d9bcd52331c01f0d4fb4c6d3c60.zip
fixes bug #436
some improvements to the multi tuner type switching
Diffstat (limited to 'lib')
-rw-r--r--lib/dvb/frontend.cpp7
-rw-r--r--lib/dvb/frontend.h1
-rw-r--r--lib/dvb/idvb.h1
-rw-r--r--lib/python/Components/NimManager.py46
-rw-r--r--lib/python/Screens/Satconfig.py2
5 files changed, 44 insertions, 13 deletions
diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp
index f85a37fe..8216eea0 100644
--- a/lib/dvb/frontend.cpp
+++ b/lib/dvb/frontend.cpp
@@ -483,6 +483,13 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate)
closeFrontend();
}
+void eDVBFrontend::reopenFrontend()
+{
+ closeFrontend();
+ m_type = -1;
+ openFrontend();
+}
+
int eDVBFrontend::openFrontend()
{
if (m_state != stateClosed)
diff --git a/lib/dvb/frontend.h b/lib/dvb/frontend.h
index 4cf05081..bc31755c 100644
--- a/lib/dvb/frontend.h
+++ b/lib/dvb/frontend.h
@@ -146,6 +146,7 @@ public:
static void setTypePriorityOrder(int val) { PriorityOrder = val; }
static int getTypePriorityOrder() { return PriorityOrder; }
+ void reopenFrontend();
int openFrontend();
int closeFrontend(bool force=false);
const char *getDescription() const { return m_description; }
diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h
index 4ef7efad..a3e87e35 100644
--- a/lib/dvb/idvb.h
+++ b/lib/dvb/idvb.h
@@ -459,6 +459,7 @@ class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject
public:
virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0;
virtual RESULT tune(const iDVBFrontendParameters &where)=0;
+ virtual void reopenFrontend()=0;
#ifndef SWIG
virtual RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection)=0;
#endif
diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py
index 745cc730..70ed7c4a 100644
--- a/lib/python/Components/NimManager.py
+++ b/lib/python/Components/NimManager.py
@@ -1,4 +1,5 @@
from Tools.HardwareInfo import HardwareInfo
+from Tools.BoundFunction import boundFunction
from config import config, ConfigSubsection, ConfigSelection, ConfigFloat, \
ConfigSatlist, ConfigYesNo, ConfigInteger, ConfigSubList, ConfigNothing, \
@@ -13,6 +14,7 @@ from enigma import eDVBSatelliteEquipmentControl as secClass, \
from time import localtime, mktime
from datetime import datetime
+from Tools.BoundFunction import boundFunction
def getConfigSatlist(orbpos, satlist):
default_orbpos = None
@@ -687,6 +689,9 @@ class NimManager:
def getNimDescription(self, slotid):
return self.nim_slots[slotid].friendly_full_description
+
+ def getNimName(self, slotid):
+ return self.nim_slots[slotid].description
def getNimListOfType(self, type, exception = -1):
# returns a list of indexes for NIMs compatible to the given type, except for 'exception'
@@ -962,12 +967,18 @@ def InitSecParams():
# the configElement should be only visible when diseqc 1.2 is disabled
def InitNimManager(nimmgr):
- InitSecParams()
hw = HardwareInfo()
+ addNimConfig = False
+ try:
+ config.Nims
+ except:
+ addNimConfig = True
- config.Nims = ConfigSubList()
- for x in range(len(nimmgr.nim_slots)):
- config.Nims.append(ConfigSubsection())
+ if addNimConfig:
+ InitSecParams()
+ config.Nims = ConfigSubList()
+ for x in range(len(nimmgr.nim_slots)):
+ config.Nims.append(ConfigSubsection())
lnb_choices = {
"universal_lnb": _("Universal LNB"),
@@ -1243,27 +1254,38 @@ def InitNimManager(nimmgr):
if nimmgr.nim_slots[slot_id].description == 'Alps BSBE2':
open("/proc/stb/frontend/%d/tone_amplitude" %(fe_id), "w").write(configElement.value)
- def tunerTypeChanged(configElement):
+ def tunerTypeChanged(nimmgr, configElement):
fe_id = configElement.fe_id
+ print "tunerTypeChanged feid %d to mode %s" % (fe_id, configElement.value)
open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value)
-
+ frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend()
+ frontend.reopenFrontend()
+ nimmgr.enumerateNIMs()
+
empty_slots = 0
for slot in nimmgr.nim_slots:
x = slot.slot
nim = config.Nims[x]
- if slot.isMultiType():
+ addMultiType = False
+ try:
+ nim.multiType
+ except:
+ addMultiType = True
+ if slot.isMultiType() and addMultiType:
typeList = []
- value = None
for id in slot.getMultiTypeList().keys():
type = slot.getMultiTypeList()[id]
typeList.append((id, type))
- if type == slot.getType():
- value = id
nim.multiType = ConfigSelection(typeList, "0")
- nim.multiType.value = value
+
nim.multiType.fe_id = x - empty_slots
- nim.multiType.addNotifier(tunerTypeChanged)
+ nim.multiType.addNotifier(boundFunction(tunerTypeChanged, nimmgr))
+ empty_slots = 0
+ for slot in nimmgr.nim_slots:
+ x = slot.slot
+ nim = config.Nims[x]
+
if slot.isCompatible("DVB-S"):
nim.toneAmplitude = ConfigSelection([("9", "600mV"), ("8", "700mV"), ("7", "800mV"), ("6", "900mV"), ("5", "1100mV")], "7")
nim.toneAmplitude.fe_id = x - empty_slots
diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py
index 7ba3a134..87d65e54 100644
--- a/lib/python/Screens/Satconfig.py
+++ b/lib/python/Screens/Satconfig.py
@@ -208,11 +208,11 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen):
self.advancedType, self.advancedSCR, self.advancedManufacturer, self.advancedUnicable, \
self.uncommittedDiseqcCommand, self.cableScanType, self.multiType)
if self["config"].getCurrent() == self.multiType:
- nimmanager.enumerateNIMs()
from Components.NimManager import InitNimManager
InitNimManager(nimmanager)
self.nim = nimmanager.nim_slots[self.slotid]
self.nimConfig = self.nim.config
+
for x in checkList:
if self["config"].getCurrent() == x:
self.createSetup()