Skip to content

Commit 90282df

Browse files
authored
Merge pull request #166 from MrAlders0n/copilot/update-rx-log-sample-count
Track and display aggregated sample counts in passive RX log entries
2 parents fa6eea7 + 9633004 commit 90282df

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

content/wardrive.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@ function queueApiPost(entry) {
26632663

26642664
// Add aggregated entry to RX log UI
26652665
const timestamp = new Date(entry.timestamp_start).toISOString();
2666-
addRxLogEntry(entry.repeater_id, entry.snr_avg, entry.rssi_avg, entry.path_length, entry.header, entry.location.lat, entry.location.lng, timestamp);
2666+
addRxLogEntry(entry.repeater_id, entry.snr_avg, entry.rssi_avg, entry.path_length, entry.header, entry.location.lat, entry.location.lng, timestamp, entry.sample_count);
26672667
}
26682668

26692669
// ---- Mobile TX Log Bottom Sheet ----
@@ -3003,6 +3003,14 @@ function createRxLogEntryElement(entry) {
30033003
const chip = createChipElement(parsed.repeaterId, parsed.snr);
30043004
chipsRow.appendChild(chip);
30053005

3006+
// Add sample count badge if aggregated (sampleCount > 1)
3007+
if (entry.sampleCount && entry.sampleCount > 1) {
3008+
const badge = document.createElement('span');
3009+
badge.className = 'text-xs text-slate-400 ml-1';
3010+
badge.textContent = `x${entry.sampleCount}`;
3011+
chipsRow.appendChild(badge);
3012+
}
3013+
30063014
logEntry.appendChild(topRow);
30073015
logEntry.appendChild(chipsRow);
30083016

@@ -3161,8 +3169,9 @@ function toggleRxLogBottomSheet() {
31613169
* @param {number} lat - Latitude
31623170
* @param {number} lon - Longitude
31633171
* @param {string} timestamp - ISO timestamp
3172+
* @param {number} [sampleCount=1] - Number of samples aggregated in this entry
31643173
*/
3165-
function addRxLogEntry(repeaterId, snr, rssi, pathLength, header, lat, lon, timestamp) {
3174+
function addRxLogEntry(repeaterId, snr, rssi, pathLength, header, lat, lon, timestamp, sampleCount = 1) {
31663175
const entry = {
31673176
repeaterId,
31683177
snr,
@@ -3171,7 +3180,8 @@ function addRxLogEntry(repeaterId, snr, rssi, pathLength, header, lat, lon, time
31713180
header,
31723181
lat,
31733182
lon,
3174-
timestamp
3183+
timestamp,
3184+
sampleCount
31753185
};
31763186

31773187
rxLogState.entries.push(entry);

0 commit comments

Comments
 (0)