Software: modifications and extensions Toon

Everything about software tools, new software development and toolchains. For developers, mostly.

Moderators: marcelr, TheHogNL, Toonz

Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Thanks Marcel,

I expect a new release tomorrow:
changelog:
- your changes above (again :oops: )
- you can zoom in and out on the google map on the latitude/longitude edit screen is
- default location set with the longitude/latitude coordinates is now also shown with
location-marker.png
location-marker.png (140 Bytes) Viewed 10760 times
on the big and small buienradar images

I will update this post when ready......
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

hmm, while finishing the zoom function I noticed that the standard xml.buienradar.nl XML file is not properly processed anymore since this morning 10:00.
At first glance it seems that the document is not loaded properly as an XML DOM model anymore in the BuienradarApp.qml, only the first tag is recognised (<buienradarnl>).
With a browser or editor the xml file seems ok.
I am looking into it now but not sure I will be able to resolve this this evening.
Tips?

Edit: could be because all lines are now separated by a CRLF, with QML effectively ignoring everything after <buienradarnl>
Edit2: Marcel, maybe good to remove the Buienradar app from the downloads section for the time being. P.S. the Regenradar tile still works fine
I can still read the whole file as one big text string, can start from there but it means a complete rewrite of the function updateBuienradar(). Need some time for that
Bummer
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

Edit: could be because all lines are now separated by a CRLF, with QML effectively ignoring everything after <buienradarnl>
If this is what's causing trouble, you might want to replace the CRLFs with the replace method in xmlhttp:

Code: Select all

 xmlhttp.responseText =  xmlhttp.responseText.replace( /\r\n/g, "\n" );
(not sure if I got the syntax correct, but it should be something along these lines IIRC, see the boiler status app for an example).

And: Buienradar app temporarily removed from downloads. Good luck patching.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

thanks for the hint Marcel. Will keep you guys posted on the progress here.
I was using the responseXML method, not the responseText, but let's see....
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

The good News: handling the buienradar file as a big string (responseText method) seem to work fine. A new working version is in the making.
The bad News: it takes some time to complete, so please have some patience... (bit busy at work coming days)
member of the Toon Software Collective
BrainHunt
Starting Member
Starting Member
Posts: 23
Joined: Thu Jun 30, 2016 11:37 am

Re: Software: modifications and extensions Toon

Post by BrainHunt »

Hi Toonz,

I just checked but the tiles are working fine at my Toon. Before rewriting the code, I woud wait to see if this change in the buienradar data is permanent...

Best!
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

that's really weird. It stopped working on both of my Toons simultaneously at 10:00 this week while I was at work. Which buienradar version do you have running?

Edit: confirmed working again here as well. We will never know.
I will package a new version tomorrow evening, including the zoom option on the lat/lon entry screen.
Ultimate goal is to enter the coordinates by just clicking anywhere on the map. Just need to figure out the pixel to real distance ratio at each zoom level.
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Here I am again, app working fine again, version 5.0.8beta:

Added recently:
- after changing the Longitude or Latitude (by clicking on the rainradar tile) a marker is placed on that location on the big Buienradar screen (via de tray icon) as well as the small buienradar image on the detail screen.
- zoom in and zoom out buttons for the map added to the Lon/Lat entry screen, default starting at the lowest zoom level (lowest set by me, increase the number in line 53 in BuienradarEditLonLatScreen.qml if you want to zoom further)

ToDo:
- when the temperature is above 10C the calculation of the 'gevoelstemperatuur' results in NaN.
This is because the variable 'vapourPressure' gets the value NaN at line 68 in buienradar.js.
I can't immediately spot the error to be honest. Tips?
- I now have the scale in pixels per map, will add the functionality to set the lon/lat parameters simply by clicking anywhere on the map

EDIT (marcelr): attachment removed, latest version in the downloads thread.
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

I can't immediately spot the error to be honest. Tips?
I think it's something with the overloading of the "+" operator in the javascript implementation of toon. Fixed it (the buienraradar script, not the js implementation), sort of.

changed:

added some typecasts in buienradar.js. in method formatGevoelstemp.

If this one's fine for you, I'll upload it to the downloads thread, and remove intermediate versions again.

BTW, I think the full screen version of the buienradar-images shrunk a little. Is that on purpose?

EDIT: attachment removed, latest version in the downloads thread.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

marcelr wrote:BTW, I think the full screen version of the buienradar-images shrunk a little. Is that on purpose?
Yes it is. The original image requested from buienradar was too big for the screen so QML resized it on the fly
I ran into problems mapping the marker correctly on the map (by x,y coordinates in pixels).
I therefore pulled a smaller picture (300x300) which is not resized by Toon.

Now I have all the 'map formulas' I can enlarge it again to the extend that it just fits without resizing, will put it on the todo list
Thanks for your changes.... almost done with selecting the lon/lat via the map.... ran into the same NaN issue again when calculating the coordinates back from the x,y pixel coordinates (formula works fine in the browser), so will apply a similar change there

<<Edit>> formula's are fine now, will tidy up during the weekend
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

I slowly run out of 'to do's':

- added functionality to enter the lon/lat coordinates on the screen behind the 'Regen' tile by clicking anywhere on the map :-) at any zoom level! Calculated by just one formula (functions calcXcoordinate and calcYcoordinate in Buienradar.js)
within the Netherlands this functionality works very precise. As you move closer to the poles or equator the deviation is large but that doesn't matter for this application.
Between zoom levels 5 (NL) and 13 (neighbourhood) it works very good. Coordinates are rounded to 2 decimals because of the limitation of the rain datafeed by buienradar. On zoomlevel 13 only 4 rounded lat/lon points exists on the map. Zoomlevel 13 is the starting zoomlevel when opening the screen.
Zooming further means the whole map is covered by just one rounded coordinate and clicking anywhere will not have an effect.
Panning can be done by clicking at the edges of the map, which will become the new center of the next map.

To do:
- enlarge the big Buienradar screen a bit
- put some helptekst on the lon/lat entry screen

<<edit: attachment removed, final version posted below>>
Last edited by Toonz on Fri Feb 03, 2017 11:27 pm, edited 1 time in total.
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Added my final version, changelog:
- big Buienradar image enlarged as before
- added some clarifying text in the lon/lat entry screen

Happy to take any change requests but currently my to-do list is empty.
Probably will move on to the traffic app.

Many thanks to all who contributed: RomMom, hvxl, Marcelr and Brainhunt (apologies if I forgot someone).
It was a steep learning curve into Javascript and QML for me.
P.S. Marcel, your solution for redirecting the console output has been a life saver a couple of times, thanks for that

EDIT (marcelr): Moved attachment to the downloads thread.
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

P.S. Marcel, your solution for redirecting the console output has been a life saver a couple of times, thanks for that
You're welcome. Thanks for this nice app.

Moved it to the downloads section.
QuasaR
Starting Member
Starting Member
Posts: 23
Joined: Wed Feb 08, 2017 1:06 pm

Re: Software: modifications and extensions Toon

Post by QuasaR »

Installed this app on fw 3.6.3 and seems to be working fine. I didn't replace the happ_thermstat files.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

QuasaR wrote:Installed this app on fw 3.6.3 and seems to be working fine. I didn't replace the happ_thermstat files.
Not sure which app you are referring to. The Buienradar app doesn't use happ_thermstat functionality at all. The Boilerstatus app from Marcel does need an older version of happ_thermstat (see downloads section for more details) to function properly.

Regards,

Toonz
member of the Toon Software Collective
Post Reply

Return to “Toon software development”