Page MenuHomePhabricator

Merge two versions of Statemachine XML
Closed, ResolvedPublic

Description

There are currently two different versions of StateMachine.xml.

  • mitk\Core\Code\Interactions
  • mitk\CoreUI\Bundles\org.mitk.gui.qt.common\resources

As far as I checked, the only difference between these two versions (dispite some minor 'formation-beautifications') is that the CoreUI one offers the Statemachine necessary for using the PlanarFigureInteractor.

It seems that normally MITK uses this Statemachine and everything works fine. However, my external application uses the wrong version.

The big question is:

Does it make sense to have two StateMachine.xml that are almost completely identical?

Event Timeline

(In reply to comment #0)

Does it make sense to have two StateMachine.xml that are almost completely
identical?

No, that is surely an implementation error. I thought that the changes during 3M3 development were meant to solve the StateMachine.xml issue for once?

How is state machine loading currently meant to work? Ingmar, do you know what was done during 3M3 development and what the results are?

(unsetting flag request, there is no change request linked and the bug does not mention a concrete change plan)

The idea was to put the responsibilty for loading the state machine on the application developer so he could use whatever mechanism the application framework (e.g. Qt) offers. IIRC the second version of the file was necessary for running the testdriver. Could you check if this is correct? It shouldn't be very difficult to resolve this, I can build some CMake stuff for this.

Tobi S. has worked on a T2413. Due to testing, the xml-file had to be moved. The xml-file in the old directory (interaction) should have been removed and replaced by a softlink. That was oniginally the plan.

If I remeber it right, there were problems with

  • the Tutorial
  • the Statemachine Editor

so we had to copy it as a quick solution.
Not really sure what problems exactly.

Which XML file do you want to delete? Your change request is not completely clear on this point (it sounds like you want to remove the core version).

How are Non-BlueBerry applications supposed to define their state machines (e.g. tutorial steps)? Could you point to some documentation on this issue?

Ah, right, that was the problem, thanks Daniel:
in MTIK, Statemachines are initialized via \source\mitk\CoreUI\Bundles\org.mitk.gui.qt.common\src\internal\QmitkCommonActivator.cpp

This is BlueBerry-based and not available for the tutorial, and also Qt based and not available for command line testing.

Therefor, 3 different ways to load StateMachines exist:

  1. Load from /Core/Code/Interaction/Statemachine.xml (done by Tests)
  2. Load from file (filename given) (done by tutorial ?)
  3. Load from Qt resource (done by MITK via activator)

Anyway, some of the code looks quite stupid.

The activator and the loading mechanism via Qt resources was necessary for 3M3 to use a compiled-in version of Statemachine.xml

reassigning to Marco as he wanted to do some Cmake magic

It starts to be tedious to have two statemachine.xml... Could you create something like a softlink to one statemachine.xml? Greetz

Ok, I will fix this as soon as I have proper VPN access. Which version is the reference one? From the comments I guess it's the one in Core/Interactions, so I will leave this one and replace the other one with a symbolic link.

I have made my changes to both, but the one in Code/Interactions has a few more patterns (MiddleLClickScroll) i think by Markus E. I have already send a comment in the corresponding bug, but no answer... Should be ok to use Code/Interaction.

THANK YOU! ;)

Resetting all bugs without active assignee flag to "CONFIRMED". Change status to IN_PROGRESS if you are working on it.

OK, as this bug has not been touched in quite a long time but causes problems once again, I'll reassign it to Andreas.

This should be fixed soon as the two version have now diverged once again causing strange behaviour...

Assigned bug to Christian since he will clean up the state machine stuff

After Christian Weber worked much on the interaction framework, we now have StateMachine.xml compiled in as ressource and most conflicts are solved.

Regarding some remaining conflicts, I could resolve the following list:

  • PressMoveReleaseWithCTRLInversionAllMouseMoves:
    • is only used from some Tool class, i.e. only from mitkWorkbench Whoever changed this file, must have worked with the Qt version ==> take code from QtStateMachine.xml
  • PointSetInteractor:
    • is mostly used from within mitkWorkbench Probably the Qt version is more up to date ==> take code from QtStateMachine.xml
  • a list of Interactors by Markus Engel (Mint):
    • alternativePan
    • alternativeScroll
    • Pan
    • LeftClickLevelWindow
    • LevelWindow
    • BinaryImageInteractor These are used by mitkWorkbench, but are known to be broken, seemingly not many people use the "PACS like interaction". ==> ignore the Qt version of StateMachine.xml ==> before merging this bug, update the remaining StateMachine.xml to get properly working "PACS like interaction"

To completely remove the duplicate version of StateMachine.xml, I removed the respective code from org_mitk_gui_qt_application_Activator.cpp

New remote branch pushed: bug-3701-merge-statemachines

(In reply to comment #16)

  • a list of Interactors by Markus Engel (Mint):
    • alternativePan
    • alternativeScroll
    • Pan
    • LeftClickLevelWindow
    • LevelWindow
    • BinaryImageInteractor These are used by mitkWorkbench, but are known to be broken, seemingly not many people use the "PACS like interaction". ==> ignore the Qt version of StateMachine.xml ==> before merging this bug, update the remaining StateMachine.xml to get properly working "PACS like interaction"

Most of this feature actually works right now. Mint will move to the new interactors soon and as part of that clean up the remaining "old-stlye" interactors

[340bd0]: Merge branch 'bug-3701-merge-statemachines'

Merged commits:

2013-02-11 18:02:28 Daniel Maleike [3e18cb]
Removing the Qt-only version of StateMachine.xml


2013-02-11 18:00:30 Daniel Maleike [385629]
Using Qt Version of StateMachine.xml, because this is the mostly used version

PointSetInteractor is almost only used within mitkWorkbench, so this
version should have less errors


2013-02-11 17:59:41 Daniel Maleike [7bbe3f]
Merging StateMachine.xml versions with the probable newer version

Fixing application behavior will follow


2013-02-11 17:56:44 Daniel Maleike [684b75]
Using Qt version of StateMachine, because this relates to mitk::Tool

... and people have been using this with Qt only for a couple of years

[d29064]: COMP: Merge branch 'bug-3701-merge-statemachines'

Merged commits:

2013-02-12 10:35:30 Daniel Maleike [df1f5f]
Deactivating failing test until fixed

Ok, there was a unit test failing after my merge. It was testing some PointSet interactor and its behavior. So actually the core version of this interactor was more recent and matching the implemented test. I'll go with this version then.

[fd9bfe]: Merge branch 'bug-3701-merge-statemachines'

Merged commits:

2013-02-12 10:52:44 Daniel Maleike [a3f837]
Revert "Using Qt Version of StateMachine.xml, because this is the mostly used version"

This reverts commit 3856293691e5a518048757d0fd4a6e466d83e51a.


2013-02-12 10:37:30 Daniel Maleike [19e07b]
Revert "Deactivating failing test until fixed"

This reverts commit df1f5f8f4fa1418b0ce46cab21161b6430dd8ed5.