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

Draft: Maintenance #28

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Draft: Maintenance #28

wants to merge 19 commits into from

Conversation

robbi5
Copy link
Contributor

@robbi5 robbi5 commented May 17, 2022

This PR adds a maintenance utility to configured printer entries. With this, it is possible to send maintenance data packets to the printer to configure stuff like paper sensor calibration values.

It accepts data in ascii or hex (with 0x-prefixes, spaced or simply endless hex characters) formats.

maintain

Maintenance and the also added printer removal feature are placed in the new three dots menu on the right side of each printer row.

This PR also migrates the settings screen from the deprecated android.preference.PreferenceFragment to androidx.preferences.PreferenceFragmentCompat

TODO:

  • fix width of the maintenance dialog, it should be min 68em wide
  • find out what to do if a print intent comes in while the dialog is open
  • move some more error messages into translateable strings
  • test with bluetooth and usb
  • squash draft commits

@robbi5 robbi5 marked this pull request as draft May 17, 2022 22:44
@raphaelm
Copy link
Member

I cannot compile this branch due to

Dependency 'androidx.preference:preference-ktx:1.2.0' requires 'compileSdkVersion' to be set to 31 or higher.
Compilation target for module ':app' is 'android-30'

Dependency 'androidx.preference:preference:1.2.0' requires 'compileSdkVersion' to be set to 31 or higher.
Compilation target for module ':app' is 'android-30'

Dependency 'androidx.slidingpanelayout:slidingpanelayout:1.2.0' requires 'compileSdkVersion' to be set to 31 or higher.
Compilation target for module ':app' is 'android-30'

Dependency 'androidx.window:window:1.0.0' requires 'compileSdkVersion' to be set to 31 or higher.
Compilation target for module ':app' is 'android-30'
``

Raising the compileSdkVersion yields a number of new issues… how is this working vor you? :see_no_evil: 

@robbi5
Copy link
Contributor Author

robbi5 commented May 20, 2022

Ah, sorry, the magic of different changelists in android studio. Should be fixed with 89947d5

@raphaelm
Copy link
Member

First of all, many printers have a line-based buffer, so what I was instantly missing most was a way to send a line feed in ASCII mode. Switching to hex mode and sending 0A is not really convenient. Do you have any ideas there?

Now for my tests.

I tried a SNBC receipt printer via USB, which apparently causes nullbytes and status bytes to be sent all the time:

device-2022-05-23-102556.mp4

This was not only annoying, but slowed down the UI so much I could barely type anything or close the keyboard.

I then tried connecting the same printer via LAN, where it did not shows these null bytes – at first. After I sent my commands, it started to show them as well. I then quit the dialog and started it again, after which the log did not work at all, also no outgoing statements:

device-2022-05-23-103031.mp4

Maybe something with the resource/thread handling is still wrong there?

I'm happy to accept that this is something specific to SNBC printers, but we need this dialog for SNBC printers. Accepting the null bytes is fine, but it should not slow down the interface so much or hide output completely.

As for the UI, it's a little annoying that the keyboard will overlap with the most interesting part of the log, even on a huge screen. Maybe instead of a dialog let's use a full-screen activity?

Screenshot_20220523_102620

On a TC25 its… better than expected, but still hard to use, do you think we can allocate more space for the input and less for HEX/ASCII and less for the send button?

Screenshot_20220523_103644

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.

None yet

2 participants