conditionals in text box?

Got an idea, post it here

conditionals in text box?

Postby damage on Sat Sep 02, 2006 4:30 am

i know there's scripting plugins, but would it be feasible to just have simple conditionals in text boxes?

for example, i have a value that comes in via the xap plugin, either 1 or 0, but i don't want to display 1 or 0. i want to display On or Off. so if i put this in the text box, i get what i want:

if plugin>xap-Xlobby>text>xyz == 1 then On else Off

or maybe something like this

(plugin>xap-Xlobby>text>xyz==1,On,Off)

thoughts?
damage
 
Posts: 35
Joined: Fri Aug 18, 2006 7:07 pm

Postby S Pittaway on Sat Sep 02, 2006 12:28 pm

it would be nice, but you can already do whatever you wont via a simple plugin....

personally, i would rather steve spent time adding things to the core that can not be done anyother way.

i know
that its a pain if you dont program, but if you tried it the kind of thing you want to do is only a few lines of c# (or vb?) code.

you can get the compiler free from microsoft, so it doesent have to cost anything to try (apart from a decent sized download of course)

and there are plenty of examples knocking showing basic plugins...
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby P3rv3rt B3ar on Sat Sep 02, 2006 12:45 pm

besides, xPErT already contains huge load of if statements, if not that particular one, it could be still achieved with small change in logic...
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby damage on Thu Sep 07, 2006 2:48 am

S Pittaway wrote:it would be nice, but you can already do whatever you wont via a simple plugin....

personally, i would rather steve spent time adding things to the core that can not be done anyother way.

i know
that its a pain if you dont program, but if you tried it the kind of thing you want to do is only a few lines of c# (or vb?) code.

you can get the compiler free from microsoft, so it doesent have to cost anything to try (apart from a decent sized download of course)

and there are plenty of examples knocking showing basic plugins...


that's great but i don't want to spend my time learning how to write a plugin. i'm trying to build a skin. it would seem this would be a core feature of xl for skin building and would help put it closer to the usability you get w/ a mainlobby or charmed quark controller. it would definitely have a greater appeal to the majority of xl users who probably aren't coders.

don't get me wrong. i like to code stuff, but it's so much overhead to have to code up a plugin to do a simple conditional. at least, if it were in xl, there would be a standard way to do things. and it would be easier to support and find documentation on.
damage
 
Posts: 35
Joined: Fri Aug 18, 2006 7:07 pm

Re: conditionals in text box?

Postby lar282 on Thu Sep 07, 2006 10:17 am

damage wrote:i know there's scripting plugins, but would it be feasible to just have simple conditionals in text boxes?

for example, i have a value that comes in via the xap plugin, either 1 or 0, but i don't want to display 1 or 0. i want to display On or Off. so if i put this in the text box, i get what i want:

if plugin>xap-Xlobby>text>xyz == 1 then On else Off

or maybe something like this

(plugin>xap-Xlobby>text>xyz==1,On,Off)

thoughts?


I have a red and green image for my lamps. It's a textbox with this in it
plugin>xap-xlobby>Image>BioRum.Slang
and then a image in the xap plugin directory called
biorum.slang.OFF.png
biorum.slang.ON.png


the devicemap.xml contains info about them
<device>
<name>biorum.slang</name>
<source>ERSP.X10.*</source>
<state>OFF</state>
<text></text>
</device>


alot nicer than on or off.

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: conditionals in text box?

Postby damage on Thu Sep 07, 2006 2:22 pm

lar282 wrote:
damage wrote:i know there's scripting plugins, but would it be feasible to just have simple conditionals in text boxes?

for example, i have a value that comes in via the xap plugin, either 1 or 0, but i don't want to display 1 or 0. i want to display On or Off. so if i put this in the text box, i get what i want:

if plugin>xap-Xlobby>text>xyz == 1 then On else Off

or maybe something like this

(plugin>xap-Xlobby>text>xyz==1,On,Off)

thoughts?


I have a red and green image for my lamps. It's a textbox with this in it
plugin>xap-xlobby>Image>BioRum.Slang
and then a image in the xap plugin directory called
biorum.slang.OFF.png
biorum.slang.ON.png


the devicemap.xml contains info about them
<device>
<name>biorum.slang</name>
<source>ERSP.X10.*</source>
<state>OFF</state>
<text></text>
</device>


alot nicer than on or off.

//Lasse


that was just an example i gave. i thought about doing what you did except i have about 500 devices that i want to show on off status for (x10, relays, digital inputs, alarm panel, sprinkler, motion sensors, etc) that would mean i would need 1000 images. each device needs 1 image for on and 1 for off.
damage
 
Posts: 35
Joined: Fri Aug 18, 2006 7:07 pm

Postby lar282 on Thu Sep 07, 2006 7:25 pm

500!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
puh, then u do need a plugin


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby S Pittaway on Fri Sep 08, 2006 7:32 am

:)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby damage on Fri Sep 08, 2006 4:19 pm

lar282 wrote:500!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
puh, then u do need a plugin
//Lasse


why?
damage
 
Posts: 35
Joined: Fri Aug 18, 2006 7:07 pm

Postby cmhardwick on Fri Sep 08, 2006 5:26 pm

but even with 500, you could do it with just 2 images if each device only has ON and OFF. You could then use a text over the On or Off image to identify the actual device.

Just a thought :)
cmhardwick
 
Posts: 508
Joined: Fri Jul 14, 2006 6:07 pm
Location: Tennessee

Postby damage on Fri Sep 08, 2006 5:51 pm

cmhardwick wrote:but even with 500, you could do it with just 2 images if each device only has ON and OFF. You could then use a text over the On or Off image to identify the actual device.

Just a thought :)


nope because my system talks to xl via xAP. the xAP plugin creates devices from xAP messages and requires a separate on & off image for each device. and each dimmable light will require 10 different images, one for each level of dim.
damage
 
Posts: 35
Joined: Fri Aug 18, 2006 7:07 pm