Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+174
@@ -0,0 +1,174 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
#
|
||||
#
|
||||
# --- Executable svcHighLevelArchitecture (svcHLA) -------------------------------------------------
|
||||
#
|
||||
|
||||
SET(xml_FILE hla_service.xml)
|
||||
|
||||
SET(SRCS_exe
|
||||
aes_handler.cpp
|
||||
aes_handler.h
|
||||
dds_handler.cpp
|
||||
dds_handler.h
|
||||
main.cpp
|
||||
main_handler.cpp
|
||||
main_handler.h
|
||||
ngs_connector.cpp
|
||||
ngs_connector.h
|
||||
ngs_handler.cpp
|
||||
ngs_handler.h
|
||||
# ngs_connector_dis.cpp
|
||||
# ngs_connector_dis.h
|
||||
ppm_handler.cpp
|
||||
ppm_handler.h
|
||||
# aesmath.cpp
|
||||
# aesmath.h
|
||||
damage_model.cpp
|
||||
damage_model.h
|
||||
|
||||
web_socket_handler.cpp
|
||||
web_socket_handler.h
|
||||
|
||||
rpr/rpr_global.h
|
||||
# rpr/rpr_ia_actionrequest.cpp
|
||||
# rpr/rpr_ia_actionrequest.h
|
||||
# rpr/rpr_ia_actionresponse.cpp
|
||||
# rpr/rpr_ia_actionresponse.h
|
||||
# rpr/rpr_ia_acknowledge.cpp
|
||||
# rpr/rpr_ia_acknowledge.h
|
||||
rpr/rpr_ia_munitiondetonation.cpp
|
||||
rpr/rpr_ia_munitiondetonation.h
|
||||
# rpr/rpr_ia_startresume.cpp
|
||||
# rpr/rpr_ia_startresume.h
|
||||
# rpr/rpr_ia_stopfreeze.cpp
|
||||
# rpr/rpr_ia_stopfreeze.h
|
||||
rpr/rpr_ia_weaponfire.cpp
|
||||
rpr/rpr_ia_weaponfire.h
|
||||
rpr/rpr_ia_guez_init.cpp
|
||||
rpr/rpr_ia_guez_init.h
|
||||
rpr/rpr_ia_guez_requestbitereport.cpp
|
||||
rpr/rpr_ia_guez_requestbitereport.h
|
||||
rpr/rpr_ia_guez_bitereport.cpp
|
||||
rpr/rpr_ia_guez_bitereport.h
|
||||
# rpr/rpr_ia_guez_exconengagement.cpp
|
||||
# rpr/rpr_ia_guez_exconengagement.h
|
||||
rpr/rpr_ia_guez_hit.cpp
|
||||
rpr/rpr_ia_guez_hit.h
|
||||
|
||||
rpr/rpr_observer_aggregateentity_object_cb.h
|
||||
rpr/rpr_observer_aggregateentity_object_instance_cb.h
|
||||
rpr/rpr_observer_aircraft_cb_notifier.h
|
||||
rpr/rpr_observer_aircraft_object_cb.h
|
||||
rpr/rpr_observer_aircraft_object_instance_cb.h
|
||||
rpr/rpr_observer_baseentity_object_cb.h
|
||||
rpr/rpr_observer_baseentity_object_instance_cb.h
|
||||
rpr/rpr_observer_groundvehicle_cb_notifier.h
|
||||
rpr/rpr_observer_groundvehicle_object_cb.h
|
||||
rpr/rpr_observer_groundvehicle_object_instance_cb.h
|
||||
rpr/rpr_observer_human_cb_notifier.h
|
||||
rpr/rpr_observer_human_object_cb.h
|
||||
rpr/rpr_observer_human_object_instance_cb.h
|
||||
rpr/rpr_observer_lifeform_object_cb.h
|
||||
rpr/rpr_observer_lifeform_object_instance_cb.h
|
||||
rpr/rpr_observer_object_cb.h
|
||||
rpr/rpr_observer_object_instance_cb.h
|
||||
rpr/rpr_observer_physicalentity_object_cb.h
|
||||
rpr/rpr_observer_physicalentity_object_instance_cb.h
|
||||
rpr/rpr_observer_platform_object_cb.h
|
||||
rpr/rpr_observer_platform_object_instance_cb.h
|
||||
# rpr/rpr_observer_surfacevessel_cb_notifier.h
|
||||
# rpr/rpr_observer_surfacevessel_object_cb.h
|
||||
# rpr/rpr_observer_surfacevessel_object_instance_cb.h
|
||||
# rpr/rpr_observer_guez_aircraft_cb_notifier.h
|
||||
# rpr/rpr_observer_guez_aircraft_object_cb.h
|
||||
# rpr/rpr_observer_guez_aircraft_object_instance_cb.h
|
||||
rpr/rpr_observer_guez_groundvehicle_cb_notifier.h
|
||||
rpr/rpr_observer_guez_groundvehicle_object_cb.h
|
||||
rpr/rpr_observer_guez_groundvehicle_object_instance_cb.h
|
||||
rpr/rpr_observer_guez_human_cb_notifier.h
|
||||
rpr/rpr_observer_guez_human_object_cb.h
|
||||
rpr/rpr_observer_guez_human_object_instance_cb.h
|
||||
rpr/rpr_observer_guez_observer_controller_cb_notifier.h
|
||||
rpr/rpr_observer_guez_observer_controller_object_cb.h
|
||||
rpr/rpr_observer_guez_observer_controller_object_instance_cb.h
|
||||
|
||||
rpr/rpr_observer_environment_object_object_cb.h
|
||||
rpr/rpr_observer_environment_object_object_instance_cb.h
|
||||
rpr/rpr_observer_areal_object_object_cb.h
|
||||
rpr/rpr_observer_areal_object_object_instance_cb.h
|
||||
rpr/rpr_observer_other_areal_object_object_cb.h
|
||||
rpr/rpr_observer_other_areal_object_object_instance_cb.h
|
||||
|
||||
rpr/rpr_observer_point_object_object_cb.h
|
||||
rpr/rpr_observer_point_object_object_instance_cb.h
|
||||
rpr/rpr_observer_other_point_object_object_cb.h
|
||||
rpr/rpr_observer_other_point_object_object_instance_cb.h
|
||||
|
||||
rpr/rpr_observer_guez_minefield_cb_notifier.h
|
||||
rpr/rpr_observer_guez_minefield_object_cb.h
|
||||
rpr/rpr_observer_guez_minefield_object_instance_cb.h
|
||||
rpr/rpr_observer_guez_minefield_breach_cb_notifier.h
|
||||
rpr/rpr_observer_guez_minefield_breach_object_cb.h
|
||||
rpr/rpr_observer_guez_minefield_breach_object_instance_cb.h
|
||||
# rpr/rpr_observer_guez_fire_support_cb_notifier.h
|
||||
# rpr/rpr_observer_guez_fire_support_object_cb.h
|
||||
# rpr/rpr_observer_guez_fire_support_object_instance_cb.h
|
||||
# rpr/rpr_observer_guez_fire_support_single_shot_cb_notifier.h
|
||||
# rpr/rpr_observer_guez_fire_support_single_shot_object_cb.h
|
||||
# rpr/rpr_observer_guez_fire_support_single_shot_object_instance_cb.h
|
||||
# rpr/rpr_observer_guez_chemical_agent_area_cb_notifier.h
|
||||
# rpr/rpr_observer_guez_chemical_agent_area_object_cb.h
|
||||
# rpr/rpr_observer_guez_chemical_agent_area_object_instance_cb.h
|
||||
# rpr/rpr_observer_guez_nuclear_agent_area_cb_notifier.h
|
||||
# rpr/rpr_observer_guez_nuclear_agent_area_object_cb.h
|
||||
# rpr/rpr_observer_guez_nuclear_agent_area_object_instance_cb.h
|
||||
|
||||
)
|
||||
# Due to debug output for EntityTypeStruct
|
||||
SET_SOURCE_FILES_PROPERTIES(ngs_connector.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
|
||||
|
||||
# make sure xml file is properly installed
|
||||
CODEGEN_HANDLE_SVC_XML(SRCS_exe ${xml_FILE})
|
||||
|
||||
NGL_ADD_SVC_ICON(SRCS_exe)
|
||||
NGL_ADD_EXECUTABLE(HLA svcHighLevelArchitecture ${SRCS_exe})
|
||||
NGL_TARGET_LINK_LIBRARIES(svcHighLevelArchitecture
|
||||
ddsconnector
|
||||
LtsCommandLineParser
|
||||
LtsCoordTrans
|
||||
nglcoreapplication
|
||||
NGLLogger
|
||||
nglsettings
|
||||
Qt5::Core
|
||||
Qt5::Network
|
||||
Qt5::WebSockets
|
||||
svcAesClient
|
||||
svcCoreClient
|
||||
svcExmClient
|
||||
svcPdmClient
|
||||
svcPpmClient
|
||||
svcTabServer
|
||||
svcTabClient
|
||||
ngltools
|
||||
LtsUtilsDds
|
||||
NGS::NGS
|
||||
HlaCommon
|
||||
tabTelegrams
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(svcHighLevelArchitecture)
|
||||
NGL_INSTALL(HLA FILES
|
||||
log4cxx_hla.props
|
||||
swconf.cfg
|
||||
DESTINATION bin)
|
||||
NGL_INSTALL(HLA FILES
|
||||
RPRFOM20d17E_saabNov2021.xml
|
||||
DESTINATION bin RENAME RPRFOM20d17E.xml)
|
||||
NGL_ADD_TARGET_LINK(svcHighLevelArchitecture pHLA)
|
||||
NGL_INSTALL(HLA FILES
|
||||
lts-cc.hla.conf
|
||||
DESTINATION . RENAME lts-cc.hla.conf.distrib)
|
||||
+22418
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,59 @@
|
||||
ObjectClass: GuezAircraft: Aircraft // Guez Specific Aircraft
|
||||
Attribute: TacticalStatus: TacticalStatusStruct // The VBG/VBA/TotalStatus
|
||||
|
||||
ObjectClass: GuezGroundVehicle: GroundVehicle // Guez Specific GroundVehicle
|
||||
Attribute: TacticalStatus: TacticalStatusStruct // The VBG/VBA/TotalStatus
|
||||
|
||||
ObjectClass: GuezHuman: Human // Guez Specific Human Lifeform
|
||||
Attribute: TacticalStatus: TacticalStatusStruct // The VBG/VBA/TotalStatus
|
||||
|
||||
ObjectClass: GuezObserverController: Human // Guez Specific Observer / Controller
|
||||
|
||||
ObjectClass: GuezChemicalAgentArea: OtherArealObject // Guez Chemical Agent Area
|
||||
Attribute: AreaEffectSimulationName: OMT13string // name of the AreaEffectSimulation
|
||||
Attribute: ActivationTime: ClockTimeStruct // GPS ActivationTime
|
||||
Attribute: Duration: Unsignedinteger32BE // Duration in seconds. 0=unlimited, 1-240 minutes, resolution: 1 minute
|
||||
Attribute: DetonationLocation: WorldLocationStruct // Optional: Location of the impact of the chemical agent
|
||||
Attribute: Radius: HLAfloat64BE // Optional: The radius of the chemical area
|
||||
Attribute: ChemicalAgentType: ChemicalAgentTypeEnum8 // The chemical agent used
|
||||
Attribute: IsPermanentAgent: HLAboolean // true for a permanent agent, false for a non permanent agent
|
||||
|
||||
ObjectClass: GuezFireSupport: OtherArealObject // Guez Fire Support
|
||||
Attribute: AreaEffectSimulationName: OMT13string // name of the AreaEffectSimulation
|
||||
Attribute: ActivationTime: ClockTimeStruct // GPS ActivationTime
|
||||
Attribute: Duration: Unsignedinteger32BE // Duration in seconds. 0=unlimited, 1-1800 seconds
|
||||
Attribute: Rounds: Unsignedinteger32BE // 1-1000
|
||||
Attribute: MunitionType: EntityTypeStruct // The munition type used
|
||||
Attribute: FirePositions: ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray // Positions of the single impacts
|
||||
Attribute: FireState: ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array // BitArray of the single impacts, whether an impact already occured or not.
|
||||
|
||||
ObjectClass: GuezFireSupportSingleShot: OtherPointObject // Guez Fire Support Single Shot
|
||||
Attribute: AreaEffectSimulationName: OMT13string // name of the AreaEffectSimulation
|
||||
Attribute: ActivationTime: ClockTimeStruct // GPS ActivationTime
|
||||
Attribute: DetonationLocation: WorldLocationStruct // Optional: The planned location of the impact. Note: A MunitionDetonation must be sent nevertheless
|
||||
Attribute: Radius: HLAfloat64BE // The radius of the affected area
|
||||
Attribute: MunitionType: EntityTypeStruct // The munition type used
|
||||
|
||||
ObjectClass: GuezMineField: OtherArealObject // Guez Mine Field
|
||||
Attribute: AreaEffectSimulationName: OMT13string // name of the AreaEffectSimulation
|
||||
Attribute: ActivationTime: ClockTimeStruct // GPS ActivationTime
|
||||
Attribute: Duration: Unsignedinteger32BE // Duration in seconds. 0=unlimited, 1-240 minutes, resolution: 1 minute
|
||||
Attribute: MineType: EntityTypeStruct //
|
||||
Attribute: MineCount: Unsignedinteger32BE //
|
||||
Attribute: MinePositions: ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray //
|
||||
Attribute: MineState: ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array // BitArray of the single mines, whether mine is already triggered or not.
|
||||
Attribute: Width: Unsignedinteger32BE // Width of the minefield (segment)
|
||||
Attribute: Length: Unsignedinteger32BE // Length of the minefield (segment)
|
||||
|
||||
ObjectClass: GuezMineFieldBreach: OtherArealObject // Guez Mine Field Breach
|
||||
Attribute: AreaEffectSimulationName: OMT13string // name of the AreaEffectSimulation
|
||||
Attribute: ActivationTime: ClockTimeStruct // GPS ActivationTime
|
||||
|
||||
ObjectClass: GuezNuclearAgentArea: OtherArealObject // Guez Mine Field Breach
|
||||
Attribute: AreaEffectSimulationName: OMT13string // name of the AreaEffectSimulation
|
||||
Attribute: ActivationTime: ClockTimeStruct // GPS ActivationTime
|
||||
Attribute: Duration: Unsignedinteger32BE // Duration in 10 minutes, 0=unlimited, up to 1000 -> 10000 minutes
|
||||
Attribute: DetonationLocation: WorldLocationStruct // Optional: Location of the impact of a nuclear ammunition
|
||||
Attribute: Radius: HLAfloat64BE // The radius of the affected area
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
DynamicArray: ErrorStructVariableArray : ErrorStruct [] : HLAvariableArray //
|
||||
|
||||
FixedRecord: TacticalStatusStruct // TacticalStatus
|
||||
Field: TacticalStatus: TacticalStatusEnum8 // current tactical status
|
||||
Field: VulnerabilityKind: Unsignedinteger32BE // index of ADAG
|
||||
Field: TotalStatus: TotalStatusEnum32 // detailed status of all vulnerabilities that occured
|
||||
|
||||
FixedRecord: BiteResultStruct //
|
||||
Field: DeviceOkay: CanDeviceEnum32 // Bits that are set identify working devices
|
||||
Field: BatteryWarning: BatteryWarningEnum32 // Bit set to identify devices with low battery
|
||||
Field: ErrorCodes: ErrorStructVariableArray // Array of Error Codes (0-21)
|
||||
|
||||
FixedRecord: ErrorStruct //
|
||||
Field: DeviceId: Unsignedinteger16BE // Device Id on CAN Bus
|
||||
Field: SubDeviceId: Unsignedinteger16BE // Subdevice Id within the device
|
||||
Field: UniqueSubdeviceId: Unsignedinteger32BE // Unique Subdevice Id
|
||||
Field: ErrorId: Unsignedinteger32BE // Specific Error Id of the Device / Subdevice Combination
|
||||
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
Enumeration: ActivateHelmetObservationEnum8: HLAoctet
|
||||
Enumerator: NoChange: 0 //
|
||||
Enumerator: WithoutHelmetWithoutVest: 1 //
|
||||
Enumerator: HelmetWithoutVest: 2 // (unused)
|
||||
Enumerator: HelmetAndVest: 3 //
|
||||
|
||||
Enumeration: CanDeviceEnum32: Unsignedinteger32BE // Aka BiteStatusCANBusEnum32, ActualConfigurationEnum32, different from Doc
|
||||
Enumerator: TNE: 1 //
|
||||
Enumerator: AGDUS: 2 //
|
||||
Enumerator: ABE: 4 //
|
||||
Enumerator: SpecialSensorFIR: 8 //
|
||||
Enumerator: SpecialSensorMV: 16 //
|
||||
Enumerator: SpecialSensorStd: 32 //
|
||||
Enumerator: MhgrSensor: 64 //
|
||||
Enumerator: AbcOverpressureSensor: 128 //
|
||||
Enumerator: AbcFlowDetector: 256 //
|
||||
Enumerator: WeaponEffect: 512 //
|
||||
Enumerator: SRT: 1024 //
|
||||
Enumerator: DMF: 2048 //
|
||||
Enumerator: IedSensor: 4096 //
|
||||
Enumerator: IedControlDevice: 8192 //
|
||||
|
||||
Enumeration: BatteryWarningEnum32: Unsignedinteger32BE
|
||||
Enumerator: BatteryWarningTNE: 1 //
|
||||
Enumerator: BatteryWarningAbcFilter: 16 //
|
||||
Enumerator: BatteryWarningWeapon: 32 //
|
||||
Enumerator: BatteryWarningHelmet: 64 //
|
||||
|
||||
Enumeration: ResetPlayerEnum8: HLAoctet
|
||||
Enumerator: NoChange: 0 //
|
||||
Enumerator: AfterExercisePause: 1 // (unused)
|
||||
Enumerator: CombatReadyWithoutReammunition: 2 //
|
||||
Enumerator: CombatReadyWithReammunition: 3 //
|
||||
|
||||
Enumeration: BiteReportTypeEnum8: HLAoctet
|
||||
Enumerator: CurrentStatus: 0 //
|
||||
Enumerator: StatusAfterSelftest: 1 //
|
||||
|
||||
Enumeration: RegistrationTypeEnum8: HLAoctet
|
||||
Enumerator: NoChange: 0 //
|
||||
Enumerator: NewRegistration: 1 //
|
||||
Enumerator: ReRegistration: 2 //
|
||||
|
||||
Enumeration: TacticalStatusEnum8 : HLAoctet
|
||||
Enumerator: CombatReady: 0 //
|
||||
Enumerator: LightHit: 1 //
|
||||
Enumerator: MediumHit: 2 //
|
||||
Enumerator: HeavyHit: 3 //
|
||||
Enumerator: Immobilized: 4 //
|
||||
Enumerator: ImmobilizedVisible: 5 //
|
||||
Enumerator: WeaponKill: 6 //
|
||||
Enumerator: WeaponKillVisible: 7 //
|
||||
Enumerator: TotalKill: 8 //
|
||||
Enumerator: TemporaryFailure: 9 //
|
||||
Enumerator: NearMiss: 10 //
|
||||
Enumerator: HitWithoutEffect: 11 //
|
||||
|
||||
Enumeration: ChemicalAgentTypeEnum8: HLAoctet
|
||||
Enumerator: Other: 0 //
|
||||
Enumerator: SLost: 1 //
|
||||
Enumerator: Sarin: 2 //
|
||||
Enumerator: VX: 3 //
|
||||
|
||||
Enumeration: TotalStatusEnum32 : Unsignedinteger32BE
|
||||
Enumerator: CombatReady: 1 //
|
||||
Enumerator: LightHit: 2 //
|
||||
Enumerator: MediumHit: 4 //
|
||||
Enumerator: HeavyHit: 8 //
|
||||
Enumerator: Immobilized: 16 //
|
||||
Enumerator: ImmobilizedVisible: 32 //
|
||||
Enumerator: WeaponKill: 64 //
|
||||
Enumerator: WeaponKillVisible: 128 //
|
||||
Enumerator: TotalKill: 256 //
|
||||
Enumerator: TemporaryFailure: 512 //
|
||||
Enumerator: NearMiss: 1024 //
|
||||
Enumerator: HitWithoutEffect: 2048 //
|
||||
Enumerator: AContamination: 16384 //
|
||||
Enumerator: CContamination: 65536 //
|
||||
Enumerator: Manipulation: 131072 //
|
||||
|
||||
Enumeration: OriginatorTypeEnum16: Unsignedinteger16BE
|
||||
Enumerator: Unknown: 0 //
|
||||
Enumerator: Participant: 1 //
|
||||
Enumerator: AreaEffectSimulation: 2 //
|
||||
Enumerator: ObserverController: 3 //
|
||||
Enumerator: ExerciseControl: 4 //
|
||||
Enumerator: NoMedicalTreatment: 5 //
|
||||
|
||||
Enumeration: HitResultEnum16: Unsignedinteger16BE
|
||||
Enumerator: Reset: 0 //
|
||||
Enumerator: LightDamage: 1 //
|
||||
Enumerator: MediumDamage: 2 //
|
||||
Enumerator: HeavyDamage: 3 //
|
||||
Enumerator: MobilityKill: 4 //
|
||||
Enumerator: MobilityKillVisible: 5 //
|
||||
Enumerator: WeaponDamage: 6 //
|
||||
Enumerator: WeaponDamageVisible: 7 //
|
||||
Enumerator: TotalKill: 8 //
|
||||
Enumerator: CheatingKill: 9 //
|
||||
Enumerator: NearMiss: 10 //
|
||||
Enumerator: HitWithNoEffect: 11 //
|
||||
Enumerator: Contaminated: 12 //
|
||||
Enumerator: TemporaryFailure: 13 //
|
||||
@@ -0,0 +1,29 @@
|
||||
InteractionClass: GuezBiteReport: HLAinteractionRoot //
|
||||
Parameter: EntityIdentifier: EntityIdentifierStruct //
|
||||
Parameter: ReportTime: ClockTimeStruct // GPS Time of the report
|
||||
Parameter: RegistrationType: RegistrationTypeEnum8 // Type of RegistrationType
|
||||
Parameter: BiteResult: BiteResultStruct // List of available CAN devices
|
||||
Parameter: ConfigurationComparisonResult: HLAboolean //
|
||||
Parameter: DiscoveredDevices: CanDeviceEnum32 //
|
||||
|
||||
InteractionClass: GuezExconEngagement: HLAinteractionRoot //
|
||||
Parameter: EntityIdentifier: EntityIdentifierStruct //
|
||||
Parameter: EngagementTime: ClockTimeStruct // GPS Time of the engagement
|
||||
Parameter: TacticalStatus: TacticalStatusStruct // The new status of the player
|
||||
|
||||
InteractionClass: GuezInit: HLAinteractionRoot //
|
||||
Parameter: EntityIdentifier: EntityIdentifierStruct //
|
||||
Parameter: ResetPlayer: ResetPlayerEnum8 // Reset a player to a specific status
|
||||
Parameter: ActivateHelmetObservation: ActivateHelmetObservationEnum8 // If player wears helmet/vest or not
|
||||
|
||||
InteractionClass: GuezRequestBiteReport: HLAinteractionRoot //
|
||||
Parameter: EntityIdentifier: EntityIdentifierStruct //
|
||||
Parameter: BiteReportType: BiteReportTypeEnum8 // The type of the BiteReportType
|
||||
|
||||
InteractionClass: GuezHit: HLAinteractionRoot //
|
||||
Parameter: TargetIdentifier: EntityIdentifierStruct //
|
||||
Parameter: TargetLocation: WorldLocationStruct //
|
||||
Parameter: OriginatorIdentifier: EntityIdentifierStruct //
|
||||
Parameter: OriginatorType: OriginatorTypeEnum16 //
|
||||
Parameter: HitResult: HitResultEnum16 //
|
||||
Parameter: Munition: EntityTypeStruct //
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
cp /opt/NGS/NGSPublic/env/*.xsd .
|
||||
/opt/NGS/NGSPublic/exe/fombuild -append RPRFOM20d17E.xml RPRFOM20d17E_guez.xml SUGEClasses.fom SUGEInteractions.fom SUGEData.fom SUGEEnum.fom
|
||||
sed -i -f sed.txt RPRFOM20d17E_guez.xml
|
||||
rm *.xsd
|
||||
mv RPRFOM20d17E_guez.xml ..
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
s#[ ]*$##g
|
||||
s# xmlns=""##g
|
||||
/<dimensions>NA<\/dimensions>/d
|
||||
s#\(units notes=.*\)>NA</units>#\1/>#g
|
||||
|
||||
+23617
File diff suppressed because it is too large.
Load diff
+23747
File diff suppressed because it is too large.
Load diff
+1125
File diff suppressed because it is too large.
Load diff
+117
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* Send AES data to NGS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Baeuerle, SLSE, 2017-05-08
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QHash>
|
||||
#include <QSet>
|
||||
|
||||
#include <AreaEffectSimulation/aes_dtc.h>
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#include <AreaEffectSimulation/Utils/aes_helper.h>
|
||||
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
#include <Common/logger.h>
|
||||
#include <Common/typestruct.h>
|
||||
|
||||
|
||||
#define SUPPORT_AES_EFFECTS // GUEZE-2570 / EXPLOSION_CLUSTER
|
||||
#define SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT // GUEZE-2570 / EXPLOSION_CLUSTER
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// namespace HighLevelArchitecture
|
||||
//------------------------------------------------------------------------------
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
class NgsHandler;
|
||||
struct ParticipantPosition;
|
||||
|
||||
class AesHandler : public QObject
|
||||
, protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::MineAreaRemoveReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::MineCorridorModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::MineCorridorRemoveReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::ExplosionSingleModifyReplyHandler
|
||||
#ifdef SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
|
||||
, protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterSingleEffectOnlyModifyReplyHandler
|
||||
#endif // SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AesHandler(NgsHandler *ngsHandler);
|
||||
|
||||
void onMineAreaModifyReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
void onMineAreaRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
void onMineCorridorModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
void onMineCorridorRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
void onExplosionSingleModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
#ifdef SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
|
||||
void onExplosionClusterSingleEffectOnlyModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
#endif // SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
|
||||
|
||||
int64_t externalId(int aesItemId) const;
|
||||
bool init();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType);
|
||||
void onTriggeredImpactsChanged(const AreaEffectSimulation::TriggeredImpacts &data, DataModification modType);
|
||||
|
||||
#ifdef SUPPORT_AES_EFFECTS
|
||||
void onEffectsChanged(const AreaEffectSimulation::Effects &data, DataModification modType);
|
||||
#endif // SUPPORT_AES_EFFECTS
|
||||
|
||||
void onAesExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType);
|
||||
void onAesMineAreaChanged(const AreaEffectSimulation::MineArea &data, DataModification modType);
|
||||
void onAesMineCorridorChanged(const AreaEffectSimulation::MineCorridor &data, DataModification modType);
|
||||
void onAesNContaminationChanged(const AreaEffectSimulation::NContamination &data, DataModification modType);
|
||||
void onAesBCContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType);
|
||||
|
||||
void onAesNameChanged(qint64 identifierInt, const std::string &newName);
|
||||
void onAesActivationTimeChanged(qint64 identifierInt, qint64 msecsSinceEpoch);
|
||||
void onAesForceIdentifierChanged(qint64 identifierInt, int partyId);
|
||||
void onAesDurationChanged(qint64 identifierInt, quint32 u_time);
|
||||
void onAesChargeChanged(qint64 identifierInt, int chargeTypeId);
|
||||
void onAesPointsDataChanged(qint64 identifierInt, const std::vector<Core::GeoPosition2D> &pos);
|
||||
void onAesRemoveItem(qint64 identifierInt);
|
||||
|
||||
bool onNewMinefield(const AreaEffectSimulation::MineAreaModifyRequest &ma);
|
||||
bool onNewMinefieldBreach(const AreaEffectSimulation::MineCorridorModifyRequest &mc);
|
||||
void onMunitionDetonation(const AreaEffectSimulation::ExplosionSingleModifyRequest &es);
|
||||
#ifdef SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
|
||||
void onMunitionDetonationExplosionClusterSingleEffect(const AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest &es);
|
||||
#endif // SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
|
||||
|
||||
private:
|
||||
template <typename T>
|
||||
void onSendRequest(const T &item);
|
||||
template <typename T>
|
||||
void addRequestToQueue(int aesItemId, T *request);
|
||||
|
||||
static bool isModifiable(const AreaEffectSimulation::AesItem &item);
|
||||
private:
|
||||
NgsHandler *m_ngsHandler;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_ftcAes;
|
||||
QMap<int32_t, AreaEffectSimulation::AesItemView> m_aesItemViews;
|
||||
QMap<int32_t, QVector<int32_t> > m_takenIndicesForAesItem; // Indices for ExplosionAreas that are already fired.
|
||||
#ifdef SUPPORT_AES_EFFECTS
|
||||
AreaEffectSimulation::HandledImpactsStorage m_handledImpactsStorage; // for ExplosionCluster
|
||||
#endif // SUPPORT_AES_EFFECTS
|
||||
|
||||
QMap<int, void*> m_pendingRequests;
|
||||
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
} // namespace HighLevelArchitecture
|
||||
+284
@@ -0,0 +1,284 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Damage state transaformation from/to HLA <-> Excon, see ICD, 4.4.3.5.6 - Damage Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "damage_model.h"
|
||||
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
// ICD, 4.4.3.5.6 - Damage Model
|
||||
// es sind dort nich alle definiert, die Reihenfolge ist DamageState - FirePower - Immobilized
|
||||
DamageModel::DamageModel(const IdentifierStruct &is,
|
||||
const rpr2::TacticalStatusStruct &state)
|
||||
: m_is(is)
|
||||
{
|
||||
initTimer();
|
||||
setTacticalStatusStruct(state, QDateTime::currentMSecsSinceEpoch());
|
||||
}
|
||||
|
||||
DamageModel::DamageModel(const rpr2::TacticalStatusStruct &state)
|
||||
{
|
||||
setTacticalStatusStruct(state, QDateTime::currentMSecsSinceEpoch());
|
||||
}
|
||||
|
||||
rpr2::DamageStatusEnum32::ET DamageModel::damageState(qint64 simTimeMSec) const
|
||||
{
|
||||
int idx = indexForTime(simTimeMSec);
|
||||
if (idx < 0)
|
||||
return rpr2::DamageStatusEnum32::NoDamage;
|
||||
|
||||
// Todo: Correct?!?
|
||||
switch (m_tacticalStates.at(idx).tss.TacticalStatus)
|
||||
{
|
||||
case rpr2::TacticalStatusEnum8::CombatReady:
|
||||
return rpr2::DamageStatusEnum32::NoDamage;
|
||||
|
||||
case rpr2::TacticalStatusEnum8::Immobilized:
|
||||
case rpr2::TacticalStatusEnum8::ImmobilizedVisible:
|
||||
case rpr2::TacticalStatusEnum8::LightHit:
|
||||
return rpr2::DamageStatusEnum32::SlightDamage;
|
||||
|
||||
case rpr2::TacticalStatusEnum8::WeaponKill:
|
||||
case rpr2::TacticalStatusEnum8::WeaponKillVisible:
|
||||
case rpr2::TacticalStatusEnum8::MediumHit:
|
||||
case rpr2::TacticalStatusEnum8::HeavyHit:
|
||||
return rpr2::DamageStatusEnum32::ModerateDamage;
|
||||
|
||||
case rpr2::TacticalStatusEnum8::TotalKill:
|
||||
return rpr2::DamageStatusEnum32::Destroyed;
|
||||
|
||||
case rpr2::TacticalStatusEnum8::HitWithoutEffect:
|
||||
case rpr2::TacticalStatusEnum8::TemporaryFailure:
|
||||
case rpr2::TacticalStatusEnum8::NearMiss:
|
||||
return rpr2::DamageStatusEnum32::NoDamage;
|
||||
}
|
||||
return rpr2::DamageStatusEnum32::NoDamage;
|
||||
}
|
||||
|
||||
rpr2::TotalStatusEnum32::ET DamageModel::totalState(qint64 simTimeMSec) const
|
||||
{
|
||||
int idx = indexForTime(simTimeMSec);
|
||||
if (idx < 0)
|
||||
return rpr2::TotalStatusEnum32::CombatReady;
|
||||
return m_tacticalStates.at(idx).tss.TotalStatus;
|
||||
}
|
||||
|
||||
bool DamageModel::immobilized(qint64 simTimeMSec) const
|
||||
{
|
||||
int idx = indexForTime(simTimeMSec);
|
||||
if (idx < 0)
|
||||
return false;
|
||||
return m_tacticalStates.at(idx).tss.TotalStatus & (rpr2::TotalStatusEnum32::Immobilized | rpr2::TotalStatusEnum32::ImmobilizedVisible);
|
||||
}
|
||||
|
||||
bool DamageModel::firePowerDisabled(qint64 simTimeMSec) const
|
||||
{
|
||||
int idx = indexForTime(simTimeMSec);
|
||||
if (idx < 0)
|
||||
return false;
|
||||
return m_tacticalStates.at(idx).tss.TotalStatus & (rpr2::TotalStatusEnum32::WeaponKill | rpr2::TotalStatusEnum32::WeaponKillVisible);
|
||||
}
|
||||
|
||||
static inline bool checkManipulationChanged(const rpr2::TacticalStatusStruct &oldTss,
|
||||
const rpr2::TacticalStatusStruct &newTss)
|
||||
{
|
||||
return
|
||||
(oldTss.TotalStatus & rpr2::TotalStatusEnum32::Manipulation) !=
|
||||
(newTss.TotalStatus & rpr2::TotalStatusEnum32::Manipulation);
|
||||
}
|
||||
|
||||
void DamageModel::setTacticalStatusStruct(const rpr2::TacticalStatusStruct &state, qint64 simTimeMSec)
|
||||
{
|
||||
bool bManipulationChanged = true;
|
||||
const int idx = indexForTime(simTimeMSec);
|
||||
if (idx > 0 && m_tacticalStates.at(idx).timeStamp == simTimeMSec)
|
||||
{
|
||||
// already there...
|
||||
if (state == m_tacticalStates.at(idx).tss)
|
||||
return;
|
||||
bManipulationChanged = checkManipulationChanged(m_tacticalStates.at(idx).tss, state);
|
||||
m_tacticalStates[idx].tss = state;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (idx >= 0)
|
||||
bManipulationChanged = checkManipulationChanged(m_tacticalStates.at(idx).tss, state);
|
||||
|
||||
TacticalStatusStructWithTimeStamp tssTs;
|
||||
tssTs.tss = state;
|
||||
tssTs.timeStamp = simTimeMSec;
|
||||
m_tacticalStates.insert(idx + 1, std::move(tssTs)); // idx = -1 -> oldest, will become index 0
|
||||
}
|
||||
|
||||
while (m_tacticalStates.size() > 10)
|
||||
m_tacticalStates.pop_front();
|
||||
|
||||
if (bManipulationChanged)
|
||||
emit playerManipulationChanged(m_is.entityNumber(), state.TotalStatus & rpr2::TotalStatusEnum32::Manipulation, simTimeMSec);
|
||||
}
|
||||
|
||||
void DamageModel::setTacticalStatusStructWithTimestamp(TacticalStatusStructWithTimeStamp &tssTs, const rpr2::HitResultEnum16::ET &state, qint64 simTimeMSec)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case rpr2::HitResultEnum16::Reset:
|
||||
tssTs.tss.TotalStatus = rpr2::TotalStatusEnum32::CombatReady;
|
||||
tssTs.tss.TacticalStatus = rpr2::TacticalStatusEnum8::CombatReady;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::LightDamage:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::LightHit);
|
||||
tssTs.tss.TacticalStatus = tssTs.tss.TacticalStatus > rpr2::TacticalStatusEnum8::LightHit ? tssTs.tss.TacticalStatus : rpr2::TacticalStatusEnum8::LightHit;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::MediumDamage:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::MediumHit);
|
||||
tssTs.tss.TacticalStatus = tssTs.tss.TacticalStatus > rpr2::TacticalStatusEnum8::MediumHit ? tssTs.tss.TacticalStatus : rpr2::TacticalStatusEnum8::MediumHit;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::HeavyDamage:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::HeavyHit);
|
||||
tssTs.tss.TacticalStatus = tssTs.tss.TacticalStatus > rpr2::TacticalStatusEnum8::HeavyHit ? tssTs.tss.TacticalStatus : rpr2::TacticalStatusEnum8::HeavyHit;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::MobilityKill:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::Immobilized);
|
||||
tssTs.tss.TacticalStatus = tssTs.tss.TacticalStatus > rpr2::TacticalStatusEnum8::Immobilized ? tssTs.tss.TacticalStatus : rpr2::TacticalStatusEnum8::Immobilized;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::MobilityKillVisible:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::ImmobilizedVisible);
|
||||
tssTs.tss.TacticalStatus = tssTs.tss.TacticalStatus > rpr2::TacticalStatusEnum8::ImmobilizedVisible ? tssTs.tss.TacticalStatus : rpr2::TacticalStatusEnum8::ImmobilizedVisible;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::WeaponDamage:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::WeaponKill);
|
||||
tssTs.tss.TacticalStatus = tssTs.tss.TacticalStatus > rpr2::TacticalStatusEnum8::WeaponKill ? tssTs.tss.TacticalStatus : rpr2::TacticalStatusEnum8::WeaponKill;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::WeaponDamageVisible:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::WeaponKillVisible);
|
||||
tssTs.tss.TacticalStatus = tssTs.tss.TacticalStatus > rpr2::TacticalStatusEnum8::WeaponKillVisible ? tssTs.tss.TacticalStatus : rpr2::TacticalStatusEnum8::WeaponKillVisible;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::TemporaryFailure:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::TemporaryFailure);
|
||||
break;
|
||||
case rpr2::HitResultEnum16::NearMiss:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::NearMiss);
|
||||
break;
|
||||
case rpr2::HitResultEnum16::Contaminated:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::CContamination);
|
||||
break;
|
||||
case rpr2::HitResultEnum16::CheatingKill:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::Manipulation);
|
||||
tssTs.tss.TacticalStatus = rpr2::TacticalStatusEnum8::TotalKill;
|
||||
break;
|
||||
case rpr2::HitResultEnum16::HitWithNoEffect:
|
||||
tssTs.tss.TotalStatus = static_cast<rpr2::TotalStatusEnum32::ET>(tssTs.tss.TotalStatus | rpr2::TotalStatusEnum32::HitWithoutEffect);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tssTs.tss.VulnerabilityKind = 0;
|
||||
tssTs.timeStamp = simTimeMSec;
|
||||
}
|
||||
|
||||
void DamageModel::setTacticalStatus(const rpr2::HitResultEnum16::ET &state, qint64 simTimeMSec)
|
||||
{
|
||||
const int idx = indexForTime(simTimeMSec);
|
||||
if (idx > 0 && m_tacticalStates.at(idx).timeStamp == simTimeMSec)
|
||||
{
|
||||
TacticalStatusStructWithTimeStamp tssTs;
|
||||
setTacticalStatusStructWithTimestamp(tssTs, state, simTimeMSec); // Convert for comparison...
|
||||
// already there...
|
||||
if (tssTs.tss.TacticalStatus == m_tacticalStates.at(idx).tss.TacticalStatus)
|
||||
return;
|
||||
// When he WAS manipulated and is now being reset, also reset manipulation:
|
||||
if (tssTs.tss.TotalStatus & rpr2::TotalStatusEnum32::Manipulation &&
|
||||
state == rpr2::HitResultEnum16::Reset)
|
||||
emit playerManipulationChanged(m_is.entityNumber(), false, simTimeMSec);
|
||||
|
||||
setTacticalStatusStructWithTimestamp(m_tacticalStates[idx], state, simTimeMSec);
|
||||
}
|
||||
else
|
||||
{
|
||||
TacticalStatusStructWithTimeStamp tssTs;
|
||||
setTacticalStatusStructWithTimestamp(tssTs, state, simTimeMSec);
|
||||
m_tacticalStates.insert(idx + 1, std::move(tssTs)); // idx = -1 -> oldest, will become index 0
|
||||
}
|
||||
|
||||
while (m_tacticalStates.size() > 10)
|
||||
m_tacticalStates.pop_front();
|
||||
|
||||
// Manipulation only occurs when cheatingKill is sent:
|
||||
if (state == rpr2::HitResultEnum16::CheatingKill)
|
||||
emit playerManipulationChanged(m_is.entityNumber(), true, simTimeMSec);
|
||||
}
|
||||
|
||||
ProjectDataManagement::VulnerabilityState DamageModel::vulnerabilityState(qint64 simTimeMSec) const
|
||||
{
|
||||
int idx = indexForTime(simTimeMSec);
|
||||
if (idx < 0)
|
||||
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
|
||||
switch (m_tacticalStates.at(idx).tss.TacticalStatus)
|
||||
{
|
||||
case rpr2::TacticalStatusEnum8::CombatReady:
|
||||
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
|
||||
case rpr2::TacticalStatusEnum8::LightHit:
|
||||
return ProjectDataManagement::VulnerabilityState_def::LightDamage;
|
||||
case rpr2::TacticalStatusEnum8::MediumHit:
|
||||
return ProjectDataManagement::VulnerabilityState_def::MediumDamage;
|
||||
case rpr2::TacticalStatusEnum8::HeavyHit:
|
||||
return ProjectDataManagement::VulnerabilityState_def::HeavyDamage;
|
||||
case rpr2::TacticalStatusEnum8::Immobilized:
|
||||
return ProjectDataManagement::VulnerabilityState_def::MobilityKill;
|
||||
case rpr2::TacticalStatusEnum8::ImmobilizedVisible:
|
||||
return ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill;
|
||||
case rpr2::TacticalStatusEnum8::WeaponKill:
|
||||
return ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage;
|
||||
case rpr2::TacticalStatusEnum8::WeaponKillVisible:
|
||||
return ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage;
|
||||
case rpr2::TacticalStatusEnum8::TotalKill:
|
||||
return ProjectDataManagement::VulnerabilityState_def::CatastrophicKill;
|
||||
case rpr2::TacticalStatusEnum8::TemporaryFailure:
|
||||
return ProjectDataManagement::VulnerabilityState_def::TemporarySeverance;
|
||||
case rpr2::TacticalStatusEnum8::NearMiss:
|
||||
return ProjectDataManagement::VulnerabilityState_def::NearMiss;
|
||||
case rpr2::TacticalStatusEnum8::HitWithoutEffect:
|
||||
return ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect;
|
||||
}
|
||||
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
|
||||
}
|
||||
|
||||
int DamageModel::indexForTime(qint64 simTimeMSec) const
|
||||
{
|
||||
const int s = m_tacticalStates.size();
|
||||
if (simTimeMSec < 0 && s != 0) // = use current
|
||||
return s - 1;
|
||||
|
||||
for (int i = s - 1; i >= 0; --i)
|
||||
{
|
||||
const auto &tss = m_tacticalStates.at(i);
|
||||
if (tss.timeStamp <= simTimeMSec)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void DamageModel::initTimer()
|
||||
{
|
||||
delete m_timer;
|
||||
m_timer = new QTimer(this);
|
||||
m_timer->setSingleShot(true);
|
||||
m_timer->start(s_waitInterval);
|
||||
connect(m_timer, &QTimer::timeout,
|
||||
this, [this]()
|
||||
{
|
||||
emit damageStateChanged();
|
||||
m_timer->deleteLater();
|
||||
m_timer = nullptr;
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace HighLevelArchitecture
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Damage state transaformation from/to HLA <-> Excon, see ICD, 4.4.3.5.6 - Damage Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Common/identifierstruct.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
#include <TacticalStatusStruct.h>
|
||||
#include <EntityIdentifierStruct.h>
|
||||
#include <DamageStatusEnum32.h>
|
||||
#include <HitResultEnum16.h>
|
||||
|
||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||
|
||||
class QTimer;
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
class DamageModel : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DamageModel(const IdentifierStruct &is,
|
||||
const rpr2::TacticalStatusStruct &state);
|
||||
explicit DamageModel(const rpr2::TacticalStatusStruct &state);
|
||||
explicit DamageModel(const IdentifierStruct &is)
|
||||
: DamageModel(is, {rpr2::TacticalStatusEnum8::CombatReady, 0, rpr2::TotalStatusEnum32::CombatReady})
|
||||
{}
|
||||
|
||||
const IdentifierStruct &identifierStruct() const { return m_is; }
|
||||
|
||||
rpr2::DamageStatusEnum32::ET damageState(qint64 simTimeMSec) const;
|
||||
rpr2::TotalStatusEnum32::ET totalState(qint64 simTimeMSec) const;
|
||||
ProjectDataManagement::VulnerabilityState vulnerabilityState(qint64 simTimeMSec) const;
|
||||
bool immobilized(qint64 simTimeMSec) const;
|
||||
bool firePowerDisabled(qint64 simTimeMSec) const;
|
||||
|
||||
void setTacticalStatusStruct(const rpr2::TacticalStatusStruct &state, qint64 simTimeMSec);
|
||||
void setTacticalStatus(const rpr2::HitResultEnum16::ET &state, qint64 simTimeMSec);
|
||||
|
||||
rpr2::TacticalStatusStruct tacticalStatusStruct(qint64 timeStamp) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void damageStateChanged();
|
||||
void playerManipulationChanged(int eqNo, bool playerIsManipulated, qint64 simTimeMSecs);
|
||||
|
||||
private:
|
||||
int indexForTime(qint64 simTimeMSec) const;
|
||||
void initTimer();
|
||||
|
||||
private:
|
||||
IdentifierStruct m_is;
|
||||
QTimer *m_timer = nullptr;
|
||||
|
||||
struct TacticalStatusStructWithTimeStamp
|
||||
{
|
||||
rpr2::TacticalStatusStruct tss;
|
||||
qint64 timeStamp = 0;
|
||||
TacticalStatusStructWithTimeStamp()
|
||||
{
|
||||
tss.TacticalStatus = rpr2::TacticalStatusEnum8::CombatReady;
|
||||
tss.VulnerabilityKind = 0;
|
||||
tss.TotalStatus = rpr2::TotalStatusEnum32::CombatReady;
|
||||
}
|
||||
};
|
||||
QVector<TacticalStatusStructWithTimeStamp> m_tacticalStates;
|
||||
|
||||
|
||||
static const int s_waitInterval = 100; // 100 ms
|
||||
void setTacticalStatusStructWithTimestamp(TacticalStatusStructWithTimeStamp &tssTs, const rpr2::HitResultEnum16::ET &state, qint64 simTimeMSec);
|
||||
};
|
||||
} // namespace HighLevelArchitecture
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* DdsHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_hlaIsActive(false)
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
DdsHandler::~DdsHandler()
|
||||
{
|
||||
m_dtcExm = nullptr;
|
||||
m_pacemaker = nullptr;
|
||||
m_ddsConnector = nullptr;
|
||||
}
|
||||
|
||||
bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
|
||||
m_dtcExm = ExerciseManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
connect(m_dtcExm.get(), &ExerciseManagement::Interface::Dtc::exerciseChanged,
|
||||
this, &DdsHandler::onExerciseChanged);
|
||||
m_dtcExm->enableExercise();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DdsHandler::onExerciseChanged(const ExerciseManagement::Exercise &ex, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
if (ex.id() != m_ddsConnector->getPartitionId())
|
||||
return;
|
||||
|
||||
// HLA is active if ex.hasHlaInterface() && ex.state() == (Started || Paused):
|
||||
bool bHlaIsActive = ex.hasHlaInterface() &&
|
||||
(ex.state() == ExerciseManagement::ExerciseState::Started ||
|
||||
ex.state() == ExerciseManagement::ExerciseState::Paused);
|
||||
|
||||
if (bHlaIsActive == m_hlaIsActive)
|
||||
return;
|
||||
|
||||
m_hlaIsActive = bHlaIsActive;
|
||||
|
||||
emit exerciseHlaStateChanged(m_hlaIsActive);
|
||||
}
|
||||
|
||||
} // namespace HighLevelArchitecture
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* DdsHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <DDS/Core/core_dts_types.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <QObject>
|
||||
|
||||
#include <Common/logger.h>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
class Pacemaker;
|
||||
}
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
class DdsHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DdsHandler(int domainId, int exerciseId);
|
||||
~DdsHandler();
|
||||
|
||||
bool init(const QStringList &qosFileList = QStringList());
|
||||
|
||||
std::shared_ptr<Core::Pacemaker> pacemaker() const { return m_pacemaker; }
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
|
||||
|
||||
bool hlaIsActive() const { return m_hlaIsActive; }
|
||||
|
||||
Q_SIGNALS:
|
||||
void exerciseHlaStateChanged(bool bHlaEnabled);
|
||||
private:
|
||||
void onExerciseChanged(const ExerciseManagement::Exercise &ex, DataModification modType);
|
||||
private:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_dtcExm;
|
||||
bool m_hlaIsActive;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace HighLevelArchitecture
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<service namespace="HighLevelArchitecture" procNames="HighLevelArchitecture" abbreviation="HLA" exerciseDependency="Exercise" groups="ExercisePreparation,ExerciseExecution,ExercisePaused,ExerciseAfterActionReview">
|
||||
<rcs>
|
||||
<Id Id="$Id: ea_export_script.txt 28914 2016-08-23 12:08:05Z ehrlicher $"/>
|
||||
<HeadURL HeadURL="$HeadURL: svn://slssvn/TDS/branches/product/devel/trunk/Lts/Common/CodeGen/ea_export_script.txt $"/>
|
||||
<Author Author="$Author: ehrlicher $"/>
|
||||
</rcs>
|
||||
<tables/>
|
||||
<dbServiceStructs/>
|
||||
<topicTypes>
|
||||
<topicType name="dummyStruct">
|
||||
<column name="id" idlType="long"/>
|
||||
</topicType>
|
||||
</topicTypes>
|
||||
<functionTopics/>
|
||||
<enumerations>
|
||||
<enumeration name="dummyEnum">
|
||||
<attribute key="unknown" value=""/>
|
||||
</enumeration>
|
||||
</enumerations>
|
||||
</service>
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
log4j.reset=true
|
||||
log4j.rootLogger=WARN, file
|
||||
|
||||
# Service: HLA
|
||||
###########################################################
|
||||
|
||||
#log4j.logger.HLA=INFO
|
||||
|
||||
#log4j.logger.HLA.main=DEBUG
|
||||
|
||||
#log4j.logger.HLA.MainHandler=DEBUG
|
||||
|
||||
#log4j.logger.HLA.NgsHandler=DEBUG
|
||||
|
||||
#log4j.logger.HLA.NgsConnector=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.Player=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.Player.Status=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.Player.Position=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.Player.StatusChange=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.Object=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.MineField=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.MineFieldBreach=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.FireSupport=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.FireSupportSingleShot=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.ChemicalAgentArea=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.MunitionDetonation=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.WeaponFire=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.GuezHit=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.GuezExconEngagement=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.GuezInit=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.GuezBiteReport=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Inbound.GuezBiteRequest=DEBUG
|
||||
|
||||
#log4j.logger.HLA.NgsConnector.Outbound=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.Startup=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.Player=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.Player.Status=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.Player.Position=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.Player.Orientation=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.MineField=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.MineField.TriggeredImpacts=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.MineFieldBreach=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.FireSupport=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.FireSupport.TriggeredImpacts=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.FireSupportSingleShot=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.ChemicalAgentArea=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.NuclearAgentArea=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.MunitionDetonation=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.WeaponFire=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.GuezHit=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.GuezExconEngagement=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.GuezInit=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.GuezBiteReport=DEBUG
|
||||
#log4j.logger.HLA.NgsConnector.Outbound.GuezBiteRequest=DEBUG
|
||||
|
||||
#log4j.logger.HLA.PpmHandler=DEBUG
|
||||
|
||||
#log4j.logger.HLA.Callbacks.Interaction.ActionRequest=DEBUG
|
||||
#log4j.logger.HLA.Callbacks.Interaction.MunitionDetonation=DEBUG
|
||||
#log4j.logger.HLA.Callbacks.Interaction.StartResume=DEBUG
|
||||
#log4j.logger.HLA.Callbacks.Interaction.StopFreeze=DEBUG
|
||||
#log4j.logger.HLA.Callbacks.Interaction.WeaponFire=DEBUG
|
||||
|
||||
#log4j.logger.HLA.WebSocketHandler=DEBUG
|
||||
|
||||
|
||||
# File
|
||||
###########################################################
|
||||
log4j.appender.file=Lts::RollingFileAppender
|
||||
log4j.appender.file.MaxFileSize=1MB
|
||||
log4j.appender.file.MaxBackupIndex=9
|
||||
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.file.layout.ConversionPattern=%d %-5p %c |#| %m (%.50F:%L) %n
|
||||
|
||||
|
||||
# Appnd_Console
|
||||
###########################################################
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern= %d %p %c %c{1} - %m (%-.30F:%L) %n
|
||||
|
||||
|
||||
# Appnd_Syslog
|
||||
###########################################################
|
||||
log4j.appender.syslog=org.apache.log4j.SyslogAppender
|
||||
log4j.appender.syslog.Threshold=ERROR
|
||||
log4j.appender.syslog.SysLogHost=localhost
|
||||
log4j.appender.syslog.Facility=LOCAL7
|
||||
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.syslog.layout.ConversionPattern= %-4r %-5p %c %x - %m
|
||||
log4j.appender.syslog.LevelRangeFilter.AcceptOnMatch=true
|
||||
log4j.appender.syslog.LevelRangeFilter.LevelMin=INFO
|
||||
log4j.appender.syslog.LevelRangeFilter.LevelMax=FATAL
|
||||
|
||||
|
||||
###########################################################
|
||||
###########################################################
|
||||
###########################################################
|
||||
# 1) Available Levels in LOG4CXX Version 0.10.0:
|
||||
# TRACE,
|
||||
# DEBUG,
|
||||
# INFO,
|
||||
# WARN,
|
||||
# ERROR
|
||||
# FATAL
|
||||
#
|
||||
# d = date/time
|
||||
# p = priority (Level)
|
||||
# c = category/channel
|
||||
# m = message
|
||||
# F = file
|
||||
# L = line
|
||||
# n = platform dependent line separator character or characters.
|
||||
# ....
|
||||
#
|
||||
# Examples for console:
|
||||
# a)
|
||||
# %d %p %c #%m# (%.50F:%L)%n
|
||||
# date/time
|
||||
# priority
|
||||
# category/channel
|
||||
# #message#
|
||||
# (Maximal 50Character des Filename von rechts:Line)
|
||||
# line separator
|
||||
#
|
||||
# b)
|
||||
# %d (%.15F:%L) %-5p %c |#| %m%n
|
||||
# date/time
|
||||
# (Maximal 15Character des Filename von rechts:Line)
|
||||
# priority, Right pad with spaces if the priority name is less than 5 characters long.
|
||||
# category/channel
|
||||
# message
|
||||
# line separator
|
||||
#
|
||||
# Examples for files:
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
[hla]
|
||||
FederationName=22
|
||||
Protocol=HLA
|
||||
SiteId=201
|
||||
ApplicationId=100
|
||||
FomIdentifier=Saab
|
||||
RtiIdentifier=MAK
|
||||
SwConfFileName=swconf.cfg
|
||||
LicenseServer=@192.168.99.100
|
||||
webSocketListenPort=12347
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* main for HLA
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
||||
#include <memory>
|
||||
#include "main_handler.h"
|
||||
#include <Common/logger.h>
|
||||
#include <Common/settings.h>
|
||||
#include <NGSApplicationBase.h>
|
||||
|
||||
// Corba specific stuff
|
||||
class myCorbaSpecificStuff final : public NGSApplicationBase
|
||||
{
|
||||
public:
|
||||
using NGSApplicationBase::NGSApplicationBase;
|
||||
int run() override { return 1; }
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
NGLCoreApplication app(argc, argv);
|
||||
|
||||
qputenv("RTI_ASSISTANT_DISABLE", QByteArray("1"));
|
||||
qputenv("RTI_RID_FILE", QCoreApplication::applicationDirPath().append(QLatin1String("/rid.mtl")).toLocal8Bit());
|
||||
|
||||
int iRet = -1;
|
||||
LtsCommandLineParser::LtsCommandLineParser options;
|
||||
if (!options.init())
|
||||
return iRet;
|
||||
app.createLogger("HLA", options.exerciseId());
|
||||
|
||||
myCorbaSpecificStuff corba(argc, argv);
|
||||
|
||||
HighLevelArchitecture::Settings::setIniFile(options.iniFile());
|
||||
|
||||
qputenv("MAKLMGRD_LICENSE_FILE", HighLevelArchitecture::Settings::hlaLicenseServer());
|
||||
|
||||
{
|
||||
std::unique_ptr<HighLevelArchitecture::MainHandler> mainHandler(new HighLevelArchitecture::MainHandler);
|
||||
if (mainHandler->init(options.domainId(), options.exerciseId()))
|
||||
{
|
||||
STARTUP_LOG(app.baseLogger());
|
||||
iRet = app.exec();
|
||||
SHUTDOWN_LOG(app.baseLogger());
|
||||
}
|
||||
}
|
||||
|
||||
return iRet;
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
/**
|
||||
* MainHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "ngs_handler.h"
|
||||
#include "web_socket_handler.h"
|
||||
#include "Common/identifierstruct.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
#include <Common/settings.h>
|
||||
#include <Common/logger.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_exerciseId(0)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
m_ngsHandler = nullptr;
|
||||
m_ddsHandler = nullptr;
|
||||
}
|
||||
|
||||
bool MainHandler::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_exerciseId = exerciseId;
|
||||
IdentifierStruct::setOwnSiteId(exerciseId);
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not init DDS handler";
|
||||
return false;
|
||||
}
|
||||
connect(m_ddsHandler.get(), &DdsHandler::exerciseHlaStateChanged,
|
||||
this, &MainHandler::onExerciseHlaStateChanged);
|
||||
|
||||
onExerciseHlaStateChanged(m_ddsHandler->hlaIsActive());
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MainHandler::isConnectedToHla() const
|
||||
{
|
||||
return m_ngsHandler && m_ngsHandler->isConnectedToHla();
|
||||
}
|
||||
|
||||
void MainHandler::onExerciseHlaStateChanged(bool bHlaEnabled)
|
||||
{
|
||||
NOTICE_LOG(m_logger) << "HLA State Changed: HLA is now " << (bHlaEnabled ? "EN" : "DIS") << "ABLED in this exercise";
|
||||
|
||||
if (bHlaEnabled)
|
||||
{
|
||||
if (m_ngsHandler && m_wsHandler)
|
||||
return;
|
||||
|
||||
if (!m_wsHandler)
|
||||
{
|
||||
m_wsHandler = std::make_shared<WebSocketHandler>(m_exerciseId, this);
|
||||
if (!m_wsHandler->init(Settings::webSocketListenPort()))
|
||||
{
|
||||
m_wsHandler = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_ngsHandler)
|
||||
{
|
||||
m_ngsHandler = std::make_shared<NgsHandler>();
|
||||
connect(m_ngsHandler.get(), &NgsHandler::ngsHandlerReady,
|
||||
m_wsHandler.get(), &WebSocketHandler::sendHlaConnectionState, Qt::UniqueConnection);
|
||||
if (!m_ngsHandler->init(m_ddsHandler))
|
||||
{
|
||||
m_ngsHandler = nullptr;
|
||||
NOTICE_LOG(m_logger) << "Could not init ngs - stopping application";
|
||||
QCoreApplication::quit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
connect(m_ngsHandler.get(), &NgsHandler::externalEquipmentNumberAdded,
|
||||
m_wsHandler.get(), &WebSocketHandler::onExternalEquipmentNumberAdded, Qt::UniqueConnection);
|
||||
connect(m_ngsHandler.get(), &NgsHandler::externalEquipmentNumberRemoved,
|
||||
m_wsHandler.get(), &WebSocketHandler::onExternalEquipmentNumberRemoved, Qt::UniqueConnection);
|
||||
|
||||
|
||||
connect(m_wsHandler.get(), &WebSocketHandler::initRequest,
|
||||
m_ngsHandler.get(), &NgsHandler::participantInitRequest, Qt::UniqueConnection);
|
||||
connect(m_wsHandler.get(), &WebSocketHandler::biteRequest,
|
||||
m_ngsHandler.get(), &NgsHandler::participantBiteRequest, Qt::UniqueConnection);
|
||||
NOTICE_LOG(m_logger) << "onExerciseHlaStateChanged - created new ngsHandler";
|
||||
connect(m_ngsHandler.get(), &NgsHandler::firstTickFinished, this, [this](){m_wsHandler->sendHlaConnectionState();});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_ngsHandler)
|
||||
NOTICE_LOG(m_logger) << "onExerciseHlaStateChanged - deleting ngsHandler";
|
||||
m_ngsHandler = nullptr;
|
||||
|
||||
if (m_wsHandler)
|
||||
{
|
||||
m_wsHandler->sendHlaConnectionState();
|
||||
auto copy = m_wsHandler;
|
||||
QTimer::singleShot(2000, this, [copy]
|
||||
{
|
||||
copy->deleteLater();
|
||||
});
|
||||
}
|
||||
m_wsHandler = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace HighLevelArchitecture
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* MainHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
#include "dds_handler.h"
|
||||
#include <Common/logger.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
class NgsHandler;
|
||||
class WebSocketHandler;
|
||||
class MainHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MainHandler(QObject *parent = nullptr);
|
||||
~MainHandler();
|
||||
|
||||
bool init(int domainId, int exerciseId);
|
||||
|
||||
bool isConnectedToHla() const;
|
||||
std::shared_ptr<NgsHandler> ngsHandler() const { return m_ngsHandler; }
|
||||
|
||||
private Q_SLOTS:
|
||||
void onExerciseHlaStateChanged(bool bHlaEnabled);
|
||||
private:
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<NgsHandler> m_ngsHandler;
|
||||
std::shared_ptr<WebSocketHandler> m_wsHandler;
|
||||
int m_exerciseId;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace HighLevelArchitecture
|
||||
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Start/Stop MAK RTI for TDS
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/opt/NGS/makRti4.5-conf/ctc_mak_rti_systemd start
|
||||
ExecStop=/opt/NGS/makRti4.5-conf/ctc_mak_rti_systemd stop
|
||||
ExecReload=/opt/NGS/makRti4.5-conf/ctc_mak_rti_systemd restart
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/rc.status
|
||||
|
||||
# Reset status of this service
|
||||
rc_reset
|
||||
bin_dir=/opt/NGS/makRti4.5/bin/
|
||||
conf_dir=/opt/NGS/makRti4.5-conf/
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
export RTI_ASSISTANT_DISABLE=1
|
||||
${bin_dir}/rtiexec -R ${conf_dir}/rid.mtl &
|
||||
# ${bin_dir}/rtiForwarder -R ${conf_dir}/rid.mtl -t 192.168.133.147 -T 4001 -A 229.7.7.7 -P 4000 -N 192.168.133.147 -M -D 5050 &
|
||||
${bin_dir}/rtiForwarder -R ${conf_dir}/rid.mtl -t 192.168.99.100 -T 4001 -A 229.7.7.7 -P 4000 -N 192.168.99.100 -M -D 5050 &
|
||||
;;
|
||||
stop)
|
||||
ps -ef | grep rtiForwarder | awk '$0 !~ /grep/ {system("kill "$2)}'
|
||||
ps -ef | grep rtiexec | awk '$0 !~ /grep/ {system("kill "$2)}'
|
||||
;;
|
||||
restart)
|
||||
## Stop the service and regardless of whether it was
|
||||
## running or not, start it again.
|
||||
$0 stop
|
||||
$0 start
|
||||
|
||||
# Remember status and be quiet
|
||||
rc_status
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
||||
|
||||
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
;; RID File generated with MAK RTI version: 4.5 HLA 1.3
|
||||
;; Compiler: GNU C++ version 4.8.5 20150623 (Red Hat 4.8.5-11)
|
||||
|
||||
(setqb RTI_IOPeriod 0.1)
|
||||
(setqb RTI_addressDelay 1)
|
||||
(setqb RTI_autoProvideDelay -1)
|
||||
(setqb RTI_discoveryMsgBundlingDelay 0)
|
||||
(setqb RTI_execMcastDiscoveryDelay 1)
|
||||
(setqb RTI_federateHeartbeatInterval 10)
|
||||
(setqb RTI_federateTimeoutInterval 25)
|
||||
(setqb RTI_flushTimeoutInterval 3)
|
||||
(setqb RTI_forwardingDelay 3)
|
||||
(setqb RTI_lrcMcastDiscoveryDelay 3)
|
||||
(setqb RTI_peerForwarderReconnectDelay 3)
|
||||
(setqb RTI_receiveTolerance 0)
|
||||
(setqb RTI_responseInterval 3)
|
||||
(setqb RTI_sharedMemoryMgrMaxWait 0)
|
||||
(setqb RTI_tickWaitPeriod 0)
|
||||
(setqb RTI_transmitDelay 0)
|
||||
(setqb RTI_transmitRate 0)
|
||||
(setqb RTI_IOQueueIndicator 0)
|
||||
(setqb RTI_allProvideUpdateRequestsDelayed 0)
|
||||
(setqb RTI_attributeRelevanceAdvisorySwitch 0)
|
||||
(setqb RTI_attributeScopeAdvisorySwitch 0)
|
||||
(setqb RTI_autoProvideSwitch 0)
|
||||
(setqb RTI_automaticNameReserveEnabled 0)
|
||||
(setqb RTI_bestEffortSendRetries 50)
|
||||
(setqb RTI_bestEffortSendRetryWaitUsec 50)
|
||||
(setqb RTI_catchFedAmbExceptions 1)
|
||||
(setqb RTI_checkFlag 0)
|
||||
(setqb RTI_configureConnectionWithRid 1)
|
||||
(setqb RTI_conveyOnlyAvailableDimensions 0)
|
||||
(setqb RTI_conveyProducingFederateSwitch 1)
|
||||
(setqb RTI_conveyRegionDesignatorSwitch 0)
|
||||
(setqb RTI_crcCheckFedFile 0)
|
||||
(setqb RTI_dataDistMgmt 1)
|
||||
(setqb RTI_ddmFixedGrid 0)
|
||||
(setqb RTI_delaySubscriptionEvaluationSwitch 0)
|
||||
(setqb RTI_deleteOrphans 1)
|
||||
(setqb RTI_detachNotifyLevelFromStdOut 2)
|
||||
(setqb RTI_disableUnlicensedForTwo 0)
|
||||
(setqb RTI_distributeFedFile 1)
|
||||
(setqb RTI_distributeFedFileAsynchronously 0)
|
||||
(setqb RTI_distributedForwarderPort 5000)
|
||||
(setqb RTI_distributedUdpForwarderMode 0)
|
||||
(setqb RTI_dualTransmitFirstInteractionRegions 0)
|
||||
(setqb RTI_dumpFed 0)
|
||||
(setqb RTI_dumpRid 1)
|
||||
(setqb RTI_enableBestEffortSendRetry 1)
|
||||
(setqb RTI_enableCheckVersion 1)
|
||||
(setqb RTI_enableFederateHeartbeat 0)
|
||||
(setqb RTI_enableFedexMsgRouting 1)
|
||||
(setqb RTI_enableFomBackwardsCompatibility 0)
|
||||
(setqb RTI_enableHlaObjectNamePrefix 0)
|
||||
(setqb RTI_enableLRCNetworkStatisticsMonitoring 1)
|
||||
(setqb RTI_enableMessageThrottling 0)
|
||||
(setqb RTI_enableNameReservation 1)
|
||||
(setqb RTI_enableNetworkTesting 1)
|
||||
(setqb RTI_enablePacketBundling 1)
|
||||
(setqb RTI_enableSaveRestoreWhenUsingRtiexec 1)
|
||||
(setqb RTI_enableSharedMemoryExecEventLog 0)
|
||||
(setqb RTI_enableTcpCompression 0)
|
||||
(setqb RTI_enableTcpSmartForwarding 0)
|
||||
(setqb RTI_enableUdpCompression 0)
|
||||
(setqb RTI_enableUdpSmartForwarding 0)
|
||||
(setqb RTI_enableUpdateRateReduction 0)
|
||||
(setqb RTI_enableWarningsForDisabledServices 1)
|
||||
(setqb RTI_exceptionReportingSwitch 0)
|
||||
(setqb RTI_extend13and1516interop 1)
|
||||
(setqb RTI_federateReconnectPause 5)
|
||||
(setqb RTI_fomDataTransportTypeControl 0)
|
||||
(setqb RTI_fomModuleMerging 1)
|
||||
(setqb RTI_fomModuleSorting 1)
|
||||
(setqb RTI_forceFullCompliance 0)
|
||||
(setqb RTI_forceUnlicensedForTwo 0)
|
||||
(setqb RTI_fullFedFileDistribution 0)
|
||||
(setqb RTI_interactionRelevanceAdvisorySwitch 1)
|
||||
(setqb RTI_internalMsgReliableWhenUsingRtiexec 1)
|
||||
(setqb RTI_internalMsgSmartForwardingWhenUsingRtiexec 1)
|
||||
(setqb RTI_lrcMinidumperLevel 0)
|
||||
(setqb RTI_maxForwarderQueue -1)
|
||||
(setqb RTI_maxIOCount 50000)
|
||||
(setqb RTI_maxIOQueue 500000)
|
||||
(setqb RTI_maxNumFederates 511)
|
||||
(setqb RTI_maxUdpPacketSize 15000)
|
||||
(setqb RTI_mcastDiscoveryEnabled 0)
|
||||
(setqb RTI_mcastDiscoveryPort 6001)
|
||||
(setqb RTI_mcastDiscoveryTries 3)
|
||||
(setqb RTI_mcastTtl 2)
|
||||
(setqb RTI_momEvokeCallbackObserverEnabled 0)
|
||||
(setqb RTI_momExceptionLogging 0)
|
||||
(setqb RTI_momFederateUpdateInterval 0)
|
||||
(setqb RTI_momServiceAvailable 0)
|
||||
(setqb RTI_momVerboseLevel 0)
|
||||
(setqb RTI_nextEventRequestAndRetractServiceEnabled 1)
|
||||
(setqb RTI_notifyLevel 4)
|
||||
(setqb RTI_objectClassRelevanceAdvisorySwitch 1)
|
||||
(setqb RTI_packetBundlingSize 1400)
|
||||
(setqb RTI_peerForwarderReconnectNumberOfTries 3)
|
||||
(setqb RTI_preferLocalFomModules 0)
|
||||
(setqb RTI_preferRidToFedSwitchTable 1)
|
||||
(setqb RTI_processUnknownUpdatesForDiscovery 1)
|
||||
(setqb RTI_processingModel 1)
|
||||
(setqb RTI_reconnectEnabled 0)
|
||||
(setqb RTI_resignResponseEnabled 0)
|
||||
(setqb RTI_reuseLogFile 1)
|
||||
(setqb RTI_reuseReleasedObjectHandles 0)
|
||||
(setqb RTI_ridConsistencyChecking 0)
|
||||
(setqb RTI_routeToAllByDefault 0)
|
||||
(setqb RTI_rtiExecPerformsLicensing 0)
|
||||
(setqb RTI_rtiExecReconnectPause 4)
|
||||
(setqb RTI_saveRestoreTimeout 120)
|
||||
(setqb RTI_saveTransientMessages 0)
|
||||
(setqb RTI_sendDiscoveredClass 1)
|
||||
(setqb RTI_serviceReportingSwitch 0)
|
||||
(setqb RTI_sharedMemoryMode 0)
|
||||
(setqb RTI_sharedMemoryQueueLength 1000)
|
||||
(setqb RTI_singleCallbackPerTick 0)
|
||||
(setqb RTI_smartForwardingLevel 0)
|
||||
(setqb RTI_socketReceiveBufferSize 2000000)
|
||||
(setqb RTI_socketSendBufferSize 2000000)
|
||||
(setqb RTI_strictFomChecking 1)
|
||||
(setqb RTI_strictHLA1516eAttributeOwnershipUnavailableCallback 1)
|
||||
(setqb RTI_strictNameReservation 0)
|
||||
(setqb RTI_tcpBufferSize 500000)
|
||||
(setqb RTI_tcpCompressionLevel 1)
|
||||
(setqb RTI_tcpNoDelay 1)
|
||||
(setqb RTI_tcpPort 4001)
|
||||
(setqb RTI_testConnectionThreshold 0)
|
||||
(setqb RTI_throwExceptionCallNotAllowedFromWithinCallback 0)
|
||||
(setqb RTI_throwExceptionForDisabledService 1)
|
||||
(setqb RTI_throwExceptionOnConcurrentAccess 0)
|
||||
(setqb RTI_tickFavorsNetwork 1)
|
||||
(setqb RTI_timeMgmt 1)
|
||||
(setqb RTI_udpCompressionLevel 1)
|
||||
(setqb RTI_udpPort 4000)
|
||||
(setqb RTI_use32BitsForValueSize 0)
|
||||
(setqb RTI_useBusyWaitForTickMinMax 0)
|
||||
(setqb RTI_useRandomNumberForFedHandle 0)
|
||||
(setqb RTI_useRtiExec 1)
|
||||
(setqb RTI_waitIOPeriodForBundling 0)
|
||||
(setqb RTI_ddmFixedGridFilename "")
|
||||
(setqb RTI_defaultFedFile "")
|
||||
(setqb RTI_defaultTimeImplementation "")
|
||||
(setqb RTI_destAddrString "229.7.7.7")
|
||||
(setqb RTI_forwarderRoutesFile "/opt/NGS/makRti4.5-conf/routes.mtl")
|
||||
(setqb RTI_implicitDdmParamsFile "")
|
||||
(setqb RTI_logFileDirectory "/shd/CTC/LOG")
|
||||
;; (setqb RTI_logFileName "makRti.log")
|
||||
(setqb RTI_maxChannelAddr "UseDefaultChannelAddr")
|
||||
(setqb RTI_mcastDiscoveryAddrString "229.7.7.8")
|
||||
(setqb RTI_minChannelAddr "UseDefaultChannelAddr")
|
||||
(setqb RTI_momModuleExtensionFileName "")
|
||||
(setqb RTI_networkInterfaceAddr "10.7.144.65")
|
||||
;; (setqb RTI_rtiExecLogFileName "rtiExec.log")
|
||||
;; (setqb RTI_rtiForwarderLogFileName "rtiForwarder.log")
|
||||
(setqb RTI_saveRestoreDirectory ".")
|
||||
(setqb RTI_sharedMemExecLogFileName "")
|
||||
(setqb RTI_sharedMemoryName "DtRtiSharedMessages")
|
||||
(setqb RTI_tcpForwarderAddr "10.7.144.65")
|
||||
(setqb RTI_tcpNetworkInterfaceAddr "10.7.144.65")
|
||||
@@ -0,0 +1,4 @@
|
||||
;; Always use eth0 net!
|
||||
(RTI_addForwarder "10.7.144.65" "10.7.144.65" 5000)
|
||||
(RTI_addForwarder "192.168.99.100" "10.7.144.65" 5050)
|
||||
|
||||
+2887
File diff suppressed because it is too large.
Load diff
+375
@@ -0,0 +1,375 @@
|
||||
/**
|
||||
* Connect to ngs / hla and provide the basic interface
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Common/participantposition.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <IObserver.h>
|
||||
#include <QMap>
|
||||
#include <QSet>
|
||||
#include <QTransform>
|
||||
|
||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||
|
||||
#include <ForceIdentifierEnum8.h>
|
||||
#include <HitResultEnum16.h>
|
||||
|
||||
namespace ngs
|
||||
{
|
||||
class ISimulatedWorldAdmin;
|
||||
class IFederationMaster;
|
||||
|
||||
class IObserverObjectInstance;
|
||||
}
|
||||
|
||||
namespace rpr2
|
||||
{
|
||||
class ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray;
|
||||
class ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array;
|
||||
class IPlayerSOM;
|
||||
class EntityTypeStruct;
|
||||
class MarkingStruct;
|
||||
class ClockTimeStruct;
|
||||
class TacticalStatusStruct;
|
||||
class IPlayerPhysicalEntityObjInstance;
|
||||
class IPlayerEnvironmentObjectObjInstance;
|
||||
class IPlayerBaseEntityObjInstance;
|
||||
class OMT13string;
|
||||
class EventIdentifierStruct;
|
||||
class EntityIdentifierStruct;
|
||||
class IsPartOfStruct;
|
||||
|
||||
class IObserverBaseEntityObjInstance;
|
||||
class IObserverMunitionDetonationIntInstance;
|
||||
class IObserverWeaponFireIntInstance;
|
||||
class IObserverGuezHitIntInstance;
|
||||
class IObserverGuezInitIntInstance;
|
||||
class IObserverGuezBiteReportIntInstance;
|
||||
class IObserverGuezRequestBiteReportIntInstance;
|
||||
class IObserverEnvironmentObjectObjInstance;
|
||||
class IObserverGuezMineFieldObjInstance;
|
||||
class IObserverGuezMineFieldBreachObjInstance;
|
||||
|
||||
}
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
}
|
||||
|
||||
namespace TrainingAreaBase
|
||||
{
|
||||
class EquipmentGearEvent;
|
||||
class EquipmentBite;
|
||||
class DemandBiteRequest;
|
||||
}
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
class ParticipantGearEvent;
|
||||
class StateInformation;
|
||||
}
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
class ExplosionSingle;
|
||||
class ExplosionArea;
|
||||
class MineArea;
|
||||
class MineAreaModifyRequest;
|
||||
class MineSegment;
|
||||
class MineCorridor;
|
||||
class MineCorridorModifyRequest;
|
||||
class ExplosionSingleModifyRequest;
|
||||
class ExplosionClusterSingleEffectOnlyRequest;
|
||||
class NContamination;
|
||||
class BCContamination;
|
||||
}
|
||||
|
||||
namespace LtsCoordTrans
|
||||
{
|
||||
struct UtmCoordinate;
|
||||
}
|
||||
|
||||
class ObserverGuezHumanCBNotifier;
|
||||
class ObserverGuezObserverControllerCBNotifier;
|
||||
class ObserverGuezGroundVehicleCBNotifier;
|
||||
|
||||
class ObserverObjectCB;
|
||||
class ObserverBaseEntityObjectCB;
|
||||
class ObserverPhysicalEntityObjectCB;
|
||||
class ObserverPlatformObjectCB;
|
||||
class ObserverGroundVehicleObjectCB;
|
||||
class ObserverGuezGroundVehicleObjectCB;
|
||||
class ObserverLifeformObjectCB;
|
||||
class ObserverHumanObjectCB;
|
||||
class ObserverGuezHumanObjectCB;
|
||||
class ObserverGuezObserverControllerObjectCB;
|
||||
|
||||
class ObserverGuezMineFieldCBNotifier;
|
||||
class ObserverGuezMineFieldBreachCBNotifier;
|
||||
|
||||
class ObserverEnvironmentObjectObjectCB;
|
||||
class ObserverArealObjectObjectCB;
|
||||
class ObserverPointObjectObjectCB;
|
||||
class ObserverOtherArealObjectObjectCB;
|
||||
class ObserverOtherPointObjectObjectCB;
|
||||
class ObserverGuezMineFieldObjectCB;
|
||||
class ObserverGuezMineFieldBreachObjectCB;
|
||||
|
||||
class ObserverMunitionDetonationCBNotifier;
|
||||
class ObserverWeaponFireCBNotifier;
|
||||
class ObserverGuezHitCBNotifier;
|
||||
class ObserverGuezInitCBNotifier;
|
||||
class ObserverGuezBiteReportCBNotifier;
|
||||
class ObserverGuezRequestBiteReportCBNotifier;
|
||||
|
||||
class QTimer;
|
||||
|
||||
struct GuezHitStruct
|
||||
{
|
||||
qint32 targetId = 0;
|
||||
qint64 sampleTime = 0;
|
||||
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::get_default();
|
||||
qint32 vulnerabilityKind = 0;
|
||||
qint32 vulnerabilityBits = 0;
|
||||
Core::GeoPosition position = Core::GeoPosition(0, 0, 0);
|
||||
qint64 originatorId = 0; // So EIS fits completely!
|
||||
ProjectDataManagement::StateChangeOriginator originatorType = ProjectDataManagement::StateChangeOriginator_def::get_default();
|
||||
QString originatorChargeTypeEtsString;
|
||||
};
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
class NgsHandler;
|
||||
class PlayerCallback;
|
||||
class DamageModel;
|
||||
class IdentifierStruct;
|
||||
class TypeStruct;
|
||||
struct ParticipantInformation;
|
||||
|
||||
class NgsConnector : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
void connectObserverObjectSignals(ObserverObjectCB *entity);
|
||||
void connectObserverBaseEntityObjectSignals(ObserverBaseEntityObjectCB *entity);
|
||||
void connectObserverPhysicalEntityObjectSignals(ObserverPhysicalEntityObjectCB *entity);
|
||||
void connectObserverPlatformObjectSignals(ObserverPlatformObjectCB *entity);
|
||||
void connectObserverGroundVehicleObjectSignals(ObserverGroundVehicleObjectCB *entity);
|
||||
void connectObserverGuezGroundVehicleObjectSignals(ObserverGuezGroundVehicleObjectCB *entity);
|
||||
void connectObserverLifeformObjectSignals(ObserverLifeformObjectCB *entity);
|
||||
void connectObserverHumanObjectSignals(ObserverHumanObjectCB *entity);
|
||||
void connectObserverGuezHumanObjectSignals(ObserverGuezHumanObjectCB *entity);
|
||||
void connectObserverGuezObserverControllerObjectSignals(ObserverGuezObserverControllerObjectCB *entity);
|
||||
|
||||
void connectObserverEnvironmentObjectObjectSignals(ObserverEnvironmentObjectObjectCB *entity);
|
||||
void connectObserverArealObjectObjectSignals(ObserverArealObjectObjectCB *entity);
|
||||
void connectObserverPointObjectObjectSignals(ObserverPointObjectObjectCB *entity);
|
||||
void connectObserverOtherArealObjectObjectSignals(ObserverOtherArealObjectObjectCB *entity);
|
||||
void connectObserverOtherPointObjectObjectSignals(ObserverOtherPointObjectObjectCB *entity);
|
||||
void connectObserverGuezMineFieldObjectSignals(ObserverGuezMineFieldObjectCB *entity);
|
||||
void connectObserverGuezMineFieldBreachObjectSignals(ObserverGuezMineFieldBreachObjectCB *entity);
|
||||
|
||||
void addObserverObjectInstance(const ngs::IObserverObjectInstance &obj);
|
||||
void removeObserverObjectInstance(const ngs::IObserverObjectInstance &obj);
|
||||
|
||||
void ensureDamageModelExists(const IdentifierStruct &is);
|
||||
|
||||
bool addBaseEntity(rpr2::IPlayerBaseEntityObjInstance *playerInstance, const ParticipantInformation &participantData);
|
||||
bool addPhysicalEntity(rpr2::IPlayerPhysicalEntityObjInstance *playerInstance, const ParticipantInformation &playerData);
|
||||
|
||||
static rpr2::MarkingStruct toMarkingStruct(const QString &designator);
|
||||
static rpr2::ClockTimeStruct getClockTimeStruct(qint64 msecsSinceEpoch);
|
||||
static qint64 getMSecsSinceEpoch(const rpr2::ClockTimeStruct &cts);
|
||||
rpr2::EntityTypeStruct getEtsCharge(int chargeType) const;
|
||||
|
||||
template<typename T>
|
||||
static rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray positionArray(const T &data);
|
||||
|
||||
static inline QTransform fromRotation(double rot) { return QTransform().rotate(rot); }
|
||||
|
||||
static QPolygonF explosionArea(const AreaEffectSimulation::ExplosionArea &ea);
|
||||
static QPolygonF mineAreaSegment(const AreaEffectSimulation::MineSegment &segment, double width, double density, bool bIsCenterline);
|
||||
static QPolygonF mineCorridorSegment(const Core::GeoPosition2D &start, const Core::GeoPosition2D &end, double width);
|
||||
static QPolygonF nContamination(const AreaEffectSimulation::NContamination &awf);
|
||||
static std::vector<Core::GeoPosition> bcReduction(const std::vector<Core::GeoPosition> &form);
|
||||
static QPolygonF utmToGeogrphic(const QPolygonF &polyUtm, const LtsCoordTrans::UtmCoordinate &base);
|
||||
|
||||
static rpr2::ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array triggeredImpactsArray(const std::vector<uint8_t> &data);
|
||||
|
||||
static rpr2::HitResultEnum16::ET getHitResultEnum(const ProjectDataManagement::VulnerabilityState &ts);
|
||||
static ProjectDataManagement::VulnerabilityState getTacticalStatusEnum(const rpr2::HitResultEnum16::ET &hr);
|
||||
|
||||
rpr2::EventIdentifierStruct getEventIdentifierStruct();
|
||||
bool setVulnerabilityState(int eqNo, const ParticipantManagement::StateInformation &state);
|
||||
static rpr2::TacticalStatusStruct getTacticalStatusFromState(const ParticipantManagement::StateInformation &state);
|
||||
|
||||
bool addMinefield(const rpr2::IObserverGuezMineFieldObjInstance *minefield);
|
||||
bool addMinefieldBreach(const rpr2::IObserverGuezMineFieldBreachObjInstance *minefieldBreach);
|
||||
|
||||
int getEquipmentNoByRTIObjectId(const std::string &sender) const;
|
||||
|
||||
static ngs::SimTime getSimTime(qint64 msecsSinceEpoch = 0);
|
||||
static ngs::SimTime getSimTime(const QDateTime &dateTime);
|
||||
IdentifierStruct getIdentifierStructbyEquipmentNo(const int eqId) const;
|
||||
|
||||
public:
|
||||
NgsConnector(const QString &fedName, NgsHandler *ngsHandler);
|
||||
~NgsConnector();
|
||||
|
||||
bool initialize(ngs::IObserver::ProtocolType protocol, const QString &playerName, const QString &appDirPath);
|
||||
void uninitialize();
|
||||
|
||||
bool canPublishData() const { return m_bCanPublishData; }
|
||||
|
||||
bool addHuman(const ParticipantInformation &participantData, const rpr2::TacticalStatusStruct &state);
|
||||
bool addGroundVehicle(const ParticipantInformation &participantData, const rpr2::TacticalStatusStruct &state);
|
||||
bool addObserverController(const ParticipantInformation &participantData);
|
||||
bool removeBaseEntity(int eqNo);
|
||||
|
||||
bool setParticipantName(int eqNo, const QString &designator);
|
||||
bool setParticipantForce(int eqNo, const rpr2::ForceIdentifierEnum8::ET forceIdentifier);
|
||||
bool setParticipantHit(int eqNo, const ParticipantManagement::StateInformation &state,
|
||||
const ParticipantPosition &partPos, int chargeType,
|
||||
ProjectDataManagement::StateChangeOriginator originatorType, int originatorEqNo = 0);
|
||||
|
||||
bool setWeaponFire(int eqNo, const ParticipantManagement::ParticipantGearEvent &data);
|
||||
bool setEquipmentBite(int eqNo, const TrainingAreaBase::EquipmentBite &data);
|
||||
// AES:
|
||||
bool guezMineField(const AreaEffectSimulation::MineArea &data);
|
||||
bool guezMineFieldBreach(const AreaEffectSimulation::MineCorridor &data);
|
||||
bool guezNuclearAgent(const AreaEffectSimulation::NContamination &data);
|
||||
bool guezChemicalAgent(const AreaEffectSimulation::BCContamination &data);
|
||||
|
||||
bool setItemForm(int aesItemId, int aesTypeId = 0, const std::vector<Core::GeoPosition> &form = std::vector<Core::GeoPosition>());
|
||||
bool setWorldLocation(int eqNo, const ParticipantPosition &pos, int eqNoHost = -1);
|
||||
void sendMunitionDetonation(const ParticipantPosition &pos, int chargeTypeId, rpr2::ForceIdentifierEnum8::ET forceId);
|
||||
void sendParticipantBiteRequest(const int eqId, bool withSelfTest, qint64 simTimeMsecs);
|
||||
void sendParticipantInitRequest(const int eqId, bool resetManipulation, bool resetVulnerabilityState, bool restockCharges, qint64 simTimeMSecs);
|
||||
|
||||
protected slots:
|
||||
void go();
|
||||
void onFirstTickFinished();
|
||||
|
||||
signals:
|
||||
void spatialChanged(int eqId, const ParticipantPosition &pos, qint64 simTimeMSecs);
|
||||
void markingChanged(int eqId, const QString &marking, qint64 simTimeMSecs);
|
||||
void participantReceivedInit(int eqId, qint64 simTimeMSecs);
|
||||
void virtualParticipantDeleted(int eqId);
|
||||
void firstTickFinished();
|
||||
|
||||
void aesNameChanged(qint64 identifierInt, const std::string &name);
|
||||
void aesActivationTimeChanged(qint64 identifierInt, qint64 msecsSinceEpoch);
|
||||
void aesForceIdentifierChanged(qint64 identifierInt, int partyId);
|
||||
void aesDurationChanged(qint64 identifierInt, quint32 msecs);
|
||||
void aesChargeChanged(qint64 identifierInt, int chargeTypeId);
|
||||
void aesRoundsChanged(qint64 identifierInt, quint32 rounds);
|
||||
void aesDetonationLocationChanged(qint64 identifierInt, const ParticipantPosition &pos);
|
||||
void aesPointsDataChanged(quint64 eqId, const std::vector<Core::GeoPosition2D> &form, qint64 simTimeMSecs);
|
||||
void aesRemoveItem(qint64 identifierInt);
|
||||
|
||||
void munitionDetonation(AreaEffectSimulation::ExplosionSingleModifyRequest &explosion);
|
||||
void munitionDetonationExplosionClusterSingleEffectOnly(AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest &explosion);
|
||||
void weaponFire(const TrainingAreaBase::EquipmentGearEvent &event);
|
||||
void guezHit(const GuezHitStruct &hitStruct);
|
||||
void guezInit(int eqNo, bool resetManipulation, bool resupplyAmmo, bool resetVulnerabilityState);
|
||||
void playerManipulationChanged(int eqNo, bool playerIsManipulated, qint64 simTimeMSecs);
|
||||
void isPartOfChanged(int eqNo, int eqNoHost, qint64 simTimeMSecs); // Host is null, if player unmounted
|
||||
void eventCountOverflow();
|
||||
void biteReport(const TrainingAreaBase::EquipmentBite &report);
|
||||
void biteRequest(const TrainingAreaBase::DemandBiteRequest &request);
|
||||
|
||||
void newMinefield(AreaEffectSimulation::MineAreaModifyRequest &ma);
|
||||
void newMinefieldBreach(AreaEffectSimulation::MineCorridorModifyRequest &mc);
|
||||
|
||||
protected:
|
||||
void subscribeAtNgs();
|
||||
void unsubscribeFromNgs();
|
||||
|
||||
int m_enitityNumberCounter;
|
||||
int m_eventCount;
|
||||
|
||||
NgsHandler *m_ngsHandler;
|
||||
const QString m_fedName;
|
||||
ngs::ISimulatedWorldAdmin *m_swadmin;
|
||||
ngs::IFederationMaster *m_master;
|
||||
rpr2::IPlayerSOM *m_somPlayer;
|
||||
PlayerCallback *m_playerCallback;
|
||||
|
||||
// Callbacks:
|
||||
ObserverGuezHumanCBNotifier *m_humanCallback;
|
||||
ObserverGuezObserverControllerCBNotifier *m_observerControllerCallback;
|
||||
ObserverGuezGroundVehicleCBNotifier *m_groundVehicleCallback;
|
||||
|
||||
ObserverGuezMineFieldCBNotifier *m_minefieldCallback;
|
||||
ObserverGuezMineFieldBreachCBNotifier *m_minefieldBreachCallback;
|
||||
|
||||
ObserverMunitionDetonationCBNotifier *m_munitionDetonationCallback;
|
||||
ObserverWeaponFireCBNotifier *m_weaponfireCallback;
|
||||
ObserverGuezHitCBNotifier *m_hitCallback;
|
||||
ObserverGuezInitCBNotifier *m_initCallback;
|
||||
ObserverGuezBiteReportCBNotifier *m_biteReportCallback;
|
||||
ObserverGuezRequestBiteReportCBNotifier *m_requestBiteReportCallback;
|
||||
|
||||
QMap<int, rpr2::IPlayerBaseEntityObjInstance *> m_playerMap; // Key: EqNo // All Players, WE handle
|
||||
QMap<int, const ngs::IObserverObjectInstance *> m_observerPlayerInstances; // Key: EqNo // All of THEIR Players on the bus.
|
||||
QMap<int, ParticipantPosition> m_observerPositions; // Key: EqNo
|
||||
QMap<int, DamageModel *> m_damageModelMap; // Key: EqNo
|
||||
QSet<const ngs::IObserverObjectInstance *> m_newObjectsWithoutParticipantIdSet;
|
||||
QSet<int> m_guezHitActive;
|
||||
|
||||
QMap<int, rpr2::IPlayerEnvironmentObjectObjInstance *> m_environmentObjects; // Key: AesId // All EOs, WE handle
|
||||
QMap<int, const ngs::IObserverObjectInstance *> m_observerEnvironmentObjects; // Key: AesId // All of THEIR EOs on the bus.
|
||||
QSet<int> m_nonpublishedEnvironmentObjects; // AesId
|
||||
QMap<int, std::vector<Core::GeoPosition> > m_arealObjectSingleItems; // Key: AesId
|
||||
QMap<int, std::vector<Core::GeoPosition> > m_arealObjectForms; // Key: AesId
|
||||
QMap<int, std::vector<uint8_t> > m_arealObjectTriggeredImpacts; // Key: AesId
|
||||
|
||||
bool m_bInitialized;
|
||||
bool m_bCanPublishData;
|
||||
|
||||
QTimer *m_timer; // Todo: Start with 1 ms occurs! Needed?
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
static quint16 s_ownSiteId;
|
||||
static quint16 s_ownApplicationId;
|
||||
|
||||
static const int STATUS_WAIT_INTERVAL = 500; // Wartezeit auf Statusänderung
|
||||
static const int ACTIVATION_LEAD_TIME = 5000; // Vorlaufzeit beim Aktivieren von Wirkfeldern.
|
||||
|
||||
private slots:
|
||||
void onEntityIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::IObserverBaseEntityObjInstance *obj);
|
||||
bool onSpatialChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &wl, qint64 simTimeMSecs);
|
||||
void onEntityTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &ets, qint64 simTimeMSecs);
|
||||
void onIsPartOfChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::IsPartOfStruct &ipos, qint64 simTimeMSecs);
|
||||
bool onMarkingChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::MarkingStruct &marking, qint64 simTimeMSecs);
|
||||
bool onPointsDataChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &points, qint64 simTimeMSecs);
|
||||
bool onForceIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::ForceIdentifierEnum8::ET identifier, qint64 simTimeMSecs);
|
||||
bool onForceIdentifierChangedEO(const rpr2::EntityIdentifierStruct &eis, rpr2::ForceIdentifierEnum8::ET identifier, qint64 simTimeMSecs);
|
||||
bool onTacticalStatusChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::TacticalStatusStruct &rprStatus, qint64 simTimeMSecs);
|
||||
bool onDeactivatedChanged(const rpr2::EntityIdentifierStruct &eis, bool state, qint64 simTimeMSecs);
|
||||
bool onPercentCompleteChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 state, qint64 simTimeMSecs);
|
||||
|
||||
bool onObjectIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::IObserverEnvironmentObjectObjInstance *obj);
|
||||
|
||||
void onAreaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, qint64 simTimeMSecs);
|
||||
void onActivationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, qint64 simTimeMSecs);
|
||||
void onDurationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
void onMineTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &ets, qint64 simTimeMSecs);
|
||||
|
||||
void onNewMunitionDetonation(const rpr2::IObserverMunitionDetonationIntInstance &interaction);
|
||||
void onNewWeaponFire(const rpr2::IObserverWeaponFireIntInstance &interaction);
|
||||
void onNewGuezHit(const rpr2::IObserverGuezHitIntInstance &interaction);
|
||||
void onNewGuezInit(const rpr2::IObserverGuezInitIntInstance &interaction);
|
||||
void onNewGuezBiteReport(const rpr2::IObserverGuezBiteReportIntInstance &interaction);
|
||||
void onNewGuezRequestBiteReport(const rpr2::IObserverGuezRequestBiteReportIntInstance &interaction);
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -0,0 +1,263 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* NGSConnector class for using DIS protocol
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Baeuerle, SLSE, 2016-01-28
|
||||
*/
|
||||
|
||||
#include "ngs_connector_dis.h"
|
||||
|
||||
#include <IPlayerSOM.h>
|
||||
|
||||
#include <IncompleteDISPDUError.h>
|
||||
|
||||
// ngs player interfaces
|
||||
#include <IPlayerHumanObjInstance.h>
|
||||
#include <IPlayerPhysicalEntityObjInstance.h>
|
||||
#include <IPlayerAggregateEntityObjInstance.h>
|
||||
#include <IPlayerGroundVehicleObjInstance.h>
|
||||
#include <IPlayerAggregateEntityObjInstance.h>
|
||||
|
||||
#include <IPlayerHumanObjClass.h>
|
||||
#include <IPlayerGroundVehicleObjClass.h>
|
||||
#include <IPlayerAggregateEntityObjClass.h>
|
||||
|
||||
#include <SpatialStruct.h>
|
||||
#include <DimensionStruct.h>
|
||||
#include <RTIObjectIdStruct.h>
|
||||
#include <RTIObjectIdArrayStruct.h>
|
||||
#include <MarkingStruct.h>
|
||||
|
||||
#include <WeaponStateEnum32.h>
|
||||
#include <StanceCodeEnum32.h>
|
||||
#include <CamouflageEnum32.h>
|
||||
#include <ForceIdentifierEnum8.h>
|
||||
#include <TrailingEffectsCodeEnum32.h>
|
||||
#include <HatchStateEnum32.h>
|
||||
#include <AggregateStateEnum8.h>
|
||||
#include <FormationEnum32.h>
|
||||
|
||||
#include <ArrayOfArticulatedParameterStructDynamicHLAunpaddedLengthlessVarArray.h>
|
||||
#include <ArrayOfPropulsionSystemDataStructDynamicHLAlengthlessVarArray.h>
|
||||
#include <ArrayOfVectoringNozzleSystemDataStructDynamicHLAlengthlessVarArray.h>
|
||||
#include <ArrayOfSilentAggregateStructDynamicHLAlengthlessVarArray.h>
|
||||
#include <ArrayOfSilentEntityStructDynamicHLAlengthlessVarArray.h>
|
||||
#include <ArrayOfVariableDatumStructDynamicHLAlengthlessVarArray.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
NgsConnectorDis::NgsConnectorDis(const QString &fedName, MainHandler *mainHandler)
|
||||
: NgsConnector(fedName, mainHandler)
|
||||
{}
|
||||
|
||||
//bool NgsConnectorDis::addAggregateEntity(const ParticipantInformation &playerData,
|
||||
// const dds::core::vector<int32_t> &children)
|
||||
//{
|
||||
// ERROR_LOG(m_logger) << "AggregateEntities (Unit typeclass) not yet supported with DIS.";
|
||||
// // TODO: Has to be implemented!
|
||||
// Q_UNUSED(playerData)
|
||||
// Q_UNUSED(children)
|
||||
|
||||
// return false;
|
||||
//}
|
||||
|
||||
bool NgsConnectorDis::addGroundVehicle(const ParticipantInformation &playerData,
|
||||
const rpr2::TacticalStatusStruct &state)
|
||||
{
|
||||
if (m_participantMap.contains(playerData.id))
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "addGroundVehicle("
|
||||
<< playerData.id << ", "
|
||||
<< playerData.partyId << ", "
|
||||
<< playerData.entityTypeString << ", "
|
||||
<< state.TacticalStatus << ")";
|
||||
|
||||
rpr2::IPlayerGroundVehicleObjClass &player = m_somPlayer->getPlayerGroundVehicleObjClass();
|
||||
rpr2::IPlayerGroundVehicleObjInstance *playerInstance = &player.newGroundVehicleObjInstance();
|
||||
|
||||
if (!addBaseEntityAttributes(playerInstance, playerData))
|
||||
return false;
|
||||
addPhysicalEntityAttributes(playerInstance, playerData, state);
|
||||
addPlatformEntityAttributes(playerInstance);
|
||||
|
||||
m_participantMap.insert(playerData.id, playerInstance);
|
||||
playerInstance->publish();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NgsConnectorDis::addHuman(const ParticipantInformation &playerData,
|
||||
const rpr2::TacticalStatusStruct &state)
|
||||
{
|
||||
if (m_participantMap.contains(playerData.id))
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "addHuman("
|
||||
<< playerData.id << ", "
|
||||
<< playerData.partyId << ", "
|
||||
<< playerData.entityTypeString << ", "
|
||||
<< state.TacticalStatus << ")";
|
||||
|
||||
rpr2::IPlayerHumanObjClass &player = m_somPlayer->getPlayerHumanObjClass();
|
||||
rpr2::IPlayerHumanObjInstance *playerInstance = &player.newHumanObjInstance();
|
||||
|
||||
if (!addBaseEntityAttributes(playerInstance, playerData))
|
||||
return false;
|
||||
addPhysicalEntityAttributes(playerInstance, playerData, state);
|
||||
addLifeFormEntityAttributes(playerInstance);
|
||||
|
||||
m_participantMap.insert(playerData.id, playerInstance);
|
||||
playerInstance->publish();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NgsConnectorDis::addAircraft(const ParticipantInformation &playerData,
|
||||
const rpr2::TacticalStatusStruct &state)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Aircrafts not yet supported with DIS.";
|
||||
// TODO: Has to be implemented!
|
||||
Q_UNUSED(playerData)
|
||||
Q_UNUSED(state)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//bool NgsConnectorDis::addVessel(const ParticipantInformation &playerData,
|
||||
// const rpr2::TacticalStatusStruct &state)
|
||||
//{
|
||||
// ERROR_LOG(m_logger) << "Vessels not yet supported with DIS.";
|
||||
// // TODO: Has to be implemented!
|
||||
// Q_UNUSED(playerData)
|
||||
// Q_UNUSED(state)
|
||||
|
||||
// return false;
|
||||
//}
|
||||
|
||||
bool NgsConnectorDis::addBaseEntityAttributes(rpr2::IPlayerBaseEntityObjInstance *playerInstance,
|
||||
const ParticipantInformation &partData)
|
||||
{
|
||||
IdentifierStruct is = IdentifierStruct::fromInt(partData.externalId);
|
||||
if (!is.isOwnElement())
|
||||
{
|
||||
playerInstance->deleteObjectInstance();
|
||||
return false;
|
||||
}
|
||||
|
||||
playerInstance->setEntityIdentifier(is.toEIS());
|
||||
|
||||
setParticipantPartyId(*playerInstance, partData.id, partData.partyId);
|
||||
|
||||
//set world location
|
||||
rpr2::SpatialStruct ss;
|
||||
ss.DeadReckoningAlgorithm__A__Alternatives.discriminant(rpr2::DeadReckoningAlgorithmEnum8::Static);
|
||||
ss.DeadReckoningAlgorithm__A__Alternatives.SpatialStatic().WorldLocation = partData.position.toWorldLocation();
|
||||
ss.DeadReckoningAlgorithm__A__Alternatives.SpatialStatic().Orientation.Phi = -2.504036;
|
||||
ss.DeadReckoningAlgorithm__A__Alternatives.SpatialStatic().Orientation.Psi = 1.865257;
|
||||
ss.DeadReckoningAlgorithm__A__Alternatives.SpatialStatic().Orientation.Theta = -0.103978;
|
||||
ss.DeadReckoningAlgorithm__A__Alternatives.SpatialStatic().IsFrozen = false;
|
||||
|
||||
playerInstance->setSpatial(ss);
|
||||
|
||||
rpr2::IPlayerBaseEntityObjInstance *parent = m_participantMap.value(partData.parentId);
|
||||
rpr2::IPlayerAggregateEntityObjInstance *parentAggregate = dynamic_cast<rpr2::IPlayerAggregateEntityObjInstance *>(parent);
|
||||
if (parentAggregate)
|
||||
{
|
||||
bool bChildFound = false;
|
||||
rpr2::RTIObjectIdStruct childObjectId;
|
||||
childObjectId.ID = rpr2::OMT13string(playerInstance->getObjectName());
|
||||
|
||||
rpr2::RTIObjectIdArrayStruct children = parentAggregate->getEntityIdentifiers();
|
||||
for (unsigned int i = 0; i < children.NumberOfObjectIDs__A__ID.size(); ++i)
|
||||
{
|
||||
if (children.NumberOfObjectIDs__A__ID[i] == childObjectId)
|
||||
{
|
||||
bChildFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!bChildFound)
|
||||
{
|
||||
addOneItemToArray(children.NumberOfObjectIDs__A__ID, childObjectId);
|
||||
parentAggregate->setEntityIdentifiers(children);
|
||||
parentAggregate->publish();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void NgsConnectorDis::addPhysicalEntityAttributes(rpr2::IPlayerPhysicalEntityObjInstance *playerInstance,
|
||||
const ParticipantInformation &partData,
|
||||
const rpr2::TacticalStatusStruct &state)
|
||||
{
|
||||
DamageModel dm(rpr2::EntityIdentifierStruct(), state);
|
||||
playerInstance->setDamageState(dm.damageState());
|
||||
playerInstance->setImmobilized(dm.immobilized());
|
||||
playerInstance->setFirePowerDisabled(dm.firePowerDisabled());
|
||||
|
||||
rpr2::MarkingStruct ms;
|
||||
fillMarkingStruct(ms, partData.partyId, partData.id);
|
||||
playerInstance->setMarking(ms);
|
||||
|
||||
rpr2::ForceIdentifierEnum8::ET forceId = partyIdToForceIdentifier(partData.partyId);
|
||||
playerInstance->setForceIdentifier(forceId);
|
||||
|
||||
playerInstance->setAcousticSignatureIndex(0);
|
||||
playerInstance->setAlternateEntityType(rpr2::EntityTypeStruct());
|
||||
playerInstance->setArticulatedParametersArray(rpr2::ArrayOfArticulatedParameterStructDynamicHLAunpaddedLengthlessVarArray());
|
||||
playerInstance->setCamouflageType(rpr2::CamouflageEnum32::UniformPaintScheme);
|
||||
playerInstance->setEngineSmokeOn(false);
|
||||
playerInstance->setFlamesPresent(false);
|
||||
playerInstance->setForceIdentifier(rpr2::ForceIdentifierEnum8::Other);
|
||||
playerInstance->setHasAmmunitionSupplyCap(false);
|
||||
playerInstance->setHasFuelSupplyCap(false);
|
||||
playerInstance->setHasRecoveryCap(false);
|
||||
playerInstance->setHasRepairCap(false);
|
||||
playerInstance->setInfraredSignatureIndex(0);
|
||||
playerInstance->setIsConcealed(false);
|
||||
playerInstance->setLiveEntityMeasuredSpeed(0);
|
||||
playerInstance->setPowerPlantOn(false);
|
||||
playerInstance->setPropulsionSystemsData(rpr2::ArrayOfPropulsionSystemDataStructDynamicHLAlengthlessVarArray());
|
||||
playerInstance->setRadarCrossSectionSignatureIndex(0);
|
||||
playerInstance->setSmokePlumePresent(false);
|
||||
playerInstance->setTentDeployed(false);
|
||||
playerInstance->setTrailingEffectsCode(rpr2::TrailingEffectsCodeEnum32::NoTrail);
|
||||
playerInstance->setVectoringNozzleSystemData(rpr2::ArrayOfVectoringNozzleSystemDataStructDynamicHLAlengthlessVarArray());
|
||||
}
|
||||
|
||||
void NgsConnectorDis::addLifeFormEntityAttributes(rpr2::IPlayerLifeformObjInstance *playerInstance)
|
||||
{
|
||||
playerInstance->setComplianceState(rpr2::ComplianceStateEnum32::Other);
|
||||
playerInstance->setFlashLightsOn(false);
|
||||
playerInstance->setPrimaryWeaponState(rpr2::WeaponStateEnum32::Stowed);
|
||||
playerInstance->setSecondaryWeaponState(rpr2::WeaponStateEnum32::Stowed);
|
||||
playerInstance->setStanceCode(rpr2::StanceCodeEnum32::UprightStandingStill);
|
||||
}
|
||||
|
||||
void NgsConnectorDis::addPlatformEntityAttributes(rpr2::IPlayerPlatformObjInstance *playerInstance)
|
||||
{
|
||||
playerInstance->setAfterburnerOn(false);
|
||||
playerInstance->setAntiCollisionLightsOn(false);
|
||||
playerInstance->setBlackOutBrakeLightsOn(false);
|
||||
playerInstance->setBlackOutLightsOn(false);
|
||||
playerInstance->setBrakeLightsOn(false);
|
||||
playerInstance->setFormationLightsOn(false);
|
||||
playerInstance->setHatchState(rpr2::HatchStateEnum32::NotApplicable);
|
||||
playerInstance->setHeadLightsOn(false);
|
||||
playerInstance->setInteriorLightsOn(false);
|
||||
playerInstance->setLandingLightsOn(false);
|
||||
playerInstance->setLauncherRaised(false);
|
||||
playerInstance->setNavigationLightsOn(false);
|
||||
playerInstance->setRampDeployed(false);
|
||||
playerInstance->setRunningLightsOn(false);
|
||||
playerInstance->setSpotLightsOn(false);
|
||||
playerInstance->setTailLightsOn(false);
|
||||
}
|
||||
|
||||
} // namespace HighLevelArchitecture
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* NGSConnector class for using DIS protocol
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Baeuerle, SLSE, 2016-01-28
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ngsconnector_new.h"
|
||||
namespace rpr2
|
||||
{
|
||||
class IPlayerLifeformObjInstance;
|
||||
class IPlayerPlatformObjInstance;
|
||||
// Todo: Remove later:
|
||||
class TacticalStatusStruct;
|
||||
class IPlayerBaseEntityObjInstance;
|
||||
class IPlayerPhysicalEntityObjInstance;
|
||||
}
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
class NgsConnectorDis : public NgsConnector
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NgsConnectorDis(const QString &fedName, MainHandler *mainHandler);
|
||||
|
||||
// bool addAggregateEntity(const ParticipantInformation &playerData,
|
||||
// const std::vector<int32_t> &children) override;
|
||||
bool addHuman(const ParticipantInformation &participantData,
|
||||
const rpr2::TacticalStatusStruct &state) ; //override;
|
||||
bool addGroundVehicle(const ParticipantInformation &participantData,
|
||||
const rpr2::TacticalStatusStruct &state) ; // override;
|
||||
bool addAircraft(const ParticipantInformation &participantData,
|
||||
const rpr2::TacticalStatusStruct &state) ; // override;
|
||||
// bool addVessel(const ParticipantInformation &participantData,
|
||||
// const rpr2::TacticalStatusStruct &state) override;
|
||||
|
||||
private:
|
||||
bool addBaseEntityAttributes(rpr2::IPlayerBaseEntityObjInstance *playerInstance,
|
||||
const ParticipantInformation &partData);
|
||||
void addPhysicalEntityAttributes(rpr2::IPlayerPhysicalEntityObjInstance *playerInstance,
|
||||
const ParticipantInformation &partData,
|
||||
const rpr2::TacticalStatusStruct &state);
|
||||
void addLifeFormEntityAttributes(rpr2::IPlayerLifeformObjInstance *playerInstance);
|
||||
void addPlatformEntityAttributes(rpr2::IPlayerPlatformObjInstance *playerInstance);
|
||||
};
|
||||
|
||||
} // namespace HighLevelArchitecture
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* NgsHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include "ngs_handler.h"
|
||||
#include "ngs_connector.h"
|
||||
#include <Common/logger.h>
|
||||
#include <Common/settings.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QHostInfo>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
NgsHandler::NgsHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_logger(getLogger("NgsHandler"))
|
||||
{}
|
||||
|
||||
NgsHandler::~NgsHandler()
|
||||
{
|
||||
m_ppmHandler = nullptr;
|
||||
m_aesHandler = nullptr;
|
||||
m_ngsConnector = nullptr;
|
||||
m_ddsHandler = nullptr;
|
||||
}
|
||||
|
||||
bool NgsHandler::init(const std::shared_ptr<DdsHandler> &ddsHandler)
|
||||
{
|
||||
// initialize DDS
|
||||
m_ddsHandler = ddsHandler;
|
||||
|
||||
QMap<ngs::IObserver::ProtocolType, QString> protToStr;
|
||||
protToStr.insert(ngs::IObserver::ProtocolType::DIS, QStringLiteral("DIS"));
|
||||
protToStr.insert(ngs::IObserver::ProtocolType::HLA, QStringLiteral("HLA"));
|
||||
protToStr.insert(ngs::IObserver::ProtocolType::CORBANOTIFY, QStringLiteral("CORBA"));
|
||||
|
||||
ngs::IObserver::ProtocolType protocol = Settings::hlaProtocol();
|
||||
|
||||
INFO_LOG(m_logger) << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN"));
|
||||
|
||||
m_ngsConnector = /* (protocol == ngs::IObserver::ProtocolType::DIS) ?
|
||||
std::make_shared<NgsConnectorDis>(Settings::federationName(), this) : */
|
||||
std::make_shared<NgsConnector>(Settings::federationName(), this);
|
||||
|
||||
connect(m_ngsConnector.get(), &NgsConnector::firstTickFinished,
|
||||
this, &NgsHandler::onFirstTickFinished, Qt::UniqueConnection);
|
||||
|
||||
return m_ngsConnector->initialize(protocol, QHostInfo::localHostName().toUpper(), QCoreApplication::applicationDirPath());
|
||||
}
|
||||
|
||||
bool NgsHandler::isConnectedToHla() const
|
||||
{
|
||||
return m_ngsConnector && m_ngsConnector->canPublishData();
|
||||
}
|
||||
|
||||
void NgsHandler::onFirstTickFinished()
|
||||
{
|
||||
m_ppmHandler = std::make_shared<PpmHandler>(this);
|
||||
m_aesHandler = std::make_shared<AesHandler>(this);
|
||||
if (!m_ppmHandler->init())
|
||||
ERROR_LOG(m_logger) << "Could not init ppm handler - not able to publish participants to HLA";
|
||||
if (!m_aesHandler->init())
|
||||
ERROR_LOG(m_logger) << "Could not init ppm handler - not able to publish area effect simulations to HLA";
|
||||
|
||||
emit firstTickFinished();
|
||||
|
||||
connect(m_ppmHandler.get(), &PpmHandler::externalEquipmentNumberAdded,
|
||||
this, &NgsHandler::externalEquipmentNumberAdded);
|
||||
connect(m_ppmHandler.get(), &PpmHandler::externalEquipmentNumberRemoved,
|
||||
this, &NgsHandler::externalEquipmentNumberRemoved);
|
||||
|
||||
connect(this, &NgsHandler::participantInitRequest, m_ppmHandler.get(), &PpmHandler::participantInitRequest);
|
||||
connect(this, &NgsHandler::participantBiteRequest, m_ppmHandler.get(), &PpmHandler::participantBiteRequest);
|
||||
emit ngsHandlerReady();
|
||||
}
|
||||
|
||||
} // namespace HighLevelArchitecture
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* MainHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
#include "dds_handler.h"
|
||||
#include "ppm_handler.h"
|
||||
#include "aes_handler.h"
|
||||
#include "ngs_handler.h"
|
||||
#include <Common/logger.h>
|
||||
|
||||
#include <TrainingAreaBase/training_area_telegrams.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
class NgsHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NgsHandler(QObject *parent = nullptr);
|
||||
~NgsHandler();
|
||||
|
||||
bool init(const std::shared_ptr<DdsHandler> &ddsHandler);
|
||||
|
||||
std::shared_ptr<DdsHandler> ddsHandler() const { return m_ddsHandler; }
|
||||
std::shared_ptr<NgsConnector> ngsConnector() const { return m_ngsConnector; }
|
||||
std::shared_ptr<PpmHandler> ppmHandler() const { return m_ppmHandler; }
|
||||
std::shared_ptr<AesHandler> aesHandler() const { return m_aesHandler; }
|
||||
|
||||
bool isConnectedToHla() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void firstTickFinished();
|
||||
// HLA -> TAB
|
||||
void externalEquipmentNumberAdded(int equipNo);
|
||||
void externalEquipmentNumberRemoved(int equipNo);
|
||||
void ngsHandlerReady();
|
||||
// TAB -> HLA
|
||||
void participantInitRequest(const TrainingAreaBase::TetraIcd::Init &request);
|
||||
void participantBiteRequest(const TrainingAreaBase::TetraIcd::DemandBite &request);
|
||||
private slots:
|
||||
void onFirstTickFinished();
|
||||
private:
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<PpmHandler> m_ppmHandler;
|
||||
std::shared_ptr<AesHandler> m_aesHandler;
|
||||
std::shared_ptr<NgsConnector> m_ngsConnector;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace HighLevelArchitecture
|
||||
+1023
File diff suppressed because it is too large.
Load diff
+144
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
* Send Participant data to NGS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
#include <ProjectDataManagement/pdm_dtc.h>
|
||||
#include <AreaEffectSimulation/aes_dtc.h>
|
||||
#include <Proxies/TrainingAreaBase/tab_dts.h>
|
||||
#include <Proxies/TrainingAreaBase/tab_dtc.h>
|
||||
#include <Proxies/TrainingAreaBase/tab_ftc.h>
|
||||
#include <TacticalStatusStruct.h>
|
||||
#include <ActivateHelmetObservationEnum8.h>
|
||||
#include <ResetPlayerEnum8.h>
|
||||
|
||||
#include <TrainingAreaBase/training_area_telegrams.h>
|
||||
|
||||
#include "ngs_connector.h"
|
||||
|
||||
#include <Common/logger.h>
|
||||
|
||||
namespace LtsUtils {
|
||||
class RequestHelper;
|
||||
}
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
class NgsHandler;
|
||||
class PpmHandler : public QObject
|
||||
, protected ParticipantManagement::Interface::Ftc::ModifyParticipantDataReplyHandler
|
||||
, protected TrainingAreaBase::Interface::Ftc::DemandInitReplyHandler
|
||||
, protected TrainingAreaBase::Interface::Ftc::DemandBiteReplyHandler
|
||||
, protected TrainingAreaBase::Interface::Ftc::SendParticipantModeReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PpmHandler(NgsHandler *ngsHandler);
|
||||
~PpmHandler();
|
||||
|
||||
bool init();
|
||||
ParticipantManagement::Role roleForPartyId(int partyId);
|
||||
ProjectDataManagement::ChargeType chargeTypeFromId(int chargeTypeId);
|
||||
ProjectDataManagement::ChargeType chargeTypeFromDisEntity(const std::string &disEntity);
|
||||
ProjectDataManagement::ChargeType chargeTypeFromDisEntity(const QString &disEntity) { return chargeTypeFromDisEntity(disEntity.toStdString()); }
|
||||
int partyIdFromForceIdentifier(rpr2::ForceIdentifierEnum8::ET fi);
|
||||
rpr2::ForceIdentifierEnum8::ET forceIdentifierFromPartyId(int partyId);
|
||||
|
||||
void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
void onDemandInitReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onSendParticipantModeReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onDemandBiteReply(const Core::FunctionReplyObject &reply) override final;
|
||||
|
||||
QMap<int, int> externalEquipmentNumbers() const { return m_externalEquipmentNumbers; }
|
||||
|
||||
Q_SIGNALS:
|
||||
void externalEquipmentNumberAdded(int equipNo);
|
||||
void externalEquipmentNumberRemoved(int equipNo);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onTypeChanged(const ParticipantManagement::Type &data, DataModification modType);
|
||||
void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType);
|
||||
void onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType);
|
||||
void onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType);
|
||||
void onPartyChanged(const ParticipantManagement::Party &data, DataModification modType);
|
||||
void onParticipantGearEventChanged(const ParticipantManagement::ParticipantGearEvent &data, DataModification modType);
|
||||
void onChargeTypeChanged(const ProjectDataManagement::ChargeType &data, DataModification modType);
|
||||
void onEquipmentBiteChanged(const TrainingAreaBase::EquipmentBite &data, DataModification modType);
|
||||
|
||||
void onSpatialChanged(int eqId, const ParticipantPosition &pos, qint64 simTimeMSecs);
|
||||
bool onMarkingChanged(int eqId, const QString &marking, qint64 simTimeMSecs);
|
||||
void onParticipantHit(const GuezHitStruct &hitStruct);
|
||||
void onParticipantInit(int eqNo, bool resetManipulation, bool resupplyAmmo, bool resetVulnerabilityState);
|
||||
bool onExconInit(int eqNo, rpr2::ResetPlayerEnum8::ET rp, rpr2::ActivateHelmetObservationEnum8::ET aho);
|
||||
bool onBiteReport(const TrainingAreaBase::EquipmentBite &report);
|
||||
bool onBiteRequest(const TrainingAreaBase::DemandBiteRequest &request);
|
||||
void onManipulationChanged(int eqNo, bool playerIsManipulated, qint64 sampleTime);
|
||||
void onParticipantReceivedInit(int eqId, qint64 simTimeMSecs);
|
||||
|
||||
void onWeaponFire(const TrainingAreaBase::EquipmentGearEvent &event);
|
||||
void onIsPartOfChanged(int eqNo, int eqNoHost, qint64 simTimeMSecs);
|
||||
|
||||
void startPublishToNgs();
|
||||
|
||||
public slots:
|
||||
void participantInitRequest(const TrainingAreaBase::TetraIcd::Init &request);
|
||||
void participantBiteRequest(const TrainingAreaBase::TetraIcd::DemandBite &request);
|
||||
|
||||
private:
|
||||
void createParticipant(const ParticipantManagement::Participant &participant);
|
||||
bool createHuman(const ParticipantManagement::Participant &participant);
|
||||
bool createGroundVehicle(const ParticipantManagement::Participant &participant);
|
||||
bool createObserverController(const ParticipantManagement::Participant &participant);
|
||||
bool removeParticipant(const ParticipantManagement::Participant &participant);
|
||||
|
||||
rpr2::TacticalStatusStruct currentTacticalStatus(int participantId) const;
|
||||
|
||||
ParticipantManagement::StateInformation currentParticipantStateInformation(int participantId) const;
|
||||
static ParticipantManagement::StateInformation currentParticipantStateInformation(const ParticipantManagement::DynamicParticipantData &data);
|
||||
std::vector<ParticipantManagement::GearInformation> currentParticipantGearInformation(int participantId) const;
|
||||
std::vector<ParticipantManagement::ManipulationInformation> currentParticipantManipulationInformation(int participantId) const;
|
||||
|
||||
ParticipantPosition getParticipantPosition(int participantId) const;
|
||||
int getEquipmentNo(int participantId) const;
|
||||
int getParticipantIdByExternalId(int externalId) const;
|
||||
rpr2::ForceIdentifierEnum8::ET getRprForceIdentifierFromPpmForceIdentifier(const ParticipantManagement::HlaForceIdentifierEnum &ppmForceIdentifier) const;
|
||||
ParticipantManagement::Type getParticipantType(int typeId);
|
||||
TypeStruct getTypestruct(int typeId);
|
||||
|
||||
private:
|
||||
NgsHandler *m_ngsHandler;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftcPpm;
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_dtcPdm;
|
||||
std::shared_ptr<TrainingAreaBase::Interface::Dts> m_dtsTab;
|
||||
std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_dtcTab;
|
||||
std::shared_ptr<TrainingAreaBase::Interface::Ftc> m_ftcTab;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes;
|
||||
|
||||
QMap<int, ParticipantManagement::Type> m_types; // By typeId
|
||||
QMap<int, ParticipantManagement::DynamicParticipantData> m_dynPartData; // By participantId
|
||||
QMap<int, ParticipantManagement::Participant> m_partData; // By participantId
|
||||
QMap<int, int> m_externalEquipmentNumbers; // participantId, equipmentNumber
|
||||
QMap<int, ParticipantManagement::ParticipantPosition> m_partPosData; // By participantId -- Positions for own Players
|
||||
QMap<int, ParticipantManagement::Party> m_partyData; // By partyId
|
||||
QMap<int, TrainingAreaBase::EquipmentPosition> m_observerPositions; // By equipmentNo -- Only foreign entities
|
||||
QMap<int, int> m_isMountedOn; // By equipmentNo of mounted participant. Value = Host
|
||||
QSet<int> m_createdParticipantIds;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
QMap<int, ProjectDataManagement::ChargeType> m_chargeTypes;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
|
||||
} // namespace HighLevelArchitecture
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// $Revision$
|
||||
// $Date$
|
||||
// $Id$
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <DamageStatusEnum32.h>
|
||||
#include <EntityTypeStruct.h>
|
||||
#include <QtCore/QMetaType>
|
||||
#include <QtCore/QHash>
|
||||
#include <Common/typestruct.h>
|
||||
|
||||
Q_DECLARE_METATYPE(rpr2::DamageStatusEnum32::ET)
|
||||
|
||||
|
||||
namespace rpr2
|
||||
{
|
||||
inline uint qHash(const rpr2::EntityTypeStruct &ets)
|
||||
{
|
||||
// da es genau 64 belegte Bits sind, geht es so am einfachsten
|
||||
const quint64 *val = reinterpret_cast<const quint64 *>(&ets);
|
||||
return ::qHash(*val);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Handle GuezBiteReport Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "rpr_ia_guez_bitereport.h"
|
||||
|
||||
/*
|
||||
* ObserverGuezBiteReportCBNotifier
|
||||
*/
|
||||
ObserverGuezBiteReportCBNotifier::ObserverGuezBiteReportCBNotifier()
|
||||
: rpr2::IObserverGuezBiteReportIntClassCB()
|
||||
, m_logger(HighLevelArchitecture::getLogger("Callbacks.Interaction.GuezBiteReport"))
|
||||
{}
|
||||
|
||||
void ObserverGuezBiteReportCBNotifier::newGuezBiteReportIntInstance(const rpr2::IObserverGuezBiteReportIntInstance &interaction)
|
||||
{
|
||||
emit newGuezBiteReport(interaction);
|
||||
}
|
||||
|
||||
void ObserverGuezBiteReportCBNotifier::deleteInterface()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete Interface";
|
||||
//rpr2::IObserverMunitionDetonationIntClassCB::deleteInterface();
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Handle GuezBiteReport Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
|
||||
#include <IObserverGuezBiteReportIntClassCB.h>
|
||||
#include <IObserverGuezBiteReportIntInstance.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <Common/logger.h>
|
||||
|
||||
/**
|
||||
* The notifier for new action requests
|
||||
*/
|
||||
class ObserverGuezBiteReportCBNotifier : public QObject, public rpr2::IObserverGuezBiteReportIntClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverGuezBiteReportCBNotifier();
|
||||
|
||||
void newGuezBiteReportIntInstance(const rpr2::IObserverGuezBiteReportIntInstance &interaction) override;
|
||||
void deleteInterface() override;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
signals:
|
||||
void newGuezBiteReport(const rpr2::IObserverGuezBiteReportIntInstance &action);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Handle GuezExconEngagement Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "rpr_ia_guez_exconengagement.h"
|
||||
|
||||
/*
|
||||
* ObserverGuezExconEngagementCBNotifier
|
||||
*/
|
||||
ObserverGuezExconEngagementCBNotifier::ObserverGuezExconEngagementCBNotifier()
|
||||
: rpr2::IObserverGuezExconEngagementIntClassCB()
|
||||
, m_logger(HighLevelArchitecture::getLogger("Callbacks.Interaction.GuezExconEngagement"))
|
||||
{}
|
||||
|
||||
void ObserverGuezExconEngagementCBNotifier::newGuezExconEngagementIntInstance(const rpr2::IObserverGuezExconEngagementIntInstance &interaction)
|
||||
{
|
||||
emit newGuezExconEngagement(interaction);
|
||||
}
|
||||
|
||||
void ObserverGuezExconEngagementCBNotifier::deleteInterface()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete Interface";
|
||||
//rpr2::IObserverMunitionDetonationIntClassCB::deleteInterface();
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Handle GuezExconEngagement Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
|
||||
#include <IObserverGuezExconEngagementIntClassCB.h>
|
||||
#include <IObserverGuezExconEngagementIntInstance.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <Common/logger.h>
|
||||
|
||||
/**
|
||||
* The notifier for new action requests
|
||||
*/
|
||||
class ObserverGuezExconEngagementCBNotifier : public QObject, public rpr2::IObserverGuezExconEngagementIntClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverGuezExconEngagementCBNotifier();
|
||||
|
||||
void newGuezExconEngagementIntInstance(const rpr2::IObserverGuezExconEngagementIntInstance &interaction) override;
|
||||
void deleteInterface() override;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
signals:
|
||||
void newGuezExconEngagement(const rpr2::IObserverGuezExconEngagementIntInstance &action);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Handle GuezHit Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "rpr_ia_guez_hit.h"
|
||||
|
||||
|
||||
/*
|
||||
* ObserverGuezHitCBNotifier
|
||||
*/
|
||||
ObserverGuezHitCBNotifier::ObserverGuezHitCBNotifier()
|
||||
: rpr2::IObserverGuezHitIntClassCB()
|
||||
, m_logger(HighLevelArchitecture::getLogger("Callbacks.Interaction.GuezHit"))
|
||||
{}
|
||||
|
||||
void ObserverGuezHitCBNotifier::newGuezHitIntInstance(const rpr2::IObserverGuezHitIntInstance &interaction)
|
||||
{
|
||||
emit newGuezHit(interaction);
|
||||
}
|
||||
|
||||
void ObserverGuezHitCBNotifier::deleteInterface()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete Interface";
|
||||
//rpr2::IObserverMunitionDetonationIntClassCB::deleteInterface();
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Handle GuezHit Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
|
||||
#include <IObserverGuezHitIntClassCB.h>
|
||||
#include <IObserverGuezHitIntInstance.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <Common/logger.h>
|
||||
|
||||
/**
|
||||
* The notifier for new action requests
|
||||
*/
|
||||
class ObserverGuezHitCBNotifier : public QObject, public rpr2::IObserverGuezHitIntClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverGuezHitCBNotifier();
|
||||
|
||||
void newGuezHitIntInstance(const rpr2::IObserverGuezHitIntInstance &interaction) override;
|
||||
void deleteInterface() override;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
signals:
|
||||
void newGuezHit(const rpr2::IObserverGuezHitIntInstance &interaction);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Handle GuezInit Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "rpr_ia_guez_init.h"
|
||||
|
||||
/*
|
||||
* ObserverGuezInitCBNotifier
|
||||
*/
|
||||
ObserverGuezInitCBNotifier::ObserverGuezInitCBNotifier()
|
||||
: rpr2::IObserverGuezInitIntClassCB()
|
||||
, m_logger(HighLevelArchitecture::getLogger("Callbacks.Interaction.GuezInit"))
|
||||
{}
|
||||
|
||||
void ObserverGuezInitCBNotifier::newGuezInitIntInstance(const rpr2::IObserverGuezInitIntInstance &interaction)
|
||||
{
|
||||
emit newGuezInit(interaction);
|
||||
}
|
||||
|
||||
void ObserverGuezInitCBNotifier::deleteInterface()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete Interface";
|
||||
//rpr2::IObserverMunitionDetonationIntClassCB::deleteInterface();
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Handle GuezInit Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
|
||||
#include <IObserverGuezInitIntClassCB.h>
|
||||
#include <IObserverGuezInitIntInstance.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <Common/logger.h>
|
||||
|
||||
/**
|
||||
* The notifier for new action requests
|
||||
*/
|
||||
class ObserverGuezInitCBNotifier : public QObject, public rpr2::IObserverGuezInitIntClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverGuezInitCBNotifier();
|
||||
|
||||
void newGuezInitIntInstance(const rpr2::IObserverGuezInitIntInstance &interaction) override;
|
||||
void deleteInterface() override;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
signals:
|
||||
void newGuezInit(const rpr2::IObserverGuezInitIntInstance &action);
|
||||
};
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Handle GuezRequestBiteReport Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "rpr_ia_guez_requestbitereport.h"
|
||||
|
||||
/*
|
||||
* ObserverGuezRequestBiteReportCBNotifier
|
||||
*/
|
||||
ObserverGuezRequestBiteReportCBNotifier::ObserverGuezRequestBiteReportCBNotifier()
|
||||
: rpr2::IObserverGuezRequestBiteReportIntClassCB()
|
||||
, m_logger(HighLevelArchitecture::getLogger("Callbacks.Interaction.GuezRequestBiteReport"))
|
||||
{}
|
||||
|
||||
void ObserverGuezRequestBiteReportCBNotifier::newGuezRequestBiteReportIntInstance(const rpr2::IObserverGuezRequestBiteReportIntInstance &interaction)
|
||||
{
|
||||
emit newGuezRequestBiteReport(interaction);
|
||||
}
|
||||
|
||||
void ObserverGuezRequestBiteReportCBNotifier::deleteInterface()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete Interface";
|
||||
//rpr2::IObserverMunitionDetonationIntClassCB::deleteInterface();
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Handle GuezRequestBiteReport Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
|
||||
#include <IObserverGuezRequestBiteReportIntClassCB.h>
|
||||
#include <IObserverGuezRequestBiteReportIntInstance.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <Common/logger.h>
|
||||
|
||||
/**
|
||||
* The notifier for new action requests
|
||||
*/
|
||||
class ObserverGuezRequestBiteReportCBNotifier : public QObject, public rpr2::IObserverGuezRequestBiteReportIntClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverGuezRequestBiteReportCBNotifier();
|
||||
|
||||
void newGuezRequestBiteReportIntInstance(const rpr2::IObserverGuezRequestBiteReportIntInstance &interaction) override;
|
||||
void deleteInterface() override;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
signals:
|
||||
void newGuezRequestBiteReport(const rpr2::IObserverGuezRequestBiteReportIntInstance &action);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Handle MunitionDetonation Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "rpr_ia_munitiondetonation.h"
|
||||
|
||||
/*
|
||||
* ObserverMunitionDetonationCBNotifier
|
||||
*/
|
||||
ObserverMunitionDetonationCBNotifier::ObserverMunitionDetonationCBNotifier()
|
||||
: rpr2::IObserverMunitionDetonationIntClassCB()
|
||||
, m_logger(HighLevelArchitecture::getLogger("Callbacks.Interaction.MunitionDetonation"))
|
||||
{}
|
||||
|
||||
void ObserverMunitionDetonationCBNotifier::newMunitionDetonationIntInstance(const rpr2::IObserverMunitionDetonationIntInstance &interaction)
|
||||
{
|
||||
emit newMunitionDetonation(interaction);
|
||||
}
|
||||
|
||||
void ObserverMunitionDetonationCBNotifier::deleteInterface()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete Interface";
|
||||
//rpr2::IObserverMunitionDetonationCBNotifier::deleteInterface();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Handle MunitionDetonation Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
|
||||
#include <IObserverMunitionDetonationIntClassCB.h>
|
||||
#include <IObserverMunitionDetonationIntInstance.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <Common/logger.h>
|
||||
|
||||
/**
|
||||
* The notifier for new munition detonation requests
|
||||
*/
|
||||
class ObserverMunitionDetonationCBNotifier : public QObject, public rpr2::IObserverMunitionDetonationIntClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverMunitionDetonationCBNotifier();
|
||||
|
||||
void newMunitionDetonationIntInstance(const rpr2::IObserverMunitionDetonationIntInstance &interaction) override;
|
||||
void deleteInterface() override;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
signals:
|
||||
void newMunitionDetonation(const rpr2::IObserverMunitionDetonationIntInstance &interaction);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Handle WeaponFire Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "rpr_ia_weaponfire.h"
|
||||
|
||||
// rpr2 data types
|
||||
#include <EventIdentifierStruct.h>
|
||||
#include <EntityTypeStruct.h>
|
||||
#include <WorldLocationStruct.h>
|
||||
|
||||
|
||||
/*
|
||||
* ObserverWeaponFireCBNotifier
|
||||
*/
|
||||
ObserverWeaponFireCBNotifier::ObserverWeaponFireCBNotifier()
|
||||
: rpr2::IObserverWeaponFireIntClassCB()
|
||||
, m_logger(HighLevelArchitecture::getLogger("Callbacks.Interaction.WeaponFire"))
|
||||
{}
|
||||
|
||||
void ObserverWeaponFireCBNotifier::newWeaponFireIntInstance(const rpr2::IObserverWeaponFireIntInstance &interaction)
|
||||
{
|
||||
emit newWeaponFire(interaction);
|
||||
}
|
||||
|
||||
void ObserverWeaponFireCBNotifier::deleteInterface()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete Interface";
|
||||
//rpr2::IObserverMunitionDetonationIntClassCB::deleteInterface();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Handle WeaponFire Events
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
|
||||
#include <IObserverWeaponFireIntClassCB.h>
|
||||
#include <IObserverWeaponFireIntInstance.h>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <Common/logger.h>
|
||||
|
||||
/**
|
||||
* The notifier for new action requests
|
||||
*/
|
||||
class ObserverWeaponFireCBNotifier : public QObject, public rpr2::IObserverWeaponFireIntClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverWeaponFireCBNotifier();
|
||||
|
||||
void newWeaponFireIntInstance(const rpr2::IObserverWeaponFireIntInstance &interaction) override;
|
||||
void deleteInterface() override;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
signals:
|
||||
void newWeaponFire(const rpr2::IObserverWeaponFireIntInstance &interaction);
|
||||
};
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in an AggregateEntity instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_aggregateentity_object_cb.h"
|
||||
#include "rpr_observer_aggregateentity_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new AggregateEntity instances
|
||||
*/
|
||||
class ObserverAggregateEntityCBNotifier : public ObserverAggregateEntityObjectCB, public rpr2::IObserverAggregateEntityObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverAggregateEntityCBNotifier()
|
||||
: ObserverAggregateEntityObjectCB("Callbacks.AggregateEntity")
|
||||
, rpr2::IObserverAggregateEntityObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverAggregateEntityObjClassCB
|
||||
rpr2::IObserverAggregateEntityObjInstanceCB &newAggregateEntityObjInstance(rpr2::IObserverAggregateEntityObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverAggregateEntityObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* class to handle signals for ObserverPhysicalEntities functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_baseentity_object_cb.h"
|
||||
#include <AggregateMarkingStruct.h>
|
||||
#include <AggregateStateEnum8.h>
|
||||
#include <DimensionStruct.h>
|
||||
#include <RTIObjectIdArrayStruct.h>
|
||||
|
||||
class ObserverAggregateEntityObjectCB : public ObserverBaseEntityObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverAggregateEntityObjectCB(const char *loggerName = "Callbacks.PhysicalEntity")
|
||||
: ObserverBaseEntityObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onAggregateMarkingChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
const rpr2::AggregateMarkingStruct &state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit aggregateMarkingChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onAggregateStateChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
rpr2::AggregateStateEnum8::ET state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit aggregateStateChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onDimensionsChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
const rpr2::DimensionStruct &state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit dimensionsChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onEntityIdentifiersChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
const rpr2::RTIObjectIdArrayStruct &state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit entityIdentifiersChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onForceIdentifierChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
rpr2::ForceIdentifierEnum8::ET state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit forceIdentifierChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void aggregateMarkingChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::AggregateMarkingStruct &state, qint64 simTimeMSecs);
|
||||
void aggregateStateChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::AggregateStateEnum8::ET state, qint64 simTimeMSecs);
|
||||
void dimensionsChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::DimensionStruct &state, qint64 simTimeMSecs);
|
||||
void entityIdentifiersChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::RTIObjectIdArrayStruct &state, qint64 simTimeMSecs);
|
||||
void forceIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::ForceIdentifierEnum8::ET state, qint64 simTimeMSecs);
|
||||
};
|
||||
Executable
+84
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* template class to handle IObserverPhysicalEntityObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverAggregateEntityObjClassCB.h>
|
||||
#include <IObserverAggregateEntityObjInstance.h>
|
||||
#include <IObserverAggregateEntityObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_aggregateentity_object_cb.h"
|
||||
#include "rpr_observer_baseentity_object_instance_cb.h"
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverAggregateEntityObjInstanceCB : public ObserverBaseEntityObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverAggregateEntityObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.PhysicalEntity")
|
||||
: ObserverBaseEntityObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
//
|
||||
// IObserverAggregateEntityObjInstanceCB
|
||||
//
|
||||
void changedAggregateMarking(const rpr2::AggregateMarkingStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
this->m_pCB->onAggregateMarkingChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedAggregateState(rpr2::AggregateStateEnum8::ET value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
this->m_pCB->onAggregateStateChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDimensions(const rpr2::DimensionStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
this->m_pCB->onDimensionsChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedEntityIdentifiers(const rpr2::RTIObjectIdArrayStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
this->m_pCB->onEntityIdentifiersChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedForceIdentifier(rpr2::ForceIdentifierEnum8::ET value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
this->m_pCB->onForceIdentifierChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedFormation(rpr2::FormationEnum32::ET) override {}
|
||||
void changedNumberOfSilentEntities(ngs::INT16) override {}
|
||||
void changedNumberOfVariableDatums(ngs::UINT32) override {}
|
||||
void changedSilentAggregates(const rpr2::ArrayOfSilentAggregateStructDynamicHLAlengthlessVarArray &) override {}
|
||||
void changedSilentEntities(const rpr2::ArrayOfSilentEntityStructDynamicHLAlengthlessVarArray &) override {}
|
||||
void changedSubAggregateIdentifiers(const rpr2::RTIObjectIdArrayStruct &) override {}
|
||||
void changedVariableDatums(const rpr2::ArrayOfVariableDatumStructDynamicHLAlengthlessVarArray &) override {}
|
||||
};
|
||||
|
||||
using ObserverAggregateEntityObjInstanceCBType = ObserverAggregateEntityObjInstanceCB<rpr2::IObserverAggregateEntityObjInstanceCB,
|
||||
rpr2::IObserverAggregateEntityObjInstance,
|
||||
ObserverAggregateEntityObjectCB>;
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in an Aircraft instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_aircraft_object_cb.h"
|
||||
#include "rpr_observer_aircraft_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new Aircraft instances
|
||||
*/
|
||||
class ObserverAircraftCBNotifier : public ObserverAircraftObjectCB, public rpr2::IObserverAircraftObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverAircraftCBNotifier()
|
||||
: ObserverAircraftObjectCB("Callbacks.Aircraft")
|
||||
, rpr2::IObserverAircraftObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverAircraftObjClassCB
|
||||
rpr2::IObserverAircraftObjInstanceCB &newAircraftObjInstance(rpr2::IObserverAircraftObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverAircraftObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* class to handle signals for ObserverAircrafts functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_platform_object_cb.h"
|
||||
|
||||
class ObserverAircraftObjectCB : public ObserverPlatformObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverAircraftObjectCB(const char *loggerName = "Callbacks.Aircraft")
|
||||
: ObserverPlatformObjectCB(loggerName)
|
||||
{}
|
||||
};
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* template class to handle IObserverAircraftObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverAircraftObjClassCB.h>
|
||||
#include <IObserverAircraftObjInstance.h>
|
||||
#include <IObserverAircraftObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_platform_object_instance_cb.h"
|
||||
|
||||
class ObserverAircraftObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverAircraftObjInstanceCB : public ObserverPlatformObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverAircraftObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.Aircraft")
|
||||
: ObserverPlatformObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedAfterburnerOn(bool) override {}
|
||||
void changedAntiCollisionLightsOn(bool) override {}
|
||||
void changedBlackOutBrakeLightsOn(bool) override {}
|
||||
void changedBlackOutLightsOn(bool) override {}
|
||||
void changedBrakeLightsOn(bool) override {}
|
||||
void changedFormationLightsOn(bool) override {}
|
||||
void changedHatchState(rpr2::HatchStateEnum32::ET) override {}
|
||||
void changedHeadLightsOn(bool) override {}
|
||||
void changedInteriorLightsOn(bool) override {}
|
||||
void changedLandingLightsOn(bool) override {}
|
||||
void changedLauncherRaised(bool) override {}
|
||||
void changedNavigationLightsOn(bool) override {}
|
||||
void changedRampDeployed(bool) override {}
|
||||
void changedRunningLightsOn(bool) override {}
|
||||
void changedSpotLightsOn(bool) override {}
|
||||
void changedTailLightsOn(bool) override {}
|
||||
|
||||
};
|
||||
|
||||
using ObserverAircraftObjInstanceCBType = ObserverAircraftObjInstanceCB<rpr2::IObserverAircraftObjInstanceCB,
|
||||
rpr2::IObserverAircraftObjInstance,
|
||||
ObserverAircraftObjectCB>;
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* class to handle signals for ObserverBaseEntities functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_environment_object_object_cb.h"
|
||||
|
||||
#include <EntityIdentifierStruct.h>
|
||||
|
||||
namespace rpr2
|
||||
{
|
||||
class WorldLocationStruct;
|
||||
class ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray;
|
||||
}
|
||||
|
||||
class ObserverArealObjectObjectCB : public ObserverEnvironmentObjectObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverArealObjectObjectCB(const char *loggerName = "Callbacks.ArealObject")
|
||||
: ObserverEnvironmentObjectObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onPointsDataChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &value,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit pointsDataChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onPercentCompleteChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
ngs::UINT32 value,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit percentCompleteChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onDamagedAppearanceChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
rpr2::DamageStatusEnum32::ET state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit damagedAppearanceChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onObjectPreDistributedChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
bool state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit objectPreDistributedChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onDeactivatedChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
bool state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit deactivatedChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onSmokingChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
bool state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit smokingChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onFlamingChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
bool state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit flamingChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void pointsDataChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &state, qint64 simTimeMSecs);
|
||||
void percentCompleteChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 state, qint64 simTimeMSecs);
|
||||
void damagedAppearanceChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::DamageStatusEnum32::ET state, qint64 simTimeMSecs);
|
||||
void objectPreDistributedChanged(const rpr2::EntityIdentifierStruct &eis, bool state, qint64 simTimeMSecs);
|
||||
void deactivatedChanged(const rpr2::EntityIdentifierStruct &eis, bool state, qint64 simTimeMSecs);
|
||||
void smokingChanged(const rpr2::EntityIdentifierStruct &eis, bool state, qint64 simTimeMSecs);
|
||||
void flamingChanged(const rpr2::EntityIdentifierStruct &eis, bool state, qint64 simTimeMSecs);
|
||||
|
||||
};
|
||||
Executable
+93
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* template class to handle IObserverArealObjectObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverArealObjectObjInstanceCB.h>
|
||||
#include <EntityIdentifierStruct.h>
|
||||
#include <SpatialStruct.h>
|
||||
#include <WorldLocationStruct.h>
|
||||
|
||||
#include <NGSUtils/SimTime.h>
|
||||
|
||||
#include "rpr_observer_environment_object_object_instance_cb.h"
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverArealObjectObjInstanceCB : public ObserverEnvironmentObjectObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverArealObjectObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.ArealObject")
|
||||
: ObserverEnvironmentObjectObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
// Declarations for pure virtual functions
|
||||
void changedPointsData(const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onPointsDataChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedPercentComplete(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onPercentCompleteChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDamagedAppearance(rpr2::DamageStatusEnum32::ET value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDamagedAppearanceChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedObjectPreDistributed(bool value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onObjectPreDistributedChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDeactivated(bool value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDeactivatedChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedSmoking(bool value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onSmokingChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedFlaming(bool value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onFlamingChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
protected:
|
||||
// ngs::SimTime m_lastPositionTime;
|
||||
};
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* class to handle signals for ObserverBaseEntities functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_object_cb.h"
|
||||
|
||||
#include <EntityIdentifierStruct.h>
|
||||
|
||||
namespace rpr2
|
||||
{
|
||||
class WorldLocationStruct;
|
||||
}
|
||||
|
||||
class ObserverBaseEntityObjectCB : public ObserverObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverBaseEntityObjectCB(const char *loggerName = "Callbacks.BaseEntity")
|
||||
: ObserverObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onEntityIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::IObserverBaseEntityObjInstance &object)
|
||||
{
|
||||
INFO_LOG(m_logger) << "EntityIdentifier changed for Human Object. New EntityIdentifier: "
|
||||
<< eis.FederateIdentifier.SiteID << "/"
|
||||
<< eis.FederateIdentifier.ApplicationID << "/"
|
||||
<< eis.EntityNumber;
|
||||
emit entityIdentifierChanged(eis, &object);
|
||||
}
|
||||
|
||||
void onSpatialChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &wl, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit spatialChanged(eis, wl, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onEntityTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &ets, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit entityTypeChanged(eis, ets, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onIsPartOfChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::IsPartOfStruct &ipos, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit isPartOfChanged(eis, ipos, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void entityIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::IObserverBaseEntityObjInstance *object);
|
||||
void spatialChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &wl, qint64 simTimeMSecs);
|
||||
void entityTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &ets, qint64 simTimeMSecs);
|
||||
void isPartOfChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::IsPartOfStruct &ipos, qint64 simTimeMSecs);
|
||||
};
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* template class to handle IObserverBaseEntityObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverBaseEntityObjInstanceCB.h>
|
||||
#include <EntityIdentifierStruct.h>
|
||||
#include <SpatialStruct.h>
|
||||
#include <WorldLocationStruct.h>
|
||||
|
||||
#include <NGSUtils/SimTime.h>
|
||||
|
||||
#include "rpr_observer_object_instance_cb.h"
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverBaseEntityObjInstanceCB : public ObserverObjectInstanceCB<IOBJ_CB, OBJ, OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverBaseEntityObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.BaseEntity")
|
||||
: ObserverObjectInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
//
|
||||
// IObserverObjectInstanceCallback
|
||||
//
|
||||
void changedSpatial(const rpr2::SpatialStruct &data) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
|
||||
rpr2::DeadReckoningAlgorithmEnum8::ET d = data.DeadReckoningAlgorithm__A__Alternatives.discriminant();
|
||||
switch (d)
|
||||
{
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::Other:
|
||||
// nothing
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::Static:
|
||||
{
|
||||
rpr2::WorldLocationStruct wl = data.DeadReckoningAlgorithm__A__Alternatives.SpatialStatic().WorldLocation;
|
||||
try
|
||||
{
|
||||
//Bei anderen Projekten muss ein Mapping stattfinden. Dies wird jetzt im NGSInterface erledigt.
|
||||
//m_pCB->onSpatialChanged(m_pIObject->getEntityIdentifier().EntityNumber, wl, simTimeMSecs);
|
||||
this->m_pCB->onSpatialChanged(this->m_pIObject->getEntityIdentifier(), wl, this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ERROR_LOG(this->m_logger) << "Human-Callback threw Exception in 'newTlnPos()";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_FPW:
|
||||
{
|
||||
rpr2::WorldLocationStruct wl = data.DeadReckoningAlgorithm__A__Alternatives.SpatialFPW().WorldLocation;
|
||||
try
|
||||
{
|
||||
this->m_pCB->onSpatialChanged(this->m_pIObject->getEntityIdentifier(), wl, this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ERROR_LOG(this->m_logger) << "Human-Callback threw Exception in 'newTlnPos()";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_RPW:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_RPW";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_RVW:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_RVW";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_FVW:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_FVW";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_FPB:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_FPB";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_RPB:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_RPB";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_RVB:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_RVB";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_FVB:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_FVB";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void receivedSpatial(const rpr2::SpatialStruct &, const ngs::SimTime &simTime) override
|
||||
{
|
||||
m_lastPositionTime = simTime;
|
||||
}
|
||||
|
||||
void changedEntityIdentifier(const rpr2::EntityIdentifierStruct &data) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
{
|
||||
ERROR_LOG(this->m_logger) << "No valid Entity.";
|
||||
return;
|
||||
}
|
||||
this->m_pCB->onEntityIdentifierChanged(data, *this->m_pIObject);
|
||||
}
|
||||
|
||||
void changedEntityType(const rpr2::EntityTypeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
|
||||
this->m_pCB->onEntityTypeChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
|
||||
}
|
||||
|
||||
void changedIsPartOf(const rpr2::IsPartOfStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
|
||||
this->m_pCB->onIsPartOfChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
// Declarations for pure virtual functions
|
||||
void changedRelativeSpatial(const rpr2::SpatialStruct &) override {}
|
||||
protected:
|
||||
ngs::SimTime m_lastPositionTime;
|
||||
};
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* class to handle signals for ObserverBaseEntities functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_object_cb.h"
|
||||
|
||||
#include <EntityIdentifierStruct.h>
|
||||
|
||||
namespace rpr2
|
||||
{
|
||||
class WorldLocationStruct;
|
||||
}
|
||||
|
||||
class ObserverEnvironmentObjectObjectCB : public ObserverObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverEnvironmentObjectObjectCB(const char *loggerName = "Callbacks.EnvironmentObject")
|
||||
: ObserverObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onObjectIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::IObserverEnvironmentObjectObjInstance &object)
|
||||
{
|
||||
INFO_LOG(m_logger) << "ObjectIdentifier changed for Environment Object Object. New ObjectIdentifier: "
|
||||
<< eis.FederateIdentifier.ApplicationID << "/"
|
||||
<< eis.FederateIdentifier.SiteID << "/"
|
||||
<< eis.EntityNumber;
|
||||
emit objectIdentifierChanged(eis, &object);
|
||||
}
|
||||
|
||||
void onSpatialChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &wl, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit spatialChanged(eis, wl, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onReferencedObjectIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::RTIObjectIdStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit referencedObjectIdentifierChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onForceIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::ForceIdentifierEnum8::ET value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit forceIdentifierChangedEO(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onObjectTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EnvironmentObjectTypeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit objectTypeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
Q_SIGNALS:
|
||||
void objectIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::IObserverEnvironmentObjectObjInstance *object);
|
||||
void spatialChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &wl, qint64 simTimeMSecs);
|
||||
void referencedObjectIdentifierChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::RTIObjectIdStruct &value, qint64 simTimeMSecs);
|
||||
void forceIdentifierChangedEO(const rpr2::EntityIdentifierStruct &eis, rpr2::ForceIdentifierEnum8::ET value, qint64 simTimeMSecs);
|
||||
void objectTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EnvironmentObjectTypeStruct &value, qint64 simTimeMSecs);
|
||||
};
|
||||
Executable
+142
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* template class to handle IObserverEnvironmentObjectObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverEnvironmentObjectObjClassCB.h>
|
||||
#include <IObserverEnvironmentObjectObjInstance.h>
|
||||
#include <IObserverEnvironmentObjectObjInstanceCB.h>
|
||||
#include <EntityIdentifierStruct.h>
|
||||
#include <SpatialStruct.h>
|
||||
#include <WorldLocationStruct.h>
|
||||
|
||||
#include <NGSUtils/SimTime.h>
|
||||
|
||||
#include "rpr_observer_object_instance_cb.h"
|
||||
|
||||
class ObserverEnvironmentObjectObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverEnvironmentObjectObjInstanceCB : public ObserverObjectInstanceCB<IOBJ_CB, OBJ, OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverEnvironmentObjectObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.EnvironmentObject")
|
||||
: ObserverObjectInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
//
|
||||
// IObserverObjectInstanceCallback
|
||||
//
|
||||
void changedSpatial(const rpr2::SpatialStruct &data)
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
|
||||
rpr2::DeadReckoningAlgorithmEnum8::ET d = data.DeadReckoningAlgorithm__A__Alternatives.discriminant();
|
||||
switch (d)
|
||||
{
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::Other:
|
||||
// nothing
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::Static:
|
||||
{
|
||||
rpr2::WorldLocationStruct wl = data.DeadReckoningAlgorithm__A__Alternatives.SpatialStatic().WorldLocation;
|
||||
try
|
||||
{
|
||||
//Bei anderen Projekten muss ein Mapping stattfinden. Dies wird jetzt im NGSInterface erledigt.
|
||||
//m_pCB->onSpatialChanged(m_pIObject->getEntityIdentifier().EntityNumber, wl, simTimeMSecs);
|
||||
this->m_pCB->onSpatialChanged(this->m_pIObject->getObjectIdentifier(), wl, this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ERROR_LOG(this->m_logger) << "Human-Callback threw Exception in 'newTlnPos()";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_FPW:
|
||||
{
|
||||
rpr2::WorldLocationStruct wl = data.DeadReckoningAlgorithm__A__Alternatives.SpatialFPW().WorldLocation;
|
||||
try
|
||||
{
|
||||
this->m_pCB->onSpatialChanged(this->m_pIObject->getObjectIdentifier(), wl, this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ERROR_LOG(this->m_logger) << "Human-Callback threw Exception in 'newTlnPos()";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_RPW:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_RPW";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_RVW:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_RVW";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_FVW:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_FVW";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_FPB:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_FPB";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_RPB:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_RPB";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_RVB:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_RVB";
|
||||
break;
|
||||
case rpr2::DeadReckoningAlgorithmEnum8::DRM_FVB:
|
||||
DEBUG_LOG(this->m_logger) << "ObserverHumanObjInstanceCB::changedSpatial, case rpr2::DeadReckoningAlgorithmEnum8::DRM_FVB";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void receivedSpatial(const rpr2::SpatialStruct &, const ngs::SimTime &simTime)
|
||||
{
|
||||
m_lastPositionTime = simTime;
|
||||
}
|
||||
|
||||
void changedObjectIdentifier(const rpr2::EntityIdentifierStruct &data) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onObjectIdentifierChanged(data, *this->m_pIObject);
|
||||
}
|
||||
|
||||
void changedReferencedObjectIdentifier(const rpr2::RTIObjectIdStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onReferencedObjectIdentifierChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedForceIdentifier(rpr2::ForceIdentifierEnum8::ET value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onForceIdentifierChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedObjectType(const rpr2::EnvironmentObjectTypeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onObjectTypeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
protected:
|
||||
ngs::SimTime m_lastPositionTime;
|
||||
};
|
||||
|
||||
using ObserverEnvironmentObjInstanceCBType = ObserverEnvironmentObjectObjInstanceCB<rpr2::IObserverEnvironmentObjectObjInstanceCB,
|
||||
rpr2::IObserverEnvironmentObjectObjInstance,
|
||||
ObserverEnvironmentObjectObjectCB>;
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in an GroundVehicle instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_groundvehicle_object_cb.h"
|
||||
#include "rpr_observer_groundvehicle_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new ground vehicle instances
|
||||
*/
|
||||
class ObserverGroundVehicleCBNotifier : public ObserverGroundVehicleObjectCB, public rpr2::IObserverGroundVehicleObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverGroundVehicleCBNotifier()
|
||||
: ObserverGroundVehicleObjectCB("Callbacks.GroundVehicle")
|
||||
, rpr2::IObserverGroundVehicleObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverGroundVehicleObjClassCB
|
||||
rpr2::IObserverGroundVehicleObjInstanceCB &newGroundVehicleObjInstance(rpr2::IObserverGroundVehicleObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGroundVehicleObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* class to handle signals for ObserverHumans functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_platform_object_cb.h"
|
||||
|
||||
class ObserverGroundVehicleObjectCB : public ObserverPlatformObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGroundVehicleObjectCB(const char *loggerName = "Callbacks.GroundVehicle")
|
||||
: ObserverPlatformObjectCB(loggerName)
|
||||
{}
|
||||
};
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* template class to handle IObserverGroundVehicleObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGroundVehicleObjClassCB.h>
|
||||
#include <IObserverGroundVehicleObjInstance.h>
|
||||
#include <IObserverGroundVehicleObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_platform_object_instance_cb.h"
|
||||
|
||||
class ObserverGroundVehicleObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGroundVehicleObjInstanceCB : public ObserverPlatformObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGroundVehicleObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GroundVehicle")
|
||||
: ObserverPlatformObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
};
|
||||
|
||||
using ObserverGroundVehicleObjInstanceCBType = ObserverGroundVehicleObjInstanceCB<rpr2::IObserverGroundVehicleObjInstanceCB,
|
||||
rpr2::IObserverGroundVehicleObjInstance,
|
||||
ObserverGroundVehicleObjectCB>;
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in a GUEZ Aircraft instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_aircraft_object_cb.h"
|
||||
#include "rpr_observer_guez_aircraft_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new Aircraft instances
|
||||
*/
|
||||
class ObserverGuezAircraftCBNotifier : public ObserverGuezAircraftObjectCB, public rpr2::IObserverGuezAircraftObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezAircraftCBNotifier()
|
||||
: ObserverGuezAircraftObjectCB("Callbacks.GuezAircraft")
|
||||
, rpr2::IObserverGuezAircraftObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverAircraftObjClassCB
|
||||
rpr2::IObserverGuezAircraftObjInstanceCB &newGuezAircraftObjInstance(rpr2::IObserverGuezAircraftObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezAircraftObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ Aircrafts functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <TacticalStatusStruct.h>
|
||||
|
||||
#include "rpr_observer_aircraft_object_cb.h"
|
||||
|
||||
class ObserverGuezAircraftObjectCB : public ObserverAircraftObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezAircraftObjectCB(const char *loggerName = "Callbacks.GuezAircraft")
|
||||
: ObserverAircraftObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onTacticalStatusChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
const rpr2::TacticalStatusStruct &state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit tacticalStatusChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void tacticalStatusChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::TacticalStatusStruct &state, qint64 simTimeMSecs);
|
||||
};
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* template class to handle IObserverGuezAircraftObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezAircraftObjClassCB.h>
|
||||
#include <IObserverGuezAircraftObjInstance.h>
|
||||
#include <IObserverGuezAircraftObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_aircraft_object_instance_cb.h"
|
||||
#include <TacticalStatusStruct.h>
|
||||
|
||||
class ObserverGuezAircraftObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezAircraftObjInstanceCB : public ObserverAircraftObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezAircraftObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezAircraft")
|
||||
: ObserverAircraftObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedTacticalStatus(const rpr2::TacticalStatusStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
this->m_pCB->onTacticalStatusChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
using ObserverGuezAircraftObjInstanceCBType = ObserverGuezAircraftObjInstanceCB<rpr2::IObserverGuezAircraftObjInstanceCB,
|
||||
rpr2::IObserverGuezAircraftObjInstance,
|
||||
ObserverGuezAircraftObjectCB>;
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in a GUEZ Aircraft instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_chemical_agent_area_object_cb.h"
|
||||
#include "rpr_observer_guez_chemical_agent_area_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new Aircraft instances
|
||||
*/
|
||||
class ObserverGuezChemicalAgentAreaCBNotifier : public ObserverGuezChemicalAgentAreaObjectCB, public rpr2::IObserverGuezChemicalAgentAreaObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezChemicalAgentAreaCBNotifier()
|
||||
: ObserverGuezChemicalAgentAreaObjectCB("Callbacks.GuezChemicalAgentArea")
|
||||
, rpr2::IObserverGuezChemicalAgentAreaObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverAircraftObjClassCB
|
||||
rpr2::IObserverGuezChemicalAgentAreaObjInstanceCB &newGuezChemicalAgentAreaObjInstance(rpr2::IObserverGuezChemicalAgentAreaObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezChemicalAgentAreaObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
Executable
+61
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ ChemicalAgentAreas functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_cb.h"
|
||||
#include <ChemicalAgentTypeEnum8.h>
|
||||
#include <ClockTimeStruct.h>
|
||||
#include <OMT13string.h>
|
||||
|
||||
class ObserverGuezChemicalAgentAreaObjectCB : public ObserverOtherArealObjectObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezChemicalAgentAreaObjectCB(const char *loggerName = "Callbacks.GuezChemicalAgentArea")
|
||||
: ObserverOtherArealObjectObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onAreaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit areaEffectSimulationNameChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onActivationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit activationTimeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onDurationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit durationChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onDetonationLocationChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit detonationLocationChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onRadiusChanged(const rpr2::EntityIdentifierStruct &eis, ngs::FLOAT64 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit radiusChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onChemicalAgentTypeChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::ChemicalAgentTypeEnum8::ET value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit chemicalAgentTypeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onIsPermanentAgentChanged(const rpr2::EntityIdentifierStruct &eis, bool value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit isPermanentAgentChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void areaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, qint64 simTimeMSecs);
|
||||
void activationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, qint64 simTimeMSecs);
|
||||
void durationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
void detonationLocationChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &value, qint64 simTimeMSecs);
|
||||
void radiusChanged(const rpr2::EntityIdentifierStruct &eis, ngs::FLOAT64 value, qint64 simTimeMSecs);
|
||||
void chemicalAgentTypeChanged(const rpr2::EntityIdentifierStruct &eis, rpr2::ChemicalAgentTypeEnum8::ET value, qint64 simTimeMSecs);
|
||||
void isPermanentAgentChanged(const rpr2::EntityIdentifierStruct &eis, bool value, qint64 simTimeMSecs);
|
||||
};
|
||||
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* template class to handle IObserverGuezChemicalAgentAreaObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezChemicalAgentAreaObjClassCB.h>
|
||||
#include <IObserverGuezChemicalAgentAreaObjInstance.h>
|
||||
#include <IObserverGuezChemicalAgentAreaObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezChemicalAgentAreaObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezChemicalAgentAreaObjInstanceCB : public ObserverOtherArealObjectObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezChemicalAgentAreaObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezChemicalAgentArea")
|
||||
: ObserverOtherArealObjectObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedAreaEffectSimulationName(const rpr2::OMT13string &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onAreaEffectSimulationNameChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedActivationTime(const rpr2::ClockTimeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onActivationTimeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDuration(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDurationChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDetonationLocation(const rpr2::WorldLocationStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDetonationLocationChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedRadius(ngs::FLOAT64 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onRadiusChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedChemicalAgentType(rpr2::ChemicalAgentTypeEnum8::ET value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onChemicalAgentTypeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedIsPermanentAgent(bool value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onIsPermanentAgentChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
};
|
||||
|
||||
using ObserverGuezChemicalAgentAreaObjInstanceCBType = ObserverGuezChemicalAgentAreaObjInstanceCB<rpr2::IObserverGuezChemicalAgentAreaObjInstanceCB,
|
||||
rpr2::IObserverGuezChemicalAgentAreaObjInstance,
|
||||
ObserverGuezChemicalAgentAreaObjectCB>;
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in a GUEZ Aircraft instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_fire_support_object_cb.h"
|
||||
#include "rpr_observer_guez_fire_support_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new Guez Fire Support instances
|
||||
*/
|
||||
class ObserverGuezFireSupportCBNotifier : public ObserverGuezFireSupportObjectCB, public rpr2::IObserverGuezFireSupportObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezFireSupportCBNotifier()
|
||||
: ObserverGuezFireSupportObjectCB("Callbacks.GuezFireSupport")
|
||||
, rpr2::IObserverGuezFireSupportObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverAircraftObjClassCB
|
||||
rpr2::IObserverGuezFireSupportObjInstanceCB &newGuezFireSupportObjInstance(rpr2::IObserverGuezFireSupportObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezFireSupportObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ OtherArealObjects functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_cb.h"
|
||||
#include <ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array.h>
|
||||
#include <ClockTimeStruct.h>
|
||||
#include <OMT13string.h>
|
||||
|
||||
class ObserverGuezFireSupportObjectCB : public ObserverOtherArealObjectObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezFireSupportObjectCB(const char *loggerName = "Callbacks.GuezFireSupport")
|
||||
: ObserverOtherArealObjectObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onAreaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit areaEffectSimulationNameChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onActivationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit activationTimeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onDurationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit durationChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onRoundsChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit roundsChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onMunitionTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit munitionTypeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onFirePositionsChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit firePositionsChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onFireStateChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit fireStateChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void areaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, qint64 simTimeMSecs);
|
||||
void activationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, qint64 simTimeMSecs);
|
||||
void durationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
void roundsChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
void munitionTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &value, qint64 simTimeMSecs);
|
||||
void firePositionsChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &value, qint64 simTimeMSecs);
|
||||
void fireStateChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array &value, qint64 simTimeMSecs);
|
||||
};
|
||||
Executable
+95
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* template class to handle IObserverFireSupportObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezFireSupportObjClassCB.h>
|
||||
#include <IObserverGuezFireSupportObjInstance.h>
|
||||
#include <IObserverGuezFireSupportObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezFireSupportObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezFireSupportObjInstanceCB : public ObserverOtherArealObjectObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezFireSupportObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezFireSupport")
|
||||
: ObserverOtherArealObjectObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedAreaEffectSimulationName(const rpr2::OMT13string &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onAreaEffectSimulationNameChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedActivationTime(const rpr2::ClockTimeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onActivationTimeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDuration(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDurationChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedRounds(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onRoundsChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedMunitionType(const rpr2::EntityTypeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onMunitionTypeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedFirePositions(const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onFirePositionsChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedFireState(const rpr2::ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onFireStateChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
using ObserverGuezFireSupportObjInstanceCBType = ObserverGuezFireSupportObjInstanceCB<rpr2::IObserverGuezFireSupportObjInstanceCB,
|
||||
rpr2::IObserverGuezFireSupportObjInstance,
|
||||
ObserverGuezFireSupportObjectCB>;
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in a GUEZ Aircraft instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_fire_support_single_shot_object_cb.h"
|
||||
#include "rpr_observer_guez_fire_support_single_shot_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new Guez Fire Support instances
|
||||
*/
|
||||
class ObserverGuezFireSupportSingleShotCBNotifier : public ObserverGuezFireSupportSingleShotObjectCB, public rpr2::IObserverGuezFireSupportSingleShotObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezFireSupportSingleShotCBNotifier()
|
||||
: ObserverGuezFireSupportSingleShotObjectCB("Callbacks.GuezFireSupportSingleShot")
|
||||
, rpr2::IObserverGuezFireSupportSingleShotObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverAircraftObjClassCB
|
||||
rpr2::IObserverGuezFireSupportSingleShotObjInstanceCB &newGuezFireSupportSingleShotObjInstance(rpr2::IObserverGuezFireSupportSingleShotObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezFireSupportSingleShotObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ OtherPointObjects functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_other_point_object_object_cb.h"
|
||||
#include <ClockTimeStruct.h>
|
||||
#include <OMT13string.h>
|
||||
|
||||
class ObserverGuezFireSupportSingleShotObjectCB : public ObserverOtherPointObjectObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezFireSupportSingleShotObjectCB(const char *loggerName = "Callbacks.GuezFireSupportSingleShot")
|
||||
: ObserverOtherPointObjectObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onAreaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit areaEffectSimulationNameChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onActivationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit activationTimeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onDetonationLocationChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit detonationLocationChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onRadiusChanged(const rpr2::EntityIdentifierStruct &eis, ngs::FLOAT64 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit radiusChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onMunitionTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit munitionTypeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void areaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, qint64 simTimeMSecs);
|
||||
void activationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, qint64 simTimeMSecs);
|
||||
void detonationLocationChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &value, qint64 simTimeMSecs);
|
||||
void radiusChanged(const rpr2::EntityIdentifierStruct &eis, ngs::FLOAT64 value, qint64 simTimeMSecs);
|
||||
void munitionTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &value, qint64 simTimeMSecs);
|
||||
};
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* template class to handle IObserverFireSupportObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezFireSupportSingleShotObjClassCB.h>
|
||||
#include <IObserverGuezFireSupportSingleShotObjInstance.h>
|
||||
#include <IObserverGuezFireSupportSingleShotObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_other_point_object_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezFireSupportSingleShotObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezFireSupportSingleShotObjInstanceCB : public ObserverOtherPointObjectObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezFireSupportSingleShotObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezFireSupportSingleShot")
|
||||
: ObserverOtherPointObjectObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedAreaEffectSimulationName(const rpr2::OMT13string &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onAreaEffectSimulationNameChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedActivationTime(const rpr2::ClockTimeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onActivationTimeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDetonationLocation(const rpr2::WorldLocationStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDetonationLocationChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedRadius(ngs::FLOAT64 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onRadiusChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedMunitionType(const rpr2::EntityTypeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onMunitionTypeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
using ObserverGuezFireSupportSingleShotObjInstanceCBType = ObserverGuezFireSupportSingleShotObjInstanceCB<rpr2::IObserverGuezFireSupportSingleShotObjInstanceCB,
|
||||
rpr2::IObserverGuezFireSupportSingleShotObjInstance,
|
||||
ObserverGuezFireSupportSingleShotObjectCB>;
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in an GUEZ GroundVehicle instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_groundvehicle_object_cb.h"
|
||||
#include "rpr_observer_guez_groundvehicle_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new ground vehicle instances
|
||||
*/
|
||||
class ObserverGuezGroundVehicleCBNotifier : public ObserverGuezGroundVehicleObjectCB, public rpr2::IObserverGuezGroundVehicleObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ObserverGuezGroundVehicleCBNotifier()
|
||||
: ObserverGuezGroundVehicleObjectCB("Callbacks.GuezGroundVehicle")
|
||||
, rpr2::IObserverGuezGroundVehicleObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverGroundVehicleObjClassCB
|
||||
rpr2::IObserverGuezGroundVehicleObjInstanceCB &newGuezGroundVehicleObjInstance(rpr2::IObserverGuezGroundVehicleObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezGroundVehicleObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ Humans functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_groundvehicle_object_cb.h"
|
||||
#include <TacticalStatusStruct.h>
|
||||
|
||||
class ObserverGuezGroundVehicleObjectCB : public ObserverGroundVehicleObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezGroundVehicleObjectCB(const char *loggerName = "Callbacks.GuezGroundVehicle")
|
||||
: ObserverGroundVehicleObjectCB(loggerName)
|
||||
{}
|
||||
~ObserverGuezGroundVehicleObjectCB() {}
|
||||
|
||||
void onTacticalStatusChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
const rpr2::TacticalStatusStruct &state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit tacticalStatusChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void tacticalStatusChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::TacticalStatusStruct &state, qint64 simTimeMSecs);
|
||||
};
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* template class to handle IObserverGuezGroundVehicleObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezGroundVehicleObjClassCB.h>
|
||||
#include <IObserverGuezGroundVehicleObjInstance.h>
|
||||
#include <IObserverGuezGroundVehicleObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_groundvehicle_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezGroundVehicleObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezGroundVehicleObjInstanceCB : public ObserverGroundVehicleObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezGroundVehicleObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezGroundVehicle")
|
||||
: ObserverGroundVehicleObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedTacticalStatus(const rpr2::TacticalStatusStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
this->m_pCB->onTacticalStatusChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
};
|
||||
|
||||
using ObserverGuezGroundVehicleObjInstanceCBType = ObserverGuezGroundVehicleObjInstanceCB<rpr2::IObserverGuezGroundVehicleObjInstanceCB,
|
||||
rpr2::IObserverGuezGroundVehicleObjInstance,
|
||||
ObserverGuezGroundVehicleObjectCB>;
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in an GUEZ Human instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_human_object_cb.h"
|
||||
#include "rpr_observer_guez_human_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new human instances
|
||||
*/
|
||||
class ObserverGuezHumanCBNotifier : public ObserverGuezHumanObjectCB, public rpr2::IObserverGuezHumanObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezHumanCBNotifier()
|
||||
: ObserverGuezHumanObjectCB("Callbacks.GuezHuman")
|
||||
, rpr2::IObserverGuezHumanObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverHumanObjClassCB
|
||||
rpr2::IObserverGuezHumanObjInstanceCB &newGuezHumanObjInstance(rpr2::IObserverGuezHumanObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezHumanObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ Humans functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_human_object_cb.h"
|
||||
#include <TacticalStatusStruct.h>
|
||||
|
||||
class ObserverGuezHumanObjectCB : public ObserverHumanObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezHumanObjectCB(const char *loggerName = "Callbacks.GuezHuman")
|
||||
: ObserverHumanObjectCB(loggerName)
|
||||
{}
|
||||
~ObserverGuezHumanObjectCB() {}
|
||||
|
||||
void onTacticalStatusChanged(const rpr2::EntityIdentifierStruct &eis,
|
||||
const rpr2::TacticalStatusStruct &state,
|
||||
const ngs::SimTime &simTime)
|
||||
{
|
||||
emit tacticalStatusChanged(eis, state, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void tacticalStatusChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::TacticalStatusStruct &state, qint64 simTimeMSecs);
|
||||
};
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* template class to handle IObserverGuezHumanObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezHumanObjClassCB.h>
|
||||
#include <IObserverGuezHumanObjInstance.h>
|
||||
#include <IObserverGuezHumanObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_human_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezHumanObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezHumanObjInstanceCB : public ObserverHumanObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezHumanObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezHuman")
|
||||
: ObserverHumanObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedTacticalStatus(const rpr2::TacticalStatusStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidEntityType())
|
||||
return;
|
||||
this->m_pCB->onTacticalStatusChanged(this->m_pIObject->getEntityIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
};
|
||||
|
||||
using ObserverGuezHumanObjInstanceCBType = ObserverGuezHumanObjInstanceCB<rpr2::IObserverGuezHumanObjInstanceCB,
|
||||
rpr2::IObserverGuezHumanObjInstance,
|
||||
ObserverGuezHumanObjectCB>;
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in a GUEZ Minefield instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_minefield_breach_object_cb.h"
|
||||
#include "rpr_observer_guez_minefield_breach_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new Minefield instances
|
||||
*/
|
||||
class ObserverGuezMineFieldBreachCBNotifier : public ObserverGuezMineFieldBreachObjectCB, public rpr2::IObserverGuezMineFieldBreachObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezMineFieldBreachCBNotifier()
|
||||
: ObserverGuezMineFieldBreachObjectCB("Callbacks.GuezMineFieldBreach")
|
||||
, rpr2::IObserverGuezMineFieldBreachObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverMinefieldObjClassCB
|
||||
rpr2::IObserverGuezMineFieldBreachObjInstanceCB &newGuezMineFieldBreachObjInstance(rpr2::IObserverGuezMineFieldBreachObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezMineFieldBreachObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ Minefields functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_cb.h"
|
||||
#include <ClockTimeStruct.h>
|
||||
#include <OMT13string.h>
|
||||
|
||||
class ObserverGuezMineFieldBreachObjectCB : public ObserverOtherArealObjectObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezMineFieldBreachObjectCB(const char *loggerName = "Callbacks.GuezMineFieldBreach")
|
||||
: ObserverOtherArealObjectObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onAreaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit areaEffectSimulationNameChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onActivationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit activationTimeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void areaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, qint64 simTimeMSecs);
|
||||
void activationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, qint64 simTimeMSecs);
|
||||
};
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* template class to handle IObserverGuezMineFieldBreachObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezMineFieldBreachObjClassCB.h>
|
||||
#include <IObserverGuezMineFieldBreachObjInstance.h>
|
||||
#include <IObserverGuezMineFieldBreachObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezMineFieldBreachObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezMineFieldBreachObjInstanceCB : public ObserverOtherArealObjectObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezMineFieldBreachObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezMineFieldBreach")
|
||||
: ObserverOtherArealObjectObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedAreaEffectSimulationName(const rpr2::OMT13string &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onAreaEffectSimulationNameChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedActivationTime(const rpr2::ClockTimeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onActivationTimeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
using ObserverGuezMineFieldBreachObjInstanceCBType = ObserverGuezMineFieldBreachObjInstanceCB<rpr2::IObserverGuezMineFieldBreachObjInstanceCB,
|
||||
rpr2::IObserverGuezMineFieldBreachObjInstance,
|
||||
ObserverGuezMineFieldBreachObjectCB>;
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in a GUEZ Minefield instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_minefield_object_cb.h"
|
||||
#include "rpr_observer_guez_minefield_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new Minefield instances
|
||||
*/
|
||||
class ObserverGuezMineFieldCBNotifier : public ObserverGuezMineFieldObjectCB, public rpr2::IObserverGuezMineFieldObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezMineFieldCBNotifier()
|
||||
: ObserverGuezMineFieldObjectCB("Callbacks.GuezMineField")
|
||||
, rpr2::IObserverGuezMineFieldObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverMinefieldObjClassCB
|
||||
rpr2::IObserverGuezMineFieldObjInstanceCB &newGuezMineFieldObjInstance(rpr2::IObserverGuezMineFieldObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezMineFieldObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ Minefields functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_cb.h"
|
||||
#include <OMT13string.h>
|
||||
|
||||
namespace rpr2
|
||||
{
|
||||
class ClockTimeStruct;
|
||||
class ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array;
|
||||
}
|
||||
|
||||
class ObserverGuezMineFieldObjectCB : public ObserverOtherArealObjectObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezMineFieldObjectCB(const char *loggerName = "Callbacks.GuezMineField")
|
||||
: ObserverOtherArealObjectObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onAreaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit areaEffectSimulationNameChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onActivationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit activationTimeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onDurationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit durationChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onMineTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit mineTypeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onMineCountChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit mineCountChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onMinePositionsChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit minePositionsChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onMineStateChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit mineStateChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onWidthChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit widthChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
void onLengthChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit lengthChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void areaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, qint64 simTimeMSecs);
|
||||
void activationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, qint64 simTimeMSecs);
|
||||
void durationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
void mineTypeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::EntityTypeStruct &value, qint64 simTimeMSecs);
|
||||
void mineCountChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
void minePositionsChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &value, qint64 simTimeMSecs);
|
||||
void mineStateChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array &value, qint64 simTimeMSecs);
|
||||
void widthChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
void lengthChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
};
|
||||
Executable
+111
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* template class to handle IObserverGuezMineFieldObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezMineFieldObjClassCB.h>
|
||||
#include <IObserverGuezMineFieldObjInstance.h>
|
||||
#include <IObserverGuezMineFieldObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezMineFieldObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezMineFieldObjInstanceCB : public ObserverOtherArealObjectObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezMineFieldObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezMineField")
|
||||
: ObserverOtherArealObjectObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedAreaEffectSimulationName(const rpr2::OMT13string &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onAreaEffectSimulationNameChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedActivationTime(const rpr2::ClockTimeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onActivationTimeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
void changedDuration(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDurationChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedMineType(const rpr2::EntityTypeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onMineTypeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedMineCount(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onMineCountChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedMinePositions(const rpr2::ArrayOfWorldLocationStructDynamicHLAlengthlessVarArray &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onMinePositionsChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedMineState(const rpr2::ArrayOfHLAoctetN_slsh_AperfectalwaysN_slsh_ADynamicHLApaddingTo32Array &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onMineStateChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedWidth(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onWidthChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedLength(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onLengthChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
};
|
||||
|
||||
using ObserverGuezMineFieldObjInstanceCBType = ObserverGuezMineFieldObjInstanceCB<rpr2::IObserverGuezMineFieldObjInstanceCB,
|
||||
rpr2::IObserverGuezMineFieldObjInstance,
|
||||
ObserverGuezMineFieldObjectCB>;
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in a GUEZ Aircraft instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_nuclear_agent_area_object_cb.h"
|
||||
#include "rpr_observer_guez_nuclear_agent_area_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new Aircraft instances
|
||||
*/
|
||||
class ObserverGuezNuclearAgentAreaCBNotifier : public ObserverGuezNuclearAgentAreaObjectCB, public rpr2::IObserverGuezNuclearAgentAreaObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezNuclearAgentAreaCBNotifier()
|
||||
: ObserverGuezNuclearAgentAreaObjectCB("Callbacks.GuezNuclearAgentArea")
|
||||
, rpr2::IObserverGuezNuclearAgentAreaObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverAircraftObjClassCB
|
||||
rpr2::IObserverGuezNuclearAgentAreaObjInstanceCB &newGuezNuclearAgentAreaObjInstance(rpr2::IObserverGuezNuclearAgentAreaObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezNuclearAgentAreaObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* class to handle signals for Observer GUEZ NuclearAgentAreas functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_cb.h"
|
||||
#include <ClockTimeStruct.h>
|
||||
#include <OMT13string.h>
|
||||
|
||||
class ObserverGuezNuclearAgentAreaObjectCB : public ObserverOtherArealObjectObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezNuclearAgentAreaObjectCB(const char *loggerName = "Callbacks.GuezNuclearAgentArea")
|
||||
: ObserverOtherArealObjectObjectCB(loggerName)
|
||||
{}
|
||||
|
||||
void onAreaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit areaEffectSimulationNameChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onActivationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit activationTimeChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onDurationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit durationChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onDetonationLocationChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit detonationLocationChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
void onRadiusChanged(const rpr2::EntityIdentifierStruct &eis, ngs::FLOAT64 value, const ngs::SimTime &simTime)
|
||||
{
|
||||
emit radiusChanged(eis, value, simTime.getSeconds() * 1000ULL + simTime.getMicroSeconds() / 1000ULL);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void areaEffectSimulationNameChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::OMT13string &value, qint64 simTimeMSecs);
|
||||
void activationTimeChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::ClockTimeStruct &value, qint64 simTimeMSecs);
|
||||
void durationChanged(const rpr2::EntityIdentifierStruct &eis, ngs::UINT32 value, qint64 simTimeMSecs);
|
||||
void detonationLocationChanged(const rpr2::EntityIdentifierStruct &eis, const rpr2::WorldLocationStruct &value, qint64 simTimeMSecs);
|
||||
void radiusChanged(const rpr2::EntityIdentifierStruct &eis, ngs::FLOAT64 value, qint64 simTimeMSecs);
|
||||
};
|
||||
Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_observer_guez_nuclear_agent_area_object_instance_cb.h
Executable
+76
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* template class to handle IObserverGuezNuclearAgentAreaObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezNuclearAgentAreaObjClassCB.h>
|
||||
#include <IObserverGuezNuclearAgentAreaObjInstance.h>
|
||||
#include <IObserverGuezNuclearAgentAreaObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_other_areal_object_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezNuclearAgentAreaObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezNuclearAgentAreaObjInstanceCB : public ObserverOtherArealObjectObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezNuclearAgentAreaObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezNuclearAgentArea")
|
||||
: ObserverOtherArealObjectObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
void changedAreaEffectSimulationName(const rpr2::OMT13string &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onAreaEffectSimulationNameChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedActivationTime(const rpr2::ClockTimeStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onActivationTimeChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDuration(ngs::UINT32 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDurationChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedDetonationLocation(const rpr2::WorldLocationStruct &value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onDetonationLocationChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
|
||||
void changedRadius(ngs::FLOAT64 value) override
|
||||
{
|
||||
if (!this->m_pIObject->isValidObjectType())
|
||||
return;
|
||||
this->m_pCB->onRadiusChanged(this->m_pIObject->getObjectIdentifier(),
|
||||
value,
|
||||
this->m_pIObject->getLatestTimeStamp());
|
||||
}
|
||||
};
|
||||
|
||||
using ObserverGuezNuclearAgentAreaObjInstanceCBType = ObserverGuezNuclearAgentAreaObjInstanceCB<rpr2::IObserverGuezNuclearAgentAreaObjInstanceCB,
|
||||
rpr2::IObserverGuezNuclearAgentAreaObjInstance,
|
||||
ObserverGuezNuclearAgentAreaObjectCB>;
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in an GuezObserverController instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_guez_observer_controller_object_cb.h"
|
||||
#include "rpr_observer_guez_observer_controller_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new guez observer controller instances
|
||||
*/
|
||||
class ObserverGuezObserverControllerCBNotifier : public ObserverGuezObserverControllerObjectCB, public rpr2::IObserverGuezObserverControllerObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezObserverControllerCBNotifier()
|
||||
: ObserverGuezObserverControllerObjectCB("Callbacks.GuezObserverController")
|
||||
, rpr2::IObserverGuezObserverControllerObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverGuezObserverControllerObjClassCB
|
||||
rpr2::IObserverGuezObserverControllerObjInstanceCB &newGuezObserverControllerObjInstance(rpr2::IObserverGuezObserverControllerObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverGuezObserverControllerObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* class to handle signals for ObserverGuezObserverControllers functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_human_object_cb.h"
|
||||
|
||||
class ObserverGuezObserverControllerObjectCB : public ObserverHumanObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverGuezObserverControllerObjectCB(const char *loggerName = "Callbacks.GuezObserverController")
|
||||
: ObserverHumanObjectCB(loggerName)
|
||||
{}
|
||||
};
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* template class to handle IObserverGuezObserverControllerObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverGuezObserverControllerObjClassCB.h>
|
||||
#include <IObserverGuezObserverControllerObjInstance.h>
|
||||
#include <IObserverGuezObserverControllerObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_human_object_instance_cb.h"
|
||||
|
||||
class ObserverGuezObserverControllerObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverGuezObserverControllerObjInstanceCB : public ObserverHumanObjInstanceCB<IOBJ_CB,
|
||||
OBJ,
|
||||
OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverGuezObserverControllerObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.GuezObserverController")
|
||||
: ObserverHumanObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
};
|
||||
|
||||
using ObserverGuezObserverControllerObjInstanceCBType = ObserverGuezObserverControllerObjInstanceCB<rpr2::IObserverGuezObserverControllerObjInstanceCB,
|
||||
rpr2::IObserverGuezObserverControllerObjInstance,
|
||||
ObserverGuezObserverControllerObjectCB>;
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* A notifier to inform NGSConnector about changes in an Human instance
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_global.h"
|
||||
#include "rpr_observer_human_object_cb.h"
|
||||
#include "rpr_observer_human_object_instance_cb.h"
|
||||
|
||||
/**
|
||||
* The notifier for new human instances
|
||||
*/
|
||||
class ObserverHumanCBNotifier : public ObserverHumanObjectCB, public rpr2::IObserverHumanObjClassCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverHumanCBNotifier()
|
||||
: ObserverHumanObjectCB("Callbacks.Human")
|
||||
, rpr2::IObserverHumanObjClassCB()
|
||||
{}
|
||||
|
||||
//Abstract functions realized from IObserverHumanObjClassCB
|
||||
rpr2::IObserverHumanObjInstanceCB &newHumanObjInstance(rpr2::IObserverHumanObjInstance &object) override
|
||||
{
|
||||
return newObjectInstance<ObserverHumanObjInstanceCBType>(object);
|
||||
}
|
||||
|
||||
void deleteInterface() override {}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* class to handle signals for ObserverHumans functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_lifeform_object_cb.h"
|
||||
|
||||
class ObserverHumanObjectCB : public ObserverLifeformObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverHumanObjectCB(const char *loggerName = "Callbacks.Human")
|
||||
: ObserverLifeformObjectCB(loggerName)
|
||||
{}
|
||||
};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* template class to handle IObserverHumanObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverHumanObjClassCB.h>
|
||||
#include <IObserverHumanObjInstance.h>
|
||||
#include <IObserverHumanObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_lifeform_object_instance_cb.h"
|
||||
|
||||
class ObserverHumanObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverHumanObjInstanceCB : public ObserverLifeformObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverHumanObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.Human")
|
||||
: ObserverLifeformObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
};
|
||||
|
||||
using ObserverHumanObjInstanceCBType = ObserverHumanObjInstanceCB<rpr2::IObserverHumanObjInstanceCB,
|
||||
rpr2::IObserverHumanObjInstance,
|
||||
ObserverHumanObjectCB>;
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* class to handle signals for ObserverLifeforms functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rpr_observer_physicalentity_object_cb.h"
|
||||
|
||||
class ObserverLifeformObjectCB : public ObserverPhysicalEntityObjectCB
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverLifeformObjectCB(const char *loggerName = "Callbacks.Lifeform")
|
||||
: ObserverPhysicalEntityObjectCB(loggerName)
|
||||
{}
|
||||
};
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* template class to handle IObserverLifeformObjInstanceCB functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IObserverLifeformObjClassCB.h>
|
||||
#include <IObserverLifeformObjInstance.h>
|
||||
#include <IObserverLifeformObjInstanceCB.h>
|
||||
|
||||
#include "rpr_observer_physicalentity_object_instance_cb.h"
|
||||
|
||||
class ObserverLifeformObjectCB;
|
||||
|
||||
template<typename IOBJ_CB, typename OBJ, typename OBJ_CB>
|
||||
class ObserverLifeformObjInstanceCB : public ObserverPhysicalEntityObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>
|
||||
{
|
||||
public:
|
||||
explicit ObserverLifeformObjInstanceCB(OBJ_CB &hoicb, const char *loggerName = "Observer.Lifeform")
|
||||
: ObserverPhysicalEntityObjInstanceCB<IOBJ_CB, OBJ, OBJ_CB>(hoicb, loggerName)
|
||||
{}
|
||||
|
||||
//
|
||||
// IObserverLifeformObjInstanceCB
|
||||
//
|
||||
// Declarations for pure virtual functions
|
||||
void changedFlashLightsOn(bool) override {}
|
||||
void changedStanceCode(rpr2::StanceCodeEnum32::ET) override {}
|
||||
void changedPrimaryWeaponState(rpr2::WeaponStateEnum32::ET) override {}
|
||||
void changedSecondaryWeaponState(rpr2::WeaponStateEnum32::ET) override {}
|
||||
void changedComplianceState(rpr2::ComplianceStateEnum32::ET) override {}
|
||||
};
|
||||
|
||||
using ObserverLifeformObjInstanceCBType = ObserverLifeformObjInstanceCB<rpr2::IObserverLifeformObjInstanceCB,
|
||||
rpr2::IObserverLifeformObjInstance,
|
||||
ObserverLifeformObjectCB>;
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* class to handle signals for ObserverObjects functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <IObserverBaseEntityObjInstance.h>
|
||||
#include <IObserverEnvironmentObjectObjInstance.h>
|
||||
|
||||
#include <Common/logger.h>
|
||||
|
||||
class ObserverObjectCB : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObserverObjectCB(const char *loggerName = "Callbacks.Object")
|
||||
: m_logger(HighLevelArchitecture::getLogger(loggerName))
|
||||
{}
|
||||
|
||||
template<typename T>
|
||||
typename T::IObjectCallback &newObjectInstance(typename T::Object &object)
|
||||
{
|
||||
typedef typename T::ObjectCallback OBJ_CB;
|
||||
|
||||
OBJ_CB *that = dynamic_cast<OBJ_CB *>(this);
|
||||
T *cb = new T(*that); //Neues Observer-Objekt erstellen
|
||||
cb->setInterface(&object); //Merken des Objekts, falls man die get-Funktionen nutzen möchte
|
||||
emit newObjectInstance2(object); //Bekannt machen, das ein neues Objekt gemeldet wurde
|
||||
return *cb; //Hier wird der Observer für dieses Objekt zurückgegeben.
|
||||
}
|
||||
|
||||
void deleteObjectInstance(const ngs::IObserverObjectInstance &object)
|
||||
{
|
||||
emit objectInstanceDeleted(object);
|
||||
}
|
||||
Q_SIGNALS:
|
||||
void newObjectInstance(const ngs::IObserverObjectInstance &object);
|
||||
void newObjectInstance2(const ngs::IObserverObjectInstance &object);
|
||||
void objectInstanceDeleted(const ngs::IObserverObjectInstance &object);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
Loaded 100 of 16245 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user