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

Big overhaul of the UI framework #1749

Merged
merged 89 commits into from
Feb 17, 2024
Merged

Big overhaul of the UI framework #1749

merged 89 commits into from
Feb 17, 2024

Conversation

Ralim
Copy link
Owner

@Ralim Ralim commented Jul 20, 2023

  • Please check if the PR fulfills these requirements
  • The changes have been tested locally
  • There are no breaking changes
  • What kind of change does this PR introduce?

One of those fun PR's that touches more than half the code in the entire codebase.
I've been putting this off all year.
This is a big refactor to migrate the whole UI to be more of an immediate mode style instead.
This is to be done for future plans to support better UI layouts (pre-rendered layouts).
This is also a requirement for BLE control of the operating mode. Which has been requested a few times.
This also means we get a far simpler implementation for transitions, and things should render a bit more smoothly in general.

  • What is the current behavior?
    Everything (generally) works

  • What is the new behavior (if this is a feature change)?
    Everything is broken. Ideally things would be roughly the same.
    At the moment they are not. Still have a fair few kinks to work out here.

Marking this PR here so that others can review and comment on where I'm heading.
This is not mergable yet :)

@ia
Copy link
Collaborator

ia commented Jul 20, 2023

Hello. I have a couple of questions so far:

  • what is very rough and very approximate estimated time to merge this into dev?
  • is your plan to merge this into dev before or after next stable release (2.22)?

Thanks.

@Ralim
Copy link
Owner Author

Ralim commented Jul 20, 2023

Hello. I have a couple of questions so far:

* what is _**very rough**_ and _**very approximate**_ estimated time to merge this into `dev`?

Ideally within a week, depends how much spare time I get.

* is your plan to merge this into `dev` _**before**_ or _**after**_ next stable release (`2.22`)?

If it is ready before the BLE issue for PinecilV2 is fixed then it will be included.

Thanks.

@discip
Copy link
Collaborator

discip commented Jul 21, 2023

@Ralim
Greetings,
could you please ping me as soon as you bring this to a testable state. 😃

Do we still need the redesigned graphics?
I started to rework these for the higher resolution OLEDs, but wanted to release them as a whole. 😊

@Ralim
Copy link
Owner Author

Ralim commented Jul 21, 2023

@Ralim Greetings, could you please ping me as soon as you bring this to a testable state. smiley

Absolutely; I left you out of being tagged as its definitely not fully functional yet 🙇🏼 Ill let you know :)

Do we still need the redesigned graphics? I started to rework these for the higher resolution OLEDs, but wanted to release them as a whole. blush

Those will be great to have as the next step after this one. So no rush, I decided I'd tackle this first before the dual resolution support. As soon as they are done let me know and can get them in, but no rush at all. Super appreciate you for anything you do here, I'm not the best at pixel editing (as verified by the early versions of this firmware).

@Ralim
Copy link
Owner Author

Ralim commented Jul 21, 2023

@discip
Okay I'm certain there are bugs in this; but I think its a point where (1) it builds and (2) it seems to not be totally broken 🤣

Would love you to give it an eye over and see how many things I've missed 😁

I'm sure there will be some in sleep and shutdown ish modes, will dig into them more later. But settings should work.

@discip
Copy link
Collaborator

discip commented Jul 21, 2023

@Ralim

Finally the animations are smooth again! 🎉 👍🏻 🚀

Not working for: TS80P, Pinecil v1 & V2:

  1. Settings are not saved / are reset as soon as the device is unplugged / powered up.

  2. ACC is not recognized.
    APPLIES TO TS80P ONLY!

  3. Pressing +/A on idle screen while the tip is not inserted, slides in the idle screen from the left every time +/A is pressed.
    Nothing should happen.

  4. Activating soldering mode slides in the soldering screen from the left.
    However leaving it, is not animated.

    Suggestion: Either

    1. remove the animation for entering soldering mode entirely or
    2. add the sliding out to the left for leaving soldering mode and disabling animation if both detailed soldering screen and detailed idle screen are activated simultaneously, since in this case the most part of the screen stays the same.
  5. Leaving the temp adjust screen clears the screen and slides in the idle screen from the right.
    However entering it, is not animated.

    Suggestion:
    Slide in the temp adjust screen from the left when entering it. And make it slide out to the left when leaving.

  6. The scroll bar stays on screen while scrolling description text appears.

  7. The length and position of the scroll bar does not match the actual menu. It is no longer updated live.
    (I remember you being the one implementing it. As I requested it back then.)
    Maybe at this point the scroll bar could be animated while transitioning as well? 😁

  8. The scroll bar does not blink when the end of a value array is reached.

  9. Top speed of increasing numerical values is definitively to fast. Which causes to roll over the last value in some cases.

  10. One more thing I noticed with the acceleration:
    If the acceleration is maxed out (many increments to go through) there is virtually no delay at the end of a value array before rolling over.
    Use a constant value for the delay at the end of a value array, independent of the delay between value changes.

  11. Leaving the debug menu reboots the device.
    DOESN'T APPLY TO Pinecil V2!

  12. Make the debug menu slide in from above when entering and slide out to the top when leaving.

Hopefully I was able to make myself clear enough. If not, please don't hesitate to ask.

@Ralim
Copy link
Owner Author

Ralim commented Jul 22, 2023

1. Settings are not saved / are **reset** as soon as the device is unplugged / powered up.

Should be fixed now 🙏🏼 Helps if I remember to do the save.

2. **`ACC`** is **not** recognized.
   **APPLIES TO `TS80P` ONLY!**

Going to leave this one to last and focus on the rest first.
EDIT: Should be fixed.

3. Pressing **`+/A`** on **`idle screen`** while the tip is **not** inserted, slides **in** the **`idle screen`** _**from** the left_ every time **`+/A`** is pressed.
   Nothing should happen.

Should be fixed now 🙏🏼

4. Activating **`soldering mode`** slides **in** the **`soldering screen`** _**from** the left_.
   However leaving it, is not animated.

Should be fixed now 🙏🏼

5. Leaving the **_`temp adjust screen`_** clears the screen and slides in the **`idle screen`** _**from** the right_.
   However entering it, is not animated.

Should be fixed now 🙏🏼

6. The **`scroll bar`** **stays** on screen while scrolling description text appears.
8. The **`scroll bar`** does **not blink** when the end of a _value array_ is reached.

Dang I was hoping to get away with not doing these two as the couple a bunch of logic. Will poke these later.
How bad is it if i dont do these; going to be a bit of a mess.

7. The length and position of the **`scroll bar`** does not match the actual menu. It is no longer updated live.
   (I remember you being the one implementing it. As I requested it back then.)
   Maybe at this point the **`scroll bar`** could be animated while transitioning as well? grin

I'm not quite following this, looking here as I move down the menu it appears to follow?
No easy way to animate it as the animations affect the entire screen sadly.

9. Top speed of increasing numerical values is definitively to fast. Which causes to _roll over_ the last value in some cases.

Should be fixed now 🙏🏼

10. One more thing I noticed with the acceleration:
    If the acceleration is maxed out (many increments to go through) there is virtually no delay at the end of a _value array_ before rolling over.
    Use a constant value for the delay at the end of a _value array_, independent of the delay between value changes.

Should be fixed now 🙏🏼

11. Leaving the **`debug menu`** reboots the device.
    **DOESN'T APPLY TO `Pinecil V2`!**

Dang, guess what I'm mostly testing on 🤣

12. Make the **`debug menu`** slide **in** _**from** above_ when entering and slide **out** _**to** the top_ when leaving.

The code is setup to slide both ways, just haven't coded an "up" animation yet.
EDIT: Should have animations now I hope.

Hopefully I was able to make myself clear enough. If not, please don't hesitate to ask.

Super clear, dont worry at all :)

@discip
Copy link
Collaborator

discip commented Jul 22, 2023

¡Muchas gracias! 👍🏻

temp adjust screen

  1. Still breaks consistency:
    Although the idle / soldering screen slides in from the right, the temp adjust screen disappears instead of sliding out to the left.

scroll bar

  1. & 8.
    Will poke these later.
    How bad is it if i dont do these; going to be a bit of a mess.

It looks broken. If I had to decide that, I would very much like to have it fixed. 😊

I'm not quite following this, looking here as I move down the menu it appears to follow?

If I recall right the length of the scroll bar was depending on the amount of entries in the current menu / submenu.
So was the position:

(e.g.: 3 entries | screen height 16 pixels)
Length: int(16/3) pixels.
Position: 1st entry > at the very top | 2nd entry > in the middle | 3rd entry > at the very bottom.

I tested this on the Pinecil V2 and even there the scroll bar disappears at some point.
Try User interface > Anim. loop. Here it is missing already and every entry after that is missing the scroll bar as well.
If you pay close attention you will notice that the scroll bar at Anim. speed is already at the bottom, although it still has 6 entries to go.

No easy way to animate it as the animations affect the entire screen sadly.

However this one would just be nice to have. So no pressure here.

debug menu

  1. Is still a thing. You will not be able to notice that on the Pinecil V2, as it does not support boot logo yet.

    Additionally:
    The transition here is buggy / not complete compared to the same transition at other places in the menu.

    downward transition
    debug_in
    The way it transitions is right, but the content of the debug menu screen while sliding down consists only of the upper half.

    upward transition
    debug_out
    This one is similar to 5. (temp adjust screen) only in reverse and in the vertical direction.
    The idle screen should slide up, instead it just appears (due to the fact that the device reboots).

leaving menus

Pressing both buttons to leave a menu, currently brings you instantly back to the idle screen, even from a sub menu. Previously only the sub menu was exited first.

factory reset

The confirmation is missing.

btw:

Thank you for reducing the file size even further with this refactoring! 😃 👍🏻 🚀 🎉

@discip discip added the Enhancement New feature or additional function. label Jul 22, 2023
@Ralim
Copy link
Owner Author

Ralim commented Jul 23, 2023

@discip More updates :)

For me the reset settings seems to confirm; can you lmk what your seeing?
Also can you re-test the debug menu crash on ts80p as well?

I think I got the rest of the above 🙇🏼

@discip
Copy link
Collaborator

discip commented Jul 23, 2023

@Ralim
All this applies to the following devices: TS80P, Pinecil & v2.

Great! 👍🏻

debug menu and leaving menus both are fixed!

But unfortunately there are still some bugs left.

temp adjust screen

temp adjust screen still disappears, instead of sliding out to the left

scroll bar

Since you mentioned that you would poke 6. & 8. later I assume you did only partially fix this, right?
Because only 6. is fixed for now.

CJC calibration

  1. while enabling it

    • The scrolling warning text (before checking the box) has a glitch:
      At the end after the ! a vertical stripe appears, sometimes even 2.
  2. powering up after activation

    1. If the conditions for the CJC calibration are not met, the display stays off until one of the conditions is fulfilled.

    2. The confirmation message stays until a button is pressed, instead of proceeding booting after 3 seconds.

scrolling explanatory text

Do not start at the beginning.
It seems like the scrolling starts in the background and at some point it gets displayed.)

factory reset confirmation

I'm referring to the Reset OK message. Which is still missing.
If you ask me, we could leave this message away entirely, as the bootlogo indicates a restart, but than again there are devices not supporting the bootlogo, users who do not use it and others who do interpret it as a reboot caused by a glitch. 😁
In the end I think we should keep it.


uint16_t setOffset = TipThermoModel::convertTipRawADCTouV(cxt->scratch_state.state3 / 16, true);
setSettingValue(SettingsOptions::CalibrationOffset, setOffset);
if (warnUser(translatedString(Tr->CJCCalibrationDone), buttons)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this by design or could we keep the previous way?

Suggested change
if (warnUser(translatedString(Tr->CJCCalibrationDone), buttons)) {
if (warnUser(translatedString(Tr->CJCCalibrationDone), 3 * TICKS_SECOND)) {

Copy link
Collaborator

@discip discip Jul 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, committing that was absolutely by accident! 😱

@discip
Copy link
Collaborator

discip commented Jul 24, 2023

@Ralim

Please forgive me. 😞

I don't know what initially caused this, but I somehow managed to destroy your work, at least to some extent.

I'm very sorry!

@Ralim
Copy link
Owner Author

Ralim commented Jul 24, 2023

Naah your fine, though for this branch I'll handle the updates as its such a messy one it tends to break 😁

@discip
Copy link
Collaborator

discip commented Jul 24, 2023

@Ralim
Thanks!
Allright, got that! I thought I could help. 👉🏻👈🏻

Is there anything to test yet? 😁

@Ralim
Copy link
Owner Author

Ralim commented Jul 24, 2023

Monday/Tuesdays are hectic days for me so nothing probably until Wednesday I'm afraid

@discip
Copy link
Collaborator

discip commented Jul 24, 2023

Didn't know that, so no intention to push. 😊

Rush is poison.
Don't let it get to you.

You know, it has not to be fast in the first place.
Quality is what matters!

So take your time.
I'll try to be patient until Wednesday.

@discip
Copy link
Collaborator

discip commented Jul 28, 2023

@Ralim
update / addition:

temp adjust

changed temp is only saved after menu was entered

standby

does not work (previously the OLED turned off if not moved for 1 minute)

Auto start

O only working setting
S even leads to a bootloop after reboot (only way to solve this, is reflashing a working old firmware)
Z & R just do nothing



not related to this specific PR

Since I don't know if this behavior is intended, I'm not sure if I should create a new issue.

Removing / inserting tip is not registered if powered using QC.
Previously it was possible to change the input voltage on the fly (very convenient for voltage calibration).
At this point the displayed voltage seems to be static until the device is power cycled.

Furthermore:
I noticed while using the AVHzY CT-3, that flipping the side of C-C cable (green arrow) pluged into the AVHzY CT-3 results either in QC or PD at the iron/(device).
image
When PD is used the AVHzY CT-3 keeps rebooting. (I don't know if this is a known behavior, most likely yes, but anyway.) 😊

@discip
Copy link
Collaborator

discip commented Oct 4, 2023

@Ralim
Any progress on this topic so far? 😁

@discip
Copy link
Collaborator

discip commented Oct 16, 2023

@Ralim
ping 😊

@Ralim
Copy link
Owner Author

Ralim commented Oct 16, 2023

Yeah I'm aware, I want to push 2.22 out first before getting back to this.

At this point the displayed voltage seems to be static until the device is power cycled.
Sounds like a bug

I noticed while using the AVHzY CT-3, that flipping the side of C-C cable (green arrow) pluged into the AVHzY CT-3 results either in QC or PD at the iron/(device).

Also feels like a bug 😓

@discip
Copy link
Collaborator

discip commented Oct 16, 2023

Yeah I'm aware, I want to push 2.22 out first before getting back to this.

Can't wait to see this day! 😁

Also feels like a bug 😓

On the IronOS - side?

@Ralim Ralim force-pushed the gui-dispatches branch 2 times, most recently from 229ac52 to 17bcc85 Compare October 23, 2023 21:27
@discip
Copy link
Collaborator

discip commented Oct 24, 2023

Great! Can't wait to test all this! 😁

@discip
Copy link
Collaborator

discip commented Jan 20, 2024

Thank you very much for the spontaneous reactions. 😀 👍🏻

  1. & 4. Fixed! 👍🏻

' 1. Fixed to some extent, but unfortunately new issues creeped in:

  1. rolling over when reaching end also scroll-bar not flashing
    1.1 Boost temp
    1.2 Sleep temp
    1.3 Temperature unit
    1.4 Display orientation
    1.5 Calibrate CJC at next boot
    1.6 Language

  2. missing checkbox
    Swap + - keys

  3. if °F is set (Temperature unit)
    3.1 Boost temp can not be changed anymore after off state is reached
    3.2 Sleep temp increases by 20 (min 60 / max 580)

BTW:
Every temp related setting is decreased to its minimum after Temperature unit is changed several times in a row (no need to leave the menu).

@Ralim
Copy link
Owner Author

Ralim commented Jan 22, 2024

1/2/3 should be fixed now
The temperature changing back and forth thing has always been there I think because the conversion rounds down :/

@Ralim
Copy link
Owner Author

Ralim commented Jan 22, 2024

Note that 1.6 is a bit trickier and isn't done yet (looking now)

@Ralim
Copy link
Owner Author

Ralim commented Jan 22, 2024

Scratch that, it should work now

@discip
Copy link
Collaborator

discip commented Jan 22, 2024

The temperature changing back and forth thing has always been there I think because the conversion rounds down :/

I think I stumbled over this some time in the past already, but did not bother reporting it at that time.
But now, since we are at it, I suggest to polish it as good as possible.
Is there a way this could be overcome? 😁

Still not home. Will report, as soon as I get there.

@discip
Copy link
Collaborator

discip commented Jan 22, 2024

Thank you once more! 👍🏻

Except for 1.6, 1 - 3 are fixed.

But there are still some other discrepancies:

  1. CJC calibration doesn't work on the Pinecil_2.
    It starts, but is almost immediately interrupted by the bootlogo.

  2. If °F is set, Boost temp and Sleep temp roll over at the end.
    I think this is due to the fact that the values in this case are incremented by 20 instead of 10.

  3. As soon as PD timeout is deactivated on the TS80P, neither heating works nor the removal / insertion of the tip is detected.

  4. One additional thing I just discovered with the Pinecil_2:
    If the voltage is too low and you press +/A to initiate heating, most of the time the screen remains unchanged, but when you press any button the Undervoltage-warning slides in from the right.

@Jonny-T-cyber
Copy link

I follow the discussion

Ralim and others added 4 commits February 14, 2024 20:36
Otherwise incrementing would stop and the scroll bar would already flash at the second to last value.
@Ralim
Copy link
Owner Author

Ralim commented Feb 14, 2024

One additional thing I just discovered with the Pinecil_2:
If the voltage is too low and you press +/A to initiate heating, most of the time the screen remains unchanged, but when you press any button the Undervoltage-warning slides in from the right.

There is a lockout on undervoltage for the first 2 seconds. To confirm, does this occur after 2 seconds?

@discip
Copy link
Collaborator

discip commented Feb 14, 2024

After your latest commit this did not occur yet.
Since I'm not done testing I didn't answer yet.

off-topic:
At the moment I'm fighting to get my S60P back to life.
Is dead after attempting to flash your bootloader.
ST-Cube programmer is not able to establish a connection.
Is it possible that I have to use those 4 pins below the OLED instead the USB interface to connect?
Any pointers?

@Ralim
Copy link
Owner Author

Ralim commented Feb 14, 2024

Ah heck, yeah the 4 points under the OLED need to be used, I couldn't get it to work over the usb port either for me.

For me, it was still flaky trying to connect via SWD. I ended up putting a craft knife between the reset pin and VSS to hold reset low while I connected to it (which worked but is suuper fiddly)

@discip
Copy link
Collaborator

discip commented Feb 16, 2024

@Ralim
So, finally I'am done with getting the S60P back to live. 😌

After having tested this PR on all the irons I have here [TS80, TS80P, Pinecil 1 & Pinecil 2] I found all the major issues to be ironed 😉 out.

But there are 2 minor things which could also be adapted:

  1. Selecting the language still rolls over at the last entry.
  2. No reset confirmation other than the boot-up-logo. (If there is no boot-up-logo, it goes straight to main screen.)

@Ralim Ralim marked this pull request as ready for review February 17, 2024 02:25
@Ralim
Copy link
Owner Author

Ralim commented Feb 17, 2024

Fantastic news to hear ❤️
For (1) I'm not going to do this right now as its a bit messy to get working due to the language id system we are using.
For (2) I'll have a look

@Ralim Ralim merged commit baf2f26 into dev Feb 17, 2024
16 checks passed
@Ralim Ralim deleted the gui-dispatches branch February 17, 2024 22:42
@ia
Copy link
Collaborator

ia commented Feb 20, 2024

Hello.

First of all, I would like to congratulate & thank you for this grand merge: thanks to @Ralim for this huge work being done and thanks to @discip for testing & reporting & testing again before anyone else could deal with all kind of issues if any.

But I have a few questions though...

  • since it's merged, would it be correct to say that current dev is relatively stable in general?
  • (regardless the answer to previous question) what should I pay attention to as regular user in the first place using build from dev after this merge [to help in reporting & solving probable issues]?
  • is there any short & clear list of known issues which are not fixed yet / won't be fixed? Or everything should be just smooth now as it was?
  • @Ralim, do you plan to work on something as long and essential as this merge in the next month or so? Or from now on it will be more like polishing here & there at least for a while?

Thanks in advance for answers because I'm just curious from project planning perspective what's next.

@discip
Copy link
Collaborator

discip commented Feb 24, 2024

@ia

    • since it's merged, would it be correct to say that current dev is relatively stable in general?

    Yes. As mentioned above:
    I tested it on 4 different irons and none of them misbehaved.

    • (regardless the answer to previous question) what should I pay attention to as regular user in the first place using build from dev after this merge [to help in reporting & solving probable issues]?

    Based on 1. there is nothing (at least I hope so) I did not test.
    Except for power-banks maybe you could pay attention to this. 😊

    • is there any short & clear list of known issues which are not fixed yet / won't be fixed? Or everything should be just smooth now as it was?

    Based on 1. the latter should be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or additional function.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants