mirror of
https://github.com/emqx/neuron.git
synced 2026-10-24 10:46:39 +08:00
Merge pull request #2091 from ZhouBox/v2.9
[v2.9]display optimization for float and double types when setting bias
This commit is contained in:
@@ -68,6 +68,7 @@ typedef struct neu_json_elem {
|
||||
enum neu_json_type t;
|
||||
union neu_json_value v;
|
||||
uint8_t precision;
|
||||
double bias;
|
||||
} neu_json_elem_t;
|
||||
|
||||
#define NEU_JSON_ELEM_SIZE(elems) sizeof(elems) / sizeof(neu_json_elem_t)
|
||||
|
||||
@@ -53,6 +53,7 @@ typedef struct {
|
||||
uint8_t precision;
|
||||
int n_meta;
|
||||
neu_json_tag_meta_t *metas;
|
||||
neu_datatag_t datatag;
|
||||
} neu_json_read_resp_tag_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -670,6 +670,7 @@ typedef struct neu_resp_tag_value_meta {
|
||||
char tag[NEU_TAG_NAME_LEN];
|
||||
neu_dvalue_t value;
|
||||
neu_tag_meta_t metas[NEU_TAG_META_SIZE];
|
||||
neu_datatag_t datatag;
|
||||
} neu_resp_tag_value_meta_t;
|
||||
|
||||
static inline UT_icd *neu_resp_tag_value_meta_icd()
|
||||
@@ -872,6 +873,8 @@ static inline void neu_tag_value_to_json(neu_resp_tag_value_meta_t *tag_value,
|
||||
}
|
||||
neu_json_metas_to_json(tag_value->metas, NEU_TAG_META_SIZE, tag_json);
|
||||
|
||||
tag_json->datatag.bias = tag_value->datatag.bias;
|
||||
|
||||
switch (tag_value->value.type) {
|
||||
case NEU_TYPE_ERROR:
|
||||
tag_json->t = NEU_JSON_INT;
|
||||
|
||||
Reference in New Issue
Block a user