<changeLog>

<changedVersionNumber>1.263</changedVersionNumber>
<date>2025-06-08</date>
<description>Airscout communication and Loginname</description>
<added> nothing </added>
<changed> The shema of AS-calculation messages from KST4Contest to Airscout had been changed due to some reports of Mats Helgöstam and other nice OMs who wasn´t able to track AP by the button. Before: EACH entry of the userlist had been sent to AirScout for AS plane path calculation in 12s intervals. EACH entry of the userlist had been added to the AirScout map. New in v1.263: Only entries of the userlist with a QRB lower than the setted max-QRB will be sent to AirScout for AS plane path calculation in 60s intervals. Only entries of the userlist with a QRB lower than the setted max-QRB will be added to the AS map. </changed>
<fixed> First: By changing the AS communication there is a huge decrease of the amount of messages which have to be queued by AS and also a huge decrease of the calculation operations of AS. That most likely will speed up also the issue of the very laggy "track in AS"-button. And also it will save a lot of computing power. The new 1min interval seems to be enough. Second: Name in chat is now saveable, whoohoo! Third: Some beauty fixes before and after login (visibiity of fields) 4th: Fixed issue which 9A2HM / Kreso told me. The name of the AS client had been hard wired to "KST" and the AS servers name had been hard wired to "AS", which results out of a time where I never mentioned to publish this client. It´s now fixed, so that the name-preferences will have a real effect.... 73 / DO5AMF </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.262</changedVersionNumber>
<date>2025-05-21</date>
<description>Freezes caused by getting messages before user login should be fixed now</description>
<added> nothing </added>
<changed> nothing </changed>
<fixed> ON4KST is delivering messages of stations which are not logged in already. That caused an error at the message processing engine which now should be fixed. </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.26</changedVersionNumber>
<date>2025-05</date>
<description>Login to multiple Channels via single signon / spend some colors</description>
<added> 1. UI: There is a dark mode, now. Switch in "Window -> use dark mode" 2. Usage of two Chatcategories at the same time. 3. opposite station multi-callsign login-tagging 73 / DO5AMF </added>
<changed> - coloring mechanic of the software. Modify colors via css by yourself... </changed>
<fixed> - Station tagging fixed completely </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.251</changedVersionNumber>
<date>2025-02</date>
<description>BUGFIX of 1.25, tnx Steve Clements!</description>
<added> - Steve spotted a problem in udp broadcast spot info reading, it´s now fixed! 73 / DO5AMF </added>
<changed> </changed>
<fixed> - Station tagging </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.25</changedVersionNumber>
<date>2025-02</date>
<description>Wishlist-time</description>
<added> - New configuration Tab: Messagehandling You can find options to wether auto-answering all messages which arriving or answer your CQ qrg automatically if someone asks you for it. - New configuration Tab: Messagehandling There you can configure the default userinfo-window message filter [for my friend Gianluca :-)] - There is a big amount of planned new features during april. Stay tuned! 73 / DO5AMF </added>
- Added coloured lines: new personal message rows will appear in red and changes its colours every 30 seconds as they get older, rainbow like via yellow to white (tnx Gianluca, good idea)
<changed> </changed>
<fixed> - Users with suffixes like "-2 and -70" had not been marked as worked. These will now be ignored and the stations will be marked correctly </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.24</changedVersionNumber>
<date>2024-11</date>
<description>Wishlist-time</description>
<added> - Button to show qrz.com profile of a selected station - Button to show qrzcq.com profile of a selected station </added>
- Added coloured lines: new personal message rows will appear in red and changes its colours every 30 seconds as they get older, rainbow like via yellow to white (tnx Gianluca, good idea)
<changed> </changed>
<fixed> - Users with suffixes like "-2 and -70" had not been marked as worked. These will now be ignored and the stations will be marked correctly </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.23</changedVersionNumber>
<date>2024-10</date>
<description>DXCluster Server is now implemented</description>
<added>- DXCluster Server (tnx OMAAO): KST4Contest inhibts a DXCluster server now. It generates a DXCluster message to feed your log client with station-reachable warnings. As a default, the dxcluster warnings will only be sent if a chatter writes to another and due to this is most likely pointing it´s antenna to your direction. For correct spot processing of your log program, you must use another spotters callsign than your contest callsign. Otherwise the filter will not work. </added>
<changed> </changed>
<fixed> </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.22</changedVersionNumber>
<date>2024-05</date>
<description>Increase usability, fixed AS button</description>
<added>- Variables (tnx OMAAO): * MYLOCATORSHORT * MYQRGSHORT * QRZNAME </added>
<changed>- Sendtext-field focus Focus is now on the text field when clicking on the list of people in the chat to avoid double clicking. You can just begin to type after clicking a callsign. </changed>
<fixed>- Worked-station-filter (tnx Gianluca) Filter is now live, if you activate the worked-filter, the worked(and user tagged not-qrv-for-this-band) will disappear without manually reactivating the filter - Chatters list sorting by QRB (tnx Alessandro) Fixed sorting, was lexicographically, now it´s handled as numbers - Airscout-showpath-button The button inhibits an arrow, directed to the selected station in the chatmembers list. A click to this button will now maximize AirScout which then shows the path and the airplanes which are reflectable to reach the selected station </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.21</changedVersionNumber>
<date>2024-04</date>
<description>Increase usability</description>
<added> </added>
<changed> - GUI-behaviour After a click to the save button, the sizes of all windows will be stored in the configfile and restored at the next startup of the client. Also the dividers of the splitpanels will be stored and restored. On problems delete config-file! Further the filters section is now a flowpane to make the software viewable at lower resolutions. </changed>
<fixed> </fixed>
<removed/>
</changeLog>
<changeLog>
<changedVersionNumber>1.2</changedVersionNumber>
<date>2024-04</date>
<description>Increase usability</description>
<added> - Selectable bands Its now possible to select which bands you want to activate. Please select your bands and click save and restart the software. There will only appear buttonds and field which are related to the bands which you have choosen. - Unworkable tags for each callsign. It´s now possible to set NOT-QRV tags for each station for each band. If an OM tells you for example, that he is not QRV at 144 MHz, you can set the "unworkable" flag for him and able to filter his callsign out of the chatmember-list - QTF-Arrow The button "show path in AS" now got an arrow which shows the QTF of the selected station while the button is still out of function (will work that out some time) </added>
<changed> </changed>
<fixed/>
<removed/>
</changeLog>
This commit is contained in:
Marc Froehlich
2025-07-16 12:56:57 +02:00
parent 5cca2923c2
commit ee5ee535bb
30 changed files with 20699 additions and 862 deletions

View File

@@ -9,11 +9,14 @@ public class ApplicationConstants {
/**
* Name of file to store preferences in.
*/
public static final double APPLICATION_CURRENTVERSIONNUMBER = 1.22;
public static final double APPLICATION_CURRENTVERSIONNUMBER = 1.263;
public static final String VERSIONINFOURLFORUPDATES_KST4CONTEST = "https://do5amf.funkerportal.de/kst4ContestVersionInfo.xml";
public static final String VERSIONINFDOWNLOADEDLOCALFILE = "kst4ContestVersionInfo.xml";
public static final String STYLECSSFILE_DEFAULT_DAYLIGHT = "KST4ContestDefaultDay.css";
public static final String STYLECSSFILE_DEFAULT_EVENING = "KST4ContestDefaultEvening.css";
public static final String DISCSTRING_DISCONNECT_AND_CLOSE = "CLOSEALL";
public static final String DISCSTRING_DISCONNECT_DUE_PAWWORDERROR = "JUSTDSICCAUSEPWWRONG";
public static final String DISCSTRING_DISCONNECTONLY = "ONLYDISCONNECT";

View File

@@ -11,6 +11,7 @@ import java.net.UnknownHostException;
import java.util.TimerTask;
import javafx.collections.ObservableList;
import kst4contest.locatorUtils.Location;
import kst4contest.model.ChatMember;
@@ -28,24 +29,30 @@ public class AirScoutPeriodicalAPReflectionInquirerTask extends TimerTask {
public void run() {
Thread.currentThread().setName("AirscoutPeriodicalReflectionInquirierTask");
String KSTClientsNameForQuery = this.client.getChatPreferences().getAirScout_asClientNameString();
String ASServerNameStringForAnswer = this.client.getChatPreferences().getAirScout_asServerNameString();
//TODO: Manage prefixes kst and as via preferences file and instance
//TODO: Check if locator is changeable via the preferences object, need to be correct if it changes
DatagramSocket dsocket;
String prefix_asSetpath ="ASSETPATH: \"KST\" \"AS\" ";
String prefix_asWatchList = "ASWATCHLIST: \"KST\" \"AS\" ";
// String prefix_asSetpath ="ASSETPATH: \"KST\" \"AS\" "; //working original
// String prefix_asWatchList = "ASWATCHLIST: \"KST\" \"AS\" "; //working original
String prefix_asSetpath ="ASSETPATH: \"" + this.client.getChatPreferences().getAirScout_asClientNameString() + "\" \"" + this.client.getChatPreferences().getAirScout_asServerNameString() + "\" ";
String prefix_asWatchList = "ASWATCHLIST:\" "+ this.client.getChatPreferences().getAirScout_asClientNameString()+ "\" \"" + this.client.getChatPreferences().getAirScout_asServerNameString() + "\" ";
String bandString = "1440000";
String myCallAndMyLocString = this.client.getChatPreferences().getLoginCallSign() + "," + this.client.getChatPreferences().getLoginLocator();
String myCallAndMyLocString = this.client.getChatPreferences().getStn_loginCallSign() + "," + this.client.getChatPreferences().getStn_loginLocatorMainCat();
String suffix = ""; //"FOREIGNCALL,FOREIGNLOC " -- dont forget the space at the end!!!
String asWatchListString = prefix_asWatchList + bandString + "," + myCallAndMyLocString;
String asWatchListStringSuffix = asWatchListString;
String host = "255.255.255.255";
// int port = 9872;
int port = client.getChatPreferences().getAirScout_asCommunicationPort();
// System.out.println("<<<<<<<<<<<<<<<<<<<<ASPERI: " + port);
int port = client.getChatPreferences().getAirScout_asCommunicationPort();
// byte[] message = "ASSETPATH: \"KST\" \"AS\" 1440000,DO5AMF,JN49GL,OK1MZM,JN89IW ".getBytes(); Original, ging
InetAddress address;
@@ -62,113 +69,42 @@ public class AirScoutPeriodicalAPReflectionInquirerTask extends TimerTask {
praktiKSTActiveUserList.toArray(ary_threadSafeChatMemberArray);
for (ChatMember i : ary_threadSafeChatMemberArray) {
suffix = i.getCallSign() + "," + i.getQra() + " ";
//
String queryStringToAirScout = "";
queryStringToAirScout += prefix_asSetpath + bandString + "," + myCallAndMyLocString + "," + suffix;
byte[] queryStringToAirScoutMSG = queryStringToAirScout.getBytes();
try {
address = InetAddress.getByName("255.255.255.255");
DatagramPacket packet = new DatagramPacket(queryStringToAirScoutMSG, queryStringToAirScoutMSG.length, address, port);
dsocket = new DatagramSocket();
dsocket.setBroadcast(true);
dsocket.send(packet);
dsocket.close();
} catch (UnknownHostException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (NoRouteToHostException e) {
e.printStackTrace();
}
catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// System.out.println("[ASUDPTask, info:] sent query " + queryStringToAirScout);
asWatchListStringSuffix += "," + i.getCallSign() + "," + i.getQra();
if (i.getQrb() < this.client.getChatPreferences().getStn_maxQRBDefault())
//Here: check if maximum distance to the chatmember is reached, only ask AS if distance is lower!
{
suffix = i.getCallSign() + "," + i.getQra() + " ";
String queryStringToAirScout = "";
queryStringToAirScout += prefix_asSetpath + bandString + "," + myCallAndMyLocString + "," + suffix;
byte[] queryStringToAirScoutMSG = queryStringToAirScout.getBytes();
try {
address = InetAddress.getByName("255.255.255.255");
DatagramPacket packet = new DatagramPacket(queryStringToAirScoutMSG, queryStringToAirScoutMSG.length, address, port);
dsocket = new DatagramSocket();
dsocket.setBroadcast(true);
dsocket.send(packet);
dsocket.close();
} catch (UnknownHostException e1) {
e1.printStackTrace();
} catch (NoRouteToHostException e) {
e.printStackTrace();
} catch (SocketException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// System.out.println("[ASUDPTask, info:] sent query " + queryStringToAirScout);
asWatchListStringSuffix += "," + i.getCallSign() + "," + i.getQra();
}
}
// for (Iterator iterator = praktiKSTActiveUserList.iterator(); iterator.hasNext();) {
// ChatMember chatMember = (ChatMember) iterator.next();
//
// suffix = chatMember.getCallSign() + "," + chatMember.getQra() + " ";
//
// String queryStringToAirScout = "";
//
// queryStringToAirScout += prefix_asSetpath + bandString + "," + myCallAndMyLocString + "," + suffix;
//
// byte[] queryStringToAirScoutMSG = queryStringToAirScout.getBytes();
//
// try {
// address = InetAddress.getByName("255.255.255.255");
// DatagramPacket packet = new DatagramPacket(queryStringToAirScoutMSG, queryStringToAirScoutMSG.length, address, port);
// dsocket = new DatagramSocket();
// dsocket.setBroadcast(true);
// dsocket.send(packet);
// dsocket.close();
// } catch (UnknownHostException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// } catch (SocketException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
//
//// System.out.println("[ASUDPTask, info:] sent query " + queryStringToAirScout);
//
// asWatchListStringSuffix += "," + chatMember.getCallSign() + "," + chatMember.getQra();
//
// }}
// for (Iterator iterator = praktiKSTActiveUserList.iterator(); iterator.hasNext();) {
// ChatMember chatMember = (ChatMember) iterator.next();
//
// suffix = chatMember.getCallSign() + "," + chatMember.getQra() + " ";
//
// String queryStringToAirScout = "";
//
// queryStringToAirScout += prefix_asSetpath + bandString + "," + myCallAndMyLocString + "," + suffix;
//
// byte[] queryStringToAirScoutMSG = queryStringToAirScout.getBytes();
//
// try {
// address = InetAddress.getByName("255.255.255.255");
// DatagramPacket packet = new DatagramPacket(queryStringToAirScoutMSG, queryStringToAirScoutMSG.length, address, port);
// dsocket = new DatagramSocket();
// dsocket.setBroadcast(true);
// dsocket.send(packet);
// dsocket.close();
// } catch (UnknownHostException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// } catch (SocketException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
//
//// System.out.println("[ASUDPTask, info:] sent query " + queryStringToAirScout);
//
// asWatchListStringSuffix += "," + chatMember.getCallSign() + "," + chatMember.getQra();
//
// }
/**
* As next we will set the ASWatchlist. All stations in chat will be watched by airscout causing following code.\n\n
* ASWATCHLIST: "KST" "AS" 4320000,DO5AMF,JN49GL,DF9QX,JO42HD,DG2KBC,JN58MI,DJ0PY,JO32MF,DL1YDI,JO42FA,DL6BF,JO32QI,F1NZC,JN15MR,F4TXU,JN23CX,F5GHP,IN96LE,F6HTJ,JN12KQ,G0GGG,IO81VE,G0JCC,IO82MA,G0JDL,JO02SI,G0MBL,JO01QH,G4AEP,IO91MB,G4CLA,IO92JL,G4DCV,IO91OF,G4LOH,IO70JC,G4MKF,IO91HJ,G4TRA,IO81WN,G8GXP,IO93FQ,G8VHI,IO92FM,GW0RHC,IO71UN,HA4ND,JN97MJ,I5/HB9SJV/P,JN52JS,IW2DAL,JN45NN,OK1FPR,JO80CE,OK6M,JN99CR,OV3T,JO46CM,OZ2M,JO65FR,PA0V,JO33II,PA2RU,JO32LT,PA3DOL,JO22MT,PA9R,JO22JK,PE1EVX,JO22MP,S51AT,JN75GW,SM7KOJ,JO66ND,SP9TTG,JO90KW<4B>
@@ -185,14 +121,7 @@ public class AirScoutPeriodicalAPReflectionInquirerTask extends TimerTask {
dsocket.setBroadcast(true);
dsocket.send(packet);
dsocket.close();
} catch (UnknownHostException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

View File

@@ -33,29 +33,73 @@ public class BeaconTask extends TimerTask {
ChatMessage beaconMSG = new ChatMessage();
String replaceVariables = this.chatController.getChatPreferences().getBcn_beaconText();
// replaceVariables = bcn_beaconText;
replaceVariables = replaceVariables.replaceAll("MYQRG", this.chatController.getChatPreferences().getMYQRG().getValue());
replaceVariables = replaceVariables.replaceAll("MYCALL", this.chatController.getChatPreferences().getLoginCallSign());
replaceVariables = replaceVariables.replaceAll("MYLOCATOR", this.chatController.getChatPreferences().getLoginLocator());
String replaceVariables = this.chatController.getChatPreferences().getBcn_beaconTextMainCat();
replaceVariables = replaceVariables.replaceAll("MYQRG", this.chatController.getChatPreferences().getMYQRGFirstCat().getValue());
replaceVariables = replaceVariables.replaceAll("MYCALL", this.chatController.getChatPreferences().getStn_loginCallSign());
replaceVariables = replaceVariables.replaceAll("MYLOCATOR", this.chatController.getChatPreferences().getStn_loginLocatorMainCat());
replaceVariables = replaceVariables.replaceAll("MYQTF", this.chatController.getChatPreferences().getActualQTF().getValue() + "");
replaceVariables = replaceVariables.replaceAll("SECONDQRG", this.chatController.getChatPreferences().getActualQTF().getValue() + "");
beaconMSG.setMessageText(
"MSG|" + this.chatController.getChatPreferences().getLoginChatCategory().getCategoryNumber() + "|0|" + replaceVariables + "|0|");
"MSG|" + this.chatController.getChatPreferences().getLoginChatCategoryMain().getCategoryNumber() + "|0|" + replaceVariables + "|0|");
beaconMSG.setMessageDirectedToServer(true);
// System.out.println("########### " + replaceVariables);
if (this.chatController.getChatPreferences().isBcn_beaconsEnabled() ) {
ChatMessage beaconMSG2 = new ChatMessage();
String replaceVariables2 = this.chatController.getChatPreferences().getBcn_beaconTextSecondCat();
replaceVariables2 = replaceVariables2.replaceAll("MYQRG", this.chatController.getChatPreferences().getMYQRGFirstCat().getValue());
replaceVariables2 = replaceVariables2.replaceAll("MYCALL", this.chatController.getChatPreferences().getStn_loginCallSign());
replaceVariables2 = replaceVariables2.replaceAll("MYLOCATOR", this.chatController.getChatPreferences().getStn_loginLocatorMainCat());
replaceVariables2 = replaceVariables2.replaceAll("MYQTF", this.chatController.getChatPreferences().getActualQTF().getValue() + "");
replaceVariables2 = replaceVariables2.replaceAll("SECONDQRG", this.chatController.getChatPreferences().getMYQRGSecondCat().getValue() + "");
beaconMSG2.setMessageText(
"MSG|" + this.chatController.getChatPreferences().getLoginChatCategorySecond().getCategoryNumber() + "|0|" + replaceVariables + "|0|");
beaconMSG2.setMessageDirectedToServer(true);
/**
* beacon 1st Chatcategory
*/
if (this.chatController.getChatPreferences().isBcn_beaconsEnabledMainCat() ) {
System.out.println(new Utils4KST().time_generateCurrentMMDDhhmmTimeString()
+ " [BeaconTask, Info]: Sending CQ: " + beaconMSG.getMessageText());
this.chatController.getMessageTXBus().add(beaconMSG);
} else {
//do nothing, CQ is disabled
}
/**
* beacon 2nd Chatcategory
*/
if (this.chatController.getChatPreferences().isLoginToSecondChatEnabled()) { //only send if 2nd cat enabled
if (this.chatController.getChatPreferences().isBcn_beaconsEnabledSecondCat()) {
beaconMSG2.setMessageText(
"MSG|" + this.chatController.getChatPreferences().getLoginChatCategorySecond().getCategoryNumber() + "|0|" + replaceVariables2 + "|0|");
beaconMSG2.setMessageDirectedToServer(true);
System.out.println(new Utils4KST().time_generateCurrentMMDDhhmmTimeString()
+ " [BeaconTask, Info]: Sending CQ 2nd Cat: " + beaconMSG2.getMessageText());
this.chatController.getMessageTXBus().add(beaconMSG2);
} else {
//do nothing, CQ is disabled
}
}
}

View File

@@ -1,17 +1,15 @@
package kst4contest.controller;
import java.net.*;
import java.nio.ByteBuffer;
import java.nio.channels.Selector;
import java.sql.SQLException;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Timer;
import java.util.TimerTask;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import javafx.beans.Observable;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
@@ -46,12 +44,14 @@ public class ChatController {
private UpdateInformation updateInformation;
private ChatPreferences chatPreferences;
private ChatCategory category;
private ChatCategory chatCategoryMain;
private ChatCategory chatCategorySecondChat;
boolean connectedAndLoggedIn;
boolean connectedAndNOTLoggedIn;
boolean disconnected;
boolean disconnectionPerformedByUser = false;
public boolean isDisconnectionPerformedByUser() {
return disconnectionPerformedByUser;
}
@@ -60,6 +60,15 @@ public class ChatController {
this.disconnectionPerformedByUser = disconnectionPerformedByUser;
}
public ChatCategory getChatCategorySecondChat() {
return chatCategorySecondChat;
}
public void setChatCategorySecondChat(ChatCategory chatCategorySecondChat) {
this.chatCategorySecondChat = chatCategorySecondChat;
}
public UpdateInformation getUpdateInformation() {
return updateInformation;
}
@@ -106,7 +115,7 @@ public class ChatController {
String prefix_asSetpath ="ASSHOWPATH: \"KST\" \"AS\" ";
String bandString = "1440000";
String myCallAndMyLocString = chatPreferences.getLoginCallSign() + "," + chatPreferences.getLoginLocator();
String myCallAndMyLocString = chatPreferences.getStn_loginCallSign() + "," + chatPreferences.getStn_loginLocatorMainCat();
String remoteCallAndLocString = remoteChatMember.getCallSign() +"," + remoteChatMember.getQra();
@@ -160,6 +169,8 @@ public class ChatController {
*/
public void disconnect(String action) {
this.dxClusterServer.stop();
this.setDisconnectionPerformedByUser(true);
try {
@@ -253,7 +264,8 @@ public class ChatController {
airScoutUDPReaderThread.interrupt();
dbHandler.closeDBConnection();
dxClusterServer.stop();
try {
@@ -352,6 +364,8 @@ public class ChatController {
private ChatController chatController;
private MessageBusManagementThread messageProcessor;
private ReadUDPbyAirScoutMessageThread airScoutUDPReaderThread;
private DXClusterThreadPooledServer dxClusterServer;
private PlayAudioUtils playAudioUtils = new PlayAudioUtils();
@@ -372,6 +386,9 @@ public class ChatController {
private DBController dbHandler;
private Socket socket;
private ServerSocket cluster_telnetServerSocket; // socket that accepts telnet client connects (cluster client)
// private ServerSocketChannel cluster_telnetServerSocketChannel;
private Timer userActualizationtimer;
@@ -424,6 +441,46 @@ public class ChatController {
// ******************************************************************************************************************************************
/**
* checks if the callsign-String of a given chatmember instance and a given list
* instance is in the list (multiple entries are possible to find by this method! <br/>
* If yes, returns an Array of int with the list indexes <b>if not, returns empty array</b>
* <br/>
* <br/>Also gives back indexes for callsign-70 or callsign-2 etc.<br/>
*
* @param lookForThis
* @return int[]
*/
public ArrayList<Integer> checkListForChatMemberIndexesByCallSign(ChatMember lookForThis) {
ArrayList<Integer> resultingIndexes = new ArrayList<Integer>();
if (lookForThis == null) {
// System.out.println("[ChatCtrl] ERROR: null Value for Chatmember detected! Member cannot be in the list!");
return resultingIndexes;
} else if (lookForThis.getCallSign() == null) {
System.out.println("[ChatCtrl] ERROR: null Value in Callsign detected! Member cannot be in the list!");
return resultingIndexes;
}
for (Iterator iterator = lst_chatMemberList.iterator(); iterator.hasNext();) {
ChatMember chatMember = (ChatMember) iterator.next();
if (chatMember.getCallSignRaw().equals(lookForThis.getCallSignRaw())) { //Change for stations with -2 or -70 in logincallsign
System.out
.println("chtctrlr: Found raw " + chatMember.getCallSignRaw() + " // " + lookForThis.getCallSign());
resultingIndexes.add(lst_chatMemberList.indexOf(chatMember));
} else {
}
}
return resultingIndexes;
}
/**
* checks if the callsign-String of a given chatmember instance and a given list
* instance is in the list. If yes, returns the index in the List, <b>if not,
@@ -445,9 +502,10 @@ public class ChatController {
for (Iterator iterator = lst_chatMemberList.iterator(); iterator.hasNext();) {
ChatMember chatMember = (ChatMember) iterator.next();
if (chatMember.getCallSign().equals(lookForThis.getCallSign())) {
// if (chatMember.getCallSign().equals(lookForThis.getCallSign())) {
if (chatMember.getCallSignRaw().equals(lookForThis.getCallSignRaw())) { //TODO: Change for stations with -2 or -70 in logincallsign
// System.out
// .println("MSGBUSHELPER: Found " + chatMember.getCallSign() + " at " + lst_chatMemberList.indexOf(chatMember));
// .println("chtctrlr: Found raw " + chatMember.getCallSignRaw() + " // " + lookForThis.getCallSign());
return lst_chatMemberList.indexOf(chatMember);
} else {
@@ -617,7 +675,9 @@ public class ChatController {
public ChatController() {
super();
category = new ChatCategory(2);
chatCategoryMain = new ChatCategory(2);//Todo: selectable chatcategory, switched by user
chatCategorySecondChat = new ChatCategory(3); //Todo: selectable chatcategory, switched by user
ownChatMemberObject = new ChatMember();
ownChatMemberObject.setCallSign(userName);
ownChatMemberObject.setName(showedName);
@@ -650,17 +710,17 @@ category = new ChatCategory(2);
try {
if (chatMessage.getReceiver().getCallSign().equals(getChatPreferences().getLoginCallSign())) {
if (chatMessage.getReceiver().getCallSign().equals(getChatPreferences().getStn_loginCallSign())) {
return true; //messages addressed to you
}
if ((chatMessage.getSender().getCallSign().equals(getChatPreferences().getLoginCallSign())) && (!chatMessage.getReceiver().getCallSign().equals("ALL"))){
if ((chatMessage.getSender().getCallSign().equals(getChatPreferences().getStn_loginCallSign())) && (!chatMessage.getReceiver().getCallSign().equals("ALL"))){
return true; //your own echo except texts to all (CQ)
}
String ignoreCaseString = chatMessage.getMessageText();
if ((chatMessage.getMessageText().contains(chatPreferences.getLoginCallSign().toLowerCase()) || (chatMessage.getMessageText().contains(chatPreferences.getLoginCallSign().toUpperCase())))
&& (!chatMessage.getSender().getCallSign().equals(getChatPreferences().getLoginCallSign()))) {
if ((chatMessage.getMessageText().contains(chatPreferences.getStn_loginCallSign().toLowerCase()) || (chatMessage.getMessageText().contains(chatPreferences.getStn_loginCallSign().toUpperCase())))
&& (!chatMessage.getSender().getCallSign().equals(getChatPreferences().getStn_loginCallSign()))) {
return true; //if someone writes about you, you will get the mail, too, except you are the sender...!
}
@@ -699,8 +759,10 @@ category = new ChatCategory(2);
@Override
public boolean test(ChatMessage chatMessage) {
try {
if ((!chatMessage.getSender().getCallSign().equals(getChatPreferences().getLoginCallSign())) &&
(!chatMessage.getReceiver().getCallSign().equals(getChatPreferences().getLoginCallSign()))) {
if ((!chatMessage.getSender().getCallSign().equals(getChatPreferences().getStn_loginCallSign())) &&
(!chatMessage.getReceiver().getCallSign().equals(getChatPreferences().getStn_loginCallSign())) && (!chatMessage.getReceiver().getCallSign().equals("ALL")) )
//RX not own callsign and TX not own callsign and callsign is not "ALL" (that means, directed to public)
{
return true;
} else return false;
@@ -717,9 +779,10 @@ category = new ChatCategory(2);
chatPreferences = new ChatPreferences();
chatPreferences.readPreferencesFromXmlFile(); // set the praktikst Prefs by file or default if file is corrupted
category = chatPreferences.getLoginChatCategory();
this.userName = chatPreferences.getLoginCallSign();
this.password = chatPreferences.getLoginPassword();
chatCategoryMain = chatPreferences.getLoginChatCategoryMain();
chatCategorySecondChat = chatPreferences.getLoginChatCategorySecond();
this.userName = chatPreferences.getStn_loginCallSign();
this.password = chatPreferences.getStn_loginPassword();
// category = setCategory;
ownChatMemberObject = setOwnChatMemberObject;
@@ -758,6 +821,7 @@ category = new ChatCategory(2);
return writeThread;
}
public void setWriteThread(WriteThread writeThread) {
this.writeThread = writeThread;
}
@@ -770,15 +834,19 @@ category = new ChatCategory(2);
this.readThread = readThread;
}
public ChatCategory getCategory() {
return category;
public ChatCategory getChatCategoryMain() {
return chatCategoryMain;
}
public void setCategory(ChatCategory category) {
this.category = category;
public void setChatCategoryMain(ChatCategory chatCategoryMain) {
this.chatCategoryMain = chatCategoryMain;
}
// public void setChatMemberTable(Hashtable<String, ChatMember> chatMemberTable) {
public DXClusterThreadPooledServer getDxClusterServer() {
return dxClusterServer;
}
// public void setChatMemberTable(Hashtable<String, ChatMember> chatMemberTable) {
// this.chatMemberTable = chatMemberTable;
// }
//
@@ -823,9 +891,14 @@ category = new ChatCategory(2);
messageTXBus = new LinkedBlockingQueue<ChatMessage>();
// messageBus.add("");
socket = new Socket(hostname, port);
socket = new Socket(hostname, port);//socket for the on4kst chat server
System.out.println("Connected to the chat server: " + socket.isConnected());
// cluster_telnetServerSocket = new ServerSocket(8000); //TODO: Port customization have do be made
ByteBuffer buffer = ByteBuffer.allocate(1024);
Selector selector = Selector.open();
// consoleReader = new InputReaderThread(this);
// consoleReader.start();
@@ -845,26 +918,29 @@ category = new ChatCategory(2);
messageProcessor.setName("messagebusManagementThread");
messageProcessor.start();
airScoutUDPReaderThread = new ReadUDPbyAirScoutMessageThread(chatPreferences.getAirScout_asCommunicationPort(), this, "AS", "KST");
// airScoutUDPReaderThread = new ReadUDPbyAirScoutMessageThread(chatPreferences.getAirScout_asCommunicationPort(), this, "AS", "KST"); //working original
airScoutUDPReaderThread = new ReadUDPbyAirScoutMessageThread(chatPreferences.getAirScout_asCommunicationPort(), this, this.getChatPreferences().getAirScout_asServerNameString(), this.getChatPreferences().getAirScout_asServerNameString()); //working original
airScoutUDPReaderThread.setName("airscoutudpreaderThread");
airScoutUDPReaderThread.start();
userActualizationtimer = new Timer();
userActualizationtimer.schedule(new UserActualizationTask(this), 4000, 60000);// TODO: Temporary
// userlistoutput
// with
// known qrgs
userActualizationtimer.schedule(new UserActualizationTask(this), 4000, 60000);// TODO: Temporary userlistoutput known qrgs
keepAliveTimer = new Timer();
keepAliveTimer.schedule(new keepAliveMessageSenderTask(this), 4000, 60000);// TODO: Temporary
// userlistoutput
// with
keepAliveTimer.schedule(new keepAliveMessageSenderTask(this), 4000, 60000);//
// keepAliveMessageSenderTask = new keepAliveMessageSenderTask(this);
// keepAliveMessageSenderTask.run();
// userActualizationTask = new UserActualizationTask(this); // kst4contest.test 4 23001
// userActualizationTask.run();// kst4contest.test 4 23001
/**
* Since here: DX cluster service running config
*/
dxClusterServer = new DXClusterThreadPooledServer(this.getChatPreferences().getNotify_dxclusterServerPort(), this);
new Thread(dxClusterServer).start();
/**
* Till here: DX cluster service running config
*/
this.setConnectedAndLoggedIn(true);
@@ -875,7 +951,7 @@ category = new ChatCategory(2);
// Timer beaconTimer;
beaconTimer = new Timer();
beaconTimer.schedule(new BeaconTask(this), 10000,
this.getChatPreferences().getBcn_beaconIntervalInMinutes() * 60000);
this.getChatPreferences().getBcn_beaconIntervalInMinutesMainCat() * 60000);
// 60000 * intervalInMinutes = IntervalInMillis
/**
@@ -884,7 +960,7 @@ category = new ChatCategory(2);
*/
// Timer ASQueryTimer;
ASQueryTimer = new Timer();
ASQueryTimer.schedule(new AirScoutPeriodicalAPReflectionInquirerTask(this), 10000, 12000);
ASQueryTimer.schedule(new AirScoutPeriodicalAPReflectionInquirerTask(this), 10000, 60000);
// 60000 * intervalInMinutes = IntervalInMillis
/**
@@ -896,7 +972,7 @@ category = new ChatCategory(2);
@Override
public void run() {
System.out.println("[Chatcontroller, info: ] periodical socketcheck");
// System.out.println("[Chatcontroller, info: ] periodical socketcheck");
Thread.currentThread().setName("SocketcheckTimer");
@@ -954,9 +1030,7 @@ category = new ChatCategory(2);
messageProcessor = new MessageBusManagementThread(chatController);
messageProcessor.start();
// chatController.setMessageProcessor= new MessageBusManagementThread(chatController);
// messageProcessor.start();
System.out.println("[Chatcontroller, info: initialized new socket, is connected? ] "
+ socket.isConnected() + " " + socket.isClosed());
@@ -1012,7 +1086,7 @@ category = new ChatCategory(2);
OffsetDateTime currentTimeInUtc = OffsetDateTime.now(ZoneOffset.UTC);
System.out.println(currentTimeInUtc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm X")));
// System.out.println(currentTimeInUtc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm X")));
long millisecondsSinceEpoch = currentTimeInUtc.toInstant().toEpochMilli() / 1000;
// System.out.println(millisecondsSinceEpoch);
@@ -1023,7 +1097,7 @@ category = new ChatCategory(2);
* Setting the initial parameters at the chat via port 23001 <br/>
* <br/>
* <b>Login parameter format is like that: </b><br/>
* LOGINC|do5amf|uxskezcj|2|wtKST 3.1.4.6|25|0|1|1663879818|0| <br/>
* LOGINC|do5amf|password|2|kst4contest1251|25|0|1|1663879818|0| <br/>
* SDONE|2| <br/>
*
* @throws InterruptedException
@@ -1043,8 +1117,8 @@ category = new ChatCategory(2);
Thread.currentThread().setName("LoginStringTimer");
String loginString = "";
loginString = "LOGINC|" + chatPreferences.getLoginCallSign() + "|" + chatPreferences.getLoginPassword()
+ "|" + chatPreferences.getLoginChatCategory().getCategoryNumber() + "|praktiKST v" + ApplicationConstants.APPLICATION_CURRENTVERSIONNUMBER
loginString = "LOGINC|" + chatPreferences.getStn_loginCallSign() + "|" + chatPreferences.getStn_loginPassword()
+ "|" + chatPreferences.getLoginChatCategoryMain().getCategoryNumber() + "|praktiKST v" + ApplicationConstants.APPLICATION_CURRENTVERSIONNUMBER
+ "|25|0|1|" + getCurrentEpochTime() + "|0|";
// System.out.println(loginString);
@@ -1056,6 +1130,39 @@ category = new ChatCategory(2);
}
}, 2000);
/**
* Entering second chat
*
* ACHAT|chat id|past messages number|past dx/map number|users list/update flags|last Unix timestamp for messages|last Unix timestamp for dx/map|
*/
if (this.chatController.getChatPreferences().isLoginToSecondChatEnabled()) { //only login to second if wished
new Timer().schedule(new TimerTask() {
@Override
public void run() { //test second chat
Thread.currentThread().setName("LoginStringTimerSecond");
String loginString = "";
loginString = "ACHAT|" + chatController.getChatPreferences().getLoginChatCategorySecond().getCategoryNumber() + "|" + "25"
+ "|" + "10" + "|2|" + getCurrentEpochTime() + "|" + getCurrentEpochTime();
// System.out.println(loginString);
ChatMessage message = new ChatMessage();
message.setMessageText(loginString);
message.setMessageDirectedToServer(true);
getMessageTXBus().add(message);
}
}, 5000);
}
/**
* end testing second chat
*
*/
new Timer().schedule(new TimerTask() {
@Override
@@ -1063,7 +1170,7 @@ category = new ChatCategory(2);
Thread.currentThread().setName("SDONEStringTimer");
ChatMessage message = new ChatMessage();
message.setMessageText("SDONE|" + chatPreferences.getLoginChatCategory().getCategoryNumber() + "|\r");
message.setMessageText("SDONE|" + chatPreferences.getLoginChatCategoryMain().getCategoryNumber() + "|\r");
message.setMessageDirectedToServer(true);
getMessageTXBus().add(message);
@@ -1076,11 +1183,10 @@ category = new ChatCategory(2);
public void run() {
Thread.currentThread().setName("SETLOCTIMER");
ChatMessage message = new ChatMessage();
message.setMessageText("MSG|" + chatPreferences.getLoginChatCategory().getCategoryNumber()
+ "|0|/SETLOC " + chatPreferences.getLoginLocator() + "|0|\r");
message.setMessageText("MSG|" + chatPreferences.getLoginChatCategoryMain().getCategoryNumber()
+ "|0|/SETLOC " + chatPreferences.getStn_loginLocatorMainCat() + "|0|\r");
message.setMessageDirectedToServer(true);
getMessageTXBus().add(message);
}
}, 4000);
@@ -1090,14 +1196,58 @@ category = new ChatCategory(2);
public void run() {
Thread.currentThread().setName("SETNAMETIMER");
ChatMessage message = new ChatMessage();
message.setMessageText("MSG|" + chatPreferences.getLoginChatCategory().getCategoryNumber()
+ "|0|/SETNAME " + chatPreferences.getLoginName() + "|0|\r");
message.setMessageText("MSG|" + chatPreferences.getLoginChatCategoryMain().getCategoryNumber()
+ "|0|/SETNAME " + chatPreferences.getStn_loginNameMainCat() + "|0|\r");
message.setMessageDirectedToServer(true);
getMessageTXBus().add(message);
}
}, 5000);
new Timer().schedule(new TimerTask() {
@Override
public void run() {
Thread.currentThread().setName("SETHereTimerMain");
ChatMessage message = new ChatMessage();
message.setMessageText("MSG|" + chatPreferences.getLoginChatCategoryMain().getCategoryNumber()
+ "|0|/BACK" + "|0|\r");
message.setMessageDirectedToServer(true);
getMessageTXBus().add(message);
}
}, 6500);
if (chatPreferences.isLoginToSecondChatEnabled()) { //only if second category had been enabled
new Timer().schedule(new TimerTask() {
@Override
public void run() {
Thread.currentThread().setName("SETNAMETIMER2nd");
ChatMessage message = new ChatMessage();
message.setMessageText("MSG|" + chatPreferences.getLoginChatCategorySecond().getCategoryNumber()
+ "|0|/SETNAME " + chatPreferences.getStn_loginNameSecondCat() + "|0|\r");
message.setMessageDirectedToServer(true);
getMessageTXBus().add(message);
}
}, 5500);
new Timer().schedule(new TimerTask() {
@Override
public void run() {
Thread.currentThread().setName("SETHereTimerSecond");
ChatMessage message = new ChatMessage();
message.setMessageText("MSG|" + chatPreferences.getLoginChatCategorySecond().getCategoryNumber()
+ "|0|/BACK" + "|0|\r");
message.setMessageDirectedToServer(true);
getMessageTXBus().add(message);
}
}, 7000);
}
new Timer().schedule(new TimerTask() {
HashMap<String, ChatMember> getWorkedDataFromDb;
@@ -1227,7 +1377,7 @@ category = new ChatCategory(2);
//
message = new ChatMessage();
// message.setDirectedToServer(true);
message.setMessageText(category + "");
message.setMessageText(chatCategoryMain + "");
this.getMessageTXBus().add(message);
//
message = new ChatMessage();

View File

@@ -405,15 +405,10 @@ public class DBController {
ResultSet rs = stmt
.executeQuery("SELECT * FROM ChatMember where callsign = '" + checkForThis.getCallSign() + "' ;");
// ChatMember updateWkdData;
// if (!rs.isBeforeFirst()) { //if there are no data to update....
// System.out.println("DBH stmt: " + rs.getStatement().toString());
while (rs.next()) {
// updateWkdData = new ChatMember();
// updateWkdData.setCallSign(rs.getString("callsign"));
checkForThis.setWorked(helper_IntToBooleanConverter(rs.getInt("worked")));
checkForThis.setWorked144(helper_IntToBooleanConverter(rs.getInt("worked144")));
checkForThis.setWorked432(helper_IntToBooleanConverter(rs.getInt("worked432")));
@@ -427,20 +422,22 @@ public class DBController {
* v1.2 since here
*/
checkForThis.setWorked144(helper_IntToBooleanConverter(rs.getInt("notQRV144")));
checkForThis.setWorked432(helper_IntToBooleanConverter(rs.getInt("notQRV432")));
checkForThis.setWorked1240(helper_IntToBooleanConverter(rs.getInt("notQRV1240")));
checkForThis.setWorked2300(helper_IntToBooleanConverter(rs.getInt("notQRV2300")));
checkForThis.setWorked3400(helper_IntToBooleanConverter(rs.getInt("notQRV3400")));
checkForThis.setWorked5600(helper_IntToBooleanConverter(rs.getInt("notQRV5600")));
checkForThis.setWorked10G(helper_IntToBooleanConverter(rs.getInt("notQRV10G")));
checkForThis.setQrv144(!helper_IntToBooleanConverter(rs.getInt("notQRV144")));
checkForThis.setQrv432(!helper_IntToBooleanConverter(rs.getInt("notQRV432")));
checkForThis.setQrv1240(!helper_IntToBooleanConverter(rs.getInt("notQRV1240")));
checkForThis.setQrv2300(!helper_IntToBooleanConverter(rs.getInt("notQRV2300")));
checkForThis.setQrv3400(!helper_IntToBooleanConverter(rs.getInt("notQRV3400")));
checkForThis.setQrv5600(!helper_IntToBooleanConverter(rs.getInt("notQRV5600")));
checkForThis.setQrv10G(!helper_IntToBooleanConverter(rs.getInt("notQRV10G")));
System.out.println(
"[DBH, Info:] providing callsign wkd info, wkd, 144, 432, ... for UA5 new chatmember : "
+ checkForThis.toString());
// System.out.println(
// "[DBH, Info:] providing callsign wkd info, wkd, 144, 432, ....... for UA5 new chatmember : "
// + checkForThis.toString());
}
// }
// rs.gets
rs.close();
stmt.close();
@@ -454,7 +451,7 @@ public class DBController {
try {
connection.close();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
@@ -704,9 +701,13 @@ public class DBController {
private boolean helper_IntToBooleanConverter(int valueFromDBField) {
// System.out.println(">>>>>>>>>>>>>>> DBC: " + valueFromDBField + " -> ");
if (valueFromDBField != 0) {
System.out.println("true");
return true;
} else
System.out.println("false");
return false;
}

View File

@@ -0,0 +1,196 @@
//package kst4contest.controller;
//
//import kst4contest.model.ChatMember;
//import kst4contest.model.ChatMessage;
//
//import java.io.*;
//import java.net.ServerSocket;
//import java.net.Socket;
//import java.nio.channels.ServerSocketChannel;
//import java.nio.channels.SocketChannel;
//import java.time.Instant;
//
///**
// * This thread is responsible for providing DXCluster messages for a connected log program.
// *
// *
// */
////public class DXClusterController extends Thread {
// PrintWriter outTelnet;
// BufferedReader inTelnet;
// private Socket socket;
// private ChatController client;
//// private OutputStream output;
//// private InputStream input;
//
// private ChatMessage messageTextRaw;
//
// private static final int PORT = 23;
// private static final String USERNAME = "user";
// private static final String PASSWORD = "pass";
// private Socket clientSocket;
//
//
//
//
//// public DXClusterController(Socket clientSocket, ChatController client) throws InterruptedException {
////
//// this.client = client;
////
//// try {
//// outTelnet = new PrintWriter(clientSocket.getOutputStream(), true);
//// inTelnet = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
//// } catch (IOException e) {
//// throw new RuntimeException(e);
//// }
//// System.out.println("defcons");
//// this.clientSocket = clientSocket;
////
//// }
//
// public DXClusterController(Socket clientSocket, ChatController chatController) {
//
// try {
// socket = clientSocket;
// } catch (Exception e) {
// throw new RuntimeException(e);
// }
// this.client = chatController;
//
// try {
// outTelnet = new PrintWriter(socket.getOutputStream(), true);
// inTelnet = new BufferedReader(new InputStreamReader(socket.getInputStream()));
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// System.out.println("[DXCCtrl, info:] DXCluster Controller created!");
// this.clientSocket = socket;
// }
//
// public DXClusterController(Socket clientSocket, ObjectOutputStream objectout, ChatController chatController) {
//
// try {
// socket = clientSocket;
// } catch (Exception e) {
// throw new RuntimeException(e);
// }
// this.client = chatController;
//
// try {
// outTelnet = new PrintWriter(socket.getOutputStream(), true);
// inTelnet = new BufferedReader(new InputStreamReader(socket.getInputStream()));
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// System.out.println("[DXCCtrl, info:] DXCluster Controller created!");
// this.clientSocket = socket;
// }
//
//// public DXClusterController(ServerSocket clientSocket, ChatController client) throws InterruptedException {
//// //TODO: GOT FROM https://stackoverflow.com/questions/15541804/creating-the-serversocket-in-a-separate-thread
//// try {
//// socket = clientSocket.accept(2);
//// } catch (IOException e) {
//// throw new RuntimeException(e);
//// }
//// this.client = client;
////
//// try {
//// outTelnet = new PrintWriter(socket.getOutputStream(), true);
//// inTelnet = new BufferedReader(new InputStreamReader(socket.getInputStream()));
//// } catch (IOException e) {
//// throw new RuntimeException(e);
//// }
//// System.out.println("defcons");
//// this.clientSocket = socket;
////
//// }
//
//// public DXClusterController(ServerSocketChannel serverSocketChannel, ChatController client) throws InterruptedException {
////
//// this.client = client;
////
////// clientSocketChannel.ac
////
//// try {
////
//// serverSocketChannel.accept();
//// serverSocketChannel.rea
////
//// outTelnet = new PrintWriter(clientSocket.getOutputStream(), true);
//// inTelnet = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
//// } catch (IOException e) {
//// throw new RuntimeException(e);
//// }
//// System.out.println("defcons");
//// this.clientSocket = clientSocket;
////
//// }
//
// public boolean terminateConnection() throws IOException {
//
//// this.output.close();
// this.socket.close();
//
// return true;
// }
//
// public void sendLocalClusterMessage() {
//
// }
//
// public void run() {
//// try (
//// PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
//// BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())))
//// {
//
//// out.println("Welcome to the Telnet Server");
// outTelnet.print("login: ");
// outTelnet.flush();
// try {
// String user = inTelnet.readLine();
// } catch (IOException ex) {
// throw new RuntimeException(ex);
// }
//// finally {
//// try {
//// clientSocket.close();
//// } catch (Exception e) {
//// System.out.println("Error closing client socket: " + e.getMessage());
//// }
//// }
//
//
//// for (int i = 0; i < 10; i++) {
////
//// outTelnet.println("DX de DM5M: 144222.0 DO5AMF JN49FL 2250Z\n");
//// }
//
//
//
// }
//
// /**
// * Sends a DX cluster message to the connected log programs via telnet, returns true if sent
// *
// * @param aChatMember
// * @return
// */
// public boolean propagateSingleDXClusterEntry(ChatMember aChatMember) {
//
// String singleDXClusterMessage = "DX de ";
//
// singleDXClusterMessage += client.getChatPreferences().getLoginCallSign() + " ";
// singleDXClusterMessage += aChatMember.getFrequency().getValue() + " ";
// singleDXClusterMessage += aChatMember.getCallSign().toUpperCase() + " ";
// singleDXClusterMessage += aChatMember.getQra().toUpperCase() + " ";
// singleDXClusterMessage += new Utils4KST().time_generateCurrenthhmmZTimeStringForClusterMessage() + "\n";
//
// outTelnet.println(singleDXClusterMessage);
// outTelnet.flush();
// return true;
// }
//}

View File

@@ -0,0 +1,215 @@
package kst4contest.controller;
import kst4contest.model.ChatMember;
import kst4contest.model.ChatPreferences;
import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class DXClusterThreadPooledServer implements Runnable{
private List<Socket> clientSockets = Collections.synchronizedList(new ArrayList<>()); //list of all connected clients
ChatController chatController = null;
protected int serverPort = 8080;
protected ServerSocket serverSocket = null;
protected boolean isStopped = false;
protected Thread runningThread= null;
protected ExecutorService threadPool =
Executors.newFixedThreadPool(10);
Socket clientSocket;
public DXClusterThreadPooledServer(int port, ChatController chatController){
this.serverPort = port;
this.chatController = chatController;
}
public void run(){
synchronized(this){
this.runningThread = Thread.currentThread();
runningThread.setName("DXCluster-thread-pooled-server");
}
openServerSocket();
while(! isStopped()){
clientSocket = null;
try {
clientSocket = this.serverSocket.accept();
synchronized(clientSockets) {
clientSockets.add(clientSocket); // add dx cluster client to the "clients list" for broadcasting
}
} catch (IOException e) {
if(isStopped()) {
System.out.println("Server Stopped.") ;
break;
}
throw new RuntimeException(
"Error accepting client connection", e);
}
DXClusterServerWorkerRunnable worker = new DXClusterServerWorkerRunnable(clientSocket, "Thread Pooled DXCluster Server ", chatController, clientSockets);
this.threadPool.execute(worker);
}
this.threadPool.shutdown();
System.out.println("Server Stopped.") ;
}
private synchronized boolean isStopped() {
return this.isStopped;
}
public synchronized void stop(){
this.isStopped = true;
try {
this.serverSocket.close();
synchronized(clientSockets) {
for (Socket socket : clientSockets) {
socket.close(); // close all client connections
}
}
} catch (IOException e) {
throw new RuntimeException("DXCCSERVER Error closing server", e);
}
}
private void openServerSocket() {
try {
this.serverSocket = new ServerSocket(this.serverPort);
} catch (IOException e) {
throw new RuntimeException("DXCCSERVER Cannot open port ", e);
}
}
/**
* Sends a DX cluster message to ALL connected log programs via telnet, returns true if sent
*
* @param aChatMember
* @return boolean true if message had been sent
*/
public boolean broadcastSingleDXClusterEntryToLoggers(ChatMember aChatMember) {
synchronized(clientSockets) {
System.out.println("DXClusterSrvr: broadcasting message to clients: " + clientSockets.size());
try {
System.out.println("-------------> ORIGINALEE VAL: " + aChatMember.getFrequency().getValue());
System.out.println("-------------> NORMALIZED VAL: " + Utils4KST.normalizeFrequencyString(aChatMember.getFrequency().getValue(), chatController.getChatPreferences().getNotify_optionalFrequencyPrefix()) + " ");
} catch (Exception e) {
System.out.println("DXCThPooledServer: Error accessing value in chatmember object: " + e.getMessage());
// e.printStackTrace();
}
for (Socket socket : clientSockets) {
try {
OutputStream output = socket.getOutputStream();
String singleDXClusterMessage = "DX de ";
// singleDXClusterMessage += chatController.getChatPreferences().getLoginCallSign() + ": ";
singleDXClusterMessage += this.chatController.getChatPreferences().getNotify_DXCSrv_SpottersCallSign().getValue() + ": ";
singleDXClusterMessage += Utils4KST.normalizeFrequencyString(aChatMember.getFrequency().getValue(), chatController.getChatPreferences().getNotify_optionalFrequencyPrefix()) + " ";
singleDXClusterMessage += aChatMember.getCallSign().toUpperCase() + " "; //we need such an amount of spaces for n1mm to work, otherwise bullshit happens
singleDXClusterMessage += aChatMember.getQra().toUpperCase() + " ";
singleDXClusterMessage += new Utils4KST().time_generateCurrenthhmmZTimeStringForClusterMessage() + ((char)7) + ((char)7) + "\r\n";
// singleDXClusterMessage += chatController.getChatPreferences().getLoginCallSign() + ": ";
// singleDXClusterMessage += Utils4KST.normalizeFrequencyString(aChatMember.getFrequency().getValue(), chatController.getChatPreferences().getNotify_optionalFrequencyPrefix()) + " ";
// singleDXClusterMessage += aChatMember.getCallSign().toUpperCase() + " ";
// singleDXClusterMessage += aChatMember.getQra().toUpperCase() + " ";
// singleDXClusterMessage += new Utils4KST().time_generateCurrenthhmmZTimeStringForClusterMessage() + ((char)7) + ((char)7) + "\r\n";
output.write((singleDXClusterMessage).getBytes());
} catch (IOException e) {
e.printStackTrace();
System.out.println("[DXClusterSrvr, Error:] broadcasting DXC-message to clients went wrong!");
return false;
}
}
}
return true; //if message had been sent, return true for "ok"
}
}
class DXClusterServerWorkerRunnable implements Runnable{
protected Socket clientSocket = null;
protected String serverText = null;
private ChatController client = null;
private List<Socket> dxClusterClientSocketsConnectedList;
public DXClusterServerWorkerRunnable(Socket clientSocket, String serverText, ChatController chatController, List<Socket> clientSockets) {
this.clientSocket = clientSocket;
this.serverText = serverText;
this.client = chatController;
this.dxClusterClientSocketsConnectedList = clientSockets;
}
public void run() {
try {
OutputStream output = clientSocket.getOutputStream();
dxClusterClientSocketsConnectedList.add(clientSocket);
Timer dXCkeepAliveTimer = new Timer();
dXCkeepAliveTimer.schedule(new TimerTask() {
@Override
public void run() {
for (Socket socket : dxClusterClientSocketsConnectedList) {
try {
OutputStream output = socket.getOutputStream();
output.write(("\r\n").getBytes());
} catch (IOException e) {
e.printStackTrace();
System.out.println("[DXClusterSrvr, Error:] broadcasting DXC-message to clients went wrong!");
dXCkeepAliveTimer.purge();
try {
socket.close();
} catch (IOException ex) {
ex.printStackTrace();
}
finally {
this.cancel();
}
dxClusterClientSocketsConnectedList.remove(socket); //if socket is closed by client, remove it from the broadcast list and close it
}
}
}
}, 30000, 30000);
output.write(("login: ").getBytes()); //say hello to the client, it will answer with a callsign
System.out.println("[DXClusterThreadPooledServer, Info:] New cluster client connected! "); //TODO: maybe integrate non blocking reader for client identification
} catch (IOException e) {
e.printStackTrace();
} finally {
synchronized(dxClusterClientSocketsConnectedList) {
dxClusterClientSocketsConnectedList.remove(clientSocket); // Entferne den Client nach Verarbeitung
}
}
}
}

View File

@@ -0,0 +1,44 @@
package kst4contest.controller;
import javafx.beans.property.SimpleStringProperty;
import kst4contest.model.ChatMember;
import kst4contest.model.ChatPreferences;
public class DXClusterThreadPooledServerTest {
public static void main(String[] args) {
ChatController client = new ChatController();
ChatPreferences testPreferences = new ChatPreferences();
testPreferences.setStn_loginCallSign("DM5M");
client.setChatPreferences(testPreferences);
DXClusterThreadPooledServer dxClusterServer = new DXClusterThreadPooledServer(8000, client);
new Thread(dxClusterServer).start();
try {
Thread.sleep(10 * 1000);
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>ready.....go!");
} catch (InterruptedException e) {
e.printStackTrace();
}
ChatMember test = new ChatMember();
test.setCallSign("DL5ASG");
test.setQra("JO51HK");
test.setFrequency(new SimpleStringProperty("144776.0"));
dxClusterServer.broadcastSingleDXClusterEntryToLoggers(test);
// try {
// Thread.sleep(20 * 3333);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// System.out.println("Stopping Server");
// server.stop();
}
}

View File

@@ -43,7 +43,7 @@ public class InputReaderThread extends Thread {
e.printStackTrace();
}
ownMSG.setMessageText("MSG|" + this.client.getCategory().getCategoryNumber() + "|0|" + sendThisMessage23001 + "|0|");
ownMSG.setMessageText("MSG|" + this.client.getChatCategoryMain().getCategoryNumber() + "|0|" + sendThisMessage23001 + "|0|");
// System.out.println("inreader " + ownMSG.getMessage() + client.getMessageTXBus().size());

View File

@@ -5,6 +5,7 @@ import java.io.PrintWriter;
import java.sql.SQLException;
//import java.net.Socket;
//import java.util.ArrayList;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -14,12 +15,7 @@ import javafx.collections.ObservableList;
import kst4contest.ApplicationConstants;
import kst4contest.locatorUtils.DirectionUtils;
import kst4contest.locatorUtils.Location;
import kst4contest.model.AirPlaneReflectionInfo;
import kst4contest.model.ChatMember;
import kst4contest.model.ChatMessage;
import kst4contest.model.ClusterMessage;
import kst4contest.utils.PlayAudioUtils;
import kst4contest.view.Kst4ContestApplication;
import kst4contest.model.*;
/**
*
@@ -43,6 +39,7 @@ public class MessageBusManagementThread extends Thread {
private Hashtable<String, ChatMember> chatMemberTable;
private final String PTRN_USERLISTENTRY = "([a-zA-Z0-9]{2}/{1})?([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z]{0,3})(/p)? [a-zA-Z]{2}[0-9]{2}[a-zA-Z]{2} [ -~]{1,20}";
private final String PTRN_QRG_CAT2 = "(([0-9]{3,4}[\\.|,| ]?[0-9]{3})([\\.|,][\\d]{1,2})?)|(([a-zA-Z][0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)|((\\b[0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)";
private final String PTRN_QRG_CAT3 = "(([0-9]{3,5}[\\.|,| ]?[0-9]{3})([\\.|,][\\d]{1,2})?)|(([a-zA-Z][0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)|((\\b[0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)";
// BufferedWriter bufwrtrDBGMSGOut;
// private String text;
@@ -72,8 +69,7 @@ public class MessageBusManagementThread extends Thread {
/**
* check if a chatmessage is part of the userlist via telnet 23000 port<br/>
* <b>Updates userlist!</b>
*
* @param chatMessage
*
*/
private void checkIfItsUserListEntry(ChatMessage messageToProcess) {
@@ -114,9 +110,7 @@ public class MessageBusManagementThread extends Thread {
/**
* check if a chatmessage is part of the userlist via telnet 23000 port<br/>
* <b>Updates userlist!</b>
*
* @param chatMessage
* <b>This method updates the userlist!</b>
*/
private void checkIfItsUserListEntry23001(ChatMessage messageToProcess) {
@@ -159,38 +153,29 @@ public class MessageBusManagementThread extends Thread {
* check if a chatmessage or a name of a chatmember contains a frequency<br/>
* <b>returns String = "" if no frequency found</b>
*
* @param chatMessage
*/
private String checkIfMessageInhibitsFrequency(ChatMessage messageToProcess) {
Pattern pattern = Pattern.compile(PTRN_QRG_CAT2); // TODO: PTRN should depend to category-selection of own stn
Pattern pattern = Pattern.compile(PTRN_QRG_CAT2); // TODO: PTRN should depend to category-selection of own stn, it´s not the case now
Matcher matcher = pattern.matcher(messageToProcess.getMessageText());
String[] splittedQRGString;
// splittedQRGString[0] = "0";
String stringAggregation = "";
// if (matcher.) {
// stringAggregation = ""; //reset aggregated string
// }
while (matcher.find()) {
// System.out.println("QRG detected: "+ matcher.group() + " " + matcher.start());
// ChatMember member = new ChatMember();
String matchedString = matcher.group();
// splittedQRGString = new String[0];
splittedQRGString = matchedString.split(" ");
for (int i = 0; i < splittedQRGString.length; i++) {
stringAggregation += splittedQRGString[i] + " ";
}
for (String s : splittedQRGString) {
stringAggregation += s + " ";
}
System.out.println("[MSGBUSMGT:] Processed qrg info: " + stringAggregation);
// if (member.getName().)
// System.out.println("Processed QRG Entry [" + this.client.getChatMemberTable().size() + "]: Call: "
// + member.getCallSign() + ", QRA: " + member.getQra() + ", Name: " + member.getName());
}
@@ -214,7 +199,7 @@ public class MessageBusManagementThread extends Thread {
messageToProcess.setMessageText(reduce);
if (messageToProcess.getMessageText().isEmpty()) {
System.out.println("[MSGBUSMGTT:] ######################no processable data");
// System.out.println("[MSGBUSMGTT:] ###################### no processable data");
} else {
if (reduce.length() >= 14 && reduce.length() <= 40) {
@@ -275,26 +260,35 @@ public class MessageBusManagementThread extends Thread {
// System.out.println("[MsgBusMgr, ERROR:] ChecklistForChatMemberIndexByCallsign, not found: "
// + lookForThis.getCallSign() + "\n ");
/***
* Old mechanic for index search,new one implemented due concurrentmodificationexcm which works - end
* /Old mechanic for index search,new one implemented due concurrentmodificationexc which works - end
*
*/
for (int i = 0; i < list.size(); i++) {
if (list.get(i).getCallSign().equals(lookForThis.getCallSign())) {
//TODO: New since 1.26! Check against category!
System.out.println("MSGBUSMGT, DEBUG: Checking Chatcategories of found list member " + list.get(i).getCallSign() + " / " + list.get(i).getChatCategory() + " against " + lookForThis.getCallSign() + " / " + lookForThis.getChatCategory());
// System.out
// .println("MSGBUSHELBER: Found " + chatMember.getCallSign() + " at " + list.indexOf(chatMember));
return list.indexOf(list.get(i));
if (list.get(i).getChatCategory().equals(lookForThis.getChatCategory())) { //new 1.26
return list.indexOf(list.get(i));
} //new 1.26
else {
System.out.println("MSGBUSMGT, DEBUG: Category does not match");
}
// System.out.println("--------------------------- chatcategory of list.get(i) = " + list.get(i).getChatCategory().getCategoryNumber());
System.out.println("--------------------------- chatcategory of lookforthisChatMember = " + lookForThis.getChatCategory().getCategoryNumber() );
}
// return list.indexOf(list.get(i)); //if no category found, return entry //TODO: ERROR detected here! Should work now, needs some proof
// return -1; //if category dont match, return: member not found
}
// for (Iterator iterator = list.iterator(); iterator.hasNext();) {
// ChatMember chatMember = (ChatMember) iterator.next();
// System.out.println(list.indexOf(lookForThis) + ": " + chatMember.getCallSign());
// }
return -1; // if it´s not found, the method will always end here and return -1
}
/**
@@ -332,6 +326,22 @@ public class MessageBusManagementThread extends Thread {
final String SRVR_LOGINWRONGCALLSYNTAX = "103";
final String SRVR_LOGINWRONGCALLUNKNOWN = "101";
/**
* here we have a helper Set for identifying questions for my qrg which can be autoanswered later // TODO: move to an extra method
*/
final HashSet<String> qrgQuestionTexts = new HashSet<String>();
// final ArrayList<String> qrgQuestionTexts = new ArrayList<String>();
qrgQuestionTexts.add("ur qrg?");
qrgQuestionTexts.add("your qrg?");
qrgQuestionTexts.add("qrg?");
qrgQuestionTexts.add("freq?");
qrgQuestionTexts.add("pse QRG");
/**
* here we have a helper list for identifying questions for my qrg which can be autoanswered later
*/
if (messageToProcess.getMessageText().isEmpty()) {
System.out.println("[MSGBUSMGTT:] ######################no processable data");
@@ -352,28 +362,32 @@ public class MessageBusManagementThread extends Thread {
/**
* Initializes the Userlist if entry fits UA0
* UA0|3|DL6SAQ|walter not qrv|JN58CK|1| <- RXed
*
*/
if (splittedMessageLine[0].contains(INITIALUSERLISTENTRY)) {
// System.out.println("MSGBUS: User detected");
ChatMember newMember = new ChatMember();
newMember.setAirPlaneReflectInfo(new AirPlaneReflectionInfo()); // TODO: Only bugfix, check
newMember.setAirPlaneReflectInfo(new AirPlaneReflectionInfo());
newMember.setChatCategory(util_getChatCategoryByCategoryNrString(splittedMessageLine[1]));
newMember.setCallSign(splittedMessageLine[2]);
newMember.setName(splittedMessageLine[3]);
newMember.setQra(splittedMessageLine[4]);
newMember.setState(Integer.parseInt(splittedMessageLine[5]));
// newMember.setQTFdirection(LocatorUtils);
newMember.setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getLoginLocator(), newMember.getQra()));
newMember.setQTFdirection(new Location(client.getChatPreferences().getLoginLocator()).getBearing(new Location(newMember.getQra())));
// newMember.setQTFdirection(LocatorUtils);
newMember.setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getStn_loginLocatorMainCat(), newMember.getQra()));
newMember.setQTFdirection(new Location(client.getChatPreferences().getStn_loginLocatorMainCat()).getBearing(new Location(newMember.getQra())));
newMember.setLastActivity(new Utils4KST().time_generateActualTimeInDateFormat());//TODO evt obsolete!
newMember.setActivityTimeLastInEpoch(new Utils4KST().time_generateCurrentEpochTime());
// this.client.getChatMemberTable().put(splittedMessageLine[2], newMember); //TODO: map -> List
//the own call will not be in the list
if (!client.getChatPreferences().getLoginCallSign().equals(newMember.getCallSign())) {
if (!client.getChatPreferences().getStn_loginCallSign().equals(newMember.getCallSign())) {
this.client.getLst_chatMemberList().add(newMember);
}
@@ -390,31 +404,36 @@ public class MessageBusManagementThread extends Thread {
/**
* Actualize Userlist, add new entry UA5 or UA2
*
* UA5|2|IU4CHE|Giorgio 2-70-23|JN64GB|2|
* UA2|2|W5ADD|Parker|EM40WL|2|
*
*/
if (splittedMessageLine[0].contains(USERENTEREDCHAT) || splittedMessageLine[0].contains(USERENTEREDCHAT2)) {
// System.out.println("MSGBUS: User detected");
/**
* The own callsign will not be hold in the userlist any more
*/
if (!client.getChatPreferences().getLoginCallSign().equals(splittedMessageLine[2])) {
if (!client.getChatPreferences().getStn_loginCallSign().equals(splittedMessageLine[2])) { //own call ignore
ChatMember newMember = new ChatMember();
newMember.setAirPlaneReflectInfo(new AirPlaneReflectionInfo());
newMember.setChatCategory(util_getChatCategoryByCategoryNrString(splittedMessageLine[1]));
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.setActivityTimeLastInEpoch(new Utils4KST().time_generateCurrentEpochTime());
newMember.setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getLoginLocator(), newMember.getQra()));
newMember.setQTFdirection(new Location(client.getChatPreferences().getLoginLocator()).getBearing(new Location(newMember.getQra())));
newMember.setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getStn_loginLocatorMainCat(), newMember.getQra()));
newMember.setQTFdirection(new Location(client.getChatPreferences().getStn_loginLocatorMainCat()).getBearing(new Location(newMember.getQra())));
newMember = this.client.getDbHandler().fetchChatMemberWkdDataForOnlyOneCallsignFromDB(newMember);
this.client.getLst_chatMemberList().add(newMember);
this.client.getDbHandler().storeChatMember(newMember);
}
@@ -433,16 +452,18 @@ public class MessageBusManagementThread extends Thread {
ChatMember newMember = new ChatMember();
newMember.setCallSign(splittedMessageLine[2]);
newMember.setChatCategory(util_getChatCategoryByCategoryNrString(splittedMessageLine[1]));
// this.client.getChatMemberTable().remove(newMember.getCallSign());
newMember.setCallSign(splittedMessageLine[2]);
System.out.println("[MSGBUSMGT, Info:] User left Chat and will be removed from list ["
+ this.client.getLst_chatMemberList().size() + "] :" + newMember.getCallSign());
try {
this.client.getLst_chatMemberList().remove(
checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), newMember));
//TODO: since 1.26 new method design to detect chatcategory, too!
} catch (Exception e) {
System.out.println("[MSGBUSMGT, EXC!, Error:] User sent left chat but had not been there ... ["
+ this.client.getLst_chatMemberList().size() + "] :" + newMember.getCallSign() + "\n"
@@ -472,43 +493,51 @@ public class MessageBusManagementThread extends Thread {
* CH|2|1663966535|DM5M|dm5m-team|0|kst4contest.test|0|
*/
if (splittedMessageLine[0].contains(CHATCHANNELMESSAGE)) {
// System.out.println("MSGBUS: User detected");
ChatMessage newMessage = new ChatMessage();
newMessage.setChatCategory(this.client.getCategory());
newMessage.setMessageGeneratedTime(splittedMessageLine[2]);
//experimental 1.26: multi channel messages
ChatMessage newMessageArrived = new ChatMessage();
ChatCategory chategoryForMessageAndMessageSender;
newMessageArrived.setChatCategory(util_getChatCategoryByCategoryNrString(splittedMessageLine[1]));
chategoryForMessageAndMessageSender = newMessageArrived.getChatCategory();
newMessageArrived.setMessageGeneratedTime(splittedMessageLine[2]);
if (splittedMessageLine[3].equals("SERVER")) {
ChatMember dummy = new ChatMember();
dummy.setCallSign("SERVER");
dummy.setName("Sysop");
newMessage.setSender(dummy);
newMessageArrived.setSender(dummy);
newMessageArrived.setChatCategory(util_getChatCategoryByCategoryNrString(splittedMessageLine[1]));
dummy.setChatCategory(util_getChatCategoryByCategoryNrString(splittedMessageLine[1]));
// System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> servers cat " + newMessageArrived.getChatCategory());
} else {
ChatMember sender = new ChatMember();
sender.setCallSign(splittedMessageLine[3]);
sender.setChatCategory(chategoryForMessageAndMessageSender);
int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), sender);
//if the user had been found in the active users list
if (index != -1) {
//user found in the chatmember list
//user not found in the chatmember list
try {
newMessage.setSender(this.client.getLst_chatMemberList().get(index)); // set sender to member of
newMessageArrived.setSender(this.client.getLst_chatMemberList().get(index)); // set sender to member of
this.client.getLst_chatMemberList().get(index).setActivityTimeLastInEpoch(new Utils4KST().time_generateCurrentEpochTime());
} catch (Exception exc) {
ChatMember aSenderDummy = new ChatMember();
aSenderDummy.setCallSign(splittedMessageLine[3] + "[n/a]");
aSenderDummy.setAirPlaneReflectInfo(new AirPlaneReflectionInfo());
newMessage.setSender(aSenderDummy);
newMessageArrived.setSender(aSenderDummy);
System.out.println("MsgBusmgtT: Catched Error! " + exc.getMessage() + " // " + splittedMessageLine[3] + " is not in the list! Faking sender!");
exc.printStackTrace();
}
// b4 init list
} else {
//user not found in chatmember list, mark it, sender can not be set
if (!sender.getCallSign().equals(this.client.getChatPreferences().getLoginCallSign().toUpperCase())) {
if (!sender.getCallSign().equals(this.client.getChatPreferences().getStn_loginCallSign().toUpperCase())) {
sender.setCallSign("[n/a]" + sender.getCallSign());
// if someone sent a message without being in the userlist (cause
// on4kst missed implementing....), callsign will be marked
@@ -516,45 +545,47 @@ public class MessageBusManagementThread extends Thread {
//that means, message was by own station, broadcasted to all other
ChatMember dummy = new ChatMember();
dummy.setCallSign("ALL");
newMessage.setReceiver(dummy);
newMessageArrived.setReceiver(dummy);
AirPlaneReflectionInfo preventNullpointerExc = new AirPlaneReflectionInfo();
preventNullpointerExc.setAirPlanesReachableCntr(0);
sender.setAirPlaneReflectInfo(preventNullpointerExc);
newMessage.setSender(sender); //my own call is the sender
newMessageArrived.setSender(sender); //my own call is the sender
}
}
// newMessage.setSender(this.client.getChatMemberTable().get(splittedMessageLine[3]));
// newMessageArrived.setSender(this.client.getChatMemberTable().get(splittedMessageLine[3]));
}
newMessage.setMessageSenderName(splittedMessageLine[4]);
newMessage.setMessageText(splittedMessageLine[6]);
newMessageArrived.setMessageSenderName(splittedMessageLine[4]);
newMessageArrived.setMessageText(splittedMessageLine[6]);
if (splittedMessageLine[7].equals("0")) {
// message is not directed to anyone, move it to the cq messages!
ChatMember dummy = new ChatMember();
dummy.setCallSign("ALL");
newMessage.setReceiver(dummy);
newMessageArrived.setReceiver(dummy);
// this.client.getLst_toAllMessageList().add(0, newMessage); // sdtout to all message-List //TODO: change, moved to globalmessagelist - original
this.client.getLst_globalChatMessageList().add(0, newMessage); // sdtout to all message-List //TODO: change, moved to globalmessagelist
this.client.getLst_globalChatMessageList().add(0, newMessageArrived); // sdtout to all message-List
} else {
//message is directed to another chatmember, process as such!
ChatMember receiver = new ChatMember();
receiver.setChatCategory(chategoryForMessageAndMessageSender); //got out of message itself
receiver.setCallSign(splittedMessageLine[7]);
int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), receiver);
if (index != -1) {
newMessage.setReceiver(this.client.getLst_chatMemberList().get(index));// -1: Member left Chat
newMessageArrived.setReceiver(this.client.getLst_chatMemberList().get(index));// -1: Member left Chat
// before...
} else { //found in active member list
if (receiver.getCallSign().equals(client.getChatPreferences().getLoginCallSign())) {
if (receiver.getCallSign().equals(client.getChatPreferences().getStn_loginCallSign())) {
/**
* If mycallsign sent a message to the server, server will publish that message and
* send it to all chatmember including me.
@@ -562,90 +593,143 @@ public class MessageBusManagementThread extends Thread {
* it in the next case (marking left user, just for information). But I want an echo.
*/
receiver.setCallSign(client.getChatPreferences().getLoginCallSign());
newMessage.setReceiver(receiver);
receiver.setCallSign(client.getChatPreferences().getStn_loginCallSign());
newMessageArrived.setReceiver(receiver);
} else {
//this are user which left chat but had been adressed by this message
receiver.setCallSign(receiver.getCallSign() + "(left)");
newMessage.setReceiver(receiver);
newMessageArrived.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: " + newMessageArrived.getReceiver().getCallSign() + ". EQ?: " + this.client.getownChatMemberObject().getCallSign() + " sent by: " + newMessageArrived.getSender().getCallSign().toUpperCase() + " -> EQ?: "+ this.client.getChatPreferences().getLoginCallSign().toUpperCase());
try {
/**
* message is directed to me, will be put in the "to me" messagelist
*/
if (newMessage.getReceiver().getCallSign()
.equals(this.client.getChatPreferences().getLoginCallSign())) {
if (newMessageArrived.getReceiver().getCallSign()
.equals(this.client.getChatPreferences().getStn_loginCallSign())) {
// this.client.getLst_toMeMessageList().add(0, newMessage); //TODO: change, moved to globalmessagelist, original
this.client.getLst_globalChatMessageList().add(0, newMessage); //TODO: change, moved to globalmessagelist, original
// this.client.getLst_toMeMessageList().add(0, newMessageArrived); //TODO: change, moved to globalmessagelist, original
this.client.getLst_globalChatMessageList().add(0, newMessageArrived); //TODO: change, moved to globalmessagelist, original
if (this.client.getChatPreferences().isNotify_playSimpleSounds()) {
this.client.getPlayAudioUtils().playNoiseLauncher('P');
}
if (this.client.getChatPreferences().isNotify_playCWCallsignsOnRxedPMs()) {
this.client.getPlayAudioUtils().playCWLauncher(" " + " " + newMessage.getSender().getCallSign().toUpperCase());
this.client.getPlayAudioUtils().playCWLauncher(" " + " " + newMessageArrived.getSender().getCallSign().toUpperCase());
}
if (this.client.getChatPreferences().isNotify_playVoiceCallsignsOnRxedPMs()) {
this.client.getPlayAudioUtils().playVoiceLauncher( "?" + newMessage.getSender().getCallSign().toUpperCase());
this.client.getPlayAudioUtils().playVoiceLauncher( "?" + newMessageArrived.getSender().getCallSign().toUpperCase());
}
if (this.client.getChatPreferences().isNotify_playSimpleSounds()) {
if (newMessage.getMessageText().toUpperCase().contains("//BELL")) {
if (newMessageArrived.getMessageText().toUpperCase().contains("//BELL")) {
this.client.getPlayAudioUtils().playVoiceLauncher("!");
}
}
if (this.client.getChatPreferences().isMsgHandling_autoAnswerEnabled()) {
System.out.println("message directed to me: " + newMessage.getReceiver().getCallSign() + ".");
ChatMessage automaticAnswer = new ChatMessage();
ChatMember itsMe = new ChatMember();
itsMe.setCallSign(this.client.getChatPreferences().getStn_loginCallSign());
} else if (newMessage.getSender().getCallSign().toUpperCase()
.equals(this.client.getChatPreferences().getLoginCallSign().toUpperCase())) {
automaticAnswer.setSender(itsMe);
automaticAnswer.setReceiver(newMessageArrived.getSender());
automaticAnswer.setMessageText("/CQ " + newMessageArrived.getSender().getCallSign() + " " + this.client.getChatPreferences().getMessageHandling_autoAnswerTextMainCat());
this.client.getMessageTXBus().add(automaticAnswer);
}
/**
* auto reply/answer to QRG requests is here
*/
if (this.client.getChatPreferences().isMessageHandling_autoAnswerToQRGRequestEnabled()) {
for (String lookForQRGString : qrgQuestionTexts) {
if (newMessageArrived.getMessageText().contains(lookForQRGString)) {
ChatMessage automaticAnswer = new ChatMessage();
ChatMember itsMe = new ChatMember();
itsMe.setCallSign(this.client.getChatPreferences().getStn_loginCallSign());
automaticAnswer.setSender(itsMe);
automaticAnswer.setReceiver(newMessageArrived.getSender());
automaticAnswer.setMessageText("/CQ " + newMessageArrived.getSender().getCallSign() + " KST4Contest Auto: QRG is: " + this.client.getChatPreferences().getMYQRGFirstCat().getValue());
if (this.client.getChatPreferences().isLoginToSecondChatEnabled()) {
automaticAnswer.setMessageText("/CQ " + newMessageArrived.getSender().getCallSign() + " KST4Contest Auto: QRGs: " + this.client.getChatPreferences().getMYQRGFirstCat().getValue() + " / " + this.client.getChatPreferences().getMYQRGSecondCat().getValue());
} else {
automaticAnswer.setMessageText("/CQ " + newMessageArrived.getSender().getCallSign() + " KST4Contest Auto: QRG is: " + this.client.getChatPreferences().getMYQRGFirstCat().getValue());
}
this.client.getMessageTXBus().add(automaticAnswer);
}
}
}
System.out.println("message directed to me: " + newMessageArrived.getReceiver().getCallSign() + ".");
} else if (newMessageArrived.getSender().getCallSign().toUpperCase()
.equals(this.client.getChatPreferences().getStn_loginCallSign().toUpperCase())) {
/**
* message sent by me!
* message from me will appear in the PM window, too, with (>CALLSIGN) before
*/
String originalMessage = newMessage.getMessageText();
newMessage
.setMessageText("(>" + newMessage.getReceiver().getCallSign() + ")" + originalMessage);
// this.client.getLst_toMeMessageList().add(0, newMessage); //TODO: change, moved to globalmessagelist, original
this.client.getLst_globalChatMessageList().add(0,newMessage);//TODO: change, moved to globalmessagelist
String originalMessage = newMessageArrived.getMessageText();
newMessageArrived
.setMessageText("(>" + newMessageArrived.getReceiver().getCallSign() + ")" + originalMessage);
this.client.getLst_globalChatMessageList().add(0,newMessageArrived);
// 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 {
//message sent to other user
// this.client.getLst_toOtherMessageList().add(0, newMessage); //TODO: change, moved to globalmessagelist, original
if (DirectionUtils.isInAngleAndRange(client.getChatPreferences().getLoginLocator(),
newMessage.getSender().getQra(),
newMessage.getReceiver().getQra(),
// this.client.getLst_toOtherMessageList().add(0, newMessageArrived); //TODO: change, moved to globalmessagelist, original
if (DirectionUtils.isInAngleAndRange(client.getChatPreferences().getStn_loginLocatorMainCat(),
newMessageArrived.getSender().getQra(),
newMessageArrived.getReceiver().getQra(),
client.getChatPreferences().getStn_maxQRBDefault(),
client.getChatPreferences().getStn_antennaBeamWidthDeg())) {
if (this.client.getChatPreferences().isNotify_playSimpleSounds()) {
//play only tick sound if the sender was not set directedtome before
if (!newMessage.getSender().isInAngleAndRange()) {
if (!newMessageArrived.getSender().isInAngleAndRange()) {
this.client.getPlayAudioUtils().playNoiseLauncher('-');
}
}
newMessage.getSender().setInAngleAndRange(true);
System.out.println(">>>>>>>>>> Anglewarning <<<<<<<<<< " + newMessage.getSender().getCallSign() + ", " + newMessage.getSender().getQra() + " -> " + newMessage.getReceiver().getCallSign() + ", " + newMessage.getReceiver().getQra() + " = " +
new Location(newMessage.getSender().getQra()).getBearing(new Location(newMessage.getReceiver().getQra())) +
" / sender bearing to me: " + new Location(newMessage.getSender().getQra()).getBearing(new Location(client.getChatPreferences().getLoginLocator())));
newMessageArrived.getSender().setInAngleAndRange(true);
if (client.getChatPreferences().isNotify_dxClusterServerEnabled()) {
try {
if (newMessageArrived.getSender().getFrequency() != null) {
this.client.getDxClusterServer().broadcastSingleDXClusterEntryToLoggers(newMessageArrived.getSender()); //tells the DXCluster server to send a DXC message for this member to the logbook software
}
} catch (Exception exception) {
System.out.println("[MSGBUSMGT, ERROR:] DXCluster messageserver error while processing spot for 0" + newMessageArrived.getSender().getCallSign() + " // " + exception.getMessage());
exception.printStackTrace();
}
}
System.out.println(">>>>>>>>>> Anglewarning <<<<<<<<<< " + newMessageArrived.getSender().getCallSign() + ", " + newMessageArrived.getSender().getQra() + " -> " + newMessageArrived.getReceiver().getCallSign() + ", " + newMessageArrived.getReceiver().getQra() + " = " +
new Location(newMessageArrived.getSender().getQra()).getBearing(new Location(newMessageArrived.getReceiver().getQra())) +
" / sender bearing to me: " + new Location(newMessageArrived.getSender().getQra()).getBearing(new Location(client.getChatPreferences().getStn_loginLocatorMainCat())));
} else {
System.out.println("-notinangle- " + newMessage.getSender().getCallSign() + ", " + newMessage.getSender().getQra() + " -> " + newMessage.getReceiver().getCallSign() + ", " + newMessage.getReceiver().getQra() + " = " +
new Location(newMessage.getSender().getQra()).getBearing(new Location(newMessage.getReceiver().getQra())) +
" ; sender bearing to me: " + new Location(newMessage.getSender().getQra()).getBearing(new Location(client.getChatPreferences().getLoginLocator())));
newMessage.getSender().setInAngleAndRange(false);
System.out.println("-notinangle- " + newMessageArrived.getSender().getCallSign() + ", " + newMessageArrived.getSender().getQra() + " -> " + newMessageArrived.getReceiver().getCallSign() + ", " + newMessageArrived.getReceiver().getQra() + " = " +
new Location(newMessageArrived.getSender().getQra()).getBearing(new Location(newMessageArrived.getReceiver().getQra())) +
" ; sender bearing to me: " + new Location(newMessageArrived.getSender().getQra()).getBearing(new Location(client.getChatPreferences().getStn_loginLocatorMainCat())));
newMessageArrived.getSender().setInAngleAndRange(false);
}
this.client.getLst_globalChatMessageList().add(0, newMessage);
// System.out.println("MSGBS bgfx: tx call = " + newMessage.getSender().getCallSign() + " / rx call = " + newMessage.getReceiver().getCallSign());
this.client.getLst_globalChatMessageList().add(0, newMessageArrived);
// System.out.println("MSGBS bgfx: tx call = " + newMessageArrived.getSender().getCallSign() + " / rx call = " + newMessageArrived.getReceiver().getCallSign());
}
} catch (NullPointerException referenceDeletedByUserLeftChatDuringMessageprocessing) {
System.out.println("MSGBS bgfx, <<<catched error>>>: referenced user left the chat during messageprocessing or message got before user entered chat message: " + referenceDeletedByUserLeftChatDuringMessageprocessing.getStackTrace());
@@ -654,7 +738,7 @@ public class MessageBusManagementThread extends Thread {
// sdtout to me message-List
// newMessage.setReceiver(this.client.getChatMemberTable().get(splittedMessageLine[7])); // set sender
// newMessageArrived.setReceiver(this.client.getChatMemberTable().get(splittedMessageLine[7])); // set sender
// to the
// member of
// before
@@ -662,11 +746,16 @@ public class MessageBusManagementThread extends Thread {
// list
}
// System.out.println("[MSGBUSMGT:] processed message: " + newMessage.getChatCategory().getCategoryNumber()
// + " " + newMessage.getSender().getCallSign() + ", " + newMessage.getMessageSenderName() + " -> "
// + newMessage.getReceiver().getCallSign() + ": " + newMessage.getMessageText());
try {
String locatedFrequencies = checkIfMessageInhibitsFrequency(newMessage);
System.out.println("[MSGBUSMGT:] processed message: " + newMessageArrived.getChatCategory().getCategoryNumber()
+ " " + newMessageArrived.getSender().getCallSign() + ", " + newMessageArrived.getMessageSenderName() + " -> "
+ newMessageArrived.getReceiver().getCallSign() + ": " + newMessageArrived.getMessageText());
} catch (Exception exceptionOccured) {
System.out.println("[MSGMgtBus: ERROR CHATCHED ON MAYBE NULL ISSUE]: " + exceptionOccured.getMessage() + "\n" + exceptionOccured.getStackTrace());
}
String locatedFrequencies = checkIfMessageInhibitsFrequency(newMessageArrived);
SimpleStringProperty qrg = new SimpleStringProperty(locatedFrequencies);
@@ -676,14 +765,10 @@ public class MessageBusManagementThread extends Thread {
// no qrg found, nothing to do
} else {
// String stringAggregation = "";
//
// for (int i = 0; i < locatedFrequencies.length; i++) {
// stringAggregation += locatedFrequencies[i] + " ";
// }
ChatMember temp3 = new ChatMember();
temp3.setCallSign(splittedMessageLine[3]);
temp3.setChatCategory(chategoryForMessageAndMessageSender);
int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(), temp3);
if (index == -1) { // user is not in the userlist but sent message...
@@ -694,13 +779,12 @@ public class MessageBusManagementThread extends Thread {
System.out.println("[MSGBUSMGT <<<catched ERROR>>>]:, Frequency for " + splittedMessageLine[3]
+ " is not settable, Callsign is not in the Member-list!");
//create dummy user to display the message but it wont be hit the user object
//create dummy user to display the message but it wont be hit an existing user object
ChatMember newMember = new ChatMember();
newMember.setCallSign(splittedMessageLine[3]);
newMember.setName(splittedMessageLine[4]);
newMember.setFrequency(qrg);
// newMember.setFrequency(locatedFrequencies);
// this.client.getLst_chatMemberList().add(newMember);
} else {
/**
@@ -709,6 +793,8 @@ public class MessageBusManagementThread extends Thread {
this.client.getLst_chatMemberList().get(index).setFrequency(qrg);
System.out.println("[MSGBUSMGT:] Frequency for " + splittedMessageLine[3] + " setted: "
+ locatedFrequencies);
// this.client.getDxClusterServer().broadcastSingleDXClusterEntryToLoggers(this.client.getLst_chatMemberList().get(index)); //tells the DXCluster server to send a DXC message for this member to the logbook software
}
}
@@ -725,6 +811,8 @@ public class MessageBusManagementThread extends Thread {
// System.out.println("MSGBUS: User detected");
ChatMember temp4 = new ChatMember();
temp4.setChatCategory(this.client.getChatCategoryMain()); //not really detectable and not really neccessarry to detect
temp4.setCallSign(splittedMessageLine[2]);
temp4.setQra(splittedMessageLine[3]);
temp4.setLastActivity(new Utils4KST().time_generateActualTimeInDateFormat());
@@ -737,21 +825,20 @@ public class MessageBusManagementThread extends Thread {
+ this.client.getLst_chatMemberList().get(index).getQra() + " new is: "
+ splittedMessageLine[3]));
this.client.getLst_chatMemberList().get(index).setQra(splittedMessageLine[3]);
this.client.getLst_chatMemberList().get(index).setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getLoginLocator(), splittedMessageLine[3]));
this.client.getLst_chatMemberList().get(index).setQTFdirection(new Location(client.getChatPreferences().getLoginLocator()).getBearing(new Location(splittedMessageLine[3])));
ChatMember foundThisInChatMemberList = this.client.getLst_chatMemberList().get(index); //make less list accesses
// this.client.getLst_chatMemberList().get(index).setQra(splittedMessageLine[3]);
// this.client.getLst_chatMemberList().get(index).setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getLoginLocator(), splittedMessageLine[3]));
// this.client.getLst_chatMemberList().get(index).setQTFdirection(new Location(client.getChatPreferences().getLoginLocator()).getBearing(new Location(splittedMessageLine[3])));
foundThisInChatMemberList.setQra(splittedMessageLine[3]);
foundThisInChatMemberList.setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getStn_loginLocatorMainCat(), splittedMessageLine[3]));
foundThisInChatMemberList.setQTFdirection(new Location(client.getChatPreferences().getStn_loginLocatorMainCat()).getBearing(new Location(splittedMessageLine[3])));
} else {
System.out.println("[MSGBUSMGT:] ERROR! Locator Change of ["
+ (splittedMessageLine[2] + "] is not possible, user is not in the Table!"));
// ChatMember newMember = new ChatMember();
// newMember.setCallSign(splittedMessageLine[2]);
// newMember.setQra(splittedMessageLine[3]);
// this.client.getChatMemberTable().put(newMember.getCallSign(), newMember);
// this.client.getLst_chatMemberList().add(temp4);
}
this.client.getDbHandler().storeChatMember(temp4); // TODO thats a bit unclean, its less an insert but a
@@ -873,6 +960,8 @@ public class MessageBusManagementThread extends Thread {
// System.out.println("[MSGBUSMGT:] DXCluster Message detected ");
stateChangeMember.setChatCategory(util_getChatCategoryByCategoryNrString(splittedMessageLine[1]));
int index = checkListForChatMemberIndexByCallSign(this.client.getLst_chatMemberList(),
stateChangeMember);
@@ -892,13 +981,15 @@ public class MessageBusManagementThread extends Thread {
ChatMember stateChangeMember = new ChatMember();
stateChangeMember.setChatCategory(util_getChatCategoryByCategoryNrString(splittedMessageLine[1]));
stateChangeMember.setCallSign(splittedMessageLine[2]);
stateChangeMember.setName(splittedMessageLine[3]);
stateChangeMember.setQra(splittedMessageLine[4]);
stateChangeMember.setState(Integer.parseInt(splittedMessageLine[5]));
stateChangeMember.setLastActivity(new Utils4KST().time_generateActualTimeInDateFormat());
stateChangeMember.setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getLoginLocator(), stateChangeMember.getQra()));
stateChangeMember.setQTFdirection(new Location(client.getChatPreferences().getLoginLocator()).getBearing(new Location(stateChangeMember.getQra())));
stateChangeMember.setQrb(new Location().getDistanceKmByTwoLocatorStrings(client.getChatPreferences().getStn_loginLocatorMainCat(), stateChangeMember.getQra()));
stateChangeMember.setQTFdirection(new Location(client.getChatPreferences().getStn_loginLocatorMainCat()).getBearing(new Location(stateChangeMember.getQra())));
this.client.getDbHandler().storeChatMember(stateChangeMember); // TODO: not clean, it should be an
// upodate
@@ -915,14 +1006,6 @@ public class MessageBusManagementThread extends Thread {
this.client.getLst_chatMemberList().get(index).setState(stateChangeMember.getState());
}
// this.client.getChatMemberTable().get(stateChangeMember.getCallSign())
// .setName(stateChangeMember.getName());
// this.client.getChatMemberTable().get(stateChangeMember.getCallSign())
// .setQra(stateChangeMember.getQra());
// this.client.getChatMemberTable().get(stateChangeMember.getCallSign())
// .setState(stateChangeMember.getState());
} else
/**
@@ -961,7 +1044,7 @@ public class MessageBusManagementThread extends Thread {
pwErrorMsg.setMessageText(splittedMessageLine[2]);
ChatMember receiverDummy = new ChatMember();
receiverDummy.setCallSign(client.getChatPreferences().getLoginCallSign());
receiverDummy.setCallSign(client.getChatPreferences().getStn_loginCallSign());
receiverDummy.setQrb(0.);
receiverDummy.setQTFdirection(0.);
pwErrorMsg.setReceiver(receiverDummy);
@@ -1008,6 +1091,28 @@ public class MessageBusManagementThread extends Thread {
}
}
/**
* Method gets a String with a messagecategory-number and returns out of which of the existing categories
* (chat channels) this message/user had written from
*
* @param categoryNumber
* @return used Chatcategory (instance of singletons)
*/
private ChatCategory util_getChatCategoryByCategoryNrString(String categoryNumber) {
// System.out.println("MSGBSMGT Debug: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> try to find out category for a member; category is " + categoryNumber + " // 1st is " + this.client.getChatCategoryMain().getCategoryNumber() + " // 2nd is " + this.client.getChatCategorySecondChat().getCategoryNumber());
if (categoryNumber.equals(this.client.getChatCategoryMain().getCategoryNumber() + "")) {
return this.client.getChatCategoryMain();
} else if (categoryNumber.equals(this.client.getChatCategorySecondChat().getCategoryNumber() + "")) {
return this.client.getChatCategorySecondChat();
} else {
System.out.println("Msgbusmgt: ERROR!!! -> category for this message does not exist!");
return this.client.getChatCategoryMain(); //Chatcategory default decision
}
}
@Override
public void interrupt() {
super.interrupt();
@@ -1118,10 +1223,10 @@ public class MessageBusManagementThread extends Thread {
try {
processRXMessage23001(messageTextRaw);
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("MsgBusMgt: process23001 went wrong / IO Error");
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
System.out.println("MsgBusMgt: process23001 went wrong / SQL Error");
e.printStackTrace();
}
}
@@ -1130,7 +1235,7 @@ public class MessageBusManagementThread extends Thread {
this.interrupt();
e1.printStackTrace();
break;// TODO Change at may24, avoid uncloability. Check if this could lead to further errors on instable link!
break;// TODO Change at may24, avoid uncloadability. Check if this could lead to further errors on instable link!
// client.getMessageRXBus().clear();
}
{

View File

@@ -2,6 +2,7 @@ package kst4contest.controller;
import java.io.*;
import java.net.*;
import java.nio.charset.StandardCharsets;
import kst4contest.model.ChatMessage;
@@ -39,7 +40,7 @@ public class ReadThread extends Thread {
try {
input = socket.getInputStream();
reader = new BufferedReader(new InputStreamReader(input));
reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
} catch (IOException ex) {
System.out.println("Error getting input stream: " + ex.getMessage());

View File

@@ -3,6 +3,7 @@ package kst4contest.controller;
import java.io.*;
import java.net.*;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
@@ -195,8 +196,12 @@ public class ReadUDPbyUCXMessageThread extends Thread {
// call = call.toLowerCase();
String band = element.getElementsByTagName("band").item(0).getTextContent();
String points = element.getElementsByTagName("points").item(0).getTextContent();
System.out.println("[Readudp, info ]: received Current Element :" + node.getNodeName()
+ "call: " + call + " / " + band);
+ "call: " + call + " / " + band + " ----> " + points + " POINTS");
// client.getChatPreferences().setBcn_contestScoreSum(Long.parseLong(points));
ChatMember workedCall = new ChatMember();
workedCall.setCallSign(call);
@@ -238,6 +243,44 @@ public class ReadUDPbyUCXMessageThread extends Thread {
}
/**
* cases hotfix for MINOS logger, which tells band like "2m", not "144"
*/
case "2m": {
workedCall.setWorked144(true);
break;
}
case "70cm": {
workedCall.setWorked432(true);
break;
}
case "23cm": {
workedCall.setWorked1240(true);
break;
}
case "13cm": {
workedCall.setWorked2300(true);
break;
}
case "9cm": {
workedCall.setWorked3400(true);
break;
}
case "6cm": {
workedCall.setWorked5600(true);
break;
}
case "3cm": {
workedCall.setWorked10G(true);
}
default:
System.out.println("[ReadUDPFromUCX, Error:] unexpected band value: \"" + band + "\"");
break;
@@ -256,79 +299,150 @@ public class ReadUDPbyUCXMessageThread extends Thread {
// modifyThat = (ChatMember) client.getMap_ucxLogInfoWorkedCalls().get(call);
int indexOfChatMemberInTable = -1;
indexOfChatMemberInTable = client.checkListForChatMemberIndexByCallSign(workedCall);
// asd //TODO: Check if callsign and callsignraw is similar, then mark first and further via new checklistforchatmembermultiplemethod with array of indize
if (indexOfChatMemberInTable == -1) {
// do nothing
ArrayList<Integer> markTheseChattersAsWorked = client.checkListForChatMemberIndexesByCallSign(workedCall);
if (markTheseChattersAsWorked.isEmpty()) {
//Worked call is not part of the chatmember list
} else {
modifyThat = client.getLst_chatMemberList().get(indexOfChatMemberInTable);
// modifyThat.setWorked(true);
client.getLst_chatMemberList()
.get(client.checkListForChatMemberIndexByCallSign(modifyThat)).setWorked(true);
for (int index : markTheseChattersAsWorked) {
modifyThat = client.getLst_chatMemberList().get(index);
if (workedCall.isWorked144()) {
modifyThat.setWorked144(true);
client.getLst_chatMemberList()
.get(client.checkListForChatMemberIndexByCallSign(modifyThat))
.setWorked144(true);
modifyThat.setWorked(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat)).setWorked(true);
} else if (workedCall.isWorked432()) {
modifyThat.setWorked432(true);
client.getLst_chatMemberList()
.get(client.checkListForChatMemberIndexByCallSign(modifyThat))
.setWorked432(true);
if (workedCall.isWorked144()) {
modifyThat.setWorked144(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked144(true);
} else if (workedCall.isWorked1240()) {
modifyThat.setWorked1240(true);
client.getLst_chatMemberList()
.get(client.checkListForChatMemberIndexByCallSign(modifyThat))
.setWorked1240(true);
} else if (workedCall.isWorked432()) {
modifyThat.setWorked432(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked432(true);
} else if (workedCall.isWorked2300()) {
modifyThat.setWorked2300(true);
client.getLst_chatMemberList()
.get(client.checkListForChatMemberIndexByCallSign(modifyThat))
.setWorked2300(true);
} else if (workedCall.isWorked1240()) {
modifyThat.setWorked1240(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked1240(true);
} else if (workedCall.isWorked3400()) {
modifyThat.setWorked3400(true);
client.getLst_chatMemberList()
.get(client.checkListForChatMemberIndexByCallSign(modifyThat))
.setWorked3400(true);
} else if (workedCall.isWorked2300()) {
modifyThat.setWorked2300(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked2300(true);
} else if (workedCall.isWorked5600()) {
modifyThat.setWorked5600(true);
client.getLst_chatMemberList()
.get(client.checkListForChatMemberIndexByCallSign(modifyThat))
.setWorked5600(true);
} else if (workedCall.isWorked3400()) {
modifyThat.setWorked3400(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked3400(true);
} else if (workedCall.isWorked10G()) {
modifyThat.setWorked10G(true);
client.getLst_chatMemberList()
.get(client.checkListForChatMemberIndexByCallSign(modifyThat))
.setWorked10G(true);
} else if (workedCall.isWorked5600()) {
modifyThat.setWorked5600(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked5600(true);
} else if (workedCall.isWorked10G()) {
modifyThat.setWorked10G(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked10G(true);
}
}
/**
* //TODO: following line is a quick fix to making disappear worked chatmembers of the list
* Thats uncomfortable due to this also causes selection changes,
* Better way is to change all worked and qrv values to observables and then trigger the underlying
* list to fire an invalidationevent. Really Todo!
*/
try{
try {
GuiUtils.triggerGUIFilteredChatMemberListChange(client); //not clean at all
} catch (Exception IllegalStateException) {
//do nothing, as it works...
}
}
/**
* old mechanic to markup worked stations in the chatmember table
*/
// int indexOfChatMemberInTable = -1; //chatmember not in table
// indexOfChatMemberInTable = client.checkListForChatMemberIndexByCallSign(workedCall);
//
// if (indexOfChatMemberInTable == -1) {
// // do nothing
// } else {
// modifyThat = client.getLst_chatMemberList().get(indexOfChatMemberInTable);
//
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat)).setWorked(true);
//
// if (workedCall.isWorked144()) {
// modifyThat.setWorked144(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked144(true);
//
// } else if (workedCall.isWorked432()) {
// modifyThat.setWorked432(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked432(true);
//
// } else if (workedCall.isWorked1240()) {
// modifyThat.setWorked1240(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked1240(true);
//
// } else if (workedCall.isWorked2300()) {
// modifyThat.setWorked2300(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked2300(true);
//
// } else if (workedCall.isWorked3400()) {
// modifyThat.setWorked3400(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked3400(true);
//
// } else if (workedCall.isWorked5600()) {
// modifyThat.setWorked5600(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked5600(true);
//
// } else if (workedCall.isWorked10G()) {
// modifyThat.setWorked10G(true);
// client.getLst_chatMemberList()
// .get(client.checkListForChatMemberIndexByCallSign(modifyThat))
// .setWorked10G(true);
// }
/**
* //TODO: following line is a quick fix to making disappear worked chatmembers of the list
* Thats uncomfortable due to this also causes selection changes,
* Better way is to change all worked and qrv values to observables and then trigger the underlying
* list to fire an invalidationevent. Really Todo!
*/
// try{
//
// GuiUtils.triggerGUIFilteredChatMemberListChange(client); //not clean at all
// } catch (Exception IllegalStateException) {
// //do nothing, as it works...
// }
// }
/**
* end -> old mechanic to markup worked stations in the chatmember table
*/
}
boolean isInChat = this.client.getDbHandler().updateWkdInfoOnChatMember(workedCall);
// This will update the worked info on a worked chatmember. DBHandler will
// check, if an entry at the db had been modified. If not, then the worked
// station had not been stored. DBHandler will store the informations then.
// station had not been stored. DBHandler will store the information then.
if (!isInChat) {
workedCall.setName("unknown");
@@ -348,7 +462,6 @@ public class ReadUDPbyUCXMessageThread extends Thread {
fileWriterPersistUDPToFile = new FileWriter(logUDPMessageToThisFile, true);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
@@ -424,7 +537,7 @@ public class ReadUDPbyUCXMessageThread extends Thread {
// System.out.println("Radio Mode: " + mode);
// System.out.println("[ReadUDPFromUCX, Info:] Setted QRG pref to: \"" + qrg + "\"" );
this.client.getChatPreferences().getMYQRG().set(formattedQRG);
this.client.getChatPreferences().getMYQRGFirstCat().set(formattedQRG);
System.out.println("[ReadUDPbyUCXTh: ] Radioinfo processed: " + formattedQRG);
}

View File

@@ -0,0 +1,65 @@
package kst4contest.controller;
import kst4contest.model.ChatMessage;
import java.util.TimerTask;
/**
* This class is updateing the scoreboard at https://slovhf.net/claimed/. Gets scores of all bands out of the
* preferences which is updated via ReadUdpByUCXLog Thread.
*
* api description: https://slovhf.net/claimed-score-api/
*
* <br/><br/>
* The task will be runned out of the singleton ChatController instance in an
* intervall as specified by the Chatpreferences-instance (typically as
* configured in the xml file.
*
*
* @author prakt
*
*/
public class ScoreboardUpdateTask extends TimerTask {
private ChatController chatController;
public ScoreboardUpdateTask(ChatController client) {
this.chatController = client;
}
@Override
public void run() {
Thread.currentThread().setName("BeaconTask");
ChatMessage beaconMSG = new ChatMessage();
String replaceVariables = this.chatController.getChatPreferences().getBcn_beaconTextMainCat();
// replaceVariables = bcn_beaconText;
replaceVariables = replaceVariables.replaceAll("MYQRG", this.chatController.getChatPreferences().getMYQRGFirstCat().getValue());
replaceVariables = replaceVariables.replaceAll("MYCALL", this.chatController.getChatPreferences().getStn_loginCallSign());
replaceVariables = replaceVariables.replaceAll("MYLOCATOR", this.chatController.getChatPreferences().getStn_loginLocatorMainCat());
replaceVariables = replaceVariables.replaceAll("MYQTF", this.chatController.getChatPreferences().getActualQTF().getValue() + "");
beaconMSG.setMessageText(
"MSG|" + this.chatController.getChatPreferences().getLoginChatCategoryMain().getCategoryNumber() + "|0|" + replaceVariables + "|0|");
beaconMSG.setMessageDirectedToServer(true);
// System.out.println("########### " + replaceVariables);
if (this.chatController.getChatPreferences().isBcn_beaconsEnabledMainCat() ) {
System.out.println(new Utils4KST().time_generateCurrentMMDDhhmmTimeString()
+ " [BeaconTask, Info]: Sending CQ: " + beaconMSG.getMessageText());
this.chatController.getMessageTXBus().add(beaconMSG);
} else {
//do nothing, CQ is disabled
}
}
}

View File

@@ -178,7 +178,7 @@ public class UpdateChecker {
for (int i = 0; i < element.getChildNodes().getLength(); i++) {
if (element.getChildNodes().item(i).getNodeType() == Node.ELEMENT_NODE) {
System.out.println(element.getChildNodes().item(i).getTextContent() + " <<<<<<<<<<<<<<<<<< " + i + " / " + childNodeCounter);
// System.out.println(element.getChildNodes().item(i).getTextContent() + " <<<<<<<<<<<<<<<<<< " + i + " / " + childNodeCounter);
// System.out.println(element.getChildNodes().item(i).getNodeName());
aChangeLogEntry[childNodeCounter] = aChangeLogEntry[childNodeCounter] + element.getChildNodes().item(i).getTextContent();
childNodeCounter++;

View File

@@ -1,5 +1,7 @@
package kst4contest.controller;
import javafx.beans.property.SimpleStringProperty;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.OffsetDateTime;
@@ -7,6 +9,8 @@ import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utils4KST {
@@ -20,6 +24,14 @@ public class Utils4KST {
return millisecondsSinceEpoch;
}
public String time_generateCurrenthhmmZTimeStringForClusterMessage() {
OffsetDateTime currentTimeInUtc = OffsetDateTime.now(ZoneOffset.UTC);
System.out.println("Utils generated current time " + currentTimeInUtc + " --> " + currentTimeInUtc.format(DateTimeFormatter.ofPattern("HHmm"))+"Z");
return currentTimeInUtc.format(DateTimeFormatter.ofPattern("HHmm"))+"Z";
}
public String time_generateCurrentMMDDhhmmTimeString() {
OffsetDateTime currentTimeInUtc = OffsetDateTime.now(ZoneOffset.UTC);
@@ -71,4 +83,119 @@ public class Utils4KST {
}
/**
* This method tests a regexp-pattern against a given string
*
* @param testString: check if this string matches a given pattern
* @param regExPattern: pattern which should be checked
* @return true if match, else false
*/
private static boolean testPattern(String testString, String regExPattern) {
Pattern pattern = Pattern.compile(regExPattern);
Matcher matcher = pattern.matcher(testString);
return matcher.find();
}
/**
* Normalizes a chatmembers frequency-string for cluster usage<br/>
* <b>returns a frequency String in KHz like = "144300" or "144300.0" to match DXC protocol needs</b>
*
* @param optionalPrefix: if there is a value like ".300", it have to be decided, wich ".300": 144.300, 432.300, 1296.300 .... prefix means for example "144."
*/
public static String normalizeFrequencyString(String qrgString, SimpleStringProperty optionalPrefix) {
// final String PTRN_QRG_CAT2 = "(([0-9]{3,4}[\\.|,| ]?[0-9]{3})([\\.|,][\\d]{1,2})?)|(([a-zA-Z][0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)|((\\b[0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)";
try {
qrgString = qrgString.replace(" ","");
} catch (Exception e) {
System.out.println("UTILS: QRG NULL, nothing to convert");
// e.printStackTrace();
}
final String PTRN_QRG_CAT2_wholeQRGMHz4Digits = "(([0-9]{4}[\\.|,| ]?[0-9]{3})([\\.|,][\\d]{1,2})?)"; //1296.300.3 etc
final String PTRN_QRG_CAT2_wholeQRGMHz3Digits = "(([0-9]{3}[\\.|,| ]?[0-9]{3})([\\.][\\d]{1,2})?)"; //144.300.3 etc
final String PTRN_QRG_CAT2_QRGwithoutPrefix = "((\\b[0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)"; //144.300.3 etc
String stringAggregation = "";
if (testPattern(qrgString, PTRN_QRG_CAT2_wholeQRGMHz4Digits)) {//case 1296.200 or 1296.200.2 etc.
stringAggregation = qrgString;
stringAggregation = stringAggregation.replace(".","");
stringAggregation = stringAggregation.replace(",","");
stringAggregation = stringAggregation.replace(" ", "");
if (stringAggregation.length() == 8) {
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length()-1) + "." + stringAggregation.substring(stringAggregation.length()-1, stringAggregation.length());
stringAggregation = stringAggregationNew + ".0";
return stringAggregation;
} else if (stringAggregation.length() == 9) {
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length()-2) + "." + stringAggregation.substring(stringAggregation.length()-2, stringAggregation.length());
stringAggregation = stringAggregationNew;
return stringAggregation;
}
} else
if (testPattern(qrgString, PTRN_QRG_CAT2_wholeQRGMHz3Digits)) { //case 144.300 or 144.300.2
stringAggregation = qrgString;
stringAggregation = stringAggregation.replace(".","");
stringAggregation = stringAggregation.replace(",","");
stringAggregation = stringAggregation.replace(" ", "");
if (stringAggregation.length() == 6) {
stringAggregation = stringAggregation + ".0";
return stringAggregation;
}
if (stringAggregation.length() == 7) {
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length()-1) + "." + stringAggregation.substring(stringAggregation.length()-1, stringAggregation.length());
stringAggregation = stringAggregationNew + ".0";
return stringAggregation;
} else if (stringAggregation.length() == 8) {
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length()-2) + "." + stringAggregation.substring(stringAggregation.length()-2, stringAggregation.length());
stringAggregation = stringAggregationNew;
return stringAggregation;
}
}
else
if (testPattern(qrgString, PTRN_QRG_CAT2_QRGwithoutPrefix)) { //case ".050 or .300 or something like that"
stringAggregation = qrgString;
stringAggregation = stringAggregation.replace(".", "");
stringAggregation = stringAggregation.replace(",", "");
stringAggregation = stringAggregation.replace(" ", "");
if (stringAggregation.length() == 3) { // like 050 or 300
String stringAggregationNew = optionalPrefix.getValue() + stringAggregation;
stringAggregation = stringAggregationNew + ".0";
return stringAggregation;
} else if (stringAggregation.length() == 4) { //like 050.2 --> 0502
stringAggregation = optionalPrefix.getValue() + stringAggregation;
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length() - 1) + "." + stringAggregation.substring(stringAggregation.length() - 1, stringAggregation.length());
stringAggregation = stringAggregationNew;
return stringAggregation;
} else if (stringAggregation.length() == 5) { //like 050.20 --> 05020
stringAggregation = optionalPrefix.getValue() + stringAggregation;
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length() - 2) + "." + stringAggregation.substring(stringAggregation.length() - 2, stringAggregation.length());
stringAggregation = stringAggregationNew;
return stringAggregation;
}
}
return stringAggregation; //if nothing else helps
}
}

View File

@@ -2,6 +2,8 @@ package kst4contest.controller;
import java.io.*;
import java.net.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import kst4contest.model.ChatMessage;
@@ -17,7 +19,7 @@ public class WriteThread extends Thread {
private ChatController client;
private OutputStream output;
private ChatMessage messageTextRaw;
private ChatMessage messageToBeSend;
public WriteThread(Socket socket, ChatController client) throws InterruptedException {
this.socket = socket;
@@ -25,7 +27,9 @@ public class WriteThread extends Thread {
try {
output = socket.getOutputStream();
writer = new PrintWriter(output, true);
writer = new PrintWriter(output, true, StandardCharsets.UTF_8);
} catch (IOException ex) {
System.out.println("Error getting output stream: " + ex.getMessage());
ex.printStackTrace();
@@ -34,7 +38,8 @@ public class WriteThread extends Thread {
/**
* This method is used to send a message to the server, raw formatted. E.g. for
* the keepalive message.
* the keepalive message. This method sends only in the main message-Category. To send it in a category
* "defined by Chatmessage", use txByRxmsgCatOrigin(Chatmessage "toBeSend")
*
* @param messageToServer
* @throws InterruptedException
@@ -48,6 +53,33 @@ public class WriteThread extends Thread {
}
/**
* This method is used to send a message directly to a receiver in a special chatcategory. The receivers category
* will be read out of the Chatmessage.getChatCategory method. <b> The message text will be modified to fit kst
* messageformat</b>
*
* @param messageToServer
* @throws InterruptedException
*/
public void txByRxmsgCatOrigin(ChatMessage messageToServer) throws InterruptedException {
// writer.println(messageToServer.getMessage()); //kst4contest.test 4 23001
// writer.flush(); //kst4contest.test 4 23001
String originalMessageText = messageToServer.getMessageText() + "";
String newMessageText = "";
newMessageText = ("MSG|" + messageToServer.getChatCategory().getCategoryNumber()
+ "|0|" + originalMessageText + "|0|"); //original before 1.26
System.out.println(newMessageText + "< sended to the writer (DIRECTED REPLY)");
writer.println(newMessageText);
}
/**
* This method gets a textmessage to the chat and adds some characters to hit
* the neccessarry format to send a message in the on4kst chat either to another
@@ -59,29 +91,28 @@ public class WriteThread extends Thread {
public void txKSTFormatted(ChatMessage messageToServer) throws InterruptedException {
// writer.println(messageToServer.getMessageText());
messageTextRaw = messageToServer;
messageToBeSend = messageToServer;
try {
messageTextRaw = client.getMessageTXBus().take();
messageToBeSend = client.getMessageTXBus().take();
// this.client.getmesetChatsetServerready(true);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String messageLine = messageTextRaw.getMessageText();
String messageLine = messageToBeSend.getMessageText();
if (messageTextRaw.isMessageDirectedToServer()) {
if (messageToBeSend.isMessageDirectedToServer()) {
/**
* We have to check if we only commands the server (keepalive) or want do talk
* to the community
*/
try {
tx(messageTextRaw);
System.out.println("BUS: tx: " + messageTextRaw.getMessageText());
tx(messageToBeSend);
System.out.println("BUS: tx: " + messageToBeSend.getMessageText());
} catch (InterruptedException e) {
// TODO Auto-generated catch block
@@ -95,8 +126,8 @@ public class WriteThread extends Thread {
// ownMSG.setMessageText(
// "MSG|" + this.client.getCategory().getCategoryNumber() + "|0|" + messageLine + "|0|");
ownMSG.setMessageText("MSG|" + this.client.getChatPreferences().getLoginChatCategory().getCategoryNumber()
+ "|0|" + messageLine + "|0|");
ownMSG.setMessageText("MSG|" + this.client.getChatPreferences().getLoginChatCategoryMain().getCategoryNumber()
+ "|0|" + messageLine + "|0|"); //original before 1.26
try {
tx(ownMSG);
@@ -108,7 +139,7 @@ public class WriteThread extends Thread {
}
}
if (messageTextRaw.equals("/QUIT")) {
if (messageToBeSend.equals("/QUIT")) {
try {
this.client.getReadThread().terminateConnection();
this.client.getReadThread().interrupt();
@@ -117,7 +148,6 @@ public class WriteThread extends Thread {
this.interrupt();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@@ -137,59 +167,62 @@ public class WriteThread extends Thread {
while (true) {
try {
messageTextRaw = client.getMessageTXBus().take();
messageToBeSend = client.getMessageTXBus().take();
if (messageTextRaw.getMessageText().equals("POISONPILL_KILLTHREAD")
&& messageTextRaw.getMessageSenderName().equals("POISONPILL_KILLTHREAD")) {
if (messageToBeSend.getMessageText().equals("POISONPILL_KILLTHREAD")
&& messageToBeSend.getMessageSenderName().equals("POISONPILL_KILLTHREAD")) {
client.getMessageRXBus().clear();
this.interrupt();
break;
} else {
String messageLine = messageTextRaw.getMessageText();
String messageLine = messageToBeSend.getMessageText();
if (messageTextRaw.isMessageDirectedToServer()) {
if (messageToBeSend.isMessageDirectedToServer()) {
/**
* We have to check if we only commands the server (keepalive) or want do talk
* to the community
*/
try {
tx(messageTextRaw);
System.out.println("BUS: tx: " + messageTextRaw.getMessageText());
tx(messageToBeSend);
System.out.println("BUS: tx: " + messageToBeSend.getMessageText());
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
} else { //message is not directed to the server, it´s directed to all or to a station
ChatMessage ownMSG = new ChatMessage();
if (messageToBeSend.getChatCategory() == this.client.getChatCategoryMain() || messageToBeSend.getChatCategory() == this.client.getChatCategorySecondChat()) {
// ownMSG.setMessageText(
// "MSG|" + this.client.getCategory().getCategoryNumber() + "|0|" + messageLine + "|0|");
txByRxmsgCatOrigin(messageToBeSend);
ownMSG.setMessageText(
"MSG|" + this.client.getChatPreferences().getLoginChatCategory().getCategoryNumber() + "|0|"
+ messageLine + "|0|");
} else { //default bhv if destination cat is not detectable
try {
tx(ownMSG);
System.out.println("BUS: tx: " + ownMSG.getMessageText());
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
ChatMessage ownMSG = new ChatMessage();
ownMSG.setMessageText(
"MSG|" + this.client.getChatPreferences().getLoginChatCategoryMain().getCategoryNumber() + "|0|"
+ messageLine + "|0|");
try {
tx(ownMSG);
System.out.println("WT: tx (raw): " + ownMSG.getMessageText());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
System.out.println("WritheTh: got message out of the queue: " + messageTextRaw.getMessageText());
System.out.println("WritheTh: got message out of the queue: " + messageToBeSend.getMessageText());
// this.client.getmesetChatsetServerready(true);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
client.getMessageTXBus().clear();
}

View File

@@ -53,28 +53,17 @@ public class ChatCategory {
public ChatCategory(int setThiscategoryNumber) {
this.categoryNumber = setThiscategoryNumber;
setCategoryNumber(setThiscategoryNumber);
}
public int getCategoryNumber() {
return categoryNumber;
}
public void setCategoryNumber(int categoryNumber) {
this.categoryNumber = categoryNumber;
}
/**
* Returns an Array of int with possible frequency prefixes, due to in the chat
* normally the following format is used (not ever): <br/>

View File

@@ -14,6 +14,9 @@ public class ChatMember {
String callSign;
String qra;
String name;
String callSignRaw; //without -2 or -70 etc.
boolean isInAngleAndRange; //if he tries a sked in my dir, he is in range, will process that in the messages
@@ -22,7 +25,7 @@ public class ChatMember {
StringProperty frequency = new SimpleStringProperty();
String password; // only used by own instance of the chatmember instance to login to the chat
ChatCategory chatCategory; // only used by own instance of the chatmember instance to login to the chat
ChatCategory chatCategory; //Source category
// ChatCategory chatCategory;//only used by own instance of the chatmember instance to login to the chat
long activityTimeLastInEpoch; // time of last activity in epochtimesec
@@ -312,10 +315,25 @@ public class ChatMember {
public void setWorked(boolean worked) {
this.worked = worked;
// this.workedInfoChangeFireListEventTriggerProperty().setValue(true);
// this.workedInfoChangeFireListEventTriggerProperty().setValue(false);
}
/**
*
* @return String (callsign) without -2 or -70 etc.
*/
public String getCallSignRaw() {
String raw = "";
try {
return this.getCallSign().split("-")[0]; //e.g. OK2M-70, returns only ok2m
} catch (Exception e) {
return getCallSign();
}
}
/**
* Sets all worked information of this object to false. Scope: GUI, Reset Button
* for worked info, called by appcontroller
@@ -352,9 +370,9 @@ public class ChatMember {
public String toString() {
String chatMemberSerialization = "";
chatMemberSerialization += callSign + ";" + name + ";" + qra + ";" + frequency + ";" + worked + ";" + worked144
+ ";" + worked432 + ";" + worked1240 + ";" + worked2300 + ";" + worked3400 + ";" + worked5600 + ";"
+ worked10G;
chatMemberSerialization += callSign + ";" + name + ";" + qra + ";" + frequency + "; wkd " + worked + "; wkd144 " + worked144
+ "; wkd432" + worked432 + "; wkd1240" + worked1240 + "; wkd2300" + worked2300 + "; wkd3400" + worked3400 + "; wkd5600" + worked5600 + "; wkd10G"
+ worked10G + " ; " + chatCategory;
return chatMemberSerialization;
}

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@ package kst4contest.model;
import java.util.ArrayList;
public class UpdateInformation {
double latestVersionNumberOnServer = 100; //dummy value to prevent nullpointerexc
double latestVersionNumberOnServer = 1.26; //dummy value to prevent nullpointerexc
String adminMessage ="";
String majorChanges ="";
String latestVersionPathOnWebserver="";

View File

@@ -0,0 +1,131 @@
package kst4contest.test;
import javafx.beans.property.SimpleStringProperty;
import kst4contest.controller.Utils4KST;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class PatternMatcherTest {
/**
* Tests if pattern matches with the given String.
*
* @param testString
* @param regExPattern
* @return true if match, else false
*/
private static boolean testPattern(String testString, String regExPattern) {
Pattern pattern = Pattern.compile(regExPattern);
Matcher matcher = pattern.matcher(testString);
return matcher.find();
}
/**
* Normalizes a chatmembers frequency-string for cluster usage<br/>
* <b>returns a frequency String in KHz like = "144300" or "144300.0" to match DXC protocol needs</b>
*
* @param optionalPrefix: if there is a value like ".300", it have to be decided, wich ".300": 144.300, 432.300, 1296.300 .... prefix means for example "144."
*/
private static String normalizeFrequencyString(String qrgString, String optionalPrefix) {
// final String PTRN_QRG_CAT2 = "(([0-9]{3,4}[\\.|,| ]?[0-9]{3})([\\.|,][\\d]{1,2})?)|(([a-zA-Z][0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)|((\\b[0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)";
final String PTRN_QRG_CAT2_wholeQRGMHz4Digits = "(([0-9]{4}[\\.|,| ]?[0-9]{3})([\\.|,][\\d]{1,2})?)"; //1296.300.3 etc
final String PTRN_QRG_CAT2_wholeQRGMHz3Digits = "(([0-9]{3}[\\.|,| ]?[0-9]{3})([\\.][\\d]{1,2})?)"; //144.300.3 etc
final String PTRN_QRG_CAT2_QRGwithoutPrefix = "((\\b[0-4]{1}[\\d]{2}\\b)([\\.|,][\\d]{1,2}\\b)?)"; //144.300.3 etc
String predefinedPrefixInMHz = optionalPrefix;
String stringAggregation = "";
if (testPattern(qrgString, PTRN_QRG_CAT2_wholeQRGMHz4Digits)) {
System.out.print("yep: ");
stringAggregation = qrgString;
stringAggregation = stringAggregation.replace(".","");
stringAggregation = stringAggregation.replace(",","");
if (stringAggregation.length() == 8) {
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length()-1) + "." + stringAggregation.substring(stringAggregation.length()-1, stringAggregation.length());
stringAggregation = stringAggregationNew;
} else if (stringAggregation.length() == 9) {
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length()-2) + "." + stringAggregation.substring(stringAggregation.length()-2, stringAggregation.length());
stringAggregation = stringAggregationNew;
}
} else
if (testPattern(qrgString, PTRN_QRG_CAT2_wholeQRGMHz3Digits)) {
System.out.print("yep: ");
stringAggregation = qrgString;
stringAggregation = stringAggregation.replace(".","");
stringAggregation = stringAggregation.replace(",","");
if (stringAggregation.length() == 7) {
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length()-1) + "." + stringAggregation.substring(stringAggregation.length()-1, stringAggregation.length());
stringAggregation = stringAggregationNew;
} else if (stringAggregation.length() == 8) {
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length()-2) + "." + stringAggregation.substring(stringAggregation.length()-2, stringAggregation.length());
stringAggregation = stringAggregationNew;
}
}
else
if (testPattern(qrgString, PTRN_QRG_CAT2_QRGwithoutPrefix)) { //case ".050 or .300 or something like that"
System.out.print("yep: ");
stringAggregation = qrgString;
stringAggregation = stringAggregation.replace(".", "");
stringAggregation = stringAggregation.replace(",", "");
if (stringAggregation.length() == 3) { // like 050 or 300
String stringAggregationNew = optionalPrefix + stringAggregation;
stringAggregation = stringAggregationNew;
return stringAggregation;
} else if (stringAggregation.length() == 4) { //like 050.2 --> 0502
stringAggregation = optionalPrefix + stringAggregation;
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length() - 1) + "." + stringAggregation.substring(stringAggregation.length() - 1, stringAggregation.length());
stringAggregation = stringAggregationNew;
return stringAggregation;
} else if (stringAggregation.length() == 5) { //like 050.20 --> 05020
stringAggregation = optionalPrefix + stringAggregation;
String stringAggregationNew = stringAggregation.substring(0, stringAggregation.length() - 2) + "." + stringAggregation.substring(stringAggregation.length() - 2, stringAggregation.length());
stringAggregation = stringAggregationNew;
return stringAggregation;
}
}
return qrgString;
}
public static void main(String[] args) {
int i = 0;
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("144.775", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("144.300.2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("144,300.2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("144300.2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("144300,2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("144.300", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("144.300.20", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("300", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString(".300", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString(".300.2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString(".300.20", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("1296.300", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("1296,300", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("1296.300.2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("1296.300.20", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("1296,300,2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("1296,300,20", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("1296.300,2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("1296,300.2", new SimpleStringProperty("144")));
System.out.println(i++ + ": " + Utils4KST.normalizeFrequencyString("q305", new SimpleStringProperty("144")));
}
}

View File

@@ -4,9 +4,12 @@ import kst4contest.controller.ChatController;
import kst4contest.model.ChatMember;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class GuiUtils {
private static final String PTRN_CALLSIGNSYNTAX = "^(?:[A-Z]{1,2}[0-9]|[0-9][A-Z])[0-9A-Z]{1,3}$";
/**
* Checks wheter the input value of the String is numeric or not, true if yes
* TODO: Move to a utils class for checking input values by user...
@@ -17,6 +20,27 @@ public class GuiUtils {
return str != null && str.matches("[0-9.]+");
}
/**
* Checks wheter the given String has a HAM radio callsign syntax or not
* @param maybeCallSignValue
* @return true if yes
*/
static boolean isCallSignSyntax(String maybeCallSignValue) {
Pattern pattern = Pattern.compile(PTRN_CALLSIGNSYNTAX, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(maybeCallSignValue);
try {
if (matcher.find()) {
return true;
}
else return false;
} catch (Exception exc) {
return false;
}
}
public static void triggerGUIFilteredChatMemberListChange(ChatController chatController) {

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,154 @@
.button:pressed {
-fx-border-color: #ff0000;
}
.button:hover {
-fx-border-color: #ff7777;
}
.toggle-button:selected {
-fx-background-color:linear-gradient(#f0ff35, #a9ff00),
radial-gradient(center 50% -40%, radius 200%, #b8ee36 45%, #80c800 50%);
-fx-background-radius: 6, 5;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 );
-fx-text-fill: #395306;
}
.text-field {
-fx-prompt-text-fill: black;
}
.text-field .text {
-fx-fill: linear-gradient(from 0% 0% to 100% 200%, green 0%, lightgreen 100%);
-fx-stroke: green;
-fx-stroke-width: 0.2;
-fx-font-size: 25px;
}
.text-input-MYQRG1 {
-fx-text-fill: linear-gradient(from 0% 0% to 100% 200%, orange 0%, red 100%);
-fx-font-weight: 300;
}
.button{
-fx-focus-traversable: false;
}
.button:hover{
-fx-text-fill: linear-gradient(from 0% 0% to 100% 200%, blue 0%, red 100%);
}
.button:hover {
-fx-background-color:linear-gradient(#f0ff35, #a9ff00),
radial-gradient(center 50% -40%, radius 200%, lightblue 45%, orange 50%);
-fx-background-radius: 6, 5;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 );
-fx-text-fill: #395306;
}
.buttonMyQrg1 {
-fx-background-color: linear-gradient(from 0% 0% to 100% 200%, #00ffff 0%, #ff99ff 100%);
-fx-background-radius: 6, 5;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 );
-fx-text-fill: #395306;
}
.toggle-button:selected {
-fx-background-color: linear-gradient(from 0% 0% to 100% 200%, #00ffff 0%, #ff99ff 100%);
-fx-background-radius: 6, 5;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 );
-fx-text-fill: #395306;
}
.table-view .column-header .text {
-fx-fill: linear-gradient(from 0% 0% to 100% 200%, repeat, black 0%, red 50%);
-fx-stroke: black;
-fx-stroke-width: 0.3;
}
.table-view .column-header .label{
-fx-alignment: CENTER_LEFT;
-fx-font-weight: none;
}
.table-row-cell > .defaultText-column {
-fx-text-fill: black;
-fx-background-insets: 0 0 1 0px;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.table-row-cell > .messageToMe-column {
-fx-text-fill: green;
-fx-background-insets: 0 0 1 0px;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlightOwn-column { /*PM own message*/
-fx-background-color: #00ffff;
-fx-background-insets: 0 0 1 0px;
-fx-text-fill: black;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight30-column { /*PM for 30 sec: works*/
-fx-text-fill: black;
-fx-background-color: #33cc33;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight60-column { /*PM for 30 sec: works*/
-fx-text-fill: black;
-fx-background-color: #40bf40;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight90-column { /*PM for 30 sec: works*/
-fx-text-fill: black;
-fx-background-color: #4db34d;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight120-column { /*PM for 30 sec: works*/
-fx-text-fill: black;
-fx-background-color: #59a659;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight180-column { /*PM for 30 sec: works*/
-fx-text-fill: black;
-fx-background-color: #669966;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight300-column { /*PM for 30 sec: works*/
-fx-text-fill: black;
-fx-background-color: #738c73;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.table-cell-bold {
-fx-font-weight: bold;
}
.table-cell-inAngleAndRange {
-fx-text-fill: green;
-fx-font-weight: bold;
}
.table-cell-100PercentAP { /*GEHT*/
-fx-text-fill: linear-gradient(from 0% 0% to 100% 200%, #f98aff 0%, #f98aff 100%); /*purple*/;
-fx-font-weight: bold;
}
.table-cell-75PercentAP { /*GEHT*/
-fx-text-fill: #fa6666;
-fx-font-weight: bold;
}
.table-cell-50PercentAP {
-fx-text-fill: #fa9f66;
-fx-font-weight: bold;
}

View File

@@ -0,0 +1,192 @@
.root {
-fx-accent: #1e74c6;
-fx-focus-color: -fx-accent;
-fx-base: #373e43;
-fx-control-inner-background: derive(-fx-base, 35%);
-fx-control-inner-background-alt: -fx-control-inner-background ;
}
.label{
-fx-text-fill: lightgray;
}
.label-callSignChatCatDescriptor {
-fx-font-family: "Arial";
-fx-font-size: 18px;
-fx-text-fill: linear-gradient(from 0% 0% to 100% 200%, green 0%, lightgreen 100%);
-fx-alignment: center;
}
.text-field {
-fx-prompt-text-fill: gray;
}
.text-field .text {
-fx-fill: linear-gradient(from 0% 0% to 100% 200%, green 0%, lightgreen 100%);
-fx-stroke: green;
-fx-stroke-width: 0.2;
-fx-font-size: 25px;
}
.text-input-MYQRG1 {
-fx-text-fill: linear-gradient(from 0% 0% to 100% 200%, #f98aff 0%, #f98aff 100%); /*purple*/
}
.titulo{
-fx-font-weight: bold;
-fx-font-size: 18px;
}
.button{
-fx-focus-traversable: false;
}
.button:hover{
-fx-text-fill: white;
}
.separator *.line {
-fx-background-color: #3C3C3C;
-fx-border-style: solid;
-fx-border-width: 1px;
}
.scroll-bar{
-fx-background-color: derive(-fx-base,45%)
}
.button:default {
-fx-base: -fx-accent ;
-fx-font-weight: bold;
}
.button:pressed {
-fx-border-color: #ff0000;
}
.button:hover {
-fx-background-color:linear-gradient(#f0ff35, #a9ff00),
radial-gradient(center 50% -40%, radius 200%, #b8ee36 45%, #80c800 50%);
-fx-background-radius: 6, 5;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 );
-fx-text-fill: #395306;
}
.buttonMyQrg1 {
-fx-background-color: linear-gradient(from 0% 0% to 100% 200%, green 0%, lightgreen 100%);
-fx-background-radius: 6, 5;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 );
-fx-text-fill: #395306;
}
.toggle-button:selected {
-fx-background-color:linear-gradient(#f0ff35, #a9ff00),
radial-gradient(center 50% -40%, radius 200%, #b8ee36 45%, #80c800 50%);
-fx-background-radius: 6, 5;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 );
-fx-text-fill: #395306;
}
.table-view .column-header {
-fx-background-color: linear-gradient(to right, #373838, #373838);
}
.table-view .column-header .text {
-fx-fill: linear-gradient(from 0% 0% to 100% 200%, repeat, green 0%, lightgreen 50%);
-fx-stroke: green;
-fx-stroke-width: 0.2;
}
.table-view{
/*-fx-background-color: derive(-fx-base, 10%);*/
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.table-view .column-header .label{
-fx-alignment: CENTER_LEFT;
-fx-font-weight: none;
}
.table-row-cell > .defaultText-column {
-fx-text-fill: white;
-fx-background-insets: 0 0 1 0px;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.table-row-cell > .messageToMe-column {
-fx-text-fill: lightgreen;
-fx-background-insets: 0 0 1 0px;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlightOwn-column { /*PM own message*/
-fx-background-color: #4674b9;
-fx-background-insets: 0 0 1 0px;
-fx-text-fill: white;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight30-column { /*PM for 30 sec: works*/
-fx-text-fill: white;
-fx-background-color: #33cc33;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight60-column { /*PM for 30 sec: works*/
-fx-text-fill: white;
-fx-background-color: #40bf40;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight90-column { /*PM for 30 sec: works*/
-fx-text-fill: white;
-fx-background-color: #4db34d;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight120-column { /*PM for 30 sec: works*/
-fx-text-fill: white;
-fx-background-color: #59a659;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight180-column { /*PM for 30 sec: works*/
-fx-text-fill: white;
-fx-background-color: #669966;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.messageHighlight300-column { /*PM for 30 sec: works*/
-fx-text-fill: white;
-fx-background-color: #738c73;
-fx-selection-bar-non-focused: derive(-fx-base, 50%);
}
.table-cell-bold {
-fx-font-weight: bold;
}
.table-cell-inAngleAndRange {
-fx-text-fill: lightgreen;
-fx-font-weight: bold;
}
.table-cell-100PercentAP { /*GEHT*/
-fx-text-fill: linear-gradient(from 0% 0% to 100% 200%, #f98aff 0%, #f98aff 100%); /*purple*/;
-fx-font-weight: bold;
}
.table-cell-75PercentAP { /*GEHT*/
-fx-text-fill: #fa6666;
-fx-font-weight: bold;
}
.table-cell-50PercentAP {
-fx-text-fill: #fa9f66;
-fx-font-weight: bold;
}

View File

@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<praktiKST>
<station>
<LoginCallSign>DO5AMF</LoginCallSign>
<LoginPassword>changeMe</LoginPassword>
<LoginDisplayedName>KST4Contest</LoginDisplayedName>
<LoginLocator>JO51IJ</LoginLocator>
<ChatCategory>2</ChatCategory>
<stn_antennaBeamWidthDeg>50.0</stn_antennaBeamWidthDeg>
<stn_maxQRBDefault>900.0</stn_maxQRBDefault>
<stn_qtfDefault>135.0</stn_qtfDefault>
<stn_bandActive144>true</stn_bandActive144>
<stn_bandActive432>true</stn_bandActive432>
<stn_bandActive1240>false</stn_bandActive1240>
<stn_bandActive2300>false</stn_bandActive2300>
<stn_bandActive3400>false</stn_bandActive3400>
<stn_bandActive5600>false</stn_bandActive5600>
<stn_bandActive10G>false</stn_bandActive10G>
</station>
<logsynch>
<logsynch_fileBasedWkdCallInterpreterFileNameReadOnly>SimpleLogFile.txt</logsynch_fileBasedWkdCallInterpreterFileNameReadOnly>
<logsynch_storeWorkedCallSignsFileNameUDPMessageBackup>udpReaderBackup.txt</logsynch_storeWorkedCallSignsFileNameUDPMessageBackup>
<logsynch_fileBasedWkdCallInterpreterEnabled>true</logsynch_fileBasedWkdCallInterpreterEnabled>
<logsynch_ucxUDPWkdCallListenerPort>12060</logsynch_ucxUDPWkdCallListenerPort>
<logsynch_ucxUDPWkdCallListenerEnabled>true</logsynch_ucxUDPWkdCallListenerEnabled>
</logsynch>
<trxSynchUCX>
<trxSynch_ucxLogUDPListenerEnabled>true</trxSynch_ucxLogUDPListenerEnabled>
<trxSynch_defaultMYQRGValue>144.374.50</trxSynch_defaultMYQRGValue>
</trxSynchUCX>
<AirScoutQuerier>
<asQry_airScoutCommunicationEnabled>true</asQry_airScoutCommunicationEnabled>
<asQry_airScoutServerName>KST</asQry_airScoutServerName>
<asQry_airScoutClientName>KST</asQry_airScoutClientName>
<asQry_airScoutUDPPort>9872</asQry_airScoutUDPPort>
<asQry_airScoutBandValue>1440000</asQry_airScoutBandValue>
</AirScoutQuerier>
<notifications>
<notify_SimpleAudioNotificationsEnabled>true</notify_SimpleAudioNotificationsEnabled>
<notify_CWCallsignAudioNotificationsEnabled>true</notify_CWCallsignAudioNotificationsEnabled>
<notify_VoiceCallsignAudioNotificationsEnabled>true</notify_VoiceCallsignAudioNotificationsEnabled>
</notifications>
<shortCuts>
<t>Hi OM,</t>
<t>pse</t>
<t>turn</t>
<t>ant</t>
<t>my</t>
<t>dir</t>
<t>sked</t>
<t>ssb</t>
<t>cw</t>
<t>try</t>
<t>agn</t>
<t>nw</t>
<t>qrg</t>
<t>beaming</t>
<t>calling</t>
<t>lsn to</t>
<t>qsb</t>
<t>rpt</t>
<t>nr</t>
<t>ur</t>
<t>I</t>
<t>hear</t>
<t>you</t>
<t>weak</t>
<t>nil, sry</t>
<t>maybe</t>
<t>later</t>
<t>tmw</t>
<t>rrr</t>
<t>tnx</t>
<t>qso</t>
<t>73</t>
<t>?</t>
<t>!</t>
<t>,</t>
<t>/SETNAME MYQRG</t>
<t>MYQRG</t>
</shortCuts>
<textSnippets>
<t>Hi QRZNAME, try sked 2m? Ur QRG?</t>
<t>try? FIRSTAP, pse lsn MYQRGSHORT</t>
<t>maybe we need AP. FIRSTAP SECONDAP</t>
<t>I am calling cq to ur dir, pse lsn to MYLOCATOR at MYQRG</t>
<t>pse ur qrg?</t>
<t>rrr, I move to your qrg nw, pse ant dir MYLOCATOR</t>
<t>Hrd you but many qrm here, pse agn</t>
<t>I turn my ant to you now</t>
<t>Sry, strong qrm by local station, may try MYQRG</t>
<t>Sry, in qso nw, pse qrx, I will meep you</t>
<t>Ur ant my dir MYLOCATOR nw?</t>
<t>QRZNAME pse ant dir MYLOCATORSHORT</t>
<t>No cw op here, pse can we use ssb?</t>
<t>No chance in ssb, can we use cw?</t>
<t>Nil till now, are you calling?</t>
<t>Nil here, tnx try, maybe later!</t>
<t>Nil, I will look for an ap and meep you then</t>
<t>There will be an AP in </t>
<t>Tnx fb qso, all ok, 73 es gl!</t>
</textSnippets>
<beaconCQ>
<beaconCQText>_.~'"´"'~.__.~'´ CQ CQ CQ de MYCALL, pse call us at MYQRG `'~.__.~'"`"'~._</beaconCQText>
<beaconCQIntervalMinutes>5</beaconCQIntervalMinutes>
<beaconCQEnabled>false</beaconCQEnabled>
</beaconCQ>
<beaconUnworkedstations>
<beaconUnworkedstationsText>Hi OM, pse Sked at MYQRG or your QRG</beaconUnworkedstationsText>
<beaconUnworkedstationsIntervalMinutes>20</beaconUnworkedstationsIntervalMinutes>
<beaconUnworkedstationsEnabled>false</beaconUnworkedstationsEnabled>
<beaconUnworkedstationsPrefix>OE</beaconUnworkedstationsPrefix>
</beaconUnworkedstations>
<guiOptions>
<GUIscn_ChatwindowMainSceneSizeHW>748.0;1544.800048828125</GUIscn_ChatwindowMainSceneSizeHW>
<GUIclusterAndQSOMonStage_SceneSizeHW>765.5999755859375;467.20001220703125</GUIclusterAndQSOMonStage_SceneSizeHW>
<GUIstage_updateStage_SceneSizeHW>640.0;480.0</GUIstage_updateStage_SceneSizeHW>
<GUIsettingsStageSceneSizeHW>720.0;768.0</GUIsettingsStageSceneSizeHW>
<GUIselectedCallSignSplitPane_dividerposition>0.5120192307692308</GUIselectedCallSignSplitPane_dividerposition>
<GUImainWindowLeftSplitPane_dividerposition>0.5046632124352332</GUImainWindowLeftSplitPane_dividerposition>
<GUImessageSectionSplitpane_dividerposition>0.5102549889135255;0.5934035476718403;0.6377494456762749</GUImessageSectionSplitpane_dividerposition>
<GUImainWindowRightSplitPane_dividerposition>0.74029933481153</GUImainWindowRightSplitPane_dividerposition>
<GUIpnl_directedMSGWin_dividerpositionDefault>0.09707903525548366</GUIpnl_directedMSGWin_dividerpositionDefault>
</guiOptions>
</praktiKST>

View File

@@ -3,15 +3,18 @@
<station>
<LoginCallSign>DO5AMF</LoginCallSign>
<LoginPassword>changeMe</LoginPassword>
<LoginDisplayedName>KST4Contest</LoginDisplayedName>
<LoginLocator>JO51IJ</LoginLocator>
<LoginDisplayedName>KST4Contest1263</LoginDisplayedName>
<stn_loginNameSecondCat>KST4Contest1263</stn_loginNameSecondCat>
<LoginLocator>JO54ME</LoginLocator>
<ChatCategory>2</ChatCategory>
<stn_antennaBeamWidthDeg>50.0</stn_antennaBeamWidthDeg>
<stn_maxQRBDefault>900.0</stn_maxQRBDefault>
<ChatCategorySecond>3</ChatCategorySecond>
<stn_secondCatEnabled>true</stn_secondCatEnabled>
<stn_antennaBeamWidthDeg>60.0</stn_antennaBeamWidthDeg>
<stn_maxQRBDefault>1333.0</stn_maxQRBDefault>
<stn_qtfDefault>135.0</stn_qtfDefault>
<stn_bandActive144>true</stn_bandActive144>
<stn_bandActive432>true</stn_bandActive432>
<stn_bandActive1240>false</stn_bandActive1240>
<stn_bandActive1240>true</stn_bandActive1240>
<stn_bandActive2300>false</stn_bandActive2300>
<stn_bandActive3400>false</stn_bandActive3400>
<stn_bandActive5600>false</stn_bandActive5600>
@@ -26,11 +29,11 @@
</logsynch>
<trxSynchUCX>
<trxSynch_ucxLogUDPListenerEnabled>true</trxSynch_ucxLogUDPListenerEnabled>
<trxSynch_defaultMYQRGValue>144.374.50</trxSynch_defaultMYQRGValue>
<trxSynch_defaultMYQRGValue>144.123.00</trxSynch_defaultMYQRGValue>
</trxSynchUCX>
<AirScoutQuerier>
<asQry_airScoutCommunicationEnabled>true</asQry_airScoutCommunicationEnabled>
<asQry_airScoutServerName>KST</asQry_airScoutServerName>
<asQry_airScoutServerName>AS</asQry_airScoutServerName>
<asQry_airScoutClientName>KST</asQry_airScoutClientName>
<asQry_airScoutUDPPort>9872</asQry_airScoutUDPPort>
<asQry_airScoutBandValue>1440000</asQry_airScoutBandValue>
@@ -39,13 +42,17 @@
<notify_SimpleAudioNotificationsEnabled>true</notify_SimpleAudioNotificationsEnabled>
<notify_CWCallsignAudioNotificationsEnabled>true</notify_CWCallsignAudioNotificationsEnabled>
<notify_VoiceCallsignAudioNotificationsEnabled>true</notify_VoiceCallsignAudioNotificationsEnabled>
<notify_dxClusterServerEnabled>true</notify_dxClusterServerEnabled>
<notify_DXClusterServerTriggerBearing>false</notify_DXClusterServerTriggerBearing>
<notify_DXClusterServerTriggerOnQRGDetect>false</notify_DXClusterServerTriggerOnQRGDetect>
<notify_dxclusterServerPort>8000</notify_dxclusterServerPort>
<notify_optionalFrequencyPrefix>432</notify_optionalFrequencyPrefix>
<notify_DXCSrv_SpottersCallSign>DO5AMF</notify_DXCSrv_SpottersCallSign>
</notifications>
<shortCuts>
<t>Hi OM,</t>
<t>pse</t>
<t>Hi OM, try Sked? FIRSTAP</t>
<t>TNX qso, 73!</t>
<t>turn</t>
<t>ant</t>
<t>my</t>
<t>dir</t>
<t>sked</t>
<t>ssb</t>
@@ -78,6 +85,7 @@
<t>,</t>
<t>/SETNAME MYQRG</t>
<t>MYQRG</t>
<t>SECONDQRG</t>
</shortCuts>
<textSnippets>
<t>Hi QRZNAME, try sked 2m? Ur QRG?</t>
@@ -101,9 +109,12 @@
<t>Tnx fb qso, all ok, 73 es gl!</t>
</textSnippets>
<beaconCQ>
<beaconCQText>_.~'"´"'~.__.~'´ CQ CQ CQ de MYCALL, pse call us at MYQRG `'~.__.~'"`"'~._</beaconCQText>
<beaconCQIntervalMinutes>5</beaconCQIntervalMinutes>
<beaconCQText>_.~'"´"'~.__.~'´ CQ CQ CQ NAC de MYCALL, pse try 144.317 for JO54 `'~.__.~'"`"'~._</beaconCQText>
<beaconCQIntervalMinutes>1</beaconCQIntervalMinutes>
<beaconCQEnabled>false</beaconCQEnabled>
<beaconCQTextSecondText>_.~'"´"'~.__.~'´ CQ CQ CQ de MYCALL, pse sked or SECONDQRG `'~.__.~'"`"'~._</beaconCQTextSecondText>
<beaconCQIntervalMinutesSecondCat>3</beaconCQIntervalMinutesSecondCat>
<beaconCQEnabledSecondCat>false</beaconCQEnabledSecondCat>
</beaconCQ>
<beaconUnworkedstations>
<beaconUnworkedstationsText>Hi OM, pse Sked at MYQRG or your QRG</beaconUnworkedstationsText>
@@ -111,15 +122,28 @@
<beaconUnworkedstationsEnabled>false</beaconUnworkedstationsEnabled>
<beaconUnworkedstationsPrefix>OE</beaconUnworkedstationsPrefix>
</beaconUnworkedstations>
<messageHandling>
<autoAnswerText>Hi, sry I am not qrv, just testing new features of KST4Contest 1.25</autoAnswerText>
<autoAnswerEnabled>false</autoAnswerEnabled>
<autoAnswerTextSecondCat>Hi, sry I am not qrv, just testing new features of KST4Contest 1.251</autoAnswerTextSecondCat>
<autoAnswerEnabledSecondCat>false</autoAnswerEnabledSecondCat>
<autoAnswerToQrgRequestEnabled>true</autoAnswerToQrgRequestEnabled>
</messageHandling>
<guiSaveableOptions>
<guiOptions_defaultFilterNothing>false</guiOptions_defaultFilterNothing>
<guiOptions_defaultFilterPmToMe>true</guiOptions_defaultFilterPmToMe>
<guiOptions_defaultFilterPmToOther>false</guiOptions_defaultFilterPmToOther>
<guiOptions_defaultFilterPublicMsgs>false</guiOptions_defaultFilterPublicMsgs>
</guiSaveableOptions>
<guiOptions>
<GUIscn_ChatwindowMainSceneSizeHW>748.0;1544.800048828125</GUIscn_ChatwindowMainSceneSizeHW>
<GUIclusterAndQSOMonStage_SceneSizeHW>765.5999755859375;467.20001220703125</GUIclusterAndQSOMonStage_SceneSizeHW>
<GUIscn_ChatwindowMainSceneSizeHW>1080.800048828125;2048.0</GUIscn_ChatwindowMainSceneSizeHW>
<GUIclusterAndQSOMonStage_SceneSizeHW>1196.800048828125;259.20001220703125</GUIclusterAndQSOMonStage_SceneSizeHW>
<GUIstage_updateStage_SceneSizeHW>640.0;480.0</GUIstage_updateStage_SceneSizeHW>
<GUIsettingsStageSceneSizeHW>720.0;768.0</GUIsettingsStageSceneSizeHW>
<GUIselectedCallSignSplitPane_dividerposition>0.5120192307692308</GUIselectedCallSignSplitPane_dividerposition>
<GUImainWindowLeftSplitPane_dividerposition>0.5046632124352332</GUImainWindowLeftSplitPane_dividerposition>
<GUImessageSectionSplitpane_dividerposition>0.5102549889135255;0.5934035476718403;0.6377494456762749</GUImessageSectionSplitpane_dividerposition>
<GUImainWindowRightSplitPane_dividerposition>0.74029933481153</GUImainWindowRightSplitPane_dividerposition>
<GUIpnl_directedMSGWin_dividerpositionDefault>0.09707903525548366</GUIpnl_directedMSGWin_dividerpositionDefault>
<GUIselectedCallSignSplitPane_dividerposition>0.5154494382022472</GUIselectedCallSignSplitPane_dividerposition>
<GUImainWindowLeftSplitPane_dividerposition>0.45846364347146207</GUImainWindowLeftSplitPane_dividerposition>
<GUImessageSectionSplitpane_dividerposition>0.5284522003034902;0.5853566009104704;0.6157056145675266</GUImessageSectionSplitpane_dividerposition>
<GUImainWindowRightSplitPane_dividerposition>0.5749241274658573</GUImainWindowRightSplitPane_dividerposition>
<GUIpnl_directedMSGWin_dividerpositionDefault>0.1754658301944221</GUIpnl_directedMSGWin_dividerpositionDefault>
</guiOptions>
</praktiKST>
</praktiKST>