Toon app: rotating through tiles, automatically

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz

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

Toon app: rotating through tiles, automatically

Post by Toonz »

Hi all,

just before I really need to start packing for the holiday I would like to share my latest proof of concept.
Well, not only a concept, it is working fine but not sure if it is the best solution.
Challenge: rotate tiles on the homescreen to see more than just the 4 tiles of screen 1 in dim state (thanks Marcel for the suggestion)

Solution: I've implemented a timer which rotates through the different existing homescreen pages every 15 seconds in dim state only.
You now can see all those tiles in dim state you have never seen before :-)

Pro's: it is a clean, simple mod to the Homescreen.qml
Con's: if you want to have a tile fixed on screen you will need to add the same tile to all homescreens (like the clock for example)
Alternatively I could look into rotating single tiles but then the question is which tiles to select. Getting a bit more complicated quickly. Happy to hear your views.

If you want to implement this copy the code below to the Homesceen.qml in the apps folder homescreen at the Component.onCompleted (line 488 in my firmware)

Code: Select all

	Component.onCompleted: {
		registry.registerWidgetContainer("prominent", rightPanel);
//screen rotate start
		homescreenrotate.running = true;
//screen rotate end
	}

//screen rotate start

	function rotateHomescreen() {
		if (screenStateController.dimmedColors) {	// only rotate screen in dim state, ignore the last page (usually empty)
			var newpage = currentPage + 1;
			if (newpage >= pagecount - 1)
				newpage = 0;
			widgetNavBar.navigateBtn(newpage);
		}
	}

	Timer {
		id: homescreenrotate
		interval: 15000  				//update every 15 sec, change to whatever you like
		triggeredOnStart: false			//can only be run once the page has loaded, not at start
		running: false				//timer will be started in the onCompleted function right above after loading the page
		repeat: true
		onTriggered: rotateHomescreen()
	}

//screen rotate end
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 »

Toonz wrote:Hi all,

just before I really need to start packing for the holiday I would like to share my latest proof of concept.
Well, not only a concept, it is working fine but not sure if it is the best solution.
Challenge: rotate tiles on the homescreen to see more than just the 4 tiles of screen 1 in dim state (thanks Marcel for the suggestion)

Solution: I've implemented a timer which rotates through the different existing homescreen pages every 15 seconds in dim state only.
You now can see all those tiles in dim state you have never seen before :-)

Pro's: it is a clean, simple mod to the Homescreen.qml
Con's: if you want to have a tile fixed on screen you will need to add the same tile to all homescreens (like the clock for example)
Alternatively I could look into rotating single tiles but then the question is which tiles to select. Getting a bit more complicated quickly. Happy to hear your views.

If you want to implement this copy the code below to the Homesceen.qml in the apps folder homescreen at the Component.onCompleted (line 488 in my firmware)

Code: Select all

	Component.onCompleted: {
		registry.registerWidgetContainer("prominent", rightPanel);
//screen rotate start
		homescreenrotate.running = true;
//screen rotate end
	}

//screen rotate start

	function rotateHomescreen() {
		if (screenStateController.dimmedColors) {	// only rotate screen in dim state, ignore the last page (usually empty)
			var newpage = currentPage + 1;
			if (newpage >= pagecount - 1)
				newpage = 0;
			widgetNavBar.navigateBtn(newpage);
		}
	}

	Timer {
		id: homescreenrotate
		interval: 15000  				//update every 15 sec, change to whatever you like
		triggeredOnStart: false			//can only be run once the page has loaded, not at start
		running: false				//timer will be started in the onCompleted function right above after loading the page
		repeat: true
		onTriggered: rotateHomescreen()
	}

//screen rotate end
Hi all,

In addition to the post above I've implemented a simple addon to the homescreen to rotate through all available tiles at a specific tile location on the homescreen at a configurable interval. Before sharing with you I would like to get some input from you guys:
Do you want to rotate through all tiles or a given (selection of) categories (as shown in the 'AddTile' screen) or do you prefer to be able to select a set of individual tiles to be included in the rotation. That selection can be easily implemented in the code, building screens for it is a bit more work.
Secondly, I now rotate the content of a specific tile on the first screen, the code can be easily changed to the tile of your liking. I will look into options to select the rotating tile (e.g. add a second button next to the '+' on an empty tile).

Views?

N.B TerrorSource, good work on DomoticzLight :-)
member of the Toon Software Collective
TerrorSource
Administrator
Administrator
Posts: 494
Joined: Thu May 04, 2017 9:28 pm

Re: Software: modifications and extensions Toon

Post by TerrorSource »

Toonz wrote:
Toonz wrote:Hi all,

just before I really need to start packing for the holiday I would like to share my latest proof of concept.
Well, not only a concept, it is working fine but not sure if it is the best solution.
Challenge: rotate tiles on the homescreen to see more than just the 4 tiles of screen 1 in dim state (thanks Marcel for the suggestion)

Solution: I've implemented a timer which rotates through the different existing homescreen pages every 15 seconds in dim state only.
You now can see all those tiles in dim state you have never seen before :-)

Pro's: it is a clean, simple mod to the Homescreen.qml
Con's: if you want to have a tile fixed on screen you will need to add the same tile to all homescreens (like the clock for example)
Alternatively I could look into rotating single tiles but then the question is which tiles to select. Getting a bit more complicated quickly. Happy to hear your views.

If you want to implement this copy the code below to the Homesceen.qml in the apps folder homescreen at the Component.onCompleted (line 488 in my firmware)

Code: Select all

	Component.onCompleted: {
		registry.registerWidgetContainer("prominent", rightPanel);
//screen rotate start
		homescreenrotate.running = true;
//screen rotate end
	}

//screen rotate start

	function rotateHomescreen() {
		if (screenStateController.dimmedColors) {	// only rotate screen in dim state, ignore the last page (usually empty)
			var newpage = currentPage + 1;
			if (newpage >= pagecount - 1)
				newpage = 0;
			widgetNavBar.navigateBtn(newpage);
		}
	}

	Timer {
		id: homescreenrotate
		interval: 15000  				//update every 15 sec, change to whatever you like
		triggeredOnStart: false			//can only be run once the page has loaded, not at start
		running: false				//timer will be started in the onCompleted function right above after loading the page
		repeat: true
		onTriggered: rotateHomescreen()
	}

//screen rotate end
Hi all,

In addition to the post above I've implemented a simple addon to the homescreen to rotate through all available tiles at a specific tile location on the homescreen at a configurable interval. Before sharing with you I would like to get some input from you guys:
Do you want to rotate through all tiles or a given (selection of) categories (as shown in the 'AddTile' screen) or do you prefer to be able to select a set of individual tiles to be included in the rotation. That selection can be easily implemented in the code, building screens for it is a bit more work.
Secondly, I now rotate the content of a specific tile on the first screen, the code can be easily changed to the tile of your liking. I will look into options to select the rotating tile (e.g. add a second button next to the '+' on an empty tile).

Views?

N.B TerrorSource, good work on DomoticzLight :-)
Well, i prefer the All-Tiles rotation. You don't need to use > to go to the next tile page then. I only prefer to set the timer manually(or in the scripts) so the tile rotation time is configurable.
Guess that it's hard to code to just rotate particular Tiles.

Any possiblity that you can send me an email so we can chat about the apps? got a few more ideas myself but i cannot code that myself.
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 would like to see the top line of tiles on the first page stay in place, and have the other tiles (from all pages) rotate through the bottom line of tiles. Not sure if that's possible, though.

Anyway, just my 2ct.
TerrorSource
Administrator
Administrator
Posts: 494
Joined: Thu May 04, 2017 9:28 pm

Re: Software: modifications and extensions Toon

Post by TerrorSource »

marcelr wrote:I would like to see the top line of tiles on the first page stay in place, and have the other tiles (from all pages) rotate through the bottom line of tiles. Not sure if that's possible, though.

Anyway, just my 2ct.
Maybe build 1 script with multiple options would do the trick for everyone :)
modus1 = rotate all screens
modus2 = rotate top row
modus3 = rotate bottom row
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

TerrorSource wrote: .... I only prefer to set the timer manually(or in the scripts) so the tile rotation time is configurable.
It is already configurable in the script in milliseconds :)
TerrorSource wrote: .... Guess that it's hard to code to just rotate particular Tiles.
Probably easy to do, can select by name probably, will need to be hardcoded in the script or via an external text file
marcelr wrote:I would like to see the top line of tiles on the first page stay in place, and have the other tiles (from all pages) rotate through the bottom line of tiles. Not sure if that's possible, though.
Good idea, possible for sure
TerrorSource wrote: Maybe build 1 script with multiple options would do the trick for everyone :)
modus1 = rotate all screens
modus2 = rotate top row
modus3 = rotate bottom row
Yep, this is how I already did my first attempt, two separate functions, one to rotate the whole screen and one to rotate on a single tile.

Need to think about a couple of other things as well:
- need to implement a way to start/stop scrolling to allow you to modify the homescreens (and/or reset to the standard layout)
- ideally the ability to change to one of the other modules without the need for restarting the qui .
I most likely will add a menu item for the homescreen config, easiest way to implement the two items above I think

Thanks a lot for your suggestions, first 'release' coming soonish (bit busy at work).
By the way, the wastecollection app is finished and going through the last testing cycles and final QA review (my wife :D ).
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: rotating through tiles, automatically

Post by Toonz »

Hi all,

I found during testing that the rotation of tiles as I do it now negatively impacts stability over time (I now remove and create tiles on the fly).
Rotating full homescreens is not an issue as the individual tiles are not touched in that case.
Need to do some more research. No ETA.... :(

What happened is that each changed tile was added to the config xml (creating a lot of duplicates).
At next reboot all these duplicates are being loaded again until memory is full and the Toon reboots itself.

Regardz,

Toonz
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: rotating through tiles, automatically

Post by Toonz »

Hi all,

the issues with my previous attempt to rotate tiles have been resolved.
The following homescreen mod gives you the ability to automatically rotate tiles on the first page of the homescreens in 4 ways:
0: no rotation, behaviour as normal
1: rotate only the right bottom tile and leave the other three untouched (both normal and dim state)
2: rotate the bottom two tiles and leave the upper two untouched (both normal and dim state)
3: rotate the whole homescreen. In this case no tile configuration is changed, merely the next homepage is selected every x seconds (only in dim state)

You can change the behaviour 'on the fly' by clicking on the new icon just right of the '>' page selector at the bottom.
The small number in the icon represent the rotation mode above.
Default value is 0 (no rotation).

Installation:
I uploaded my full homescreen app (version 3.7.9) but the best way to implement is probably to copy/paste all changes into your own homescreen app.
Changes to be made:
- copy the 4 SettingsIconx.png icons from the drawables folder into your own homescreen/drawables folder.
- copy/paste alle code changes (5 blocks) in Homescreen.qml which are marked between:
// start mod rotating tiles
and
// end mod rotating tiles
- change the 'cycle time' in the first block if you want, default is 15 seconds (property int rotationInterval : 15000)

Important notes:
- only tiles which are visible at the start of qt-gui will be included in the rotation. If you want to include newer tiles as well my advice is to stop rotation (setting 0) first, finish your homescreen/tile layout and restart the gui.
- rotation will only start 3 minutes after completing the loading of the homepage to wait for the initial initialisation of the tiles at startup


Have fun. As always happy to hear different views on how this can be implemented (critical comments are received as a gift :) )
Homescreenmod_tiles_rotation.png
Homescreenmod_tiles_rotation.png (57.16 KiB) Viewed 18319 times
Attachments
homescreen_rotating_tiles_V0.2.zip
(42.38 KiB) Downloaded 567 times
member of the Toon Software Collective
Wunser
Starting Member
Starting Member
Posts: 14
Joined: Sat Sep 09, 2017 6:35 pm

Re: Toon app: rotating through tiles, automatically

Post by Wunser »

Any chance for an update that works with the newest toon firmware? I tried deploying these code changes, but it left the panel in a qt-reboot loop.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: rotating through tiles, automatically

Post by Toonz »

Wunser wrote:Any chance for an update that works with the newest toon firmware? I tried deploying these code changes, but it left the panel in a qt-reboot loop.
Sure, which firmware version do you have?
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: rotating through tiles, automatically

Post by Toonz »

I already did the one for firmware version 4.4.21.
It is a modded version of Homescreen.qml.
DO NOT INSTALL ON OTHER FIRMWARE VERSIONS.!!!
Unzip the attached file in the folder .../qml/apps/homescreen

I can make one for 4.7.23 as well rather quickly if anyone is interested

Kind regardz,

Toonz
Attachments
Homescreen_rotating_tile_mod_firmware_4.4.21.zip
(7.99 KiB) Downloaded 547 times
member of the Toon Software Collective
Templar
Member
Member
Posts: 178
Joined: Fri Mar 18, 2011 8:49 pm
Location: Netherlands

Re: Toon app: rotating through tiles, automatically

Post by Templar »

Toonz wrote:I can make one for 4.7.23 as well rather quickly if anyone is interested
FW 4.8.25 is already released.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: rotating through tiles, automatically

Post by Toonz »

useless release ;-)
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: rotating through tiles, automatically

Post by Toonz »

Toonz wrote:I already did the one for firmware version 4.4.21.
It is a modded version of Homescreen.qml.
DO NOT INSTALL ON OTHER FIRMWARE VERSIONS.!!!
Unzip the attached file in the folder .../qml/apps/homescreen

I can make one for 4.7.23 as well rather quickly if anyone is interested

Kind regardz,

Toonz
Apologies, also copy the attached icons in /qml/apps/homescreen/drawables, otherwise you still see nothing ;-)
Attachments
drawables_Homescreen_4.4.21.zip
(10.78 KiB) Downloaded 536 times
member of the Toon Software Collective
Wunser
Starting Member
Starting Member
Posts: 14
Joined: Sat Sep 09, 2017 6:35 pm

Re: Toon app: rotating through tiles, automatically

Post by Wunser »

Toonz wrote:I already did the one for firmware version 4.4.21.

I can make one for 4.7.23 as well rather quickly if anyone is interested

Kind regardz,

Toonz
Yep, very very interested :D
Post Reply

Return to “Toon Apps”