Class FireDetector

All Implemented Interfaces:
Serializable, MeasurementDeviceInterface, NamedInterface

public class FireDetector extends MeasurementDeviceBaseClass
Fire Detector instrument for fire detection and alarm systems.

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 Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • fireDetected

      private boolean fireDetected
      Indicates if fire is currently detected.
    • detectionThreshold

      private double detectionThreshold
      Detection threshold (0.0 to 1.0, where 1.0 means fire confirmed).
    • detectionDelay

      private double detectionDelay
      Detection delay in seconds (time to confirm fire before alarm).
    • signalLevel

      private double signalLevel
      Current signal level (simulates IR/UV sensor reading).
    • location

      private String location
      Detector location/zone identifier.
  • Constructor Details

    • FireDetector

      public FireDetector(String name)
      Constructor for FireDetector.
      Parameters:
      name - name of fire detector
    • FireDetector

      public FireDetector(String name, String location)
      Constructor for FireDetector with location.
      Parameters:
      name - name of fire detector
      location - location or zone where detector is installed
  • 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

      public void setLocation(String location)
      Sets the detector location.
      Parameters:
      location - location or zone identifier
    • getLocation

      public String getLocation()
      Gets the detector location.
      Returns:
      location or zone identifier
    • 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

      public double getMeasuredValue(String unit)
      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:
      getMeasuredValue in interface MeasurementDeviceInterface
      Overrides:
      getMeasuredValue in class MeasurementDeviceBaseClass
      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:
      displayResult in interface MeasurementDeviceInterface
      Overrides:
      displayResult in class MeasurementDeviceBaseClass
    • toString

      public String toString()
      Gets a string representation of the fire detector state.
      Overrides:
      toString in class Object
      Returns:
      string describing detector state