From 2db14ee522f1dfce9313684bb4f4d0c676498ba2 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 4 May 2023 10:22:30 -0400 Subject: [PATCH] Fix #2320, reorganize CFE_TESTCASE header files Organize CFE_TESTCASE header file contents according to the convention --- modules/cfe_testcase/arch_build.cmake | 30 ++++++++++++ .../config/default_cfe_test_msgids.h | 39 +++++++++++++++ .../default_cfe_test_tbl.h} | 0 .../config/default_cfe_test_topicids.h | 48 +++++++++++++++++++ .../config/default_cfe_testcase_msgids.h | 39 +++++++++++++++ modules/cfe_testcase/mission_build.cmake | 31 ++++++++++++ 6 files changed, 187 insertions(+) create mode 100644 modules/cfe_testcase/arch_build.cmake create mode 100644 modules/cfe_testcase/config/default_cfe_test_msgids.h rename modules/cfe_testcase/{inc/cfe_test_tbl.h => config/default_cfe_test_tbl.h} (100%) create mode 100644 modules/cfe_testcase/config/default_cfe_test_topicids.h create mode 100644 modules/cfe_testcase/config/default_cfe_testcase_msgids.h create mode 100644 modules/cfe_testcase/mission_build.cmake diff --git a/modules/cfe_testcase/arch_build.cmake b/modules/cfe_testcase/arch_build.cmake new file mode 100644 index 000000000..b04904ed0 --- /dev/null +++ b/modules/cfe_testcase/arch_build.cmake @@ -0,0 +1,30 @@ +########################################################### +# +# TEST Core Module platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the TEST configuration +set(TEST_PLATFORM_CONFIG_FILE_LIST + cfe_test_msgids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(TEST_CFGFILE ${TEST_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${TEST_CFGFILE}" NAME_WE) + if (DEFINED TEST_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE "${TEST_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TEST_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${TEST_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/cfe_testcase/config/default_cfe_test_msgids.h b/modules/cfe_testcase/config/default_cfe_test_msgids.h new file mode 100644 index 000000000..a4b41aa30 --- /dev/null +++ b/modules/cfe_testcase/config/default_cfe_test_msgids.h @@ -0,0 +1,39 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Test app (CFE_TEST) Application Message IDs + */ +#ifndef CFE_TEST_MSGIDS_H +#define CFE_TEST_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_test_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */ + +#endif diff --git a/modules/cfe_testcase/inc/cfe_test_tbl.h b/modules/cfe_testcase/config/default_cfe_test_tbl.h similarity index 100% rename from modules/cfe_testcase/inc/cfe_test_tbl.h rename to modules/cfe_testcase/config/default_cfe_test_tbl.h diff --git a/modules/cfe_testcase/config/default_cfe_test_topicids.h b/modules/cfe_testcase/config/default_cfe_test_topicids.h new file mode 100644 index 000000000..6ecca4fb5 --- /dev/null +++ b/modules/cfe_testcase/config/default_cfe_test_topicids.h @@ -0,0 +1,48 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Test app (CFE_TESTCASE) Application Topic IDs + */ +#ifndef CFE_TESTCASE_TOPICIDS_H +#define CFE_TESTCASE_TOPICIDS_H + +/** +** \cfemissioncfg cFE Portable Message Numbers for Commands +** +** \par Description: +** Portable message numbers for the cFE TEST command messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TEST_CMD_MSG 2 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Telemetry +** +** \par Description: +** Portable message numbers for the cFE TEST telemetry messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TEST_HK_TLM_MSG 2 + +#endif diff --git a/modules/cfe_testcase/config/default_cfe_testcase_msgids.h b/modules/cfe_testcase/config/default_cfe_testcase_msgids.h new file mode 100644 index 000000000..a4b41aa30 --- /dev/null +++ b/modules/cfe_testcase/config/default_cfe_testcase_msgids.h @@ -0,0 +1,39 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Test app (CFE_TEST) Application Message IDs + */ +#ifndef CFE_TEST_MSGIDS_H +#define CFE_TEST_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_test_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */ + +#endif diff --git a/modules/cfe_testcase/mission_build.cmake b/modules/cfe_testcase/mission_build.cmake new file mode 100644 index 000000000..fd1df0bc0 --- /dev/null +++ b/modules/cfe_testcase/mission_build.cmake @@ -0,0 +1,31 @@ +########################################################### +# +# TEST Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the TEST configuration +set(TEST_MISSION_CONFIG_FILE_LIST + cfe_test_tbl.h + cfe_test_topicids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(TEST_CFGFILE ${TEST_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${TEST_CFGFILE}" NAME_WE) + if (DEFINED TEST_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${TEST_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TEST_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${TEST_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach()