CapeUnitBaseValidate Method

Validates the unit operation.

Definition

Namespace: CapeOpen
Assembly: CapeOpen (in CapeOpen.dll) Version: 1.0.0.0 (1.0.0.0)
public override 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.

Implements

ICapeUnitValidate(String)

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.

The base-class implementation of this method traverses the port and parameter collections and calls the Validate(String) method of each member. The unit is valid if all port and parameters are valid, which is signified by the Validate method returning true.

Exceptions

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

See Also