-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
add power devices menu #75
Conversation
I'm trying to cross compile the binary for my Creality Ender V3 KE (which has the same chipset as K1) but keep running into this error:
I've downloaded the mips sdk and included it in my path. Building natively for x86 works fine but when I set |
Thanks for the PR! See https://github.com/ballaswag/guppyscreen/pull/62/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R105 to get around that spdlog issue. For icons, I use the lvgl image convert tool to convert svg into c arrays (https://github.com/lvgl/lv_img_conv): The icon set I'm using are from https://pictogrammers.com/library/mdi/ (I'm out of the zbolt icons since that set is custom). There are also 2 sizes because I didn't bother trying to figure out how to dynamically scale them in lvgl. The default set is 64x64, and the small screen ones are 46x46. |
Thanks for the spdlog suggestion! It's working now. I've updated the PR with a new icon for the power devices menu. Unsure what to do about ZBolt though. |
void PowerPanel::create_devices(json &j) { | ||
std::lock_guard<std::mutex> lock(lv_lock); | ||
|
||
if (j.contains("result")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably need to clear the devices map here for when the printer re-initializes, so if any devices removed physically will also get removed from in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. Do you know how I can remove existing UI widgets in LVGL? Simply clearing the map still leaves the UI widget on screen and causes duplicate entries.
#ifndef ZBOLT | ||
, power_devices_btn(cont, &power_devices_img, "Power Devices", &PrinterTunePanel::_handle_callback, this) | ||
#else | ||
, power_devices_btn(cont, &print, "Power Devices", &PrinterTunePanel::_handle_callback, this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just start using material icons for zbolt too when there's no zbolt equivalent.
Thanks for the feature! Will merge and let it bake in nightly. Some minor comments, if you don't a chance to fix, I'll see to them when I get some time. Another thing is I'll probably move this icon into a different section and leave the tuning panel for tuning stuff. For now it's good enough. |
This PR adds a power devices sub-menu to the printer tuning menu that allows users to turn on/off power devices exposed via moonraker. Examples of power devices include smart plugs that the printer is connected to or external fans etc.
I'm pretty new to LGVL so appreciate any feedback you have. The only thing missing is the icon for the menu button as I'm unsure how to generate an icon for the button. I'm using the graph icon as a placeholder for now.