|
From: <ma...@us...> - 2011-10-20 23:12:19
|
Revision: 459
http://openautomation.svn.sourceforge.net/openautomation/?rev=459&view=rev
Author: makki1
Date: 2011-10-20 23:12:13 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
small fixes on infotrigger with realtive values
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-20 21:06:30 UTC (rev 458)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-20 23:12:13 UTC (rev 459)
@@ -680,6 +680,7 @@
'styling' : $p.attr('styling'),
'value' : $p.attr('downvalue') || 0,
'align' : $p.attr('align'),
+ 'change' : $p.attr('change'),
'type' : 'switch'
} ).bind( 'click', this.action );
@@ -695,6 +696,7 @@
'styling' : $p.attr('styling'),
'value' : $p.attr('upvalue') || 1,
'align' : $p.attr('align'),
+ 'change' : $p.attr('change'),
'type' : 'switch'
} ).bind( 'click', this.action );
@@ -733,13 +735,13 @@
},
action: function() {
var data = $(this).data();
- var value = $(this).parent().find('.switchInvisible').data('basicvalue');
+ var value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
for( var addr in data.address )
{
if( data.address[addr][1] == true ) continue; // skip read only
- if( data.change == 'absolute' )
+ if( data.change == 'relative' )
{
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], value + data.value ) );
+ visu.write( addr.substr(1), transformEncode( data.address[addr][0], value + parseFloat(data.value) ) );
} else {
visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value ) );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|