Class ValvePositionCondition

java.lang.Object
neqsim.process.logic.condition.ValvePositionCondition
All Implemented Interfaces:
LogicCondition

public class ValvePositionCondition extends Object implements LogicCondition
Condition that checks valve position/opening percentage.

Supports comparison operators: >, >=, <, <=, ==, !=

Example usage:

// Check if valve is closed (less than 5% open)
ValvePositionCondition closed = new ValvePositionCondition(valve, "<", 5.0);

// Check if valve is fully open
ValvePositionCondition open = new ValvePositionCondition(valve, ">", 95.0);
Version:
1.0
Author:
ESOL
  • Field Details

    • valve

      private final ValveInterface valve
    • setpoint

      private final double setpoint
    • operator

      private final String operator
    • tolerance

      private final double tolerance
  • Constructor Details

    • ValvePositionCondition

      public ValvePositionCondition(ValveInterface valve, String operator, double setpoint)
      Creates a valve position condition with default tolerance (1.0%).
      Parameters:
      valve - valve to check
      operator - comparison operator (>, >=, <, <=, ==, !=)
      setpoint - position setpoint (0-100%)
    • ValvePositionCondition

      public ValvePositionCondition(ValveInterface valve, String operator, double setpoint, double tolerance)
      Creates a valve position condition with specified tolerance.
      Parameters:
      valve - valve to check
      operator - comparison operator (>, >=, <, <=, ==, !=)
      setpoint - position setpoint (0-100%)
      tolerance - tolerance for equality checks (%)
  • Method Details

    • evaluate

      public boolean evaluate()
      Description copied from interface: LogicCondition
      Evaluates if the condition is currently met.
      Specified by:
      evaluate in interface LogicCondition
      Returns:
      true if condition is satisfied, false otherwise
    • getDescription

      public String getDescription()
      Description copied from interface: LogicCondition
      Gets a description of this condition.
      Specified by:
      getDescription in interface LogicCondition
      Returns:
      human-readable description
    • getTargetEquipment

      public ProcessEquipmentInterface getTargetEquipment()
      Description copied from interface: LogicCondition
      Gets the target equipment this condition monitors (if any).
      Specified by:
      getTargetEquipment in interface LogicCondition
      Returns:
      target equipment, or null if not equipment-specific
    • getCurrentValue

      public String getCurrentValue()
      Description copied from interface: LogicCondition
      Gets the current value being evaluated (for diagnostics).
      Specified by:
      getCurrentValue in interface LogicCondition
      Returns:
      current value as string, or empty if not applicable
    • getExpectedValue

      public String getExpectedValue()
      Description copied from interface: LogicCondition
      Gets the expected/setpoint value (for diagnostics).
      Specified by:
      getExpectedValue in interface LogicCondition
      Returns:
      expected value as string, or empty if not applicable