Output source option of Value & Gauge widgets in a symbolic way
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <debug.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "strhelpers.h"
|
||||
#include "switches.h"
|
||||
|
||||
namespace yaml_conv_220 {
|
||||
|
||||
@@ -168,10 +168,19 @@ uint8_t select_zov(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
data += bitoffs >> 3UL;
|
||||
data -= sizeof(ZoneOptionValueEnum);
|
||||
ZoneOptionValueEnum* p_zovt = (ZoneOptionValueEnum*)data;
|
||||
if (*p_zovt > ZOV_String)
|
||||
return 0;
|
||||
if (*p_zovt > ZOV_Source) return 0;
|
||||
return *p_zovt;
|
||||
}
|
||||
|
||||
#define r_zov_source nullptr
|
||||
|
||||
bool w_zov_source(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
data += bitoffs >> 3UL;
|
||||
auto p_val = reinterpret_cast<ZoneOptionValue*>(data);
|
||||
return w_mixSrcRaw(nullptr, p_val->unsignedValue, wf, opaque);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t select_mod_type(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_ZoneOptionValueEnum[] = {
|
||||
{ ZOV_Signed, "Signed" },
|
||||
{ ZOV_Bool, "Bool" },
|
||||
{ ZOV_String, "String" },
|
||||
{ ZOV_Source, "Source" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
@@ -334,6 +335,7 @@ static const struct YamlNode union_ZoneOptionValue_elmts[] = {
|
||||
YAML_SIGNED( "signedValue", 32 ),
|
||||
YAML_UNSIGNED( "boolValue", 32 ),
|
||||
YAML_STRING("stringValue", 8),
|
||||
YAML_CUSTOM("source",r_zov_source,w_zov_source),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_ZoneOptionValueEnum[] = {
|
||||
{ ZOV_Signed, "Signed" },
|
||||
{ ZOV_Bool, "Bool" },
|
||||
{ ZOV_String, "String" },
|
||||
{ ZOV_Source, "Source" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
@@ -355,6 +356,7 @@ static const struct YamlNode union_ZoneOptionValue_elmts[] = {
|
||||
YAML_SIGNED( "signedValue", 32 ),
|
||||
YAML_UNSIGNED( "boolValue", 32 ),
|
||||
YAML_STRING("stringValue", 8),
|
||||
YAML_CUSTOM("source",r_zov_source,w_zov_source),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_ZoneOptionValueEnum[] = {
|
||||
{ ZOV_Signed, "Signed" },
|
||||
{ ZOV_Bool, "Bool" },
|
||||
{ ZOV_String, "String" },
|
||||
{ ZOV_Source, "Source" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
@@ -355,6 +356,7 @@ static const struct YamlNode union_ZoneOptionValue_elmts[] = {
|
||||
YAML_SIGNED( "signedValue", 32 ),
|
||||
YAML_UNSIGNED( "boolValue", 32 ),
|
||||
YAML_STRING("stringValue", 8),
|
||||
YAML_CUSTOM("source",r_zov_source,w_zov_source),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
|
||||
|
||||
@@ -35,7 +35,9 @@ enum ZoneOptionValueEnum {
|
||||
ZOV_Unsigned=0,
|
||||
ZOV_Signed,
|
||||
ZOV_Bool,
|
||||
ZOV_String
|
||||
ZOV_String,
|
||||
// added for conversion:
|
||||
ZOV_Source
|
||||
};
|
||||
|
||||
struct ZoneOption
|
||||
|
||||
Reference in New Issue
Block a user