Files
qt-migration-legatus/qt5-before/dlbo/Lts/Services/skeleton/generate_handlers.sh
T
torstenandCopilot 7173785915 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>
2026-09-15 18:20:26 +00:00

145 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
#
# @RDE_HEADER@
# $Id$
# $HeadURL$
# $Author$
#
svc_name_abbr=""
svc_name_long=""
usage()
{
echo "usage: $0 -l <ObjectName>"
# echo " -o <ObjectName> : ObjectName in CamelCase "
echo " -s <SvcName short>: Abbreviation of ServiceName with 3 letters"
echo " -l <SvcName long> : ServiceName in CamelCase"
}
while getopts "s:l:" opt "$@"; do
case $opt in
# o)
# obj_cc=$OPTARG
# ;;
l)
svc_cc=$OPTARG
;;
s)
svc_abbr=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG"
usage
exit 1
;;
:)
echo "Option -$OPTARG requires an argument."
usage
exit 1
;;
esac
done
shift $((OPTIND-1))
if [ -z $svc_cc ]; then
echo "Parameter -l is required"
usage
exit 1
fi
if [ -z $svc_abbr ]; then
echo "Parameter -s is required"
usage
exit 1
fi
svc_abbr_lc=${svc_abbr,,}
svc_abbr_cc=${svc_abbr_lc~}
echo "svc CamelCase : ${svc_cc} "
echo "svc abbr Cc : ${svc_abbr_cc} "
echo "svc abbr lower : ${svc_abbr_lc} "
echo "ObjectNames (cc): "
for obje in "$@"; do
echo " ${obje}"
done
echo "=========================="
echo "Iterating through objects:"
echo
declare -a headers
declare -a sources
for obje in "$@"; do
cd ../skeleton
obj_lower=${obje,,}
obj_upper=${obje^^}
obj_underscore=`echo ${obje} | sed 's/\([a-z0-9]\)\([A-Z]\)/\1_\L\2/g'`
obj_underscore=${obj_underscore,,}
echo "Object '${obje}': "
echo " obj CamelCase : ${obje} "
echo " obj lower : ${obj_lower} "
echo " obj UPPER : ${obj_upper} "
echo " obj under_score : ${obj_underscore} "
echo
echo " Copying [handler|object]_${obj_underscore}.[cpp|h] to ./${svc_cc} directory"
cp ./stub/handler_xxx.cpp ../${svc_cc}/handler_${obj_underscore}.cpp
cp ./stub/handler_xxx.h ../${svc_cc}/handler_${obj_underscore}.h
cp ./stub/object_xxx.cpp ../${svc_cc}/object_${obj_underscore}.cpp
cp ./stub/object_xxx.h ../${svc_cc}/object_${obj_underscore}.h
cd ../${svc_cc}
# search & replace XXX/Xxx/xxx/XxxXxxXxx
for file in `find . -type f -name "*_${obj_underscore}.*" `; do
echo " -> Replace all Xxx/xxx/XXX and namespace in file ${file}"
# sed -i "s/XxxXxxXxx/${svc_name_long}/g" ${file}
sed -i "s/XXX/${obj_upper}/g" ${file}
sed -i "s/Xxx/${obje}/g" ${file}
sed -i "s/xxx_xxx/${obj_underscore}/g" ${file}
sed -i "s/xxx/${obj_lower}/g" ${file}
sed -i "s/YyyYyyYyy/${svc_cc}/g" ${file}
sed -i "s/Yyy/${svc_abbr_cc}/g" ${file}
sed -i "s/yyy/${svc_abbr_lc}/g" ${file}
fil2=${file##.*/}
if [[ "$file" == *.h ]]
then
headers+=(${fil2})
else
sources+=(${fil2})
fi
done
echo
done
echo "=========================="
echo "Copied handler and object files and replaced strings within files."
# echo what to do next:
echo "=========================="
echo "Next steps:"
echo
echo "=> Include Files in CMakeLists.txt by adding the following lines:"
echo "SET(SRCS_exe"
echo " [...]"
echo "vvvvvvvvvvvvvvvvvvvvvvvvvv"
for source in "${sources[@]}"; do
echo " ${source}"
done
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo ")"
echo "SET(HDRS_exe"
echo " [...]"
echo "vvvvvvvvvvvvvvvvvvvvvvvvvv"
for head in "${headers[@]}"; do
echo " ${head}"
done
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo ")"