Multi lattice search: WIP - Integration added by Claude Opus (doesn't work :) )

This commit is contained in:
2026-06-05 16:22:35 +02:00
parent c1e9babe13
commit 4c45d1c835
11 changed files with 286 additions and 117 deletions
+25 -1
View File
@@ -725,6 +725,17 @@ namespace {
std::vector<float> tmp;
GetCBORFloatArray(value, tmp);
message.indexing_lattice = CrystalLattice(tmp);
} else if (key == "extra_lattices") {
size_t array_len = GetCBORArrayLen(value);
CborValue array_value;
cborErr(cbor_value_enter_container(&value, &array_value));
for (size_t i = 0; i < array_len; i++) {
std::vector<float> tmp;
GetCBORFloatArray(array_value, tmp);
if (tmp.size() == 9)
message.extra_lattices.emplace_back(tmp);
}
cborErr(cbor_value_leave_container(&value, &array_value));
} else if (key == "indexing_time")
message.indexing_time_s = GetCBORFloat(value);
else if (key == "spot_finding_time")
@@ -1225,6 +1236,8 @@ namespace {
message.unit_cell = ProcessUnitCellElement(value);
else if (key == "max_spot_count")
message.max_spot_count = GetCBORUInt(value);
else if (key == "max_extra_lattices")
message.max_extra_lattices = GetCBORUInt(value);
else if (key == "threshold_energy")
message.threshold_energy = ProcessThresholdEnergy(value);
else if (key == "image_dtype") {
@@ -1408,7 +1421,18 @@ namespace {
message.rotation_lattice = CrystalLattice(tmp);
} else if (key == "rotation_lattice_type")
message.rotation_lattice_type = GetCBORLatticeMessage(value);
else
else if (key == "extra_lattices") {
size_t array_len = GetCBORArrayLen(value);
CborValue array_value;
cborErr(cbor_value_enter_container(&value, &array_value));
for (size_t i = 0; i < array_len; i++) {
std::vector<float> tmp;
GetCBORFloatArray(array_value, tmp);
if (tmp.size() == 9)
message.extra_lattices.emplace_back(tmp);
}
cborErr(cbor_value_leave_container(&value, &array_value));
} else
cbor_value_advance(&value);
return true;
} catch (const JFJochException &e) {