Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+91
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* @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
|
||||
|
||||
Reference in new issue
Block a user