Package PamController.command
Class CommandManager
java.lang.Object
PamController.PamControlledUnit
PamController.command.CommandManager
- All Implemented Interfaces:
SettingsNameProvider
- Direct Known Subclasses:
MulticastController
,NetworkController
,TerminalController
Interpret commands which may have come either from a terminal or from a Network
(e.g. UDP) interface.
- Author:
- dg50
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindCommand
(String command) static String
getCommandFromIndex
(String command, int index) Get the command string left from the given index.boolean
interpretCommand
(String commandString) Interpret and act on a udp command string.abstract boolean
sendData
(ExtCommand extCommand, String dataString) Reply to data called from InterpredDatastatic String[]
splitCommandLine
(String command) Slightly nasty split since some module names will be in quotes if they are names with spaces so the split needs to a) take out multiple words surrounded by "" and then split what's left by word.Methods inherited from class PamController.PamControlledUnit
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addPamProcess, addRelatedMenuItems, canClose, canPlayViewerSound, createDetectionMenu, createDisplayMenu, createFileMenu, createHelpMenu, flushDataBlockBuffers, getBackupInformation, getFrameNumber, getGUI, getGuiFrame, getInstanceIndex, getModuleStatus, getModuleStatusManager, getModuleSummary, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineState, getOfflineTaskGroup, getPamConfiguration, getPamController, getPamModuleInfo, getPamProcess, getPamView, getPlugin, getShortUnitType, getSidePanel, getTabClipCopier, getTabPanel, getTabSpecificMenuBar, getToolbarComponent, getUnitName, getUnitType, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, notifyModelChanged, pamClose, pamHasStopped, pamToStart, playViewerSound, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setModuleStatusManager, setPamConfiguration, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setToolbarComponent, setupControlledUnit, stopViewerSound, tellModule, terminalPrint, terminalPrintln, toString
-
Constructor Details
-
CommandManager
-
-
Method Details
-
findCommand
-
interpretCommand
Interpret and act on a udp command string.- Parameters:
command
- command string- Returns:
- false if the command was to exit the program (in which case this thread will exit and close the port). True otherwise.
-
splitCommandLine
Slightly nasty split since some module names will be in quotes if they are names with spaces so the split needs to a) take out multiple words surrounded by "" and then split what's left by word. Or split by work and rejoin anything with "" ?- Parameters:
command
-- Returns:
-
getCommandFromIndex
Get the command string left from the given index. This can be used to get everything left in the string that follows the command name, module type and module name fields for example.- Parameters:
command
- full command stringindex
- how many items to skip- Returns:
- remainder of the string, warts n all.
-
sendData
Reply to data called from InterpredData- Parameters:
extCommand
-dataString
-- Returns:
- true if replay successful
-