ICapeUnitValidate Method

Validate the unit operation to verify that the parameters and ports are all valid. If invalid, this method returns a message indicating the reason that the unit is invalid.

Definition

Namespace: CapeOpen
Assembly: CapeOpen (in CapeOpen.dll) Version: 1.0.0.0 (1.0.0.0)
[DispIdAttribute(4)]
bool Validate(
	ref string message
)

Parameters

message  String
Reference to a string that will conain a message regarding the validation of the parameter.

Return Value

Boolean

true, if the unit is valid.

false, if the unit is not valid.

Remarks

Sets the flag that indicates whether the Flowsheet Unit is valid by validating the ports and parameters of the Flowsheet Unit. For example, this method could check that all mandatory ports have connections and that the values of all parameters are within bounds.

Note that the Simulation Executive can call the Validate routine at any time, in particular it may be called before the executive is ready to call the Calculate method. This means that Material Objects connected to unit ports may not be correctly configured when Validate is called. The recommended approach is for this method to validate parameters and ports but not Material Object configuration. A second level of validation to check Material Objects can be implemented as part of Calculate, when it is reasonable to expect that the Material Objects connected to ports will be correctly configured.

Exceptions

ECapeUnknownThe error to be raised when other error(s), specified for this operation, are not suitable.
ECapeBadCOParameterECapeBadCOParameter
ECapeBadInvOrderECapeBadInvOrder

See Also