kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
Initial workup for LoTW throttling & diff fetching
rodzic
9330df84f3
commit
268459833b
|
@ -86,6 +86,36 @@ function onAdiLoadComplete(adiBuffer, saveAdifFile, adifFileName, newFile)
|
||||||
{
|
{
|
||||||
let finalMode = "";
|
let finalMode = "";
|
||||||
|
|
||||||
|
let appLoTW_RXQSO = findAdiField(
|
||||||
|
activeAdifArray[x],
|
||||||
|
"APP_LoTW_RXQSO"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (appLoTW_RXQSO != "")
|
||||||
|
{
|
||||||
|
let dRXQSO = Date.parse(appLoTW_RXQSO);
|
||||||
|
let dLastLOTW_QSO = Date.parse(g_adifLogSettings.lastFetch.lotw_qso);
|
||||||
|
if ((isNaN(dRXQSO) == false) && (isNaN(dLastLOTW_QSO) == false) && (dRXQSO > dLastLOTW_QSO))
|
||||||
|
{
|
||||||
|
g_adifLogSettings.lastFetch.lotw_qso = appLoTW_RXQSO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let appLoTW_RXQSL = findAdiField(
|
||||||
|
activeAdifArray[x],
|
||||||
|
"APP_LoTW_RXQSL"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (appLoTW_RXQSL != "")
|
||||||
|
{
|
||||||
|
let dRXQSL = Date.parse(appLoTW_RXQSL);
|
||||||
|
let dLastLOTW_QSL = Date.parse(g_adifLogSettings.lastFetch.lotw_qsl);
|
||||||
|
if ((isNaN(dRXQSL) == false) && (isNaN(dLastLOTW_QSL) == false) && (dRXQSL > dLastLOTW_QSL))
|
||||||
|
{
|
||||||
|
g_adifLogSettings.lastFetch.lotw_qso = appLoTW_RXQSO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (activeAdifArray[x].length > 3)
|
if (activeAdifArray[x].length > 3)
|
||||||
{
|
{
|
||||||
if (activeAdifLogMode)
|
if (activeAdifLogMode)
|
||||||
|
@ -577,6 +607,7 @@ function lotwCallback(buffer, flag)
|
||||||
if (lotwQSHeader !== null)
|
if (lotwQSHeader !== null)
|
||||||
{
|
{
|
||||||
if (lotwQSHeader[1].toUpperCase() == "QSORX")
|
if (lotwQSHeader[1].toUpperCase() == "QSORX")
|
||||||
|
<<<<<<< HEAD
|
||||||
{
|
{
|
||||||
g_adifLogSettings.lastFetch.lotw_qso = lotwQSHeader[2]
|
g_adifLogSettings.lastFetch.lotw_qso = lotwQSHeader[2]
|
||||||
}
|
}
|
||||||
|
@ -584,6 +615,11 @@ function lotwCallback(buffer, flag)
|
||||||
{
|
{
|
||||||
g_adifLogSettings.lastFetch.lotw_qsl = lotwQSHeader[2];
|
g_adifLogSettings.lastFetch.lotw_qsl = lotwQSHeader[2];
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
{ g_adifLogSettings.lastFetch.lotw_qso = lotwQSHeader[2] }
|
||||||
|
elseif(lotwQSHeader[1].toUpperCase() == "QSL")
|
||||||
|
g_adifLogSettings.lastFetch.lotw_qsl = lotwQSHeader[2];
|
||||||
|
>>>>>>> 272892e... Initial workup for LoTW throttling & diff fetching
|
||||||
}
|
}
|
||||||
|
|
||||||
rawAdiBuffer = cleanAndPrepADIF(
|
rawAdiBuffer = cleanAndPrepADIF(
|
||||||
|
@ -637,6 +673,7 @@ var g_isGettingLOTW = false;
|
||||||
|
|
||||||
function grabLOtWLog(test)
|
function grabLOtWLog(test)
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
var lastQSLDateString = "";
|
var lastQSLDateString = "";
|
||||||
|
|
||||||
if (test == true && g_isGettingLOTW == false)
|
if (test == true && g_isGettingLOTW == false)
|
||||||
|
@ -645,6 +682,28 @@ function grabLOtWLog(test)
|
||||||
lastQSLDateString = "&qso_qsosince=2100-01-01";
|
lastQSLDateString = "&qso_qsosince=2100-01-01";
|
||||||
|
|
||||||
// Fetch Test Results
|
// Fetch Test Results
|
||||||
|
=======
|
||||||
|
var dLoTWQSO = Date.parse(g_adifLogSettings.lastFetch.lotw_qso);
|
||||||
|
var dLoTWQSL = Date.parse(g_adifLogSettings.lastFetch.lotw_qsl);
|
||||||
|
var tmpDate = ((new Date().getTime()) - 300);
|
||||||
|
|
||||||
|
// Be nice to LoTW and only fetch if last fetch was > 5 mins ago
|
||||||
|
if ((g_isGettingLOTW == false) &&
|
||||||
|
(((isNaN(dLoTWQSO) == false) && (dLoTWQSO < tmpDate)) ||
|
||||||
|
((isNaN(dLoTWQSL) == false) && (dLoTWQSL < tmpDate))
|
||||||
|
))
|
||||||
|
{
|
||||||
|
var lastQSLDateString =
|
||||||
|
"&qso_qsorxsince=" + g_adifLogSettings.lastFetch.lotw_qso +
|
||||||
|
"&qso_qslsince=" + g_adifLogSettings.lastFetch.lotw_qsl;
|
||||||
|
if (test == true)
|
||||||
|
{
|
||||||
|
lotwTestResult.innerHTML = "Testing";
|
||||||
|
lastQSLDateString = "&qso_qsosince=2100-01-01";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch QSOs
|
||||||
|
>>>>>>> 272892e... Initial workup for LoTW throttling & diff fetching
|
||||||
getABuffer(
|
getABuffer(
|
||||||
"https://lotw.arrl.org/lotwuser/lotwreport.adi?login=" +
|
"https://lotw.arrl.org/lotwuser/lotwreport.adi?login=" +
|
||||||
lotwLogin.value +
|
lotwLogin.value +
|
||||||
|
@ -719,6 +778,27 @@ function grabLoTWQSL()
|
||||||
"g_isGettingLOTW",
|
"g_isGettingLOTW",
|
||||||
120000
|
120000
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Fetch QSLs
|
||||||
|
var tQSO = setTimeout(function()
|
||||||
|
{
|
||||||
|
if (test == false) lotwLogLoaded = true;
|
||||||
|
getABuffer(
|
||||||
|
"https://lotw.arrl.org/lotwuser/lotwreport.adi?login=" +
|
||||||
|
lotwLogin.value +
|
||||||
|
"&password=" +
|
||||||
|
encodeURIComponent(lotwPassword.value) +
|
||||||
|
"&qso_query=1&qso_qsl=yes&qso_qsldetail=yes&qso_withown=yes" +
|
||||||
|
lastQSLDateString,
|
||||||
|
lotwCallback,
|
||||||
|
test,
|
||||||
|
"https",
|
||||||
|
443,
|
||||||
|
lotwLogImg,
|
||||||
|
"g_isGettingLOTW",
|
||||||
|
120000
|
||||||
|
);
|
||||||
|
}, 10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5118,7 +5118,7 @@ function clearLogFilesAndCounts()
|
||||||
g_adifLogSettings.downloads = {};
|
g_adifLogSettings.downloads = {};
|
||||||
g_adifLogSettings.lastFetch.lotw_qso = "1940-01-01";
|
g_adifLogSettings.lastFetch.lotw_qso = "1940-01-01";
|
||||||
g_adifLogSettings.lastFetch.lotw_qsl = "1940-01-01";
|
g_adifLogSettings.lastFetch.lotw_qsl = "1940-01-01";
|
||||||
saveAdifSettings();
|
localStorage.adifLogSettings = JSON.stringify(g_adifLogSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentBandModeHTML()
|
function getCurrentBandModeHTML()
|
||||||
|
|
Ładowanie…
Reference in New Issue