mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-08-05 09:55:25 +02:00
added project Band enum from Win-Test band IDs
This commit is contained in:
@@ -36,8 +36,8 @@ public class DBController {
|
||||
* Number of milliseconds after which worked/not-QRV data is considered outdated
|
||||
* 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
|
||||
* marker. The marker is stored in SQLite PRAGMA user_version so the expensive
|
||||
|
||||
@@ -303,17 +303,19 @@ public class ReadUDPByWintestThread extends Thread {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (bandId.trim()) {
|
||||
case "12": return Band.B_144;
|
||||
case "14": return Band.B_432;
|
||||
case "16": return Band.B_1296;
|
||||
case "17": return Band.B_2320;
|
||||
case "18": return Band.B_3400;
|
||||
case "19": return Band.B_5760;
|
||||
case "20": return Band.B_10G;
|
||||
case "21": return Band.B_24G;
|
||||
default: return null;
|
||||
}
|
||||
return switch (bandId.trim()) {
|
||||
case "10" -> Band.B_50;
|
||||
case "11" -> Band.B_70;
|
||||
case "12" -> Band.B_144;
|
||||
case "14" -> Band.B_432;
|
||||
case "16" -> Band.B_1296;
|
||||
case "17" -> Band.B_2320;
|
||||
case "18" -> Band.B_3400;
|
||||
case "19" -> Band.B_5760;
|
||||
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();
|
||||
|
||||
grdPnlInternalDBPane.add(
|
||||
generateLabeledSeparator(100,
|
||||
"Change the settings of the internal database (worked stations, reset before a new contest!)"),
|
||||
0, 0, 2, 1);
|
||||
generateLabeledSeparator(
|
||||
100,
|
||||
"Internal contest data: worked stations, NOT-QRV tags and worked grids"
|
||||
),
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
1
|
||||
);
|
||||
// grdPnlShorts.add(lblEnableTRXMsgbyUCX, 0, 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");
|
||||
btn_wkdDB_reset.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
Button btn_wkdDB_reset = new Button("Reset worked, NOT-QRV and grid data...");
|
||||
btn_wkdDB_reset.setTooltip(new Tooltip(
|
||||
"Manual reset of all contest-related database flags. "
|
||||
+ "This is normally not required because entries expire automatically after three days."
|
||||
));
|
||||
|
||||
int affectedLines;
|
||||
affectedLines = chatcontroller.getDbHandler().resetWorkedDataInDB();
|
||||
chatcontroller.resetWorkedAndQrvInfoInGuiLists();
|
||||
chatcontroller.refreshWorkedStateAndDatabaseListFromDatabase();
|
||||
finalTblVwWorked.refresh();
|
||||
btn_wkdDB_reset.setOnAction(event -> {
|
||||
Alert confirmation = new Alert(AlertType.CONFIRMATION);
|
||||
confirmation.setTitle("Reset contest data");
|
||||
confirmation.setHeaderText("Reset all worked, NOT-QRV and grid data?");
|
||||
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);
|
||||
|
||||
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();
|
||||
}
|
||||
if (confirmation.showAndWait().orElse(cancelButton) != resetButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
+10
-1
@@ -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;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
|
||||
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
|
||||
Reference in New Issue
Block a user