Specifications
Extensibility 3-63
3-63
9. While the Initialize and Execute methods are required for the
implementation of the unit operation extension, it is strongly
recommended you also include a Status Query method that
accurately assesses how the extension is performing.
hyContainer.SolveComplete
This line prevents a second Calculation
pass, because it is not required. See the
comment associated with the If Not
Forgetting Then line of code at the
beginning of the code. Read the section
on the SolveComplete method in
Extending HYSYS Help file for more
information.
CalcError(0) = False
CalcError(1) = False
End If
Reset error flags.
ErrorTrap:
Line to which the On Error statement
branches if an error occurs.
End Sub
Signifies the end of the sub-routine. This
line does not need to be added.
Code Explanation
Code Explanation
Public Sub StatusQuery(hyStatus As ObjectStatus)
The StatusQuery sub-routine of the
extension is used to display appropriate
messages on the extension property view
(EDF file) in HYSYS. This sub-routine is
called whenever some change is made to
the extension, whether it is a result of a
solver pass or user interaction.
Dim OK As Boolean
OK = True
Declare and initialize the OK flag.
If WaterPresent = False Then
Call
hyStatus.AddStatusCondition(slMissingRequire
dInformation, 1, "Water is Required as a
Component")
OK = False
End If
If there is no water present in the fluid
package, an error message appears
telling you water is required.
If hyFeedStrm Is Nothing Then
Call
hyStatus.AddStatusCondition(slMissingRequire
dInformation, 2, "Feed Stream Required")
OK = False
End If
If there is no feed stream attached to the
unit op, an error message appears telling
you that a feed stream is required.