Class ProcessEvent
java.lang.Object
neqsim.process.util.event.ProcessEvent
- All Implemented Interfaces:
Serializable
Represents an event in the process simulation.
Events can represent state changes, alarms, threshold crossings, or any significant occurrence that external systems may want to react to.
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEvent types.static enumEvent severity levels. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Stringprivate static final longprivate final ProcessEvent.Severityprivate final Stringprivate final Instantprivate final ProcessEvent.EventType -
Constructor Summary
ConstructorsConstructorDescriptionProcessEvent(String eventId, ProcessEvent.EventType type, String source, String description, ProcessEvent.Severity severity) Creates a process event. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProcessEventCreates an alarm event.private static StringGets the description.Gets the event ID.Gets all properties.getProperty(String key) Gets a property value.<T> TgetProperty(String key, Class<T> type) Gets a typed property value.Gets the severity.Gets the source name.Gets the event timestamp.getType()Gets the event type.static ProcessEventCreates an info event.static ProcessEventmodelDeviation(String source, String variable, double measured, double predicted) Creates a model deviation event.setProperty(String key, Object value) Sets a custom property on the event.static ProcessEventthresholdCrossed(String source, String variable, double value, double threshold, boolean above) Creates a threshold crossed event.toString()static ProcessEventCreates a warning event.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
eventId
-
type
-
source
-
timestamp
-
description
-
properties
-
severity
-
-
Constructor Details
-
ProcessEvent
public ProcessEvent(String eventId, ProcessEvent.EventType type, String source, String description, ProcessEvent.Severity severity) Creates a process event.- Parameters:
eventId- unique event identifiertype- event typesource- source equipment/component namedescription- human-readable descriptionseverity- event severity
-
-
Method Details
-
info
Creates an info event.- Parameters:
source- source namedescription- description- Returns:
- info event
-
warning
Creates a warning event.- Parameters:
source- source namedescription- description- Returns:
- warning event
-
alarm
Creates an alarm event.- Parameters:
source- source namedescription- description- Returns:
- alarm event
-
thresholdCrossed
public static ProcessEvent thresholdCrossed(String source, String variable, double value, double threshold, boolean above) Creates a threshold crossed event.- Parameters:
source- source namevariable- variable namevalue- current valuethreshold- threshold valueabove- true if crossed above threshold- Returns:
- threshold event
-
modelDeviation
public static ProcessEvent modelDeviation(String source, String variable, double measured, double predicted) Creates a model deviation event.- Parameters:
source- source namevariable- variable namemeasured- measured valuepredicted- predicted value- Returns:
- deviation event
-
generateId
-
setProperty
Sets a custom property on the event.- Parameters:
key- property keyvalue- property value- Returns:
- this event for chaining
-
getProperty
-
getProperty
-
getEventId
-
getType
-
getSource
-
getTimestamp
-
getDescription
-
getSeverity
-
getProperties
-
toString
-