You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
Multi TX ID functionality
Return alternative matches from TX search algorithm and show them in frontend panel
This commit is contained in:
@@ -416,7 +416,8 @@ function handleData(wss, receivedData, rdsWss) {
|
||||
azi: currentTx.azimuth,
|
||||
id: currentTx.id,
|
||||
pi: currentTx.pi,
|
||||
reg: currentTx.reg
|
||||
reg: currentTx.reg,
|
||||
otherMatches: currentTx.others
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -416,7 +416,7 @@ router.get('/log_fmlist', (req, res) => {
|
||||
client: {
|
||||
request_ip: clientIp
|
||||
},
|
||||
type: (req.query.type && dataHandler.dataToSend.txInfo.dist > 700) ? req.query.type : 'tropo',
|
||||
type: req.query.type ? req.query.type : 'tropo',
|
||||
log_msg: "Logged PS: " + dataHandler.dataToSend.ps.replace(/\s+/g, '_') + ", PI: " + dataHandler.dataToSend.pi + ", Signal: " + (dataHandler.dataToSend.sig - 11.25).toFixed(0) + " dBµV",
|
||||
});
|
||||
|
||||
|
||||
@@ -149,10 +149,10 @@ function evaluateStation(station) {
|
||||
return score;
|
||||
}
|
||||
|
||||
// Fetch data from cached database
|
||||
// Fetch data from maps
|
||||
async function fetchTx(freq, piCode, rdsPs) {
|
||||
let match = null;
|
||||
// let multiMatches = [];
|
||||
let multiMatches = [];
|
||||
const now = Date.now();
|
||||
freq = parseFloat(freq);
|
||||
|
||||
@@ -192,7 +192,7 @@ async function fetchTx(freq, piCode, rdsPs) {
|
||||
loc.score = evaluateStation(loc);
|
||||
}
|
||||
match = filteredLocations.reduce((max, obj) => obj.score > max.score ? obj : max, filteredLocations[0]);
|
||||
// multiMatches = filteredLocations.filter(obj => obj !== match);
|
||||
multiMatches = filteredLocations.filter(obj => obj !== match);
|
||||
} else if (filteredLocations.length === 1) {
|
||||
match = filteredLocations[0];
|
||||
}
|
||||
@@ -218,7 +218,7 @@ async function fetchTx(freq, piCode, rdsPs) {
|
||||
pi: match.pi,
|
||||
foundStation: true,
|
||||
reg: match.detectedByPireg,
|
||||
// others: multiMatches,
|
||||
others: multiMatches,
|
||||
};
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
|
||||
Reference in New Issue
Block a user