Package alarm.actions
Class AlarmAction
java.lang.Object
alarm.actions.AlarmAction
- Direct Known Subclasses:
AlarmSerialAction
,AlarmUDPAction
,PlaySound
,SendEmailAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
protected AlarmControl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
actOnAlarm
(AlarmDataUnit alarmDataUnit) Act on the alarm - called every time the data unit is updated.abstract int
canDo()
Alarm action can complete (i.e.protected String
createAlarmString
(AlarmDataUnit alarmDataUnit) Create the alarm string according to standard pgxxx/v2.34.700abstract String
abstract boolean
boolean
Called when PAMGuard initialises to prepare any alarm actions, e.g.abstract boolean
setSettings
(Window window) Open an action specific dialog to configure the action
-
Field Details
-
Constructor Details
-
Method Details
-
getActionName
- Returns:
- the name of the alarm action
-
hasSettings
public abstract boolean hasSettings()- Returns:
- true if the action has configurable settings
-
setSettings
Open an action specific dialog to configure the action- Parameters:
window
- parent window- Returns:
- true if settings changed.
-
actOnAlarm
Act on the alarm - called every time the data unit is updated.- Parameters:
alarmDataUnit
- alarm data unit that has changed.- Returns:
- true if action completed ok
-
canDo
public abstract int canDo()Alarm action can complete (i.e. some tests have been conducted)- Returns:
- 0 = no, 1 = yes, -1 = don't know.
-
prepareAction
public boolean prepareAction()Called when PAMGuard initialises to prepare any alarm actions, e.g. open a serial port, find a file, etc.- Returns:
- true if preparation completed Ok.
-
createAlarmString
Create the alarm string according to standard pgxxx/v2.34.700- Parameters:
alarmDataUnit
-- Returns:
- a string to write to the serial port.
-