C

Qt Quick Ultralite Motorcycle Cluster Demo

/****************************************************************************** ** ** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Ultralite module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ******************************************************************************/
#ifndef STATES_H #define STATES_H #include "simulation/smfwd.h" #include "MotorCluster/MainModel.h" namespace Simulation { struct SimulationState : Machine::AbstractState { void onEnter(const StateId &, const Layer &, Machine &) {} void onUpdate(uint32_t, const Layer &, Machine &) {} void onLeave(const StateId &, const Layer &, Machine &) {} }; struct IntroState : public SimulationState { IntroState(const StateId &nextState); void onEnter(const StateId &, const Layer &layer, Machine &sm); void onUpdate(uint32_t, const Layer &layer, Machine &sm); private: enum Step { Step_Blank, Step_ShowBLinkers, Step_ShowLogo, Step_ShowTellTales, Step_ShowTachoScale, Step_ShowBottomElements, Step_ShowBgLines, Step_ShowBgRoad, Step_ShowSpeedometer, Step_ShowGauges, Step_RpmToMax, Step_RpmToZero, Step_Done } _step; StateId _nextState; }; struct EndState : public SimulationState { EndState(const StateId &nextState); void onEnter(const StateId &prevState, const Layer &layer, Machine &sm); void onUpdate(uint32_t, const Layer &layer, Machine &sm); void onLeave(const StateId &, const Layer &, Machine &); private: enum Step { Step_Blank, Step_HideBgLines, Step_HideRoad, Step_HideGauges, Step_HideBottomElements, Step_HideTellTales, Step_HideTachoScale, Step_HideTacho, Step_HideTachoFramesTop, Step_Done } _step; StateId _nextState; }; } // namespace Simulation #endif // STATES_H