Comments (3)
Hi spachner,
Thanks for pointing it. Yes it’s a bug. I’ll fix it soon.
Thanks,
Nandkishor
from uml-state-machine-in-c.
Hi Stefan,
After analyzing and debugging, I found that it's not a bug. The entry handler is getting called as per the order.
pTarget_State is traversed upward to its parent node in the process of finding the traverse path.
as shown below
// Is Source hierarchy level greater than target level?
else if(pSource_State->Level < pTarget_State->Level)
{
// Traverse the target state to upward,
// Till it matches with source state hierarchy level.
while(pSource_State->Level < pTarget_State->Level)
{
pTarget_Path[index++] = pTarget_State; // Store the target node path.
pTarget_State = pTarget_State->Parent;
}
}
// Now Source & Target are at same hierarchy level.
// Traverse the source & target state to upward, till we find their common parent.
while(pSource_State->Parent != pTarget_State->Parent)
{
EXECUTE_HANDLER(pSource_State->Exit, triggered_to_self, pState_Machine);
pSource_State = pSource_State->Parent; // Move source state to upward state.
pTarget_Path[index++] = pTarget_State; // Store the target node path.
pTarget_State = pTarget_State->Parent; // Move the target state to upward state.
}
pTarget_State is not the final node, it is the first node for the entry traverse.
Thanks,
Nandkishor
from uml-state-machine-in-c.
Hi Nandkishor,
great, thank's for pointing that out. I was missleaded by the variable's name pTarget_State which is actually not the target in this line. I'm am closing the ticket.
regards
spachner
from uml-state-machine-in-c.
Related Issues (12)
- Add cmake support
- Add continuous integration support
- Example for HSM HOT 2
- Compile error in UTC due to anonymous structure of hsm.h
- Help: hierarchical state machine HOT 2
- building for embedded targets HOT 1
- Please give credit to the original source HOT 3
- get remaing time in paused state is wrong
- Demo: Simple state machine
- Remove get remaining time user option
- Add process tick to print process remaining time every second
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uml-state-machine-in-c.