コード例 #1
0
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;
}
コード例 #2
0
void Karussell::drehen() {
    NOTIFY_OPERATION(drehen, drehen(), 0, System_Karussell_drehen_SERIALIZE);
    //#[ operation drehen()
    Waage* myWaage = itsWaage[MaxStation-1]; 
    
    if( !GlaeserDrauf() ) return;
    
    for(int i=0; i < MaxStation; i++) 
    {
    	if( !itsStation[i]->isOk() ) return; 
    }
    
    for( int i = MaxStation-1; i > 0; i-- )
    {
    	itsWaage[i] = itsWaage[i-1];
    	
    }
    itsWaage[0] = myWaage;  
     
    updateLED();
     
    for(int i=0; i < MaxStation; i++) 
    {
    	itsStation[i]->GEN(evRun); 
    }
    
    jemalsgedreht = true;         
    //#]
}
コード例 #3
0
void runSzenario5dotfinder(){
    if(getFrontZeichen()=='.'||getFrontZeichen()=='Z'){
        geheNachVorn(1);
        setZeichenAnPosition(' ', getRoboterPosition());
    }else{
        drehen(45,1);
    }
}