Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lvgl] exported lvgl code (lv_arc) doesn't respect custom value range #443

Closed
jcuypers opened this issue Jul 9, 2024 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@jcuypers
Copy link
Contributor

jcuypers commented Jul 9, 2024

Custom value range works correctly in run mode, but isn't exported in code

Defining and simulating (running) an arc with a custom range in studio works as expected. however while exporting the range statement is omitted, making it behave like a standard 0-100 scale.

Please implement the correct scale on export
lv_arc_set_range(obj, <start>, <end>);

tested with latest codebase

@jcuypers
Copy link
Contributor Author

jcuypers commented Jul 9, 2024

its weird ... it should work based on the code

if (this.rangeMinType == "literal" && this.rangeMaxType == "literal") {
            if (this.rangeMin != 0 || this.rangeMax != 100) {
                build.line(
                    `lv_arc_set_range(obj, ${this.rangeMin}, ${this.rangeMax});`
                );
            }
        } else if (this.rangeMinType == "literal") {
            build.line(
                `lv_arc_set_range(obj, ${this.rangeMin}, ${this.rangeMin});`
            );
        } else if (this.rangeMaxType == "literal") {
            build.line(
                `lv_arc_set_range(obj, ${this.rangeMax}, ${this.rangeMax});`
            );
        }

@mvladic mvladic added this to the M21 milestone Jul 9, 2024
mvladic added a commit that referenced this issue Jul 9, 2024
@mvladic
Copy link
Contributor

mvladic commented Jul 9, 2024

Fixed.

@jcuypers
Copy link
Contributor Author

jcuypers commented Jul 9, 2024

tested. works as expected

@jcuypers jcuypers closed this as completed Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants