[Qt-interest] unable to use more than 1 transition added to a state (QT StateMachine Framework)
Mandeep Sandhu
mandeepsandhu.chd at gmail.com
Thu Mar 18 14:12:49 CET 2010
> For example, in other cases you may need to check that the SM is not in either
> of 1 or more child states. In this case it would be worth making your guarded
> transition class check that the SM is not in any state of a list of supplied
> child states. This way you could reuse it for many such situations. In other
> cases you may need to check more complicated combinations of states, this
> would then require another specialised class that inherits from
> QAbstractTransition.
Yes, I just need to make sure I construct my SM such there's aren't
too many states in this "ignore" list! :) Otherwise probably my HSM
design is at fault.
>
> It is down to you to decide the best way to abstract the commonality between
> such guarded transitions into a reasonable set of transition classes. We have
> some pretty complex SMs that we use to control hardware with many
> interdependent subsystems and we have found it necessary to write a handful of
> specialised guarded transitions. It is not an onerous task since you only have
> to override one or two functions and it brings a great deal of power with it.
I too am trying to abstract out the behavior of a particular h/w into this SM.
>
>> Or should the HSM be constructed in a different way so that such hacks
>> are not needed?
>
> It is not a hack, this is a legitimate way of implementing guarded
> transitions. If it still feels like a hack then you should examine the
> possibility of refactoring your SM structure. But only you have the domain-
> specific knowledge to do so in your particular case.
Thanks for your inputs Sean.
Regards,
-mandeep
>
> Cheers,
>
> Sean
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list