Refactor LivoxGen1 provider param parsing to shared DAP helpers.
Replace local param parsing with DeviceAttachmentSpec primitives for consistency with lcameraBuff and intrin threshold modules. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef _LIVOX_GEN1_PCLOUD_AMBIENCE_QUALE_IFACE_API_H
|
||||
#define _LIVOX_GEN1_PCLOUD_AMBIENCE_QUALE_IFACE_API_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
@@ -39,15 +38,6 @@ struct ParamComparator
|
||||
}
|
||||
};
|
||||
|
||||
inline bool paramsContain(
|
||||
const std::vector<std::pair<std::string, std::string>>& params,
|
||||
const std::string& name)
|
||||
{
|
||||
return std::any_of(
|
||||
params.begin(), params.end(),
|
||||
[&name](const auto& p) { return p.first == name; });
|
||||
}
|
||||
|
||||
/* pcloudLightAmbience requires exactly one `passband-count-gt-val` on its
|
||||
* qualeIfaceApi params; `passband-count-lt-val` is a hard error. Feeds a
|
||||
* negtrin(...) segment (scene is "unbearably much, get away").
|
||||
@@ -57,7 +47,8 @@ inline ParamComparator parsePcloudLightAmbienceGtComparator(
|
||||
{
|
||||
const auto& params = deviceAttachmentSpec->qualeIfaceApiParams;
|
||||
|
||||
if (paramsContain(params, "passband-count-lt-val"))
|
||||
if (device::DeviceAttachmentSpec::paramsContain(
|
||||
params, "passband-count-lt-val"))
|
||||
{
|
||||
throw std::runtime_error(
|
||||
"pcloudLightAmbience qualeIfaceApi does not accept "
|
||||
@@ -91,7 +82,8 @@ inline ParamComparator parsePcloudDarkAmbienceLtComparator(
|
||||
{
|
||||
const auto& params = deviceAttachmentSpec->qualeIfaceApiParams;
|
||||
|
||||
if (paramsContain(params, "passband-count-gt-val"))
|
||||
if (device::DeviceAttachmentSpec::paramsContain(
|
||||
params, "passband-count-gt-val"))
|
||||
{
|
||||
throw std::runtime_error(
|
||||
"pcloudDarkAmbience qualeIfaceApi does not accept "
|
||||
|
||||
Reference in New Issue
Block a user