Hello all,
Is it possible to post non-error messages to the PME using COBIA (e.g. warnings/info)? If so, are there any examples on how to do so available? I am aware of the Simulation Context Interface, which includes the LogMessage and PopUpMessage functions, and I have also checked out the ThermoClientPMETest example from the COBIA source code, but I have not figured out how to properly use it yet. Any advice would be appreciated.
Posting non-error messages to the PME
Moderator: jasper
Re: Posting non-error messages to the PME
Any PME that supports this (mostly all) will set the simulation context.
There, you can query for the ICapeDiagnostics interface. Make that a class member.
Then, use LogMessage from the ICapeDiagnostics.
Example:
There, you can query for the ICapeDiagnostics interface. Make that a class member.
Then, use LogMessage from the ICapeDiagnostics.
Example:
Code: Select all
CAPEOPEN_1_2::CapeDiagnostic diagnostic;
void putSimulationContext(/*in*/ CAPEOPEN_1_2::CapeSimulationContext context) {
diagnostic=context; //may not be implemented
}
void LogMessage(CapeStringImpl &messsage) {
if (diagnostic) {
diagnostic.LogMessage(messsage);
}
}