Displaying a dynamic battery charge graphic
Posted: Thu Mar 04, 2010 9:14 pm
Hi,
I am trying to get a graphic showing the battery charge of a device.
I tried this directly:
Image_[$SCRIPT=Math.Round(&hs.DeviceValue("V1")/25)*25].png
But this does not work, so I used $hs.regex to run a little script which does this indirectly, I am just having problems returning a (correct) result. How does this work?
The script is simple and currently looks like this:
Sub Main (parm as object)
Dim Charge as Integer = parm
Charge = Math.Round(Charge / 25)*25
hs.writelog("Battery", "Rounded Batterylife comes to: " & Charge)
End Sub
Where the log returns the expected value, but in HSTouch I get 0?
Any ideas?
Cheers,
Elco
I am trying to get a graphic showing the battery charge of a device.
I tried this directly:
Image_[$SCRIPT=Math.Round(&hs.DeviceValue("V1")/25)*25].png
But this does not work, so I used $hs.regex to run a little script which does this indirectly, I am just having problems returning a (correct) result. How does this work?
The script is simple and currently looks like this:
Sub Main (parm as object)
Dim Charge as Integer = parm
Charge = Math.Round(Charge / 25)*25
hs.writelog("Battery", "Rounded Batterylife comes to: " & Charge)
End Sub
Where the log returns the expected value, but in HSTouch I get 0?
Any ideas?
Cheers,
Elco