|
From: <ma...@us...> - 2011-02-20 21:11:06
|
Revision: 302
http://openautomation.svn.sourceforge.net/openautomation/?rev=302&view=rev
Author: mayerch
Date: 2011-02-20 21:10:59 +0000 (Sun, 20 Feb 2011)
Log Message:
-----------
- Changed info widget from "precision" to "format", i.e. now it's possible to use printf syntax to format the displayed value in an info widget.
- Added example of the use of the Konnex HVAC mode (this might be later changed to a more specialized version)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/visu_config_demo.xml
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-02-20 20:57:45 UTC (rev 301)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-02-20 21:10:59 UTC (rev 302)
@@ -137,7 +137,7 @@
actor += '</div>';
var $actor = $(actor).data({
'address' : address,
- 'precision': $p.attr('precision'),
+ 'format' : $p.attr('format'),
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling')
});
@@ -149,7 +149,7 @@
attributes: {
pre: { type: 'string', required: false },
post: { type: 'string', required: false },
- precision: { type: 'precision', required: false },
+ format: { type: 'format', required: false },
mapping: { type: 'mapping', required: false },
styling: { type: 'styling', required: false }
},
@@ -751,6 +751,8 @@
var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
if( element.data( 'precision' ) )
value = Number( value ).toPrecision( element.data( 'precision' ) );
+ if( element.data( 'format' ) )
+ value = sprintf( element.data( 'format' ), value );
element.data( 'value', value );
element.find('.value').text( map( value, element ) );
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2011-02-20 20:57:45 UTC (rev 301)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2011-02-20 21:10:59 UTC (rev 302)
@@ -82,6 +82,10 @@
<label>Multitrigger - Szenenaufruf</label>
<address transform="DPT:5.010" readonly="false" type="">11/2/50</address>
</multitrigger>
+ <multitrigger button1label="Auto" button1value="auto" button2label="Komfort" button2value="comfort" button3label="Standy By" button3value="standby" button4label="Economy" button4value="economy">
+ <label>KONNEX Betriebsart</label>
+ <address transform="DPT:20.102" readonly="false" type="">3/1/50</address>
+ </multitrigger>
<line/>
<image src="icon/comet_128_ff8000.png" width="500px" height="46px"/>
<image src="http://www.e-zeeinternet.com/count.php?page=546016&style=default&nbdigits=9&reloads=1" refresh="10">
@@ -97,7 +101,7 @@
1/2/60
1/2/61
</colorchooser>
- <info precision="4">
+ <info format="%.2f">
<label>R</label>
<address transform="DPT:5.001" type="">1/2/59</address>
</info>
@@ -105,7 +109,7 @@
<label>R</label>
<address transform="DPT:5.001" type="">1/2/59</address>
</slide>
- <info precision="4">
+ <info format="%.2f">
<label>G</label>
<address transform="DPT:5.001" type="">1/2/60</address>
</info>
@@ -113,7 +117,7 @@
<label>G</label>
<address transform="DPT:5.001" type="">1/2/60</address>
</slide>
- <info precision="4">
+ <info format="%.2f">
<label>B</label>
<address transform="DPT:5.001" type="">1/2/61</address>
</info>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|