added project Band enum from Win-Test band IDs

This commit is contained in:
Marc Froehlich
2026-08-05 01:18:41 +02:00
parent e37cda8ff2
commit 6092ff882a
4 changed files with 88 additions and 41 deletions
@@ -36,8 +36,8 @@ public class DBController {
* Number of milliseconds after which worked/not-QRV data is considered outdated * Number of milliseconds after which worked/not-QRV data is considered outdated
* and therefore automatically reset. * and therefore automatically reset.
*/ */
private static final long WORKED_DATA_EXPIRATION_IN_MILLISECONDS = 65L * 60L * 60L * 1000L; private static final long WORKED_DATA_EXPIRATION_IN_MILLISECONDS =
3L * 24L * 60L * 60L * 1000L;
/** /**
* Database schema version that includes the raw-callsign normalization migration * Database schema version that includes the raw-callsign normalization migration
* marker. The marker is stored in SQLite PRAGMA user_version so the expensive * marker. The marker is stored in SQLite PRAGMA user_version so the expensive
@@ -303,17 +303,19 @@ public class ReadUDPByWintestThread extends Thread {
return null; return null;
} }
switch (bandId.trim()) { return switch (bandId.trim()) {
case "12": return Band.B_144; case "10" -> Band.B_50;
case "14": return Band.B_432; case "11" -> Band.B_70;
case "16": return Band.B_1296; case "12" -> Band.B_144;
case "17": return Band.B_2320; case "14" -> Band.B_432;
case "18": return Band.B_3400; case "16" -> Band.B_1296;
case "19": return Band.B_5760; case "17" -> Band.B_2320;
case "20": return Band.B_10G; case "18" -> Band.B_3400;
case "21": return Band.B_24G; case "19" -> Band.B_5760;
default: return null; case "20" -> Band.B_10G;
} case "21" -> Band.B_24G;
default -> null;
};
} }
/** /**
@@ -10915,9 +10915,15 @@ public class Kst4ContestApplication extends Application implements StatusUpdateL
// CheckBox chkBxEnableTRXMsgbyUCX = new CheckBox(); // CheckBox chkBxEnableTRXMsgbyUCX = new CheckBox();
grdPnlInternalDBPane.add( grdPnlInternalDBPane.add(
generateLabeledSeparator(100, generateLabeledSeparator(
"Change the settings of the internal database (worked stations, reset before a new contest!)"), 100,
0, 0, 2, 1); "Internal contest data: worked stations, NOT-QRV tags and worked grids"
),
0,
0,
2,
1
);
// grdPnlShorts.add(lblEnableTRXMsgbyUCX, 0, 1); // grdPnlShorts.add(lblEnableTRXMsgbyUCX, 0, 1);
// grdPnlShorts.add(chkBxEnableTRXMsgbyUCX, 1, 1); // grdPnlShorts.add(chkBxEnableTRXMsgbyUCX, 1, 1);
@@ -10940,34 +10946,64 @@ public class Kst4ContestApplication extends Application implements StatusUpdateL
} }
}); });
Button btn_wkdDB_reset = new Button("Reset worked-tags and NOT-QRV-tags"); Button btn_wkdDB_reset = new Button("Reset worked, NOT-QRV and grid data...");
btn_wkdDB_reset.setOnAction(new EventHandler<ActionEvent>() { btn_wkdDB_reset.setTooltip(new Tooltip(
@Override "Manual reset of all contest-related database flags. "
public void handle(ActionEvent event) { + "This is normally not required because entries expire automatically after three days."
));
int affectedLines; btn_wkdDB_reset.setOnAction(event -> {
affectedLines = chatcontroller.getDbHandler().resetWorkedDataInDB(); Alert confirmation = new Alert(AlertType.CONFIRMATION);
chatcontroller.resetWorkedAndQrvInfoInGuiLists(); confirmation.setTitle("Reset contest data");
chatcontroller.refreshWorkedStateAndDatabaseListFromDatabase(); confirmation.setHeaderText("Reset all worked, NOT-QRV and grid data?");
finalTblVwWorked.refresh(); confirmation.setContentText(
"This removes all worked markings, manually assigned NOT-QRV tags "
+ "and stored worked-grid information. The operation cannot be undone.\n\n"
+ "A reset before every contest is normally not required because these data "
+ "expire automatically after three days."
);
if (affectedLines >= 0) { ButtonType resetButton = new ButtonType(
"Reset data",
ButtonBar.ButtonData.OK_DONE
);
ButtonType cancelButton = new ButtonType(
"Cancel",
ButtonBar.ButtonData.CANCEL_CLOSE
);
confirmation.getButtonTypes().setAll(resetButton, cancelButton);
Alert a = new Alert(AlertType.INFORMATION); if (confirmation.showAndWait().orElse(cancelButton) != resetButton) {
return;
a.setTitle("Worked data");
a.setHeaderText("All worked data had been reset. " + affectedLines
+ " callsign entries had been updated.");
a.show();
} else {
Alert a = new Alert(AlertType.INFORMATION);
a.setTitle("Worked data");
a.setHeaderText("Something went wrong, DB have to be rebuilt or other error!");
a.show();
}
} }
int affectedLines = chatcontroller.getDbHandler().resetWorkedDataInDB();
if (affectedLines < 0) {
Alert error = new Alert(AlertType.ERROR);
error.setTitle("Reset contest data");
error.setHeaderText("The contest data could not be reset.");
error.setContentText(
"The internal database may be unavailable or inconsistent. "
+ "No successful reset was confirmed."
);
error.show();
return;
}
chatcontroller.resetWorkedAndQrvInfoInGuiLists();
chatcontroller.refreshWorkedStateAndDatabaseListFromDatabase();
finalTblVwWorked.refresh();
Alert information = new Alert(AlertType.INFORMATION);
information.setTitle("Reset contest data");
information.setHeaderText("The contest data were reset.");
information.setContentText(
affectedLines
+ " callsign database entries were updated. "
+ "Worked-grid data were cleared as well."
);
information.show();
}); });
HBox hbxwkdShortBtnBox = new HBox(); HBox hbxwkdShortBtnBox = new HBox();
+10 -1
View File
@@ -2370,4 +2370,13 @@ DO5SA;unknown;unknown;StringProperty [value: null]; wkd true; wkd144 true; wkd43
9A2HM;unknown;unknown;StringProperty [value: null]; wkd true; wkd144 false; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; null 9A2HM;unknown;unknown;StringProperty [value: null]; wkd true; wkd144 false; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; null
9A2HM;null;null;StringProperty [value: null]; wkd true; wkd144 false; wkd432true; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; null 9A2HM;null;null;StringProperty [value: null]; wkd true; wkd144 false; wkd432true; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; null
9A2HM;null;null;StringProperty [value: null]; wkd true; wkd144 false; wkd432false; wkd1240false; wkd2300true; wkd3400false; wkd5600false; wkd10Gfalse ; null 9A2HM;null;null;StringProperty [value: null]; wkd true; wkd144 false; wkd432false; wkd1240false; wkd2300true; wkd3400false; wkd5600false; wkd10Gfalse ; null
OV3T;Thomas;JO46CM;StringProperty [value: null]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz OV3T;Thomas;JO46CM;StringProperty [value: null]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
OZ1ALS;144307;JO44XX;StringProperty [value: 144.307]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
OZ1FDH;Claus;JO55QX;StringProperty [value: null]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
OZ2AR;FRS Club;JO65BT;StringProperty [value: 144.243]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
SM7NCL;Chris;JO66JI;StringProperty [value: 144.255]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
OZ1DLD/P;Bent;JO45SK;StringProperty [value: 144.285]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
SM6VTZ;Chris 2/70/23/3;JO58UJ;StringProperty [value: 144.135]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
OZ7KJ;Skive Club;JO46ML;StringProperty [value: 144.225]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
OV3T;Thomas;JO46CM;StringProperty [value: null]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz
OZ6TY;Henning;JO55XE;StringProperty [value: 144.196]; wkd true; wkd144 true; wkd432false; wkd1240false; wkd2300false; wkd3400false; wkd5600false; wkd10Gfalse ; 2: 144/432 MHz