kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
Reload the roster when toggling setting. Plus notes.
rodzic
be8e504e85
commit
ee83005ac4
|
@ -1,3 +1,14 @@
|
||||||
|
/**
|
||||||
|
* PSTRotator is a third party application (windows-only) that interfaces with dozens of antenna rotators.
|
||||||
|
* It offers a way for other apps to request rotation to a specific azimuth, or a grid square.
|
||||||
|
*
|
||||||
|
* Other rotator control apps, like [CatRotator](https://www.pianetaradio.it/blog/catrotator/) also support this API.
|
||||||
|
*
|
||||||
|
* The most comprehensive API details are in this Groups.io post:
|
||||||
|
* https://groups.io/g/PstRotator/message/5825
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
validSettings.push("pstrotatorSettings")
|
validSettings.push("pstrotatorSettings")
|
||||||
|
|
||||||
var def_pstrotatorSettings = {
|
var def_pstrotatorSettings = {
|
||||||
|
@ -10,15 +21,35 @@ var g_pstrotatorSettings = {};
|
||||||
|
|
||||||
function pstrotatorServiceChanged()
|
function pstrotatorServiceChanged()
|
||||||
{
|
{
|
||||||
g_pstrotatorSettings.enable = pstrotatorCheckBox.checked;
|
if (g_pstrotatorSettings.enabled != pstrotatorCheckBox.checked)
|
||||||
|
{
|
||||||
|
// This setting toggles the presence of a contextual menu item in the roster,
|
||||||
|
// which is constructed only during roster initialization.
|
||||||
|
//
|
||||||
|
// So when this setting is changed, we need to reload the entire roster window.
|
||||||
|
//
|
||||||
|
g_pstrotatorSettings.enable = pstrotatorCheckBox.checked;
|
||||||
|
if (g_rosterInitialized)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
g_callRosterWindowHandle.window.location.reload();
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_pstrotatorSettings.ip = pstrotatorIpInput.value;
|
g_pstrotatorSettings.ip = pstrotatorIpInput.value;
|
||||||
g_pstrotatorSettings.port = pstrotatorPortInput.value;
|
g_pstrotatorSettings.port = pstrotatorPortInput.value;
|
||||||
|
|
||||||
localStorage.pstrotatorSettings = JSON.stringify(g_pstrotatorSettings);
|
localStorage.pstrotatorSettings = JSON.stringify(g_pstrotatorSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
function aimRotator({callObj})
|
function aimRotator(info) {
|
||||||
console.log("Aim Rotator", callObj)
|
const { callObj } = info
|
||||||
|
|
||||||
if (
|
if (
|
||||||
g_pstrotatorSettings.enable == true &&
|
g_pstrotatorSettings.enable == true &&
|
||||||
|
@ -41,7 +72,6 @@ function aimRotator({callObj})
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
console.log("UDP Payload", payload)
|
|
||||||
sendUdpMessage(
|
sendUdpMessage(
|
||||||
payload,
|
payload,
|
||||||
payload.length,
|
payload.length,
|
||||||
|
|
Ładowanie…
Reference in New Issue