Specifications
3-14 Creating an Extension
3-14
Once the preliminary definition information is provided, you
specify the variables that the object owns and that is visible to
the user. These variables are of the following types:
Numeric Variables and Text Variables may or may not be
persistent. If they are, their values are stored when the
Simulation Case containing the extension is saved.
Implement the Required Interfaces
To create an extension in C++, you must create a class that
implements the required interfaces. For example, an Extension
Unit Operation must implement the ExtensionObject interface
and the ExtensionUnitOperation interface. This calculation can
be done through inheritance or aggregation. HYSYS functions if
either approach is taken, as long as the interfaces are supported
through the COM QueryInterface mechanism.
To implement an extension, you must provide code for the
standard COM IUnknown methods (AddRef, Release,
QueryInterface), as well as any methods required by the
interfaces you are supporting. Other methods may return
E_NOTIMPL if you choose not to implement them.
Variable Type Description
Numeric • Represent numerical quantities and have a
Variable Type that allows HYSYS to manage Unit
Conversions for the user.
• May have zero, one, or two dimensions.
• Can also trigger the steady state solver when
they are changed. If this is the case, the variable
operates like other HYSYS variables in that the
solver performs consistency checking when
values are changed.
Text • Represents a string.
• May be zero- or one-dimensional.
Message Usually associated with buttons in a property view.
Messages are sent through the VariableChanged
method of an extension.
For more information on
the View Editor see
Chapter 4 - Extension
View Editor.