From 35cec634e531ed4964376509e83cc021d7f78c7f Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Thu, 30 Jun 2016 10:03:39 -0500 Subject: [PATCH] Convert old units to udunits in test code Changed all of the old units to the new udunit strings. refs #261 --- test/SIM_test_dp/models/dp/include/dp.h | 8 ++++---- .../test_ip/include/ClassOfEverything.hh | 4 ++-- .../models/sched/include/sched.h | 6 +++--- .../Ball/models/ball/L1/include/ball_state.h | 2 +- .../models/ball/L2/include/ball_altimeter.h | 6 +++--- .../models/ball/L2/include/ball_control.h | 10 +++++----- .../Ball/models/ball/L2/include/ball_state.h | 20 +++++++++---------- .../Cannon/SIM_amoeba/RUN_test/unit_test.py | 6 +++--- .../SIM_cannon_aero/RUN_test/unit_test.py | 6 +++--- .../SIM_cannon_jet/RUN_test/unit_test.py | 6 +++--- .../Cannon/SIM_monte/RUN_test/unit_test.py | 6 +++--- trick_sims/SIM_Ball++_L1/models/BallState.hh | 2 +- .../models/Satellite/include/Satellite.hh | 2 +- trick_sims/SIM_sun/RUN_test/input.py | 4 ++-- .../SIM_sun/models/Sun/include/sun_pred.h | 14 ++++++------- 15 files changed, 51 insertions(+), 51 deletions(-) diff --git a/test/SIM_test_dp/models/dp/include/dp.h b/test/SIM_test_dp/models/dp/include/dp.h index 0e55ab9a..4aa287ba 100644 --- a/test/SIM_test_dp/models/dp/include/dp.h +++ b/test/SIM_test_dp/models/dp/include/dp.h @@ -11,12 +11,12 @@ PROGRAMMERS: ( (Keith Vetter) (Titan) (8-20-2002) ) typedef struct { short si[3] ; /* ohm -- */ - int i[3] ; /* M -- */ + int i[3] ; /* m -- */ long l[3] ; /* amp -- */ - float f[3] ; /* M/s2 -- */ - double d[3] ; /* kg*M/s2 -- */ + float f[3] ; /* m/s2 -- */ + double d[3] ; /* kg*m/s2 -- */ unsigned short us[3] ; /* N -- */ - unsigned int ui[3] ; /* dB -- */ + unsigned int ui[3] ; /* cnt -- */ unsigned long ul[3] ; /* v -- */ long long ll[3] ; /* K -- */ diff --git a/test/SIM_test_ip/models/test_ip/include/ClassOfEverything.hh b/test/SIM_test_ip/models/test_ip/include/ClassOfEverything.hh index 6ab8c61f..60f062b4 100644 --- a/test/SIM_test_ip/models/test_ip/include/ClassOfEverything.hh +++ b/test/SIM_test_ip/models/test_ip/include/ClassOfEverything.hh @@ -200,8 +200,8 @@ class ClassOfEverything { float * fap[4] ; /* kg blah */ float ** fpp ; /* kg blah */ - float f_rad ; /* r float test value */ - double d_deg ; /* d blah */ + float f_rad ; /* rad float test value */ + double d_deg ; /* degree blah */ char c ; /* -- blah */ char ca[20] ; /* -- blah */ diff --git a/test/SIM_test_sched/models/sched/include/sched.h b/test/SIM_test_sched/models/sched/include/sched.h index 6aae42ae..11df5891 100644 --- a/test/SIM_test_sched/models/sched/include/sched.h +++ b/test/SIM_test_sched/models/sched/include/sched.h @@ -13,9 +13,9 @@ PROGRAMMERS: ( (Keith Vetter) (Titan) (8-20-2002) ) typedef struct { /* SCHEDULE ------------------------------------------------*/ - double pos ; /* M Position */ - double vel ; /* M/s Velocity */ - double acc ; /* M/s2 Acceleration */ + double pos ; /* m Position */ + double vel ; /* m/s Velocity */ + double acc ; /* m/s2 Acceleration */ double mass ; /* kg Mass */ int amf ; /* -- Just a test variable */ int amf_error ; /* -- Order error occured in amf job */ diff --git a/trick_sims/Ball/models/ball/L1/include/ball_state.h b/trick_sims/Ball/models/ball/L1/include/ball_state.h index fd7952d8..bfb3e4ed 100644 --- a/trick_sims/Ball/models/ball/L1/include/ball_state.h +++ b/trick_sims/Ball/models/ball/L1/include/ball_state.h @@ -26,7 +26,7 @@ typedef struct { /* BSTATE_IN ------------------------------------------------*/ double mass ; /**< (kg) Total mass */ double position[2] ; /**< (m) X(horizontal),Y(vertical) position */ double speed ; /**< (m/s) Linear speed */ - double elevation ; /**< (r) Trajectory angle with respect to the horizontal */ + double elevation ; /**< (rad) Trajectory angle with respect to the horizontal */ int print_off; /**< (--) Set to nonzero to suppress output */ } BSTATE_IN ; /*--------------------------------------------------------------*/ diff --git a/trick_sims/Ball/models/ball/L2/include/ball_altimeter.h b/trick_sims/Ball/models/ball/L2/include/ball_altimeter.h index 9fbeadf7..c34e204a 100644 --- a/trick_sims/Ball/models/ball/L2/include/ball_altimeter.h +++ b/trick_sims/Ball/models/ball/L2/include/ball_altimeter.h @@ -22,14 +22,14 @@ typedef struct { /* BALT_IN --------------------------------------------------*/ Flag add_noise ; /* -- Yes = Add noise to sensed altitude */ Flag add_bias ; /* -- Yes = Add bias to sensed altitude */ - double noise ; /* M 1 sigma noise */ - double bias ; /* M Measurement bias */ + double noise ; /* m 1 sigma noise */ + double bias ; /* m Measurement bias */ } BALT_IN ; /*----------------------------------------------------------------*/ typedef struct { /* BALT_OUT -------------------------------------------------*/ - double altitude ; /* M Sensed altitude */ + double altitude ; /* m Sensed altitude */ } BALT_OUT ; /*---------------------------------------------------------------*/ diff --git a/trick_sims/Ball/models/ball/L2/include/ball_control.h b/trick_sims/Ball/models/ball/L2/include/ball_control.h index efcb57c2..44476d1d 100644 --- a/trick_sims/Ball/models/ball/L2/include/ball_control.h +++ b/trick_sims/Ball/models/ball/L2/include/ball_control.h @@ -23,10 +23,10 @@ PROGRAMMERS: typedef struct { /* BCONTROL_IN ----------------------------------------------*/ Flag active ; /* -- Yes = control system active */ - double target_altitude ; /* M Altitude to achieve and hold */ - double dead_zone ; /* M delta altitude about target altitude where + double target_altitude ; /* m Altitude to achieve and hold */ + double dead_zone ; /* m delta altitude about target altitude where no jets are fired */ - double max_rate ; /* M/s Maximum allowed altitude rate of change */ + double max_rate ; /* m/s Maximum allowed altitude rate of change */ } BCONTROL_IN ; /*------------------------------------------------------------*/ @@ -38,8 +38,8 @@ typedef struct { /* BCONTROL_OUT ---------------------------------------------*/ typedef struct { /* BCONTROL_WORK --------------------------------------------*/ - double last_altitude ; /* *io M Sensed altitude from last pass */ - double rate_est ; /* M/s Estimated altitude rate of change */ + double last_altitude ; /* *io m Sensed altitude from last pass */ + double rate_est ; /* m/s Estimated altitude rate of change */ } BCONTROL_WORK ; /*----------------------------------------------------------*/ diff --git a/trick_sims/Ball/models/ball/L2/include/ball_state.h b/trick_sims/Ball/models/ball/L2/include/ball_state.h index cf47cfa7..3a6cebb8 100644 --- a/trick_sims/Ball/models/ball/L2/include/ball_state.h +++ b/trick_sims/Ball/models/ball/L2/include/ball_state.h @@ -23,15 +23,15 @@ typedef struct { /* BSTATE_IN ------------------------------------------------*/ /*=== Initial Ball States ===*/ double mass ; /* kg Total mass */ - double position[2] ; /* M X(horizontal),Y(vertical) position */ - double speed ; /* M/s Linear speed */ - double elevation ; /* r Trajectory angle with respect + double position[2] ; /* m X(horizontal),Y(vertical) position */ + double speed ; /* m/s Linear speed */ + double elevation ; /* rad Trajectory angle with respect to the horizontal */ /* DYNAMIC EVENT INPUTS */ - double floor_y_pos ; /* M Horizontal floor location on Y axis */ - double right_wall_x_pos ;/* M Vertical right wall location on X axis */ - double ceiling_y_pos ; /* M Horizontal ceiling location on Y axis */ - double left_wall_x_pos ; /* M Vertical left wall location on X axis */ + double floor_y_pos ; /* m Horizontal floor location on Y axis */ + double right_wall_x_pos ;/* m Vertical right wall location on X axis */ + double ceiling_y_pos ; /* m Horizontal ceiling location on Y axis */ + double left_wall_x_pos ; /* m Vertical left wall location on X axis */ REGULA_FALSI floor ; /* -- Dynamic event params for floor impact */ REGULA_FALSI right_wall ;/* -- Dynamic event params for right wall impact*/ REGULA_FALSI ceiling ; /* -- Dynamic event params for ceiling impact */ @@ -41,10 +41,10 @@ typedef struct { /* BSTATE_IN ------------------------------------------------*/ typedef struct { /* BSTATE_OUT -----------------------------------------------*/ - double position[2] ; /* M X(horizontal), Y(vertical) position */ + double position[2] ; /* m X(horizontal), Y(vertical) position */ double Frequency ; /* (Hz) Total mass */ - double velocity[2] ; /* M/s X,Y velocity */ - double acceleration[2] ; /* M/s2 X,Y acceleration */ + double velocity[2] ; /* m/s X,Y velocity */ + double acceleration[2] ; /* m/s2 X,Y acceleration */ double external_force[2] ; /* N Total external force on ball */ } BSTATE_OUT ; /*-------------------------------------------------------------*/ diff --git a/trick_sims/Cannon/SIM_amoeba/RUN_test/unit_test.py b/trick_sims/Cannon/SIM_amoeba/RUN_test/unit_test.py index 66e490ee..316cc737 100644 --- a/trick_sims/Cannon/SIM_amoeba/RUN_test/unit_test.py +++ b/trick_sims/Cannon/SIM_amoeba/RUN_test/unit_test.py @@ -34,9 +34,9 @@ dyn.baseball.vel[0] = 43.30 dyn.baseball.vel[1] = 0.0 dyn.baseball.vel[2] = 25.0 -dyn.baseball.theta = trick.attach_units("d" , -90.0) -dyn.baseball.phi = trick.attach_units("d" , 1.0) -dyn.baseball.omega0 = trick.attach_units("rev/s" , 30.0) +dyn.baseball.theta = trick.attach_units("degree" , -90.0) +dyn.baseball.phi = trick.attach_units("degree" , 1.0) +dyn.baseball.omega0 = trick.attach_units("revolution/s" , 30.0) dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 6) diff --git a/trick_sims/Cannon/SIM_cannon_aero/RUN_test/unit_test.py b/trick_sims/Cannon/SIM_cannon_aero/RUN_test/unit_test.py index 7e1d3f30..48d1b6a5 100644 --- a/trick_sims/Cannon/SIM_cannon_aero/RUN_test/unit_test.py +++ b/trick_sims/Cannon/SIM_cannon_aero/RUN_test/unit_test.py @@ -6,9 +6,9 @@ dyn.baseball.vel[0] = -30.0 dyn.baseball.vel[1] = -0.1 dyn.baseball.vel[2] = 1.0 -dyn.baseball.theta = trick.attach_units("d",-90.0) -dyn.baseball.phi = trick.attach_units("d",1.0) -dyn.baseball.omega0 = trick.attach_units("rev/s",30.0) +dyn.baseball.theta = trick.attach_units("degree",-90.0) +dyn.baseball.phi = trick.attach_units("degree",1.0) +dyn.baseball.omega0 = trick.attach_units("revolution/s",30.0) dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 6) trick.exec_set_terminate_time(5.2) diff --git a/trick_sims/Cannon/SIM_cannon_jet/RUN_test/unit_test.py b/trick_sims/Cannon/SIM_cannon_jet/RUN_test/unit_test.py index 7e1d3f30..48d1b6a5 100644 --- a/trick_sims/Cannon/SIM_cannon_jet/RUN_test/unit_test.py +++ b/trick_sims/Cannon/SIM_cannon_jet/RUN_test/unit_test.py @@ -6,9 +6,9 @@ dyn.baseball.vel[0] = -30.0 dyn.baseball.vel[1] = -0.1 dyn.baseball.vel[2] = 1.0 -dyn.baseball.theta = trick.attach_units("d",-90.0) -dyn.baseball.phi = trick.attach_units("d",1.0) -dyn.baseball.omega0 = trick.attach_units("rev/s",30.0) +dyn.baseball.theta = trick.attach_units("degree",-90.0) +dyn.baseball.phi = trick.attach_units("degree",1.0) +dyn.baseball.omega0 = trick.attach_units("revolution/s",30.0) dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 6) trick.exec_set_terminate_time(5.2) diff --git a/trick_sims/Cannon/SIM_monte/RUN_test/unit_test.py b/trick_sims/Cannon/SIM_monte/RUN_test/unit_test.py index 2755ec2b..535e4880 100644 --- a/trick_sims/Cannon/SIM_monte/RUN_test/unit_test.py +++ b/trick_sims/Cannon/SIM_monte/RUN_test/unit_test.py @@ -47,9 +47,9 @@ dyn.baseball.vel[0] = 43.30 dyn.baseball.vel[1] = 0.0 dyn.baseball.vel[2] = 25.0 -dyn.baseball.theta = trick.attach_units("d" , -90.0) -dyn.baseball.phi = trick.attach_units("d" , 1.0) -dyn.baseball.omega0 = trick.attach_units("rev/s" , 30.0) +dyn.baseball.theta = trick.attach_units("degree" , -90.0) +dyn.baseball.phi = trick.attach_units("degree" , 1.0) +dyn.baseball.omega0 = trick.attach_units("revolution/s" , 30.0) dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 6) diff --git a/trick_sims/SIM_Ball++_L1/models/BallState.hh b/trick_sims/SIM_Ball++_L1/models/BallState.hh index b16fac88..b9f29050 100644 --- a/trick_sims/SIM_Ball++_L1/models/BallState.hh +++ b/trick_sims/SIM_Ball++_L1/models/BallState.hh @@ -33,7 +33,7 @@ class BallStateInput { double mass; /**< trick_units(kg) Total mass. */ double position[2]; /**< trick_units(m) X(horizontal), Y(vertical) position. */ double speed; /**< trick_units(m/s) Linear speed. */ - double elevation; /**< trick_units(r) Trajectory angle with respect to the horizontal. */ + double elevation; /**< trick_units(rad) Trajectory angle with respect to the horizontal. */ BallStateInput() ; }; diff --git a/trick_sims/SIM_satellite/models/Satellite/include/Satellite.hh b/trick_sims/SIM_satellite/models/Satellite/include/Satellite.hh index 259f3e52..be33f344 100644 --- a/trick_sims/SIM_satellite/models/Satellite/include/Satellite.hh +++ b/trick_sims/SIM_satellite/models/Satellite/include/Satellite.hh @@ -43,7 +43,7 @@ class Satellite { double Iinv[3][3]; /* (--) */ double Rdot[3][3]; /* (--) */ double vel[3]; /* (m/s) Vehicle velocity in world frame. */ - double omega[3]; /* (r/s) Angular velocity. */ + double omega[3]; /* (rad/s) Angular velocity. */ double Rplat[3][3]; /* (--) Vehicle platform to World rotation matrix. */ double force[3]; /* (kg*m/s2) Force on vehicle. */ diff --git a/trick_sims/SIM_sun/RUN_test/input.py b/trick_sims/SIM_sun/RUN_test/input.py index e7d2ee3b..86831b4f 100644 --- a/trick_sims/SIM_sun/RUN_test/input.py +++ b/trick_sims/SIM_sun/RUN_test/input.py @@ -28,8 +28,8 @@ if STRIPCHART: """ LOCATION """ """ ======================================== """ # JSC MAIN Gate -sun_predictor.sun.observer_latitude = trick.sim_services.attach_units("d" , 29.55298) -sun_predictor.sun.observer_longitude = trick.sim_services.attach_units("d" , 95.09379) +sun_predictor.sun.observer_latitude = trick.sim_services.attach_units("degree" , 29.55298) +sun_predictor.sun.observer_longitude = trick.sim_services.attach_units("degree" , 95.09379) # Mom's House #sun_predictor.sun.observer_latitude = trick.sim_services.attach_units("d" , 38.842677) diff --git a/trick_sims/SIM_sun/models/Sun/include/sun_pred.h b/trick_sims/SIM_sun/models/Sun/include/sun_pred.h index 6327c592..262d7ecc 100644 --- a/trick_sims/SIM_sun/models/Sun/include/sun_pred.h +++ b/trick_sims/SIM_sun/models/Sun/include/sun_pred.h @@ -16,8 +16,8 @@ typedef struct { } CALENDAR_DATE; typedef struct { - double observer_latitude; /* (d) */ - double observer_longitude; /* (d) */ + double observer_latitude; /* (degree) */ + double observer_longitude; /* (degree) */ CALENDAR_DATE local_time; /* (--) */ double local_sidereal_time; /* (s) */ double sidereal_time_at_Greenwich; /* (s) */ @@ -25,11 +25,11 @@ typedef struct { CALENDAR_DATE utc; /* (--) */ double JD_start; /* (day) Julian date at the beginning of the sim run.*/ double JD; /* (day) Current Julian date */ - double right_ascension; /* (d) */ - double declination; /* (d) */ - double hour_angle; /* (d) */ - double solar_azimuth; /* (d) */ - double solar_elevation; /* (d) */ + double right_ascension; /* (degree) */ + double declination; /* (degree) */ + double hour_angle; /* (degree) */ + double solar_azimuth; /* (degree) */ + double solar_elevation; /* (degree) */ wchar_t* label_UTC; /* (--) wide character pointer */ wchar_t* label_JD; /* (--) wide character pointer */ wchar_t* label_Azimuth; /* (--) wide character pointer */