New REST+OpenAPI interface

This commit is contained in:
2023-12-11 12:11:54 +01:00
parent 99f33eaf53
commit 0b69dfb290
120 changed files with 11309 additions and 2532 deletions
+14 -6
View File
@@ -507,27 +507,31 @@ void CBORStream2Deserializer::ProcessChannels(CborValue &value) {
}
void CBORStream2Deserializer::ProcessUnitCellElement(CborValue &value) {
UnitCell unit_cell{};
CborValue map_value;
cborErr(cbor_value_enter_container(&value, &map_value));
while (! cbor_value_at_end(&map_value)) {
auto key = GetCBORString(map_value);
if (key == "a")
start_message.unit_cell[0] = GetCBORFloat(map_value);
unit_cell.a = GetCBORFloat(map_value);
else if (key == "b")
start_message.unit_cell[1] = GetCBORFloat(map_value);
unit_cell.b = GetCBORFloat(map_value);
else if (key == "c")
start_message.unit_cell[2] = GetCBORFloat(map_value);
unit_cell.c = GetCBORFloat(map_value);
else if (key == "alpha")
start_message.unit_cell[3] = GetCBORFloat(map_value);
unit_cell.alpha = GetCBORFloat(map_value);
else if (key == "beta")
start_message.unit_cell[4] = GetCBORFloat(map_value);
unit_cell.beta = GetCBORFloat(map_value);
else if (key == "gamma")
start_message.unit_cell[5] = GetCBORFloat(map_value);
unit_cell.gamma = GetCBORFloat(map_value);
else
cbor_value_advance(&map_value);
}
cborErr(cbor_value_leave_container(&value, &map_value));
start_message.unit_cell = unit_cell;
}
void CBORStream2Deserializer::ProcessStartMessageUserDataElement(CborValue &value) {
@@ -580,6 +584,10 @@ void CBORStream2Deserializer::ProcessStartMessageUserDataElement(CborValue &valu
start_message.storage_cell_number = GetCBORUInt(map_value);
else if (key == "storage_cell_delay")
start_message.storage_cell_delay_ns = GetRational(map_value).first;
else if (key == "total_flux")
start_message.total_flux = GetCBORFloat(map_value);
else if (key == "attenuator_transmission")
start_message.attenuator_transmission = GetCBORFloat(map_value);
else if (key == "compression_algorithm") {
auto tmp = GetCBORString(map_value);
if (tmp == "bslz4")