|
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-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...> - 2011-01-01 15:18:10
|
Revision: 238
http://openautomation.svn.sourceforge.net/openautomation/?rev=238&view=rev
Author: mayerch
Date: 2011-01-01 15:18:04 +0000 (Sat, 01 Jan 2011)
Log Message:
-----------
Fixed bug in the switch widget to make it work again
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-01-01 14:31:24 UTC (rev 237)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-01-01 15:18:04 UTC (rev 238)
@@ -271,15 +271,15 @@
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' );
+ 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), Transform[data.address[addr][0]].encode( data.value ) );
+ visu.write( addr.substr(1), Transform[data.address[addr][0]].encode( data.value == 0 ) );
}
},
attributes: {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-01 15:20:41
|
Revision: 239
http://openautomation.svn.sourceforge.net/openautomation/?rev=239&view=rev
Author: mayerch
Date: 2011-01-01 15:20:35 +0000 (Sat, 01 Jan 2011)
Log Message:
-----------
Clean up slider widget (remove left over comments)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-01-01 15:18:04 UTC (rev 238)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-01-01 15:20:35 UTC (rev 239)
@@ -159,11 +159,9 @@
address[ '_' + src ] = [ this.getAttribute('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,
@@ -173,8 +171,7 @@
'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,
@@ -183,7 +180,7 @@
animate: true,
start: this.slideStart,
change: this.slideChange
- }/*slide:slideAction}*/);
+ });
ret_val.append( label ).append( $actor );
return ret_val;
},
@@ -209,7 +206,6 @@
{
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) );
visu.write( addr.substr(1), Transform[data.address[addr][0]].encode( data.value ) );
}
}, 250 ) ); // update KNX every 250 ms
@@ -225,7 +221,6 @@
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) );
visu.write( addr.substr(1), Transform[data.address[addr][0]].encode( ui.value ) );
}
},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-02 21:07:34
|
Revision: 241
http://openautomation.svn.sourceforge.net/openautomation/?rev=241&view=rev
Author: mayerch
Date: 2011-01-02 21:07:28 +0000 (Sun, 02 Jan 2011)
Log Message:
-----------
Compare the encoded values at the slider widget to reduce sent messages
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-01-01 16:21:41 UTC (rev 240)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-01-02 21:07:28 UTC (rev 241)
@@ -202,12 +202,15 @@
actor.data( 'updateFn', setInterval( function(){
var data = actor.data();
if( data.value == actor.slider('value') ) return;
+ var asv = actor.slider('value');
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), Transform[data.address[addr][0]].encode( data.value ) );
+ var dv = Transform[data.address[addr][0]].encode( data.value );
+ if( dv != Transform[data.address[addr][0]].encode( asv ) )
+ visu.write( addr.substr(1), dv );
}
+ data.value = actor.slider('value');
}, 250 ) ); // update KNX every 250 ms
},
/**
@@ -218,11 +221,13 @@
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), Transform[data.address[addr][0]].encode( ui.value ) );
- }
+ for( var addr in data.address )
+ {
+ if( data.address[addr][1] == true ) continue; // skip read only
+ var uv = Transform[data.address[addr][0]].encode( ui.value );
+ if( uv != Transform[data.address[addr][0]].encode( data.value ) )
+ visu.write( addr.substr(1), uv );
+ }
},
attributes: {
min: { 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...> - 2011-02-06 18:04:20
|
Revision: 284
http://openautomation.svn.sourceforge.net/openautomation/?rev=284&view=rev
Author: mayerch
Date: 2011-02-06 18:04:14 +0000 (Sun, 06 Feb 2011)
Log Message:
-----------
Bugfix - handle unknown widgets correctly
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-02-06 13:50:29 UTC (rev 283)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-02-06 18:04:14 UTC (rev 284)
@@ -26,7 +26,7 @@
}
this.getCreator = function(name) {
- if (typeof this.creators[name] == undefined) {
+ if (this.creators[name] === undefined) {
return this.creators.unknown;
}
return this.creators[name];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-02-13 13:16:49
|
Revision: 294
http://openautomation.svn.sourceforge.net/openautomation/?rev=294&view=rev
Author: mayerch
Date: 2011-02-13 13:16:42 +0000 (Sun, 13 Feb 2011)
Log Message:
-----------
Fix bug in the slider that prevented the updates during the sliding.
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-02-13 13:03:53 UTC (rev 293)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-02-13 13:16:42 UTC (rev 294)
@@ -218,8 +218,8 @@
for( var addr in data.address )
{
if( data.address[addr][1] == true ) continue; // skip read only
- var dv = Transform[data.address[addr][0]].encode( data.value );
- if( dv != Transform[data.address[addr][0]].encode( asv ) )
+ var dv = Transform[data.address[addr][0]].encode( asv );
+ if( dv != Transform[data.address[addr][0]].encode( data.value ) )
visu.write( addr.substr(1), dv );
}
data.value = actor.slider('value');
@@ -310,7 +310,7 @@
},
content: false
});
-
+
this.addCreator('trigger', {
create: function( page, path ) {
var $p = $(page);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-02-27 12:54:48
|
Revision: 305
http://openautomation.svn.sourceforge.net/openautomation/?rev=305&view=rev
Author: mayerch
Date: 2011-02-27 12:54:42 +0000 (Sun, 27 Feb 2011)
Log Message:
-----------
Bug fix: default to untransformed data when the transform isn't known
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-02-24 12:01:21 UTC (rev 304)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-02-27 12:54:42 UTC (rev 305)
@@ -748,7 +748,10 @@
function defaultUpdate( e, data, passedElement )
{
var element = passedElement || $(this);
- var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
+ var thisTransform = element.data().address[ e.type ][0];
+ var value = thisTransform in Transform ?
+ Transform[ element.data().address[ e.type ][0] ].decode( data ) :
+ data; // fall back - no Transform defined...
if( element.data( 'precision' ) )
value = Number( value ).toPrecision( element.data( 'precision' ) );
if( element.data( 'format' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-02-27 15:58:23
|
Revision: 306
http://openautomation.svn.sourceforge.net/openautomation/?rev=306&view=rev
Author: mayerch
Date: 2011-02-27 15:58:17 +0000 (Sun, 27 Feb 2011)
Log Message:
-----------
- Fix that made the editor place new widgets on a wrong (sub)page
- Inital support for page flavours
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-02-27 12:54:42 UTC (rev 305)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-02-27 15:58:17 UTC (rev 306)
@@ -54,26 +54,28 @@
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
- var style = '';
- if( $p.attr('align') ) style += 'text-align:' + $p.attr('align') + ';';
- if( style != '' ) style = 'style="' + style + '"';
+ var pstyle = ( '0' != path ) ? 'display:none;' : ''; // subPage style
+ var name = $p.attr('name');
+ var type = $p.attr('type'); //text, 2d or 3d
+ var flavour = $p.attr('flavour'); // sub design choice
+ var wstyle = ''; // widget style
+ if( $p.attr('align') ) wstyle += 'text-align:' + $p.attr('align') + ';';
+ if( wstyle != '' ) wstyle = 'style="' + wstyle + '"';
ret_val.addClass( 'link' ).addClass('pagelink');
- ret_val.append( '<div ' + style + '><a href="javascript:scrollToPage(\''+path+'\')">' + name + '</a></div>' );
+ ret_val.append( '<div ' + wstyle + '><a href="javascript:scrollToPage(\''+path+'\')">' + name + '</a></div>' );
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) );
+ $('#pages').prepend( $( '<div class="page" id="' + path + '" style="'+pstyle+';"/>' ).append(container) );
return ret_val;
},
attributes: {
- align:{ type: 'string', required: false },
- name: { type: 'string', required: true }
+ align: { type: 'string', required: false },
+ flavour:{ type: 'string', required: false },
+ name: { type: 'string', required: true }
},
elements: {
},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-03-08 21:13:24
|
Revision: 316
http://openautomation.svn.sourceforge.net/openautomation/?rev=316&view=rev
Author: mayerch
Date: 2011-03-08 21:13:18 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
Bug fix for the broken styling feature
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-03-06 20:46:46 UTC (rev 315)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-03-08 21:13:18 UTC (rev 316)
@@ -761,25 +761,6 @@
var element = passedElement || $(this);
var thisTransform = element.data().address[ e.type ][0];
var value = transformDecode( element.data().address[ e.type ][0], data );
- if( element.data( 'precision' ) )
- value = Number( value ).toPrecision( element.data( 'precision' ) );
- if( element.data( 'format' ) )
- value = sprintf( element.data( 'format' ), value );
- element.data( 'value', value );
- value = map( value, element );
- if( value.constructor == Date )
- {
- switch( thisTransform ) // special case for KNX
- {
- case 'DPT:10.001':
- value = value.toLocaleTimeString();
- break;
- case 'DPT:11.001':
- value = value.toLocaleDateString();
- break;
- }
- }
- element.find('.value').text( value );
var styling = element.data('styling');
if( styling && stylings[styling] && (stylings[styling][value] || stylings[styling]['range']) )
@@ -803,5 +784,26 @@
if( not_found ) element.addClass( 'actor' );
}
}
+
+ if( element.data( 'precision' ) )
+ value = Number( value ).toPrecision( element.data( 'precision' ) );
+ if( element.data( 'format' ) )
+ value = sprintf( element.data( 'format' ), value );
+ element.data( 'value', value );
+ value = map( value, element );
+ if( value.constructor == Date )
+ {
+ switch( thisTransform ) // special case for KNX
+ {
+ case 'DPT:10.001':
+ value = value.toLocaleTimeString();
+ break;
+ case 'DPT:11.001':
+ value = value.toLocaleDateString();
+ break;
+ }
+ }
+ element.find('.value').text( value );
+
return value;
}
\ 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...> - 2011-04-27 16:15:22
|
Revision: 318
http://openautomation.svn.sourceforge.net/openautomation/?rev=318&view=rev
Author: mayerch
Date: 2011-04-27 16:15:16 +0000 (Wed, 27 Apr 2011)
Log Message:
-----------
Created optional parameters for the switch to set the values for on and off
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-03-08 21:29:06 UTC (rev 317)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-04-27 16:15:16 UTC (rev 318)
@@ -296,6 +296,8 @@
'address' : address,
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
+ 'on_value' : $p.attr('on_value' ) || 1,
+ 'off_value' : $p.attr('off_value') || 0,
'type' : 'switch'
} ).bind( 'click', this.action );
for( var addr in address ) $actor.bind( addr, this.update );
@@ -305,18 +307,21 @@
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' );
+ var off = element.data( 'off_value' );
+ element.removeClass( value == off ? 'switchPressed' : 'switchUnpressed' );
+ element.addClass( value == off ? '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), transformEncode( data.address[addr][0], data.value == 0 ) );
+ visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value == data.off_value ? data.on_value : data.off_value ) );
}
},
attributes: {
+ on_value: { type: 'string' , required: false },
+ off_value: { type: 'string' , required: false },
pre: { type: 'string' , required: false },
post: { type: 'string' , required: false },
mapping: { type: 'mapping' , required: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-05-12 17:03:45
|
Revision: 331
http://openautomation.svn.sourceforge.net/openautomation/?rev=331&view=rev
Author: mayerch
Date: 2011-05-12 17:03:39 +0000 (Thu, 12 May 2011)
Log Message:
-----------
Fix bug #3300926: "Multitrigger display broken"
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-05-11 16:04:16 UTC (rev 330)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-05-12 17:03:39 UTC (rev 331)
@@ -349,8 +349,11 @@
address[ '_' + src ] = [ transform, readonly=='true' ];
});
ret_val.append( label );
+ var buttons = $('<div style="float:left"/>');
+ var buttonCount = 0;
if( $p.attr('button1label') )
{
+ //buttonCount++;
var actor = '<div class="actor switchUnpressed">';
actor += '<div class="value">' + $p.attr('button1label') + '</div>';
actor += '</div>';
@@ -361,7 +364,8 @@
'value' : $p.attr('button1value'),
'type' : 'switch'
} ).bind( 'click', this.action );
- ret_val.append( $actor );
+ buttons.append( $actor );
+ if( 1 == (buttonCount++ % 2) ) buttons.append( $('<br/>') );
}
if( $p.attr('button2label') )
{
@@ -375,7 +379,8 @@
'value' : $p.attr('button2value'),
'type' : 'switch'
} ).bind( 'click', this.action );
- ret_val.append( $actor );
+ buttons.append( $actor );
+ if( 1 == (buttonCount++ % 2) ) buttons.append( $('<br/>') );
}
if( $p.attr('button3label') )
{
@@ -389,7 +394,8 @@
'value' : $p.attr('button3value'),
'type' : 'switch'
} ).bind( 'click', this.action );
- ret_val.append( $actor );
+ buttons.append( $actor );
+ if( 1 == buttonCount++ % 2 ) buttons.append( $('<br/>') );
}
if( $p.attr('button4label') )
{
@@ -403,11 +409,12 @@
'value' : $p.attr('button4value'),
'type' : 'switch'
} ).bind( 'click', this.action );
- ret_val.append( $actor );
+ buttons.append( $actor );
+ if( 1 == buttonCount++ % 2 ) buttons.append( $('<br/>') );
}
//for( var addr in address ) $actor.bind( addr, this.update );
// ret_val.append( label ).append( $actor );
- return ret_val;
+ return ret_val.append( buttons );
},
update: function(e,d) {
var element = $(this);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-05-12 19:19:10
|
Revision: 333
http://openautomation.svn.sourceforge.net/openautomation/?rev=333&view=rev
Author: mayerch
Date: 2011-05-12 19:19:04 +0000 (Thu, 12 May 2011)
Log Message:
-----------
Test commit to check the SVN mailinglist settings.
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-05-12 18:25:06 UTC (rev 332)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-05-12 19:19:04 UTC (rev 333)
@@ -818,4 +818,5 @@
element.find('.value').text( value );
return value;
-}
\ 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...> - 2011-05-20 21:56:11
|
Revision: 339
http://openautomation.svn.sourceforge.net/openautomation/?rev=339&view=rev
Author: mayerch
Date: 2011-05-20 21:56:05 +0000 (Fri, 20 May 2011)
Log Message:
-----------
Format cleanup
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-05-18 08:34:17 UTC (rev 338)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-05-20 21:56:05 UTC (rev 339)
@@ -288,7 +288,7 @@
'styling' : $p.attr('styling'),
'on_value' : $p.attr('on_value' ) || 1,
'off_value' : $p.attr('off_value') || 0,
- 'align' : $p.attr('align'),
+ 'align' : $p.attr('align'),
'type' : 'switch'
} ).bind( 'click', this.action );
for( var addr in address ) $actor.bind( addr, this.update );
@@ -315,7 +315,7 @@
off_value: { type: 'string' , required: false },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ align: { type: 'string' , required: false }
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -446,7 +446,7 @@
button4value: { type: 'string' , required: false },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ align: { type: 'string' , required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-05-21 12:34:45
|
Revision: 340
http://openautomation.svn.sourceforge.net/openautomation/?rev=340&view=rev
Author: mayerch
Date: 2011-05-21 12:34:39 +0000 (Sat, 21 May 2011)
Log Message:
-----------
Fix switch pressed / unpressed optics when using maps
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-05-20 21:56:05 UTC (rev 339)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-05-21 12:34:39 UTC (rev 340)
@@ -288,7 +288,7 @@
'styling' : $p.attr('styling'),
'on_value' : $p.attr('on_value' ) || 1,
'off_value' : $p.attr('off_value') || 0,
- 'align' : $p.attr('align'),
+ 'align' : $p.attr('align'),
'type' : 'switch'
} ).bind( 'click', this.action );
for( var addr in address ) $actor.bind( addr, this.update );
@@ -298,7 +298,7 @@
update: function(e,d) {
var element = $(this);
var value = defaultUpdate( e, d, element );
- var off = element.data( 'off_value' );
+ var off = map( element.data( 'off_value' ), element );
element.removeClass( value == off ? 'switchPressed' : 'switchUnpressed' );
element.addClass( value == off ? 'switchUnpressed' : 'switchPressed' );
},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-06-03 22:05:51
|
Revision: 352
http://openautomation.svn.sourceforge.net/openautomation/?rev=352&view=rev
Author: mayerch
Date: 2011-06-03 22:05:45 +0000 (Fri, 03 Jun 2011)
Log Message:
-----------
Changed behaviour of the slider to not send any packets when it's changed by an external packet - even if it can't display that value
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-05-31 20:05:55 UTC (rev 351)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-06-03 22:05:45 UTC (rev 352)
@@ -222,7 +222,8 @@
'min' : min,
'max' : max,
'step' : step,
- 'type' : 'dim'
+ 'type' : 'dim',
+ 'valueInternal': true
});
for( var addr in address ) $actor.bind( addr, this.update );
$actor.slider({
@@ -242,7 +243,9 @@
if( element.data( 'value' ) != value )
{
element.data( 'value', value );
+ element.data( 'valueInternal', false );
element.slider('value', value);
+ element.data( 'valueInternal', true );
}
},
/**
@@ -251,6 +254,7 @@
slideStart:function(event,ui)
{
var actor = $( '.actor', $(this).parent() );
+ actor.data( 'valueInternal', true );
actor.data( 'updateFn', setInterval( function(){
var data = actor.data();
if( data.value == actor.slider('value') ) return;
@@ -272,7 +276,7 @@
{
var data = $(this).data();
clearInterval( data.updateFn, ui.value);
- if( data.value != ui.value )
+ if( data.valueInternal && data.value != ui.value )
for( var addr in data.address )
{
if( data.address[addr][1] == true ) continue; // skip read only
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 11:03:17
|
Revision: 447
http://openautomation.svn.sourceforge.net/openautomation/?rev=447&view=rev
Author: mayerch
Date: 2011-10-15 11:03:10 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Whitespace clean up (DON'T USE TABS!)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 10:48:18 UTC (rev 446)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 11:03:10 UTC (rev 447)
@@ -351,11 +351,11 @@
}
},
attributes: {
- on_value: { type: 'string' , required: false },
- off_value: { type: 'string' , required: false },
- mapping: { type: 'mapping' , required: false },
- styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ on_value: { type: 'string' , required: false },
+ off_value: { type: 'string' , required: false },
+ mapping: { type: 'mapping' , required: false },
+ styling: { type: 'styling' , required: false },
+ align: { type: 'string' , required: false }
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -384,11 +384,11 @@
if( $p.attr('button1label') )
{
//buttonCount++;
- var actor = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
-
+ var actor = '<div class="actor switchUnpressed ';
+ if ( $p.attr( 'align' ) )
+ actor += $p.attr( 'align' );
+ actor += '">';
+
actor += '<div class="value">' + $p.attr('button1label') + '</div>';
actor += '</div>';
var $actor = $(actor).data( {
@@ -396,18 +396,18 @@
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'value' : $p.attr('button1value'),
- 'align' : $p.attr('align'),
- 'type' : 'switch'
+ 'align' : $p.attr('align'),
+ 'type' : 'switch'
} ).bind( 'click', this.action );
buttons.append( $actor );
if( 1 == (buttonCount++ % 2) ) buttons.append( $('<br/>') );
}
if( $p.attr('button2label') )
{
- var actor = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
+ var actor = '<div class="actor switchUnpressed ';
+ if ( $p.attr( 'align' ) )
+ actor += $p.attr( 'align' );
+ actor += '">';
actor += '<div class="value">' + $p.attr('button2label') + '</div>';
actor += '</div>';
var $actor = $(actor).data( {
@@ -415,18 +415,18 @@
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'value' : $p.attr('button2value'),
- 'type' : 'switch',
- 'align' : $p.attr('align')
+ 'type' : 'switch',
+ 'align' : $p.attr('align')
} ).bind( 'click', this.action );
buttons.append( $actor );
if( 1 == (buttonCount++ % 2) ) buttons.append( $('<br/>') );
}
if( $p.attr('button3label') )
{
- var actor = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
+ var actor = '<div class="actor switchUnpressed ';
+ if ( $p.attr( 'align' ) )
+ actor += $p.attr( 'align' );
+ actor += '">';
actor += '<div class="value">' + $p.attr('button3label') + '</div>';
actor += '</div>';
var $actor = $(actor).data( {
@@ -434,17 +434,17 @@
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'value' : $p.attr('button3value'),
- 'type' : 'switch'
+ 'type' : 'switch'
} ).bind( 'click', this.action );
buttons.append( $actor );
if( 1 == buttonCount++ % 2 ) buttons.append( $('<br/>') );
}
if( $p.attr('button4label') )
{
- var actor = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
+ var actor = '<div class="actor switchUnpressed ';
+ if ( $p.attr( 'align' ) )
+ actor += $p.attr( 'align' );
+ actor += '">';
actor += '<div class="value">' + $p.attr('button4label') + '</div>';
actor += '</div>';
var $actor = $(actor).data( {
@@ -453,7 +453,7 @@
'styling' : $p.attr('styling'),
'value' : $p.attr('button4value'),
'type' : 'switch',
- } ).bind( 'click', this.action );
+ } ).bind( 'click', this.action );
buttons.append( $actor );
if( 1 == buttonCount++ % 2 ) buttons.append( $('<br/>') );
}
@@ -510,10 +510,10 @@
ga_list.push( src )
address[ '_' + src ] = [ transform, readonly=='true' ];
});
- var actor = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
+ var actor = '<div class="actor switchUnpressed ';
+ if ( $p.attr( 'align' ) )
+ actor += $p.attr( 'align' );
+ actor += '">';
var map = $p.attr('mapping');
if( mappings[map] && mappings[map][value] )
actor += '<div class="value">' + mappings[map][value] + '</div>';
@@ -525,7 +525,7 @@
'mapping' : $(page).attr('mapping'),
'styling' : $(page).attr('styling'),
'type' : 'trigger',
- 'align' : $p.attr('align'),
+ 'align' : $p.attr('align'),
'sendValue': value
} ).bind( 'click', this.action );
ret_val.append( label ).append( $actor );
@@ -543,7 +543,7 @@
value: { type: 'string' , required: true },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false },
+ align: { type: 'string' , required: false },
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -643,93 +643,93 @@
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget switch" />');
-
- // handle label
- var labelElement = $p.find('label')[0];
+
+ // handle label
+ var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
ret_val.append( label );
-
+
// handle addresses
- var address = {};
- var addrread = {};
- $p.find('address').each( function(){
+ var address = {};
+ var addrread = {};
+ $p.find('address').each( function(){
var src = this.textContent;
var transform = this.getAttribute('transform');
var readonly = this.getAttribute('readonly');
ga_list.push( src )
if (readonly=='true') {
- addrread[ '_' + src ] = [ transform, readonly=='true' ];
- } else {
- address[ '_' + src ] = [ transform, readonly=='true' ];
- };
+ addrread[ '_' + src ] = [ transform, readonly=='true' ];
+ } else {
+ address[ '_' + src ] = [ transform, readonly=='true' ];
+ };
});
-
- // create buttons + info
+
+ // create buttons + info
var buttons = $('<div style="float:left;"/>');
var buttonCount = 2;
-
- var actordown = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actordown += $p.attr( 'align' );
- actordown += '">';
- actordown += '<div class="value">' + ($p.attr('downlabel') ? $p.attr('downlabel') : '-') + '</div>';
+
+ var actordown = '<div class="actor switchUnpressed '
+ if ( $p.attr( 'align' ) )
+ actordown += $p.attr( 'align' );
+ actordown += '">';
+ actordown += '<div class="value">' + ($p.attr('downlabel') ? $p.attr('downlabel') : '-') + '</div>';
actordown += '</div>';
var $actordown = $(actordown).data( {
'address' : address,
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'value' : $p.attr('downvalue') || 0,
- 'align' : $p.attr('align'),
- 'type' : 'switch'
+ 'align' : $p.attr('align'),
+ 'type' : 'switch'
} ).bind( 'click', this.action );
-
+
var actorup = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actorup += $p.attr( 'align' );
- actorup += '">';
- actorup += '<div class="value">' + ($p.attr('uplabel') ? $p.attr('uplabel') : '+') + '</div>';
+ if ( $p.attr( 'align' ) )
+ actorup += $p.attr( 'align' );
+ actorup += '">';
+ actorup += '<div class="value">' + ($p.attr('uplabel') ? $p.attr('uplabel') : '+') + '</div>';
actorup += '</div>';
var $actorup = $(actorup).data( {
'address' : address,
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'value' : $p.attr('upvalue') || 1,
- 'align' : $p.attr('align'),
- 'type' : 'switch'
+ 'align' : $p.attr('align'),
+ 'type' : 'switch'
} ).bind( 'click', this.action );
-
+
var actorinfo = '<div class="actor switchInvisible"><div class="value">-</div></div>';
var $actorinfo = $(actorinfo).data({
'address' : addrread,
'format' : $p.attr('format'),
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
- 'align' : $p.attr('align'),
+ 'align' : $p.attr('align'),
});
- for( var addr in addrread ) $actorinfo.bind( addr, this.update );
-
- if ( $p.attr('infoposition' )==1 ) {
- buttons.append( $actordown );
- buttons.append( $actorinfo );
- buttons.append( $actorup );
- } else if ( $p.attr('infoposition' )==2 ) {
- buttons.append( $actordown );
- buttons.append( $actorup );
- buttons.append( $actorinfo );
- } else {
- buttons.append( $actorinfo );
- buttons.append( $actordown );
- buttons.append( $actorup );
- }
-
+ for( var addr in addrread ) $actorinfo.bind( addr, this.update );
+
+ if ( $p.attr('infoposition' )==1 ) {
+ buttons.append( $actordown );
+ buttons.append( $actorinfo );
+ buttons.append( $actorup );
+ } else if ( $p.attr('infoposition' )==2 ) {
+ buttons.append( $actordown );
+ buttons.append( $actorup );
+ buttons.append( $actorinfo );
+ } else {
+ buttons.append( $actorinfo );
+ buttons.append( $actordown );
+ buttons.append( $actorup );
+ }
+
ret_val.append( buttons );
- return ret_val;
+ return ret_val;
},
-
+
update: function(e,d) {
var element = $(this);
var value = defaultUpdate( e, d, element );
- element.addClass('switchInvisible');
+ element.addClass('switchInvisible');
},
action: function() {
var data = $(this).data();
@@ -746,7 +746,7 @@
downvalue: { type: 'string' , required: false },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ align: { type: 'string' , required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -768,72 +768,72 @@
this.addPopup('unknown', {
create: function( attributes ) {
- var repositon = false;
- var ret_val = $('<div class="popup" style="display:none"/><div class="popup_background" style="display:none" />').appendTo('body');
- ret_val.addClass( this.type );
+ var repositon = false;
+ var ret_val = $('<div class="popup" style="display:none"/><div class="popup_background" style="display:none" />').appendTo('body');
+ ret_val.addClass( this.type );
- if (attributes.title) {
- ret_val.filter(".popup").append( $('<div class="head" />').append(attributes.title));
- }
+ if (attributes.title) {
+ ret_val.filter(".popup").append( $('<div class="head" />').append(attributes.title));
+ }
- if( attributes.content) {
- ret_val.filter(".popup").append( $('<div class="main" />').append(attributes.content));
- }
+ if( attributes.content) {
+ ret_val.filter(".popup").append( $('<div class="main" />').append(attributes.content));
+ }
- if( attributes.width ) {
- ret_val.width( attributes.width );
- reposition = true;
- }
+ if( attributes.width ) {
+ ret_val.width( attributes.width );
+ reposition = true;
+ }
- if( attributes.height ) {
- ret_val.height( attributes.height );
- reposition = true;
- }
+ if( attributes.height ) {
+ ret_val.height( attributes.height );
+ reposition = true;
+ }
- var anchor = {x: -1, y: -1, w: 0, h: 0};
- var align;
- if( attributes.position )
- {
- if( attributes.position.offset )
- {
- var offset = attributes.position.offset();
- anchor.x = offset.left;
- anchor.y = offset.top;
- anchor.w = attributes.position.width();
- anchor.h = attributes.position.height();
- } else {
- if( attributes.position.hasOwnProperty('x') ) anchor.x = attributes.position.x;
- if( attributes.position.hasOwnProperty('y') ) anchor.y = attributes.position.y;
- if( attributes.position.hasOwnProperty('w') ) anchor.w = attributes.position.w;
- if( attributes.position.hasOwnProperty('h') ) anchor.h = attributes.position.h;
- if( anchor.w == 0 && anchor.h == 0 ) align = 5;
- }
- }
- if( attributes.align !== undefined ) align = attributes.align;
- var placement = placementStrategy(
- anchor,
- { w:ret_val.outerWidth(), h:ret_val.outerHeight() },
- { w:$(window).width() , h:$(window).height() },
- align
- );
- ret_val.css( 'left', placement.x );
- ret_val.css( 'top' , placement.y );
-
- ret_val.bind("click", function() {
- ret_val.remove();
- return false;
- })
+ var anchor = {x: -1, y: -1, w: 0, h: 0};
+ var align;
+ if( attributes.position )
+ {
+ if( attributes.position.offset )
+ {
+ var offset = attributes.position.offset();
+ anchor.x = offset.left;
+ anchor.y = offset.top;
+ anchor.w = attributes.position.width();
+ anchor.h = attributes.position.height();
+ } else {
+ if( attributes.position.hasOwnProperty('x') ) anchor.x = attributes.position.x;
+ if( attributes.position.hasOwnProperty('y') ) anchor.y = attributes.position.y;
+ if( attributes.position.hasOwnProperty('w') ) anchor.w = attributes.position.w;
+ if( attributes.position.hasOwnProperty('h') ) anchor.h = attributes.position.h;
+ if( anchor.w == 0 && anchor.h == 0 ) align = 5;
+ }
+ }
+ if( attributes.align !== undefined ) align = attributes.align;
+ var placement = placementStrategy(
+ anchor,
+ { w:ret_val.outerWidth(), h:ret_val.outerHeight() },
+ { w:$(window).width() , h:$(window).height() },
+ align
+ );
+ ret_val.css( 'left', placement.x );
+ ret_val.css( 'top' , placement.y );
- ret_val.css( 'display', 'block' );
- return ret_val;
- },
+ ret_val.bind("click", function() {
+ ret_val.remove();
+ return false;
+ });
+
+ ret_val.css( 'display', 'block' );
+ return ret_val;
+ },
attributes: {
- title: {type: 'string', required: false},
- content: {type: 'string', required: false},
- width: {type: 'string', required: false},
- height: {type: 'string', required: false},
- position: {type: 'object', required: false} // either {x:,y:} or an jQuery object
- }
+ title: {type: 'string', required: false},
+ content: {type: 'string', required: false},
+ width: {type: 'string', required: false},
+ height: {type: 'string', required: false},
+ position: {type: 'object', required: false} // either {x:,y:} or an jQuery object
+ }
});
this.addPopup('info' , $.extend(true, {}, this.getPopup('unknown')) );
@@ -966,7 +966,7 @@
if( element.data( 'align' ) )
element.addClass(element.data( 'align' ) );
-
+
if( element.data( 'precision' ) )
value = Number( value ).toPrecision( element.data( 'precision' ) );
if( element.data( 'format' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 21:25:32
|
Revision: 449
http://openautomation.svn.sourceforge.net/openautomation/?rev=449&view=rev
Author: mayerch
Date: 2011-10-15 21:25:26 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Show infoposition attribute of the infotrigger in the editor
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 16:00:41 UTC (rev 448)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 21:25:26 UTC (rev 449)
@@ -746,7 +746,8 @@
downvalue: { type: 'string' , required: false },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ align: { type: 'string' , required: false },
+ infoposition: { type: 'numeric' , required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 21:34:52
|
Revision: 450
http://openautomation.svn.sourceforge.net/openautomation/?rev=450&view=rev
Author: mayerch
Date: 2011-10-15 21:34:46 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Show format attribute of the infotrigger in the editor
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 21:25:26 UTC (rev 449)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 21:34:46 UTC (rev 450)
@@ -747,7 +747,8 @@
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
align: { type: 'string' , required: false },
- infoposition: { type: 'numeric' , required: false }
+ infoposition: { type: 'numeric' , required: false },
+ format: { type: 'string' , required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-20 20:47:37
|
Revision: 456
http://openautomation.svn.sourceforge.net/openautomation/?rev=456&view=rev
Author: mayerch
Date: 2011-10-20 20:47:31 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
Selection list for multitrigger layout and preparation for relative mode
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-19 15:24:07 UTC (rev 455)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-20 20:47:31 UTC (rev 456)
@@ -747,8 +747,9 @@
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
align: { type: 'string' , required: false },
- infoposition: { type: 'numeric' , required: false },
- format: { type: 'string' , required: false }
+ infoposition: { type: 'list' , required: true , list: {0: 'Info/Down/Up', 1: 'Down/Info/Up', 2: 'Down/Up/Info'} },
+ format: { type: 'string' , required: false },
+ change: { type: 'list' , required: true , list: {'relative': 'relative', 'absolute': 'absolute'} }
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-20 21:06:36
|
Revision: 458
http://openautomation.svn.sourceforge.net/openautomation/?rev=458&view=rev
Author: mayerch
Date: 2011-10-20 21:06:30 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
Initial implementation of absolute value change for infotrigger. Highly untested!!!
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-20 20:57:33 UTC (rev 457)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-20 21:06:30 UTC (rev 458)
@@ -733,10 +733,16 @@
},
action: function() {
var data = $(this).data();
+ var value = $(this).parent().find('.switchInvisible').data('basicvalue');
for( var addr in data.address )
{
if( data.address[addr][1] == true ) continue; // skip read only
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value ) );
+ if( data.change == 'absolute' )
+ {
+ visu.write( addr.substr(1), transformEncode( data.address[addr][0], value + data.value ) );
+ } else {
+ visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value ) );
+ }
}
},
attributes: {
@@ -970,6 +976,7 @@
if( element.data( 'align' ) )
element.addClass(element.data( 'align' ) );
+ element.data( 'basicvalue', value );
if( element.data( 'precision' ) )
value = Number( value ).toPrecision( element.data( 'precision' ) );
if( element.data( 'format' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-20 23:12:19
|
Revision: 459
http://openautomation.svn.sourceforge.net/openautomation/?rev=459&view=rev
Author: makki1
Date: 2011-10-20 23:12:13 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
small fixes on infotrigger with realtive values
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-20 21:06:30 UTC (rev 458)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-20 23:12:13 UTC (rev 459)
@@ -680,6 +680,7 @@
'styling' : $p.attr('styling'),
'value' : $p.attr('downvalue') || 0,
'align' : $p.attr('align'),
+ 'change' : $p.attr('change'),
'type' : 'switch'
} ).bind( 'click', this.action );
@@ -695,6 +696,7 @@
'styling' : $p.attr('styling'),
'value' : $p.attr('upvalue') || 1,
'align' : $p.attr('align'),
+ 'change' : $p.attr('change'),
'type' : 'switch'
} ).bind( 'click', this.action );
@@ -733,13 +735,13 @@
},
action: function() {
var data = $(this).data();
- var value = $(this).parent().find('.switchInvisible').data('basicvalue');
+ var value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
for( var addr in data.address )
{
if( data.address[addr][1] == true ) continue; // skip read only
- if( data.change == 'absolute' )
+ if( data.change == 'relative' )
{
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], value + data.value ) );
+ visu.write( addr.substr(1), transformEncode( data.address[addr][0], value + parseFloat(data.value) ) );
} else {
visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value ) );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-22 20:57:50
|
Revision: 466
http://openautomation.svn.sourceforge.net/openautomation/?rev=466&view=rev
Author: mayerch
Date: 2011-10-22 20:57:43 +0000 (Sat, 22 Oct 2011)
Log Message:
-----------
Cleaned up relative (i.e. sending the delta values) and absolute (i.e. sending the resulting new value)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-22 20:16:45 UTC (rev 465)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-22 20:57:43 UTC (rev 466)
@@ -744,7 +744,7 @@
'styling' : $p.attr('styling'),
'value' : $p.attr('downvalue') || 0,
'align' : $p.attr('align'),
- 'change' : $p.attr('change') || 'absolute',
+ 'change' : $p.attr('change') || 'relative',
'min' : parseFloat($p.attr('min')) || 0,
'max' : parseFloat($p.attr('max')) || 255,
'type' : 'switch'
@@ -762,7 +762,7 @@
'styling' : $p.attr('styling'),
'value' : $p.attr('upvalue') || 1,
'align' : $p.attr('align'),
- 'change' : $p.attr('change') || 'absolute',
+ 'change' : $p.attr('change') || 'relative',
'min' : parseFloat($p.attr('min')) || 0,
'max' : parseFloat($p.attr('max')) || 255,
'type' : 'switch'
@@ -804,14 +804,14 @@
action: function() {
var data = $(this).data();
var value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
- var relativevalue = value + parseFloat(data.value);
+ var absoluteValue = value + parseFloat(data.value);
for( var addr in data.address )
{
if( data.address[addr][1] == true ) continue; // skip read only
- if( data.change == 'relative' )
+ if( data.change == 'absolute' )
{
- if (relativevalue < data.min || relativevalue > data.max) continue; // check min/max
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], relativevalue ) );
+ if (absoluteValue < data.min || data.max < absoluteValue) continue; // check min/max
+ visu.write( addr.substr(1), transformEncode( data.address[addr][0], absoluteValue ) );
} else {
visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value ) );
}
@@ -827,7 +827,7 @@
align: { type: 'string' , required: false },
infoposition: { type: 'list' , required: true , list: {0: 'Info/Down/Up', 1: 'Down/Info/Up', 2: 'Down/Up/Info'} },
format: { type: 'string' , required: false },
- change: { type: 'list' , required: false , list: {'relative': 'relative', 'absolute': 'absolute'} },
+ change: { type: 'list' , required: false , list: {'relative': 'Send relative/delta values', 'absolute': 'Send absolute values'} },
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...> - 2011-10-30 14:10:59
|
Revision: 481
http://openautomation.svn.sourceforge.net/openautomation/?rev=481&view=rev
Author: mayerch
Date: 2011-10-30 14:10:53 +0000 (Sun, 30 Oct 2011)
Log Message:
-----------
Change infotrigger to use variant=absolute or relative in the addresses to determine where a delta value should be sent to and which is the info address when used in the relative mode.
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-30 11:50:17 UTC (rev 480)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-30 14:10:53 UTC (rev 481)
@@ -715,16 +715,14 @@
// handle addresses
var address = {};
- var addrread = {};
$p.find('address').each( function(){
var src = this.textContent;
var transform = this.getAttribute('transform');
- var readonly = this.getAttribute('readonly');
- ga_list.push( src )
- if (readonly=='true') {
- addrread[ '_' + src ] = [ transform, readonly=='true' ];
- } else {
- address[ '_' + src ] = [ transform, readonly=='true' ];
+ var readonly = this.getAttribute('readonly' ) == 'true' ;
+ var relative = this.getAttribute('variant' ) == 'relative';
+ address[ '_' + src ] = [ transform, readonly, relative ];
+ if( !relative ) { // no need to listen to relative address
+ ga_list.push( src );
};
});
@@ -773,13 +771,17 @@
actorinfo += 'style="text-align: '+$p.attr( 'align' )+'" ';
actorinfo += '" ><div class="value">-</div></div>';
var $actorinfo = $(actorinfo).data({
- 'address' : addrread,
+ 'address' : address,
'format' : $p.attr('format'),
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'align' : $p.attr('align'),
});
- for( var addr in addrread ) $actorinfo.bind( addr, this.update );
+ for( var addr in address )
+ {
+ if( !address[addr][2] ) // if NOT relative
+ $actorinfo.bind( addr, this.update );
+ }
if ( $p.attr('infoposition' )==1 ) {
buttons.append( $actordown );
@@ -806,18 +808,19 @@
},
action: function() {
var data = $(this).data();
- var value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
- var absoluteValue = value + parseFloat(data.value);
+ var value = data.value;
+ var relative = ( data.change != 'absolute' );
+ if( !relative )
+ {
+ value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
+ value = value + parseFloat(data.value);
+ if (value < data.min || data.max < value) return; // check min/max
+ }
for( var addr in data.address )
{
if( data.address[addr][1] == true ) continue; // skip read only
- if( data.change == 'absolute' )
- {
- if (absoluteValue < data.min || data.max < absoluteValue) continue; // check min/max
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], absoluteValue ) );
- } else {
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value ) );
- }
+ if( data.address[addr][2] != relative ) continue; // skip when address mode doesn't fit action mode
+ visu.write( addr.substr(1), transformEncode( data.address[addr][0], value ) );
}
},
attributes: {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-31 17:07:12
|
Revision: 487
http://openautomation.svn.sourceforge.net/openautomation/?rev=487&view=rev
Author: mayerch
Date: 2011-10-31 17:07:05 +0000 (Mon, 31 Oct 2011)
Log Message:
-----------
Useability fix: add a button movement "animation" to the triggers so that a user has immediate feedback
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-31 13:33:40 UTC (rev 486)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-31 17:07:05 UTC (rev 487)
@@ -591,7 +591,11 @@
'type' : 'trigger',
'align' : $p.attr('align'),
'sendValue': value
- } ).bind( 'click', this.action );
+ } ).bind( 'click', this.action ).bind( 'mousedown', function(){
+ $(this).removeClass('switchUnpressed').addClass('switchPressed');
+ } ).bind( 'mouseup mouseout', function(){ // not perfect but simple
+ $(this).removeClass('switchPressed').addClass('switchUnpressed');
+ } );
ret_val.append( label ).append( $actor );
return ret_val;
},
@@ -746,7 +750,11 @@
'min' : parseFloat($p.attr('min')) || 0,
'max' : parseFloat($p.attr('max')) || 255,
'type' : 'switch'
- } ).bind( 'click', this.action );
+ } ).bind( 'click', this.action ).bind( 'mousedown', function(){
+ $(this).removeClass('switchUnpressed').addClass('switchPressed');
+ } ).bind( 'mouseup mouseout', function(){ // not perfect but simple
+ $(this).removeClass('switchPressed').addClass('switchUnpressed');
+ } );
var actorup = '<div class="actor switchUnpressed '
if ( $p.attr( 'align' ) )
@@ -764,7 +772,11 @@
'min' : parseFloat($p.attr('min')) || 0,
'max' : parseFloat($p.attr('max')) || 255,
'type' : 'switch'
- } ).bind( 'click', this.action );
+ } ).bind( 'click', this.action ).bind( 'mousedown', function(){
+ $(this).removeClass('switchUnpressed').addClass('switchPressed');
+ } ).bind( 'mouseup mouseout', function(){ // not perfect but simple
+ $(this).removeClass('switchPressed').addClass('switchUnpressed');
+ } );
var actorinfo = '<div class="actor switchInvisible" ';
if ( $p.attr( 'align' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|