mirror of
https://github.com/eclipse-openvehicle-api/openvehicle-api.git
synced 2026-06-30 21:05:10 +00:00
Update sdv_packager (#6)
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
#*******************************************************************************
|
||||
# Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
#
|
||||
# This program and the accompanying materials are made available under the
|
||||
# terms of the Apache License Version 2.0 which is available at
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#*******************************************************************************
|
||||
|
||||
project(DoorDemoExample)
|
||||
|
||||
# Use new policy for project version settings and default warning level
|
||||
@@ -19,7 +29,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/config/front_left_door_example.toml DESTINATION
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/config/front_right_door_example.toml DESTINATION ${CMAKE_BINARY_DIR}/bin/config)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/config/rear_left_door_example.toml DESTINATION ${CMAKE_BINARY_DIR}/bin/config)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/config/rear_right_door_example.toml DESTINATION ${CMAKE_BINARY_DIR}/bin/config)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/config/door_comple_service.toml DESTINATION ${CMAKE_BINARY_DIR}/bin/config)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/config/door_complex_service.toml DESTINATION ${CMAKE_BINARY_DIR}/bin/config)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/config/data_link_door.toml DESTINATION ${CMAKE_BINARY_DIR}/bin/config)
|
||||
|
||||
# Copy the ASC files used by can_com_sim.sdv which includes the CAN messages
|
||||
@@ -32,77 +42,85 @@ file (COPY ${PROJECT_SOURCE_DIR}/door_example_receiver.asc DESTINATION ${CMAKE_B
|
||||
# preparation
|
||||
######################################################################################################################################################################
|
||||
|
||||
# Execute sdv_vss_util to create IDL files for devices and basic services.
|
||||
message("Create interface code for devices and basic services of doors example.")
|
||||
execute_process(COMMAND "${SDV_VSS_UTIL}" "${PROJECT_SOURCE_DIR}/vss_doors_example.csv" "-O${PROJECT_SOURCE_DIR}/generated/" --prefixdoors --version1.0.0.1 --enable_components)
|
||||
|
||||
|
||||
message("Compiling Interface Door01Left RX")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle01left_vd_rx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle01left_bs_rx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_01left_vd_rx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_01left_bs_rx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
|
||||
message("Compiling Interface Door01Right RX")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle01right_vd_rx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle01right_bs_rx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_01right_vd_rx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_01right_bs_rx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
|
||||
message("Compiling Interface Door02Left RX")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle02left_vd_rx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle02left_bs_rx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_02left_vd_rx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_02left_bs_rx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
|
||||
message("Compiling Interface Door02Right RX")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle02right_vd_rx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle02right_bs_rx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_02right_vd_rx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_02right_bs_rx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
|
||||
|
||||
message("Compiling Interface Door01Left TX")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle01left_vd_tx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle01left_bs_tx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_01left_vd_tx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_01left_bs_tx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
|
||||
message("Compiling Interface Door01Right TX")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle01right_vd_tx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle01right_bs_tx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_01right_vd_tx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_01right_bs_tx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
|
||||
message("Compiling Interface Door02Left TX")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle02left_vd_tx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle02left_bs_tx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_02left_vd_tx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_02left_bs_tx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
|
||||
message("Compiling Interface Door02Right TX")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle02right_vd_tx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/interfaces/vss_vehiclechassisdooraxle02right_bs_tx.idl" "-O${PROJECT_SOURCE_DIR}/interfaces/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_02right_vd_tx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --no_ps)
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/generated/vss_files/vss_vehiclebodydooraxle_02right_bs_tx.idl" "-O${PROJECT_SOURCE_DIR}/generated/vss_files/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Igenerated/vss_files/ --ps_lib_namedoors_proxystub)
|
||||
|
||||
# Execute the IDL compiler for the complex service to digest interface code.
|
||||
message("Compiling door_ifc.idl")
|
||||
execute_process(COMMAND "${SDV_IDL_COMPILER}" "${PROJECT_SOURCE_DIR}/door_service/door_ifc.idl" "-O${PROJECT_SOURCE_DIR}/generated/door_service/" "-I${SDV_FRAMEWORK_DEV_INCLUDE}" -Iexample_service/ --ps_lib_namedoors_service_proxystub)
|
||||
|
||||
add_subdirectory(interfaces/ps)
|
||||
add_subdirectory(generated/door_service/ps)
|
||||
add_subdirectory(generated/vss_files/ps)
|
||||
|
||||
add_subdirectory(vd/vd_front_door_left)
|
||||
add_subdirectory(vd/vd_front_door_right)
|
||||
add_subdirectory(vd/vd_rear_door_left)
|
||||
add_subdirectory(vd/vd_rear_door_right)
|
||||
add_subdirectory(generated/vss_files/vd_frontdoorleft)
|
||||
add_subdirectory(generated/vss_files/vd_frontdoorright)
|
||||
add_subdirectory(generated/vss_files/vd_reardoorleft)
|
||||
add_subdirectory(generated/vss_files/vd_reardoorright)
|
||||
|
||||
add_subdirectory(bs/bs_front_door_left)
|
||||
add_subdirectory(bs/bs_front_door_right)
|
||||
add_subdirectory(bs/bs_rear_door_left)
|
||||
add_subdirectory(bs/bs_rear_door_right)
|
||||
add_subdirectory(generated/vss_files/bs_frontdoorleft)
|
||||
add_subdirectory(generated/vss_files/bs_frontdoorright)
|
||||
add_subdirectory(generated/vss_files/bs_reardoorleft)
|
||||
add_subdirectory(generated/vss_files/bs_reardoorright)
|
||||
|
||||
add_subdirectory(can_dl_door)
|
||||
# Execute sdv_dbc_util to create data link code & FMU code.
|
||||
message("Create data link for doors example")
|
||||
execute_process(COMMAND ${SDV_DBC_UTIL} "${PROJECT_SOURCE_DIR}/datalink_4doors_example.dbc" "-O${PROJECT_SOURCE_DIR}/generated/" --nodesdoors --version1.0.0.1 --moduleDoorsExampleFMU --dl_lib_namecan_dl_doors)
|
||||
|
||||
add_subdirectory(generated/can_dl)
|
||||
|
||||
|
||||
######################################################################################################################################################################
|
||||
# complex service
|
||||
######################################################################################################################################################################
|
||||
|
||||
include_directories(interfaces)
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR}/door_app/include)
|
||||
|
||||
message("Include: proxy/stub for complex doors service")
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR}/generated/door_service)
|
||||
add_subdirectory(generated/door_service/ps)
|
||||
|
||||
add_library(door_complex_service SHARED
|
||||
add_library(doors_complex_service SHARED
|
||||
door_service/complex_service.h
|
||||
door_service/complex_service.cpp
|
||||
door_service/lock_doors_thread.h)
|
||||
|
||||
set_target_properties(door_complex_service PROPERTIES OUTPUT_NAME "door_complex_service")
|
||||
set_target_properties(door_complex_service PROPERTIES PREFIX "")
|
||||
set_target_properties(door_complex_service PROPERTIES SUFFIX ".sdv")
|
||||
set_target_properties(doors_complex_service PROPERTIES OUTPUT_NAME "doors_complex_service")
|
||||
set_target_properties(doors_complex_service PROPERTIES PREFIX "")
|
||||
set_target_properties(doors_complex_service PROPERTIES SUFFIX ".sdv")
|
||||
|
||||
######################################################################################################################################################################
|
||||
# executable
|
||||
@@ -152,19 +170,18 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
######################################################################################################################################################################
|
||||
# create instance 3002 of door demo example
|
||||
######################################################################################################################################################################
|
||||
add_custom_target(vehicle_device_doors_config
|
||||
ALL
|
||||
DEPENDS
|
||||
can_dl_door
|
||||
doors_vd_frontdoorleft
|
||||
doors_vd_frontdoorright
|
||||
doors_vd_reardoorleft
|
||||
doors_vd_reardoorright
|
||||
COMMAND "${SDV_PACKAGER}" DIRECT_INSTALL VehicleDeviceDoors --instance3002 can_dl_door.sdv doors_vd_frontdoorleft.sdv doors_vd_frontdoorright.sdv doors_vd_reardoorleft.sdv doors_vd_reardoorright.sdv "-I${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" --interface_config --overwrite
|
||||
can_dl_doors
|
||||
doors_vd_frontdoorleft_rx
|
||||
doors_vd_frontdoorright_rx
|
||||
doors_vd_reardoorleft_rx
|
||||
doors_vd_reardoorright_rx
|
||||
COMMAND "${SDV_PACKAGER}" DIRECT_INSTALL VehicleDeviceDoors --instance3002 can_dl_doors.sdv doors_vd_frontdoorleft_rx.sdv doors_vd_frontdoorright_rx.sdv doors_vd_reardoorleft_rx.sdv doors_vd_reardoorright_rx.sdv "-I${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" --interface_config --overwrite
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
@@ -172,31 +189,29 @@ add_custom_target(basic_service_doors_config
|
||||
ALL
|
||||
DEPENDS
|
||||
doors_proxystub
|
||||
doors_bs_frontdoorleft
|
||||
doors_bs_frontdoorright
|
||||
doors_bs_reardoorleft
|
||||
doors_bs_reardoorright
|
||||
COMMAND "${SDV_PACKAGER}" DIRECT_INSTALL BasicServiceDoors --instance3002 doors_proxystub.sdv doors_bs_frontdoorleft.sdv doors_bs_frontdoorright.sdv doors_bs_reardoorleft.sdv doors_bs_reardoorright.sdv "-I${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" --abstract_config --overwrite
|
||||
doors_bs_frontdoorleft_rx
|
||||
doors_bs_frontdoorright_rx
|
||||
doors_bs_reardoorleft_rx
|
||||
doors_bs_reardoorright_rx
|
||||
COMMAND "${SDV_PACKAGER}" DIRECT_INSTALL BasicServiceDoors --instance3002 doors_proxystub.sdv doors_bs_frontdoorleft_rx.sdv doors_bs_frontdoorright_rx.sdv doors_bs_reardoorleft_rx.sdv doors_bs_reardoorright_rx.sdv "-I${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" --abstract_config --overwrite
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_target(door_complex_service_config
|
||||
ALL
|
||||
DEPENDS
|
||||
door_complex_service
|
||||
doors_complex_service
|
||||
doors_service_proxystub
|
||||
COMMAND "${SDV_PACKAGER}" DIRECT_INSTALL DoorComplexService --instance3002 door_complex_service.sdv doors_service_proxystub.sdv "-I${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" --user_config --overwrite
|
||||
COMMAND "${SDV_PACKAGER}" DIRECT_INSTALL DoorsComplexService --instance3002 doors_complex_service.sdv doors_service_proxystub.sdv "-I${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" --user_config --overwrite
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_target(platform_doors_config
|
||||
ALL
|
||||
COMMAND "${SDV_PACKAGER}" CONFIGURE ${PROJECT_SOURCE_DIR}/coreconfig/platform.toml --instance3002 --platform_config
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
######################################################################################################################################################################
|
||||
# TODO: SDV_PACKAGER does not create the toml files, therefore we need to copy them
|
||||
######################################################################################################################################################################
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/coreconfig/door_demo.toml DESTINATION ${SDV_FRAMEWORK_RUNTIME}/3002)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/coreconfig/platform.toml DESTINATION ${SDV_FRAMEWORK_RUNTIME}/3002)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/coreconfig/settings.toml DESTINATION ${SDV_FRAMEWORK_RUNTIME}/3002)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/coreconfig/vehicle_abstract.toml DESTINATION ${SDV_FRAMEWORK_RUNTIME}/3002)
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/coreconfig/vehicle_ifc.toml DESTINATION ${SDV_FRAMEWORK_RUNTIME}/3002)
|
||||
|
||||
######################################################################################################################################################################
|
||||
# the FMU files have been created via the dbc file
|
||||
@@ -211,5 +226,5 @@ file (COPY ${PROJECT_SOURCE_DIR}/coreconfig/vehicle_ifc.toml DESTINATION ${SDV_F
|
||||
# ...\fmu_Doors2ExampleFMU\Doors2ExampleFMU\model.cpp
|
||||
# ...\fmu_Doors2ExampleFMU\Doors4ExampleFMU\model.cpp
|
||||
######################################################################################################################################################################
|
||||
add_subdirectory(fmu_Doors2ExampleFMU)
|
||||
add_subdirectory(fmu_Doors4ExampleFMU)
|
||||
add_subdirectory(fmu_Doors2ExampleFMU)
|
||||
add_subdirectory(fmu_Doors4ExampleFMU)
|
||||
|
||||
@@ -4,6 +4,7 @@ Version = 100
|
||||
[[Component]]
|
||||
Path = "can_com_sim.sdv"
|
||||
Class = "CAN_Com_Sim"
|
||||
[Component.Parameters]
|
||||
Source="door_example_receiver.asc"
|
||||
Target="door_example_writer.asc"
|
||||
|
||||
|
||||
10
examples/door_demo_example/config/door_complex_service.toml
Normal file
10
examples/door_demo_example/config/door_complex_service.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[Configuration]
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_complex_service.sdv"
|
||||
Class = "Doors Example Service"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,13 +2,12 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_frontdoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Left_Device"
|
||||
Path = "doors_vd_frontdoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Left_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_frontdoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Left_Service"
|
||||
|
||||
Path = "doors_bs_frontdoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Left_Service"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_frontdoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Right_Device"
|
||||
Path = "doors_vd_frontdoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Right_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_frontdoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Right_Service"
|
||||
Path = "doors_bs_frontdoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Right_Service"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_reardoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle02.Left_Device"
|
||||
Path = "doors_vd_reardoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._02.Left_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_reardoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle02.Left_Service"
|
||||
Path = "doors_bs_reardoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._02.Left_Service"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_reardoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle02.Right_Device"
|
||||
Path = "doors_vd_reardoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._02.Right_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_reardoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle02.Right_Service"
|
||||
Path = "doors_bs_reardoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._02.Right_Service"
|
||||
|
||||
@@ -4,6 +4,7 @@ Version = 100
|
||||
[[Component]]
|
||||
Path = "can_com_sim.sdv"
|
||||
Class = "CAN_Com_Sim"
|
||||
[Component.Parameters]
|
||||
Source="door_example_receiver.asc"
|
||||
Target="door_example_writer.asc"
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#include "include/console.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -131,7 +141,7 @@ bool CConsole::PrepareDataConsumers()
|
||||
}
|
||||
}
|
||||
|
||||
auto basicServiceL1 = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_GetIsOpen>();
|
||||
auto basicServiceL1 = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_GetIsOpenL1>();
|
||||
if (!basicServiceL1)
|
||||
{
|
||||
SDV_LOG_ERROR("Could not get interface 'LeftService::IVSS_IsOpen': [CConsole]");
|
||||
@@ -142,29 +152,29 @@ bool CConsole::PrepareDataConsumers()
|
||||
/* Interface exists -> Clean the line for Console window */
|
||||
PrintText(g_sBasicServiceL1, " ");
|
||||
}
|
||||
basicServiceL1->RegisterOnSignalChangeOfLeftDoorIsOpen01(dynamic_cast<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetIsOpen_Event*> (this));
|
||||
basicServiceL1->RegisterOnSignalChangeOfLeftDoorIsOpen01(dynamic_cast<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetIsOpenL1_Event*> (this));
|
||||
bool value = false;
|
||||
PrintValue(g_sFrontLeftDoorIsLocked, "Front Left Latch:", value, (value ? "locked" : "unlocked"));
|
||||
|
||||
// all other doors are optional
|
||||
auto basicServiceR1 = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_GetIsOpen>();
|
||||
auto basicServiceR1 = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_GetIsOpenR1>();
|
||||
if (basicServiceR1)
|
||||
{
|
||||
basicServiceR1->RegisterOnSignalChangeOfRightDoorIsOpen01(dynamic_cast<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetIsOpen_Event*> (this));
|
||||
basicServiceR1->RegisterOnSignalChangeOfRightDoorIsOpen01(dynamic_cast<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetIsOpenR1_Event*> (this));
|
||||
PrintValue(g_sFrontRightDoorIsLocked, "Front Right Latch:", value, (value ? "locked" : "unlocked"));
|
||||
}
|
||||
|
||||
auto basicServiceL2 = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_GetIsOpen>();
|
||||
auto basicServiceL2 = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_GetIsOpenL2>();
|
||||
if (basicServiceL2)
|
||||
{
|
||||
basicServiceL2->RegisterOnSignalChangeOfLeftDoorIsOpen02(dynamic_cast<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetIsOpen_Event*> (this));
|
||||
basicServiceL2->RegisterOnSignalChangeOfLeftDoorIsOpen02(dynamic_cast<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetIsOpenL2_Event*> (this));
|
||||
PrintValue(g_sRearLeftDoorIsLocked, "Rear Left Latch:", value, (value ? "locked" : "unlocked"));
|
||||
}
|
||||
|
||||
auto basicServiceR2 = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_GetIsOpen>();
|
||||
auto basicServiceR2 = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_GetIsOpenR2>();
|
||||
if (basicServiceR2)
|
||||
{
|
||||
basicServiceR2->RegisterOnSignalChangeOfRightDoorIsOpen02(dynamic_cast<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetIsOpen_Event*> (this));
|
||||
basicServiceR2->RegisterOnSignalChangeOfRightDoorIsOpen02(dynamic_cast<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetIsOpenR2_Event*> (this));
|
||||
PrintValue(g_sRearRightDoorIsLocked, "Rear Right Latch:", value, (value ? "locked" : "unlocked"));
|
||||
}
|
||||
|
||||
@@ -196,25 +206,26 @@ void CConsole::ResetSignals()
|
||||
SetCursorPos(g_sCursor);
|
||||
|
||||
// Registrate for the vehicle device & basic service of the front left door. Front left door mzust exist, the others are optional
|
||||
auto vehicleDevice = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Left_Device").GetInterface<vss::Vehicle::Chassis::Door::Axle01::LeftDevice::IVSS_IsOpen>();
|
||||
auto vehicleDevice =
|
||||
sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Left_Device").GetInterface < vss::Vehicle::Body::Door::Axle::_01 ::LeftDevice::IVSS_IsOpen > ();
|
||||
if (vehicleDevice)
|
||||
vehicleDevice->UnregisterIsOpenEvent(dynamic_cast<vss::Vehicle::Chassis::Door::Axle01::LeftDevice::IVSS_WriteIsOpen_Event*> (this));
|
||||
vehicleDevice->UnregisterIsOpenEvent(dynamic_cast<vss::Vehicle::Body::Door::Axle::_01::LeftDevice::IVSS_WriteIsOpen_Event*> (this));
|
||||
|
||||
auto basicServiceL1 = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_GetIsOpen>();
|
||||
auto basicServiceL1 = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_GetIsOpenL1>();
|
||||
if (basicServiceL1)
|
||||
basicServiceL1->UnregisterOnSignalChangeOfLeftDoorIsOpen01(dynamic_cast<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetIsOpen_Event*> (this));
|
||||
basicServiceL1->UnregisterOnSignalChangeOfLeftDoorIsOpen01(dynamic_cast<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetIsOpenL1_Event*> (this));
|
||||
|
||||
auto basicServiceR1 = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_GetIsOpen>();
|
||||
auto basicServiceR1 = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_GetIsOpenR1>();
|
||||
if (basicServiceR1)
|
||||
basicServiceR1->UnregisterOnSignalChangeOfRightDoorIsOpen01(dynamic_cast<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetIsOpen_Event*> (this));
|
||||
basicServiceR1->UnregisterOnSignalChangeOfRightDoorIsOpen01(dynamic_cast<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetIsOpenR1_Event*> (this));
|
||||
|
||||
auto basicServiceL2 = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_GetIsOpen>();
|
||||
auto basicServiceL2 = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_GetIsOpenL2>();
|
||||
if (basicServiceL2)
|
||||
basicServiceL2->UnregisterOnSignalChangeOfLeftDoorIsOpen02(dynamic_cast<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetIsOpen_Event*> (this));
|
||||
basicServiceL2->UnregisterOnSignalChangeOfLeftDoorIsOpen02(dynamic_cast<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetIsOpenL2_Event*> (this));
|
||||
|
||||
auto basicServiceR2 = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_GetIsOpen>();
|
||||
auto basicServiceR2 = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_GetIsOpenR2>();
|
||||
if (basicServiceR2)
|
||||
basicServiceR2->UnregisterOnSignalChangeOfRightDoorIsOpen02(dynamic_cast<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetIsOpen_Event*> (this));
|
||||
basicServiceR2->UnregisterOnSignalChangeOfRightDoorIsOpen02(dynamic_cast<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetIsOpenR2_Event*> (this));
|
||||
|
||||
// Unregister the data link signalss
|
||||
if (m_SignalFrontLeftDoorIsOpen)
|
||||
@@ -327,13 +338,13 @@ bool CConsole::PrepareDataConsumersForStandAlone()
|
||||
}
|
||||
|
||||
// Registrate for the vehicle device & basic service of the front left door. Front left door mzust exist, the others are optional
|
||||
auto vehicleDevice = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Left_Device").GetInterface<vss::Vehicle::Chassis::Door::Axle01::LeftDevice::IVSS_IsOpen>();
|
||||
auto vehicleDevice = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Left_Device").GetInterface<vss::Vehicle::Body::Door::Axle::_01::LeftDevice::IVSS_IsOpen>();
|
||||
if (!vehicleDevice)
|
||||
{
|
||||
SDV_LOG_ERROR("Could not get interface 'LeftDevice::IVSS_IsOpen': [CConsole]");
|
||||
return false;
|
||||
}
|
||||
vehicleDevice->RegisterIsOpenEvent(dynamic_cast<vss::Vehicle::Chassis::Door::Axle01::LeftDevice::IVSS_WriteIsOpen_Event*> (this));
|
||||
vehicleDevice->RegisterIsOpenEvent(dynamic_cast<vss::Vehicle::Body::Door::Axle::_01::LeftDevice::IVSS_WriteIsOpen_Event*> (this));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#include "../door_app/include/door_application.h"
|
||||
#include "../door_app/include/signal_names.h"
|
||||
|
||||
@@ -126,7 +136,7 @@ bool CDoorControl::Initialize(const uint32_t numberOfDoors)
|
||||
}
|
||||
}
|
||||
|
||||
bResult &= LoadConfigFile("Load door service (complex service): ", "door_comple_service.toml");
|
||||
bResult &= LoadConfigFile("Load door service (complex service): ", "door_complex_service.toml");
|
||||
|
||||
if (!bResult)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
#include "../door_app/include/door_application.h"
|
||||
#include "../door_app/include/console.h"
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#include "../door_app/include/door_extern_application.h"
|
||||
#include "../door_app/include/signal_names.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
#include "../door_app/include/door_extern_application.h"
|
||||
#include "../door_app/include/console.h"
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef CONSOLE_OUTPUT_H
|
||||
#define CONSOLE_OUTPUT_H
|
||||
|
||||
@@ -12,29 +22,30 @@
|
||||
#include "signal_names.h"
|
||||
#include <fcntl.h>
|
||||
#include <atomic>
|
||||
#include "../interfaces/vss_vehiclechassisdooraxle01left_vd_rx.h"
|
||||
#include "../interfaces/vss_vehiclechassisdooraxle01left_bs_rx.h"
|
||||
#include "../interfaces/vss_vehiclechassisdooraxle01right_bs_rx.h"
|
||||
#include "../interfaces/vss_vehiclechassisdooraxle02left_bs_rx.h"
|
||||
#include "../interfaces/vss_vehiclechassisdooraxle02right_bs_rx.h"
|
||||
|
||||
#include "../../generated/vss_files/vss_vehiclebodydooraxle_01left_vd_rx.h"
|
||||
#include "../../generated/vss_files/vss_vehiclebodydooraxle_01left_bs_rx.h"
|
||||
#include "../../generated/vss_files/vss_vehiclebodydooraxle_01right_bs_rx.h"
|
||||
#include "../../generated/vss_files/vss_vehiclebodydooraxle_02left_bs_rx.h"
|
||||
#include "../../generated/vss_files/vss_vehiclebodydooraxle_02right_bs_rx.h"
|
||||
|
||||
#ifdef __unix__
|
||||
#include <termios.h> // Needed for tcgetattr and fcntl
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "../generated/door_service/door_ifc.h"
|
||||
#include "../../generated/door_service/door_ifc.h"
|
||||
|
||||
/**
|
||||
* @brief Console operation class.
|
||||
* @details This class retrieves RX data from the data dispatch service, vehicle device & basic service of front left door on event change.
|
||||
* Furthermore, it shows TX value by polling the RX signals.
|
||||
*/
|
||||
class CConsole : public vss::Vehicle::Chassis::Door::Axle01::LeftDevice::IVSS_WriteIsOpen_Event
|
||||
, public vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetIsOpen_Event
|
||||
, public vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetIsOpen_Event
|
||||
, public vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetIsOpen_Event
|
||||
, public vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetIsOpen_Event
|
||||
class CConsole : public vss::Vehicle::Body::Door::Axle::_01::LeftDevice::IVSS_WriteIsOpen_Event
|
||||
, public vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetIsOpenL1_Event
|
||||
, public vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetIsOpenR1_Event
|
||||
, public vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetIsOpenL2_Event
|
||||
, public vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetIsOpenR2_Event
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#include <string>
|
||||
#include <support/app_control.h>
|
||||
#include <support/signal_support.h>
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#include <string>
|
||||
#include <support/app_control.h>
|
||||
#include <support/signal_support.h>
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* namespace for the signal names
|
||||
* in case /interfaces/signal_identifier.h
|
||||
@@ -9,14 +19,14 @@
|
||||
namespace doors
|
||||
{
|
||||
// Data Dispatch Service signal names to dbc variable names C-type RX/TX vss name space
|
||||
static std::string dsLeftDoorIsOpen01 = "CAN_Input_L1.Door01LeftIsOpen"; ///< bool RX Vehicle.Chassis.Door.Axle01.Left
|
||||
static std::string dsRightDoorIsOpen01 = "CAN_Input_R1.Door01RightIsOpen"; ///< bool RX Vehicle.Chassis.Door.Axle01.Right
|
||||
static std::string dsLeftDoorIsOpen02 = "CAN_Input_L2.Door02LeftIsOpen"; ///< bool RX Vehicle.Chassis.Door.Axle02.Left
|
||||
static std::string dsRightDoorIsOpen02 = "CAN_Input_R2.Door02RightIsOpen"; ///< bool RX Vehicle.Chassis.Door.Axle02.Right
|
||||
static std::string dsLeftLatch01 = "CAN_Output.LockDoor01Left"; ///< bool TX Vehicle.Chassis.TX.Door.Axle01.Left
|
||||
static std::string dsRightLatch01 = "CAN_Output.LockDoor01Right"; ///< bool TX Vehicle.Chassis.TX.Door.Axle01.Right
|
||||
static std::string dsLeftLatch02 = "CAN_Output.LockDoor02Left"; ///< bool TX Vehicle.Chassis.TX.Door.Axle02.Left
|
||||
static std::string dsRightLatch02 = "CAN_Output.LockDoor02Right"; ///< bool TX Vehicle.Chassis.TX.Door.Axle02.Left
|
||||
static std::string dsLeftDoorIsOpen01 = "CAN_Input_L1.Door01LeftIsOpen"; ///< bool RX Vehicle.Body.Door.Axle._01.Left
|
||||
static std::string dsRightDoorIsOpen01 = "CAN_Input_R1.Door01RightIsOpen"; ///< bool RX Vehicle.Body.Door.Axle._01.Right
|
||||
static std::string dsLeftDoorIsOpen02 = "CAN_Input_L2.Door02LeftIsOpen"; ///< bool RX Vehicle.Body.Door.Axle._02.Left
|
||||
static std::string dsRightDoorIsOpen02 = "CAN_Input_R2.Door02RightIsOpen"; ///< bool RX Vehicle.Body.Door.Axle._02.Right
|
||||
static std::string dsLeftLatch01 = "CAN_Output.LockDoor01Left"; ///< bool TX Vehicle.Body.Door.Axle._01.Left
|
||||
static std::string dsRightLatch01 = "CAN_Output.LockDoor01Right"; ///< bool TX Vehicle.Body.Door.Axle._01.Right
|
||||
static std::string dsLeftLatch02 = "CAN_Output.LockDoor02Left"; ///< bool TX Vehicle.Body.Door.Axle._02.Left
|
||||
static std::string dsRightLatch02 = "CAN_Output.LockDoor02Right"; ///< bool TX Vehicle.Body.Door.Axle._02.Right
|
||||
|
||||
} // doors
|
||||
|
||||
|
||||
@@ -1,119 +1,113 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
#include "complex_service.h"
|
||||
|
||||
void CDoorsExampleService::Initialize(const sdv::u8string& /*ssObjectConfig*/)
|
||||
bool CDoorsExampleService::OnInitialize()
|
||||
{
|
||||
m_eStatus = sdv::EObjectStatus::initializing;
|
||||
|
||||
// Request the basic service for front left door.
|
||||
auto pFrontLeftDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_GetIsOpen>();
|
||||
auto pFrontLeftDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_GetIsOpenL1>();
|
||||
if (pFrontLeftDoorSvc)
|
||||
{
|
||||
// Register front left door change event handler.
|
||||
pFrontLeftDoorSvc->RegisterOnSignalChangeOfLeftDoorIsOpen01(static_cast<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetIsOpen_Event*> (this));
|
||||
pFrontLeftDoorSvc->RegisterOnSignalChangeOfLeftDoorIsOpen01(static_cast<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetIsOpenL1_Event*> (this));
|
||||
}
|
||||
|
||||
// Request the basic service for front right door.
|
||||
auto pFrontRightDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_GetIsOpen>();
|
||||
auto pFrontRightDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_GetIsOpenR1>();
|
||||
if (pFrontRightDoorSvc)
|
||||
{
|
||||
// Register front right door change event handler.
|
||||
pFrontRightDoorSvc->RegisterOnSignalChangeOfRightDoorIsOpen01(static_cast<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetIsOpen_Event*> (this));
|
||||
pFrontRightDoorSvc->RegisterOnSignalChangeOfRightDoorIsOpen01(static_cast<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetIsOpenR1_Event*> (this));
|
||||
}
|
||||
|
||||
// Request the basic service for rear left door.
|
||||
auto pRearLeftDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_GetIsOpen>();
|
||||
auto pRearLeftDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_GetIsOpenL2>();
|
||||
if (pRearLeftDoorSvc)
|
||||
{
|
||||
// Register rear left door change event handler.
|
||||
pRearLeftDoorSvc->RegisterOnSignalChangeOfLeftDoorIsOpen02(static_cast<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetIsOpen_Event*> (this));
|
||||
pRearLeftDoorSvc->RegisterOnSignalChangeOfLeftDoorIsOpen02(static_cast<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetIsOpenL2_Event*> (this));
|
||||
}
|
||||
|
||||
// Request the basic service for front right door.
|
||||
auto pRearRightDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_GetIsOpen>();
|
||||
auto pRearRightDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_GetIsOpenR2>();
|
||||
if (pRearRightDoorSvc)
|
||||
{
|
||||
// Register rear right door change event handler.
|
||||
pRearRightDoorSvc->RegisterOnSignalChangeOfRightDoorIsOpen02(static_cast<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetIsOpen_Event*> (this));
|
||||
pRearRightDoorSvc->RegisterOnSignalChangeOfRightDoorIsOpen02(static_cast<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetIsOpenR2_Event*> (this));
|
||||
}
|
||||
|
||||
// Request the basic service for locking the front left door.
|
||||
m_pFrontLeftDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetLock>();
|
||||
m_pFrontLeftDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetLock>();
|
||||
|
||||
// Request the basic service for locking the front right door.
|
||||
m_pFrontRightDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetLock>();
|
||||
m_pFrontRightDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetLock>();
|
||||
|
||||
// Request the basic service for locking the rear left door.
|
||||
m_pRearLeftDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetLock>();
|
||||
m_pRearLeftDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetLock>();
|
||||
|
||||
// Request the basic service for locking the rear right door.
|
||||
m_pRearRightDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetLock>();
|
||||
m_pRearRightDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetLock>();
|
||||
|
||||
// Validate if we have the Open/Closed signal and the Lock/Unlock door signal, both must exist together or both must not exist
|
||||
// Front left door is an exception, it isalways required
|
||||
// Front left door is an exception, it is always required
|
||||
if ((!pFrontLeftDoorSvc) || (!m_pFrontLeftDoorSvc))
|
||||
{
|
||||
SDV_LOG_ERROR("Could not get interfaces for 'Front left door': [CDoorsExampleService]");
|
||||
m_eStatus = sdv::EObjectStatus::initialization_failure;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((pFrontRightDoorSvc == nullptr) != (m_pFrontRightDoorSvc == nullptr))
|
||||
{
|
||||
SDV_LOG_ERROR("Could not get both interfaces for 'Front right door': [CDoorsExampleService]");
|
||||
m_eStatus = sdv::EObjectStatus::initialization_failure;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((pRearLeftDoorSvc == nullptr) != (m_pRearLeftDoorSvc == nullptr))
|
||||
{
|
||||
SDV_LOG_ERROR("Could not get both interfaces for 'Rear left door': [CDoorsExampleService]");
|
||||
m_eStatus = sdv::EObjectStatus::initialization_failure;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((pRearRightDoorSvc == nullptr) != (m_pRearRightDoorSvc == nullptr))
|
||||
{
|
||||
SDV_LOG_ERROR("Could not get both interfaces for 'Rear right door': [CDoorsExampleService]");
|
||||
m_eStatus = sdv::EObjectStatus::initialization_failure;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_doorsThread.start(m_Interval);
|
||||
m_eStatus = sdv::EObjectStatus::initialized;
|
||||
return true;
|
||||
}
|
||||
|
||||
sdv::EObjectStatus CDoorsExampleService::GetStatus() const
|
||||
{
|
||||
return m_eStatus;
|
||||
}
|
||||
|
||||
void CDoorsExampleService::SetOperationMode(sdv::EOperationMode /*eMode*/)
|
||||
{
|
||||
// Not applicable
|
||||
}
|
||||
|
||||
void CDoorsExampleService::Shutdown()
|
||||
void CDoorsExampleService::OnShutdown()
|
||||
{
|
||||
// Unregister front left door change event handler.
|
||||
auto pFrontLeftDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_GetIsOpen>();
|
||||
auto pFrontLeftDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_GetIsOpenL1>();
|
||||
if (pFrontLeftDoorSvc)
|
||||
pFrontLeftDoorSvc->UnregisterOnSignalChangeOfLeftDoorIsOpen01(static_cast<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetIsOpen_Event*> (this));
|
||||
pFrontLeftDoorSvc->UnregisterOnSignalChangeOfLeftDoorIsOpen01(static_cast<vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetIsOpenL1_Event*> (this));
|
||||
|
||||
// Unregister front right door change event handler.
|
||||
auto pFrontRightDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle01.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_GetIsOpen>();
|
||||
auto pFrontRightDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._01.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_GetIsOpenR1>();
|
||||
if (pFrontRightDoorSvc)
|
||||
pFrontRightDoorSvc->UnregisterOnSignalChangeOfRightDoorIsOpen01(static_cast<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetIsOpen_Event*> (this));
|
||||
pFrontRightDoorSvc->UnregisterOnSignalChangeOfRightDoorIsOpen01(static_cast<vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetIsOpenR1_Event*> (this));
|
||||
|
||||
// Unregister rear left door change event handler.
|
||||
auto pRearLeftDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Left_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_GetIsOpen>();
|
||||
auto pRearLeftDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Left_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_GetIsOpenL2>();
|
||||
if (pRearLeftDoorSvc)
|
||||
pRearLeftDoorSvc->UnregisterOnSignalChangeOfLeftDoorIsOpen02(static_cast<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetIsOpen_Event*> (this));
|
||||
pRearLeftDoorSvc->UnregisterOnSignalChangeOfLeftDoorIsOpen02(static_cast<vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetIsOpenL2_Event*> (this));
|
||||
|
||||
// Unregister rear right door change event handler.
|
||||
auto pRearRightDoorSvc = sdv::core::GetObject("Vehicle.Chassis.Door.Axle02.Right_Service").GetInterface<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_GetIsOpen>();
|
||||
auto pRearRightDoorSvc = sdv::core::GetObject("Vehicle.Body.Door.Axle._02.Right_Service").GetInterface<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_GetIsOpenR2>();
|
||||
if (pRearRightDoorSvc)
|
||||
pRearRightDoorSvc->UnregisterOnSignalChangeOfRightDoorIsOpen02(static_cast<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetIsOpen_Event*> (this));
|
||||
pRearRightDoorSvc->UnregisterOnSignalChangeOfRightDoorIsOpen02(static_cast<vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetIsOpenR2_Event*> (this));
|
||||
|
||||
m_doorsThread.stop();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef DOORS_COMPLEX_SERVICE_EXAMPLE_H
|
||||
#define DOORS_COMPLEX_SERVICE_EXAMPLE_H
|
||||
|
||||
@@ -8,15 +18,15 @@
|
||||
#include <support/signal_support.h>
|
||||
#include <support/timer.h>
|
||||
|
||||
// VSS interfaces - located in ../interfaces
|
||||
#include "vss_vehiclechassisdooraxle01left_bs_rx.h"
|
||||
#include "vss_vehiclechassisdooraxle01left_bs_tx.h"
|
||||
#include "vss_vehiclechassisdooraxle01right_bs_rx.h"
|
||||
#include "vss_vehiclechassisdooraxle01right_bs_tx.h"
|
||||
#include "vss_vehiclechassisdooraxle02left_bs_rx.h"
|
||||
#include "vss_vehiclechassisdooraxle02left_bs_tx.h"
|
||||
#include "vss_vehiclechassisdooraxle02right_bs_rx.h"
|
||||
#include "vss_vehiclechassisdooraxle02right_bs_tx.h"
|
||||
// VSS interfaces - located in ../generated/vss_files/
|
||||
#include "../generated/vss_files/vss_vehiclebodydooraxle_01left_bs_rx.h"
|
||||
#include "../generated/vss_files/vss_vehiclebodydooraxle_01left_bs_tx.h"
|
||||
#include "../generated/vss_files/vss_vehiclebodydooraxle_01right_bs_rx.h"
|
||||
#include "../generated/vss_files/vss_vehiclebodydooraxle_01right_bs_tx.h"
|
||||
#include "../generated/vss_files/vss_vehiclebodydooraxle_02left_bs_rx.h"
|
||||
#include "../generated/vss_files/vss_vehiclebodydooraxle_02left_bs_tx.h"
|
||||
#include "../generated/vss_files/vss_vehiclebodydooraxle_02right_bs_rx.h"
|
||||
#include "../generated/vss_files/vss_vehiclebodydooraxle_02right_bs_tx.h"
|
||||
|
||||
#include "lock_doors_thread.h"
|
||||
|
||||
@@ -26,11 +36,10 @@
|
||||
* @brief Doors example service: locks/unlocks doors after closing/opening doors
|
||||
*/
|
||||
class CDoorsExampleService : public sdv::CSdvObject
|
||||
, public sdv::IObjectControl
|
||||
, public vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetIsOpen_Event
|
||||
, public vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetIsOpen_Event
|
||||
, public vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetIsOpen_Event
|
||||
, public vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetIsOpen_Event
|
||||
, public vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetIsOpenL1_Event
|
||||
, public vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetIsOpenR1_Event
|
||||
, public vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetIsOpenL2_Event
|
||||
, public vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetIsOpenR2_Event
|
||||
, public IDoorService
|
||||
{
|
||||
public:
|
||||
@@ -43,48 +52,32 @@ public:
|
||||
* @brief Destructor
|
||||
*/
|
||||
~CDoorsExampleService()
|
||||
{
|
||||
// Just in case...
|
||||
Shutdown();
|
||||
}
|
||||
{}
|
||||
|
||||
// Interface map
|
||||
BEGIN_SDV_INTERFACE_MAP()
|
||||
SDV_INTERFACE_ENTRY(sdv::IObjectControl)
|
||||
SDV_INTERFACE_ENTRY(vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetIsOpen_Event)
|
||||
SDV_INTERFACE_ENTRY(vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetIsOpen_Event)
|
||||
SDV_INTERFACE_ENTRY(vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetIsOpen_Event)
|
||||
SDV_INTERFACE_ENTRY(vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetIsOpen_Event)
|
||||
SDV_INTERFACE_ENTRY(vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetIsOpenL1_Event)
|
||||
SDV_INTERFACE_ENTRY(vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetIsOpenR1_Event)
|
||||
SDV_INTERFACE_ENTRY(vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetIsOpenL2_Event)
|
||||
SDV_INTERFACE_ENTRY(vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetIsOpenR2_Event)
|
||||
SDV_INTERFACE_ENTRY(IDoorService)
|
||||
END_SDV_INTERFACE_MAP()
|
||||
|
||||
// Object declarations
|
||||
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::ComplexService)
|
||||
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::vehicle_function)
|
||||
DECLARE_OBJECT_CLASS_NAME("Doors Example Service")
|
||||
DECLARE_OBJECT_SINGLETON()
|
||||
|
||||
/**
|
||||
* @brief Initialize the object. Overload of sdv::IObjectControl::Initialize.
|
||||
* @param[in] ssObjectConfig Optional configuration string.
|
||||
* @brief Initialization event, called after object configuration was loaded. Overload of sdv::CSdvObject::OnInitialize.
|
||||
* @return Returns 'true' when the initialization was successful, 'false' when not.
|
||||
*/
|
||||
void Initialize(const sdv::u8string& ssObjectConfig) override;
|
||||
virtual bool OnInitialize() override;
|
||||
|
||||
/**
|
||||
* @brief Get the current status of the object. Overload of sdv::IObjectControl::GetStatus.
|
||||
* @return Return the current status of the object.
|
||||
* @brief Shutdown the object. Overload of sdv::CSdvObject::OnShutdown.
|
||||
*/
|
||||
sdv::EObjectStatus GetStatus() const override;
|
||||
|
||||
/**
|
||||
* @brief Set the component operation mode. Overload of sdv::IObjectControl::SetOperationMode.
|
||||
* @param[in] eMode The operation mode, the component should run in.
|
||||
*/
|
||||
void SetOperationMode(sdv::EOperationMode eMode) override;
|
||||
|
||||
/**
|
||||
* @brief Shutdown called before the object is destroyed. Overload of sdv::IObjectControl::Shutdown.
|
||||
*/
|
||||
void Shutdown() override;
|
||||
virtual void OnShutdown() override;
|
||||
|
||||
/**
|
||||
* @brief Set leftDoorIsOpen signal (front door)
|
||||
@@ -166,8 +159,6 @@ private:
|
||||
*/
|
||||
void LockDoors(const bool lock) const;
|
||||
|
||||
sdv::EObjectStatus m_eStatus = sdv::EObjectStatus::initialization_pending; ///< Current object status
|
||||
|
||||
bool m_bFrontLeftDoorIsOpen = false; ///< Front Left Door Status
|
||||
bool m_bFrontRightDoorIsOpen = false; ///< Front Right Door Status
|
||||
bool m_bRearLeftDoorIsOpen = false; ///< Rear Left Door Status
|
||||
@@ -176,10 +167,10 @@ private:
|
||||
bool m_bAllDoorsAreLocked = false; ///< state for locked/unlocked of all doors
|
||||
|
||||
///< Door lock interfaces.
|
||||
vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetLock* m_pFrontLeftDoorSvc = nullptr; ///< Front Left Door
|
||||
vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetLock* m_pFrontRightDoorSvc = nullptr; ///< Front Right Door
|
||||
vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetLock* m_pRearLeftDoorSvc = nullptr; ///< Rear Left Door
|
||||
vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetLock* m_pRearRightDoorSvc = nullptr; ///< Rear Right Door
|
||||
vss::Vehicle::Body::Door::Axle::_01::LeftService::IVSS_SetLock* m_pFrontLeftDoorSvc = nullptr; ///< Front Left Door
|
||||
vss::Vehicle::Body::Door::Axle::_01::RightService::IVSS_SetLock* m_pFrontRightDoorSvc = nullptr; ///< Front Right Door
|
||||
vss::Vehicle::Body::Door::Axle::_02::LeftService::IVSS_SetLock* m_pRearLeftDoorSvc = nullptr; ///< Rear Left Door
|
||||
vss::Vehicle::Body::Door::Axle::_02::RightService::IVSS_SetLock* m_pRearRightDoorSvc = nullptr; ///< Rear Right Door
|
||||
|
||||
LockDoorsThread m_doorsThread; ///< timer thread
|
||||
uint32_t m_Interval = 18; ///< interval value * 100 = x milliseconds
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* @file door_ifc.idl
|
||||
* @details Door service interface definition.
|
||||
*/
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* @brief DoorService example service interface. The interface provides functions for the
|
||||
* @details Door service interface definition.
|
||||
* Doors example complex service.
|
||||
*/
|
||||
interface IDoorService
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef LOCK_DOORS_THREAD_H
|
||||
#define LOCK_DOORS_THREAD_H
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
|
||||
# @file CMakeLists.txt
|
||||
# This file is cmake project file.
|
||||
# This file was generated by the DBC utility from:
|
||||
# datalink_2doors_example.dbc
|
||||
# DBC file version: 1.0.0.1
|
||||
#*******************************************************************************
|
||||
# Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
#
|
||||
# This program and the accompanying materials are made available under the
|
||||
# terms of the Apache License Version 2.0 which is available at
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#*******************************************************************************
|
||||
|
||||
|
||||
# Based on CMakeLists.txt from https://github.com/modelica/Reference-FMUs
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* @file config.h
|
||||
* @date 2025-09-06 15:15:34
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* @file model.cpp
|
||||
* @date 2025-09-06 15:15:34
|
||||
@@ -137,7 +147,7 @@ bool OpenAPILoad(const std::string& resources)
|
||||
|
||||
success &= g_appcontrol->LoadConfig("front_left_door_example.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
success &= g_appcontrol->LoadConfig("front_right_door_example.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
success &= g_appcontrol->LoadConfig("door_comple_service.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
success &= g_appcontrol->LoadConfig("door_complex_service.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
|
||||
g_appcontrol->SetRunningMode();
|
||||
return success;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[Configuration]
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_complex_service.sdv"
|
||||
Class = "Doors Example Service"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_frontdoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Left_Device"
|
||||
Path = "doors_vd_frontdoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Left_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_frontdoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Left_Service"
|
||||
Path = "doors_bs_frontdoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Left_Service"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_frontdoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Right_Device"
|
||||
Path = "doors_vd_frontdoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Right_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_frontdoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Right_Service"
|
||||
Path = "doors_bs_frontdoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Right_Service"
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
@file signal_identifier.h
|
||||
@date 2025-09-06 15:15:34
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
|
||||
# @file CMakeLists.txt
|
||||
# This file is cmake project file.
|
||||
# This file was generated by the DBC utility from:
|
||||
# datalink_4doors_example.dbc
|
||||
# DBC file version: 1.0.0.1
|
||||
#*******************************************************************************
|
||||
# Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
#
|
||||
# This program and the accompanying materials are made available under the
|
||||
# terms of the Apache License Version 2.0 which is available at
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#*******************************************************************************
|
||||
|
||||
|
||||
# Based on CMakeLists.txt from https://github.com/modelica/Reference-FMUs
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* @file config.h
|
||||
* @date 2025-09-06 14:55:42
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* @file model.cpp
|
||||
* @date 2025-09-06 14:55:42
|
||||
@@ -164,7 +174,7 @@ bool OpenAPILoad(const std::string& resources)
|
||||
success &= g_appcontrol->LoadConfig("front_right_door_example.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
success &= g_appcontrol->LoadConfig("rear_left_door_example.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
success &= g_appcontrol->LoadConfig("rear_right_door_example.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
success &= g_appcontrol->LoadConfig("door_comple_service.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
success &= g_appcontrol->LoadConfig("door_complex_service.toml") == sdv::core::EConfigProcessResult::successful;
|
||||
|
||||
g_appcontrol->SetRunningMode();
|
||||
return success;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[Configuration]
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_complex_service.sdv"
|
||||
Class = "Doors Example Service"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_frontdoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Left_Device"
|
||||
Path = "doors_vd_frontdoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Left_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_frontdoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Left_Service"
|
||||
Path = "doors_bs_frontdoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Left_Service"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_frontdoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Right_Device"
|
||||
Path = "doors_vd_frontdoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Right_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_frontdoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle01.Right_Service"
|
||||
Path = "doors_bs_frontdoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._01.Right_Service"
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_reardoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle02.Left_Device"
|
||||
Path = "doors_vd_reardoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._02.Left_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_reardoorleft.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle02.Left_Service"
|
||||
Path = "doors_bs_reardoorleft_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._02.Left_Service"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
Version = 100
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_vd_reardoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle02.Right_Device"
|
||||
Path = "doors_vd_reardoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._02.Right_Device"
|
||||
|
||||
[[Component]]
|
||||
Path = "doors_bs_reardoorright.sdv"
|
||||
Class = "Vehicle.Chassis.Door.Axle02.Right_Service"
|
||||
Path = "doors_bs_reardoorright_rx.sdv"
|
||||
Class = "Vehicle.Body.Door.Axle._02.Right_Service"
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
@file signal_identifier.h
|
||||
@date 2025-09-06 14:55:42
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
********************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user