Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,69 @@
|
||||
// /**
|
||||
// * Object class for EffectorStateMachine
|
||||
// * $Id$
|
||||
// * $HeadURL$
|
||||
// * $Author$
|
||||
// */
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <QString>
|
||||
#include <aes_enums.hpp>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
class EffectorStateMachine : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
explicit EffectorStateMachine(AreaEffectSimulation::AesEffectorState initialState = AreaEffectSimulation::AesEffectorState::EsNotReadyToFire, QObject *parent = nullptr);
|
||||
~EffectorStateMachine();
|
||||
|
||||
void init();
|
||||
|
||||
void setEmptyCharge(bool emptyCharge){m_emptyCharge = emptyCharge;}
|
||||
QString getStateStr(AreaEffectSimulation::AesEffectorState state);
|
||||
QString getCurrentStateStr(){return getStateStr(m_currentState);}
|
||||
AreaEffectSimulation::AesEffectorState getCurrentState(){return m_currentState;}
|
||||
bool overrideReportFireReadinessMinMax(int newMin, int newMax);
|
||||
bool resetReportFireReadinessMinMax();
|
||||
signals:
|
||||
// void stateChanged(State newState);
|
||||
void logMessage(QString msg);
|
||||
|
||||
void signalNotReadyToFire();
|
||||
void signalReadyToFire();
|
||||
void signalReceivedOrder();
|
||||
void signalReportedFired();
|
||||
void signalFired(); // State abgefeuert erreicht
|
||||
|
||||
public slots:
|
||||
bool reportNotFireReadiness(); // Wirkfeld angelegt
|
||||
bool reportFireReadiness(); // Feuerbereit melden
|
||||
bool fireOrder(); // Feuerbefehl
|
||||
bool fire(); // Feuern
|
||||
bool reportFired(); // Abgefeuert melden
|
||||
|
||||
private:
|
||||
void stopAllTimer();
|
||||
int intervalFire();
|
||||
int intervalReportFired();
|
||||
int intervalReportFireReadiness();
|
||||
int intervalInitialFireReadiness();
|
||||
|
||||
AreaEffectSimulation::AesEffectorState m_currentState;
|
||||
|
||||
QTimer m_timerFire;
|
||||
QTimer m_timerReportFired;
|
||||
QTimer m_timerReportFireReadiness;
|
||||
QTimer m_timerInitialFireReadiness;
|
||||
bool m_emptyCharge = false;
|
||||
bool m_initialFireReadinessDone = false;
|
||||
int m_intervalReportFireReadinessMin = 0;
|
||||
int m_intervalReportFireReadinessMax = 0;
|
||||
LOGGER_T &m_logger;
|
||||
};
|
||||
} // namespace AreaEffectSimulation
|
||||
Reference in new issue
Block a user