SW-Wight is a open-source GUI library based on the vex v5 system and V5 API. I only spend 3 days on this project, so there must be some shortages in this project somewhere. I’m glad to hear your suggestions. (〃‘▽’〃)
The SW-Wight contains 4 wights now. They are button, buttonGroup, Graph, Panel. And detailed api is directly written in the corresponding header files for you to check it out(^▽^).
Wight
button
Custom color is supported.
Custom size is supported.
Two interactmode —SELECT and PRESS.
buttonGroup
Manage buttons by group
Custom numbers of selected buttons
Custom size is supported.
For example:
One button selected ↓
Two buttons selected ↓
Graph
Custom color is supported.
Draw dots or lines.
Two display mode — PASS and STAY PASS: STAY:
Panel
Custom color is supported.
Custom size is supported.
Optional data display(data label).
DEMO Reveal (All in one)
The Panel records the present motor velocity(unit is pct).
The Graph records the present motor velocity(unit is rpm).
If you press C1, a motor will spin at 25% of power.
If you press C2 or C3, the buttons you pressed will be selected.
If only C2 is selected, motor will spin at 50% of power.
If only C3 is selected, motor will spin at 75% of power.
If C2 and C3 are both selected, motor will spin at 100% of power.
However, if there is no button pressed or selected, the motorwill stop.
The explanation is a kind of vague in the “DEMO Reveal (All in one)” part, due to the lack of definition of C1 C2 C3 (I actually forget to upload the picture). So here it is :
Someone might get confused towards the interact mode (SELECT and PRESS) of buttons.Here are the gifs. SELECT: PRESS:
Oh wow this looks fantastic! I have been working on my own V5 API GUI library for the past several months now as a complete overhaul of another system I had been working on before it, so I hope it means something when I say that this being made in only 3 days is seriously impressive! Good luck with future development and I really hope that more people get to see and use this incredible tool!
Hi, there. Thanks for appreciating my project.
Could I take a look at your library? I’m kind of curious and I believe there is something I can learn from you.
By the way, do you have any suggestion for the further improvement? I’m actually looking forward to get more widgets in there or change some widgets’ styles. But I have no idea where I can start.
No problem at all! I was quite surprised to find such little support for graphics libraries on the V5 Brain (LVGL is ported in PROS but I find nobody using it very extensively??), so people like you are pretty much heroes!
The first version of KOWGUI is officially going public in maybe a bit over a week (mostly depends on how long creating documentation takes), but I put a prerelease up on GitHub now if you want to look through the code and see if you can learn anything. If you’re looking for inspiration, toDo.txt in the root folder has a giant list of ideas that I haven’t yet implemented into my own project.
Some suggestions I could give for further improvement are mostly small organizational things. I think it’d be worth adding a namespace to everything SW-Wight related, that way it’s clear that names such as graph belong to the GUI library and not something else. For example, classes such as motor or brain are put in the vex namespace. You can use those classes without specifying vex::motor every time by typing using namespace vex;, but now the user is free to create their own class with the same name and they know that vex::motor is part of the VEX API.
It feels like the library is woven quite tightly into the user’s code… All of the SW-Wight render code uses the vex::brain Brain variable declared within robot-config.h. If the user changed the name of Brain, everything would break. I would recommend setting a SW-Wight specific pointer at the start of the program, perhaps as a parameter to a single setup function combining logic_runner() and render_runner()), then using that vex::brain* for SW-Wight code instead of the global variable defined within robot-config.h.
I would also suggest trying to keep things consistent to make the system easier to learn. button, buttonGroup, and panel all have a display() function, but graph has two draw functions. If they are changed to display_line() and display_dot(), code completion / IntelliSense could more easily guide someone to the correct function.
Sorry if these suggestions sound super nitpicky, I’m just trying to give some amount of advice to a project that is already constructed quite well!
it definately works and works super well. And I actually tried it before.
But LVGL is bit overkill, and it actually takes some time to compile and download, which could slow down the prograss of adjusting the program.
So I decide to make a light-weight library based on V5 api.