Update GPS Adv Sports II.js
parent
ab31c898b0
commit
e3a6f961fa
|
|
@ -5,8 +5,7 @@ app.LoadPlugin( "PuckJS" );
|
|||
|
||||
|
||||
//Called when application is started.
|
||||
function OnStart()
|
||||
{
|
||||
function OnStart() {
|
||||
|
||||
requiredVer = '1.43';
|
||||
|
||||
|
|
@ -22,6 +21,7 @@ function OnStart()
|
|||
puck.Scan("Bangle");
|
||||
|
||||
// Controls
|
||||
app.SetScreenMode("Full")
|
||||
|
||||
//Create a layout with objects vertically centered.
|
||||
layVert = app.CreateLayout("Linear", "VCenter,FillXY")
|
||||
|
|
@ -85,37 +85,9 @@ function OnStart()
|
|||
btnScan.SetBackColor(btnOff)
|
||||
layBtn.AddChild(btnScan);
|
||||
|
||||
/*
|
||||
btn1 = app.CreateButton( " SPD " );
|
||||
btn1.SetOnTouch( btn_OnBTN1 );
|
||||
btn1.SetBackColor(btnOff)
|
||||
layBtn.AddChild( btn1 );
|
||||
|
||||
btn2 = app.CreateButton( " ALT " );
|
||||
btn2.SetOnTouch( btn_OnBTN2 );
|
||||
btn2.SetBackColor(btnOff)
|
||||
layBtn.AddChild( btn2 );
|
||||
|
||||
btn3 = app.CreateButton( " DST " );
|
||||
btn3.SetOnTouch( btn_OnBTN3 );
|
||||
btn3.SetBackColor(btnOff)
|
||||
layBtn.AddChild( btn3 );
|
||||
|
||||
btn4 = app.CreateButton( " VMG " );
|
||||
btn4.SetOnTouch( btn_OnBTN4 );
|
||||
btn4.SetBackColor(btnOff)
|
||||
layBtn.AddChild( btn4 );
|
||||
*/
|
||||
|
||||
// Status 'LED'
|
||||
led = app.AddCanvas(layBtn, 0.1, 0.1, "FillXY,Bottom")
|
||||
|
||||
// bt = app.CreateText( '' ,-1,-1)
|
||||
// bt.SetSize(20,-1,"px")
|
||||
// layBtn.AddChild(bt)
|
||||
|
||||
|
||||
|
||||
layVert.AddChild(layBtn)
|
||||
|
||||
//Add layout to app.
|
||||
|
|
@ -214,8 +186,6 @@ function readResponse(data) {
|
|||
|
||||
function clearLED() {
|
||||
led.Clear()
|
||||
// led.SetPaintColor("#D31A99")
|
||||
// led.DrawCircle( 0.5, 0.5, 0.1 )
|
||||
led.Update()
|
||||
}
|
||||
|
||||
|
|
@ -223,15 +193,13 @@ function onConnect() {
|
|||
btn_OnStart() // Once connect tell app to start sending updates
|
||||
}
|
||||
|
||||
function btn_OnStart()
|
||||
{
|
||||
function btn_OnStart() {
|
||||
btnStart.SetBackColor(btnOn)
|
||||
btnStop.SetBackColor(btnOff)
|
||||
puck.SendCode('btOn(1)\n') // Enable the data send
|
||||
}
|
||||
|
||||
function btn_OnStop()
|
||||
{
|
||||
function btn_OnStop() {
|
||||
btnStart.SetBackColor(btnOff)
|
||||
btnStop.SetBackColor(btnOn)
|
||||
puck.SendCode('btOn(0)\n') // Disable the data send
|
||||
|
|
@ -242,20 +210,9 @@ function btn_OnStop()
|
|||
sats.SetText('')
|
||||
}
|
||||
|
||||
function btn_OnScan()
|
||||
{
|
||||
function btn_OnScan() {
|
||||
btnStart.SetBackColor(btnOff)
|
||||
btnStop.SetBackColor(btnOff)
|
||||
puck.Scan("Bangle");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
function btn_OnBTN1() {puck.SendCode('btSetMode(0)\n')} // SPD
|
||||
|
||||
function btn_OnBTN2() {puck.SendCode('btSetMode(1)\n')} // ALT
|
||||
|
||||
function btn_OnBTN3() {puck.SendCode('btSetMode(2)\n')} // DST
|
||||
|
||||
function btn_OnBTN4() {puck.SendCode('btSetMode(3)\n')} // DST
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue