mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2025-05-09 16:17:23 +00:00
Add notify command
Add notify command to try to debug notification handling. Send udp command notify with a single integer parameter, e.g. notify 16
This commit is contained in:
parent
dfadf25b5e
commit
3dbbdfbe8f
@ -30,6 +30,7 @@ public abstract class CommandManager extends PamControlledUnit {
|
||||
commandsList.add(new StartCommand());
|
||||
commandsList.add(new StopCommand());
|
||||
commandsList.add(new PingCommand());
|
||||
commandsList.add(new NotifyCommand());
|
||||
commandsList.add(new StatusCommand());
|
||||
commandsList.add(new SummaryCommand());
|
||||
commandsList.add(new SummaryPeekCommand());
|
||||
|
47
src/PamController/command/NotifyCommand.java
Normal file
47
src/PamController/command/NotifyCommand.java
Normal file
@ -0,0 +1,47 @@
|
||||
package PamController.command;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import PamController.PamController;
|
||||
|
||||
public class NotifyCommand extends ExtCommand {
|
||||
|
||||
public NotifyCommand() {
|
||||
super("notify", false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getHint() {
|
||||
return "Send an integer notification method to PamController";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String execute(String command) {
|
||||
String[] commandWords = CommandManager.splitCommandLine(command);
|
||||
if (commandWords.length < 2) {
|
||||
return "Notify command requires one parameter";
|
||||
}
|
||||
String pStr = commandWords[1];
|
||||
int pInt = 0;
|
||||
try {
|
||||
pInt = Integer.valueOf(pStr);
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
return String.format("Command \"%s\" is not a valid parameter for the notiry command", pStr);
|
||||
}
|
||||
final int pInt2 = pInt;
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PamController.getInstance().notifyModelChanged(pInt2);
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -169,7 +169,7 @@ public class DataMapControl extends PamControlledUnit implements PamSettings {
|
||||
getDataMapGUI().createDataGraphs();
|
||||
dataMapPanel.repaintAll();
|
||||
}
|
||||
break;
|
||||
// break;
|
||||
case PamControllerInterface.OFFLINE_DATA_LOADED:
|
||||
dataMapPanel.repaintAll();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user