|
From: <ma...@us...> - 2010-12-26 22:59:00
|
Revision: 228
http://openautomation.svn.sourceforge.net/openautomation/?rev=228&view=rev
Author: mayerch
Date: 2010-12-26 22:58:54 +0000 (Sun, 26 Dec 2010)
Log Message:
-----------
Brought DPT 5 up to spec
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-26 21:30:38 UTC (rev 227)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-26 22:58:54 UTC (rev 228)
@@ -57,24 +57,42 @@
'5.001' : {
name : 'DPT_Scaling',
+ unit : '%',
encode: function( phy ){
- return phy.toString( 16 );
+ return parseInt( phy * 255 / 100 ).toString( 16 );
},
decode: function( hex ){
- return parseInt( hex, 16 );
+ return parseInt( hex, 16 ) * 100 / 255.0;
}
},
+ '5.003' : {
+ name : 'DPT_Angle',
+ unit : '°',
+ encode: function( phy ){
+ return parseInt( phy * 255 / 360 ).toString( 16 );
+ },
+ decode: function( hex ){
+ return parseInt( hex, 16 ) * 100 / 360.0;
+ }
+ },
'5.004' : {
name : 'DPT_Percent_U8',
+ unit : '%',
encode: function( phy ){
- return parseInt( phy * 255 / 100 ).toSting( 16 );
+ return phy.toString( 16 );
},
decode: function( hex ){
- return parseInt( hex, 16 ) * 100 / 255.0;
+ return parseInt( hex, 16 );
}
},
+ '5.010': {
+ link : '5.004',
+ name : 'DPT_Value_1_Ucount',
+ unit : '-'
+ },
'5': {
- link : '5.004'
+ link : '5.004',
+ name : '8-Bit Unsigned Value'
},
'6.001' : {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|