fixed scoreservice. Not-QRV stations and such which dont provide needed bands now never could appear at the prirotity list

This commit is contained in:
Marc Froehlich
2026-08-06 00:26:29 +02:00
parent 084923366f
commit 6d65bc365c
2 changed files with 12 additions and 3 deletions
@@ -166,7 +166,15 @@ public final class ScoreService {
scoreByCallRaw.put(callRaw, score);
preferredCategoryByCallRaw.put(callRaw, representative.getChatCategory());
topAll.add(new TopCandidate(callRaw, representative.getCallSign(), representative.getChatCategory(), score));
if (Double.isFinite(score) && score > 0.0) {
topAll.add(new TopCandidate(
callRaw,
representative.getCallSign(),
representative.getChatCategory(),
score
));
}
}
// 3) Build Top-N
@@ -2,6 +2,7 @@ package kst4contest.controller;
import kst4contest.logic.SignalDetector;
import kst4contest.model.ChatPreferences;
import kst4contest.model.ChatMember;
import java.util.ArrayDeque;
import java.util.Deque;
@@ -21,7 +22,7 @@ import java.util.regex.Pattern;
public final class StationMetricsService {
/** /cq <CALL> ... */
private static final Pattern OUTBOUND_CQ_PATTERN = Pattern.compile("(?i)^\\s*/cq\\s+([A-Z0-9/]+)\\b.*");
private static final Pattern OUTBOUND_CQ_PATTERN = Pattern.compile("(?i)^\\s*/cq\\s+([A-Z0-9/-]+)\\b.*");
/** Rolling window timestamps for momentum scoring. */
private static final int MAX_STORED_INBOUND_TIMESTAMPS = 32;
@@ -195,7 +196,7 @@ public final class StationMetricsService {
private static String normalizeCallRaw(String s) {
if (s == null) return null;
return s.trim().toUpperCase();
return ChatMember.normalizeCallSignToBaseCallSign(s);
}
private static final class StationMetrics {