3 Replies Latest reply on May 21, 2012 4:53 AM by Otto Palminkoski

    Battery & Network signals not changing

    Venkatasubbaiah Chenna

      Hi

       

      I am trying to display battery and network on my page. I have added the following code. I am calling this loadDeviceDetails() method on jquery.ready() function. Battery and Network icons displayed. But changes not reapinting the indicators.The event is firing

       

      $(document).ready(function () {

                  //alert("DOM OK !");

                  loadDeviceDetails();

              });

       

       

      And also minimize button is not displayed where as quit button is displayed.

       

      <script type="text/javascript">

              function drawSignalAndNetwork(jsonObject) {

                  signal.layout = 'right';

                  signal.top = 3;

                  signal.left = 390;

                  signal.color = '#FFFFFF';

                  signal.visibility = 'visible';

       

       

                  //battery.getSmartBatteryStatus();

                  battery.layout = 'right';

                  battery.top = 3;

                  battery.left = 440;

                  battery.color = '#FFFFFF';

                  battery.visibility = 'visible';

                              //alert("DONE !");

              }

       

       

              function displaySignalAndNetwork() {

                  battery.getSmartBatteryStatus();

                  minimizeButton.top = '0'

                  minimizeButton.left = '200'

                  minimizeButton.Visible = 'visible';

                  minimizeButton.imageUp = '@Url.Content("~/Areas/MCxxTW/Content/images/lock.png")';

                  minimizeButton.imageDown = '@Url.Content("~/Areas/MCxxTW/Content/images/lock.png")';

       

       

                  quitButton.top = '0';

                  quitButton.left = '90';

                  quitButton.visibility = 'visible';

       

                  // Subscribe to the signal event

                  signal.signalEvent = "url('JavaScript:drawSignalAndNetwork(%json)')";

                }

       

       

              function loadDeviceDetails() {

                         displaySignalAndNetwork();

               }

      </script>

       

      thanks

      Chenna

        • Re: Battery & Network signals not changing
          Venkatasubbaiah Chenna

          added battery event. But still not working.

           

          <script type="text/javascript">

           

                    $(document).ready(function () {

                        //alert("DOM OK !");

                        loadDeviceDetails();

                    });

           

                     function drawSignalAndNetwork(jsonObject) {

                          //alert("DONE !");

                    }

           

                    function OnBattery(json) {

                        //alert("OnBattery() !");      

                    }

           

           

                    function displaySignalAndNetwork() {

                        minimizeButton.top = '0'

                        minimizeButton.left = '240'

                        minimizeButton.visibility = 'visible';

           

                        minimizeButton.imageUp = '@Url.Content("~/Areas/MCxxTW/Content/images/lock.png")';

                        minimizeButton.imageDown = '@Url.Content("~/Areas/MCxxTW/Content/images/lock.png")';

           

                        quitButton.top = '0';

                        quitButton.left = '0';

                        quitButton.visibility = 'visible';

           

                        signal.layout = 'right';

                        signal.top = 3;

                        signal.left = 390;

                        signal.color = '#FFFFFF';

                        signal.visibility = 'visible';

             

                        battery.layout = 'right';

                        battery.top = 3;

                        battery.left = 440;

                        battery.color = '#FFFFFF';

                        battery.visibility = 'visible';

             

                        // Subscribe to the batteryevent

                        battery.batteryEvent = "OnBattery(%json)";

           

                         // Subscribe to the signal event

                        signal.signalEvent = "url('JavaScript:drawSignalAndNetwork(%json)')";

           

                    }

           

                    function loadDeviceDetails() {

                          displaySignalAndNetwork();

                      }

            

          </script>

            • Re: Battery & Network signals not changing
              Sushil Gusain

              Hi,

              Please find the attached file - FeatureDemo.

              I think it will help you to show signal strength and the automatic change.

              For Battery signals you can use the code given below:

               

              <META HTTP-Equiv="Battery" Content="Left:50;Top:50;Layout:Left;color:#FF0000;visibility:visible">

              or javascript function()

              like this :

              function BatterySignal()

              {

                            battery.layout = 'right';

                            battery.top = 3;

                            battery.left = 440;

                            battery.color = '#FFFFFF';

                            battery.visibility = 'visible';

               

              }

              with setTimeout("BatterySignal",1000);

            • Re: Battery & Network signals not changing
              Otto Palminkoski

              Hello,

               

              use different color than #ffffff. This should fix the 'problem'.

               

              - Otto