Software: modifications and extensions Toon

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

Moderator: marcelr

Re: Software: modifications and extensions Toon

Postby Toonz » Mon Jun 18, 2018 10:36 am

Luc_S wrote:Hey all, is there any way to open an app directly from the dim-state window?

No, because there is an overlay window active in dim state covering the whole screen. A press anywhere on screen (that overlay window) will bring you out of the Dim state
member of the Toon Software Collective
User avatar
Toonz
Advanced Member
Advanced Member
 
Posts: 819
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Luc_S » Mon Jun 18, 2018 5:46 pm

Toonz wrote:
Luc_S wrote:Hey all, is there any way to open an app directly from the dim-state window?

No, because there is an overlay window active in dim state covering the whole screen. A press anywhere on screen (that overlay window) will bring you out of the Dim state


And we are unable to tweak this overlay in any way? I'm having some trouble finding out where this overlay function is located.
Luc_S
Starting Member
Starting Member
 
Posts: 25
Joined: June 2018

Re: Software: modifications and extensions Toon

Postby Toonz » Mon Jun 18, 2018 9:03 pm

Luc_S wrote:
Toonz wrote:And we are unable to tweak this overlay in any way? I'm having some trouble finding out where this overlay function is located.

Look in Canvas.qml ;-)
member of the Toon Software Collective
User avatar
Toonz
Advanced Member
Advanced Member
 
Posts: 819
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Rudolf » Tue Jun 19, 2018 6:56 am

Does anyone know where the module 'BasicUIControls' comes from?

I can't find it as javascript on the Toon and can't find it anywhere online as cpp (as I could with FileIO).
Are these closed source classes written in cpp by Quby?
Rudolf
Member
Member
 
Posts: 113
Joined: December 2017

Re: Software: modifications and extensions Toon

Postby marcelr » Tue Jun 19, 2018 11:06 am

Yes, most likely.
Most of the code on Toon is open source, so there's a strong possibility that this particular module is (at least derived from) publicly available code.
marcelr
Advanced Member
Advanced Member
 
Posts: 942
Joined: May 2012
Location: Ehv

Re: Software: modifications and extensions Toon

Postby Rudolf » Mon Aug 06, 2018 8:55 pm

I finally decided to mount the Toon in the living room and replace the existing thermostat.
And offcourse the missus had a comment ready right away; the hue/controlpanel-button was too bright in the dimstate.

And I must say that I agree; it's a rather large white-button with tiny black dots and a small arrow.
It's a nifty little button; because it allows you to open the controlpanel right away.
I decided it was better to invert this color scheme, black background, white dots/arrow.

Since the icon has a transparent background; we must edit its parent object.
Replace #ffffff with #000000 as shown below. (6x zeroes, for all black, instead of white)

/qmf/qml/qb/components/SlidePanelButton.qml
Code: Select all
        color: canvas.dimState ? "#000000" : (root.parent.panelOpen ? colors.canvas : colors.background)


I edited the svg using this online editing tool.
http://editor.method.ac/

The file to edit is located here:
Code: Select all
/qmf/qml/apps/controlPanel/drawables/controlPanelClosed_dim.svg


I attached both the original and the modified version (in case you mess yours up)
Attachments
controlPanelMod.zip
(911 Bytes) Downloaded 48 times
Rudolf
Member
Member
 
Posts: 113
Joined: December 2017

Re: Software: modifications and extensions Toon

Postby Rudolf » Sun Oct 07, 2018 6:54 pm

To copy this mod to Toon2 I've been messing with drawables.rcc (or its contents)
and found the following svg in plain-text
Code: Select all
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><title>controlPanelClosed_dim</title><g id="Layer_2" data-name="Layer 2"><g id="control_panel" data-name="control panel"><circle cx="4" cy="4" r="4"/><circle cx="16" cy="4" r="4"/><circle cx="4" cy="16" r="4"/><path d="M19,12a1,1,0,0,0-1,1v3.586L13.414,12A1,1,0,0,0,12,13.414L16.586,18H13a1,1,0,0,0,0,2h6a1,1,0,0,0,1-1V13A1,1,0,0,0,19,12Z"/></g></g></svg>


With this online tool I was able to make some modifications:
https://www.rapidtables.com/web/tools/s ... ditor.html

Code: Select all
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" ><title>controlPanelClosed_dim</title><g id="Layer_2" data-name="Layer 2"><g id="control_panel" data-name="control panel"><circle cx="4" cy="4" r="4" fill="grey"/><circle cx="16" cy="4" r="4" fill="grey"/><circle cx="4" cy="16" r="4" fill="grey"/><path d="M19,12a1,1,0,0,0-1,1v3.586L13.414,12A1,1,0,0,0,12,13.414L16.586,18H13a1,1,0,0,0,0,2h6a1,1,0,0,0,1-1V13A1,1,0,0,0,19,12Z" fill="grey"/></g></g></svg>


I used "grey" to maintain visibility on the white background, but white is preferred.
I can't seem to make the background black, but I'm unsure if that's necessary.

Any guidance, will this work?
Rudolf
Member
Member
 
Posts: 113
Joined: December 2017

Re: Software: modifications and extensions Toon

Postby TheHogNL » Sun Oct 07, 2018 7:27 pm

Nope, you can't 'text edit' the rcc files. Just leave the drawables.rcc as it is.
If you need that mod I will need to change the resources.rcc and add the new button somewhere. Takes some work though.
Member of the Toon Software Collective
User avatar
TheHogNL
Advanced Member
Advanced Member
 
Posts: 564
Joined: August 2017

Re: Software: modifications and extensions Toon

Postby Rudolf » Mon Oct 08, 2018 9:48 am

Will the existing controlPanel app use the modified button?
Rudolf
Member
Member
 
Posts: 113
Joined: December 2017

Re: Software: modifications and extensions Toon

Postby Cctl01 » Thu Nov 08, 2018 4:36 pm

I'm trying to take my first babysteps into toon programming. I wanted to start following the basic clock examples given in this thread but I'm stuck before I even began.

The problem is not being able to find the location of the clock tile. I've tried the following to find it.
Code: Select all
# find / -name clock
/qmf/qml/apps/clock
# /qmf/qml/apps/clock# ls -al
drwxr-xr-x    3 root     root           224 Sep 12 17:48 .
drwxrwxr-x   34 root     root          2752 Nov  8 11:36 ..
drwxr-xr-x    2 root     root          1952 Sep 12 17:54 lang


But as you can see all i find is a (practically) empty directory. What's going on here? :roll:
Cctl01
Starting Member
Starting Member
 
Posts: 12
Joined: November 2018

Re: Software: modifications and extensions Toon

Postby marcelr » Thu Nov 08, 2018 9:29 pm

Since FW 4.16.x all qml code has been packed in what is called a resource file (extension .rcc). These files are binary blobs holding all qml code. To start coding yourself, you can install the modified rcc files from the forum ftp server. Checkout this thread for more info:
https://www.domoticaforum.eu/viewtopic.php?f=96&t=12071

Then install the toonstore, and checkout the code that's installed through it. Our apps are still plain qml/javascript, so it's easy to read and modify these.

Happy coding!
marcelr
Advanced Member
Advanced Member
 
Posts: 942
Joined: May 2012
Location: Ehv

Re: Software: modifications and extensions Toon

Postby jackli072 » Tue Dec 11, 2018 3:35 pm

Thanks for the information.

cygnusx wrote:Well, almost everything is possible. The language is QML. It's a language to define which widgets go where and define some specifics. But, all the rest in the QML file is actually Javascript.

So, things like x&y coordinates, height, width, opacity etc. is QML, and actions like onclick, loading data on specific intervals, that's all plain javascript.

That makes it kinda easy to program for it. It's mostly basic javascript programming.

I use the original modules to make my own. For instancy, my lights/blinds screen is just a modification from the original one. The difference is that Quby does not do web requests via QML/Javascript but it has it's own daemon on the background where it communicates with. I suppose that has better software application development company performance than my solution, but that part (the daemon) is written in C, in other words, it's compiled and not (easily) modifyable. But if you are smart you can just get away with using javascript.

For instance. I made my own weather script instead of using the default one. It's based on buienradar, so the data is already publicly available. Normally, Toon gets regular weather updates from its backend daemon. This daemon reads the full weather xml and fetches the interesting part (only the weather for your location instead of all weather stations in NL) and sends it to the Toon frontend. In this way, Toon does not have to process all of the data what could make it slow.

I do almost the same. I have a PHP script running on a raspberry pi in my house. This script fetches the buienradar xml. It get's my relevant weather station and sends that part to toon. on my toon i do the rest.
jackli072
Starting Member
Starting Member
 
Posts: 1
Joined: December 2018

Previous

Return to Toon software development

Who is online

Users browsing this forum: No registered users and 1 guest