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

Changed default orientation to Auto for TS100, TS80(P) & Pinecil ... #1168

Merged
merged 16 commits into from
Jan 8, 2022
Merged

Changed default orientation to Auto for TS100, TS80(P) & Pinecil ... #1168

merged 16 commits into from
Jan 8, 2022

Conversation

discip
Copy link
Collaborator

@discip discip commented Jan 7, 2022

... as requested here #1157.

Also some minor changes to gui.cpp.

@Ralim
Copy link
Owner

Ralim commented Jan 7, 2022

Hi,
Would rather just leave the inverted screen there for now since we have the room, but it's one of the first on the chopping block when we need room ?

@discip
Copy link
Collaborator Author

discip commented Jan 7, 2022

Good morning Sir,
as mentioned above and you most likely have observed it for yourself already, the code is still in there and I did not plan to remove it.

However I would like to keep it hidden like that, until it is needed.

Do you mean to revert the change, or was your concern just about removing the code entirely?

Are you good with the change of the default orientation?

@Johnex
Copy link

Johnex commented Jan 7, 2022

I like the inverted screen, can we keep it?

@discip
Copy link
Collaborator Author

discip commented Jan 7, 2022

@Johnex
Of course! This is why I asked, if someone would miss it. 😊

@discip
Copy link
Collaborator Author

discip commented Jan 7, 2022

@Ralim
If everyone is happy, also regarding default orientation to Auto, this should be good to go. 😃

kind regards

source/Core/Inc/Settings.h Outdated Show resolved Hide resolved
source/Core/Src/Settings.cpp Outdated Show resolved Hide resolved
source/Core/Threads/GUIThread.cpp Outdated Show resolved Hide resolved
@Ralim
Copy link
Owner

Ralim commented Jan 7, 2022

If you can please swap those settings entries back would be great so we dont mess with settings on upgrade :)

What was the gui tweak for?
@discip

@discip
Copy link
Collaborator Author

discip commented Jan 7, 2022

@Ralim
Should be good now. 😃

Sorry for turning knobs not knowing what they are meant for. 😅

@Johnex
Copy link

Johnex commented Jan 8, 2022

Auto would be great, i usually set it to auto first thing i do 👍

@Ralim Ralim merged commit 26493c0 into Ralim:master Jan 8, 2022
@Ralim
Copy link
Owner

Ralim commented Jan 8, 2022

@discip No problem at allll, that is what I'm here to check 😁

@discip
Copy link
Collaborator Author

discip commented Jan 8, 2022

@Ralim
Good afternoon,
coming back to this:

What was the gui tweak for?

OLED::setCursor(-1, 0);
}
OLED::clearScreen();
// Draw in the screen details
if (getSettingValue(SettingsOptions::DetailedSoldering)) {
gui_drawTipTemp(true, FontStyle::LARGE);

Why I am not able to shift this down by a pixel?

It results in showing only the lower half of the digits. 🤷‍♂️😵

thanks in advance

@Ralim
Copy link
Owner

Ralim commented Jan 8, 2022

To remove a big chunk of complexity, the screen driver only supports vertical offsets of 0 or 8 pixels, as otherwise we have to shift every bit in every byte along one, and wrap overflow to the next row.

So it gets really messy 😅

By only supporting the two height offsets (0/8) it removes a big chunk of code that I didn't feel like writing

@discip
Copy link
Collaborator Author

discip commented Jan 8, 2022

Thank you for the explanation. 😃👍
Is there an elegant way of shifting characters horizontally nonetheless?

I would need to shift the large digits down by only 1 pixel to make them align properly.

@Ralim
Copy link
Owner

Ralim commented Jan 8, 2022

You can move things horizontally on the screen by one pixel increments no issue.
But height is locked to the 0/8 (top row, bottom row).

If it is all digits, it is better to shift the fontmap

@discip
Copy link
Collaborator Author

discip commented Jan 8, 2022

Sorry, I meant vertically of course.

Where would I find the fontmap?
And what exactly would I have to change?

@Ralim
Copy link
Owner

Ralim commented Jan 8, 2022

Soo......

The font table is here: https://github.com/Ralim/IronOS/blob/master/Translations/font_tables.py

In each byte, the LSB (bit0) is the top of that column, and the MSB (bit1) is at the bottom of that column.

So to move a symbol "down" a pixel, you want to:

  1. For each byte in the second half of the set of bytes (ie. bottom row) shift all the bits left by one (up) <<1
  2. For each byte in the first half of the set of bytes (i.e. top row) copy their MSB (top bit) into the LSB (bottom bit) of each matching byte in the second half of the set of bytes
  3. For each byte in the first half of the set of bytes, shift all the bits left by one (up) <<1

If that is too messy to understand I can try and write some quite python to do the shifts for you.
But probably best to split this out to an issue with explanation of what the goal is :)

@discip
Copy link
Collaborator Author

discip commented Jan 8, 2022

Thank you for the thorough explanation.
But as you might have guessed, this is to high for me, to wrap my head around, especially in code.

Since I thought of changing all the characters by hand, your proposal is highly welcomed.

So you planned on writing a script, that is run once and that would change all the actual characters in the font map. Right?

And yes I will open a new issue on that.
But I have to pause this for now and plan on coming back on Monday.

Have a nice weekend.

@discip
Copy link
Collaborator Author

discip commented Jan 9, 2022

@Ralim
Good morning Sir,

If it is all digits, it is better to shift the fontmap

I just noticed that changing the font table, would harm other scenarios, so I unfortunately have to either drop the entire idea, or you help me to make it work for only some cases. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants