From b32015a1ad26624ff733f9e60b4789fc929b68d7 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Tue, 6 Sep 2016 13:15:36 -0500 Subject: [PATCH] Trick View: Can't set variables with -- units #301 Called map_trick_units_to_udunits to convert incoming units to udunits. --- trick_source/sim_services/VariableServer/var_server_ext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trick_source/sim_services/VariableServer/var_server_ext.cpp b/trick_source/sim_services/VariableServer/var_server_ext.cpp index abbed8f7..d746fbea 100644 --- a/trick_source/sim_services/VariableServer/var_server_ext.cpp +++ b/trick_source/sim_services/VariableServer/var_server_ext.cpp @@ -6,6 +6,7 @@ #include "trick/message_proto.h" #include "trick/message_type.h" #include "trick/memorymanager_c_intf.h" +#include "trick/map_trick_units_to_udunits.hh" extern Trick::VariableServer * the_vs ; @@ -524,7 +525,8 @@ int var_set_base( const char * var , T value , const char * units ) { V_DATA v_data ; v_tree.v_data = &v_data ; var_set_value( v_data , value) ; - ref->units = (char *)units ; + //ref->units = (char *)units ; + ref->units = (char *)(map_trick_units_to_udunits(units).c_str()) ; ref_assignment(ref , &v_tree) ; free(ref) ; } else {