Component properties configuration from *.pcf file

Hello,

i am a little bit confused about a way how the components
are configured by a XML configuration file.

A tried to solve the controller exercise ( 7 )
from Peter, where a application.cpf should read
the properties of controller component from
controller.cpf . The application.cpf already
defines properties of controller component:


...


AND the controller.cpf defines also the same properties of
the same component.

The offered solution is to use

Controller.cpf
inside the Controller properties definition in application.cpf which would cause redefinition of all previous defined Controller properties. It is right ?

It is not better to define just required controller property

Property Kp;

in controller.cpf and use in application.cpf just "update property" ?

controller.cpf

-vitali

Component properties configuration from *.pcf file

vitali wrote:
Hello,

i am a little bit confused about a way how the components are configured by a XML configuration file.

A tried to solve the controller exercise ( 7 ) from Peter, where a application.cpf should read the properties of controller component from controller.cpf . The application.cpf already defines properties of controller component:

<struct name="Controller" type="UseCase::Controller">
...
</struct>
AND the controller.cpf defines also the same properties of the same component.

Sorry for the confusion 'controller.cpf' is in this exercise not the same as 'Controller.cpf' (with capital C). controller.cpf is used to start the application with just one component: UseCase::Controller. The Controller.cpf file (check out the solution) contains the real properties (Kp).

vitali wrote:

The offered solution is to use

 <simple name="PropertyFile" type="string"> <value>Controller.cpf</value></simple>
inside the Controller properties definition in application.cpf which would cause redefinition of all previous defined Controller properties. It is right ?

It is not better to define just required controller property

    Property<double> Kp;
in controller.cpf and use in application.cpf just "update property" ?
<simple name="UpdateProperties" type="string"><value>controller.cpf</value></simple>
-vitali

So that must be 'Controller.cpf'. I'll rename the 'controller.cpf' in the example to something more meaningful.

Also check the Deployment Component Manual http://www.orocos.org/stable/documentation/ocl/v1.6.x/doc-xml/ocl-overview.html

Thanks for the feedback, Peter

Btw,the Exercise in the

Btw,

the Exercise in the application.cpf

is already solved ! :)

vitali

Btw,the Exercise in the

On Friday 30 January 2009 19:11:21 vitali [..] ... wrote:
> Btw,
>
> the Exercise in the application.cpf
>
> &#10;&gt;   &lt;!-- This OCL component can be used to log data port values to files.&#10;&gt;              Exercise: The reporting component is setup allright to log&#10;&gt;             the data flow ports of the Plant and the Automatic Component.&#10;&gt;        Extend it such that it also logs the values of Joystick.&#10;&gt;   --&gt;&#10;&gt;&#10;&gt;
>
> is already solved ! :)

It isn't. 'Joystick' is a peer of the Reporter, but the reporter does not yet
log the ports of it. You need to edit the deployment/logging/log-plant.cpf
file in order to actually have the ports in the log file.

Peter

Component properties configuration from *.pcf file

Hello,

sspr wrote:

Sorry for the confusion 'controller.cpf' is in this exercise not the same as 'Controller.cpf' (with capital C).
controller.cpf is used to start the application with just one component: UseCase::Controller. The Controller.cpf file (check out the solution) contains the real properties (Kp).

but there is no Controller.cpf (with capital C) in the solution present, an it leads me ( maybe ) to assume, that [[cC]ontroller.cpf IS the file what i have to use.

Just for clarifying:

According to "Deployment Component Manual":

Quote:

The PropertyFile section specifies from which XML file each component is configured and must contain values for all properties of the component. In case you only want to update part of the properties, use the UpdateProperties element. The properties are read during the configureComponents() step of the DeploymentComponent.

What does "properties of component" means ? Are they all members of component, such as activity, ports, peers or just only the Property members declared in this particular component class?

vitali

Component properties configuration from *.pcf file

On Friday 30 January 2009 18:36:53 vitali [..] ... wrote:
> Hello,
>
>

sspr wrote:

>
> Sorry for the confusion 'controller.cpf' is in this exercise not the same
> as 'Controller.cpf' (with capital C). controller.cpf is used to start the
> application with just one component: UseCase::Controller. The
> Controller.cpf file (check out the solution) contains the real properties
> (Kp).

>
> but there is no Controller.cpf (with capital C) in the solution present, an
> it leads me ( maybe ) to assume, that [[cC]ontroller.cpf IS the file what i
> have to use.

I'll add Controller.cpf to the solution and remove the controller.cpf and
plant.cpf files from the exercise in order to avoid future confusion.

>
> Just for clarifying:
>
> According to "Deployment Component Manual":
>
>

Quote:

> The PropertyFile section specifies from which XML file each component is
> configured and must contain values for all properties of the component. In
> case you only want to update part of the properties, use the
> UpdateProperties element. The properties are read during the
> configureComponents() step of the DeploymentComponent.

>
> What does "properties of component" means ? Are they all members of
> component, such as activity, ports, peers or just only the Property<X>
> members declared by this particular component class?

The latter. Only the Property<X> elements of a component. The other 'members'
are only interpreted by the DeploymentComponent, they instruct the DC how to
configure this specific component.

Peter