- Copied complete Lts/Tools directory from qt5-before to qt6-after - Updated 32 CMakeLists.txt files (Qt5:: → Qt6::) - Tools subdirectory already included in parent Lts/CMakeLists.txt - All 72 tool submodules now present in qt6-migrated-legatus - Includes: Adler, ArAssets, ConfigX, DBAdministration, DBUpdate, DdsView, InfrastructureManagement, and 67 more tools - C++17 standard (RTI 7.7.0 compatibility maintained) - Tests deferred until final validation phase Migration progress: ✅ Lts/Application (68 files) ✅ Lts/DDS (verified Qt6-ready) ✅ Lts/Plugins (60 submodules, verified) ✅ Lts/Projects (5 submodules, verified) ✅ Lts/Proxies (13 submodules, verified) ✅ Lts/Services (47 submodules, verified) ✅ Lts/Tools (72 submodules, copied + CMake updated) ✅ Lts/Viewer (LtsFileDialog, LtsReportDisplay, SituationMap) 🟡 TetraIF (partial) 🟡 Z (partial: nglwidgets, QtSingleApplication, qsql_informix, WMS_Interface)
63 lines
1.6 KiB
Go
Executable File
63 lines
1.6 KiB
Go
Executable File
package participanthandler
|
|
|
|
import (
|
|
"log"
|
|
"math"
|
|
"time"
|
|
)
|
|
|
|
// degreesToRadians konvertiert Grad in Radiant.
|
|
// degrees: Der Winkel in Grad.
|
|
// Rückgabewert: Der Winkel in Radiant.
|
|
func degreesToRadians(degrees float64) float64 {
|
|
return degrees * (math.Pi / 180)
|
|
}
|
|
|
|
// ChangePosition ändert die Position eines Geräts.
|
|
// equipmentNumber: Die Nummer des Geräts, dessen Position geändert werden soll.
|
|
// geoPosition: Die neue geografische Position des Geräts.
|
|
// Rückgabewert: Gibt einen Fehler zurück, falls die Änderung fehlschlägt.
|
|
func (c *ParticipantHandler) ChangePosition(equipmentNumber int, geoPosition *GeoPosition) error {
|
|
log.Println(equipmentNumber, geoPosition)
|
|
|
|
// Erstellen einer Anfrage zur Änderung der Position
|
|
req := PositionChangeRequest{
|
|
Data: struct {
|
|
Header struct {
|
|
EquipmentNumber int `json:"equipmentNumber"`
|
|
TimeStamp int `json:"timeStamp"`
|
|
} `json:"header"`
|
|
GeoPosition struct {
|
|
Lon float64 `json:"lon"`
|
|
Lat float64 `json:"lat"`
|
|
Z float64 `json:"z"`
|
|
} `json:"geoPosition"`
|
|
}{
|
|
Header: struct {
|
|
EquipmentNumber int `json:"equipmentNumber"`
|
|
TimeStamp int `json:"timeStamp"`
|
|
}{
|
|
EquipmentNumber: equipmentNumber,
|
|
TimeStamp: int(time.Now().UnixMilli()),
|
|
},
|
|
GeoPosition: struct {
|
|
Lon float64 `json:"lon"`
|
|
Lat float64 `json:"lat"`
|
|
Z float64 `json:"z"`
|
|
}{
|
|
Lon: degreesToRadians(geoPosition.Lng),
|
|
Lat: degreesToRadians(geoPosition.Lat),
|
|
Z: 0.0,
|
|
},
|
|
},
|
|
TypeID: 21,
|
|
}
|
|
|
|
// Senden der Anfrage über den MariusSocket
|
|
if err := c.MariusSocket.WriteJSON(req); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|