0
down vote
favorite
I'm beginner in qtstate machine and I'm trying to convert a state machine that is created using switch case, how would I model the state machine to the qt state machine. For example I have a state machine like the following

Qt Code:
  1. switch (state)
  2. {
  3. case ZL_ZL_RINSINGCUP_UP:
  4. if(!GSet.defaultCleaningCup_LTC)
  5. {
  6. wtim=0;
  7. emit stateChanged(state=ZL_RINSE,resStat);
  8. break;
  9. }
  10. if(Fp.LidClose()||Global::UL>USERLEVEL_6){
  11. if(wtim)
  12. {
  13. mot.Up(); // dont move when custom cup is used!
  14. wtim=0;
  15. }
  16. else
  17. {
  18. if((!mot.isDown() && !mot.inMove())){
  19. emit stateChanged(state=ZL_RINSE,resStat);
  20. }
  21. }
  22. }
  23. else
  24. {
  25. if(!wtim){ //lid opened
  26. mot.Stop();
  27. wtim=1;
  28. }
  29. }
  30. break;
  31. case ZL_RINSE: // GUI
  32. break;
  33. }
To copy to clipboard, switch view to plain text mode