Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+7
-7
@@ -30,7 +30,7 @@ bool ClientConnection::init()
|
||||
{
|
||||
if (m_socket == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Initialisation failed due to an invalid socket";
|
||||
ERROR_LOG(m_logger) << "Initialisation failed due to an invalid socket";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -51,17 +51,17 @@ void ClientConnection::addMessage(const CombatNetRadio::WebSocketInterface::Mess
|
||||
if (!m_socket || m_socket->state() != QAbstractSocket::ConnectedState)
|
||||
{
|
||||
m_messageQueue.enqueue(message);
|
||||
DEBUG_LOG() << "Adding message to queue, size: " << m_messageQueue.size();
|
||||
DEBUG_LOG(m_logger) << "Adding message to queue, size: " << m_messageQueue.size();
|
||||
return;
|
||||
}
|
||||
const QString msg(message.toJsonString());
|
||||
DEBUG_LOG() << "Send msg: " << msg;
|
||||
DEBUG_LOG(m_logger) << "Send msg: " << msg;
|
||||
m_socket->sendTextMessage(msg);
|
||||
}
|
||||
|
||||
void ClientConnection::onNewTextMessageFromSocket(const QString &message)
|
||||
{
|
||||
DEBUG_LOG() << "Recv msg: " << message;
|
||||
DEBUG_LOG(m_logger) << "Recv msg: " << message;
|
||||
emit newTextMessage(this, message);
|
||||
}
|
||||
|
||||
@@ -73,15 +73,15 @@ void ClientConnection::sendMessagesFromQueue()
|
||||
{
|
||||
Messages::ReplyMessage message = m_messageQueue.dequeue();
|
||||
const QString msg(message.toJsonString());
|
||||
TRACE_LOG() << "Send msg: " << msg;
|
||||
TRACE_LOG(m_logger) << "Send msg: " << msg;
|
||||
m_socket->sendTextMessage(msg);
|
||||
DEBUG_LOG() << "Sent message from queue, new size: " << m_messageQueue.size();
|
||||
DEBUG_LOG(m_logger) << "Sent message from queue, new size: " << m_messageQueue.size();
|
||||
}
|
||||
}
|
||||
|
||||
void ClientConnection::onSocketDisconnect()
|
||||
{
|
||||
DEBUG_LOG() << "Client with ip "
|
||||
DEBUG_LOG(m_logger) << "Client with ip "
|
||||
<< m_ip.toString()
|
||||
<< " disconnected";
|
||||
emit disconnected(this);
|
||||
|
||||
+2
@@ -40,9 +40,11 @@ private Q_SLOTS:
|
||||
void onSocketDisconnect();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sendMessages();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QWebSocket *m_socket;
|
||||
QQueue<Messages::ReplyMessage> m_messageQueue;
|
||||
QHostAddress m_ip;
|
||||
|
||||
+8
-9
@@ -10,9 +10,8 @@
|
||||
|
||||
using namespace CombatNetRadio::WebSocketInterface::Connection;
|
||||
|
||||
ConnectionHandler::ConnectionHandler()
|
||||
: m_server(nullptr)
|
||||
{
|
||||
ConnectionHandler::ConnectionHandler() : m_server(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
ConnectionHandler::~ConnectionHandler()
|
||||
@@ -38,13 +37,13 @@ bool ConnectionHandler::init()
|
||||
|
||||
|
||||
quint16 port = 2081;
|
||||
DEBUG_LOG() << "Trying to listen to port " << port;
|
||||
DEBUG_LOG(m_logger) << "Trying to listen to port " << port;
|
||||
if (!m_server->listen(QHostAddress::Any, port))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to listen to port " << port;
|
||||
ERROR_LOG(m_logger) << "Not possible to listen to port " << port;
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "... ok";
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -63,7 +62,7 @@ void ConnectionHandler::onNewMessage(CombatNetRadio::WebSocketInterface::Message
|
||||
|
||||
void ConnectionHandler::onServerError(QWebSocketProtocol::CloseCode closeCode)
|
||||
{
|
||||
ERROR_LOG() << "Got server error with close code " << closeCode;
|
||||
ERROR_LOG(m_logger) << "Got server error with close code " << closeCode;
|
||||
}
|
||||
|
||||
void ConnectionHandler::onNewConnection()
|
||||
@@ -75,7 +74,7 @@ void ConnectionHandler::onNewConnection()
|
||||
|
||||
if (!newConnection->init())
|
||||
{
|
||||
ERROR_LOG() << "Failed to initialise new client";
|
||||
ERROR_LOG(m_logger) << "Failed to initialise new client";
|
||||
delete newConnection;
|
||||
newConnection = nullptr;
|
||||
continue;
|
||||
@@ -85,7 +84,7 @@ void ConnectionHandler::onNewConnection()
|
||||
connect(newConnection, &ClientConnection::disconnected, this, &ConnectionHandler::onDisconnected);
|
||||
|
||||
m_connections.append(newConnection);
|
||||
DEBUG_LOG() << "New client with ip " << newConnection->ip().toString() << " connected";
|
||||
DEBUG_LOG(m_logger) << "New client with ip " << newConnection->ip().toString() << " connected";
|
||||
emit newClientConnection((qint64) static_cast<WebSocketInterface::Connection::ClientConnection::MessageTransmitter*>(newConnection));
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -50,6 +50,7 @@ private Q_SLOTS:
|
||||
void onDisconnected(ClientConnection *conn);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QWebSocketServer *m_server;
|
||||
QVector<ClientConnection *> m_connections;
|
||||
};
|
||||
|
||||
+2
-3
@@ -12,9 +12,8 @@ namespace WebSocketInterface
|
||||
namespace Messages
|
||||
{
|
||||
|
||||
MessageHandler::MessageHandler(ExerciseManager *exerciseManager)
|
||||
: m_exerciseManager(exerciseManager)
|
||||
{
|
||||
MessageHandler::MessageHandler(ExerciseManager *exerciseManager) : m_exerciseManager(exerciseManager),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
Q_ASSERT(exerciseManager);
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -28,6 +28,8 @@ public Q_SLOTS:
|
||||
void onNewTextMessage(MessageTransmitter *transmitter, const QString &message);
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
ExerciseManager *m_exerciseManager;
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ bool WebSocketInterfaceHandler::init()
|
||||
|
||||
if (!m_connectionHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Failed to initialise ConnectionHandler";
|
||||
ERROR_LOG(m_logger) << "Failed to initialise ConnectionHandler";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,11 @@
|
||||
namespace CombatNetRadio
|
||||
{
|
||||
|
||||
ConfigCnr::ConfigCnr(int exerciseId, AudioVideoManagement::Interface::Dtc *avmDtc, InfrastructureManagement::Interface::Dtc *ismDtc)
|
||||
: m_exerciseId(exerciseId)
|
||||
ConfigCnr::ConfigCnr(int exerciseId, AudioVideoManagement::Interface::Dtc *avmDtc, InfrastructureManagement::Interface::Dtc *ismDtc) : m_exerciseId(exerciseId)
|
||||
, m_avmDtc(avmDtc)
|
||||
, m_ismDtc(ismDtc)
|
||||
, m_loggerJson(getLogger("ConfigCnr.Json"))
|
||||
{
|
||||
, m_loggerJson(getLogger("ConfigCnr.Json")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
Q_ASSERT(avmDtc);
|
||||
Q_ASSERT(ismDtc);
|
||||
|
||||
@@ -199,7 +198,7 @@ boost::optional<AudioVideoManagement::FrequencyPlanning> ConfigCnr::activePlan()
|
||||
|
||||
void ConfigCnr::onActiveFrequencyPlanningChanged(const AudioVideoManagement::ActiveFrequencyPlanning &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << ": " << data;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": " << data;
|
||||
|
||||
Q_UNUSED(modType);
|
||||
if (data.exerciseId() == m_exerciseId)
|
||||
@@ -208,7 +207,7 @@ void ConfigCnr::onActiveFrequencyPlanningChanged(const AudioVideoManagement::Act
|
||||
|
||||
void ConfigCnr::onFrequencyPlanningChanged(const AudioVideoManagement::FrequencyPlanning &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << ": " << data;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": " << data;
|
||||
|
||||
Q_UNUSED(modType);
|
||||
|
||||
@@ -223,7 +222,7 @@ void ConfigCnr::onFrequencyPlanningChanged(const AudioVideoManagement::Frequency
|
||||
|
||||
void ConfigCnr::onCnrConfigChanged(const AudioVideoManagement::CnrConfig &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << ": " << data;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": " << data;
|
||||
|
||||
Q_UNUSED(modType);
|
||||
bool isGlobal = !data.exerciseId().is_set();
|
||||
|
||||
@@ -15,16 +15,16 @@ namespace CombatNetRadio
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Global))
|
||||
{
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG() << "Error initializing dds connections - aborting";
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::unique_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<AssetManagement::Interface::Dtc> m_asmDtc;
|
||||
|
||||
@@ -111,13 +111,13 @@ std::vector<WebSocketInterface::Messages::ReplyMessage> ExerciseManager::radioSt
|
||||
|
||||
WebSocketInterface::Messages::ReplyMessage ExerciseManager::configCnr(const QString &uuid)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
|
||||
const WebSocketInterface::Messages::ErrorMessage noActivePlanning(1, uuid, QStringLiteral("No active frequency planning found"));
|
||||
|
||||
if (m_parts.empty())
|
||||
{
|
||||
DEBUG_LOG() << "No active frequency planning due to empty m_parts.";
|
||||
DEBUG_LOG(m_logger) << "No active frequency planning due to empty m_parts.";
|
||||
|
||||
return noActivePlanning;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ WebSocketInterface::Messages::ReplyMessage ExerciseManager::configCnr(const QStr
|
||||
|
||||
if (configCnrData.radioCircuit.empty())
|
||||
{
|
||||
DEBUG_LOG() << "No active frequency planning due to empty radio circuits.";
|
||||
DEBUG_LOG(m_logger) << "No active frequency planning due to empty radio circuits.";
|
||||
|
||||
return noActivePlanning;
|
||||
}
|
||||
@@ -182,25 +182,25 @@ WebSocketInterface::Messages::ReplyMessage ExerciseManager::positionsCnr(const Q
|
||||
void ExerciseManager::onModifyFrequencyPlanningStatusReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG() << "Error while modifying FrequencyPlanningStatus: " << replyObject.str();
|
||||
ERROR_LOG(m_logger) << "Error while modifying FrequencyPlanningStatus: " << replyObject.str();
|
||||
else
|
||||
INFO_LOG() << "onModifyFrequencyPlanningStatusReply ok";
|
||||
INFO_LOG(m_logger) << "onModifyFrequencyPlanningStatusReply ok";
|
||||
}
|
||||
|
||||
void ExerciseManager::onClearFrequencyPlanningStatusReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG() << "Error while clearing FrequencyPlanningStatus: " << replyObject.str();
|
||||
ERROR_LOG(m_logger) << "Error while clearing FrequencyPlanningStatus: " << replyObject.str();
|
||||
else
|
||||
INFO_LOG() << "onClearFrequencyPlanningStatusReply ok";
|
||||
INFO_LOG(m_logger) << "onClearFrequencyPlanningStatusReply ok";
|
||||
}
|
||||
|
||||
void ExerciseManager::onRemoveFrequencyPlanningStatusByClientReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG() << "Error while removing FrequencyPlanningStatus: " << replyObject.str();
|
||||
ERROR_LOG(m_logger) << "Error while removing FrequencyPlanningStatus: " << replyObject.str();
|
||||
else
|
||||
INFO_LOG() << "onRemoveFrequencyPlanningStatusByClientReply ok";
|
||||
INFO_LOG(m_logger) << "onRemoveFrequencyPlanningStatusByClientReply ok";
|
||||
}
|
||||
|
||||
void ExerciseManager::setPositionsUpdateInterval(std::chrono::milliseconds interval)
|
||||
|
||||
@@ -68,6 +68,7 @@ signals:
|
||||
void positionsUpdate(const WebSocketInterface::Messages::ReplyMessage &positionsCnr);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onExerciseActivated(int exerciseId);
|
||||
void onExerciseDeactivated(int exerciseId);
|
||||
void onPositionsUpdateTimeout();
|
||||
|
||||
@@ -19,12 +19,12 @@ MainHandler::~MainHandler() = default;
|
||||
|
||||
bool MainHandler::init(int domainId)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
|
||||
m_ddsHandler.reset(new DdsHandler(domainId));
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation DdsHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation DdsHandler failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ bool MainHandler::init(int domainId)
|
||||
m_webSocketInterfaceHandler.reset(new WebSocketInterface::WebSocketInterfaceHandler(m_exerciseManager.get()));
|
||||
if (!m_webSocketInterfaceHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void TrainingArea::getRadioStations(InfrastructureManagement::Interface::Dtc *is
|
||||
data.id = stationId(mse);
|
||||
if (data.id == 0)
|
||||
{
|
||||
WARNING_LOG() << "Got MainStructureElement of type 'RadioStation' but property 'stationId' was not set"
|
||||
WARNING_LOG(m_logger) << "Got MainStructureElement of type 'RadioStation' but property 'stationId' was not set"
|
||||
<< " - database id: " << mse.id() << " - ignoring!";
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user