Posting non-error messages to the PME

Discusses CAPE-OPEN specific middleware and corresponding development kit

Moderator: jasper

Post Reply
User avatar
desyk
Posts: 4
Joined: 12 March 2025, 09:43
Location: U.K. / Greece

Posting non-error messages to the PME

Post by desyk »

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.
User avatar
jasper
Posts: 1143
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Posting non-error messages to the PME

Post by jasper »

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:

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);
		}
	}
Post Reply

Return to “CAPE-OPEN Binary Interop Architecture”