self.record_service = None
if self.afterEvent == AFTEREVENT.STANDBY:
if not Screens.Standby.inStandby: # not already in standby
- Notifications.AddNotificationWithCallback(self.sendStandbyNotification, MessageBox, _("A finished record timer wants to set your\nDreambox to standby. Do that now?"), timeout = 20)
+ Notifications.AddNotificationWithCallback(self.sendStandbyNotification, MessageBox, _("A finished record timer wants to set your\nSTB to standby. Do that now?"), timeout = 20)
elif self.afterEvent == AFTEREVENT.DEEPSTANDBY:
if not Screens.Standby.inTryQuitMainloop: # not a shutdown messagebox is open
if Screens.Standby.inStandby: # in standby
RecordTimerEntry.TryQuitMainloop() # start shutdown handling without screen
else:
- Notifications.AddNotificationWithCallback(self.sendTryQuitMainloopNotification, MessageBox, _("A finished record timer wants to shut down\nyour Dreambox. Shutdown now?"), timeout = 20)
+ Notifications.AddNotificationWithCallback(self.sendTryQuitMainloopNotification, MessageBox, _("A finished record timer wants to shut down\nyour STB. Shutdown now?"), timeout = 20)
return True
def setAutoincreaseEnd(self, entry = None):
if self.state == self.StateRunning:
if config.SleepTimer.action.value == "shutdown":
if config.SleepTimer.ask.value and not Screens.Standby.inTryQuitMainloop:
- Notifications.AddNotificationWithCallback(self.shutdown, MessageBox, _("A sleep timer wants to shut down\nyour Dreambox. Shutdown now?"), timeout = 20)
+ Notifications.AddNotificationWithCallback(self.shutdown, MessageBox, _("A sleep timer wants to shut down\nyour STB. Shutdown now?"), timeout = 20)
else:
self.shutdown(True)
elif config.SleepTimer.action.value == "standby":
if config.SleepTimer.ask.value and not Screens.Standby.inStandby:
- Notifications.AddNotificationWithCallback(self.standby, MessageBox, _("A sleep timer wants to set your\nDreambox to standby. Do that now?"), timeout = 20)
+ Notifications.AddNotificationWithCallback(self.standby, MessageBox, _("A sleep timer wants to set your\nSTB to standby. Do that now?"), timeout = 20)
else:
self.standby(True)
lib/python/Plugins/SystemPlugins/Videomode/meta/Makefile
lib/python/Plugins/SystemPlugins/WirelessLan/Makefile
lib/python/Plugins/SystemPlugins/WirelessLan/meta/Makefile
+lib/python/Plugins/SystemPlugins/FactoryTest/Makefile
+lib/python/Plugins/SystemPlugins/Fancontrol/Makefile
+lib/python/Plugins/SystemPlugins/Fancontrol/meta/Makefile
+lib/python/Plugins/SystemPlugins/FPGAUpgrade/Makefile
+lib/python/Plugins/SystemPlugins/FPGAUpgrade/meta/Makefile
+lib/python/Plugins/SystemPlugins/WirelessLanSetup/Makefile
+lib/python/Plugins/SystemPlugins/WirelessLanSetup/meta/Makefile
+lib/python/Plugins/SystemPlugins/ManualFancontrol/Makefile
+lib/python/Plugins/SystemPlugins/ManualFancontrol/meta/Makefile
+lib/python/Plugins/SystemPlugins/Blindscan/Makefile
+lib/python/Plugins/SystemPlugins/Blindscan/meta/Makefile
lib/python/Tools/Makefile
lib/service/Makefile
lib/components/Makefile
tools/enigma2.sh
enigma2.pc
])
+AC_DEFINE(BUILD_VUPLUS,1,[Define to 1 for vuplus])
AC_OUTPUT
-config.misc.rcused=0
\ No newline at end of file
+config.misc.rcused=0
<key id="KEY_RECORD" mapto="instantRecord" flags="m" />
</device>
<device name="dreambox remote control (native)">
+<!-- ikseong insert KEY_RECORD action -->
+ <key id="KEY_RECORD" mapto="instantRecord" flags="m" />
<key id="KEY_RED" mapto="instantRecord" flags="b" />
</device>
</map>
<key id="KEY_ENTER" mapto="ok" flags="m" />
<key id="KEY_EXIT" mapto="back" flags="m" />
<key id="KEY_ESC" mapto="back" flags="m" />
+<!-- ikseong for factory test -->
+ <key id="KEY_SUBTITLE" mapto="test" flags="m" />
+ <key id="KEY_RADIO" mapto="testexit" flags="m" />
+ <key id="KEY_PAUSE" mapto="agingend" flags="m" />
+ <key id="KEY_STOP" mapto="agingfinish" flags="m" />
+ <key id="KEY_GREEN" mapto="agingstart" flags="m" />
</map>
<map context="InfobarMenuActions">
<key id="KEY_VIDEO" mapto="showMovies" flags="m" />
<key id="KEY_RADIO" mapto="showRadio" flags="m" />
<key id="KEY_TV" mapto="showTv" flags="m" />
+<!-- ikseong insert KEY_SUBTITLE action for subtitle hotkey -->
+ <key id="KEY_SUBTITLE" mapto="showSubtitle" flags="m" />
</map>
<map context="InfobarAudioSelectionActions">
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_YELLOW" mapto="audioSelection" flags="b" />
+ <key id="KEY_AUDIO" mapto="audioSelection" flags="m" />
</device>
</map>
<key id="KEY_BLUE" mapto="seekFwd" flags="b" />
<key id="KEY_RED" mapto="seekBackManual" flags="l" />
<key id="KEY_BLUE" mapto="seekFwdManual" flags="l" />
+<!-- ikseong insert KEY_PAUSE, KEY_PLAY, KEY_REWIND, KEY_FASTFORWARD -->
+ <key id="KEY_PAUSE" mapto="pauseService" flags="m" />
+ <key id="KEY_PLAY" mapto="playpauseService" flags="m" />
+ <key id="KEY_REWIND" mapto="seekBack" flags="b" />
+ <key id="KEY_FASTFORWARD" mapto="seekFwd" flags="b" />
+ <key id="KEY_REWIND" mapto="seekBackManual" flags="l" />
+ <key id="KEY_FASTFORWARD" mapto="seekFwdManual" flags="l" />
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_PLAY" mapto="playpauseService" flags="m" />
<key id="KEY_BLUE" mapto="seekFwd" flags="b" />
<key id="KEY_RED" mapto="seekBackManual" flags="l" />
<key id="KEY_BLUE" mapto="seekFwdManual" flags="l" />
+<!-- ikseong insert KEY_REWIND, KEY_FASTFORWARD -->
+ <key id="KEY_REWIND" mapto="seekBack" flags="b" />
+ <key id="KEY_FASTFORWARD" mapto="seekFwd" flags="b" />
+ <key id="KEY_REWIND" mapto="seekBackManual" flags="l" />
+ <key id="KEY_FASTFORWARD" mapto="seekFwdManual" flags="l" />
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_PREVIOUSSONG" mapto="seekBack" flags="b" />
<device name="dreambox remote control (native)">
<key id="KEY_YELLOW" mapto="timeshiftStart" flags="b" />
<key id="KEY_TV" mapto="timeshiftStop" flags="m" />
+<!-- ikseong insert KEY_PAUSE, KEY_PLAY, KEY_STOP -->
+ <key id="KEY_PLAY" mapto="timeshiftStart" flags="m" />
+ <key id="KEY_PAUSE" mapto="timeshiftStart" flags="m" />
+ <key id="KEY_STOP" mapto="timeshiftStop" flags="m" />
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_PLAY" mapto="timeshiftStart" flags="m" />
<device name="dreambox remote control (native)">
<key id="KEY_RED" mapto="timeshiftActivateEnd" flags="b" />
<key id="KEY_YELLOW" mapto="timeshiftActivateEndAndPause" flags="b" />
+<!-- ikseong insert KEY_PAUSE, KEY_PLAY, KEY_REWIND -->
+ <key id="KEY_PLAY" mapto="timeshiftActivateEndAndPause" flags="m" />
+ <key id="KEY_REWIND" mapto="timeshiftActivateEnd" flags="m" />
+ <key id="KEY_PAUSE" mapto="timeshiftActivateEndAndPause" flags="m" />
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_PREVIOUSSONG" mapto="timeshiftActivateEnd" flags="m" />
<map context="MoviePlayerActions">
<device name="dreambox remote control (native)">
<key id="KEY_TV" mapto="leavePlayer" flags="m" />
+ <key id="KEY_STOP" mapto="leavePlayer" flags="m" />
+<!-- ikseong insert KEY_SUBTITLE action for subtitle hotkey -->
+ <key id="KEY_SUBTITLE" mapto="showSubtitle" flags="m" />
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_TV" mapto="leavePlayer" flags="m" />
<key id="KEY_RADIO" mapto="shift_record" flags="l" />
<key id="KEY_PREVIOUS" mapto="previous" flags="m" />
<key id="KEY_NEXT" mapto="next" flags="m" />
+<!-- ikseong insert KEY_PAUSE, KEY_PLAY, KEY_STOP, KEY_RECORD, KEY_REWIND, KEY_FASTFORWARD -->
+ <key id="KEY_PAUSE" mapto="pause" flags="m" />
+ <key id="KEY_PLAY" mapto="play" flags="m" />
+ <key id="KEY_STOP" mapto="stop" flags="b" />
+ <key id="KEY_STOP" mapto="shift_stop" flags="l" />
+ <key id="KEY_RECORD" mapto="shift_record" flags="l" />
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_PLAYPAUSE" mapto="pause" flags="m" />
kmap=dream-de.kmap
-name=Dreambox Keyboard Deutsch
+name=Keyboard Deutsch
<!--<item text="Remote Control"><setup id="rc" /></item>-->
<!--<item text="OSD"><setup id="osd" /></item>-->
<item level="0" text="Network" entryID="network_setup"><screen module="NetworkSetup" screen="NetworkAdapterSelection" /></item>
- <item level="1" text="Input devices" entryID="input_device_setup"><screen module="InputDeviceSetup" screen="InputDeviceSelection" /></item>
+ <!--<item level="1" text="Input devices" entryID="input_device_setup"><screen module="InputDeviceSetup" screen="InputDeviceSelection" /></item>-->
<item requires="Display"><setup level="1" id="lcd" /></item>
<item text="Keyboard"><setup id="keyboard" /></item>
<!--<menu level="1" text="Network..." entryID="network_setup">
from os import system, _exit
system("rm -R /etc/enigma2")
system("cp -R /usr/share/enigma2/defaults /etc/enigma2")
+ system("/usr/bin/showiframe /boot/backdrop.mvi")
_exit(0)
self.session.openWithCallback(msgClosed, FactoryReset)
</code>
+<!-- ikseong modify position as 750S RCU -->
<rcs>
<rc id="0">
<button name="SHIFT" pos="58,21" />
- <button name="POWER" pos="90,21" />
+ <button name="POWER" pos="110,50" />
<button name="DREAMSELECT" pos="54,53" />
<button name="TVSELECT" pos="98,53" />
- <button name="1" pos="37,83" />
- <button name="2" pos="76,83" />
- <button name="3" pos="115,83" />
- <button name="4" pos="37,105" />
- <button name="5" pos="76,105" />
- <button name="6" pos="115,105" />
- <button name="7" pos="37,126" />
- <button name="8" pos="76,126" />
- <button name="9" pos="115,126" />
- <button name="ARROWLEFT" pos="37,148" />
- <button name="0" pos="76,148" />
- <button name="ARROWRIGHT" pos="115,148" />
- <button name="VOL+" pos="30,184" />
- <button name="VOL-" pos="39,208" />
- <button name="MUTE" pos="76,179" />
- <button name="EXIT" pos="76,201" />
- <button name="BOUQUET+" pos="122,184" />
- <button name="BOUQUET-" pos="113,208" />
- <button name="INFO" pos="28,238" />
- <button name="MENU" pos="124,238" />
- <button name="OK" pos="77,266" />
- <button name="UP" pos="77,241" />
- <button name="DOWN" pos="77,291" />
- <button name="LEFT" pos="48,266" />
- <button name="RIGHT" pos="106,266" />
- <button name="HELP" pos="32,298" />
- <button name="PVR" pos="121,298" />
- <button name="RED" pos="34,333" />
- <button name="GREEN" pos="61,335" />
- <button name="YELLOW" pos="90,335" />
- <button name="BLUE" pos="118,333" />
- <button name="REWIND" pos="37,365" />
- <button name="PLAYPAUSE" pos="64,366" />
- <button name="STOP" pos="90,366" />
- <button name="FORWARD" pos="117,365" />
- <button name="TV" pos="40,397" />
- <button name="RADIO" pos="65,399" />
- <button name="TEXT" pos="89,399" />
- <button name="RECORD" pos="113,397" />
+ <button name="SUBTITLE" pos="60,70" />
+ <button name="1" pos="43,98" />
+ <button name="2" pos="74,98" />
+ <button name="3" pos="106,98" />
+ <button name="4" pos="43,126" />
+ <button name="5" pos="74,126" />
+ <button name="6" pos="106,126" />
+ <button name="7" pos="43,152" />
+ <button name="8" pos="74,152" />
+ <button name="9" pos="106,152" />
+ <button name="ARROWLEFT" pos="43,180" />
+ <button name="0" pos="74,180" />
+ <button name="ARROWRIGHT" pos="106,180" />
+ <button name="VOL+" pos="41,310" />
+ <button name="VOL-" pos="42,341" />
+ <button name="MUTE" pos="35,29" />
+ <button name="EXIT" pos="75,320" />
+ <button name="BOUQUET+" pos="105,317" />
+ <button name="BOUQUET-" pos="105,347" />
+ <button name="INFO" pos="75,340" />
+ <button name="MENU" pos="41,370" />
+ <button name="OK" pos="75,257" />
+ <button name="UP" pos="75,240" />
+ <button name="DOWN" pos="75,288" />
+ <button name="LEFT" pos="45,257" />
+ <button name="RIGHT" pos="105,257" />
+ <button name="HELP" pos="105,370" />
+ <button name="PVR" pos="64,370" />
+ <button name="RED" pos="39,206" />
+ <button name="GREEN" pos="63,206" />
+ <button name="YELLOW" pos="87,206" />
+ <button name="BLUE" pos="110,206" />
+ <button name="REWIND" pos="41,392" />
+ <button name="PLAYPAUSE" pos="86,392" />
+ <button name="STOP" pos="86,412" />
+ <button name="FORWARD" pos="109,392" />
+ <button name="TV" pos="41,412" />
+ <button name="RADIO" pos="109,412" />
+ <button name="TEXT" pos="38,72" />
+ <button name="RECORD" pos="64,412" />
</rc>
<rc id="1">
<button name="SHIFT" pos="59,23" />
- <button name="POWER" pos="93,23" />
+ <button name="POWER" pos="107,29" />
<button name="DREAMSELECT" pos="51,55" />
<button name="TVSELECT" pos="97,55" />
- <button name="1" pos="38,81" />
- <button name="2" pos="77,81" />
- <button name="3" pos="113,81" />
- <button name="4" pos="38,102" />
- <button name="5" pos="77,102" />
- <button name="6" pos="113,102" />
- <button name="7" pos="38,122" />
- <button name="8" pos="77,122" />
- <button name="9" pos="113,122" />
- <button name="ARROWLEFT" pos="38,143" />
- <button name="0" pos="77,143" />
- <button name="ARROWRIGHT" pos="113,143" />
- <button name="VOL+" pos="31,181" />
- <button name="VOL-" pos="42,206" />
- <button name="MUTE" pos="76,172" />
- <button name="EXIT" pos="76,194" />
- <button name="BOUQUET+" pos="119,181" />
- <button name="BOUQUET-" pos="111,206" />
- <button name="INFO" pos="27,233" />
- <button name="MENU" pos="125,233" />
- <button name="OK" pos="77,262" />
- <button name="UP" pos="76,235" />
- <button name="DOWN" pos="76,289" />
- <button name="LEFT" pos="45,262" />
- <button name="RIGHT" pos="108,262" />
- <button name="AUDIO" pos="31,295" />
- <button name="VIDEO" pos="121,295" />
- <button name="RED" pos="34,329" />
- <button name="GREEN" pos="62,330" />
- <button name="YELLOW" pos="89,330" />
- <button name="BLUE" pos="118,329" />
- <button name="TV" pos="37,362" />
- <button name="RADIO" pos="62,363" />
- <button name="TEXT" pos="89,363" />
- <button name="HELP" pos="114,362" />
+ <button name="SUBTITLE" pos="64,73" />
+ <button name="1" pos="40,100" />
+ <button name="2" pos="76,100" />
+ <button name="3" pos="102,100" />
+ <button name="4" pos="40,108" />
+ <button name="5" pos="76,108" />
+ <button name="6" pos="102,108" />
+ <button name="7" pos="40,152" />
+ <button name="8" pos="76,152" />
+ <button name="9" pos="102,152" />
+ <button name="ARROWLEFT" pos="43,180" />
+ <button name="0" pos="76,180" />
+ <button name="ARROWRIGHT" pos="108,180" />
+ <button name="VOL+" pos="41,316" />
+ <button name="VOL-" pos="42,350" />
+ <button name="MUTE" pos="35,29" />
+ <button name="EXIT" pos="75,320" />
+ <button name="BOUQUET+" pos="106,316" />
+ <button name="BOUQUET-" pos="105,350" />
+ <button name="INFO" pos="76,342" />
+ <button name="MENU" pos="42,370" />
+ <button name="OK" pos="76,255" />
+ <button name="UP" pos="76,240" />
+ <button name="DOWN" pos="76,288" />
+ <button name="LEFT" pos="43,255" />
+ <button name="RIGHT" pos="106,255" />
+ <button name="RECORD" pos="65,414" />
+ <button name="AUDIO" pos="87,370" />
+ <button name="VIDEO" pos="64,370" />
+ <button name="RED" pos="40,204" />
+ <button name="GREEN" pos="64,204" />
+ <button name="YELLOW" pos="88,204" />
+ <button name="BLUE" pos="112,204" />
+ <button name="TV" pos="42,414" />
+ <button name="RADIO" pos="110,414" />
+ <button name="TEXT" pos="40,72" />
+ <button name="HELP" pos="108,370" />
</rc>
-</rcs>
\ No newline at end of file
+</rcs>
<item level="0" text="Aspect Ratio">config.av.aspectratio</item>
<item level="0" text="TV System">config.av.tvsystem</item>
<item level="1" text="WSS on 4:3">config.av.wss</item>
- <item level="1" text="AC3 default">config.av.defaultac3</item>
- <item level="1" text="General AC3 delay (ms)">config.av.generalAC3delay</item>
+ <item level="1" text="Dolby Digital default">config.av.defaultac3</item>
+ <item level="1" text="General Dolby Digital delay (ms)">config.av.generalAC3delay</item>
<item level="1" text="General PCM delay (ms)">config.av.generalPCMdelay</item>
- <item level="1" text="AC3 downmix" requires="CanDownmixAC3">config.av.downmix_ac3</item>
+ <item level="1" text="Dolby Digital downmix" requires="CanDownmixAC3">config.av.downmix_ac3</item>
<item level="1" text="Auto scart switching" requires="ScartSwitch">config.av.vcrswitch</item>
</setup>
<setup key="usage" title="Customize">
<convert type="ConditionalShowHide" />
</widget>
<!-- Crypt icon (encrypted service?) -->
- <ePixmap position="563,48" zPosition="0" size="107,15" pixmap="skin_default/icons/icons_off.png" />
+ <!-- ikseong
+ <ePixmap position="563,48" zPosition="0" size="107,15" pixmap="skin_default/icons/icons_off.png" /> -->
+ <ePixmap position="563,48" zPosition="0" size="80,15" pixmap="skin_default/icons/icons_off.png" />
<widget source="session.CurrentService" render="Pixmap" pixmap="skin_default/icons/icon_crypt.png" position="563,48" zPosition="1" size="12,16" alphatest="on">
<convert type="ServiceInfo">IsCrypted</convert>
<convert type="ConditionalShowHide" />
<convert type="ConditionalShowHide" />
</widget>
<!-- Audio icon (is there multichannel audio?) -->
+<!-- ikseong
<widget source="session.CurrentService" render="Pixmap" pixmap="skin_default/icons/icon_dolby.png" position="645,48" zPosition="1" size="26,16" alphatest="on">
<convert type="ServiceInfo">IsMultichannel</convert>
<convert type="ConditionalShowHide" />
- </widget>
+ </widget> -->
<!-- Progressbar (current event duration)-->
<ePixmap pixmap="skin_default/progress_bg.png" position="48,77" size="84,7" transparent="1" alphatest="on" />
<widget source="session.Event_Now" render="Progress" pixmap="skin_default/progress_small.png" position="50,78" zPosition="1" size="80,5" transparent="1">
<wizard>
<step id="start" nextstep="introduction">
- <text value="Welcome.\n\nThis start wizard will guide you through the basic setup of your Dreambox.\nPress the OK button on your remote control to move to the next step." />
+ <text value="Welcome.\n\nThis start wizard will guide you through the basic setup of your STB.\nPress the OK button on your remote control to move to the next step." />
+
<code>
self.clearSelectedKeys()
self.selectKey("OK")
</list>
</step>
<step id="finisheddefaultsatlists">
- <text value="Do you want to enable the parental control feature on your dreambox?" />
+ <text value="Do you want to enable the parental control feature on your STB?" />
+
<list>
<listentry caption="Yes" step="parentalsetup" />
<listentry caption="No" step="end" />
config.ParentalControl.setuppin.save()
</code>
- <text value="After the start wizard is completed, you need to protect single services. Refer to your dreambox's manual on how to do that." />
+ <text value="After the start wizard is completed, you need to protect single services. Refer to your STB's manual on how to do that." />
+
</step>
<step id="end" laststep="true">
<condition>
self.condition = self.isLastWizard
</condition>
- <text value="Thank you for using the wizard. Your box is now ready to use.\nPlease press OK to start using your Dreambox." />
+ <text value="Thank you for using the wizard. Your box is now ready to use.\nPlease press OK to start using your STB." />
+
</step>
</wizard>
<text value="Do you want to view a tutorial?" />
<list>
<listentry caption="Yes, view the tutorial" step="next" />
- <listentry caption="No, just start my dreambox" step="end" />
+ <listentry caption="No, just start my STB" step="end" />
</list>
</step>
rc.cpp \
rcconsole.cpp \
rcinput.cpp \
- rfmod.cpp
+ rfmod.cpp \
+ memtest.cpp \
+ sc_test.cpp
driverincludedir = $(pkgincludedir)/lib/driver
driverinclude_HEADERS = \
--- /dev/null
+#include <lib/driver/memtest.h>\r
+#include <errno.h>\r
+#include <lib/base/eerror.h>\r
+#include <lib/base/estring.h>\r
+\r
+#define TESTSIZE 32*1024\r
+\r
+eMemtest *eMemtest::instance;\r
+\r
+eMemtest::eMemtest()\r
+{\r
+ instance = this;\r
+\r
+}\r
+\r
+eMemtest::~eMemtest()\r
+{\r
+ instance=NULL;\r
+\r
+}\r
+/*\r
+* return value\r
+* 0 - ok\r
+* 1 - fail\r
+*/\r
+int eMemtest::dramtest()\r
+{\r
+ int result=0;\r
+ int i;\r
+ char memt[TESTSIZE];\r
+ eDebug("dramtest start");\r
+\r
+ \r
+ for(i=0;i<TESTSIZE;i++)\r
+ memt[i]=0x13;\r
+ \r
+ for(i=0;i<TESTSIZE;i++)\r
+ {\r
+ if(memt[i]!=0x13)\r
+ {\r
+ result=1;\r
+ break;\r
+ }\r
+ }\r
+ \r
+ return result;\r
+ \r
+}\r
+\r
+int eMemtest::flashtest()\r
+{\r
+ int result=0;\r
+ \r
+ return result;\r
+}\r
--- /dev/null
+#ifdef BUILD_VUPLUS /* ikseong */\r
+#ifndef __memtest_h\r
+#define __memtest_h\r
+\r
+#include <lib/base/object.h>\r
+#include <lib/python/connections.h>\r
+\r
+class eMemtest\r
+{\r
+ static eMemtest *instance;\r
+public:\r
+ eMemtest();\r
+ ~eMemtest();\r
+ int dramtest();\r
+ int flashtest();\r
+ static eMemtest *getInstance() { return instance; }\r
+\r
+};\r
+#endif\r
+#endif\r
+\r
--- /dev/null
+#include <lib/dvb/dvb.h>\r
+#include <lib/dvb/frontendparms.h>\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <limits.h>\r
+#include <string.h>\r
+#include <errno.h>\r
+#include <sys/ioctl.h>\r
+#include <sys/types.h>\r
+#include <sys/stat.h>\r
+#include <sys/poll.h>\r
+#include <fcntl.h>\r
+#include <time.h>\r
+#include <unistd.h>\r
+#include <termios.h>\r
+#include <lib/driver/sc_test.h>\r
+#include <errno.h>\r
+#include <lib/base/eerror.h>\r
+#include <lib/base/estring.h>\r
+\r
+#include <stdint.h>\r
+#include <sys/time.h>\r
+#include <poll.h>\r
+\r
+\r
+#define SC_CHECK_TIMEOUT 5\r
+#define SC_REMOVE_TIMEOUT 10\r
+\r
+\r
+#define SMART_CARD0 "/dev/sci0" /* upper smart card */\r
+#define SMART_CARD1 "/dev/sci1" /* lower smart card */\r
+\r
+#define SC_SUCCESS 0\r
+#define NO_DEV_FOUND -1\r
+#define SC_NOT_INSERTED -2\r
+#define SC_NOT_VALID_ATR -3\r
+#define SC_NOT_REMOVED -4\r
+#define SC_READ_TIMEOUT -5\r
+\r
+\r
+#define SCI_IOW_MAGIC 's'\r
+\r
+/* ioctl cmd table */\r
+//#include "sci_global.h"\r
+#define IOCTL_SET_RESET _IOW(SCI_IOW_MAGIC, 1, unsigned long)\r
+#define IOCTL_SET_MODES _IOW(SCI_IOW_MAGIC, 2, SCI_MODES)\r
+#define IOCTL_GET_MODES _IOW(SCI_IOW_MAGIC, 3, SCI_MODES)\r
+#define IOCTL_SET_PARAMETERS _IOW(SCI_IOW_MAGIC, 4, SCI_PARAMETERS)\r
+#define IOCTL_GET_PARAMETERS _IOW(SCI_IOW_MAGIC, 5, SCI_PARAMETERS)\r
+#define IOCTL_SET_CLOCK_START _IOW(SCI_IOW_MAGIC, 6, unsigned long)\r
+#define IOCTL_SET_CLOCK_STOP _IOW(SCI_IOW_MAGIC, 7, unsigned long)\r
+#define IOCTL_GET_IS_CARD_PRESENT _IOW(SCI_IOW_MAGIC, 8, unsigned long)\r
+#define IOCTL_GET_IS_CARD_ACTIVATED _IOW(SCI_IOW_MAGIC, 9, unsigned long)\r
+#define IOCTL_SET_DEACTIVATE _IOW(SCI_IOW_MAGIC, 10, unsigned long)\r
+#define IOCTL_SET_ATR_READY _IOW(SCI_IOW_MAGIC, 11, unsigned long)\r
+#define IOCTL_GET_ATR_STATUS _IOW(SCI_IOW_MAGIC, 12, unsigned long)\r
+#define IOCTL_DUMP_REGS _IOW(SCI_IOW_MAGIC, 20, unsigned long)\r
+\r
+eSctest *eSctest::instance;\r
+\r
+eSctest::eSctest()\r
+{\r
+ instance = this;\r
+\r
+}\r
+\r
+eSctest::~eSctest()\r
+{\r
+ instance=NULL;\r
+\r
+}\r
+\r
+int eSctest::n_check_smart_card(char *dev_name)\r
+{\r
+ int fd;\r
+ struct pollfd pollfd;\r
+ unsigned char buf[64];\r
+ int cnt = 0;\r
+ int modem_status;\r
+ int count = SC_CHECK_TIMEOUT;\r
+ int readok=0;\r
+ \r
+ fd = ::open(dev_name, O_RDWR);\r
+ \r
+ if(fd < 0){\r
+ eDebug("sci0 open error\n");\r
+ return NO_DEV_FOUND;\r
+ }\r
+ else\r
+ eDebug("sci0 is opened fd : %d\n", fd);\r
+\r
+\r
+ ::ioctl(fd, IOCTL_GET_IS_CARD_PRESENT, &modem_status);\r
+\r
+ if( modem_status )\r
+ eDebug("card is now inserted\n");\r
+ else\r
+ {\r
+ eDebug("card is NOT inserted\n");\r
+ ::close(fd);\r
+ return SC_NOT_INSERTED;\r
+ }\r
+\r
+ /* now smart card is inserted, let's do reset */\r
+\r
+ ::ioctl(fd, IOCTL_SET_RESET, &modem_status);\r
+\r
+ /* now we can get the ATR */\r
+\r
+ pollfd.fd = fd;\r
+ pollfd.events = POLLIN|POLLOUT|POLLERR|POLLPRI;\r
+\r
+\r
+ while(poll(&pollfd, 1, 1000)>=0 && count--){\r
+\r
+ eDebug("pollfd.revents : 0x%x\n", pollfd.revents);\r
+ if(pollfd.revents & POLLIN){\r
+ eDebug(">>read \n");\r
+ cnt = read(fd, buf, 64);\r
+ eDebug("<<read cnt:%d\n", cnt); \r
+ if(cnt) \r
+ {\r
+ if(buf[0]==0x3b||buf[0]==0x3f)\r
+ {\r
+ eDebug("read -%d : 0x%x",cnt, buf[0]);\r
+ readok = 1;\r
+ }\r
+ break;\r
+ }\r
+ else\r
+ eDebug("no data\n");\r
+ }\r
+ }\r
+\r
+ ::close(fd);\r
+ \r
+ if (readok == 0) return SC_NOT_VALID_ATR;\r
+ if(!count) return SC_READ_TIMEOUT;\r
+ return SC_SUCCESS;\r
+}\r
+\r
+int eSctest::check_smart_card(char *dev_name)\r
+{\r
+ int fd;\r
+ struct pollfd pollfd;\r
+ unsigned char buf[64];\r
+ int cnt = 0;\r
+ int modem_status;\r
+ int count = SC_CHECK_TIMEOUT;\r
+ int readok=0;\r
+ fd = ::open(dev_name, O_RDWR);\r
+ \r
+ if(fd < 0){\r
+ eDebug("sci0 open error");\r
+ return NO_DEV_FOUND;\r
+ }\r
+ else\r
+ eDebug("sci0 is opened fd : %d", fd);\r
+\r
+ ::tcflush(fd, TCIFLUSH);\r
+\r
+ ::ioctl(fd, TIOCMGET, &modem_status);\r
+\r
+ if( modem_status & TIOCM_CAR)\r
+ eDebug("card is now inserted");\r
+ else\r
+ {\r
+ eDebug("card is NOT inserted");\r
+ close(fd);\r
+ return SC_NOT_INSERTED;\r
+ }\r
+\r
+ /* now smart card is inserted, let's do reset */\r
+\r
+ modem_status |= TIOCM_RTS;\r
+ ::ioctl(fd, TIOCMSET, &modem_status);\r
+\r
+ modem_status &= ~TIOCM_RTS;\r
+ ::ioctl(fd, TIOCMSET, &modem_status);\r
+\r
+\r
+ /* now we can get the ATR */\r
+\r
+ pollfd.fd = fd;\r
+ pollfd.events = POLLIN|POLLOUT|POLLERR|POLLPRI;\r
+\r
+\r
+ while(poll(&pollfd, 1, 1000)>=0 && count--){\r
+\r
+ eDebug("pollfd.revents : 0x%x %d", pollfd.revents,count);\r
+ if(pollfd.revents & POLLIN){\r
+ eDebug(">>read ");\r
+ cnt = ::read(fd, buf, 64);\r
+ eDebug("<<read cnt:%d", cnt);\r
+ if(cnt) \r
+ {\r
+ int i;\r
+ for( i = 0 ; i < cnt ; i ++)\r
+ {\r
+ if(buf[i]!=0x0)\r
+ readok = 1;\r
+ eDebug("read : 0x%x", buf[i]);\r
+ }\r
+ break;\r
+ }\r
+ else\r
+ eDebug("no data");\r
+ }\r
+ }\r
+ \r
+ ::close(fd);\r
+ eDebug("readok = %d",readok);\r
+ if (readok == 0) return SC_NOT_VALID_ATR;\r
+ if(count<=0 ) return SC_READ_TIMEOUT;\r
+ return SC_SUCCESS;\r
+}\r
+int eSctest::eject_smart_card(char *dev_name)\r
+{\r
+ int fd;\r
+ struct pollfd pollfd;\r
+ unsigned char buf[64];\r
+ int cnt = 0;\r
+ int modem_status;\r
+ int count = SC_CHECK_TIMEOUT;\r
+ \r
+ fd = ::open(dev_name, O_RDWR);\r
+ \r
+ if(fd < 0){\r
+ eDebug("sci0 open error");\r
+ return NO_DEV_FOUND;\r
+ }\r
+ else\r
+ eDebug("sci0 is opened fd : %d", fd);\r
+\r
+ ::tcflush(fd, TCIFLUSH);\r
+\r
+ ::ioctl(fd, TIOCMGET, &modem_status);\r
+\r
+ if( modem_status & TIOCM_CAR)\r
+ eDebug("card is now inserted");\r
+ else\r
+ {\r
+ eDebug("card is NOT inserted");\r
+ close(fd);\r
+ return SC_NOT_INSERTED;\r
+ }\r
+ /* now we can get the ATR */\r
+\r
+ pollfd.fd = fd;\r
+ pollfd.events = POLLIN|POLLOUT|POLLERR|POLLPRI;\r
+\r
+ /* let's wait until card is removed for count secs.*/\r
+ count = SC_REMOVE_TIMEOUT; \r
+ do{\r
+ ::ioctl(fd, TIOCMGET, &modem_status);\r
+ eDebug("modem_status : 0x%x %d", modem_status,count);\r
+ sleep(1); \r
+\r
+ }\r
+ while((modem_status&TIOCM_CAR) && count--);\r
+\r
+ if(count<=0 ) return SC_NOT_REMOVED;\r
+ \r
+ ::close(fd); \r
+ return SC_SUCCESS;\r
+}\r
+\r
+\r
+int eSctest::VFD_Open()\r
+{\r
+ VFD_fd = open("/dev/dbox/lcd0", O_RDWR);\r
+ return VFD_fd;\r
+}\r
+\r
+int eSctest::turnon_VFD()\r
+{ \r
+ ioctl(VFD_fd, 0xa0a0a0a0, 0);\r
+}\r
+\r
+int eSctest::turnoff_VFD()\r
+{\r
+ ioctl(VFD_fd, 0x01010101, 0); \r
+}\r
+\r
+void eSctest::VFD_Close()\r
+{\r
+ close(VFD_fd);\r
+}\r
+\r
+extern int frontend0_fd;\r
+extern int frontend1_fd;\r
+\r
+int eSctest::getFrontendstatus(int fe)\r
+{\r
+ fe_status_t status;\r
+\r
+ int m_fd;\r
+ int res;\r
+\r
+ if (fe == 0)\r
+ m_fd = frontend0_fd;\r
+ else if (fe==1)\r
+ m_fd = frontend1_fd;\r
+ else \r
+ return -1;\r
+\r
+ if (m_fd < 0)\r
+ {\r
+ eDebug("%d open error ",fe);\r
+ return -1;\r
+ }\r
+ else\r
+ eDebug("%d open ok!!!! ",m_fd);\r
+ \r
+ if ( ioctl(m_fd, FE_READ_STATUS, &status) < 0)\r
+ eDebug("%d read error ",fe); \r
+\r
+ if (status&FE_HAS_LOCK)\r
+ return 1;\r
+ else\r
+ return 0;\r
+\r
+}\r
+\r
--- /dev/null
+#ifdef BUILD_VUPLUS /* ikseong */
+#ifndef __sc_test_h
+#define __sc_test_h
+
+#include <lib/base/object.h>
+#include <lib/python/connections.h>
+
+class eSctest
+{
+ static eSctest *instance;
+protected:
+ int VFD_fd;
+
+public:
+ eSctest();
+ ~eSctest();
+ int n_check_smart_card(char *dev_name);
+ int check_smart_card(char *dev_name);
+ int eject_smart_card(char *dev_name);
+ int VFD_Open();
+ void VFD_Close();
+ int turnon_VFD();
+ int turnoff_VFD();
+ int getFrontendstatus(int fe);
+
+ static eSctest *getInstance() { return instance; }
+};
+
+#if !defined(_sci_global_h_)
+#define _sci_global_h_
+
+#define INT int
+#define UCHAR unsigned char
+#define ULONG unsigned long
+
+#define SCI_CLASS_A 1 /* only 5V Vcc to Smart Card */
+#define SCI_CLASS_B 2 /* only 3V Vcc to Smart Card */
+#define SCI_CLASS_AB 3 /* 5V or 3V Vcc to Smart Card */
+#define SCI_NUMBER_OF_CONTROLLERS 2 /* number of SCI controllers */
+
+#define SCI_BUFFER_SIZE 512
+
+#define SCI_CLOCK_STOP_DISABLED 0
+#define SCI_CLOCK_STOP_LOW 1
+#define SCI_CLOCK_STOP_HIGH 2
+
+#define SCI_MAX_ATR_SIZE 33
+
+#define SCI_MAX_F 80000000
+#define SCI_MAX_ETU 0xFFF
+#define SCI_MAX_WWT 0xFFFFFFFF
+#define SCI_MAX_CWT 0xFFFF
+#define SCI_MAX_BWT 0xFFFFFFFF
+#define SCI_MAX_EGT 0xFF
+
+#define SCI_MIN_F 1000000
+#define SCI_MIN_ETU 8
+#define SCI_MIN_WWT 12
+#define SCI_MIN_CWT 12
+#define SCI_MIN_BWT 971
+#define SCI_MIN_EGT 0
+
+#define SCI_SYNC 0x00000001
+#define SCI_DATA_ANY 0x00000002
+
+/* Reserved for Future Use defined as 0 */
+#define RFU 0
+
+/* error codes */
+typedef enum
+{
+ SCI_ERROR_OK = 0,
+ SCI_ERROR_DRIVER_NOT_INITIALIZED = -1691,
+ SCI_ERROR_FAIL,
+ SCI_ERROR_KERNEL_FAIL,
+ SCI_ERROR_NO_ATR,
+ SCI_ERROR_TS_CHARACTER_INVALID,
+ SCI_ERROR_LRC_FAIL,
+ SCI_ERROR_CRC_FAIL,
+ SCI_ERROR_LENGTH_FAIL,
+ SCI_ERROR_PARITY_FAIL,
+ SCI_ERROR_RX_OVERFLOW_FAIL,
+ SCI_ERROR_TX_OVERFLOW_FAIL,
+ SCI_ERROR_TX_UNDERRUN_FAIL,
+ SCI_ERROR_CARD_NOT_PRESENT,
+ SCI_ERROR_CARD_NOT_ACTIVATED,
+ SCI_ERROR_AWT_TIMEOUT,
+ SCI_ERROR_WWT_TIMEOUT,
+ SCI_ERROR_CWT_TIMEOUT,
+ SCI_ERROR_BWT_TIMEOUT,
+ SCI_ERROR_PARAMETER_OUT_OF_RANGE,
+ SCI_ERROR_TRANSACTION_ABORTED,
+ SCI_ERROR_CLOCK_STOP_DISABLED,
+ SCI_ERROR_TX_PENDING,
+ SCI_ERROR_ATR_PENDING
+}
+SCI_ERROR;
+
+/* SCI driver modes */
+typedef struct sci_modes
+{
+ INT emv2000;
+ INT dma;
+ INT man_act;
+ INT rw_mode;
+}
+SCI_MODES;
+
+/* SCI communication parameters */
+typedef struct sci_parameters
+{
+ UCHAR T;
+ ULONG FI; // Contains the clock rate conversion. This factor is used as an index into a table of maximum operating frequencies. When the smart card is reset, the smart card driver library uses this value to calculate a new clock frequency.
+ ULONG ETU; //elementary time unit
+ ULONG WWT;
+ ULONG CWT;
+ ULONG BWT;
+ ULONG EGT; //Extra Guard Time
+ ULONG clock_stop_polarity;
+ UCHAR check;
+ UCHAR P;
+ UCHAR I;
+ UCHAR U;
+}
+SCI_PARAMETERS;
+
+/* SCI ATR status */
+typedef enum
+{
+ SCI_WITHOUT_ATR = 0,
+ SCI_ATR_READY
+}
+SCI_ATR_STATUS;
+
+#endif /* _sci_global_h_ */
+
+#endif
+#endif
+
case aDTSHD:
bypass = 0x10;
break;
+ case aDDP:
+ bypass = 0x22;
+ break;
+
}
eDebugNoNewLine("AUDIO_SET_BYPASS(%d) - ", bypass);
ePtr<eDVBDemux> m_demux;
int m_fd, m_fd_demux, m_dev, m_is_freezed;
public:
- enum { aMPEG, aAC3, aDTS, aAAC, aAACHE, aLPCM, aDTSHD };
+ enum { aMPEG, aAC3, aDTS, aAAC, aAACHE, aLPCM, aDTSHD, aDDP };
eDVBAudio(eDVBDemux *demux, int dev);
enum { aMonoLeft, aStereo, aMonoRight };
void setChannel(int channel);
}
} else if (state == iDVBFrontend::stateFailed)
{
+#ifdef BUILD_VUPLUS /* ikseong */
+ if (m_current_frontend_parameters)
+ {
+ eDebug("OURSTATE: lost lock, trying to retune");
+ ourstate = state_tuning;
+ m_frontend->get().tune(*m_current_frontend_parameters);
+ }
+ else
+ {
+ eDebug("OURSTATE: failed");
+ ourstate = state_failed;
+ }
+#else
eDebug("OURSTATE: failed");
ourstate = state_failed;
+#endif
} else
eFatal("state unknown");
openFrontend();
}
+#ifdef BUILD_VUPLUS /* ikseong */
+int frontend0_fd;
+int frontend1_fd;
+#endif
+
int eDVBFrontend::openFrontend()
{
if (m_state != stateClosed)
eWarning("failed! (%s) %m", m_filename);
return -1;
}
+#ifdef BUILD_VUPLUS /* ikseong */
+ else
+ {
+ if (m_dvbid==0)
+ frontend0_fd = m_fd;
+ else if (m_dvbid==1)
+ frontend1_fd = m_fd;
+ }
+#endif
}
else
eWarning("frontend %d already opened", m_dvbid);
m_tuning = 0;
if (m_state == stateTuning)
{
+#ifdef BUILD_VUPLUS /* ikseong */
+ eDVBFrontend *sec_fe = this;
+ sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = -1; // reset diseqc
+#endif
m_state = stateFailed;
m_stateChanged(this);
}
#include <dvbsi++/teletext_descriptor.h>
#include <dvbsi++/video_stream_descriptor.h>
#include <dvbsi++/registration_descriptor.h>
+#include <dvbsi++/ac3_descriptor.h>
eDVBServicePMTHandler::eDVBServicePMTHandler()
:m_ca_servicePtr(0), m_dvb_scan(0), m_decode_demux_num(0xFF), m_no_pat_entry_delay(eTimer::create())
audio.type = audioStream::atAACHE; // MPEG4-AAC
break;
case AC3_DESCRIPTOR:
- isaudio = 1;
+ {
+ Ac3Descriptor *ac = (Ac3Descriptor*)(*desc);
+
+ isaudio = 1;
audio.type = audioStream::atAC3;
+
+ if(ac->getAc3TypeFlag())
+ {
+
+ uint8_t ac3type = ac->getAc3Type();
+ if( ( ac3type & 0x80 ) && ( (ac3type<<5) == 0xA0 || (ac3type<<5) == 0xC0) ) // From EN-300 468 v1.7.1 Table D.1
+ audio.type = audioStream::atDDP;
+ }
+
+ break;
+ }
+ case ENHANCED_AC3_DESCRIPTOR:
+ isaudio = 1;
+ audio.type = audioStream::atDDP;
break;
+
+
case REGISTRATION_DESCRIPTOR: /* some services don't have a separate AC3 descriptor */
{
RegistrationDescriptor *d = (RegistrationDescriptor*)(*desc);
{
int pid,
rdsPid; // hack for some radio services which transmit radiotext on different pid (i.e. harmony fm, HIT RADIO FFH, ...)
- enum { atMPEG, atAC3, atDTS, atAAC, atAACHE, atLPCM, atDTSHD };
+ enum { atMPEG, atAC3, atDTS, atAAC, atAACHE, atLPCM, atDTSHD, atDDP };
int type; // mpeg2, ac3, dts, ...
int component_tag;
{
case gOpcode::flush:
// if (update)
+#ifndef BUILD_VUPLUS /* ikseong */
lcd->update();
+#else
+ ;
+#endif
default:
gDC::exec(o);
break;
void eDBoxLCD::update()
{
+#ifdef BUILD_VUPLUS /* ikseong */
+ return ;
+#endif
if (lcdfd >= 0)
{
if (!is_oled || is_oled == 2)
# when YUV is not enabled, don't let the user select it
if config.av.yuvenabled.value:
colorformat_choices["yuv"] = _("YPbPr")
-
- config.av.colorformat = ConfigSelection(choices=colorformat_choices, default="rgb")
+# ikseong
+ config.av.colorformat = ConfigSelection(choices=colorformat_choices, default="cvbs")
config.av.aspectratio = ConfigSelection(choices={
"4_3_letterbox": _("4:3 Letterbox"),
"4_3_panscan": _("4:3 PanScan"),
while idx < n:
i = audio.getTrackInfo(idx)
description = i.getDescription();
- if "AC3" in description or "DTS" in description:
+ if "AC3" in description or "DTS" in description or "Dolby Digital" in description:
return True
idx += 1
return False
from os import system, listdir, statvfs, popen, makedirs, stat, major, minor, path, access
-from Tools.Directories import SCOPE_HDD, resolveFilename
+# ikseong
+from Tools.Directories import SCOPE_HDD, resolveFilename, fileExists
+
from Tools.CList import CList
from SystemInfo import SystemInfo
import time
return ret
def diskSize(self):
- line = readFile(self.sysfsPath('size'))
+ # ikseong
+ try:
+ line = readFile(self.sysfsPath('size'))
+ except:
+ harddiskmanager.removeHotplugPartition(self.device)
+ print "error remove",self.device
+ return -1
try:
cap = int(line)
except:
return "%d.%03d GB" % (cap/1000, cap%1000)
def model(self):
- if self.device[:2] == "hd":
- return readFile('/proc/ide/' + self.device + '/model')
- elif self.device[:2] == "sd":
- vendor = readFile(self.sysfsPath('device/vendor'))
- model = readFile(self.sysfsPath('device/model'))
- return vendor + '(' + model + ')'
- else:
- assert False, "no hdX or sdX"
+ # ikseong
+ try:
+ if self.device[:2] == "hd":
+ return readFile('/proc/ide/' + self.device + '/model')
+ elif self.device[:2] == "sd":
+ vendor = readFile(self.sysfsPath('device/vendor'))
+ model = readFile(self.sysfsPath('device/model'))
+ return vendor + '(' + model + ')'
+ else:
+ assert False, "no hdX or sdX"
+ except:
+ harddiskmanager.removeHotplugPartition(self.device)
+ print "error remove",self.device
+ return -1
def free(self):
try:
return (res >> 8)
def createMovieFolder(self):
+# ikseong
try:
+ if not fileExists("/hdd", 0):
+ print "not found /hdd"
+ system("ln -s /media/hdd /hdd")
+#
makedirs(resolveFilename(SCOPE_HDD))
except OSError:
return -1
idle_time = t - self.last_access
stats = self.readStats()
+ # ikseong
+ if stats == -1:
+ self.setIdleTime(0)
+ return
print "nr_read", stats[0], "nr_write", stats[1]
l = sum(stats)
print "sum", l, "prev_sum", self.last_stat
def getAutofsMountpoint(self, device):
return "/autofs/%s/" % (device)
+
def is_hard_mounted(self, device):
mounts = file('/proc/mounts').read().split('\n')
for x in mounts:
def HDDList(self):
list = [ ]
for hd in self.hdd:
+ # ikseong
+ if hd.model() == -1:
+ continue
hdd = hd.model() + " - " + hd.bus()
cap = hd.capacity()
if cap != "":
from Plugins.Plugin import PluginDescriptor
from Components.PluginComponent import plugins
-from os import path as os_path, walk as os_walk
+from os import path as os_path, walk as os_walk, system
from mimetypes import guess_type, add_type
add_type("application/x-debian-package", ".ipk")
for p in paths_to_scan:
path = os_path.join(mountpoint, p.path)
+ cmd = "ls " + path
+ system(cmd)
for root, dirs, files in os_walk(path):
for f in files:
path = os_path.join(root, f)
value = self.getValue(self.LOCK)
if self.type == self.SNR_DB:
- if value != 0x12345678:
+# ikseong
+# if value != 0x12345678:
+ if value is not None and value != 0x12345678:
self.setText("%3.02f dB" % (value / 100.0))
else:
self.setText("")
self.target = None
self.settings = ConfigSubsection()
self.settings.name = ConfigText(fixed_size = False, visible_width = 40)
- self.settings.authormode = ConfigSelection(choices = [("menu_linked", _("Linked titles with a DVD menu")), ("just_linked", _("Direct playback of linked titles without menu")), ("menu_seperate", _("Seperate titles with a main menu")), ("data_ts", _("Dreambox format data DVD (HDTV compatible)"))])
+ self.settings.authormode = ConfigSelection(choices = [("menu_linked", _("Linked titles with a DVD menu")), ("just_linked", _("Direct playback of linked titles without menu")), ("menu_seperate", _("Seperate titles with a main menu")), ("data_ts", _("STB format data DVD (HDTV compatible)"))])
self.settings.titlesetmode = ConfigSelection(choices = [("single", _("Simple titleset (compatibility for legacy players)")), ("multi", _("Complex (allows mixing audio tracks and aspects)"))], default="multi")
self.settings.output = ConfigSelection(choices = [("iso", _("Create DVD-ISO")), ("dvd", _("Burn DVD"))])
self.settings.isopath = ConfigText(fixed_size = False, visible_width = 40)
tool = "genisoimage"
isopathfile = getISOfilename(self.project.settings.isopath.getValue(), volName)
burnargs = [ "-o", isopathfile ]
- burnargs += [ "-dvd-video", "-publisher", "Dreambox", "-V", volName, self.workspace + "/dvd" ]
+ burnargs += [ "-dvd-video", "-publisher", "STB", "-V", volName, self.workspace + "/dvd" ]
BurnTask(self, burnargs, tool)
RemoveDVDFolder(self)
burnargs += ["-iso-level", "4", "-allow-limited-size" ]
elif self.project.settings.dataformat.getValue() == "udf":
burnargs += ["-udf", "-allow-limited-size" ]
- burnargs += [ "-publisher", "Dreambox", "-V", volName, "-follow-links", self.workspace ]
+ burnargs += [ "-publisher", "STB", "-V", volName, "-follow-links", self.workspace ]
BurnTask(self, burnargs, tool)
RemoveDVDFolder(self)
burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD(), "-dvd-compat" ]
if getSize(imagepath)/(1024*1024) > self.project.MAX_SL:
burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ]
- burnargs += [ "-dvd-video", "-publisher", "Dreambox", "-V", volName, imagepath ]
+ burnargs += [ "-dvd-video", "-publisher", "STB", "-V", volName, imagepath ]
tool = "growisofs"
BurnTask(self, burnargs, tool)
if source is None:
return None
if not source.getPath().endswith(".ts"):
- self.session.open(MessageBox,text = _("You can only burn Dreambox recordings!"), type = MessageBox.TYPE_ERROR)
+ self.session.open(MessageBox,text = _("You can only burn STB recordings!"), type = MessageBox.TYPE_ERROR)
return None
t = self.project.addService(source)
try:
t = self.current_edit_title
t.titleEditDone(cutlist)
if t.VideoType != 0:
- self.session.openWithCallback(self.DVDformatCB,MessageBox,text = _("The DVD standard doesn't support H.264 (HDTV) video streams. Do you want to create a Dreambox format data DVD (which will not play in stand-alone DVD players) instead?"), type = MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.DVDformatCB,MessageBox,text = _("The DVD standard doesn't support H.264 (HDTV) video streams. Do you want to create a STB format data DVD (which will not play in stand-alone DVD players) instead?"), type = MessageBox.TYPE_YESNO)
else:
self.updateTitleList()
self.seek_target = None
- from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
- hotplugNotifier.append(self.hotplugCB)
+# ikseong
+# from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
+# hotplugNotifier.append(self.hotplugCB)
class MoviePlayerActionMap(NumberActionMap):
def __init__(self, player, contexts = [ ], actions = { }, prio=0):
"prevBouquet": (self.switchToPlayList, _("switch to playlist")),
"nextBouquet": (self.switchToFileList, _("switch to filelist")),
"delete": (self.deletePlaylistEntry, _("delete playlist entry")),
- "shift_stop": (self.clear_playlist, _("clear playlist")),
- "shift_record": (self.playlist.PlayListShuffle, _("shuffle playlist")),
+#ikseong
+# "shift_stop": (self.clear_playlist, _("clear playlist")),
+# "shift_record": (self.playlist.PlayListShuffle, _("shuffle playlist")),
+ "shift_stop": self.clear_playlist,
+ "shift_record": self.playlist.PlayListShuffle,
"subtitles": (self.subtitleSelection, _("Subtitle selection")),
}, -2)
if config.mediaplayer.saveDirOnExit.getValue():
config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory())
config.mediaplayer.defaultDir.save()
- from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
- hotplugNotifier.remove(self.hotplugCB)
+# ikseong
+# from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
+# hotplugNotifier.remove(self.hotplugCB)
del self["coverArt"].picload
self.close()
currPlay = self.session.nav.getCurrentService()
sTagAudioCodec = currPlay.info().getInfoString(iServiceInformation.sTagAudioCodec)
print "[__evAudioDecodeError] audio-codec %s can't be decoded by hardware" % (sTagAudioCodec)
- self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sTagAudioCodec, type = MessageBox.TYPE_INFO,timeout = 20 )
+ self.session.open(MessageBox, _("This STB can't decode %s streams!") % sTagAudioCodec, type = MessageBox.TYPE_INFO,timeout = 20 )
def __evVideoDecodeError(self):
currPlay = self.session.nav.getCurrentService()
sTagVideoCodec = currPlay.info().getInfoString(iServiceInformation.sTagVideoCodec)
print "[__evVideoDecodeError] video-codec %s can't be decoded by hardware" % (sTagVideoCodec)
- self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sTagVideoCodec, type = MessageBox.TYPE_INFO,timeout = 20 )
+ self.session.open(MessageBox, _("This STB can't decode %s streams!") % sTagVideoCodec, type = MessageBox.TYPE_INFO,timeout = 20 )
def __evPluginError(self):
currPlay = self.session.nav.getCurrentService()
--- /dev/null
+installdir = $(pkglibdir)/python/Plugins/SystemPlugins/Blindscan
+
+SUBDIRS = meta
+
+install_PYTHON = \
+ __init__.py \
+ plugin.py
+
--- /dev/null
+installdir = $(datadir)/meta
+
+dist_install_DATA = plugin_blindscan.xml
--- /dev/null
+<default>
+ <prerequisites>
+ <tag type="System" />
+ </prerequisites>
+ <info>
+ <author>doliyu and oskwon</author>
+ <name>Blindscan</name>
+ <packagename>enigma2-plugin-systemplugins-blindscan</packagename>
+ <shortdescription>vuplus blindscan...</shortdescription>
+ <description>vuplus blindscan...</description>
+ </info>
+
+ <files type="package"> <!-- without version, without .ipk -->
+ <file type="package" name="enigma2-plugin-systemplugins-blindscan" />
+ </files>
+</default>
--- /dev/null
+from Plugins.Plugin import PluginDescriptor
+
+from Screens.Screen import Screen
+from Screens.ServiceScan import ServiceScan
+from Screens.MessageBox import MessageBox
+from Screens.DefaultWizard import DefaultWizard
+
+from Components.Label import Label
+from Components.TuneTest import Tuner
+from Components.ConfigList import ConfigListScreen
+from Components.Sources.StaticText import StaticText
+from Components.ActionMap import NumberActionMap, ActionMap
+from Components.NimManager import nimmanager, getConfigSatlist
+from Components.config import config, ConfigSubsection, ConfigSelection, ConfigYesNo, ConfigInteger, getConfigListEntry, ConfigSlider, ConfigEnableDisable
+
+from Tools.HardwareInfo import HardwareInfo
+from Tools.Directories import resolveFilename, SCOPE_DEFAULTPARTITIONMOUNTDIR, SCOPE_DEFAULTDIR, SCOPE_DEFAULTPARTITION
+
+from enigma import eTimer, eDVBFrontendParametersSatellite, eComponentScan, eDVBSatelliteEquipmentControl, eDVBFrontendParametersTerrestrial, eDVBFrontendParametersCable, eConsoleAppContainer, eDVBResourceManager
+
+class Blindscan(ConfigListScreen, Screen):
+ skin="""
+ <screen name="Blindscan" position="center,center" size="560,290" title="Blindscan">
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="5,0" size="140,40" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/buttons/green.png" position="145,0" size="140,40" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/buttons/button_off.png" position="285,0" size="140,40" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/buttons/blue.png" position="425,0" size="140,40" alphatest="on" />
+ <widget source="key_red" render="Label" position="20,0" zPosition="1" size="115,30" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget source="key_green" render="Label" position="160,0" zPosition="1" size="115,30" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget source="key_blue" render="Label" position="440,0" zPosition="1" size="115,30" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget name="config" position="5,50" size="550,200" scrollbarMode="showOnDemand" />
+ <widget name="introduction" position="0,265" size="560,20" font="Regular;20" halign="center" />
+ </screen>
+ """
+ def __init__(self, session):
+ Screen.__init__(self, session)
+
+ self.current_play_service = self.session.nav.getCurrentlyPlayingServiceReference()
+
+ # update sat list
+ self.satList = []
+ for slot in nimmanager.nim_slots:
+ if slot.isCompatible("DVB-S"):
+ self.satList.append(nimmanager.getSatListForNim(slot.slot))
+
+ # make config
+ self.createConfig()
+
+ self.list = []
+ self.status = ""
+
+ ConfigListScreen.__init__(self, self.list)
+ if self.scan_nims.value != None and self.scan_nims.value != "" :
+ self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", ],
+ {
+ "red": self.keyCancel,
+ "green": self.keyGo,
+ "blue":self.keyGoAll,
+ "ok": self.keyGo,
+ "cancel": self.keyCancel,
+ }, -2)
+ self["key_red"] = StaticText(_("Exit"))
+ self["key_green"] = StaticText("Start")
+ self["key_blue"] = StaticText("Scan All")
+ self["introduction"] = Label(_("Press Green/OK to start the scan"))
+ self.createSetup()
+ else :
+ self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", ],
+ {
+ "red": self.keyCancel,
+ "green": self.keyNone,
+ "blue":self.keyNone,
+ "ok": self.keyNone,
+ "cancel": self.keyCancel,
+ }, -2)
+ self["key_red"] = StaticText(_("Exit"))
+ self["key_green"] = StaticText(" ")
+ self["key_blue"] = StaticText(" ")
+ self["introduction"] = Label(_("Please setup your tuner configuration."))
+
+ def keyNone(self):
+ None
+ def callbackNone(self, *retval):
+ None
+
+ def openFrontend(self):
+ res_mgr = eDVBResourceManager.getInstance()
+ if res_mgr:
+ self.raw_channel = res_mgr.allocateRawChannel(self.feid)
+ if self.raw_channel:
+ self.frontend = self.raw_channel.getFrontend()
+ if self.frontend:
+ return True
+ else:
+ print "getFrontend failed"
+ else:
+ print "getRawChannel failed"
+ else:
+ print "getResourceManager instance failed"
+ return False
+
+ def createConfig(self):
+ self.feinfo = None
+ frontendData = None
+ defaultSat = {
+ "orbpos": 192,
+ "system": eDVBFrontendParametersSatellite.System_DVB_S,
+ "frequency": 11836,
+ "inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
+ "symbolrate": 27500,
+ "polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
+ "fec": eDVBFrontendParametersSatellite.FEC_Auto,
+ "fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
+ "modulation": eDVBFrontendParametersSatellite.Modulation_QPSK
+ }
+
+ self.service = self.session.nav.getCurrentService()
+ if self.service is not None:
+ self.feinfo = self.service.frontendInfo()
+ frontendData = self.feinfo and self.feinfo.getAll(True)
+ if frontendData is not None:
+ ttype = frontendData.get("tuner_type", "UNKNOWN")
+ if ttype == "DVB-S":
+ defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
+ defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
+ defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
+ defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
+ defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
+ if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
+ defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
+ defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
+ defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
+ else:
+ defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
+ defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
+ defaultSat["orbpos"] = frontendData.get("orbital_position", 0)
+ del self.feinfo
+ del self.service
+ del frontendData
+
+ self.scan_sat = ConfigSubsection()
+ self.scan_networkScan = ConfigYesNo(default = False)
+
+ # blindscan add
+ self.blindscan_hi = ConfigSelection(default = "hi_low", choices = [("low", _("low")), ("high", _("high")), ("hi_low", _("hi_low"))])
+
+ #ConfigYesNo(default = True)
+ self.blindscan_start_frequency = ConfigInteger(default = 950*1000000)
+ self.blindscan_stop_frequency = ConfigInteger(default = 2150*1000000)
+ self.blindscan_start_symbol = ConfigInteger(default = 2*1000000)
+ self.blindscan_stop_symbol = ConfigInteger(default = 45*1000000)
+
+ # collect all nims which are *not* set to "nothing"
+ nim_list = []
+ for n in nimmanager.nim_slots:
+ if n.config_mode == "nothing":
+ continue
+ if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
+ continue
+ if n.config_mode in ("loopthrough", "satposdepends"):
+ root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.value))
+ if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
+ continue
+ nim_list.append((str(n.slot), n.friendly_full_description))
+
+ self.scan_nims = ConfigSelection(choices = nim_list)
+
+ # sat
+ self.scan_sat.frequency = ConfigInteger(default = defaultSat["frequency"], limits = (1, 99999))
+ #self.scan_sat.polarization = ConfigSelection(default = defaultSat["polarization"], choices = [
+ self.scan_sat.polarization = ConfigSelection(default = eDVBFrontendParametersSatellite.Polarisation_CircularRight + 1, choices = [
+ (eDVBFrontendParametersSatellite.Polarisation_CircularRight + 1, _("horizontal_vertical")),
+ (eDVBFrontendParametersSatellite.Polarisation_Horizontal, _("horizontal")),
+ (eDVBFrontendParametersSatellite.Polarisation_Vertical, _("vertical")),
+ (eDVBFrontendParametersSatellite.Polarisation_CircularLeft, _("circular left")),
+ (eDVBFrontendParametersSatellite.Polarisation_CircularRight, _("circular right"))])
+ self.scan_scansat = {}
+ for sat in nimmanager.satList:
+ self.scan_scansat[sat[0]] = ConfigYesNo(default = False)
+
+ self.scan_satselection = []
+ for slot in nimmanager.nim_slots:
+ if slot.isCompatible("DVB-S"):
+ self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot]))
+ return True
+
+ def createSetup(self):
+ self.list = []
+ self.multiscanlist = []
+ index_to_scan = int(self.scan_nims.value)
+ print "ID: ", index_to_scan
+
+ self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
+ self.list.append(self.tunerEntry)
+
+ if self.scan_nims == [ ]:
+ return
+
+ self.systemEntry = None
+ self.modulationEntry = None
+ nim = nimmanager.nim_slots[index_to_scan]
+
+ self.scan_networkScan.value = False
+ if nim.isCompatible("DVB-S") :
+ self.list.append(getConfigListEntry(_('Satellite'), self.scan_satselection[index_to_scan]))
+ self.list.append(getConfigListEntry(_('Scan start frequency'), self.blindscan_start_frequency))
+ self.list.append(getConfigListEntry(_('Scan stop frequency'), self.blindscan_stop_frequency))
+ self.list.append(getConfigListEntry(_("Polarity"), self.scan_sat.polarization))
+ self.list.append(getConfigListEntry(_("Scan band"), self.blindscan_hi))
+ self.list.append(getConfigListEntry(_('Scan start symbolrate'), self.blindscan_start_symbol))
+ self.list.append(getConfigListEntry(_('Scan stop symbolrate'), self.blindscan_stop_symbol))
+ self["config"].list = self.list
+ self["config"].l.setList(self.list)
+
+ def newConfig(self):
+ cur = self["config"].getCurrent()
+ print "cur is", cur
+ if cur == self.tunerEntry or \
+ cur == self.systemEntry or \
+ (self.modulationEntry and self.systemEntry[1].value == eDVBFrontendParametersSatellite.System_DVB_S2 and cur == self.modulationEntry):
+ self.createSetup()
+
+ def checkSettings(self):
+ if self.blindscan_start_frequency.value < 950*1000000 or self.blindscan_start_frequency.value > 2150*1000000 :
+ self.session.open(MessageBox, _("Please check again.\nStart frequency must be between 950 and 2150."), MessageBox.TYPE_ERROR)
+ return False
+ if self.blindscan_stop_frequency.value < 950*1000000 or self.blindscan_stop_frequency.value > 2150*1000000 :
+ self.session.open(MessageBox, _("Please check again.\nStop frequency must be between 950 and 2150."), MessageBox.TYPE_ERROR)
+ return False
+ if self.blindscan_start_frequency.value > self.blindscan_stop_frequency.value :
+ self.session.open(MessageBox, _("Please check again.\nFrequency : start value is larger than stop value."), MessageBox.TYPE_ERROR)
+ return False
+ if self.blindscan_start_symbol.value < 2*1000000 or self.blindscan_start_symbol.value > 45*1000000 :
+ self.session.open(MessageBox, _("Please check again.\nStart symbolrate must be between 2MHz and 45MHz."), MessageBox.TYPE_ERROR)
+ return False
+ if self.blindscan_stop_symbol.value < 2*1000000 or self.blindscan_stop_symbol.value > 45*1000000 :
+ self.session.open(MessageBox, _("Please check again.\nStop symbolrate must be between 2MHz and 45MHz."), MessageBox.TYPE_ERROR)
+ return False
+ if self.blindscan_start_symbol.value > self.blindscan_stop_symbol.value :
+ self.session.open(MessageBox, _("Please check again.\nSymbolrate : start value is larger than stop value."), MessageBox.TYPE_ERROR)
+ return False
+ return True
+
+ def keyLeft(self):
+ ConfigListScreen.keyLeft(self)
+ self.newConfig()
+
+ def keyRight(self):
+ ConfigListScreen.keyRight(self)
+ self.newConfig()
+
+ def keyCancel(self):
+ self.session.nav.playService(self.current_play_service)
+ for x in self["config"].list:
+ x[1].cancel()
+ self.close()
+
+ def keyGo(self):
+ if self.checkSettings() == False:
+ return
+
+ tab_pol = {
+ eDVBFrontendParametersSatellite.Polarisation_Horizontal : "horizontal",
+ eDVBFrontendParametersSatellite.Polarisation_Vertical : "vertical",
+ eDVBFrontendParametersSatellite.Polarisation_CircularLeft : "circular left",
+ eDVBFrontendParametersSatellite.Polarisation_CircularRight : "circular right",
+ eDVBFrontendParametersSatellite.Polarisation_CircularRight + 1 : "horizontal_vertical"
+ }
+
+ self.tmp_tplist=[]
+ tmp_pol = []
+ tmp_band = []
+ tmp_list=[self.satList[0][self.scan_satselection[0].index]]
+
+ if self.blindscan_hi.value == "hi_low" :
+ tmp_band=["low","high"]
+ else:
+ tmp_band=[self.blindscan_hi.value]
+
+ if self.scan_sat.polarization.value == eDVBFrontendParametersSatellite.Polarisation_CircularRight + 1 :
+ tmp_pol=["horizontal","vertical"]
+ else:
+ tmp_pol=[tab_pol[self.scan_sat.polarization.value]]
+
+ self.doRun(tmp_list, tmp_pol, tmp_band)
+
+ def keyGoAll(self):
+ if self.checkSettings() == False:
+ return
+
+ self.tmp_tplist=[]
+ tmp_list=[]
+ tmp_band=["low","high"]
+ tmp_pol=["horizontal","vertical"]
+ for slot in nimmanager.nim_slots:
+ if slot.isCompatible("DVB-S"):
+ for s in self.satList[slot.slot]:
+ tmp_list.append(s)
+
+ self.doRun(tmp_list, tmp_pol, tmp_band)
+
+ def doRun(self, tmp_list, tmp_pol, tmp_band):
+ self.full_data = ""
+ self.total_list=[]
+ for x in tmp_list:
+ for y in tmp_pol:
+ for z in tmp_band:
+ self.total_list.append([x,y,z])
+ print "add scan item : ", x, ", ", y, ", ", z
+
+ self.max_count = len(self.total_list)
+ self.is_runable = True
+ self.running_count = 0
+ self.clockTimer = eTimer()
+ self.clockTimer.callback.append(self.doClock)
+ self.clockTimer.start(1000)
+
+ def doClock(self):
+ is_scan = False
+ if self.is_runable :
+ if self.running_count >= self.max_count:
+ self.clockTimer.stop()
+ del self.clockTimer
+ self.clockTimer = None
+ print "Done"
+ return
+ orb = self.total_list[self.running_count][0]
+ pol = self.total_list[self.running_count][1]
+ band = self.total_list[self.running_count][2]
+ self.running_count = self.running_count + 1
+ print "running status-[%d] : [%d][%s][%s]" %(self.running_count, orb[0], pol, band)
+ if self.running_count == self.max_count:
+ is_scan = True
+ self.prepareScanData(orb, pol, band, is_scan)
+
+ def prepareScanData(self, orb, pol, band, is_scan):
+ self.is_runable = False
+ self.orb_position = orb[0]
+ self.feid = int(self.scan_nims.value)
+ tab_hilow = {"high" : 1, "low" : 0}
+ tab_pol = {
+ "horizontal" : eDVBFrontendParametersSatellite.Polarisation_Horizontal,
+ "vertical" : eDVBFrontendParametersSatellite.Polarisation_Vertical,
+ "circular left" : eDVBFrontendParametersSatellite.Polarisation_CircularLeft,
+ "circular right" : eDVBFrontendParametersSatellite.Polarisation_CircularRight
+ }
+
+ returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+
+ if not self.openFrontend():
+ self.oldref = self.session.nav.getCurrentlyPlayingServiceReference()
+ self.session.nav.stopService()
+ if not self.openFrontend():
+ if self.session.pipshown:
+ self.session.pipshown = False
+ del self.session.pip
+ if not self.openFrontend():
+ self.frontend = None
+ self.tuner = Tuner(self.frontend)
+
+ if tab_hilow[band]:
+ self.scan_sat.frequency.value = 12515
+ else:
+ self.scan_sat.frequency.value = 11015
+ returnvalue = (self.scan_sat.frequency.value,
+ 0,
+ tab_pol[pol],
+ 0,
+ 0,
+ orb[0],
+ eDVBFrontendParametersSatellite.System_DVB_S,
+ 0,
+ 0,
+ 0)
+ self.tuner.tune(returnvalue)
+
+ cmd = "vuplus_blindscan %d %d %d %d %d %d %d" % (self.blindscan_start_frequency.value/1000000, self.blindscan_stop_frequency.value/1000000, self.blindscan_start_symbol.value/1000000, self.blindscan_stop_symbol.value/1000000, tab_pol[pol], tab_hilow[band], self.feid)
+ print "prepared command : [%s]" % (cmd)
+ self.blindscan_container = eConsoleAppContainer()
+ self.blindscan_container.appClosed.append(self.blindscanContainerClose)
+ self.blindscan_container.dataAvail.append(self.blindscanContainerAvail)
+ self.blindscan_container.execute(cmd)
+
+ tmpstr = "Look for available transponders.\nThis works will take several minutes.\n\n - Current Status : %d/%d\n - Orbital Positions : %s\n - Polarization : %s\n - Bandwidth : %s" %(self.running_count, self.max_count, orb[1], pol, band)
+ if is_scan :
+ self.blindscan_session = self.session.openWithCallback(self.blindscanSessionClose, MessageBox, _(tmpstr), MessageBox.TYPE_INFO)
+ else:
+ self.blindscan_session = self.session.openWithCallback(self.blindscanSessionNone, MessageBox, _(tmpstr), MessageBox.TYPE_INFO)
+
+ def blindscanContainerClose(self, retval):
+ lines = self.full_data.split('\n')
+ for line in lines:
+ data = line.split()
+ print "cnt :", len(data), ", data :", data
+ if len(data) >= 10:
+ if data[0] == 'OK':
+ parm = eDVBFrontendParametersSatellite()
+ sys = { "DVB-S" : eDVBFrontendParametersSatellite.System_DVB_S,
+ "DVB-S2" : eDVBFrontendParametersSatellite.System_DVB_S2}
+ qam = { "QPSK" : parm.Modulation_QPSK,
+ "8PSK" : parm.Modulation_8PSK}
+ inv = { "INVERSION_OFF" : parm.Inversion_Off,
+ "INVERSION_ON" : parm.Inversion_On,
+ "INVERSION_AUTO" : parm.Inversion_Unknown}
+ fec = { "FEC_AUTO" : parm.FEC_Auto,
+ "FEC_1_2" : parm.FEC_1_2,
+ "FEC_2_3" : parm.FEC_2_3,
+ "FEC_3_4" : parm.FEC_3_4,
+ "FEC_5_6": parm.FEC_5_6,
+ "FEC_7_8" : parm.FEC_7_8,
+ "FEC_8_9" : parm.FEC_8_9,
+ "FEC_3_5" : parm.FEC_3_5,
+ "FEC_9_10" : parm.FEC_9_10,
+ "FEC_NONE" : parm.FEC_None}
+ roll ={ "ROLLOFF_20" : parm.RollOff_alpha_0_20,
+ "ROLLOFF_25" : parm.RollOff_alpha_0_25,
+ "ROLLOFF_35" : parm.RollOff_alpha_0_35}
+ pilot={ "PILOT_ON" : parm.Pilot_On,
+ "PILOT_OFF" : parm.Pilot_Off}
+ pol = { "HORIZONTAL" : parm.Polarisation_Horizontal,
+ "VERTICAL" : parm.Polarisation_Vertical}
+ parm.orbital_position = self.orb_position
+ parm.polarisation = pol[data[1]]
+ parm.frequency = int(data[2])
+ parm.symbol_rate = int(data[3])
+ parm.system = sys[data[4]]
+ parm.inversion = inv[data[5]]
+ parm.pilot = pilot[data[6]]
+ parm.fec = fec[data[7]]
+ parm.modulation = qam[data[8]]
+ parm.rolloff = roll[data[9]]
+ self.tmp_tplist.append(parm)
+ self.blindscan_session.close(True)
+
+ def blindscanContainerAvail(self, str):
+ self.full_data = self.full_data + str
+
+ def blindscanSessionNone(self, *val):
+ import time
+ self.blindscan_container.sendCtrlC()
+ self.blindscan_container = None
+ time.sleep(2)
+
+ if self.frontend:
+ self.frontend = None
+ del self.raw_channel
+
+ if val[0] == False:
+ self.tmp_tplist = []
+ self.running_count = self.max_count
+
+ self.is_runable = True
+
+ def blindscanSessionClose(self, *val):
+ self.blindscanSessionNone(val[0])
+
+ if self.tmp_tplist != None and self.tmp_tplist != []:
+ for p in self.tmp_tplist:
+ print "data : [%d][%d][%d][%d][%d][%d][%d][%d][%d][%d]" % (p.orbital_position, p.polarisation, p.frequency, p.symbol_rate, p.system, p.inversion, p.pilot, p.fec, p.modulation, p.modulation)
+
+ self.startScan(self.tmp_tplist, self.feid)
+ else:
+ msg = "No found transponders!!\nPlease check the satellite connection, or scan other search condition."
+ if val[0] == False:
+ msg = "Blindscan was canceled by the user."
+ self.session.openWithCallback(self.callbackNone, MessageBox, _(msg), MessageBox.TYPE_INFO, timeout=10)
+ self.tmp_tplist = []
+
+ def startScan(self, tlist, feid, networkid = 0):
+ self.scan_session = None
+ self.session.open(ServiceScan, [{"transponders": tlist, "feid": feid, "flags": 0, "networkid": networkid}])
+
+def main(session, **kwargs):
+ session.open(Blindscan)
+
+def Plugins(**kwargs):
+ return PluginDescriptor(name=_("Blindscan"), description="scan type(DVB-S)", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)
+
<default>
<prerequisites>
<hardware type="dm8000" />
+ <hardware type="dm500hd" />
<tag type="CI" />
<tag type="System" />
</prerequisites>
appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
elif state == 2:
appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
+ # ikseong
+ else :
+ appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
+ #
self.list.append( (appname, ConfigNothing(), 0, slot) )
else:
self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )
self.enableVKeyIcon()
self.showKeypad()
elif current == self.AnonCrashlogEntry:
- self["status"].setText(_("Adds enigma2 settings and dreambox model informations like SN, rev... if enabled."))
+ self["status"].setText(_("Adds enigma2 settings and STB model informations like SN, rev... if enabled."))
self.disableVKeyIcon()
elif current == self.NetworkEntry:
self["status"].setText(_("Adds network configuration if enabled."))
if crashlog.startswith("enigma2_crash_") and crashlog.endswith(".log"):
print "[CrashlogAutoSubmit] - found crashlog: ",os.path.basename(crashlog)
crashLogFilelist.append('/media/hdd/' + crashlog)
-
- if len(crashLogFilelist):
- if config.plugins.crashlogautosubmit.sendmail.value == "send":
- Notifications.AddNotificationWithCallback(handleAnswer, ChoiceBox, title=_("Crashlogs found!\nSend them to Dream Multimedia?"), list = list)
- elif config.plugins.crashlogautosubmit.sendmail.value == "send_always":
- send_mail()
- else:
- print "[CrashlogAutoSubmit] - no crashlogs found."
-
+# ikseong
+# if len(crashLogFilelist):
+# if config.plugins.crashlogautosubmit.sendmail.value == "send":
+# session.openWithCallback(handleAnswer, ChoiceBox, title=_("Crashlogs found!\nSend them to Dream Multimedia ?"), list = list)
+# elif config.plugins.crashlogautosubmit.sendmail.value == "send_always":
+# send_mail()
+# else:
+# print "[CrashlogAutoSubmit] - no crashlogs found."
+#
+ print "block to handle Crashlogs "
def getMailExchange(host):
print "[CrashlogAutoSubmit] - getMailExchange"
--- /dev/null
+installdir = $(pkglibdir)/python/Plugins/SystemPlugins/FPGAUpgrade
+
+SUBDIRS = meta
+
+install_PYTHON = \
+ __init__.py \
+ plugin.py \
+ fpga.py \
+ fpga.conf \
+ _fpga.so
--- /dev/null
+http://archive.vuplus.com/download/fpga/
--- /dev/null
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.39
+#
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
+# This file is compatible with both classic and new-style classes.
+
+from sys import version_info
+if version_info >= (2,6,0):
+ def swig_import_helper():
+ from os.path import dirname
+ import imp
+ fp = None
+ try:
+ fp, pathname, description = imp.find_module('_fpga', [dirname(__file__)])
+ except ImportError:
+ import _fpga
+ return _fpga
+ if fp is not None:
+ try:
+ _mod = imp.load_module('_fpga', fp, pathname, description)
+ finally:
+ fp.close()
+ return _mod
+ _fpga = swig_import_helper()
+ del swig_import_helper
+else:
+ import _fpga
+del version_info
+try:
+ _swig_property = property
+except NameError:
+ pass # Python < 2.2 doesn't have 'property'.
+def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+ if (name == "thisown"): return self.this.own(value)
+ if (name == "this"):
+ if type(value).__name__ == 'SwigPyObject':
+ self.__dict__[name] = value
+ return
+ method = class_type.__swig_setmethods__.get(name,None)
+ if method: return method(self,value)
+ if (not static) or hasattr(self,name):
+ self.__dict__[name] = value
+ else:
+ raise AttributeError("You cannot add attributes to %s" % self)
+
+def _swig_setattr(self,class_type,name,value):
+ return _swig_setattr_nondynamic(self,class_type,name,value,0)
+
+def _swig_getattr(self,class_type,name):
+ if (name == "thisown"): return self.this.own()
+ method = class_type.__swig_getmethods__.get(name,None)
+ if method: return method(self)
+ raise AttributeError(name)
+
+def _swig_repr(self):
+ try: strthis = "proxy of " + self.this.__repr__()
+ except: strthis = ""
+ return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
+
+try:
+ _object = object
+ _newclass = 1
+except AttributeError:
+ class _object : pass
+ _newclass = 0
+
+
+DP_NO_ACTION_FOUND = _fpga.DP_NO_ACTION_FOUND
+DP_DEVICE_INFO_ACTION_CODE = _fpga.DP_DEVICE_INFO_ACTION_CODE
+DP_READ_IDCODE_ACTION_CODE = _fpga.DP_READ_IDCODE_ACTION_CODE
+DP_ERASE_ACTION_CODE = _fpga.DP_ERASE_ACTION_CODE
+DP_PROGRAM_ACTION_CODE = _fpga.DP_PROGRAM_ACTION_CODE
+DP_VERIFY_ACTION_CODE = _fpga.DP_VERIFY_ACTION_CODE
+NO_SRC_FILE_PATH = _fpga.NO_SRC_FILE_PATH
+NO_TAR_DEVICE_PATH = _fpga.NO_TAR_DEVICE_PATH
+FAIL_OPEN_SRC_FILE = _fpga.FAIL_OPEN_SRC_FILE
+ZERO_SRC_FILE_SIZE = _fpga.ZERO_SRC_FILE_SIZE
+FAIL_OPEN_DEVICE = _fpga.FAIL_OPEN_DEVICE
+class Fpga(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, Fpga, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, Fpga, name)
+ __repr__ = _swig_repr
+ def __init__(self):
+ this = _fpga.new_Fpga()
+ try: self.this.append(this)
+ except: self.this = this
+ __swig_destroy__ = _fpga.delete_Fpga
+ __del__ = lambda self : None;
+ def get_interval(self): return _fpga.Fpga_get_interval(self)
+ def get_error_msg(self, *args): return _fpga.Fpga_get_error_msg(self, *args)
+ def fpga_upgrade(self, *args): return _fpga.Fpga_fpga_upgrade(self, *args)
+ def get_status(self): return _fpga.Fpga_get_status(self)
+Fpga_swigregister = _fpga.Fpga_swigregister
+Fpga_swigregister(Fpga)
+
+
+
--- /dev/null
+installdir = $(datadir)/meta
+
+dist_install_DATA = plugin_fpgaupgrade.xml
--- /dev/null
+<default>
+ <prerequisites>
+ <tag type="System" />
+ </prerequisites>
+ <info>
+ <author>oskwon</author>
+ <name>FPGAUpgrade</name>
+ <packagename>enigma2-plugin-systemplugins-fpgaupgrade</packagename>
+ <shortdescription>Upgrade your system FPGA</shortdescription>
+ <description>Upgrade your internal system FPGA.</description>
+ </info>
+
+ <files type="package"> <!-- without version, without .ipk -->
+ <file type="package" name="enigma2-plugin-systemplugins-fpgaupgrade" />
+ </files>
+</default>
--- /dev/null
+import os
+
+import fpga
+from enigma import eTimer
+
+from urllib import urlretrieve
+import urllib
+
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+
+from Plugins.Plugin import PluginDescriptor
+
+from Tools.Directories import fileExists
+
+from Components.Label import Label
+from Components.Slider import Slider
+from Components.Pixmap import Pixmap
+from Components.FileList import FileList
+from Components.ActionMap import ActionMap
+from Components.PluginComponent import plugins
+from Components.Sources.StaticText import StaticText
+
+class UpgradeStatus(Screen):
+ skin = """
+ <screen position="center,center" size="450,100" title="FPGA Upgrade">
+ <widget name="name" position="10,0" size="430,20" font="Regular;18" halign="left" valign="bottom"/>
+ <widget name="slider" position="10,25" size="430,30" backgroundColor="white"/>
+ <widget name="status" position="10,25" zPosition="1" size="430,30" font="Regular;18" halign="center" valign="center" foregroundColor="black" backgroundColor="black" transparent="1"/>
+ <widget source="info" render="Label" position="10,70" zPosition="1" size="430,30" font="Regular;22" halign="center" valign="center" backgroundColor="#a08500" transparent="1"/>
+ </screen>
+ """
+ def __init__(self, session, parent, timeout = 10):
+ Screen.__init__(self,session)
+ self.session = session
+
+ self["actions"] = ActionMap(["OkCancelActions"],
+ {
+ "ok": self.keyExit,
+ }, -1)
+
+ self.is_done = 0
+ self.exit_count = 0
+ self.timeout = timeout
+ self.title_str = "FPGA Upgrade"
+
+ #self["name"] = Label(_("Upgrade status"))
+ self["name"] = Label(_(" "))
+ self["info"] = StaticText(_("Can't cancel during upgrade!!"))
+
+ self["status"] = Label(_("Status : 0%"))
+ self.status_bar = self["status"]
+
+ self.slider = Slider(0, 100)
+ self["slider"] = self.slider
+
+ self.parent = parent
+ self.timer_check_progress = eTimer()
+ self.timer_check_progress.callback.append(self.callbackDoCheckProgress)
+ interval = self.parent.FPGA.get_interval()
+ self.timer_check_progress.start(interval)
+
+ def callbackDoCheckProgress(self):
+ self.status = self.parent.FPGA.get_status()
+
+ if self.status > 0:
+ self.slider.setValue(self.status)
+
+ if self.status == 100:
+ #print "fpga-upgrade done!!"
+ self.status_bar.setText(_("Success. Press OK to exit."))
+ #self.status_bar.setText(_("%d / 100" % (self.status)))
+ self.timer_check_progress.stop()
+ self.is_done = 1
+
+ self.timer_exit = eTimer()
+ self.timer_exit.callback.append(self.callbackExit)
+ self.timer_exit.start(1000)
+ elif self.status == -1 or self.status == -2:
+ #print "fpga-upgrade error >> errno : [%d]" % (self.status)
+ self.status_bar.setText(_("Error[%d]. Press Cancel to exit." % (self.status)))
+ self.timer_check_progress.stop()
+ self.is_done = 1
+ else:
+ #print "fpga-upgrade status : %d" % self.status
+ self.status_bar.setText(_("%d / 100" % (self.status)))
+
+ def callbackExit(self):
+ if self.exit_count == self.timeout:
+ self.timer_exit.stop()
+ self.keyExit()
+ self.exit_count = self.exit_count + 1
+ self.instance.setTitle("%s (%d)" % (self.title_str, (self.timeout-self.exit_count)))
+
+ def keyExit(self):
+ if self.is_done :
+ self.close()
+
+class FPGAUpgrade(Screen):
+ skin = """
+ <screen position="center,center" size="560,440" title="FPGA Upgrade" >
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="0,7" size="140,40" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/green.png" position="140,7" size="140,40" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/yellow.png" position="280,7" size="140,40" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/blue.png" position="420,7" size="140,40" alphatest="blend" />
+
+ <widget source="key_red" render="Label" position="20,0" zPosition="1" size="115,40" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget source="key_green" render="Label" position="160,0" zPosition="1" size="115,40" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget source="key_yellow" render="Label" position="300,0" zPosition="1" size="115,40" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget source="key_blue" render="Label" position="440,0" zPosition="1" size="115,40" font="Regular;20" halign="center" valign="center" transparent="1" />
+
+ <widget source="status" render="Label" position="15,45" zPosition="1" size="540,40" font="Regular;18" halign="left" valign="center" backgroundColor="#a08500" transparent="1" />
+ <widget name="file_list" position="0,100" size="555,325" scrollbarMode="showOnDemand" />
+ </screen>
+ """
+
+ def __init__(self, session):
+ Screen.__init__(self, session)
+ self.session = session
+
+ self["key_red"] = StaticText(_("Close"))
+ self["key_green"] = StaticText(_("Ugrade"))
+ self["key_yellow"] = StaticText(_(" "))
+ self["key_blue"] = StaticText(_("Download"))
+ #self["key_blue"] = StaticText(_(" "))
+ self["status"] = StaticText(_(" "))
+ self["file_list"] = FileList("/", matchingPattern = "^.*")
+
+ self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", ],
+ {
+ "red": self.onClickRed,
+ "green": self.onClickGreen,
+ "blue": self.onClickBlue,
+ "back": self.onClickRed,
+ "ok": self.onClickOk,
+ "up": self.onClickUp,
+ "down": self.onClickDown,
+ "left": self.onClickLeft,
+ "right": self.onClickRight,
+ }, -1)
+ self.onLayoutFinish.append(self.doLayoutFinish)
+
+ self.ERROR_MSG = ''
+ self.ERROR_CODE = 0
+ self.SOURCELIST = self["file_list"]
+ self.STATUS_BAR = self["status"]
+ self.STATUS_BAR.setText(_(self.SOURCELIST.getCurrentDirectory()))
+
+ self.DEVICE_LIST = '/dev/fpga_dp;/dev/misc/dp;'
+ self.DOWNLOAD_TAR_PATH = '/tmp/'
+ self.DOWNLOAD_FILE_NAME = 'TS_PRO.dat'
+ self.DOWNLOAD_URL = ''
+ self.doLoadConf()
+ self.FPGA = fpga.Fpga()
+ print self.DEVICE_LIST
+ print self.DOWNLOAD_TAR_PATH
+ print self.DOWNLOAD_FILE_NAME
+ print self.DOWNLOAD_URL
+
+ def doLayoutFinish(self):
+ return
+
+ def doExit(self):
+ if fileExists(self.DOWNLOAD_TAR_PATH + self.DOWNLOAD_FILE_NAME):
+ os.remove(self.DOWNLOAD_TAR_PATH + self.DOWNLOAD_FILE_NAME)
+ self.close()
+
+ def doLoadConf(self):
+ if fileExists("/proc/stb/info/vumodel"):
+ model = open("/proc/stb/info/vumodel").read().strip()
+ download_uri_header = open('/usr/lib/enigma2/python/Plugins/SystemPlugins/FPGAUpgrade/fpga.conf').readline().strip()
+ self.DOWNLOAD_URL = str(download_uri_header) + "vu" + str(model) + "/" + self.DOWNLOAD_FILE_NAME
+
+ def doHook(self, blockNumber, blockSize, totalSize) :
+ if blockNumber*blockSize > totalSize :
+ self.STATUS_BAR.setText(_("Downloaded " + self.DOWNLOAD_TAR_PATH + self.DOWNLOAD_FILE_NAME))
+ else :
+ self.STATUS_BAR.setText(_("Downloading..."))
+
+ def onCallbackHandler(self, confirmed):
+ if confirmed:
+ self.doExit()
+
+ def doUpgradeHandler(self, confirmed):
+ if confirmed == False:
+ return
+
+ path = ''
+ try:
+ path = self.SOURCELIST.getCurrentDirectory() + self.SOURCELIST.getFilename()
+ except:
+ #self.session.open(MessageBox, _("Can't select directory."), MessageBox.TYPE_INFO, timeout = 5)
+ return
+
+ device = ""
+ device_list = self.DEVICE_LIST.split(";")
+
+ for d in device_list:
+ if os.path.exists(d):
+ device = d
+ break
+
+ if device == None or len(device) == 0:
+ message = "Fail to upgrade.\nCause : Can't found device.\nDo you want to exit?"
+ self.session.openWithCallback(self.onCallbackHandler, MessageBox, _(message), MessageBox.TYPE_YESNO, timeout = 10, default = True)
+ print "DEVICE_LIST : ", device_list
+
+ print "DEVICE : ", device
+ self.ERROR_CODE = self.FPGA.fpga_upgrade(path, device)
+ if self.ERROR_CODE > 0:
+ self.ERROR_MSG = self.FPGA.get_error_msg(self.ERROR_CODE, self.ERROR_MSG)
+ message = "Fail to upgrade.\nCause : " + self.ERROR_MSG + "\nDo you want to exit?"
+ self.session.openWithCallback(self.onCallbackHandler, MessageBox, _(message), MessageBox.TYPE_YESNO, timeout = 10, default = True)
+ print "DEVICE : ", device
+ print "FILE : ", path
+ else:
+ #self.session.open(MessageBox, _("Success!!"), MessageBox.TYPE_INFO, timeout = 5)
+ self.session.open(UpgradeStatus, self, timeout = 10)
+
+ def onClickRed(self):
+ self.doExit()
+
+ # run upgrade!!
+ def onClickGreen(self):
+ #self.session.open(MessageBox, _("Upgrade will take about 5 minutes to finish."), MessageBox.TYPE_INFO, timeout = 10)
+ message = "Upgrade will take about 5 minutes to finish.\nDo you want to upgrade?"
+ self.session.openWithCallback(self.doUpgradeHandler, MessageBox, _(message), MessageBox.TYPE_YESNO, timeout = 10, default = True)
+
+ def onClickBlue(self):
+ fname = ''
+ header = ''
+ test_opener = urllib.URLopener()
+ try:
+ test_opener.open(self.DOWNLOAD_URL)
+ except:
+ self.session.open(MessageBox, _('File not found'), MessageBox.TYPE_INFO, timeout = 5)
+ del test_opener
+ return
+ try :
+ fname, header = urlretrieve(self.DOWNLOAD_URL, self.DOWNLOAD_TAR_PATH + self.DOWNLOAD_FILE_NAME, self.doHook)
+ except IOError, msg:
+ self.session.open(MessageBox, _(str(msg)), MessageBox.TYPE_INFO, timeout = 5)
+ del test_opener
+ return
+ del test_opener
+
+ before_name = ''
+ self.SOURCELIST.changeDir(self.DOWNLOAD_TAR_PATH)
+ self.SOURCELIST.moveToIndex(0)
+ while cmp(self.SOURCELIST.getFilename(), self.DOWNLOAD_FILE_NAME) != 0 :
+ self.SOURCELIST.down()
+ if cmp(before_name, self.SOURCELIST.getFilename()) == 0:
+ break
+ before_name = self.SOURCELIST.getFilename()
+
+ def onClickOk(self):
+ if self.SOURCELIST.canDescent() : # isDir
+ self.SOURCELIST.descent()
+ if self.SOURCELIST.getCurrentDirectory():
+ self.STATUS_BAR.setText(_(self.SOURCELIST.getCurrentDirectory()))
+ else:
+ self.onClickGreen()
+
+ def onClickUp(self):
+ self.SOURCELIST.up()
+ self.STATUS_BAR.setText(_(self.SOURCELIST.getCurrentDirectory()))
+
+ def onClickDown(self):
+ self.SOURCELIST.down()
+ self.STATUS_BAR.setText(_(self.SOURCELIST.getCurrentDirectory()))
+
+ def onClickLeft(self):
+ self.SOURCELIST.pageUp()
+ self.STATUS_BAR.setText(_(self.SOURCELIST.getCurrentDirectory()))
+
+ def onClickRight(self):
+ self.SOURCELIST.pageDown()
+ self.STATUS_BAR.setText(_(self.SOURCELIST.getCurrentDirectory()))
+
+def main(session, **kwargs):
+ session.open(FPGAUpgrade)
+
+def Plugins(**kwargs):
+ return PluginDescriptor(name=_("FPGA Upgrade"), description="Upgrade FPGA..", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)
+
--- /dev/null
+installdir = $(pkglibdir)/python/Plugins/SystemPlugins/FactoryTest
+
+install_PYTHON = \
+ __init__.py \
+ plugin.py \
+ testdb
--- /dev/null
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+from Plugins.Plugin import PluginDescriptor
+from Components.MenuList import MenuList
+from Tools.Directories import fileExists
+from Components.ServiceList import ServiceList
+from Components.ActionMap import ActionMap,NumberActionMap
+from Components.config import config
+from os import system,access,F_OK,R_OK,W_OK
+from Components.Label import Label
+from Components.AVSwitch import AVSwitch
+from time import sleep
+from Components.Console import Console
+from enigma import eTimer
+from Components.HTMLComponent import HTMLComponent
+from Components.GUIComponent import GUIComponent
+from enigma import eListboxPythonStringContent, eListbox, gFont, eServiceCenter, eDVBResourceManager
+from enigma import eServiceReference
+from enigma import eMemtest
+from enigma import eSctest
+from enigma import eDVBDB
+from Components.NimManager import nimmanager
+from enigma import eDVBCI_UI,eDVBCIInterfaces
+from Tools.Directories import resolveFilename, SCOPE_SYSETC
+
+class TestResultList(HTMLComponent, GUIComponent):
+ def __init__(self, list, enableWrapAround=False, content=eListboxPythonStringContent):
+ GUIComponent.__init__(self)
+ self.list = list
+ self.l = content()
+ self.l.setList(self.list)
+ self.onSelectionChanged = [ ]
+ self.enableWrapAround = enableWrapAround
+
+ def getCurrent(self):
+ return self.l.getCurrentSelection()
+
+ GUI_WIDGET = eListbox
+
+ def postWidgetCreate(self, instance):
+ self.instance.setSelectionEnable(0)
+ instance.setContent(self.l)
+ instance.selectionChanged.get().append(self.selectionChanged)
+ if self.enableWrapAround:
+ self.instance.setWrapAround(True)
+
+ def preWidgetRemove(self, instance):
+ instance.setContent(None)
+ instance.selectionChanged.get().remove(self.selectionChanged)
+
+ def selectionChanged(self):
+ for f in self.onSelectionChanged:
+ f()
+
+ def getSelectionIndex(self):
+ return self.l.getCurrentSelectionIndex()
+
+ def getSelectedIndex(self):
+ return self.l.getCurrentSelectionIndex()
+
+ def setList(self, list):
+ self.list = list
+ self.l.setList(self.list)
+
+ def updateList(self, list):
+ self.list = list
+ self.l.setList(self.list)
+
+ def moveToIndex(self, idx):
+ if self.instance is not None:
+ self.instance.moveSelectionTo(idx)
+
+ def pageUp(self):
+ if self.instance is not None:
+ self.instance.moveSelection(self.instance.pageUp)
+
+ def pageDown(self):
+ if self.instance is not None:
+ self.instance.moveSelection(self.instance.pageDown)
+
+ def up(self):
+ if self.instance is not None:
+ self.instance.moveSelection(self.instance.moveUp)
+
+ def down(self):
+ if self.instance is not None:
+ self.instance.moveSelection(self.instance.moveDown)
+
+ def selectionEnabled(self, enabled):
+ if self.instance is not None:
+ self.instance.setSelectionEnable(enabled)
+
+class FactoryTest(Screen):
+ skin = """
+ <screen position="120,125" size="440,400" title="Test Menu" >
+ <widget name="testlist" position="10,0" size="340,350" />
+ <widget name="resultlist" position="370,0" size="60,350" />
+ <widget name="testdate" position="20,350" size="150,25" font="Regular;22" />
+ <widget name="testversion" position="20,375" size="150,25" font="Regular;22" />
+ <widget name="mactext" position="180,350" size="230,25" font="Regular;22" />
+ </screen>"""
+ def __init__(self, session):
+
+ self["actions"] = NumberActionMap(["OkCancelActions","WizardActions","NumberActions","ColorActions",],
+ {
+ "left": self.nothing,
+ "right":self.nothing,
+ "ok": self.TestAction,
+ "testexit": self.keyCancel,
+ "agingstart": self.Agingmode,
+ "up": self.keyup,
+ "down": self.keydown,
+ "0": self.numberaction,
+ "1": self.numberaction,
+ "2": self.numberaction,
+ "3": self.numberaction,
+ "4": self.numberaction,
+ "5": self.numberaction,
+ "6": self.numberaction,
+ "7": self.numberaction,
+ "8": self.numberaction,
+ "9": self.numberaction,
+ "red": self.shutdownaction,
+ }, -2)
+
+ Screen.__init__(self, session)
+ TESTPROGRAM_DATE = self.getImageVersion() +" (v1.00)"
+ TESTPROGRAM_VERSION = "Version 01.10"
+
+ self.model = 0
+ self.getModelInfo()
+
+ self["testdate"]=Label((TESTPROGRAM_DATE))
+ self["testversion"]=Label(("Loading version..."))
+ self["mactext"]=Label(("Loading mac address..."))
+ if self.model == 0 or self.model == 1:
+ nimConfig = nimmanager.getNimConfig(0)
+ nimConfig.configMode.slot_id=0
+ nimConfig.configMode.value= "simple"
+ nimConfig.diseqcMode.value="diseqc_a_b"
+ nimConfig.diseqcA.value="160"
+ nimConfig.diseqcB.value="100"
+ if self.model == 0:
+ nimConfig = nimmanager.getNimConfig(1)
+ nimConfig.configMode.slot_id=1
+ nimConfig.configMode.value= "simple"
+ nimConfig.diseqcMode.value="diseqc_a_b"
+ nimConfig.diseqcA.value="130"
+ nimConfig.diseqcB.value="192"
+ if self.model == 2:
+ pass
+ if self.model == 3 or self.model == 4:
+ self.NimType = {}
+ sat_list = ["160","100","130","192","620","642"]
+ try:
+ nimfile = open("/proc/bus/nim_sockets")
+ except IOError:
+ nimfile = None
+ if nimfile is None:
+ self.session.openWithCallback(self.close, MessageBox, _("File not Found!\n/proc/bus/nim_sockets"), MessageBox.TYPE_ERROR)
+ for line in nimfile.readlines():
+ print line
+ if line == "":
+ break
+ if line.strip().startswith("NIM Socket"):
+ parts = line.strip().split(" ")
+ current_slot = int(parts[2][:-1])
+ self.NimType[current_slot]={}
+ self.NimType[current_slot]["slot"] = current_slot
+ elif line.strip().startswith("Type:"):
+ print str(line.strip())
+ self.NimType[current_slot]["type"] = str(line.strip()[6:])
+ if self.NimType[current_slot]["type"].startswith("DVB-S"):
+ self.NimType[current_slot]["sat1"] = sat_list.pop(0)
+ self.NimType[current_slot]["sat2"] = sat_list.pop(0)
+ else:
+ self.NimType[current_slot]["sat1"] = None
+ self.NimType[current_slot]["sat2"] = None
+ elif line.strip().startswith("empty"):
+ self.NimType.pop(current_slot)
+ nimfile.close()
+ if True:
+ for (key, val) in self.NimType.items():
+ print key
+ print val
+ if val["type"].startswith("DVB-S"):
+ print "nimConfig (dvb-s): ",key
+ nimConfig = nimmanager.getNimConfig(key)
+ nimConfig.configMode.slot_id=key
+ nimConfig.configMode.value= "simple"
+ nimConfig.diseqcMode.value="diseqc_a_b"
+ nimConfig.diseqcA.value = val["sat1"]
+ nimConfig.diseqcB.value = val["sat2"]
+ else :
+ nimConfig = nimmanager.getNimConfig(key)
+ print "configMode check : ",nimConfig.configMode.value
+
+ nimmanager.sec.update()
+
+ system("cp /usr/lib/enigma2/python/Plugins/SystemPlugins/FactoryTest/testdb /etc/enigma2/lamedb")
+ db = eDVBDB.getInstance()
+ db.reloadServicelist()
+ self.createConfig()
+
+ self.rlist = []
+ for x in range(self.menulength):
+ self.rlist.append((".."))
+ self["resultlist"] = TestResultList(self.rlist)
+
+ self.avswitch = AVSwitch()
+ self.scTest= eSctest()
+
+ self.testing = 0
+
+ self.servicelist = ServiceList()
+ self.oldref = session.nav.getCurrentlyPlayingServiceReference()
+ print "oldref",self.oldref
+ session.nav.stopService() # try to disable foreground service
+
+ self.tunemsgtimer = eTimer()
+ self.tunemsgtimer.callback.append(self.tunemsg)
+
+ self.camstep = 1
+ self.camtimer = eTimer()
+ self.camtimer.callback.append(self.cam_state)
+ self.mactry = 1
+ self.getmacaddr()
+ self.getversion()
+
+ self.tunerlock = 0
+ self.tuningtimer = eTimer()
+ self.tuningtimer.callback.append(self.updateStatus)
+
+ self.satatry = 8
+ self.satatimer = eTimer()
+ self.satatimer.callback.append(self.sataCheck)
+
+ self.usbtimer = eTimer()
+ self.usbtimer.callback.append(self.usbCheck)
+
+ self.agingtimer = eTimer()
+ self.agingtimer.callback.append(self.agingCheck)
+ self.setSourceVar()
+
+ def createConfig(self):
+ tlist = []
+ self.satetestIndex = -1
+ self.scarttestIndex = -1
+ if self.model == 0:
+ self.satetestIndex=0
+ tlist.append((" 0. Sata & extend hdd test",self.satetestIndex))
+ self.usbtestIndex=1
+ tlist.append((" 1. USB test",self.usbtestIndex))
+ self.fronttestIndex=2
+ tlist.append((" 2. Front test",self.fronttestIndex))
+ self.smarttestIndex=3
+ tlist.append((" 3. Smartcard test",self.smarttestIndex))
+ self.tuner1_1testIndex=4
+ tlist.append((" 4. T1/H/22K x /4:3/CVBS",self.tuner1_1testIndex))
+ self.tuner1_2testIndex=5
+ tlist.append((" 5. T1/V/22k o/16:9/RGB",self.tuner1_2testIndex))
+ self.tuner2_1testIndex=6
+ tlist.append((" 6. T2/H/22k x/4:3/YC",self.tuner2_1testIndex))
+ self.tuner2_2testIndex=7
+ tlist.append((" 7. T2/V/22k o/16:9/CVBS/CAM",self.tuner2_2testIndex))
+ self.scarttestIndex=8
+ tlist.append((" 8. VCR Scart loop",self.scarttestIndex))
+ self.rs232testIndex=9
+ tlist.append((" 9. RS232 test",self.rs232testIndex))
+ self.ethernettestIndex=10
+ tlist.append(("10. Ethernet & mac test",self.ethernettestIndex))
+ self.fdefaultIndex=11
+ tlist.append(("11. Factory default",self.fdefaultIndex))
+ self.shutdownIndex=12
+ tlist.append(("12. Shutdown(Deep Standby)",self.shutdownIndex))
+ self.tuner_test_first_index = 4
+ self.tuner_test_last_index = 7
+
+ elif self.model == 1:
+ self.usbtestIndex=0
+ tlist.append((" 0. USB test",self.usbtestIndex))
+ self.fronttestIndex=1
+ tlist.append((" 1. Front test",self.fronttestIndex))
+ self.smarttestIndex=2
+ tlist.append((" 2. Smartcard test",self.smarttestIndex))
+ self.tuner1_1testIndex=3
+ tlist.append((" 3. T1/H/22K x/4:3/CVBS",self.tuner1_1testIndex))
+ self.tuner2_2testIndex = self.tuner1_2testIndex=4
+ tlist.append((" 4. T1/V/22k o/16:9/RGB/CAM",self.tuner1_2testIndex))
+ self.rs232testIndex=5
+ tlist.append((" 5. RS232 test",self.rs232testIndex))
+ self.ethernettestIndex=6
+ tlist.append((" 6. Ethernet & mac test",self.ethernettestIndex))
+ self.fdefaultIndex=7
+ tlist.append((" 7. Factory default",self.fdefaultIndex))
+ self.shutdownIndex=8
+ tlist.append((" 8. Shutdown(Deep Standby)",self.shutdownIndex))
+ self.tuner_test_first_index = 3
+ self.tuner_test_last_index = 4
+
+ elif self.model == 2:
+ self.satetestIndex=0
+ tlist.append((" 0. Sata & extend hdd test",self.satetestIndex))
+ self.usbtestIndex=1
+ tlist.append((" 1. USB test",self.usbtestIndex))
+ self.fronttestIndex=2
+ tlist.append((" 2. Front test",self.fronttestIndex))
+ self.smarttestIndex=3
+ tlist.append((" 3. Smartcard test",self.smarttestIndex))
+ self.tuner1_1testIndex=4
+ tlist.append((" 4. T1 H 22K x 4:3 CVBS",self.tuner1_1testIndex))
+ self.tuner1_2testIndex=5
+ tlist.append((" 5. T1 V 22k o 16:9 RGB",self.tuner1_2testIndex))
+ self.tuner2_1testIndex = -1
+ self.tuner2_2testIndex=6
+ tlist.append((" 6. T2 DVB-C 4:3 YC CAM",self.tuner2_2testIndex))
+ self.rs232testIndex=7
+ tlist.append((" 7. RS232 test",self.rs232testIndex))
+ self.ethernettestIndex=8
+ tlist.append(("8. Ethernet & mac test",self.ethernettestIndex))
+ self.fdefaultIndex=9
+ tlist.append(("9. Factory default",self.fdefaultIndex))
+ self.shutdownIndex=10
+ tlist.append(("10. Shutdown",self.shutdownIndex))
+ self.tuner_test_first_index = 4
+ self.tuner_test_last_index = 6
+
+ elif self.model == 3 or self.model == 4:
+ self.satetestIndex=0
+ tlist.append((" 0. Sata & extend hdd test",self.satetestIndex))
+ self.usbtestIndex=1
+ tlist.append((" 1. USB test",self.usbtestIndex))
+ self.fronttestIndex=2
+ tlist.append((" 2. Front test",self.fronttestIndex))
+ self.smarttestIndex=3
+ tlist.append((" 3. Smartcard test",self.smarttestIndex))
+ self.tuner_test_first_index = current_index = 4
+ AspectRatio=["4:3", "16:9"]
+ ColorFormat=["CVBS","RGB","YC","CVBS","CVBS","CVBS","CVBS","CVBS"]
+ self.tuneInfo={}
+ for (key, val) in self.NimType.items():
+ if val["type"].startswith("DVB-S"):
+# Chang : DVB -S setting diseqc A
+ getRatio = AspectRatio.pop(0) # ratio
+ AspectRatio.append(getRatio)
+ getColorFormat=ColorFormat.pop(0) # colorFormat
+ menuname=" %d. T%d/%s/H/22k x/%s/%s" % (current_index, key+1, val["type"], getRatio, getColorFormat) #menuname
+ print current_index
+# current_index=4
+ self.setTuneInfo(index=current_index, slot=key, type=val["type"], sat=val["sat1"], pol="H", tone=False, ratio=getRatio, color=getColorFormat, cam=False) # setTuneInfo
+# self.setTuneInfo(current_index, key, val["type"], val["sat1"], "H", True, getRatio, getColorFormat, False) # setTuneInfo
+ tlist.append((menuname,current_index))
+ current_index+=1
+# Chang : DVB -S setting diseqc B
+ getRatio = AspectRatio.pop(0)
+ AspectRatio.append(getRatio)
+ getColorFormat=ColorFormat.pop(0)
+ menuname=" %d. T%d/%s/V/22k o/%s/%s" % (current_index, key+1, val["type"], getRatio, getColorFormat)
+ if len(self.NimType) == key+1: # CAM test on/off
+ menuname+="/CAM"
+ camtest = True
+ else:
+ camtest = False
+ self.setTuneInfo( index=current_index, slot=key, type=val["type"], sat=val["sat2"], pol="V", tone=True, ratio=getRatio, color=getColorFormat, cam=camtest)
+ tlist.append((menuname,current_index))
+ current_index+=1
+# Chang : DVB -T or DVB-C
+ elif val["type"].startswith("DVB-T") or val["type"].startswith("DVB-C"):
+ additionalMenu = None
+ menulen = 1
+ if len(self.NimType) == 1:
+ additionalMenu = True
+ menulen +=1
+ for x in range(menulen):
+ getRatio = AspectRatio.pop(0)
+ AspectRatio.append(getRatio)
+ getColorFormat=ColorFormat.pop(0)
+ menuname=" %d. T%d/%s/%s/%s" % (current_index, key+1, val["type"], getRatio, getColorFormat)
+ if len(self.NimType) == key+1 and (additionalMenu is None or x != 0): # CAM test on/off
+ menuname+=" CAM"
+ camtest = True
+ else:
+ camtest = False
+ self.setTuneInfo( index=current_index, slot=key, type=val["type"], sat=None, pol=None, tone=None, ratio=getRatio, color=getColorFormat, cam=camtest)
+ tlist.append((menuname,current_index))
+ current_index+=1
+ self.tuner_test_last_index = current_index-1
+ self.rs232testIndex=current_index
+ tlist.append((" %d. RS232 test" % current_index,self.rs232testIndex))
+ current_index+=1
+ self.ethernettestIndex=current_index
+ tlist.append((" %d. Ethernet & mac test" % current_index,self.ethernettestIndex))
+ current_index+=1
+ self.fdefaultIndex=current_index
+ tlist.append((" %d. Factory default" % current_index,self.fdefaultIndex))
+ current_index+=1
+ self.shutdownIndex=current_index
+ tlist.append((" %d. Shutdown(Deep Standby)" % current_index,self.shutdownIndex))
+
+ self.menulength= len(tlist)
+ self["testlist"] = MenuList(tlist)
+
+ def setTuneInfo(self,index=0,slot=0,type="DVB-S2",sat="160",pol="H",tone=True,ratio="4:3",color="CVBS",cam=False):
+ self.tuneInfo[index]={}
+ self.tuneInfo[index]["slot"]=slot
+ self.tuneInfo[index]["type"]=type
+ self.tuneInfo[index]["sat"]=sat
+ self.tuneInfo[index]["pol"]=pol
+ self.tuneInfo[index]["22k"]=tone
+ self.tuneInfo[index]["ratio"]=ratio
+ self.tuneInfo[index]["color"]=color
+ self.tuneInfo[index]["cam"]=cam
+
+ def getModelInfo(self):
+ getmodel = 0
+ if fileExists("/proc/stb/info/vumodel"):
+ info = open("/proc/stb/info/vumodel").read().strip()
+ if info == "duo":
+ self.model = 0
+ getmodel = 1
+ print "getModelInfo : duo"
+ if info == "solo":
+ self.model = 1
+ getmodel = 1
+ print "getModelInfo : solo"
+ if info == "combo":
+ self.model = 2
+ getmodel = 1
+ print "getModelInfo : combo"
+ if info == "uno":
+ self.model = 3
+ getmodel = 1
+ print "getModelInfo : uno"
+ if info == "ultimo":
+ self.model = 4
+ getmodel = 1
+ print "getModelInfo : ultimo"
+ if getmodel == 0 and fileExists("/proc/stb/info/version"):
+ info = open("/proc/stb/info/version").read()
+ if info[:2] == "14":
+ self.model = 1
+ print "getModelInfo : solo_"
+ elif info[:2] == "12":
+ self.model = 0
+ print "getModelInfo : duo_"
+
+ def nothing(self):
+ print "nothing"
+
+ def keyup(self):
+ print "self.menulength = ",self.menulength
+ print "self[\"testlist\"].getCurrent()[1] = ",self["testlist"].getCurrent()[1]
+ if self.testing==1:
+ return
+ if self["testlist"].getCurrent()[1]==0:
+ self["testlist"].moveToIndex(self.menulength-1)
+ self["resultlist"].moveToIndex(self.menulength-1)
+ else:
+ self["testlist"].up()
+ self["resultlist"].up()
+
+
+ def keydown(self):
+ print "self.menulength = ",self.menulength
+ print "self[\"testlist\"].getCurrent()[1] = ",self["testlist"].getCurrent()[1]
+ if self.testing==1:
+ return
+ if self["testlist"].getCurrent()[1]==(self.menulength-1):
+ self["testlist"].moveToIndex(0)
+ self["resultlist"].moveToIndex(0)
+ else:
+ self["testlist"].down()
+ self["resultlist"].down()
+
+ def numberaction(self, number):
+ if self.testing==1:
+ return
+ if number >= self.menulength:
+ return
+ index = int(number)
+ self["testlist"].moveToIndex(index)
+ self["resultlist"].moveToIndex(index)
+
+ def getImageVersion(self):
+ date = 'xxxx-xx-xx'
+ file = open(resolveFilename(SCOPE_SYSETC, 'image-version'), 'r')
+ lines = file.readlines()
+ for x in lines:
+ splitted = x.split('=')
+ if splitted[0] == "version":
+ # YYYY MM DD hh mm
+ #0120 2005 11 29 01 16
+ #0123 4567 89 01 23 45
+ version = splitted[1]
+ year = version[4:8]
+ month = version[8:10]
+ day = version[10:12]
+ date = '-'.join((year, month, day))
+ break;
+ return date
+
+ def getversion(self):
+ try:
+ fd = open("/proc/stb/info/version","r")
+ version = fd.read()
+ self["testversion"].setText(("Version %s"%version))
+ except:
+ self["testversion"].setText(("Version no load"))
+
+
+ def getmacaddr(self):
+ try:
+ if self.model == 2 or self.model == 3 or self.model == 4:
+ cmd = "nanddump -s 0x" + str((self.mactry-1)*2) + "0000 -b -o -l 64 -p /dev/mtd5"
+ elif self.model == 0 or self.model == 1:
+ cmd = "nanddump -s 0x" + str((self.mactry-1)*2) + "0000 -b -o -l 64 -p /dev/mtd4"
+ self.macConsole = Console()
+ self.macConsole.ePopen(cmd, self.readmac,self.checkReadmac)
+ except:
+ return
+
+ def readmac(self, result, retval,extra_args=None):
+ (callback) = extra_args
+ if self.macConsole is not None:
+ if retval == 0:
+ self.macConsole = None
+ macline = None
+ content =result.splitlines()
+ for x in content:
+ if x.startswith('0x000'+str((self.mactry-1)*2)+'0010:'):
+ macline = x.split()
+ if macline == None:
+ callback(0)
+ elif len(macline) < 10:
+ callback(1)
+ else:
+ mac = macline[5]+":"+macline[6]+":"+macline[7]+":"+macline[8]+":"+macline[9]+":"+macline[10]
+ self["mactext"].setText(("MAC : "+mac))
+ callback(2)
+
+ def checkReadmac(self,data):
+ if data == 0:
+ print "block %d is bad block" % self.mactry
+ self.mactry = self.mactry + 1
+ if self.mactry > 4:
+ self.session.open(MessageBox, _("FLASH IS BROKEN"), type = MessageBox.TYPE_INFO, enable_input = False)
+ return
+ else:
+ self.getmacaddr()
+ elif data == 1:
+ print 'mac dump read error'
+ return
+ elif data == 2:
+ print 'mac address read ok'
+ return
+
+ def TestAction(self):
+ if self.testing==1:
+ return
+ print "line - ",self["testlist"].getCurrent()[1]
+ self.currentindex = index = self["testlist"].getCurrent()[1]
+ result = 0
+ if index==self.satetestIndex:
+ self.Test0()
+ elif index==self.fronttestIndex:
+ self.Test1()
+ elif index>=self.tuner_test_first_index and index<=self.tuner_test_last_index:
+ self.TestTune(index)
+ elif index==self.scarttestIndex:
+ self.Test6()
+ elif index==self.rs232testIndex:
+ self.Test7()
+ elif index==self.usbtestIndex:
+ self.Test8()
+ elif index==self.ethernettestIndex:
+ self.Test9()
+ elif index == self.smarttestIndex:
+ self.Test10()
+# elif index == 11:
+# self.Test11()
+# elif index ==12:
+# self.Test12()
+# elif index==13:
+# self.Test13()
+ elif index==self.fdefaultIndex:
+ self.Test14()
+# elif index==self.shutdownIndex:
+# self.Test15()
+ else:
+ pass
+
+ def shutdownaction(self):
+ if self["testlist"].getCurrent()[1] == self.shutdownIndex:
+ self.Test15()
+
+
+ def Test0(self):
+ self.satatry = 8
+ self.satatimer.start(100,True)
+
+ def sataCheck(self):
+# print "try", self.satatry
+ if self.satatry == 0:
+ displayerror = 1
+ else:
+ self.rlist[self["testlist"].getCurrent()[1]]="try %d"%self.satatry
+ self["resultlist"].updateList(self.rlist)
+ self.satatry -= 1
+ displayerror = 0
+ result =0
+ try:
+ if fileExists("/autofs/sdb1"):
+ if access("/autofs/sdb1",F_OK|R_OK|W_OK):
+ dummy=open("/autofs/sdb1/dummy03","w")
+ dummy.write("complete")
+ dummy.close()
+ dummy=open("/autofs/sdb1/dummy03","r")
+ if dummy.readline()=="complete":
+ print "/autofs/sdb1 - complete"
+ else:
+ print "/autofs/sdb1 - readline error"
+ result = 1
+ displayerror = 1
+ dummy.close()
+ system("rm /autofs/sdb1/dummy03")
+ else:
+ print "/autofs/sdb1 - rw access error"
+ result = 1
+ displayerror = 1
+ else:
+ print "/autofs/sdb1 - file not exist"
+ result = 1
+ except:
+ print "/autofs/sdb1 - exceptional error"
+ result = 1
+ displayerror = 1
+ try:
+ if fileExists("/autofs/sda1"):
+ if access("/autofs/sda1",F_OK|R_OK|W_OK):
+ dummy=open("/autofs/sda1/dummy03","w")
+ dummy.write("complete")
+ dummy.close()
+ dummy=open("/autofs/sda1/dummy03","r")
+ if dummy.readline()=="complete":
+ print "/autofs/sda1 - complete"
+ else:
+ print "/autofs/sda1 - readline error"
+ result += 1
+ displayerror = 1
+ dummy.close()
+ system("rm /autofs/sda1/dummy03")
+ else:
+ print "/autofs/sda1 - rw access error"
+ result += 1
+ displayerror = 1
+ else:
+ print "/autofs/sda1 - file not exist"
+ result += 1
+ except:
+ print "/autofs/sda1 - exceptional error"
+ result += 1
+ displayerror = 1
+
+ if result == 0:
+ self.session.open( MessageBox, _("Sata & extend hdd test pass\nPress 'OK' button!"), MessageBox.TYPE_INFO)
+ self.rlist[self["testlist"].getCurrent()[1]]="pass"
+ elif result == 1:
+ if displayerror==1:
+ self.session.open( MessageBox, _("One hdd test error\nPress 'EXIT' button!"), MessageBox.TYPE_ERROR)
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+ else:
+ self.satatimer.start(1100,True)
+ else:
+ if displayerror==1:
+ self.session.open( MessageBox, _("Sata & extend hdd test error\nPress 'EXIT' button!"), MessageBox.TYPE_ERROR)
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+ else:
+ self.satatimer.start(1100,True)
+
+ def Test1(self):
+ if self.model== 0:
+ self.session.openWithCallback(self.displayresult ,FrontTest)
+ elif self.model == 1:
+ self.session.openWithCallback(self.displayresult ,FrontTest_solo)
+ elif self.model == 2 or self.model == 3 or self.model == 4:
+ self.session.openWithCallback(self.displayresult ,FrontTest_uno)
+
+ def displayresult(self):
+ global fronttest
+ if fronttest == 1:
+ self.rlist[self["testlist"].getCurrent()[1]]="pass"
+ else:
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+
+ def TestTune(self,index):
+ if self.oldref is None:
+ eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0")
+ serviceHandler = eServiceCenter.getInstance()
+ servicelist = serviceHandler.list(eref)
+ if not servicelist is None:
+ ref = servicelist.getNext()
+ else:
+ ref = self.getCurrentSelection() # raise error
+ print "servicelist none"
+ else:
+ ref = self.oldref
+ self.session.nav.stopService() # try to disable foreground service
+ if self.model == 0 or self.model == 1:
+ if index==self.tuner1_1testIndex:
+ ref.setData(0,1)
+ ref.setData(1,0x6D3)
+ ref.setData(2,0x3)
+ ref.setData(3,0xA4)
+ ref.setData(4,0xA00000)
+ self.session.nav.playService(ref)
+ self.avswitch.setColorFormat(0)
+ self.avswitch.setAspectRatio(0)
+ elif index==self.tuner1_2testIndex:
+ if self.model == 1:
+ self.camstep = 1
+ self.camtimer.start(100,True)
+ ref.setData(0,0x19)
+ ref.setData(1,0x1325)
+ ref.setData(2,0x3ef)
+ ref.setData(3,0x1)
+ ref.setData(4,0x64af79)
+ self.session.nav.playService(ref)
+ self.avswitch.setColorFormat(1)
+ self.avswitch.setAspectRatio(6)
+ elif index==self.tuner2_1testIndex:
+ ref.setData(0,1)
+ ref.setData(1,0x6D3)
+ ref.setData(2,0x3)
+ ref.setData(3,0xA4)
+ ref.setData(4,0x820000)
+ self.session.nav.playService(ref)
+ self.avswitch.setColorFormat(2)
+ self.avswitch.setAspectRatio(0)
+ elif index==self.tuner2_2testIndex:
+ self.camstep = 1
+ self.camtimer.start(100,True)
+ ref.setData(0,0x19)
+ ref.setData(1,0x1325)
+ ref.setData(2,0x3ef)
+ ref.setData(3,0x1)
+ ref.setData(4,0xC00000)
+ self.session.nav.playService(ref)
+ self.avswitch.setColorFormat(0)
+ self.avswitch.setAspectRatio(6)
+ self.tuningtimer.start(2000,True)
+ self.tunemsgtimer.start(3000, True)
+ elif self.model == 3 or self.model == 4:
+ getTuneInfo=self.tuneInfo[index]
+ if getTuneInfo["cam"] is True:
+ self.camstep = 1
+ self.camtimer.start(100,True)
+ if getTuneInfo["type"].startswith("DVB-S"):
+ if getTuneInfo["pol"] == "H":
+ ref.setData(0,1)
+ ref.setData(1,0x6D3)
+ ref.setData(2,0x3)
+ ref.setData(3,0xA4)
+ else:
+ ref.setData(0,0x19)
+ ref.setData(1,0x1325)
+ ref.setData(2,0x3ef)
+ ref.setData(3,0x1)
+ if getTuneInfo["sat"] == "160": # Eutelsat W2
+ ref.setData(4,0xA00000)
+ elif getTuneInfo["sat"] == "100": # Eutelsat
+ ref.setData(4,0x64af79)
+ elif getTuneInfo["sat"] == "130": # Hotbird
+ ref.setData(4,0x820000)
+ elif getTuneInfo["sat"] == "192": # Astra
+ ref.setData(4,0xC00000)
+ elif getTuneInfo["sat"] == "620": # Intelsat 902
+ ref.setData(4,0x26c0000) # need to fix later
+ elif getTuneInfo["sat"] == "642": # Intelsat 906
+ ref.setData(4,0x282AF79) # need to fix later
+ elif getTuneInfo["type"].startswith("DVB-C"):
+ ref.setData(0,0x19)
+ ref.setData(1,0x1325)
+ ref.setData(2,0x3ef)
+ ref.setData(3,0x1)
+ ref.setData(4,-64870) # ffff029a
+ elif getTuneInfo["type"].startswith("DVB-T"):
+ ref.setData(0,0x19)
+ ref.setData(1,0x1325)
+ ref.setData(2,0x3ef)
+ ref.setData(3,0x1)
+ ref.setData(4,-286391716) # eeee025c
+ self.session.nav.playService(ref)
+ if getTuneInfo["color"]=="CVBS":
+ self.avswitch.setColorFormat(0)
+ elif getTuneInfo["color"]=="RGB":
+ self.avswitch.setColorFormat(1)
+ elif getTuneInfo["color"]=="YC":
+ self.avswitch.setColorFormat(2)
+ if getTuneInfo["ratio"] == "4:3":
+ self.avswitch.setAspectRatio(0)
+ elif getTuneInfo["ratio"] == "16:9":
+ self.avswitch.setAspectRatio(6)
+ self.tuningtimer.start(2000,True)
+ self.tunemsgtimer.start(3000, True)
+
+ def cam_state(self):
+ current_index = self.currentindex
+ if self.camstep == 1:
+ slot = 0
+ state = eDVBCI_UI.getInstance().getState(slot)
+ print '-1-stat',state
+ if state > 0:
+ self.camstep=2
+ self.camtimer.start(100,True)
+ else:
+ self.session.nav.stopService()
+ self.session.open( MessageBox, _("CAM1_NOT_INSERTED\nPress exit!"), MessageBox.TYPE_ERROR)
+ self.rlist[current_index]="fail"
+ self.tunemsgtimer.stop()
+ elif self.camstep == 2:
+ slot = 0
+ appname = eDVBCI_UI.getInstance().getAppName(slot)
+ print 'appname',appname
+ if appname is None:
+ self.session.nav.stopService()
+ self.session.open( MessageBox, _("NO_GET_APPNAME\nPress exit!"), MessageBox.TYPE_ERROR)
+ self.rlist[current_index]="fail"
+ self.tunemsgtimer.stop()
+ else:
+ self.camstep=3
+ self.camtimer.start(100,True)
+ elif self.camstep==3:
+ slot = 1
+ state = eDVBCI_UI.getInstance().getState(slot)
+ print '-2-stat',state
+ if state > 0:
+ self.camstep=4
+ self.camtimer.start(100,True)
+ else:
+ self.session.nav.stopService()
+ self.session.open( MessageBox, _("CAM2_NOT_INSERTED\nPress exit!"), MessageBox.TYPE_ERROR)
+ self.rlist[current_index]="fail"
+ self.tunemsgtimer.stop()
+ elif self.camstep == 4:
+ slot = 1
+ appname = eDVBCI_UI.getInstance().getAppName(slot)
+ print 'appname',appname
+ if appname is None:
+ self.session.nav.stopService()
+ self.session.open( MessageBox, _("NO_GET_APPNAME\nPress exit!"), MessageBox.TYPE_ERROR)
+ self.rlist[current_index]="fail"
+ self.tunemsgtimer.stop()
+ else:
+ self.setSource()
+ self.camstep = 5
+
+ def updateStatus(self):
+ current_index = self.currentindex
+ if self.model == 0 or self.model == 1:
+ if current_index ==self.tuner1_1testIndex or current_index==self.tuner1_2testIndex:
+ tunno = 1
+ result = eSctest.getInstance().getFrontendstatus(0)
+ else:
+ tunno = 2
+ result = eSctest.getInstance().getFrontendstatus(1)
+ if current_index == self.tuner1_2testIndex or current_index==self.tuner2_2testIndex:
+ hv = "Ver"
+ else:
+ hv = "Hor"
+
+ elif self.model == 3 or self.model == 4:
+ getTuneInfo=self.tuneInfo[current_index]
+ result = eSctest.getInstance().getFrontendstatus(getTuneInfo["slot"])
+ tunno = getTuneInfo["slot"]+1
+ hv = getTuneInfo["pol"]
+ if hv == "H":
+ hv = "Hor"
+ elif hv == "V":
+ hv = "Ver"
+ else :
+ hv == ""
+
+ print "eSctest.getInstance().getFrontendstatus - %d"%result
+ if result == 0:
+ self.tunerlock = 0
+ self.tunemsgtimer.stop()
+ self.session.nav.stopService()
+ self.avswitch.setColorFormat(0)
+ self.session.open( MessageBox, _("Tune%d %s Locking Fail..."%(tunno,hv)), MessageBox.TYPE_ERROR)
+ self.rlist[current_index]="fail"
+ else :
+ self.tunerlock = 1
+
+ def tuneback(self,yesno):
+ current_index=self.currentindex
+ self.session.nav.stopService() # try to disable foreground service
+ if yesno and self.tunerlock == 1:
+ if current_index == self.tuner_test_last_index and self.camstep < 5: # need fix to depending about CAM exist
+ self.rlist[current_index]="fail"
+ else :
+ self.rlist[current_index]="pass"
+ else:
+ self.rlist[current_index]="fail"
+ if self.model == 0 and current_index == 6: # YC
+ self.avswitch.setColorFormat(0)
+ elif ( self.model == 3 or self.model == 4 ) and self.tuneInfo[current_index]["color"] == "YC":
+ self.avswitch.setColorFormat(0)
+ self.resetSource()
+ self["resultlist"].updateList(self.rlist)
+
+ def tunemsg(self):
+ self.tuningtimer.stop()
+ self.session.openWithCallback(self.tuneback, MessageBox, _("%s ok?" %(self["testlist"].getCurrent()[0])), MessageBox.TYPE_YESNO)
+
+ def setSourceVar(self):
+ if self.model == 0:
+ self.input_pad_num=1
+ self.setTuner = 'B'
+ elif self.model == 1:
+ self.input_pad_num=0
+ self.setTuner = 'A'
+ else:
+ self.input_pad_num=len(self.NimType)-1
+ if self.input_pad_num == 0:
+ self.setTuner = 'A'
+ elif self.input_pad_num == 1:
+ self.setTuner = 'B'
+ elif self.input_pad_num == 2:
+ self.setTuner = 'C'
+
+# ikseong - for 22000 tp
+ def setSource(self):
+# fix input source
+ inputname = ("/proc/stb/tsmux/input%d" % self.input_pad_num)
+ print "<setsource> inputname : ",inputname
+ fd=open(inputname,"w")
+ fd.write("CI0")
+ fd.close()
+# fix ci_input Tuner
+ filename = ("/proc/stb/tsmux/ci0_input")
+ fd = open(filename,'w')
+ fd.write(self.setTuner)
+ print "setTuner(CI0) : ",self.setTuner
+ fd.close()
+ print "CI loop test!!!!!!!!!!!!!!"
+
+ def resetSource(self):
+ inputname = ("/proc/stb/tsmux/input%d" % self.input_pad_num)
+ print "<resetsource> inputname : ",inputname
+ fd=open(inputname,"w")
+ fd.write(self.setTuner)
+ fd.close()
+ print "CI loop test end!!!!!!!!!!!!!!"
+
+ def Test6(self):
+ self.avswitch.setInput("SCART")
+ sleep(2)
+ self.session.openWithCallback(self.check6, MessageBox, _("Scart loop ok?"), MessageBox.TYPE_YESNO)
+
+ def check6(self,yesno):
+ if yesno:
+ self.rlist[self["testlist"].getCurrent()[1]]="pass"
+ else:
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+ self.avswitch.setInput("ENCODER")
+
+ def check7(self):
+ global rstest
+ if rstest == 1:
+ self.rlist[self["testlist"].getCurrent()[1]]="pass"
+ else:
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+
+ def Test7(self):
+ self.session.openWithCallback(self.check7,RS232Test)
+
+ def Agingmode(self):
+ if self.testing==1:
+ return
+ if self.oldref is None:
+ eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0")
+ serviceHandler = eServiceCenter.getInstance()
+ servicelist = serviceHandler.list(eref)
+ if not servicelist is None:
+ ref = servicelist.getNext()
+ else:
+ ref = self.getCurrentSelection()
+ print "servicelist none"
+ else:
+ ref = self.oldref
+ self.session.nav.stopService() # try to disable foreground service
+ if self.model == 0 or self.model == 1 or self.NimType[0]["type"].startswith("DVB-S"):
+ ref.setData(0,0x19)
+ ref.setData(1,0x1325)
+ ref.setData(2,0x3ef)
+ ref.setData(3,0x1)
+ ref.setData(4,0x64af79)
+ elif self.NimType[0]["type"].startswith("DVB-C"):
+ ref.setData(0,0x19)
+ ref.setData(1,0x1325)
+ ref.setData(2,0x3ef)
+ ref.setData(3,0x1)
+ ref.setData(4,-64870) # ffff029a
+ elif self.NimType[0]["type"].startswith("DVB-T"):
+ ref.setData(0,0x19)
+ ref.setData(1,0x1325)
+ ref.setData(2,0x3ef)
+ ref.setData(3,0x1)
+ ref.setData(4,-286391716) # eeee025c
+ self.session.nav.playService(ref)
+ self.avswitch.setColorFormat(0)
+ self.avswitch.setAspectRatio(0)
+ self.agingtimer.start(2000,True)
+
+ def agingCheck(self):
+ result = eSctest.getInstance().getFrontendstatus(0)
+ hv = "Ver"
+ print "eSctest.getInstance().getFrontendstatus - %d"%result
+ if result == 0:
+ self.session.nav.stopService()
+ self.session.open( MessageBox, _("Tune 1 Ver Locking Fail..."), MessageBox.TYPE_ERROR)
+ elif result == 1 :
+ self.session.openWithCallback(self.agingResult,AgingTest)
+ else:
+ self.session.nav.stopService()
+ self.session.open( MessageBox, _("Tune 1 Ver Error %d..."%result), MessageBox.TYPE_ERROR)
+
+ def agingResult(self):
+ global Agingresult
+ if(Agingresult ==1):
+ self["testlist"].moveToIndex(self.fdefaultIndex)
+ self.Test14()
+ self["testlist"].moveToIndex(self.shutdownIndex)
+
+ def Test8(self):
+ self.usbtry = 9
+ self.usbtimer.start(100,True)
+
+ def usbCheck(self):
+ if self.usbtry == 0:
+ displayerror = 1
+ else:
+ self.rlist[self["testlist"].getCurrent()[1]]="try %d"%self.usbtry
+ self["resultlist"].updateList(self.rlist)
+ self.usbtry -= 1
+ displayerror = 0
+
+ if self.model==0 or self.model==3 or self.model==4:
+ devices = [ "/autofs/sdc1", "/autofs/sdd1", "/autofs/sde1" ]
+ elif self.model==1:
+ devices = [ "/autofs/sda1", "/autofs/sdb1" ]
+ elif self.model==2:
+ devices = [ "/autofs/sdc1", "/autofs/sdd1" ]
+ else :
+ self.session.open( MessageBox, _("invalid model"), MessageBox.TYPE_ERROR)
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+ return
+
+ result=len(devices)
+
+ for dev in devices:
+ try:
+ if fileExists(dev):
+ if access(dev,F_OK|R_OK|W_OK):
+ dummy=open(dev+"/dummy03","w")
+ dummy.write("complete")
+ dummy.close()
+ dummy=open(dev+"/dummy03","r")
+ if dummy.readline()=="complete":
+ print dev," - complete"
+ else:
+ print dev," - readline error"
+ result=result -1
+ displayerror = 1
+ dummy.close()
+ system("rm "+dev+"/dummy03")
+ else:
+ print dev," - rw access error"
+ result=result -1
+ displayerror = 1
+ else:
+ print dev," - file not exist"
+ result=result-1
+ except:
+ print dev," - exceptional error"
+ result=result -1
+ displayerror = 1
+
+ if result < 0 :
+ result = 0
+ elif result == len(devices):
+ self.session.open( MessageBox, _("USB test pass %d devices\nPress 'OK' button!"%result), MessageBox.TYPE_INFO)
+ self.rlist[self["testlist"].getCurrent()[1]]="pass"
+ else:
+ if displayerror == 1:
+ self.session.open( MessageBox, _("USB test error : Success-%d"%result+" Fail-%d\nPress 'EXIT' button!"%(len(devices)-result)), MessageBox.TYPE_ERROR)
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+ else:
+ self.usbtimer.start(1100,True)
+
+ def pingtest(self):
+ self.testing = 1
+# system("/etc/init.d/networking stop")
+ system("ifconfig eth0 192.168.0.10")
+# system("/etc/init.d/networking start")
+ cmd1 = "ping -c 1 192.168.0.100"
+ self.PingConsole = Console()
+ self.PingConsole.ePopen(cmd1, self.checkNetworkStateFinished,self.NetworkStatedataAvail)
+
+ def checkNetworkStateFinished(self, result, retval,extra_args):
+ (statecallback) = extra_args
+ if self.PingConsole is not None:
+ if retval == 0:
+ self.PingConsole = None
+ content = result.splitlines()
+# print 'content',content
+ x = content[4].split()
+# print 'x',x
+ if x[0]==x[3]:
+ statecallback(1)
+ else:
+ statecallback(0)
+ else:
+ statecallback(0)
+
+
+ def NetworkStatedataAvail(self,data):
+ global ethtest
+ if data == 1:
+ ethtest = 1
+ print "success"
+ self.session.openWithCallback(self.openMacConfig ,MessageBox, _("Ping test pass"), MessageBox.TYPE_INFO,2)
+
+ else:
+ ethtest = 0
+ print "fail"
+ self.session.open( MessageBox, _("Ping test fail\nPress exit"), MessageBox.TYPE_ERROR)
+ self.macresult()
+
+ def Test9(self):
+ self.pingtest()
+
+ def openMacConfig(self, ret=False):
+ self.session.openWithCallback(self.macresult ,MacConfig,mactry=self.mactry)
+
+ def macresult(self):
+ global ethtest
+ if ethtest == 1:
+ self.rlist[self.ethernettestIndex]="pass"
+ else:
+ self.rlist[self.ethernettestIndex]="fail"
+ self.getmacaddr()
+ self.testing = 0
+
+ def MemTest(self, which):
+ index = which
+ result = 0
+ if index==0:
+ result = eMemtest.getInstance().dramtest()
+ elif index==1:
+ result = eMemtest.getInstance().flashtest()
+ result = 0 # temp
+ else:
+ result = eMemtest.getInstance().dramtest()
+ result = eMemtest.getInstance().flashtest()
+ result = 0 # temp
+
+ index = index+10
+
+ if result == 0:
+ print index,self.rlist[index]
+ self.rlist[index]="pass"
+ else:
+ print index,self.rlist[index]
+ self.rlist[index]="fail"
+ self["resultlist"].updateList(self.rlist)
+
+ def scciresult(self):
+ global smartcardtest
+ if smartcardtest == 1:
+ self.rlist[self["testlist"].getCurrent()[1]]="pass"
+ else:
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+
+ def Test10(self):
+ self.session.openWithCallback(self.scciresult ,SmartCardTest,stbmodel=self.model)
+
+ def Test11(self):
+ self.MemTest(1)
+
+ def Test12(self):
+ self.MemTest(2)
+
+ def Test13(self):
+ self.MemTest(3)
+
+
+ def Test14(self):
+ try:
+ print "test14"
+ system("rm -R /etc/enigma2")
+ system("ls /")
+ system("cp -R /usr/share/enigma2/defaults /etc/enigma2")
+ self.rlist[self["testlist"].getCurrent()[1]]="pass"
+ self["resultlist"].updateList(self.rlist)
+ except:
+ print "test14 except"
+ self.rlist[self["testlist"].getCurrent()[1]]="fail"
+ self["resultlist"].updateList(self.rlist)
+ self.session.open( MessageBox, _("Factory reset fail"), MessageBox.TYPE_ERROR)
+
+ def Test15(self):
+ self.session.openWithCallback(self.shutdown ,MessageBox, _("Do you want to shut down?"), MessageBox.TYPE_YESNO)
+
+ def shutdown(self, yesno):
+ if yesno :
+ from os import _exit
+ system("/usr/bin/showiframe /boot/backdrop.mvi")
+ _exit(1)
+ else:
+ return
+
+ def keyCancel(self):
+ if self.testing==1:
+ return
+ print "exit"
+ self.close()
+# if self.oldref is not None:
+# self.session.nav.playService(self.oldref)
+
+ethtest = 0
+class MacConfig(Screen):
+ skin = """
+ <screen position="100,250" size="520,100" title="Mac Config" >
+ <eLabel text="Mac Address " position="10,15" size="200,40" font="Regular;30" />
+ <widget name="text" position="230,15" size="230,40" font="Regular;30" />
+ <widget name="text1" position="470,15" size="40,40" font="Regular;30" />
+ <eLabel text=" " position="5,55" zPosition="-1" size="510,5" backgroundColor="#02e1e8e6" />
+ <widget name="stattext" position="30,75" size="400,25" font="Regular;20" />
+ </screen>"""
+
+ def __init__(self, session, mactry = 1):
+ self["actions"] = ActionMap(["DirectionActions","OkCancelActions"],
+ {
+ "ok": self.keyOk,
+ "left": self.keyleft,
+ "right": self.keyright,
+ "cancel": self.keyCancel,
+ }, -2)
+
+ Screen.__init__(self, session)
+
+ self.mactry = mactry
+ self.model = 0
+ self.getModelInfo()
+ self.macfd = 0
+ self.macaddr = "000000000000"
+ self.ReadMacinfo = 0
+ self["text"]=Label((self.macaddr))
+ self["text1"]= Label(("< >"))
+ self["stattext"]= Label((""))
+ self.displaymac()
+ self.loadmacaddr()
+ self.getmacaddr()
+ global ethtest
+ ethtest = 1
+
+ def getModelInfo(self):
+ getmodel = 0
+ if fileExists("/proc/stb/info/vumodel"):
+ info = open("/proc/stb/info/vumodel").read().strip()
+ if info == "combo":
+ self.model = 2
+ getmodel = 1
+ print "MacConfig, model : combo"
+ elif info == "solo":
+ self.model = 1
+ getmodel = 1
+ print "MacConfig, model : solo"
+ elif info == "duo":
+ self.model = 0
+ getmodel = 1
+ print "MacConfig, model : duo"
+ elif info == "uno":
+ self.model = 3
+ getmodel = 1
+ print "getModelInfo : uno"
+ elif info == "ultimo":
+ self.model = 4
+ getmodel = 1
+ print "getModelInfo : ultimo"
+
+
+ if getmodel == 0 and fileExists("/proc/stb/info/version"):
+ info = open("/proc/stb/info/version").read()
+# print info,info[:2]
+ if info[:2] == "14":
+ self.model = 1
+ print "MacConfig, model : solo_"
+ elif info[:2] == "12":
+ self.model = 0
+ print "MacConfig, model: duo_"
+
+ def loadmacaddr(self):
+ try:
+ self.macfd = 0
+
+ if self.model==0 or self.model==3 or self.model==4 :
+ devices = ["/autofs/sdb1", "/autofs/sdc1", "/autofs/sdd1", "/autofs/sde1" ]
+ elif self.model==1:
+ devices = [ "/autofs/sda1", "/autofs/sdb1" ]
+ elif self.model==2:
+ devices = [ "/autofs/sdb1", "/autofs/sdc1", "/autofs/sdd1" ]
+
+ for dev in devices:
+ print 'try..',dev
+ if fileExists(dev+"/macinfo.txt"):
+ print "<open>"+dev+"/macinfo.txt"
+ self.macfd = open(dev+"/macinfo.txt","r+")
+ break
+
+ if self.macfd == 0:
+ self["text"].setText(("cannot read usb!!"))
+ self["text1"].setText((" "))
+ self["stattext"].setText((" Press Exit Key."))
+ self.ReadMacinfo=0
+ return
+
+ macaddr=self.macfd.readline().split(":")
+ self.macaddr=macaddr[1]+macaddr[2]+macaddr[3]+macaddr[4]+macaddr[5]+macaddr[6]
+ self.displaymac()
+ self.ReadMacinfo = 1
+ except:
+ self["text"].setText(("cannot read usb!!"))
+ self["text1"].setText((" "))
+ self["stattext"].setText((" Press Exit Key."))
+ self.ReadMacinfo=0
+
+ def getmacaddr(self):
+ if self.ReadMacinfo==0:
+ return
+ try:
+ if self.model == 2 or self.model == 3 or self.model == 4:
+ cmd = "nanddump -s 0x" + str((self.mactry-1)*2) + "0000 -b -o -l 64 -p /dev/mtd5"
+ elif self.model == 0 or self.model == 1:
+ cmd = "nanddump -s 0x" + str((self.mactry-1)*2) + "0000 -b -o -l 64 -p /dev/mtd4"
+ self.macConsole = Console()
+ self.macConsole.ePopen(cmd, self.readmac,self.checkReadmac)
+ except:
+ return
+
+ def readmac(self, result, retval,extra_args=None):
+ (callback) = extra_args
+ if self.macConsole is not None:
+ if retval == 0:
+ self.macConsole = None
+ macline = None
+ content =result.splitlines()
+ for x in content:
+ if x.startswith('0x000'+str((self.mactry-1)*2)+'0010:'):
+ macline = x.split()
+ if macline == None:
+ callback(0)
+ elif len(macline) < 10:
+ callback(1)
+ else:
+ mac = macline[5]+":"+macline[6]+":"+macline[7]+":"+macline[8]+":"+macline[9]+":"+macline[10]
+ self["stattext"].setText(("now : "+mac))
+ callback(2)
+
+ def checkReadmac(self,data):
+ if data == 0:
+ print "block %d is bad block" % self.mactry
+ self.mactry = self.mactry + 1
+ if self.mactry > 4:
+ self.session.open(MessageBox, _("FLASH IS BROKEN"), type = MessageBox.TYPE_INFO, enable_input = False)
+ return
+ else:
+ self.getmacaddr()
+ elif data == 1:
+ print 'mac dump read error'
+ return
+ elif data == 2:
+ print 'mac address read ok'
+ return
+
+
+ def keyleft(self):
+ if self.ReadMacinfo==0 :
+ return
+ macaddress = long(self.macaddr,16)-1
+ if macaddress < 0 :
+ macaddress = 0xffffffffffff
+ self.macaddr = "%012x"%macaddress
+ self.displaymac()
+
+ def keyright(self):
+ if self.ReadMacinfo==0 :
+ return
+ macaddress = long(self.macaddr,16)+1
+ if macaddress > 0xffffffffffff:
+ macaddress = 0
+ self.macaddr = "%012x"%macaddress
+ self.displaymac()
+
+ def displaymac(self):
+ macaddr= self.macaddr
+ self["text"].setText(("%02x:%02x:%02x:%02x:%02x:%02x"%(int(macaddr[0:2],16),int(macaddr[2:4],16),int(macaddr[4:6],16),int(macaddr[6:8],16),int(macaddr[8:10],16),int(macaddr[10:12],16))))
+
+ def keyOk(self):
+ if self.ReadMacinfo==0 :
+ return
+ try:
+ macaddr = self.macaddr
+#make_mac_sector 00-99-99-99-00-00 > /tmp/mac.sector
+#flash_eraseall /dev/mtd4
+#nandwrite /dev/mtd4 /tmp/mac.sector -p
+ cmd = "make_mac_sector %02x-%02x-%02x-%02x-%02x-%02x > /tmp/mac.sector"%(int(macaddr[0:2],16),int(macaddr[2:4],16),int(macaddr[4:6],16),int(macaddr[6:8],16),int(macaddr[8:10],16),int(macaddr[10:12],16))
+ system(cmd)
+ if self.model == 2 or self.model == 3 or self.model == 4:
+ system("flash_eraseall /dev/mtd5")
+ system("nandwrite /dev/mtd5 /tmp/mac.sector -p")
+ elif self.model == 0 or self.model ==1 :
+ system("flash_eraseall /dev/mtd4")
+ system("nandwrite /dev/mtd4 /tmp/mac.sector -p")
+ macaddress = long(macaddr,16)+1
+ if macaddress > 0xffffffffffff:
+ macaddress = 0
+ macaddr = "%012x"%macaddress
+ macwritetext = "MAC:%02x:%02x:%02x:%02x:%02x:%02x"%(int(macaddr[0:2],16),int(macaddr[2:4],16),int(macaddr[4:6],16),int(macaddr[6:8],16),int(macaddr[8:10],16),int(macaddr[10:12],16))
+ self.macfd.seek(0)
+ self.macfd.write(macwritetext)
+ self.macfd.close()
+ system("sync")
+ self.macaddr = macaddr
+ self.close()
+ except:
+ self.session.open( MessageBox, _("Mac address fail"), MessageBox.TYPE_ERROR)
+ global ethtest
+ ethtest = 0
+ self.close()
+
+ def keyCancel(self):
+ if self.macfd != 0:
+ self.macfd.close()
+ global ethtest
+ ethtest = 0
+ self.close()
+
+smartcardtest = 0
+class SmartCardTest(Screen):
+ skin = """
+ <screen position="300,240" size="160,120" title="SmartCard Test" >
+ <widget name="text" position="10,10" size="140,100" font="Regular;22" />
+ </screen>"""
+
+ def __init__(self, session, stbmodel = 0):
+ self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
+ {
+ "cancel": self.keyCancel,
+ "ok" : self.keyOk
+ }, -2)
+
+ Screen.__init__(self, session)
+ self["text"]=Label(("Testing Smartcard 1..."))
+ self.testok = 0
+ self.smartcardtimer = eTimer()
+ self.smartcardtimer.callback.append(self.check_smart_card)
+ self.closetimer = eTimer()
+ self.closetimer.callback.append(self.close)
+ self.smartcard=0
+ global smartcardtest
+ smartcardtest = 0
+ self.model = stbmodel
+ self.Testmode = 1
+ self.smartcardtimer.start(100,True)
+
+ def check_smart_card(self):
+ global smartcardtest
+ index = self.smartcard
+ result = 0
+ if index==0:
+ if self.Testmode==0:
+ result = eSctest.getInstance().check_smart_card("/dev/sci0")
+ else:
+ result = eSctest.getInstance().n_check_smart_card("/dev/sci0")
+ elif index ==1:
+ if self.Testmode==0:
+ result = eSctest.getInstance().check_smart_card("/dev/sci1")
+ else:
+ result = eSctest.getInstance().n_check_smart_card("/dev/sci1")
+ else:
+ result = -1
+
+ print result
+
+ if result == 0:
+ print 'pass'
+ if(index== 0 and ( self.model== 0 or self.model==2 or self.model == 3 or self.model == 4) ):
+ self.smartcard = 1
+ self["text"].setText(_("Testing Smartcard 2..."))
+ self.smartcardtimer.start(100,True)
+ return
+ elif (index==1 or self.model==1):
+ smartcardtest = 1
+ self.testok = 1
+ self["text"].setText(_("Smart Card OK!!"))
+ self.closetimer.start(2000,True)
+ self.smartcardtimer.stop()
+ else :
+
+ self["text"].setText(_("Smart Card model type error"))
+ self.closetimer.start(2000,True)
+ self.smartcardtimer.stop()
+ else:
+# if result ==-1:
+# self.session.open( MessageBox, _("%d:NO_DEV_FOUND"%(index+1)), MessageBox.TYPE_ERROR)
+# elif result == -2:
+# self.session.open( MessageBox, _("%d:SC_NOT_INSERTED"%(index+1)), MessageBox.TYPE_ERROR)
+# elif result == -3:
+# self.session.open( MessageBox, _("%d:SC_NOT_VALID_ATR"%(index+1)), MessageBox.TYPE_ERROR)
+# elif result == -5:
+# self.session.open( MessageBox, _("%d:SC_READ_TIMEOUT"%(index+1)), MessageBox.TYPE_ERROR)
+ if(index==0):
+ self["text"].setText(_("Smart Card 1 Error!\nerrorcode=%d"%result))
+ elif (index==1):
+ self["text"].setText(_("Smart Card 2 Error!\nerrorcode=%d"%result))
+ self.closetimer.start(2000,True)
+ self.smartcardtimer.stop()
+
+
+ def keyCancel(self):
+ self.close()
+
+ def keyOk(self):
+ if self.testok == 1:
+ self.close()
+
+
+
+fronttest = 0
+
+class FrontTest(Screen):
+ skin = """
+ <screen position="260,240" size="200,180" title="Front Test" >
+ <widget name="text" position="10,10" size="180,160" font="Regular;22" />
+ </screen>"""
+
+ def __init__(self, session):
+ self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
+ {
+ "ok": self.keyOk,
+ "up":self.keyUp,
+ "down":self.keyDown,
+ "cancel": self.keyCancel,
+ }, -2)
+
+ Screen.__init__(self, session)
+ self["text"]=Label(("Wheel LEFT"))
+ self.step = 1
+
+ self.fronttimer= eTimer()
+ self.fronttimer.callback.append(self.FrontAnimate)
+ self.frontturnonoff = 0
+ eSctest.getInstance().VFD_Open()
+ self.keytimeout = eTimer()
+ self.keytimeout.callback.append(self.KeyTimeOut)
+ self.keytimeout.start(5000,True)
+
+ def KeyTimeOut(self):
+ if self.step == 1:
+ self["text"].setText(("Wheel LEFT ERROR"))
+ elif self.step ==2 :
+ self["text"].setText(("Wheel RIGHT ERROR"))
+ elif self.step == 3:
+ self["text"].setText(("Wheel BUTTON ERROR"))
+ self.step = 0
+# self.keyCancel()
+
+ def keyCancel(self):
+ global fronttest
+ self.fronttimer.stop()
+ eSctest.getInstance().VFD_Close()
+ if self.step==4:
+ fronttest = 1
+ else:
+ fronttest = 0
+ self.close()
+
+ def keyDown(self):
+ if self.step==2:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 3
+ self["text"].setText(_("Press Front Wheel"))
+
+ def keyUp(self):
+ if self.step==1:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step=2
+ self["text"].setText(_("Wheel RIGHT"))
+
+ def keyOk(self):
+ if self.step == 3:
+ self.keytimeout.stop()
+ self.step =4
+ self.fronttimer.start(1000,True)
+ self["text"].setText(("Front Test OK!\nPress Exit Key"))
+# elif self.step==4:
+# global fronttest
+# self.fronttimer.stop()
+# eSctest.getInstance().VFD_Close()
+# fronttest = 1
+# self.close()
+
+ def FrontAnimate(self):
+ if (self.frontturnonoff==0):
+ eSctest.getInstance().turnon_VFD()
+ self.frontturnonoff = 1
+ else:
+ self.frontturnonoff = 0
+ eSctest.getInstance().turnoff_VFD()
+ self.fronttimer.start(1000,True)
+
+
+class FrontTest_solo(Screen):
+ skin = """
+ <screen position="260,240" size="200,180" title="Front Test" >
+ <widget name="text" position="10,10" size="180,160" font="Regular;22" />
+ </screen>"""
+
+ def __init__(self, session):
+ self["actions"] = ActionMap(["DirectionActions", "OkCancelActions","GlobalActions"],
+ {
+ "ok": self.keyOk,
+ "cancel": self.keyCancel,
+ "left": self.keyleft,
+ "right": self.keyright,
+ "power_down": self.keypower,
+ "volumeUp": self.keyvolup,
+ "volumeDown": self.keyvoldown,
+ }, -2)
+
+ Screen.__init__(self, session)
+ self["text"]=Label(("Press Front STANDBY"))
+ self.step = 1
+
+ self.fronttimer= eTimer()
+ self.fronttimer.callback.append(self.FrontAnimate)
+ self.frontturnonoff = 0
+ eSctest.getInstance().VFD_Open()
+ self.keytimeout = eTimer()
+ self.keytimeout.callback.append(self.KeyTimeOut)
+ self.keytimeout.start(5000,True)
+
+ def KeyTimeOut(self):
+ if self.step == 1:
+ self["text"].setText(("Front STANDBY ERROR\nPress exit!"))
+ elif self.step == 2 :
+ self["text"].setText(("Front CH - ERROR\nPress exit!"))
+ elif self.step == 3:
+ self["text"].setText(("Front CH + ERROR\nPress exit!"))
+ elif self.step == 4 :
+ self["text"].setText(("Front VOL - ERROR\nPress exit!"))
+ elif self.step == 5:
+ self["text"].setText(("Front VOL + ERROR\nPress exit!"))
+
+ self.step = 0
+# self.keyCancel()
+
+ def keypower(self):
+ if self.step== 1:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 2
+ self["text"].setText(_("Press Front CH -"))
+
+ def keyright(self):
+ if self.step== 3:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 4
+ self["text"].setText(_("Press Front VOL -"))
+
+ def keyleft(self):
+ if self.step== 2:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 3
+ self["text"].setText(_("Press Front CH +"))
+
+ def keyvolup(self):
+ if self.step== 5:
+ self.keytimeout.stop()
+ self.step = 6
+ self.fronttimer.start(1000,True)
+ self["text"].setText(_("Front LED OK?\n\nyes-ok\nno-exit"))
+# self["text"].setText(("Front Test OK!\nPress Exit Key"))
+
+ def keyvoldown(self):
+ if self.step== 4:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 5
+ self["text"].setText(_("Press Front VOL +"))
+
+ def checkled(self, yesno):
+ if yesno :
+ self.step=6
+ else:
+ self.step=0
+ self.keyCancel()
+
+ def keyCancel(self):
+ global fronttest
+ self.fronttimer.stop()
+ eSctest.getInstance().VFD_Close()
+ fronttest = 0
+ self.close()
+
+ def keyOk(self):
+ global fronttest
+ if self.step == 6:
+ fronttest = 1
+ self.fronttimer.stop()
+ eSctest.getInstance().VFD_Close()
+ self.close()
+
+ def FrontAnimate(self):
+ if (self.frontturnonoff==0):
+ eSctest.getInstance().turnon_VFD()
+ self.frontturnonoff = 1
+ else:
+ self.frontturnonoff = 0
+ eSctest.getInstance().turnoff_VFD()
+ self.fronttimer.start(1000,True)
+
+class FrontTest_uno(Screen):
+ skin = """
+ <screen name="FrontTest_uno" position="center,center" size="300,180" title="Front Test" >
+ <widget name="text" position="10,10" size="280,160" font="Regular;30" />
+ </screen>"""
+
+ def __init__(self, session):
+ self["actions"] = ActionMap(["DirectionActions", "OkCancelActions","GlobalActions"],
+ {
+ "ok": self.keyOk,
+ "cancel": self.keyCancel,
+ "left": self.keyleft,
+ "right": self.keyright,
+ "volumeUp": self.keyvolup,
+ "volumeDown": self.keyvoldown,
+ "power_down": self.keypower,
+ }, -2)
+
+ Screen.__init__(self, session)
+ self["text"]=Label(("Press Front CH -"))
+ self.step = 1
+ self.fronttimer= eTimer()
+ self.fronttimer.callback.append(self.FrontAnimate)
+ self.frontturnonoff = 0
+ eSctest.getInstance().VFD_Open()
+ self.keytimeout = eTimer()
+ self.keytimeout.callback.append(self.KeyTimeOut)
+ self.keytimeout.start(5000,True)
+
+ def KeyTimeOut(self):
+ if self.step == 1:
+ self["text"].setText(("Front CH - ERROR\nPress exit!"))
+ elif self.step == 2:
+ self["text"].setText(("Front CH + ERROR\nPress exit!"))
+ elif self.step == 3 :
+ self["text"].setText(("Front VOL - ERROR\nPress exit!"))
+ elif self.step == 4:
+ self["text"].setText(("Front VOL + ERROR\nPress exit!"))
+ elif self.step == 5:
+ self["text"].setText(("Front STANDBY ERROR\nPress exit!"))
+ self.step = 0
+
+ def keyleft(self):
+ if self.step== 1:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 2
+ self["text"].setText(_("Press Front CH +"))
+ def keyright(self):
+ if self.step== 2:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 3
+ self["text"].setText(_("Press Front VOL -"))
+
+ def keyvoldown(self):
+ if self.step== 3:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 4
+ self["text"].setText(_("Press Front VOL +"))
+
+ def keyvolup(self):
+ if self.step== 4:
+ self.keytimeout.stop()
+ self.keytimeout.start(5000,True)
+ self.step = 5
+ self["text"].setText(_("Press Front STANDBY"))
+
+ def keypower(self):
+ if self.step== 5:
+ self.keytimeout.stop()
+ self.step = 6
+ self.fronttimer.start(1000,True)
+ self["text"].setText(_("Front LED OK?\n\nyes-ok\nno-exit"))
+
+ def keyCancel(self):
+ global fronttest
+ self.fronttimer.stop()
+ eSctest.getInstance().VFD_Close()
+ fronttest = 0
+ self.close()
+
+ def keyOk(self):
+ global fronttest
+ if self.step == 6:
+ fronttest = 1
+ self.fronttimer.stop()
+ eSctest.getInstance().VFD_Close()
+ self.close()
+
+ def FrontAnimate(self):
+ if (self.frontturnonoff==0):
+ eSctest.getInstance().turnon_VFD()
+ self.frontturnonoff = 1
+ else:
+ self.frontturnonoff = 0
+ eSctest.getInstance().turnoff_VFD()
+ self.fronttimer.start(1000,True)
+
+
+rstest = 0
+
+import select
+
+class RS232Test(Screen):
+ skin = """
+ <screen position="300,240" size="160,100" title="RS232 Test" >
+ <widget name="text" position="10,10" size="140,80" font="Regular;22" />
+ </screen>"""
+ step=1
+ def __init__(self, session):
+ self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
+ {
+ "cancel": self.keyCancel,
+ }, -2)
+
+ Screen.__init__(self, session)
+ self["text"]=Label(("Press \"Enter\" Key"))
+ self.timer = eTimer()
+ self.timer.callback.append(self.checkrs232)
+ self.timer.start(100, True)
+
+ def checkrs232(self):
+ global rstest
+ try:
+ rs=open('/dev/ttyS0','r')
+ rd = [rs]
+ r,w,e = select.select(rd, [], [], 10)
+ if r:
+ input = rs.read(1)
+ if input == "\n":
+ rstest = 1
+ else:
+ rstest = 0
+ else:
+ rstest = 0
+ except:
+ print 'error'
+ rstest = 0
+ if rstest == 0:
+ self.session.open( MessageBox, _("RS232 Test Failed!\nPress 'EXIT' button!"), MessageBox.TYPE_ERROR)
+ self.close()
+
+ def keyCancel(self):
+ self.close()
+
+Agingresult = 0
+
+class AgingTest(Screen):
+ skin = """
+ <screen position="200,240" size="250,100" title="Aging Test" >
+ <widget name="text1" position="10,10" size="230,40" font="Regular;22" />
+ <widget name="text2" position="10,50" size="230,40" font="Regular;22" />
+ </screen>"""
+ step=1
+ def __init__(self, session):
+ self["actions"] = ActionMap(["MediaPlayerActions","GlobalActions"],
+ {
+ "pause": self.keyEnd,
+ "stop": self.keyFinish,
+ "volumeUp": self.nothing,
+ "volumeDown": self.nothing,
+ "volumeMute": self.nothing,
+ }, -2)
+
+ Screen.__init__(self, session)
+ self["text1"]=Label(("Exit - Press Pause Key"))
+ self["text2"]=Label(("Reset - Press Stop Key"))
+# self.servicelist = ServiceList()
+# self.oldref = session.nav.getCurrentlyPlayingServiceReference()
+# print "oldref",self.oldref
+# session.nav.stopService() # try to disable foreground service
+# self.chstart()
+ self.tunerlock = 0
+ self.tuningtimer = eTimer()
+ self.tuningtimer.callback.append(self.updateStatus)
+# self.tuningtimer.start(200,True)
+
+
+ def updateStatus(self):
+ result = eSctest.getInstance().getFrontendstatus(0)
+ hv = "Ver"
+
+ print "eSctest.getInstance().getFrontendstatus - %d"%result
+ if result == 0:
+ self.tunerlock = 0
+ self.session.nav.stopService()
+ self.session.open( MessageBox, _("Tune 1 Ver Locking Fail..."), MessageBox.TYPE_ERROR)
+ elif result==1 :
+ self.tunerlock = 1
+ else:
+ self.tunerlock = 0
+ self.session.nav.stopService()
+ self.session.open( MessageBox, _("Tune 1 Ver Error %d..."%result), MessageBox.TYPE_ERROR)
+
+
+ def nothing(self):
+ print "nothing"
+
+ def chstart(self):
+ if self.oldref is None:
+ eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0")
+ serviceHandler = eServiceCenter.getInstance()
+ servicelist = serviceHandler.list(eref)
+ if not servicelist is None:
+ ref = servicelist.getNext()
+ else:
+ ref = self.getCurrentSelection()
+ print "servicelist none"
+ else:
+ ref = self.oldref
+ self.session.nav.stopService() # try to disable foreground service
+ ref.setData(0,0x19)
+ ref.setData(1,0x83)
+ ref.setData(2,0x6)
+ ref.setData(3,0x85)
+ ref.setData(4,0x640000)
+ self.session.nav.playService(ref)
+
+ def keyEnd(self):
+ global Agingresult
+ Agingresult = 0
+ self.session.nav.stopService() # try to disable foreground service
+ self.close()
+
+ def keyFinish(self):
+ global Agingresult
+ Agingresult = 1
+ self.session.nav.stopService() # try to disable foreground service
+ self.close()
+
+session = None
+
+
+def cleanup():
+ global Session
+ Session = None
+ global Servicelist
+ Servicelist = None
+
+def main(session, servicelist, **kwargs):
+ global Session
+ Session = session
+ global Servicelist
+ Servicelist = servicelist
+ bouquets = Servicelist.getBouquetList()
+ global bouquetSel
+ bouquetSel = Session.openWithCallback(cleanup, FactoryTest)
+
+#def Plugins(**kwargs):
+# return PluginDescriptor(name=_("Factory Test"), description="Test App for Factory", where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main)
+
+def Plugins(**kwargs):
+ return []
--- /dev/null
+eDVB services /4/
+transponders
+0064af79:03ef:0001
+ s 12153000:22000000:1:2:100:2:0:1:2:0:2
+/
+00820000:0003:00a4
+ s 10900000:26850000:0:0:130:2:0
+/
+00a00000:0003:00a4
+ s 10900000:26850000:0:0:160:2:0
+/
+00c00000:03ef:0001
+ s 12153000:22000000:1:2:192:2:0:1:2:0:2
+/
+ffff029a:03ef:0001
+ c 666000:6900000:2:3:0:0
+/
+eeee025c:03ef:0001
+ t 604000000:1:5:5:3:2:4:4:2:0
+/
+026c0000:0003:00a4
+ s 10900000:26850000:0:0:620:2:0
+/
+0282af79:03ef:0001
+ s 12153000:22000000:1:2:642:2:0:1:2:0:2
+/
+end
+services
+06d3:00820000:0003:00a4:1:0
+747 Channel [V] China
+p:STAR,c:000203,c:01028c,c:031ffe,f:40
+06d3:00a00000:0003:00a4:1:0
+747 Channel [V] China
+p:STAR,c:000203,c:01028c,c:031ffe,f:40
+1325:00c00000:03ef:0001:25:0
+ASTRA HD
+p:BetaDigital,f:40
+1325:0064af79:03ef:0001:25:0
+ASTRA HD
+p:BetaDigital,f:40
+1325:ffff029a:03ef:0001:25:0
+ASTRA HD+
+p:BetaDigital,f:40
+06d3:026c0000:0003:00a4:1:0
+747 Channel [V] China
+p:STAR,c:000203,c:01028c,c:031ffe,f:40
+1325:0282af79:03ef:0001:25:0
+ASTRA HD
+p:BetaDigital,c:0001ff,c:0301ff,c:040203,c:050001,f:40
+1325:eeee025c:03ef:0001:25:0
+ASTRA HD+
+p:BetaDigital,f:40
+1324:eeee025c:03ef:0001:25:0
+ANIXE HD
+p:BetaDigital,f:40
+end
+Have a lot of bugs!
--- /dev/null
+installdir = $(pkglibdir)/python/Plugins/SystemPlugins/Fancontrol
+
+SUBDIRS = meta
+
+install_PYTHON = \
+ __init__.py \
+ plugin.py
--- /dev/null
+installdir = $(datadir)/meta
+
+dist_install_DATA = plugin_fancontrol.xml
--- /dev/null
+<default>
+ <prerequisites>
+ <tag type="System" />
+ </prerequisites>
+ <info language="en">
+ <author>ikseong</author>
+ <name>Fancontrol</name>
+ <packagename>enigma2-plugin-systemplugins-fancontrol</packagename>
+ <shortdescription>Fan Control setting in standbymode.</shortdescription>
+ <description>The Fan control turn on, turn off, modify fan action time on standbymode.
+ </description>
+ </info>
+ <files type="package"> <!-- without version, without .ipk -->
+ <file type="package" name="enigma2-plugin-systemplugins-fancontrol" />
+ </files>
+
+</default>
--- /dev/null
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+from Plugins.Plugin import PluginDescriptor
+from Components.ActionMap import ActionMap,NumberActionMap
+from Components.config import config
+from Components.config import config, getConfigListEntry, ConfigInteger, ConfigSubsection, ConfigSelection
+from Components.ConfigList import ConfigListScreen
+from Components.ActionMap import ActionMap
+from Components.Sources.StaticText import StaticText
+
+
+config.plugins.fancontrols = ConfigSubsection()
+config.plugins.fancontrols.standbymode = ConfigSelection(default = "off", choices = [
+ ("off", _("off")), ("on", _("on"))])
+config.plugins.fancontrols.usetimer = ConfigSelection(default = "off", choices = [
+ ("off", _("no")), ("on", _("yes"))])
+config.plugins.fancontrols.fanontime = ConfigInteger(default = 5, limits = (1, 100))
+config.plugins.fancontrols.fanofftime = ConfigInteger(default = 60, limits = (1, 100))
+
+class FancontrolConfiguration(Screen, ConfigListScreen):
+ skin = """
+ <screen name="FancontrolConfiguration" position="center,center" size="560,300" title="Standbymode Fancontrol settings" >
+ <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+ <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
+ <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ececec" backgroundColor="#9f1313" transparent="1" />
+ <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ececec" backgroundColor="#1f771f" transparent="1" />
+ <widget name="config" zPosition="2" position="5,50" size="550,200" scrollbarMode="showOnDemand" transparent="1" />
+ </screen>"""
+ def __init__(self, session):
+ Screen.__init__(self, session)
+ self.session = session
+ self.standbyEntry = None
+ self.usetimerEntry = None
+ self.fanontimeEntry = None
+ self.fanofftimeEntry = None
+
+ self["shortcuts"] = ActionMap(["ShortcutActions", "SetupActions" ],
+ {
+ "ok": self.keySave,
+ "cancel": self.keyCancel,
+ "red": self.keyCancel,
+ "green": self.keySave,
+ }, -2)
+
+ self.list = []
+ ConfigListScreen.__init__(self, self.list,session = self.session)
+# self.getFaninfo()
+ self.createSetup()
+
+ self["key_red"] = StaticText(_("Close"))
+ self["key_green"] = StaticText(_("Save"))
+
+ def keyLeft(self):
+ ConfigListScreen.keyLeft(self)
+ self.newConfig()
+
+ def keyRight(self):
+ ConfigListScreen.keyRight(self)
+ self.newConfig()
+
+ def getFaninfo(self):
+ try:
+ value=int(open('/proc/stb/system/standby_fan_off','r').read())
+ if value is 0:
+ config.plugins.fancontrols.standbymode.value="on"
+ else:
+ config.plugins.fancontrols.standbymode.value="off"
+ value=int(open('/proc/stb/system/use_fan_timer','r').read())
+ if value is 0:
+ config.plugins.fancontrols.usetimer.value = "off"
+ else:
+ config.plugins.fancontrols.usetimer.value = "on"
+ time=int(open('/proc/stb/system/fan_on_time','r').read())
+ if time > 0 and time < 101:
+ config.plugins.fancontrols.fanontime.value = time
+ else:
+ config.plugins.fancontrols.fanontime.value = 1
+ time=int(open('/proc/stb/system/fan_off_time','r').read())
+ if time > 0 and time < 101:
+ config.plugins.fancontrols.fanofftime.value = time
+ else:
+ config.plugins.fancontrols.fanofftime.value = 1
+ except:
+ print 'Error read proc of fan'
+
+
+ def createSetup(self):
+ self.list = []
+ self.standbyEntry = getConfigListEntry(_("Fan basic action"), config.plugins.fancontrols.standbymode)
+ self.usetimerEntry = getConfigListEntry(_("Use Fan timer"), config.plugins.fancontrols.usetimer)
+ self.fanontimeEntry = getConfigListEntry(_("Fan on duration time"), config.plugins.fancontrols.fanontime)
+ self.fanofftimeEntry = getConfigListEntry(_("Fan off duration time"), config.plugins.fancontrols.fanofftime)
+
+ self.list.append( self.standbyEntry )
+ if config.plugins.fancontrols.standbymode.value is "off":
+ self.list.append( self.usetimerEntry )
+ if config.plugins.fancontrols.usetimer.value is not "off":
+ self.list.append( self.fanontimeEntry )
+ self.list.append( self.fanofftimeEntry )
+
+ self["config"].list = self.list
+ self["config"].l.setList(self.list)
+ if not self.selectionChanged in self["config"].onSelectionChanged:
+ self["config"].onSelectionChanged.append(self.selectionChanged)
+
+ def newConfig(self):
+ if self["config"].getCurrent() == self.usetimerEntry or self["config"].getCurrent() == self.standbyEntry:
+ self.createSetup()
+
+ def selectionChanged(self):
+ current = self["config"].getCurrent()
+ print current
+
+ def cancelConfirm(self, result):
+ if not result:
+ return
+ for x in self["config"].list:
+ x[1].cancel()
+ self.close()
+
+
+ def keyCancel(self):
+ print "cancel"
+ if self["config"].isChanged():
+ self.session.openWithCallback(self.cancelConfirm, MessageBox, _("Really close without saving settings?"))
+ else:
+ self.close()
+
+ def keySave(self):
+ ConfigListScreen.keySave(self)
+ try:
+ if config.plugins.fancontrols.standbymode.value is "on":
+ open('/proc/stb/system/standby_fan_off','w').write('0')
+ else:
+ open('/proc/stb/system/standby_fan_off','w').write('1')
+ if config.plugins.fancontrols.usetimer.value is "off":
+ open('/proc/stb/system/use_fan_timer','w').write('0')
+ else:
+ open('/proc/stb/system/use_fan_timer','w').write('1')
+ open('/proc/stb/system/fan_on_time','w').write('%s'%config.plugins.fancontrols.fanontime.value)
+ open('/proc/stb/system/fan_off_time','w').write('%s'%config.plugins.fancontrols.fanofftime.value)
+ except:
+ print 'Error write proc of fan'
+
+
+def openconfig(session, **kwargs):
+ session.open(FancontrolConfiguration)
+
+def selSetup(menuid, **kwargs):
+ if menuid != "system":
+ return [ ]
+
+ return [(_("Fan Control"), openconfig, "fancontrol_config", 70)]
+
+def setfancontrol(reason, **kwargs):
+ try:
+ if config.plugins.fancontrols.standbymode.value == "on":
+ open('/proc/stb/system/standby_fan_off','w').write('0')
+ else:
+ open('/proc/stb/system/standby_fan_off','w').write('1')
+ if config.plugins.fancontrols.usetimer.value is "off":
+ open('/proc/stb/system/use_fan_timer','w').write('0')
+ else:
+ open('/proc/stb/system/use_fan_timer','w').write('1')
+ open('/proc/stb/system/fan_on_time','w').write('%s'%config.plugins.fancontrols.fanontime.value)
+ open('/proc/stb/system/fan_off_time','w').write('%s'%config.plugins.fancontrols.fanofftime.value)
+ except:
+ print 'Error to set fan control'
+
+def Plugins(**kwargs):
+ return [PluginDescriptor(name = "Fancontrols", description = "check Fan Control settings", where = PluginDescriptor.WHERE_AUTOSTART, fnc = setfancontrol),
+ PluginDescriptor(name=_("Fan control"), description="Fan Control", where = PluginDescriptor.WHERE_MENU, fnc=selSetup)]
SkinSelector SatelliteEquipmentControl Videomode VideoTune Hotplug \
DefaultServicesScanner NFIFlash DiseqcTester CommonInterfaceAssignment \
CrashlogAutoSubmit CleanupWizard VideoEnhancement WirelessLan NetworkWizard \
- TempFanControl
+ TempFanControl FactoryTest Fancontrol FPGAUpgrade WirelessLanSetup ManualFancontrol \
+ Blindscan
install_PYTHON = \
__init__.py
--- /dev/null
+from Components.config import config, ConfigSubList, ConfigSubsection
+import NavigationInstance
+from enigma import iRecordableService, eTimer, iPlayableService, eServiceCenter, iServiceInformation
+from Components.ConfigList import ConfigListScreen
+from Components.config import config, ConfigSubsection, ConfigSelection, ConfigSlider
+from Components.Harddisk import harddiskmanager
+
+config.plugins.manualfancontrols = ConfigSubsection()
+config.plugins.manualfancontrols.standbymode = ConfigSelection(default = "yes", choices = [
+ ("no", _("no")), ("yes", _("yes"))])
+config.plugins.manualfancontrols.pwmvalue = ConfigSlider(default = 10, increment = 5, limits = (0, 255))
+config.plugins.manualfancontrols.checkperiod = ConfigSelection(default = "10", choices = [
+ ("5", "5 " + _("seconds")), ("10", "10 " + _("seconds")), ("30", "30 " + _("seconds")),
+ ("60", "1 " + _("minute")), ("120", "2 " + _("minutes")),
+ ("300", "5 " + _("minutes")), ("600", "10 " + _("minutes"))])
+
+instandbyOn_playingpvr = False
+
+class instandbyOn:
+ def __init__(self):
+ self.fanoffmode = 'OFF'
+ self.minimum_pwm = 5
+ self.setPWM(config.plugins.manualfancontrols.pwmvalue.value)
+ self.checkStstusTimer = eTimer()
+ self.checkStstusTimer.callback.append(self.checkStstus)
+ if config.plugins.manualfancontrols.pwmvalue.value == 0:
+ self.fanoffmode = 'ON'
+ if self.fanoffmode == 'ON':
+ self.checkStatusLoopStart()
+
+ config.misc.standbyCounter.addNotifier(self.standbyBegin, initial_call = False)
+ print "<ManualFancontrol> init : self.fanoffmode : ", self.fanoffmode
+ print "<ManualFancontrol> init : config.plugins.manualfancontrols.pwmvalue.value : ", config.plugins.manualfancontrols.pwmvalue.value
+
+ def checkStatusLoopStart(self):
+ print "<ManualFancontrol> checkStatusLoopStart"
+ self.checkStstusTimer.start(int(config.plugins.manualfancontrols.checkperiod.value) * 1000)
+
+ def checkStatusLoopStop(self):
+ print "<ManualFancontrol> checkStatusLoopStop"
+ self.checkStstusTimer.stop()
+
+ def checkStstus(self):
+ from Screens.Standby import inStandby
+ print "<ManualFancontrol> checkStstus, fanoffmode : %s, "%self.fanoffmode,"inStandby : ",inStandby and True or False
+ if self.fanoffmode is 'ON' : # pwmvalue is '0'
+ if self.isRecording() or self.isHDDActive():
+ self.setPWM(self.minimum_pwm)
+ else:
+ self.setPWM(0)
+ elif inStandby : # standby mode but pwm > 0
+ if self.isRecording() or self.isHDDActive():
+ self.setPWM(config.plugins.manualfancontrols.pwmvalue.value)
+ else:
+ self.setPWM(0)
+ elif self.getPWM() != config.plugins.manualfancontrols.pwmvalue.value : # normal mode
+ self.setPWM(config.plugins.manualfancontrols.pwmvalue.value)
+
+ def standbyBegin(self, configElement):
+ print "<ManualFancontrol> Standby Begin"
+ if config.plugins.manualfancontrols.standbymode.value == "yes" and self.fanoffmode is "OFF":
+ from Screens.Standby import inStandby
+ inStandby.onClose.append(self.StandbyEnd)
+ self.addRecordEventCB()
+ self.checkStatusLoopStart()
+ self.checkStstus()
+
+ def StandbyEnd(self):
+ print "<ManualFancontrol> Standby End"
+ if self.fanoffmode is "OFF":
+ self.removeRecordEventCB()
+ self.checkStatusLoopStop()
+ self.checkStstus()
+
+ def addRecordEventCB(self):
+ print "<ManualFancontrol> addRecordEventCB"
+ if self.getRecordEvent not in NavigationInstance.instance.record_event:
+ NavigationInstance.instance.record_event.append(self.getRecordEvent)
+
+ def removeRecordEventCB(self):
+ print "<ManualFancontrol> removeRecordEventCB"
+ if self.getRecordEvent in NavigationInstance.instance.record_event:
+ NavigationInstance.instance.record_event.remove(self.getRecordEvent)
+
+ def getRecordEvent(self, recservice, event):
+ if event == iRecordableService.evEnd or event == iRecordableService.evStart:
+ self.checkStstus()
+
+ def isRecording(self):
+ recordings = NavigationInstance.instance.getRecordings()
+ print "<ManualFancontrol_> recordings : ",len(recordings)
+ if recordings :
+ return True
+ else:
+ return False
+
+ def isHDDActive(self): # remake certainly
+ for hdd in harddiskmanager.HDDList():
+ if not hdd[1].isSleeping():
+ print "<ManualFancontrol_> %s is not Sleeping"%hdd[0]
+ return True
+ print "<ManualFancontrol_> All HDDs are Sleeping"
+ return False
+
+ def getPWM(self):
+ f = open("/proc/stb/fp/fan_pwm", "r")
+ value = int(f.readline().strip(), 16)
+ f.close()
+ print "<ManualFancontrol> getPWM : %d "%value
+ return value
+
+ def setPWM(self, value):
+ print "<ManualFancontrol> setPWM to : %d"%value
+ f = open("/proc/stb/fp/fan_pwm", "w")
+ f.write("%x" % value)
+ f.close()
+
+instandbyon = instandbyOn()
+
--- /dev/null
+installdir = $(pkglibdir)/python/Plugins/SystemPlugins/ManualFancontrol
+
+SUBDIRS = meta
+
+install_PYTHON = \
+ __init__.py \
+ plugin.py \
+ InstandbyOn.py
--- /dev/null
+installdir = $(datadir)/meta
+
+dist_install_DATA = plugin_manualfancontrol.xml
--- /dev/null
+<default>
+ <prerequisites>
+ <tag type="System" />
+ </prerequisites>
+ <info>
+ <author>hschang</author>
+ <name>ManualFancontrol</name>
+ <packagename>enigma2-plugin-systemplugins-manualfancontrol</packagename>
+ <shortdescription>Fancontrol Settings inStandby Mode</shortdescription>
+ <description>Fancontrol Settings inStandby Mode</description>
+ </info>
+
+ <files type="package"> <!-- without version, without .ipk -->
+ <file type="package" name="enigma2-plugin-systemplugins-manualfancontrol" />
+ </files>
+
+</default>
--- /dev/null
+from Screens.Screen import Screen
+from Components.ConfigList import ConfigListScreen
+from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigSelection, ConfigInteger
+from Components.ActionMap import ActionMap,NumberActionMap
+from Screens.MessageBox import MessageBox
+from Components.Sources.StaticText import StaticText
+from Plugins.Plugin import PluginDescriptor
+from Plugins.SystemPlugins.ManualFancontrol.InstandbyOn import instandbyon
+import NavigationInstance
+
+class ManualFancontrol(Screen,ConfigListScreen):
+ skin = """
+ <screen name="ManualFancontrol" position="center,center" size="560,300" title="Fancontrol Settings in Standby mode" >
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="10,10" size="25,25" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/buttons/green.png" position="290,10" size="25,25" alphatest="on" />
+ <widget source="key_red" render="Label" position="40,10" zPosition="1" size="140,25" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget source="key_green" render="Label" position="320,10" zPosition="1" size="140,25" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget name="config" zPosition="2" position="5,50" size="550,200" scrollbarMode="showOnDemand" transparent="1" />
+ <widget source="current" render="Label" position="150,270" zPosition="1" size="280,30" font="Regular;20" halign="center" valign="center" transparent="1" />
+ </screen>"""
+
+ def __init__(self,session):
+ Screen.__init__(self,session)
+ self.session = session
+ self["shortcuts"] = ActionMap(["ShortcutActions", "SetupActions" ],
+ {
+ "ok": self.keySave,
+ "cancel": self.keyCancel,
+ "red": self.keyCancel,
+ "green": self.keySave,
+ }, -2)
+ self.list = []
+ ConfigListScreen.__init__(self, self.list,session = self.session)
+ self["key_red"] = StaticText(_("Cancel"))
+ self["key_green"] = StaticText(_("Save"))
+ self["current"] = StaticText(_(" "))
+ self.configSetup()
+ self.oldfanoffmode = instandbyon.fanoffmode
+ if instandbyon.fanoffmode is 'ON' :
+ instandbyon.checkStatusLoopStop()
+
+ def displayCurrentValue(self):
+ currrent_val = self["config"].getCurrent()[0]+" : "+str(self["config"].getCurrent()[1].value)
+ self["current"].setText(_(currrent_val))
+ print currrent_val
+
+ def selectionChanged(self):
+ if self["config"].getCurrent() == self.pwmEntry:
+ instandbyon.setPWM(self["config"].getCurrent()[1].value)
+
+ def keyLeft(self):
+ oldpwmvalue=config.plugins.manualfancontrols.pwmvalue.value
+ ConfigListScreen.keyLeft(self)
+ if self["config"].getCurrent() == self.pwmEntry and oldpwmvalue == 5:
+ self.createSetup()
+ else:
+ self.displayCurrentValue()
+ self.selectionChanged()
+
+ def keyRight(self):
+ oldpwmvalue=config.plugins.manualfancontrols.pwmvalue.value
+ ConfigListScreen.keyRight(self)
+ if self["config"].getCurrent() == self.pwmEntry and oldpwmvalue == 0:
+ self.createSetup()
+ while self["config"].getCurrent() != self.pwmEntry:
+ self["config"].setCurrentIndex(self["config"].getCurrentIndex()+1)
+ else:
+ self.displayCurrentValue()
+ self.selectionChanged()
+
+ def createSetup(self):
+ self.list = []
+ if config.plugins.manualfancontrols.pwmvalue.value > 0:
+ self.list.append( self.standbyEntry )
+ self.list.append( self.pwmEntry )
+ self.list.append( self.periodEntry )
+ self["config"].list = self.list
+ self["config"].l.setList(self.list)
+
+ def configSetup(self):
+ self.standbyEntry = getConfigListEntry(_("FanOFF InStanby"), config.plugins.manualfancontrols.standbymode)
+ self.pwmEntry = getConfigListEntry(_("PWM value"), config.plugins.manualfancontrols.pwmvalue)
+ self.periodEntry = getConfigListEntry(_("Status Check Period"), config.plugins.manualfancontrols.checkperiod)
+ if not self.displayCurrentValue in self["config"].onSelectionChanged:
+ self["config"].onSelectionChanged.append(self.displayCurrentValue)
+ self.createSetup()
+
+ def keySave(self):
+ if instandbyon.fanoffmode is 'OFF' and config.plugins.manualfancontrols.pwmvalue.value == 0:
+ print "<SimpleFancontrol> instandbyon.fanoffmode 'OFF' -> 'ON'"
+ instandbyon.fanoffmode = 'ON'
+ instandbyon.addRecordEventCB()
+ instandbyon.checkStatusLoopStart()
+ elif instandbyon.fanoffmode is 'ON' and config.plugins.manualfancontrols.pwmvalue.value != 0:
+ print "<SimpleFancontrol> instandbyon.fanoffmode 'ON' -> 'OFF'"
+ instandbyon.fanoffmode = 'OFF'
+ instandbyon.removeRecordEventCB()
+# instandbyon.checkStatusLoopStop() # stoped at init
+ elif self.oldfanoffmode is 'ON' :
+ instandbyon.checkStatusLoopStart()
+ instandbyon.checkStstus()
+ ConfigListScreen.keySave(self)
+
+ def cancelConfirm(self, result):
+ if not result:
+ return
+ for x in self["config"].list:
+ x[1].cancel()
+ instandbyon.checkStstus()
+ self.oldfanoffmode = instandbyon.fanoffmode
+ if self.oldfanoffmode is 'ON' :
+ instandbyon.checkStatusLoopStart()
+ self.close()
+
+ def keyCancel(self):
+ if self["config"].isChanged():
+ self.session.openWithCallback(self.cancelConfirm, MessageBox, _("Really close without saving settings?"))
+ else:
+ instandbyon.checkStstus()
+ if self.oldfanoffmode is 'ON' :
+ instandbyon.checkStatusLoopStart()
+ self.close()
+
+def main(session, **kwargs):
+ session.open(ManualFancontrol)
+
+def Plugins(**kwargs):
+ return [PluginDescriptor(name=_("Manual Fan control"), description="setup Fancontol inStandby mode", where = PluginDescriptor.WHERE_PLUGINMENU, needsRestart = True, fnc=main)]
def go(self):
if self.update:
- self.session.openWithCallback(self.doUpdate, MessageBox, _("Do you want to update your Dreambox?\nAfter pressing OK, please wait!"))
+ self.session.openWithCallback(self.doUpdate, MessageBox, _("Do you want to update your STB?\nAfter pressing OK, please wait!"))
else:
self.close()
def go(self):
if self.update:
- self.session.openWithCallback(self.doUpdate, MessageBox, _("Do you want to update your Dreambox?\nAfter pressing OK, please wait!"))
+ self.session.openWithCallback(self.doUpdate, MessageBox, _("Do you want to update your STB?\nAfter pressing OK, please wait!"))
else:
self.close()
<packagename>enigma2-plugin-systemplugins-skinselector</packagename>
<shortdescription>SkinSelector shows a menu with selectable skins</shortdescription>
<description>The SkinSelector shows a menu with selectable skins.\n
- It's now easy to change the look and feel of your Dreambox.
+ It's now easy to change the look and feel of your STB.
</description>
<screenshot src="http://www.dreamboxupdate.com/preview/plugin_skinselector_en.jpg" />
</info>
self.skinlist.append(subdir)
else:
subdir = "Default Skin"
- self.skinlist.append(subdir)
+ #self.skinlist.append(subdir)
def ok(self):
if self["SkinList"].getCurrent() == "Default Skin":
def getUpdates(self, callback = None):
if self.lastDownloadDate is None:
- if self.hardware_info.device_name != "dm7025":
+ if 0:
etpm = eTPM()
l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
if l2cert is None:
return
val = etpm.challenge(rnd)
result = decrypt_block(val, l3key)
- if self.hardware_info.device_name == "dm7025" or result[80:88] == rnd:
+ if 1:
if self.NetworkConnectionAvailable == True:
self.lastDownloadDate = time()
if self.list_updating is False and callback is None:
self.NotifierCallback = callback
else:
if self.list_updating and callback is not None:
- if self.hardware_info.device_name != "dm7025":
+ if 0:
etpm = eTPM()
l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
if l2cert is None:
return
val = etpm.challenge(rnd)
result = decrypt_block(val, l3key)
- if self.hardware_info.device_name == "dm7025" or result[80:88] == rnd:
+ if self.hardware_info.device_name == "dm500hd" or result[80:88] == rnd:
self.NotifierCallback = callback
self.startIpkgListAvailable()
else:
<text value="Do you want to restore your settings?" />
<list>
<listentry caption="Yes, restore the settings now" step="restore" />
- <listentry caption="No, just start my dreambox" step="end" />
+ <listentry caption="No, just start my STB" step="end" />
</list>
<code>
self.clearSelectedKeys()
</step>
<step id="welcome">
- <text value="Welcome to the Image upgrade wizard. The wizard will assist you in upgrading the firmware of your Dreambox by providing a backup facility for your current settings and a short explanation of how to upgrade your firmware." />
+ <text value="Welcome to the Image upgrade wizard. The wizard will assist you in upgrading the firmware of your STB by providing a backup facility for your current settings and a short explanation of how to upgrade your firmware." />
<list>
<listentry caption="OK, guide me through the upgrade process" step="backupquestion" />
<listentry caption="Exit the wizard" step="end" />
</step>
<step id="upgrade">
- <text value="You need a PC connected to your dreambox. If you need further instructions, please visit the website http://www.dm7025.de.\nYour dreambox will now be halted. After you have performed the update instructions from the website, your new firmware will ask you to restore your settings." />
+ <text value="You need a PC connected to your STB. If you need further instructions, please visit the website http://www.dm7025.de.\nYour STB will now be halted. After you have performed the update instructions from the website, your new firmware will ask you to restore your settings." />
<list>
<listentry caption="Yes, perform a shutdown now." step="shutdown" />
<listentry caption="No, do nothing." step="end" />
from enigma import quitMainloop
quitMainloop(1)
</code>
- <text value="Your dreambox is shutting down. Please stand by..." />
+ <text value="Your STB is shutting down. Please stand by..." />
</step>
<step id="end" laststep="true">
self.backupdirs = ' '.join( config.plugins.configurationbackup.backupdirs.value )
if self.menu == 0:
print "building menu entries"
- self.list.append(("install-extensions", _("Manage extensions"), _("\nManage extensions or plugins for your Dreambox" ) + self.oktext, None))
- self.list.append(("software-update", _("Software update"), _("\nOnline update of your Dreambox software." ) + self.oktext, None))
- self.list.append(("software-restore", _("Software restore"), _("\nRestore your Dreambox with a new firmware." ) + self.oktext, None))
- self.list.append(("system-backup", _("Backup system settings"), _("\nBackup your Dreambox settings." ) + self.oktext + "\n\n" + self.infotext, None))
- self.list.append(("system-restore",_("Restore system settings"), _("\nRestore your Dreambox settings." ) + self.oktext, None))
+ self.list.append(("install-extensions", _("Manage extensions"), _("\nManage extensions or plugins for your STB" ) + self.oktext, None))
+ self.list.append(("software-update", _("Software update"), _("\nOnline update of your STB software." ) + self.oktext, None))
+ self.list.append(("software-restore", _("Software restore"), _("\nRestore your STB with a new firmware." ) + self.oktext, None))
+ self.list.append(("system-backup", _("Backup system settings"), _("\nBackup your STB settings." ) + self.oktext + "\n\n" + self.infotext, None))
+ self.list.append(("system-restore",_("Restore system settings"), _("\nRestore your STB settings." ) + self.oktext, None))
self.list.append(("ipkg-install", _("Install local extension"), _("\nScan for local extensions and install them." ) + self.oktext, None))
for p in plugins.getPlugins(PluginDescriptor.WHERE_SOFTWAREMANAGER):
if p.__call__.has_key("SoftwareSupported"):
currentEntry = current[0]
if self.menu == 0:
if (currentEntry == "software-update"):
- self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to update your Dreambox?")+"\n"+_("\nAfter pressing OK, please wait!"))
+ self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to update your STB?")+"\n"+_("\nAfter pressing OK, please wait!"))
elif (currentEntry == "software-restore"):
self.session.open(ImageWizard)
elif (currentEntry == "install-extensions"):
def runExecuteFinished(self):
self.reloadPluginlist()
if plugins.restartRequired or self.restartRequired:
- self.session.openWithCallback(self.ExecuteReboot, MessageBox, _("Install or remove finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.ExecuteReboot, MessageBox, _("Install or remove finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
else:
self.selectedFiles = []
self.restartRequired = False
elif cmd == 2:
info = args['package']
else:
- info = _("Dreambox software because updates are available.")
+ info = _("STB software because updates are available.")
self.list.append(self.buildEntryComponent(action,info))
self['list'].setList(self.list)
if self.packagefiles:
for package in self.packagefiles[:]:
self.cmdList.append((IpkgComponent.CMD_REMOVE, { "package": package["name"] }))
- if len(self.cmdList):
- self.session.openWithCallback(self.runRemove, MessageBox, _("Do you want to remove the package:\n") + self.pluginname + "\n" + self.oktext)
+ if len(self.cmdList):
+ self.session.openWithCallback(self.runRemove, MessageBox, _("Do you want to remove the package:\n") + self.pluginname + "\n" + self.oktext)
else:
if iSoftwareTools.NetworkConnectionAvailable:
if self.packagefiles:
for package in self.packagefiles[:]:
self.cmdList.append((IpkgComponent.CMD_INSTALL, { "package": package["name"] }))
- if len(self.cmdList):
- self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + self.pluginname + "\n" + self.oktext)
+ if len(self.cmdList):
+ self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + self.pluginname + "\n" + self.oktext)
def runUpgrade(self, result):
if result:
def runUpgradeFinished(self):
self.reloadPluginlist()
if plugins.restartRequired or self.restartRequired:
- self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Installation finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Installation finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
else:
self.close(True)
def UpgradeReboot(self, result):
self.updating = True
self.activityTimer.start(100, False)
self.package.setText(_("Package list update"))
- self.status.setText(_("Upgrading Dreambox... Please wait"))
+ self.status.setText(_("Upgrading STB... Please wait"))
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
else:
self.package.setText(_("Your network is not working. Please try again."))
else:
self.activityTimer.stop()
self.activityslider.setValue(0)
- error = _("your dreambox might be unusable now. Please consult the manual for further assistance before rebooting your dreambox.")
+ error = _("your STB might be unusable now. Please consult the manual for further assistance before rebooting your STB.")
if self.packages == 0:
error = _("No packages were upgraded yet. So you can check your network and try again.")
if self.updating:
- error = _("Your dreambox isn't connected to the internet properly. Please check it and try again.")
+ error = _("Your STB isn't connected to the internet properly. Please check it and try again.")
self.status.setText(_("Error") + " - " + error)
#print event, "-", param
pass
def exit(self):
if not self.ipkg.isRunning():
if self.packages != 0 and self.error == 0:
- self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?"))
+ self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your STB?"))
else:
self.close()
else:
self.session.openWithCallback(self.runRemoveFinished, Ipkg, cmdList = self.cmdList)
def runRemoveFinished(self):
- self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
def RemoveReboot(self, result):
if result is None:
self.session.openWithCallback(self.runUpgradeFinished, Ipkg, cmdList = self.cmdList)
def runUpgradeFinished(self):
- self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
def UpgradeReboot(self, result):
if result is None:
self.list.append(getConfigListEntry(_("Auto scart switching"), config.av.vcrswitch))
if level >= 1:
- self.list.append(getConfigListEntry(_("AC3 default"), config.av.defaultac3))
+ self.list.append(getConfigListEntry(_("Dolby Digital default"), config.av.defaultac3))
if SystemInfo["CanDownmixAC3"]:
- self.list.append(getConfigListEntry(_("AC3 downmix"), config.av.downmix_ac3))
+ self.list.append(getConfigListEntry(_("Dolby Digital downmix"), config.av.downmix_ac3))
self.list.extend((
- getConfigListEntry(_("General AC3 Delay"), config.av.generalAC3delay),
+ getConfigListEntry(_("General Dolby Digital Delay"), config.av.generalAC3delay),
getConfigListEntry(_("General PCM Delay"), config.av.generalPCMdelay)
))
--- /dev/null
+installdir = $(pkglibdir)/python/Plugins/SystemPlugins/WirelessLanSetup
+
+SUBDIRS = meta
+
+install_PYTHON = \
+ __init__.py \
+ plugin.py
--- /dev/null
+installdir = $(datadir)/meta
+
+dist_install_DATA = plugin_wirelesslansetup.xml
--- /dev/null
+<default>
+ <prerequisites>
+ <tag type="System" />
+ </prerequisites>
+ <info language="en">
+ <author>hschang</author>
+ <name>WirelessLanSetup</name>
+ <packagename>enigma2-plugin-systemplugins-wirelesslansetup</packagename>
+ <shortdescription>Wireless LAN Setup plugin</shortdescription>
+ <description>Wireless LAN setting and search AP and show status.
+ </description>
+ </info>
+ <files type="package"> <!-- without version, without .ipk -->
+ <file type="package" name="enigma2-plugin-systemplugins-wirelesslansetup" />
+ </files>
+
+</default>
--- /dev/null
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+from Screens.InputBox import InputBox
+from Screens.Standby import *
+from Screens.VirtualKeyBoard import VirtualKeyBoard
+from Screens.HelpMenu import HelpableScreen
+from Components.Network import iNetwork
+from Screens.NetworkSetup import NameserverSetup
+from Components.Sources.StaticText import StaticText
+from Components.Sources.Boolean import Boolean
+from Components.Sources.List import List
+from Components.Label import Label,MultiColorLabel
+from Components.Pixmap import Pixmap,MultiPixmap
+from Components.MenuList import MenuList
+from Components.config import config, ConfigYesNo, ConfigIP, NoSave, ConfigText, ConfigPassword, ConfigSelection, getConfigListEntry, ConfigNothing
+from Components.config import ConfigInteger, ConfigSubsection
+from Components.ConfigList import ConfigListScreen
+from Components.PluginComponent import plugins
+from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest
+from Components.ActionMap import ActionMap, NumberActionMap, HelpableActionMap
+from Components.Console import Console
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_SKIN
+from Tools.LoadPixmap import LoadPixmap
+from Plugins.Plugin import PluginDescriptor
+from enigma import eTimer, ePoint, eSize, RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont
+from os import path as os_path, system as os_system, unlink,listdir
+from re import compile as re_compile, search as re_search
+from Tools.Directories import fileExists
+import time
+
+class WlanSelection(Screen,HelpableScreen):
+ skin = """
+ <screen name="WlanSelection" position="209,48" size="865,623" title="Wireless Network Configuration..." flags="wfNoBorder" backgroundColor="transparent">
+ <ePixmap pixmap="Vu_HD/Bg_EPG_view.png" zPosition="-1" position="0,0" size="865,623" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/menu/ico_title_Setup.png" position="32,41" size="40,40" alphatest="blend" transparent="1" />
+ <eLabel text="Wireless Network Adapter Selection..." position="90,50" size="600,32" font="Semiboldit;32" foregroundColor="#5d5d5d" backgroundColor="#27b5b9bd" transparent="1" />
+ <ePixmap pixmap="Vu_HD/icons/clock.png" position="750,55" zPosition="1" size="20,20" alphatest="blend" />
+ <widget source="global.CurrentTime" render="Label" position="770,57" zPosition="1" size="50,20" font="Regular;20" foregroundColor="#1c1c1c" backgroundColor="#27d9dee2" halign="right" transparent="1">
+ <convert type="ClockToText">Format:%H:%M</convert>
+ </widget>
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="45,98" size="25,25" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/green.png" position="240,98" size="25,25" alphatest="blend" />
+ <widget source="key_red" render="Label" position="66,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="key_green" render="Label" position="268,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <ePixmap pixmap="Vu_HD/border_menu.png" position="120,140" zPosition="-1" size="342,358" transparent="1" alphatest="blend" />
+ <widget name="menulist" position="130,150" size="322,338" transparent="1" backgroundColor="#27d9dee2" zPosition="10" scrollbarMode="showOnDemand" />
+ <widget source="description" render="Label" position="500,140" size="280,360" font="Regular;19" halign="center" valign="center" backgroundColor="#c5c9cc" transparent="1"/>
+ </screen>"""
+
+ def __init__(self, session):
+ Screen.__init__(self,session)
+ HelpableScreen.__init__(self)
+ self.mainmenu = self.getWlandevice()
+ self["menulist"] = MenuList(self.mainmenu)
+ self["key_red"] = StaticText(_("Close"))
+ self["key_green"] = StaticText(_("Select"))
+ self["description"] = StaticText()
+ self["description"].setText(_("Select Wireless Lan module. \n" ))
+ self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
+ {
+ "ok": (self.ok, _("select interface")),
+ "cancel": (self.close, _("exit network interface list")),
+ })
+
+ self["ColorActions"] = HelpableActionMap(self, "ColorActions",
+ {
+ "green": (self.ok, _("select interface")),
+ "red": (self.close, _("exit network interface list")),
+ })
+ self.updateInterfaces()
+ self.onClose.append(self.cleanup)
+
+ def updateInterfaces(self):
+ iNetwork.config_ready = False
+ iNetwork.msgPlugins()
+ iNetwork.getInterfaces()
+
+ def ok(self):
+# print len(self["menulist"].list)
+ if len(self["menulist"].list) == 0:
+ self.session.open(MessageBox, (_("Can not find any WirelessLan Module\n")),MessageBox.TYPE_ERROR,5 )
+ return
+ ifaces=self["menulist"].getCurrent()[1]
+ if ifaces == None:
+ pass
+ else:
+ self.session.open(WlanSetup,ifaces)
+
+ def getWlandevice(self):
+ list = []
+ for x in iNetwork.getInstalledAdapters():
+ if x.startswith('eth'):
+ continue
+ description=self.getAdapterDescription(x)
+ if description == "Unknown network adapter":
+ list.append((description,x))
+ else:
+ list.append((description + " (%s)"%x,x))
+ return list
+
+ def getAdapterDescription(self, iface):
+ classdir = "/sys/class/net/" + iface + "/device/"
+ driverdir = "/sys/class/net/" + iface + "/device/driver/"
+ if os_path.exists(classdir):
+ files = listdir(classdir)
+ if 'driver' in files:
+ if os_path.realpath(driverdir).endswith('rtw_usb_drv'):
+ return _("Realtak")+ " " + _("WLAN adapter.")
+ elif os_path.realpath(driverdir).endswith('ath_pci'):
+ return _("Atheros")+ " " + _("WLAN adapter.")
+ elif os_path.realpath(driverdir).endswith('zd1211b'):
+ return _("Zydas")+ " " + _("WLAN adapter.")
+ elif os_path.realpath(driverdir).endswith('rt73'):
+ return _("Ralink")+ " " + _("WLAN adapter.")
+ elif os_path.realpath(driverdir).endswith('rt73usb'):
+ return _("Ralink")+ " " + _("WLAN adapter.")
+ else:
+ return str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter")
+ else:
+ return _("Unknown network adapter")
+ else:
+ return _("Unknown network adapter")
+
+ def cleanup(self):
+ iNetwork.stopGetInterfacesConsole()
+
+class WlanSetup(Screen,HelpableScreen):
+ skin = """
+ <screen name="WlanSetup" position="209,48" size="865,623" title="Wireless Network Configuration..." flags="wfNoBorder" backgroundColor="transparent">
+ <ePixmap pixmap="Vu_HD/Bg_EPG_view.png" zPosition="-1" position="0,0" size="865,623" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/menu/ico_title_Setup.png" position="32,41" size="40,40" alphatest="blend" transparent="1" />
+ <eLabel text="Wireless Network Setup Menu..." position="90,50" size="600,32" font="Semiboldit;32" foregroundColor="#5d5d5d" backgroundColor="#27b5b9bd" transparent="1" />
+ <ePixmap pixmap="Vu_HD/icons/clock.png" position="750,55" zPosition="1" size="20,20" alphatest="blend" />
+ <widget source="global.CurrentTime" render="Label" position="770,57" zPosition="1" size="50,20" font="Regular;20" foregroundColor="#1c1c1c" backgroundColor="#27d9dee2" halign="right" transparent="1">
+ <convert type="ClockToText">Format:%H:%M</convert>
+ </widget>
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="45,98" size="25,25" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/green.png" position="240,98" size="25,25" alphatest="blend" />
+ <widget source="key_red" render="Label" position="66,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="key_green" render="Label" position="268,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <ePixmap pixmap="Vu_HD/border_menu.png" position="120,140" zPosition="-1" size="342,358" transparent="1" alphatest="blend" />
+ <widget name="menulist" position="130,150" size="322,338" transparent="1" backgroundColor="#27d9dee2" zPosition="10" scrollbarMode="showOnDemand" />
+ <widget source="description" render="Label" position="500,140" size="280,360" font="Regular;19" halign="center" valign="center" backgroundColor="#c5c9cc" transparent="1"/>
+ </screen>"""
+ def __init__(self, session, ifaces):
+ Screen.__init__(self, session)
+ HelpableScreen.__init__(self)
+ self.session = session
+ self.iface = ifaces
+ self.restartLanRef = None
+ self.LinkState = None
+ self.mainmenu = self.MakeMenu()
+ self["menulist"] = MenuList(self.mainmenu)
+ self["key_red"] = StaticText(_("Close"))
+ self["key_green"] = StaticText(_("Select"))
+ self["description"] = StaticText()
+ self["IFtext"] = StaticText()
+ self["IF"] = StaticText()
+ self["Statustext"] = StaticText()
+ self["statuspic"] = MultiPixmap()
+ self["statuspic"].hide()
+ self.onLayoutFinish.append(self.loadDescription)
+
+ self.oktext = _("Press OK on your remote control to continue.")
+
+ self["WizardActions"] = HelpableActionMap(self, "WizardActions",
+ {
+ "up": (self.up, _("move up to previous entry")),
+ "down": (self.down, _("move down to next entry")),
+ "left": (self.left, _("move up to first entry")),
+ "right": (self.right, _("move down to last entry")),
+ })
+
+ self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
+ {
+ "cancel": (self.close, _("exit networkadapter setup menu")),
+ "ok": (self.ok, _("select menu entry")),
+ })
+
+ self["ColorActions"] = HelpableActionMap(self, "ColorActions",
+ {
+ "red": (self.close, _("exit networkadapter setup menu")),
+ "green": (self.ok, _("select menu entry")),
+ })
+
+ self["actions"] = NumberActionMap(["WizardActions","ShortcutActions"],
+ {
+ "ok": self.ok,
+ "back": self.close,
+ "up": self.up,
+ "down": self.down,
+ "red": self.close,
+ "left": self.left,
+ "right": self.right,
+ }, -2)
+ self.onClose.append(self.cleanup)
+
+ def loadDescription(self):
+ if self["menulist"].getCurrent()[1] == 'setting':
+ self["description"].setText(_("Edit the network configuration of your STB.\n" ) + self.oktext )
+ if self["menulist"].getCurrent()[1] == 'scanap':
+ self["description"].setText(_("Scan your network for wireless access points and connect to them using your selected wireless device.\n" ) + self.oktext )
+ if self["menulist"].getCurrent()[1] == 'dns':
+ self["description"].setText(_("Edit the Nameserver configuration of your STB.\n" ) + self.oktext )
+ if self["menulist"].getCurrent()[1] == 'status':
+ self["description"].setText(_("Shows the state of your wireless LAN connection.\n" ) + self.oktext )
+ if self["menulist"].getCurrent()[1] == 'test':
+ self["description"].setText(_("Test the network configuration of your STB.\n" ) + self.oktext )
+ if self["menulist"].getCurrent()[1] == 'restart':
+ self["description"].setText(_("Restart your network connection and interfaces.\n" ) + self.oktext )
+
+ def up(self):
+ self["menulist"].up()
+ self.loadDescription()
+
+ def down(self):
+ self["menulist"].down()
+ self.loadDescription()
+
+ def left(self):
+ self["menulist"].pageUp()
+ self.loadDescription()
+
+ def right(self):
+ self["menulist"].pageDown()
+ self.loadDescription()
+
+ def ok(self):
+ self.cleanup()
+ if self["menulist"].getCurrent()[1] == 'setting':
+ self.session.openWithCallback(self.checklist, WlanConfig, self.iface)
+ elif self["menulist"].getCurrent()[1] == 'scanap':
+ self.session.open(WlanScanAp, self.iface)
+ elif self["menulist"].getCurrent()[1] == 'dns':
+ self.session.open(NameserverSetup)
+ elif self["menulist"].getCurrent()[1] == 'status':
+ self.session.open(Wlanstatus, self.iface)
+ elif self["menulist"].getCurrent()[1] == 'test':
+ self.session.openWithCallback(self.checklist,NetworkAdapterTest,self.iface)
+ elif self["menulist"].getCurrent()[1] == 'restart':
+ self.session.openWithCallback(self.restartLan, MessageBox, (_("Are you sure you want to restart your network interfaces?\n\n") + self.oktext ) )
+
+ def checklist(self):
+ self["menulist"].setList(self.MakeMenu())
+
+ def MakeMenu(self):
+ menu = []
+ menu.append((_("Adapter settings"), "setting"))
+ menu.append((_("Scan Wireless AP"), "scanap"))
+ menu.append((_("Nameserver settings"), "dns"))
+ if iNetwork.getAdapterAttribute(self.iface, "up"):
+ menu.append((_("Show WLAN Status"), "status"))
+ menu.append((_("Network test"), "test"))
+ menu.append((_("Restart network"), "restart"))
+
+ return menu
+
+ def restartLan(self, ret = False):
+ if (ret == True):
+ iNetwork.restartNetwork(self.restartLanDataAvail)
+ self.restartLanRef = self.session.openWithCallback(self.restartfinishedCB, MessageBox, _("Please wait while your network is restarting..."), type = MessageBox.TYPE_INFO, enable_input = False)
+
+ def restartLanDataAvail(self, data):
+ if data is True:
+ iNetwork.getInterfaces(self.getInterfacesDataAvail)
+
+ def getInterfacesDataAvail(self, data):
+ if data is True:
+ self.restartLanRef.close(True)
+
+ def restartfinishedCB(self,data):
+ if data is True:
+ self.session.open(MessageBox, _("Finished restarting your network"), type = MessageBox.TYPE_INFO, timeout = 5, default = False)
+
+ def cleanup(self):
+ iNetwork.stopRestartConsole()
+ iNetwork.stopGetInterfacesConsole()
+
+wlanconfig = ConfigSubsection()
+wlanconfig.usedevice = ConfigSelection(default = "off", choices = [
+ ("off", _("off")), ("on", _("on"))])
+wlanconfig.usedhcp = ConfigSelection(default = "off", choices = [
+ ("off", _("no")), ("on", _("yes"))])
+wlanconfig.essid = ConfigSelection(default = "none", choices = ["none"])
+wlanconfig.encrypt = ConfigSelection(default = "off", choices = [
+ ("off", _("no")), ("on", _("yes"))])
+wlanconfig.method = ConfigSelection(default = "wep", choices = [
+ ("wep", _("WEP")), ("wpa", _("WPA")), ("wpa2", _("WPA2")),("wpa/wpa2", _("WPA/WPA2"))])
+wlanconfig.keytype = ConfigSelection(default = "ascii", choices = [
+ ("ascii", _("ASCII")), ("hex", _("HEX"))])
+wlanconfig.key = ConfigText(default = "XXXXXXXX", visible_width = 50, fixed_size = False)
+wlanconfig.usegateway = ConfigSelection(default = "off", choices = [
+ ("off", _("no")), ("on", _("yes"))])
+wlanconfig.ip = ConfigIP([0,0,0,0])
+wlanconfig.netmask = ConfigIP([0,0,0,0])
+wlanconfig.gateway = ConfigIP([0,0,0,0])
+
+selectap = None
+class WlanConfig(Screen, ConfigListScreen, HelpableScreen):
+ skin = """
+ <screen name="WlanConfig" position="209,48" size="865,623" title="Wireless Network Configuration..." flags="wfNoBorder" backgroundColor="transparent">
+ <ePixmap pixmap="Vu_HD/Bg_EPG_view.png" zPosition="-1" position="0,0" size="865,623" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/menu/ico_title_Setup.png" position="32,41" size="40,40" alphatest="blend" transparent="1" />
+ <eLabel text="Wireless Network Configuration..." position="90,50" size="600,32" font="Semiboldit;32" foregroundColor="#5d5d5d" backgroundColor="#27b5b9bd" transparent="1" />
+ <ePixmap pixmap="Vu_HD/icons/clock.png" position="750,55" zPosition="1" size="20,20" alphatest="blend" />
+ <widget source="global.CurrentTime" render="Label" position="770,57" zPosition="1" size="50,20" font="Regular;20" foregroundColor="#1c1c1c" backgroundColor="#27d9dee2" halign="right" transparent="1">
+ <convert type="ClockToText">Format:%H:%M</convert>
+ </widget>
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="45,98" size="25,25" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/green.png" position="240,98" size="25,25" alphatest="blend" />
+ <widget source="key_red" render="Label" position="66,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="key_grean" render="Label" position="268,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <ePixmap pixmap="Vu_HD/border_menu.png" position="120,140" zPosition="-1" size="342,358" transparent="1" alphatest="blend" />
+ <widget name="config" position="130,150" size="322,338" transparent="1" backgroundColor="#27d9dee2" zPosition="10" scrollbarMode="showOnDemand" />
+ <eLabel text="IP Address : " position="500,160" size="200,26" font="Semiboldit;22" foregroundColor="#5d5d5d" backgroundColor="#27b5b9bd" transparent="1" />
+ <widget source="ipaddress" render="Label" position="530,190" zPosition="1" size="150,26" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ <eLabel text="NetMask : " position="500,220" size="200,26" font="Semiboldit;22" foregroundColor="#5d5d5d" backgroundColor="#27b5b9bd" transparent="1" />
+ <widget source="netmask" render="Label" position="530,250" zPosition="1" size="150,26" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ <eLabel text="Gateway : " position="500,280" size="200,26" font="Semiboldit;22" foregroundColor="#5d5d5d" backgroundColor="#27b5b9bd" transparent="1" />
+ <widget source="gateway" render="Label" position="530,310" zPosition="1" size="150,26" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ </screen>"""
+
+ def __init__(self, session, iface):
+ Screen.__init__(self,session)
+ self.session = session
+ self["key_red"] = StaticText(_("Close"))
+ self["key_grean"] = StaticText(_("Ok"))
+ self["ipaddress"] = StaticText(_("[ N/A ]"))
+ self["netmask"] = StaticText(_("[ N/A ]"))
+ self["gateway"] = StaticText(_("[ N/A ]"))
+ self["OkCancelActions"] = ActionMap(["ShortcutActions", "SetupActions" ],
+ {
+ "ok": self.saveWlanConfig,
+ "green": self.saveWlanConfig,
+ "cancel": self.keyCancel,
+ "red": self.keyCancel,
+ }, -2)
+ self.iface = iface
+ self.ssid = None
+ self.ap_scan = None
+ self.scan_ssid = None
+ self.key_mgmt = None
+ self.proto = None
+ self.key_type = None
+ self.encryption_key = None
+ self.wlanscanap = None
+# self.scanAPcount =5
+ self.scanAPcount =1
+ self.list = []
+ ConfigListScreen.__init__(self, self.list,session = self.session)
+ self.oldInterfaceState = iNetwork.getAdapterAttribute(self.iface, "up")
+ self.readWpaSupplicantConf()
+ self.scanAPFailedTimer = eTimer()
+ self.scanAPFailedTimer.callback.append(self.scanAPFailed)
+ self.scanAplistTimer = eTimer()
+ self.scanAplistTimer.callback.append(self.scanApList)
+ self.Console = Console()
+# self.scanAplistTimer.start(100,True)
+ self.updateInterfaces(self.readWlanSettings)
+ self.onClose.append(self.cleanup)
+
+ def updateInterfaces(self,callback = None):
+ iNetwork.config_ready = False
+ iNetwork.msgPlugins()
+ iNetwork.getInterfaces(callback)
+
+ def readWlanSettings(self,ret=None):
+ if ret is not True:
+ print "getInterfaces Fail... "
+ if iNetwork.getAdapterAttribute(self.iface, "up") == True:
+ default_tmp = "on"
+ else:
+ default_tmp = "off"
+ wlanconfig.usedevice = ConfigSelection(default=default_tmp, choices = [("off", _("off")), ("on", _("on"))])
+
+ if iNetwork.getAdapterAttribute(self.iface, "dhcp"):
+ default_tmp = "on"
+ else:
+ default_tmp = "off"
+ wlanconfig.usedhcp = ConfigSelection(default=default_tmp, choices = [("off", _("no")), ("on", _("yes"))])
+
+ wlanconfig.ip = ConfigIP(default=iNetwork.getAdapterAttribute(self.iface, "ip")) or [0,0,0,0]
+
+ wlanconfig.netmask = ConfigIP(default=iNetwork.getAdapterAttribute(self.iface, "netmask") or [255,0,0,0])
+ if iNetwork.getAdapterAttribute(self.iface, "gateway"):
+ default_tmp = "on"
+ else:
+ default_tmp = "off"
+ wlanconfig.usegateway = ConfigSelection(default = default_tmp, choices = [("off", _("no")), ("on", _("yes"))])
+
+ wlanconfig.gateway = ConfigIP(default=iNetwork.getAdapterAttribute(self.iface, "gateway") or [0,0,0,0])
+
+ self["ipaddress"].setText(_(self.formatip(iNetwork.getAdapterAttribute(self.iface, "ip"))))
+ self["netmask"].setText(_(self.formatip(iNetwork.getAdapterAttribute(self.iface, "netmask"))))
+ self["gateway"].setText(_(self.formatip(iNetwork.getAdapterAttribute(self.iface, "gateway"))))
+
+ if self.encryption_key is not None:
+ default_tmp = "on"
+ else:
+ default_tmp = "off"
+ wlanconfig.encrypt = ConfigSelection(default = default_tmp, choices = [("off", _("no")), ("on", _("yes"))])
+
+ if self.key_mgmt=="NONE":
+ default_tmp = "wep"
+ elif self.key_mgmt == "WPA-PSK":
+ if self.proto == "WPA":
+ default_tmp = "wpa"
+ elif self.proto == "RSN":
+ default_tmp = "wpa2"
+ elif self.proto in ( "WPA RSN", "WPA WPA2"):
+ default_tmp = "wpa/wpa2"
+ else:
+ default_tmp = "wpa"
+ else:
+ default_tmp = "wep"
+
+ wlanconfig.method = ConfigSelection(default = default_tmp, choices = [
+ ("wep", _("WEP")), ("wpa", _("WPA")), ("wpa2", _("WPA2")),("wpa/wpa2", _("WPA/WPA2"))])
+
+ if self.key_type == 0:
+ default_tmp = "hex"
+ else:
+ default_tmp = "ascii"
+ wlanconfig.keytype = ConfigSelection(default = default_tmp, choices = [
+ ("ascii", _("ASCII")), ("hex", _("HEX"))])
+ default_tmp = self.encryption_key or "XXXXXXXX"
+ wlanconfig.key = ConfigText(default = default_tmp, visible_width = 50, fixed_size = False)
+ self.scanAplistTimer.start(100,True)
+
+ def readWpaSupplicantConf(self):
+ try:
+ if fileExists("/etc/wpa_supplicant.conf"):
+ wpafd = open("/etc/wpa_supplicant.conf","r")
+ if wpafd >0:
+ data = wpafd.readline()
+ while len(data) > 0:
+# print "####readWpaSupplicantConf, data : ",data
+ data = data.lstrip()
+ if len(data) == 0:
+ data = wpafd.readline()
+ continue
+ if data.startswith('ssid=') and len(data) > 6:
+ self.ssid = data[6:-2]
+ elif data.startswith('ap_scan=') :
+ self.ap_scan = data[8:]
+# print "####readWpaSupplicantConf, ap_scan : ",self.ap_scan
+ elif data.startswith('scan_ssid=') and len(data) > 10:
+ self.scan_ssid = data[10:-1]
+ elif data.startswith('key_mgmt=') and len(data) > 9:
+ self.key_mgmt = data[9:-1]
+ elif data.startswith('proto=') and len(data) > 6:
+ self.proto = data[6:-1]
+ elif data.startswith('wep_key0="') and len(data) > 11:
+ self.key_type = 1 # ascii
+ self.encryption_key = data[10:-2]
+ elif data.startswith('wep_key0=') and len(data) > 9:
+ self.key_type = 0 # hex
+ self.encryption_key = data[9:-1]
+ elif data.startswith('psk="') and len(data) > 6:
+ self.key_type = 1 # ascii
+ self.encryption_key = data[5:-2]
+ elif data.startswith('psk=') and len(data) > 4:
+ self.key_type = 0 # hex
+ self.encryption_key = data[4:-1]
+ data = wpafd.readline()
+ print self.ssid,self.scan_ssid,self.key_mgmt,self.proto,self.key_type,self.encryption_key
+ wpafd.close()
+ else:
+ print 'read error'
+ else:
+ pass
+ except:
+ print 'failed loading wpasupplicant.conf'
+
+ def createConfig(self):
+ self.configList=[]
+ self.usedeviceEntry = getConfigListEntry(_("Use Device"), wlanconfig.usedevice)
+ self.usedhcpEntry = getConfigListEntry(_("Use DHCP"), wlanconfig.usedhcp)
+ self.essidEntry = getConfigListEntry(_("ESSID"), wlanconfig.essid)
+ self.hiddenessidEntry = getConfigListEntry(_("Input Hidden ESSID"), wlanconfig.hiddenessid)
+ self.encryptEntry = getConfigListEntry(_("Encrypt"), wlanconfig.encrypt)
+ self.methodEntry = getConfigListEntry(_("Method"), wlanconfig.method)
+ self.keytypeEntry = getConfigListEntry(_("Key Type"), wlanconfig.keytype)
+ self.keyEntry = getConfigListEntry(_("KEY"), wlanconfig.key)
+
+ self.ipEntry = getConfigListEntry(_("IP"), wlanconfig.ip)
+ self.netmaskEntry = getConfigListEntry(_("NetMask"), wlanconfig.netmask)
+
+ self.usegatewayEntry = getConfigListEntry(_("Use Gateway"), wlanconfig.usegateway)
+ self.gatewayEntry = getConfigListEntry(_("Gateway"), wlanconfig.gateway)
+
+ self.configList.append( self.usedeviceEntry )
+ if wlanconfig.usedevice.value is "on":
+ self.configList.append( self.usedhcpEntry )
+ if wlanconfig.usedhcp.value is "off":
+ self.configList.append(self.ipEntry)
+ self.configList.append(self.netmaskEntry)
+ self.configList.append(self.usegatewayEntry)
+ if wlanconfig.usegateway.value is "on":
+ self.configList.append(self.gatewayEntry)
+ self.configList.append( self.essidEntry )
+# print "#### wlanconfig.essid.value : ",wlanconfig.essid.value
+ if wlanconfig.essid.value == 'Input hidden ESSID':
+ self.configList.append( self.hiddenessidEntry )
+ self.configList.append( self.encryptEntry )
+ if wlanconfig.encrypt.value is "on" :
+ self.configList.append( self.methodEntry )
+ self.configList.append( self.keytypeEntry )
+ self.configList.append( self.keyEntry )
+
+ self["config"].list = self.configList
+ self["config"].l.setList(self.configList)
+# if not self.selectionChanged in self["config"].onSelectionChanged:
+# self["config"].onSelectionChanged.append(self.selectionChanged)
+
+ def scanApList(self):
+ self.apList = []
+ self.configurationmsg = self.session.open(MessageBox, _("Please wait for scanning AP..."), type = MessageBox.TYPE_INFO, enable_input = False)
+ cmd = "ifconfig "+self.iface+" up"
+ print 'cmd ',cmd
+ os_system(cmd)
+ self.wlanscanap = Console()
+ cmd = "iwlist "+self.iface+" scan"
+ print 'cmd ',cmd
+ self.wlanscanap.ePopen(cmd, self.apListFinnished,self.apListParse)
+
+ def apListFinnished(self, result, retval,extra_args):
+ (callback) = extra_args
+ if self.wlanscanap is not None:
+ if retval == 0:
+ self.wlanscanap = None
+ content = result.splitlines()
+ first = content[0].split()
+ completed = False
+ for x in first:
+ if x == 'completed':
+ completed = True
+ if completed == True:
+ callback(result)
+ else:
+ callback(0)
+ else:
+ callback(0)
+
+ def apListParse(self,data):
+ global selectap
+ if data == 0:
+ if self.scanAPcount >0:
+ self.scanAPcount -=1
+ self.configurationmsg.close(True)
+ time.sleep(3)
+ self.scanAplistTimer.start(500,True)
+ return
+ else:
+ self.configurationmsg.close(True)
+ self.scanAPFailedTimer.start(500,True)
+ return
+ else:
+ self.apList = []
+# self.scanAPcount =5
+ self.scanAPcount =0
+ list = data.splitlines()
+ for x in list:
+ xx = x.lstrip()
+ if xx.startswith('ESSID:') and len(xx)>8 and xx[7:-1]not in self.apList:
+ self.apList.append(xx[7:-1])
+ self.apList.append('Input hidden ESSID')
+# print "###### selectap : ",selectap
+ if selectap is not None and selectap in self.apList:
+ wlanconfig.essid = ConfigSelection(default=selectap,choices = self.apList)
+ elif self.ap_scan is not None and self.ap_scan.strip() == '2':
+ wlanconfig.essid = ConfigSelection(default='Input hidden ESSID',choices = self.apList)
+ elif self.ssid is not None and self.ssid in self.apList:
+ wlanconfig.essid = ConfigSelection(default=self.ssid,choices = self.apList)
+ else:
+ wlanconfig.essid = ConfigSelection(choices = self.apList)
+ if self.ssid is not None:
+ wlanconfig.hiddenessid = ConfigText(default = self.ssid, visible_width = 50, fixed_size = False)
+ else:
+ wlanconfig.hiddenessid = ConfigText(default = "<Input ESSID>", visible_width = 50, fixed_size = False)
+ self.configurationmsg.close(True)
+ self.createConfig()
+
+ def scanAPFailed(self):
+ self.session.openWithCallback(self.keyCancel ,MessageBox, _("Scan AP Failed"), MessageBox.TYPE_ERROR,10)
+
+ def keyLeft(self):
+ ConfigListScreen.keyLeft(self)
+ self.newConfig()
+
+ def keyRight(self):
+ ConfigListScreen.keyRight(self)
+ self.newConfig()
+
+ def newConfig(self):
+ if self["config"].getCurrent() == self.usedeviceEntry or self["config"].getCurrent() == self.encryptEntry \
+ or self["config"].getCurrent() == self.usedhcpEntry or self["config"].getCurrent() == self.usegatewayEntry \
+ or self["config"].getCurrent() == self.essidEntry:
+ self.createConfig()
+
+ def saveWlanConfig(self):
+ if self["config"].getCurrent() == self.keyEntry or self["config"].getCurrent() == self.hiddenessidEntry :
+ self["config"].getCurrent()[1].onDeselect(self.session)
+ if self["config"].isChanged():
+ self.session.openWithCallback(self.checkNetworkShares, MessageBox, (_("Are you sure you want to restart your network interfaces?\n") ) )
+ else:
+ self.session.openWithCallback(self.checkNetworkShares, MessageBox, (_("Network configuration is not changed....\n\nAre you sure you want to restart your network interfaces?\n") ) )
+
+ def checkNetworkShares(self,ret = False):
+ if ret == False:
+ if self["config"].getCurrent() == self.keyEntry or self["config"].getCurrent() == self.hiddenessidEntry :
+ self["config"].getCurrent()[1].onSelect(self.session)
+ return
+ if not self.Console:
+ self.Console = Console()
+ cmd = "cat /proc/mounts"
+ self.Console.ePopen(cmd, self.checkSharesFinished, self.confirmAnotherIfaces)
+
+ def checkSharesFinished(self, result, retval, extra_args):
+ callback = extra_args
+ print "checkMountsFinished : result : \n",result
+ networks = ['nfs','smbfs','ncp','coda']
+ for line in result.splitlines():
+ split = line.strip().split(' ',3)
+ if split[2] in networks:
+ self.session.open(MessageBox, ("NOT deconfiguring network interfaces :\n network shares still mounted\n"), type = MessageBox.TYPE_ERROR, timeout = 10)
+ callback(False)
+ if self["config"].getCurrent() == self.keyEntry or self["config"].getCurrent() == self.hiddenessidEntry :
+ self["config"].getCurrent()[1].onSelect(self.session)
+ return
+ callback(True)
+
+ def confirmAnotherIfaces(self, ret = False):
+ if ret == False:
+ return
+ else:
+ num_configured_if = len(iNetwork.getConfiguredAdapters())
+ if num_configured_if >= 1:
+ if num_configured_if == 1 and self.iface in iNetwork.getConfiguredAdapters():
+ self.writeWlanConfig(False)
+ else:
+ self.session.openWithCallback(self.writeWlanConfig, MessageBox, _("A second configured interface has been found.\n\nDo you want to disable the second network interface?"), default = True)
+ else:
+ self.writeWlanConfig(False)
+
+ def writeWlanConfig(self,ret = False):
+ if ret == True:
+ configuredInterfaces = iNetwork.getConfiguredAdapters()
+ for interface in configuredInterfaces:
+ if interface == self.iface:
+ continue
+ iNetwork.setAdapterAttribute(interface, "up", False)
+ iNetwork.deactivateInterface(interface)
+ ret=self.writeWpasupplicantConf()
+ if ret == -1:
+ self.session.open(MessageBox, _("wpa_supplicant.conf open error."), type = MessageBox.TYPE_ERROR, timeout = 10)
+ return
+ elif ret == -2:
+ self.session.open(MessageBox, _("hidden ESSID empty"), type = MessageBox.TYPE_ERROR, timeout = 10)
+ return
+
+ if wlanconfig.usedevice.value=="on":
+ iNetwork.setAdapterAttribute(self.iface, "up", True)
+ if wlanconfig.usedhcp.value =="on":
+ iNetwork.setAdapterAttribute(self.iface, "dhcp", True)
+ else:
+ iNetwork.setAdapterAttribute(self.iface, "dhcp", False)
+ iNetwork.setAdapterAttribute(self.iface, "ip", wlanconfig.ip.value)
+ iNetwork.setAdapterAttribute(self.iface, "netmask", wlanconfig.netmask.value)
+ if wlanconfig.usegateway.value == "on":
+ iNetwork.setAdapterAttribute(self.iface, "gateway", wlanconfig.gateway.value)
+ else:
+ iNetwork.setAdapterAttribute(self.iface, "up", False)
+ iNetwork.deactivateInterface(self.iface)
+ contents = "\tpre-up wpa_supplicant -i"+self.iface+" -c/etc/wpa_supplicant.conf -B -D"+iNetwork.detectWlanModule(self.iface)+"\n"
+ contents += "\tpost-down wpa_cli terminate\n\n"
+ iNetwork.setAdapterAttribute(self.iface, "configStrings", contents)
+ iNetwork.writeNetworkConfig()
+ iNetwork.restartNetwork(self.updateCurrentInterfaces)
+ self.configurationmsg = None
+ self.configurationmsg = self.session.openWithCallback(self.configFinished, MessageBox, _("Please wait for activation of your network configuration..."), type = MessageBox.TYPE_INFO, enable_input = False)
+
+ def writeWpasupplicantConf(self):
+ wpafd = open("/etc/wpa_supplicant.conf","w")
+ if wpafd > 0:
+ contents = "#WPA Supplicant Configuration by STB\n"
+ contents += "ctrl_interface=/var/run/wpa_supplicant\n"
+ contents += "eapol_version=1\n"
+ contents += "fast_reauth=1\n"
+
+ if wlanconfig.essid.value == 'Input hidden ESSID':
+ contents += "ap_scan=2\n"
+ else :
+ contents += "ap_scan=1\n"
+ contents += "network={\n"
+ if wlanconfig.essid.value == 'Input hidden ESSID':
+ if len(wlanconfig.hiddenessid.value) == 0:
+ wpafd.close()
+ return -2
+ contents += "\tssid=\""+wlanconfig.hiddenessid.value+"\"\n"
+ else :
+ contents += "\tssid=\""+wlanconfig.essid.value+"\"\n"
+ contents += "\tscan_ssid=0\n"
+ if wlanconfig.encrypt.value == "on":
+ if wlanconfig.method.value =="wep":
+ contents += "\tkey_mgmt=NONE\n"
+ contents += "\twep_key0="
+ elif wlanconfig.method.value == "wpa":
+ contents += "\tkey_mgmt=WPA-PSK\n"
+ contents += "\tproto=WPA\n"
+ contents += "\tpairwise=CCMP TKIP\n"
+ contents += "\tgroup=CCMP TKIP\n"
+ contents += "\tpsk="
+ elif wlanconfig.method.value == "wpa2":
+ contents += "\tkey_mgmt=WPA-PSK\n"
+ contents += "\tproto=RSN\n"
+ contents += "\tpairwise=CCMP TKIP\n"
+ contents += "\tgroup=CCMP TKIP\n"
+ contents += "\tpsk="
+ else:
+ contents += "\tkey_mgmt=WPA-PSK\n"
+ contents += "\tproto=WPA RSN\n"
+ contents += "\tpairwise=CCMP TKIP\n"
+ contents += "\tgroup=CCMP TKIP\n"
+ contents += "\tpsk="
+ if wlanconfig.keytype.value == "ascii":
+ contents += "\""+wlanconfig.key.value+"\"\n"
+ else:
+ contents += wlanconfig.key.value+"\n"
+ else:
+ contents += "\tkey_mgmt=NONE\n"
+ contents += "}\n"
+ print "content = \n"+contents
+ wpafd.write(contents)
+ wpafd.close()
+ return 0
+ else :
+ self.session.open(MessageBox, _("wpa_supplicant.conf open error."), type = MessageBox.TYPE_ERROR, timeout = 10)
+ return -1
+ def updateCurrentInterfaces(self,ret):
+ if ret is True:
+ iNetwork.getInterfaces(self.configurationMsgClose)
+
+ def configurationMsgClose(self,ret):
+ if ret is True and self.configurationmsg is not None:
+ self.configurationmsg.close(True)
+
+ def configFinished(self,data):
+ global selectap
+ if data is True:
+ self.session.openWithCallback(self.configFinishedCB, MessageBox, _("Your network configuration has been activated."), type = MessageBox.TYPE_INFO, timeout = 10)
+ selectap = wlanconfig.essid.value
+
+ def configFinishedCB(self,data):
+ if data is not None:
+ if data is True:
+ self.close()
+
+ def formatip(self, iplist):
+ list = []
+ list = iplist
+# print "iplist : ",iplist
+ try:
+ if len(iplist) == 4:
+ result = str(iplist[0])+"."+str(iplist[1])+"."+str(iplist[2])+"."+str(iplist[3])
+ else:
+ result ="0.0.0.0"
+# print "result : ",result
+ return result
+ except:
+ return "[N/A]"
+
+ def keyCancelConfirm(self, result):
+ if not result:
+ return
+ if self.oldInterfaceState is False:
+ iNetwork.setAdapterAttribute(self.iface, "up", False)
+ iNetwork.deactivateInterface(self.iface,self.keyCancelCB)
+ else:
+ self.close()
+
+ def keyCancel(self,yesno = True):
+ if self["config"].isChanged():
+ self.session.openWithCallback(self.keyCancelConfirm, MessageBox, _("Really close without saving settings?"))
+ else:
+ self.keyCancelConfirm(True)
+
+ def keyCancelCB(self,data):
+ if data is not None:
+ if data is True:
+ self.close()
+
+ def cleanup(self):
+ iNetwork.stopRestartConsole()
+ iNetwork.stopGetInterfacesConsole()
+ iNetwork.stopDeactivateInterfaceConsole()
+ self.stopwlanscanapConsole()
+ self.stopCheckNetworkSharesConsole()
+
+ def stopwlanscanapConsole(self):
+ if self.wlanscanap is not None:
+ if len(self.wlanscanap.appContainers):
+ for name in self.wlanscanap.appContainers.keys():
+ self.wlanscanap.kill(name)
+
+ def stopCheckNetworkSharesConsole(self):
+ if self.Console is not None:
+ if len(self.Console.appContainers):
+ for name in self.Console.appContainers.keys():
+ self.Console.kill(name)
+
+class WlanScanAp(Screen,HelpableScreen):
+ skin = """
+ <screen name="WlanScanAp" position="209,48" size="865,623" title="Wireless Network Configuration..." flags="wfNoBorder" backgroundColor="transparent">
+ <ePixmap pixmap="Vu_HD/Bg_EPG_view.png" zPosition="-1" position="0,0" size="865,623" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/menu/ico_title_Setup.png" position="32,41" size="40,40" alphatest="blend" transparent="1" />
+ <eLabel text="Wireless Network AP Scan..." position="90,50" size="600,32" font="Semiboldit;32" foregroundColor="#5d5d5d" backgroundColor="#27b5b9bd" transparent="1" />
+ <ePixmap pixmap="Vu_HD/icons/clock.png" position="750,55" zPosition="1" size="20,20" alphatest="blend" />
+ <widget source="global.CurrentTime" render="Label" position="770,57" zPosition="1" size="50,20" font="Regular;20" foregroundColor="#1c1c1c" backgroundColor="#27d9dee2" halign="right" transparent="1">
+ <convert type="ClockToText">Format:%H:%M</convert>
+ </widget>
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="45,98" size="25,25" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/green.png" position="240,98" size="25,25" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/blue.png" position="630,98" size="25,25" alphatest="blend" />
+ <widget source="key_red" render="Label" position="66,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="key_green" render="Label" position="268,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="key_blue" render="Label" position="665,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <ePixmap pixmap="Vu_HD/border_menu.png" position="120,140" zPosition="-1" size="342,358" transparent="1" alphatest="blend" />
+ <widget name="menulist" position="130,150" size="322,338" transparent="1" backgroundColor="#27d9dee2" zPosition="10" scrollbarMode="showOnDemand" />
+ <widget source="Address" render="Label" position="490,220" zPosition="1" size="300,30" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="ESSID" render="Label" position="490,250" zPosition="1" size="300,30" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="Protocol" render="Label" position="490,280" zPosition="1" size="300,30" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="Frequency" render="Label" position="490,310" zPosition="1" size="300,30" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="Encryption key" render="Label" position="490,340" zPosition="1" size="300,30" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="BitRate" render="Label" position="490,370" zPosition="1" size="300,60" font="Regular;20" halign="center" valign="center" backgroundColor="#27b5b9bd" foregroundColor="#1c1c1c" transparent="1" />
+ </screen>"""
+
+ def __init__(self, session, iface):
+ Screen.__init__(self,session)
+ HelpableScreen.__init__(self)
+ self.session = session
+ self.iface = iface
+ self.wlanscanap = None
+# self.scanAPcount = 5
+ self.scanAPcount = 1
+ self.apList = {}
+ self.SetApList = []
+
+ self["WizardActions"] = HelpableActionMap(self, "WizardActions",
+ {
+ "up": (self.up, _("move up to previous entry")),
+ "down": (self.down, _("move down to next entry")),
+ "left": (self.left, _("move up to first entry")),
+ "right": (self.right, _("move down to last entry")),
+ })
+
+ self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
+ {
+ "cancel": (self.close, _("exit")),
+ "ok": (self.ok, "select AP"),
+ })
+
+ self["ColorActions"] = HelpableActionMap(self, "ColorActions",
+ {
+ "red": (self.close, _("exit")),
+ "green": (self.ok, "select AP"),
+ "blue": (self.startWlanConfig, "Edit Wireless settings"),
+ })
+
+ self["actions"] = NumberActionMap(["WizardActions","ShortcutActions"],
+ {
+ "ok": self.ok,
+ "back": self.close,
+ "up": self.up,
+ "down": self.down,
+ "red": self.close,
+ "left": self.left,
+ "right": self.right,
+ }, -2)
+
+ self["menulist"] = MenuList(self.SetApList)
+ self["key_red"] = StaticText(_("Close"))
+ self["key_green"] = StaticText(_("Select"))
+ self["key_blue"] = StaticText(_("EditSetting"))
+ self["Address"] = StaticText(_("Scanning AP List.."))
+ self["ESSID"] = StaticText(_("Wait a moment"))
+ self["Protocol"] = StaticText(" ")
+ self["Frequency"] = StaticText(" ")
+ self["Encryption key"] = StaticText(" ")
+ self["BitRate"] = StaticText(" ")
+ self.scanAPFailedTimer = eTimer()
+ self.scanAPFailedTimer.callback.append(self.scanAPFailed)
+ self.scanAplistTimer = eTimer()
+ self.scanAplistTimer.callback.append(self.scanApList)
+ self.scanAplistTimer.start(100,True)
+ self.onClose.append(self.cleanup)
+
+ def left(self):
+ self["menulist"].pageUp()
+ self.displayApInfo()
+
+ def right(self):
+ self["menulist"].pageDown()
+ self.displayApInfo()
+
+ def up(self):
+ self["menulist"].up()
+ self.displayApInfo()
+
+ def down(self):
+ self["menulist"].down()
+ self.displayApInfo()
+
+ def ok(self):
+ global selectap
+ selectAp=self["menulist"].getCurrent()[0]
+ selectap = selectAp
+ self.close()
+
+ def startWlanConfig(self):
+ global selectap
+ selectAp=self["menulist"].getCurrent()[0]
+ selectap = selectAp
+ self.cleanup()
+ self.session.open(WlanConfig,self.iface)
+# self.close()
+
+ def scanApList(self):
+ # print "self.scanAPcount : ",self.scanAPcount
+ self.apList = {}
+ self.SetApList = []
+ self.configurationmsg = self.session.open(MessageBox, _("Please wait for scanning AP..."), type = MessageBox.TYPE_INFO, enable_input = False)
+ os_system('ifconfig '+self.iface+" up")
+ self.wlanscanap = Console()
+ cmd = "iwlist "+self.iface+" scan"
+ print cmd
+ self.wlanscanap.ePopen(cmd, self.iwlistfinnished,self.APListParse)
+
+ def iwlistfinnished(self, result, retval,extra_args):
+# print "iwlistfinnished"
+ (statecallback) = extra_args
+ if self.wlanscanap is not None:
+# print "retval = ",retval
+ if retval == 0:
+ self.wlanscanap = None
+ content = result.splitlines()
+ first = content[0].split()
+ completed = False
+ for x in first:
+ if x == 'completed':
+ completed = True
+ if completed == True:
+ statecallback(result)
+ else:
+ statecallback(0)
+ else:
+ statecallback(0)
+
+ def APListParse(self,data):
+ if data == 0:
+ if self.scanAPcount >0:
+ self.scanAPcount -=1
+ self.configurationmsg.close(True)
+ time.sleep(3)
+ self.scanAplistTimer.start(500,True)
+ return
+ else:
+ self.configurationmsg.close(True)
+ self.scanAPFailedTimer.start(500,True)
+ return
+ else:
+# print data
+ self.apList = {}
+# self.scanAPcount =5
+ self.scanAPcount =0
+ list = data.splitlines()
+ for line in list:
+# print "line : ",line
+ if line.strip().startswith("Cell"): # Cell 01 - Address: 00:26:66:5C:EF:24
+ parts = line.strip().split(" ")
+ current_ap_id = int(parts[1])
+ self.apList[current_ap_id]={}
+ self.apList[current_ap_id]["Address"]=parts[4]
+ elif line.strip().startswith("ESSID"):
+ self.apList[current_ap_id]["ESSID"]=line.strip()[6:].strip('"')
+ self.SetApList.append( (self.apList[current_ap_id]["ESSID"],current_ap_id) )
+ elif line.strip().startswith("Protocol"):
+ self.apList[current_ap_id]["Protocol"]=line.strip()[9:]
+ elif line.strip().startswith("Frequency"):
+ self.apList[current_ap_id]["Frequency"]=line.strip()[10:]
+ elif line.strip().startswith("Encryption key"):
+ self.apList[current_ap_id]["Encryption key"]=line.strip()[15:]
+ elif line.strip().startswith("Bit Rates"):
+ self.apList[current_ap_id]["BitRate"]=line.strip()[10:]
+ print self.apList
+ print len(self.apList)
+ self.configurationmsg.close(True)
+ self.displayApInfo()
+
+ def scanAPFailed(self):
+ self.session.openWithCallback(self.ScanAPclose,MessageBox, _("Scan AP Failed"), MessageBox.TYPE_ERROR,10)
+
+ def displayApInfo(self):
+ if len(self.apList) >0:
+ self["menulist"].setList(self.SetApList)
+ index = self["menulist"].getCurrent()[1]
+ for key in ["Address", "ESSID", "Protocol", "Frequency", "Encryption key", "BitRate"]:
+ if self.apList[index].has_key(key):
+ self[key].setText((key+": "+self.apList[index][key]))
+ else:
+ self[key].setText(("None"))
+ else:
+ self.session.openWithCallback(self.ScanAPclose, MessageBox, _("No AP detected."), type = MessageBox.TYPE_INFO, timeout = 10)
+
+ def ScanAPclose(self,data):
+ self.close()
+
+ def cleanup(self):
+ self.stopwlanscanapConsole()
+
+ def stopwlanscanapConsole(self):
+ if self.wlanscanap is not None:
+ if len(self.wlanscanap.appContainers):
+ for name in self.wlanscanap.appContainers.keys():
+ self.wlanscanap.kill(name)
+
+class NetworkAdapterTest(Screen):
+ def __init__(self, session,iface):
+ Screen.__init__(self, session)
+ self.iface = iface
+ self.oldInterfaceState = iNetwork.getAdapterAttribute(self.iface, "up")
+ self.setLabels()
+ self.onClose.append(self.cleanup)
+ self.onHide.append(self.cleanup)
+
+ self["updown_actions"] = NumberActionMap(["WizardActions","ShortcutActions"],
+ {
+ "ok": self.KeyOK,
+ "blue": self.KeyOK,
+ "up": lambda: self.updownhandler('up'),
+ "down": lambda: self.updownhandler('down'),
+
+ }, -2)
+
+ self["shortcuts"] = ActionMap(["ShortcutActions","WizardActions"],
+ {
+ "red": self.cancel,
+ "back": self.cancel,
+ }, -2)
+ self["infoshortcuts"] = ActionMap(["ShortcutActions","WizardActions"],
+ {
+ "red": self.closeInfo,
+ "back": self.closeInfo,
+ }, -2)
+ self["shortcutsgreen"] = ActionMap(["ShortcutActions"],
+ {
+ "green": self.KeyGreen,
+ }, -2)
+ self["shortcutsgreen_restart"] = ActionMap(["ShortcutActions"],
+ {
+ "green": self.KeyGreenRestart,
+ }, -2)
+ self["shortcutsyellow"] = ActionMap(["ShortcutActions"],
+ {
+ "yellow": self.KeyYellow,
+ }, -2)
+
+ self["shortcutsgreen_restart"].setEnabled(False)
+ self["updown_actions"].setEnabled(False)
+ self["infoshortcuts"].setEnabled(False)
+ self.onClose.append(self.delTimer)
+ self.onLayoutFinish.append(self.layoutFinished)
+ self.steptimer = False
+ self.nextstep = 0
+ self.activebutton = 0
+ self.nextStepTimer = eTimer()
+ self.nextStepTimer.callback.append(self.nextStepTimerFire)
+
+ def cancel(self):
+ if self.oldInterfaceState is False:
+ iNetwork.setAdapterAttribute(self.iface, "up", self.oldInterfaceState)
+ iNetwork.deactivateInterface(self.iface)
+ self.close()
+
+ def closeInfo(self):
+ self["shortcuts"].setEnabled(True)
+ self["infoshortcuts"].setEnabled(False)
+ self["InfoText"].hide()
+ self["InfoTextBorder"].hide()
+ self["key_red"].setText(_("Close"))
+
+ def delTimer(self):
+ del self.steptimer
+ del self.nextStepTimer
+
+ def nextStepTimerFire(self):
+ self.nextStepTimer.stop()
+ self.steptimer = False
+ self.runTest()
+
+ def updownhandler(self,direction):
+ if direction == 'up':
+ if self.activebutton >=2:
+ self.activebutton -= 1
+ else:
+ self.activebutton = 6
+ self.setActiveButton(self.activebutton)
+ if direction == 'down':
+ if self.activebutton <=5:
+ self.activebutton += 1
+ else:
+ self.activebutton = 1
+ self.setActiveButton(self.activebutton)
+
+ def setActiveButton(self,button):
+ if button == 1:
+ self["EditSettingsButton"].setPixmapNum(0)
+ self["EditSettings_Text"].setForegroundColorNum(0)
+ self["NetworkInfo"].setPixmapNum(0)
+ self["NetworkInfo_Text"].setForegroundColorNum(1)
+ self["AdapterInfo"].setPixmapNum(1) # active
+ self["AdapterInfo_Text"].setForegroundColorNum(2) # active
+ if button == 2:
+ self["AdapterInfo_Text"].setForegroundColorNum(1)
+ self["AdapterInfo"].setPixmapNum(0)
+ self["DhcpInfo"].setPixmapNum(0)
+ self["DhcpInfo_Text"].setForegroundColorNum(1)
+ self["NetworkInfo"].setPixmapNum(1) # active
+ self["NetworkInfo_Text"].setForegroundColorNum(2) # active
+ if button == 3:
+ self["NetworkInfo"].setPixmapNum(0)
+ self["NetworkInfo_Text"].setForegroundColorNum(1)
+ self["IPInfo"].setPixmapNum(0)
+ self["IPInfo_Text"].setForegroundColorNum(1)
+ self["DhcpInfo"].setPixmapNum(1) # active
+ self["DhcpInfo_Text"].setForegroundColorNum(2) # active
+ if button == 4:
+ self["DhcpInfo"].setPixmapNum(0)
+ self["DhcpInfo_Text"].setForegroundColorNum(1)
+ self["DNSInfo"].setPixmapNum(0)
+ self["DNSInfo_Text"].setForegroundColorNum(1)
+ self["IPInfo"].setPixmapNum(1) # active
+ self["IPInfo_Text"].setForegroundColorNum(2) # active
+ if button == 5:
+ self["IPInfo"].setPixmapNum(0)
+ self["IPInfo_Text"].setForegroundColorNum(1)
+ self["EditSettingsButton"].setPixmapNum(0)
+ self["EditSettings_Text"].setForegroundColorNum(0)
+ self["DNSInfo"].setPixmapNum(1) # active
+ self["DNSInfo_Text"].setForegroundColorNum(2) # active
+ if button == 6:
+ self["DNSInfo"].setPixmapNum(0)
+ self["DNSInfo_Text"].setForegroundColorNum(1)
+ self["EditSettingsButton"].setPixmapNum(1) # active
+ self["EditSettings_Text"].setForegroundColorNum(2) # active
+ self["AdapterInfo"].setPixmapNum(0)
+ self["AdapterInfo_Text"].setForegroundColorNum(1)
+
+ def runTest(self):
+ next = self.nextstep
+ if next == 0:
+ self.doStep1()
+ elif next == 1:
+ self.doStep2()
+ elif next == 2:
+ self.doStep3()
+ elif next == 3:
+ self.doStep4()
+ elif next == 4:
+ self.doStep5()
+ elif next == 5:
+ self.doStep6()
+ self.nextstep += 1
+
+ def doStep1(self):
+ self.steptimer = True
+ self.nextStepTimer.start(3000)
+ self["key_yellow"].setText(_("Stop test"))
+
+ def doStep2(self):
+ self["Adapter"].setText(iNetwork.getFriendlyAdapterName(self.iface))
+ self["Adapter"].setForegroundColorNum(2)
+ self["Adaptertext"].setForegroundColorNum(1)
+ self["AdapterInfo_Text"].setForegroundColorNum(1)
+ self["AdapterInfo_OK"].show()
+ self.steptimer = True
+ self.nextStepTimer.start(3000)
+
+ def doStep3(self):
+ self["Networktext"].setForegroundColorNum(1)
+ self["Network"].setText(_("Please wait..."))
+ self.AccessPointInfo(self.iface)
+ self["NetworkInfo_Text"].setForegroundColorNum(1)
+ self.steptimer = True
+ self.nextStepTimer.start(3000)
+
+ def doStep4(self):
+ self["Dhcptext"].setForegroundColorNum(1)
+ if iNetwork.getAdapterAttribute(self.iface, 'dhcp') is True:
+ self["Dhcp"].setForegroundColorNum(2)
+ self["Dhcp"].setText(_("enabled"))
+ self["DhcpInfo_Check"].setPixmapNum(0)
+ else:
+ self["Dhcp"].setForegroundColorNum(1)
+ self["Dhcp"].setText(_("disabled"))
+ self["DhcpInfo_Check"].setPixmapNum(1)
+ self["DhcpInfo_Check"].show()
+ self["DhcpInfo_Text"].setForegroundColorNum(1)
+ self.steptimer = True
+ self.nextStepTimer.start(3000)
+
+ def doStep5(self):
+ self["IPtext"].setForegroundColorNum(1)
+ self["IP"].setText(_("Please wait..."))
+ iNetwork.checkNetworkState(self.NetworkStatedataAvail)
+
+ def doStep6(self):
+ self.steptimer = False
+ self.nextStepTimer.stop()
+ self["DNStext"].setForegroundColorNum(1)
+ self["DNS"].setText(_("Please wait..."))
+ iNetwork.checkDNSLookup(self.DNSLookupdataAvail)
+
+ def KeyGreen(self):
+ self["shortcutsgreen"].setEnabled(False)
+ self["shortcutsyellow"].setEnabled(True)
+ self["updown_actions"].setEnabled(False)
+ self["key_yellow"].setText("")
+ self["key_green"].setText("")
+ self.steptimer = True
+ self.nextStepTimer.start(1000)
+
+ def KeyGreenRestart(self):
+ self.nextstep = 0
+ self.layoutFinished()
+ self["Adapter"].setText((""))
+ self["Network"].setText((""))
+ self["Dhcp"].setText((""))
+ self["IP"].setText((""))
+ self["DNS"].setText((""))
+ self["AdapterInfo_Text"].setForegroundColorNum(0)
+ self["NetworkInfo_Text"].setForegroundColorNum(0)
+ self["DhcpInfo_Text"].setForegroundColorNum(0)
+ self["IPInfo_Text"].setForegroundColorNum(0)
+ self["DNSInfo_Text"].setForegroundColorNum(0)
+ self["shortcutsgreen_restart"].setEnabled(False)
+ self["shortcutsgreen"].setEnabled(False)
+ self["shortcutsyellow"].setEnabled(True)
+ self["updown_actions"].setEnabled(False)
+ self["key_yellow"].setText("")
+ self["key_green"].setText("")
+ self.steptimer = True
+ self.nextStepTimer.start(1000)
+
+ def KeyOK(self):
+ self["infoshortcuts"].setEnabled(True)
+ self["shortcuts"].setEnabled(False)
+ if self.activebutton == 1: # Adapter Check
+ self["InfoText"].setText(_("This test detects your configured Wireless LAN-Adapter."))
+ self["InfoTextBorder"].show()
+ self["InfoText"].show()
+ self["key_red"].setText(_("Back"))
+ if self.activebutton == 2: #LAN Check
+ self["InfoText"].setText(_("This test checks whether a network cable is connected to your Wireless LAN-Adapter."))
+ self["InfoTextBorder"].show()
+ self["InfoText"].show()
+ self["key_red"].setText(_("Back"))
+ if self.activebutton == 3: #DHCP Check
+ self["InfoText"].setText(_("This test checks whether your Wireless LAN Adapter is set up for automatic IP Address configuration with DHCP.\nIf you get a \"disabled\" message:\n - then your Wireless LAN Adapter is configured for manual IP Setup\n- verify thay you have entered correct IP informations in the AdapterSetup dialog.\nIf you get an \"enabeld\" message:\n-verify that you have a configured and working DHCP Server in your network."))
+ self["InfoTextBorder"].show()
+ self["InfoText"].show()
+ self["key_red"].setText(_("Back"))
+ if self.activebutton == 4: # IP Check
+ self["InfoText"].setText(_("This test checks whether a valid IP Address is found for your LAN Adapter.\nIf you get a \"unconfirmed\" message:\n- no valid IP Address was found\n- please check your DHCP, cabling and adapter setup"))
+ self["InfoTextBorder"].show()
+ self["InfoText"].show()
+ self["key_red"].setText(_("Back"))
+ if self.activebutton == 5: # DNS Check
+ self["InfoText"].setText(_("This test checks for configured Nameservers.\nIf you get a \"unconfirmed\" message:\n- please check your DHCP, cabling and Adapter setup\n- if you configured your Nameservers manually please verify your entries in the \"Nameserver\" Configuration"))
+ self["InfoTextBorder"].show()
+ self["InfoText"].show()
+ self["key_red"].setText(_("Back"))
+ if self.activebutton == 6: # Edit Settings
+ self.cleanup()
+ self.session.open(WlanConfig,self.iface)
+ self["shortcuts"].setEnabled(True)
+ self["infoshortcuts"].setEnabled(False)
+
+ def KeyYellow(self):
+ self.nextstep = 0
+ self["shortcutsgreen_restart"].setEnabled(True)
+ self["shortcutsgreen"].setEnabled(False)
+ self["shortcutsyellow"].setEnabled(False)
+ self["key_green"].setText(_("Restart test"))
+ self["key_yellow"].setText("")
+ self.steptimer = False
+ self.nextStepTimer.stop()
+
+ def layoutFinished(self):
+ self.setTitle(_("Network test: ") + iNetwork.getFriendlyAdapterName(self.iface) )
+ self["shortcutsyellow"].setEnabled(False)
+ self["AdapterInfo_OK"].hide()
+ self["NetworkInfo_Check"].hide()
+ self["DhcpInfo_Check"].hide()
+ self["IPInfo_Check"].hide()
+ self["DNSInfo_Check"].hide()
+ self["EditSettings_Text"].hide()
+ self["EditSettingsButton"].hide()
+ self["InfoText"].hide()
+ self["InfoTextBorder"].hide()
+ self["key_yellow"].setText("")
+
+ def setLabels(self):
+ self["Adaptertext"] = MultiColorLabel(_("LAN Adapter"))
+ self["Adapter"] = MultiColorLabel()
+ self["AdapterInfo"] = MultiPixmap()
+ self["AdapterInfo_Text"] = MultiColorLabel(_("Show Info"))
+ self["AdapterInfo_OK"] = Pixmap()
+
+ if self.iface in iNetwork.wlan_interfaces:
+ self["Networktext"] = MultiColorLabel(_("Wireless Network"))
+ else:
+ self["Networktext"] = MultiColorLabel(_("Local Network"))
+
+ self["Network"] = MultiColorLabel()
+ self["NetworkInfo"] = MultiPixmap()
+ self["NetworkInfo_Text"] = MultiColorLabel(_("Show Info"))
+ self["NetworkInfo_Check"] = MultiPixmap()
+
+ self["Dhcptext"] = MultiColorLabel(_("DHCP"))
+ self["Dhcp"] = MultiColorLabel()
+ self["DhcpInfo"] = MultiPixmap()
+ self["DhcpInfo_Text"] = MultiColorLabel(_("Show Info"))
+ self["DhcpInfo_Check"] = MultiPixmap()
+
+ self["IPtext"] = MultiColorLabel(_("IP Address"))
+ self["IP"] = MultiColorLabel()
+ self["IPInfo"] = MultiPixmap()
+ self["IPInfo_Text"] = MultiColorLabel(_("Show Info"))
+ self["IPInfo_Check"] = MultiPixmap()
+
+ self["DNStext"] = MultiColorLabel(_("Nameserver"))
+ self["DNS"] = MultiColorLabel()
+ self["DNSInfo"] = MultiPixmap()
+ self["DNSInfo_Text"] = MultiColorLabel(_("Show Info"))
+ self["DNSInfo_Check"] = MultiPixmap()
+
+ self["EditSettings_Text"] = MultiColorLabel(_("Edit settings"))
+ self["EditSettingsButton"] = MultiPixmap()
+
+ self["key_red"] = StaticText(_("Close"))
+ self["key_green"] = StaticText(_("Start test"))
+ self["key_yellow"] = StaticText(_("Stop test"))
+
+ self["InfoTextBorder"] = Pixmap()
+ self["InfoText"] = Label()
+
+ def NetworkStatedataAvail(self,data):
+ if data <= 2:
+ self["IP"].setForegroundColorNum(2)
+ self["IP"].setText(_("confirmed"))
+ self["IPInfo_Check"].setPixmapNum(0)
+ else:
+ self["IP"].setForegroundColorNum(1)
+ self["IP"].setText(_("unconfirmed"))
+ self["IPInfo_Check"].setPixmapNum(1)
+ self["IPInfo_Check"].show()
+ self["IPInfo_Text"].setForegroundColorNum(1)
+ self.steptimer = True
+ self.nextStepTimer.start(3000)
+
+ def DNSLookupdataAvail(self,data):
+ if data <= 2:
+ self["DNS"].setForegroundColorNum(2)
+ self["DNS"].setText(_("confirmed"))
+ self["DNSInfo_Check"].setPixmapNum(0)
+ else:
+ self["DNS"].setForegroundColorNum(1)
+ self["DNS"].setText(_("unconfirmed"))
+ self["DNSInfo_Check"].setPixmapNum(1)
+ self["DNSInfo_Check"].show()
+ self["DNSInfo_Text"].setForegroundColorNum(1)
+ self["EditSettings_Text"].show()
+ self["EditSettingsButton"].setPixmapNum(1)
+ self["EditSettings_Text"].setForegroundColorNum(2) # active
+ self["EditSettingsButton"].show()
+ self["key_yellow"].setText("")
+ self["key_green"].setText(_("Restart test"))
+ self["shortcutsgreen"].setEnabled(False)
+ self["shortcutsgreen_restart"].setEnabled(True)
+ self["shortcutsyellow"].setEnabled(False)
+ self["updown_actions"].setEnabled(True)
+ self.activebutton = 6
+
+ def getInfoCB(self,status):
+ if status is not None:
+ if status.startswith("No Connection") or status.startswith("Not-Associated") or status == False:
+ self["Network"].setForegroundColorNum(1)
+ self["Network"].setText(_("disconnected"))
+ self["NetworkInfo_Check"].setPixmapNum(1)
+ self["NetworkInfo_Check"].show()
+ else:
+ self["Network"].setForegroundColorNum(2)
+ self["Network"].setText(_("connected"))
+ self["NetworkInfo_Check"].setPixmapNum(0)
+ self["NetworkInfo_Check"].show()
+
+ def cleanup(self):
+ iNetwork.stopLinkStateConsole()
+ iNetwork.stopPingConsole()
+ iNetwork.stopDNSConsole()
+
+ def AccessPointInfo(self,iface):
+ cmd = "iwconfig %s"%iface
+ self.iwconfigConsole = Console()
+ self.iwconfigConsole.ePopen(cmd,self.readAP,self.getInfoCB)
+
+ def readAP(self,result,retval,extra_args):
+ (callback) = extra_args
+ self.apState = None
+ if self.iwconfigConsole is not None:
+ if retval == 0:
+ self.iwconfigConsole = None
+ for content in result.splitlines():
+ if 'Access Point' in content:
+ self.apState = content.strip().split('Access Point: ')[1]
+ callback(self.apState)
+ return
+ callback(self.apState)
+
+class Wlanstatus(Screen):
+ skin = """
+ <screen name="Wlanstatus" position="209,48" size="865,623" title="Wireless Network Configuration..." flags="wfNoBorder" backgroundColor="transparent">
+ <ePixmap pixmap="Vu_HD/Bg_EPG_view.png" zPosition="-1" position="0,0" size="865,623" alphatest="on" />
+ <ePixmap pixmap="Vu_HD/menu/ico_title_Setup.png" position="32,41" size="40,40" alphatest="blend" transparent="1" />
+ <eLabel text="Wireless Network Status..." position="90,50" size="600,32" font="Semiboldit;32" foregroundColor="#5d5d5d" backgroundColor="#27b5b9bd" transparent="1" />
+ <ePixmap pixmap="Vu_HD/icons/clock.png" position="750,55" zPosition="1" size="20,20" alphatest="blend" />
+ <widget source="global.CurrentTime" render="Label" position="770,57" zPosition="1" size="50,20" font="Regular;20" foregroundColor="#1c1c1c" backgroundColor="#27d9dee2" halign="right" transparent="1">
+ <convert type="ClockToText">Format:%H:%M</convert>
+ </widget>
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="45,98" size="25,25" alphatest="blend" />
+ <widget source="key_red" render="Label" position="66,97" zPosition="1" size="150,25" font="Regular;20" halign="center" valign="center" backgroundColor="darkgrey" foregroundColor="#1c1c1c" transparent="1" />
+ <widget source="status" render="Label" position="110,200" size="650,400" transparent="1" font="Regular;20" foregroundColor="#1c1c1c" backgroundColor="#27d9dee2" zPosition="1" />
+ </screen>"""
+ def __init__(self, session,iface):
+ Screen.__init__(self,session)
+ self.session = session
+ self.iface = iface
+ self["status"] = StaticText(_("Wait a moment..."))
+ self["key_red"] = StaticText(_("Close"))
+ self["OkCancelActions"] = ActionMap(["ShortcutActions", "SetupActions" ],
+ {
+ "ok": self.ok,
+ "cancel": self.close,
+ "red": self.close,
+ }, -2)
+ self.readstatus()
+ self.onClose.append(self.cleanup)
+
+ def readstatus(self):
+ self.wlanstatus = Console()
+ cmd1 = "iwconfig "+self.iface
+ self.wlanstatus.ePopen(cmd1, self.iwconfigfinnished,self.statusdisplay)
+
+ def iwconfigfinnished(self, result, retval,extra_args):
+ try:
+ (statecallback) = extra_args
+ if self.wlanstatus is not None:
+ if retval == 0:
+ statecallback(result)
+ else:
+ statecallback(0)
+ except:
+ self.close()
+
+
+ def statusdisplay(self,data):
+ if data == 0:
+ self["status"].setText(_("No information..."))
+ else:
+ self["status"].setText(data)
+
+ def ok(self):
+ pass
+
+ def cleanup(self):
+ self.stopWlanStatusConsole()
+
+ def stopWlanStatusConsole(self):
+ if self.wlanstatus is not None:
+ if len(self.wlanstatus.appContainers):
+ for name in self.wlanstatus.appContainers.keys():
+ self.wlanstatus.kill(name)
+
+def openconfig(session, **kwargs):
+ session.open(WlanSelection)
+
+def selSetup(menuid, **kwargs):
+ list=[]
+ if menuid != "system":
+ return [ ]
+ else:
+ for x in iNetwork.getInstalledAdapters():
+ if x.startswith('eth'):
+ continue
+ list.append(x)
+ if len(list):
+ return [(_("Wireless LAN Setup"), openconfig, "wlansetup_config", 80)]
+ else:
+ return [ ]
+ return [ ]
+
+def Plugins(**kwargs):
+ return PluginDescriptor(name=_("Wireless LAN Setup"), description="Wireless LAN Setup", where = PluginDescriptor.WHERE_MENU, fnc=selSetup)
def __init__(self, session):
Screen.__init__(self, session)
- self["EnigmaVersion"] = StaticText("Enigma: " + about.getEnigmaVersionString())
+ self["EnigmaVersion"] = StaticText("Version: " + about.getEnigmaVersionString())
self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString())
self["TunerHeader"] = StaticText(_("Detected NIMs:"))
if SystemInfo["CanDownmixAC3"]:
self.settings.downmix = ConfigOnOff(default=config.av.downmix_ac3.value)
self.settings.downmix.addNotifier(self.changeAC3Downmix, initial_call = False)
- conflist.append(getConfigListEntry(_("AC3 downmix"), self.settings.downmix))
+ conflist.append(getConfigListEntry(_("Dolby Digital downmix"), self.settings.downmix))
self["key_red"].setBoolean(True)
if n > 0:
def statusCallback(self, status, progress):
print "statusCallback:", status, progress
if status == DreamInfoHandler.STATUS_DONE:
- self["text"].setText(_("The installation of the default settings is finished. You can now continue configuring your Dreambox by pressing the OK button on the remote control."))
+ self["text"].setText(_("The installation of the default settings is finished. You can now continue configuring your STB by pressing the OK button on the remote control."))
self.markDone()
self.disableKeys = False
ScanPath(path = "dmpkg", with_subdirs = True),
ScanPath(path = "", with_subdirs = False),
],
- name = "Dream-Package",
+ name = "STB-Package",
description = _("Install settings, skins, software..."),
openfnc = filescan_open, )
print "add dreampackage scanner plugin"
-plugins.addPlugin(PluginDescriptor(name="Dream-Package", where = PluginDescriptor.WHERE_FILESCAN, fnc = filescan, internal = True))
+plugins.addPlugin(PluginDescriptor(name="STB-Package", where = PluginDescriptor.WHERE_FILESCAN, fnc = filescan, internal = True))
print "added"
wizardManager.registerWizard(DefaultWizard, config.misc.defaultchosen.value, priority = 6)
"showMovies": (self.showMovies, _("Play recorded movies...")),
"showRadio": (self.showRadio, _("Show the radio player...")),
"showTv": (self.showTv, _("Show the tv player...")),
+ # ikseong action for subtitle hotkey
+ "showSubtitle":(self.showSubtitle, _("Show the Subtitle...")),
}, prio=2)
self.allowPiP = True
if service is not None:
self.session.open(MoviePlayer, service)
+ # ikseong action for subtitle hotkey
+ def showSubtitle(self):
+ from Screens.Subtitles import Subtitles
+ self.session.open(Subtitles)
+
class MoviePlayer(InfoBarBase, InfoBarShowHide, \
InfoBarMenu, \
InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
{
+ # ikseong action for subtitle hotkey
+ "showSubtitle":(self.showSubtitle, _("Show the Subtitle...")),
"leavePlayer": (self.leavePlayer, _("leave movie player..."))
})
self.returning = False
elif self.returning:
self.close()
+
+ # ikseong action for subtitle hotkey
+ def showSubtitle(self):
+ from Screens.Subtitles import Subtitles
+ self.session.open(Subtitles)
dir = preferredInstantRecordPath()
if not dir or not fileExists(dir, 'w'):
dir = defaultMoviePath()
+# ikseong
+ if not fileExists("/hdd", 0):
+ print "not found /hdd"
+ system("ln -s /media/hdd /hdd")
+#
try:
stat = os_stat(dir)
except:
self["key_blue"] = StaticText("")
self["introduction"] = StaticText(self.edittext)
- self.devices = [(iInputDevices.getDeviceName(x),x) for x in iInputDevices.getDeviceList()]
+ self.devices = [(iInputDevices.getDeviceName(x)[9:],x) for x in iInputDevices.getDeviceList()]
print "[InputDeviceSelection] found devices :->", len(self.devices),self.devices
self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
from Screen import Screen
-from Components.ActionMap import ActionMap
+# ikseong
+from Components.ActionMap import ActionMap,NumberActionMap
from Components.Language import language
from Components.config import config
from Components.Sources.List import List
png = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "countries/missing.png"))
res = (index, name, png)
return res
+# ikseong
+from Plugins.SystemPlugins.FactoryTest.plugin import FactoryTest
class LanguageSelection(Screen):
def __init__(self, session):
self.updateList()
self.onLayoutFinish.append(self.selectActiveLanguage)
-
- self["actions"] = ActionMap(["OkCancelActions"],
+# ikseong
+ self["actions"] = NumberActionMap(["OkCancelActions","NumberActions"],
{
"ok": self.save,
"cancel": self.cancel,
+ "1": self.keyNumberGlobal,
+ "2": self.keyNumberGlobal,
+ "3": self.keyNumberGlobal,
+ "4": self.keyNumberGlobal,
+ "5": self.keyNumberGlobal,
+ "6": self.keyNumberGlobal,
+ "7": self.keyNumberGlobal,
+ "8": self.keyNumberGlobal,
+ "9": self.keyNumberGlobal,
+ "0": self.keyNumberGlobal,
}, -1)
+ self.testkey=0
+
+# ikseong
+ def keyNumberGlobal(self, number):
+ self.testkey = self.testkey * 10 + number
+ if self.testkey > 10000:
+ self.testkey = self.testkey%10000
+ if self.testkey == 4599:
+ self.session.open(FactoryTest)
+ print "testkey", self.testkey
def selectActiveLanguage(self):
activeLanguage = language.getActiveLanguage()
Satconfig.py ScanSetup.py NetworkSetup.py Ci.py TimerEntry.py Volume.py \
EpgSelection.py EventView.py Mute.py Standby.py ServiceInfo.py \
InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \
- Dish.py LanguageSelection.py StartWizard.py PiPSetup.py \
+ Dish.py LanguageSelection.py StartWizard.py PiPSetup.py Subtitles.py \
TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
Console.py InputBox.py ChoiceBox.py SimpleSummary.py \
TimerSelection.py PictureInPicture.py TimeDateInput.py \
self["statuspic"].hide()
self.oktext = _("Press OK on your remote control to continue.")
- self.reboottext = _("Your Dreambox will restart after pressing OK on your remote control.")
+ self.reboottext = _("Your STB will restart after pressing OK on your remote control.")
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.missingwlanplugintxt = _("The wireless LAN plugin is not installed!\nPlease install it.")
def loadDescription(self):
if self["menulist"].getCurrent()[1] == 'edit':
- self["description"].setText(_("Edit the network configuration of your Dreambox.\n" ) + self.oktext )
+ self["description"].setText(_("Edit the network configuration of your STB.\n" ) + self.oktext )
if self["menulist"].getCurrent()[1] == 'test':
- self["description"].setText(_("Test the network configuration of your Dreambox.\n" ) + self.oktext )
+ self["description"].setText(_("Test the network configuration of your STB.\n" ) + self.oktext )
if self["menulist"].getCurrent()[1] == 'dns':
- self["description"].setText(_("Edit the Nameserver configuration of your Dreambox.\n" ) + self.oktext )
+ self["description"].setText(_("Edit the Nameserver configuration of your STB.\n" ) + self.oktext )
if self["menulist"].getCurrent()[1] == 'scanwlan':
self["description"].setText(_("Scan your network for wireless access points and connect to them using your selected wireless device.\n" ) + self.oktext )
if self["menulist"].getCurrent()[1] == 'wlanstatus':
self.remainingdata = ""
for x in lines:
- plugin = x.split(" - ", 2)
- if len(plugin) == 3:
+ plugin = x.split(" - ")
+ if len(plugin) >= 2:
if self.run == 1 and self.type == self.DOWNLOAD:
if plugin[0] not in self.installedplugins:
self.installedplugins.append(plugin[0])
self.plugins = {}
for x in self.pluginlist:
+ if len(x) < 4:
+ split = x[0].split('-',3)
+ if not self.plugins.has_key(split[2]):
+ self.plugins[split[2]] = []
+ self.plugins[split[2]].append((PluginDescriptor(name = x[2], description = " ", icon = verticallineIcon), split[3]))
+ continue
+
split = x[3].split('-', 1)
if len(split) < 2:
continue
def createSummary(self):
print "ServiceScanCreateSummary"
- return ServiceScanSummary
\ No newline at end of file
+ return ServiceScanSummary
self.status = True
self.updateColors()
- self["pretext"] = Label(_("Shutdown Dreambox after"))
+ self["pretext"] = Label(_("Shutdown STB after"))
self["aftertext"] = Label(_("minutes"))
self["actions"] = NumberActionMap(["SleepTimerEditorActions", "TextEntryActions", "KeyboardInputActions"],
def select(self):
if self.status:
- time = int(self["input"].getText())
- config.SleepTimer.defaulttime.setValue(time)
- config.SleepTimer.defaulttime.save()
- config.SleepTimer.action.save()
- config.SleepTimer.ask.save()
- self.session.nav.SleepTimer.setSleepTime(time)
- self.session.openWithCallback(self.close, MessageBox, _("The sleep timer has been activated."), MessageBox.TYPE_INFO)
+# ikseong
+ if self["input"].getText()=='':
+ self.session.nav.SleepTimer.clear()
+ self.session.openWithCallback(self.close, MessageBox, _("The sleep timer is invalid."), MessageBox.TYPE_INFO)
+ else:
+ time = int(self["input"].getText())
+ config.SleepTimer.defaulttime.setValue(time)
+ config.SleepTimer.defaulttime.save()
+ config.SleepTimer.action.save()
+ config.SleepTimer.ask.save()
+ self.session.nav.SleepTimer.setSleepTime(time)
+ self.session.openWithCallback(self.close, MessageBox, _("The sleep timer has been activated."), MessageBox.TYPE_INFO)
else:
self.session.nav.SleepTimer.clear()
self.session.openWithCallback(self.close, MessageBox, _("The sleep timer has been disabled."), MessageBox.TYPE_INFO)
def keyNumberGlobal(self, number):
- self["input"].number(number)
+# ikseong
+ if self["input"].getText() == '' :
+ inputtime=0
+ else:
+ inputtime= int(self["input"].getText())*10 +number
+ if inputtime < 10000 :
+ self["input"].number(number)
def selectLeft(self):
self["input"].left()
--- /dev/null
+from Screen import Screen
+from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ActionMap import ActionMap
+from Components.ConfigList import ConfigListScreen
+from Components.config import config, getConfigListEntry, ConfigNothing
+from enigma import iPlayableService
+
+from Tools.ISO639 import LanguageCodes
+
+# ikseong for subtitle hotkey
+from Screens.InfoBar import InfoBar
+
+class Subtitles(Screen, ConfigListScreen):
+ def __init__(self, session, infobar=None):
+ Screen.__init__(self, session)
+
+ self["actions"] = ActionMap(["SetupActions"],
+ {
+ "ok": self.ok,
+ "cancel": self.cancel,
+ }, -2)
+
+ self.list = []
+ ConfigListScreen.__init__(self, self.list)
+# ikseong for subtitle hotkey
+ if self.session.infobar is None:
+ if InfoBar.instance:
+ self.infobar = InfoBar.instance
+ else:
+ self.infobar = self.session.infobar
+#
+ self.fillList()
+
+ self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
+ {
+ iPlayableService.evUpdatedInfo: self.__updatedInfo
+ })
+ self.cached_subtitle_checked = False
+ self.__selected_subtitle = None
+
+ def fillList(self):
+ list = self.list
+ del list[:]
+ print "self.list", list
+ if self.subtitlesEnabled():
+ list.append(getConfigListEntry(_("Disable Subtitles"), ConfigNothing(), None))
+ sel = self.infobar.selected_subtitle
+ else:
+ sel = None
+ for x in self.getSubtitleList():
+ if sel and sel[:4] == x[:4]: #ignore Language code in compare
+ text = _("Running")
+ else:
+ text = _("Enable")
+ if x[0] == 0:
+ if LanguageCodes.has_key(x[4]):
+ list.append(getConfigListEntry(text+" DVB "+LanguageCodes[x[4]][0], ConfigNothing(), x))
+ else:
+ list.append(getConfigListEntry(text+" DVB "+x[4], ConfigNothing(), x))
+ elif x[0] == 1:
+ if x[4] == 'und': #undefined
+ list.append(getConfigListEntry(text+" TTX "+_("Page")+" %x%02x"%(x[3],x[2]), ConfigNothing(), x))
+ else:
+ if LanguageCodes.has_key(x[4]):
+ list.append(getConfigListEntry(text+" TTX "+_("Page")+" %x%02x"%(x[3],x[2])+" "+LanguageCodes[x[4]][0], ConfigNothing(), x))
+ else:
+ list.append(getConfigListEntry(text+" TTX "+_("Page")+" %x%02x"%(x[3],x[2])+" "+x[4], ConfigNothing(), x))
+ elif x[0] == 2:
+ types = (" UTF-8 text "," SSA / AAS "," .SRT file ")
+ if x[4] == 'und': #undefined
+ list.append(getConfigListEntry(text+types[x[2]]+_("Subtitles")+" %d" % x[1], ConfigNothing(), x))
+ else:
+ if LanguageCodes.has_key(x[4]):
+ list.append(getConfigListEntry(text+types[x[2]]+_("Subtitles") + ' ' + LanguageCodes[x[4]][0], ConfigNothing(), x))
+ else:
+ list.append(getConfigListEntry(text+types[x[2]]+_("Subtitles")+" %d " % x[1] +x[4], ConfigNothing(), x))
+# return _("Disable subtitles")
+ self["config"].list = list
+ self["config"].l.setList(list)
+
+ def __updatedInfo(self):
+ self.fillList()
+
+ def getSubtitleList(self):
+ s = self.infobar and self.infobar.getCurrentServiceSubtitle()
+ l = s and s.getSubtitleList() or [ ]
+ return l
+
+ def subtitlesEnabled(self):
+ return self.infobar.subtitles_enabled
+
+ def enableSubtitle(self, subtitles):
+ if self.infobar.selected_subtitle != subtitles:
+ self.infobar.subtitles_enabled = False
+ self.infobar.selected_subtitle = subtitles
+ if subtitles:
+ self.infobar.subtitles_enabled = True
+
+ def keyLeft(self):
+ ConfigListScreen.keyLeft(self)
+
+ def keyRight(self):
+ ConfigListScreen.keyRight(self)
+
+ def ok(self):
+ if self.list:
+ cur = self["config"].getCurrent()
+ self.enableSubtitle(cur[2])
+ self.close(1)
+
+ def cancel(self):
+ self.close()
from Screens.MessageBox import MessageBox
if self.settings.afterEvent.getValue() == "deepstandby":
if not Screens.Standby.inTryQuitMainloop:
- Notifications.AddNotificationWithCallback(self.sendTryQuitMainloopNotification, MessageBox, _("A sleep timer wants to shut down\nyour Dreambox. Shutdown now?"), timeout = 20)
+ Notifications.AddNotificationWithCallback(self.sendTryQuitMainloopNotification, MessageBox, _("A sleep timer wants to shut down\nyour STB. Shutdown now?"), timeout = 20)
elif self.settings.afterEvent.getValue() == "standby":
if not Screens.Standby.inStandby:
- Notifications.AddNotificationWithCallback(self.sendStandbyNotification, MessageBox, _("A sleep timer wants to set your\nDreambox to standby. Do that now?"), timeout = 20)
+ Notifications.AddNotificationWithCallback(self.sendStandbyNotification, MessageBox, _("A sleep timer wants to set your\nSTB to standby. Do that now?"), timeout = 20)
def checkNotifications(self):
InfoBarNotifications.checkNotifications(self)
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
+# ikseong
+from Plugins.SystemPlugins.FactoryTest.plugin import FactoryTest
+
class WizardSummary(Screen):
skin = """
<screen position="0,0" size="132,64">
self.timeoutTimer = eTimer()
self.timeoutTimer.callback.append(self.timeoutCounterFired)
+ # ikseong - for memory test
+ self.memorytestmode = 0
+ self.testkey = 0
+
self["text"] = Label()
if showConfig:
"7": self.keyNumberGlobal,
"8": self.keyNumberGlobal,
"9": self.keyNumberGlobal,
- "0": self.keyNumberGlobal
+ "0": self.keyNumberGlobal,
+# ikseong
+ "test":self.testmode
}, -1)
self["VirtualKB"] = NumberActionMap(["VirtualKeyboardActions"],
self.configInstance.run()
self.finished()
+# ikseong
+ def testmode(self):
+ print "testmode ",self.memorytestmode
+ if self.memorytestmode == 0:
+ self.memorytestmode = 1
+ else:
+ self.memorytestmode = 0
+
def keyNumberGlobal(self, number):
+ if self.memorytestmode == 1:
+ self.testkey = self.testkey * 10 + number
+ if self.testkey > 10000:
+ self.testkey = self.testkey%10000
+ if self.testkey == 4599:
+ self.session.open(FactoryTest)
+ print "testkey", self.testkey
+ return
if (self.wizard[self.currStep]["config"]["screen"] != None):
self.configInstance.keyNumberGlobal(number)
elif (self.wizard[self.currStep]["config"]["type"] == "dynamic"):
KEYIDS["KEY_9"]: ("9",),
KEYIDS["KEY_EXIT"]: ("EXIT",),
KEYIDS["KEY_STOP"]: ("TV", "SHIFT"),
- KEYIDS["KEY_RECORD"]: ("RECORD",)
+ KEYIDS["KEY_RECORD"]: ("RECORD",),
+# ikseong for subtitle hotkey
+ KEYIDS["KEY_SUBTITLE"]: ("SUBTITLE",)
},
{
KEYIDS["BTN_0"]: ("UP", "fp"),
KEYIDS["KEY_9"]: ("9",),
KEYIDS["KEY_EXIT"]: ("EXIT",),
KEYIDS["KEY_STOP"]: ("TV", "SHIFT"),
- KEYIDS["KEY_RECORD"]: ("RADIO", "SHIFT")
+# ikseong
+# KEYIDS["KEY_RECORD"]: ("RADIO", "SHIFT"),
+ KEYIDS["KEY_RECORD"]: ("RECORD",),
+# ikseong for subtitle hotkey
+ KEYIDS["KEY_SUBTITLE"]: ("SUBTITLE",)
}
]
#include <lib/dvb_ci/dvbci_ui.h>
#include <lib/python/python.h>
#include <lib/gdi/picload.h>
+#include <lib/driver/memtest.h>
+#include <lib/driver/sc_test.h>
%}
%feature("ref") iObject "$this->AddRef(); /* eDebug(\"AddRef (%s:%d)!\", __FILE__, __LINE__); */ "
#define DEBUG
+#define BUILD_VUPLUS
typedef long time_t;
%include "typemaps.i"
%include "std_string.i"
%include <lib/dvb/db.h>
%include <lib/python/python.h>
%include <lib/gdi/picload.h>
+%include <lib/driver/memtest.h>
+%include <lib/driver/sc_test.h>
/************** eptr **************/
/************** signals **************/
if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atMPEG)
info.m_description = "MPEG";
else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAC3)
- info.m_description = "AC3";
+ info.m_description = "Dolby Digital";
+ else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atDDP)
+ info.m_description = "Dolby Digital+";
else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAAC)
info.m_description = "AAC";
else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAACHE)
/************************************************/
+#ifdef BUILD_VUPLUS /* ikseong */
+#define CRASH_EMAILADDR "crashlog"
+#else
#define CRASH_EMAILADDR "crashlog@dream-multimedia-tv.de"
+#endif
#define INFOFILE "/maintainer.info"
#define RINGBUFFER_SIZE 16384
ePtr<gMainDC> my_dc;
gMainDC::getInstance(my_dc);
-
+
gPainter p(my_dc);
p.resetOffset();
p.resetClip(eRect(ePoint(0, 0), my_dc->size()));
p.clear();
eRect usable_area = eRect(100, 70, my_dc->size().width() - 150, 100);
-
- std::string text("We are really sorry. Your Dreambox encountered "
+
+ std::string text("We are really sorry. Your STB encountered "
"a software problem, and needs to be restarted. "
"Please send the logfile created in /hdd/ to " + crash_emailaddr + ".\n"
- "Your Dreambox restarts in 10 seconds!\n"
+ "Your STB restarts in 10 seconds!\n"
"Component: " + crash_component);
p.renderText(usable_area, text.c_str(), gPainter::RT_WRAP|gPainter::RT_HALIGN_LEFT);