void CloudsTransitionController::transitionToVisualSystem(float outDuration, float inDuration){ confirmEmpty("transitionToVisualSystem"); cout << "TRANSITION POINTCLOUD --> VISUAL SYSTEM" << endl; queueState(TRANSITION_INTERVIEW_OUT, outDuration); queueState(TRANSITION_VISUALSYSTEM_IN, inDuration); startTransition(); }
void CloudsTransitionController::transitionToInterview(float outDuration, float inDuration){ confirmEmpty("transitionToInterview"); cout << "TRANSITION VISUAL SYSTEM --> POINTCLOUD" << endl; queueState(TRANSITION_VISUALSYSTEM_OUT, outDuration); queueState(TRANSITION_INTERVIEW_IN, inDuration); startTransition(); }
void CloudsTransitionController::transitionFromClusterMap(float transitionDuration){ confirmEmpty("transitionFromClusterMap"); queueState(TRANSITION_CLUSTERMAP_OUT, transitionDuration); startTransition(); }
void CloudsTransitionController::transitionToFirstVisualSystem(float duration){ confirmEmpty("transitionToFirstVisualSystem"); queueState(TRANSITION_VISUALSYSTEM_IN, duration); startTransition(); }
void CloudsTransitionController::transitionToIntro(float inDuration){ confirmEmpty("transitionToIntro"); if(previousState == TRANSITION_INTERLUDE_IN){ queueState(TRANSITION_INTERLUDE_OUT, inDuration); } else if(previousState == TRANSITION_INTERVIEW_IN){ queueState(TRANSITION_INTERVIEW_OUT, inDuration); } else if(previousState == TRANSITION_VISUALSYSTEM_IN){ queueState(TRANSITION_VISUALSYSTEM_OUT, inDuration); } queueState(TRANSITION_INTRO_IN, inDuration); startTransition(); }
void CloudsTransitionController::transitionFromIntro(float outDuration){ confirmEmpty("transitionFromIntro"); queueState(TRANSITION_INTRO_OUT, outDuration); startTransition(); }
void CloudsTransitionController::transitionFromInterlude(float inDuration){ confirmEmpty("transitionFromInterlude"); queueState(TRANSITION_INTERLUDE_OUT, inDuration); startTransition(); }
void CloudsTransitionController::transitionToFirstInterview(float duration){ confirmEmpty("transitionToFirstInterview"); queueState(TRANSITION_INTERVIEW_IN, duration); startTransition(); }
void CloudsTransitionController::transitionWithQuestion(float outDuration, float portalDuration){ confirmEmpty("transitionWithQuestion"); queueState(TRANSITION_INTERVIEW_OUT, outDuration); //queueState(TRANSITION_QUESTION_IN, portalDuration); startTransition(); }
void CloudsTransitionController::transitionToInterlude(float inDuration,float outDuration){ confirmEmpty("transitionToInterlude"); //we are in a visual system if(getPreviousState() == TRANSITION_VISUALSYSTEM_IN){ cout<<"VISUAL SYSTEM --> INTERLUDE MAP"<<endl; currentState = TRANSITION_VISUALSYSTEM_IN; queueState(TRANSITION_VISUALSYSTEM_OUT, outDuration); queueState(TRANSITION_INTERLUDE_IN, inDuration); } //we are in an interview else if(getPreviousState() == TRANSITION_INTERVIEW_IN){ cout<<"INTERVIEW --> INTERLUDE MAP"<<endl; queueState(TRANSITION_INTERVIEW_OUT, outDuration); queueState(TRANSITION_INTERLUDE_IN, inDuration); } startTransition(); }
void BasicDeviceDriver::onRequestActivation(void) { queueState(SM_ACT_BEGIN); }
void BasicDeviceDriver::updateStateMachine(void) { switch (dequeueState()) { // Wait for activation. case SM_IDLE: break; // Begin activation sequence. case SM_ACT_BEGIN: setEntityState(IMC::EntityState::ESTA_NORMAL, Status::CODE_ACTIVATING); m_wdog.setTop(getActivationTime()); queueState(SM_ACT_POWER_ON); break; // Turn power on. case SM_ACT_POWER_ON: turnPowerOn(); queueState(SM_ACT_POWER_WAIT); break; // Wait for power to be on. case SM_ACT_POWER_WAIT: if (isPowered()) { m_power_on_timer.setTop(m_post_power_on_delay); queueState(SM_ACT_DEV_WAIT); } if (m_wdog.overflow()) { failActivation(DTR("failed to turn power on")); queueState(SM_IDLE); } break; // Connect to device. case SM_ACT_DEV_WAIT: if (m_wdog.overflow()) { failActivation(DTR("failed to connect to device")); queueState(SM_IDLE); } else if (m_power_on_timer.overflow()) { if (connect()) queueState(SM_ACT_DEV_SYNC); } break; // Synchronize with device. case SM_ACT_DEV_SYNC: if (m_wdog.overflow()) { failActivation(DTR("failed to synchronize with device")); queueState(SM_IDLE); } else { if (synchronize()) queueState(SM_ACT_LOG_REQUEST); } break; // Request log name. case SM_ACT_LOG_REQUEST: if (m_wdog.overflow()) { failActivation(DTR("failed to request current log name")); queueState(SM_IDLE); } else { closeLog(); requestLogName(); queueState(SM_ACT_LOG_WAIT); } break; // Wait for log name. case SM_ACT_LOG_WAIT: if (m_wdog.overflow()) { failActivation(DTR("failed to retrieve current log name")); queueState(SM_IDLE); } else { if (m_log_opened) queueState(SM_ACT_DONE); } break; // Activation procedure is complete. case SM_ACT_DONE: activate(); queueState(SM_ACT_SAMPLE); break; // Read samples. case SM_ACT_SAMPLE: readSample(); break; // Start deactivation procedure. case SM_DEACT_BEGIN: setEntityState(IMC::EntityState::ESTA_NORMAL, Status::CODE_DEACTIVATING); m_wdog.setTop(getDeactivationTime()); queueState(SM_DEACT_DISCONNECT); break; // Gracefully disconnect from device. case SM_DEACT_DISCONNECT: disconnect(); closeLog(); m_power_off_timer.setTop(m_power_off_delay); queueState(SM_DEACT_POWER_OFF); break; // Turn power off. case SM_DEACT_POWER_OFF: if (m_power_off_timer.overflow() || m_wdog.overflow()) { turnPowerOff(); queueState(SM_DEACT_POWER_WAIT); } break; // Wait for power to be turned off. case SM_DEACT_POWER_WAIT: if (!isPowered()) queueState(SM_DEACT_DONE); break; // Deactivation is complete. case SM_DEACT_DONE: deactivate(); queueState(SM_IDLE); break; } }