|
From: <ma...@us...> - 2010-12-23 20:30:23
|
Revision: 224
http://openautomation.svn.sourceforge.net/openautomation/?rev=224&view=rev
Author: mayerch
Date: 2010-12-23 20:30:17 +0000 (Thu, 23 Dec 2010)
Log Message:
-----------
Added more encodings
Modified Paths:
--------------
CometVisu/trunk/visu/transforms/transform_knx.js
Modified: CometVisu/trunk/visu/transforms/transform_knx.js
===================================================================
--- CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-22 21:07:26 UTC (rev 223)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-23 20:30:17 UTC (rev 224)
@@ -24,7 +24,7 @@
'1.001': {
name : 'DPT_Switch',
encode: function( phy ){
- return phy.toSting( 16 );
+ return phy.toString( 16 );
},
decode: function( hex ){
return parseInt( hex , 16 );
@@ -58,7 +58,7 @@
'5.001' : {
name : 'DPT_Scaling',
encode: function( phy ){
- return phy;
+ return phy.toString( 16 );
},
decode: function( hex ){
return parseInt( hex, 16 );
@@ -67,7 +67,7 @@
'5.004' : {
name : 'DPT_Percent_U8',
encode: function( phy ){
- return phy;
+ return parseInt( phy * 255 / 100 ).toSting( 16 );
},
decode: function( hex ){
return parseInt( hex, 16 ) * 100 / 255.0;
@@ -80,7 +80,8 @@
'6.001' : {
name : 'DPT_Percent_V8',
encode: function( phy ){
- return phy;
+ var val = phy < 0 ? phy + 256 : phy;
+ return val.toString( 16 );
},
decode: function( hex ){
var val = parseInt( hex, 16 )
@@ -94,7 +95,7 @@
'7.001' : {
name : 'DPT_Value_2_Ucount',
encode: function( phy ){
- return phy;
+ return phy.toString( 16 );
},
decode: function( hex ){
return parseInt( hex, 16 );
@@ -107,7 +108,8 @@
'8.001' : {
name : 'DPT_Value_2_Count',
encode: function( phy ){
- return phy;
+ var val = phy < 0 ? phy + 65536 : phy;
+ return val.toString( 16 );
},
decode: function( hex ){
var val = parseInt( hex, 16 );
@@ -121,7 +123,7 @@
'12.001' : {
name : 'DPT_Value_4_Ucount',
encode: function( phy ){
- return phy;
+ return phy.toString( 16 );
},
decode: function( hex ){
return parseInt( hex, 16 );
@@ -134,7 +136,8 @@
'13.001' : {
name : 'DPT_Value_4_Count',
encode: function( phy ){
- return phy;
+ var val = phy < 0 ? phy + 4294967296 : phy;
+ return val.toString( 16 );
},
decode: function( hex ){
var val = parseInt( hex, 16 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|