Class FireDetector
- All Implemented Interfaces:
Serializable, MeasurementDeviceInterface, NamedInterface
A fire detector is a binary sensor that detects the presence of fire. It can be used in emergency shutdown (ESD) systems where multiple fire detectors may need to activate before triggering an ESD response (voting logic).
Key features:
- Binary state: fire detected (active) or no fire detected (inactive)
- Can be configured with detection threshold and delay
- Measured value: 1.0 when fire detected, 0.0 when no fire
- Supports alarm configuration for logging and escalation
- Reset capability for testing and normal operation restoration
Typical usage in ESD system with voting logic:
// Create fire detectors
FireDetector fireDetector1 = new FireDetector("FD-101");
FireDetector fireDetector2 = new FireDetector("FD-102");
// Configure alarm thresholds
AlarmConfig alarmConfig = AlarmConfig.builder().highLimit(0.5).delay(1.0).unit("binary").build();
fireDetector1.setAlarmConfig(alarmConfig);
fireDetector2.setAlarmConfig(alarmConfig);
// Simulate fire detection
fireDetector1.detectFire();
fireDetector2.detectFire();
// Check detector states
if (fireDetector1.isFireDetected() && fireDetector2.isFireDetected()) {
// Two fire alarms - activate ESD
esdSystem.activate();
}
// After emergency is resolved
fireDetector1.reset();
fireDetector2.reset();
- Version:
- $Id: $Id
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleDetection delay in seconds (time to confirm fire before alarm).private doubleDetection threshold (0.0 to 1.0, where 1.0 means fire confirmed).private booleanIndicates if fire is currently detected.private StringDetector location/zone identifier.private static final longSerialization version UID.private doubleCurrent signal level (simulates IR/UV sensor reading).Fields inherited from class MeasurementDeviceBaseClass
unitFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionFireDetector(String name) Constructor for FireDetector.FireDetector(String name, String location) Constructor for FireDetector with location. -
Method Summary
Modifier and TypeMethodDescriptionvoidSimulates fire detection - activates the detector.voidDisplays the current state of the fire detector.doubleGets the detection delay.doubleGets the detection threshold.Gets the detector location.doubleGets the measured value of the fire detector.doublegetMeasuredValue(String unit) Gets the measured value in the specified unit.doubleGets the current signal level.booleanChecks if fire is currently detected.voidreset()Resets the detector to inactive (no fire detected) state.voidsetDetectionDelay(double delay) Sets the detection delay.voidsetDetectionThreshold(double threshold) Sets the detection threshold.voidsetLocation(String location) Sets the detector location.voidsetSignalLevel(double level) Sets a partial signal level (for testing gradual detection).toString()Gets a string representation of the fire detector state.Methods inherited from class MeasurementDeviceBaseClass
acknowledgeAlarm, applySignalModifiers, doConditionAnalysis, evaluateAlarm, getAlarmConfig, getAlarmState, getConditionAnalysisMaxDeviation, getConditionAnalysisMessage, getDelaySteps, getMaximumValue, getMeasuredPercentValue, getMinimumValue, getNoiseStdDev, getOnlineMeasurementValue, getOnlineSignal, getUnit, isLogging, isOnlineSignal, runConditionAnalysis, setAlarmConfig, setConditionAnalysis, setConditionAnalysisMaxDeviation, setDelaySteps, setIsOnlineSignal, setLogging, setMaximumValue, setMinimumValue, setNoiseStdDev, setOnlineMeasurementValue, setOnlineSignal, setQualityCheckMessage, setRandomSeed, setUnitMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface MeasurementDeviceInterface
equals, getOnlineValue, hashCodeMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagName
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
fireDetected
private boolean fireDetectedIndicates if fire is currently detected. -
detectionThreshold
private double detectionThresholdDetection threshold (0.0 to 1.0, where 1.0 means fire confirmed). -
detectionDelay
private double detectionDelayDetection delay in seconds (time to confirm fire before alarm). -
signalLevel
private double signalLevelCurrent signal level (simulates IR/UV sensor reading). -
location
Detector location/zone identifier.
-
-
Constructor Details
-
FireDetector
Constructor for FireDetector.- Parameters:
name- name of fire detector
-
FireDetector
-
-
Method Details
-
detectFire
public void detectFire()Simulates fire detection - activates the detector.In real applications, this would be triggered by actual sensor readings (IR, UV, heat, smoke). For simulation purposes, this method directly sets the fire detected state.
-
setSignalLevel
public void setSignalLevel(double level) Sets a partial signal level (for testing gradual detection).If signal level exceeds detection threshold, fire is considered detected.
- Parameters:
level- signal level between 0.0 (no fire) and 1.0 (confirmed fire)
-
reset
public void reset()Resets the detector to inactive (no fire detected) state.This simulates detector reset after emergency is resolved or for testing purposes.
-
isFireDetected
public boolean isFireDetected()Checks if fire is currently detected.- Returns:
- true if fire is detected
-
getSignalLevel
public double getSignalLevel()Gets the current signal level.- Returns:
- signal level between 0.0 and 1.0
-
setDetectionThreshold
public void setDetectionThreshold(double threshold) Sets the detection threshold.- Parameters:
threshold- threshold level (0.0 to 1.0) above which fire is confirmed
-
getDetectionThreshold
public double getDetectionThreshold()Gets the detection threshold.- Returns:
- detection threshold level
-
setDetectionDelay
public void setDetectionDelay(double delay) Sets the detection delay.- Parameters:
delay- delay in seconds before confirming fire alarm
-
getDetectionDelay
public double getDetectionDelay()Gets the detection delay.- Returns:
- detection delay in seconds
-
setLocation
Sets the detector location.- Parameters:
location- location or zone identifier
-
getLocation
-
getMeasuredValue
public double getMeasuredValue()Gets the measured value of the fire detector.Returns 1.0 if fire is detected, 0.0 if no fire detected.
- Returns:
- 1.0 if fire detected, 0.0 otherwise
-
getMeasuredValue
Gets the measured value in the specified unit.Fire detector only supports "binary" unit. Returns 1.0 if fire detected, 0.0 otherwise.
- Specified by:
getMeasuredValuein interfaceMeasurementDeviceInterface- Overrides:
getMeasuredValuein classMeasurementDeviceBaseClass- Parameters:
unit- engineering unit (only "binary" or "" supported)- Returns:
- 1.0 if fire detected, 0.0 otherwise
-
displayResult
public void displayResult()Displays the current state of the fire detector.- Specified by:
displayResultin interfaceMeasurementDeviceInterface- Overrides:
displayResultin classMeasurementDeviceBaseClass
-
toString
-