Merge branch 'POTA-menu' into 'master'

POTA feature setting under Settings -> Logbook

See merge request gridtracker.org/gridtracker!206

If this is changing anything in the UI or operational behavior, please prepare to update the wiki!
merge-requests/205/merge
T Loomis 2022-10-02 18:39:54 +00:00
commit 5d7f214948
8 zmienionych plików z 91 dodań i 38 usunięć

Wyświetl plik

@ -695,9 +695,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<div id="radarButton" onclick="toggleNexrad()" class="iconButton" title="Toggle US Nexrad">
<img src="./img/radar-button.png" class="buttonImg" />
</div>
<div id="potaButton" onClick="togglePota();" class="iconButton" title="Parks On The Air">
<img id="potaImg" src="./img/pota.png" class="buttonImg" />
</div>
<div id="gridOverlayButton" onclick="toggleAllGrids()" class="iconButton" title="Toggle All Grid Overlay">
<img src="./img/grid-overlay.png" class="buttonImg" />
</div>
@ -707,6 +704,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<div id="msgButton" onclick="showMessaging();" class="iconButton" title="Messaging Window">
<img id="msgImg" src="./img/gt_chat.png" class="buttonImg" />
</div>
<div id="potaButton" onClick="togglePotaMap();" class="iconButton" title="Parks On The Air">
<img id="potaImg" src="./img/pota.png" class="buttonImg" />
</div>
</div>
<div
id="SpotsDiv"
@ -1520,6 +1520,29 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</tr>
</table>
</div>
<div id="featureControlDiv" class="mapItem">
<table align="center" class="darkTable">
<tr>
<th colspan="6" style="font-weight: bold; color: yellow">Feature Control</th>
</tr>
<tr>
<th>Feature</th>
<th>Enabled</th>
<th>Menu Button</th>
</tr>
<tr>
<td>POTA</td>
<td>
<input type="checkbox" id="potaEnabled" onclick="changePotaEnable();" />
</td>
<td>
<input type="checkbox" id="potaMenu" onclick="changePotaMenu();" />
</td>
</tr>
</table>
</div>
</div>
<div id="SpeechSettingsDiv" class="settingsTabcontent">
<div class="roundBorder" style="border: 1px solid #666; margin: 2px; padding: 5px">

Wyświetl plik

@ -1827,7 +1827,7 @@ function sendToLogger(ADIF)
record.GRIDSQUARE = g_liveCallsigns[localHash].grid.substr(0, 4);
}
if (g_potaEnabled == 1 && localHash in g_liveCallsigns && g_liveCallsigns[localHash].pota.length > 0)
if (g_appSettings.potaEnabled == 1 && localHash in g_liveCallsigns && g_liveCallsigns[localHash].pota.length > 0)
{
let pota = g_liveCallsigns[localHash].pota[0];
if (pota != "?-????")
@ -1948,7 +1948,7 @@ function finishSendingReport(record, localMode)
{
g_lastReport = report;
if (g_potaEnabled == 1 && "POTA" in record)
if (g_appSettings.potaEnabled == 1 && "POTA" in record)
{
reportPotaQSO(record);
addLastTraffic("<font style='color:white'>Spotted to POTA</font>");

Wyświetl plik

@ -75,7 +75,9 @@ var def_appSettings = {
myRawFreq: "",
myRawGrid: "",
pathWidthWeight: 1.0,
potaEnabled: 0,
potaEnabled: 1,
potaShowMenu: true,
potaMapEnabled: false,
pushPinMode: false,
qrzPathWidthWeight: 1.2,
sixWideMode: 0,

Wyświetl plik

@ -180,7 +180,6 @@ var g_flightDuration = 30;
var g_crScript = g_appSettings.crScript;
var g_spotsEnabled = g_appSettings.spotsEnabled;
var g_potaEnabled = g_appSettings.potaEnabled;
var g_heatEnabled = g_appSettings.heatEnabled;
var g_myLat = g_mapSettings.latitude;
@ -7165,7 +7164,7 @@ function handleWsjtxDecode(newMessage)
}
}
if (g_potaEnabled == 1)
if (g_appSettings.potaEnabled == 1)
{
if (callsign.DEcall in g_pota.callSpots || callsign.DEcall in g_pota.callSchedule)
{

Wyświetl plik

@ -62,36 +62,62 @@ var g_gtParkIconInactive = new ol.style.Icon({
function initPota()
{
potaImg.style.filter = g_potaEnabled == 1 ? "" : "grayscale(1)";
potaEnabled.checked = (g_appSettings.potaEnabled == 1);
potaMenu.checked = g_appSettings.potaShowMenu;
potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu) ? "" : "none";
potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
getPotaParks();
}
function togglePota()
{
g_potaEnabled ^= 1;
g_appSettings.potaEnabled = g_potaEnabled;
potaImg.style.filter = g_potaEnabled == 1 ? "" : "grayscale(1)";
saveAppSettings();
if (g_potaEnabled == 1)
g_layerSources.pota.clear();
g_pota.mapParks = {};
if (g_appSettings.potaEnabled == 1)
{
getPotaParks();
}
else
}
function changePotaEnable()
{
g_appSettings.potaEnabled = (potaEnabled.checked == true) ? 1 : 0;
potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu) ? "" : "none";
if (!g_appSettings.potaEnabled)
{
g_layerSources.pota.clear();
g_pota.mapParks = {};
}
else
{
getPotaParks();
}
saveAppSettings();
goProcessRoster();
}
function changePotaMenu()
{
g_appSettings.potaShowMenu = potaMenu.checked;
potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu) ? "" : "none";
potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
saveAppSettings();
}
function togglePotaMap()
{
g_appSettings.potaMapEnabled = !g_appSettings.potaMapEnabled;
potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
saveAppSettings();
redrawParks();
}
function redrawParks()
{
g_layerSources.pota.clear();
if (g_potaEnabled == 1)
if (g_appSettings.potaEnabled == 1 && g_appSettings.potaMapEnabled)
{
g_pota.mapParks = {};
makeParkFeatures();
@ -164,7 +190,10 @@ function potaSpotFromDecode(callObj)
}
// may or may not be on screen, so try
addParkSpotFeature(park, g_pota.parkSpots[park][callObj.DEcall]);
if (g_appSettings.potaMapEnabled)
{
addParkSpotFeature(park, g_pota.parkSpots[park][callObj.DEcall]);
}
let hash = park + callObj.DEcall;
if (!(hash in g_pota.rbnReportTimes) || Date.now() > g_pota.rbnReportTimes[hash])
@ -290,7 +319,7 @@ function addParkSpotFeature(park, report)
function processPotaParks(buffer)
{
if (g_potaEnabled == 1)
if (g_appSettings.potaEnabled == 1)
{
try
{
@ -332,7 +361,7 @@ function getPotaParks()
g_pota.spotsTimeout = null;
}
if (g_mapSettings.offlineMode == false && g_potaEnabled == 1)
if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
{
getBuffer(
"https://storage.googleapis.com/gt_app/pota.json?cb=" + Date.now(),
@ -380,7 +409,7 @@ function uniqueArrayFromArray(input)
function processPotaSpots(buffer)
{
if (g_potaEnabled == 1)
if (g_appSettings.potaEnabled == 1)
{
try
{
@ -439,7 +468,7 @@ function getPotaSpots()
g_pota.spotsTimeout = null;
}
if (g_mapSettings.offlineMode == false && g_potaEnabled == 1)
if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
{
getBuffer(
"https://api.pota.app/spot/activator",
@ -455,7 +484,7 @@ function getPotaSpots()
function processPotaSchedule(buffer)
{
if (g_potaEnabled == 1)
if (g_appSettings.potaEnabled == 1)
{
try
{
@ -513,7 +542,7 @@ function getPotaSchedule()
g_pota.scheduleTimeout = null;
}
if (g_mapSettings.offlineMode == false && g_potaEnabled == 1)
if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
{
getBuffer(
"https://api.pota.app/activation",

Wyświetl plik

@ -68,7 +68,7 @@ var g_defaultSettings = {
callsign: "all",
hunting: "dxcc",
huntNeed: "confirmed",
requireGrid: true,
requireGrid: false,
wantMaxDT: false,
wantMinDB: false,
wantMinFreq: false,
@ -119,9 +119,9 @@ var g_defaultSettings = {
DXCC: true,
Flag: true,
State: true,
County: true,
County: false,
POTA: false,
Cont: true,
Cont: false,
dB: true,
Freq: false,
DT: false,
@ -129,7 +129,7 @@ var g_defaultSettings = {
Azim: true,
CQz: false,
ITUz: false,
PX: true,
PX: false,
LoTW: false,
eQSL: false,
OQRS: false,
@ -145,7 +145,7 @@ var g_defaultSettings = {
settingProfiles: false,
sortColumn: "Age",
sortReverse: false
sortReverse: true
};
const LOGBOOK_LIVE_BAND_LIVE_MODE = "0";

Wyświetl plik

@ -15,7 +15,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
const currentYear = new Date().getFullYear();
const currentYearSuffix = `&rsquo;${currentYear - 2000}`;
const potaEnabled = (window.opener.g_potaEnabled === 1);
const potaEnabled = (window.opener.g_appSettings.potaEnabled === 1);
// TODO: Hunting results might be used to filter, based on the "Callsigns: Only Wanted" option,
// so maybe we can move this loop first, and add a check to the filtering loop?

Wyświetl plik

@ -33,7 +33,7 @@ function renderRoster(callRoster, rosterSettings)
columnOverrides.LoTW = false;
}
if (window.opener.g_potaEnabled === 1)
if (window.opener.g_appSettings.potaEnabled === 1)
{
huntingMatrixPotaDiv.style.display = "";
}