locked
Spec Explorer Scenario inputSpeed RRS feed

  • Question

  • hi 

    I want write scenario for InputSpeed in cord file ,

    if Engine on then go state (s2) , if Engine off return to state (s1), if there is speed still loop transaction on state (s2)

    How I can add behavior in this way " From S2 via S2 Speed" ?

     

    thanks

     

    Wednesday, July 20, 2011 2:07 AM

Answers

  • Maybe here is answer to Your question:
    config EngineConfig
    {
     action abstract static void Engine.On();
     action abstract static void Engine.Off();
     action abstract static void Engine.Speed(int level);
    }
    
    machine OnOffRunScenario(): EngineConfig
    {
     (On;Speed(_)*;Off)*
    }
    

    Monday, August 8, 2011 5:32 PM

All replies

  • Hi, Salam,

    I am not very clear about your question, especially for the transitions between states.

    What is the action/transition between S0 and S1 / S0 and S2 ? Do you mean there are actions related to "turn on engine" and "turn off engine"?

    And the speed will change accordingly?

    Thanks,

    Xiang

    Wednesday, July 20, 2011 2:45 AM
    Moderator
  • Maybe here is answer to Your question:
    config EngineConfig
    {
     action abstract static void Engine.On();
     action abstract static void Engine.Off();
     action abstract static void Engine.Speed(int level);
    }
    
    machine OnOffRunScenario(): EngineConfig
    {
     (On;Speed(_)*;Off)*
    }
    

    Monday, August 8, 2011 5:32 PM