IOxfReactive::TakeEventStatus Controller::Timing_processEvent() {
    IOxfReactive::TakeEventStatus res = eventNotConsumed;
    if(Timing_active == Time)
        {
            if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == Timing_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("13");
                            if(Timing_timeout != NULL)
                                {
                                    Timing_timeout->cancel();
                                    Timing_timeout = NULL;
                                }
                            //#[ state ROOT.On.Timing.Time.(Exit) 
                            Reduce_time();
                            //#]
                            NOTIFY_STATE_EXITED("ROOT.On.Timing.Time");
                            NOTIFY_STATE_ENTERED("ROOT.On.Timing.Time");
                            Timing_subState = Time;
                            Timing_active = Time;
                            Timing_timeout = scheduleTimeout(1000, "ROOT.On.Timing.Time");
                            NOTIFY_TRANSITION_TERMINATED("13");
                            res = eventConsumed;
                        }
                }
            
            
        }
    return res;
}
IOxfReactive::TakeEventStatus Karussell::rootState_processEvent() {
    IOxfReactive::TakeEventStatus res = eventNotConsumed;
    // State idle
    if(rootState_active == idle)
        {
            if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == rootState_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("1");
                            cancel(rootState_timeout);
                            //#[ state idle.(Exit) 
                            dreht = true;  
                            //#]
                            NOTIFY_STATE_EXITED("ROOT.idle");
                            //#[ transition 1 
                            drehen();
                            //#]
                            NOTIFY_STATE_ENTERED("ROOT.idle");
                            rootState_subState = idle;
                            rootState_active = idle;
                            //#[ state idle.(Entry) 
                               dreht = false;
                            //#]
                            rootState_timeout = scheduleTimeout(1000, "ROOT.idle");
                            NOTIFY_TRANSITION_TERMINATED("1");
                            res = eventConsumed;
                        }
                }
            
        }
    return res;
}
void Controller::Timing_entDef() {
    NOTIFY_STATE_ENTERED("ROOT.On.Timing");
    NOTIFY_TRANSITION_STARTED("12");
    NOTIFY_STATE_ENTERED("ROOT.On.Timing.Time");
    Timing_subState = Time;
    Timing_active = Time;
    Timing_timeout = scheduleTimeout(1000, "ROOT.On.Timing.Time");
    NOTIFY_TRANSITION_TERMINATED("12");
}
IOxfReactive::TakeEventStatus Hold::rootState_processEvent() {
    IOxfReactive::TakeEventStatus res = eventNotConsumed;
    switch (rootState_active) {
        case Off:
        {
            if(IS_EVENT_TYPE_OF(ev_Hold_Default_id))
                {
                    NOTIFY_TRANSITION_STARTED("0");
                    NOTIFY_STATE_EXITED("ROOT.Off");
                    NOTIFY_STATE_ENTERED("ROOT.On");
                    rootState_subState = On;
                    rootState_active = On;
                    //#[ state ROOT.On.(Entry) 
                    itsController->GEN(ev_Manual);
                    //#]
                    NOTIFY_TRANSITION_TERMINATED("0");
                    res = eventConsumed;
                }
            
        }
        break;
        case On:
        {
            if(IS_EVENT_TYPE_OF(ev_Hold_Default_id))
                {
                    NOTIFY_TRANSITION_STARTED("2");
                    //#[ state ROOT.On.(Exit) 
                    itsController->GEN(ev_Manual);
                    //#]
                    NOTIFY_STATE_EXITED("ROOT.On");
                    NOTIFY_STATE_ENTERED("ROOT.Off");
                    rootState_subState = Off;
                    rootState_active = Off;
                    NOTIFY_TRANSITION_TERMINATED("2");
                    res = eventConsumed;
                }
            
        }
        break;
        default:
            break;
    }
    return res;
}
void Dosierer::rootState_entDef() {
    {
        NOTIFY_STATE_ENTERED("ROOT");
        NOTIFY_TRANSITION_STARTED("0");
        NOTIFY_STATE_ENTERED("ROOT.Idle");
        rootState_subState = Idle;
        rootState_active = Idle;
        NOTIFY_TRANSITION_TERMINATED("0");
    }
}
void Hold::rootState_entDef() {
    {
        NOTIFY_STATE_ENTERED("ROOT");
        NOTIFY_TRANSITION_STARTED("1");
        NOTIFY_STATE_ENTERED("ROOT.Off");
        rootState_subState = Off;
        rootState_active = Off;
        NOTIFY_TRANSITION_TERMINATED("1");
    }
}
Пример #7
0
void Sensor::rootState_entDef() {
    {
        NOTIFY_STATE_ENTERED("ROOT");
        NOTIFY_TRANSITION_STARTED("4");
        NOTIFY_STATE_ENTERED("ROOT.init");
        rootState_subState = init;
        rootState_active = init;
        NOTIFY_TRANSITION_TERMINATED("4");
    }
}
Пример #8
0
static void rootState_entDef(void * const void_me) {
    
    Admin * const me = (Admin *)void_me;
    {
        NOTIFY_STATE_ENTERED(me, Admin, "ROOT");
        NOTIFY_TRANSITION_STARTED(me, Admin, "0");
        NOTIFY_STATE_ENTERED(me, Admin, "ROOT.WaitForAdminCommands");
        me->rootState_subState = Admin_WaitForAdminCommands;
        me->rootState_active = Admin_WaitForAdminCommands;
        NOTIFY_TRANSITION_TERMINATED(me, Admin, "0");
    }
}
Пример #9
0
static void rootState_entDef(void * const void_me) {
    
    Freight Forwarder * const me = (Freight Forwarder *)void_me;
    {
        NOTIFY_STATE_ENTERED(me, Freight Forwarder, "ROOT");
        NOTIFY_TRANSITION_STARTED(me, Freight Forwarder, "0");
        NOTIFY_STATE_ENTERED(me, Freight Forwarder, "ROOT.WaitForUserCommands");
        me->rootState_subState = Freight Forwarder_WaitForUserCommands;
        me->rootState_active = Freight Forwarder_WaitForUserCommands;
        NOTIFY_TRANSITION_TERMINATED(me, Freight Forwarder, "0");
    }
}
void Karussell::rootState_entDef() {
    {
        NOTIFY_STATE_ENTERED("ROOT");
        NOTIFY_TRANSITION_STARTED("0");
        NOTIFY_STATE_ENTERED("ROOT.idle");
        rootState_subState = idle;
        rootState_active = idle;
        //#[ state idle.(Entry) 
           dreht = false;
        //#]
        rootState_timeout = scheduleTimeout(1000, "ROOT.idle");
        NOTIFY_TRANSITION_TERMINATED("0");
    }
}
void Controller::rootState_entDef() {
    {
        NOTIFY_STATE_ENTERED("ROOT");
        NOTIFY_TRANSITION_STARTED("0");
        NOTIFY_STATE_ENTERED("ROOT.Off");
        rootState_subState = Off;
        rootState_active = Off;
        //#[ state ROOT.Off.(Entry) 
        Reset();
        NS_REDTIME=0;
        NS_ORANGETIME=0;
        NS_GREENTIME=0;
        EW_REDTIME=0;
        EW_ORANGETIME=0;
        EW_GREENTIME=0;
        NS_MSG=" ";
        EW_MSG=" ";
        //#]
        NOTIFY_TRANSITION_TERMINATED("0");
    }
}
void Controller::state_10_entDef() {
    NOTIFY_STATE_ENTERED("ROOT.On.state_10");
    NOTIFY_TRANSITION_STARTED("9");
    NOTIFY_STATE_ENTERED("ROOT.On.state_10.On_000");
    state_10_subState = On_000;
    state_10_active = On_000;
    //#[ state ROOT.On.state_10.On_000.(Entry) 
    if(x==false && y==false && z==false)
    {
    Reset();
    NS_RED=1;
    EW_GREEN=1;
    NS_REDTIME=5;
    EW_GREENTIME=5;
    NS_MSG="  STOP";
    EW_MSG="  GO";
    }
    //#]
    state_10_timeout = scheduleTimeout(5000, "ROOT.On.state_10.On_000");
    NOTIFY_TRANSITION_TERMINATED("9");
}
Пример #13
0
static RiCTakeEventStatus rootState_dispatchEvent(void * const void_me, short id) {
    
    Admin * const me = (Admin *)void_me;
    RiCTakeEventStatus res = eventNotConsumed;
    switch (me->rootState_active) {
        case Admin_WaitForAdminCommands:
        {
            switch (id) {
                case ApplyElectronicKey_ActorPkg_id:
                {
                    NOTIFY_TRANSITION_STARTED(me, Admin, "3");
                    NOTIFY_STATE_EXITED(me, Admin, "ROOT.WaitForAdminCommands");
                    NOTIFY_STATE_ENTERED(me, Admin, "ROOT.sendaction_2");
                    RiCReactive_pushNullConfig(&(me->ric_reactive));
                    me->rootState_subState = Admin_sendaction_2;
                    me->rootState_active = Admin_sendaction_2;
                    {
                        /*#[ state ROOT.sendaction_2.(Entry) */
                        RiCGEN_PORT(me->pUc_Uc1ArmingLogger, evKeyApplied());
                        /*#]*/
                    }
                    NOTIFY_TRANSITION_TERMINATED(me, Admin, "3");
                    res = eventConsumed;
                }
                break;
                case TurnOnDevice_ActorPkg_id:
                {
                    NOTIFY_TRANSITION_STARTED(me, Admin, "1");
                    NOTIFY_STATE_EXITED(me, Admin, "ROOT.WaitForAdminCommands");
                    NOTIFY_STATE_ENTERED(me, Admin, "ROOT.sendaction_1");
                    RiCReactive_pushNullConfig(&(me->ric_reactive));
                    me->rootState_subState = Admin_sendaction_1;
                    me->rootState_active = Admin_sendaction_1;
                    {
                        /*#[ state ROOT.sendaction_1.(Entry) */
                        RiCGEN_PORT(me->pUc_Uc1ArmingLogger, evWakeUpButtonPressed());
                        /*#]*/
                    }
                    NOTIFY_TRANSITION_TERMINATED(me, Admin, "1");
                    res = eventConsumed;
                }
                break;
                default:
                    break;
            }
        }
        break;
        case Admin_sendaction_1:
        {
            if(id == Null_id)
                {
                    NOTIFY_NULL_TRANSITION_STARTED(me, Admin, "2");
                    RiCReactive_popNullConfig(&(me->ric_reactive));
                    NOTIFY_STATE_EXITED(me, Admin, "ROOT.sendaction_1");
                    NOTIFY_STATE_ENTERED(me, Admin, "ROOT.WaitForAdminCommands");
                    me->rootState_subState = Admin_WaitForAdminCommands;
                    me->rootState_active = Admin_WaitForAdminCommands;
                    NOTIFY_TRANSITION_TERMINATED(me, Admin, "2");
                    res = eventConsumed;
                }
        }
        break;
        case Admin_sendaction_2:
        {
            if(id == Null_id)
                {
                    NOTIFY_NULL_TRANSITION_STARTED(me, Admin, "4");
                    RiCReactive_popNullConfig(&(me->ric_reactive));
                    NOTIFY_STATE_EXITED(me, Admin, "ROOT.sendaction_2");
                    NOTIFY_STATE_ENTERED(me, Admin, "ROOT.WaitForAdminCommands");
                    me->rootState_subState = Admin_WaitForAdminCommands;
                    me->rootState_active = Admin_WaitForAdminCommands;
                    NOTIFY_TRANSITION_TERMINATED(me, Admin, "4");
                    res = eventConsumed;
                }
        }
        break;
        default:
            break;
    }
    return res;
}
Пример #14
0
IOxfReactive::TakeEventStatus Sensor::rootState_processEvent() {
    IOxfReactive::TakeEventStatus res = eventNotConsumed;
    switch (rootState_active) {
        // State under
        case under:
        {
            if(IS_EVENT_TYPE_OF(pass_Default_id))
                {
                    //## transition 0 
                    if(value > limit)
                        {
                            NOTIFY_TRANSITION_STARTED("0");
                            NOTIFY_STATE_EXITED("ROOT.under");
                            NOTIFY_STATE_ENTERED("ROOT.over");
                            rootState_subState = over;
                            rootState_active = over;
                            NOTIFY_TRANSITION_TERMINATED("0");
                            res = eventConsumed;
                        }
                }
            
        }
        break;
        // State over
        case over:
        {
            if(IS_EVENT_TYPE_OF(pass_Default_id))
                {
                    //## transition 1 
                    if(value < limit)
                        {
                            NOTIFY_TRANSITION_STARTED("1");
                            NOTIFY_STATE_EXITED("ROOT.over");
                            NOTIFY_STATE_ENTERED("ROOT.under");
                            rootState_subState = under;
                            rootState_active = under;
                            NOTIFY_TRANSITION_TERMINATED("1");
                            res = eventConsumed;
                        }
                }
            
        }
        break;
        // State init
        case init:
        {
            if(IS_EVENT_TYPE_OF(initialize_Default_id))
                {
                    //## transition 2 
                    if(value < limit)
                        {
                            NOTIFY_TRANSITION_STARTED("2");
                            NOTIFY_STATE_EXITED("ROOT.init");
                            NOTIFY_STATE_ENTERED("ROOT.under");
                            rootState_subState = under;
                            rootState_active = under;
                            NOTIFY_TRANSITION_TERMINATED("2");
                            res = eventConsumed;
                        }
                    else
                        {
                            //## transition 3 
                            if(value > limit)
                                {
                                    NOTIFY_TRANSITION_STARTED("3");
                                    NOTIFY_STATE_EXITED("ROOT.init");
                                    NOTIFY_STATE_ENTERED("ROOT.over");
                                    rootState_subState = over;
                                    rootState_active = over;
                                    NOTIFY_TRANSITION_TERMINATED("3");
                                    res = eventConsumed;
                                }
                        }
                }
            
        }
        break;
        default:
            break;
    }
    return res;
}
IOxfReactive::TakeEventStatus Dosierer::rootState_processEvent() {
    IOxfReactive::TakeEventStatus res = eventNotConsumed;
    switch (rootState_active) {
        // State Idle
        case Idle:
        {
            if(IS_EVENT_TYPE_OF(evRun_System_id))
                {
                    NOTIFY_TRANSITION_STARTED("1");
                    NOTIFY_STATE_EXITED("ROOT.Idle");
                    NOTIFY_STATE_ENTERED("ROOT.Running");
                    rootState_subState = Running;
                    rootState_active = Running;
                    //#[ state Running.(Entry) 
                    dosiere();
                    //#]
                    rootState_timeout = scheduleTimeout(100, "ROOT.Running");
                    NOTIFY_TRANSITION_TERMINATED("1");
                    res = eventConsumed;
                }
            
        }
        break;
        // State Running
        case Running:
        {
            if(IS_EVENT_TYPE_OF(evStop_System_id))
                {
                    NOTIFY_TRANSITION_STARTED("2");
                    cancel(rootState_timeout);
                    NOTIFY_STATE_EXITED("ROOT.Running");
                    NOTIFY_STATE_ENTERED("ROOT.Idle");
                    rootState_subState = Idle;
                    rootState_active = Idle;
                    NOTIFY_TRANSITION_TERMINATED("2");
                    res = eventConsumed;
                }
            else if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == rootState_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("3");
                            cancel(rootState_timeout);
                            NOTIFY_STATE_EXITED("ROOT.Running");
                            //#[ transition 3 
                            runde++;
                            //#]
                            NOTIFY_STATE_ENTERED("ROOT.Running");
                            rootState_subState = Running;
                            rootState_active = Running;
                            //#[ state Running.(Entry) 
                            dosiere();
                            //#]
                            rootState_timeout = scheduleTimeout(100, "ROOT.Running");
                            NOTIFY_TRANSITION_TERMINATED("3");
                            res = eventConsumed;
                        }
                }
            
        }
        break;
        default:
            break;
    }
    return res;
}
IOxfReactive::TakeEventStatus Controller::rootState_processEvent() {
    IOxfReactive::TakeEventStatus res = eventNotConsumed;
    switch (rootState_active) {
        case Off:
        {
            if(IS_EVENT_TYPE_OF(ev_Start_Default_id))
                {
                    NOTIFY_TRANSITION_STARTED("1");
                    NOTIFY_STATE_EXITED("ROOT.Off");
                    On_entDef();
                    NOTIFY_TRANSITION_TERMINATED("1");
                    res = eventConsumed;
                }
            
        }
        break;
        case On:
        {
            res = On_processEvent();
        }
        break;
        case Manual_mode:
        {
            if(IS_EVENT_TYPE_OF(ev_Manual_Default_id))
                {
                    NOTIFY_TRANSITION_STARTED("11");
                    //#[ state ROOT.Manual_mode.(Exit) 
                    NS_ORANGE=0;
                    EW_ORANGE=0;
                    //#]
                    NOTIFY_STATE_EXITED("ROOT.Manual_mode");
                    NOTIFY_STATE_ENTERED("ROOT.On");
                    rootState_subState = On;
                    rootState_active = On;
                    Timing_entDef();
                    NOTIFY_STATE_ENTERED("ROOT.On.state_10");
                    state_10_entHist();
                    NOTIFY_TRANSITION_TERMINATED("11");
                    res = eventConsumed;
                }
            
        }
        break;
        case Emerg_ns:
        {
            if(IS_EVENT_TYPE_OF(ev_EmergNS_Default_id))
                {
                    NOTIFY_TRANSITION_STARTED("15");
                    NOTIFY_STATE_EXITED("ROOT.Emerg_ns");
                    NOTIFY_STATE_ENTERED("ROOT.On");
                    rootState_subState = On;
                    rootState_active = On;
                    Timing_entDef();
                    NOTIFY_STATE_ENTERED("ROOT.On.state_10");
                    state_10_entHist();
                    NOTIFY_TRANSITION_TERMINATED("15");
                    res = eventConsumed;
                }
            
        }
        break;
        case Emerg_ew:
        {
            if(IS_EVENT_TYPE_OF(ev_EmergEW_Default_id))
                {
                    NOTIFY_TRANSITION_STARTED("17");
                    NOTIFY_STATE_EXITED("ROOT.Emerg_ew");
                    NOTIFY_STATE_ENTERED("ROOT.On");
                    rootState_subState = On;
                    rootState_active = On;
                    Timing_entDef();
                    NOTIFY_STATE_ENTERED("ROOT.On.state_10");
                    state_10_entHist();
                    NOTIFY_TRANSITION_TERMINATED("17");
                    res = eventConsumed;
                }
            
        }
        break;
        default:
            break;
    }
    return res;
}
IOxfReactive::TakeEventStatus Controller::state_10_processEvent() {
    IOxfReactive::TakeEventStatus res = eventNotConsumed;
    switch (state_10_active) {
        case On_000:
        {
            if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == state_10_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("3");
                            if(state_10_timeout != NULL)
                                {
                                    state_10_timeout->cancel();
                                    state_10_timeout = NULL;
                                }
                            NOTIFY_STATE_EXITED("ROOT.On.state_10.On_000");
                            //#[ transition 3 
                            z=true;
                            //#]
                            NOTIFY_STATE_ENTERED("ROOT.On.state_10.On_001");
                            state_10_subState = On_001;
                            state_10_active = On_001;
                            //#[ state ROOT.On.state_10.On_001.(Entry) 
                            if(x==false && y==false && z==true)
                            {
                            Reset();
                            NS_ORANGE=1;
                            EW_ORANGE=1;
                            NS_ORANGETIME=5;
                            EW_ORANGETIME=5;
                            NS_MSG=" READY";
                            EW_MSG="  WAIT";
                            }
                            
                            //#]
                            state_10_timeout = scheduleTimeout(5000, "ROOT.On.state_10.On_001");
                            NOTIFY_TRANSITION_TERMINATED("3");
                            res = eventConsumed;
                        }
                }
            
            
        }
        break;
        case On_001:
        {
            if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == state_10_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("4");
                            if(state_10_timeout != NULL)
                                {
                                    state_10_timeout->cancel();
                                    state_10_timeout = NULL;
                                }
                            NOTIFY_STATE_EXITED("ROOT.On.state_10.On_001");
                            //#[ transition 4 
                            y=true;
                            //#]
                            NOTIFY_STATE_ENTERED("ROOT.On.state_10.On_011");
                            state_10_subState = On_011;
                            state_10_active = On_011;
                            //#[ state ROOT.On.state_10.On_011.(Entry) 
                            if(x==false && y==true && z==true)
                            {
                            Reset();
                            EW_RED=1;
                            NS_GREEN=1;
                            EW_REDTIME=10;
                            NS_GREENTIME=10;
                            EW_MSG="  STOP";
                            NS_MSG="   GO";
                            }
                            
                            //#]
                            state_10_timeout = scheduleTimeout(5000, "ROOT.On.state_10.On_011");
                            NOTIFY_TRANSITION_TERMINATED("4");
                            res = eventConsumed;
                        }
                }
            
            
        }
        break;
        case On_011:
        {
            if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == state_10_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("5");
                            if(state_10_timeout != NULL)
                                {
                                    state_10_timeout->cancel();
                                    state_10_timeout = NULL;
                                }
                            NOTIFY_STATE_EXITED("ROOT.On.state_10.On_011");
                            //#[ transition 5 
                            x=true;
                            //#]
                            NOTIFY_STATE_ENTERED("ROOT.On.state_10.On_111");
                            state_10_subState = On_111;
                            state_10_active = On_111;
                            //#[ state ROOT.On.state_10.On_111.(Entry) 
                            if(x==true && y==true && z==true)
                            {
                            Reset();
                            EW_RED=1;
                            NS_GREEN=1;
                            EW_REDTIME=5;
                            NS_GREENTIME=5;
                            EW_MSG="  STOP";
                            NS_MSG="   GO";
                            }
                            //#]
                            state_10_timeout = scheduleTimeout(5000, "ROOT.On.state_10.On_111");
                            NOTIFY_TRANSITION_TERMINATED("5");
                            res = eventConsumed;
                        }
                }
            
            
        }
        break;
        case On_100:
        {
            if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == state_10_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("8");
                            if(state_10_timeout != NULL)
                                {
                                    state_10_timeout->cancel();
                                    state_10_timeout = NULL;
                                }
                            NOTIFY_STATE_EXITED("ROOT.On.state_10.On_100");
                            //#[ transition 8 
                            x=false;
                            //#]
                            NOTIFY_STATE_ENTERED("ROOT.On.state_10.On_000");
                            state_10_subState = On_000;
                            state_10_active = On_000;
                            //#[ state ROOT.On.state_10.On_000.(Entry) 
                            if(x==false && y==false && z==false)
                            {
                            Reset();
                            NS_RED=1;
                            EW_GREEN=1;
                            NS_REDTIME=5;
                            EW_GREENTIME=5;
                            NS_MSG="  STOP";
                            EW_MSG="  GO";
                            }
                            //#]
                            state_10_timeout = scheduleTimeout(5000, "ROOT.On.state_10.On_000");
                            NOTIFY_TRANSITION_TERMINATED("8");
                            res = eventConsumed;
                        }
                }
            
            
        }
        break;
        case On_110:
        {
            if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == state_10_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("7");
                            if(state_10_timeout != NULL)
                                {
                                    state_10_timeout->cancel();
                                    state_10_timeout = NULL;
                                }
                            NOTIFY_STATE_EXITED("ROOT.On.state_10.On_110");
                            //#[ transition 7 
                            y=false;
                            //#]
                            NOTIFY_STATE_ENTERED("ROOT.On.state_10.On_100");
                            state_10_subState = On_100;
                            state_10_active = On_100;
                            //#[ state ROOT.On.state_10.On_100.(Entry) 
                            if(x==true && y==false && z==false)
                            {
                            Reset();
                            NS_RED=1;
                            EW_GREEN=1;
                            NS_REDTIME=10;
                            EW_GREENTIME=10;
                            NS_MSG="  STOP";
                            EW_MSG="  GO";
                            }
                            //#]
                            state_10_timeout = scheduleTimeout(5000, "ROOT.On.state_10.On_100");
                            NOTIFY_TRANSITION_TERMINATED("7");
                            res = eventConsumed;
                        }
                }
            
            
        }
        break;
        case On_111:
        {
            if(IS_EVENT_TYPE_OF(OMTimeoutEventId))
                {
                    if(getCurrentEvent() == state_10_timeout)
                        {
                            NOTIFY_TRANSITION_STARTED("6");
                            if(state_10_timeout != NULL)
                                {
                                    state_10_timeout->cancel();
                                    state_10_timeout = NULL;
                                }
                            NOTIFY_STATE_EXITED("ROOT.On.state_10.On_111");
                            //#[ transition 6 
                            z=false;
                            //#]
                            NOTIFY_STATE_ENTERED("ROOT.On.state_10.On_110");
                            state_10_subState = On_110;
                            state_10_active = On_110;
                            //#[ state ROOT.On.state_10.On_110.(Entry) 
                            if(x==true && y==true && z==false)
                            {
                            Reset();
                            NS_ORANGE=1;
                            EW_ORANGE=1;
                            NS_ORANGETIME=5;
                            EW_ORANGETIME=5;
                            NS_MSG="  WAIT";
                            EW_MSG=" READY";
                            }
                            //#]
                            state_10_timeout = scheduleTimeout(5000, "ROOT.On.state_10.On_110");
                            NOTIFY_TRANSITION_TERMINATED("6");
                            res = eventConsumed;
                        }
                }
            
            
        }
        break;
        default:
            break;
    }
    return res;
}
IOxfReactive::TakeEventStatus Controller::On_handleEvent() {
    IOxfReactive::TakeEventStatus res = eventNotConsumed;
    if(IS_EVENT_TYPE_OF(ev_EmergEW_Default_id))
        {
            NOTIFY_TRANSITION_STARTED("16");
            On_exit();
            NOTIFY_STATE_ENTERED("ROOT.Emerg_ew");
            rootState_subState = Emerg_ew;
            rootState_active = Emerg_ew;
            //#[ state ROOT.Emerg_ew.(Entry) 
            Reset();
            NS_RED=1;
            EW_GREEN=1;
            NS_REDTIME=0;
            NS_ORANGETIME=0;
            NS_GREENTIME=0;
            EW_REDTIME=0;
            EW_ORANGETIME=0;
            EW_GREENTIME=0;
            NS_MSG="EMRGENCY";
            EW_MSG="GO FAST";
            //#]
            NOTIFY_TRANSITION_TERMINATED("16");
            res = eventConsumed;
        }
    else if(IS_EVENT_TYPE_OF(ev_EmergNS_Default_id))
        {
            NOTIFY_TRANSITION_STARTED("14");
            On_exit();
            NOTIFY_STATE_ENTERED("ROOT.Emerg_ns");
            rootState_subState = Emerg_ns;
            rootState_active = Emerg_ns;
            //#[ state ROOT.Emerg_ns.(Entry) 
            Reset();
            EW_RED=1;
            NS_GREEN=1;
            NS_REDTIME=0;
            NS_ORANGETIME=0;
            NS_GREENTIME=0;
            EW_REDTIME=0;
            EW_ORANGETIME=0;
            EW_GREENTIME=0;
            NS_MSG="GO FAST";
            EW_MSG="EMRGNCY";
            //#]
            NOTIFY_TRANSITION_TERMINATED("14");
            res = eventConsumed;
        }
    else if(IS_EVENT_TYPE_OF(ev_Manual_Default_id))
        {
            NOTIFY_TRANSITION_STARTED("10");
            On_exit();
            NOTIFY_STATE_ENTERED("ROOT.Manual_mode");
            rootState_subState = Manual_mode;
            rootState_active = Manual_mode;
            //#[ state ROOT.Manual_mode.(Entry) 
            Reset();
            NS_ORANGE=1;
            EW_ORANGE=1;
            NS_MSG="MANUAL";
            EW_MSG="MANUAL";
            //#]
            NOTIFY_TRANSITION_TERMINATED("10");
            res = eventConsumed;
        }
    else if(IS_EVENT_TYPE_OF(ev_Stop_Default_id))
        {
            NOTIFY_TRANSITION_STARTED("2");
            On_exit();
            NOTIFY_STATE_ENTERED("ROOT.Off");
            rootState_subState = Off;
            rootState_active = Off;
            //#[ state ROOT.Off.(Entry) 
            Reset();
            NS_REDTIME=0;
            NS_ORANGETIME=0;
            NS_GREENTIME=0;
            EW_REDTIME=0;
            EW_ORANGETIME=0;
            EW_GREENTIME=0;
            NS_MSG=" ";
            EW_MSG=" ";
            //#]
            NOTIFY_TRANSITION_TERMINATED("2");
            res = eventConsumed;
        }
    
    return res;
}