|
From: <j-...@us...> - 2013-02-12 17:16:59
|
Revision: 1472
http://openautomation.svn.sourceforge.net/openautomation/?rev=1472&view=rev
Author: j-n-k
Date: 2013-02-12 17:16:47 +0000 (Tue, 12 Feb 2013)
Log Message:
-----------
Pt. 1 of diagram-plugin cleanup, config upgrade and removed code diagram_inline/diagram_popup
re-committed toggle in visu_config.xsd
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php
CometVisu/trunk/visu/visu_config.xsd
CometVisu/trunk/visu/visu_config_demo.xml
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-11 16:47:07 UTC (rev 1471)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-12 17:16:47 UTC (rev 1472)
@@ -47,7 +47,7 @@
* - title: optional, diagram title (overrides label-content)
*
* functions:
- * - createDiagram(page, path, oldType)
+ * - createDiagram(page, path)
* - refreshDiagram(diagram, flotoptions, data)
*
*/
@@ -97,7 +97,7 @@
return { axes: axes, axesnum: axesnum, rrd: rrd, rrdnum: rrdnum };
}
-function createDiagram( page, path, oldType ) {
+function createDiagram( page, path ) {
var $p = $(page);
function uniqid() {
@@ -117,10 +117,9 @@
if ($p.attr("width")) {
diagram.css("width", $p.attr("width"));
- } else {
- if (oldType=="popup") {
+ }
+ if ($p.attr("previewlabels")=="false") {
diagram.removeClass("diagram_inline").addClass("diagram_preview");
- }
}
if ($p.attr("height")) {
diagram.css("height", $p.attr("height"));
@@ -150,7 +149,7 @@
diagram.data("ispopup", false);
- if ((oldType=="popup") || ($p.attr("popup")=="true")) {
+ if ($p.attr("popup")=="true") {
diagram.bind("click", function() {
bDiagram.data(data);
bDiagram.data("ispopup", true);
@@ -197,7 +196,7 @@
return false;
});
}
- if ((oldType=="inline") || ($p.attr("previewlabels") == "true")) {
+ if ($p.attr("previewlabels") == "true") {
//refreshDiagram(diagram, {});
} else {
refreshDiagram(diagram, {xaxes: [{ticks: 0}], yaxes: [{ticks: 0}]});
@@ -207,21 +206,10 @@
}
-VisuDesign_Custom.prototype.addCreator("diagram_inline", {
- create: function( page, path ) {
- return createDiagram(page, path, "inline");
- }
-});
-VisuDesign_Custom.prototype.addCreator("diagram_popup", {
- create: function(page,path) {
- return createDiagram(page, path, "popup");
- }
-});
-
VisuDesign_Custom.prototype.addCreator("diagram", {
create: function(page,path) {
- return createDiagram(page, path, "none");
+ return createDiagram(page, path);
}
});
Modified: CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php
===================================================================
--- CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php 2013-02-11 16:47:07 UTC (rev 1471)
+++ CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php 2013-02-12 17:16:47 UTC (rev 1472)
@@ -134,6 +134,31 @@
$this->log('renamed ' . $i . ' nodes of type \'iframe\' to \'web\'');
unset($objElements, $i);
+ // change diagram_popup to diagram
+
+ $objElements = $objXPath->query('//diagram_popup');
+ $i = 0;
+ foreach ($objElements as $objElement) {
+ $objElement->setAttribute('popup', 'true');
+ $objElement->setAttribute('previewlabels', 'false');
+ $this->renameNode($objElement, 'diagram');
+ ++$i;
+ }
+ $this->log('changed ' . $i . ' nodes of type \'diagram_popup\' to \'diagram\'');
+ unset($objElements);
+
+ // change diagram_popup to diagram
+ $objElements = $objXPath->query('//diagram_inline');
+ $i = 0;
+ foreach ($objElements as $objElement) {
+ $objElement->setAttribute('popup', 'false');
+ $objElement->setAttribute('previewlabels', 'true');
+ $this->renameNode($objElement, 'diagram');
+ ++$i;
+ }
+ $this->log('changed ' . $i . ' nodes of type \'diagram_inline\' to \'diagram\'');
+ unset($objElements);
+
// remove whitespace-attributes
$objAttributes = $objXPath->query('//@*[.=\' \']');
$i = 0;
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2013-02-11 16:47:07 UTC (rev 1471)
+++ CometVisu/trunk/visu/visu_config.xsd 2013-02-12 17:16:47 UTC (rev 1472)
@@ -331,8 +331,6 @@
<xsd:choice>
<xsd:element name="clock" type="clock" />
<xsd:element name="colorchooser" type="colorchooser" />
- <xsd:element name="diagram_popup" type="diagram_popup" />
- <xsd:element name="diagram_inline" type="diagram_inline" />
<xsd:element name="diagram_info" type="diagram_info" />
<xsd:element name="diagram" type="diagram" />
<xsd:element name="rss" type="rss" />
@@ -816,49 +814,6 @@
<xsd:attribute name="tooltip" type="xsd:boolean" use="optional" />
</xsd:complexType>
- <xsd:complexType name="diagram_inline">
- <xsd:sequence>
- <xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="label" type="label" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="axis" type="axis" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="rrd" type="rrd" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="rrd" type="xsd:string" use="optional" />
- <xsd:attribute name="unit" type="xsd:string" use="optional" />
- <xsd:attribute name="width" type="dimension" use="optional" />
- <xsd:attribute ref="series" use="optional" />
- <xsd:attribute name="height" type="dimension" use="optional" />
- <xsd:attribute name="refresh" type="xsd:integer" use="optional" />
- <xsd:attribute name="period" type="xsd:string" use="optional" />
- <xsd:attribute ref="datasource" use="optional" />
- <xsd:attribute name="linecolor" type="xsd:string" use="optional" />
- <xsd:attribute name="gridcolor" type="xsd:string" use="optional" />
- <xsd:attribute name="yaxismin" type="xsd:string" use="optional" />
- <xsd:attribute name="yaxismax" type="xsd:string" use="optional" />
- <xsd:attribute name="title" type="xsd:string" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="diagram_popup">
- <xsd:sequence>
- <xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="label" type="label" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="axis" type="axis" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="rrd" type="rrd" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="rrd" type="xsd:string" use="optional" />
- <xsd:attribute name="unit" type="xsd:string" use="optional" />
- <xsd:attribute ref="series" use="optional" />
- <xsd:attribute name="refresh" type="xsd:integer" use="optional" />
- <xsd:attribute name="period" type="xsd:string" use="optional" />
- <xsd:attribute ref="datasource" use="optional" />
- <xsd:attribute name="tooltip" type="xsd:boolean" use="optional" />
- <xsd:attribute name="linecolor" type="xsd:string" use="optional" />
- <xsd:attribute name="gridcolor" type="xsd:string" use="optional" />
- <xsd:attribute name="yaxismin" type="xsd:string" use="optional" />
- <xsd:attribute name="yaxismax" type="xsd:string" use="optional" />
- <xsd:attribute name="title" type="xsd:string" use="optional" />
- </xsd:complexType>
-
<xsd:complexType name="diagram_info">
<xsd:sequence>
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1"/>
@@ -951,7 +906,17 @@
<xsd:complexType name="line" />
- <!-- toggle is not yet implemented -->
+ <xsd:complexType name="toogle">
+ <xsd:sequence>
+ <xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="label" type="label" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="address" type="address" minOccurs="1" />
+ </xsd:sequence>
+ <xsd:attribute ref="styling" use="optional" />
+ <xsd:attribute ref="mapping" use="optional" />
+ <xsd:attribute ref="align" use="optional" />
+ <xsd:attribute ref="flavour" use="optional" />
+ </xsd:complexType><!-- toggle is not yet implemented -->
<xsd:complexType name="axis">
<xsd:simpleContent>
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2013-02-11 16:47:07 UTC (rev 1471)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2013-02-12 17:16:47 UTC (rev 1472)
@@ -1097,12 +1097,12 @@
<address transform="DPT:5.001" mode="readwrite">12/7/52</address>
</slide>
<break/>
- <diagram_popup rrd="eib_traffic" unit="tps" series="day" refresh="300">
+ <diagram rrd="eib_traffic" unit="tps" series="day" refresh="300" popup="true" previewlabels="false">
<label>KNX traffic</label>
- </diagram_popup>
- <diagram_inline rrd="eib_traffic" width="600" height="400">
+ </diagram>
+ <diagram rrd="eib_traffic" width="600" height="400" popup="false" previewlabels="true">
<label/>
- </diagram_inline>
+ </diagram>
<diagram_info rrd="eib_traffic" unit="tps" series="day" refresh="300">
<label>KNX traffic</label>
<address transform="DPT:9.021" mode="readwrite">12/7/9</address>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|