Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Websocket C++ API for building control unit
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-01-30
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <Json/buildingcontroljson_export.h>
|
||||
#include <VWM/vwm_types.h>
|
||||
#include <BSM/bsm_types.h>
|
||||
#include <logger.h>
|
||||
#include <memory>
|
||||
#include <bcu_types.h>
|
||||
|
||||
class QWebSocket;
|
||||
namespace BuildingControlUnit
|
||||
{
|
||||
namespace Json
|
||||
{
|
||||
namespace Telegrams
|
||||
{
|
||||
class BaseTelegram;
|
||||
}
|
||||
class WebSocketHandler;
|
||||
class BUILDINGCONTROLJSON_EXPORT Api : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Api(QObject *parent = nullptr);
|
||||
|
||||
bool init(quint16 listenPort);
|
||||
|
||||
void sendHitResult(const HitResult &hitResult, const QMap<int, ContaminationState> &contaminationStates, QWebSocket *ws);
|
||||
void sendBsmState(const QVector<BSM::BsmState> &bsmStates, QWebSocket *ws);
|
||||
void sendRelayState(const QString &segment,
|
||||
const qint64 stateTime,
|
||||
const qint64 offlineTime,
|
||||
const QVector<RelayStateInfo> &relayStates,
|
||||
QWebSocket *ws);
|
||||
void sendEffectOverrides(const QString &segment,
|
||||
const qint64 stateTime,
|
||||
const qint64 offlineTime,
|
||||
const QVector<BcuEffectState> &effectOverrides,
|
||||
QWebSocket *ws);
|
||||
public Q_SLOTS:
|
||||
void onHitResult(const HitResult &hitResult, const QMap<int, ContaminationState> &contaminationStates, bool playSound);
|
||||
void onBsmState(const QVector<BSM::BsmState> &bsmStates);
|
||||
void onRelayState(const RelayState &relayState);
|
||||
Q_SIGNALS:
|
||||
void damageStateRequest(int originatorId, DamageState damageState, const QVector<int> &roomIds);
|
||||
void setContaminationStateRequest(const std::vector<BuildingControlUnit::ContaminationState> &contaminationStates);
|
||||
void resetContaminationRequest();
|
||||
void setEffectStatesRequest( const QString &hostname, const QVector<BcuEffectState> &effectStates);
|
||||
void switchRelayRequest( const QString &hostname, const SwitchRelayValues &switchRelayValues);
|
||||
void setFortifyFactorRequest(int originatorId, const QVector<FortifyInfo> &foritfyInfos);
|
||||
void relayStatesRequest(const QString &hostname, const QVector<RelayStateInfo> &RelayStateInfos);
|
||||
void bsmTriggerFlashlightRequest(int sensorId, const QString &hostname, int numberOfFlashes, int pauseBetweenFlashesSec);
|
||||
// tasInd
|
||||
void centralEffectSimulationHit(const qint64 effectTimeMSec, const int chargeTypeId,
|
||||
const int destructiveFactor, const int penetrationFactor,
|
||||
const int aesId, const LtsUtils::QPoint3D &relImpact,
|
||||
const QString &properties);
|
||||
void centralEffectSimulationHit3D(const qint64 effectTimeMSec, const int chargeTypeId,
|
||||
const int destructiveFactor, const int penetrationFactor,
|
||||
const int aesId, const LtsUtils::QPoint3D &relImpact,
|
||||
const LtsUtils::QPoint3D &relDetonationLocation,
|
||||
const double detonationDistance,
|
||||
const QString &properties);
|
||||
// debug - simulate BSM hit
|
||||
void simulateBSMHit(qint64 timeMSec, int sensorId, int originatorId,
|
||||
int chargeTypeId, int deposition1, int deposition2);
|
||||
// request status for a bsm
|
||||
void getBsmConfiguration(int sensorId);
|
||||
void getBsmBitTimeout(int sensorId);
|
||||
void getBsmTechnicalStatus(int sensorId);
|
||||
void webSocketConnected(QWebSocket *ws);
|
||||
private Q_SLOTS:
|
||||
void onTelegramReceived(const std::shared_ptr<Telegrams::BaseTelegram> &tele);
|
||||
private:
|
||||
WebSocketHandler *m_webSocketHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
} // namespace Json
|
||||
} // namespace BuildingControlUnit
|
||||
Reference in new issue
Block a user