C

Qt Quick Ultralite Motorcycle Cluster Demo

// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial
#include "simulation/simulationcontroller.h"
#include "MotorCluster/MainModel.h"
#include "statemachine.h"
#include "simulation/smfwd.h"
#include "simulation/states.h"
#include "simulation/normaldrivestate.h"

using namespace Simulation;

void introFinished(Machine &sm);

namespace {
// State Machine instance
Machine sm(State_Idle);

// State Instances
IntroState introState(State_NormalDrive);
NormalDriveState normalDriveState(State_End);
EndState endState(State_Intro);
} // namespace

SimulationController::SimulationController()
{
    sm.registerState(State_Intro, &introState);
    sm.registerState(State_NormalDrive, &normalDriveState);
    sm.registerState(State_End, &endState);
}

void SimulationController::start()
{
    sm.changeState(State_Intro, Layer_Gauges);
}