-
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.
geostationary satellites, footprint, client side pass calculation, up…
…dated rotator control, node-red info
- Loading branch information
Showing
7 changed files
with
638 additions
and
194 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,50 @@ | ||
function rotatorConnectionOpen(event) { | ||
console.log("Rotator Connected"); | ||
var rotatorConnected = false; | ||
var azActual = -1 | ||
var elActual = -1 | ||
|
||
function connectRotator() | ||
{ | ||
if ( rotatorConnected == true ) | ||
{ | ||
return; | ||
} | ||
|
||
function rotatorConnectionClosed(event) { | ||
console.log("Rotator Disconnected"); | ||
try { | ||
|
||
rotator_header.innerHTML = "Rotator Control <span class='badge bg-danger'>Connecting</span>"; | ||
|
||
connectWS("ws://192.168.0.250:1880/ws/rotator", rotatorConnectionOpen, rotatorConnectionClosed, rotatorConnectionMessageReceived); | ||
} | ||
catch (err) { | ||
console.log("Couldn't connect to rotator websocket") | ||
} | ||
|
||
} | ||
|
||
function rotatorConnectionOpen(event) { | ||
console.log("Rotator Connected"); | ||
|
||
rotator_header.innerHTML = "Rotator Control <span class='badge bg-success'>Connected</span>"; | ||
|
||
rotatorConnected = true; | ||
$("#rotatorEnabled").attr("disabled", false); | ||
} | ||
|
||
function rotatorConnectionClosed(event) { | ||
rotator_header.innerHTML = "Rotator Control <a onClick='connectRotator()'><span class='badge bg-danger'>Disconnected</span></a>"; | ||
|
||
$("#rotatorEnabled").attr("disabled", true); | ||
|
||
console.log("Rotator Disconnected"); | ||
rotatorConnected = false; | ||
} | ||
|
||
function rotatorConnectionMessageReceived(event) { | ||
console.log(JSON.parse(event.data)) | ||
function rotatorConnectionMessageReceived(event) { | ||
console.log(JSON.parse(event.data)) | ||
|
||
rotatorData = JSON.parse(event.data) | ||
rot_actual_el.innerHTML = rotatorData.el; | ||
rot_actual_az.innerHTML = rotatorData.az; | ||
} | ||
rotatorData = 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.