|
From: <ma...@us...> - 2012-09-04 19:22:09
|
Revision: 999
http://openautomation.svn.sourceforge.net/openautomation/?rev=999&view=rev
Author: mayerch
Date: 2012-09-04 19:22:03 +0000 (Tue, 04 Sep 2012)
Log Message:
-----------
Added new widget: wgpluging_info
This allows to show internal values of the wiregate plugins. The content is updated when a GA in the address-element is recieved.
Modified Paths:
--------------
CometVisu/trunk/visu/index.html
CometVisu/trunk/visu/visu_config_demo.xml
Added Paths:
-----------
CometVisu/trunk/visu/structure/pure/wgplugin_info.js
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2012-09-03 07:11:58 UTC (rev 998)
+++ CometVisu/trunk/visu/index.html 2012-09-04 19:22:03 UTC (rev 999)
@@ -39,6 +39,7 @@
<script src="structure/pure/trigger.js" type="text/javascript"></script>
<script src="structure/pure/unknown.js" type="text/javascript"></script>
<script src="structure/pure/video.js" type="text/javascript"></script>
+ <script src="structure/pure/wgplugin_info.js" type="text/javascript"></script>
<script src="designs/structure_custom.js" type="text/javascript"></script>
<!-- Load the widgets: end -->
<script src="lib/templateengine.js" type="text/javascript"></script>
Added: CometVisu/trunk/visu/structure/pure/wgplugin_info.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/wgplugin_info.js (rev 0)
+++ CometVisu/trunk/visu/structure/pure/wgplugin_info.js 2012-09-04 19:22:03 UTC (rev 999)
@@ -0,0 +1,72 @@
+/* info.js (c) 2012 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
+ */
+
+basicdesign.addCreator('wgplugin_info', {
+ create: function( element, path, flavour, type ) {
+ var $e = $(element);
+ var layout = $e.children('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout, type ) + '"' : '';
+ var ret_val = $('<div class="widget clearfix info" ' + style + ' />');
+ //type == '3d' && ret_val.data( extractLayout3d( layout ) ).bind( 'update3d', this.update3d );
+ type == '3d' && $(document).bind( 'update3d', {element: ret_val, layout: extractLayout3d( layout )}, this.update3d );
+
+ ret_val.setWidgetLayout($e).makeWidgetLabel($e);
+ var address = makeAddressList($e);
+
+ var actor = '<div class="actor"><div class="value">-</div></div>';
+ var $actor = $(actor).data({
+ 'variable' : $e.attr('variable'),
+ 'address' : address,
+ 'format' : $e.attr('format'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling')
+ });
+ for( var addr in address ) $actor.bind( addr, this.update );
+ ret_val.append( $actor );
+ return ret_val;
+ },
+ update: function( e, data, passedElement )
+ {
+ var element = passedElement || $(this);
+
+ var variable = element.data( 'variable' );
+ var valueElement = element.find('.value');
+ $.getJSON('/wg-plugindb.pl?name=' + variable, function(data) {
+ element.setWidgetStyling( element.data( 'basicvalue' ) );
+
+ if( element.data( 'align' ) )
+ element.addClass(element.data( 'align' ) );
+ valueElement.empty();
+ valueElement.append( data[variable] );
+ });
+ },
+ update3d: defaultUpdate3d,
+ attributes: {
+ variable:{ type: 'string' , required: true },
+ format: { type: 'format' , required: false },
+ mapping: { type: 'mapping', required: false },
+ styling: { type: 'styling', required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
+ },
+ elements: {
+ label: { type: 'string' , required: true , multi: false },
+ address: { type: 'address', required: true , multi: true },
+ layout: { type: 'layout' , required: false, multi: false }
+ },
+ content: false
+});
\ No newline at end of file
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2012-09-03 07:11:58 UTC (rev 998)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2012-09-04 19:22:03 UTC (rev 999)
@@ -728,6 +728,14 @@
<address transform="DPT:9" type="">12/7/9</address>
</slide>
</group>
+ <wgplugin_info variable="KNX-Watchdog_last">
+ <label>WireGate Plugin Variable</label>
+ <address transform="DPT:1.001">12/7/1</address>
+ </wgplugin_info>
+ <trigger value="Trigger" mapping="On_Off">
+ <label>Update Value</label>
+ <address transform="DPT:1.001" type="">12/7/1</address>
+ </trigger>
</page>
</page>
</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|