Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
18662 files changed
+4115092
-5435
No files matched your search
@@ -0,0 +1,175 @@
|
||||
/**
|
||||
* Handle one wind sensor
|
||||
* Requests for wind sensor data in an given interval.
|
||||
* All data will be send by signal/slot connection in case of data change.
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-09-22
|
||||
*/
|
||||
|
||||
#include "tcpwind.h"
|
||||
#include "settings.h"
|
||||
#include "logger.h"
|
||||
|
||||
namespace MeteoDataManagement
|
||||
{
|
||||
|
||||
TcpWind::TcpWind(QObject *parent)
|
||||
: TcpSocket("TcpWind", parent)
|
||||
, m_requestTimer(new QTimer(this))
|
||||
, m_requestTimeoutTimer(new QTimer(this))
|
||||
, m_direction(0)
|
||||
, m_speed(0)
|
||||
, m_dataChanged(false)
|
||||
{
|
||||
// m_logger geerbt aus TcpSocket
|
||||
INFO_LOG(m_logger) << "CTOR TcpWind... hat TcpSocket fuer connects initialisiert";
|
||||
|
||||
connect(m_requestTimer, &QTimer::timeout, this, &TcpWind::onSensorDataRequest);
|
||||
connect(m_requestTimeoutTimer, &QTimer::timeout, this, &TcpWind::onRequestTimeout);
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void TcpWind::start(const QString &converterIp, quint16 windPort)
|
||||
{
|
||||
INFO_LOG(m_logger) << "startTcpWind() ... call function TcpSocket::start()";
|
||||
|
||||
TcpSocket::start(converterIp, windPort); // connect...
|
||||
m_requestTimer->start(Settings::getRequstIntervalWindSensor());
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void TcpWind::init()
|
||||
{
|
||||
// pure virtual function aus TcpSocket
|
||||
|
||||
// WS-425 Einstellungen: NEMA-Extended, PollMode, 9600,8,N,1
|
||||
// Hier sind dann keine weiteren Einstellungen erforderlich.
|
||||
// Nach PowerOn ist der WS betriebsbereit.
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void TcpWind::dataAvailable(const QByteArray &line)
|
||||
{
|
||||
// pure virtual function aus TcpSocket
|
||||
|
||||
// Nur lines mit Wetterdaten behandeln
|
||||
if (line.contains("PAMWV"))
|
||||
{
|
||||
m_requestTimeoutTimer->stop();
|
||||
|
||||
bool windOk = extractDataFromLine(line);
|
||||
|
||||
if (m_dataChanged)
|
||||
{
|
||||
m_dataChanged = false;
|
||||
emit sigWindDataChanged(m_direction, m_speed, windOk);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Other wind sensor data available line: " << line ;
|
||||
// ggf. andere Meldungen behandeln
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void TcpWind::onSensorDataRequest()
|
||||
{
|
||||
if (m_requestTimeoutTimer->isActive())
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "onSensorDataRequest() ...";
|
||||
|
||||
if (!sendCommand("$WIPAQ,*72\r\n"))
|
||||
return;
|
||||
|
||||
m_requestTimeoutTimer->start(Settings::getRequstTimeoutWindSensor());
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void TcpWind::onRequestTimeout()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout for wind sensor data request."
|
||||
<< " RS232-LAN Converter: " << m_hostName
|
||||
<< " Port: " << m_hostPort;
|
||||
|
||||
emit sigWindDataChanged(0, 0, false);
|
||||
m_requestTimeoutTimer->stop();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
bool TcpWind::extractDataFromLine(const QByteArray &line)
|
||||
{
|
||||
bool bOk = true;
|
||||
DEBUG_LOG(m_logger) << "extractDataFromLine line: " << line;
|
||||
|
||||
QList<QByteArray> list = line.split(',');
|
||||
|
||||
if (list.size() != 6)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Invalid number of data in line: " << line << " cnt: " << list.size();
|
||||
return false;
|
||||
}
|
||||
|
||||
// NMEA-Extended line data format:
|
||||
// [0] $PAWMV fixed Remark: 'A' discribes the sensor-id
|
||||
// [1] float direction in degree, or empty
|
||||
// [2] char R = relativ, T = true
|
||||
// [3] float speed, or empty
|
||||
// [4] char M = m/s, K = Km/h, N = Knoten
|
||||
// [5] String "<State> * <checksum>"
|
||||
// State: A = Data valid, V = Data invalid
|
||||
// * fixed
|
||||
// checksum 8bit XOR, excluding $ and *)
|
||||
|
||||
if (list.at(5).contains('V'))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Invalid data from windsensor. "
|
||||
<< " RS232-LAN Converter: " << m_hostName
|
||||
<< " Port: " << m_hostPort
|
||||
<< " Line: " << line;
|
||||
return false;
|
||||
}
|
||||
|
||||
float value;
|
||||
if (list.at(1).size() > 0)
|
||||
{
|
||||
value = list.at(1).toFloat(&bOk);
|
||||
if (bOk && !qFuzzyCompare(value, m_direction))
|
||||
{
|
||||
m_direction = value;
|
||||
m_dataChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (list.at(3).size() > 0)
|
||||
{
|
||||
value = list.at(3).toFloat(&bOk);
|
||||
if (bOk && !qFuzzyCompare(value, m_speed))
|
||||
{
|
||||
m_speed = value;
|
||||
m_dataChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (list.at(4).contains('K'))
|
||||
{
|
||||
// km/h -> m/s
|
||||
m_speed = m_speed * 0.2778f;
|
||||
}
|
||||
|
||||
if (list.at(4).contains('N'))
|
||||
{
|
||||
// Kn -> m/s
|
||||
m_speed = m_speed * 0.5144f;
|
||||
}
|
||||
|
||||
return bOk;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
||||
} // namespace MeteoDataManagement
|
||||
Reference in new issue
Block a user