DAPSpec: QualeIfaceApiParams: Add histbuffMs
This commit is contained in:
@@ -178,11 +178,36 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse history buffer duration from quale-iface-api-params
|
||||
int histbuffMs = 30000; // Default: 30000ms (30 seconds)
|
||||
const std::vector<std::string> histbuffParamNames = {
|
||||
"history-buffer-duration-ms",
|
||||
"hist-buff-duration-ms",
|
||||
"histbuff-duration-ms",
|
||||
"histbuff-ms"
|
||||
};
|
||||
|
||||
// Loop through synonyms in reverse order; lattermost synonym wins.
|
||||
for (auto synIt = histbuffParamNames.rbegin();
|
||||
synIt != histbuffParamNames.rend(); ++synIt)
|
||||
{
|
||||
const auto& paramName = *synIt;
|
||||
try {
|
||||
histbuffMs = smo::device::DeviceAttachmentSpec
|
||||
::parseRequiredParamAsInt(
|
||||
context->spec->qualeIfaceApiParams, paramName);
|
||||
break; // Found and parsed successfully
|
||||
} catch (const std::exception&) {
|
||||
// Parameter not found or parse error, continue to next synonym
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Create and add PcloudStimulusBuffer to collection now that device is ready
|
||||
StimulusBuffer::PcloudFormatDesc formatDesc;
|
||||
formatDesc.format = StimulusBuffer::PcloudFormatDesc::Format::XYZI;
|
||||
auto pcloudStimBuff = std::make_shared<PcloudStimulusBuffer>(
|
||||
*context->spec, context->deviceTmp, formatDesc, 30);
|
||||
*context->spec, context->deviceTmp, formatDesc, histbuffMs, 30);
|
||||
|
||||
context->stimBuff = pcloudStimBuff;
|
||||
context->deviceTmp->nAttachedStimBuffs++;
|
||||
|
||||
Reference in New Issue
Block a user