96 views
in GUI Development by
Hi, EW team:

     I have defined a normal profile for code generation, and another profile for simulation. When normal profile is used, the root APP is composed of a group Application. When simulation, the root APP is derived to variant APPSimulation, which is composed of Application and SimulationPanel. In order to enable communication between Application and SimulationPanel, I managed to make the root object available. But when I tried to reference SimulationPanel by APPSimulation.SimulationPanel, the studio told me that the definition of the class APPSimulation is unknow.

   The profile simulation works because both Application and SimulationPanel are visible in APPSimulation, which as a variant takes the place of APP. But the class APPSimulation is illegal seen from the studio!

   This is really confusing. I don't know if there is other way to do this work. Please help me.

 

Best regards.

Stephen

1 Answer

0 votes
by
 
Best answer

Hello Stephen,

if I understood your application case correctly, you have create a variant of a component APP. This variant contains an embedded object and you want to access this embedded object when accessing the original component APP. In such case, the interface of APP is determined by APP itself. New members added in variants (e.g. the object) are not found in the original component APP. Therefore they are not accessible. You can imagine, the variants may also be activated/deactivated at the runtime. Exposing members existing in derived variants would expect a modification of the original component's interface.

If it is necessary to acess the members defined in a variant, add a method to the original component ( e.g. GetMyObject()). In the original component the method returns null since there is no object found. In the derived variant, override the method and return the object.

I hope it helps you further.

Best regards

Paul Banach

by
Hi, Paul:
     The problem can be walked around by using Device autoobject.
     Thank you for answering.

Best regards
Stephen

Embedded Wizard Website | Privacy Policy | Imprint

...