Toon app: NL-Alert

Forum about forum-provided applications on Toon

Moderators: marcelr, TerrorSource, Toonz, TheHogNL

Toon app: NL-Alert

Postby glsf91 » Fri Mar 13, 2020 5:28 pm

I have made an app to display the NL-Alert messages for Toon1 en Toon2 (tested both). It has the following functionality:

Configuration (Instellingen screen) of:
- location of Toon (latitude, longitude); Also QrCode scan can be used (like buienradar app)
- range (distance) in km for messages counted for regio
- timeframe (Tijdsduur) where an alert is counted in summary of the Tile
- icon in systray

On the Tile it shows a summary of the number of messages:
- for the messages where your location is inside the NL-Alert area
- for the messages where your location is outside the NL-Alert area
- for the messages where NL-Alert center lies in your regio (configurable distance)
It shows also the status of getting/processing the messages.

In dimstate it show an NL-Alert icon if there is a NL-Alert message in the regio range or where your location is inside the NL-Alert area. Everything in the Tile is depending on the defined timeframe.

When clicking on the Tile you get a screen with scrollable NL-Alert messages.
Alle messages for the last 7 days are visible. With a (remembered) Filter button you can show only the messages within the regio range and where your location is inside the Nl-Alert area. Defined timeframe is not used here.
There is also a refresh button which refreshes the messages. It can only be used again after a minute (because of rate limits).
Every 15 minutes the NL-Alert messages are refreshed.

Sometimes the app is getting rate limit problems. Retries are build in, so just wait.

When a NL-Alert message is received in the regio range or where your location is inside the NL-Alert area, a full screen alarm popup is shown with the first NL-Alert message.
You have to acknowledge the alarm. It is shown only once (survives restart).

If you don't want an alarm popup for the regio range, just change the regio range to 0 in the configuration screen.

V1.0.1
Initial release

V1.1.0
Added alarm popup

V1.1.1
Qqrcode timer fix (qrcode timer fix)
(thanks TheHogNL)

V1.1.2
Confirmation that it received the coordinates using the qr code option
(thanks TheHogNL)

V1.2.0
Changed alerting from NL-Alert center to NL-Alert area
Changed Tile and settings

V1.2.1
- debug logging switched off by default

Known issues
When reboot Toon (after firmware upgrade) the app shows the NL-ALert popup again if there is still a old NL-Alert messages visible (depending on configurable timeframe).
Empty thumbnail icon when adding to Tile. Has no influence on app functionality. Is fixed when using firmware 5.25.8 or later.
Last edited by glsf91 on Fri Mar 27, 2020 11:07 am, edited 14 times in total.
glsf91
Member
Member
 
Posts: 133
Joined: September 2017

Re: Toon app: NL-Alert

Postby Toonz » Fri Mar 13, 2020 5:42 pm

nice idea.
For the configuration (lon/lat coordinates) you can copy code from the buienradar app (BuienradarEditLonLatScreen.qml). This was fully automated by TheHogNL using your mobile phone.
For the thumbnails you can use an existing one from another app or refer to it via an http URL to the local Toon (127.0.0.1).

If you want it in ToonStore just email me the zipfile, I will then upload it to our GitHub from which you can do further maintenance via the git client on Toon.
And publish in ToonStore of course.....
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1374
Joined: December 2016

Re: Toon app: NL-Alert

Postby glsf91 » Fri Mar 13, 2020 5:51 pm

Toonz wrote:nice idea.
For the thumbnails you can use an existing one from another app or refer to it via an http URL to the local Toon (127.0.0.1).


I want to use my own one if possible. I tried with the following result:
If I try: property url thumbnailIcon: "http://localhost/nl-icon.png"
I get the error: qrc:/apps/homescreen/TileThumbnail.qml:73:3: QML Image: Failed to get image from provider: image://scaled//localhost/nl-icon.png

When using wget I get the icon without any problem.
For example the systray icon it will work, but not for thumbnail (looks like).

Other stuff I will look into.
glsf91
Member
Member
 
Posts: 133
Joined: September 2017

Re: Toon app: NL-Alert

Postby TerrorSource » Fri Mar 13, 2020 6:39 pm

glsf91 wrote:
Toonz wrote:nice idea.
For the thumbnails you can use an existing one from another app or refer to it via an http URL to the local Toon (127.0.0.1).


I want to use my own one if possible. I tried with the following result:
If I try: property url thumbnailIcon: "http://localhost/nl-icon.png"
I get the error: qrc:/apps/homescreen/TileThumbnail.qml:73:3: QML Image: Failed to get image from provider: image://scaled//localhost/nl-icon.png

When using wget I get the icon without any problem.
For example the systray icon it will work, but not for thumbnail (looks like).

Other stuff I will look into.


What if you use:
http://127.0.0.1/hdrv_zwave/file.txt for example?

Saw that Toonz used that for DomoticzBoard testing :)

Can you put the app on Github ? If it's finished we can fork the repo it into the TSC github
TerrorSource
Member
Member
 
Posts: 356
Joined: May 2017

Re: Toon app: NL-Alert

Postby glsf91 » Fri Mar 13, 2020 6:58 pm

TerrorSource wrote:What if you use:
http://127.0.0.1/hdrv_zwave/file.txt for example?

Saw that Toonz used that for DomoticzBoard testing :)

Can you put the app on Github ? If it's finished we can fork the repo it into the TSC github


Even with wget not working on the Toon it self. wget http://127.0.0.1/hdrv_zwave/file.txt gives:
--2020-03-13 17:34:22-- http://127.0.0.1/hdrv_zwave/file.txt
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-03-13 17:34:22 ERROR 404: Not Found.

Maybe first without thumbnail and wait until it is in the resourcefile.

I will (try) putting it on github.
glsf91
Member
Member
 
Posts: 133
Joined: September 2017

Re: Toon app: NL-Alert

Postby TerrorSource » Sat Mar 14, 2020 2:03 am

I've tried, exactly the same issue with "thumbnailIcon".

Send me an email with your icons and i will create a test resourcefile for you.
TerrorSource
Member
Member
 
Posts: 356
Joined: May 2017

Re: Toon app: NL-Alert

Postby TheHogNL » Sat Mar 14, 2020 8:23 am

To get it on toonstore first you need to have it on your github and we will fork it to the TSC repository.

Look at the calendar app for example which files/dirs you need to have on the github for your app. https://github.com/ToonSoftwareCollective/calendar

And an idea, look at the smokedetector native app how they overwrite the full screen when smoke is detected. You can use that code to post a NL-alert message
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1415
Joined: August 2017

Re: Toon app: NL-Alert

Postby glsf91 » Sat Mar 14, 2020 9:30 am

TheHogNL wrote:To get it on toonstore first you need to have it on your github and we will fork it to the TSC repository.

Look at the calendar app for example which files/dirs you need to have on the github for your app. https://github.com/ToonSoftwareCollective/calendar

And an idea, look at the smokedetector native app how they overwrite the full screen when smoke is detected. You can use that code to post a NL-alert message


I have created a repository here: https://github.com/glsf91/nlalert

I have the following questions:

I see also a versions.txt and an qmldir file. Do I also have to create this files in my repository?
And which lines do I have to add in qmldir (I don't know what this file is doing)?
If I look at other apps I see differences in which file is included in qmldir. So maybe somebody can explain this.

In toonstore_AppRepository I see also screenshots of the apps. How can I make and supply these or are the Toon" guys" are making this?

I had also sended an email to @Toonz yesterday with this informations/ questions.

I will take a look at your idea.
glsf91
Member
Member
 
Posts: 133
Joined: September 2017

Re: Toon app: NL-Alert

Postby TerrorSource » Sat Mar 14, 2020 10:29 am

glsf91 wrote:
TheHogNL wrote:To get it on toonstore first you need to have it on your github and we will fork it to the TSC repository.

Look at the calendar app for example which files/dirs you need to have on the github for your app. https://github.com/ToonSoftwareCollective/calendar

And an idea, look at the smokedetector native app how they overwrite the full screen when smoke is detected. You can use that code to post a NL-alert message


I have created a repository here: https://github.com/glsf91/nlalert

I have the following questions:

I see also a versions.txt and an qmldir file. Do I also have to create this files in my repository?
And which lines do I have to add in qmldir (I don't know what this file is doing)?
If I look at other apps I see differences in which file is included in qmldir. So maybe somebody can explain this.

In toonstore_AppRepository I see also screenshots of the apps. How can I make and supply these or are the Toon" guys" are making this?

I had also sended an email to @Toonz yesterday with this informations/ questions.

I will take a look at your idea.


versions is ToonStore requirement to track version history when you press the ? in the ToonStore.
i'm not sure about the qmldir file.

Easiest for us is that you add the screenshots yourself via a Pull Request, then we only need to check and approve it.

I've send a custom made resoucefile to you so you can test with your images.
TerrorSource
Member
Member
 
Posts: 356
Joined: May 2017

Re: Toon app: NL-Alert

Postby Toonz » Sat Mar 14, 2020 10:33 am

glsf91 wrote:In toonstore_AppRepository I see also screenshots of the apps. How can I make and supply these or are the Toon" guys" are making this?

We use the x11vnc app for this. On a Toon 1 you can fully operate a Toon 1 remotely.
Unfortunately on a Toon 2 only the viewing functionality works (due to the multi-touchscreen of the Toon 2 which is not supported by x11vnc).
But I am happy to add the screenshots for you when the production version is ready.
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1374
Joined: December 2016

Re: Toon app: NL-Alert

Postby Toonz » Sat Mar 14, 2020 10:37 am

glsf91 wrote:And which lines do I have to add in qmldir (I don't know what this file is doing)?


Explanation: https://doc.qt.io/qt-5/qtqml-modules-qmldir.html
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1374
Joined: December 2016

Re: Toon app: NL-Alert

Postby glsf91 » Sat Mar 14, 2020 7:25 pm

Toonz wrote:
glsf91 wrote:And which lines do I have to add in qmldir (I don't know what this file is doing)?


Explanation: https://doc.qt.io/qt-5/qtqml-modules-qmldir.html


I have read this. But I'am not sure it is really used because there is no corresponding import in my files. But maybe my understanding is wrong.
I also saw differences in using this file between several apps.
But I have added it. Also with version en Changelog files.

So I think I'am ready with this. I also made screenshots and made a pull request for toonstore_AppRepository. Also made pull request for adding 2 images to tsc-images. Update for resourcefile is only (for now) for the thumbnail icon, so not in a hurry for me.
Hopefully done everything in the right way.

Now it up to your guys I think (and hope :lol: ).
glsf91
Member
Member
 
Posts: 133
Joined: September 2017

Re: Toon app: NL-Alert

Postby Toonz » Sat Mar 14, 2020 8:25 pm

Hi glsf91,

I forked your GitHub repository and merged your pull requests.
The app is available now in the ToonStore test environment for review.

Working fine, just haven't seen a new alert coming in yet.
One comment: The image on the tile in dim state is now showing colors which is against the 'standards' of Quby.
Can you make that one black & white (greyscale)?

Minor detail: the screenshot of the tile should have the same size as a normal screenshot, otherwise the ToonStore will stretch it to full screen

But a great job :-) !!

Kind regardz,

Toonz
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1374
Joined: December 2016

Re: Toon app: NL-Alert

Postby glsf91 » Sat Mar 14, 2020 8:50 pm

Thanks.

Luckily I'am not working for Quby :lol:
I liked the color on the Dim Tile but will try to change it.

I will look into you points, probable tomorrow.

Edit 15-3
I have changed the Tile image and screenshot and made a new version of the app and some pull requests
glsf91
Member
Member
 
Posts: 133
Joined: September 2017

Re: Toon app: NL-Alert

Postby Toonz » Sun Mar 15, 2020 1:01 pm

glsf91 wrote:Edit 15-3
I have changed the Tile image and screenshot and made a new version of the app and some pull requests


Hi glsf91,

All changes processed.
The app is now available in the ToonStore for everyone (version 1.0.1).

Note that the thumbnail icon will be included in the first next release of the resourcefiles.
Therefore currently not showing the icon when adding the nlalert tile to your homescreen, this doesn't impact the app itself.

N.B. The app passed the WAF challenge over here ;-)

Kind regardz,

Toonz
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1374
Joined: December 2016

Next

Return to Toon Apps

Who is online

Users browsing this forum: No registered users and 1 guest