Skip to content

Commit

Permalink
additional decoding for runtime parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-urban committed Nov 28, 2024
1 parent 8f9b623 commit 026683e
Show file tree
Hide file tree
Showing 5 changed files with 307 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,20 @@ void init_c_runtimeparameters(pybind11::module& m)
DOC_RuntimeParameters(get_mode_as_dual_swath_mode),
py::arg("unhandled_message") = std::nullopt)

// mode2
.def("get_mode2_as_rx_or_sonar_head_use",
&RuntimeParameters::get_mode2_as_rx_or_sonar_head_use,
DOC_RuntimeParameters(get_mode2_as_rx_or_sonar_head_use),
py::arg("unhandled_message") = std::nullopt)
.def("get_mode2_as_pulselength",
&RuntimeParameters::get_mode2_as_pulselength,
DOC_RuntimeParameters(get_mode2_as_pulselength),
py::arg("unhandled_message") = std::nullopt)
.def("get_mode2_as_receive_fixed_gain_setting_dB",
&RuntimeParameters::get_mode2_as_receive_fixed_gain_setting_dB,
DOC_RuntimeParameters(get_mode2_as_receive_fixed_gain_setting_dB),
py::arg("unhandled_value") = std::nullopt)

// filter_identifier
.def("get_filter_identifier_as_spike_filter",
&RuntimeParameters::get_filter_identifier_as_spike_filter,
Expand Down Expand Up @@ -261,7 +275,7 @@ void init_c_runtimeparameters(pybind11::module& m)
DOC_RuntimeParameters(get_passive_mode_enabled))
.def("get_3d_scanning_enabled",
&RuntimeParameters::get_3d_scanning_enabled,
DOC_RuntimeParameters(get_3d_scanning_enable))
DOC_RuntimeParameters(get_3d_scanning_enabled))

// --- mode2 ---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//sourcehash: dab7e938e6ebdf84ccbaf47d08e05fec5295a441961198a89f30c1f908367336
//sourcehash: 57f01e60b0b367eaee503ba8ccff1c2adf5d4a000fe05f25f219935caad43a20

/*
This file contains docstrings for use in the Python bindings.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//sourcehash: e5766a1cd578adcc3416d3c9e1ac1eba3c83d0e534625235753ce32c96fd89e9
//sourcehash: 0aaecbe141a93b6eb0ad10ad932f90e1a68553ce94995a78a883702a57f017ec

/*
This file contains docstrings for use in the Python bindings.
Expand Down Expand Up @@ -156,6 +156,52 @@ static const char *__doc_themachinethatgoesping_echosounders_kongsbergall_datagr

static const char *__doc_themachinethatgoesping_echosounders_kongsbergall_datagrams_RuntimeParameters_get_mode = R"doc()doc";

static const char *__doc_themachinethatgoesping_echosounders_kongsbergall_datagrams_RuntimeParameters_get_mode2_as_pulselength =
R"doc(Retrieves Pulselength encoded in the mode2 variable
The decoding is EM model specific. Currently only outputs sensefull
values for EM2040 and EM2040C. See datagram format specification for
details.
Parameter ``unhandled_message``:
If provided, this message is used as the return value if the mode
is not handled for the specific system. Otherwise: 'Sonar head use
unhandled' is returned
Returns:
A string representing Pulselength as encoded by 'mode2')doc";

static const char *__doc_themachinethatgoesping_echosounders_kongsbergall_datagrams_RuntimeParameters_get_mode2_as_receive_fixed_gain_setting_dB =
R"doc(Retrieves receiver fixed gain setting encoded in the mode2 variable
The decoding is EM model specific. This only outputs sensefull values
for EM2000, EM1002, EM3000, EM3002, EM300, EM120. See datagram format
specification for details.
Parameter ``unhandled_value``:
If provided, this value is used as the return value if the mode is
not handled for the specific system. Otherwise: 'None' is returned
Returns:
A uint8_t representing receiver fixed gain setting use as encoded
by 'mode2')doc";

static const char *__doc_themachinethatgoesping_echosounders_kongsbergall_datagrams_RuntimeParameters_get_mode2_as_rx_or_sonar_head_use =
R"doc(Retrieves Rx array/ sonar head encoded in the mode2 variable
The decoding is EM model specific. Currently only outputs sensefull
values for EM2040 and EM2040C. See datagram format specification for
details.
Parameter ``unhandled_message``:
If provided, this message is used as the return value if the mode
is not handled for the specific system. Otherwise: 'None' is
returned
Returns:
A string representing Rx array / Sonar head use as encoded by
'mode2')doc";

static const char *__doc_themachinethatgoesping_echosounders_kongsbergall_datagrams_RuntimeParameters_get_mode2_or_receiver_fixed_gain_setting = R"doc()doc";

static const char *__doc_themachinethatgoesping_echosounders_kongsbergall_datagrams_RuntimeParameters_get_mode_as_dual_swath_mode =
Expand All @@ -166,8 +212,8 @@ for details.
Parameter ``unhandled_message``:
If provided, this message is used as the return value if the mode
is not handled for the specific system. Otherwise: 'Ping mode
unhandled' or 'Ping mode not implemented' is returned
is not handled for the specific system. Otherwise: None is
returned
Returns:
A string representing Tx pulse form as encoded by 'mode')doc";
Expand All @@ -180,8 +226,8 @@ for details.
Parameter ``unhandled_message``:
If provided, this message is used as the return value if the mode
is not handled for the specific system. Otherwise: 'Ping mode
unhandled' or 'Ping mode not implemented' is returned
is not handled for the specific system. Otherwise: None is
returned
Returns:
A string representing Ping mode as encoded by 'mode')doc";
Expand All @@ -194,8 +240,8 @@ for details.
Parameter ``unhandled_message``:
If provided, this message is used as the return value if the mode
is not handled for the specific system. Otherwise: 'Ping mode
unhandled' or 'Ping mode not implemented' is returned
is not handled for the specific system. Otherwise: None is
returned.
Returns:
A string representing Tx pulse form as encoded by 'mode')doc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class KongsbergAllDatagram
"datagram_identifier",
fmt::format("0x{:02x}", uint8_t(_datagram_identifier)),
datagram_identifier_to_string(t_KongsbergAllDatagramIdentifier(_datagram_identifier)));
printer.register_value("model_number", get_model_number(), get_model_number_as_string());
printer.register_string(
"model_number", get_model_number_as_string(), std::to_string(get_model_number()));
printer.register_value("date", _date, "YYYYMMDD");
printer.register_value("time_since_midnight", _time_since_midnight, "ms");

Expand Down
Loading

0 comments on commit 026683e

Please sign in to comment.