Page MenuHomePhabricator

Controlled initialization of EventMapper and StateMachines
Closed, ResolvedPublic

Description

At the moment StateMachines and EventMapper are initialized on demand by calling mitk::GlobalInteraction::StandardInteractionSetup();

The application should initialize the Interaction, since depending on the application there a different possibilities how the StateMachine description could be loaded, eg in Qt as a Qt resource file.

Event Timeline

see T2279 for the code location where state machines could be loaded from qt resources during application startup.

see T440 for a patch for initialization by string.

please update bug settings when working on it

[SVN revision 19503]
FIX (#2413): GlobalInteraction, its StateMachineFactory and EventMapper are now initialized via an Activator and a compiled-in XML string. See T2413 for details.

[SVN revision 19524]
FIX (#2413): Remove Global state machine setter/getter in event mapper, because it is now a member of GlobalInteraction.

[SVN revision 19525]
FIX (#2413): Correctly call GlobalInteraction::GetInstance

[SVN revision 19526]
FIX (#2413): Remove obsolete security check

[SVN revision 19527]
FIX (#2413): Documentation and code cleanup

[SVN revision 19555]
FIX (#2413): Only delete elements in destructor that are really created

[SVN revision 19556]
FIX (#2413): Initialize GlobalInteraction with default values for testing

[SVN revision 19557]
FIX (#2413): Combined Initialize() methods to a single one. Can be used with an empty string, a file name with path, or the actual XML content as string.

[SVN revision 19561]
COMP (#2413): Adapt tests to new GlobalInteraction initialization routine

[SVN revision 19562]
COMP (#2413): Adapt tests to new GlobalInteraction initialization routine

[SVN revision 19563]
COMP (#2413): Adapt tests to new GlobalInteraction initialization routine

[SVN revision 19663]
FIX (#2413): Move mitkEventAndActionConstants.xml to same folder as StateMachine.xml to make StateMachineEditor work again.

[SVN revision 19680]
FIX (#2413): Move mitkEventAndActionConstants.xml to same folder as StateMachine.xml to make StateMachineEditor work again.

Marked as assigned again.
There are still some issues, mainly with the tutorial.

Copied Change Request to Wiki page.

[SVN revision 19733]
FIX (#2413): Changed order of initialization, because if GlobalInteraction is not already initialized, it will now be in QmitkRegisterClasses

[SVN revision 19734]
FIX (#2413): If GlobalInteraction is not already initialized, do it here. (Needed for tutorial)

[SVN revision 19735]
COMP (#2413): Moved IsInitialized method from private to public

[SVN revision 19736]
FIX (#2413): Removed double call of itksys::SystemTools in EventMapper; STYLE: removed unused header files

GlobalInteraction is now initialized in QmitkRegisterClasses() function if it is not already. For the main application, this function is called, too, in the CommonActivator, but GlobalInteraction is initialized earlier.

Closing this bug; Initialization working so far.
Follow-Up see T2840