-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
seperate tracker screen, initial radio support
- Loading branch information
Showing
9 changed files
with
598 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,5 @@ | |
|
||
.small { | ||
font: 10px sans-serif; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var radioConnected = false; | ||
|
||
function connectRadio() | ||
{ | ||
if ( radioConnected == true ) | ||
{ | ||
return; | ||
} | ||
|
||
try { | ||
|
||
radio_header.innerHTML = "Radio Control <span class='badge bg-danger'>Connecting</span>"; | ||
|
||
connectWS("ws://localhost:1880/ws/radio", radioConnectionOpen, radioConnectionClosed, radioConnectionMessageReceived); | ||
} | ||
catch (err) { | ||
console.log("Couldn't connect to radio websocket") | ||
} | ||
|
||
} | ||
|
||
function radioConnectionOpen(event) { | ||
console.log("Radio Connected"); | ||
|
||
radio_header.innerHTML = "Radio Control <span class='badge bg-success'>Connected</span>"; | ||
|
||
radioConnected = true; | ||
$("#radioEnabled").attr("disabled", false); | ||
} | ||
|
||
function radioConnectionClosed(event) { | ||
radio_header.innerHTML = "Radio Control <a onClick='connectRadio()'><span class='badge bg-danger'>Disconnected</span></a>"; | ||
|
||
$("#radioEnabled").attr("disabled", true); | ||
|
||
console.log("Radio Disconnected"); | ||
radioConnected = false; | ||
} | ||
|
||
function radioConnectionMessageReceived(event) { | ||
console.log(JSON.parse(event.data)) | ||
|
||
radioData = JSON.parse(event.data) | ||
/* | ||
azActual = rotatorData.az; | ||
elActual = rotatorData.el; | ||
rot_actual_el.innerHTML = rotatorData.el; | ||
rot_actual_az.innerHTML = rotatorData.az; | ||
*/ | ||
} |
Oops, something went wrong.