Software: modifications and extensions Toon

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

Moderators: marcelr, TheHogNL, Toonz

Post Reply
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 »

Hi toonz,

A few more changes on detail (at the risk of you finding me most annoying ;-) ).

-typo's
-tile layout (moved relative humidity to wind chill, changed lv to rv (relatieve vochtigheid, in Dutch))
-choice of province on newline. (my province (Noord Brabant) didn't fit :-( )
-changed selector language to Dutch.
-removed all topographic images, set drawables to be loaded from weather app (the same images, no need to store them twice on a machine with tight disk space).
-shifted 5-day forecast 20 pixels to the right, and made this shift selectable.

anyway, see for yourself.

EDIT (marcelr): Attachment removed, stable version of the app to be found in the Downloads thread.
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

marcelr wrote:Hi toonz,
A few more changes on detail (at the risk of you finding me most annoying ;-) ).
Hi Marcel,

not annoying at all :-).
I wasn't sure whether the weather app is loaded on all Toon's by default, just copied the images it to be sure but I am ok to use the weather app folder images.
Happy to take all your improvements except the BuienradarDetailsScreen.
I was working on this one already this evening to add the 5-day wind forecasts (yes, I also shifted that block 20 pixels to the right :-) )
When done I will post the final version. The only item left will be the option to write the default weather station to a local file but we can live without that I think.

Thanks for your contribution.....
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Final release Buienradar app.

Changelog:
- Marcels improvements two post above.
- added 5-days wind forecasts to Detail screen
- Images will be taken from the weather app folder. Please delete the provincies folder from ../buienradar/drawables manually to save space on your device.

My next project: make a stand-alone version of the Traffic app......
And finally I will mount Toon at the wall to be my 'production' thermostate in the next few days.
Will get another Toon this weekend for developments........;-)

EDIT (marcelr): Attachment removed, stable version of the app to be found 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 »

Request for help: I want to write the selected weather station to a local text file to use as startup value after a reboot. Reading values from a text file is easy in QML. However, in QML (using FileIO) it is not possible to write local files I believe. It might require c++ programming to create a plugin but that is beyond my skills.
File IO for plain text files works without any added programming in C++.

I tried this and it does its job (stackoverflow is VERY handy sometimes ;-) ):

Code: Select all

	console.log( "############### about to read file" );
	var doc = new XMLHttpRequest();
	doc.onreadystatechange = function() {
	    if (doc.readyState == XMLHttpRequest.DONE) {
		// output response of request
		console.log(doc.responseText);
	    }
	}
	doc.open("GET", "http://127.0.0.1/happ_thermstat?action=getThermostatInfo");
	doc.send();
	console.log( "############### reading done" );

	console.log( "############### about to write file" );
	var doc2 = new XMLHttpRequest();
	doc2.onreadystatechange = function() {
	    if (doc2.readyState == XMLHttpRequest.DONE) {
		// output response of request
		console.log(doc2.status);
	    }
	}
	doc2.open("PUT", "file:///tmp/test1212.txt");
	doc2.send( "test1212" );
	console.log( "############### writing done" );
(I put it inside the OnClicked section of buienradarTile for testing, works)

Now I need to find out how to do declarations, type definitions, function calls etc. in qml, and string/JSON handling. Should be able to make graphs of boiler parameters this way.
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 »

Another thing: I forgot two provinces in the edit toward the weather app drawables. The revised file is attached.
Sorry folks, in Flevoland and Limburg :oops:
Just unpack and overwrite the previous file in the apps/buienradar directory.
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

marcelr wrote: doc2.onreadystatechange = function() {
if (doc2.readyState == XMLHttpRequest.DONE) {
// output response of request
console.log(doc2.status);
}
}
doc2.open("PUT", "file:///tmp/test1212.txt");
doc2.send( "test1212" );
console.log( "############### writing done" );
Great stuff. Will build this into the app to store the default location. Thanks a lot.
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Latest update to the Buienradar app:

Changelog:
- Details screen: images are now properly aligned in the 5 days weather forecast columns
- Fix on StationScreen by Marcel (thanks)
- A new selected weather station is now saved to "/tmp/selectedStation.txt' and read during startup of qt-gui.
when the file doesn't exist, Rotterdam (6344) is used as default.
- cosmetic update to the tile on request of my family: relative humidity now represented as 'lv'- luchtvochtigheid.

if you want to use a weather station which is not yet selectable through the gui, just enter the number in /tmp/selectedStation.txt:
6308 : "Cadzand";
6283 : "Groenlo";
6315 : "Hansweert";
6258 : "Houtribdijk";
6285 : "Schiermonnikoog";
6209 : "IJmond";
6225 : "IJmuiden";
6320 : "Goeree";
6312 : "Oosterschelde";
6316 : "Schaar";
6324 : "Stavenisse";
6331 : "Tholen";
6313 : "Vlakte ad Raan";
6215 : "Voorschoten";
6248 : "Wijdenes";
6257 : "Wijk aan Zee";

@Marcelr: should we post these apps in the downloads section going forward?

EDIT (marcelr): Attachment removed, stable version of the app to be found 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 »

@Marcelr: should we post these apps in the downloads section going forward?
Yes.

Three remarks:

i) /tmp is really temporary on toon, it's in a part of the RAM mounted as a temporary fs. So, each reboot, it is wiped. Not sure if that is where you want to store the default location.

ii) The unit for relative humidity is %, so I would suggest to drop both lv and rv as additions to this percentage. It's crowded enough already on that line in the tile.
The official abbreviation would be RH (from relative humidity). Maybe we can shorten "gevoelstemp" to T_gevoel (gevoel as subscript, not yet sure how to make that) or WCET (wind chill equivalent temperature (not very poetic)). So we would get:

Tgevoel: -6,5^oC, RH: 97 %
or
WCET: -6.5^oC, RH: 97 %

on a single line.

iii) We will need a short manual for its installation. I can write that later today (download, unpack, install, set location, that's about it).
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Hi Marcel,

the path to the selectedStation.txt file is in two locations:
BuienradarApp.qml, line 123 (for reading at startup)
BuienradarStationScreen.qml, line 155 (for writing after selecting a station)

I had considered writing to the buienradar app folder but somehow I prefered to keep apps and data separated.
I wasn't aware that the tmp folder is really temporary :-)
I leave it up to you to select the best location.

Very much appreciated if you make the change to the tile and write a short manual.... that hadn't crossed my mind yet. Learning for next time....

Thanks a lot.
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Custom logo on main screen

Post by Toonz »

Something completely different:

I changed the Eneco logo to my own picture (/HCBv2/qml/images/enecoLogo.png).
Default size is 64x28 pixels which is quite small. My own logo is now 128x28.

I therefore increased the width parameter of the widget to 128 in /HCBv2/qml/qb/stage/Logo.qml.
Secondly, if you change:
if (dimState)
colorize.setStrength(1.0);

to
if (dimState)
colorize.setStrength(2.0);

then the picture looks less distorted in the dim state.

Kind regards
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 »

Hi Toonz,

On my toon, the FileIO part doesn't work.

I moved the location file to /usr/share/misc/, it gets written there, but not read.
Can't see any error messages, console logging is not working equally well every time I relaunch qt-gui.

Did you see this as well (sometimes)?
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

marcelr wrote:Hi Toonz,

On my toon, the FileIO part doesn't work.

I moved the location file to /usr/share/misc/, it gets written there, but not read.
Can't see any error messages, console logging is not working equally well every time I relaunch qt-gui.

Did you see this as well (sometimes)?
Yes, console logging is a bit buggy (needs a retry sometimes), but working most of the time.

Did you include "import FileIO 1.0" at the top of BuienradarApp.qml?
If yes, I will replace the FileIO part with the http option, but the FileIO code for reading is a bit cleaner....(works flawlessly here)
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 »

Hi Toonz,

I use your copy of the app.
Oh and I'm making the dimmed state such that it only shows the outside temperature. A bit like the reduced data that you get from all other tiles. Need to find a way to implement the proper locale. Now it's -0.1 deg instead of the dutch -0,1.
(decimal dot instead of comma).
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

after a full reboot file reading doesn't work here either. Will revert with a working version. Weird....
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

fixed the fileIO bug (was reading the file at the wrong moment). Working fine now.
apologies for my lousy testing earlier.

Only the file BuienradarApp.qml has changed (still reads using FileIO)
Path I used is: /HCBv2/qml/apps/buienradar/selectedStation.txt

EDIT (marcelr): Attachment removed, stable version of the app to be found in the Downloads thread.
member of the Toon Software Collective
Post Reply

Return to “Toon software development”