Kodi Community Forum

Full Version: Problem with List or grouplist aligny="bottom" and Integer (temp Curve)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

after some weeks off not to much (to non) coding, i use this saturday to try to do one of these themperature curves, knewn from other weather apps, that i like, and try to get something like that in Kodi.

After thinking a while on how i could do this, i came to the conclusion that working with "blocks"/"images" for every degree might is/could be, the best chance to achive what im after.

heres a Mockup how the temperature curve (Houerly) could look after its done:

Image

but as u might guess i have some problems to get this to work.

Problem 1:

I did try to use a Grouplists for every houer, but i need a <aligny>bottom</aligny> in any way, which i wasnt abel to achive.

Is there a way with a List, group, or what ever, which alows me to "stack" my "degree-Images" from the bottom to the Top?

Problem 2:

To avoid problems and odd looking of the themperatur curve, i compare against day low temp, to avoid to much blocks and problems with °C / °F

for this i would need something like this:
Code:
IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))
as a visible condition

which would alow me, to hide the unused "degree-Images/blocks".

but as far as i can thel from the wiki, "IntegerGreatherThan" alows me only to compare against a number, and not agains an other infolabel.

Does may someone of u got a Idea for a Workaround?

Maybe Code says more as these Words, so:

Here is an attempt: the Code for the First Houer.

PHP Code:
    <!-- Temp-bar 1st houer -->
    <
control type="grouplist">
        <
left>0</left>
        <
top>5</top>
        <
width>45</width>
        <
height>320</height>
        <
itemgap>0</itemgap>
        <
aligny>bottom</aligny>
        <
orientation>vertical</orientation>
        <
usecontrolcoords>true</usecontrolcoords>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),36) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),35) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),34) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),33) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),32) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),31) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),30) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),29) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),28) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),27) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),26) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),25) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),24) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),23) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),22) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),21) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),20) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),19) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),18) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),17) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),16) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),15) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),14) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),13) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),12) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),11) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),10) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),09) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),08) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),07) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),06) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),05) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),04) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),03) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),02) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
        
        <
control type="image">
            <
width>45</width>
            <
height>10</height>
            <
texture background="true" colordiffuse="FFFFFFFF">common/Base.png</texture>
            <
aspectratio>stretch</aspectratio>
            <
visible>IntegerGreaterThan(Window.Property(Hourly.1.Temperature),01) + IntegerGreaterThan(Window.Property(Hourly.1.Temperature),Window.Property(Day0.LowTemp))</visible>
        </
control>
    </
control

The Idea is to work with params at a lator attempt, but for now to see if i can get it to work i did it this way.

Hope u get the Idea.

at the Moment im stuck, so if one might got a idea how i can push away the stones which block the road to get this to work, that would be cool.
Wouldn't it just be easier to make separate textures for each height and then simply display them like this?

PHP Code:
<control type="image">
    <
left>0</left>
    <
top>5</top>
    <
width>45</width>
    <
height>320</height>
    <
texture>$INFO[Window.Property(Hourly.1.Temperature),weather/hours/temperature/,.png]</texture>
</
control
Thanks,

Cool Idea, should work., will give it a try

(jer should be easyer, the reason for me trying to working with "degree blocks" was that i was trying to finde a solution where i can start at a individual "baseline" depending on the "day low temp".

guess this shuld also be possible with the solution u did post. Starting from "0°" or try to start at "dayLowTemp", will see what fits best.)

Thanks
Love the idea. Keep Fahrenheit in mind.
Really great idea!

Would minus degrees (eg. -10 degrees C) then align at the top and move down?
(2016-08-08, 10:04)Gade Wrote: [ -> ]Really great idea!

Would minus degrees (eg. -10 degrees C) then align at the top and move down?

Thanks

did have two Ideas in minde. The One you mentioned or simply choose an other Color for -°C degrees (/degrees below the freezing point)
After experimenting with Hitchers Idea (which works as expected), -> (Screen) (at least it works for + degrees the way i use it, minus degrees not tested jet..)

i thought i go back to the "single degree image" / "degreeblocks" Idea, for the reason that i think, even if it is more code (which it realy is), it is more flexible in design.

i did get it to work (upsidedown, but the idea is to use an 180° animation in the parent group to turn it.)

--

one thing i couldnt solve so far is one of the visible condition:

Code:
IntegerGreaterThan(Window.Property(Daily.1.LowTemperature),$PARAM[visibleDegree_id])

this works just as long there are no -°C "degreeblocks", as soon there are some, them are always visible. Could it be possible that "IntegerGreatherThan" have problems with negative values? (or simple cant handle these?)

So:
Code:
<param name="visibleDegree_id" value="1" />
works (Image (/degreeblock) is hidden if the "visibleDegree_id" is lower than the "daily low Temp")

Code:
<param name="visibleDegree_id" value="-1" />
doesnt work (Image (/degreeblock) is always visible)
Yeah, choosing another color is probably much easier to code.

Please keep us updated on the progress Wink