From 613447d89ad124aa6fb52627dd7c98085cdd8d31 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 7 Nov 2008 14:38:00 +0100 Subject: fix bsod in some cases --- lib/python/Screens/TimerEdit.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 800bab33..aae345db 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -317,6 +317,7 @@ class TimerSanityConflict(Screen): EMPTY = 0 ENABLE = 1 DISABLE = 2 + EDIT = 3 def __init__(self, session, timer): Screen.__init__(self, session) @@ -338,10 +339,11 @@ class TimerSanityConflict(Screen): self["key_red"] = Button("Edit") self["key_green"] = Button(" ") - self["key_yellow"] = Button("Edit") + self["key_yellow"] = Button(" ") self["key_blue"] = Button(" ") self.key_green_choice = self.EMPTY + self.key_yellow_choice = self.EMPTY self.key_blue_choice = self.EMPTY self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ShortcutActions", "TimerEditActions"], @@ -415,9 +417,14 @@ class TimerSanityConflict(Screen): self["actions"].actions.update({"green":self.toggleTimer1}) self["key_green"].setText(_("Disable")) self.key_green_choice = self.DISABLE + if len(self.timer) > 1: x = self["list"].getSelectedIndex() if self.timer[x] is not None: + if self.key_yellow_choice == self.EMPTY: + self["actions"].actions.update({"yellow":self.editTimer2}) + self["key_yellow"].setText(_("Edit")) + self.key_yellow_choice = self.EDIT if self.timer[x].disabled and self.key_blue_choice != self.ENABLE: self["actions"].actions.update({"blue":self.toggleTimer2}) self["key_blue"].setText(_("Enable")) @@ -432,9 +439,11 @@ class TimerSanityConflict(Screen): self.key_blue_choice = self.DISABLE else: #FIXME.... this doesnt hide the buttons self.... just the text - self.removeAction("yellow") - self["key_yellow"].setText(" ") - self.key_yellow_choice = self.EMPTY - self.removeAction("blue") - self["key_blue"].setText(" ") - self.key_blue_choice = self.EMPTY + if self.key_yellow_choice != self.EMPTY: + self.removeAction("yellow") + self["key_yellow"].setText(" ") + self.key_yellow_choice = self.EMPTY + if self.key_blue_choice != self.EMPTY: + self.removeAction("blue") + self["key_blue"].setText(" ") + self.key_blue_choice = self.EMPTY -- cgit v1.2.3 From a90424c0dc460b587898b65f6a89a564399ab551 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 7 Nov 2008 20:35:57 +0100 Subject: fix non working invert of oled display add non working standby slider in display setup --- lib/gdi/lcd.cpp | 8 +++++++- lib/python/Components/Lcd.py | 10 ++++++---- lib/python/Components/config.py | 5 +++++ 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'lib/python') diff --git a/lib/gdi/lcd.cpp b/lib/gdi/lcd.cpp index 39117194..ecc19b53 100644 --- a/lib/gdi/lcd.cpp +++ b/lib/gdi/lcd.cpp @@ -166,8 +166,14 @@ void eDBoxLCD::update() memset(raw, 0, 64*64); for (y=0; y<64; y++) { + int pix=0; for (x=0; x<128 / 2; x++) - raw[y*64+x] = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4); + { + pix = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4); + if (inverted) + pix = 0xFF - pix; + raw[y*64+x] = pix; + } } if (lcdfd >= 0) write(lcdfd, raw, 64*64); diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py index 0471843c..0e501237 100644 --- a/lib/python/Components/Lcd.py +++ b/lib/python/Components/Lcd.py @@ -44,9 +44,14 @@ def InitLcd(): ilcd = LCD() - config.lcd.bright = ConfigSlider(default=10, limits=(0, 10)) + config.lcd.standby = ConfigSlider(default=0, limits=(0, 10)) + config.lcd.standby.addNotifier(setLCDbright); + config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby) + + config.lcd.bright = ConfigSlider(default=5, limits=(0, 10)) config.lcd.bright.addNotifier(setLCDbright); config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright) + config.lcd.bright.callNotifiersOnSaveAndCancel = True if not ilcd.isOled(): config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) @@ -54,9 +59,6 @@ def InitLcd(): else: config.lcd.contrast = ConfigNothing() - config.lcd.standby = ConfigSlider(default=0, limits=(0, 10)) - config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby) - config.lcd.invert = ConfigYesNo(default=False) config.lcd.invert.addNotifier(setLCDinverted); else: diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index c21a9192..4ddcabec 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -34,6 +34,7 @@ class ConfigElement(object): self.save_disabled = False self.notifiers = [] self.enabled = True + self.callNotifiersOnSaveAndCancel = False # you need to override this to do input validation def setValue(self, value): @@ -66,9 +67,13 @@ class ConfigElement(object): self.saved_value = None else: self.saved_value = self.tostring(self.value) + if self.callNotifiersOnSaveAndCancel: + self.changed() def cancel(self): self.load() + if self.callNotifiersOnSaveAndCancel: + self.changed() def isChanged(self): sv = self.saved_value -- cgit v1.2.3 From b81939c5a6375795d59a7fd8d9f81c0810c7eebe Mon Sep 17 00:00:00 2001 From: acid-burn Date: Fri, 7 Nov 2008 21:30:25 +0100 Subject: fix typos fix async callback translation update --- lib/python/Screens/NetworkSetup.py | 42 +++++++++++--------- po/de.po | 81 ++++++++++++++++++++++---------------- 2 files changed, 71 insertions(+), 52 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Screens/NetworkSetup.py b/lib/python/Screens/NetworkSetup.py index 887e1674..580673e4 100755 --- a/lib/python/Screens/NetworkSetup.py +++ b/lib/python/Screens/NetworkSetup.py @@ -50,8 +50,8 @@ class NetworkAdapterSelection(Screen,HelpableScreen): Screen.__init__(self, session) HelpableScreen.__init__(self) - self.wlan_errortext = _("No working wireless networkadapter found.\nPlease verify that you have attached a compatible WLAN USB Stick and your Network is configured correctly.") - self.lan_errortext = _("No working local networkadapter found.\nPlease verify that you have attached a network cable and your Network is configured correctly.") + self.wlan_errortext = _("No working wireless network adapter found.\nPlease verify that you have attached a compatible WLAN device and your network is configured correctly.") + self.lan_errortext = _("No working local network adapter found.\nPlease verify that you have attached a network cable and your network is configured correctly.") self.oktext = _("Press OK on your remote control to continue.") self.restartLanRef = None @@ -67,18 +67,18 @@ class NetworkAdapterSelection(Screen,HelpableScreen): self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { - "cancel": (self.close, _("exit networkinterface list")), + "cancel": (self.close, _("exit network interface list")), "ok": (self.okbuttonClick, _("select interface")), }) self["ColorActions"] = HelpableActionMap(self, "ColorActions", { - "red": (self.close, _("exit networkinterface list")), + "red": (self.close, _("exit network interface list")), }) self["DefaultInterfaceAction"] = HelpableActionMap(self, "ColorActions", { - "blue": (self.setDefaultInterface, [_("Set interface as default Interface"),_("* Only available if more then one interface is active.")] ), + "blue": (self.setDefaultInterface, [_("Set interface as default Interface"),_("* Only available if more than one interface is active.")] ), }) self.list = [] @@ -273,13 +273,18 @@ class NameserverSetup(Screen, ConfigListScreen, HelpableScreen): self.createSetup() class AdapterSetup(Screen, ConfigListScreen, HelpableScreen): - def __init__(self, session, iface,essid=None, aplist=None): + def __init__(self, session, networkinfo, essid=None, aplist=None): Screen.__init__(self, session) HelpableScreen.__init__(self) self.session = session - self.iface = iface - self.essid = essid - self.aplist = aplist + if isinstance(networkinfo, (list, tuple)): + self.iface = networkinfo[0] + self.essid = networkinfo[1] + self.aplist = networkinfo[2] + else: + self.iface = networkinfo + self.essid = essid + self.aplist = aplist self.extended = None self.applyConfigRef = None self.finished_cb = None @@ -290,19 +295,19 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen): self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { - "cancel": (self.cancel, _("exit networkadapter setup menu")), + "cancel": (self.cancel, _("exit network adapter setup menu")), "ok": (self.ok, _("select menu entry")), }) self["ColorActions"] = HelpableActionMap(self, "ColorActions", { - "red": (self.cancel, _("exit networkadapter configuration")), + "red": (self.cancel, _("exit network adapter configuration")), "blue": (self.KeyBlue, _("open nameserver configuration")), }) self["VirtualKB"] = HelpableActionMap(self, "ColorActions", { - "green": (self.KeyGreen, [_("open virtual keyboard input help"),_("* Only available when entering hidden ssid or network key")] ), + "green": (self.KeyGreen, [_("open virtual keyboard input help"),_("* Only available when entering hidden SSID or network key")] ), }) self["actions"] = NumberActionMap(["SetupActions"], @@ -516,7 +521,7 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen): if self.iface == "wlan0" or self.iface == "ath0" : if self["config"].getCurrent() == self.hiddenSSID: if config.plugins.wlan.essid.value == 'hidden...': - self.session.openWithCallback(self.VirtualKeyBoardSSIDCallback, VirtualKeyBoard, title = (_("Enter WLAN networkname/SSID:")), text = config.plugins.wlan.essid.value) + self.session.openWithCallback(self.VirtualKeyBoardSSIDCallback, VirtualKeyBoard, title = (_("Enter WLAN network name/SSID:")), text = config.plugins.wlan.essid.value) if self["config"].getCurrent() == self.encryptionKey: self.session.openWithCallback(self.VirtualKeyBoardKeyCallback, VirtualKeyBoard, title = (_("Enter WLAN passphrase/key:")), text = config.plugins.wlan.encryption.psk.value) @@ -600,7 +605,7 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen): iNetwork.deactivateInterface(self.iface) iNetwork.writeNetworkConfig() iNetwork.restartNetwork(self.applyConfigDataAvail) - self.applyConfigRef = self.session.openWithCallback(self.applyConfigfinishedCB, MessageBox, _("Please wait while activating your network configuration..."), type = MessageBox.TYPE_INFO, enable_input = False) + self.applyConfigRef = self.session.openWithCallback(self.applyConfigfinishedCB, MessageBox, _("Please wait for activation of your network configuration..."), type = MessageBox.TYPE_INFO, enable_input = False) else: self.cancel() @@ -616,10 +621,10 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen): if data is True: num_configured_if = len(iNetwork.getConfiguredAdapters()) if num_configured_if >= 2: - self.session.openWithCallback(self.secondIfaceFoundCB, MessageBox, _("Your network configuration has been activated.\nA second configured interface has been found.\n\nDo you want to disable the second networkinterface?"), default = True) + self.session.openWithCallback(self.secondIfaceFoundCB, MessageBox, _("Your network configuration has been activated.\nA second configured interface has been found.\n\nDo you want to disable the second network interface?"), default = True) else: if self.finished_cb: - self.session.openWithCallback(self.finished_cb, MessageBox, _("Your network configuration has been activated."), type = MessageBox.TYPE_INFO, timeout = 10) + self.session.openWithCallback(lambda x : self.finished_cb(), MessageBox, _("Your network configuration has been activated."), type = MessageBox.TYPE_INFO, timeout = 10) else: self.session.openWithCallback(self.ConfigfinishedCB, MessageBox, _("Your network configuration has been activated."), type = MessageBox.TYPE_INFO, timeout = 10) @@ -695,7 +700,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): self.oktext = _("Press OK on your remote control to continue.") self.reboottext = _("Your Dreambox will restart after pressing OK on your remote control.") - self.errortext = _("No working wireless interface found.\n Please verify that you have attached a compatible WLAN device or enable you local network interface.") + self.errortext = _("No working wireless network interface found.\n Please verify that you have attached a compatible WLAN device or enable your local network interface.") self["WizardActions"] = HelpableActionMap(self, "WizardActions", { @@ -1404,4 +1409,5 @@ class NetworkAdapterTest(Screen): except ImportError: pass else: - iStatus.stopWlanConsole() \ No newline at end of file + iStatus.stopWlanConsole() + diff --git a/po/de.po b/po/de.po index eb38d378..e5f33eec 100755 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: tuxbox-enigma 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-07 09:36+0100\n" +"POT-Creation-Date: 2008-11-07 21:18+0100\n" "PO-Revision-Date: 2008-10-15 12:10+0100\n" "Last-Translator: Andreas Frisch \n" "Language-Team: none\n" @@ -98,13 +98,11 @@ msgstr "(leer)" msgid "(show optional DVD audio menu)" msgstr "" -msgid "* Only available if more then one interface is active." +msgid "* Only available if more than one interface is active." msgstr "* Nur verfügbar wenn mehr als ein Netzwerkadapter aktiv ist." -msgid "* Only available when entering hidden ssid or network key" -msgstr "" -"* Nur verfügbar während der eingabe einer versteckten Netzwerk SSID oder " -"WLAN Passwortes" +msgid "* Only available when entering hidden SSID or network key" +msgstr "* Verfügbar für die Eingabe der Netzwerk SSID oder Passwortes" msgid ".NFI Download failed:" msgstr "" @@ -596,7 +594,7 @@ msgid "Change bouquets in quickzap" msgstr "Bouquet wechseln beim Quickzap" msgid "Change dir." -msgstr "Verzeichniss wechseln" +msgstr "Verzeichnis wechseln" msgid "Change pin code" msgstr "Pincode ändern" @@ -1163,8 +1161,8 @@ msgstr "Anfängliche Vorlaufgeschwindigkeit eingeben" msgid "Enter Rewind at speed" msgstr "Anfängliche Rücklaufgeschwindigkeit eingeben" -msgid "Enter WLAN networkname/SSID:" -msgstr "WLAN Netzwerkname/SSID eingeben:" +msgid "Enter WLAN network name/SSID:" +msgstr "" msgid "Enter WLAN passphrase/key:" msgstr "WLAN Schlüssel/Passwort eingeben:" @@ -1262,10 +1260,10 @@ msgid "Finished" msgstr "Beendet" msgid "Finished configuring your network" -msgstr "" +msgstr "Netzwerkkonfiguration abgeschlossen" msgid "Finished restarting your network" -msgstr "" +msgstr "Netzwerkneustart abgeschlossen" msgid "Finnish" msgstr "Finnisch" @@ -1499,7 +1497,7 @@ msgid "Integrated Ethernet" msgstr "Eingebaute Netzwerkschnittstelle" msgid "Integrated Wireless" -msgstr "Integriertes Funknetzwerk" +msgstr "Integriertes WLAN" msgid "Intermediate" msgstr "Fortgeschritten" @@ -1885,22 +1883,31 @@ msgstr "" "Wenn Sie 'NEIN' wählen, bleibt der Einstellungen-Schutz deaktiviert!" msgid "" -"No working local networkadapter found.\n" -"Please verify that you have attached a network cable and your Network is " +"No working local network adapter found.\n" +"Please verify that you have attached a network cable and your network is " "configured correctly." msgstr "" +"Kein funktionierender Netzwerkadapter gefunden.\n" +"Stellen Sie sicher, dass Sie ein Netzwerkkabel angeschlossen haben und das " +"Ihr Netzwerk richtig konfiguriert ist." msgid "" -"No working wireless interface found.\n" -" Please verify that you have attached a compatible WLAN device or enable you " -"local network interface." +"No working wireless network adapter found.\n" +"Please verify that you have attached a compatible WLAN device and your " +"network is configured correctly." msgstr "" +"Kein funktionierende WLAN Netzwerkadapter gefunden.\n" +"Stellen Sie sicher, dass Sie ein kompatibles Gerät angeschlossen haben oder " +"aktivieren Sie den internen Netzwerkadapter." msgid "" -"No working wireless networkadapter found.\n" -"Please verify that you have attached a compatible WLAN USB Stick and your " -"Network is configured correctly." +"No working wireless network interface found.\n" +"Please verify that you have attached a compatible WLAN device or enable your " +"local network interface." msgstr "" +"Kein funktionierender WLAN Netzwerkadapter gefunden.\n" +"Stellen Sie sicher, dass Sie ein kompatibles Gerät angeschlossen haben und " +"das Ihr Netzwerk richtig konfiguriert ist." msgid "No, but restart from begin" msgstr "Nein, aber von Anfang an neu beginnen" @@ -2166,12 +2173,12 @@ msgstr "" "Bitte benutzen Sie die Hoch/Runter-Tasten, um Ihre Sprache auszuwählen. " "Danach drücken Sie bitte OK." +msgid "Please wait for activation of your network configuration..." +msgstr "Bitte warten während die Netzwerkkonfiguration aktiviert wird..." + msgid "Please wait for md5 signature verification..." msgstr "" -msgid "Please wait while activating your network configuration..." -msgstr "Bitte warten während die Netzwerkkonfiguration aktiviert wird..." - msgid "Please wait while we configure your network..." msgstr "Bitte warten während das Netzwerk konfiguriert wird..." @@ -2693,7 +2700,7 @@ msgid "Set as default Interface" msgstr "Netzwerkadapter als Standard definieren" msgid "Set interface as default Interface" -msgstr "Setze Netzwerkadapter als Standardad" +msgstr "Setze Netzwerkadapter als Standardd" msgid "Set limits" msgstr "Limits setzen" @@ -3751,7 +3758,7 @@ msgid "" "Your network configuration has been activated.\n" "A second configured interface has been found.\n" "\n" -"Do you want to disable the second networkinterface?" +"Do you want to disable the second network interface?" msgstr "" "Ihre Netzwerkkonfiguration wurde aktiviert.\n" "Ein zweiter konfigurierter Netzwerkadapter wurde gefunden.\n" @@ -3881,7 +3888,7 @@ msgid "chapters" msgstr "Kapitel" msgid "choose destination directory" -msgstr "Wähle Zielverzeichniss" +msgstr "Wähle Zielverzeichnis" msgid "circular left" msgstr "links-zirkulär" @@ -3914,7 +3921,7 @@ msgid "copy to bouquets" msgstr "in Bouquets kopieren" msgid "create directory" -msgstr "Verzeichniss erstellen" +msgstr "Verzeichnis erstellen" msgid "daily" msgstr "täglich" @@ -4015,15 +4022,18 @@ msgstr "Verlasse Filmliste" msgid "exit nameserver configuration" msgstr "DNS Serverkonfiguration verlassen" -msgid "exit networkadapter configuration" +msgid "exit network adapter configuration" msgstr "Netzwerkadapterkonfiguration verlassen" -msgid "exit networkadapter setup menu" +msgid "exit network adapter setup menu" msgstr "Netzwerkadaptermenu verlassen" -msgid "exit networkinterface list" +msgid "exit network interface list" msgstr "Netzwerkadapterübersicht verlassen" +msgid "exit networkadapter setup menu" +msgstr "" + msgid "failed" msgstr "" @@ -4252,7 +4262,7 @@ msgid "open servicelist(up)" msgstr "Kanalliste öffnen(nach oben)" msgid "open virtual keyboard input help" -msgstr "Virtuelle Tastatur Eingabehilfe öffnen" +msgstr "Virtuelle Tastatureingabehilfe öffnen" msgid "pass" msgstr "Durchgang" @@ -4309,7 +4319,7 @@ msgid "remove bookmark" msgstr "Bookmark entfernen" msgid "remove directory" -msgstr "Verzeichniss entfernen" +msgstr "Verzeichnis entfernen" msgid "remove entry" msgstr "Eintrag entfernen" @@ -4370,10 +4380,10 @@ msgid "select image from server" msgstr "Wähle ein Image vom Server" msgid "select interface" -msgstr "Wähle einen Ntzwerkadapter" +msgstr "Wähle einen Netzwerkadapter" msgid "select menu entry" -msgstr "Wähle einen Menupunkt" +msgstr "Wähle einen Menüpunkt" msgid "select movie" msgstr "Wähle Film" @@ -4616,6 +4626,9 @@ msgstr "umgeschaltet" #~ msgid "Enable WLAN Support" #~ msgstr "Aktiviere WLAN Unterstützung" +#~ msgid "Enter WLAN networ kname/SSID:" +#~ msgstr "WLAN Netzwerkname/SSID eingeben:" + #~ msgid "Games / Plugins" #~ msgstr "Spiele / Erweiterungen" -- cgit v1.2.3 From 19b37ace32489ada16dbc4c88b74907064d9c292 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 8 Nov 2008 00:16:49 +0100 Subject: add (tune)simulate support to some functions --- lib/dvb/db.cpp | 4 ++-- lib/dvb/dvb.cpp | 22 +++++++++++++--------- lib/dvb/dvb.h | 4 ++-- lib/dvb/idvb.h | 2 +- lib/python/enigma_python.i | 4 ++-- lib/service/iservice.h | 2 +- lib/service/service.cpp | 2 +- lib/service/servicedvb.cpp | 4 ++-- lib/service/servicedvb.h | 2 +- 9 files changed, 25 insertions(+), 21 deletions(-) (limited to 'lib/python') diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp index 02ecc1d2..c6c2e855 100644 --- a/lib/dvb/db.cpp +++ b/lib/dvb/db.cpp @@ -151,7 +151,7 @@ RESULT eDVBService::getEvent(const eServiceReference &ref, ePtr & return eEPGCache::getInstance()->lookupEventTime(ref, start_time, ptr); } -int eDVBService::isPlayable(const eServiceReference &ref, const eServiceReference &ignore) +int eDVBService::isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate) { ePtr res_mgr; if ( eDVBResourceManager::getInstance( res_mgr ) ) @@ -161,7 +161,7 @@ int eDVBService::isPlayable(const eServiceReference &ref, const eServiceReferenc eDVBChannelID chid, chid_ignore; ((const eServiceReferenceDVB&)ref).getChannelID(chid); ((const eServiceReferenceDVB&)ignore).getChannelID(chid_ignore); - return res_mgr->canAllocateChannel(chid, chid_ignore); + return res_mgr->canAllocateChannel(chid, chid_ignore, simulate); } return 0; } diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 68d9a0dd..e04caa00 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -713,12 +713,13 @@ RESULT eDVBResourceManager::connectChannelAdded(const Slot1 & return 0; } -int eDVBResourceManager::canAllocateFrontend(ePtr &feparm) +int eDVBResourceManager::canAllocateFrontend(ePtr &feparm, bool simulate) { + eSmartPtrList &frontends = simulate ? m_simulate_frontend : m_frontend; ePtr best; int bestval = 0; - for (eSmartPtrList::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i) + for (eSmartPtrList::iterator i(frontends.begin()); i != frontends.end(); ++i) if (!i->m_inuse) { int c = i->m_frontend->isCompatibleWith(feparm); @@ -755,10 +756,11 @@ int tuner_type_channel_default(ePtr &channellist, const eDVBCha return 0; } -int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID& ignore) +int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID& ignore, bool simulate) { + std::list &active_channels = simulate ? m_active_simulate_channels : m_active_channels; int ret=0; - if (m_cached_channel) + if (!simulate && m_cached_channel) { eDVBChannel *cache_chan = (eDVBChannel*)&(*m_cached_channel); if(channelid==cache_chan->getChannelID()) @@ -767,7 +769,7 @@ int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, cons /* first, check if a channel is already existing. */ // eDebug("allocate channel.. %04x:%04x", channelid.transport_stream_id.get(), channelid.original_network_id.get()); - for (std::list::iterator i(m_active_channels.begin()); i != m_active_channels.end(); ++i) + for (std::list::iterator i(active_channels.begin()); i != active_channels.end(); ++i) { // eDebug("available channel.. %04x:%04x", i->m_channel_id.transport_stream_id.get(), i->m_channel_id.original_network_id.get()); if (i->m_channel_id == channelid) @@ -780,8 +782,9 @@ int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, cons int *decremented_cached_channel_fe_usecount=NULL, *decremented_fe_usecount=NULL; - for (std::list::iterator i(m_active_channels.begin()); i != m_active_channels.end(); ++i) + for (std::list::iterator i(active_channels.begin()); i != active_channels.end(); ++i) { + eSmartPtrList &frontends = simulate ? m_simulate_frontend : m_frontend; // eDebug("available channel.. %04x:%04x", i->m_channel_id.transport_stream_id.get(), i->m_channel_id.original_network_id.get()); if (i->m_channel_id == ignore) { @@ -795,7 +798,7 @@ int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, cons ePtr fe; if (!i->m_channel->getFrontend(fe)) { - for (eSmartPtrList::iterator ii(m_frontend.begin()); ii != m_frontend.end(); ++ii) + for (eSmartPtrList::iterator ii(frontends.begin()); ii != frontends.end(); ++ii) { if ( &(*fe) == &(*ii->m_frontend) ) { @@ -822,7 +825,8 @@ int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, cons ePtr fe; if (!channel->getFrontend(fe)) { - for (eSmartPtrList::iterator ii(m_frontend.begin()); ii != m_frontend.end(); ++ii) + eSmartPtrList &frontends = simulate ? m_simulate_frontend : m_frontend; + for (eSmartPtrList::iterator ii(frontends.begin()); ii != frontends.end(); ++ii) { if ( &(*fe) == &(*ii->m_frontend) ) { @@ -852,7 +856,7 @@ int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, cons goto error; } - ret = canAllocateFrontend(feparm); + ret = canAllocateFrontend(feparm, simulate); error: if (decremented_fe_usecount) diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h index 1a773efa..13556c26 100644 --- a/lib/dvb/dvb.h +++ b/lib/dvb/dvb.h @@ -184,7 +184,7 @@ public: }; RESULT connectChannelAdded(const Slot1 &channelAdded, ePtr &connection); - int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore); + int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore, bool simulate=false); /* allocate channel... */ RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr &channel, bool simulate=false); @@ -206,7 +206,7 @@ public: #ifdef SWIG public: #endif - int canAllocateFrontend(ePtr &feparm); + int canAllocateFrontend(ePtr &feparm, bool simulate=false); bool canMeasureFrontendInputPower(); PSignal1 frontendUseMaskChanged; SWIG_VOID(RESULT) allocateRawChannel(eUsePtr &SWIG_OUTPUT, int slot_index); diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index a2cce94d..cda05894 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -315,7 +315,7 @@ public: // iStaticServiceInformation RESULT getName(const eServiceReference &ref, std::string &name); RESULT getEvent(const eServiceReference &ref, ePtr &ptr, time_t start_time); - int isPlayable(const eServiceReference &ref, const eServiceReference &ignore); + int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate=false); PyObject *getInfoObject(const eServiceReference &ref, int); // implemented in lib/service/servicedvb.h /* for filtering: */ diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i index 8f05d53d..7de05d2b 100644 --- a/lib/python/enigma_python.i +++ b/lib/python/enigma_python.i @@ -282,9 +282,9 @@ PyObject *New_iRecordableServicePtr(const ePtr &ptr) /* needed for service groups */ -PyObject *getBestPlayableServiceReference(const eServiceReference &bouquet_ref, const eServiceReference &ignore); +PyObject *getBestPlayableServiceReference(const eServiceReference &bouquet_ref, const eServiceReference &ignore, bool simulate=false); %{ -PyObject *getBestPlayableServiceReference(const eServiceReference &bouquet_ref, const eServiceReference &ignore) +PyObject *getBestPlayableServiceReference(const eServiceReference &bouquet_ref, const eServiceReference &ignore, bool simulate=false) { eStaticServiceDVBBouquetInformation info; if (info.isPlayable(bouquet_ref, ignore)) diff --git a/lib/service/iservice.h b/lib/service/iservice.h index 0385b9c2..02fc4508 100644 --- a/lib/service/iservice.h +++ b/lib/service/iservice.h @@ -240,7 +240,7 @@ public: virtual int getLength(const eServiceReference &ref); virtual SWIG_VOID(RESULT) getEvent(const eServiceReference &ref, ePtr &SWIG_OUTPUT, time_t start_time=-1); // returns true when not implemented - virtual int isPlayable(const eServiceReference &ref, const eServiceReference &ignore); + virtual int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate=false); virtual int getInfo(const eServiceReference &ref, int w); virtual std::string getInfoString(const eServiceReference &ref,int w); diff --git a/lib/service/service.cpp b/lib/service/service.cpp index f34237d2..eb2757ab 100644 --- a/lib/service/service.cpp +++ b/lib/service/service.cpp @@ -239,7 +239,7 @@ int iStaticServiceInformation::getLength(const eServiceReference &ref) return -1; } -int iStaticServiceInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore) +int iStaticServiceInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate) { return 0; } diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 954a3964..2f98ed6b 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -412,7 +412,7 @@ RESULT eStaticServiceDVBBouquetInformation::getName(const eServiceReference &ref return -1; } -int eStaticServiceDVBBouquetInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore) +int eStaticServiceDVBBouquetInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate) { if (ref.flags & eServiceReference::isGroup) { @@ -453,7 +453,7 @@ int eStaticServiceDVBBouquetInformation::isPlayable(const eServiceReference &ref { 2, 1, 3 } // -T -S -C }; ((const eServiceReferenceDVB&)*it).getChannelID(chid); - int tmp=res->canAllocateChannel(chid, chid_ignore); + int tmp=res->canAllocateChannel(chid, chid_ignore, simulate); switch(tmp) { case 0: diff --git a/lib/service/servicedvb.h b/lib/service/servicedvb.h index 85e97ea1..d19b92d6 100644 --- a/lib/service/servicedvb.h +++ b/lib/service/servicedvb.h @@ -293,7 +293,7 @@ public: eServiceReference &getPlayableService() { return m_playable_service; } RESULT getName(const eServiceReference &ref, std::string &name); int getLength(const eServiceReference &ref); - int isPlayable(const eServiceReference &ref, const eServiceReference &ignore); + int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate=false); RESULT getEvent(const eServiceReference &ref, ePtr &ptr, time_t start_time); }; -- cgit v1.2.3 From 68182033644faf17e06f10d1b98a128b5e3a7058 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 8 Nov 2008 00:18:59 +0100 Subject: fix TimerSanityCheck for Service Groups (Alternatives) dont care about tuner slot num in Timersanity Check fix wrong timersanitycheck result in some cases (Bug: unknown Conflict) --- Navigation.py | 4 +-- lib/python/Components/TimerSanityCheck.py | 54 +++++++++++++++++++++---------- 2 files changed, 39 insertions(+), 19 deletions(-) (limited to 'lib/python') diff --git a/Navigation.py b/Navigation.py index bda6f584..42733cb2 100644 --- a/Navigation.py +++ b/Navigation.py @@ -79,14 +79,14 @@ class Navigation: def getCurrentlyPlayingServiceReference(self): return self.currentlyPlayingServiceReference - def recordService(self, ref): + def recordService(self, ref, simulate=False): service = None print "recording service: %s" % (str(ref)) if isinstance(ref, ServiceReference.ServiceReference): ref = ref.ref if ref: if ref.flags & eServiceReference.isGroup: - ref = getBestPlayableServiceReference(ref, eServiceReference()) + ref = getBestPlayableServiceReference(ref, eServiceReference(), simulate) service = ref and self.pnav and self.pnav.recordService(ref) if service is None: print "record returned non-zero" diff --git a/lib/python/Components/TimerSanityCheck.py b/lib/python/Components/TimerSanityCheck.py index e793cdcd..031c9cae 100644 --- a/lib/python/Components/TimerSanityCheck.py +++ b/lib/python/Components/TimerSanityCheck.py @@ -1,9 +1,7 @@ -import string import NavigationInstance from time import localtime -from Components.NimManager import nimmanager from ServiceReference import ServiceReference -from enigma import iServiceInformation, eServiceCenter +from enigma import iServiceInformation, eServiceCenter, eServiceReference class TimerSanityCheck: def __init__(self, timerlist, newtimer=None): @@ -54,6 +52,7 @@ class TimerSanityCheck: # index -1 for the new Timer, 0..n index of the existing timers # count of running timers + serviceHandler = eServiceCenter.getInstance() print "checkTimerlist" # create a list with all start and end times # split it into recurring and singleshot timers @@ -149,9 +148,7 @@ class TimerSanityCheck: fakeRecList = [] ConflictTimer = None ConflictTunerType = None - ConflictSlot = None newTimerTunerType = None - newTimerTunerSlot = None cnt = 0 idx = 0 overlaplist = [] @@ -162,24 +159,45 @@ class TimerSanityCheck: else: timer = self.timerlist[event[2]] if event[1] == self.bflag: - fakeRecService = NavigationInstance.instance.recordService(timer.service_ref) - fakeRecResult = fakeRecService.start(True) - feinfo = fakeRecService.frontendInfo().getFrontendData() - tunerType = feinfo.get("tuner_type") - tunerSlot = feinfo.get("tuner_number") + tunerType = [ ] + fakeRecService = NavigationInstance.instance.recordService(timer.service_ref, True) + if fakeRecService: + fakeRecResult = fakeRecService.start(True) + else: + fakeRecResult = -1 + if not fakeRecResult: # tune okay + feinfo = fakeRecService.frontendInfo().getFrontendData() + tunerType.append(feinfo.get("tuner_type")) + else: # tune failed.. so we must go another way to get service type (DVB-S, DVB-T, DVB-C) + + def getServiceType(ref): # helper function to get a service type of a service reference + serviceInfo = serviceHandler.info(ref) + serviceInfo = serviceInfo and serviceInfo.getInfoObject(ref, iServiceInformation.sTransponderData) + if serviceInfo: + return { "Satellite" : "DVB-S", "Cable" : "DVB-C", "Terrestrial" : "DVB-T"}[serviceInfo["type"]] + + ref = timer.service_ref.ref + if ref.flags & eServiceReference.isGroup: # service group ? + serviceList = serviceHandler.list(ref) # get all alternative services + if serviceList: + for ref in serviceList.getContent("R"): # iterate over all group service references + type = getServiceType(ref) + if not type in tunerType: # just add single time + tunerType.append(type) + else: + tunerType.append(getServiceType(ref)) + if event[2] == -1: # new timer newTimerTunerType = tunerType - newTimerTunerSlot = tunerSlot - overlaplist.append((fakeRecResult, timer, tunerType, tunerSlot)) + overlaplist.append((fakeRecResult, timer, tunerType)) fakeRecList.append((timer, fakeRecService)) if fakeRecResult: if ConflictTimer is None: # just take care of the first conflict ConflictTimer = timer ConflictTunerType = tunerType - ConflictTunerSlot = tunerSlot elif event[1] == self.eflag: for fakeRec in fakeRecList: - if timer == fakeRec[0]: + if timer == fakeRec[0] and fakeRec[1]: NavigationInstance.instance.stopRecordService(fakeRec[1]) fakeRecList.remove(fakeRec) del fakeRec @@ -211,7 +229,6 @@ class TimerSanityCheck: if nt and kt: ConflictTimer = self.newtimer ConflictTunerType = newTimerTunerType - ConflictSlot = newTimerTunerSlot break self.simultimer = [ ConflictTimer ] @@ -223,8 +240,11 @@ class TimerSanityCheck: else: continue for entry in event[4]: - if not self.simultimer.count(entry[1]) and (entry[2] == ConflictTunerType or entry[3] == ConflictTunerSlot): - self.simultimer.append(entry[1]) + if not entry[1] in self.simultimer: + for x in entry[2]: + if x in ConflictTunerType: + self.simultimer.append(entry[1]) + break if len(self.simultimer) < 2: print "Bug: unknown Conflict!" -- cgit v1.2.3 From 2aa5cf5a1bfe64fbb1ef6b082920c82ff927007a Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 8 Nov 2008 00:23:39 +0100 Subject: fix rotor input current measurement default value for dm8000 --- lib/python/Components/NimManager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 3c7a147e..434ab4aa 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -1,3 +1,5 @@ +from Tools.HardwareInfo import HardwareInfo + from config import config, ConfigSubsection, ConfigSelection, ConfigFloat, \ ConfigSatlist, ConfigYesNo, ConfigInteger, ConfigSubList, ConfigNothing, \ ConfigSubDict, ConfigOnOff, ConfigDateTime @@ -153,6 +155,7 @@ class SecConfigure: for slot in nim_slots: x = slot.slot nim = slot.config + hw = HardwareInfo() if slot.isCompatible("DVB-S"): print "slot: " + str(x) + " configmode: " + str(nim.configMode.value) if nim.configMode.value in [ "loopthrough", "satposdepends", "nothing" ]: @@ -185,7 +188,7 @@ class SecConfigure: loValue = rotorParam.EAST else: loValue = rotorParam.WEST - inputPowerDelta=50 + inputPowerDelta=hw.get_device_name() == "dm8000" and 50 or 15 useInputPower=False turning_speed=0 if nim.powerMeasurement.value: @@ -842,6 +845,7 @@ def InitSecParams(): def InitNimManager(nimmgr): InitSecParams() + hw = HardwareInfo() config.Nims = ConfigSubList() for x in range(len(nimmgr.nim_slots)): @@ -972,7 +976,7 @@ def InitNimManager(nimmgr): nim.advanced.lnb[x].latitude = ConfigFloat(default = [50,767], limits = [(0,359),(0,999)]) nim.advanced.lnb[x].latitudeOrientation = ConfigSelection(choices = [("north", _("North")), ("south", _("South"))], default = "north") nim.advanced.lnb[x].powerMeasurement = ConfigYesNo(default=True) - nim.advanced.lnb[x].powerThreshold = ConfigInteger(default=50, limits=(0, 100)) + nim.advanced.lnb[x].powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm8000" and 15 or 50, limits=(0, 100)) nim.advanced.lnb[x].turningSpeed = ConfigSelection(choices = [("fast", _("Fast")), ("slow", _("Slow")), ("fast epoch", _("Fast epoch"))], default = "fast") btime = datetime(1970, 1, 1, 7, 0); nim.advanced.lnb[x].fastTurningBegin = ConfigDateTime(default=mktime(btime.timetuple()), formatstring = _("%H:%M"), increment = 600) -- cgit v1.2.3 From cb725de8216cb61d0a889b3a6a7651619161ef08 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 8 Nov 2008 00:28:33 +0100 Subject: 15 <-> 50 --- lib/python/Components/NimManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 434ab4aa..1ee8dddd 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -188,7 +188,7 @@ class SecConfigure: loValue = rotorParam.EAST else: loValue = rotorParam.WEST - inputPowerDelta=hw.get_device_name() == "dm8000" and 50 or 15 + inputPowerDelta=hw.get_device_name() == "dm8000" and 15 or 50 useInputPower=False turning_speed=0 if nim.powerMeasurement.value: -- cgit v1.2.3 From d3a03446578d5cf77ea3f2128aa3aeee434a23b8 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 8 Nov 2008 00:52:00 +0100 Subject: fix typos --- lib/python/Components/NimManager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 1ee8dddd..3c1fe455 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -659,7 +659,7 @@ class NimManager: def canEqualTo(self, slotid): type = self.getNimType(slotid) - if self.getNimConfig(slotid) == "DVB-S2": + if type == "DVB-S2": type = "DVB-S" nimList = self.getNimListOfType(type, slotid) for nim in nimList[:]: @@ -667,10 +667,10 @@ class NimManager: if mode.configMode.value == "loopthrough" or mode.configMode.value == "satposdepends": nimList.remove(nim) return nimList - + def canDependOn(self, slotid): type = self.getNimType(slotid) - if self.getNimConfig(slotid) == "DVB-S2": + if type == "DVB-S2": type = "DVB-S" nimList = self.getNimListOfType(type, slotid) positionerList = [] -- cgit v1.2.3 From ae5651346d0b371a89287365003466fef729b72a Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 8 Nov 2008 01:01:18 +0100 Subject: add possibility to select "second cable of motorized LNB" also when the rotor is configured in advanced mode --- lib/python/Components/NimManager.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/python') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 3c1fe455..32fca47f 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -683,6 +683,13 @@ class NimManager: if lnb != 0: nimHaveRotor = True break + if not nimHaveRotor: + for sat in mode.advanced.sat.values(): + lnb_num = int(sat.lnb.value) + diseqcmode = lnb_num and mode.advanced.lnb[lnb_num].diseqcMode.value or "" + if diseqcmode == "1_2": + nimHaveRotor = True + break if nimHaveRotor: alreadyConnected = False for testnim in nimList: -- cgit v1.2.3