Skip to content

[LVGL] Function buildFlowStructValues auto-generates code with typo for field.type == "double" #853

@ACIDBURN2501

Description

@ACIDBURN2501

Describe the bug

get = ".getDoulbe()";

See above for the exact typo in the source.

A type in the string used for a replacement to access the member for a double in auto-generated code in structs.h causes an lsp error.

To Reproduce
Steps to reproduce the behavior:

  1. Create a project in EEZ Studio as LVGL with Flow
  2. Create a struct in the "Variable" view
  3. Add a field to the structure of type double
  4. See emitted structs.h for lsp error

Desktop:

  • OS: Linux (Arch)
  • Version: 6.16.8-arch3-1

** LVGL version (if used)**

  • 8.x or 9.x

Additional context

In this example you can see the auto-generated code containts the incorrect call to a structs member:

/* structs.h */
typedef ArrayOf<heartbeatValue, FLOW_ARRAY_OF_STRUCTURE_HEARTBEAT> ArrayOfheartbeatValue;
struct can_snap_metaValue {
    Value value;
    
    can_snap_metaValue() {
        value = Value::makeArrayRef(FLOW_STRUCTURE_CAN_SNAP_META_NUM_FIELDS, FLOW_STRUCTURE_CAN_SNAP_META, 0);
    }
    
    can_snap_metaValue(Value value) : value(value) {}
    
    operator Value() const { return value; }
    
    operator bool() const { return value.isArray(); }
    
    double valid_mask() {
        return value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_VALID_MASK].getDoulbe();
    }
    void valid_mask(double valid_mask) {
        value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_VALID_MASK] = DoubleValue(valid_mask);
    }
    
    double last_update_ms() {
        return value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_LAST_UPDATE_MS].getDoulbe();
    }
    void last_update_ms(double last_update_ms) {
        value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_LAST_UPDATE_MS] = DoubleValue(last_update_ms);
    }
    
    double frames_rx() {
        return value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_FRAMES_RX].getDoulbe();
    }
    void frames_rx(double frames_rx) {
        value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_FRAMES_RX] = DoubleValue(frames_rx);
    }
    
    double frames_dropped() {
        return value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_FRAMES_DROPPED].getDoulbe();
    }
    void frames_dropped(double frames_dropped) {
        value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_FRAMES_DROPPED] = DoubleValue(frames_dropped);
    }
    
    double errors() {
        return value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_ERRORS].getDoulbe();
    }
    void errors(double errors) {
        value.getArray()->values[FLOW_STRUCTURE_CAN_SNAP_META_FIELD_ERRORS] = DoubleValue(errors);
    }
};

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions