From a0ae92efcfeea6d81f077be4b5423b524f59b131 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Wed, 10 Dec 2008 12:52:28 +0100 Subject: enable dream keyboard --- lib/python/Screens/Wizard.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 lib/python/Screens/Wizard.py (limited to 'lib/python/Screens') diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py old mode 100644 new mode 100755 index 23d6253a..feba8ac2 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -3,7 +3,8 @@ from Screen import Screen import string from Screens.HelpMenu import HelpableScreen -from Components.config import config, KEY_LEFT, KEY_RIGHT, KEY_DELETE, KEY_BACKSPACE +from Components.config import config, KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS + from Components.Label import Label from Components.Slider import Slider from Components.ActionMap import NumberActionMap @@ -215,8 +216,9 @@ class Wizard(Screen): self.disableKeys = False - self["actions"] = NumberActionMap(["WizardActions", "NumberActions", "ColorActions", "SetupActions"], + self["actions"] = NumberActionMap(["WizardActions", "NumberActions", "ColorActions", "SetupActions", "InputAsciiActions"], { + "gotAsciiCode": self.keyGotAscii, "ok": self.ok, "back": self.back, "left": self.left, @@ -368,6 +370,10 @@ class Wizard(Screen): def keyNumberGlobal(self, number): if (self.wizard[self.currStep]["config"]["screen"] != None): self.configInstance.keyNumberGlobal(number) + + def keyGotAscii(self): + if (self.wizard[self.currStep]["config"]["screen"] != None): + self["config"].handleKey(KEY_ASCII) def left(self): self.resetCounter() -- cgit v1.2.3 From f2f6bf14c7a92410a6484f050837febd6985d401 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 12 Dec 2008 12:59:41 +0100 Subject: cleanup code --- lib/python/Screens/ScanSetup.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/python/Screens') diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py index 608dcb2d..464c701a 100644 --- a/lib/python/Screens/ScanSetup.py +++ b/lib/python/Screens/ScanSetup.py @@ -487,9 +487,9 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): ttype = frontendData.get("tuner_type", "UNKNOWN") if ttype == "DVB-S": defaultSat["system"] = {"DVB-S": "dvb-s", "DVB-S2": "dvb-s2"}[frontendData.get("system", "DVB-S")] - defaultSat["frequency"] = int(frontendData.get("frequency", 0) / 1000) + defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000 defaultSat["inversion"] = {"INVERSION_OFF": "off", "INVERSION_ON": "on", "INVERSION_AUTO": "auto"}[frontendData.get("inversion", "INVERSION_AUTO")] - defaultSat["symbolrate"] = int(frontendData.get("symbol_rate", 0) / 1000) + defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000 defaultSat["polarization"] = {"HORIZONTAL": "horizontal", "VERTICAL": "vertical", "CIRCULAR_LEFT": "circular_left", "CIRCULAR_RIGHT": "circular_right", "UNKNOWN": None}[frontendData.get("polarization", "HORIZONTAL")] if frontendData.get("system", "DVB-S") == "DVB-S2": @@ -504,8 +504,8 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): defaultSat["modulation"] = {"QPSK": "qpsk", "8PSK": "8psk"}[frontendData.get("modulation", "QPSK")] defaultSat["orbpos"] = frontendData.get("orbital_position", 0) elif ttype == "DVB-C": - defaultCab["frequency"] = int(frontendData.get("frequency", 0) / 1000) - defaultCab["symbolrate"] = int(frontendData.get("symbol_rate", 0) / 1000) + defaultCab["frequency"] = frontendData.get("frequency", 0) / 1000 + defaultCab["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000 defaultCab["inversion"] = {"INVERSION_OFF": "off", "INVERSION_ON": "on", "INVERSION_AUTO": "auto"}[frontendData.get("inversion", "INVERSION_AUTO")] defaultCab["fec"] = {"FEC_AUTO": "auto", "FEC_1_2": "1_2", "FEC_2_3": "2_3", "FEC_3_4": "3_4", "FEC_5_6": "5_6", "FEC_7_8": "7_8", "FEC_8_9": "8_9", "FEC_NONE": "none"}[frontendData.get("fec_inner", "FEC_AUTO")] defaultCab["modulation"] = {"QAM_AUTO": "auto", "QAM_16": "16qam", "QAM_32": "32qam", "QAM_64": "64qam", "QAM_128": "128qam", "QAM_256": "256qam"}[frontendData.get("modulation", "QAM_16")] @@ -577,7 +577,7 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.scan_satselection = [] for slot in nimmanager.nim_slots: if slot.isCompatible("DVB-S"): - self.scan_satselection.append(getConfigSatlist(int(defaultSat["orbpos"]), self.satList[slot.slot])) + self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot])) else: self.scan_satselection.append(None) @@ -621,9 +621,9 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): parm.polarisation = polarisation parm.fec = self.fecmap[fec] parm.inversion = inversion - parm.orbital_position = int(orbital_position) - parm.rolloff = int(rolloff) - parm.pilot = int(pilot) + parm.orbital_position = orbital_position + parm.rolloff = rolloff + parm.pilot = pilot tlist.append(parm) def addCabTransponder(self, tlist, frequency, symbol_rate, modulation, fec, inversion): -- cgit v1.2.3 From b833353b5285a547eb18c079aa860c9ee2765d6e Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 13 Dec 2008 01:33:05 +0100 Subject: add possibility to set manual lnb priority (only in advanced sat config) range 0..64 to decrease priorities (this is lower as all auto given priorities) range 14000..14064 this is higher than auto given rotor priorities range 19000..19064 this is higher than each auto given priorities --- lib/dvb/sec.cpp | 28 ++++++++++++++++++++++++---- lib/dvb/sec.h | 5 ++++- lib/python/Components/NimManager.py | 10 ++++++++++ lib/python/Screens/Satconfig.py | 1 + 4 files changed, 39 insertions(+), 5 deletions(-) (limited to 'lib/python/Screens') diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 751a5453..1022b955 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -140,7 +140,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite { bool rotor=false; eDVBSatelliteLNBParameters &lnb_param = m_lnbs[idx]; - if ( lnb_param.slot_mask & slot_id ) // lnb for correct tuner? + if ( lnb_param.m_slot_mask & slot_id ) // lnb for correct tuner? { int ret = 0; eDVBSatelliteDiseqcParameters &di_param = lnb_param.m_diseqc_parameters; @@ -297,6 +297,9 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite ret=0; } + if (ret && lnb_param.m_prio != -1) + ret = lnb_param.m_prio; + eSecDebugNoSimulate("ret %d, score old %d", ret, score); if (ret > score) { @@ -309,7 +312,12 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite } } if (score && satcount) - score -= (satcount-1); + { + if (score > (satcount-1)) + score -= (satcount-1); + else + score = 1; // min score + } if (score && direct_connected) score += 5; // increase score for tuners with direct sat connection eSecDebugNoSimulate("final score %d", score); @@ -963,7 +971,8 @@ RESULT eDVBSatelliteEquipmentControl::clear() for (int i=0; i <= m_lnbidx; ++i) { m_lnbs[i].m_satellites.clear(); - m_lnbs[i].slot_mask = 0; + m_lnbs[i].m_slot_mask = 0; + m_lnbs[i].m_prio = -1; // auto } m_lnbidx=-1; @@ -1021,7 +1030,7 @@ RESULT eDVBSatelliteEquipmentControl::setLNBSlotMask(int slotmask) { eSecDebug("eDVBSatelliteEquipmentControl::setLNBSlotMask(%d)", slotmask); if ( currentLNBValid() ) - m_lnbs[m_lnbidx].slot_mask = slotmask; + m_lnbs[m_lnbidx].m_slot_mask = slotmask; else return -ENOENT; return 0; @@ -1067,6 +1076,17 @@ RESULT eDVBSatelliteEquipmentControl::setLNBIncreasedVoltage(bool onoff) return 0; } +RESULT eDVBSatelliteEquipmentControl::setLNBPrio(int prio) +{ + eSecDebug("eDVBSatelliteEquipmentControl::setLNBPrio(%d)", prio); + if ( currentLNBValid() ) + m_lnbs[m_lnbidx].m_prio = prio; + else + return -ENOENT; + return 0; +} + + /* DiSEqC Specific Parameters */ RESULT eDVBSatelliteEquipmentControl::setDiSEqCMode(int diseqcmode) { diff --git a/lib/dvb/sec.h b/lib/dvb/sec.h index 27dcedd5..2efd0b49 100644 --- a/lib/dvb/sec.h +++ b/lib/dvb/sec.h @@ -231,7 +231,7 @@ public: #ifndef SWIG t_12V_relais_state m_12V_relais_state; // 12V relais output on/off - __u8 slot_mask; // useable by slot ( 1 | 2 | 4...) + int m_slot_mask; // useable by slot ( 1 | 2 | 4...) unsigned int m_lof_hi, // for 2 band universal lnb 10600 Mhz (high band offset frequency) m_lof_lo, // for 2 band universal lnb 9750 Mhz (low band offset frequency) @@ -242,6 +242,8 @@ public: std::map m_satellites; eDVBSatelliteDiseqcParameters m_diseqc_parameters; eDVBSatelliteRotorParameters m_rotor_parameters; + + int m_prio; // to override automatic tuner management ... -1 is Auto #endif }; @@ -304,6 +306,7 @@ public: RESULT setLNBLOFH(int lofh); RESULT setLNBThreshold(int threshold); RESULT setLNBIncreasedVoltage(bool onoff); + RESULT setLNBPrio(int prio); /* DiSEqC Specific Parameters */ RESULT setDiSEqCMode(int diseqcmode); RESULT setToneburst(int toneburst); diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index edd3bbbb..168962e9 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -381,6 +381,8 @@ class SecConfigure: sec.setLNBSlotMask(tunermask) + sec.setLNBPrio(int(currLnb.prio.value)) + # finally add the orbital positions for y in lnbSat[x]: self.addSatellite(sec, y) @@ -1026,6 +1028,14 @@ def InitNimManager(nimmgr): nim.advanced.lnb[x].fastTurningBegin = ConfigDateTime(default=mktime(btime.timetuple()), formatstring = _("%H:%M"), increment = 600) etime = datetime(1970, 1, 1, 19, 0); nim.advanced.lnb[x].fastTurningEnd = ConfigDateTime(default=mktime(etime.timetuple()), formatstring = _("%H:%M"), increment = 600) + prio_list = [ ("-1", _("Auto")) ] + for prio in range(65): + prio_list.append((str(prio), str(prio))) + for prio in range(14000,14065): + prio_list.append((str(prio), str(prio))) + for prio in range(19000,19065): + prio_list.append((str(prio), str(prio))) + nim.advanced.lnb[x].prio = ConfigSelection(default="-1", choices=prio_list) elif slot.isCompatible("DVB-C"): nim.configMode = ConfigSelection( choices = { diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index 6489f28f..5628926f 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -283,6 +283,7 @@ class NimSetup(Screen, ConfigListScreen): self.list.append(getConfigListEntry(_("Threshold"), currLnb.threshold)) # self.list.append(getConfigListEntry(_("12V Output"), currLnb.output_12v)) self.list.append(getConfigListEntry(_("Increased voltage"), currLnb.increased_voltage)) + self.list.append(getConfigListEntry(_("Priority"), currLnb.prio)) def fillAdvancedList(self): self.list = [ ] -- cgit v1.2.3