Git Product home page Git Product logo

Comments (23)

pqueiros avatar pqueiros commented on June 18, 2024

Hi,

I started looking at the source code and to the many events that can be programmed but I am a bit overwhelmed :). this thing is really complex. does anyone have pointers how to get into the code base. And even better suggestions in how to implement this feature?

from xcsoar.

MaxKellermann avatar MaxKellermann commented on June 18, 2024

You could implement this as a small modal dialog (class WndForm) which is displayed in one screen corner. It contains just one small "Unlock" button. That way, XCSoar shows the usual information, but does not respond to clicks (only to the "Unlock" button).
Once we have that, we can refactor it to an invisible overlay which requires the user to draw a gesture (dimming the screen, showing the gesture and instructions while the finger touches the screen). But let's do one thing at a time.

from xcsoar.

MaxKellermann avatar MaxKellermann commented on June 18, 2024

Oh and yes, one can easily be overwhelmed by the complexity of XCSoar. And its heavily underdocumented non-standard UI toolkit. I hope you have enough patience to get this done.

from xcsoar.

pqueiros avatar pqueiros commented on June 18, 2024

@MaxKellermann,

Thank you very much for the hints. I will look for references on the WndForm class and investigate further.

from xcsoar.

ulipo avatar ulipo commented on June 18, 2024

Any news on this front? I think it would be a very useful feature for any praraglider pilot.
LJK8000 has a feature that disables touch screen until the software detects the take off, but locking the scrren after a time out would be definitely more useful option.

from xcsoar.

nico-krais avatar nico-krais commented on June 18, 2024

I started to implement a feature like that in https://github.com/nico-krais/XCSoar/tree/ScreenLock. As suggested, there is a new button under "Display" that locks the screen, and only shows a very, very small OK button to return to normal operation.
I would much prefer to have it that a longer press on the button is required instead of making it very small, but couldn't figure that out by now.
Also, it would be very helpful to automatically unlock the screen at take-off - at least that would be my use-case.
If anyone with more experience in the code-base could point me in the right direction for the two points mentioned above, I would also have a look at that.

from xcsoar.

nico-krais avatar nico-krais commented on June 18, 2024

I now tested this successfully on my Kobo mini, it prevents exactly what @pqueiros described: That the risers trigger all sort of Inputs before take off. Until now I have not managed to unlock the screen unintentionally. The new menu item looks like this:

Screenshot_20190604_212425
and after pressing the button you see
Screenshot_20190604_212444
The current version of my implementation can be found here: https://github.com/nico-krais/XCSoar/tree/v6.8.11_patched

I based this on the v6.8.11 tag since this is the current release and I have that in production.

As mentioned above this is probably as far as I can go without some directions from a more experienced developer.

If this feature is of interest, I can prepare a merge request. Let me know if specific work should be done before.

If someone is interested in the meantime, I uploaded the version I use on my Kobo mini: https://github.com/nico-krais/XCSoar/releases/tag/v6.8.11_patched - WITHOUT ANY SORT OF WARRANTY, THIS IS BARELY TESTED, ASSUME THAT IT WILL DESTROY YOUR DEVICE AND AT THE VERY LEAST HAVE A FULL BACKUP OF YOUR SD CARD

from xcsoar.

nico-krais avatar nico-krais commented on June 18, 2024

I've just seen that there already exists a pull request for that, so it should be mentioned in this issue: #202

So I won't prepare the merge request for my implementation.

from xcsoar.

rewopen avatar rewopen commented on June 18, 2024

from xcsoar.

ulipo avatar ulipo commented on June 18, 2024

My implementation, the one in the (somehow embarrassing) pull request, uses a modal dialog like the one of Nico Krais, but I tailored it to be as small as possible and to put it in an area where it shouldn't cover anything important.
Lately I made a small change (the button acts now as a "cancel" instead of "OK") and that brought in the unexpected ability to close the modal also by pressing the hardware "power" button!

If you want to try it out, here attached is an updated KoboRoot.tgz, but use it at your own risk, I'm not responsible if it bricks your device, raids your fridge, kills your dog and so on...
unzip_me.zip

from xcsoar.

nico-krais avatar nico-krais commented on June 18, 2024

I prefer to lock the screen permanently, while I am flying with the paraglider. So it is impossible that my jacket push on the screen from my kobo. When I lock the screen, I can see the „Screenlock“ and „Anzeige 3/3“ Buttons. It would be nice, when only a very small Button to unock was visible. Thanks

Yea, the file I uploaded was from an old commit - it's updated now. Also the dialog is smaller. But again, since there is the pull request by @ulipo, the smartest thing is to wait for that to get merged and officially released.

from xcsoar.

rewopen avatar rewopen commented on June 18, 2024

If I lock my screen on kobo, there is no thermal asstistant on the left bottom corner. If I unlock the creen, the asstistant is visible in cycling mode. I testet it in replay and while I am flying.

from xcsoar.

ulipo avatar ulipo commented on June 18, 2024

I guess the thermal assistant is done as another dialog window or such, probably it's queued to the modal window of the lock screen and isn't displayed until the first one is closed.
The same happens for the messages, they are all displayed in a row when you unlock the screen.
I am not skilled enough to know how to circumvent this, I am afraid for the time being you'll have to choose to have either the screen locked, or the other functions...

from xcsoar.

rewopen avatar rewopen commented on June 18, 2024

Thank you. It is possible to use an event.xci? Do you know the syntax for thermal asstistant window?

from xcsoar.

ulipo avatar ulipo commented on June 18, 2024

I'm sorry, I totally don't know

from xcsoar.

rewopen avatar rewopen commented on June 18, 2024

I tried the thermalAsstist.xci
Switch automatically to Thermal Assist screen when thermalling, switch back to previous screen when not.
Copy thermalAssist.xci to XCSoarData
Start XCSoar goto:
Config 2/3 -> System -> Look -> Language, Input
Select Events then thermalAssist.xci
Restart XCSoar

mode=default
type=gce
data=FLIGHTMODE_CLIMB
event=ThermalAssistant
event=Mode default

mode=default
type=gce
data=FLIGHTMODE_CRUISE
event=ScreenModes previous
event=Mode default

It works an make the ThermalAsstistant visible, also if the screen ist locked. But I would prefer the small ThermalAssistant in the left bottom corner. So I would see my flight track. The thermalAssit.xci I found from Lloyd on the internet.

from xcsoar.

ajdayvie avatar ajdayvie commented on June 18, 2024

Am I missing something obvious here. I've tried to update my build on kobomini using all of the KoboRoot.tgz files above. none of them show the menu item DISPLAY3/3 > Screen Lock. After updating my kobo shows a new version number so it seems like it's loading the files ok.
I would love to have this feature. I'm always having to reset stuff mid flight because all of the unintentional buttons pushed.

from xcsoar.

ulipo avatar ulipo commented on June 18, 2024

If you use my build from the "unzip_me.zip" file I posted above, the lock screen button is in the main menu, not in DISPLAY.

from xcsoar.

ajdayvie avatar ajdayvie commented on June 18, 2024

Huh, i've loaded up your build. I'm still not seeing a lock screen button. I see the build number on startup as 'v7.0_preview14-kobo'

2019-08-26_121528
2019-08-26_121747
2019-08-26_121711

from xcsoar.

ulipo avatar ulipo commented on June 18, 2024

That's strange, the button should be just on the left of "Cancel" in main menu, I already tried it on a Mini and I'm sure it was working...
Try this other build here, it's the one I'm using on my Kobo Glo and includes also the OTG kernel (but I didn't test that on Mini)
KoboRoot_XCsoar_OTG_LOCK.zip
As always, take a full backup of your SD card before trying stuff, or anyway don't hold me responsible if your Kobo blows up in chippings 😁

from xcsoar.

ajdayvie avatar ajdayvie commented on June 18, 2024

It is strange. That one isn't showing the button either. Maybe I need to do more with the install? I'm just putting the .tgz into the kobo folder, but not erasing anything. Do you think erasing the existing xcsoar and then installing fresh would help?

Thanks for the development on this btw 😁, I've been wanting this feature for a long time.

Do I need to do something with an XCI file?

from xcsoar.

ajdayvie avatar ajdayvie commented on June 18, 2024

Yes. Problem solved. I had a default.xci file overriding the menu display. I removed it and the lock screen now works as described!

from xcsoar.

lordfolken avatar lordfolken commented on June 18, 2024

This is implemented in preview15

from xcsoar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.