Class PressureCondition
java.lang.Object
neqsim.process.logic.condition.PressureCondition
- All Implemented Interfaces:
LogicCondition
Condition that checks if pressure meets a specified criteria.
Supports comparison operators: >, >=, <, <=, ==, !=
Example usage:
// Check if pressure is above 5 bara PressureCondition minPressure = new PressureCondition(stream, 5.0, ">"); // Check if pressure is stable at 10 bara (within tolerance) PressureCondition stable = new PressureCondition(stream, 10.0, "==", 0.5);
- Version:
- 1.0
- Author:
- ESOL
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPressureCondition(ProcessEquipmentInterface equipment, double setpoint, String operator) Creates a pressure condition with default tolerance (0.1 bara).PressureCondition(ProcessEquipmentInterface equipment, double setpoint, String operator, double tolerance) Creates a pressure condition with specified tolerance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate()Evaluates if the condition is currently met.Gets the current value being evaluated (for diagnostics).Gets a description of this condition.Gets the expected/setpoint value (for diagnostics).private doubleGets the target equipment this condition monitors (if any).
-
Field Details
-
equipment
-
setpoint
private final double setpoint -
operator
-
tolerance
private final double tolerance
-
-
Constructor Details
-
PressureCondition
Creates a pressure condition with default tolerance (0.1 bara).- Parameters:
equipment- equipment with stream to checksetpoint- pressure setpoint in baraoperator- comparison operator (>, >=, <, <=, ==, !=)
-
PressureCondition
public PressureCondition(ProcessEquipmentInterface equipment, double setpoint, String operator, double tolerance) Creates a pressure condition with specified tolerance.- Parameters:
equipment- equipment with stream to checksetpoint- pressure setpoint in baraoperator- comparison operator (>, >=, <, <=, ==, !=)tolerance- tolerance for equality checks (bara)
-
-
Method Details
-
evaluate
public boolean evaluate()Description copied from interface:LogicConditionEvaluates if the condition is currently met.- Specified by:
evaluatein interfaceLogicCondition- Returns:
- true if condition is satisfied, false otherwise
-
getPressure
private double getPressure() -
getDescription
Description copied from interface:LogicConditionGets a description of this condition.- Specified by:
getDescriptionin interfaceLogicCondition- Returns:
- human-readable description
-
getTargetEquipment
Description copied from interface:LogicConditionGets the target equipment this condition monitors (if any).- Specified by:
getTargetEquipmentin interfaceLogicCondition- Returns:
- target equipment, or null if not equipment-specific
-
getCurrentValue
Description copied from interface:LogicConditionGets the current value being evaluated (for diagnostics).- Specified by:
getCurrentValuein interfaceLogicCondition- Returns:
- current value as string, or empty if not applicable
-
getExpectedValue
Description copied from interface:LogicConditionGets the expected/setpoint value (for diagnostics).- Specified by:
getExpectedValuein interfaceLogicCondition- Returns:
- expected value as string, or empty if not applicable
-