diff --git a/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_heartbeat.hpp b/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_heartbeat.hpp index 47a6731..7fa12d2 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_heartbeat.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_heartbeat.hpp @@ -21,7 +21,7 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.aero_model_heartbeat(), model_data->aero_model_heartbeat); + assign_value(model_data->aero_model_heartbeat, data.aero_model_heartbeat()); } template void setData(T *model_data) @@ -30,7 +30,7 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.aero_model_heartbeat(), model_data->aero_model_heartbeat); + assign_value(out_data.aero_model_heartbeat(), model_data->aero_model_heartbeat); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_input.hpp b/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_input.hpp index 8bf648c..423cd73 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_input.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_input.hpp @@ -21,33 +21,33 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.l_04_i_aerocomac_alpha_f8(), model_data->l_04_i_aerocomac_alpha_f8); - assign_value_get(data.l_04_i_aerocomac_alpdot_f8(), model_data->l_04_i_aerocomac_alpdot_f8); - assign_value_get(data.l_04_i_aerocomac_beta_f8(), model_data->l_04_i_aerocomac_beta_f8); - assign_value_get(data.l_04_i_aerocomac_press_alt_f8(), model_data->l_04_i_aerocomac_press_alt_f8); - assign_value_get(data.l_04_i_aerocomac_tas_f8(), model_data->l_04_i_aerocomac_tas_f8); - assign_value_get(data.l_04_i_aerocomac_mach_f8(), model_data->l_04_i_aerocomac_mach_f8); - assign_value_get(data.l_04_i_aerocomac_nx_f8(), model_data->l_04_i_aerocomac_nx_f8); - assign_value_get(data.l_04_i_aerocomac_ny_f8(), model_data->l_04_i_aerocomac_ny_f8); - assign_value_get(data.l_04_i_aerocomac_nz_f8(), model_data->l_04_i_aerocomac_nz_f8); - assign_value_get(data.l_04_i_aerocomac_p_f8(), model_data->l_04_i_aerocomac_p_f8); - assign_value_get(data.l_04_i_aerocomac_q_f8(), model_data->l_04_i_aerocomac_q_f8); - assign_value_get(data.l_04_i_aerocomac_r_f8(), model_data->l_04_i_aerocomac_r_f8); - assign_value_get(data.l_04_i_aerocomac_qbar_f8(), model_data->l_04_i_aerocomac_qbar_f8); - assign_value_get(data.l_04_i_aerocomac_blcg_f8(), model_data->l_04_i_aerocomac_blcg_f8); - assign_value_get(data.l_04_i_aerocomac_bscg_f8(), model_data->l_04_i_aerocomac_bscg_f8); - assign_value_get(data.l_04_i_aerocomac_wlcg_f8(), model_data->l_04_i_aerocomac_wlcg_f8); - assign_value_get(data.l_04_i_aerocomac_ail_f8(), model_data->l_04_i_aerocomac_ail_f8); - assign_value_get(data.l_04_i_aerocomac_elv_f8(), model_data->l_04_i_aerocomac_elv_f8); - assign_value_get(data.l_04_i_aerocomac_rud_f8(), model_data->l_04_i_aerocomac_rud_f8); - assign_value_get(data.l_04_i_aerocomac_stab_f8(), model_data->l_04_i_aerocomac_stab_f8); - assign_value_get(data.l_04_i_aerocomac_gear_f8(), model_data->l_04_i_aerocomac_gear_f8); - assign_value_get(data.l_04_i_aerocomac_flap_f8(), model_data->l_04_i_aerocomac_flap_f8); - assign_value_get(data.l_04_i_aerocomac_slat_f8(), model_data->l_04_i_aerocomac_slat_f8); - assign_value_get(data.l_04_i_aerocomac_spl_f8(), model_data->l_04_i_aerocomac_spl_f8); - assign_value_get(data.l_04_i_aerocomac_tnet_f8(), model_data->l_04_i_aerocomac_tnet_f8); - assign_value_get(data.l_04_i_aerocomac_kice_f8(), model_data->l_04_i_aerocomac_kice_f8); - assign_value_get(data.l_04_i_aerocomac_alt_agl_f8(), model_data->l_04_i_aerocomac_alt_agl_f8); + assign_value(model_data->l_04_i_aerocomac_alpha_f8, data.l_04_i_aerocomac_alpha_f8()); + assign_value(model_data->l_04_i_aerocomac_alpdot_f8, data.l_04_i_aerocomac_alpdot_f8()); + assign_value(model_data->l_04_i_aerocomac_beta_f8, data.l_04_i_aerocomac_beta_f8()); + assign_value(model_data->l_04_i_aerocomac_press_alt_f8, data.l_04_i_aerocomac_press_alt_f8()); + assign_value(model_data->l_04_i_aerocomac_tas_f8, data.l_04_i_aerocomac_tas_f8()); + assign_value(model_data->l_04_i_aerocomac_mach_f8, data.l_04_i_aerocomac_mach_f8()); + assign_value(model_data->l_04_i_aerocomac_nx_f8, data.l_04_i_aerocomac_nx_f8()); + assign_value(model_data->l_04_i_aerocomac_ny_f8, data.l_04_i_aerocomac_ny_f8()); + assign_value(model_data->l_04_i_aerocomac_nz_f8, data.l_04_i_aerocomac_nz_f8()); + assign_value(model_data->l_04_i_aerocomac_p_f8, data.l_04_i_aerocomac_p_f8()); + assign_value(model_data->l_04_i_aerocomac_q_f8, data.l_04_i_aerocomac_q_f8()); + assign_value(model_data->l_04_i_aerocomac_r_f8, data.l_04_i_aerocomac_r_f8()); + assign_value(model_data->l_04_i_aerocomac_qbar_f8, data.l_04_i_aerocomac_qbar_f8()); + assign_value(model_data->l_04_i_aerocomac_blcg_f8, data.l_04_i_aerocomac_blcg_f8()); + assign_value(model_data->l_04_i_aerocomac_bscg_f8, data.l_04_i_aerocomac_bscg_f8()); + assign_value(model_data->l_04_i_aerocomac_wlcg_f8, data.l_04_i_aerocomac_wlcg_f8()); + assign_value(model_data->l_04_i_aerocomac_ail_f8, data.l_04_i_aerocomac_ail_f8()); + assign_value(model_data->l_04_i_aerocomac_elv_f8, data.l_04_i_aerocomac_elv_f8()); + assign_value(model_data->l_04_i_aerocomac_rud_f8, data.l_04_i_aerocomac_rud_f8()); + assign_value(model_data->l_04_i_aerocomac_stab_f8, data.l_04_i_aerocomac_stab_f8()); + assign_value(model_data->l_04_i_aerocomac_gear_f8, data.l_04_i_aerocomac_gear_f8()); + assign_value(model_data->l_04_i_aerocomac_flap_f8, data.l_04_i_aerocomac_flap_f8()); + assign_value(model_data->l_04_i_aerocomac_slat_f8, data.l_04_i_aerocomac_slat_f8()); + assign_value(model_data->l_04_i_aerocomac_spl_f8, data.l_04_i_aerocomac_spl_f8()); + assign_value(model_data->l_04_i_aerocomac_tnet_f8, data.l_04_i_aerocomac_tnet_f8()); + assign_value(model_data->l_04_i_aerocomac_kice_f8, data.l_04_i_aerocomac_kice_f8()); + assign_value(model_data->l_04_i_aerocomac_alt_agl_f8, data.l_04_i_aerocomac_alt_agl_f8()); } template void setData(T *model_data) @@ -56,33 +56,33 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.l_04_i_aerocomac_alpha_f8(), model_data->l_04_i_aerocomac_alpha_f8); - assign_value_set(out_data.l_04_i_aerocomac_alpdot_f8(), model_data->l_04_i_aerocomac_alpdot_f8); - assign_value_set(out_data.l_04_i_aerocomac_beta_f8(), model_data->l_04_i_aerocomac_beta_f8); - assign_value_set(out_data.l_04_i_aerocomac_press_alt_f8(), model_data->l_04_i_aerocomac_press_alt_f8); - assign_value_set(out_data.l_04_i_aerocomac_tas_f8(), model_data->l_04_i_aerocomac_tas_f8); - assign_value_set(out_data.l_04_i_aerocomac_mach_f8(), model_data->l_04_i_aerocomac_mach_f8); - assign_value_set(out_data.l_04_i_aerocomac_nx_f8(), model_data->l_04_i_aerocomac_nx_f8); - assign_value_set(out_data.l_04_i_aerocomac_ny_f8(), model_data->l_04_i_aerocomac_ny_f8); - assign_value_set(out_data.l_04_i_aerocomac_nz_f8(), model_data->l_04_i_aerocomac_nz_f8); - assign_value_set(out_data.l_04_i_aerocomac_p_f8(), model_data->l_04_i_aerocomac_p_f8); - assign_value_set(out_data.l_04_i_aerocomac_q_f8(), model_data->l_04_i_aerocomac_q_f8); - assign_value_set(out_data.l_04_i_aerocomac_r_f8(), model_data->l_04_i_aerocomac_r_f8); - assign_value_set(out_data.l_04_i_aerocomac_qbar_f8(), model_data->l_04_i_aerocomac_qbar_f8); - assign_value_set(out_data.l_04_i_aerocomac_blcg_f8(), model_data->l_04_i_aerocomac_blcg_f8); - assign_value_set(out_data.l_04_i_aerocomac_bscg_f8(), model_data->l_04_i_aerocomac_bscg_f8); - assign_value_set(out_data.l_04_i_aerocomac_wlcg_f8(), model_data->l_04_i_aerocomac_wlcg_f8); - assign_value_set(out_data.l_04_i_aerocomac_ail_f8(), model_data->l_04_i_aerocomac_ail_f8); - assign_value_set(out_data.l_04_i_aerocomac_elv_f8(), model_data->l_04_i_aerocomac_elv_f8); - assign_value_set(out_data.l_04_i_aerocomac_rud_f8(), model_data->l_04_i_aerocomac_rud_f8); - assign_value_set(out_data.l_04_i_aerocomac_stab_f8(), model_data->l_04_i_aerocomac_stab_f8); - assign_value_set(out_data.l_04_i_aerocomac_gear_f8(), model_data->l_04_i_aerocomac_gear_f8); - assign_value_set(out_data.l_04_i_aerocomac_flap_f8(), model_data->l_04_i_aerocomac_flap_f8); - assign_value_set(out_data.l_04_i_aerocomac_slat_f8(), model_data->l_04_i_aerocomac_slat_f8); - assign_value_set(out_data.l_04_i_aerocomac_spl_f8(), model_data->l_04_i_aerocomac_spl_f8); - assign_value_set(out_data.l_04_i_aerocomac_tnet_f8(), model_data->l_04_i_aerocomac_tnet_f8); - assign_value_set(out_data.l_04_i_aerocomac_kice_f8(), model_data->l_04_i_aerocomac_kice_f8); - assign_value_set(out_data.l_04_i_aerocomac_alt_agl_f8(), model_data->l_04_i_aerocomac_alt_agl_f8); + assign_value(out_data.l_04_i_aerocomac_alpha_f8(), model_data->l_04_i_aerocomac_alpha_f8); + assign_value(out_data.l_04_i_aerocomac_alpdot_f8(), model_data->l_04_i_aerocomac_alpdot_f8); + assign_value(out_data.l_04_i_aerocomac_beta_f8(), model_data->l_04_i_aerocomac_beta_f8); + assign_value(out_data.l_04_i_aerocomac_press_alt_f8(), model_data->l_04_i_aerocomac_press_alt_f8); + assign_value(out_data.l_04_i_aerocomac_tas_f8(), model_data->l_04_i_aerocomac_tas_f8); + assign_value(out_data.l_04_i_aerocomac_mach_f8(), model_data->l_04_i_aerocomac_mach_f8); + assign_value(out_data.l_04_i_aerocomac_nx_f8(), model_data->l_04_i_aerocomac_nx_f8); + assign_value(out_data.l_04_i_aerocomac_ny_f8(), model_data->l_04_i_aerocomac_ny_f8); + assign_value(out_data.l_04_i_aerocomac_nz_f8(), model_data->l_04_i_aerocomac_nz_f8); + assign_value(out_data.l_04_i_aerocomac_p_f8(), model_data->l_04_i_aerocomac_p_f8); + assign_value(out_data.l_04_i_aerocomac_q_f8(), model_data->l_04_i_aerocomac_q_f8); + assign_value(out_data.l_04_i_aerocomac_r_f8(), model_data->l_04_i_aerocomac_r_f8); + assign_value(out_data.l_04_i_aerocomac_qbar_f8(), model_data->l_04_i_aerocomac_qbar_f8); + assign_value(out_data.l_04_i_aerocomac_blcg_f8(), model_data->l_04_i_aerocomac_blcg_f8); + assign_value(out_data.l_04_i_aerocomac_bscg_f8(), model_data->l_04_i_aerocomac_bscg_f8); + assign_value(out_data.l_04_i_aerocomac_wlcg_f8(), model_data->l_04_i_aerocomac_wlcg_f8); + assign_value(out_data.l_04_i_aerocomac_ail_f8(), model_data->l_04_i_aerocomac_ail_f8); + assign_value(out_data.l_04_i_aerocomac_elv_f8(), model_data->l_04_i_aerocomac_elv_f8); + assign_value(out_data.l_04_i_aerocomac_rud_f8(), model_data->l_04_i_aerocomac_rud_f8); + assign_value(out_data.l_04_i_aerocomac_stab_f8(), model_data->l_04_i_aerocomac_stab_f8); + assign_value(out_data.l_04_i_aerocomac_gear_f8(), model_data->l_04_i_aerocomac_gear_f8); + assign_value(out_data.l_04_i_aerocomac_flap_f8(), model_data->l_04_i_aerocomac_flap_f8); + assign_value(out_data.l_04_i_aerocomac_slat_f8(), model_data->l_04_i_aerocomac_slat_f8); + assign_value(out_data.l_04_i_aerocomac_spl_f8(), model_data->l_04_i_aerocomac_spl_f8); + assign_value(out_data.l_04_i_aerocomac_tnet_f8(), model_data->l_04_i_aerocomac_tnet_f8); + assign_value(out_data.l_04_i_aerocomac_kice_f8(), model_data->l_04_i_aerocomac_kice_f8); + assign_value(out_data.l_04_i_aerocomac_alt_agl_f8(), model_data->l_04_i_aerocomac_alt_agl_f8); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_output.hpp b/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_output.hpp index e913724..8016eb3 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_output.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/Aerodynamics_output.hpp @@ -21,19 +21,19 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.l_04_o_aerocomac_fxb_f8(), model_data->l_04_o_aerocomac_fxb_f8); - assign_value_get(data.l_04_o_aerocomac_fyb_f8(), model_data->l_04_o_aerocomac_fyb_f8); - assign_value_get(data.l_04_o_aerocomac_fzb_f8(), model_data->l_04_o_aerocomac_fzb_f8); - assign_value_get(data.l_04_o_aerocomac_mxb_f8(), model_data->l_04_o_aerocomac_mxb_f8); - assign_value_get(data.l_04_o_aerocomac_myb_f8(), model_data->l_04_o_aerocomac_myb_f8); - assign_value_get(data.l_04_o_aerocomac_mzb_f8(), model_data->l_04_o_aerocomac_mzb_f8); - assign_value_get(data.l_04_o_aerocomac_cls_f8(), model_data->l_04_o_aerocomac_cls_f8); - assign_value_get(data.l_04_o_aerocomac_cl_f8(), model_data->l_04_o_aerocomac_cl_f8); - assign_value_get(data.l_04_o_aerocomac_cd_f8(), model_data->l_04_o_aerocomac_cd_f8); - assign_value_get(data.l_04_o_aerocomac_cm_f8(), model_data->l_04_o_aerocomac_cm_f8); - assign_value_get(data.l_04_o_aerocomac_cr_f8(), model_data->l_04_o_aerocomac_cr_f8); - assign_value_get(data.l_04_o_aerocomac_cy_f8(), model_data->l_04_o_aerocomac_cy_f8); - assign_value_get(data.l_04_o_aerocomac_cn_f8(), model_data->l_04_o_aerocomac_cn_f8); + assign_value(model_data->l_04_o_aerocomac_fxb_f8, data.l_04_o_aerocomac_fxb_f8()); + assign_value(model_data->l_04_o_aerocomac_fyb_f8, data.l_04_o_aerocomac_fyb_f8()); + assign_value(model_data->l_04_o_aerocomac_fzb_f8, data.l_04_o_aerocomac_fzb_f8()); + assign_value(model_data->l_04_o_aerocomac_mxb_f8, data.l_04_o_aerocomac_mxb_f8()); + assign_value(model_data->l_04_o_aerocomac_myb_f8, data.l_04_o_aerocomac_myb_f8()); + assign_value(model_data->l_04_o_aerocomac_mzb_f8, data.l_04_o_aerocomac_mzb_f8()); + assign_value(model_data->l_04_o_aerocomac_cls_f8, data.l_04_o_aerocomac_cls_f8()); + assign_value(model_data->l_04_o_aerocomac_cl_f8, data.l_04_o_aerocomac_cl_f8()); + assign_value(model_data->l_04_o_aerocomac_cd_f8, data.l_04_o_aerocomac_cd_f8()); + assign_value(model_data->l_04_o_aerocomac_cm_f8, data.l_04_o_aerocomac_cm_f8()); + assign_value(model_data->l_04_o_aerocomac_cr_f8, data.l_04_o_aerocomac_cr_f8()); + assign_value(model_data->l_04_o_aerocomac_cy_f8, data.l_04_o_aerocomac_cy_f8()); + assign_value(model_data->l_04_o_aerocomac_cn_f8, data.l_04_o_aerocomac_cn_f8()); } template void setData(T *model_data) @@ -42,19 +42,19 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.l_04_o_aerocomac_fxb_f8(), model_data->l_04_o_aerocomac_fxb_f8); - assign_value_set(out_data.l_04_o_aerocomac_fyb_f8(), model_data->l_04_o_aerocomac_fyb_f8); - assign_value_set(out_data.l_04_o_aerocomac_fzb_f8(), model_data->l_04_o_aerocomac_fzb_f8); - assign_value_set(out_data.l_04_o_aerocomac_mxb_f8(), model_data->l_04_o_aerocomac_mxb_f8); - assign_value_set(out_data.l_04_o_aerocomac_myb_f8(), model_data->l_04_o_aerocomac_myb_f8); - assign_value_set(out_data.l_04_o_aerocomac_mzb_f8(), model_data->l_04_o_aerocomac_mzb_f8); - assign_value_set(out_data.l_04_o_aerocomac_cls_f8(), model_data->l_04_o_aerocomac_cls_f8); - assign_value_set(out_data.l_04_o_aerocomac_cl_f8(), model_data->l_04_o_aerocomac_cl_f8); - assign_value_set(out_data.l_04_o_aerocomac_cd_f8(), model_data->l_04_o_aerocomac_cd_f8); - assign_value_set(out_data.l_04_o_aerocomac_cm_f8(), model_data->l_04_o_aerocomac_cm_f8); - assign_value_set(out_data.l_04_o_aerocomac_cr_f8(), model_data->l_04_o_aerocomac_cr_f8); - assign_value_set(out_data.l_04_o_aerocomac_cy_f8(), model_data->l_04_o_aerocomac_cy_f8); - assign_value_set(out_data.l_04_o_aerocomac_cn_f8(), model_data->l_04_o_aerocomac_cn_f8); + assign_value(out_data.l_04_o_aerocomac_fxb_f8(), model_data->l_04_o_aerocomac_fxb_f8); + assign_value(out_data.l_04_o_aerocomac_fyb_f8(), model_data->l_04_o_aerocomac_fyb_f8); + assign_value(out_data.l_04_o_aerocomac_fzb_f8(), model_data->l_04_o_aerocomac_fzb_f8); + assign_value(out_data.l_04_o_aerocomac_mxb_f8(), model_data->l_04_o_aerocomac_mxb_f8); + assign_value(out_data.l_04_o_aerocomac_myb_f8(), model_data->l_04_o_aerocomac_myb_f8); + assign_value(out_data.l_04_o_aerocomac_mzb_f8(), model_data->l_04_o_aerocomac_mzb_f8); + assign_value(out_data.l_04_o_aerocomac_cls_f8(), model_data->l_04_o_aerocomac_cls_f8); + assign_value(out_data.l_04_o_aerocomac_cl_f8(), model_data->l_04_o_aerocomac_cl_f8); + assign_value(out_data.l_04_o_aerocomac_cd_f8(), model_data->l_04_o_aerocomac_cd_f8); + assign_value(out_data.l_04_o_aerocomac_cm_f8(), model_data->l_04_o_aerocomac_cm_f8); + assign_value(out_data.l_04_o_aerocomac_cr_f8(), model_data->l_04_o_aerocomac_cr_f8); + assign_value(out_data.l_04_o_aerocomac_cy_f8(), model_data->l_04_o_aerocomac_cy_f8); + assign_value(out_data.l_04_o_aerocomac_cn_f8(), model_data->l_04_o_aerocomac_cn_f8); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_heartbeat.hpp b/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_heartbeat.hpp index 0b72ca2..bc7b577 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_heartbeat.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_heartbeat.hpp @@ -21,7 +21,7 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.groundhandling_model_heartbeat(), model_data->groundhandling_model_heartbeat); + assign_value(model_data->groundhandling_model_heartbeat, data.groundhandling_model_heartbeat()); } template void setData(T *model_data) @@ -30,7 +30,7 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.groundhandling_model_heartbeat(), model_data->groundhandling_model_heartbeat); + assign_value(out_data.groundhandling_model_heartbeat(), model_data->groundhandling_model_heartbeat); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_input.hpp b/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_input.hpp index 13a19ec..2bd5c17 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_input.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_input.hpp @@ -21,45 +21,45 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.l_04_i_gdcomac_frz_l1(), model_data->l_04_i_gdcomac_frz_l1); - assign_value_get(data.l_04_i_gdcomac_chocks_l1(), model_data->l_04_i_gdcomac_chocks_l1); - assign_value_get(data.l_04_i_gdcomac_alt_agl_f8(), model_data->l_04_i_gdcomac_alt_agl_f8); - assign_value_get(data.l_04_i_gdcomac_frzflt_l1(), model_data->l_04_i_gdcomac_frzflt_l1); - assign_value_get(data.l_04_i_gdcomac_p_f8(), model_data->l_04_i_gdcomac_p_f8); - assign_value_get(data.l_04_i_gdcomac_q_f8(), model_data->l_04_i_gdcomac_q_f8); - assign_value_get(data.l_04_i_gdcomac_r_f8(), model_data->l_04_i_gdcomac_r_f8); - assign_value_get(data.l_04_i_gdcomac_ug_f8(), model_data->l_04_i_gdcomac_ug_f8); - assign_value_get(data.l_04_i_gdcomac_vg_f8(), model_data->l_04_i_gdcomac_vg_f8); - assign_value_get(data.l_04_i_gdcomac_wg_f8(), model_data->l_04_i_gdcomac_wg_f8); - assign_value_get(data.l_04_i_gdcomac_blcg_f8(), model_data->l_04_i_gdcomac_blcg_f8); - assign_value_get(data.l_04_i_gdcomac_bscg_f8(), model_data->l_04_i_gdcomac_bscg_f8); - assign_value_get(data.l_04_i_gdcomac_wlcg_f8(), model_data->l_04_i_gdcomac_wlcg_f8); - assign_value_get(data.l_04_i_gdcomac_pb_active_l1(), model_data->l_04_i_gdcomac_pb_active_l1); - assign_value_get(data.l_04_i_gdcomac_brake_torq_f8(), model_data->l_04_i_gdcomac_brake_torq_f8); - assign_value_get(data.l_04_i_gdcomac_gear_f8(), model_data->l_04_i_gdcomac_gear_f8); - assign_value_get(data.l_04_i_gdcomac_gsteer_f8(), model_data->l_04_i_gdcomac_gsteer_f8); - assign_value_get(data.l_04_i_gdcomac_tire_pres_f8(), model_data->l_04_i_gdcomac_tire_pres_f8); - assign_value_get(data.l_04_i_gdcomac_onjax_l1(), model_data->l_04_i_gdcomac_onjax_l1); - assign_value_get(data.l_04_i_gdcomac_contdep_f8(), model_data->l_04_i_gdcomac_contdep_f8); - assign_value_get(data.l_04_i_gdcomac_thetag_f8(), model_data->l_04_i_gdcomac_thetag_f8); - assign_value_get(data.l_04_i_gdcomac_phig_f8(), model_data->l_04_i_gdcomac_phig_f8); - assign_value_get(data.l_04_i_gdcomac_rwyrgh_i2(), model_data->l_04_i_gdcomac_rwyrgh_i2); - assign_value_get(data.l_04_i_gdcomac_rwyhdg_f8(), model_data->l_04_i_gdcomac_rwyhdg_f8); - assign_value_get(data.l_04_i_gdcomac_reset_braketemp_l1(), model_data->l_04_i_gdcomac_reset_braketemp_l1); - assign_value_get(data.l_04_i_gdcomac_reset_tirepress_l1(), model_data->l_04_i_gdcomac_reset_tirepress_l1); - assign_value_get(data.l_04_i_gdcomac_temp_c_f8(), model_data->l_04_i_gdcomac_temp_c_f8); - assign_value_get(data.l_04_i_gdcomac_brake_temp_f8(), model_data->l_04_i_gdcomac_brake_temp_f8); - assign_value_get(data.l_04_i_gdcomac_tire_tburst_l1(), model_data->l_04_i_gdcomac_tire_tburst_l1); - assign_value_get(data.l_04_i_gdcomac_tire_tflat_l1(), model_data->l_04_i_gdcomac_tire_tflat_l1); - assign_value_get(data.l_04_i_gdcomac_brk_reset_tpres_l1(), model_data->l_04_i_gdcomac_brk_reset_tpres_l1); - assign_value_get(data.l_04_i_gdcomac_rcon_ci_f8(), model_data->l_04_i_gdcomac_rcon_ci_f8); - assign_value_get(data.l_04_i_gdcomac_pb_towforce_f8(), model_data->l_04_i_gdcomac_pb_towforce_f8); - assign_value_get(data.l_04_i_gdcomac_gsteer_state_i4(), model_data->l_04_i_gdcomac_gsteer_state_i4); - assign_value_get(data.l_04_i_gdcomac_trim_active_l1(), model_data->l_04_i_gdcomac_trim_active_l1); - assign_value_get(data.l_04_i_gdcomac_phi_deg_f8(), model_data->l_04_i_gdcomac_phi_deg_f8); - assign_value_get(data.l_04_i_gdcomac_theta_deg_f8(), model_data->l_04_i_gdcomac_theta_deg_f8); - assign_value_get(data.l_04_i_gdcomac_psi_deg_f8(), model_data->l_04_i_gdcomac_psi_deg_f8); - assign_value_get(data.l_04_i_gdcomac_resetint_l1(), model_data->l_04_i_gdcomac_resetint_l1); + assign_value(model_data->l_04_i_gdcomac_frz_l1, data.l_04_i_gdcomac_frz_l1()); + assign_value(model_data->l_04_i_gdcomac_chocks_l1, data.l_04_i_gdcomac_chocks_l1()); + assign_value(model_data->l_04_i_gdcomac_alt_agl_f8, data.l_04_i_gdcomac_alt_agl_f8()); + assign_value(model_data->l_04_i_gdcomac_frzflt_l1, data.l_04_i_gdcomac_frzflt_l1()); + assign_value(model_data->l_04_i_gdcomac_p_f8, data.l_04_i_gdcomac_p_f8()); + assign_value(model_data->l_04_i_gdcomac_q_f8, data.l_04_i_gdcomac_q_f8()); + assign_value(model_data->l_04_i_gdcomac_r_f8, data.l_04_i_gdcomac_r_f8()); + assign_value(model_data->l_04_i_gdcomac_ug_f8, data.l_04_i_gdcomac_ug_f8()); + assign_value(model_data->l_04_i_gdcomac_vg_f8, data.l_04_i_gdcomac_vg_f8()); + assign_value(model_data->l_04_i_gdcomac_wg_f8, data.l_04_i_gdcomac_wg_f8()); + assign_value(model_data->l_04_i_gdcomac_blcg_f8, data.l_04_i_gdcomac_blcg_f8()); + assign_value(model_data->l_04_i_gdcomac_bscg_f8, data.l_04_i_gdcomac_bscg_f8()); + assign_value(model_data->l_04_i_gdcomac_wlcg_f8, data.l_04_i_gdcomac_wlcg_f8()); + assign_value(model_data->l_04_i_gdcomac_pb_active_l1, data.l_04_i_gdcomac_pb_active_l1()); + assign_value(model_data->l_04_i_gdcomac_brake_torq_f8, data.l_04_i_gdcomac_brake_torq_f8()); + assign_value(model_data->l_04_i_gdcomac_gear_f8, data.l_04_i_gdcomac_gear_f8()); + assign_value(model_data->l_04_i_gdcomac_gsteer_f8, data.l_04_i_gdcomac_gsteer_f8()); + assign_value(model_data->l_04_i_gdcomac_tire_pres_f8, data.l_04_i_gdcomac_tire_pres_f8()); + assign_value(model_data->l_04_i_gdcomac_onjax_l1, data.l_04_i_gdcomac_onjax_l1()); + assign_value(model_data->l_04_i_gdcomac_contdep_f8, data.l_04_i_gdcomac_contdep_f8()); + assign_value(model_data->l_04_i_gdcomac_thetag_f8, data.l_04_i_gdcomac_thetag_f8()); + assign_value(model_data->l_04_i_gdcomac_phig_f8, data.l_04_i_gdcomac_phig_f8()); + assign_value(model_data->l_04_i_gdcomac_rwyrgh_i2, data.l_04_i_gdcomac_rwyrgh_i2()); + assign_value(model_data->l_04_i_gdcomac_rwyhdg_f8, data.l_04_i_gdcomac_rwyhdg_f8()); + assign_value(model_data->l_04_i_gdcomac_reset_braketemp_l1, data.l_04_i_gdcomac_reset_braketemp_l1()); + assign_value(model_data->l_04_i_gdcomac_reset_tirepress_l1, data.l_04_i_gdcomac_reset_tirepress_l1()); + assign_value(model_data->l_04_i_gdcomac_temp_c_f8, data.l_04_i_gdcomac_temp_c_f8()); + assign_value(model_data->l_04_i_gdcomac_brake_temp_f8, data.l_04_i_gdcomac_brake_temp_f8()); + assign_value(model_data->l_04_i_gdcomac_tire_tburst_l1, data.l_04_i_gdcomac_tire_tburst_l1()); + assign_value(model_data->l_04_i_gdcomac_tire_tflat_l1, data.l_04_i_gdcomac_tire_tflat_l1()); + assign_value(model_data->l_04_i_gdcomac_brk_reset_tpres_l1, data.l_04_i_gdcomac_brk_reset_tpres_l1()); + assign_value(model_data->l_04_i_gdcomac_rcon_ci_f8, data.l_04_i_gdcomac_rcon_ci_f8()); + assign_value(model_data->l_04_i_gdcomac_pb_towforce_f8, data.l_04_i_gdcomac_pb_towforce_f8()); + assign_value(model_data->l_04_i_gdcomac_gsteer_state_i4, data.l_04_i_gdcomac_gsteer_state_i4()); + assign_value(model_data->l_04_i_gdcomac_trim_active_l1, data.l_04_i_gdcomac_trim_active_l1()); + assign_value(model_data->l_04_i_gdcomac_phi_deg_f8, data.l_04_i_gdcomac_phi_deg_f8()); + assign_value(model_data->l_04_i_gdcomac_theta_deg_f8, data.l_04_i_gdcomac_theta_deg_f8()); + assign_value(model_data->l_04_i_gdcomac_psi_deg_f8, data.l_04_i_gdcomac_psi_deg_f8()); + assign_value(model_data->l_04_i_gdcomac_resetint_l1, data.l_04_i_gdcomac_resetint_l1()); } template void setData(T *model_data) @@ -68,45 +68,45 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.l_04_i_gdcomac_frz_l1(), model_data->l_04_i_gdcomac_frz_l1); - assign_value_set(out_data.l_04_i_gdcomac_chocks_l1(), model_data->l_04_i_gdcomac_chocks_l1); - assign_value_set(out_data.l_04_i_gdcomac_alt_agl_f8(), model_data->l_04_i_gdcomac_alt_agl_f8); - assign_value_set(out_data.l_04_i_gdcomac_frzflt_l1(), model_data->l_04_i_gdcomac_frzflt_l1); - assign_value_set(out_data.l_04_i_gdcomac_p_f8(), model_data->l_04_i_gdcomac_p_f8); - assign_value_set(out_data.l_04_i_gdcomac_q_f8(), model_data->l_04_i_gdcomac_q_f8); - assign_value_set(out_data.l_04_i_gdcomac_r_f8(), model_data->l_04_i_gdcomac_r_f8); - assign_value_set(out_data.l_04_i_gdcomac_ug_f8(), model_data->l_04_i_gdcomac_ug_f8); - assign_value_set(out_data.l_04_i_gdcomac_vg_f8(), model_data->l_04_i_gdcomac_vg_f8); - assign_value_set(out_data.l_04_i_gdcomac_wg_f8(), model_data->l_04_i_gdcomac_wg_f8); - assign_value_set(out_data.l_04_i_gdcomac_blcg_f8(), model_data->l_04_i_gdcomac_blcg_f8); - assign_value_set(out_data.l_04_i_gdcomac_bscg_f8(), model_data->l_04_i_gdcomac_bscg_f8); - assign_value_set(out_data.l_04_i_gdcomac_wlcg_f8(), model_data->l_04_i_gdcomac_wlcg_f8); - assign_value_set(out_data.l_04_i_gdcomac_pb_active_l1(), model_data->l_04_i_gdcomac_pb_active_l1); - assign_value_set(out_data.l_04_i_gdcomac_brake_torq_f8(), model_data->l_04_i_gdcomac_brake_torq_f8); - assign_value_set(out_data.l_04_i_gdcomac_gear_f8(), model_data->l_04_i_gdcomac_gear_f8); - assign_value_set(out_data.l_04_i_gdcomac_gsteer_f8(), model_data->l_04_i_gdcomac_gsteer_f8); - assign_value_set(out_data.l_04_i_gdcomac_tire_pres_f8(), model_data->l_04_i_gdcomac_tire_pres_f8); - assign_value_set(out_data.l_04_i_gdcomac_onjax_l1(), model_data->l_04_i_gdcomac_onjax_l1); - assign_value_set(out_data.l_04_i_gdcomac_contdep_f8(), model_data->l_04_i_gdcomac_contdep_f8); - assign_value_set(out_data.l_04_i_gdcomac_thetag_f8(), model_data->l_04_i_gdcomac_thetag_f8); - assign_value_set(out_data.l_04_i_gdcomac_phig_f8(), model_data->l_04_i_gdcomac_phig_f8); - assign_value_set(out_data.l_04_i_gdcomac_rwyrgh_i2(), model_data->l_04_i_gdcomac_rwyrgh_i2); - assign_value_set(out_data.l_04_i_gdcomac_rwyhdg_f8(), model_data->l_04_i_gdcomac_rwyhdg_f8); - assign_value_set(out_data.l_04_i_gdcomac_reset_braketemp_l1(), model_data->l_04_i_gdcomac_reset_braketemp_l1); - assign_value_set(out_data.l_04_i_gdcomac_reset_tirepress_l1(), model_data->l_04_i_gdcomac_reset_tirepress_l1); - assign_value_set(out_data.l_04_i_gdcomac_temp_c_f8(), model_data->l_04_i_gdcomac_temp_c_f8); - assign_value_set(out_data.l_04_i_gdcomac_brake_temp_f8(), model_data->l_04_i_gdcomac_brake_temp_f8); - assign_value_set(out_data.l_04_i_gdcomac_tire_tburst_l1(), model_data->l_04_i_gdcomac_tire_tburst_l1); - assign_value_set(out_data.l_04_i_gdcomac_tire_tflat_l1(), model_data->l_04_i_gdcomac_tire_tflat_l1); - assign_value_set(out_data.l_04_i_gdcomac_brk_reset_tpres_l1(), model_data->l_04_i_gdcomac_brk_reset_tpres_l1); - assign_value_set(out_data.l_04_i_gdcomac_rcon_ci_f8(), model_data->l_04_i_gdcomac_rcon_ci_f8); - assign_value_set(out_data.l_04_i_gdcomac_pb_towforce_f8(), model_data->l_04_i_gdcomac_pb_towforce_f8); - assign_value_set(out_data.l_04_i_gdcomac_gsteer_state_i4(), model_data->l_04_i_gdcomac_gsteer_state_i4); - assign_value_set(out_data.l_04_i_gdcomac_trim_active_l1(), model_data->l_04_i_gdcomac_trim_active_l1); - assign_value_set(out_data.l_04_i_gdcomac_phi_deg_f8(), model_data->l_04_i_gdcomac_phi_deg_f8); - assign_value_set(out_data.l_04_i_gdcomac_theta_deg_f8(), model_data->l_04_i_gdcomac_theta_deg_f8); - assign_value_set(out_data.l_04_i_gdcomac_psi_deg_f8(), model_data->l_04_i_gdcomac_psi_deg_f8); - assign_value_set(out_data.l_04_i_gdcomac_resetint_l1(), model_data->l_04_i_gdcomac_resetint_l1); + assign_value(out_data.l_04_i_gdcomac_frz_l1(), model_data->l_04_i_gdcomac_frz_l1); + assign_value(out_data.l_04_i_gdcomac_chocks_l1(), model_data->l_04_i_gdcomac_chocks_l1); + assign_value(out_data.l_04_i_gdcomac_alt_agl_f8(), model_data->l_04_i_gdcomac_alt_agl_f8); + assign_value(out_data.l_04_i_gdcomac_frzflt_l1(), model_data->l_04_i_gdcomac_frzflt_l1); + assign_value(out_data.l_04_i_gdcomac_p_f8(), model_data->l_04_i_gdcomac_p_f8); + assign_value(out_data.l_04_i_gdcomac_q_f8(), model_data->l_04_i_gdcomac_q_f8); + assign_value(out_data.l_04_i_gdcomac_r_f8(), model_data->l_04_i_gdcomac_r_f8); + assign_value(out_data.l_04_i_gdcomac_ug_f8(), model_data->l_04_i_gdcomac_ug_f8); + assign_value(out_data.l_04_i_gdcomac_vg_f8(), model_data->l_04_i_gdcomac_vg_f8); + assign_value(out_data.l_04_i_gdcomac_wg_f8(), model_data->l_04_i_gdcomac_wg_f8); + assign_value(out_data.l_04_i_gdcomac_blcg_f8(), model_data->l_04_i_gdcomac_blcg_f8); + assign_value(out_data.l_04_i_gdcomac_bscg_f8(), model_data->l_04_i_gdcomac_bscg_f8); + assign_value(out_data.l_04_i_gdcomac_wlcg_f8(), model_data->l_04_i_gdcomac_wlcg_f8); + assign_value(out_data.l_04_i_gdcomac_pb_active_l1(), model_data->l_04_i_gdcomac_pb_active_l1); + assign_value(out_data.l_04_i_gdcomac_brake_torq_f8(), model_data->l_04_i_gdcomac_brake_torq_f8); + assign_value(out_data.l_04_i_gdcomac_gear_f8(), model_data->l_04_i_gdcomac_gear_f8); + assign_value(out_data.l_04_i_gdcomac_gsteer_f8(), model_data->l_04_i_gdcomac_gsteer_f8); + assign_value(out_data.l_04_i_gdcomac_tire_pres_f8(), model_data->l_04_i_gdcomac_tire_pres_f8); + assign_value(out_data.l_04_i_gdcomac_onjax_l1(), model_data->l_04_i_gdcomac_onjax_l1); + assign_value(out_data.l_04_i_gdcomac_contdep_f8(), model_data->l_04_i_gdcomac_contdep_f8); + assign_value(out_data.l_04_i_gdcomac_thetag_f8(), model_data->l_04_i_gdcomac_thetag_f8); + assign_value(out_data.l_04_i_gdcomac_phig_f8(), model_data->l_04_i_gdcomac_phig_f8); + assign_value(out_data.l_04_i_gdcomac_rwyrgh_i2(), model_data->l_04_i_gdcomac_rwyrgh_i2); + assign_value(out_data.l_04_i_gdcomac_rwyhdg_f8(), model_data->l_04_i_gdcomac_rwyhdg_f8); + assign_value(out_data.l_04_i_gdcomac_reset_braketemp_l1(), model_data->l_04_i_gdcomac_reset_braketemp_l1); + assign_value(out_data.l_04_i_gdcomac_reset_tirepress_l1(), model_data->l_04_i_gdcomac_reset_tirepress_l1); + assign_value(out_data.l_04_i_gdcomac_temp_c_f8(), model_data->l_04_i_gdcomac_temp_c_f8); + assign_value(out_data.l_04_i_gdcomac_brake_temp_f8(), model_data->l_04_i_gdcomac_brake_temp_f8); + assign_value(out_data.l_04_i_gdcomac_tire_tburst_l1(), model_data->l_04_i_gdcomac_tire_tburst_l1); + assign_value(out_data.l_04_i_gdcomac_tire_tflat_l1(), model_data->l_04_i_gdcomac_tire_tflat_l1); + assign_value(out_data.l_04_i_gdcomac_brk_reset_tpres_l1(), model_data->l_04_i_gdcomac_brk_reset_tpres_l1); + assign_value(out_data.l_04_i_gdcomac_rcon_ci_f8(), model_data->l_04_i_gdcomac_rcon_ci_f8); + assign_value(out_data.l_04_i_gdcomac_pb_towforce_f8(), model_data->l_04_i_gdcomac_pb_towforce_f8); + assign_value(out_data.l_04_i_gdcomac_gsteer_state_i4(), model_data->l_04_i_gdcomac_gsteer_state_i4); + assign_value(out_data.l_04_i_gdcomac_trim_active_l1(), model_data->l_04_i_gdcomac_trim_active_l1); + assign_value(out_data.l_04_i_gdcomac_phi_deg_f8(), model_data->l_04_i_gdcomac_phi_deg_f8); + assign_value(out_data.l_04_i_gdcomac_theta_deg_f8(), model_data->l_04_i_gdcomac_theta_deg_f8); + assign_value(out_data.l_04_i_gdcomac_psi_deg_f8(), model_data->l_04_i_gdcomac_psi_deg_f8); + assign_value(out_data.l_04_i_gdcomac_resetint_l1(), model_data->l_04_i_gdcomac_resetint_l1); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_output.hpp b/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_output.hpp index 77ec560..74d65a7 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_output.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/GroundHandling_output.hpp @@ -21,40 +21,40 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.l_04_o_gdcomac_frz_l1(), model_data->l_04_o_gdcomac_frz_l1); - assign_value_get(data.l_04_o_gdcomac_ac_on_ground_l1(), model_data->l_04_o_gdcomac_ac_on_ground_l1); - assign_value_get(data.l_04_o_gdcomac_ac_stationary_f8(), model_data->l_04_o_gdcomac_ac_stationary_f8); - assign_value_get(data.l_04_o_gdcomac_alt_tire_f8(), model_data->l_04_o_gdcomac_alt_tire_f8); - assign_value_get(data.l_04_o_gdcomac_zcg_to_tire_f8(), model_data->l_04_o_gdcomac_zcg_to_tire_f8); - assign_value_get(data.l_04_o_gdcomac_fxb_f8(), model_data->l_04_o_gdcomac_fxb_f8); - assign_value_get(data.l_04_o_gdcomac_fyb_f8(), model_data->l_04_o_gdcomac_fyb_f8); - assign_value_get(data.l_04_o_gdcomac_fzb_f8(), model_data->l_04_o_gdcomac_fzb_f8); - assign_value_get(data.l_04_o_gdcomac_mxb_f8(), model_data->l_04_o_gdcomac_mxb_f8); - assign_value_get(data.l_04_o_gdcomac_myb_f8(), model_data->l_04_o_gdcomac_myb_f8); - assign_value_get(data.l_04_o_gdcomac_mzb_f8(), model_data->l_04_o_gdcomac_mzb_f8); - assign_value_get(data.l_04_o_gdcomac_fygs_f8(), model_data->l_04_o_gdcomac_fygs_f8); - assign_value_get(data.l_04_o_gdcomac_mzgs_f8(), model_data->l_04_o_gdcomac_mzgs_f8); - assign_value_get(data.l_04_o_gdcomac_mu_f8(), model_data->l_04_o_gdcomac_mu_f8); - assign_value_get(data.l_04_o_gdcomac_dstroke_f8(), model_data->l_04_o_gdcomac_dstroke_f8); - assign_value_get(data.l_04_o_gdcomac_sr_f8(), model_data->l_04_o_gdcomac_sr_f8); - assign_value_get(data.l_04_o_gdcomac_sy_f8(), model_data->l_04_o_gdcomac_sy_f8); - assign_value_get(data.l_04_o_gdcomac_sx_f8(), model_data->l_04_o_gdcomac_sx_f8); - assign_value_get(data.l_04_o_gdcomac_xft_f8(), model_data->l_04_o_gdcomac_xft_f8); - assign_value_get(data.l_04_o_gdcomac_yft_f8(), model_data->l_04_o_gdcomac_yft_f8); - assign_value_get(data.l_04_o_gdcomac_zft_f8(), model_data->l_04_o_gdcomac_zft_f8); - assign_value_get(data.l_04_o_gdcomac_distngrxcg_f8(), model_data->l_04_o_gdcomac_distngrxcg_f8); - assign_value_get(data.l_04_o_gdcomac_distmgrxcg_f8(), model_data->l_04_o_gdcomac_distmgrxcg_f8); - assign_value_get(data.l_04_o_gdcomac_distmgrzcg_f8(), model_data->l_04_o_gdcomac_distmgrzcg_f8); - assign_value_get(data.l_04_o_gdcomac_tire_vel_f8(), model_data->l_04_o_gdcomac_tire_vel_f8); - assign_value_get(data.l_04_o_gdcomac_tire_burst_l1(), model_data->l_04_o_gdcomac_tire_burst_l1); - assign_value_get(data.l_04_o_gdcomac_tire_temp_f8(), model_data->l_04_o_gdcomac_tire_temp_f8); - assign_value_get(data.l_04_o_gdcomac_wow_l1(), model_data->l_04_o_gdcomac_wow_l1); - assign_value_get(data.l_04_o_gdcomac_utirew_f8(), model_data->l_04_o_gdcomac_utirew_f8); - assign_value_get(data.l_04_o_gdcomac_vtirew_f8(), model_data->l_04_o_gdcomac_vtirew_f8); - assign_value_get(data.l_04_o_gdcomac_whl_omega_f8(), model_data->l_04_o_gdcomac_whl_omega_f8); - assign_value_get(data.l_04_o_gdcomac_dstruc_f8(), model_data->l_04_o_gdcomac_dstruc_f8); - assign_value_get(data.l_04_o_gdcomac_wor_par_f8(), model_data->l_04_o_gdcomac_wor_par_f8); - assign_value_get(data.l_04_o_gdcomac_nd_f8(), model_data->l_04_o_gdcomac_nd_f8); + assign_value(model_data->l_04_o_gdcomac_frz_l1, data.l_04_o_gdcomac_frz_l1()); + assign_value(model_data->l_04_o_gdcomac_ac_on_ground_l1, data.l_04_o_gdcomac_ac_on_ground_l1()); + assign_value(model_data->l_04_o_gdcomac_ac_stationary_f8, data.l_04_o_gdcomac_ac_stationary_f8()); + assign_value(model_data->l_04_o_gdcomac_alt_tire_f8, data.l_04_o_gdcomac_alt_tire_f8()); + assign_value(model_data->l_04_o_gdcomac_zcg_to_tire_f8, data.l_04_o_gdcomac_zcg_to_tire_f8()); + assign_value(model_data->l_04_o_gdcomac_fxb_f8, data.l_04_o_gdcomac_fxb_f8()); + assign_value(model_data->l_04_o_gdcomac_fyb_f8, data.l_04_o_gdcomac_fyb_f8()); + assign_value(model_data->l_04_o_gdcomac_fzb_f8, data.l_04_o_gdcomac_fzb_f8()); + assign_value(model_data->l_04_o_gdcomac_mxb_f8, data.l_04_o_gdcomac_mxb_f8()); + assign_value(model_data->l_04_o_gdcomac_myb_f8, data.l_04_o_gdcomac_myb_f8()); + assign_value(model_data->l_04_o_gdcomac_mzb_f8, data.l_04_o_gdcomac_mzb_f8()); + assign_value(model_data->l_04_o_gdcomac_fygs_f8, data.l_04_o_gdcomac_fygs_f8()); + assign_value(model_data->l_04_o_gdcomac_mzgs_f8, data.l_04_o_gdcomac_mzgs_f8()); + assign_value(model_data->l_04_o_gdcomac_mu_f8, data.l_04_o_gdcomac_mu_f8()); + assign_value(model_data->l_04_o_gdcomac_dstroke_f8, data.l_04_o_gdcomac_dstroke_f8()); + assign_value(model_data->l_04_o_gdcomac_sr_f8, data.l_04_o_gdcomac_sr_f8()); + assign_value(model_data->l_04_o_gdcomac_sy_f8, data.l_04_o_gdcomac_sy_f8()); + assign_value(model_data->l_04_o_gdcomac_sx_f8, data.l_04_o_gdcomac_sx_f8()); + assign_value(model_data->l_04_o_gdcomac_xft_f8, data.l_04_o_gdcomac_xft_f8()); + assign_value(model_data->l_04_o_gdcomac_yft_f8, data.l_04_o_gdcomac_yft_f8()); + assign_value(model_data->l_04_o_gdcomac_zft_f8, data.l_04_o_gdcomac_zft_f8()); + assign_value(model_data->l_04_o_gdcomac_distngrxcg_f8, data.l_04_o_gdcomac_distngrxcg_f8()); + assign_value(model_data->l_04_o_gdcomac_distmgrxcg_f8, data.l_04_o_gdcomac_distmgrxcg_f8()); + assign_value(model_data->l_04_o_gdcomac_distmgrzcg_f8, data.l_04_o_gdcomac_distmgrzcg_f8()); + assign_value(model_data->l_04_o_gdcomac_tire_vel_f8, data.l_04_o_gdcomac_tire_vel_f8()); + assign_value(model_data->l_04_o_gdcomac_tire_burst_l1, data.l_04_o_gdcomac_tire_burst_l1()); + assign_value(model_data->l_04_o_gdcomac_tire_temp_f8, data.l_04_o_gdcomac_tire_temp_f8()); + assign_value(model_data->l_04_o_gdcomac_wow_l1, data.l_04_o_gdcomac_wow_l1()); + assign_value(model_data->l_04_o_gdcomac_utirew_f8, data.l_04_o_gdcomac_utirew_f8()); + assign_value(model_data->l_04_o_gdcomac_vtirew_f8, data.l_04_o_gdcomac_vtirew_f8()); + assign_value(model_data->l_04_o_gdcomac_whl_omega_f8, data.l_04_o_gdcomac_whl_omega_f8()); + assign_value(model_data->l_04_o_gdcomac_dstruc_f8, data.l_04_o_gdcomac_dstruc_f8()); + assign_value(model_data->l_04_o_gdcomac_wor_par_f8, data.l_04_o_gdcomac_wor_par_f8()); + assign_value(model_data->l_04_o_gdcomac_nd_f8, data.l_04_o_gdcomac_nd_f8()); } template void setData(T *model_data) @@ -63,40 +63,40 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.l_04_o_gdcomac_frz_l1(), model_data->l_04_o_gdcomac_frz_l1); - assign_value_set(out_data.l_04_o_gdcomac_ac_on_ground_l1(), model_data->l_04_o_gdcomac_ac_on_ground_l1); - assign_value_set(out_data.l_04_o_gdcomac_ac_stationary_f8(), model_data->l_04_o_gdcomac_ac_stationary_f8); - assign_value_set(out_data.l_04_o_gdcomac_alt_tire_f8(), model_data->l_04_o_gdcomac_alt_tire_f8); - assign_value_set(out_data.l_04_o_gdcomac_zcg_to_tire_f8(), model_data->l_04_o_gdcomac_zcg_to_tire_f8); - assign_value_set(out_data.l_04_o_gdcomac_fxb_f8(), model_data->l_04_o_gdcomac_fxb_f8); - assign_value_set(out_data.l_04_o_gdcomac_fyb_f8(), model_data->l_04_o_gdcomac_fyb_f8); - assign_value_set(out_data.l_04_o_gdcomac_fzb_f8(), model_data->l_04_o_gdcomac_fzb_f8); - assign_value_set(out_data.l_04_o_gdcomac_mxb_f8(), model_data->l_04_o_gdcomac_mxb_f8); - assign_value_set(out_data.l_04_o_gdcomac_myb_f8(), model_data->l_04_o_gdcomac_myb_f8); - assign_value_set(out_data.l_04_o_gdcomac_mzb_f8(), model_data->l_04_o_gdcomac_mzb_f8); - assign_value_set(out_data.l_04_o_gdcomac_fygs_f8(), model_data->l_04_o_gdcomac_fygs_f8); - assign_value_set(out_data.l_04_o_gdcomac_mzgs_f8(), model_data->l_04_o_gdcomac_mzgs_f8); - assign_value_set(out_data.l_04_o_gdcomac_mu_f8(), model_data->l_04_o_gdcomac_mu_f8); - assign_value_set(out_data.l_04_o_gdcomac_dstroke_f8(), model_data->l_04_o_gdcomac_dstroke_f8); - assign_value_set(out_data.l_04_o_gdcomac_sr_f8(), model_data->l_04_o_gdcomac_sr_f8); - assign_value_set(out_data.l_04_o_gdcomac_sy_f8(), model_data->l_04_o_gdcomac_sy_f8); - assign_value_set(out_data.l_04_o_gdcomac_sx_f8(), model_data->l_04_o_gdcomac_sx_f8); - assign_value_set(out_data.l_04_o_gdcomac_xft_f8(), model_data->l_04_o_gdcomac_xft_f8); - assign_value_set(out_data.l_04_o_gdcomac_yft_f8(), model_data->l_04_o_gdcomac_yft_f8); - assign_value_set(out_data.l_04_o_gdcomac_zft_f8(), model_data->l_04_o_gdcomac_zft_f8); - assign_value_set(out_data.l_04_o_gdcomac_distngrxcg_f8(), model_data->l_04_o_gdcomac_distngrxcg_f8); - assign_value_set(out_data.l_04_o_gdcomac_distmgrxcg_f8(), model_data->l_04_o_gdcomac_distmgrxcg_f8); - assign_value_set(out_data.l_04_o_gdcomac_distmgrzcg_f8(), model_data->l_04_o_gdcomac_distmgrzcg_f8); - assign_value_set(out_data.l_04_o_gdcomac_tire_vel_f8(), model_data->l_04_o_gdcomac_tire_vel_f8); - assign_value_set(out_data.l_04_o_gdcomac_tire_burst_l1(), model_data->l_04_o_gdcomac_tire_burst_l1); - assign_value_set(out_data.l_04_o_gdcomac_tire_temp_f8(), model_data->l_04_o_gdcomac_tire_temp_f8); - assign_value_set(out_data.l_04_o_gdcomac_wow_l1(), model_data->l_04_o_gdcomac_wow_l1); - assign_value_set(out_data.l_04_o_gdcomac_utirew_f8(), model_data->l_04_o_gdcomac_utirew_f8); - assign_value_set(out_data.l_04_o_gdcomac_vtirew_f8(), model_data->l_04_o_gdcomac_vtirew_f8); - assign_value_set(out_data.l_04_o_gdcomac_whl_omega_f8(), model_data->l_04_o_gdcomac_whl_omega_f8); - assign_value_set(out_data.l_04_o_gdcomac_dstruc_f8(), model_data->l_04_o_gdcomac_dstruc_f8); - assign_value_set(out_data.l_04_o_gdcomac_wor_par_f8(), model_data->l_04_o_gdcomac_wor_par_f8); - assign_value_set(out_data.l_04_o_gdcomac_nd_f8(), model_data->l_04_o_gdcomac_nd_f8); + assign_value(out_data.l_04_o_gdcomac_frz_l1(), model_data->l_04_o_gdcomac_frz_l1); + assign_value(out_data.l_04_o_gdcomac_ac_on_ground_l1(), model_data->l_04_o_gdcomac_ac_on_ground_l1); + assign_value(out_data.l_04_o_gdcomac_ac_stationary_f8(), model_data->l_04_o_gdcomac_ac_stationary_f8); + assign_value(out_data.l_04_o_gdcomac_alt_tire_f8(), model_data->l_04_o_gdcomac_alt_tire_f8); + assign_value(out_data.l_04_o_gdcomac_zcg_to_tire_f8(), model_data->l_04_o_gdcomac_zcg_to_tire_f8); + assign_value(out_data.l_04_o_gdcomac_fxb_f8(), model_data->l_04_o_gdcomac_fxb_f8); + assign_value(out_data.l_04_o_gdcomac_fyb_f8(), model_data->l_04_o_gdcomac_fyb_f8); + assign_value(out_data.l_04_o_gdcomac_fzb_f8(), model_data->l_04_o_gdcomac_fzb_f8); + assign_value(out_data.l_04_o_gdcomac_mxb_f8(), model_data->l_04_o_gdcomac_mxb_f8); + assign_value(out_data.l_04_o_gdcomac_myb_f8(), model_data->l_04_o_gdcomac_myb_f8); + assign_value(out_data.l_04_o_gdcomac_mzb_f8(), model_data->l_04_o_gdcomac_mzb_f8); + assign_value(out_data.l_04_o_gdcomac_fygs_f8(), model_data->l_04_o_gdcomac_fygs_f8); + assign_value(out_data.l_04_o_gdcomac_mzgs_f8(), model_data->l_04_o_gdcomac_mzgs_f8); + assign_value(out_data.l_04_o_gdcomac_mu_f8(), model_data->l_04_o_gdcomac_mu_f8); + assign_value(out_data.l_04_o_gdcomac_dstroke_f8(), model_data->l_04_o_gdcomac_dstroke_f8); + assign_value(out_data.l_04_o_gdcomac_sr_f8(), model_data->l_04_o_gdcomac_sr_f8); + assign_value(out_data.l_04_o_gdcomac_sy_f8(), model_data->l_04_o_gdcomac_sy_f8); + assign_value(out_data.l_04_o_gdcomac_sx_f8(), model_data->l_04_o_gdcomac_sx_f8); + assign_value(out_data.l_04_o_gdcomac_xft_f8(), model_data->l_04_o_gdcomac_xft_f8); + assign_value(out_data.l_04_o_gdcomac_yft_f8(), model_data->l_04_o_gdcomac_yft_f8); + assign_value(out_data.l_04_o_gdcomac_zft_f8(), model_data->l_04_o_gdcomac_zft_f8); + assign_value(out_data.l_04_o_gdcomac_distngrxcg_f8(), model_data->l_04_o_gdcomac_distngrxcg_f8); + assign_value(out_data.l_04_o_gdcomac_distmgrxcg_f8(), model_data->l_04_o_gdcomac_distmgrxcg_f8); + assign_value(out_data.l_04_o_gdcomac_distmgrzcg_f8(), model_data->l_04_o_gdcomac_distmgrzcg_f8); + assign_value(out_data.l_04_o_gdcomac_tire_vel_f8(), model_data->l_04_o_gdcomac_tire_vel_f8); + assign_value(out_data.l_04_o_gdcomac_tire_burst_l1(), model_data->l_04_o_gdcomac_tire_burst_l1); + assign_value(out_data.l_04_o_gdcomac_tire_temp_f8(), model_data->l_04_o_gdcomac_tire_temp_f8); + assign_value(out_data.l_04_o_gdcomac_wow_l1(), model_data->l_04_o_gdcomac_wow_l1); + assign_value(out_data.l_04_o_gdcomac_utirew_f8(), model_data->l_04_o_gdcomac_utirew_f8); + assign_value(out_data.l_04_o_gdcomac_vtirew_f8(), model_data->l_04_o_gdcomac_vtirew_f8); + assign_value(out_data.l_04_o_gdcomac_whl_omega_f8(), model_data->l_04_o_gdcomac_whl_omega_f8); + assign_value(out_data.l_04_o_gdcomac_dstruc_f8(), model_data->l_04_o_gdcomac_dstruc_f8); + assign_value(out_data.l_04_o_gdcomac_wor_par_f8(), model_data->l_04_o_gdcomac_wor_par_f8); + assign_value(out_data.l_04_o_gdcomac_nd_f8(), model_data->l_04_o_gdcomac_nd_f8); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_heartbeat.hpp b/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_heartbeat.hpp index 98969f1..546222e 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_heartbeat.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_heartbeat.hpp @@ -21,7 +21,7 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.weightbody_model_heartbeat(), model_data->weightbody_model_heartbeat); + assign_value(model_data->weightbody_model_heartbeat, data.weightbody_model_heartbeat()); } template void setData(T *model_data) @@ -30,7 +30,7 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.weightbody_model_heartbeat(), model_data->weightbody_model_heartbeat); + assign_value(out_data.weightbody_model_heartbeat(), model_data->weightbody_model_heartbeat); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_input.hpp b/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_input.hpp index b5c0651..b873288 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_input.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_input.hpp @@ -21,29 +21,29 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.l_04_i_wbcomac_theta_deg_f8(), model_data->l_04_i_wbcomac_theta_deg_f8); - assign_value_get(data.l_04_i_wbcomac_gear_mode_l1(), model_data->l_04_i_wbcomac_gear_mode_l1); - assign_value_get(data.l_04_i_wbcomac_acset_gw_f8(), model_data->l_04_i_wbcomac_acset_gw_f8); - assign_value_get(data.l_04_i_wbcomac_acset_cg_f8(), model_data->l_04_i_wbcomac_acset_cg_f8); - assign_value_get(data.l_04_i_wbcomac_acset_tankfuel_f4(), model_data->l_04_i_wbcomac_acset_tankfuel_f4); - assign_value_get(data.l_04_i_wbcomac_acset_totfuel_f8(), model_data->l_04_i_wbcomac_acset_totfuel_f8); - assign_value_get(data.l_04_i_wbcomac_acset_zfw_f8(), model_data->l_04_i_wbcomac_acset_zfw_f8); - assign_value_get(data.l_04_i_wbcomac_acset_zfwcg_f8(), model_data->l_04_i_wbcomac_acset_zfwcg_f8); - assign_value_get(data.l_04_i_wbcomac_eng_efsep_l1(), model_data->l_04_i_wbcomac_eng_efsep_l1); - assign_value_get(data.l_04_i_wbcomac_fuel_f8(), model_data->l_04_i_wbcomac_fuel_f8); - assign_value_get(data.l_04_i_wbcomac_gear_avg_f8(), model_data->l_04_i_wbcomac_gear_avg_f8); - assign_value_get(data.l_04_i_wbcomac_kice_f8(), model_data->l_04_i_wbcomac_kice_f8); - assign_value_get(data.l_04_i_wbcomac_bycglim_l1(), model_data->l_04_i_wbcomac_bycglim_l1); - assign_value_get(data.l_04_i_wbcomac_bygwlim_l1(), model_data->l_04_i_wbcomac_bygwlim_l1); - assign_value_get(data.l_04_i_wbcomac_frz_l1(), model_data->l_04_i_wbcomac_frz_l1); - assign_value_get(data.l_04_i_wbcomac_zcgfrz_l1(), model_data->l_04_i_wbcomac_zcgfrz_l1); - assign_value_get(data.l_04_i_wbcomac_zcgfrz_grfx_l1(), model_data->l_04_i_wbcomac_zcgfrz_grfx_l1); - assign_value_get(data.l_04_i_wbcomac_ycgfrz_l1(), model_data->l_04_i_wbcomac_ycgfrz_l1); - assign_value_get(data.l_04_i_wbcomac_inertfrz_l1(), model_data->l_04_i_wbcomac_inertfrz_l1); - assign_value_get(data.l_04_i_wbcomac_potreq_gw_f8(), model_data->l_04_i_wbcomac_potreq_gw_f8); - assign_value_get(data.l_04_i_wbcomac_potreq_gwcg_f8(), model_data->l_04_i_wbcomac_potreq_gwcg_f8); - assign_value_get(data.l_04_i_wbcomac_phi_deg_f8(), model_data->l_04_i_wbcomac_phi_deg_f8); - assign_value_get(data.l_04_i_wbcomac_psi_deg_f8(), model_data->l_04_i_wbcomac_psi_deg_f8); + assign_value(model_data->l_04_i_wbcomac_theta_deg_f8, data.l_04_i_wbcomac_theta_deg_f8()); + assign_value(model_data->l_04_i_wbcomac_gear_mode_l1, data.l_04_i_wbcomac_gear_mode_l1()); + assign_value(model_data->l_04_i_wbcomac_acset_gw_f8, data.l_04_i_wbcomac_acset_gw_f8()); + assign_value(model_data->l_04_i_wbcomac_acset_cg_f8, data.l_04_i_wbcomac_acset_cg_f8()); + assign_value(model_data->l_04_i_wbcomac_acset_tankfuel_f4, data.l_04_i_wbcomac_acset_tankfuel_f4()); + assign_value(model_data->l_04_i_wbcomac_acset_totfuel_f8, data.l_04_i_wbcomac_acset_totfuel_f8()); + assign_value(model_data->l_04_i_wbcomac_acset_zfw_f8, data.l_04_i_wbcomac_acset_zfw_f8()); + assign_value(model_data->l_04_i_wbcomac_acset_zfwcg_f8, data.l_04_i_wbcomac_acset_zfwcg_f8()); + assign_value(model_data->l_04_i_wbcomac_eng_efsep_l1, data.l_04_i_wbcomac_eng_efsep_l1()); + assign_value(model_data->l_04_i_wbcomac_fuel_f8, data.l_04_i_wbcomac_fuel_f8()); + assign_value(model_data->l_04_i_wbcomac_gear_avg_f8, data.l_04_i_wbcomac_gear_avg_f8()); + assign_value(model_data->l_04_i_wbcomac_kice_f8, data.l_04_i_wbcomac_kice_f8()); + assign_value(model_data->l_04_i_wbcomac_bycglim_l1, data.l_04_i_wbcomac_bycglim_l1()); + assign_value(model_data->l_04_i_wbcomac_bygwlim_l1, data.l_04_i_wbcomac_bygwlim_l1()); + assign_value(model_data->l_04_i_wbcomac_frz_l1, data.l_04_i_wbcomac_frz_l1()); + assign_value(model_data->l_04_i_wbcomac_zcgfrz_l1, data.l_04_i_wbcomac_zcgfrz_l1()); + assign_value(model_data->l_04_i_wbcomac_zcgfrz_grfx_l1, data.l_04_i_wbcomac_zcgfrz_grfx_l1()); + assign_value(model_data->l_04_i_wbcomac_ycgfrz_l1, data.l_04_i_wbcomac_ycgfrz_l1()); + assign_value(model_data->l_04_i_wbcomac_inertfrz_l1, data.l_04_i_wbcomac_inertfrz_l1()); + assign_value(model_data->l_04_i_wbcomac_potreq_gw_f8, data.l_04_i_wbcomac_potreq_gw_f8()); + assign_value(model_data->l_04_i_wbcomac_potreq_gwcg_f8, data.l_04_i_wbcomac_potreq_gwcg_f8()); + assign_value(model_data->l_04_i_wbcomac_phi_deg_f8, data.l_04_i_wbcomac_phi_deg_f8()); + assign_value(model_data->l_04_i_wbcomac_psi_deg_f8, data.l_04_i_wbcomac_psi_deg_f8()); } template void setData(T *model_data) @@ -52,29 +52,29 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.l_04_i_wbcomac_theta_deg_f8(), model_data->l_04_i_wbcomac_theta_deg_f8); - assign_value_set(out_data.l_04_i_wbcomac_gear_mode_l1(), model_data->l_04_i_wbcomac_gear_mode_l1); - assign_value_set(out_data.l_04_i_wbcomac_acset_gw_f8(), model_data->l_04_i_wbcomac_acset_gw_f8); - assign_value_set(out_data.l_04_i_wbcomac_acset_cg_f8(), model_data->l_04_i_wbcomac_acset_cg_f8); - assign_value_set(out_data.l_04_i_wbcomac_acset_tankfuel_f4(), model_data->l_04_i_wbcomac_acset_tankfuel_f4); - assign_value_set(out_data.l_04_i_wbcomac_acset_totfuel_f8(), model_data->l_04_i_wbcomac_acset_totfuel_f8); - assign_value_set(out_data.l_04_i_wbcomac_acset_zfw_f8(), model_data->l_04_i_wbcomac_acset_zfw_f8); - assign_value_set(out_data.l_04_i_wbcomac_acset_zfwcg_f8(), model_data->l_04_i_wbcomac_acset_zfwcg_f8); - assign_value_set(out_data.l_04_i_wbcomac_eng_efsep_l1(), model_data->l_04_i_wbcomac_eng_efsep_l1); - assign_value_set(out_data.l_04_i_wbcomac_fuel_f8(), model_data->l_04_i_wbcomac_fuel_f8); - assign_value_set(out_data.l_04_i_wbcomac_gear_avg_f8(), model_data->l_04_i_wbcomac_gear_avg_f8); - assign_value_set(out_data.l_04_i_wbcomac_kice_f8(), model_data->l_04_i_wbcomac_kice_f8); - assign_value_set(out_data.l_04_i_wbcomac_bycglim_l1(), model_data->l_04_i_wbcomac_bycglim_l1); - assign_value_set(out_data.l_04_i_wbcomac_bygwlim_l1(), model_data->l_04_i_wbcomac_bygwlim_l1); - assign_value_set(out_data.l_04_i_wbcomac_frz_l1(), model_data->l_04_i_wbcomac_frz_l1); - assign_value_set(out_data.l_04_i_wbcomac_zcgfrz_l1(), model_data->l_04_i_wbcomac_zcgfrz_l1); - assign_value_set(out_data.l_04_i_wbcomac_zcgfrz_grfx_l1(), model_data->l_04_i_wbcomac_zcgfrz_grfx_l1); - assign_value_set(out_data.l_04_i_wbcomac_ycgfrz_l1(), model_data->l_04_i_wbcomac_ycgfrz_l1); - assign_value_set(out_data.l_04_i_wbcomac_inertfrz_l1(), model_data->l_04_i_wbcomac_inertfrz_l1); - assign_value_set(out_data.l_04_i_wbcomac_potreq_gw_f8(), model_data->l_04_i_wbcomac_potreq_gw_f8); - assign_value_set(out_data.l_04_i_wbcomac_potreq_gwcg_f8(), model_data->l_04_i_wbcomac_potreq_gwcg_f8); - assign_value_set(out_data.l_04_i_wbcomac_phi_deg_f8(), model_data->l_04_i_wbcomac_phi_deg_f8); - assign_value_set(out_data.l_04_i_wbcomac_psi_deg_f8(), model_data->l_04_i_wbcomac_psi_deg_f8); + assign_value(out_data.l_04_i_wbcomac_theta_deg_f8(), model_data->l_04_i_wbcomac_theta_deg_f8); + assign_value(out_data.l_04_i_wbcomac_gear_mode_l1(), model_data->l_04_i_wbcomac_gear_mode_l1); + assign_value(out_data.l_04_i_wbcomac_acset_gw_f8(), model_data->l_04_i_wbcomac_acset_gw_f8); + assign_value(out_data.l_04_i_wbcomac_acset_cg_f8(), model_data->l_04_i_wbcomac_acset_cg_f8); + assign_value(out_data.l_04_i_wbcomac_acset_tankfuel_f4(), model_data->l_04_i_wbcomac_acset_tankfuel_f4); + assign_value(out_data.l_04_i_wbcomac_acset_totfuel_f8(), model_data->l_04_i_wbcomac_acset_totfuel_f8); + assign_value(out_data.l_04_i_wbcomac_acset_zfw_f8(), model_data->l_04_i_wbcomac_acset_zfw_f8); + assign_value(out_data.l_04_i_wbcomac_acset_zfwcg_f8(), model_data->l_04_i_wbcomac_acset_zfwcg_f8); + assign_value(out_data.l_04_i_wbcomac_eng_efsep_l1(), model_data->l_04_i_wbcomac_eng_efsep_l1); + assign_value(out_data.l_04_i_wbcomac_fuel_f8(), model_data->l_04_i_wbcomac_fuel_f8); + assign_value(out_data.l_04_i_wbcomac_gear_avg_f8(), model_data->l_04_i_wbcomac_gear_avg_f8); + assign_value(out_data.l_04_i_wbcomac_kice_f8(), model_data->l_04_i_wbcomac_kice_f8); + assign_value(out_data.l_04_i_wbcomac_bycglim_l1(), model_data->l_04_i_wbcomac_bycglim_l1); + assign_value(out_data.l_04_i_wbcomac_bygwlim_l1(), model_data->l_04_i_wbcomac_bygwlim_l1); + assign_value(out_data.l_04_i_wbcomac_frz_l1(), model_data->l_04_i_wbcomac_frz_l1); + assign_value(out_data.l_04_i_wbcomac_zcgfrz_l1(), model_data->l_04_i_wbcomac_zcgfrz_l1); + assign_value(out_data.l_04_i_wbcomac_zcgfrz_grfx_l1(), model_data->l_04_i_wbcomac_zcgfrz_grfx_l1); + assign_value(out_data.l_04_i_wbcomac_ycgfrz_l1(), model_data->l_04_i_wbcomac_ycgfrz_l1); + assign_value(out_data.l_04_i_wbcomac_inertfrz_l1(), model_data->l_04_i_wbcomac_inertfrz_l1); + assign_value(out_data.l_04_i_wbcomac_potreq_gw_f8(), model_data->l_04_i_wbcomac_potreq_gw_f8); + assign_value(out_data.l_04_i_wbcomac_potreq_gwcg_f8(), model_data->l_04_i_wbcomac_potreq_gwcg_f8); + assign_value(out_data.l_04_i_wbcomac_phi_deg_f8(), model_data->l_04_i_wbcomac_phi_deg_f8); + assign_value(out_data.l_04_i_wbcomac_psi_deg_f8(), model_data->l_04_i_wbcomac_psi_deg_f8); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_output.hpp b/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_output.hpp index 674d9b0..a50ec3c 100644 --- a/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_output.hpp +++ b/Release/Configuration/C909_V1/IDL/ATA04/WeightBalance_output.hpp @@ -21,62 +21,62 @@ public: std::lock_guard lock(dataMutex); if(model_data == nullptr) return; - assign_value_get(data.l_04_o_wbcomac_frz_l1(), model_data->l_04_o_wbcomac_frz_l1); - assign_value_get(data.l_04_o_wbcomac_zcgfrz_l1(), model_data->l_04_o_wbcomac_zcgfrz_l1); - assign_value_get(data.l_04_o_wbcomac_zcgfrz_grfx_l1(), model_data->l_04_o_wbcomac_zcgfrz_grfx_l1); - assign_value_get(data.l_04_o_wbcomac_ycgfrz_l1(), model_data->l_04_o_wbcomac_ycgfrz_l1); - assign_value_get(data.l_04_o_wbcomac_inertfrz_l1(), model_data->l_04_o_wbcomac_inertfrz_l1); - assign_value_get(data.l_04_o_wbcomac_gw_f4(), model_data->l_04_o_wbcomac_gw_f4); - assign_value_get(data.l_04_o_wbcomac_cg_f4(), model_data->l_04_o_wbcomac_cg_f4); - assign_value_get(data.l_04_o_wbcomac_blcg_f8(), model_data->l_04_o_wbcomac_blcg_f8); - assign_value_get(data.l_04_o_wbcomac_bscg_f8(), model_data->l_04_o_wbcomac_bscg_f8); - assign_value_get(data.l_04_o_wbcomac_wlcg_f8(), model_data->l_04_o_wbcomac_wlcg_f8); - assign_value_get(data.l_04_o_wbcomac_xcg_f8(), model_data->l_04_o_wbcomac_xcg_f8); - assign_value_get(data.l_04_o_wbcomac_ixx_f8(), model_data->l_04_o_wbcomac_ixx_f8); - assign_value_get(data.l_04_o_wbcomac_ixy_f8(), model_data->l_04_o_wbcomac_ixy_f8); - assign_value_get(data.l_04_o_wbcomac_ixz_f8(), model_data->l_04_o_wbcomac_ixz_f8); - assign_value_get(data.l_04_o_wbcomac_iyy_f8(), model_data->l_04_o_wbcomac_iyy_f8); - assign_value_get(data.l_04_o_wbcomac_iyz_f8(), model_data->l_04_o_wbcomac_iyz_f8); - assign_value_get(data.l_04_o_wbcomac_izz_f8(), model_data->l_04_o_wbcomac_izz_f8); - assign_value_get(data.l_04_o_wbcomac_zfw_f4(), model_data->l_04_o_wbcomac_zfw_f4); - assign_value_get(data.l_04_o_wbcomac_zfwcg_f4(), model_data->l_04_o_wbcomac_zfwcg_f4); - assign_value_get(data.l_04_o_wbcomac_zfw_blcg_f4(), model_data->l_04_o_wbcomac_zfw_blcg_f4); - assign_value_get(data.l_04_o_wbcomac_zfw_wlcg_f4(), model_data->l_04_o_wbcomac_zfw_wlcg_f4); - assign_value_get(data.l_04_o_wbcomac_fuel_cmd_f8(), model_data->l_04_o_wbcomac_fuel_cmd_f8); - assign_value_get(data.l_04_o_wbcomac_fuel_mode_i4(), model_data->l_04_o_wbcomac_fuel_mode_i4); - assign_value_get(data.l_04_o_wbcomac_fuel_ixx_f8(), model_data->l_04_o_wbcomac_fuel_ixx_f8); - assign_value_get(data.l_04_o_wbcomac_fuel_ixy_f8(), model_data->l_04_o_wbcomac_fuel_ixy_f8); - assign_value_get(data.l_04_o_wbcomac_fuel_ixz_f8(), model_data->l_04_o_wbcomac_fuel_ixz_f8); - assign_value_get(data.l_04_o_wbcomac_fuel_iyy_f8(), model_data->l_04_o_wbcomac_fuel_iyy_f8); - assign_value_get(data.l_04_o_wbcomac_fuel_iyz_f8(), model_data->l_04_o_wbcomac_fuel_iyz_f8); - assign_value_get(data.l_04_o_wbcomac_fuel_izz_f8(), model_data->l_04_o_wbcomac_fuel_izz_f8); - assign_value_get(data.l_04_o_wbcomac_l_wt_fuel_f8(), model_data->l_04_o_wbcomac_l_wt_fuel_f8); - assign_value_get(data.l_04_o_wbcomac_ice_airframe_total_f8(), model_data->l_04_o_wbcomac_ice_airframe_total_f8); - assign_value_get(data.l_04_o_wbcomac_ice_eng_f8(), model_data->l_04_o_wbcomac_ice_eng_f8); - assign_value_get(data.l_04_o_wbcomac_ice_eng_total_f8(), model_data->l_04_o_wbcomac_ice_eng_total_f8); - assign_value_get(data.l_04_o_wbcomac_ice_fuselage_f8(), model_data->l_04_o_wbcomac_ice_fuselage_f8); - assign_value_get(data.l_04_o_wbcomac_ice_stab_left_f8(), model_data->l_04_o_wbcomac_ice_stab_left_f8); - assign_value_get(data.l_04_o_wbcomac_ice_stab_right_f8(), model_data->l_04_o_wbcomac_ice_stab_right_f8); - assign_value_get(data.l_04_o_wbcomac_ice_stab_total_f8(), model_data->l_04_o_wbcomac_ice_stab_total_f8); - assign_value_get(data.l_04_o_wbcomac_ice_total_f8(), model_data->l_04_o_wbcomac_ice_total_f8); - assign_value_get(data.l_04_o_wbcomac_ice_total_frac_f8(), model_data->l_04_o_wbcomac_ice_total_frac_f8); - assign_value_get(data.l_04_o_wbcomac_ice_vert_tail_f8(), model_data->l_04_o_wbcomac_ice_vert_tail_f8); - assign_value_get(data.l_04_o_wbcomac_ice_wing_left_f8(), model_data->l_04_o_wbcomac_ice_wing_left_f8); - assign_value_get(data.l_04_o_wbcomac_ice_wing_right_f8(), model_data->l_04_o_wbcomac_ice_wing_right_f8); - assign_value_get(data.l_04_o_wbcomac_ice_wing_total_f8(), model_data->l_04_o_wbcomac_ice_wing_total_f8); - assign_value_get(data.l_04_o_wbcomac_init_l1(), model_data->l_04_o_wbcomac_init_l1); - assign_value_get(data.l_04_o_wbcomac_potmin_gw_f8(), model_data->l_04_o_wbcomac_potmin_gw_f8); - assign_value_get(data.l_04_o_wbcomac_potmax_gw_f8(), model_data->l_04_o_wbcomac_potmax_gw_f8); - assign_value_get(data.l_04_o_wbcomac_potmin_gwcg_f8(), model_data->l_04_o_wbcomac_potmin_gwcg_f8); - assign_value_get(data.l_04_o_wbcomac_potmax_gwcg_f8(), model_data->l_04_o_wbcomac_potmax_gwcg_f8); - assign_value_get(data.l_04_o_wbcomac_min_cg_f4(), model_data->l_04_o_wbcomac_min_cg_f4); - assign_value_get(data.l_04_o_wbcomac_min_gw_f4(), model_data->l_04_o_wbcomac_min_gw_f4); - assign_value_get(data.l_04_o_wbcomac_min_zfw_f4(), model_data->l_04_o_wbcomac_min_zfw_f4); - assign_value_get(data.l_04_o_wbcomac_min_zfwcg_f4(), model_data->l_04_o_wbcomac_min_zfwcg_f4); - assign_value_get(data.l_04_o_wbcomac_max_cg_f4(), model_data->l_04_o_wbcomac_max_cg_f4); - assign_value_get(data.l_04_o_wbcomac_max_gw_f4(), model_data->l_04_o_wbcomac_max_gw_f4); - assign_value_get(data.l_04_o_wbcomac_max_zfw_f4(), model_data->l_04_o_wbcomac_max_zfw_f4); - assign_value_get(data.l_04_o_wbcomac_max_zfwcg_f4(), model_data->l_04_o_wbcomac_max_zfwcg_f4); + assign_value(model_data->l_04_o_wbcomac_frz_l1, data.l_04_o_wbcomac_frz_l1()); + assign_value(model_data->l_04_o_wbcomac_zcgfrz_l1, data.l_04_o_wbcomac_zcgfrz_l1()); + assign_value(model_data->l_04_o_wbcomac_zcgfrz_grfx_l1, data.l_04_o_wbcomac_zcgfrz_grfx_l1()); + assign_value(model_data->l_04_o_wbcomac_ycgfrz_l1, data.l_04_o_wbcomac_ycgfrz_l1()); + assign_value(model_data->l_04_o_wbcomac_inertfrz_l1, data.l_04_o_wbcomac_inertfrz_l1()); + assign_value(model_data->l_04_o_wbcomac_gw_f4, data.l_04_o_wbcomac_gw_f4()); + assign_value(model_data->l_04_o_wbcomac_cg_f4, data.l_04_o_wbcomac_cg_f4()); + assign_value(model_data->l_04_o_wbcomac_blcg_f8, data.l_04_o_wbcomac_blcg_f8()); + assign_value(model_data->l_04_o_wbcomac_bscg_f8, data.l_04_o_wbcomac_bscg_f8()); + assign_value(model_data->l_04_o_wbcomac_wlcg_f8, data.l_04_o_wbcomac_wlcg_f8()); + assign_value(model_data->l_04_o_wbcomac_xcg_f8, data.l_04_o_wbcomac_xcg_f8()); + assign_value(model_data->l_04_o_wbcomac_ixx_f8, data.l_04_o_wbcomac_ixx_f8()); + assign_value(model_data->l_04_o_wbcomac_ixy_f8, data.l_04_o_wbcomac_ixy_f8()); + assign_value(model_data->l_04_o_wbcomac_ixz_f8, data.l_04_o_wbcomac_ixz_f8()); + assign_value(model_data->l_04_o_wbcomac_iyy_f8, data.l_04_o_wbcomac_iyy_f8()); + assign_value(model_data->l_04_o_wbcomac_iyz_f8, data.l_04_o_wbcomac_iyz_f8()); + assign_value(model_data->l_04_o_wbcomac_izz_f8, data.l_04_o_wbcomac_izz_f8()); + assign_value(model_data->l_04_o_wbcomac_zfw_f4, data.l_04_o_wbcomac_zfw_f4()); + assign_value(model_data->l_04_o_wbcomac_zfwcg_f4, data.l_04_o_wbcomac_zfwcg_f4()); + assign_value(model_data->l_04_o_wbcomac_zfw_blcg_f4, data.l_04_o_wbcomac_zfw_blcg_f4()); + assign_value(model_data->l_04_o_wbcomac_zfw_wlcg_f4, data.l_04_o_wbcomac_zfw_wlcg_f4()); + assign_value(model_data->l_04_o_wbcomac_fuel_cmd_f8, data.l_04_o_wbcomac_fuel_cmd_f8()); + assign_value(model_data->l_04_o_wbcomac_fuel_mode_i4, data.l_04_o_wbcomac_fuel_mode_i4()); + assign_value(model_data->l_04_o_wbcomac_fuel_ixx_f8, data.l_04_o_wbcomac_fuel_ixx_f8()); + assign_value(model_data->l_04_o_wbcomac_fuel_ixy_f8, data.l_04_o_wbcomac_fuel_ixy_f8()); + assign_value(model_data->l_04_o_wbcomac_fuel_ixz_f8, data.l_04_o_wbcomac_fuel_ixz_f8()); + assign_value(model_data->l_04_o_wbcomac_fuel_iyy_f8, data.l_04_o_wbcomac_fuel_iyy_f8()); + assign_value(model_data->l_04_o_wbcomac_fuel_iyz_f8, data.l_04_o_wbcomac_fuel_iyz_f8()); + assign_value(model_data->l_04_o_wbcomac_fuel_izz_f8, data.l_04_o_wbcomac_fuel_izz_f8()); + assign_value(model_data->l_04_o_wbcomac_l_wt_fuel_f8, data.l_04_o_wbcomac_l_wt_fuel_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_airframe_total_f8, data.l_04_o_wbcomac_ice_airframe_total_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_eng_f8, data.l_04_o_wbcomac_ice_eng_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_eng_total_f8, data.l_04_o_wbcomac_ice_eng_total_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_fuselage_f8, data.l_04_o_wbcomac_ice_fuselage_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_stab_left_f8, data.l_04_o_wbcomac_ice_stab_left_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_stab_right_f8, data.l_04_o_wbcomac_ice_stab_right_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_stab_total_f8, data.l_04_o_wbcomac_ice_stab_total_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_total_f8, data.l_04_o_wbcomac_ice_total_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_total_frac_f8, data.l_04_o_wbcomac_ice_total_frac_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_vert_tail_f8, data.l_04_o_wbcomac_ice_vert_tail_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_wing_left_f8, data.l_04_o_wbcomac_ice_wing_left_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_wing_right_f8, data.l_04_o_wbcomac_ice_wing_right_f8()); + assign_value(model_data->l_04_o_wbcomac_ice_wing_total_f8, data.l_04_o_wbcomac_ice_wing_total_f8()); + assign_value(model_data->l_04_o_wbcomac_init_l1, data.l_04_o_wbcomac_init_l1()); + assign_value(model_data->l_04_o_wbcomac_potmin_gw_f8, data.l_04_o_wbcomac_potmin_gw_f8()); + assign_value(model_data->l_04_o_wbcomac_potmax_gw_f8, data.l_04_o_wbcomac_potmax_gw_f8()); + assign_value(model_data->l_04_o_wbcomac_potmin_gwcg_f8, data.l_04_o_wbcomac_potmin_gwcg_f8()); + assign_value(model_data->l_04_o_wbcomac_potmax_gwcg_f8, data.l_04_o_wbcomac_potmax_gwcg_f8()); + assign_value(model_data->l_04_o_wbcomac_min_cg_f4, data.l_04_o_wbcomac_min_cg_f4()); + assign_value(model_data->l_04_o_wbcomac_min_gw_f4, data.l_04_o_wbcomac_min_gw_f4()); + assign_value(model_data->l_04_o_wbcomac_min_zfw_f4, data.l_04_o_wbcomac_min_zfw_f4()); + assign_value(model_data->l_04_o_wbcomac_min_zfwcg_f4, data.l_04_o_wbcomac_min_zfwcg_f4()); + assign_value(model_data->l_04_o_wbcomac_max_cg_f4, data.l_04_o_wbcomac_max_cg_f4()); + assign_value(model_data->l_04_o_wbcomac_max_gw_f4, data.l_04_o_wbcomac_max_gw_f4()); + assign_value(model_data->l_04_o_wbcomac_max_zfw_f4, data.l_04_o_wbcomac_max_zfw_f4()); + assign_value(model_data->l_04_o_wbcomac_max_zfwcg_f4, data.l_04_o_wbcomac_max_zfwcg_f4()); } template void setData(T *model_data) @@ -85,62 +85,62 @@ public: return; std::lock_guard lock(outDataMutex); clearOutData(); - assign_value_set(out_data.l_04_o_wbcomac_frz_l1(), model_data->l_04_o_wbcomac_frz_l1); - assign_value_set(out_data.l_04_o_wbcomac_zcgfrz_l1(), model_data->l_04_o_wbcomac_zcgfrz_l1); - assign_value_set(out_data.l_04_o_wbcomac_zcgfrz_grfx_l1(), model_data->l_04_o_wbcomac_zcgfrz_grfx_l1); - assign_value_set(out_data.l_04_o_wbcomac_ycgfrz_l1(), model_data->l_04_o_wbcomac_ycgfrz_l1); - assign_value_set(out_data.l_04_o_wbcomac_inertfrz_l1(), model_data->l_04_o_wbcomac_inertfrz_l1); - assign_value_set(out_data.l_04_o_wbcomac_gw_f4(), model_data->l_04_o_wbcomac_gw_f4); - assign_value_set(out_data.l_04_o_wbcomac_cg_f4(), model_data->l_04_o_wbcomac_cg_f4); - assign_value_set(out_data.l_04_o_wbcomac_blcg_f8(), model_data->l_04_o_wbcomac_blcg_f8); - assign_value_set(out_data.l_04_o_wbcomac_bscg_f8(), model_data->l_04_o_wbcomac_bscg_f8); - assign_value_set(out_data.l_04_o_wbcomac_wlcg_f8(), model_data->l_04_o_wbcomac_wlcg_f8); - assign_value_set(out_data.l_04_o_wbcomac_xcg_f8(), model_data->l_04_o_wbcomac_xcg_f8); - assign_value_set(out_data.l_04_o_wbcomac_ixx_f8(), model_data->l_04_o_wbcomac_ixx_f8); - assign_value_set(out_data.l_04_o_wbcomac_ixy_f8(), model_data->l_04_o_wbcomac_ixy_f8); - assign_value_set(out_data.l_04_o_wbcomac_ixz_f8(), model_data->l_04_o_wbcomac_ixz_f8); - assign_value_set(out_data.l_04_o_wbcomac_iyy_f8(), model_data->l_04_o_wbcomac_iyy_f8); - assign_value_set(out_data.l_04_o_wbcomac_iyz_f8(), model_data->l_04_o_wbcomac_iyz_f8); - assign_value_set(out_data.l_04_o_wbcomac_izz_f8(), model_data->l_04_o_wbcomac_izz_f8); - assign_value_set(out_data.l_04_o_wbcomac_zfw_f4(), model_data->l_04_o_wbcomac_zfw_f4); - assign_value_set(out_data.l_04_o_wbcomac_zfwcg_f4(), model_data->l_04_o_wbcomac_zfwcg_f4); - assign_value_set(out_data.l_04_o_wbcomac_zfw_blcg_f4(), model_data->l_04_o_wbcomac_zfw_blcg_f4); - assign_value_set(out_data.l_04_o_wbcomac_zfw_wlcg_f4(), model_data->l_04_o_wbcomac_zfw_wlcg_f4); - assign_value_set(out_data.l_04_o_wbcomac_fuel_cmd_f8(), model_data->l_04_o_wbcomac_fuel_cmd_f8); - assign_value_set(out_data.l_04_o_wbcomac_fuel_mode_i4(), model_data->l_04_o_wbcomac_fuel_mode_i4); - assign_value_set(out_data.l_04_o_wbcomac_fuel_ixx_f8(), model_data->l_04_o_wbcomac_fuel_ixx_f8); - assign_value_set(out_data.l_04_o_wbcomac_fuel_ixy_f8(), model_data->l_04_o_wbcomac_fuel_ixy_f8); - assign_value_set(out_data.l_04_o_wbcomac_fuel_ixz_f8(), model_data->l_04_o_wbcomac_fuel_ixz_f8); - assign_value_set(out_data.l_04_o_wbcomac_fuel_iyy_f8(), model_data->l_04_o_wbcomac_fuel_iyy_f8); - assign_value_set(out_data.l_04_o_wbcomac_fuel_iyz_f8(), model_data->l_04_o_wbcomac_fuel_iyz_f8); - assign_value_set(out_data.l_04_o_wbcomac_fuel_izz_f8(), model_data->l_04_o_wbcomac_fuel_izz_f8); - assign_value_set(out_data.l_04_o_wbcomac_l_wt_fuel_f8(), model_data->l_04_o_wbcomac_l_wt_fuel_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_airframe_total_f8(), model_data->l_04_o_wbcomac_ice_airframe_total_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_eng_f8(), model_data->l_04_o_wbcomac_ice_eng_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_eng_total_f8(), model_data->l_04_o_wbcomac_ice_eng_total_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_fuselage_f8(), model_data->l_04_o_wbcomac_ice_fuselage_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_stab_left_f8(), model_data->l_04_o_wbcomac_ice_stab_left_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_stab_right_f8(), model_data->l_04_o_wbcomac_ice_stab_right_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_stab_total_f8(), model_data->l_04_o_wbcomac_ice_stab_total_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_total_f8(), model_data->l_04_o_wbcomac_ice_total_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_total_frac_f8(), model_data->l_04_o_wbcomac_ice_total_frac_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_vert_tail_f8(), model_data->l_04_o_wbcomac_ice_vert_tail_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_wing_left_f8(), model_data->l_04_o_wbcomac_ice_wing_left_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_wing_right_f8(), model_data->l_04_o_wbcomac_ice_wing_right_f8); - assign_value_set(out_data.l_04_o_wbcomac_ice_wing_total_f8(), model_data->l_04_o_wbcomac_ice_wing_total_f8); - assign_value_set(out_data.l_04_o_wbcomac_init_l1(), model_data->l_04_o_wbcomac_init_l1); - assign_value_set(out_data.l_04_o_wbcomac_potmin_gw_f8(), model_data->l_04_o_wbcomac_potmin_gw_f8); - assign_value_set(out_data.l_04_o_wbcomac_potmax_gw_f8(), model_data->l_04_o_wbcomac_potmax_gw_f8); - assign_value_set(out_data.l_04_o_wbcomac_potmin_gwcg_f8(), model_data->l_04_o_wbcomac_potmin_gwcg_f8); - assign_value_set(out_data.l_04_o_wbcomac_potmax_gwcg_f8(), model_data->l_04_o_wbcomac_potmax_gwcg_f8); - assign_value_set(out_data.l_04_o_wbcomac_min_cg_f4(), model_data->l_04_o_wbcomac_min_cg_f4); - assign_value_set(out_data.l_04_o_wbcomac_min_gw_f4(), model_data->l_04_o_wbcomac_min_gw_f4); - assign_value_set(out_data.l_04_o_wbcomac_min_zfw_f4(), model_data->l_04_o_wbcomac_min_zfw_f4); - assign_value_set(out_data.l_04_o_wbcomac_min_zfwcg_f4(), model_data->l_04_o_wbcomac_min_zfwcg_f4); - assign_value_set(out_data.l_04_o_wbcomac_max_cg_f4(), model_data->l_04_o_wbcomac_max_cg_f4); - assign_value_set(out_data.l_04_o_wbcomac_max_gw_f4(), model_data->l_04_o_wbcomac_max_gw_f4); - assign_value_set(out_data.l_04_o_wbcomac_max_zfw_f4(), model_data->l_04_o_wbcomac_max_zfw_f4); - assign_value_set(out_data.l_04_o_wbcomac_max_zfwcg_f4(), model_data->l_04_o_wbcomac_max_zfwcg_f4); + assign_value(out_data.l_04_o_wbcomac_frz_l1(), model_data->l_04_o_wbcomac_frz_l1); + assign_value(out_data.l_04_o_wbcomac_zcgfrz_l1(), model_data->l_04_o_wbcomac_zcgfrz_l1); + assign_value(out_data.l_04_o_wbcomac_zcgfrz_grfx_l1(), model_data->l_04_o_wbcomac_zcgfrz_grfx_l1); + assign_value(out_data.l_04_o_wbcomac_ycgfrz_l1(), model_data->l_04_o_wbcomac_ycgfrz_l1); + assign_value(out_data.l_04_o_wbcomac_inertfrz_l1(), model_data->l_04_o_wbcomac_inertfrz_l1); + assign_value(out_data.l_04_o_wbcomac_gw_f4(), model_data->l_04_o_wbcomac_gw_f4); + assign_value(out_data.l_04_o_wbcomac_cg_f4(), model_data->l_04_o_wbcomac_cg_f4); + assign_value(out_data.l_04_o_wbcomac_blcg_f8(), model_data->l_04_o_wbcomac_blcg_f8); + assign_value(out_data.l_04_o_wbcomac_bscg_f8(), model_data->l_04_o_wbcomac_bscg_f8); + assign_value(out_data.l_04_o_wbcomac_wlcg_f8(), model_data->l_04_o_wbcomac_wlcg_f8); + assign_value(out_data.l_04_o_wbcomac_xcg_f8(), model_data->l_04_o_wbcomac_xcg_f8); + assign_value(out_data.l_04_o_wbcomac_ixx_f8(), model_data->l_04_o_wbcomac_ixx_f8); + assign_value(out_data.l_04_o_wbcomac_ixy_f8(), model_data->l_04_o_wbcomac_ixy_f8); + assign_value(out_data.l_04_o_wbcomac_ixz_f8(), model_data->l_04_o_wbcomac_ixz_f8); + assign_value(out_data.l_04_o_wbcomac_iyy_f8(), model_data->l_04_o_wbcomac_iyy_f8); + assign_value(out_data.l_04_o_wbcomac_iyz_f8(), model_data->l_04_o_wbcomac_iyz_f8); + assign_value(out_data.l_04_o_wbcomac_izz_f8(), model_data->l_04_o_wbcomac_izz_f8); + assign_value(out_data.l_04_o_wbcomac_zfw_f4(), model_data->l_04_o_wbcomac_zfw_f4); + assign_value(out_data.l_04_o_wbcomac_zfwcg_f4(), model_data->l_04_o_wbcomac_zfwcg_f4); + assign_value(out_data.l_04_o_wbcomac_zfw_blcg_f4(), model_data->l_04_o_wbcomac_zfw_blcg_f4); + assign_value(out_data.l_04_o_wbcomac_zfw_wlcg_f4(), model_data->l_04_o_wbcomac_zfw_wlcg_f4); + assign_value(out_data.l_04_o_wbcomac_fuel_cmd_f8(), model_data->l_04_o_wbcomac_fuel_cmd_f8); + assign_value(out_data.l_04_o_wbcomac_fuel_mode_i4(), model_data->l_04_o_wbcomac_fuel_mode_i4); + assign_value(out_data.l_04_o_wbcomac_fuel_ixx_f8(), model_data->l_04_o_wbcomac_fuel_ixx_f8); + assign_value(out_data.l_04_o_wbcomac_fuel_ixy_f8(), model_data->l_04_o_wbcomac_fuel_ixy_f8); + assign_value(out_data.l_04_o_wbcomac_fuel_ixz_f8(), model_data->l_04_o_wbcomac_fuel_ixz_f8); + assign_value(out_data.l_04_o_wbcomac_fuel_iyy_f8(), model_data->l_04_o_wbcomac_fuel_iyy_f8); + assign_value(out_data.l_04_o_wbcomac_fuel_iyz_f8(), model_data->l_04_o_wbcomac_fuel_iyz_f8); + assign_value(out_data.l_04_o_wbcomac_fuel_izz_f8(), model_data->l_04_o_wbcomac_fuel_izz_f8); + assign_value(out_data.l_04_o_wbcomac_l_wt_fuel_f8(), model_data->l_04_o_wbcomac_l_wt_fuel_f8); + assign_value(out_data.l_04_o_wbcomac_ice_airframe_total_f8(), model_data->l_04_o_wbcomac_ice_airframe_total_f8); + assign_value(out_data.l_04_o_wbcomac_ice_eng_f8(), model_data->l_04_o_wbcomac_ice_eng_f8); + assign_value(out_data.l_04_o_wbcomac_ice_eng_total_f8(), model_data->l_04_o_wbcomac_ice_eng_total_f8); + assign_value(out_data.l_04_o_wbcomac_ice_fuselage_f8(), model_data->l_04_o_wbcomac_ice_fuselage_f8); + assign_value(out_data.l_04_o_wbcomac_ice_stab_left_f8(), model_data->l_04_o_wbcomac_ice_stab_left_f8); + assign_value(out_data.l_04_o_wbcomac_ice_stab_right_f8(), model_data->l_04_o_wbcomac_ice_stab_right_f8); + assign_value(out_data.l_04_o_wbcomac_ice_stab_total_f8(), model_data->l_04_o_wbcomac_ice_stab_total_f8); + assign_value(out_data.l_04_o_wbcomac_ice_total_f8(), model_data->l_04_o_wbcomac_ice_total_f8); + assign_value(out_data.l_04_o_wbcomac_ice_total_frac_f8(), model_data->l_04_o_wbcomac_ice_total_frac_f8); + assign_value(out_data.l_04_o_wbcomac_ice_vert_tail_f8(), model_data->l_04_o_wbcomac_ice_vert_tail_f8); + assign_value(out_data.l_04_o_wbcomac_ice_wing_left_f8(), model_data->l_04_o_wbcomac_ice_wing_left_f8); + assign_value(out_data.l_04_o_wbcomac_ice_wing_right_f8(), model_data->l_04_o_wbcomac_ice_wing_right_f8); + assign_value(out_data.l_04_o_wbcomac_ice_wing_total_f8(), model_data->l_04_o_wbcomac_ice_wing_total_f8); + assign_value(out_data.l_04_o_wbcomac_init_l1(), model_data->l_04_o_wbcomac_init_l1); + assign_value(out_data.l_04_o_wbcomac_potmin_gw_f8(), model_data->l_04_o_wbcomac_potmin_gw_f8); + assign_value(out_data.l_04_o_wbcomac_potmax_gw_f8(), model_data->l_04_o_wbcomac_potmax_gw_f8); + assign_value(out_data.l_04_o_wbcomac_potmin_gwcg_f8(), model_data->l_04_o_wbcomac_potmin_gwcg_f8); + assign_value(out_data.l_04_o_wbcomac_potmax_gwcg_f8(), model_data->l_04_o_wbcomac_potmax_gwcg_f8); + assign_value(out_data.l_04_o_wbcomac_min_cg_f4(), model_data->l_04_o_wbcomac_min_cg_f4); + assign_value(out_data.l_04_o_wbcomac_min_gw_f4(), model_data->l_04_o_wbcomac_min_gw_f4); + assign_value(out_data.l_04_o_wbcomac_min_zfw_f4(), model_data->l_04_o_wbcomac_min_zfw_f4); + assign_value(out_data.l_04_o_wbcomac_min_zfwcg_f4(), model_data->l_04_o_wbcomac_min_zfwcg_f4); + assign_value(out_data.l_04_o_wbcomac_max_cg_f4(), model_data->l_04_o_wbcomac_max_cg_f4); + assign_value(out_data.l_04_o_wbcomac_max_gw_f4(), model_data->l_04_o_wbcomac_max_gw_f4); + assign_value(out_data.l_04_o_wbcomac_max_zfw_f4(), model_data->l_04_o_wbcomac_max_zfw_f4); + assign_value(out_data.l_04_o_wbcomac_max_zfwcg_f4(), model_data->l_04_o_wbcomac_max_zfwcg_f4); sendOutData(); } protected: diff --git a/Release/Configuration/C909_V1/PluginCode/CMakeLists.txt b/Release/Configuration/C909_V1/PluginCode/CMakeLists.txt index 420e4d9..c8e47c3 100644 --- a/Release/Configuration/C909_V1/PluginCode/CMakeLists.txt +++ b/Release/Configuration/C909_V1/PluginCode/CMakeLists.txt @@ -8,6 +8,10 @@ project(C909_V1_Monitor_plugin) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug, Release, RelWithDebInfo, MinSizeRel)" FORCE) +endif() + # 查找必要的包 find_package(PkgConfig REQUIRED) find_package(FastDDS REQUIRED) diff --git a/Release/database/XNSim.db b/Release/database/XNSim.db index 073e96f..5ec9dda 100644 Binary files a/Release/database/XNSim.db and b/Release/database/XNSim.db differ diff --git a/Release/include/XNCore/XNByteArray.h b/Release/include/XNCore/XNByteArray.h index b6ba387..e728068 100644 --- a/Release/include/XNCore/XNByteArray.h +++ b/Release/include/XNCore/XNByteArray.h @@ -94,6 +94,71 @@ public: */ void reserve(size_t size) { data_.reserve(size); } + /** + * @brief 按指定大小分段 + * @param segmentSize 每段的大小 + * @return 分段后的XNByteArray向量,如果不能整除则返回空向量 + */ + std::vector segment(size_t segmentSize) const + { + if (segmentSize == 0) { + return {}; + } + + size_t totalSize = data_.size(); + + // 检查是否能够整除 + if (totalSize % segmentSize != 0) { + return {}; + } + + std::vector segments; + size_t numSegments = totalSize / segmentSize; + segments.reserve(numSegments); + + for (size_t i = 0; i < totalSize; i += segmentSize) { + segments.emplace_back(data_.data() + i, segmentSize); + } + + return segments; + } + + /** + * @brief 获取指定范围的子数组 + * @param start 起始位置 + * @param length 长度 + * @return 子数组 + */ + XNByteArray mid(size_t start, size_t length = SIZE_MAX) const + { + if (start >= data_.size()) { + return XNByteArray{}; + } + + size_t actualLength = std::min(length, data_.size() - start); + return XNByteArray(data_.data() + start, actualLength); + } + + /** + * @brief 获取左侧子数组 + * @param length 长度 + * @return 左侧子数组 + */ + XNByteArray left(size_t length) const { return mid(0, length); } + + /** + * @brief 获取右侧子数组 + * @param length 长度 + * @return 右侧子数组 + */ + XNByteArray right(size_t length) const + { + if (length >= data_.size()) { + return *this; + } + return mid(data_.size() - length, length); + } + private: std::vector data_; }; \ No newline at end of file diff --git a/Release/include/XNCore/XNDDSInterface.h b/Release/include/XNCore/XNDDSInterface.h index bfc6f65..e4578a9 100644 --- a/Release/include/XNCore/XNDDSInterface.h +++ b/Release/include/XNCore/XNDDSInterface.h @@ -49,332 +49,6 @@ public: void setDataByString(const std::unordered_map &data); protected: - /** - * @brief 获取指定变量的字节数据,用于网络通信 - * @param data: 数据 - * @return 字节数组 - */ - template - XNByteArray getByteArray(const eprosima::fastcdr::optional &data) - { - XNByteArray result(getTypeSize()); - - if constexpr (std::is_arithmetic_v) { - if (data) { - std::memcpy(result.data(), &data.value(), sizeof(T)); - } else { - T zero = 0; - std::memcpy(result.data(), &zero, sizeof(T)); - } - } else if constexpr (is_std_array_v) { - if (data) { - return getByteArrayFromStdArray(data.value()); - } else { - T zero = {}; - return getByteArrayFromStdArray(zero); - } - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161001:T 必须是算术类型或std::array类型"); - } - - return result; - } - - /** - * @brief 设置指定变量的字节数据,用于网络通信 - * @param data: 数据 - * @param byteArray: 字节数组 - */ - template - void setByteArray(eprosima::fastcdr::optional &data, const XNByteArray &byteArray, - uint32_t &pos) - { - uint32_t thisSize = getTypeSize(); - XNByteArray thisArray(thisSize); - if (pos + thisSize > byteArray.size()) { - return; - } - std::memcpy(thisArray.data(), byteArray.data() + pos, thisSize); - pos += thisSize; - - if constexpr (std::is_arithmetic_v) { - T temp; - std::memcpy(&temp, thisArray.data(), sizeof(T)); - data = temp; - } else if constexpr (is_std_array_v) { - if (!data) { - data = T{}; - } - setByteArrayFromStdArray(data.value(), thisArray); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161002:T 必须是算术类型或std::array类型"); - } - } - - /** - * @brief 获取指定数组变量的字节数据,用于网络通信 - * @param data: 数据 - * @return 字节数组 - */ - template - XNByteArray getByteArrayFromStdArray(const std::array &data) - { - XNByteArray result(getTypeSize() * N); - - for (std::size_t i = 0; i < N; ++i) { - if constexpr (std::is_arithmetic_v) { - std::memcpy(result.data() + i * getTypeSize(), &data[i], getTypeSize()); - } else if constexpr (is_std_array_v) { - XNByteArray subArray = getByteArrayFromStdArray(data[i]); - std::memcpy(result.data() + i * getTypeSize(), subArray.data(), - getTypeSize()); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161003:T 必须是算术类型或std::array类型"); - } - } - - return result; - } - - /** - * @brief 设置指定数组变量的字节数据,用于网络通信 - * @param data: 数据 - * @param byteArray: 字节数组 - */ - template - void setByteArrayFromStdArray(std::array &data, const XNByteArray &byteArray) - { - if (byteArray.size() < getTypeSize() * N) - return; - - for (std::size_t i = 0; i < N; ++i) { - if constexpr (std::is_arithmetic_v) { - std::memcpy(&data[i], byteArray.data() + i * getTypeSize(), getTypeSize()); - } else if constexpr (is_std_array_v) { - XNByteArray subArray(byteArray.data() + i * getTypeSize(), getTypeSize()); - setByteArrayFromStdArray(data[i], subArray); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161004:T 必须是算术类型或std::array类型"); - } - } - } - - /** - * @brief 获取指定变量的字符串数据,用于JSON前端 - * @param data: 数据 - * @return: 数据(字符串格式) - */ - template - std::string getString(const eprosima::fastcdr::optional &data) - { - if constexpr (std::is_arithmetic_v) { - if (data) { - return std::to_string(data.value()); - } else { - return "0"; - } - } else if constexpr (is_std_array_v) { - if (data) { - return getStringFromStdArray(data.value()); - } else { - T zero = {}; - return getStringFromStdArray(zero); - } - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161005:T 必须是算术类型或std::array类型"); - } - return std::string(); - } - - /** - * @brief 通过字符串数据设置指定变量,用于JSON前端 - * @param data: 数据 - * @param value: 字符串数据 - */ - template - void setDataFromString(eprosima::fastcdr::optional &data, const std::string &value) - { - if constexpr (std::is_arithmetic_v) { - if constexpr (std::is_same_v || std::is_same_v) { - data = XNSim::safe_stod(value); - } else { - data = XNSim::safe_stoll(value); - } - } else if constexpr (is_std_array_v) { - // 解析输入字符串 - std::stringstream ss(value); - std::string item; - std::vector items; - while (std::getline(ss, item, ',')) { - items.push_back(item); - } - if (items.size() != getArrayWholeSize()) { - LOG_WARNING("A01163006:数组大小不一致, 设置数据失败!"); - return; - } - T temp; - setStdArrayFromString(temp, items, 0); - data = temp; - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161007:T 必须是算术类型或std::array类型"); - } - } - - /** - * @brief 获取指定数组变量的字符串数据,用于JSON前端 - * @param data: 数据 - * @return: 数据(字符串格式) - */ - template - std::string getStringFromStdArray(const std::array &data) - { - std::stringstream ss; - for (std::size_t i = 0; i < N; ++i) { - if (i > 0) - ss << ","; - if constexpr (std::is_arithmetic_v) { - if constexpr (std::is_same_v) { - ss << static_cast(data[i]); - } else if constexpr (std::is_same_v) { - ss << static_cast(data[i]); - } else { - ss << data[i]; - } - } else if constexpr (is_std_array_v) { - ss << getStringFromStdArray(data[i]); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161008:T 必须是算术类型或std::array类型"); - } - } - return ss.str(); - } - - /** - * @brief 通过字符串数据设置指定数组变量,用于JSON前端 - * @param data: 数据 - * @param value: 字符串数据,格式为"数字,数字,..." - * @param start_pos: 当前数组在输入字符串中的起始位置 - * @return 处理完当前数组后,下一个数组的起始位置 - * @throw std::runtime_error: 当输入数据格式不正确时抛出异常 - */ - template - size_t setStdArrayFromString(std::array &data, const std::vector &value, - size_t start_pos = 0) - { - // 递归处理每个元素 - for (std::size_t i = 0; i < N; ++i) { - try { - if constexpr (std::is_arithmetic_v) { - // 对于基本类型,直接转换 - if constexpr (std::is_same_v || std::is_same_v) { - data[i] = static_cast(XNSim::safe_stod(value[start_pos + i])); - } else { - data[i] = static_cast(XNSim::safe_stoll(value[start_pos + i])); - } - } else if constexpr (is_std_array_v) { - // 对于嵌套数组,递归处理 - start_pos = setStdArrayFromString(data[i], value, start_pos); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161009:T 必须是算术类型或std::array类型"); - } - } catch (const std::exception &e) { - LOG_WARNING("A01163010:无法解析第 %1 个元素: %2", i, e.what()); - } - } - return start_pos + N; - } - - template - void assign_value_get(const eprosima::fastcdr::optional &data, T2 &model_data) - { - if (data) { - auto temp = data.value(); - if constexpr (std::is_arithmetic_v) { - static_assert(std::is_arithmetic_v, "A01161011:模板参数T2必须是算术类型"); - static_assert(std::is_convertible_v, - "A01161012:模板参数T1必须可以转换为T2类型"); - model_data = temp; - } else if constexpr (is_std_array_v) { - size_t arraySize = array_size_v; - for (size_t i = 0; i < arraySize; ++i) { - auto temp2 = temp[i]; - using array_type = typename T1::value_type; - if constexpr (std::is_arithmetic_v) { - model_data[i] = temp2; - } else if constexpr (is_std_array_v) { - size_t arraySize2 = array_size_v; - using sub_array_type = typename array_type::value_type; - if constexpr (std::is_arithmetic_v) { - for (size_t j = 0; j < arraySize2; ++j) { - model_data[i][j] = temp2[j]; - } - } else { - static_assert(std::is_arithmetic_v, - "A01161013:模板参数T1是std::" - "array类型时,它的数组嵌套不能超过两层"); - } - } else { - static_assert(std::is_arithmetic_v - || is_std_array_v, - "A01161014:模板参数T1是std::array类型时,它的value_" - "type必须是算术类型或std::array类型"); - } - } - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161015:模板参数T1必须是算术类型或std::array类型"); - } - } - } - - template - void assign_value_set(eprosima::fastcdr::optional &data, const T2 &model_data) - { - if constexpr (std::is_arithmetic_v) { - static_assert(std::is_arithmetic_v, "A01161016:模板参数T2必须是算术类型"); - static_assert(std::is_convertible_v, - "A01161017:模板参数T2必须可以转换为T1类型"); - data = model_data; - } else if constexpr (is_std_array_v) { - T1 temp; - size_t arraySize = array_size_v; - using array_type = typename T1::value_type; - for (size_t i = 0; i < arraySize; ++i) { - if constexpr (std::is_arithmetic_v) { - temp[i] = model_data[i]; - } else if constexpr (is_std_array_v) { - size_t arraySize2 = array_size_v; - using sub_array_type = typename array_type::value_type; - if constexpr (std::is_arithmetic_v) { - for (size_t j = 0; j < arraySize2; ++j) { - temp[i][j] = model_data[i][j]; - } - } else { - static_assert( - std::is_arithmetic_v, - "A01161018:模板参数T1是std::array类型时,它的数组嵌套不能超过两层"); - } - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161019:模板参数T1是std::array类型时,它的value_" - "type必须是算术类型或std::array类型"); - } - } - data = temp; - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161020:模板参数T1必须是算术类型或std::array类型"); - } - } - virtual void clearOutData() {} virtual void sendOutData() {} @@ -382,7 +56,7 @@ protected: std::unordered_map> getDataFunction; std::unordered_map> setDataFunction; std::vector> getByteArrayFunction; - std::vector> setByteArrayFunction; + std::vector> setByteArrayFunction; std::mutex dataMutex; std::mutex outDataMutex; uint8_t header[8]{0}; // 固定大小的头部 @@ -391,11 +65,11 @@ protected: }; #define MAP_DATA_FUNC(NAME) \ - getDataFunction[#NAME] = [this]() { return getString(data.NAME()); }; \ + getDataFunction[#NAME] = [this]() { return StringSerializer(data.NAME()); }; \ setDataFunction[#NAME] = [this](const std::string &value) { \ - setDataFromString(out_data.NAME(), value); \ + StringDeserializer(out_data.NAME(), value); \ }; \ - getByteArrayFunction.push_back([this]() { return getByteArray(data.NAME()); }); \ - setByteArrayFunction.push_back([this](const XNByteArray &byteArray, uint32_t &pos) { \ - setByteArray(out_data.NAME(), byteArray, pos); \ + getByteArrayFunction.push_back([this]() { return ByteArraySerializer(data.NAME()); }); \ + setByteArrayFunction.push_back([this](const XNByteArray &byteArray) { \ + ByteArrayDeserializer(out_data.NAME(), byteArray); \ }); diff --git a/Release/include/XNCore/XNTypeTraits.h b/Release/include/XNCore/XNTypeTraits.h index e754392..2987af8 100644 --- a/Release/include/XNCore/XNTypeTraits.h +++ b/Release/include/XNCore/XNTypeTraits.h @@ -2,37 +2,72 @@ #include #include #include +#include +#include "XNByteArray.h" +/** + * @brief 检查类型是否为std::array + * @tparam T 要检查的类型 + * @return 默认返回std::false_type + */ template struct is_std_array : std::false_type { }; +/** + * @brief 检查类型是否为std::array + * @tparam T 要检查的类型 + * @tparam N 数组大小 + * @return 如果T是std::array,返回true + */ template struct is_std_array> : std::true_type { }; -// 变量模板简化使用 +/** + * @brief is_std_array的简化 + * @tparam T 要检查的类型 + * @return 如果是std::array,返回true;否则返回false + */ template inline constexpr bool is_std_array_v = is_std_array::value; /** * @brief 获取类型的数组大小 * @tparam T 要检查的类型 - * @return 如果是std::array,返回其大小;否则返回1 + * @return 默认返回1 */ template struct array_size : std::integral_constant { }; +/** + * @brief 获取类型的数组大小 + * @tparam T 要检查的类型 + * @tparam N 数组大小 + * @return 返回数组大小 + */ template struct array_size> : std::integral_constant { }; -// 变量模板简化使用 +template +struct array_size : std::integral_constant { +}; + +/** + * @brief 获取类型的数组大小 + * @tparam T 要检查的类型 + * @return 返回数组大小 + */ template inline constexpr std::size_t array_size_v = array_size::value; -// 获取类型大小的辅助函数 +/** + * @brief 获取类型的字节大小 + * @tparam T 要检查的类型 + * @return 返回字节大小 + */ template constexpr size_t getTypeSize() { @@ -44,6 +79,11 @@ constexpr size_t getTypeSize() } } +/** + * @brief 获取类型的数组整体大小 + * @tparam T 要检查的类型 + * @return 返回数组整体大小 + */ template constexpr size_t getArrayWholeSize() { @@ -54,3 +94,360 @@ constexpr size_t getArrayWholeSize() return 1; } } + +/** + * @brief 检查类型是否为optional + * @tparam T 要检查的类型 + * @return 默认返回std::false_type + */ +template +struct is_optional : std::false_type { +}; + +/** + * @brief 检查类型是否为optional + * @tparam T 要检查的类型 + * @return 如果T是eprosima::fastcdr::optional,返回true + */ +template +struct is_optional> + : std::is_same, eprosima::fastcdr::optional> { +}; + +/** + * @brief is_optional的简化 + * @tparam T 要检查的类型 + * @return 如果是optional,返回true;否则返回false + */ +template +constexpr bool is_optional_v = is_optional::value; + +/** + * @brief 序列化器 + * @tparam T 要序列化的类型 + * @tparam RT 返回类型 + */ +template +struct Serializer; + +/** + * @brief 序列化器 + * @tparam T 要序列化的类型 + * @tparam RT 返回类型特化为XNByteArray + */ +template +struct Serializer { + static XNByteArray Serialize(const T &data) + { + XNByteArray result; + if constexpr (std::is_arithmetic_v) { + // 如果T是算术类型,则直接序列化 + XNByteArray temp(sizeof(T)); + std::memcpy(temp.data(), &data, sizeof(T)); + result.append(temp); + } else if constexpr (is_std_array_v) { + // 如果T是std::array,则序列化每个元素 + for (std::size_t i = 0; i < array_size_v; ++i) { + //递归调用序列化器 + result.append(Serializer::Serialize(data[i])); + } + } else if constexpr (is_optional_v) { + // 如果T是optional,则序列化其值 + if (data) { + //递归调用序列化器 + result.append(Serializer::Serialize(data.value())); + } else { + typename T::type zero{}; + //递归调用序列化器 + result.append(Serializer::Serialize(zero)); + } + } else { + // 如果T是其他类型,则抛出异常 + static_assert(std::is_arithmetic_v || is_std_array_v || is_optional_v, + "A01011001:不支持的类型T"); + } + return result; + } +}; + +/** + * @brief 序列化器 + * @tparam T 要序列化的类型 + * @tparam RT 返回类型特化为std::string + */ +template +struct Serializer { + static std::string Serialize(const T &data) + { + if constexpr (std::is_arithmetic_v) { + // 如果T是算术类型,则直接序列化 + return std::to_string(data); + } else if constexpr (is_std_array_v) { + // 如果T是std::array,则序列化每个元素 + std::string result; + for (std::size_t i = 0; i < array_size_v; ++i) { + //递归调用序列化器 + result += Serializer::Serialize(data[i]); + // 如果i不是最后一个元素,则添加逗号 + if (i != array_size_v - 1) { + result += ","; + } + } + return result; + } else if constexpr (is_optional_v) { + // 如果T是optional,则序列化其值 + if (data) { + //递归调用序列化器 + return Serializer::Serialize(data.value()); + } else { + // 如果T是optional,但值为空,则返回全0 + typename T::type zero{}; + //递归调用序列化器 + return Serializer::Serialize(zero); + } + } else { + static_assert(std::is_arithmetic_v || is_std_array_v || is_optional_v, + "A01011002:不支持的类型T"); + } + } +}; + +/** + * @brief 反序列化器 + * @tparam T 要反序列化的类型 + * @tparam RT 返回类型 + */ +template +struct Deserializer; + +/** + * @brief 反序列化器 + * @tparam T 要反序列化的类型 + * @tparam RT 返回类型特化为XNByteArray + */ +template +struct Deserializer { + static void Deserialize(T &data, const XNByteArray &byteArray) + { + if constexpr (is_optional_v) { + // 如果T是optional,则先将其初始化为有效值 + data = typename T::type{}; + //递归调用反序列化器 + Deserializer::Deserialize(data.value(), byteArray); + } else { + // 如果T是其他类型,则检查字节数组大小是否与目标类型大小一致 + if (getTypeSize() != byteArray.size()) { + // 如果大小不一致,则直接返回 + return; + } + if constexpr (std::is_arithmetic_v) { + // 如果T是算术类型,则直接复制字节数组 + std::memcpy(&data, byteArray.data(), byteArray.size()); + } else if constexpr (is_std_array_v) { + // 如果T是std::array,则先分割字节数组 + auto subArray = byteArray.segment(getTypeSize()); + for (std::size_t i = 0; i < array_size_v; ++i) { + //递归调用反序列化器 + Deserializer::Deserialize(data[i], + subArray[i]); + } + } else { + // 如果T是其他类型,则抛出异常 + static_assert(std::is_arithmetic_v || is_std_array_v || is_optional_v, + "A01011003:不支持的类型T"); + } + } + } +}; + +/** + * @brief 反序列化器 + * @tparam T 要反序列化的类型 + * @tparam RT 返回类型特化为std::string + */ +template +struct Deserializer { + static void Deserialize(T &data, const std::string &str) + { + // 如果字符串为空,则直接返回 + if (str.empty()) { + return; + } + if constexpr (is_optional_v) { + // 如果T是optional,则先将其初始化为有效值 + data = typename T::type{}; + //递归调用反序列化器 + Deserializer::Deserialize(data.value(), str); + } else { + if constexpr (std::is_arithmetic_v) { + // 如果T是算术类型,则直接转换字符串 + if constexpr (std::is_same_v || std::is_same_v) { + data = XNSim::safe_stod(str); + } else { + data = XNSim::safe_stoll(str); + } + } else if constexpr (is_std_array_v) { + // 如果T是std::array,则先分割字符串 + std::vector items; + std::stringstream ss(str); + std::string item; + while (std::getline(ss, item, ',')) { + items.push_back(item); + } + // 如果字符串大小与目标类型大小不一致,则直接返回 + if (items.size() != getArrayWholeSize()) { + return; + } + if constexpr (std::is_arithmetic_v) { + // 如果std::array的元素是算术类型,则直接反序列化 + for (std::size_t i = 0; i < array_size_v; ++i) { + //递归调用反序列化器 + Deserializer::Deserialize(data[i], + items[i]); + } + } else if constexpr (is_std_array_v) { + // 如果std::array的元素是std::array,则先获取子数组大小 + auto sub_size = getArrayWholeSize(); + //将items分割成sub_size大小的子数组,并拼接成一个字符串 + std::vector sub_items; + for (std::size_t i = 0; i < items.size(); i += sub_size) { + std::string sub_item; + for (std::size_t j = 0; j < sub_size; ++j) { + sub_item += items[i + j]; + if (j != sub_size - 1) { + sub_item += ","; + } + } + sub_items.push_back(sub_item); + } + // 使用拼接后的字符串,递归调用反序列化器 + for (std::size_t i = 0; i < array_size_v; ++i) { + Deserializer::Deserialize( + data[i], sub_items[i]); + } + } else { + // 如果std::array的元素是其他类型,则抛出异常 + static_assert(std::is_arithmetic_v + || is_std_array_v, + "A01011004:不支持的类型T"); + } + } else { + // 如果T是其他类型,则抛出异常 + static_assert(std::is_arithmetic_v || is_std_array_v || is_optional_v, + "A01011005:不支持的类型T"); + } + } + } +}; + +/** + * @brief 字符串序列化器函数 + * @tparam T 要序列化的类型 + */ +template +std::string StringSerializer(const T &data) +{ + return Serializer::Serialize(data); +} + +/** + * @brief 字符串反序列化器函数 + * @tparam T 要反序列化的类型 + */ +template +void StringDeserializer(T &data, const std::string &str) +{ + Deserializer::Deserialize(data, str); +} + +/** + * @brief 字节数组序列化器别名 + * @tparam T 要序列化的类型 + */ +template +XNByteArray ByteArraySerializer(const T &data) +{ + return Serializer::Serialize(data); +} + +/** + * @brief 字节数组反序列化器函数 + * @tparam T 要反序列化的类型 + */ +template +void ByteArrayDeserializer(T &data, const XNByteArray &byteArray) +{ + Deserializer::Deserialize(data, byteArray); +} + +/** + * @brief 赋值函数 + * @tparam T1 目标类型 + * @tparam T2 源类型 + * @param dst 目标变量 + * @param src 源变量 + */ +template +void assign_value(T1 &dst, const T2 &src) +{ + if constexpr (std::is_arithmetic_v && std::is_arithmetic_v) { + // 如果T1和T2都是算术类型,则直接赋值 + static_assert(std::is_convertible_v, "A01011006:模板参数T2必须可以转换为T1类型"); + dst = src; + } else if constexpr ((is_std_array_v || std::is_array_v || std::is_pointer_v) + && (is_std_array_v || std::is_array_v || std::is_pointer_v)) { + // 如果T1和T2都是指针类型,则无法赋值 + static_assert(!(std::is_pointer_v && std::is_pointer_v), + "A01011008: 不支持的类型组合"); + size_t array_size; + if constexpr (std::is_pointer_v && !std::is_pointer_v) { + // 如果T1是指针类型, 则使用T2的数组大小 + array_size = array_size_v; + } else if constexpr (!std::is_pointer_v && std::is_pointer_v) { + // 如果T1不是指针类型, 则使用T1的数组大小 + array_size = array_size_v; + } else { + // 如果T1和T2都是数组类型, 则检查数组大小是否相同 + static_assert(array_size_v == array_size_v, + "A01011007:模板参数T1和T2的数组大小必须相同"); + //使用T1的数组大小 + array_size = array_size_v; + } + for (size_t i = 0; i < array_size; ++i) { + //递归调用赋值函数 + assign_value(dst[i], src[i]); + } + } else if constexpr (is_optional_v && !is_optional_v) { + // 如果T1是optional,T2不是optional,则先初始化T1 + dst = typename T1::type{}; + //递归调用赋值函数 + assign_value(dst.value(), src); + } else if constexpr (!is_optional_v && is_optional_v) { + // 如果T1不是optional,T2是optional,则判断T2是否为空 + if (src) { + //递归调用赋值函数 + assign_value(dst, src.value()); + } + } else if constexpr (is_optional_v && is_optional_v) { + // 如果T1和T2都是optional,则判断T2是否为空 + if (src) { + // 如果T2不为空,则将T2赋值给T1 + dst = src; + } + } else { + // 如果T1和T2都不是算术类型、std::array、数组或optional,则抛出异常 + static_assert((std::is_arithmetic_v || is_std_array_v || std::is_array_v + || is_optional_v), + "A01011008: 不支持的类型T1"); + // 如果T2不是算术类型、std::array、数组或optional,则抛出异常 + static_assert((std::is_arithmetic_v || is_std_array_v || std::is_array_v + || is_optional_v), + "A01011009: 不支持的类型T2"); + // 如果T1是算术类型,T2是std::array或数组,则抛出异常 + static_assert(!(std::is_arithmetic_v && (is_std_array_v || std::is_array_v)), + "A01011010: 不支持的类型组合"); + // 如果T1是std::array或数组,T2是算术类型,则抛出异常 + static_assert(!((is_std_array_v || std::is_array_v) && std::is_arithmetic_v), + "A01011011: 不支持的类型组合"); + } +} \ No newline at end of file diff --git a/XNCore/XNByteArray.h b/XNCore/XNByteArray.h index b6ba387..e728068 100644 --- a/XNCore/XNByteArray.h +++ b/XNCore/XNByteArray.h @@ -94,6 +94,71 @@ public: */ void reserve(size_t size) { data_.reserve(size); } + /** + * @brief 按指定大小分段 + * @param segmentSize 每段的大小 + * @return 分段后的XNByteArray向量,如果不能整除则返回空向量 + */ + std::vector segment(size_t segmentSize) const + { + if (segmentSize == 0) { + return {}; + } + + size_t totalSize = data_.size(); + + // 检查是否能够整除 + if (totalSize % segmentSize != 0) { + return {}; + } + + std::vector segments; + size_t numSegments = totalSize / segmentSize; + segments.reserve(numSegments); + + for (size_t i = 0; i < totalSize; i += segmentSize) { + segments.emplace_back(data_.data() + i, segmentSize); + } + + return segments; + } + + /** + * @brief 获取指定范围的子数组 + * @param start 起始位置 + * @param length 长度 + * @return 子数组 + */ + XNByteArray mid(size_t start, size_t length = SIZE_MAX) const + { + if (start >= data_.size()) { + return XNByteArray{}; + } + + size_t actualLength = std::min(length, data_.size() - start); + return XNByteArray(data_.data() + start, actualLength); + } + + /** + * @brief 获取左侧子数组 + * @param length 长度 + * @return 左侧子数组 + */ + XNByteArray left(size_t length) const { return mid(0, length); } + + /** + * @brief 获取右侧子数组 + * @param length 长度 + * @return 右侧子数组 + */ + XNByteArray right(size_t length) const + { + if (length >= data_.size()) { + return *this; + } + return mid(data_.size() - length, length); + } + private: std::vector data_; }; \ No newline at end of file diff --git a/XNCore/XNDDSInterface.cpp b/XNCore/XNDDSInterface.cpp index 1f58b51..06ccb81 100644 --- a/XNCore/XNDDSInterface.cpp +++ b/XNCore/XNDDSInterface.cpp @@ -50,14 +50,13 @@ void XNDDSInterface::setDataByUDPPackage(const XNByteArray &package) return; } - uint32_t currentPos = 8; - + XNByteArray byteArray = package.mid(8, packageSize - 8); // 设置数据 { std::lock_guard lock(outDataMutex); clearOutData(); for (auto &func : setByteArrayFunction) { - func(package, currentPos); + func(byteArray); } } sendOutData(); diff --git a/XNCore/XNDDSInterface.h b/XNCore/XNDDSInterface.h index bfc6f65..e4578a9 100644 --- a/XNCore/XNDDSInterface.h +++ b/XNCore/XNDDSInterface.h @@ -49,332 +49,6 @@ public: void setDataByString(const std::unordered_map &data); protected: - /** - * @brief 获取指定变量的字节数据,用于网络通信 - * @param data: 数据 - * @return 字节数组 - */ - template - XNByteArray getByteArray(const eprosima::fastcdr::optional &data) - { - XNByteArray result(getTypeSize()); - - if constexpr (std::is_arithmetic_v) { - if (data) { - std::memcpy(result.data(), &data.value(), sizeof(T)); - } else { - T zero = 0; - std::memcpy(result.data(), &zero, sizeof(T)); - } - } else if constexpr (is_std_array_v) { - if (data) { - return getByteArrayFromStdArray(data.value()); - } else { - T zero = {}; - return getByteArrayFromStdArray(zero); - } - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161001:T 必须是算术类型或std::array类型"); - } - - return result; - } - - /** - * @brief 设置指定变量的字节数据,用于网络通信 - * @param data: 数据 - * @param byteArray: 字节数组 - */ - template - void setByteArray(eprosima::fastcdr::optional &data, const XNByteArray &byteArray, - uint32_t &pos) - { - uint32_t thisSize = getTypeSize(); - XNByteArray thisArray(thisSize); - if (pos + thisSize > byteArray.size()) { - return; - } - std::memcpy(thisArray.data(), byteArray.data() + pos, thisSize); - pos += thisSize; - - if constexpr (std::is_arithmetic_v) { - T temp; - std::memcpy(&temp, thisArray.data(), sizeof(T)); - data = temp; - } else if constexpr (is_std_array_v) { - if (!data) { - data = T{}; - } - setByteArrayFromStdArray(data.value(), thisArray); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161002:T 必须是算术类型或std::array类型"); - } - } - - /** - * @brief 获取指定数组变量的字节数据,用于网络通信 - * @param data: 数据 - * @return 字节数组 - */ - template - XNByteArray getByteArrayFromStdArray(const std::array &data) - { - XNByteArray result(getTypeSize() * N); - - for (std::size_t i = 0; i < N; ++i) { - if constexpr (std::is_arithmetic_v) { - std::memcpy(result.data() + i * getTypeSize(), &data[i], getTypeSize()); - } else if constexpr (is_std_array_v) { - XNByteArray subArray = getByteArrayFromStdArray(data[i]); - std::memcpy(result.data() + i * getTypeSize(), subArray.data(), - getTypeSize()); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161003:T 必须是算术类型或std::array类型"); - } - } - - return result; - } - - /** - * @brief 设置指定数组变量的字节数据,用于网络通信 - * @param data: 数据 - * @param byteArray: 字节数组 - */ - template - void setByteArrayFromStdArray(std::array &data, const XNByteArray &byteArray) - { - if (byteArray.size() < getTypeSize() * N) - return; - - for (std::size_t i = 0; i < N; ++i) { - if constexpr (std::is_arithmetic_v) { - std::memcpy(&data[i], byteArray.data() + i * getTypeSize(), getTypeSize()); - } else if constexpr (is_std_array_v) { - XNByteArray subArray(byteArray.data() + i * getTypeSize(), getTypeSize()); - setByteArrayFromStdArray(data[i], subArray); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161004:T 必须是算术类型或std::array类型"); - } - } - } - - /** - * @brief 获取指定变量的字符串数据,用于JSON前端 - * @param data: 数据 - * @return: 数据(字符串格式) - */ - template - std::string getString(const eprosima::fastcdr::optional &data) - { - if constexpr (std::is_arithmetic_v) { - if (data) { - return std::to_string(data.value()); - } else { - return "0"; - } - } else if constexpr (is_std_array_v) { - if (data) { - return getStringFromStdArray(data.value()); - } else { - T zero = {}; - return getStringFromStdArray(zero); - } - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161005:T 必须是算术类型或std::array类型"); - } - return std::string(); - } - - /** - * @brief 通过字符串数据设置指定变量,用于JSON前端 - * @param data: 数据 - * @param value: 字符串数据 - */ - template - void setDataFromString(eprosima::fastcdr::optional &data, const std::string &value) - { - if constexpr (std::is_arithmetic_v) { - if constexpr (std::is_same_v || std::is_same_v) { - data = XNSim::safe_stod(value); - } else { - data = XNSim::safe_stoll(value); - } - } else if constexpr (is_std_array_v) { - // 解析输入字符串 - std::stringstream ss(value); - std::string item; - std::vector items; - while (std::getline(ss, item, ',')) { - items.push_back(item); - } - if (items.size() != getArrayWholeSize()) { - LOG_WARNING("A01163006:数组大小不一致, 设置数据失败!"); - return; - } - T temp; - setStdArrayFromString(temp, items, 0); - data = temp; - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161007:T 必须是算术类型或std::array类型"); - } - } - - /** - * @brief 获取指定数组变量的字符串数据,用于JSON前端 - * @param data: 数据 - * @return: 数据(字符串格式) - */ - template - std::string getStringFromStdArray(const std::array &data) - { - std::stringstream ss; - for (std::size_t i = 0; i < N; ++i) { - if (i > 0) - ss << ","; - if constexpr (std::is_arithmetic_v) { - if constexpr (std::is_same_v) { - ss << static_cast(data[i]); - } else if constexpr (std::is_same_v) { - ss << static_cast(data[i]); - } else { - ss << data[i]; - } - } else if constexpr (is_std_array_v) { - ss << getStringFromStdArray(data[i]); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161008:T 必须是算术类型或std::array类型"); - } - } - return ss.str(); - } - - /** - * @brief 通过字符串数据设置指定数组变量,用于JSON前端 - * @param data: 数据 - * @param value: 字符串数据,格式为"数字,数字,..." - * @param start_pos: 当前数组在输入字符串中的起始位置 - * @return 处理完当前数组后,下一个数组的起始位置 - * @throw std::runtime_error: 当输入数据格式不正确时抛出异常 - */ - template - size_t setStdArrayFromString(std::array &data, const std::vector &value, - size_t start_pos = 0) - { - // 递归处理每个元素 - for (std::size_t i = 0; i < N; ++i) { - try { - if constexpr (std::is_arithmetic_v) { - // 对于基本类型,直接转换 - if constexpr (std::is_same_v || std::is_same_v) { - data[i] = static_cast(XNSim::safe_stod(value[start_pos + i])); - } else { - data[i] = static_cast(XNSim::safe_stoll(value[start_pos + i])); - } - } else if constexpr (is_std_array_v) { - // 对于嵌套数组,递归处理 - start_pos = setStdArrayFromString(data[i], value, start_pos); - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161009:T 必须是算术类型或std::array类型"); - } - } catch (const std::exception &e) { - LOG_WARNING("A01163010:无法解析第 %1 个元素: %2", i, e.what()); - } - } - return start_pos + N; - } - - template - void assign_value_get(const eprosima::fastcdr::optional &data, T2 &model_data) - { - if (data) { - auto temp = data.value(); - if constexpr (std::is_arithmetic_v) { - static_assert(std::is_arithmetic_v, "A01161011:模板参数T2必须是算术类型"); - static_assert(std::is_convertible_v, - "A01161012:模板参数T1必须可以转换为T2类型"); - model_data = temp; - } else if constexpr (is_std_array_v) { - size_t arraySize = array_size_v; - for (size_t i = 0; i < arraySize; ++i) { - auto temp2 = temp[i]; - using array_type = typename T1::value_type; - if constexpr (std::is_arithmetic_v) { - model_data[i] = temp2; - } else if constexpr (is_std_array_v) { - size_t arraySize2 = array_size_v; - using sub_array_type = typename array_type::value_type; - if constexpr (std::is_arithmetic_v) { - for (size_t j = 0; j < arraySize2; ++j) { - model_data[i][j] = temp2[j]; - } - } else { - static_assert(std::is_arithmetic_v, - "A01161013:模板参数T1是std::" - "array类型时,它的数组嵌套不能超过两层"); - } - } else { - static_assert(std::is_arithmetic_v - || is_std_array_v, - "A01161014:模板参数T1是std::array类型时,它的value_" - "type必须是算术类型或std::array类型"); - } - } - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161015:模板参数T1必须是算术类型或std::array类型"); - } - } - } - - template - void assign_value_set(eprosima::fastcdr::optional &data, const T2 &model_data) - { - if constexpr (std::is_arithmetic_v) { - static_assert(std::is_arithmetic_v, "A01161016:模板参数T2必须是算术类型"); - static_assert(std::is_convertible_v, - "A01161017:模板参数T2必须可以转换为T1类型"); - data = model_data; - } else if constexpr (is_std_array_v) { - T1 temp; - size_t arraySize = array_size_v; - using array_type = typename T1::value_type; - for (size_t i = 0; i < arraySize; ++i) { - if constexpr (std::is_arithmetic_v) { - temp[i] = model_data[i]; - } else if constexpr (is_std_array_v) { - size_t arraySize2 = array_size_v; - using sub_array_type = typename array_type::value_type; - if constexpr (std::is_arithmetic_v) { - for (size_t j = 0; j < arraySize2; ++j) { - temp[i][j] = model_data[i][j]; - } - } else { - static_assert( - std::is_arithmetic_v, - "A01161018:模板参数T1是std::array类型时,它的数组嵌套不能超过两层"); - } - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161019:模板参数T1是std::array类型时,它的value_" - "type必须是算术类型或std::array类型"); - } - } - data = temp; - } else { - static_assert(std::is_arithmetic_v || is_std_array_v, - "A01161020:模板参数T1必须是算术类型或std::array类型"); - } - } - virtual void clearOutData() {} virtual void sendOutData() {} @@ -382,7 +56,7 @@ protected: std::unordered_map> getDataFunction; std::unordered_map> setDataFunction; std::vector> getByteArrayFunction; - std::vector> setByteArrayFunction; + std::vector> setByteArrayFunction; std::mutex dataMutex; std::mutex outDataMutex; uint8_t header[8]{0}; // 固定大小的头部 @@ -391,11 +65,11 @@ protected: }; #define MAP_DATA_FUNC(NAME) \ - getDataFunction[#NAME] = [this]() { return getString(data.NAME()); }; \ + getDataFunction[#NAME] = [this]() { return StringSerializer(data.NAME()); }; \ setDataFunction[#NAME] = [this](const std::string &value) { \ - setDataFromString(out_data.NAME(), value); \ + StringDeserializer(out_data.NAME(), value); \ }; \ - getByteArrayFunction.push_back([this]() { return getByteArray(data.NAME()); }); \ - setByteArrayFunction.push_back([this](const XNByteArray &byteArray, uint32_t &pos) { \ - setByteArray(out_data.NAME(), byteArray, pos); \ + getByteArrayFunction.push_back([this]() { return ByteArraySerializer(data.NAME()); }); \ + setByteArrayFunction.push_back([this](const XNByteArray &byteArray) { \ + ByteArrayDeserializer(out_data.NAME(), byteArray); \ }); diff --git a/XNCore/XNTypeTraits.h b/XNCore/XNTypeTraits.h index e754392..2987af8 100644 --- a/XNCore/XNTypeTraits.h +++ b/XNCore/XNTypeTraits.h @@ -2,37 +2,72 @@ #include #include #include +#include +#include "XNByteArray.h" +/** + * @brief 检查类型是否为std::array + * @tparam T 要检查的类型 + * @return 默认返回std::false_type + */ template struct is_std_array : std::false_type { }; +/** + * @brief 检查类型是否为std::array + * @tparam T 要检查的类型 + * @tparam N 数组大小 + * @return 如果T是std::array,返回true + */ template struct is_std_array> : std::true_type { }; -// 变量模板简化使用 +/** + * @brief is_std_array的简化 + * @tparam T 要检查的类型 + * @return 如果是std::array,返回true;否则返回false + */ template inline constexpr bool is_std_array_v = is_std_array::value; /** * @brief 获取类型的数组大小 * @tparam T 要检查的类型 - * @return 如果是std::array,返回其大小;否则返回1 + * @return 默认返回1 */ template struct array_size : std::integral_constant { }; +/** + * @brief 获取类型的数组大小 + * @tparam T 要检查的类型 + * @tparam N 数组大小 + * @return 返回数组大小 + */ template struct array_size> : std::integral_constant { }; -// 变量模板简化使用 +template +struct array_size : std::integral_constant { +}; + +/** + * @brief 获取类型的数组大小 + * @tparam T 要检查的类型 + * @return 返回数组大小 + */ template inline constexpr std::size_t array_size_v = array_size::value; -// 获取类型大小的辅助函数 +/** + * @brief 获取类型的字节大小 + * @tparam T 要检查的类型 + * @return 返回字节大小 + */ template constexpr size_t getTypeSize() { @@ -44,6 +79,11 @@ constexpr size_t getTypeSize() } } +/** + * @brief 获取类型的数组整体大小 + * @tparam T 要检查的类型 + * @return 返回数组整体大小 + */ template constexpr size_t getArrayWholeSize() { @@ -54,3 +94,360 @@ constexpr size_t getArrayWholeSize() return 1; } } + +/** + * @brief 检查类型是否为optional + * @tparam T 要检查的类型 + * @return 默认返回std::false_type + */ +template +struct is_optional : std::false_type { +}; + +/** + * @brief 检查类型是否为optional + * @tparam T 要检查的类型 + * @return 如果T是eprosima::fastcdr::optional,返回true + */ +template +struct is_optional> + : std::is_same, eprosima::fastcdr::optional> { +}; + +/** + * @brief is_optional的简化 + * @tparam T 要检查的类型 + * @return 如果是optional,返回true;否则返回false + */ +template +constexpr bool is_optional_v = is_optional::value; + +/** + * @brief 序列化器 + * @tparam T 要序列化的类型 + * @tparam RT 返回类型 + */ +template +struct Serializer; + +/** + * @brief 序列化器 + * @tparam T 要序列化的类型 + * @tparam RT 返回类型特化为XNByteArray + */ +template +struct Serializer { + static XNByteArray Serialize(const T &data) + { + XNByteArray result; + if constexpr (std::is_arithmetic_v) { + // 如果T是算术类型,则直接序列化 + XNByteArray temp(sizeof(T)); + std::memcpy(temp.data(), &data, sizeof(T)); + result.append(temp); + } else if constexpr (is_std_array_v) { + // 如果T是std::array,则序列化每个元素 + for (std::size_t i = 0; i < array_size_v; ++i) { + //递归调用序列化器 + result.append(Serializer::Serialize(data[i])); + } + } else if constexpr (is_optional_v) { + // 如果T是optional,则序列化其值 + if (data) { + //递归调用序列化器 + result.append(Serializer::Serialize(data.value())); + } else { + typename T::type zero{}; + //递归调用序列化器 + result.append(Serializer::Serialize(zero)); + } + } else { + // 如果T是其他类型,则抛出异常 + static_assert(std::is_arithmetic_v || is_std_array_v || is_optional_v, + "A01011001:不支持的类型T"); + } + return result; + } +}; + +/** + * @brief 序列化器 + * @tparam T 要序列化的类型 + * @tparam RT 返回类型特化为std::string + */ +template +struct Serializer { + static std::string Serialize(const T &data) + { + if constexpr (std::is_arithmetic_v) { + // 如果T是算术类型,则直接序列化 + return std::to_string(data); + } else if constexpr (is_std_array_v) { + // 如果T是std::array,则序列化每个元素 + std::string result; + for (std::size_t i = 0; i < array_size_v; ++i) { + //递归调用序列化器 + result += Serializer::Serialize(data[i]); + // 如果i不是最后一个元素,则添加逗号 + if (i != array_size_v - 1) { + result += ","; + } + } + return result; + } else if constexpr (is_optional_v) { + // 如果T是optional,则序列化其值 + if (data) { + //递归调用序列化器 + return Serializer::Serialize(data.value()); + } else { + // 如果T是optional,但值为空,则返回全0 + typename T::type zero{}; + //递归调用序列化器 + return Serializer::Serialize(zero); + } + } else { + static_assert(std::is_arithmetic_v || is_std_array_v || is_optional_v, + "A01011002:不支持的类型T"); + } + } +}; + +/** + * @brief 反序列化器 + * @tparam T 要反序列化的类型 + * @tparam RT 返回类型 + */ +template +struct Deserializer; + +/** + * @brief 反序列化器 + * @tparam T 要反序列化的类型 + * @tparam RT 返回类型特化为XNByteArray + */ +template +struct Deserializer { + static void Deserialize(T &data, const XNByteArray &byteArray) + { + if constexpr (is_optional_v) { + // 如果T是optional,则先将其初始化为有效值 + data = typename T::type{}; + //递归调用反序列化器 + Deserializer::Deserialize(data.value(), byteArray); + } else { + // 如果T是其他类型,则检查字节数组大小是否与目标类型大小一致 + if (getTypeSize() != byteArray.size()) { + // 如果大小不一致,则直接返回 + return; + } + if constexpr (std::is_arithmetic_v) { + // 如果T是算术类型,则直接复制字节数组 + std::memcpy(&data, byteArray.data(), byteArray.size()); + } else if constexpr (is_std_array_v) { + // 如果T是std::array,则先分割字节数组 + auto subArray = byteArray.segment(getTypeSize()); + for (std::size_t i = 0; i < array_size_v; ++i) { + //递归调用反序列化器 + Deserializer::Deserialize(data[i], + subArray[i]); + } + } else { + // 如果T是其他类型,则抛出异常 + static_assert(std::is_arithmetic_v || is_std_array_v || is_optional_v, + "A01011003:不支持的类型T"); + } + } + } +}; + +/** + * @brief 反序列化器 + * @tparam T 要反序列化的类型 + * @tparam RT 返回类型特化为std::string + */ +template +struct Deserializer { + static void Deserialize(T &data, const std::string &str) + { + // 如果字符串为空,则直接返回 + if (str.empty()) { + return; + } + if constexpr (is_optional_v) { + // 如果T是optional,则先将其初始化为有效值 + data = typename T::type{}; + //递归调用反序列化器 + Deserializer::Deserialize(data.value(), str); + } else { + if constexpr (std::is_arithmetic_v) { + // 如果T是算术类型,则直接转换字符串 + if constexpr (std::is_same_v || std::is_same_v) { + data = XNSim::safe_stod(str); + } else { + data = XNSim::safe_stoll(str); + } + } else if constexpr (is_std_array_v) { + // 如果T是std::array,则先分割字符串 + std::vector items; + std::stringstream ss(str); + std::string item; + while (std::getline(ss, item, ',')) { + items.push_back(item); + } + // 如果字符串大小与目标类型大小不一致,则直接返回 + if (items.size() != getArrayWholeSize()) { + return; + } + if constexpr (std::is_arithmetic_v) { + // 如果std::array的元素是算术类型,则直接反序列化 + for (std::size_t i = 0; i < array_size_v; ++i) { + //递归调用反序列化器 + Deserializer::Deserialize(data[i], + items[i]); + } + } else if constexpr (is_std_array_v) { + // 如果std::array的元素是std::array,则先获取子数组大小 + auto sub_size = getArrayWholeSize(); + //将items分割成sub_size大小的子数组,并拼接成一个字符串 + std::vector sub_items; + for (std::size_t i = 0; i < items.size(); i += sub_size) { + std::string sub_item; + for (std::size_t j = 0; j < sub_size; ++j) { + sub_item += items[i + j]; + if (j != sub_size - 1) { + sub_item += ","; + } + } + sub_items.push_back(sub_item); + } + // 使用拼接后的字符串,递归调用反序列化器 + for (std::size_t i = 0; i < array_size_v; ++i) { + Deserializer::Deserialize( + data[i], sub_items[i]); + } + } else { + // 如果std::array的元素是其他类型,则抛出异常 + static_assert(std::is_arithmetic_v + || is_std_array_v, + "A01011004:不支持的类型T"); + } + } else { + // 如果T是其他类型,则抛出异常 + static_assert(std::is_arithmetic_v || is_std_array_v || is_optional_v, + "A01011005:不支持的类型T"); + } + } + } +}; + +/** + * @brief 字符串序列化器函数 + * @tparam T 要序列化的类型 + */ +template +std::string StringSerializer(const T &data) +{ + return Serializer::Serialize(data); +} + +/** + * @brief 字符串反序列化器函数 + * @tparam T 要反序列化的类型 + */ +template +void StringDeserializer(T &data, const std::string &str) +{ + Deserializer::Deserialize(data, str); +} + +/** + * @brief 字节数组序列化器别名 + * @tparam T 要序列化的类型 + */ +template +XNByteArray ByteArraySerializer(const T &data) +{ + return Serializer::Serialize(data); +} + +/** + * @brief 字节数组反序列化器函数 + * @tparam T 要反序列化的类型 + */ +template +void ByteArrayDeserializer(T &data, const XNByteArray &byteArray) +{ + Deserializer::Deserialize(data, byteArray); +} + +/** + * @brief 赋值函数 + * @tparam T1 目标类型 + * @tparam T2 源类型 + * @param dst 目标变量 + * @param src 源变量 + */ +template +void assign_value(T1 &dst, const T2 &src) +{ + if constexpr (std::is_arithmetic_v && std::is_arithmetic_v) { + // 如果T1和T2都是算术类型,则直接赋值 + static_assert(std::is_convertible_v, "A01011006:模板参数T2必须可以转换为T1类型"); + dst = src; + } else if constexpr ((is_std_array_v || std::is_array_v || std::is_pointer_v) + && (is_std_array_v || std::is_array_v || std::is_pointer_v)) { + // 如果T1和T2都是指针类型,则无法赋值 + static_assert(!(std::is_pointer_v && std::is_pointer_v), + "A01011008: 不支持的类型组合"); + size_t array_size; + if constexpr (std::is_pointer_v && !std::is_pointer_v) { + // 如果T1是指针类型, 则使用T2的数组大小 + array_size = array_size_v; + } else if constexpr (!std::is_pointer_v && std::is_pointer_v) { + // 如果T1不是指针类型, 则使用T1的数组大小 + array_size = array_size_v; + } else { + // 如果T1和T2都是数组类型, 则检查数组大小是否相同 + static_assert(array_size_v == array_size_v, + "A01011007:模板参数T1和T2的数组大小必须相同"); + //使用T1的数组大小 + array_size = array_size_v; + } + for (size_t i = 0; i < array_size; ++i) { + //递归调用赋值函数 + assign_value(dst[i], src[i]); + } + } else if constexpr (is_optional_v && !is_optional_v) { + // 如果T1是optional,T2不是optional,则先初始化T1 + dst = typename T1::type{}; + //递归调用赋值函数 + assign_value(dst.value(), src); + } else if constexpr (!is_optional_v && is_optional_v) { + // 如果T1不是optional,T2是optional,则判断T2是否为空 + if (src) { + //递归调用赋值函数 + assign_value(dst, src.value()); + } + } else if constexpr (is_optional_v && is_optional_v) { + // 如果T1和T2都是optional,则判断T2是否为空 + if (src) { + // 如果T2不为空,则将T2赋值给T1 + dst = src; + } + } else { + // 如果T1和T2都不是算术类型、std::array、数组或optional,则抛出异常 + static_assert((std::is_arithmetic_v || is_std_array_v || std::is_array_v + || is_optional_v), + "A01011008: 不支持的类型T1"); + // 如果T2不是算术类型、std::array、数组或optional,则抛出异常 + static_assert((std::is_arithmetic_v || is_std_array_v || std::is_array_v + || is_optional_v), + "A01011009: 不支持的类型T2"); + // 如果T1是算术类型,T2是std::array或数组,则抛出异常 + static_assert(!(std::is_arithmetic_v && (is_std_array_v || std::is_array_v)), + "A01011010: 不支持的类型组合"); + // 如果T1是std::array或数组,T2是算术类型,则抛出异常 + static_assert(!((is_std_array_v || std::is_array_v) && std::is_arithmetic_v), + "A01011011: 不支持的类型组合"); + } +} \ No newline at end of file diff --git a/XNInterfaceGenServer/DDSInterfaceGen.cpp b/XNInterfaceGenServer/DDSInterfaceGen.cpp index e2ef6f9..c9f480b 100644 --- a/XNInterfaceGenServer/DDSInterfaceGen.cpp +++ b/XNInterfaceGenServer/DDSInterfaceGen.cpp @@ -90,8 +90,8 @@ bool DDSInterfaceGen::generateDDSInterfaceHpp(const std::string &nameSpace, hppFile << "\t\t" << "if(model_data == nullptr)" << std::endl; hppFile << "\t\t\t" << "return;" << std::endl; for (const auto &interface : interfaceData) { - hppFile << "\t\t" << "assign_value_get(data." << interface.interfaceName - << "(), model_data->" << interface.interfaceName << ");" << std::endl; + hppFile << "\t\t" << "assign_value(model_data->" << interface.interfaceName << ", data." + << interface.interfaceName << "());" << std::endl; } hppFile << "\t" << "}" << std::endl; // 10. 写入设置数据模板函数 @@ -103,7 +103,7 @@ bool DDSInterfaceGen::generateDDSInterfaceHpp(const std::string &nameSpace, hppFile << "\t\t" << "std::lock_guard lock(outDataMutex);" << std::endl; hppFile << "\t\t" << "clearOutData();" << std::endl; for (const auto &interface : interfaceData) { - hppFile << "\t\t" << "assign_value_set(out_data." << interface.interfaceName + hppFile << "\t\t" << "assign_value(out_data." << interface.interfaceName << "(), model_data->" << interface.interfaceName << ");" << std::endl; } hppFile << "\t\t" << "sendOutData();" << std::endl; diff --git a/XNInterfaceGenServer/test/XNInterfaceGenTest.cpp b/XNInterfaceGenServer/test/XNInterfaceGenTest.cpp index 5744204..6fbf881 100644 --- a/XNInterfaceGenServer/test/XNInterfaceGenTest.cpp +++ b/XNInterfaceGenServer/test/XNInterfaceGenTest.cpp @@ -10,29 +10,107 @@ // 声明外部函数 extern "C" { - int XNInterfaceGen(const char *tableName, const int tableNameSize, const char *configName, - const int configNameSize, const char *errorMsg, const int errorMsgSize); + int XNInterfaceGen_Step1_InitParams(int configrationID, const char *errorMsg, + const int errorMsgSize); + int XNInterfaceGen_Step2_GetInterfaceData(const char *errorMsg, const int errorMsgSize); + int XNInterfaceGen_Step3_CreateConfigDir(const char *errorMsg, const int errorMsgSize); + int XNInterfaceGen_Step4_GenerateIDL(const char *errorMsg, const int errorMsgSize); + int XNInterfaceGen_Step5_GenerateFastDDS(const char *errorMsg, const int errorMsgSize); + int XNInterfaceGen_Step6_GenerateDDSInterface(const char *errorMsg, const int errorMsgSize); + int XNInterfaceGen_Step7_GenerateCMakeLists(const char *errorMsg, const int errorMsgSize); + int XNInterfaceGen_Step8_BuildAndInstall(const char *errorMsg, const int errorMsgSize); + int XNInterfaceGen_Step9_SudoLdconfig(const char *errorMsg, const int errorMsgSize); } int main() { // 测试参数 - const char *tableName = "DataInterface_1"; - const char *configName = "C909_V1"; - char errorMsg[1024] = {0}; // 错误信息缓冲区 + int configrationID = 1; // 配置ID + char errorMsg[1024] = {0}; // 错误信息缓冲区 - std::cout << "开始测试XNInterfaceGen..." << std::endl; + std::cout << "开始测试XNInterfaceGen步骤函数..." << std::endl; - // 调用XNInterfaceGen函数 - int ret = XNInterfaceGen(tableName, strlen(tableName), configName, strlen(configName), errorMsg, - sizeof(errorMsg)); - - // 检查结果 - if (ret == 0) { - std::cout << "测试成功!接口生成完成。" << std::endl; - } else { - std::cout << "测试失败!错误信息: " << errorMsg << std::endl; + // 步骤1: 初始化参数 + std::cout << "步骤1: 初始化参数..." << std::endl; + int ret = XNInterfaceGen_Step1_InitParams(configrationID, errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤1失败!错误信息: " << errorMsg << std::endl; + return ret; } + std::cout << "步骤1成功: " << errorMsg << std::endl; - return ret; + // 步骤2: 获取接口数据 + std::cout << "步骤2: 获取接口数据..." << std::endl; + ret = XNInterfaceGen_Step2_GetInterfaceData(errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤2失败!错误信息: " << errorMsg << std::endl; + return ret; + } + std::cout << "步骤2成功" << std::endl; + + // 步骤3: 创建配置目录 + std::cout << "步骤3: 创建配置目录..." << std::endl; + ret = XNInterfaceGen_Step3_CreateConfigDir(errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤3失败!错误信息: " << errorMsg << std::endl; + return ret; + } + std::cout << "步骤3成功" << std::endl; + + // 步骤4: 生成IDL + std::cout << "步骤4: 生成IDL..." << std::endl; + ret = XNInterfaceGen_Step4_GenerateIDL(errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤4失败!错误信息: " << errorMsg << std::endl; + return ret; + } + std::cout << "步骤4成功" << std::endl; + + // 步骤5: 生成FastDDS代码 + std::cout << "步骤5: 生成FastDDS代码..." << std::endl; + ret = XNInterfaceGen_Step5_GenerateFastDDS(errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤5失败!错误信息: " << errorMsg << std::endl; + return ret; + } + std::cout << "步骤5成功" << std::endl; + + // 步骤6: 生成DDS接口 + std::cout << "步骤6: 生成DDS接口..." << std::endl; + ret = XNInterfaceGen_Step6_GenerateDDSInterface(errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤6失败!错误信息: " << errorMsg << std::endl; + return ret; + } + std::cout << "步骤6成功" << std::endl; + + // 步骤7: 生成CMakeLists + std::cout << "步骤7: 生成CMakeLists..." << std::endl; + ret = XNInterfaceGen_Step7_GenerateCMakeLists(errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤7失败!错误信息: " << errorMsg << std::endl; + return ret; + } + std::cout << "步骤7成功" << std::endl; + + // 步骤8: 构建和安装 + std::cout << "步骤8: 构建和安装..." << std::endl; + ret = XNInterfaceGen_Step8_BuildAndInstall(errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤8失败!错误信息: " << errorMsg << std::endl; + return ret; + } + std::cout << "步骤8成功" << std::endl; + + // 步骤9: 执行ldconfig + std::cout << "步骤9: 执行ldconfig..." << std::endl; + ret = XNInterfaceGen_Step9_SudoLdconfig(errorMsg, sizeof(errorMsg)); + if (ret != 0) { + std::cout << "步骤9失败!错误信息: " << errorMsg << std::endl; + return ret; + } + std::cout << "步骤9成功" << std::endl; + + std::cout << "所有步骤测试成功!接口生成完成。" << std::endl; + return 0; } \ No newline at end of file diff --git a/XNModelGenServer/XNModelGen.cpp b/XNModelGenServer/XNModelGen.cpp index db5340b..a1cb2de 100644 --- a/XNModelGenServer/XNModelGen.cpp +++ b/XNModelGenServer/XNModelGen.cpp @@ -513,6 +513,15 @@ bool XNModelGen::GenerateCMakeLists() cmakeListsFile << "set(CMAKE_CXX_STANDARD_REQUIRED ON)" << std::endl; cmakeListsFile << "set(CMAKE_POSITION_INDEPENDENT_CODE ON)" << std::endl; cmakeListsFile << std::endl; + + // 设置默认构建类型为Release + cmakeListsFile << "if(NOT CMAKE_BUILD_TYPE)" << std::endl; + cmakeListsFile << "\tset(CMAKE_BUILD_TYPE Release CACHE STRING " + << "\"Choose the type of build (Debug, Release, RelWithDebInfo, MinSizeRel)\"" + << " FORCE)" << std::endl; + cmakeListsFile << "endif()" << std::endl; + cmakeListsFile << std::endl; + // 获取环境变量 cmakeListsFile << "if(DEFINED ENV{XNCore})" << std::endl; cmakeListsFile << " set(XNCore_PATH $ENV{XNCore})" << std::endl; diff --git a/XNMonitorServer/PluginGenerator.cpp b/XNMonitorServer/PluginGenerator.cpp index 5509e35..df57839 100644 --- a/XNMonitorServer/PluginGenerator.cpp +++ b/XNMonitorServer/PluginGenerator.cpp @@ -289,6 +289,14 @@ std::string PluginGenerator::generateCMakeListsContent() ss << "set(CMAKE_CXX_STANDARD 17)\n"; ss << "set(CMAKE_CXX_STANDARD_REQUIRED ON)\n\n"; + // 设置默认构建类型为Release + ss << "if(NOT CMAKE_BUILD_TYPE)" << std::endl; + ss << "\tset(CMAKE_BUILD_TYPE Release CACHE STRING " + << "\"Choose the type of build (Debug, Release, RelWithDebInfo, MinSizeRel)\"" + << " FORCE)" << std::endl; + ss << "endif()" << std::endl; + ss << std::endl; + ss << "# 查找必要的包\n"; ss << "find_package(PkgConfig REQUIRED)\n"; ss << "find_package(FastDDS REQUIRED)\n"; diff --git a/XNServiceGenServer/XNServiceGen.cpp b/XNServiceGenServer/XNServiceGen.cpp index 2d2ba0f..4488210 100644 --- a/XNServiceGenServer/XNServiceGen.cpp +++ b/XNServiceGenServer/XNServiceGen.cpp @@ -287,6 +287,15 @@ bool XNServiceGen::GenerateCMakeLists() cmakeListsFile << "set(CMAKE_CXX_STANDARD_REQUIRED ON)" << std::endl; cmakeListsFile << "set(CMAKE_POSITION_INDEPENDENT_CODE ON)" << std::endl; cmakeListsFile << std::endl; + + // 设置默认构建类型为Release + cmakeListsFile << "if(NOT CMAKE_BUILD_TYPE)" << std::endl; + cmakeListsFile << "\tset(CMAKE_BUILD_TYPE Release CACHE STRING " + << "\"Choose the type of build (Debug, Release, RelWithDebInfo, MinSizeRel)\"" + << " FORCE)" << std::endl; + cmakeListsFile << "endif()" << std::endl; + cmakeListsFile << std::endl; + // 获取环境变量 cmakeListsFile << "if(DEFINED ENV{XNCore})" << std::endl; cmakeListsFile << " set(XNCore_PATH $ENV{XNCore})" << std::endl;