|
From: <ma...@us...> - 2011-12-11 19:27:40
|
Revision: 565
http://openautomation.svn.sourceforge.net/openautomation/?rev=565&view=rev
Author: mayerch
Date: 2011-12-11 19:27:33 +0000 (Sun, 11 Dec 2011)
Log Message:
-----------
Initial commit for 2D (and very little 3D) mode.
Think of it as a proof of concept - and not anything to build on. Anything of it might change in the (hopefully: near) future.
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/visu_config.xsd
Added Paths:
-----------
CometVisu/trunk/visu/media/
CometVisu/trunk/visu/media/demo_2d_backdrop_red_pot.png
CometVisu/trunk/visu/visu_config_2d3d.xml
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-12-10 10:03:11 UTC (rev 564)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-12-11 19:27:33 UTC (rev 565)
@@ -70,7 +70,8 @@
var pstyle = ( '0' != path ) ? 'display:none;' : ''; // subPage style
var name = $p.attr('name');
- var type = $p.attr('type'); //text, 2d or 3d
+ var type = $p.attr('type') || 'text'; //text, 2d or 3d
+ var backdrop = $p.attr('backdrop');
if( $p.attr('flavour') ) flavour = $p.attr('flavour');// sub design choice
var wstyle = ''; // widget style
if( $p.attr('align') ) wstyle += 'text-align:' + $p.attr('align') + ';';
@@ -87,13 +88,17 @@
}
var childs = $p.children();
- var container = $( '<div class="clearfix"/>' );
+ var container = $( '<div class="clearfix" />' );
var $container = $( '<div class="clearfix" path="'+path+'"/>');
for( var addr in address ) $container.bind( addr, this.update );
var container=$container;
container.append( '<h1>' + name + '</h1>' );
+ if( '2d' == type )
+ {
+ container.append( '<img src="' + backdrop + '" style="position: absolute; top: 0px; left: 0px;z-index:-1;"/>' );
+ }
$( childs ).each( function(i){
container.append( create_pages( childs[i], path + '_' + i, flavour ) );
} );
@@ -104,11 +109,13 @@
return ret_val;
},
attributes: {
- align: { type: 'string', required: false },
- flavour:{ type: 'string', required: false },
- name: { type: 'string', required: true },
- ga: { type: 'addr', required: false },
- visible:{ type: 'string', required: false }
+ align: { type: 'string', required: false },
+ flavour: { type: 'string', required: false },
+ name: { type: 'string', required: true },
+ ga: { type: 'addr', required: false },
+ visible: { type: 'string', required: false },
+ type: { type: 'string', required: false },
+ backdrop: { type: 'string', required: false }
},
elements: {
},
@@ -191,7 +198,9 @@
this.addCreator('info', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget info" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget info" ' + style + ' />');
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
@@ -218,6 +227,7 @@
styling: { type: 'styling', required: false }
},
elements: {
+ layout: { type: 'layout', required: false, multi: false },
label: { type: 'string', required: true, multi: false },
address: { type: 'address', required: true, multi: true }
},
@@ -227,7 +237,9 @@
this.addCreator('slide', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget slide" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget slide" ' + style + ' />');
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
@@ -330,6 +342,7 @@
styling: { type: 'styling', required: false }
},
elements: {
+ layout: { type: 'layout', required: false, multi: false },
label: { type: 'string', required: true, multi: false },
address: { type: 'address', required: true, multi: true }
},
@@ -1135,3 +1148,12 @@
return value;
}
+
+function extractLayout( layout )
+{
+ var ret_val = 'position:absolute;';
+ if( layout.getAttribute('x' ) ) ret_val += 'left:' + layout.getAttribute('x' ) + ';';
+ if( layout.getAttribute('y' ) ) ret_val += 'top:' + layout.getAttribute('y' ) + ';';
+ if( layout.getAttribute('width') ) ret_val += 'width:' + layout.getAttribute('width') + ';';
+ return ret_val;
+}
\ No newline at end of file
Added: CometVisu/trunk/visu/media/demo_2d_backdrop_red_pot.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/media/demo_2d_backdrop_red_pot.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2011-12-10 10:03:11 UTC (rev 564)
+++ CometVisu/trunk/visu/visu_config.xsd 2011-12-11 19:27:33 UTC (rev 565)
@@ -16,6 +16,12 @@
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
+<xsd:complexType name="layout">
+ <xsd:attribute name="x" type="xsd:string" use="optional" />
+ <xsd:attribute name="y" type="xsd:string" use="optional" />
+ <xsd:attribute name="width" type="xsd:string" use="optional" />
+</xsd:complexType>
+
<xsd:complexType name="address">
<xsd:simpleContent>
<xsd:extension base="addr">
@@ -180,6 +186,16 @@
<xsd:attribute ref="align" use="optional" />
<xsd:attribute name="ga" type="addr" use="optional" />
<xsd:attribute name="visible" type="xsd:boolean" />
+ <xsd:attribute name="type" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="text"/>
+ <xsd:enumeration value="2d"/>
+ <xsd:enumeration value="3d"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="backdrop" type="uri" use="optional" />
</xsd:complexType>
</xsd:element>
@@ -302,6 +318,7 @@
<xsd:choice maxOccurs="unbounded" minOccurs="1">
<xsd:element name="label" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" />
+ <xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
</xsd:choice>
<xsd:attribute ref="min" />
<xsd:attribute ref="max" />
@@ -314,6 +331,7 @@
<xsd:choice maxOccurs="unbounded" minOccurs="1">
<xsd:element name="label" type="xsd:string" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1"/>
+ <xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
</xsd:choice>
<xsd:attribute ref="format" use="optional" />
<xsd:attribute ref="styling" use="optional" />
Added: CometVisu/trunk/visu/visu_config_2d3d.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_2d3d.xml (rev 0)
+++ CometVisu/trunk/visu/visu_config_2d3d.xml 2011-12-11 19:27:33 UTC (rev 565)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" design="pure" xsi:noNamespaceSchemaLocation="visu_config.xsd">
+ <meta>
+ <plugins>
+ <plugin name="colorchooser"/>
+ <plugin name="diagram"/>
+ </plugins>
+ <mappings>
+ <mapping name="Open_Close">
+ <entry value="0">zu</entry>
+ <entry value="1">offen</entry>
+ </mapping>
+ <mapping name="Close_Open">
+ <entry value="0">offen</entry>
+ <entry value="1">zu</entry>
+ </mapping>
+ <mapping name="On_Off">
+ <entry value="0">Aus</entry>
+ <entry value="1">An</entry>
+ </mapping>
+ <mapping name="Off_On">
+ <entry value="0">An</entry>
+ <entry value="1">Aus</entry>
+ </mapping>
+ <mapping name="KonnexHVAC">
+ <entry value="auto">Auto</entry>
+ <entry value="comfort">Komfort</entry>
+ <entry value="standby">Stand By</entry>
+ <entry value="economy">Economy</entry>
+ <entry value="building_protection">Haus-Schutz</entry>
+ </mapping>
+ </mappings>
+ <stylings>
+ <styling name="Red_Green">
+ <entry value="0">red</entry>
+ <entry value="1">green</entry>
+ </styling>
+ <styling name="Green_Red">
+ <entry value="0">green</entry>
+ <entry value="1">red</entry>
+ </styling>
+ <styling name="Blue_Green_Red">
+ <entry range_min="-100" range_max="20">blue</entry>
+ <entry range_min="20" range_max="22">green</entry>
+ <entry range_min="22" range_max="100">red</entry>
+ </styling>
+ </stylings>
+ <statusbar>
+ <status type="html"><![CDATA[
+ <img src="icon/comet_64_ff8000.png" alt="CometVisu" /> by <a href="http://www.cometvisu.org/">CometVisu.org</a>
+ - <a href=".?forceReload=true">Reload</a>
+ - <a href="?config=demo">Widget Demo</a>
+ ]]></status>
+ <status type="html" condition="!edit" hrefextend="config"><![CDATA[
+ - <a href="edit_config.html">Edit</a>
+ ]]></status>
+ <status type="html" condition="edit" hrefextend="all"><![CDATA[
+ - <a href=".">normal Mode</a>
+ ]]></status>
+ <status type="html"><![CDATA[
+ - <a href="check_config.php">Check Config</a>
+ <div style="float:right;padding-right:0.5em">Version: SVN</div>
+ ]]></status>
+ </statusbar>
+ </meta>
+ <page name="Start" type="text">
+ <line/>
+ <text align="center">Welcome to the CometVisu!</text>
+ <break/>
+ <page name="2D Demo" type="2d" backdrop="media/demo_2d_backdrop_red_pot.png">
+ <slide>
+ <layout x="0px" y="470px" width="600px" />
+ <label>Level</label>
+ <address transform="DPT:5.001" type="">12/7/52</address>
+ </slide>
+ <info format="%.2f">
+ <layout x="350px" y="370px" />
+ <address transform="DPT:5.001" type="">12/7/52</address>
+ </info>
+ </page>
+ <page name="3D Demo" >
+ <text>not avialable at the moment...</text>
+ </page>
+ <line/>
+ </page>
+</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|