You can subscribe to this list here.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(121) |
Dec
(58) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
(38) |
Feb
(36) |
Mar
(7) |
Apr
(2) |
May
(32) |
Jun
(24) |
Jul
(16) |
Aug
(21) |
Sep
(17) |
Oct
(62) |
Nov
(60) |
Dec
(70) |
| 2012 |
Jan
(54) |
Feb
(41) |
Mar
(21) |
Apr
(38) |
May
(76) |
Jun
(47) |
Jul
(25) |
Aug
(72) |
Sep
(29) |
Oct
(64) |
Nov
(93) |
Dec
(97) |
| 2013 |
Jan
(100) |
Feb
(168) |
Mar
(115) |
Apr
(59) |
May
(37) |
Jun
(32) |
Jul
(45) |
Aug
(42) |
Sep
(24) |
Oct
(73) |
Nov
(64) |
Dec
(4) |
| 2014 |
Jan
(14) |
Feb
(57) |
Mar
(58) |
Apr
(10) |
May
(18) |
Jun
(12) |
Jul
(7) |
Aug
(12) |
Sep
(15) |
Oct
(6) |
Nov
(32) |
Dec
(17) |
| 2015 |
Jan
(50) |
Feb
(5) |
Mar
(1) |
Apr
(26) |
May
(10) |
Jun
(3) |
Jul
(3) |
Aug
(2) |
Sep
(3) |
Oct
(18) |
Nov
(18) |
Dec
(8) |
| 2016 |
Jan
(33) |
Feb
(35) |
Mar
(50) |
Apr
(20) |
May
(25) |
Jun
(17) |
Jul
(8) |
Aug
(73) |
Sep
(64) |
Oct
(51) |
Nov
(20) |
Dec
(14) |
| 2017 |
Jan
(41) |
Feb
(57) |
Mar
(44) |
Apr
(136) |
May
(32) |
Jun
(39) |
Jul
(2) |
Aug
(12) |
Sep
(32) |
Oct
(103) |
Nov
(12) |
Dec
(4) |
| 2018 |
Jan
(9) |
Feb
(1) |
Mar
(60) |
Apr
(24) |
May
(15) |
Jun
(1) |
Jul
(2) |
Aug
(23) |
Sep
(15) |
Oct
(57) |
Nov
(21) |
Dec
(77) |
| 2019 |
Jan
(62) |
Feb
(99) |
Mar
(98) |
Apr
(49) |
May
(6) |
Jun
(3) |
Jul
(6) |
Aug
(18) |
Sep
(9) |
Oct
(15) |
Nov
(30) |
Dec
(6) |
| 2020 |
Jan
(14) |
Feb
(2) |
Mar
(22) |
Apr
(33) |
May
(47) |
Jun
(12) |
Jul
|
Aug
|
Sep
(4) |
Oct
(2) |
Nov
(5) |
Dec
(5) |
| 2021 |
Jan
(4) |
Feb
(101) |
Mar
(13) |
Apr
(32) |
May
(40) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(25) |
Nov
(12) |
Dec
|
| 2022 |
Jan
(154) |
Feb
(82) |
Mar
(63) |
Apr
(27) |
May
(26) |
Jun
(5) |
Jul
(12) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(13) |
Dec
(21) |
| 2023 |
Jan
(43) |
Feb
(43) |
Mar
(15) |
Apr
(8) |
May
(3) |
Jun
(25) |
Jul
(6) |
Aug
(38) |
Sep
(5) |
Oct
(20) |
Nov
(9) |
Dec
(28) |
| 2024 |
Jan
(15) |
Feb
(2) |
Mar
(12) |
Apr
(2) |
May
(8) |
Jun
(10) |
Jul
(10) |
Aug
(2) |
Sep
(3) |
Oct
(15) |
Nov
(6) |
Dec
(20) |
| 2025 |
Jan
|
Feb
(2) |
Mar
(6) |
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(11) |
Nov
(2) |
Dec
|
|
From: <ma...@us...> - 2010-12-27 22:51:23
|
Revision: 230
http://openautomation.svn.sourceforge.net/openautomation/?rev=230&view=rev
Author: mayerch
Date: 2010-12-27 22:51:16 +0000 (Mon, 27 Dec 2010)
Log Message:
-----------
Send according to KNX spec (add 0x80 depending on data length)
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-27 18:26:03 UTC (rev 229)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-27 22:51:16 UTC (rev 230)
@@ -24,7 +24,7 @@
'1.001': {
name : 'DPT_Switch',
encode: function( phy ){
- return phy.toString( 16 );
+ return (phy | 0x80).toString( 16 );
},
decode: function( hex ){
return parseInt( hex , 16 );
@@ -45,7 +45,8 @@
'4.001': {
name : 'DPT_Char_ASCII',
encode: function( phy ){
- return phy.charCodeAt( 0 ).toString( 16 );
+ var val = phy.charCodeAt( 0 ).toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
return String.fromCharCode(parseInt( hex, 16 ));
@@ -59,7 +60,8 @@
name : 'DPT_Scaling',
unit : '%',
encode: function( phy ){
- return parseInt( phy * 255 / 100 ).toString( 16 );
+ var val = parseInt( phy * 255 / 100 ).toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
return parseInt( hex, 16 ) * 100 / 255.0;
@@ -69,7 +71,8 @@
name : 'DPT_Angle',
unit : '°',
encode: function( phy ){
- return parseInt( phy * 255 / 360 ).toString( 16 );
+ var val = parseInt( phy * 255 / 360 ).toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
return parseInt( hex, 16 ) * 100 / 360.0;
@@ -79,7 +82,8 @@
name : 'DPT_Percent_U8',
unit : '%',
encode: function( phy ){
- return phy.toString( 16 );
+ var val = phy.toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
return parseInt( hex, 16 );
@@ -99,7 +103,8 @@
name : 'DPT_Percent_V8',
encode: function( phy ){
var val = phy < 0 ? phy + 256 : phy;
- return val.toString( 16 );
+ val = val.toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
var val = parseInt( hex, 16 )
@@ -113,7 +118,8 @@
'7.001' : {
name : 'DPT_Value_2_Ucount',
encode: function( phy ){
- return phy.toString( 16 );
+ var val = phy.toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
return parseInt( hex, 16 );
@@ -127,7 +133,7 @@
name : 'DPT_Value_2_Count',
encode: function( phy ){
var val = phy < 0 ? phy + 65536 : phy;
- return val.toString( 16 );
+ return '80' + val.toString( 16 );
},
decode: function( hex ){
var val = parseInt( hex, 16 );
@@ -149,8 +155,8 @@
mant >>= 1;
exp++;
}
- var v = ( sign | (exp<<11) | (mant & 0x07ff) ).toString( 16 );
- return new Array(4 - v.length + 1).join('0') + v;
+ var val = ( sign | (exp<<11) | (mant & 0x07ff) ).toString( 16 );
+ return '80' + ( new Array(4 - val.length + 1).join('0') + val );
},
decode: function( hex ){
if( 0x7fff == parseInt( hex, 16 ) ) return NaN;
@@ -171,7 +177,8 @@
'12.001' : {
name : 'DPT_Value_4_Ucount',
encode: function( phy ){
- return phy.toString( 16 );
+ var val = phy.toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
return parseInt( hex, 16 );
@@ -185,7 +192,8 @@
name : 'DPT_Value_4_Count',
encode: function( phy ){
var val = phy < 0 ? phy + 4294967296 : phy;
- return val.toString( 16 );
+ val = val.toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
var val = parseInt( hex, 16 );
@@ -199,7 +207,7 @@
'14.001' : {
name : 'DPT_Value_Acceleration_Angular',
encode: function( phy ){
- return phy;
+ return '80' + phy;
},
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.
|
|
From: <ma...@us...> - 2010-12-27 18:26:09
|
Revision: 229
http://openautomation.svn.sourceforge.net/openautomation/?rev=229&view=rev
Author: mayerch
Date: 2010-12-27 18:26:03 +0000 (Mon, 27 Dec 2010)
Log Message:
-----------
Create encoding for DPT 9 (+ temporary test function that will be deleted again later)
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 22:58:54 UTC (rev 228)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-27 18:26:03 UTC (rev 229)
@@ -141,9 +141,19 @@
'9.001' : {
name : 'DPT_Value_Temp',
encode: function( phy ){
- return phy;
+ if( undefined === phy || NaN == phy ) return '7fff';
+ var sign = phy < 0 ? 0x8000 : 0;
+ var mant = Math.round(phy * 100.0);
+ var exp = 0;
+ while( Math.abs(mant) > 2047 ) {
+ mant >>= 1;
+ exp++;
+ }
+ var v = ( sign | (exp<<11) | (mant & 0x07ff) ).toString( 16 );
+ return new Array(4 - v.length + 1).join('0') + v;
},
decode: function( hex ){
+ if( 0x7fff == parseInt( hex, 16 ) ) return NaN;
var bin1 = parseInt( hex.substr(0,2), 16 );
var bin2 = parseInt( hex.substr(2,2), 16 );
var sign = parseInt( bin1 & 0x80 );
@@ -226,4 +236,33 @@
},
*/
'temp dummy' : {link:'1.001'}
-} );
\ No newline at end of file
+} );
+
+//////
+// To be deleted later: a test function to check if the coding is consistent
+function TEST( DPT, Bytes )
+{
+ var maxErr = 5;
+ DPT = 'DPT:' + DPT;
+ for( i = 0; i < Math.pow(2,8*Bytes); i++ )
+ {
+ var v = i.toString( 16 );
+ v = new Array(2*Bytes - v.length + 1).join('0') + v;
+ var test = Transform[DPT].encode(
+ Transform[DPT].decode(v)
+ );
+ //console.log(i,v,test);
+ if( v != test )
+ {
+ var v2 = Transform[DPT].decode(v);
+ var test2 = Transform[DPT].decode(
+ Transform[DPT].encode(v2)
+ );
+ if( v2 != test2 )
+ {
+ console.log( i, v, test, Transform[DPT].decode(v), v2, test2, maxErr );
+ if( (--maxErr) < 0 ) return maxErr;
+ }
+ }
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <ma...@us...> - 2010-12-26 21:30:44
|
Revision: 227
http://openautomation.svn.sourceforge.net/openautomation/?rev=227&view=rev
Author: mayerch
Date: 2010-12-26 21:30:38 +0000 (Sun, 26 Dec 2010)
Log Message:
-----------
The transformations might contain a unit (optional!) and a "long name" (optional, locale specific).
The links in the transformations might als contain their own name (if not set, it will be inherited, just like the coding funtions)
Note: JavaScript doesn't specify if the functions are copied by value or by reference - it's doing something inbetween. If unmodified they are copied by reference which is broken up in the moment that one is modified (so it's actually a sort of lazy write by value...)
Anyway: this makes sure that no unnecessary memory is wasted...
Modified Paths:
--------------
CometVisu/trunk/visu/transforms/transform_default.js
CometVisu/trunk/visu/transforms/transform_knx.js
Modified: CometVisu/trunk/visu/transforms/transform_default.js
===================================================================
--- CometVisu/trunk/visu/transforms/transform_default.js 2010-12-23 22:54:57 UTC (rev 226)
+++ CometVisu/trunk/visu/transforms/transform_default.js 2010-12-26 21:30:38 UTC (rev 227)
@@ -61,17 +61,9 @@
{
if( transforms[trans].link )
{
- Transform[ prefix + ':' + trans ] = transforms[ transforms[trans].link ];
+ Transform[ prefix + ':' + trans ] = $.extend( {}, transforms[ transforms[trans].link ], transforms[trans] );
} else {
Transform[ prefix + ':' + trans ] = transforms[ trans ];
}
}
-}
-
-/**
- * The universal decoding function.
- */
-function decode( raw, type )
-{
- return decodeDPT( raw, type.substr(4) ); // filter away the 'DPT:'
-}
+}
\ No newline at end of file
Modified: CometVisu/trunk/visu/transforms/transform_knx.js
===================================================================
--- CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-23 22:54:57 UTC (rev 226)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-26 21:30:38 UTC (rev 227)
@@ -181,6 +181,14 @@
return sign * Math.pow( 2, exp ) * ( mant / (1 << 23));
}
},
+ '14': {
+ link : '14.001',
+ name : '4 byte float',
+ lname : {
+ 'de': '4 Byte Gleitkommazahl'
+ },
+ unit : '-'
+ },
/* 9 Zeilen:
},
'.001' : {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-23 22:55:03
|
Revision: 226
http://openautomation.svn.sourceforge.net/openautomation/?rev=226&view=rev
Author: mayerch
Date: 2010-12-23 22:54:57 +0000 (Thu, 23 Dec 2010)
Log Message:
-----------
Change from decodeDPT to the new transform
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/lib/knx_decode.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-23 22:39:04 UTC (rev 225)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-23 22:54:57 UTC (rev 226)
@@ -603,14 +603,12 @@
*/
function transform( raw, type )
{
- return decodeDPT( raw, type.substr(4) ); // filter away the 'DPT:'
+ return Transform[type].decode( raw );
}
function defaultUpdate( e, data, passedElement )
{
var element = passedElement || $(this);
- //var datatype = element.data().address[ e.type ];
- //var value = decodeDPT( data, element.data('datatype') );
var value = transform( data, element.data().address[ e.type ][0] );
element.data( 'value', value );
element.find('.value').text( map( value, element ) );
Modified: CometVisu/trunk/visu/lib/knx_decode.js
===================================================================
--- CometVisu/trunk/visu/lib/knx_decode.js 2010-12-23 22:39:04 UTC (rev 225)
+++ CometVisu/trunk/visu/lib/knx_decode.js 2010-12-23 22:54:57 UTC (rev 226)
@@ -15,6 +15,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+/* now obsolete
+
function formatInt(number,minlen)
{
var result="";
@@ -121,3 +123,4 @@
}
}
+*/
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-23 22:39:11
|
Revision: 225
http://openautomation.svn.sourceforge.net/openautomation/?rev=225&view=rev
Author: mayerch
Date: 2010-12-23 22:39:04 +0000 (Thu, 23 Dec 2010)
Log Message:
-----------
Added decoding of DPT9
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-23 20:30:17 UTC (rev 224)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-23 22:39:04 UTC (rev 225)
@@ -120,6 +120,26 @@
link : '8.001'
},
+ '9.001' : {
+ name : 'DPT_Value_Temp',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ var bin1 = parseInt( hex.substr(0,2), 16 );
+ var bin2 = parseInt( hex.substr(2,2), 16 );
+ var sign = parseInt( bin1 & 0x80 );
+ var exp = parseInt( bin1 & 0x78 ) >> 3;
+ var mant = parseInt( ((bin1 & 0x7) << 8) | bin2 );
+ if( sign != 0 )
+ mant = -(~(mant - 1) & 0x7ff);
+ return (1 << exp) * 0.01 * mant;
+ }
+ },
+ '9': {
+ link : '9.001'
+ },
+
'12.001' : {
name : 'DPT_Value_4_Ucount',
encode: function( phy ){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <ma...@us...> - 2010-12-22 21:07:32
|
Revision: 223
http://openautomation.svn.sourceforge.net/openautomation/?rev=223&view=rev
Author: mayerch
Date: 2010-12-22 21:07:26 +0000 (Wed, 22 Dec 2010)
Log Message:
-----------
Added graph to the test page
Modified Paths:
--------------
CometVisu/trunk/visu/visu_config_neu.xml
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-22 21:06:53 UTC (rev 222)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-22 21:07:26 UTC (rev 223)
@@ -3,9 +3,7 @@
<meta>
<plugins>
<plugin name="colorchooser"/>
- <!--
<plugin name="diagram"/>
- -->
</plugins>
<mappings>
<mapping name="OpenClose">
@@ -98,5 +96,6 @@
<info><label>G</label><address transform="DPT:5.001">1/2/60</address></info>
<info><label>B</label><address transform="DPT:5.001">1/2/61</address></info>
<slide><label>B</label><address transform="DPT:5.001">1/2/61</address></slide>
+ <diagram_popup undefined="DALI Strom L1" rrd="200_DALI_Linie_1_Strom" unit="mA" series="day" refresh="300">DALI Strom L1</diagram_popup>
</page>
</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-22 21:07:00
|
Revision: 222
http://openautomation.svn.sourceforge.net/openautomation/?rev=222&view=rev
Author: mayerch
Date: 2010-12-22 21:06:53 +0000 (Wed, 22 Dec 2010)
Log Message:
-----------
Fix slider to work again as expected
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-22 19:56:41 UTC (rev 221)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-22 21:06:53 UTC (rev 222)
@@ -190,40 +190,44 @@
update: function( e, data ) {
var element = $(this);
var value = transform( data, element.data().address[ e.type ][0] );
- element.data( 'value', value );
- element.slider('value', value);
+ if( element.data( 'value' ) != value )
+ {
+ element.data( 'value', value );
+ element.slider('value', value);
+ }
},
-/**
- * Start a thread that regularily sends the silder position to the bus
- */
-slideStart:function(event,ui)
-{
- console.log('start');
- var actor = $( '.actor', $(this).parent() );
- actor.data( 'updateFn', setInterval( function(){
- var data = actor.data();
- for( var addr in data.address )
+ /**
+ * Start a thread that regularily sends the silder position to the bus
+ */
+ slideStart:function(event,ui)
{
- if( data.address[addr][1] == true ) continue; // skip read only
- visu.write( addr.substr(1), ui.value, data.address[addr][0].substr(4) );
- }
- }, 250 ) ); // update KNX every 250 ms
-},
-/**
- * Delete the update thread and send the final value of the slider to the bus
- */
-slideChange:function(event,ui)
-{
- console.log('change');
- var data = $(this).data();
- clearInterval( data.updateFn, ui.value);
- if( data.value != ui.value )
- for( var addr in data.address )
- {
- if( data.address[addr][1] == true ) continue; // skip read only
- visu.write( addr.substr(1), ui.value, data.address[addr][0].substr(4) );
- }
-},
+ var actor = $( '.actor', $(this).parent() );
+ actor.data( 'updateFn', setInterval( function(){
+ var data = actor.data();
+ if( data.value == actor.slider('value') ) return;
+ for( var addr in data.address )
+ {
+ data.value = actor.slider('value');
+ if( data.address[addr][1] == true ) continue; // skip read only
+ visu.write( addr.substr(1), data.value, data.address[addr][0].substr(4) );
+ }
+ }, 250 ) ); // update KNX every 250 ms
+ },
+ /**
+ * Delete the update thread and send the final value of the slider to the bus
+ */
+ slideChange:function(event,ui)
+ {
+ var data = $(this).data();
+ clearInterval( data.updateFn, ui.value);
+ if( data.value != ui.value )
+ for( var addr in data.address )
+ {
+ console.log('change send');
+ if( data.address[addr][1] == true ) continue; // skip read only
+ visu.write( addr.substr(1), ui.value, data.address[addr][0].substr(4) );
+ }
+ },
attributes: {
min: { type: 'numeric', required: false },
max: { type: 'numeric', required: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-22 19:56:47
|
Revision: 221
http://openautomation.svn.sourceforge.net/openautomation/?rev=221&view=rev
Author: mayerch
Date: 2010-12-22 19:56:41 +0000 (Wed, 22 Dec 2010)
Log Message:
-----------
A few more DPT (as it's work in progress there a quite a lot encoding functions missing!)
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-14 21:57:43 UTC (rev 220)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-22 19:56:41 UTC (rev 221)
@@ -23,14 +23,158 @@
addTransform( 'DPT', {
'1.001': {
name : 'DPT_Switch',
- encode: function( i ){
- return i.toSting( 16 );
+ encode: function( phy ){
+ return phy.toSting( 16 );
},
- decode: function( i ){
- return parseInt( i , 16 );
+ decode: function( hex ){
+ return parseInt( hex , 16 );
}
},
'1': {
link : '1.001'
+ },
+
+ '2': {
+ link : '1.001'
+ },
+
+ '3': {
+ link : '1.001'
+ },
+
+ '4.001': {
+ name : 'DPT_Char_ASCII',
+ encode: function( phy ){
+ return phy.charCodeAt( 0 ).toString( 16 );
+ },
+ decode: function( hex ){
+ return String.fromCharCode(parseInt( hex, 16 ));
+ }
+ },
+ '4': {
+ link : '4.001'
+ },
+
+ '5.001' : {
+ name : 'DPT_Scaling',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ return parseInt( hex, 16 );
+ }
+ },
+ '5.004' : {
+ name : 'DPT_Percent_U8',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ return parseInt( hex, 16 ) * 100 / 255.0;
+ }
+ },
+ '5': {
+ link : '5.004'
+ },
+
+ '6.001' : {
+ name : 'DPT_Percent_V8',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ var val = parseInt( hex, 16 )
+ return val > 127 ? (val-256) : val;
+ }
+ },
+ '6': {
+ link : '6.001'
+ },
+
+ '7.001' : {
+ name : 'DPT_Value_2_Ucount',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ return parseInt( hex, 16 );
+ }
+ },
+ '7': {
+ link : '7.001'
+ },
+
+ '8.001' : {
+ name : 'DPT_Value_2_Count',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ var val = parseInt( hex, 16 );
+ return val > 32767 ? (val-65536) : val;
+ }
+ },
+ '8': {
+ link : '8.001'
+ },
+
+ '12.001' : {
+ name : 'DPT_Value_4_Ucount',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ return parseInt( hex, 16 );
+ }
+ },
+ '12': {
+ link : '12.001'
+ },
+
+ '13.001' : {
+ name : 'DPT_Value_4_Count',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ var val = parseInt( hex, 16 );
+ return val > 2147483647 ? (val-4294967296) : val;
+ }
+ },
+ '13': {
+ link : '13.001'
+ },
+
+ '14.001' : {
+ name : 'DPT_Value_Acceleration_Angular',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ var val = parseInt( hex, 16 );
+ var sign = (val & 0x80000000) ? -1 : 1;
+ var exp =((val & 0x7F800000) >> 23) - 127;
+ var mant = (val & 0x007FFFFF | 0x00800000);
+ return sign * Math.pow( 2, exp ) * ( mant / (1 << 23));
+ }
+ },
+ /* 9 Zeilen:
+ },
+ '.001' : {
+ name : '',
+ encode: function( phy ){
+ return phy;
+ },
+ decode: function( hex ){
+ return hex;
+ }
}
+ */ /////////////////////////////////////////////////
+ /* 3 Zeilen:
+ }
+ '': {
+ link : '.001'
+ },
+ */
+ 'temp dummy' : {link:'1.001'}
} );
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-14 21:57:49
|
Revision: 220
http://openautomation.svn.sourceforge.net/openautomation/?rev=220&view=rev
Author: makki1
Date: 2010-12-14 21:57:43 +0000 (Tue, 14 Dec 2010)
Log Message:
-----------
KNX GA > 99 invalid in visu_config.xsd
Modified Paths:
--------------
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2010-12-13 21:53:25 UTC (rev 219)
+++ CometVisu/trunk/visu/visu_config.xsd 2010-12-14 21:57:43 UTC (rev 220)
@@ -4,7 +4,7 @@
<!-- basic types -->
<xsd:simpleType name="address">
<xsd:restriction base="xsd:string">
- <xsd:pattern value="[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,2}" />
+ <xsd:pattern value="[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,3}" />
</xsd:restriction>
</xsd:simpleType>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-13 21:53:31
|
Revision: 219
http://openautomation.svn.sourceforge.net/openautomation/?rev=219&view=rev
Author: mayerch
Date: 2010-12-13 21:53:25 +0000 (Mon, 13 Dec 2010)
Log Message:
-----------
Take care of the prefix
Modified Paths:
--------------
CometVisu/trunk/visu/transforms/transform_default.js
Modified: CometVisu/trunk/visu/transforms/transform_default.js
===================================================================
--- CometVisu/trunk/visu/transforms/transform_default.js 2010-12-13 21:51:18 UTC (rev 218)
+++ CometVisu/trunk/visu/transforms/transform_default.js 2010-12-13 21:53:25 UTC (rev 219)
@@ -61,9 +61,9 @@
{
if( transforms[trans].link )
{
- Transform[ trans ] = transforms[ transforms[trans].link ];
+ Transform[ prefix + ':' + trans ] = transforms[ transforms[trans].link ];
} else {
- Transform[ trans ] = transforms[ trans ];
+ Transform[ prefix + ':' + trans ] = transforms[ trans ];
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-13 21:51:23
|
Revision: 218
http://openautomation.svn.sourceforge.net/openautomation/?rev=218&view=rev
Author: mayerch
Date: 2010-12-13 21:51:18 +0000 (Mon, 13 Dec 2010)
Log Message:
-----------
Initial commit for setting up the transform infrastructure
Modified Paths:
--------------
CometVisu/trunk/visu/index.html
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2010-12-13 21:50:25 UTC (rev 217)
+++ CometVisu/trunk/visu/index.html 2010-12-13 21:51:18 UTC (rev 218)
@@ -14,6 +14,8 @@
<script src="designs/structure_pure.js" type="text/javascript"></script>
<script src="designs/structure_custom.js" type="text/javascript"></script>
<script src="lib/templateengine.js" type="text/javascript"></script>
+ <script src="transforms/transform_default.js" type="text/javascript"></script>
+ <script src="transforms/transform_knx.js" type="text/javascript"></script>
<style type="text/css">
.loading { display: none; }
</style>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-13 21:50:31
|
Revision: 217
http://openautomation.svn.sourceforge.net/openautomation/?rev=217&view=rev
Author: mayerch
Date: 2010-12-13 21:50:25 +0000 (Mon, 13 Dec 2010)
Log Message:
-----------
Initial commit for setting up the transform infrastructure
Added Paths:
-----------
CometVisu/trunk/visu/transforms/
CometVisu/trunk/visu/transforms/transform_default.js
CometVisu/trunk/visu/transforms/transform_knx.js
Added: CometVisu/trunk/visu/transforms/transform_default.js
===================================================================
--- CometVisu/trunk/visu/transforms/transform_default.js (rev 0)
+++ CometVisu/trunk/visu/transforms/transform_default.js 2010-12-13 21:50:25 UTC (rev 217)
@@ -0,0 +1,77 @@
+/* transform_default.js (c) 2010 by Christian Mayer [CometVisu at ChristianMayer dot de]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+*/
+
+/**
+ * This class defines the default transforms:
+ * encode: transform JavaScript to bus value
+ * decode: transform bus to JavaScript value
+ */
+Transform = {
+ 'raw': {
+ name : 'Only the RAW value',
+ encode: function( i ){
+ return i;
+ },
+ decode: function( i ){
+ return i;
+ }
+ },
+ 'int': {
+ name : 'Cast to Int',
+ encode: function( i ){
+ return i.toString();
+ },
+ decode: function( i ){
+ return parseInt( i );
+ }
+ },
+ 'float': {
+ name : 'Cast to Float',
+ encode: function( i ){
+ return i.toString();
+ },
+ decode: function( i ){
+ return parseFloat( i );
+ }
+ }
+}
+
+/****************************************************************************
+ * All functions below are only in this, i.e. the default, file.
+ * All further transforms will only have the above data structure.
+ ***************************************************************************/
+
+function addTransform( prefix, transforms )
+{
+ for( trans in transforms )
+ {
+ if( transforms[trans].link )
+ {
+ Transform[ trans ] = transforms[ transforms[trans].link ];
+ } else {
+ Transform[ trans ] = transforms[ trans ];
+ }
+ }
+}
+
+/**
+ * The universal decoding function.
+ */
+function decode( raw, type )
+{
+ return decodeDPT( raw, type.substr(4) ); // filter away the 'DPT:'
+}
Added: CometVisu/trunk/visu/transforms/transform_knx.js
===================================================================
--- CometVisu/trunk/visu/transforms/transform_knx.js (rev 0)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-13 21:50:25 UTC (rev 217)
@@ -0,0 +1,36 @@
+/* transform_knx.js (c) 2010 by Christian Mayer [CometVisu at ChristianMayer dot de]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+*/
+
+/**
+ * This class defines the default transforms:
+ * encode: transform JavaScript to bus value
+ * decode: transform bus to JavaScript value
+ */
+addTransform( 'DPT', {
+ '1.001': {
+ name : 'DPT_Switch',
+ encode: function( i ){
+ return i.toSting( 16 );
+ },
+ decode: function( i ){
+ return parseInt( i , 16 );
+ }
+ },
+ '1': {
+ link : '1.001'
+ }
+} );
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-13 20:42:40
|
Revision: 216
http://openautomation.svn.sourceforge.net/openautomation/?rev=216&view=rev
Author: mayerch
Date: 2010-12-13 20:42:34 +0000 (Mon, 13 Dec 2010)
Log Message:
-----------
Changed address-element structure from using the src attribute to it's textContent
E.g.
<address src="12/4/250" transform="DPT:9" />
becomes
<address transform="DPT:9">12/4/250</address>
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
CometVisu/trunk/visu/visu_config_neu.xml
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 21:33:55 UTC (rev 215)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-13 20:42:34 UTC (rev 216)
@@ -116,7 +116,7 @@
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
$p.find('address').each( function(){
- var src = this.getAttribute('src');
+ var src = this.textContent;
var transform = this.getAttribute('transform');
ga_list.push( src )
address[ '_' + src ] = [transform];
@@ -153,7 +153,7 @@
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
$p.find('address').each( function(){
- var src = this.getAttribute('src');
+ var src = this.textContent;
var transform = this.getAttribute('transform');
ga_list.push( src )
address[ '_' + src ] = [transform];
@@ -242,7 +242,7 @@
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
$p.find('address').each( function(){
- var src = this.getAttribute('src');
+ var src = this.textContent;
var transform = this.getAttribute('transform');
var readonly = this.getAttribute('readonly');
ga_list.push( src )
@@ -295,7 +295,7 @@
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
$p.find('address').each( function(){
- var src = this.getAttribute('src');
+ var src = this.textContent;
var transform = this.getAttribute('transform');
var readonly = this.getAttribute('readonly');
ga_list.push( src )
Modified: CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-12 21:33:55 UTC (rev 215)
+++ CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-13 20:42:34 UTC (rev 216)
@@ -30,11 +30,11 @@
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
$p.find('address').each( function(){
- var src = this.getAttribute('src');
+ var src = this.textContent;
var transform = this.getAttribute('transform');
var color = this.getAttribute('color' );
var readonly = this.getAttribute('readonly' );
- ga_list.push( src )
+ ga_list.push( src );
address[ '_' + src ] = [ transform, color, readonly=='true' ];
});
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 21:33:55 UTC (rev 215)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-13 20:42:34 UTC (rev 216)
@@ -58,26 +58,26 @@
<text align="center">CometVisu format neu</text>
<info styling="BluePurpleRed">
<label>Slide Info</label>
- <address src="12/4/250" transform="DPT:9" />
- <address src="12/4/251" transform="DPT:9.001" />
+ <address transform="DPT:9">12/4/250</address>
+ <address transform="DPT:9.001">12/4/251</address>
</info>
<switch mapping="OnOff" styling="RedGreen">
<label>Terrase Licht</label>
- <address src="1/0/2" transform="DPT:1.001" />
- <address src="12/4/253" transform="DPT:9.001" readonly="true" />
+ <address transform="DPT:1.001">1/0/2</address>
+ <address transform="DPT:9.001" readonly="true">12/4/253</address>
</switch>
<slide min="-18" max="26">
<label>Slide</label>
- <address src="12/4/250" transform="DPT:9" />
+ <address transform="DPT:9">12/4/250</address>
</slide>
<break />
<trigger value="0" mapping="OnOff">
<label>Terrase Licht 0</label>
- <address src="1/0/2" transform="DPT:1.001" />
+ <address transform="DPT:1.001">1/0/2</address>
</trigger>
<trigger value="1" mapping="OnOff">
<label>Terrase Licht 1</label>
- <address src="1/0/2" transform="DPT:1.001" />
+ <address transform="DPT:1.001">1/0/2</address>
</trigger>
<line />
<image src="icon/comet_128_ff8000.png" width="500px" height="46px"/>
@@ -90,13 +90,13 @@
</page>
<colorchooser>
<label>A colorChooser</label>
- <address src="1/2/59" transform="DPT:5.001" color="r" />
- <address src="1/2/60" transform="DPT:5.001" color="g" />
- <address src="1/2/61" transform="DPT:5.001" color="b" />
+ <address transform="DPT:5.001" color="r">1/2/59</address>
+ <address transform="DPT:5.001" color="g">1/2/60</address>
+ <address transform="DPT:5.001" color="b">1/2/61</address>
</colorchooser>
- <info><label>R</label><address src="1/2/59" transform="DPT:5.001" /></info>
- <info><label>G</label><address src="1/2/60" transform="DPT:5.001" /></info>
- <info><label>B</label><address src="1/2/61" transform="DPT:5.001" /></info>
- <slide><label>B</label><address src="1/2/61" transform="DPT:5.001" /></slide>
+ <info><label>R</label><address transform="DPT:5.001">1/2/59</address></info>
+ <info><label>G</label><address transform="DPT:5.001">1/2/60</address></info>
+ <info><label>B</label><address transform="DPT:5.001">1/2/61</address></info>
+ <slide><label>B</label><address transform="DPT:5.001">1/2/61</address></slide>
</page>
</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 21:34:01
|
Revision: 215
http://openautomation.svn.sourceforge.net/openautomation/?rev=215&view=rev
Author: mayerch
Date: 2010-12-12 21:33:55 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
Transformed colorChooser
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
CometVisu/trunk/visu/visu_config_neu.xml
Modified: CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-12 20:22:10 UTC (rev 214)
+++ CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-12 21:33:55 UTC (rev 215)
@@ -21,77 +21,109 @@
* to demonstrate all available
*/
VisuDesign_Custom.prototype.addCreator("colorchooser", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'colorChooser' );
- var label = '<div class="label">' + page.textContent + '</div>';
- var actor = '<div class="actor">';
- actor += '</div>';
- var a_r = $(page).attr('address_r'); ga_list.push( a_r );
- var a_g = $(page).attr('address_g'); ga_list.push( a_g );
- var a_b = $(page).attr('address_b'); ga_list.push( a_b );
- var datatype = $(page).attr('datatype');
- ret_val.append(label)
- .append($(actor)
- .data({
- //'mapping' : $(page).attr('mapping'),
- //'styling' : $(page).attr('styling'),
- 'datatype': datatype, //jQuery(page).attr('datatype'), // use jQuery as '$' dosn't work here?!?
- 'value_r' : 0,
- 'value_g' : 0,
- 'value_b' : 0,
- 'type' : 'colorChooser'
- })
- .farbtastic( function(color){
- var r = parseInt(color.substring(1, 3), 16) * 100 / 255;
- var g = parseInt(color.substring(3, 5), 16) * 100 / 255;
- var b = parseInt(color.substring(5, 7), 16) * 100 / 255;
- visu.write( a_r, r, datatype );
- visu.write( a_g, g, datatype );
- visu.write( a_b, b, datatype );
- })
- .bind('_'+$(page).attr('address_r'), this.update_r )
- .bind('_'+$(page).attr('address_g'), this.update_g )
- .bind('_'+$(page).attr('address_b'), this.update_b ) );
- return ret_val;
- },
- update_r: function(e,d) {
- var element = $(this);
- var value = decodeDPT( d, element.data('datatype') );
- element.data( 'value_r', value );
- function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
- var color = toHex( element.data( 'value_r' )*255/100 )
- + toHex( element.data( 'value_g' )*255/100 )
- + toHex( element.data( 'value_b' )*255/100 );
- jQuery.farbtastic( element ).setColor( '#' + color );
- },
- update_g: function(e,d) {
- var element = $(this);
- var value = decodeDPT( d, element.data('datatype') );
- element.data( 'value_g', value );
- function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
- var color = toHex( element.data( 'value_r' )*255/100 )
- + toHex( element.data( 'value_g' )*255/100 )
- + toHex( element.data( 'value_b' )*255/100 );
- jQuery.farbtastic( element ).setColor( '#' + color );
- },
- update_b: function(e,d) {
- var element = $(this);
- var value = decodeDPT( d, element.data('datatype') );
- element.data( 'value_b', value );
- function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
- var color = toHex( element.data( 'value_r' )*255/100 )
- + toHex( element.data( 'value_g' )*255/100 )
- + toHex( element.data( 'value_b' )*255/100 );
- jQuery.farbtastic( element ).setColor( '#' + color );
- },
- attributes: {
- address_r: {type: "address", required: true},
- address_g: {type: "address", required: true},
- address_b: {type: "address", required: true},
- datatype: {type: "datatype", required: true},
- },
- content: {type: "string", required: true}
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'colorChooser' );
+
+ var labelElement = $p.find('label')[0];
+ var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
+ var address = {};
+ $p.find('address').each( function(){
+ var src = this.getAttribute('src');
+ var transform = this.getAttribute('transform');
+ var color = this.getAttribute('color' );
+ var readonly = this.getAttribute('readonly' );
+ ga_list.push( src )
+ address[ '_' + src ] = [ transform, color, readonly=='true' ];
+ });
+
+ var actor = '<div class="actor">';
+ actor += '</div>';
+ var datatype = $(page).attr('datatype');
+ var $actor = $(actor)
+ .data({
+ 'address' : address,
+ 'value_r' : 0,
+ 'value_g' : 0,
+ 'value_b' : 0,
+ 'type' : 'colorChooser'
+ })
+ .farbtastic( function(color){
+ var r = parseInt(color.substring(1, 3), 16) * 100 / 255;
+ var g = parseInt(color.substring(3, 5), 16) * 100 / 255;
+ var b = parseInt(color.substring(5, 7), 16) * 100 / 255;
+ for( var addr in address )
+ {
+ if( address[addr][2] == true ) continue; // skip read only
+ switch( address[addr][1] )
+ {
+ case 'r':
+ visu.write( addr.substr(1), r, address[addr][0].substr(4) );
+ break;
+ case 'g':
+ visu.write( addr.substr(1), g, address[addr][0].substr(4) );
+ break;
+ case 'b':
+ visu.write( addr.substr(1), b, address[addr][0].substr(4) );
+ break;
+ }
+ }
+ });
+ for( var addr in address ) {
+ switch( address[addr][1] ) {
+ case 'r':
+ $actor.bind( addr, this.update_r );
+ break;
+ case 'g':
+ $actor.bind( addr, this.update_g );
+ break;
+ case 'b':
+ $actor.bind( addr, this.update_b );
+ break;
+ }
+ }
+
+ ret_val.append(label).append( $actor );
+ return ret_val;
+ },
+ update_r: function( e, data ) {
+ var element = $(this);
+ var value = transform( data, element.data().address[ e.type ][0] );
+ element.data( 'value_r', value );
+ function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
+ var color = toHex( element.data( 'value_r' )*255/100 )
+ + toHex( element.data( 'value_g' )*255/100 )
+ + toHex( element.data( 'value_b' )*255/100 );
+ jQuery.farbtastic( element ).setColor( '#' + color );
+ },
+ update_g: function( e, data ) {
+ var element = $(this);
+ var value = transform( data, element.data().address[ e.type ][0] );
+ element.data( 'value_g', value );
+ function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
+ var color = toHex( element.data( 'value_r' )*255/100 )
+ + toHex( element.data( 'value_g' )*255/100 )
+ + toHex( element.data( 'value_b' )*255/100 );
+ jQuery.farbtastic( element ).setColor( '#' + color );
+ },
+ update_b: function( e, data ) {
+ var element = $(this);
+ var value = transform( data, element.data().address[ e.type ][0] );
+ element.data( 'value_b', value );
+ function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
+ var color = toHex( element.data( 'value_r' )*255/100 )
+ + toHex( element.data( 'value_g' )*255/100 )
+ + toHex( element.data( 'value_b' )*255/100 );
+ jQuery.farbtastic( element ).setColor( '#' + color );
+ },
+ attributes: {
+ address_r: { type: 'address' , required: true },
+ address_g: { type: 'address' , required: true },
+ address_b: { type: 'address' , required: true },
+ datatype: { type: 'datatype', required: true },
+ },
+ content: { type: 'string', required: true }
});
/**
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 20:22:10 UTC (rev 214)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 21:33:55 UTC (rev 215)
@@ -2,8 +2,8 @@
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" design="pure" xsi:noNamespaceSchemaLocation="visu_config.xsd">
<meta>
<plugins>
+ <plugin name="colorchooser"/>
<!--
- <plugin name="colorchooser"/>
<plugin name="diagram"/>
-->
</plugins>
@@ -88,5 +88,15 @@
<page name="iframe Test">
<iframe src="http://www.cometvisu.org" width="500px" height="500px"/>
</page>
+ <colorchooser>
+ <label>A colorChooser</label>
+ <address src="1/2/59" transform="DPT:5.001" color="r" />
+ <address src="1/2/60" transform="DPT:5.001" color="g" />
+ <address src="1/2/61" transform="DPT:5.001" color="b" />
+ </colorchooser>
+ <info><label>R</label><address src="1/2/59" transform="DPT:5.001" /></info>
+ <info><label>G</label><address src="1/2/60" transform="DPT:5.001" /></info>
+ <info><label>B</label><address src="1/2/61" transform="DPT:5.001" /></info>
+ <slide><label>B</label><address src="1/2/61" transform="DPT:5.001" /></slide>
</page>
</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 20:22:16
|
Revision: 214
http://openautomation.svn.sourceforge.net/openautomation/?rev=214&view=rev
Author: mayerch
Date: 2010-12-12 20:22:10 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
Handle unknown element types gracefully (again)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 19:45:28 UTC (rev 213)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 20:22:10 UTC (rev 214)
@@ -403,7 +403,7 @@
if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
if( style != '' ) style = 'style="' + style + '"';
var actor = '<div class="actor"><iframe src="' +$p.attr('src') + '" ' + style + '></iframe></div>';
- ret_val.append( $(actor) ); // abuse "each" to call in context...
+ ret_val.append( $(actor) );
return ret_val;
},
attributes: {
@@ -417,7 +417,7 @@
this.addCreator('unknown', {
create: function( page, path ) {
var ret_val = $('<div class="widget" />');
- ret_val.append( '<pre>' + page.textContent + '</pre>' );
+ ret_val.append( '<pre>unknown: ' + page.nodeName + '</pre>' );
return ret_val;
},
attributes: {
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-12-12 19:45:28 UTC (rev 213)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-12-12 20:22:10 UTC (rev 214)
@@ -233,7 +233,9 @@
function create_pages( page, path )
{
var retval;
- retval = design.creators[ page.nodeName ].create( page, path );
+ retval = (design.creators[ page.nodeName ]) ?
+ design.creators[ page.nodeName ].create( page, path ) :
+ design.creators[ 'unknown' ].create( page, path ) ;
node = $(page).get(0);
var attributes = {};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 19:45:34
|
Revision: 213
http://openautomation.svn.sourceforge.net/openautomation/?rev=213&view=rev
Author: mayerch
Date: 2010-12-12 19:45:28 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
updated current changes
Modified Paths:
--------------
CometVisu/trunk/ChangeLog
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2010-12-12 19:26:20 UTC (rev 212)
+++ CometVisu/trunk/ChangeLog 2010-12-12 19:45:28 UTC (rev 213)
@@ -1,14 +1,21 @@
HEAD
====
-- ...
-
-Config changes:
-The format of the config file has changed. Please update the existing file to:
-- ...
- New Design: "discreet_sand": dark text, light background
- New Design: "discreet_slim": more widgets per line for bigger screens
+- New config structure: To allow widgets to listen to multiple addresses
+ the structure of the config file had to change.
+Config changes:
+The format of the config file has changed. Please update the existing file, so:
+- the labels are now sub elements of type <label>
+- the addresses are now sub elements of type <address> with the attributes
+ - src: the addess on the bus
+ - transform (optional): the name of a function that translates between the
+ raw values on the bus and the internal JavaScript types
+ - readonly (optional): when set to "true" the widget will only listen on
+ that address and not send values when the widget gets changed
+
0.5.2
=====
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 19:26:26
|
Revision: 212
http://openautomation.svn.sourceforge.net/openautomation/?rev=212&view=rev
Author: mayerch
Date: 2010-12-12 19:26:20 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
Initial transfer of slider - the structure should be ready now, although the slider itself still isn't perfect.
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config_neu.xml
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 17:06:01 UTC (rev 211)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 19:26:20 UTC (rev 212)
@@ -145,49 +145,93 @@
content: { type: 'string' , required: true }
});
- this.addCreator("slide", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'dim' );
- var label = '<div class="label">' + page.textContent + '</div>';
- ga_list.push( $(page).attr('address') );
- var actor = $('<div class="actor">');
- ret_val.append( label ).append( actor );
- var min = parseFloat( $(page).attr('min') || 0 );
- var max = parseFloat( $(page).attr('max') || 100 );
- var step = parseFloat( $(page).attr('step') || 0.5 );
- ret_val.find('.actor').data( {
- 'events': $(actor).data( 'events' ),
- 'GA': $(page).attr('address'),
- 'datatype': $(page).attr('datatype'),
- 'mapping' : $(page).attr('mapping'),
- 'styling' : $(page).attr('styling'),
- 'min' : min,
- 'max' : max,
- 'step' : step,
- 'type' : 'dim'
- }).bind('_'+$(page).attr('address'), this.update )
- .slider({step:step,min:min,max:max, animate: true,start:slideStart,change:slideChange}/*slide:slideAction}*/);
- return ret_val;
- },
- update: function(e,d) {
- var element = $(this);
- var value = decodeDPT( d, element.data('datatype') );
- element.data( 'value', value );
- element.slider('value', value);
- },
- attributes: {
- address: {type: "address", required: true},
- datatype: {type: "datatype", required: true},
- response_address: {type: "address", required: true},
- response_datatype: {type: "datatype", required: true},
- min: {type: "numeric", required: false},
- max: {type: "numeric", required: false},
- step: {type: "numeric", required: false},
- mapping: {type: "mapping", required: false},
- styling: {type: "styling", required: false}
- },
- content: {type: "string", required: true}
+ this.addCreator('slide', {
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget slide" />');
+ var labelElement = $p.find('label')[0];
+ var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
+ var address = {};
+ $p.find('address').each( function(){
+ var src = this.getAttribute('src');
+ var transform = this.getAttribute('transform');
+ ga_list.push( src )
+ address[ '_' + src ] = [transform];
+ });
+ var actor = $('<div class="actor">');
+// ret_val.append( label ).append( actor );
+ var min = parseFloat( $p.attr('min') || 0 );
+ var max = parseFloat( $p.attr('max') || 100 );
+ var step = parseFloat( $p.attr('step') || 0.5 );
+// ret_val.find('.actor').data( {
+ var $actor = $(actor).data({
+ 'events': $(actor).data( 'events' ),
+ 'address' : address,
+ 'mapping' : $p.attr('mapping'),
+ 'styling' : $p.attr('styling'),
+ 'min' : min,
+ 'max' : max,
+ 'step' : step,
+ 'type' : 'dim'
+ });//.bind('_'+$(page).attr('address'), this.update )
+ //.slider({step:step,min:min,max:max, animate: true,start:slideStart,change:slideChange}/*slide:slideAction}*/);
+ for( var addr in address ) $actor.bind( addr, this.update );
+ $actor.slider({
+ step: step,
+ min: min,
+ max: max,
+ animate: true,
+ start: this.slideStart,
+ change: this.slideChange
+ }/*slide:slideAction}*/);
+ ret_val.append( label ).append( $actor );
+ return ret_val;
+ },
+ update: function( e, data ) {
+ var element = $(this);
+ var value = transform( data, element.data().address[ e.type ][0] );
+ element.data( 'value', value );
+ element.slider('value', value);
+ },
+/**
+ * Start a thread that regularily sends the silder position to the bus
+ */
+slideStart:function(event,ui)
+{
+ console.log('start');
+ var actor = $( '.actor', $(this).parent() );
+ actor.data( 'updateFn', setInterval( function(){
+ var data = actor.data();
+ for( var addr in data.address )
+ {
+ if( data.address[addr][1] == true ) continue; // skip read only
+ visu.write( addr.substr(1), ui.value, data.address[addr][0].substr(4) );
+ }
+ }, 250 ) ); // update KNX every 250 ms
+},
+/**
+ * Delete the update thread and send the final value of the slider to the bus
+ */
+slideChange:function(event,ui)
+{
+ console.log('change');
+ var data = $(this).data();
+ clearInterval( data.updateFn, ui.value);
+ if( data.value != ui.value )
+ for( var addr in data.address )
+ {
+ if( data.address[addr][1] == true ) continue; // skip read only
+ visu.write( addr.substr(1), ui.value, data.address[addr][0].substr(4) );
+ }
+},
+ attributes: {
+ min: { type: 'numeric', required: false },
+ max: { type: 'numeric', required: false },
+ step: { type: 'numeric', required: false },
+ mapping: { type: 'mapping', required: false },
+ styling: { type: 'styling', required: false }
+ },
+ content: { type: 'string', required: true }
});
this.addCreator('switch', {
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-12-12 17:06:01 UTC (rev 211)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-12-12 19:26:20 UTC (rev 212)
@@ -327,36 +327,4 @@
if( src.indexOf('?') < 0 ) src += '?';
$(this).data('interval', setInterval( function(){refreshAction(target, src);}, refresh ) );
}
-}
-
-/**
- * The update thread to send the slider position to the bus
- */
-function slideUpdate(actor)
-{
- var data = actor.data();
- visu.write( data.GA, actor.slider('value'), data.datatype );
-}
-
-/**
- * Start a thread that regularily sends the silder position to the bus
- */
-function slideStart(event,ui)
-{
- var actor = $( '.actor', $(this).parent() );
- actor.data( 'updateFn', setInterval( function(){slideUpdate(actor);}, 250 ) ); // update KNX every 250 ms
-}
-
-/**
- * Delete the update thread and send the final value of the slider to the bus
- */
-function slideChange(event,ui)
-{
- var data = $( '.actor', $(this).parent() ).data();
- var actor = $( '.actor', $(this).parent() );
-
- clearInterval( data.updateFn, ui.value);
-
- if( data.value != ui.value )
- visu.write( data.GA, ui.value, data.datatype );
-}
+}
\ No newline at end of file
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 17:06:01 UTC (rev 211)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 19:26:20 UTC (rev 212)
@@ -66,6 +66,10 @@
<address src="1/0/2" transform="DPT:1.001" />
<address src="12/4/253" transform="DPT:9.001" readonly="true" />
</switch>
+ <slide min="-18" max="26">
+ <label>Slide</label>
+ <address src="12/4/250" transform="DPT:9" />
+ </slide>
<break />
<trigger value="0" mapping="OnOff">
<label>Terrase Licht 0</label>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 17:06:08
|
Revision: 211
http://openautomation.svn.sourceforge.net/openautomation/?rev=211&view=rev
Author: mayerch
Date: 2010-12-12 17:06:01 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
updated image and video element
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/visu_config_neu.xml
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 16:56:12 UTC (rev 210)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 17:06:01 UTC (rev 211)
@@ -46,10 +46,10 @@
return this.popups[name];
}
- /**
- * The creators object contians all widgets creators and their mappin to the
- * XML config file tags
- */
+ /**
+ * The creators object contians all widgets creators and their mapping to the
+ * XML config file tags
+ */
this.addCreator('page', {
create: function( page, path ) {
var $p = $(page);
@@ -296,54 +296,56 @@
content: { type: 'string' , required: true }
});
- this.addCreator("image", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'image' );
- ret_val.append( '<div class="label">' + page.textContent + '</div>' );
- var style = '';
- if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
- if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><img src="' +$(page).attr('src') + '" ' + style + ' /></div>';
- var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
- ret_val.append( $(actor).data( {
- 'refresh': refresh
- } ).each(setupRefreshAction) ); // abuse "each" to call in context...
- return ret_val;
- },
- attributes: {
- src: {type: "uri", required: true},
- width: {type: "string", required: false},
- height: {type: "string", required: false},
- refresh: {type: "numeric", required: false}
- },
- content: {type: "string", required: false}
+ this.addCreator('image', {
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget image" />');
+ var labelElement = $p.find('label')[0];
+ ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
+ var style = '';
+ if( $p.attr('width' ) ) style += 'width:' + $p.attr('width' ) + ';';
+ if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ var actor = '<div class="actor"><img src="' +$p.attr('src') + '" ' + style + ' /></div>';
+ var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
+ ret_val.append( $(actor).data( {
+ 'refresh': refresh
+ } ).each(setupRefreshAction) ); // abuse "each" to call in context...
+ return ret_val;
+ },
+ attributes: {
+ src: { type: 'uri' , required: true },
+ width: { type: 'string' , required: false },
+ height: { type: 'string' , required: false },
+ refresh: { type: 'numeric', required: false }
+ },
+ content: { type: 'string', required: false }
});
- this.addCreator("video", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'video' );
- ret_val.append( '<div class="label">' + page.textContent + '</div>' );
- var style = '';
- if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
- if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><video src="' +$(page).attr('src') + '" ' + style + ' controls="controls" /></div>';
- var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
- ret_val.append( $(actor).data( {
- 'refresh': refresh
- } ).each(setupRefreshAction) ); // abuse "each" to call in context...
- return ret_val;
- },
- attributes: {
- src: {type: "uri", required: true},
- width: {type: "string", required: false},
- height: {type: "string", required: false},
- refresh: {type: "numeric", required: false}
- },
- content: {type: "string", required: true}
+ this.addCreator('video', {
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget video" />');
+ var labelElement = $p.find('label')[0];
+ ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
+ var style = '';
+ if( $p.attr('width' ) ) style += 'width:' + $p.attr('width' ) + ';';
+ if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ var actor = '<div class="actor"><video src="' +$p.attr('src') + '" ' + style + ' controls="controls" /></div>';
+ var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
+ ret_val.append( $(actor).data( {
+ 'refresh': refresh
+ } ).each(setupRefreshAction) ); // abuse "each" to call in context...
+ return ret_val;
+ },
+ attributes: {
+ src: { type: 'uri' , required: true },
+ width: { type: 'string' , required: false },
+ height: { type: 'string' , required: false },
+ refresh: { type: 'numeric', required: false }
+ },
+ content: { type: 'string', required: true }
});
this.addCreator('iframe', {
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 16:56:12 UTC (rev 210)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 17:06:01 UTC (rev 211)
@@ -76,6 +76,10 @@
<address src="1/0/2" transform="DPT:1.001" />
</trigger>
<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">
+ <label>Update every 10 sec</label>
+ </image>
<designtoggle>Change design</designtoggle>
<page name="iframe Test">
<iframe src="http://www.cometvisu.org" width="500px" height="500px"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 16:56:18
|
Revision: 210
http://openautomation.svn.sourceforge.net/openautomation/?rev=210&view=rev
Author: mayerch
Date: 2010-12-12 16:56:12 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
updated page and iframe widget
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/visu_config_neu.xml
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 16:46:55 UTC (rev 209)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 16:56:12 UTC (rev 210)
@@ -50,28 +50,28 @@
* The creators object contians all widgets creators and their mappin to the
* XML config file tags
*/
- this.addCreator("page", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- var style = ( '0' != path ) ? 'display:none' : '';
- var name = $(page).attr('name'); //path += '_' + name;
- var type = $(page).attr('type'); //text, 2d or 3d
- ret_val.addClass( 'link' ).addClass("pagelink");
- ret_val.append( '<a href="javascript:scrollToPage(\''+path+'\')">' + name + '</a>' );
- var childs = $(page).children();
- var container = $( '<div class="clearfix"/>' );
-
- container.append( '<h1>' + name + '</h1>' );
- $( childs ).each( function(i){
- container.append( create_pages(childs[i], path + '_' + i ) );
- } );
- $('#pages').prepend( $( '<div class="page" id="' + path + '" style="'+style+';"/>' ).append(container) );
- return ret_val;
- },
- attributes: {
- name: {type: "string", required: true}
- },
- content: true
+ this.addCreator('page', {
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget" />');
+ var style = ( '0' != path ) ? 'display:none' : '';
+ var name = $p.attr('name');
+ var type = $p.attr('type'); //text, 2d or 3d
+ ret_val.addClass( 'link' ).addClass('pagelink');
+ ret_val.append( '<a href="javascript:scrollToPage(\''+path+'\')">' + name + '</a>' );
+ var childs = $p.children();
+ var container = $( '<div class="clearfix"/>' );
+ container.append( '<h1>' + name + '</h1>' );
+ $( childs ).each( function(i){
+ container.append( create_pages(childs[i], path + '_' + i ) );
+ } );
+ $('#pages').prepend( $( '<div class="page" id="' + path + '" style="'+style+';"/>' ).append(container) );
+ return ret_val;
+ },
+ attributes: {
+ name: { type: 'string', required: true }
+ },
+ content: true
});
this.addCreator('line', {
@@ -346,25 +346,26 @@
content: {type: "string", required: true}
});
- this.addCreator("iframe", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'iframe' );
- ret_val.append( '<div class="label">' + page.textContent + '</div>' );
- var style = '';
- if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
- if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><iframe src="' +$(page).attr('src') + '" ' + style + '></iframe></div>';
- ret_val.append( $(actor) ); // abuse "each" to call in context...
- return ret_val;
- },
- attributes: {
- src: {type: "uri", required: true},
- width: {type: "string", required: false},
- height: {type: "string", required: false}
- },
- content: {type: "string", required: false}
+ this.addCreator('iframe', {
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'iframe' );
+ ret_val.append( '<div class="label">' + page.textContent + '</div>' );
+ var style = '';
+ if( $p.attr('width' ) ) style += 'width:' + $p.attr('width' ) + ';';
+ if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ var actor = '<div class="actor"><iframe src="' +$p.attr('src') + '" ' + style + '></iframe></div>';
+ ret_val.append( $(actor) ); // abuse "each" to call in context...
+ return ret_val;
+ },
+ attributes: {
+ src: { type: 'uri' , required: true },
+ width: { type: 'string', required: false },
+ height: { type: 'string', required: false }
+ },
+ content: { type: 'string', required: false }
});
this.addCreator('unknown', {
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 16:46:55 UTC (rev 209)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 16:56:12 UTC (rev 210)
@@ -77,5 +77,8 @@
</trigger>
<line />
<designtoggle>Change design</designtoggle>
+ <page name="iframe Test">
+ <iframe src="http://www.cometvisu.org" width="500px" height="500px"/>
+ </page>
</page>
</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 16:47:02
|
Revision: 209
http://openautomation.svn.sourceforge.net/openautomation/?rev=209&view=rev
Author: mayerch
Date: 2010-12-12 16:46:55 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
Moved switch and trigger to new config syntax
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config_demo.xml
CometVisu/trunk/visu/visu_config_neu.xml
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 15:48:46 UTC (rev 208)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 16:46:55 UTC (rev 209)
@@ -119,7 +119,7 @@
var src = this.getAttribute('src');
var transform = this.getAttribute('transform');
ga_list.push( src )
- address[ '_' + src ] = transform;
+ address[ '_' + src ] = [transform];
});
var actor = '<div class="actor">';
if( $p.attr('pre') ) actor += '<div>' + $p.attr('pre') + '</div>';
@@ -190,86 +190,110 @@
content: {type: "string", required: true}
});
- this.addCreator("switch", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'switch' );
- var label = '<div class="label">' + page.textContent + '</div>';
- var response_address = $(page).attr('response_address');
- ga_list.push( response_address );
- var actor = '<div class="actor switchUnpressed">';
- if( $(page).attr('pre') ) actor += $(page).attr('pre');
- actor += '<div class="value">-</div>';
- if( $(page).attr('post') ) actor += $(page).attr('post');
- actor += '</div>';
- ret_val.append( label ).append( $(actor).data( {
- 'GA': $(page).attr('address'),
- 'datatype': $(page).attr('datatype'),
- 'mapping' : $(page).attr('mapping'),
- 'styling' : $(page).attr('styling'),
- 'type' : 'toggle'
- } ).bind('click',switchAction)
- .bind('_'+$(page).attr('address'), this.update ) );
- return ret_val;
- },
- update: function(e,d) {
- var element = $(this);
- var value = defaultUpdate( e, d, element );
- element.removeClass( value == '0' ? 'switchPressed' : 'switchUnpressed' );
- element.addClass( value == '0' ? 'switchUnpressed' : 'switchPressed' );
- },
- attributes: {
- address: {type: "address", required: true},
- datatype: {type: "datatype", required: true},
- response_address: {type: "address", required: true},
- response_datatype: {type: "datatype", required: true},
- pre: {type: "string", required: false},
- post: {type: "string", required: false},
- mapping: {type: "mapping", required: false},
- styling: {type: "styling", required: false}
- },
- content: {type: "string", required: true}
+ this.addCreator('switch', {
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget switch" />');
+ var labelElement = $p.find('label')[0];
+ var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
+ var address = {};
+ $p.find('address').each( function(){
+ var src = this.getAttribute('src');
+ var transform = this.getAttribute('transform');
+ var readonly = this.getAttribute('readonly');
+ ga_list.push( src )
+ address[ '_' + src ] = [ transform, readonly=='true' ];
+ });
+ var actor = '<div class="actor switchUnpressed">';
+ if( $p.attr('pre') ) actor += $p.attr('pre');
+ actor += '<div class="value">-</div>';
+ if( $p.attr('post') ) actor += $p.attr('post');
+ actor += '</div>';
+ var $actor = $(actor).data( {
+ 'address' : address,
+ 'mapping' : $p.attr('mapping'),
+ 'styling' : $p.attr('styling'),
+ 'type' : 'switch'
+ } ).bind( 'click', this.action );
+ for( var addr in address ) $actor.bind( addr, this.update );
+ ret_val.append( label ).append( $actor );
+ return ret_val;
+ },
+ update: function(e,d) {
+ var element = $(this);
+ var value = defaultUpdate( e, d, element );
+ element.removeClass( value == '0' ? 'switchPressed' : 'switchUnpressed' );
+ element.addClass( value == '0' ? 'switchUnpressed' : 'switchPressed' );
+ },
+ action: function() {
+ var data = $(this).data();
+ for( var addr in data.address )
+ {
+ if( data.address[addr][1] == true ) continue; // skip read only
+ visu.write( addr.substr(1), data.value=='1' ? '0' : '1', data.address[addr][0].substr(4) );
+ }
+ },
+ attributes: {
+ pre: { type: 'string' , required: false },
+ post: { type: 'string' , required: false },
+ mapping: { type: 'mapping' , required: false },
+ styling: { type: 'styling' , required: false }
+ },
+ content: { type: 'string', required: true }
});
- this.addCreator("toggle", this.getCreator("switch"));
-
- this.addCreator("trigger", {
- create: function( page, path ) {
- var value = $(page).attr('value') ? $(page).attr('value') : 0;
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'switch' );
- var label = '<div class="label">' + page.textContent + '</div>';
- var address = $(page).attr('address');
- var actor = '<div class="actor switchUnpressed">';
- if( $(page).attr('pre') ) actor += $(page).attr('pre');
- var map = $(page).attr('mapping');
- if( mappings[map] && mappings[map][value] )
- actor += '<div class="value">' + mappings[map][value] + '</div>';
- else
- actor += '<div class="value">' + value + '</div>';
- if( $(page).attr('post') ) actor += $(page).attr('post');
- actor += '</div>';
- ret_val.append( label ).append( $(actor).data( {
- 'GA' : $(page).attr('address'),
- 'datatype': $(page).attr('datatype'),
- 'mapping' : $(page).attr('mapping'),
- 'styling' : $(page).attr('styling'),
- 'type' : 'trigger',
- 'sendValue': value
- } ).bind('click',triggerAction) );
-
- return ret_val;
- },
- attributes: {
- address: {type: "address", required: true},
- datatype: {type: "datatype", required: true},
- value: {type: "string", required: true},
- pre: {type: "string", required: false},
- post: {type: "string", required: false},
- mapping: {type: "mapping", required: false},
- styling: {type: "styling", required: false}
- },
- content: {type: "string", required: true}
+ this.addCreator('trigger', {
+ create: function( page, path ) {
+ var $p = $(page);
+ var value = $p.attr('value') ? $p.attr('value') : 0;
+ var ret_val = $('<div class="widget switch" />');
+ var labelElement = $p.find('label')[0];
+ var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
+ var address = {};
+ $p.find('address').each( function(){
+ var src = this.getAttribute('src');
+ var transform = this.getAttribute('transform');
+ var readonly = this.getAttribute('readonly');
+ ga_list.push( src )
+ address[ '_' + src ] = [ transform, readonly=='true' ];
+ });
+ var actor = '<div class="actor switchUnpressed">';
+ if( $p.attr('pre') ) actor += $p.attr('pre');
+ var map = $p.attr('mapping');
+ if( mappings[map] && mappings[map][value] )
+ actor += '<div class="value">' + mappings[map][value] + '</div>';
+ else
+ actor += '<div class="value">' + value + '</div>';
+ if( $p.attr('post') ) actor += $p.attr('post');
+ actor += '</div>';
+ var $actor = $(actor).data( {
+ 'address' : address,
+ 'mapping' : $(page).attr('mapping'),
+ 'styling' : $(page).attr('styling'),
+ 'type' : 'trigger',
+ 'sendValue': value
+ } ).bind( 'click', this.action );
+ ret_val.append( label ).append( $actor );
+ return ret_val;
+ },
+ action: function() {
+ var data = $(this).data();
+ for( var addr in data.address )
+ {
+ if( data.address[addr][1] == true ) continue; // skip read only
+ visu.write( addr.substr(1), data.sendValue, data.address[addr][0].substr(4) );
+ }
+ },
+ attributes: {
+ address: { type: 'address' , required: true },
+ datatype: { type: 'datatype', required: true },
+ value: { type: 'string' , required: true },
+ pre: { type: 'string' , required: false },
+ post: { type: 'string' , required: false },
+ mapping: { type: 'mapping' , required: false },
+ styling: { type: 'styling' , required: false }
+ },
+ content: { type: 'string' , required: true }
});
this.addCreator("image", {
@@ -428,12 +452,6 @@
this.addPopup('warning', $.extend(true, {}, this.getPopup('unknown')) );
this.addPopup('error' , $.extend(true, {}, this.getPopup('unknown')) ) ;
- this.switchAction = function() {
- var data = $(this).data();
- // alert( data.GA + ' = ' + data.value );
- visu.write( data.GA, data.value=='1' ? '0' : '1', data.datatype );
- }
-
this.slideAction = function(event,ui) {
//alert(ui.value);
var now = new Date().getTime();
@@ -542,7 +560,7 @@
var element = passedElement || $(this);
//var datatype = element.data().address[ e.type ];
//var value = decodeDPT( data, element.data('datatype') );
- var value = transform( data, element.data().address[ e.type ] );
+ var value = transform( data, element.data().address[ e.type ][0] );
element.data( 'value', value );
element.find('.value').text( map( value, element ) );
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-12-12 15:48:46 UTC (rev 208)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-12-12 16:46:55 UTC (rev 209)
@@ -313,18 +313,6 @@
/* FIXME - Question: should this belong to the VisuDesign object so that it */
/* is possible to overload?!? */
/****************************************************************************/
-function switchAction()
-{
- var data = $(this).data();
- visu.write( data.GA, data.value=='1' ? '0' : '1', data.datatype );
-}
-
-function triggerAction()
-{
- var data = $(this).data();
- visu.write( data.GA, data.sendValue, data.datatype );
-}
-
function refreshAction( target, src )
{
target.src = src + '&' + new Date().getTime();
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2010-12-12 15:48:46 UTC (rev 208)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2010-12-12 16:46:55 UTC (rev 209)
@@ -38,7 +38,8 @@
<statusbar>
<status type="html"><![CDATA[
<img src="icon/comet_64_ff8000.png" alt="CometVisu" /> by <a href="http://www.cometvisu.org/">CometVisu.org</a>
- - <a href=".">Reload</a>
+ - <a href=".?config=demo">Reload</a>
+ - <a href=".">Default Config</a>
]]></status>
<status type="html" condition="!edit"><![CDATA[
- <a href="edit_config.html">Edit</a>
@@ -52,7 +53,7 @@
</statusbar>
</meta>
<page name="Übersicht">
- <text align="center">Willkommen bei der CometVisu!</text>
+ <text align="center">CometVisu widget demo</text>
<toggle address="1/0/2" datatype="1.001" response_address="1/0/2" mapping="OnOff" styling="RedGreen">Terrase Licht</toggle>
<trigger address="1/0/2" datatype="1.001" value="0" mapping="OnOff">Terrase Licht 0</trigger>
<trigger address="1/0/2" datatype="1.001" value="1" mapping="OnOff">Terrase Licht 1</trigger>
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 15:48:46 UTC (rev 208)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 16:46:55 UTC (rev 209)
@@ -61,6 +61,20 @@
<address src="12/4/250" transform="DPT:9" />
<address src="12/4/251" transform="DPT:9.001" />
</info>
+ <switch mapping="OnOff" styling="RedGreen">
+ <label>Terrase Licht</label>
+ <address src="1/0/2" transform="DPT:1.001" />
+ <address src="12/4/253" transform="DPT:9.001" readonly="true" />
+ </switch>
+ <break />
+ <trigger value="0" mapping="OnOff">
+ <label>Terrase Licht 0</label>
+ <address src="1/0/2" transform="DPT:1.001" />
+ </trigger>
+ <trigger value="1" mapping="OnOff">
+ <label>Terrase Licht 1</label>
+ <address src="1/0/2" transform="DPT:1.001" />
+ </trigger>
<line />
<designtoggle>Change design</designtoggle>
</page>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 15:48:52
|
Revision: 208
http://openautomation.svn.sourceforge.net/openautomation/?rev=208&view=rev
Author: mayerch
Date: 2010-12-12 15:48:46 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
Transformed elements that aren't affected by the new config syntax...
Cleaned up code style
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 15:06:00 UTC (rev 207)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 15:48:46 UTC (rev 208)
@@ -19,32 +19,32 @@
* This class defines all the building blocks for a Visu in the "Pure" design
*/
function VisuDesign() {
- this.creators = {};
+ this.creators = {};
- this.addCreator = function (name, object) {
- this.creators[name] = object;
- }
+ this.addCreator = function (name, object) {
+ this.creators[name] = object;
+ }
- this.getCreator = function(name) {
- if (typeof this.creators[name] == undefined) {
- return this.creators.unknown;
- }
- return this.creators[name];
+ this.getCreator = function(name) {
+ if (typeof this.creators[name] == undefined) {
+ return this.creators.unknown;
}
+ return this.creators[name];
+ }
- this.popups = {};
+ this.popups = {};
- this.addPopup = function (name, object) {
- this.popups[name] = object;
- this.popups[name].type = name;
- }
+ this.addPopup = function (name, object) {
+ this.popups[name] = object;
+ this.popups[name].type = name;
+ }
- this.getPopup = function(name) {
- if (typeof this.popups[name] == undefined) {
- return this.popups.unknown;
- }
- return this.popups[name];
+ this.getPopup = function(name) {
+ if (typeof this.popups[name] == undefined) {
+ return this.popups.unknown;
}
+ return this.popups[name];
+ }
/**
* The creators object contians all widgets creators and their mappin to the
@@ -74,42 +74,41 @@
content: true
});
- this.addCreator("line", {
- create: function( page, path ) {
- return $( '<hr />' );
- },
- attributes: {
- },
- content: false
+ this.addCreator('line', {
+ create: function( page, path ) {
+ return $( '<hr />' );
+ },
+ attributes: {
+ },
+ content: false
});
- this.addCreator("break", {
- create: function( page, path ) {
- return $( '<br />' );
- },
- attributes: {
- },
- content: false
+ this.addCreator('break', {
+ create: function( page, path ) {
+ return $( '<br />' );
+ },
+ attributes: {
+ },
+ content: false
});
-
- this.addCreator("text", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'text' );
- var style = '';
- if( $(page).attr('align') ) style += 'text-align:' + $(page).attr('align') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- ret_val.append( '<div ' + style + '>' + page.textContent + '</div>' );
- return ret_val;
- },
- attributes: {
- align: {type: "string", required: false}
- },
- content: {type: "string", required: true}
+ this.addCreator('text', {
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget text" />');
+ var style = '';
+ if( $p.attr('align') ) style += 'text-align:' + $p.attr('align') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ ret_val.append( '<div ' + style + '>' + page.textContent + '</div>' );
+ return ret_val;
+ },
+ attributes: {
+ align: { type: 'string', required: false }
+ },
+ content: { type: 'string', required: true }
});
-
- this.addCreator("info", {
+
+ this.addCreator('info', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget info" />');
@@ -138,18 +137,15 @@
},
update: defaultUpdate,
attributes: {
- pre: {type: "string", required: false},
- post: {type: "string", required: false},
- mapping: {type: "mapping", required: false},
- styling: {type: "styling", required: false}
+ pre: { type: 'string' , required: false },
+ post: { type: 'string' , required: false },
+ mapping: { type: 'mapping', required: false },
+ styling: { type: 'styling', required: false }
},
- content: {type: "string", required: true}
+ content: { type: 'string' , required: true }
});
- this.addCreator("shade", this.getCreator("info"));
-
-
- this.addCreator("dim", {
+ this.addCreator("slide", {
create: function( page, path ) {
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'dim' );
@@ -194,8 +190,6 @@
content: {type: "string", required: true}
});
- this.addCreator("slide", this.getCreator("dim"));
-
this.addCreator("switch", {
create: function( page, path ) {
var ret_val = $('<div class="widget" />');
@@ -349,15 +343,15 @@
content: {type: "string", required: false}
});
- this.addCreator("unknown", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.append( '<pre>' + page.textContent + '</pre>' );
- return ret_val;
- },
- attributes: {
- },
- content: {type: "string", required: true}
+ this.addCreator('unknown', {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.append( '<pre>' + page.textContent + '</pre>' );
+ return ret_val;
+ },
+ attributes: {
+ },
+ content: {type: 'string', required: true}
});
this.addPopup('unknown', {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 15:06:06
|
Revision: 207
http://openautomation.svn.sourceforge.net/openautomation/?rev=207&view=rev
Author: mayerch
Date: 2010-12-12 15:06:00 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
First step towards moving addesses from the attributes to own elements (-> feature whish #3133031).
Also inital step towards feature whish #3134595 (Change data types to transfer functions)
As this will break all existing config files and as this is only the first step, that converted the info widget, there's a new config file (visu_config_neu.xml) that can be called by adding "?config=neu" to the visu URL. This file contains the new config syntax and will be extended by each widget that gets transformed.
NOTE: this will also break the editor!
So if you aren't perfectly sure about what you are doing, DO NOT update to the latest SVN version yet!
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Added Paths:
-----------
CometVisu/trunk/visu/visu_config_neu.xml
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 13:22:42 UTC (rev 206)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-12 15:06:00 UTC (rev 207)
@@ -110,34 +110,40 @@
});
this.addCreator("info", {
- create: function( page, path ) {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'info' );
- var label = '<div class="label">' + page.textContent + '</div>';
- ga_list.push( $(page).attr('address') );
- var actor = '<div class="actor">';
- if( $(page).attr('pre') ) actor += '<div>' + $(page).attr('pre') + '</div>';
- actor += '<div class="value">-</div>';
- if( $(page).attr('post') ) actor += '<div>' + $(page).attr('post') + '</div>';
- actor += '</div>';
- ret_val.append( label ).append( $(actor).data( {
- 'GA': $(page).attr('address'),
- 'datatype': $(page).attr('datatype'),
- 'mapping' : $(page).attr('mapping'),
- 'styling' : $(page).attr('styling')
- } ).bind('_'+$(page).attr('address'), this.update ) );
- return ret_val;
- },
- update: defaultUpdate,
- attributes: {
- address: {type: "address", required: true},
- datatype: {type: "datatype", required: true},
- pre: {type: "string", required: false},
- post: {type: "string", required: false},
- mapping: {type: "mapping", required: false},
- styling: {type: "styling", required: false}
- },
- content: {type: "string", required: true}
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget info" />');
+ var labelElement = $p.find('label')[0];
+ var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
+ var address = {};
+ $p.find('address').each( function(){
+ var src = this.getAttribute('src');
+ var transform = this.getAttribute('transform');
+ ga_list.push( src )
+ address[ '_' + src ] = transform;
+ });
+ var actor = '<div class="actor">';
+ if( $p.attr('pre') ) actor += '<div>' + $p.attr('pre') + '</div>';
+ actor += '<div class="value">-</div>';
+ if( $p.attr('post') ) actor += '<div>' + $p.attr('post') + '</div>';
+ actor += '</div>';
+ var $actor = $(actor).data({
+ 'address' : address,
+ 'mapping' : $p.attr('mapping'),
+ 'styling' : $p.attr('styling')
+ });
+ for( var addr in address ) $actor.bind( addr, this.update );
+ ret_val.append( label ).append( $actor );
+ return ret_val;
+ },
+ update: defaultUpdate,
+ attributes: {
+ pre: {type: "string", required: false},
+ post: {type: "string", required: false},
+ mapping: {type: "mapping", required: false},
+ styling: {type: "styling", required: false}
+ },
+ content: {type: "string", required: true}
});
this.addCreator("shade", this.getCreator("info"));
@@ -529,11 +535,20 @@
return { x: 0, y: 0 }; // sanity return
}
+/**
+ * temporary function till the transformation framework is implemented
+ */
+function transform( raw, type )
+{
+ return decodeDPT( raw, type.substr(4) ); // filter away the 'DPT:'
+}
function defaultUpdate( e, data, passedElement )
{
var element = passedElement || $(this);
- var value = decodeDPT( data, element.data('datatype') );
+ //var datatype = element.data().address[ e.type ];
+ //var value = decodeDPT( data, element.data('datatype') );
+ var value = transform( data, element.data().address[ e.type ] );
element.data( 'value', value );
element.find('.value').text( map( value, element ) );
Added: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml (rev 0)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-12 15:06:00 UTC (rev 207)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" design="pure" xsi:noNamespaceSchemaLocation="visu_config.xsd">
+ <meta>
+ <plugins>
+ <!--
+ <plugin name="colorchooser"/>
+ <plugin name="diagram"/>
+ -->
+ </plugins>
+ <mappings>
+ <mapping name="OpenClose">
+ <entry value="0">zu</entry>
+ <entry value="1">offen</entry>
+ </mapping>
+ <mapping name="OnOff">
+ <entry value="0">Aus</entry>
+ <entry value="1">An</entry>
+ </mapping>
+ <mapping name="Sign">
+ <entry range_min="-1e99" range_max="0">Negativ</entry>
+ <entry value="0">Null</entry>
+ <entry range_min="0" range_max="1e99">Positiv</entry>
+ </mapping>
+ </mappings>
+ <stylings>
+ <styling name="RedGreen">
+ <entry value="0">red</entry>
+ <entry value="1">green</entry>
+ </styling>
+ <styling name="GreenRed">
+ <entry value="0">green</entry>
+ <entry value="1">red</entry>
+ </styling>
+ <styling name="BluePurpleRed">
+ <entry range_min="-100" range_max="0">blue</entry>
+ <entry value="0">purple</entry>
+ <entry range_min="0" range_max="100">red</entry>
+ </styling>
+ </stylings>
+ <statusbar>
+ <status type="html"><![CDATA[
+ <img src="icon/comet_64_ff8000.png" alt="CometVisu" /> by <a href="http://www.cometvisu.org/">CometVisu.org</a>
+ - <a href=".?config=neu">Reload</a>
+ - <a href=".">Default Config</a>
+ ]]></status>
+ <status type="html" condition="!edit"><![CDATA[
+ - <a href="edit_config.html">Edit</a>
+ ]]></status>
+ <status type="html" condition="edit"><![CDATA[
+ - <a href=".">normal Mode</a>
+ ]]></status>
+ <status type="html"><![CDATA[
+ - <a href="check_config.php">Check Config</a>
+ ]]></status>
+ </statusbar>
+ </meta>
+ <page name="Übersicht">
+ <text align="center">CometVisu format neu</text>
+ <info styling="BluePurpleRed">
+ <label>Slide Info</label>
+ <address src="12/4/250" transform="DPT:9" />
+ <address src="12/4/251" transform="DPT:9.001" />
+ </info>
+ <line />
+ <designtoggle>Change design</designtoggle>
+ </page>
+</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 13:22:48
|
Revision: 206
http://openautomation.svn.sourceforge.net/openautomation/?rev=206&view=rev
Author: mayerch
Date: 2010-12-12 13:22:42 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
Added statusbar widget and align attribute of text widget.
Modified Paths:
--------------
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2010-12-12 13:09:28 UTC (rev 205)
+++ CometVisu/trunk/visu/visu_config.xsd 2010-12-12 13:22:42 UTC (rev 206)
@@ -60,6 +60,7 @@
<xsd:element ref="plugins" />
<xsd:element ref="mappings" />
<xsd:element ref="stylings" />
+ <xsd:element ref="statusbar" />
</xsd:choice>
</xsd:complexType>
</xsd:element>
@@ -112,12 +113,29 @@
</xsd:complexType>
</xsd:element>
+<xsd:complexType name="status">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="type" type="xsd:string" use="optional" />
+ <xsd:attribute name="condition" type="xsd:string" use="optional" />
+ </xsd:extension>
+ </xsd:simpleContent>
+</xsd:complexType>
+
+<xsd:element name="statusbar">
+ <xsd:complexType>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="status" type="status" minOccurs="1" />
+ </xsd:choice>
+ </xsd:complexType>
+</xsd:element>
+
<!-- define a page - if you add a new widget, you need to list it here -->
<xsd:element name="page">
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<!-- list all possbile widgets here -->
- <xsd:element name="text" type="xsd:string" />
+ <xsd:element name="text" type="text" />
<xsd:element name="line" type="line" />
<xsd:element name="switch" type="switch" />
<xsd:element name="toggle" type="switch" />
@@ -138,6 +156,14 @@
<!-- more fun part - all widgets - if you add a new widget, you need to define it here -->
+<xsd:complexType name="text">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="align" type="xsd:string" />
+ </xsd:extension>
+ </xsd:simpleContent>
+</xsd:complexType>
+
<xsd:complexType name="switch">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|