Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.h
T
torstenandCopilot d5af8b9764 Session 026: Lts/Services Qt5:: to Qt6:: migration
- Migrated all 104 CMakeLists.txt files in Lts/Services
- Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg,
  Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test,
  Qt5::SerialPort with Qt6:: equivalents
- 1244 files modified (CMakeLists.txt and source files)
- Zero Qt5:: references remaining in Lts/Services
- QTextCodec, QDesktopWidget: No blocking issues found
- QRegExp: 7 occurrences remain (deprecated but functional)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-25 19:23:30 +02:00

70 lines
1.9 KiB
C++
Executable File

// /**
// * 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