CCSDS 503.0-B Tracking Data Message parser and serializer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

tdm: drop find_ prefix from helper, rename interop test_parse

- Rename Tdm.find_float -> opt_float (find_ prefix is redundant; the
function already returns float option, so the new name signals the
optional result).
- Rename interop orekit test_parse -> parse to drop redundant module
prefix from Test.

+5 -6
+3 -3
lib/tdm.ml
··· 155 155 156 156 let find key pairs = List.assoc_opt key pairs 157 157 158 - let find_float key pairs = 158 + let opt_float key pairs = 159 159 match find key pairs with Some v -> float_of v | None -> None 160 160 161 161 let parse_header pairs = ··· 185 185 transmit_band = find "TRANSMIT_BAND" pairs; 186 186 receive_band = find "RECEIVE_BAND" pairs; 187 187 timetag_ref = find "TIMETAG_REF" pairs; 188 - integration_interval = find_float "INTEGRATION_INTERVAL" pairs; 188 + integration_interval = opt_float "INTEGRATION_INTERVAL" pairs; 189 189 integration_ref = find "INTEGRATION_REF" pairs; 190 190 range_mode = find "RANGE_MODE" pairs; 191 - range_modulus = find_float "RANGE_MODULUS" pairs; 191 + range_modulus = opt_float "RANGE_MODULUS" pairs; 192 192 range_units = find "RANGE_UNITS" pairs; 193 193 angle_type = find "ANGLE_TYPE" pairs; 194 194 data_quality = find "DATA_QUALITY" pairs;
+2 -3
test/interop/orekit/test.ml
··· 80 80 81 81 (* -- Parse and verify ------------------------------------------------ *) 82 82 83 - let test_parse (row : index_row) () = 83 + let parse (row : index_row) () = 84 84 let path = trace row.file in 85 85 let tdm = 86 86 match Tdm.of_file path with ··· 152 152 Alcotest.run "tdm-interop" 153 153 [ 154 154 ( "parse", 155 - List.map (fun r -> Alcotest.test_case r.name `Quick (test_parse r)) rows 156 - ); 155 + List.map (fun r -> Alcotest.test_case r.name `Quick (parse r)) rows ); 157 156 ( "roundtrip", 158 157 List.map (fun r -> Alcotest.test_case r.name `Quick (roundtrip r)) rows 159 158 );