5 Commits

Author SHA1 Message Date
Marc Froehlich
d57880d945 fixed another bug which had been caused due to owncall is not longer in the userlist 2023-11-21 23:31:19 +01:00
Marc Froehlich
d79886d4c9 removed own callsign of userlist, which made neccessarry some changes for processing rxed commandlines of the server 2023-11-21 20:24:58 +01:00
Marc Froehlich
499b58965c changed way of db init 2023-11-14 00:50:10 +01:00
Marc Froehlich
7d9adeba1a changed way of db init 2023-11-13 00:23:12 +01:00
praktimarc
fcc46b3c3b Merge pull request #1 from praktimarc/CreateMavenProjectstructure
Create maven projectstructure
2023-11-10 23:27:26 +01:00
9 changed files with 209 additions and 132 deletions

0
null Normal file
View File

View File

@@ -620,7 +620,7 @@ public class ChatController {
*/ */
// Timer ASQueryTimer; // Timer ASQueryTimer;
ASQueryTimer = new Timer(); ASQueryTimer = new Timer();
ASQueryTimer.schedule(new AirScoutPeriodicalAPReflectionInquirerTask(this), 10000, 5000); ASQueryTimer.schedule(new AirScoutPeriodicalAPReflectionInquirerTask(this), 10000, 12000);
// 60000 * intervalInMinutes = IntervalInMillis // 60000 * intervalInMinutes = IntervalInMillis
/** /**

View File

@@ -27,7 +27,8 @@ public class DBController {
private static final DBController dbcontroller = new DBController(); private static final DBController dbcontroller = new DBController();
private static Connection connection; private static Connection connection;
// private static final String DB_PATH = System.getProperty("praktiKST.db"); // private static final String DB_PATH = System.getProperty("praktiKST.db");
private static final String DB_PATH = ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, DATABASE_FILE); private static String DB_PATH = ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, DATABASE_FILE);
/* /*
@@ -71,7 +72,17 @@ public class DBController {
if (connection != null) if (connection != null)
return; return;
System.out.println("Creating Connection to Database..."); System.out.println("Creating Connection to Database...");
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH);
DB_PATH = ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, DATABASE_FILE);
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH);
//connection = DriverManager.getConnection("jdbc:sqlite:" + "C:\\Users\\prakt\\.praktiKST\\praktiKST.db");
System.out.println("[DBH, Info]: Path = " + DB_PATH);
if (!connection.isClosed()) if (!connection.isClosed())
System.out.println("...Connection established"); System.out.println("...Connection established");
} catch (SQLException e) { } catch (SQLException e) {
@@ -91,6 +102,8 @@ public class DBController {
} }
} }
}); });
} }
// private void handleDB() { // private void handleDB() {

View File

@@ -18,9 +18,9 @@ import kst4contest.model.ClusterMessage;
/** /**
* *
* This thread is responsible for processing rx and tx messages, synchronize tx * This thread is responsible for processing received messages.
* and rx and saving the whole chat content in a textfile and write the text to * It checks all messages from server for their functional contest, such as commands to build or change the userlist
* the stdio. * or their settings, get clustermessages and sure the content of all chatmessages, which are delivered.
* *
*/ */
public class MessageBusManagementThread extends Thread { public class MessageBusManagementThread extends Thread {
@@ -196,6 +196,7 @@ public class MessageBusManagementThread extends Thread {
* Builds UserList and gets meta informations out of the chat, as far as it is * Builds UserList and gets meta informations out of the chat, as far as it is
* possible. \n This is the only place where the Chatmember-List will be written * possible. \n This is the only place where the Chatmember-List will be written
* *
* Old Method for port 23000, raw text interface without any comfort, no longer used
* @param messageToProcess * @param messageToProcess
*/ */
private void processRXMessage23000(ChatMessage messageToProcess) { private void processRXMessage23000(ChatMessage messageToProcess) {
@@ -362,7 +363,11 @@ public class MessageBusManagementThread extends Thread {
// this.client.getChatMemberTable().put(splittedMessageLine[2], newMember); //TODO: map -> List // this.client.getChatMemberTable().put(splittedMessageLine[2], newMember); //TODO: map -> List
this.client.getLst_chatMemberList().add(newMember); //the own call will not be in the list
if (!client.getChatPreferences().getLoginCallSign().equals(newMember.getCallSign())) {
this.client.getLst_chatMemberList().add(newMember);
}
this.client.getDbHandler().storeChatMember(newMember); this.client.getDbHandler().storeChatMember(newMember);
@@ -380,20 +385,27 @@ public class MessageBusManagementThread extends Thread {
if (splittedMessageLine[0].contains(USERENTEREDCHAT) || splittedMessageLine[0].contains(USERENTEREDCHAT2)) { if (splittedMessageLine[0].contains(USERENTEREDCHAT) || splittedMessageLine[0].contains(USERENTEREDCHAT2)) {
// System.out.println("MSGBUS: User detected"); // System.out.println("MSGBUS: User detected");
ChatMember newMember = new ChatMember(); /**
* The own callsign will not be hold in the userlist any more
*/
if (!client.getChatPreferences().getLoginCallSign().equals(splittedMessageLine[2])) {
newMember.setAirPlaneReflectInfo(new AirPlaneReflectionInfo());
newMember.setCallSign(splittedMessageLine[2]);
newMember.setName(splittedMessageLine[3]);
newMember.setQra(splittedMessageLine[4]);
newMember.setState(Integer.parseInt(splittedMessageLine[5]));
newMember.setLastActivity(new Utils4KST().time_generateActualTimeInDateFormat());
newMember = this.client.getDbHandler().fetchChatMemberWkdDataForOnlyOneCallsignFromDB(newMember); ChatMember newMember = new ChatMember();
this.client.getLst_chatMemberList().add(newMember); newMember.setAirPlaneReflectInfo(new AirPlaneReflectionInfo());
newMember.setCallSign(splittedMessageLine[2]);
newMember.setName(splittedMessageLine[3]);
newMember.setQra(splittedMessageLine[4]);
newMember.setState(Integer.parseInt(splittedMessageLine[5]));
newMember.setLastActivity(new Utils4KST().time_generateActualTimeInDateFormat());
newMember = this.client.getDbHandler().fetchChatMemberWkdDataForOnlyOneCallsignFromDB(newMember);
this.client.getLst_chatMemberList().add(newMember);
this.client.getDbHandler().storeChatMember(newMember);
}
this.client.getDbHandler().storeChatMember(newMember);
// this.client.getChatMemberTable().put(splittedMessageLine[2], newMember); // this.client.getChatMemberTable().put(splittedMessageLine[2], newMember);
@@ -459,25 +471,30 @@ public class MessageBusManagementThread extends Thread {
dummy.setCallSign("SERVER"); dummy.setCallSign("SERVER");
dummy.setName("Sysop"); dummy.setName("Sysop");
newMessage.setSender(dummy); newMessage.setSender(dummy);
} else { } else {
ChatMember temp = new ChatMember(); ChatMember sender = new ChatMember();
temp.setCallSign(splittedMessageLine[3]); sender.setCallSign(splittedMessageLine[3]);
int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), temp); int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), sender);
if (index != -1) { if (index != -1) {
//user found in the chatmember list
newMessage.setSender(this.client.getLst_chatMemberList().get(index)); // set sender to member of newMessage.setSender(this.client.getLst_chatMemberList().get(index)); // set sender to member of
// b4 init list // b4 init list
} else { } else {
//user not found in chatmember list
if (!temp.getCallSign().equals(this.client.getChatPreferences().getLoginCallSign().toUpperCase())) { if (!sender.getCallSign().equals(this.client.getChatPreferences().getLoginCallSign().toUpperCase())) {
temp.setCallSign("[n/a]" + temp.getCallSign()); sender.setCallSign("[n/a]" + sender.getCallSign());
// if someone sent a message without being in the userlist (cause
// on4kst missed implementing....), callsign will be marked
} else {
AirPlaneReflectionInfo preventNullpointerExc = new AirPlaneReflectionInfo();
preventNullpointerExc.setAirPlanesReachableCntr(0);
sender.setAirPlaneReflectInfo(preventNullpointerExc);
newMessage.setSender(sender); //my own call is the sender
} }
newMessage.setSender(temp); // if someone sent a message without being in the userlist (cause
// on4kst missed implementing....)
} }
// newMessage.setSender(this.client.getChatMemberTable().get(splittedMessageLine[3])); // newMessage.setSender(this.client.getChatMemberTable().get(splittedMessageLine[3]));
@@ -487,7 +504,7 @@ public class MessageBusManagementThread extends Thread {
newMessage.setMessageText(splittedMessageLine[6]); newMessage.setMessageText(splittedMessageLine[6]);
if (splittedMessageLine[7].equals("0")) { if (splittedMessageLine[7].equals("0")) {
// message is not directed to anyone // message is not directed to anyone, move it to the cq messages
ChatMember dummy = new ChatMember(); ChatMember dummy = new ChatMember();
dummy.setCallSign("ALL"); dummy.setCallSign("ALL");
newMessage.setReceiver(dummy); newMessage.setReceiver(dummy);
@@ -496,40 +513,61 @@ public class MessageBusManagementThread extends Thread {
} else { } else {
ChatMember temp2 = new ChatMember(); ChatMember receiver = new ChatMember();
temp2.setCallSign(splittedMessageLine[7]); receiver.setCallSign(splittedMessageLine[7]);
int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), temp2); int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), receiver);
if (index != -1) { if (index != -1) {
newMessage.setReceiver(this.client.getLst_chatMemberList().get(index));// -1: Member left Chat newMessage.setReceiver(this.client.getLst_chatMemberList().get(index));// -1: Member left Chat
// before... // before...
} else { } else {
temp2.setCallSign(temp2.getCallSign() + "(left)");
newMessage.setReceiver(temp2);
if (receiver.getCallSign().equals(client.getChatPreferences().getLoginCallSign())) {
/**
* If mycallsign sent a message to the server, server will publish that message and
* send it to all chatmember including me.
* As mycall is not in the userlist, the message would not been displayed if I handle
* it in the next case (marking left user, just for information). But I want an echo.
*/
receiver.setCallSign(client.getChatPreferences().getLoginCallSign());
newMessage.setReceiver(receiver);
} else {
//this are user which left chat but had been adressed by this message
receiver.setCallSign(receiver.getCallSign() + "(left)");
newMessage.setReceiver(receiver);
}
} }
System.out.println("message directed to: " + newMessage.getReceiver().getCallSign() + ". EQ?: " + this.client.getownChatMemberObject().getCallSign() + " sent by: " + newMessage.getSender().getCallSign().toUpperCase() + " -> EQ?: "+ this.client.getChatPreferences().getLoginCallSign().toUpperCase()); // System.out.println("message directed to: " + newMessage.getReceiver().getCallSign() + ". EQ?: " + this.client.getownChatMemberObject().getCallSign() + " sent by: " + newMessage.getSender().getCallSign().toUpperCase() + " -> EQ?: "+ this.client.getChatPreferences().getLoginCallSign().toUpperCase());
if (newMessage.getReceiver().getCallSign() try {
.equals(this.client.getChatPreferences().getLoginCallSign())) { if (newMessage.getReceiver().getCallSign()
.equals(this.client.getChatPreferences().getLoginCallSign())) {
this.client.getLst_toMeMessageList().add(0, newMessage); this.client.getLst_toMeMessageList().add(0, newMessage);
System.out.println("message directed to me: " + newMessage.getReceiver().getCallSign() + "."); System.out.println("message directed to me: " + newMessage.getReceiver().getCallSign() + ".");
} else if (newMessage.getSender().getCallSign().toUpperCase() // if you sent the message, it will be sorted in to } else if (newMessage.getSender().getCallSign().toUpperCase()
// the "to you message list" .equals(this.client.getChatPreferences().getLoginCallSign().toUpperCase())) {
.equals(this.client.getChatPreferences().getLoginCallSign().toUpperCase())) { String originalMessage = newMessage.getMessageText();
String originalMessage = newMessage.getMessageText(); newMessage
newMessage .setMessageText("(>" + newMessage.getReceiver().getCallSign() + ")" + originalMessage);
.setMessageText("(>" + newMessage.getReceiver().getCallSign() + ")" + originalMessage); this.client.getLst_toMeMessageList().add(0, newMessage);
this.client.getLst_toMeMessageList().add(0, newMessage); // TODO:check // if you sent the message to another station, it will be sorted in to
// the "to me message list" with modified messagetext, added rxers callsign
} else { } else {
this.client.getLst_toOtherMessageList().add(0, newMessage); this.client.getLst_toOtherMessageList().add(0, newMessage);
// System.out.println("MSGBS bgfx: tx call = " + newMessage.getSender().getCallSign() + " / rx call = " + newMessage.getReceiver().getCallSign()); // System.out.println("MSGBS bgfx: tx call = " + newMessage.getSender().getCallSign() + " / rx call = " + newMessage.getReceiver().getCallSign());
}
} catch (NullPointerException referenceDeletedByUserLeftChatDuringMessageprocessing) {
System.out.println("MSGBS bgfx, catched error: referenced user left the chat during messageprocessing: ");
referenceDeletedByUserLeftChatDuringMessageprocessing.printStackTrace();
} }
// sdtout to me message-List // sdtout to me message-List
@@ -584,24 +622,13 @@ public class MessageBusManagementThread extends Thread {
} else { } else {
/** /**
* User is in the list... * User is in the list...
*
*/ */
this.client.getLst_chatMemberList().get(index).setFrequency(qrg); this.client.getLst_chatMemberList().get(index).setFrequency(qrg);
System.out.println("[MSGBUSMGT:] Frequency for " + splittedMessageLine[3] + " setted: " System.out.println("[MSGBUSMGT:] Frequency for " + splittedMessageLine[3] + " setted: "
+ locatedFrequencies); + locatedFrequencies);
// this.client.getLst_chatMemberList().
// ChatMember dummy = new ChatMember();
//
// dummy.setAirPlaneReflectInfo(new AirPlaneReflectionInfo()); //TODO: check if this is neccessary
// this.client.getLst_chatMemberList().add(dummy); // TODO: Bugfix for UI actualization, maybe we dont need that any more
// this.client.getLst_chatMemberList().remove(dummy);
// this.client.getLst_chatMemberList().sorted();
//
} }
} }
} }
// TODO: Next: get frequency infos out of name? // TODO: Next: get frequency infos out of name?
@@ -793,9 +820,13 @@ public class MessageBusManagementThread extends Thread {
int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(),
stateChangeMember); stateChangeMember);
this.client.getLst_chatMemberList().get(index).setName(stateChangeMember.getName()); //-1 could be the case if mycall is processed
this.client.getLst_chatMemberList().get(index).setQra(stateChangeMember.getQra()); if (index != -1) {
this.client.getLst_chatMemberList().get(index).setState(stateChangeMember.getState()); this.client.getLst_chatMemberList().get(index).setName(stateChangeMember.getName());
this.client.getLst_chatMemberList().get(index).setQra(stateChangeMember.getQra());
this.client.getLst_chatMemberList().get(index).setState(stateChangeMember.getState());
}
// this.client.getChatMemberTable().get(stateChangeMember.getCallSign()) // this.client.getChatMemberTable().get(stateChangeMember.getCallSign())
// .setName(stateChangeMember.getName()); // .setName(stateChangeMember.getName());

View File

@@ -106,8 +106,9 @@ public class ReadUDPbyAirScoutMessageThread extends Thread {
if (received.contains("ASSETPATH") || received.contains("ASWATCHLIST")) { if (received.contains("ASSETPATH") || received.contains("ASWATCHLIST")) {
// do nothing, that is your own message // do nothing, that is your own message
} else if (received.contains("ASNEAREST:")) { } else if (received.contains("ASNEAREST:")) { //answer by airscout
processASUDPMessage(received); processASUDPMessage(received);
// System.out.println("[ReadUSPASTh, info:] received AS String " + received); // System.out.println("[ReadUSPASTh, info:] received AS String " + received);
AirPlaneReflectionInfo apReflectInfoForChatMember; AirPlaneReflectionInfo apReflectInfoForChatMember;

View File

@@ -156,11 +156,11 @@ public class Kst4ContestApplication extends Application {
SimpleStringProperty airPlaneInfo = new SimpleStringProperty(); SimpleStringProperty airPlaneInfo = new SimpleStringProperty();
if (cellDataFeatures.getValue().getAirPlaneReflectInfo().getRisingAirplanes() == null) { if (cellDataFeatures.getValue().getAirPlaneReflectInfo().getRisingAirplanes() == null) {
airPlaneInfo.setValue(" "); airPlaneInfo.setValue("nil");
} }
else if (cellDataFeatures.getValue().getAirPlaneReflectInfo().getRisingAirplanes().size() <= 0) { else if (cellDataFeatures.getValue().getAirPlaneReflectInfo().getRisingAirplanes().size() <= 0) {
airPlaneInfo.setValue(" "); airPlaneInfo.setValue("nil");
} else { } else {
String apInfoText = "" String apInfoText = ""
+ cellDataFeatures.getValue().getAirPlaneReflectInfo().getRisingAirplanes().get(0) + cellDataFeatures.getValue().getAirPlaneReflectInfo().getRisingAirplanes().get(0)
@@ -427,7 +427,7 @@ public class Kst4ContestApplication extends Application {
* timer_chatMemberTableSortTimer --> * timer_chatMemberTableSortTimer -->
* This part fixes a javafx bug. The update of the Chatmember fields is (for any * This part fixes a javafx bug. The update of the Chatmember fields is (for any
* reason) not visible in the ui. Its neccessarry to sort the table in intervals * reason) not visible in the ui. Its neccessarry to sort the table in intervals
* to keep the table up to date. Otherwise * to keep the table up to date.
*/ */
timer_chatMemberTableSortTimer = new Timer(); timer_chatMemberTableSortTimer = new Timer();
@@ -835,57 +835,38 @@ public class Kst4ContestApplication extends Application {
SimpleStringProperty airPlaneInfo = new SimpleStringProperty(); SimpleStringProperty airPlaneInfo = new SimpleStringProperty();
try { try {
cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes(); if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes() == null) {
} catch (NullPointerException e) { airPlaneInfo.setValue("nil");
airPlaneInfo.setValue(" ");
isnull = true;
}
// if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes() == null) {
// airPlaneInfo.setValue(" ");
// }
// else
try {
if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes()
.size() <= 0) {
airPlaneInfo.setValue(" ");}
} catch (NullPointerException e) {
airPlaneInfo.setValue(" ");
isnull = true;
}
// if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes()
// .size() <= 0) {
// airPlaneInfo.setValue(" ");
// }
// else
if (!isnull) {
String apInfoText = ""
+ cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes()
.get(0).getArrivingDurationMinutes()
+ " (" + cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo()
.getRisingAirplanes().get(0).getPotential()
+ "%)";
//
//
if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes()
.size() > 1) {
apInfoText += " / "
+ cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes()
.get(1).getArrivingDurationMinutes()
+ " (" + cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo()
.getRisingAirplanes().get(1).getPotential()
+ "%)";
} }
airPlaneInfo.setValue(apInfoText); else if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().size() <= 0) {
} else { airPlaneInfo.setValue("nil");
airPlaneInfo.setValue(" "); //no planes rising } else {
String apInfoText = ""
+ cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(0)
.getArrivingDurationMinutes()
+ " (" + cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(0)
.getPotential()
+ "%)";
//
//
if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().size() > 1) {
apInfoText += " / "
+ cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(1)
.getArrivingDurationMinutes()
+ " (" + cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes()
.get(1).getPotential()
+ "%)";
}
airPlaneInfo.setValue(apInfoText);
}
} catch (NullPointerException thereIsNoApReflectionInfo) {
//e.g. in case of mycall it´s not possible to set!
} }
return airPlaneInfo; return airPlaneInfo;
} }
}); });
/** /**
@@ -1143,23 +1124,23 @@ public class Kst4ContestApplication extends Application {
} }
}); });
TableColumn<ChatMessage, String> nameCol = new TableColumn<ChatMessage, String>("Name"); // TableColumn<ChatMessage, String> nameCol = new TableColumn<ChatMessage, String>("Name");
nameCol.setCellValueFactory(new Callback<CellDataFeatures<ChatMessage, String>, ObservableValue<String>>() { // nameCol.setCellValueFactory(new Callback<CellDataFeatures<ChatMessage, String>, ObservableValue<String>>() {
//
@Override // @Override
public ObservableValue<String> call(CellDataFeatures<ChatMessage, String> cellDataFeatures) { // public ObservableValue<String> call(CellDataFeatures<ChatMessage, String> cellDataFeatures) {
SimpleStringProperty name = new SimpleStringProperty(); // SimpleStringProperty name = new SimpleStringProperty();
//
if (cellDataFeatures.getValue().getSender() != null) { // if (cellDataFeatures.getValue().getSender() != null) {
//
name.setValue(cellDataFeatures.getValue().getSender().getName()); // name.setValue(cellDataFeatures.getValue().getSender().getName());
} else { // } else {
//
name.setValue("");// TODO: Prevents a bug of not setting all values as a default // name.setValue("");// TODO: Prevents a bug of not setting all values as a default
} // }
return name; // return name;
} // }
}); // });
TableColumn<ChatMessage, String> qrgTXerCol = new TableColumn<ChatMessage, String>("Last QRG TX"); TableColumn<ChatMessage, String> qrgTXerCol = new TableColumn<ChatMessage, String>("Last QRG TX");
qrgTXerCol.setCellValueFactory(new Callback<CellDataFeatures<ChatMessage, String>, ObservableValue<String>>() { qrgTXerCol.setCellValueFactory(new Callback<CellDataFeatures<ChatMessage, String>, ObservableValue<String>>() {
@@ -1254,7 +1235,7 @@ public class Kst4ContestApplication extends Application {
}); });
tbl_toOtherMSGTable.getColumns().addAll(timeCol, callSignTRCVCol, qrgTXerCol, workedTXCol, callSignRCVRCol, tbl_toOtherMSGTable.getColumns().addAll(timeCol, callSignTRCVCol, qrgTXerCol, workedTXCol, callSignRCVRCol,
qrgRXerCol, workedRXCol, nameCol, msgCol); qrgRXerCol, workedRXCol, msgCol);
ObservableList<ChatMessage> toOtherMSGList = chatcontroller.getLst_toOtherMessageList(); ObservableList<ChatMessage> toOtherMSGList = chatcontroller.getLst_toOtherMessageList();
tbl_toOtherMSGTable.setItems(toOtherMSGList); tbl_toOtherMSGTable.setItems(toOtherMSGList);

View File

@@ -0,0 +1,15 @@
package kst4contest.test;
import kst4contest.ApplicationConstants;
import kst4contest.utils.ApplicationFileUtils;
public class TestApplicationFileUtils {
public static final String DATABASE_FILE = "praktiKST.db";
private static final String DB_PATH = ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, DATABASE_FILE);
public static void main(String[] args) {
System.out.println("DB Path = " + DB_PATH);
}
}

View File

@@ -0,0 +1,33 @@
package kst4contest.test;
import kst4contest.ApplicationConstants;
import kst4contest.controller.DBController;
import kst4contest.controller.Utils4KST;
import kst4contest.model.ChatMember;
import kst4contest.utils.ApplicationFileUtils;
public class TestDBController {
public static final String DATABASE_FILE = "praktiKST.db";
private static final String DB_PATH = ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, DATABASE_FILE);
public static void main(String[] args) {
DBController dbc = DBController.getInstance();
// dbc.initDBConnection();
ChatMember dummy = new ChatMember();
dummy.setCallSign("DM5M");
dummy.setQra("jo51ij");
dummy.setName("Team Test");
dummy.setLastActivity(new Utils4KST().time_generateActualTimeInDateFormat());
dummy.setWorked5600(true);
// dummy.setWorked432(true);
dbc.fetchChatMemberWkdDataForOnlyOneCallsignFromDB(dummy);
}
}

3
udpReaderBackup.txt Normal file
View File

@@ -0,0 +1,3 @@
9A5R;Zeljko;JN95MM;StringProperty [value: null];true;true;false;false;false;false;false;false
DM5M;Marc;JN49FL;StringProperty [value: 144.243 ];true;true;false;false;false;false;false;false