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...> - 2011-01-16 12:53:20
|
Revision: 255
http://openautomation.svn.sourceforge.net/openautomation/?rev=255&view=rev
Author: mayerch
Date: 2011-01-16 12:53:14 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
Fix: compare bottom right corner for canvas resize (and not top left...)
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/logicEditor.js
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 12:44:54 UTC (rev 254)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 12:53:14 UTC (rev 255)
@@ -146,7 +146,7 @@
var c = getCoordinate( {pageX: ui.position.left, pageY: ui.position.top} );
var data = $.extend( true, c, ui.draggable.data('element') );
drawElement( $('#editor').svg('get'), data );
- editorResize( c );
+ editorResize( { x: c.x + data.width, y: c.y + data.height } );
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-16 12:45:00
|
Revision: 254
http://openautomation.svn.sourceforge.net/openautomation/?rev=254&view=rev
Author: mayerch
Date: 2011-01-16 12:44:54 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
Automatically resize the canvas when a new block is dropped on the border
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/logicEditor.js
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 12:23:36 UTC (rev 253)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 12:44:54 UTC (rev 254)
@@ -20,7 +20,7 @@
// global variables
var overPort = false;
var connectionLookingForInPort = true; // only relevant in connection drawing mode
-var maxX = 500; // the biggest x value of the current view
+var maxX = 0; // the biggest x value of the current view
var maxY = 0; // the biggest y value of the current view
$(function() {
@@ -28,8 +28,8 @@
applyDefaultStyles: false,
center__onresize: function( name, element, state ){
var editor = element.find('svg')[0];
- editor.width.baseVal.value = Math.max( maxX, state.innerWidth-2 );
- editor.height.baseVal.value = Math.max( maxY, state.innerHeight-2 );
+ editor.width.baseVal.value = Math.max( maxX, state.innerWidth );
+ editor.height.baseVal.value = Math.max( maxY, state.innerHeight );
},
north__closable: false,
north__resizable: false
@@ -146,6 +146,7 @@
var c = getCoordinate( {pageX: ui.position.left, pageY: ui.position.top} );
var data = $.extend( true, c, ui.draggable.data('element') );
drawElement( $('#editor').svg('get'), data );
+ editorResize( c );
}
}
@@ -157,6 +158,34 @@
element.setAttribute( 'class', element.getAttribute( 'class' ) + ' selected' );
}
+/**
+ * Iterate over all blocks to make sure the editor is big enough
+ * The optional parameter "test" allows to bypass the resize if it's not
+ * necessary, i.e. the test.{xy} fits into the current canvas
+ */
+function editorResize( test )
+{
+ var extraSpace = 20; // a bit more space, e.g. for scroll bars
+
+ if( test !== undefined &&
+ test.x + extraSpace <= maxX && test.y + extraSpace <= maxY )
+ return;
+
+ maxX = 0;
+ maxY = 0;
+ $.each( blockRegistry, function(){
+ var x = this.getX() + this.getWidth();
+ var y = this.getY() + this.getHeight();
+ if( x > maxX ) maxX = x;
+ if( y > maxY ) maxY = y;
+ });
+ maxX += extraSpace; maxY += extraSpace;
+ var editor = $('#editor');
+ var svg = $('#editor svg')[0];
+ svg.width.baseVal.value = Math.max( maxX, editor.innerWidth() );
+ svg.height.baseVal.value = Math.max( maxY, editor.innerHeight() );
+}
+
jQuery(document).ready(function(){
getCoordinate = (function()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-16 12:23:42
|
Revision: 253
http://openautomation.svn.sourceforge.net/openautomation/?rev=253&view=rev
Author: mayerch
Date: 2011-01-16 12:23:36 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
* Changed tree view to use only local icons
* Added correctly sized (= 16x16) block icon
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/logicEditor.js
Added Paths:
-----------
PyWireGate/trunk/logic_editor/icon/16/
PyWireGate/trunk/logic_editor/icon/16/code-block.png
Added: PyWireGate/trunk/logic_editor/icon/16/code-block.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/16/code-block.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 12:17:49 UTC (rev 252)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 12:23:36 UTC (rev 253)
@@ -39,27 +39,27 @@
json_data : {
data : [
{
- data : "A node",
+ data : 'System 1',
attr : { rel : 'logic' },
children : [
{
- data: 'My Child',
+ data: 'Subsystem 1',
attr: { rel: 'subsystem' },
children : [
{
- data: 'My second child',
+ data: 'Subsubsystem',
attr: { rel: 'subsystem' }
}
]
},
- "Child 1",
- "Child 2"
+ 'Subsystem 2',
+ 'Subsystem 3'
]
},
{
attr : { rel : 'logic' },
data : {
- title : "Long format demo",
+ title : 'System 2',
attr : { href : "#" }
}
}
@@ -72,8 +72,8 @@
},
types: {
types: {
- logic : { icon: { image: "http://static.jstree.com/v.1.0rc/_docs/_drive.png" } },
- subsystem: { icon: { image: "http://static.jstree.com/v.1.0rc/_docs/syntax/help.png" } }
+ logic : { icon: { image: 'icon/16/code-block.png' } },
+ subsystem: { icon: { image: 'icon/16/code-block.png' } }
}
}
});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-16 12:17:56
|
Revision: 252
http://openautomation.svn.sourceforge.net/openautomation/?rev=252&view=rev
Author: mayerch
Date: 2011-01-16 12:17:49 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
Move icons to size dependand subdir
Added Paths:
-----------
PyWireGate/trunk/logic_editor/icon/32/
PyWireGate/trunk/logic_editor/icon/32/align-horizontal-center.png
PyWireGate/trunk/logic_editor/icon/32/align-horizontal-left.png
PyWireGate/trunk/logic_editor/icon/32/align-horizontal-right.png
PyWireGate/trunk/logic_editor/icon/32/align-vertical-bottom.png
PyWireGate/trunk/logic_editor/icon/32/align-vertical-center.png
PyWireGate/trunk/logic_editor/icon/32/align-vertical-top.png
PyWireGate/trunk/logic_editor/icon/32/application-exit.png
PyWireGate/trunk/logic_editor/icon/32/checkbox.png
PyWireGate/trunk/logic_editor/icon/32/chronometer.png
PyWireGate/trunk/logic_editor/icon/32/code-block.png
PyWireGate/trunk/logic_editor/icon/32/code-class.png
PyWireGate/trunk/logic_editor/icon/32/code-context.png
PyWireGate/trunk/logic_editor/icon/32/code-function.png
PyWireGate/trunk/logic_editor/icon/32/code-typedef.png
PyWireGate/trunk/logic_editor/icon/32/code-variable.png
PyWireGate/trunk/logic_editor/icon/32/configure.png
PyWireGate/trunk/logic_editor/icon/32/dialog-cancel.png
PyWireGate/trunk/logic_editor/icon/32/dialog-close.png
PyWireGate/trunk/logic_editor/icon/32/dialog-ok-apply.png
PyWireGate/trunk/logic_editor/icon/32/dialog-ok.png
PyWireGate/trunk/logic_editor/icon/32/distribute-horizontal-center.png
PyWireGate/trunk/logic_editor/icon/32/distribute-vertical-center.png
PyWireGate/trunk/logic_editor/icon/32/document-close.png
PyWireGate/trunk/logic_editor/icon/32/document-new.png
PyWireGate/trunk/logic_editor/icon/32/document-save.png
PyWireGate/trunk/logic_editor/icon/32/edit-bomb.png
PyWireGate/trunk/logic_editor/icon/32/edit-cut.png
PyWireGate/trunk/logic_editor/icon/32/edit-delete.png
PyWireGate/trunk/logic_editor/icon/32/edit-find.png
PyWireGate/trunk/logic_editor/icon/32/edit-select.png
PyWireGate/trunk/logic_editor/icon/32/edit-undo.png
PyWireGate/trunk/logic_editor/icon/32/format-add-node.png
PyWireGate/trunk/logic_editor/icon/32/format-break-node.png
PyWireGate/trunk/logic_editor/icon/32/format-join-node.png
PyWireGate/trunk/logic_editor/icon/32/format-remove-node.png
PyWireGate/trunk/logic_editor/icon/32/help-about.png
PyWireGate/trunk/logic_editor/icon/32/help-hint.png
PyWireGate/trunk/logic_editor/icon/32/object-flip-horizontal.png
PyWireGate/trunk/logic_editor/icon/32/object-flip-vertical.png
PyWireGate/trunk/logic_editor/icon/32/object-rotate-left.png
PyWireGate/trunk/logic_editor/icon/32/object-rotate-right.png
PyWireGate/trunk/logic_editor/icon/32/process-stop.png
PyWireGate/trunk/logic_editor/icon/32/view-refresh.png
PyWireGate/trunk/logic_editor/icon/32/view-statistics.png
PyWireGate/trunk/logic_editor/icon/32/window-close.png
PyWireGate/trunk/logic_editor/icon/32/zoom-in.png
PyWireGate/trunk/logic_editor/icon/32/zoom-original.png
PyWireGate/trunk/logic_editor/icon/32/zoom-out.png
Removed Paths:
-------------
PyWireGate/trunk/logic_editor/icon/align-horizontal-center.png
PyWireGate/trunk/logic_editor/icon/align-horizontal-left.png
PyWireGate/trunk/logic_editor/icon/align-horizontal-right.png
PyWireGate/trunk/logic_editor/icon/align-vertical-bottom.png
PyWireGate/trunk/logic_editor/icon/align-vertical-center.png
PyWireGate/trunk/logic_editor/icon/align-vertical-top.png
PyWireGate/trunk/logic_editor/icon/application-exit.png
PyWireGate/trunk/logic_editor/icon/checkbox.png
PyWireGate/trunk/logic_editor/icon/chronometer.png
PyWireGate/trunk/logic_editor/icon/code-block.png
PyWireGate/trunk/logic_editor/icon/code-class.png
PyWireGate/trunk/logic_editor/icon/code-context.png
PyWireGate/trunk/logic_editor/icon/code-function.png
PyWireGate/trunk/logic_editor/icon/code-typedef.png
PyWireGate/trunk/logic_editor/icon/code-variable.png
PyWireGate/trunk/logic_editor/icon/configure.png
PyWireGate/trunk/logic_editor/icon/dialog-cancel.png
PyWireGate/trunk/logic_editor/icon/dialog-close.png
PyWireGate/trunk/logic_editor/icon/dialog-ok-apply.png
PyWireGate/trunk/logic_editor/icon/dialog-ok.png
PyWireGate/trunk/logic_editor/icon/distribute-horizontal-center.png
PyWireGate/trunk/logic_editor/icon/distribute-vertical-center.png
PyWireGate/trunk/logic_editor/icon/document-close.png
PyWireGate/trunk/logic_editor/icon/document-new.png
PyWireGate/trunk/logic_editor/icon/document-save.png
PyWireGate/trunk/logic_editor/icon/edit-bomb.png
PyWireGate/trunk/logic_editor/icon/edit-cut.png
PyWireGate/trunk/logic_editor/icon/edit-delete.png
PyWireGate/trunk/logic_editor/icon/edit-find.png
PyWireGate/trunk/logic_editor/icon/edit-select.png
PyWireGate/trunk/logic_editor/icon/edit-undo.png
PyWireGate/trunk/logic_editor/icon/format-add-node.png
PyWireGate/trunk/logic_editor/icon/format-break-node.png
PyWireGate/trunk/logic_editor/icon/format-join-node.png
PyWireGate/trunk/logic_editor/icon/format-remove-node.png
PyWireGate/trunk/logic_editor/icon/help-about.png
PyWireGate/trunk/logic_editor/icon/help-hint.png
PyWireGate/trunk/logic_editor/icon/object-flip-horizontal.png
PyWireGate/trunk/logic_editor/icon/object-flip-vertical.png
PyWireGate/trunk/logic_editor/icon/object-rotate-left.png
PyWireGate/trunk/logic_editor/icon/object-rotate-right.png
PyWireGate/trunk/logic_editor/icon/process-stop.png
PyWireGate/trunk/logic_editor/icon/view-refresh.png
PyWireGate/trunk/logic_editor/icon/view-statistics.png
PyWireGate/trunk/logic_editor/icon/window-close.png
PyWireGate/trunk/logic_editor/icon/zoom-in.png
PyWireGate/trunk/logic_editor/icon/zoom-original.png
PyWireGate/trunk/logic_editor/icon/zoom-out.png
Copied: PyWireGate/trunk/logic_editor/icon/32/align-horizontal-center.png (from rev 243, PyWireGate/trunk/logic_editor/icon/align-horizontal-center.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/align-horizontal-left.png (from rev 243, PyWireGate/trunk/logic_editor/icon/align-horizontal-left.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/align-horizontal-right.png (from rev 243, PyWireGate/trunk/logic_editor/icon/align-horizontal-right.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/align-vertical-bottom.png (from rev 243, PyWireGate/trunk/logic_editor/icon/align-vertical-bottom.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/align-vertical-center.png (from rev 243, PyWireGate/trunk/logic_editor/icon/align-vertical-center.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/align-vertical-top.png (from rev 243, PyWireGate/trunk/logic_editor/icon/align-vertical-top.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/application-exit.png (from rev 243, PyWireGate/trunk/logic_editor/icon/application-exit.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/checkbox.png (from rev 243, PyWireGate/trunk/logic_editor/icon/checkbox.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/chronometer.png (from rev 243, PyWireGate/trunk/logic_editor/icon/chronometer.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/code-block.png (from rev 243, PyWireGate/trunk/logic_editor/icon/code-block.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/code-class.png (from rev 243, PyWireGate/trunk/logic_editor/icon/code-class.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/code-context.png (from rev 243, PyWireGate/trunk/logic_editor/icon/code-context.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/code-function.png (from rev 243, PyWireGate/trunk/logic_editor/icon/code-function.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/code-typedef.png (from rev 243, PyWireGate/trunk/logic_editor/icon/code-typedef.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/code-variable.png (from rev 243, PyWireGate/trunk/logic_editor/icon/code-variable.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/configure.png (from rev 243, PyWireGate/trunk/logic_editor/icon/configure.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/dialog-cancel.png (from rev 243, PyWireGate/trunk/logic_editor/icon/dialog-cancel.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/dialog-close.png (from rev 243, PyWireGate/trunk/logic_editor/icon/dialog-close.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/dialog-ok-apply.png (from rev 243, PyWireGate/trunk/logic_editor/icon/dialog-ok-apply.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/dialog-ok.png (from rev 243, PyWireGate/trunk/logic_editor/icon/dialog-ok.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/distribute-horizontal-center.png (from rev 243, PyWireGate/trunk/logic_editor/icon/distribute-horizontal-center.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/distribute-vertical-center.png (from rev 243, PyWireGate/trunk/logic_editor/icon/distribute-vertical-center.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/document-close.png (from rev 243, PyWireGate/trunk/logic_editor/icon/document-close.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/document-new.png (from rev 243, PyWireGate/trunk/logic_editor/icon/document-new.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/document-save.png (from rev 243, PyWireGate/trunk/logic_editor/icon/document-save.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/edit-bomb.png (from rev 243, PyWireGate/trunk/logic_editor/icon/edit-bomb.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/edit-cut.png (from rev 243, PyWireGate/trunk/logic_editor/icon/edit-cut.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/edit-delete.png (from rev 243, PyWireGate/trunk/logic_editor/icon/edit-delete.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/edit-find.png (from rev 243, PyWireGate/trunk/logic_editor/icon/edit-find.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/edit-select.png (from rev 243, PyWireGate/trunk/logic_editor/icon/edit-select.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/edit-undo.png (from rev 243, PyWireGate/trunk/logic_editor/icon/edit-undo.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/format-add-node.png (from rev 243, PyWireGate/trunk/logic_editor/icon/format-add-node.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/format-break-node.png (from rev 243, PyWireGate/trunk/logic_editor/icon/format-break-node.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/format-join-node.png (from rev 243, PyWireGate/trunk/logic_editor/icon/format-join-node.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/format-remove-node.png (from rev 243, PyWireGate/trunk/logic_editor/icon/format-remove-node.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/help-about.png (from rev 243, PyWireGate/trunk/logic_editor/icon/help-about.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/help-hint.png (from rev 243, PyWireGate/trunk/logic_editor/icon/help-hint.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/object-flip-horizontal.png (from rev 243, PyWireGate/trunk/logic_editor/icon/object-flip-horizontal.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/object-flip-vertical.png (from rev 243, PyWireGate/trunk/logic_editor/icon/object-flip-vertical.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/object-rotate-left.png (from rev 243, PyWireGate/trunk/logic_editor/icon/object-rotate-left.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/object-rotate-right.png (from rev 243, PyWireGate/trunk/logic_editor/icon/object-rotate-right.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/process-stop.png (from rev 243, PyWireGate/trunk/logic_editor/icon/process-stop.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/view-refresh.png (from rev 243, PyWireGate/trunk/logic_editor/icon/view-refresh.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/view-statistics.png (from rev 243, PyWireGate/trunk/logic_editor/icon/view-statistics.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/window-close.png (from rev 243, PyWireGate/trunk/logic_editor/icon/window-close.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/zoom-in.png (from rev 243, PyWireGate/trunk/logic_editor/icon/zoom-in.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/zoom-original.png (from rev 243, PyWireGate/trunk/logic_editor/icon/zoom-original.png)
===================================================================
(Binary files differ)
Copied: PyWireGate/trunk/logic_editor/icon/32/zoom-out.png (from rev 243, PyWireGate/trunk/logic_editor/icon/zoom-out.png)
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/align-horizontal-center.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/align-horizontal-left.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/align-horizontal-right.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/align-vertical-bottom.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/align-vertical-center.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/align-vertical-top.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/application-exit.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/checkbox.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/chronometer.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/code-block.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/code-class.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/code-context.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/code-function.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/code-typedef.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/code-variable.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/configure.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/dialog-cancel.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/dialog-close.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/dialog-ok-apply.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/dialog-ok.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/distribute-horizontal-center.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/distribute-vertical-center.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/document-close.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/document-new.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/document-save.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/edit-bomb.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/edit-cut.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/edit-delete.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/edit-find.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/edit-select.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/edit-undo.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/format-add-node.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/format-break-node.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/format-join-node.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/format-remove-node.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/help-about.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/help-hint.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/object-flip-horizontal.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/object-flip-vertical.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/object-rotate-left.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/object-rotate-right.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/process-stop.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/view-refresh.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/view-statistics.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/window-close.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/zoom-in.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/zoom-original.png
===================================================================
(Binary files differ)
Deleted: PyWireGate/trunk/logic_editor/icon/zoom-out.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-16 11:51:13
|
Revision: 251
http://openautomation.svn.sourceforge.net/openautomation/?rev=251&view=rev
Author: mayerch
Date: 2011-01-16 11:51:06 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
Correctly handle a scrolled working pane by using the new universal getCoordinate
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/gle/gle.block.js
PyWireGate/trunk/logic_editor/logicEditor.js
Modified: PyWireGate/trunk/logic_editor/gle/gle.block.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-15 22:38:32 UTC (rev 250)
+++ PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-16 11:51:06 UTC (rev 251)
@@ -335,10 +335,8 @@
function editorConnectionPointMouseMove( event )
{
- //console.log( event.data.con );
- var x = event.pageX - $('#editor')[0].offsetLeft;
- var y = event.pageY - $('#editor')[0].offsetTop;
- event.data.con.lastMove( [x, y] );
+ var c = getCoordinate( event );
+ event.data.con.lastMove( [c.x, c.y] );
}
function editorConnectionPointMouseUp( event )
@@ -364,11 +362,10 @@
number: event.data.portNumber
};
} else {
- var ex = event.pageX - $('#editor')[0].offsetLeft;
- var ey = event.pageY - $('#editor')[0].offsetTop;
+ var c = getCoordinate( event );
var distance = function( pos )
{
- return (ex-pos[0])*(ex-pos[0]) + (ey-pos[1])*(ey-pos[1]);
+ return (c.x-pos[0])*(c.x-pos[0]) + (c.y-pos[1])*(c.y-pos[1]);
}
if( connectionLookingForInPort )
{
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-15 22:38:32 UTC (rev 250)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 11:51:06 UTC (rev 251)
@@ -143,11 +143,9 @@
{
if( ui.draggable.data('element') )
{
- var svg = $('#editor').svg('get');
- var x = ui.position.left - this.offsetLeft;
- var y = ui.position.top - this.offsetTop ;
- var data = $.extend( true, {x:x, y:y}, ui.draggable.data('element') );
- drawElement( svg, data );
+ var c = getCoordinate( {pageX: ui.position.left, pageY: ui.position.top} );
+ var data = $.extend( true, c, ui.draggable.data('element') );
+ drawElement( $('#editor').svg('get'), data );
}
}
@@ -162,10 +160,11 @@
jQuery(document).ready(function(){
getCoordinate = (function()
{
- var svg = $('#editor svg'); // quasi static variable
+ var editor = $('#editor'); // quasi static variable
return function( event ) {
- var o = svg.offset();
- return {x: event.pageX - o.left, y: event.pageY - o.top};
+ var o = editor.offset();
+ return {x: event.pageX - o.left + editor.scrollLeft(),
+ y: event.pageY - o.top + editor.scrollTop () };
};
})();
});
\ 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-01-15 22:38:38
|
Revision: 250
http://openautomation.svn.sourceforge.net/openautomation/?rev=250&view=rev
Author: mayerch
Date: 2011-01-15 22:38:32 +0000 (Sat, 15 Jan 2011)
Log Message:
-----------
bug fix: scope was too narrow
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/logicEditor.js
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-15 22:34:27 UTC (rev 249)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-15 22:38:32 UTC (rev 250)
@@ -160,7 +160,7 @@
}
jQuery(document).ready(function(){
- var getCoordinate = (function()
+ getCoordinate = (function()
{
var svg = $('#editor svg'); // quasi static variable
return function( event ) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-15 22:34:33
|
Revision: 249
http://openautomation.svn.sourceforge.net/openautomation/?rev=249&view=rev
Author: mayerch
Date: 2011-01-15 22:34:27 +0000 (Sat, 15 Jan 2011)
Log Message:
-----------
New function that gives the current coordinate based on the event object that is passed as an parameter.
This will be extended later when the zooming functionality gets implemented
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/logicEditor.js
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-14 23:50:58 UTC (rev 248)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-15 22:34:27 UTC (rev 249)
@@ -158,3 +158,14 @@
});
element.setAttribute( 'class', element.getAttribute( 'class' ) + ' selected' );
}
+
+jQuery(document).ready(function(){
+ var getCoordinate = (function()
+ {
+ var svg = $('#editor svg'); // quasi static variable
+ return function( event ) {
+ var o = svg.offset();
+ return {x: event.pageX - o.left, y: event.pageY - o.top};
+ };
+ })();
+});
\ 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-01-14 23:51:04
|
Revision: 248
http://openautomation.svn.sourceforge.net/openautomation/?rev=248&view=rev
Author: mayerch
Date: 2011-01-14 23:50:58 +0000 (Fri, 14 Jan 2011)
Log Message:
-----------
Inital support for bigger target areas (inkl. preparation for non square blocks)
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/backendCommunication.js
PyWireGate/trunk/logic_editor/gle/gle.block.js
PyWireGate/trunk/logic_editor/gle/gle.connection.js
PyWireGate/trunk/logic_editor/logicEditor.js
Modified: PyWireGate/trunk/logic_editor/backendCommunication.js
===================================================================
--- PyWireGate/trunk/logic_editor/backendCommunication.js 2011-01-14 22:39:21 UTC (rev 247)
+++ PyWireGate/trunk/logic_editor/backendCommunication.js 2011-01-14 23:50:58 UTC (rev 248)
@@ -54,6 +54,34 @@
],
'outPorts': [],
'parameters':{}
+ },
+ 'sink2': {
+ 'width': 100,
+ 'height': 100,
+ 'rotation': 0,
+ 'flip': false,
+ 'color': [0.0, 0.0, 0.0],
+ 'background': [1.0, 1.0, 1.0],
+ 'inPorts': [
+ {
+ 'name': 'in',
+ 'type': 'event'
+ },
+ {
+ 'name': 'in',
+ 'type': 'event'
+ },
+ {
+ 'name': 'in',
+ 'type': 'event'
+ },
+ {
+ 'name': 'in',
+ 'type': 'event'
+ }
+ ],
+ 'outPorts': [],
+ 'parameters':{}
}
},
'mathLib': {
Modified: PyWireGate/trunk/logic_editor/gle/gle.block.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-14 22:39:21 UTC (rev 247)
+++ PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-14 23:50:58 UTC (rev 248)
@@ -103,6 +103,7 @@
} else {
canvas.rect( body, 0, 0, width, height, style );
}
+ if( addEvent ) editorConnectionPointCreate( body, undefined, undefined );
// extend the style for the ports...
style.cursor = 'crosshair';
@@ -297,10 +298,13 @@
////////////////
function editorConnectionPointCreate( obj, portType, portNumber )
{
- $(obj).bind( 'mousedown', {
- portType :portType,
- portNumber:portNumber
- }, editorConnectionPointDrag );
+ if( portType !== undefined && portNumber !== undefined )
+ {
+ $(obj).bind( 'mousedown', {
+ portType :portType,
+ portNumber:portNumber
+ }, editorConnectionPointDrag );
+ }
$(obj).bind( 'mouseover', {
portType :portType,
portNumber:portNumber
@@ -352,11 +356,42 @@
function editorConnectionPointOverPort( event )
{
console.log( 'eCPOP', event.data.portType );
- overPort = {
- block : that,
- type : event.data.portType,
- number: event.data.portNumber
- };
+ if( event.data.portType !== undefined && event.data.portNumber !== undefined )
+ {
+ overPort = {
+ block : that,
+ type : event.data.portType,
+ number: event.data.portNumber
+ };
+ } else {
+ var ex = event.pageX - $('#editor')[0].offsetLeft;
+ var ey = event.pageY - $('#editor')[0].offsetTop;
+ var distance = function( pos )
+ {
+ return (ex-pos[0])*(ex-pos[0]) + (ey-pos[1])*(ey-pos[1]);
+ }
+ if( connectionLookingForInPort )
+ {
+ var smallestDistance = 1e99;
+ var smallestDistancePort = -1;
+ for( var i = 0; i < inPorts.length; i++ )
+ {
+ var dist = distance( that.inPortPos(i) );
+ if( dist < smallestDistance )
+ {
+ smallestDistance = dist;
+ smallestDistancePort = i;
+ }
+ }
+ overPort = {
+ block : that,
+ type : 'inPort',
+ number: smallestDistancePort
+ };
+ } else {
+ // FIXME ADD outPort
+ }
+ }
}
function editorConnectionPointOverPortOut( event )
Modified: PyWireGate/trunk/logic_editor/gle/gle.connection.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-14 22:39:21 UTC (rev 247)
+++ PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-14 23:50:58 UTC (rev 248)
@@ -130,7 +130,7 @@
function editorDragMouseMove( event )
{
var ed = event.data;
- console.log('cDMM', ed );
+ //console.log('cDMM', ed );
if( ed.extend )
{
that.lastMove( [ed.origx - ed.startx + event.pageX, ed.origy - ed.starty + event.pageY], false );
@@ -139,30 +139,6 @@
paths[ed.obj[1]].path[ed.obj[2]][1] = ed.origy - ed.starty + event.pageY;
draw();
}
- /*
- if( 'move' == event.data.type )
- {
- relocate(); // shortcut
- } else {
- if( width < 10 ) width = 10; // sanity...
- if( height < 10 ) height = 10; // sanity...
- draw();
- }
-
- $.each( inPorts, function(i){
- if( 'connection' in this )
- {
- this.connection.lastMove( that.inPortPos( i ), true );
- }
- });
-
- $.each( outPorts, function(i){
- if( 'connection' in this )
- {
- this.connection.firstMove( that.outPortPos( i ) );
- }
- });
- */
}
function editorDragMouseUp( event )
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-14 22:39:21 UTC (rev 247)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-14 23:50:58 UTC (rev 248)
@@ -19,6 +19,7 @@
// global variables
var overPort = false;
+var connectionLookingForInPort = true; // only relevant in connection drawing mode
var maxX = 500; // the biggest x value of the current view
var maxY = 0; // the biggest y value of the current view
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-14 22:39:28
|
Revision: 247
http://openautomation.svn.sourceforge.net/openautomation/?rev=247&view=rev
Author: mayerch
Date: 2011-01-14 22:39:21 +0000 (Fri, 14 Jan 2011)
Log Message:
-----------
Simplify connection when connected bock gets moved and the points get aligned.
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/gle/gle.connection.js
Modified: PyWireGate/trunk/logic_editor/gle/gle.connection.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-14 20:52:51 UTC (rev 246)
+++ PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-14 22:39:21 UTC (rev 247)
@@ -181,13 +181,24 @@
this.firstMove = function( pos )
{
- if( paths[0].path[0][1] == paths[0].path[1][1] ) // keep horizontal line
+ if( Math.abs( paths[0].path[0][1] - paths[0].path[1][1] ) < 1.0 ) // keep horizontal line
{
paths[0].path[0] = pos;
paths[0].path[1][1] = pos[1];
} else {
paths[0].path[0] = pos;
}
+ // remove obsolete points if the are the same now
+ if( paths[0].path.length > 3 &&
+ Math.abs( paths[0].path[1][0] - paths[0].path[2][0] ) < 1.0 &&
+ Math.abs( paths[0].path[1][1] - paths[0].path[2][1] ) < 1.0 )
+ {
+ console.log( 'firstMove', paths[0].path.length );
+ lastFixed -= 2;
+ paths[0].path.shift(); // remove front
+ paths[0].path.shift(); // remove first identical
+ paths[0].path[0] = pos; // remove second identical by setting it to the first
+ }
draw();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-14 20:52:58
|
Revision: 246
http://openautomation.svn.sourceforge.net/openautomation/?rev=246&view=rev
Author: mayerch
Date: 2011-01-14 20:52:51 +0000 (Fri, 14 Jan 2011)
Log Message:
-----------
Inital (not final!) support for extending unconnected connections
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/gle/gle.block.js
PyWireGate/trunk/logic_editor/gle/gle.connection.js
Modified: PyWireGate/trunk/logic_editor/gle/gle.block.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-11 21:40:10 UTC (rev 245)
+++ PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-14 20:52:51 UTC (rev 246)
@@ -222,7 +222,8 @@
}
$.each( inPorts, function(i){
- if( 'connection' in this )
+ //if( 'connection' in this )
+ if( this.connection !== undefined )
{
this.connection.lastMove( that.inPortPos( i ), true );
}
Modified: PyWireGate/trunk/logic_editor/gle/gle.connection.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-11 21:40:10 UTC (rev 245)
+++ PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-14 20:52:51 UTC (rev 246)
@@ -40,6 +40,7 @@
var canvas = svg || $('#editor').svg('get');
var addEvent = interactive !== undefined ? interactive : true;
+ var inEdit = false;
var g = undefined; // link to the representation of the block in the DOM
// the private functions
@@ -70,8 +71,114 @@
parameter['stroke-dasharray'] = 'none';
var x = canvas.polyline( g, paths[i].path, parameter );
}
+
+ // shotcut
+ function connectionDrag( obj, handle )
+ {
+ $(handle).bind( 'mousedown', {obj:obj}, connectionDragMouseDown );
+ }
+
+ // Draw the handles
+ for( var i in paths )
+ {
+ for( var j in paths[i].path )
+ {
+ var x = paths[i].path[j][0];
+ var y = paths[i].path[j][1];
+ var style = '';
+ if( j == 0 || j == paths[i].path.length-1 ) style = 'opacity:0;';
+ if( inEdit && j == paths[i].path.length-1 ) style += 'display:none';
+ connectionDrag( [g,i,j], canvas.rect( g, x-outset, y-outset, 1+inset+outset, 1+inset+outset, {class:'move',style:style} ) );
+ }
+ }
+
}
+ function connectionDragMouseDown( event )
+ {
+ console.log( 'cDMD', event );
+ var classList = this.getAttribute('class').split(' ');
+ console.log( 'cDMD', classList );
+ console.log( 'cDMD', event.data.obj );
+
+ var path = paths[ event.data.obj[1] ].path;
+ var extend = event.data.obj[2] == path.length - 1
+ var parameter = {
+ obj : event.data.obj,
+ origx : path[ event.data.obj[2] ][0],
+ origy : path[ event.data.obj[2] ][1],
+ extend : extend,
+ startx : event.pageX,
+ starty : event.pageY
+ };
+
+ lastFixed = path.length - 1;
+
+ /*
+ if( extend )
+ {
+ this.style.display = 'none';
+ }
+ */
+ inEdit = true;
+
+ $(document).bind( 'mousemove', parameter, editorDragMouseMove );
+ $(document).bind( 'mouseup' , editorDragMouseUp );
+ return false;
+ }
+
+ function editorDragMouseMove( event )
+ {
+ var ed = event.data;
+ console.log('cDMM', ed );
+ if( ed.extend )
+ {
+ that.lastMove( [ed.origx - ed.startx + event.pageX, ed.origy - ed.starty + event.pageY], false );
+ } else {
+ paths[ed.obj[1]].path[ed.obj[2]][0] = ed.origx - ed.startx + event.pageX;
+ paths[ed.obj[1]].path[ed.obj[2]][1] = ed.origy - ed.starty + event.pageY;
+ draw();
+ }
+ /*
+ if( 'move' == event.data.type )
+ {
+ relocate(); // shortcut
+ } else {
+ if( width < 10 ) width = 10; // sanity...
+ if( height < 10 ) height = 10; // sanity...
+ draw();
+ }
+
+ $.each( inPorts, function(i){
+ if( 'connection' in this )
+ {
+ this.connection.lastMove( that.inPortPos( i ), true );
+ }
+ });
+
+ $.each( outPorts, function(i){
+ if( 'connection' in this )
+ {
+ this.connection.firstMove( that.outPortPos( i ) );
+ }
+ });
+ */
+ }
+
+ function editorDragMouseUp( event )
+ {
+ $(document).unbind( 'mousemove', editorDragMouseMove );
+ $(document).unbind( 'mouseup' , editorDragMouseUp );
+ inEdit = false;
+ var target = that.lastTarget();
+ if( target )
+ {
+ target.block.setConnection( target.type, target.number, that ); //event.data.con );
+ }
+ draw();
+ }
+
+
this.firstMove = function( pos )
{
if( paths[0].path[0][1] == paths[0].path[1][1] ) // keep horizontal line
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-11 21:40:16
|
Revision: 245
http://openautomation.svn.sourceforge.net/openautomation/?rev=245&view=rev
Author: mayerch
Date: 2011-01-11 21:40:10 +0000 (Tue, 11 Jan 2011)
Log Message:
-----------
Inital implementation of setting cursor for connection drawing to crosshair
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/gle/gle.block.js
Modified: PyWireGate/trunk/logic_editor/gle/gle.block.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-11 20:46:56 UTC (rev 244)
+++ PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-11 21:40:10 UTC (rev 245)
@@ -104,6 +104,10 @@
canvas.rect( body, 0, 0, width, height, style );
}
+ // extend the style for the ports...
+ style.cursor = 'crosshair';
+ style.fill = style.stroke;
+
// Draw the inports
var inPortsLength = inPorts.length;
$.each( inPorts, function(i){
@@ -111,7 +115,7 @@
if( 'connection' in this )
canvas.line( g, 0, y, 6, y, style );
else
- editorConnectionPointCreate( canvas.polyline( g, [[1, y-4],[6, y],[1, y+4]] ), 'inPort', i );
+ editorConnectionPointCreate( canvas.polyline( g, [[1, y-4],[6, y],[1, y+4]], style ), 'inPort', i );
if( maskOptions.showLabel )
canvas.text( g, 10, y, this.name, {'dominant-baseline':'middle','text-anchor':'start'} );
});
@@ -123,7 +127,7 @@
if( 'connection' in this )
canvas.line( g, width+6, y, width+12, y, style );
else
- editorConnectionPointCreate( canvas.polyline( g, [[width+6, y-4],[width+11, y],[width+6, y+4]] ), 'outPort', i );
+ editorConnectionPointCreate( canvas.polyline( g, [[width+6, y-4],[width+11, y],[width+6, y+4]], style ), 'outPort', i );
if( maskOptions.showLabel )
canvas.text( g, width, y, this.name, {'dominant-baseline':'middle','text-anchor':'end'} );
});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-11 20:47:02
|
Revision: 244
http://openautomation.svn.sourceforge.net/openautomation/?rev=244&view=rev
Author: mayerch
Date: 2011-01-11 20:46:56 +0000 (Tue, 11 Jan 2011)
Log Message:
-----------
Fixed display of unnecessary scrollbars
(-> http://stackoverflow.com/questions/4640348/why-do-scrollbars-appear-when-using-a-svg-element-inside-a-div)
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/logicEditor.css
Modified: PyWireGate/trunk/logic_editor/logicEditor.css
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.css 2011-01-09 20:14:55 UTC (rev 243)
+++ PyWireGate/trunk/logic_editor/logicEditor.css 2011-01-11 20:46:56 UTC (rev 244)
@@ -61,4 +61,8 @@
#editorX {
height: 100%;
width: 100%;
+}
+
+#editor svg {
+ display: block;
}
\ 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-01-09 20:15:05
|
Revision: 243
http://openautomation.svn.sourceforge.net/openautomation/?rev=243&view=rev
Author: mayerch
Date: 2011-01-09 20:14:55 +0000 (Sun, 09 Jan 2011)
Log Message:
-----------
Initial commit of the graphical logic editor
Added Paths:
-----------
PyWireGate/trunk/logic_editor/
PyWireGate/trunk/logic_editor/backendCommunication.js
PyWireGate/trunk/logic_editor/gle/
PyWireGate/trunk/logic_editor/gle/gle.block.js
PyWireGate/trunk/logic_editor/gle/gle.connection.js
PyWireGate/trunk/logic_editor/icon/
PyWireGate/trunk/logic_editor/icon/LICENCE.txt
PyWireGate/trunk/logic_editor/icon/align-horizontal-center.png
PyWireGate/trunk/logic_editor/icon/align-horizontal-left.png
PyWireGate/trunk/logic_editor/icon/align-horizontal-right.png
PyWireGate/trunk/logic_editor/icon/align-vertical-bottom.png
PyWireGate/trunk/logic_editor/icon/align-vertical-center.png
PyWireGate/trunk/logic_editor/icon/align-vertical-top.png
PyWireGate/trunk/logic_editor/icon/application-exit.png
PyWireGate/trunk/logic_editor/icon/checkbox.png
PyWireGate/trunk/logic_editor/icon/chronometer.png
PyWireGate/trunk/logic_editor/icon/code-block.png
PyWireGate/trunk/logic_editor/icon/code-class.png
PyWireGate/trunk/logic_editor/icon/code-context.png
PyWireGate/trunk/logic_editor/icon/code-function.png
PyWireGate/trunk/logic_editor/icon/code-typedef.png
PyWireGate/trunk/logic_editor/icon/code-variable.png
PyWireGate/trunk/logic_editor/icon/configure.png
PyWireGate/trunk/logic_editor/icon/dialog-cancel.png
PyWireGate/trunk/logic_editor/icon/dialog-close.png
PyWireGate/trunk/logic_editor/icon/dialog-ok-apply.png
PyWireGate/trunk/logic_editor/icon/dialog-ok.png
PyWireGate/trunk/logic_editor/icon/distribute-horizontal-center.png
PyWireGate/trunk/logic_editor/icon/distribute-vertical-center.png
PyWireGate/trunk/logic_editor/icon/document-close.png
PyWireGate/trunk/logic_editor/icon/document-new.png
PyWireGate/trunk/logic_editor/icon/document-save.png
PyWireGate/trunk/logic_editor/icon/edit-bomb.png
PyWireGate/trunk/logic_editor/icon/edit-cut.png
PyWireGate/trunk/logic_editor/icon/edit-delete.png
PyWireGate/trunk/logic_editor/icon/edit-find.png
PyWireGate/trunk/logic_editor/icon/edit-select.png
PyWireGate/trunk/logic_editor/icon/edit-undo.png
PyWireGate/trunk/logic_editor/icon/format-add-node.png
PyWireGate/trunk/logic_editor/icon/format-break-node.png
PyWireGate/trunk/logic_editor/icon/format-join-node.png
PyWireGate/trunk/logic_editor/icon/format-remove-node.png
PyWireGate/trunk/logic_editor/icon/help-about.png
PyWireGate/trunk/logic_editor/icon/help-hint.png
PyWireGate/trunk/logic_editor/icon/object-flip-horizontal.png
PyWireGate/trunk/logic_editor/icon/object-flip-vertical.png
PyWireGate/trunk/logic_editor/icon/object-rotate-left.png
PyWireGate/trunk/logic_editor/icon/object-rotate-right.png
PyWireGate/trunk/logic_editor/icon/process-stop.png
PyWireGate/trunk/logic_editor/icon/view-refresh.png
PyWireGate/trunk/logic_editor/icon/view-statistics.png
PyWireGate/trunk/logic_editor/icon/window-close.png
PyWireGate/trunk/logic_editor/icon/zoom-in.png
PyWireGate/trunk/logic_editor/icon/zoom-original.png
PyWireGate/trunk/logic_editor/icon/zoom-out.png
PyWireGate/trunk/logic_editor/index.html
PyWireGate/trunk/logic_editor/lib/
PyWireGate/trunk/logic_editor/lib/jquery-1.4.4.js
PyWireGate/trunk/logic_editor/lib/jquery-ui-1.8.7.custom.min.js
PyWireGate/trunk/logic_editor/lib/jquery.jstree.js
PyWireGate/trunk/logic_editor/lib/jquery.layout.js
PyWireGate/trunk/logic_editor/lib/jquery.svg.js
PyWireGate/trunk/logic_editor/lib/themes/
PyWireGate/trunk/logic_editor/lib/themes/classic/
PyWireGate/trunk/logic_editor/lib/themes/classic/d.png
PyWireGate/trunk/logic_editor/lib/themes/classic/dot_for_ie.gif
PyWireGate/trunk/logic_editor/lib/themes/classic/style.css
PyWireGate/trunk/logic_editor/lib/themes/classic/throbber.gif
PyWireGate/trunk/logic_editor/logicEditor.css
PyWireGate/trunk/logic_editor/logicEditor.js
Added: PyWireGate/trunk/logic_editor/backendCommunication.js
===================================================================
--- PyWireGate/trunk/logic_editor/backendCommunication.js (rev 0)
+++ PyWireGate/trunk/logic_editor/backendCommunication.js 2011-01-09 20:14:55 UTC (rev 243)
@@ -0,0 +1,99 @@
+ // Sollte das Backend dynamisch aus den verfuegbaren Bloecken generieren:
+ var libJSON = {
+ 'sourceLib': {
+ 'source1': {
+ 'width': 100,
+ 'height': 50,
+ 'rotation': 0,
+ 'flip': false,
+ 'color': [0.0, 0.0, 0.0],
+ 'background': [1.0, 1.0, 1.0],
+ 'inPorts': [],
+ 'outPorts': [
+ {
+ 'name': 'out1',
+ 'type': 'event'
+ }
+ ],
+ 'parameters':{}
+ },
+ 'source2': {
+ 'width': 100,
+ 'height': 100,
+ 'rotation': 0,
+ 'flip': false,
+ 'color': [0.0, 0.0, 1.0],
+ 'background': [1.0, 1.0, 0.5],
+ 'inPorts': [],
+ 'outPorts': [
+ {
+ 'name': 'out1',
+ 'type': 'event'
+ },
+ {
+ 'name': 'out2',
+ 'type': 'event'
+ }
+ ],
+ 'parameters':{}
+ }
+ },
+ 'sinkLib': {
+ 'sink1': {
+ 'width': 100,
+ 'height': 100,
+ 'rotation': 0,
+ 'flip': false,
+ 'color': [0.0, 0.0, 0.0],
+ 'background': [1.0, 1.0, 1.0],
+ 'inPorts': [
+ {
+ 'name': 'in',
+ 'type': 'event'
+ }
+ ],
+ 'outPorts': [],
+ 'parameters':{}
+ }
+ },
+ 'mathLib': {
+ 'gain': {
+ 'width': 100,
+ 'height': 100,
+ 'rotation': 0,
+ 'flip': false,
+ 'color': [0.0, 0.0, 0.0],
+ 'background': [1.0, 1.0, 1.0],
+ 'mask': [
+ { 'type': 'move', 'x': 0.999, 'y': 0.5 }, // just to show what's possible
+ { 'type': 'line', 'x': 0 , 'y': 0.999 },
+ { 'type': 'line', 'x': 0 , 'y': 0 }
+ // auto close
+ ],
+ 'maskOptions': {
+ 'showLabel': false
+ },
+ 'inPorts': [
+ {
+ 'name': 'in',
+ 'type': 'event'
+ }
+ ],
+ 'outPorts': [
+ {
+ 'name': 'out',
+ 'type': 'event'
+ }
+ ],
+ 'parameters': [
+ {
+ 'name': 'gain',
+ 'type': 'float'
+ }
+ ]
+ }
+ }
+};
+
+// Die Struktur mit der feritgen Logik
+var logicJSON = {};
Added: PyWireGate/trunk/logic_editor/gle/gle.block.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.block.js (rev 0)
+++ PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-09 20:14:55 UTC (rev 243)
@@ -0,0 +1,366 @@
+/* gle.block.js (c) 2011 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
+ */
+
+/**
+ * The element that stores all informations and methods about one block
+ */
+
+/**
+ * The block constructor.
+ * type: the block (proto)type in JSON notation
+ * svg: the link to the SVG canvas
+ * interactive: event handlers will be added, set to false to create picture only
+ */
+function Block( type, svg, interactive )
+{
+ // setup the private "constants"
+ var that = this;
+ var inset = 3; // how far should the handle stick in
+ var outset = 3; // how far should the handle stick out
+
+ // setup the private variables
+ var x = type.x || 0;
+ var y = type.y || 0;
+ var width = type.width || 100;
+ var height = type.height || 100;
+ var rotation = type.rotation || 0;
+ var flip = type.flip || false;
+ var mask = type.mask || undefined;
+ var maskOptions = type.maskOptions || { showLabel: true };
+ var color = type.color || [0.0, 0.0, 0.0];
+ var background = type.background || [1.0, 1.0, 1.0];
+ var inPorts = type.inPorts || [];
+ var outPorts = type.outPorts || [];
+ var parameters = type.parameters || {};
+
+ var canvas = svg || $('#editor').svg('get');
+ var addEvent = interactive !== undefined ? interactive : true;
+ var g = undefined; // link to the representation of the block in the DOM
+
+ // the private functions
+
+ // (re)draw itself on the canvas
+ function draw()
+ {
+ var classList = 'block';
+ if( g )
+ {
+ classList = g.getAttribute('class');
+ g.parentNode.removeChild( g ); // delete the old representation
+ }
+ g = canvas.group( {'transform':'translate(' + x + ',' + y + ')', 'class':classList} );
+
+ // helper function to scale relative positioning
+ function scaleRelPos( value, absValue )
+ {
+ if( value >= 1.0 ) return value; // it is already absolutely scaled
+ if( value < 0 ) return absValue + value; // absolutely from right
+ return absValue * value; // relative scaled
+ }
+
+ var style = {
+ fill: colorByArray( background ),
+ stroke: colorByArray( color ),
+ 'stroke-width': 1
+ };
+
+ // Draw the body
+ var body = canvas.group( g, {'transform':'translate(6,1)'} );
+ if( mask )
+ {
+ var path = canvas.createPath();
+ for( var i in mask )
+ {
+ var obj = mask[i];
+ var sx = scaleRelPos( obj.x, width );
+ var sy = scaleRelPos( obj.y, height );
+ switch( obj.type )
+ {
+ case 'move':
+ path.move( sx, sy );
+ break;
+
+ case 'line':
+ path.line( sx, sy );
+ break;
+ }
+ }
+ canvas.path( body, path.close(), style );
+ } else {
+ canvas.rect( body, 0, 0, width, height, style );
+ }
+
+ // Draw the inports
+ var inPortsLength = inPorts.length;
+ $.each( inPorts, function(i){
+ var y = 1 + height * (0.5 + i)/inPortsLength;
+ if( 'connection' in this )
+ canvas.line( g, 0, y, 6, y, style );
+ else
+ editorConnectionPointCreate( canvas.polyline( g, [[1, y-4],[6, y],[1, y+4]] ), 'inPort', i );
+ if( maskOptions.showLabel )
+ canvas.text( g, 10, y, this.name, {'dominant-baseline':'middle','text-anchor':'start'} );
+ });
+
+ // Draw the outports
+ var outPortsLength = outPorts.length;
+ $.each( outPorts, function(i){
+ var y = 1 + height * (0.5 + i)/outPortsLength;
+ if( 'connection' in this )
+ canvas.line( g, width+6, y, width+12, y, style );
+ else
+ editorConnectionPointCreate( canvas.polyline( g, [[width+6, y-4],[width+11, y],[width+6, y+4]] ), 'outPort', i );
+ if( maskOptions.showLabel )
+ canvas.text( g, width, y, this.name, {'dominant-baseline':'middle','text-anchor':'end'} );
+ });
+
+ // shotcut
+ function editorDrag( obj, handle )
+ {
+ if( addEvent )
+ {
+ $(handle).bind( 'mousedown', {obj:obj}, editorDragMouseDown );
+ }
+ }
+
+ editorDrag( g, g ); // move
+ // Draw the handles
+ editorDrag( g, canvas.rect( g, 5-outset , -outset , 1+inset+outset, 1+inset+outset, {class:'nw-resize'} ) );
+ editorDrag( g, canvas.rect( g, 6+width-inset, -outset , 1+inset+outset, 1+inset+outset, {class:'ne-resize'} ) );
+ editorDrag( g, canvas.rect( g, 5-outset , height+1-inset, 1+inset+outset, 1+inset+outset, {class:'sw-resize'} ) );
+ editorDrag( g, canvas.rect( g, 6+width-inset, height+1-inset, 1+inset+outset, 1+inset+outset, {class:'se-resize'} ) );
+
+ }
+
+ // relocate itself on the canvas
+ function relocate()
+ {
+ if( !g ) return draw(); // nothing to relocate...
+ g.setAttribute( 'transform', 'translate(' + x + ',' + y + ')' );
+ }
+
+ function editorDragMouseDown( event )
+ {
+ console.log( 'eDMD', event );
+ var classList = this.getAttribute('class').split(' ');
+ console.log( 'eDMD', classList );
+ var type = 'move';
+ for( var i = 0; i < classList.length; i++ )
+ if( classList[i] != '' && classList[i] != 'selected' && classList[i] != 'block' ) type = classList[i];
+ if( $.inArray('selected', classList) == -1 && type=='move' ) editorSelect( this );
+
+ var parameter = {
+ type : type,
+ origx : x,
+ origy : y,
+ origw : width,
+ origh : height,
+ startx : event.pageX,
+ starty : event.pageY
+ };
+
+ $(document).bind( 'mousemove', parameter, editorDragMouseMove );
+ $(document).bind( 'mouseup' , editorDragMouseUp );
+ return false;
+ }
+
+ function editorDragMouseMove( event )
+ {
+ var ed = event.data;
+ switch( event.data.type )
+ {
+ case 'move':
+ x = ed.origx - ed.startx + event.pageX;
+ y = ed.origy - ed.starty + event.pageY;
+ break;
+ case 'nw-resize':
+ x = ed.origx - ed.startx + event.pageX;
+ width = ed.origw + ed.startx - event.pageX;
+ y = ed.origy - ed.starty + event.pageY;
+ height = ed.origh + ed.starty - event.pageY;
+ break;
+ case 'ne-resize':
+ width = ed.origw - ed.startx + event.pageX;
+ y = ed.origy - ed.starty + event.pageY;
+ height = ed.origh + ed.starty - event.pageY;
+ break;
+ case 'se-resize':
+ height = ed.origh - ed.starty + event.pageY;
+ width = ed.origw - ed.startx + event.pageX;
+ break;
+ case 'sw-resize':
+ height = ed.origh - ed.starty + event.pageY;
+ x = ed.origx - ed.startx + event.pageX;
+ width = ed.origw + ed.startx - event.pageX;
+ break;
+ }
+ if( 'move' == event.data.type )
+ {
+ relocate(); // shortcut
+ } else {
+ if( width < 10 ) width = 10; // sanity...
+ if( height < 10 ) height = 10; // sanity...
+ draw();
+ }
+
+ $.each( inPorts, function(i){
+ if( 'connection' in this )
+ {
+ this.connection.lastMove( that.inPortPos( i ), true );
+ }
+ });
+
+ $.each( outPorts, function(i){
+ if( 'connection' in this )
+ {
+ this.connection.firstMove( that.outPortPos( i ) );
+ }
+ });
+ }
+
+ function editorDragMouseUp( event )
+ {
+ $(document).unbind( 'mousemove', editorDragMouseMove );
+ $(document).unbind( 'mouseup' , editorDragMouseUp );
+ }
+
+ // the public (privileged) methods:
+ this.getWidth = function() { return width ; }
+ this.setWidth = function( _width ) { width = _width ; draw(); }
+ this.getHeight = function() { return height; }
+ this.setHeight = function( _height ) { height = _height; draw(); }
+ this.getX = function() { return x ; }
+ this.setX = function( _x ) { x = _x ; draw(); }
+ this.getY = function() { return y ; }
+ this.setY = function( _y ) { y = _y ; draw(); }
+ this.getColor = function() { return color ; }
+ this.setColor = function( _color ) { color = _color ; draw(); }
+ this.setConnection = function( portType, portNumber, connection )
+ {
+ if( 'inPort' == portType )
+ inPorts [ portNumber ].connection = connection;
+ else
+ outPorts[ portNumber ].connection = connection;
+ draw();
+ }
+ this.inPortPos = function( number )
+ {
+ return [ x , y + 1 + height * (0.5 + number) / inPorts.length ];
+ }
+ this.outPortPos = function( number )
+ {
+ return [ x + width + 10, y + 1 + height * (0.5 + number) / outPorts.length ];
+ }
+
+ // Dump this Block in JSON notation to serialize it
+ this.getJSON = function()
+ {
+ return {
+ x : x ,
+ y : y ,
+ width : width ,
+ height : height ,
+ rotation : rotation ,
+ flip : flip ,
+ mask : mask ,
+ maskOptions : maskOptions ,
+ color : color ,
+ background : background ,
+ inPorts : inPorts ,
+ outPorts : outPorts ,
+ parameters : parameters
+ };
+ }
+
+ // finally draw itself:
+ draw();
+
+ ////////////////
+ function editorConnectionPointCreate( obj, portType, portNumber )
+ {
+ $(obj).bind( 'mousedown', {
+ portType :portType,
+ portNumber:portNumber
+ }, editorConnectionPointDrag );
+ $(obj).bind( 'mouseover', {
+ portType :portType,
+ portNumber:portNumber
+ }, editorConnectionPointOverPort );
+ $(obj).bind( 'mouseout', {
+ }, editorConnectionPointOverPortOut );
+ }
+
+ function editorConnectionPointDrag( event )
+ {
+ console.log( 'Block: eCPD', event );
+ var pn = event.data.portNumber;
+ var pt = event.data.portType;
+ var c = new Connection({
+ origin : that,
+ originPortNumber: pn,
+ paths : [{path:[that.outPortPos( pn )]}]
+ });
+ that.setConnection( pt, pn,c );
+ ///???
+ var parameter = {con:c};
+
+ $(document).bind( 'mousemove', parameter, editorConnectionPointMouseMove );
+ $(document).bind( 'mouseup' , parameter, editorConnectionPointMouseUp );
+
+ return false;
+ }
+
+ function editorConnectionPointMouseMove( event )
+ {
+ //console.log( event.data.con );
+ var x = event.pageX - $('#editor')[0].offsetLeft;
+ var y = event.pageY - $('#editor')[0].offsetTop;
+ event.data.con.lastMove( [x, y] );
+ }
+
+ function editorConnectionPointMouseUp( event )
+ {
+ console.log( 'eCPMU' );
+ $(document).unbind( 'mousemove', editorConnectionPointMouseMove );
+ $(document).unbind( 'mouseup' , editorConnectionPointMouseUp );
+ var target = event.data.con.lastTarget();
+ if( target )
+ {
+ target.block.setConnection( target.type, target.number, event.data.con );
+ }
+ }
+
+ function editorConnectionPointOverPort( event )
+ {
+ console.log( 'eCPOP', event.data.portType );
+ overPort = {
+ block : that,
+ type : event.data.portType,
+ number: event.data.portNumber
+ };
+ }
+
+ function editorConnectionPointOverPortOut( event )
+ {
+ console.log( 'eCPOPO' );
+ overPort = false;
+ }
+}
+Block.prototype = {
+ globalTestFunc: function(){ alert('test'+ this.getWidth()); }
+};
+
Added: PyWireGate/trunk/logic_editor/gle/gle.connection.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.connection.js (rev 0)
+++ PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-09 20:14:55 UTC (rev 243)
@@ -0,0 +1,126 @@
+/* gle.connection.js (c) 2011 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
+ */
+
+/**
+ * The element that stores all informations and methods about one connection
+ */
+
+/**
+ * The connection constructor.
+ * type: the block (proto)type in JSON notation
+ * svg: the link to the SVG canvas
+ * interactive: event handlers will be added, set to false to create picture only
+ */
+function Connection( JSON, svg, interactive )
+{
+ // setup the private "constants"
+ var that = this;
+ var inset = 3; // how far should the handle stick in
+ var outset = 3; // how far should the handle stick out
+
+ // setup the private variables
+ var origin = JSON.origin || undefined;
+ var paths = JSON.paths || [];
+ var branch = 0; // the current branch to edit
+ var lastFixed = 0; // the last fixed position
+
+ var canvas = svg || $('#editor').svg('get');
+ var addEvent = interactive !== undefined ? interactive : true;
+ var g = undefined; // link to the representation of the block in the DOM
+
+ // the private functions
+
+ // (re)draw itself on the canvas
+ function draw()
+ {
+ var classList = 'connection';
+ if( g )
+ {
+ classList = g.getAttribute('class');
+ g.parentNode.removeChild( g ); // delete the old representation
+ }
+ g = canvas.group( { 'class':classList } );
+
+ var parameter = {
+ class: classList,
+ stroke: colorByArray( origin.getColor() ),
+ 'stroke-width': 1,
+ 'marker-end' : 'url(#ArrowEnd)',
+ fill: 'none'
+ };
+ for( var i in paths )
+ {
+ if( paths[i].target == undefined || origin == undefined )
+ parameter['stroke-dasharray'] = '1,3';
+ else
+ parameter['stroke-dasharray'] = 'none';
+ var x = canvas.polyline( g, paths[i].path, parameter );
+ }
+ }
+
+ this.firstMove = function( pos )
+ {
+ if( paths[0].path[0][1] == paths[0].path[1][1] ) // keep horizontal line
+ {
+ paths[0].path[0] = pos;
+ paths[0].path[1][1] = pos[1];
+ } else {
+ paths[0].path[0] = pos;
+ }
+ draw();
+ }
+
+ this.lastMove = function( pos, force )
+ {
+ while( paths[branch].path.length > lastFixed+1 )
+ paths[branch].path.pop();
+ var start = paths[branch].path[ paths[branch].path.length - 1 ];
+ var op = overPort;
+ if( !force && op && op.type == 'inPort' )
+ {
+ pos = op.block.inPortPos( op.number );
+ }
+ if( force || (op && op.type == 'inPort') )
+ {
+ paths[branch].target = op;
+ if( Math.abs( start[1] - pos[1] ) > 1.0 )
+ paths[branch].path.push( [ (pos[0]+start[0])/2, start[1] ] );
+ paths[branch].path.push( [ (pos[0]+start[0])/2, pos[1] ] );
+ } else {
+ paths[branch].target = undefined;
+ if( Math.abs( start[1] - pos[1] ) > 1.0 )
+ paths[branch].path.push( [ pos[0], start[1] ] );
+ }
+ paths[branch].path.push( pos );
+ draw();
+ }
+
+ this.lastTarget = function()
+ {
+ return paths[branch].target;
+ }
+
+ // Dump this Block in JSON notation to serialize it
+ this.getJSON = function()
+ {
+ return {
+ origin : origin,
+ paths : paths
+ };
+ }
+}
+
Added: PyWireGate/trunk/logic_editor/icon/LICENCE.txt
===================================================================
--- PyWireGate/trunk/logic_editor/icon/LICENCE.txt (rev 0)
+++ PyWireGate/trunk/logic_editor/icon/LICENCE.txt 2011-01-09 20:14:55 UTC (rev 243)
@@ -0,0 +1 @@
+Oxygen icon theme is dual licensed. You may copy it under the Creative Common Attribution-ShareAlike 3.0 License or the GNU Library General Public License.
\ No newline at end of file
Added: PyWireGate/trunk/logic_editor/icon/align-horizontal-center.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/align-horizontal-center.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/align-horizontal-left.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/align-horizontal-left.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/align-horizontal-right.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/align-horizontal-right.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/align-vertical-bottom.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/align-vertical-bottom.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/align-vertical-center.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/align-vertical-center.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/align-vertical-top.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/align-vertical-top.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/application-exit.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/application-exit.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/checkbox.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/checkbox.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/chronometer.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/chronometer.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/code-block.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/code-block.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/code-class.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/code-class.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/code-context.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/code-context.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/code-function.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/code-function.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/code-typedef.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/code-typedef.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/code-variable.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/code-variable.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/configure.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/configure.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/dialog-cancel.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/dialog-cancel.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/dialog-close.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/dialog-close.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/dialog-ok-apply.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/dialog-ok-apply.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/dialog-ok.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/dialog-ok.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/distribute-horizontal-center.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/distribute-horizontal-center.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/distribute-vertical-center.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/distribute-vertical-center.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/document-close.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/document-close.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/document-new.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/document-new.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/document-save.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/document-save.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/edit-bomb.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/edit-bomb.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/edit-cut.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/edit-cut.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/edit-delete.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/edit-delete.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/edit-find.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/edit-find.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/edit-select.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/edit-select.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/edit-undo.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/edit-undo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/format-add-node.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/format-add-node.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/format-break-node.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/format-break-node.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/format-join-node.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/format-join-node.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/format-remove-node.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/format-remove-node.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/help-about.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/help-about.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/help-hint.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/help-hint.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/object-flip-horizontal.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/object-flip-horizontal.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/object-flip-vertical.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/object-flip-vertical.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/object-rotate-left.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/object-rotate-left.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/object-rotate-right.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/object-rotate-right.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/process-stop.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/process-stop.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/view-refresh.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/view-refresh.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/view-statistics.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/view-statistics.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/window-close.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/window-close.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/zoom-in.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/zoom-in.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/zoom-original.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/zoom-original.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/icon/zoom-out.png
===================================================================
(Binary files differ)
Property changes on: PyWireGate/trunk/logic_editor/icon/zoom-out.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: PyWireGate/trunk/logic_editor/index.html
===================================================================
--- PyWireGate/trunk/logic_editor/index.html (rev 0)
+++ PyWireGate/trunk/logic_editor/index.html 2011-01-09 20:14:55 UTC (rev 243)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+ <title>Graphical Logic Editor</title>
+ <link rel="stylesheet" href="logicEditor.css" type="text/css" />
+ <script type="text/javascript" src="lib/jquery-1.4.4.js"></script>
+ <script type="text/javascript" src="lib/jquery-ui-1.8.7.custom.min.js"></script>
+ <script type="text/javascript" src="lib/jquery.svg.js"></script>
+ <script type="text/javascript" src="lib/jquery.layout.js"></script>
+ <script type="text/javascript" src="lib/jquery.jstree.js"></script>
+ <script type="text/javascript" src="backendCommunication.js"></script>
+ <script type="text/javascript" src="gle/gle.block.js"></script>
+ <script type="text/javascript" src="gle/gle.connection.js"></script>
+ <script type="text/javascript" src="logicEditor.js"></script>
+ <script type="text/javascript">
+ </script>
+ </head>
+ <body>
+ <div id="header" class="ui-layout-north">
+ <h1>Example SVG based Logic Engine Editor</h1>
+ Toolbar...
+ </div>
+ <div id="structureContainer" class="ui-layout-west">
+ <h2>Structure area</h2>
+ <div id="structureTree"></div>
+ </div>
+ <div id="editor" class="ui-layout-center ui-layout-content"></div>
+ <div id="libraryContainer" class="ui-layout-east">
+ <h2>Element Library</h2>
+ <div id="library"></div>
+ </div>
+ </body>
+</html>
Property changes on: PyWireGate/trunk/logic_editor/index.html
___________________________________________________________________
Added: svn:executable
+ *
Added: PyWireGate/trunk/logic_editor/lib/jquery-1.4.4.js
===================================================================
--- PyWireGate/trunk/logic_editor/lib/jquery-1.4.4.js (rev 0)
+++ PyWireGate/trunk/logic_editor/lib/jquery-1.4.4.js 2011-01-09 20:14:55 UTC (rev 243)
@@ -0,0 +1,7179 @@
+/*!
+ * jQuery JavaScript Library v1.4.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Nov 11 19:04:53 2010 -0500
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
+
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+ rwhite = /\s/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Check for non-word characters
+ rnonword = /\W/,
+
+ // Check for digits
+ rdigit = /\d/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // Has the ready events already been bound?
+ readyBound = false,
+
+ // The functions to execute on DOM ready
+ readyList = [],
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = "body";
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $("TAG")
+ } else if ( !context && !rnonword.test( selector ) ) {
+ this.selector = selector;
+ this.context = document;
+ selector = document.getElementsByTagName( selector );
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return jQuery( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.4.4",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady ) {
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ } else if ( readyList ) {
+ // Add the function to the wait list
+ readyList.push( fn );
+ }
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || jQuery(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // A third-party is pushing the ready event forwards
+ if ( wait === true ) {
+ jQuery.readyWait--;
+ }
+
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ if ( readyList ) {
+ // Execute all of them
+ var fn,
+ i = 0,
+ ready = readyList;
+
+ // Reset the list of functions
+ readyList = null;
+
+ while ( (fn = ready[ i++ ]) ) {
+ fn.call( document, jQuery );
+ }
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
+ }
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyBound ) {
+ return;
+ }
+
+ readyBound = true;
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNaN: function( obj ) {
+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test(data.replace(rvalidescape, "@")
+ .replace(rvalidtokens, "]")
+ .replace(rvalidbraces, "")) ) {
+
+ // Try to use the native JSON parser first
+ return window.JSON && window.JSON.parse ?
+ window.JSON.parse( data ) :
+ (new Function("return " + data))();
+
+ } else {
+ jQuery.error( "Invalid JSON: " + data );
+ }
+ },
+
+ noop: function() {},
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+
+ if ( jQuery.support.scriptEval ) {
+ script.appendChild( document.createTextNode( data ) );
+ } else {
+ script.text = data;
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction(object);
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function(...
[truncated message content] |
|
From: <ma...@us...> - 2011-01-02 21:21:02
|
Revision: 242
http://openautomation.svn.sourceforge.net/openautomation/?rev=242&view=rev
Author: mayerch
Date: 2011-01-02 21:20:56 +0000 (Sun, 02 Jan 2011)
Log Message:
-----------
Fix handling of readonly in the slide 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 2011-01-02 21:07:28 UTC (rev 241)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-01-02 21:20:56 UTC (rev 242)
@@ -155,8 +155,10 @@
var address = {};
$p.find('address').each( function(){
var src = this.textContent;
+ var transform = this.getAttribute('transform');
+ var readonly = this.getAttribute('readonly');
ga_list.push( src )
- address[ '_' + src ] = [ this.getAttribute('transform') ];
+ address[ '_' + src ] = [ transform, readonly=='true' ];
});
var actor = $('<div class="actor">');
var min = parseFloat( $p.attr('min') || 0 );
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2011-01-02 21:07:28 UTC (rev 241)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2011-01-02 21:20:56 UTC (rev 242)
@@ -67,6 +67,7 @@
<slide min="-18" max="26">
<label>Slide</label>
<address transform="DPT:9">12/4/250</address>
+ <address transform="DPT:9.001" readonly="true">12/4/253</address>
</slide>
<break />
<trigger value="0" mapping="OnOff">
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-01-01 16:21:47
|
Revision: 240
http://openautomation.svn.sourceforge.net/openautomation/?rev=240&view=rev
Author: mayerch
Date: 2011-01-01 16:21:41 +0000 (Sat, 01 Jan 2011)
Log Message:
-----------
Added rate limiter (set to 250 ms) to the colorChooser
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2011-01-01 15:20:35 UTC (rev 239)
+++ CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2011-01-01 16:21:41 UTC (rev 240)
@@ -44,43 +44,73 @@
var $actor = $(actor)
.data({
'address' : address,
- 'value_r' : 0,
- 'value_g' : 0,
- 'value_b' : 0,
+ 'value_r' : 0, // The currenty displayed value
+ 'value_g' : 0, // The currenty displayed value
+ 'value_b' : 0, // The currenty displayed value
+ 'bus_r' : 0, // The current value on the bus
+ 'bus_g' : 0, // The current value on the bus
+ 'bus_b' : 0, // The current value on the bus
+ 'rateLimiter' : false, // is the rate limiter active?
'type' : 'colorChooser'
});
$actor.farbtastic( function(color){
- var r = parseInt(color.substring(1, 3), 16) * 100 / 255.0;
- var g = parseInt(color.substring(3, 5), 16) * 100 / 255.0;
- var b = parseInt(color.substring(5, 7), 16) * 100 / 255.0;
- var vr = $actor.data('value_r');
- var vg = $actor.data('value_g');
- var vb = $actor.data('value_b');
- $actor.data( 'value_r', vr );
- $actor.data( 'value_g', vg );
- $actor.data( 'value_b', vb );
- for( var addr in address )
- {
- if( address[addr][2] == true ) continue; // skip read only
- switch( address[addr][1] )
+ $actor.data( 'value_r', parseInt(color.substring(1, 3), 16) * 100 / 255.0 );
+ $actor.data( 'value_g', parseInt(color.substring(3, 5), 16) * 100 / 255.0 );
+ $actor.data( 'value_b', parseInt(color.substring(5, 7), 16) * 100 / 255.0 );
+ function rateLimitedSend( a ) {
+ var modified = false;
+ var address = a.data( 'address' );
+ var r = a.data( 'value_r' );
+ var g = a.data( 'value_g' );
+ var b = a.data( 'value_b' );
+ var br = a.data( 'bus_r' );
+ var bg = a.data( 'bus_g' );
+ var bb = a.data( 'bus_b' );
+ for( var addr in address )
{
- case 'r':
- var v = Transform[address[addr][0]].encode( r );
- if( v != Transform[address[addr][0]].encode( vr ) )
- visu.write( addr.substr(1), v );
- break;
- case 'g':
- var v = Transform[address[addr][0]].encode( g );
- if( v != Transform[address[addr][0]].encode( vg ) )
- visu.write( addr.substr(1), v );
- break;
- case 'b':
- var v = Transform[address[addr][0]].encode( b );
- if( v != Transform[address[addr][0]].encode( vb ) )
- visu.write( addr.substr(1), v );
- break;
+ if( address[addr][2] == true ) continue; // skip read only
+ switch( address[addr][1] )
+ {
+ case 'r':
+ var v = Transform[address[addr][0]].encode( r );
+ if( v != Transform[address[addr][0]].encode( br ) )
+ {
+ visu.write( addr.substr(1), v );
+ modified = true;
+ }
+ break;
+ case 'g':
+ var v = Transform[address[addr][0]].encode( g );
+ if( v != Transform[address[addr][0]].encode( bg ) )
+ {
+ visu.write( addr.substr(1), v );
+ modified = true;
+ }
+ break;
+ case 'b':
+ var v = Transform[address[addr][0]].encode( b );
+ if( v != Transform[address[addr][0]].encode( bb ) )
+ {
+ visu.write( addr.substr(1), v );
+ modified = true;
+ }
+ break;
+ }
}
+
+ if( modified )
+ {
+ a.data( 'bus_r', a.data( 'value_r' ) );
+ a.data( 'bus_g', a.data( 'value_g' ) );
+ a.data( 'bus_b', a.data( 'value_b' ) );
+ a.data( 'rateLimiter', true );
+ setTimeout( function(){rateLimitedSend( a );}, 250 ); // next call in 250ms
+ } else {
+ a.data( 'rateLimiter', false );
+ }
}
+ if( $actor.data( 'rateLimiter' ) == false ) // already requests going?
+ rateLimitedSend( $actor );
});
for( var addr in address ) {
switch( address[addr][1] ) {
@@ -102,7 +132,7 @@
update_r: function( e, data ) {
var element = $(this);
var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
- element.data( 'value_r', value );
+ element.data( 'bus_r', value );
function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
var color = jQuery.farbtastic( element ).color || '#000000';
color = color.substring(0,1) +
@@ -113,7 +143,7 @@
update_g: function( e, data ) {
var element = $(this);
var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
- element.data( 'value_g', value );
+ element.data( 'bus_g', value );
function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
var color = jQuery.farbtastic( element ).color || '#000000';
color = color.substring(0,3) +
@@ -124,7 +154,7 @@
update_b: function( e, data ) {
var element = $(this);
var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
- element.data( 'value_b', value );
+ element.data( 'bus_b', value );
function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
var color = jQuery.farbtastic( element ).color || '#000000';
color = color.substring(0,5) +
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-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 14:31:31
|
Revision: 237
http://openautomation.svn.sourceforge.net/openautomation/?rev=237&view=rev
Author: mayerch
Date: 2011-01-01 14:31:24 +0000 (Sat, 01 Jan 2011)
Log Message:
-----------
Cleaned up the tranforms
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-28 22:07:57 UTC (rev 236)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-01-01 14:31:24 UTC (rev 237)
@@ -117,9 +117,8 @@
var address = {};
$p.find('address').each( function(){
var src = this.textContent;
- var transform = this.getAttribute('transform');
ga_list.push( src )
- address[ '_' + src ] = [transform];
+ address[ '_' + src ] = [ this.getAttribute('transform') ];
});
var actor = '<div class="actor">';
if( $p.attr('pre') ) actor += '<div>' + $p.attr('pre') + '</div>';
@@ -156,9 +155,8 @@
var address = {};
$p.find('address').each( function(){
var src = this.textContent;
- var transform = this.getAttribute('transform');
ga_list.push( src )
- address[ '_' + src ] = [transform];
+ address[ '_' + src ] = [ this.getAttribute('transform') ];
});
var actor = $('<div class="actor">');
// ret_val.append( label ).append( actor );
@@ -191,7 +189,7 @@
},
update: function( e, data ) {
var element = $(this);
- var value = transform( data, element.data().address[ e.type ][0] );
+ var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
if( element.data( 'value' ) != value )
{
element.data( 'value', value );
@@ -281,7 +279,6 @@
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) );
visu.write( addr.substr(1), Transform[data.address[addr][0]].encode( data.value ) );
}
},
@@ -602,18 +599,10 @@
return { x: 0, y: 0 }; // sanity return
}
-/**
- * temporary function till the transformation framework is implemented
- */
-function transform( raw, type )
-{
- return Transform[type].decode( raw );
-}
-
function defaultUpdate( e, data, passedElement )
{
var element = passedElement || $(this);
- var value = transform( data, element.data().address[ e.type ][0] );
+ var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
if( element.data( 'precision' ) )
value = Number( value ).toPrecision( element.data( 'precision' ) );
element.data( 'value', value );
Modified: CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-28 22:07:57 UTC (rev 236)
+++ CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2011-01-01 14:31:24 UTC (rev 237)
@@ -101,7 +101,7 @@
},
update_r: function( e, data ) {
var element = $(this);
- var value = transform( data, element.data().address[ e.type ][0] );
+ var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
element.data( 'value_r', value );
function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
var color = jQuery.farbtastic( element ).color || '#000000';
@@ -112,7 +112,7 @@
},
update_g: function( e, data ) {
var element = $(this);
- var value = transform( data, element.data().address[ e.type ][0] );
+ var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
element.data( 'value_g', value );
function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
var color = jQuery.farbtastic( element ).color || '#000000';
@@ -123,7 +123,7 @@
},
update_b: function( e, data ) {
var element = $(this);
- var value = transform( data, element.data().address[ e.type ][0] );
+ var value = Transform[ element.data().address[ e.type ][0] ].decode( data );
element.data( 'value_b', value );
function toHex( x ) { var r = parseInt( x ).toString(16); return r.length == 1 ? '0'+r : r; }
var color = jQuery.farbtastic( element ).color || '#000000';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-28 22:08:04
|
Revision: 236
http://openautomation.svn.sourceforge.net/openautomation/?rev=236&view=rev
Author: mayerch
Date: 2010-12-28 22:07:57 +0000 (Tue, 28 Dec 2010)
Log Message:
-----------
Make colorChooser much more smooth (and avoid sending of lots of (outdated) values)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-28 20:10:44 UTC (rev 235)
+++ CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-28 22:07:57 UTC (rev 236)
@@ -48,27 +48,36 @@
'value_g' : 0,
'value_b' : 0,
'type' : 'colorChooser'
- })
- .farbtastic( function(color){
+ });
+ $actor.farbtastic( function(color){
var r = parseInt(color.substring(1, 3), 16) * 100 / 255.0;
var g = parseInt(color.substring(3, 5), 16) * 100 / 255.0;
var b = parseInt(color.substring(5, 7), 16) * 100 / 255.0;
+ var vr = $actor.data('value_r');
+ var vg = $actor.data('value_g');
+ var vb = $actor.data('value_b');
+ $actor.data( 'value_r', vr );
+ $actor.data( 'value_g', vg );
+ $actor.data( 'value_b', vb );
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) );
- visu.write( addr.substr(1), Transform[address[addr][0]].encode( r ) );
+ var v = Transform[address[addr][0]].encode( r );
+ if( v != Transform[address[addr][0]].encode( vr ) )
+ visu.write( addr.substr(1), v );
break;
case 'g':
- //visu.write( addr.substr(1), g, address[addr][0].substr(4) );
- visu.write( addr.substr(1), Transform[address[addr][0]].encode( g ) );
+ var v = Transform[address[addr][0]].encode( g );
+ if( v != Transform[address[addr][0]].encode( vg ) )
+ visu.write( addr.substr(1), v );
break;
case 'b':
- //visu.write( addr.substr(1), b, address[addr][0].substr(4) );
- visu.write( addr.substr(1), Transform[address[addr][0]].encode( b ) );
+ var v = Transform[address[addr][0]].encode( b );
+ if( v != Transform[address[addr][0]].encode( vb ) )
+ visu.write( addr.substr(1), v );
break;
}
}
@@ -95,30 +104,33 @@
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 );
+ var color = jQuery.farbtastic( element ).color || '#000000';
+ color = color.substring(0,1) +
+ toHex( value*255/100 )+
+ color.substring(3);
+ 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 );
+ var color = jQuery.farbtastic( element ).color || '#000000';
+ color = color.substring(0,3) +
+ toHex( value*255/100 )+
+ color.substring(5);
+ 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 );
+ var color = jQuery.farbtastic( element ).color || '#000000';
+ color = color.substring(0,5) +
+ toHex( value*255/100 )+
+ color.substring(7);
+ jQuery.farbtastic( element ).setColor( color );
},
attributes: {
address_r: { type: 'address' , required: true },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-28 20:10:50
|
Revision: 235
http://openautomation.svn.sourceforge.net/openautomation/?rev=235&view=rev
Author: mayerch
Date: 2010-12-28 20:10:44 +0000 (Tue, 28 Dec 2010)
Log Message:
-----------
New Feature: When the url contains the parameter "forceReload" set to true, it'll make sure that all scripts are reloaded and not cached
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-12-28 12:04:40 UTC (rev 234)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-12-28 20:10:44 UTC (rev 235)
@@ -57,9 +57,14 @@
configSuffix = "_" + $.getUrlVar("config");
}
+var forceReload = false;
+if( $.getUrlVar('forceReload') ) {
+ forceReload = $.getUrlVar('forceReload') != 'false'; // true unless set to false
+}
+
$(document).ready(function() {
// get the data once the page was loaded
- $.ajaxSetup({cache: false});
+ $.ajaxSetup({cache: !forceReload});
window.setTimeout("$.get( 'visu_config" + configSuffix + ".xml', parseXML );", 200);
// disable text selection - it's annoying on a touch screen!
@@ -131,12 +136,14 @@
// start with the plugins
var pluginsToLoad = 0;
$( 'meta > plugins plugin', xml ).each( function(i){
- pluginsToLoad += 1;
- var name = $(this).attr('name');
+ pluginsToLoad += 1;
+ var name = 'plugins/' + $(this).attr('name') + '/structure_plugin.js';
+ if( forceReload )
+ name += '?_=' + (new Date().getTime());
var html_doc = document.getElementsByTagName('body')[0];
js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
- js.setAttribute('src', 'plugins/' + name + '/structure_plugin.js');
+ js.setAttribute('src' , name );
html_doc.appendChild(js);
js.onreadystatechange = function () {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-28 12:04:46
|
Revision: 234
http://openautomation.svn.sourceforge.net/openautomation/?rev=234&view=rev
Author: mayerch
Date: 2010-12-28 12:04:40 +0000 (Tue, 28 Dec 2010)
Log Message:
-----------
Bug fix
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 23:54:56 UTC (rev 233)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2010-12-28 12:04:40 UTC (rev 234)
@@ -75,7 +75,7 @@
return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
- return parseInt( hex, 16 ) * 100 / 360.0;
+ return parseInt( hex, 16 ) * 360 / 255.0;
}
},
'5.004' : {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-27 23:55:03
|
Revision: 233
http://openautomation.svn.sourceforge.net/openautomation/?rev=233&view=rev
Author: mayerch
Date: 2010-12-27 23:54:56 +0000 (Mon, 27 Dec 2010)
Log Message:
-----------
Added ability to set precision for displaying float values
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-27 23:12:29 UTC (rev 232)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-27 23:54:56 UTC (rev 233)
@@ -127,9 +127,10 @@
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')
+ 'address' : address,
+ 'precision': $p.attr('precision'),
+ 'mapping' : $p.attr('mapping'),
+ 'styling' : $p.attr('styling')
});
for( var addr in address ) $actor.bind( addr, this.update );
ret_val.append( label ).append( $actor );
@@ -137,10 +138,11 @@
},
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 },
+ precision: { type: 'precision', required: false },
+ mapping: { type: 'mapping' , required: false },
+ styling: { type: 'styling' , required: false }
},
content: { type: 'string' , required: true }
});
@@ -612,6 +614,8 @@
{
var element = passedElement || $(this);
var value = transform( data, element.data().address[ e.type ][0] );
+ if( element.data( 'precision' ) )
+ value = Number( value ).toPrecision( element.data( 'precision' ) );
element.data( 'value', value );
element.find('.value').text( map( value, element ) );
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-27 23:12:29 UTC (rev 232)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-27 23:54:56 UTC (rev 233)
@@ -92,11 +92,11 @@
<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 transform="DPT:5.001">1/2/59</address></info>
+ <info precision="4"><label>R</label><address transform="DPT:5.001">1/2/59</address></info>
<slide><label>R</label><address transform="DPT:5.001">1/2/59</address></slide>
- <info><label>G</label><address transform="DPT:5.001">1/2/60</address></info>
+ <info precision="4"><label>G</label><address transform="DPT:5.001">1/2/60</address></info>
<slide><label>G</label><address transform="DPT:5.001">1/2/60</address></slide>
- <info><label>B</label><address transform="DPT:5.001">1/2/61</address></info>
+ <info precision="4"><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>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-27 23:12:35
|
Revision: 232
http://openautomation.svn.sourceforge.net/openautomation/?rev=232&view=rev
Author: mayerch
Date: 2010-12-27 23:12:29 +0000 (Mon, 27 Dec 2010)
Log Message:
-----------
Remove debug output
(And add additional sliders to debug the colorChooser)
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-27 22:53:32 UTC (rev 231)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-27 23:12:29 UTC (rev 232)
@@ -224,7 +224,6 @@
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) );
visu.write( addr.substr(1), Transform[data.address[addr][0]].encode( ui.value ) );
Modified: CometVisu/trunk/visu/visu_config_neu.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_neu.xml 2010-12-27 22:53:32 UTC (rev 231)
+++ CometVisu/trunk/visu/visu_config_neu.xml 2010-12-27 23:12:29 UTC (rev 232)
@@ -93,7 +93,9 @@
<address transform="DPT:5.001" color="b">1/2/61</address>
</colorchooser>
<info><label>R</label><address transform="DPT:5.001">1/2/59</address></info>
+ <slide><label>R</label><address transform="DPT:5.001">1/2/59</address></slide>
<info><label>G</label><address transform="DPT:5.001">1/2/60</address></info>
+ <slide><label>G</label><address transform="DPT:5.001">1/2/60</address></slide>
<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>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-27 22:53:38
|
Revision: 231
http://openautomation.svn.sourceforge.net/openautomation/?rev=231&view=rev
Author: mayerch
Date: 2010-12-27 22:53:32 +0000 (Mon, 27 Dec 2010)
Log Message:
-----------
Send raw values and bring the CometVisu client back to spec (i.e. don't send the DPT anymore)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/lib/cometvisu-client.js
CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2010-12-27 22:51:16 UTC (rev 230)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2010-12-27 22:53:32 UTC (rev 231)
@@ -209,7 +209,8 @@
{
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), 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 +226,8 @@
{
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) );
+ //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 ) );
}
},
attributes: {
@@ -278,7 +280,8 @@
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) );
+// visu.write( addr.substr(1), data.value=='1' ? '0' : '1', data.address[addr][0].substr(4) );
+ visu.write( addr.substr(1), Transform[data.address[addr][0]].encode( data.value ) );
}
},
attributes: {
@@ -329,7 +332,7 @@
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) );
+ visu.write( addr.substr(1), Transform[data.address[addr][0]].encode( data.sendValue ) );
}
},
attributes: {
Modified: CometVisu/trunk/visu/lib/cometvisu-client.js
===================================================================
--- CometVisu/trunk/visu/lib/cometvisu-client.js 2010-12-27 22:51:16 UTC (rev 230)
+++ CometVisu/trunk/visu/lib/cometvisu-client.js 2010-12-27 22:53:32 UTC (rev 231)
@@ -144,16 +144,10 @@
/**
* This function sends a value
*/
- this.write = function( address, value, datatype ) // FIXME datatype not in spec!!!
+ this.write = function( address, value )
{
- //var request = {};
- //request.a = address; // FIXME the spec allows multiple addresses
- //request.v = value;
-var request = 'a=' + address + '&v=' + value;
-datatype = datatype.split('.');
-request += '&d=' + datatype[0]; // FIXME datatype not in spec!!!
+ var request = 'a=' + address + '&v=' + value;
$.ajax( {url:this.urlPrefix + 'w',dataType: 'json',context:this,data:request} );
-//alert( 'write to "' + address + '" value "' + value + '"' );
}
};
Modified: CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-27 22:51:16 UTC (rev 230)
+++ CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2010-12-27 22:53:32 UTC (rev 231)
@@ -50,22 +50,25 @@
'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;
+ var r = parseInt(color.substring(1, 3), 16) * 100 / 255.0;
+ var g = parseInt(color.substring(3, 5), 16) * 100 / 255.0;
+ var b = parseInt(color.substring(5, 7), 16) * 100 / 255.0;
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) );
+ //visu.write( addr.substr(1), r, address[addr][0].substr(4) );
+ visu.write( addr.substr(1), Transform[address[addr][0]].encode( r ) );
break;
case 'g':
- visu.write( addr.substr(1), g, address[addr][0].substr(4) );
+ //visu.write( addr.substr(1), g, address[addr][0].substr(4) );
+ visu.write( addr.substr(1), Transform[address[addr][0]].encode( g ) );
break;
case 'b':
- visu.write( addr.substr(1), b, address[addr][0].substr(4) );
+ //visu.write( addr.substr(1), b, address[addr][0].substr(4) );
+ visu.write( addr.substr(1), Transform[address[addr][0]].encode( b ) );
break;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|