Author: remi
Date: 2009-06-23 17:46:04 +0200 (Tue, 23 Jun 2009)
New Revision: 4873

Added:
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_frame.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_empty.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_high.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_low.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_middle.png
Removed:
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_closeerror_activate.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_closeerror_enable.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_configure_activate.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_configure_enable.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_startstop_activate.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_startstop_enable.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_bottom_error.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_content.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_100.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_20.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_40.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_60.png
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_80.png
Modified:
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
   
software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
   
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Log:
* updated page "live with tux"

Modified: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
      2009-06-23 14:17:01 UTC (rev 4872)
+++ 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
      2009-06-23 15:46:04 UTC (rev 4873)
@@ -265,16 +265,6 @@
     float:left;
 }
 
-div.notifyHintContainer{
-    margin-left:0px;
-    margin-top:50px;
-    height:235px;
-    width:430px;
-    font-family:Verdana, Bitstream Vera Sans;
-    display:table;
-    float:left;
-}
-
 div.notifyHintContent{
     margin-left:0px;
     margin-top:0px;
@@ -286,126 +276,17 @@
     float:left;
 }
 
-div.notifyHintBottom{
+div.notifyHintFrame{
     margin-left:0px;
-    margin-top:0px;
-    height:8px;
+    margin-top:50px;
+    height:235px;
     width:430px;
     font-family:Verdana, Bitstream Vera Sans;
-    
background-image:url(/data/web_interface/user_01/img/notify_hint_bottom.png);
+    
background-image:url(/data/web_interface/user_01/img/notify_hint_frame.png);
     display:table;
-    overflow:hidden;
-}
-
-div.notifyHintBottomError{
-    margin-left:0px;
-    margin-top:0px;
-    height:48px;
-    width:430px;
-    font-family:Verdana, Bitstream Vera Sans;
-    
background-image:url(/data/web_interface/user_01/img/notify_hint_bottom_error.png);
-    display:table;
-    overflow:hidden;
-}
-
-div.notifyHintGadgetDiv{
-    top:0px;
-    left:0px;
-       width:24px;
-    height:24px;
-    margin-left:64px;
-    -margin-left:32px;
-    margin-top:7px;
-    display:table;
     float:left;
 }
 
-.notifyHintGadgetName{
-    top:0px;
-    left:0px;
-       width:157px;
-    height:24px;
-    margin-left:8px;
-    margin-top:6px;
-    display:table;
-    line-height:24px;
-    float:left;
-    font-size:11px;
-    color:#FFFFFF;
-    font-weight:bold;
-    overflow:hidden;
-}
-
-.notifyBtnConfigure{
-    top:0px;
-    left:0px;
-       width:25px;
-    height:24px;
-    margin-left:0px;
-    margin-top:7px;
-    display:table;
-    line-height:24px;
-    float:left;
-    
background-image:url(/data/web_interface/user_01/img/notify_btn_configure_enable.png);
-}
-
-.notifyBtnConfigure:hover{
-    
background-image:url(/data/web_interface/user_01/img/notify_btn_configure_activate.png);
-}
-
-.notifyBtnStartStop{
-    top:0px;
-    left:0px;
-       width:65px;
-    height:24px;
-    margin-left:5px;
-    margin-top:7px;
-    display:table;
-    line-height:24px;
-    float:left;
-    font-size:11px;
-    color:#FFFFFF;
-    font-weight:bold;
-    text-align:center;
-    text-decoration:none;
-    
background-image:url(/data/web_interface/user_01/img/notify_btn_startstop_enable.png);
-}
-
-.notifyBtnStartStop:hover{
-    
background-image:url(/data/web_interface/user_01/img/notify_btn_startstop_activate.png);
-}
-
-.notifyHintErrorMessage{
-    top:0px;
-    left:0px;
-       width:307px;
-    height:20px;
-    margin-left:93px;
-    margin-top:12px;
-    line-height:20px;
-    display:table;
-    float:left;
-    font-size:11px;
-    color:#FF6D00;
-}
-
-.notifyBtnCloseError{
-    top:0px;
-    left:0px;
-       width:20px;
-    height:20px;
-    margin-left:0px;
-    margin-top:14px;
-    display:table;
-    float:left;
-    line-height:20px;
-    
background-image:url(/data/web_interface/user_01/img/notify_btn_closeerror_enable.png);
-}
-
-.notifyBtnCloseError:hover{
-    
background-image:url(/data/web_interface/user_01/img/notify_btn_closeerror_activate.png);
-}
-
 div.statusFrame{
     margin-top:0px;
     font-family:Verdana, Bitstream Vera Sans;
@@ -476,7 +357,7 @@
     left:0px;
        width:32px;
     height:32px;
-    margin-left:331px;
+    margin-left:375px;
     margin-top:9px;
     display:table;
     float:left;
@@ -504,7 +385,7 @@
     left:0px;
        width:101px;
     height:32px;
-    margin-left:0px;
+    margin-left:10px;
     margin-top:9px;
     display:table;
     float:left;

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_closeerror_activate.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_closeerror_enable.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_configure_activate.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_configure_enable.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_startstop_activate.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_btn_startstop_enable.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_bottom_error.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_content.png
===================================================================
(Binary files differ)

Added: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_frame.png
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_frame.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_100.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_20.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_40.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_60.png
===================================================================
(Binary files differ)

Deleted: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_80.png
===================================================================
(Binary files differ)

Added: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_empty.png
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_empty.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_high.png
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_high.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_low.png
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_low.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_middle.png
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_battery_middle.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
      2009-06-23 14:17:01 UTC (rev 4872)
+++ 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
      2009-06-23 15:46:04 UTC (rev 4873)
@@ -165,25 +165,9 @@
 
             function initialization()
             {
-                hideError();
                 updateStates();
             }
 
-            function showError(message)
-            {
-                document.getElementById("notifyHintBottom").className = 
"notifyHintBottomError";
-                
document.getElementById("notifyHintErrorMessage").style.display = "";
-                
document.getElementById("notifyHintErrorMessage").firstChild.nodeValue = 
message;
-                document.getElementById("notifyBtnCloseError").style.display = 
"";
-            }
-
-            function hideError()
-            {
-                document.getElementById("notifyHintBottom").className = 
"notifyHintBottom";
-                
document.getElementById("notifyHintErrorMessage").style.display = "none";
-                document.getElementById("notifyBtnCloseError").style.display = 
"none";
-            }
-
             function showSoundOn()
             {
                 document.getElementById("statusBtnSoundOn").src = 
"/data/web_interface/user_01/img/status_btn_soundon_activate.png";
@@ -211,37 +195,22 @@
                 if (state == 'charge')
                 {
                     document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_oncharge.png";
-                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "~";
                 }
-                else if (state == '0')
+                else if (state == 'empty')
                 {
-                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_20.png";
-                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "0 %";
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_empty.png";
                 }
-                else if (state == '20')
+                else if (state == 'low')
                 {
-                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_20.png";
-                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "20 %";
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_low.png";
                 }
-                else if (state == '40')
+                else if (state == 'middle')
                 {
-                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_40.png";
-                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "40 %";
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_middle.png";
                 }
-                else if (state == '60')
-                {
-                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_60.png";
-                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "60 %";
-                }
-                else if (state == '80')
-                {
-                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_80.png";
-                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "80 %";
-                }
                 else
                 {
-                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_100.png";
-                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "100 %";
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_high.png";
                 }
             }
 
@@ -280,6 +249,11 @@
                 getRequest("/robot_content_interactions/start_gadget", {});
             }
 
+            function startStopGadget()
+            {
+                getRequest("/robot_content_interactions/start_stop_gadget", 
{});
+            }
+
             function stopGadget()
             {
                 getRequest("/robot_content_interactions/stop_gadget", {});
@@ -292,11 +266,11 @@
                     knowedGadget04Name = name;
                     knowedGadget04Uuid = uuid;
                     knowedGadget04Icon = icon;
-                    document.getElementById("notifyHintGadgetIcon").src = icon;
-                    setpng(document.getElementById('notifyHintGadgetIcon'));
                     document.getElementById("thumbnailBarGadgetIcon04").src = 
icon;
                     
setpng(document.getElementById('thumbnailBarGadgetIcon04'));
-                    
document.getElementById("notifyHintGadgetName").firstChild.nodeValue = name;
+                    
document.getElementById('thumbnailBarGadgetIcon04').onclick = function() {
+                        startStopGadget();
+                    }
                 }
             }
 
@@ -435,6 +409,7 @@
                         <xsl:element name="img">
                             <xsl:attribute 
name="id">thumbnailBarGadgetIcon04</xsl:attribute>
                             <xsl:attribute 
name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
+                            <xsl:attribute 
name="onclick">javascript:startStopGadget();return false;</xsl:attribute>
                             <xsl:attribute name="height">70</xsl:attribute>
                             <xsl:attribute name="width">70</xsl:attribute>
                         </xsl:element>
@@ -489,54 +464,8 @@
                     <xsl:attribute name="class">notifyTuxIdle</xsl:attribute>
                     <xsl:attribute 
name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
                 </xsl:element>
-                <div class="notifyHintContainer">
-                    <!-- NOTIFIER HINT CONTENT -->
-                    <div class="notifyHintContent">
-                        <!-- GADGET ICON -->
-                        <div class="notifyHintGadgetDiv">
-                            <xsl:element name="img">
-                                <xsl:attribute 
name="id">notifyHintGadgetIcon</xsl:attribute>
-                                <xsl:attribute 
name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
-                                <xsl:attribute name="height">24</xsl:attribute>
-                                <xsl:attribute name="width">24</xsl:attribute>
-                            </xsl:element>
-                        </div>
-                        <!-- GADGET NAME -->
-                        <span class="notifyHintGadgetName" 
id="notifyHintGadgetName"> . </span>
-                        <!-- CONFIGURE BUTTON -->
-                        <xsl:element name="a">
-                            <xsl:attribute 
name="class">notifyBtnConfigure</xsl:attribute>
-                            <xsl:attribute name="name">lbOn</xsl:attribute>
-                            <xsl:attribute 
name="rel">ligthboxExample</xsl:attribute>
-                            <xsl:attribute name="onclick"></xsl:attribute>
-                            <xsl:attribute name="href">#</xsl:attribute>
-                        </xsl:element>
-                        <!-- START BUTTON -->
-                        <xsl:element name="a">
-                            <xsl:attribute 
name="class">notifyBtnStartStop</xsl:attribute>
-                            <xsl:attribute 
name="onclick">javascript:startGadget();return false;</xsl:attribute>
-                            <xsl:attribute name="href">#</xsl:attribute>
-                            <xsl:value-of select="root/translations/start"/>
-                        </xsl:element>
-                        <!-- STOP BUTTON -->
-                        <xsl:element name="a">
-                            <xsl:attribute 
name="class">notifyBtnStartStop</xsl:attribute>
-                            <xsl:attribute 
name="onclick">javascript:stopGadget();return false;</xsl:attribute>
-                            <xsl:attribute name="href">#</xsl:attribute>
-                            <xsl:value-of select="root/translations/stop"/>
-                        </xsl:element>
-                    </div>
-                    <!-- NOTIFIER HINT BOTTOM -->
-                    <div class="notifyHintBottomError" id="notifyHintBottom">
-                        <span class="notifyHintErrorMessage" 
id="notifyHintErrorMessage"></span>
-                        <!-- CLOSE ERROR HINT -->
-                        <xsl:element name="a">
-                            <xsl:attribute 
name="class">notifyBtnCloseError</xsl:attribute>
-                            <xsl:attribute 
name="id">notifyBtnCloseError</xsl:attribute>
-                            <xsl:attribute 
name="onclick">javascript:hideError();return false;</xsl:attribute>
-                            <xsl:attribute name="href">#</xsl:attribute>
-                        </xsl:element>
-                    </div>
+                <!-- NOTIFIER HINT FRAME -->
+                <div class="notifyHintFrame">
                 </div>
             </div>
             <div class="frame01Bottom"></div>
@@ -570,10 +499,8 @@
                 <xsl:element name="img">
                     <xsl:attribute 
name="class">statusPicBattery</xsl:attribute>
                     <xsl:attribute name="id">statusPicBattery</xsl:attribute>
-                    <xsl:attribute 
name="src">/data/web_interface/user_01/img/status_battery_100.png</xsl:attribute>
+                    <xsl:attribute 
name="src">/data/web_interface/user_01/img/status_battery_empty.png</xsl:attribute>
                 </xsl:element>
-                <!-- STATUS BATTERY LABEL -->
-                <span class="statusBatteryLabel" id="statusBatteryLabel">100 
%</span>
                 <!-- STATUS BTN SOUND ON -->
                 <xsl:element name="img">
                     <xsl:attribute 
name="class">statusBtnSoundOn</xsl:attribute>

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
      2009-06-23 14:17:01 UTC (rev 4872)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
      2009-06-23 15:46:04 UTC (rev 4873)
@@ -849,6 +849,33 @@
                 self.getBackgroundPguContext().stopExecution()
                 return
 
+    def startStopCurrentGadget(self):
+        """
+        """
+        # Abort foreground context if exists
+        if self.getForegroundPguContext() != None:
+            if self.getForegroundPguContext().executionIsStarted():
+                if not self.__checkLastRunActionTime():
+                    return
+                self.getForegroundPguContext().stopExecution()
+                return
+        # Else abort background context if exists
+        if self.getBackgroundPguContext() != None:
+            if self.getBackgroundPguContext().executionIsStarted():
+                # Exception for plugins commands with attribute 
"allUserButtons"
+                if self.backgroundPguContextNeedAllUserButtons():
+                    return
+                if not self.__checkLastRunActionTime():
+                    return
+                self.getBackgroundPguContext().stopExecution()
+                return
+        # Else load current selected on demand gadget
+        if len(self.__onDemandList) > 0:
+            ugc = self.__onDemandList[self.__onDemandIndex]
+            if not self.__checkLastStopActionTime():
+                return
+            ugc.start(ugc.getDefaultRunCommandName())
+
     def __contextLTPrevious(self, eventName, *args):
         """
         """
@@ -1197,3 +1224,26 @@
 
 # Register the service into the resource
 
resourceRobotContentInteractions.addService(TDSServiceRobotContentInteractionsStopGadget)
+
+# 
------------------------------------------------------------------------------
+# Declaration of the service "start_stop_gadget".
+# 
------------------------------------------------------------------------------
+class TDSServiceRobotContentInteractionsStartStopGadget(TDSService):
+
+    def configure(self):
+        self.parametersDict = {}
+        self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+        self.exclusiveExecution = True
+        self.name = "start_stop_gadget"
+        self.comment = "Start or Stop the current gadget."
+
+    def execute(self, id, parameters):
+        headersStruct = self.getDefaultHeadersStruct()
+        contentStruct = self.getDefaultContentStruct()
+        t = threading.Thread(target = 
resourceRobotContentInteractions.getPguContextsManager().startStopCurrentGadget)
+        t.start()
+        contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+        return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceRobotContentInteractions.addService(TDSServiceRobotContentInteractionsStartStopGadget)

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
  2009-06-23 14:17:01 UTC (rev 4872)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
  2009-06-23 15:46:04 UTC (rev 4873)
@@ -38,21 +38,17 @@
                 radioState = "off"
         state = 
eventsHandler.getEventHandler(ST_NAME_BATTERY_LEVEL).getLastState()
         if state == None:
-            batteryState = "0"
+            batteryState = "empty"
         else:
-            rndVal = int(state[0] / 240) * 240
+            rndVal = int(state[0] / 333) * 333
             if rndVal <= 4800:
-                batteryState = "0"
-            elif rndVal == 5040:
-                batteryState = "20"
-            elif rndVal == 5280:
-                batteryState = "40"
-            elif rndVal == 5520:
-                batteryState = "60"
-            elif rndVal == 5760:
-                batteryState = "80"
+                batteryState = "empty"
+            elif rndVal == 5133:
+                batteryState = "low"
+            elif rndVal == 5466:
+                batteryState = "middle"
             else:
-                batteryState = "100"
+                batteryState = "high"
         state = 
eventsHandler.getEventHandler(ST_NAME_CHARGER_STATE).getLastState()
         if state != None:
             if state[0] != "UNPLUGGED":


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to