The FW4SPL architecture provides a dynamic management of configurations to allow the use of multiple objects and services.
The xml configuration for an application is defines with the extension fwServices::registry::AppConfig
.
1 <
extension implements=
"::fwServices::registry::AppConfig">
4 <
param name=
"appName" default=
"my Application" />
5 <
param name=
"appIconPath" />
7 <
desc>
Image Viewer</
desc>
10 <
object type=
"::fwData::Composite">
18 <
service uid=
"myFrame" impl=
"::gui::frame::SDefaultFrame">
21 <
name>${
appName}</
name>
22 <
icon>${
appIconPath}</
icon>
23 <
minSize width=
"800" height=
"600" />
28 <
view sid=
"myRendering" />
33 <
object uid=
"myImageUid" type=
"::fwData::Image">
39 <
service uid=
"myReaderPathFile" impl=
"::ioVTK::SImageReader">
40 <
file>./
TutoData/
patient1.vtk</
file>
47 <
service uid=
"myRendering" impl=
"::vtkSimpleNegato::SRenderer" />
56 <
start uid=
"myFrame" />
57 <
start uid=
"myReaderPathFile" />
58 <
start uid=
"myRendering" />
65 <
update uid=
"myReaderPathFile" />
66 <
update uid=
"myRendering" />
- id: it is the configuration identifier
- parameters (optional): it defines the list of the parameters used by the configuration
- param: defines a parameter
- name: parameter name, used as "${paramName}" in the configuration. It will be replaced by the string defined by the service, activity or application that launchs the configuration.
- default(optional): default value for the parameter, it is used if the value is not given by the config launcher.
- desc (optional): it is the description of the application
- config: it defines the services and objects to launch
- object: it defines an object of the AppConfig. We usually use a fwData::Composite in order to add sub-objects. An object can defines a list of services. Some object object can have a specific configuration : fwData::TransformationMatrix3D, fwData::Float, fwData::List, ...
- uid (optional): unique identifier of the object (fwTools::fwID). If it is not defined, it will be automatically generated.
- type: object type (ex: fwData::Image, fwData::Composite)
- src (optional, "new" by default): defines if the object should be created ("new") or if it already exists in the application ("ref"). In the last case, the uid must be the same as the first declaration of this object (with "new").
- service: it represents a service working on the object. Some services needs a specific configuration, it is usually described in the doxygen of the method configuring().
- uid (optional): unique identifier of the service. If it is not defined, it will be automatically generated.
- impl: service implementation
- type (optional): service type (ex: fwGui::IFrameSrv)
- autoConnect (optional, "no" by default): defines if the service listen the signals of the working object
- worker (optional): allows to run the service in another worker (see fwThread::Worker)
- matrix (optional): it works only for fwData::TransformationMatrix3D objects. It defines the value of the matrix.
1 <
object uid=
"matrix" type=
"::fwData::TransformationMatrix3D">
1 <
object type=
"::fwData::Integer">
- item (optional): it defines a sub-object of a composite. It can only be used if the parent object is a fwData::Composite.
- key: key of the object in the composite
- object: the 'item' tag can only contain 'object' tags that represents the composite sub-object
2 <
object uid=
"myImageUid" type=
"::fwData::Image" />
1 <
object type=
"::fwData::TransferFunction">
3 <
step color=
"#ff0000ff" value=
"1" />
4 <
step color=
"#ffff00ff" value=
"500" />
5 <
step color=
"#00ff00ff" value=
"1000" />
6 <
step color=
"#00ffffff" value=
"1500" />
7 <
step color=
"#0000ffff" value=
"2000" />
8 <
step color=
"#000000ff" value=
"4000" />
- connect (optional): allows to connect a signal to one or more slot(s). The signal and slots must be compatible.
2 <
signal>
object_uid/
signal_name</
signal>
3 <
slot>
service_uid/
slot_name</
slot>
- proxy (optional): allows to connect one or more signal(s) to one or more slot(s). The signals and slots must be compatible.
- channel: name of the channel use for the proxy.
1 <
proxy channel=
"myChannel">
2 <
signal>
object_uid/
signal_name</
signal>
3 <
slot>
service_uid/
slot_name</
slot>
- start: defines the service to start when the AppConfig is launched. The services will be automatically stopped in the reverse order when the AppConfig is stopped.
1 <
start uid=
"service_uid" />
- update: defines the service to update when the AppConfig is launched.
1 <
update uid=
"service_uid" />
The FW4SPL architecture provides a dynamic management of configurations to allow the use of multiple objects and services.
The xml configuration for an application is defines with the extension fwServices::registry::AppConfig
.
1 <
extension implements=
"::fwServices::registry::AppConfig">
4 <
param name=
"appName" default=
"my Application" />
5 <
param name=
"appIconPath" />
7 <
desc>
Image Viewer</
desc>
10 <
object uid=
"myImage" type=
"::fwData::Image" />
18 <
service uid=
"myFrame" type=
"::gui::frame::SDefaultFrame">
21 <
name>${
appName}</
name>
22 <
icon>${
appIconPath}</
icon>
23 <
minSize width=
"800" height=
"600" />
28 <
view sid=
"myRendering" />
37 <
service uid=
"myReaderPathFile" type=
"::ioVTK::SImageReader">
38 <
inout key=
"target" uid=
"myImage" />
39 <
file>./
TutoData/
patient1.vtk</
file>
46 <
service uid=
"myRendering" type=
"::vtkSimpleNegato::SRenderer">
47 <
in key=
"image" uid=
"myImage" />
55 <
start uid=
"myFrame" />
56 <
start uid=
"myReaderPathFile" />
57 <
start uid=
"myRendering" />
64 <
update uid=
"myReaderPathFile" />
65 <
update uid=
"myRendering" />
Definition
Parameters
- id: it is the configuration identifier
- parameters (optional): it defines the list of the parameters used by the configuration
- param: defines a parameter
- name: parameter name, used as "${paramName}" in the configuration. It will be replaced by the string defined by the service, activity or application that launchs the configuration.
- default(optional): default value for the parameter, it is used if the value is not given by the config launcher.
- desc (optional): it is the description of the application
- config: it defines the services and objects to launch
Object
- object: it defines an object of the AppConfig.
- uid (optional): unique identifier of the object (fwTools::fwID). If it is not defined, it will be automatically generated.
- type: object type (ex: fwData::Image, fwData::Mesh)
- src (optional, "new" by default, values: "new", "ref", "deferred"):
- "new" : defines that the object should be created
- "ref" : defines that the object already exists in the application. The uid must be the same as the first declaration of this object (with "new").
- "deferred" : defines that the object will be created later (by a service).
Some objects can have a specific configuration :
1 <
object uid=
"matrix" type=
"::fwData::TransformationMatrix3D">
1 <
object type=
"::fwData::Integer">
1 <
object type=
"::fwData::TransferFunction">
3 <
step color=
"#ff0000ff" value=
"1" />
4 <
step color=
"#ffff00ff" value=
"500" />
5 <
step color=
"#00ff00ff" value=
"1000" />
6 <
step color=
"#00ffffff" value=
"1500" />
7 <
step color=
"#0000ffff" value=
"2000" />
8 <
step color=
"#000000ff" value=
"4000" />
- item (optional): it defines a sub-object of a composite or a field of any other object.
- key: key of the object
- object: the 'item' tag can only contain 'object' tags that represents the sub-object
2 <
object uid=
"myImageUid" type=
"::fwData::Image" />
Service
- service: it represents a service working on the object. Services list the data the use and how they access them. Some services needs a specific configuration, it is usually described in the doxygen of the method configuring().
- uid (optional): unique identifier of the service. If it is not defined, it will be automatically generated.
- type: service type (ex: ioVTK::SImageReader)
- autoConnect (optional, "no" by default): defines if the service listen the signals of the working objects
- worker (optional): allows to run the service in another worker (see fwThread::Worker)
1 <
service uid=
"mesher" type=
"::opMesh::SMesher">
2 <
in key=
"image" uid=
"imageId" />
3 <
out key=
"mesh" uid=
"meshId" />
- in : input object, it is const and cannot be modified
- inout : input object that can be modified
- out : output object, it must be created by the service and registered with the 'setOutput(key, obj)' method. The output object must be declared as "deferred" in the <object> declaration.
- key: Object key used to retreive the object into the service
- uid: Uid of the object declared in the <object> tag
- optional(optional, default "no", values: "yes" or "no") If "yes", the service can be started even if the object is not present. The output objects are always optional.
::fwData::Image::csptr image = this->getInput< ::fwData::Image >("image");
::fwData::Mesh::sptr mesh = ::fwData::Mesh::New();
this->setOutput("mesh", mesh);
- connect (optional): allows to connect one or more signal(s) to one or more slot(s). The signals and slots must be compatible.
- channel (optional): name of the channel use for the connections.
1 <
connect channel=
"myChannel">
2 <
signal>
object_uid/
signal_name</
signal>
3 <
slot>
service_uid/
slot_name</
slot>
- start: defines the service to start when the AppConfig is launched. The services will be automatically stopped in the reverse order when the AppConfig is stopped.
1 <
start uid=
"service_uid" />
The service using "deferred" object as input will be automatically started when the object is created.
- update: defines the service to update when the AppConfig is launched.
1 <
update uid=
"service_uid" />