92 lines
1.7 KiB
C++
Executable File
92 lines
1.7 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Base for ExerciseState
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QState>
|
|
|
|
#include <ExerciseManagement/exm_enums.hpp>
|
|
|
|
#include "object_exercise.h"
|
|
|
|
namespace ExerciseManagement
|
|
{
|
|
|
|
class ExerciseStateBase : public QState
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
ExerciseManagement::ExerciseState exerciseState() const { return m_exerciseState; }
|
|
|
|
protected:
|
|
ExerciseStateBase(const QString &objectName, const ExerciseState &exerciseState, ObjectExercise* objExe);
|
|
void onEntry(QEvent *event);
|
|
|
|
int exerciseId() const { return m_exercise ? m_exercise->id() : -1; }
|
|
|
|
protected:
|
|
ObjectExercise *m_exercise;
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
private:
|
|
const ExerciseManagement::ExerciseState m_exerciseState;
|
|
};
|
|
|
|
class Unknown : public ExerciseStateBase
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Unknown(ObjectExercise *objExe);
|
|
};
|
|
|
|
class Creation : public ExerciseStateBase
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Creation(ObjectExercise *objExe);
|
|
protected:
|
|
void onEntry(QEvent *event);
|
|
};
|
|
|
|
class Start : public ExerciseStateBase
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Start(ObjectExercise *objExe);
|
|
protected:
|
|
void onEntry(QEvent *event);
|
|
void onExit(QEvent *event);
|
|
};
|
|
|
|
class Pause : public ExerciseStateBase
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Pause(ObjectExercise *objExe);
|
|
};
|
|
|
|
class Stop : public ExerciseStateBase
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Stop(ObjectExercise *objExe);
|
|
protected:
|
|
void onEntry(QEvent *event);
|
|
};
|
|
|
|
class Terminate : public ExerciseStateBase
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Terminate(ObjectExercise *objExe);
|
|
};
|
|
|
|
|
|
} // namespace ExerciseManagement
|
|
|