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: <pf...@us...> - 2012-04-15 08:39:49
|
Revision: 755
http://openautomation.svn.sourceforge.net/openautomation/?rev=755&view=rev
Author: pfry
Date: 2012-04-15 08:39:43 +0000 (Sun, 15 Apr 2012)
Log Message:
-----------
etwas eleganter mit given...when
Modified Paths:
--------------
wiregate/plugin/generic/Ansagen.pl
Modified: wiregate/plugin/generic/Ansagen.pl
===================================================================
--- wiregate/plugin/generic/Ansagen.pl 2012-04-14 22:05:09 UTC (rev 754)
+++ wiregate/plugin/generic/Ansagen.pl 2012-04-15 08:39:43 UTC (rev 755)
@@ -71,6 +71,7 @@
elsif($event=~/bus/ && $msg{'apci'} eq 'A_GroupValue_Write')
{
my $ga=$msg{'dst'};
+ my $val=$msg{'value'};
my $dpt=$eibgaconf{$ga}{'DPTSubId'};
$dpt=1.017 unless defined $dpt; # = Trigger, bedeutet Textansage ohne Daten
@@ -102,78 +103,64 @@
}
# Informationsteil (Inhalt des Telegramms)
- if($dpt == 1.017)
+ given($dpt)
{
- # kein Datenzusatz
- }
- elsif($dpt == 1.001) # An/Aus
- {
- push(@statement, 'Zahlen/'.($msg{'value'}?'an':'aus').'.wav');
- }
- elsif($dpt == 1.008) # Hoch/Runter
- {
- push(@statement, 'Zahlen/'.($msg{'value'}?'hoch':'runter').'.wav');
- }
- elsif($dpt == 1.009) # Auf/Zu
- {
- push(@statement, 'Zahlen/'.($msg{'value'}?'auf':'zu').'.wav');
- }
- elsif($dpt == 5.010 || $dpt == 7.001) # Ordinalzahl
- {
- push(@statement, number(\@speech, $msg{'value'}, -1));
- }
- elsif($dpt == 6.010 || $dpt == 8.001) # Kardinalzahl
- {
- push(@statement, number(\@speech, $msg{'value'}));
- }
- elsif($dpt == 6.001 || $dpt == 5.001) # Prozent
- {
- push(@statement, number(\@speech, $msg{'value'}));
- push(@statement, 'Zahlen/Prozent.wav');
- }
- elsif($dpt == 9.001) # Temperatur
- {
- push(@statement, number(\@speech, $msg{'value'}, 1));
- push(@statement, 'Zahlen/Grad.wav');
- }
- elsif($dpt == 11.001) # Datum
- {
- if($msg{'value'}=~/^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])/)
- {
- my @monat=qw(Januar Februar Maerz April Mai Juni Juli August September Oktober November Dezember);
- push(@statement, number(\@speech, $3, -1));
- push(@statement, 'Monate/'.$monat[$2-1].'.wav') if defined $2 && $2>0 && $2<13;
+ when (1.001) # An/Aus
+ { push(@statement, 'Zahlen/'.($val?'an':'aus').'.wav'); }
+ when (1.008) # Hoch/Runter
+ { push(@statement, 'Zahlen/'.($val?'hoch':'runter').'.wav'); }
+ when(1.009) # Auf/Zu
+ { push(@statement, 'Zahlen/'.($val?'auf':'zu').'.wav'); }
+ when([5.010,7.001,12.001]) # Ordinalzahl
+ { push(@statement, number(\@speech, $val, -1)); }
+ when([6.010,8.001,13.001]) # Kardinalzahl
+ { push(@statement, number(\@speech, $val)); }
+ when([5.001,6.001]) # Prozent
+ {
+ push(@statement, number(\@speech, $val));
+ push(@statement, 'Zahlen/Prozent.wav');
}
- else
+ when(9.001) # Temperatur
{
- return "Unbekanntes Datumsformat $msg{value}";
+ push(@statement, number(\@speech, $val, 1));
+ push(@statement, 'Zahlen/Grad.wav');
}
- }
- elsif($dpt == 10.001) # Uhrzeit
- {
- if($msg{'value'}=~/^(Mo|Di|Mi|Do|Fr|Sa|So)\s+([0-9][0-9])\:([0-9][0-9])/)
+ when(11.001) # Datum
{
- push(@statement, "Wochentage/$1.wav");
- push(@statement, number(\@speech, $2));
- push(@statement, "Zeiten/Uhr.wav");
- push(@statement, number(\@speech, $3));
+ if($val=~/^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])/)
+ {
+ my @monat=qw(Januar Februar Maerz April Mai Juni Juli August September Oktober November Dezember);
+ push(@statement, number(\@speech, $3, -1));
+ push(@statement, 'Monate/'.$monat[$2-1].'.wav') if defined $2 && $2>0 && $2<13;
+ }
+ else
+ {
+ return "Unbekanntes Datumsformat $val";
+ }
}
- elsif($msg{'value'}=~/^([0-9][0-9])\:([0-9][0-9])}\:([0-9][0-9])/)
+ when(10.001) # Uhrzeit
{
- push(@statement, number(\@speech, $2));
- push(@statement, "Zeiten/Uhr.wav");
- push(@statement, number(\@speech, $3));
+ if($val=~/^(Mo|Di|Mi|Do|Fr|Sa|So)\s+([0-9][0-9])\:([0-9][0-9])/)
+ {
+ push(@statement, "Wochentage/$1.wav");
+ push(@statement, number(\@speech, $2));
+ push(@statement, "Zeiten/Uhr.wav");
+ push(@statement, number(\@speech, $3));
+ }
+ elsif($val=~/^([0-9][0-9])\:([0-9][0-9])}\:([0-9][0-9])/)
+ {
+ push(@statement, number(\@speech, $2));
+ push(@statement, "Zeiten/Uhr.wav");
+ push(@statement, number(\@speech, $3));
+ }
+ else
+ {
+ return "Unbekanntes Uhrzeitformat $msg{value}";
+ }
}
- else
- {
- return "Unbekanntes Uhrzeitformat $msg{value}";
- }
+ when(1.017) {} # kein Datenzusatz
+ default { return "Datentyp $dpt nicht implementiert"; }
}
- else
- {
- return "Datentyp $dpt nicht implementiert";
- }
-
# Das komplette Statement in die Ausgabe geben
speak($channel, $name, @statement);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-04-14 22:05:16
|
Revision: 754
http://openautomation.svn.sourceforge.net/openautomation/?rev=754&view=rev
Author: mayerch
Date: 2012-04-14 22:05:09 +0000 (Sat, 14 Apr 2012)
Log Message:
-----------
Clean up: the API sends an element to the widgets and not a page
Modified Paths:
--------------
CometVisu/trunk/visu/structure/pure/group.js
CometVisu/trunk/visu/structure/pure/iframe.js
CometVisu/trunk/visu/structure/pure/image.js
CometVisu/trunk/visu/structure/pure/imagetrigger.js
CometVisu/trunk/visu/structure/pure/infotrigger.js
CometVisu/trunk/visu/structure/pure/line.js
CometVisu/trunk/visu/structure/pure/multitrigger.js
CometVisu/trunk/visu/structure/pure/slide.js
CometVisu/trunk/visu/structure/pure/switch.js
CometVisu/trunk/visu/structure/pure/text.js
CometVisu/trunk/visu/structure/pure/toggle.js
CometVisu/trunk/visu/structure/pure/trigger.js
CometVisu/trunk/visu/structure/pure/unknown.js
CometVisu/trunk/visu/structure/pure/video.js
Modified: CometVisu/trunk/visu/structure/pure/group.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/group.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/group.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -17,20 +17,20 @@
basicdesign.addCreator('group', {
maturity: Maturity.development,
- create: function( page, path, flavour ) {
- var $p = $(page);
+ create: function( element, path, flavour ) {
+ var $e = $(element);
var ret_val = $('<div class="widget clearfix group" />');
- if( $p.attr('flavour') ) flavour = $p.attr('flavour');// sub design choice
+ if( $e.attr('flavour') ) flavour = $e.attr('flavour');// sub design choice
var hstyle = ''; // heading style
- if( $p.attr('align') ) hstyle += 'text-align:' + $p.attr('align') + ';';
+ if( $e.attr('align') ) hstyle += 'text-align:' + $e.attr('align') + ';';
if( hstyle != '' ) hstyle = 'style="' + hstyle + '"';
- ret_val.setWidgetLayout($p);
- if ($p.attr('nowidget')=='true') {
+ ret_val.setWidgetLayout($e);
+ if ($e.attr('nowidget')=='true') {
ret_val.removeClass('widget');
}
- var childs = $p.children();
+ var childs = $e.children();
var container = $( '<div class="clearfix"/>' );
- if( $p.attr('name') ) container.append( '<h2 ' + hstyle + '>' + $p.attr('name') + '</h2>' );
+ if( $e.attr('name') ) container.append( '<h2 ' + hstyle + '>' + $e.attr('name') + '</h2>' );
$( childs ).each( function(i){
container.append( create_pages( childs[i], path + '_' + i, flavour ) );
} );
Modified: CometVisu/trunk/visu/structure/pure/iframe.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/iframe.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/iframe.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,26 +16,26 @@
*/
basicdesign.addCreator('iframe', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget iframe" ' + style + '/>');
- ret_val.setWidgetLayout($p);
- ret_val.append( '<div class="label">' + page.textContent + '</div>' );
+ ret_val.setWidgetLayout($e);
+ ret_val.append( '<div class="label">' + element.textContent + '</div>' );
var iframeStyle = '';
- if( $p.attr('width' ) ) {
- iframeStyle += 'width:' + $p.attr('width' ) + ';';
+ if( $e.attr('width' ) ) {
+ iframeStyle += 'width:' + $e.attr('width' ) + ';';
} else { // default width is 100% of widget space (fix bug #3175343 part 1)
iframeStyle += 'width: 100%;';
}
- if( $p.attr('height') ) iframeStyle += 'height:' + $p.attr('height') + ';';
- if( $p.attr('frameborder') == 'false' ) style += 'border: 0px ;';
- if( $p.attr('background') ) iframeStyle += 'background-color:' + $p.attr('background') + ';';
+ if( $e.attr('height') ) iframeStyle += 'height:' + $e.attr('height') + ';';
+ if( $e.attr('frameborder') == 'false' ) style += 'border: 0px ;';
+ if( $e.attr('background') ) iframeStyle += 'background-color:' + $e.attr('background') + ';';
if( iframeStyle != '' ) iframeStyle = 'style="' + iframeStyle + '"';
- var actor = '<div class="actor"><iframe src="' +$p.attr('src') + '" ' + iframeStyle + '></iframe></div>';
+ var actor = '<div class="actor"><iframe src="' +$e.attr('src') + '" ' + iframeStyle + '></iframe></div>';
- var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
+ var refresh = $e.attr('refresh') ? $e.attr('refresh')*1000 : 0;
ret_val.append( $(actor).data( {
'refresh': refresh
} ).each(setupRefreshAction) ); // abuse "each" to call in context...
Modified: CometVisu/trunk/visu/structure/pure/image.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/image.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/image.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,24 +16,24 @@
*/
basicdesign.addCreator('image', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix image" ' + style + '/>');
- ret_val.setWidgetLayout($p);
- var labelElement = $p.find('label')[0];
+ ret_val.setWidgetLayout($e);
+ var labelElement = $e.find('label')[0];
ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
var imgStyle = '';
- if( $p.attr('width' ) ) {
- imgStyle += 'width:' + $p.attr('width' ) + ';';
+ if( $e.attr('width' ) ) {
+ imgStyle += 'width:' + $e.attr('width' ) + ';';
} else {
imgStyle += 'width: 100%;';
}
- if( $p.attr('height') ) imgStyle += 'height:' + $p.attr('height') + ';';
+ if( $e.attr('height') ) imgStyle += 'height:' + $e.attr('height') + ';';
if( imgStyle != '' ) imgStyle = 'style="' + imgStyle + '"';
- var actor = '<div class="actor"><img src="' +$p.attr('src') + '" ' + imgStyle + '/></div>';
- var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
+ var actor = '<div class="actor"><img src="' +$e.attr('src') + '" ' + imgStyle + '/></div>';
+ var refresh = $e.attr('refresh') ? $e.attr('refresh')*1000 : 0;
ret_val.append( $(actor).data( {
'refresh': refresh
} ).each(setupRefreshAction) ); // abuse "each" to call in context...
Modified: CometVisu/trunk/visu/structure/pure/imagetrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/imagetrigger.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/imagetrigger.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,16 +16,16 @@
*/
basicdesign.addCreator('imagetrigger', {
- create: function( page, path ) {
- var $p = $(page);
+ create: function( element, path ) {
+ var $e = $(element);
var ret_val = $('<div class="widget clearfix image" />');
- ret_val.setWidgetLayout($p);
+ ret_val.setWidgetLayout($e);
ret_val.addClass ('imagetrigger');
- var value = $p.attr('value') ? $p.attr('value') : 0;
- var labelElement = $p.find('label')[0];
+ var value = $e.attr('value') ? $e.attr('value') : 0;
+ var labelElement = $e.find('label')[0];
ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
var address = {};
- $p.find('address').each( function(){
+ $e.find('address').each( function(){
var src = this.textContent;
ga_list.push( src )
address[ '_' + src ] = [
@@ -39,22 +39,22 @@
var style = layout ? 'style="' + extractLayout( layout, {width:'100%'} ) + '"' : '';
var actor = '<div class="actor">';
- if ( $p.attr('type')=='show' )
- actor += '<img src="' + $p.attr('src') + '.' + $p.attr('suffix') + '" ' + style + ' />';
+ if ( $e.attr('type')=='show' )
+ actor += '<img src="' + $e.attr('src') + '.' + $e.attr('suffix') + '" ' + style + ' />';
else
actor += '<img src="" ' + style + ' />';
actor += '</div>';
actor += '</div>';
- var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
+ var refresh = $e.attr('refresh') ? $e.attr('refresh')*1000 : 0;
var $actor = $(actor).data( {
'address': address,
'refresh': refresh,
- 'src': $p.attr('src'),
- 'suffix': $p.attr('suffix'),
- 'type': $p.attr('type'),
+ 'src': $e.attr('src'),
+ 'suffix': $e.attr('suffix'),
+ 'type': $e.attr('type'),
'mapping': map,
- 'sendValue': $p.attr('sendValue') || ""
+ 'sendValue': $e.attr('sendValue') || ""
} )
.each(setupRefreshAction) // abuse "each" to call in context... refresh is broken with select right now
.bind( 'click', this.action );
Modified: CometVisu/trunk/visu/structure/pure/infotrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/infotrigger.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/infotrigger.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,20 +16,20 @@
*/
basicdesign.addCreator('infotrigger', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix switch" ' + style + '/>');
- ret_val.setWidgetLayout($p);
+ ret_val.setWidgetLayout($e);
// handle label
- var labelElement = $p.find('label')[0];
+ var labelElement = $e.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
ret_val.append( label );
// handle addresses
var address = {};
- $p.find('address').each( function(){
+ $e.find('address').each( function(){
var src = this.textContent;
var transform = this.getAttribute('transform');
var readonly = this.getAttribute('readonly' ) == 'true';
@@ -45,20 +45,20 @@
var buttonCount = 2;
var actordown = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actordown += $p.attr( 'align' );
+ if ( $e.attr( 'align' ) )
+ actordown += $e.attr( 'align' );
actordown += '">';
- actordown += '<div class="value">' + ($p.attr('downlabel') ? $p.attr('downlabel') : '-') + '</div>';
+ actordown += '<div class="value">' + ($e.attr('downlabel') ? $e.attr('downlabel') : '-') + '</div>';
actordown += '</div>';
var $actordown = $(actordown).data( {
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('downvalue') || 0,
- 'align' : $p.attr('align'),
- 'change' : $p.attr('change') || 'relative',
- 'min' : parseFloat($p.attr('min')) || 0,
- 'max' : parseFloat($p.attr('max')) || 255,
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'value' : $e.attr('downvalue') || 0,
+ 'align' : $e.attr('align'),
+ 'change' : $e.attr('change') || 'relative',
+ 'min' : parseFloat($e.attr('min')) || 0,
+ 'max' : parseFloat($e.attr('max')) || 255,
'type' : 'switch'
} ).bind( 'click', this.action ).bind( 'mousedown', function(){
$(this).removeClass('switchUnpressed').addClass('switchPressed');
@@ -67,20 +67,20 @@
} );
var actorup = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actorup += $p.attr( 'align' );
+ if ( $e.attr( 'align' ) )
+ actorup += $e.attr( 'align' );
actorup += '">';
- actorup += '<div class="value">' + ($p.attr('uplabel') ? $p.attr('uplabel') : '+') + '</div>';
+ actorup += '<div class="value">' + ($e.attr('uplabel') ? $e.attr('uplabel') : '+') + '</div>';
actorup += '</div>';
var $actorup = $(actorup).data( {
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('upvalue') || 1,
- 'align' : $p.attr('align'),
- 'change' : $p.attr('change') || 'relative',
- 'min' : parseFloat($p.attr('min')) || 0,
- 'max' : parseFloat($p.attr('max')) || 255,
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'value' : $e.attr('upvalue') || 1,
+ 'align' : $e.attr('align'),
+ 'change' : $e.attr('change') || 'relative',
+ 'min' : parseFloat($e.attr('min')) || 0,
+ 'max' : parseFloat($e.attr('max')) || 255,
'type' : 'switch'
} ).bind( 'click', this.action ).bind( 'mousedown', function(){
$(this).removeClass('switchUnpressed').addClass('switchPressed');
@@ -89,15 +89,15 @@
} );
var actorinfo = '<div class="actor switchInvisible" ';
- if ( $p.attr( 'align' ) )
- actorinfo += 'style="text-align: '+$p.attr( 'align' )+'" ';
+ if ( $e.attr( 'align' ) )
+ actorinfo += 'style="text-align: '+$e.attr( 'align' )+'" ';
actorinfo += '" ><div class="value">-</div></div>';
var $actorinfo = $(actorinfo).data({
'address' : address,
- 'format' : $p.attr('format'),
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'align' : $p.attr('align'),
+ 'format' : $e.attr('format'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'align' : $e.attr('align'),
});
for( var addr in address )
{
@@ -105,11 +105,11 @@
$actorinfo.bind( addr, this.update );
}
- if ( $p.attr('infoposition' )==1 ) {
+ if ( $e.attr('infoposition' )==1 ) {
buttons.append( $actordown );
buttons.append( $actorinfo );
buttons.append( $actorup );
- } else if ( $p.attr('infoposition' )==2 ) {
+ } else if ( $e.attr('infoposition' )==2 ) {
buttons.append( $actordown );
buttons.append( $actorup );
buttons.append( $actorinfo );
Modified: CometVisu/trunk/visu/structure/pure/line.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/line.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/line.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,7 +16,7 @@
*/
basicdesign.addCreator('line', {
- create: function( page, path ) {
+ create: function( element, path ) {
return $( '<hr />' );
},
attributes: {},
Modified: CometVisu/trunk/visu/structure/pure/multitrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/multitrigger.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/multitrigger.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,35 +16,35 @@
*/
basicdesign.addCreator('multitrigger', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix switch" ' + style + '/>');
- ret_val.setWidgetLayout($p)
- var labelElement = $p.find('label')[0];
+ ret_val.setWidgetLayout($e)
+ var labelElement = $e.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = makeAddressList($p);
- var showstatus = $p.attr("showstatus") || "false";
+ var address = makeAddressList($e);
+ var showstatus = $e.attr("showstatus") || "false";
ret_val.append( label );
var buttons = $('<div style="float:left"/>');
var buttonCount = 0;
- if( $p.attr('button1label') )
+ if( $e.attr('button1label') )
{
//buttonCount++;
var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
+ if ( $e.attr( 'align' ) )
+ actor += $e.attr( 'align' );
actor += '">';
- actor += '<div class="value">' + $p.attr('button1label') + '</div>';
+ actor += '<div class="value">' + $e.attr('button1label') + '</div>';
actor += '</div>';
var $actor = $(actor).data( {
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('button1value'),
- 'align' : $p.attr('align'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'value' : $e.attr('button1value'),
+ 'align' : $e.attr('align'),
'type' : 'switch'
} ).bind( 'click', this.action );
if( showstatus == "true" ) {
@@ -53,21 +53,21 @@
buttons.append( $actor );
if( 1 == (buttonCount++ % 2) ) buttons.append( $('<br/>') );
}
- if( $p.attr('button2label') )
+ if( $e.attr('button2label') )
{
var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
+ if ( $e.attr( 'align' ) )
+ actor += $e.attr( 'align' );
actor += '">';
- actor += '<div class="value">' + $p.attr('button2label') + '</div>';
+ actor += '<div class="value">' + $e.attr('button2label') + '</div>';
actor += '</div>';
var $actor = $(actor).data( {
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('button2value'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'value' : $e.attr('button2value'),
'type' : 'switch',
- 'align' : $p.attr('align')
+ 'align' : $e.attr('align')
} ).bind( 'click', this.action );
if( showstatus == "true" ) {
for( var addr in address ) $actor.bind( addr, this.update );
@@ -75,19 +75,19 @@
buttons.append( $actor );
if( 1 == (buttonCount++ % 2) ) buttons.append( $('<br/>') );
}
- if( $p.attr('button3label') )
+ if( $e.attr('button3label') )
{
var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
+ if ( $e.attr( 'align' ) )
+ actor += $e.attr( 'align' );
actor += '">';
- actor += '<div class="value">' + $p.attr('button3label') + '</div>';
+ actor += '<div class="value">' + $e.attr('button3label') + '</div>';
actor += '</div>';
var $actor = $(actor).data( {
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('button3value'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'value' : $e.attr('button3value'),
'type' : 'switch'
} ).bind( 'click', this.action );
if( showstatus == "true" ) {
@@ -96,19 +96,19 @@
buttons.append( $actor );
if( 1 == buttonCount++ % 2 ) buttons.append( $('<br/>') );
}
- if( $p.attr('button4label') )
+ if( $e.attr('button4label') )
{
var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
+ if ( $e.attr( 'align' ) )
+ actor += $e.attr( 'align' );
actor += '">';
- actor += '<div class="value">' + $p.attr('button4label') + '</div>';
+ actor += '<div class="value">' + $e.attr('button4label') + '</div>';
actor += '</div>';
var $actor = $(actor).data( {
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('button4value'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'value' : $e.attr('button4value'),
'type' : 'switch',
} ).bind( 'click', this.action );
if( showstatus == "true" ) {
Modified: CometVisu/trunk/visu/structure/pure/slide.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/slide.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/slide.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,16 +16,16 @@
*/
basicdesign.addCreator('slide', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix slide" ' + style + ' />');
- ret_val.setWidgetLayout($p).makeWidgetLabel($p);
+ ret_val.setWidgetLayout($e).makeWidgetLabel($e);
var address = {};
var datatype_min = undefined;
var datatype_max = undefined;
- $p.find('address').each( function(){
+ $e.find('address').each( function(){
var src = this.textContent;
var transform = this.getAttribute('transform');
var readonly = this.getAttribute('readonly');
@@ -41,14 +41,14 @@
}
});
var actor = $('<div class="actor">');
- var min = parseFloat( $p.attr('min') || datatype_min || 0 );
- var max = parseFloat( $p.attr('max') || datatype_max || 100 );
- var step = parseFloat( $p.attr('step') || 0.5 );
+ var min = parseFloat( $e.attr('min') || datatype_min || 0 );
+ var max = parseFloat( $e.attr('max') || datatype_max || 100 );
+ var step = parseFloat( $e.attr('step') || 0.5 );
var $actor = $(actor).data({
'events': $(actor).data( 'events' ),
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
'min' : min,
'max' : max,
'step' : step,
Modified: CometVisu/trunk/visu/structure/pure/switch.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/switch.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/switch.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,23 +16,23 @@
*/
basicdesign.addCreator('switch', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix switch" ' + style + '/>');
- ret_val.setWidgetLayout($p)
- var labelElement = $p.find('label')[0];
+ ret_val.setWidgetLayout($e)
+ var labelElement = $e.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = makeAddressList($p);
+ var address = makeAddressList($e);
var actor = '<div class="actor switchUnpressed"><div class="value">-</div></div>';
var $actor = $(actor).data( {
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'on_value' : $p.attr('on_value' ) || 1,
- 'off_value' : $p.attr('off_value') || 0,
- 'align' : $p.attr('align'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'on_value' : $e.attr('on_value' ) || 1,
+ 'off_value' : $e.attr('off_value') || 0,
+ 'align' : $e.attr('align'),
'type' : 'switch'
} ).bind( 'click', this.action );
for( var addr in address )
Modified: CometVisu/trunk/visu/structure/pure/text.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/text.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/text.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,16 +16,16 @@
*/
basicdesign.addCreator('text', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix text" ' + style + '/>');
- ret_val.setWidgetLayout($p);
+ ret_val.setWidgetLayout($e);
var style = '';
- if( $p.attr('align') ) style += 'text-align:' + $p.attr('align') + ';';
+ if( $e.attr('align') ) style += 'text-align:' + $e.attr('align') + ';';
if( style != '' ) style = 'style="' + style + '"';
- ret_val.append( '<div ' + style + '>' + page.textContent + '</div>' );
+ ret_val.append( '<div ' + style + '>' + element.textContent + '</div>' );
return ret_val;
},
attributes: {
Modified: CometVisu/trunk/visu/structure/pure/toggle.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/toggle.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/toggle.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,21 +16,21 @@
*/
basicdesign.addCreator('toggle', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix toggle" ' + style + '/>');
- ret_val.setWidgetLayout($p);
- var labelElement = $p.find('label')[0];
+ ret_val.setWidgetLayout($e);
+ var labelElement = $e.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = makeAddressList($p);
+ var address = makeAddressList($e);
var actor = '<div class="actor switchUnpressed"><div class="value">-</div></div>';
var $actor = $(actor).data( {
'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'align' : $p.attr('align'),
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'align' : $e.attr('align'),
'type' : 'switch'
} ).bind( 'click', this.action );
for( var addr in address ) $actor.bind( addr, this.update );
Modified: CometVisu/trunk/visu/structure/pure/trigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/trigger.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/trigger.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,21 +16,21 @@
*/
basicdesign.addCreator('trigger', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
- var value = $p.attr('value') ? $p.attr('value') : 0;
+ var value = $e.attr('value') ? $e.attr('value') : 0;
var ret_val = $('<div class="widget clearfix switch" ' + style + ' />');
- ret_val.setWidgetLayout($p);
- var labelElement = $p.find('label')[0];
+ ret_val.setWidgetLayout($e);
+ var labelElement = $e.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = makeAddressList($p);
+ var address = makeAddressList($e);
var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
+ if ( $e.attr( 'align' ) )
+ actor += $e.attr( 'align' );
actor += '">';
- var map = $p.attr('mapping');
+ var map = $e.attr('mapping');
if( mappings[map] && mappings[map][value] )
actor += '<div class="value">' + mappings[map][value] + '</div>';
else
@@ -38,10 +38,10 @@
actor += '</div>';
var $actor = $(actor).data( {
'address' : address,
- 'mapping' : $(page).attr('mapping'),
- 'styling' : $(page).attr('styling'),
+ 'mapping' : $(element).attr('mapping'),
+ 'styling' : $(element).attr('styling'),
'type' : 'trigger',
- 'align' : $p.attr('align'),
+ 'align' : $e.attr('align'),
'sendValue': value
} ).bind( 'click', this.action ).bind( 'mousedown', function(){
$(this).removeClass('switchUnpressed').addClass('switchPressed');
Modified: CometVisu/trunk/visu/structure/pure/unknown.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/unknown.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/unknown.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,9 +16,9 @@
*/
basicdesign.addCreator('unknown', {
- create: function( page, path ) {
+ create: function( element, path ) {
var ret_val = $('<div class="widget clearfix" />');
- ret_val.append( '<pre>unknown: ' + page.nodeName + '</pre>' );
+ ret_val.append( '<pre>unknown: ' + element.nodeName + '</pre>' );
return ret_val;
},
attributes: {},
Modified: CometVisu/trunk/visu/structure/pure/video.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/video.js 2012-04-14 21:10:37 UTC (rev 753)
+++ CometVisu/trunk/visu/structure/pure/video.js 2012-04-14 22:05:09 UTC (rev 754)
@@ -16,20 +16,20 @@
*/
basicdesign.addCreator('video', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix video" ' + style + '/>');
- ret_val.setWidgetLayout($p);
- var labelElement = $p.find('label')[0];
+ ret_val.setWidgetLayout($e);
+ var labelElement = $e.find('label')[0];
ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
- var autoplay = ($p.attr('autoplay') && $p.attr('autoplay')=='true') ? ' autoplay="autoplay"' : '';
+ var autoplay = ($e.attr('autoplay') && $e.attr('autoplay')=='true') ? ' autoplay="autoplay"' : '';
var style = '';
- if( $p.attr('width' ) ) style += 'width:' + $p.attr('width' ) + ';';
- if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
+ if( $e.attr('width' ) ) style += 'width:' + $e.attr('width' ) + ';';
+ if( $e.attr('height') ) style += 'height:' + $e.attr('height') + ';';
if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><video src="' +$p.attr('src') + '" ' + style + autoplay + ' controls="controls" /></div>';
+ var actor = '<div class="actor"><video src="' +$e.attr('src') + '" ' + style + autoplay + ' controls="controls" /></div>';
ret_val.append( $(actor).data( {} ) );
return ret_val;
},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-04-14 21:10:44
|
Revision: 753
http://openautomation.svn.sourceforge.net/openautomation/?rev=753&view=rev
Author: mayerch
Date: 2012-04-14 21:10:37 +0000 (Sat, 14 Apr 2012)
Log Message:
-----------
Added layout support for most missing widgets (=> necessary for 2d pages)
Modified Paths:
--------------
CometVisu/trunk/visu/structure/pure/_common.js
CometVisu/trunk/visu/structure/pure/break.js
CometVisu/trunk/visu/structure/pure/iframe.js
CometVisu/trunk/visu/structure/pure/image.js
CometVisu/trunk/visu/structure/pure/imagetrigger.js
CometVisu/trunk/visu/structure/pure/infotrigger.js
CometVisu/trunk/visu/structure/pure/multitrigger.js
CometVisu/trunk/visu/structure/pure/page.js
CometVisu/trunk/visu/structure/pure/switch.js
CometVisu/trunk/visu/structure/pure/text.js
CometVisu/trunk/visu/structure/pure/toggle.js
CometVisu/trunk/visu/structure/pure/video.js
Modified: CometVisu/trunk/visu/structure/pure/_common.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/_common.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/_common.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -353,12 +353,21 @@
//console.log( e, data, e.data, pos.x, pos.y );
}
-function extractLayout( layout )
+function extractLayout( layout, defaultValues )
{
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') + ';';
+ if( layout.getAttribute('x' ) ) ret_val += 'left:' + layout.getAttribute('x' ) + ';';
+ else if( defaultValues[ 'x' ] ) ret_val += 'left:' + defaultValues[ 'x' ] + ';';
+
+ if( layout.getAttribute('y' ) ) ret_val += 'top:' + layout.getAttribute('y' ) + ';';
+ else if( defaultValues[ 'y' ] ) ret_val += 'top:' + defaultValues[ 'y' ] + ';';
+
+ if( layout.getAttribute('width' ) ) ret_val += 'width:' + layout.getAttribute('width' ) + ';';
+ else if( defaultValues[ 'width' ] ) ret_val += 'width:' + defaultValues[ 'width' ] + ';';
+
+ if( layout.getAttribute('height') ) ret_val += 'height:' + layout.getAttribute('height') + ';';
+ else if( defaultValues[ 'height'] ) ret_val += 'height:' + defaultValues[ 'height'] + ';';
+
return ret_val;
}
Modified: CometVisu/trunk/visu/structure/pure/break.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/break.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/break.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -16,7 +16,7 @@
*/
basicdesign.addCreator('break', {
- create: function( page, path ) {
+ create: function( element, path ) {
return $( '<br />' );
},
attributes: {},
Modified: CometVisu/trunk/visu/structure/pure/iframe.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/iframe.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/iframe.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -18,20 +18,22 @@
basicdesign.addCreator('iframe', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget iframe" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget iframe" ' + style + '/>');
ret_val.setWidgetLayout($p);
ret_val.append( '<div class="label">' + page.textContent + '</div>' );
- var style = '';
+ var iframeStyle = '';
if( $p.attr('width' ) ) {
- style += 'width:' + $p.attr('width' ) + ';';
+ iframeStyle += 'width:' + $p.attr('width' ) + ';';
} else { // default width is 100% of widget space (fix bug #3175343 part 1)
- style += 'width: 100%;';
+ iframeStyle += 'width: 100%;';
}
- if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
+ if( $p.attr('height') ) iframeStyle += 'height:' + $p.attr('height') + ';';
if( $p.attr('frameborder') == 'false' ) style += 'border: 0px ;';
- if( $p.attr('background') ) style += 'background-color:' + $p.attr('background') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><iframe src="' +$p.attr('src') + '" ' + style + '></iframe></div>';
+ if( $p.attr('background') ) iframeStyle += 'background-color:' + $p.attr('background') + ';';
+ if( iframeStyle != '' ) iframeStyle = 'style="' + iframeStyle + '"';
+ var actor = '<div class="actor"><iframe src="' +$p.attr('src') + '" ' + iframeStyle + '></iframe></div>';
var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
ret_val.append( $(actor).data( {
@@ -41,8 +43,8 @@
},
attributes: {
src: { type: 'uri' , required: true },
- width: { type: 'string' , required: false },
- height: { type: 'string' , required: false },
+ width: { type: 'string' , required: false }, // only for the iframe - not the widget!
+ height: { type: 'string' , required: false }, // only for the iframe - not the widget!
frameborder: { type: 'list' , required: false, list: {'true': "yes", 'false': "no"} },
background: { type: 'string' , required: false },
refresh: { type: 'numeric', required: false },
@@ -50,7 +52,8 @@
rowspan: { type: 'numeric', required: false }
},
elements: {
- label: { type: 'string', required: false, multi: false }
+ layout: { type: 'layout' , required: false, multi: false },
+ label: { type: 'string' , required: false, multi: false }
},
content: false
});
\ No newline at end of file
Modified: CometVisu/trunk/visu/structure/pure/image.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/image.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/image.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -18,19 +18,21 @@
basicdesign.addCreator('image', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget clearfix image" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget clearfix image" ' + style + '/>');
ret_val.setWidgetLayout($p);
var labelElement = $p.find('label')[0];
ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
- var style = '';
+ var imgStyle = '';
if( $p.attr('width' ) ) {
- style += 'width:' + $p.attr('width' ) + ';';
+ imgStyle += 'width:' + $p.attr('width' ) + ';';
} else {
- style += 'width: 100%;';
+ imgStyle += 'width: 100%;';
}
- if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><img src="' +$p.attr('src') + '" ' + style + ' /></div>';
+ if( $p.attr('height') ) imgStyle += 'height:' + $p.attr('height') + ';';
+ if( imgStyle != '' ) imgStyle = 'style="' + imgStyle + '"';
+ var actor = '<div class="actor"><img src="' +$p.attr('src') + '" ' + imgStyle + '/></div>';
var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
ret_val.append( $(actor).data( {
'refresh': refresh
@@ -39,14 +41,15 @@
},
attributes: {
src: { type: 'uri' , required: true },
- width: { type: 'string' , required: false },
- height: { type: 'string' , required: false },
+ width: { type: 'string' , required: false }, // only for the image - not the widget!
+ height: { type: 'string' , required: false }, // only for the image - not the widget!
refresh: { type: 'numeric', required: false },
colspan: { type: 'numeric', required: false },
rowspan: { type: 'numeric', required: false }
},
elements: {
- label: { type: 'string', required: false, multi: false }
+ layout: { type: 'layout' , required: false, multi: false },
+ label: { type: 'string' , required: false, multi: false }
},
content: false
});
\ No newline at end of file
Modified: CometVisu/trunk/visu/structure/pure/imagetrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/imagetrigger.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/imagetrigger.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -35,9 +35,8 @@
}
];
});
- var style = ' style=" ';
- style += $p.attr('width' ) ? 'width:' + $p.attr('width' ) + ';' : 'width: 100%;';
- style += $p.attr('height' ) ? 'height:' + $p.attr('height' ) + ';"' : '"';
+ var layout = $e.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout, {width:'100%'} ) + '"' : '';
var actor = '<div class="actor">';
if ( $p.attr('type')=='show' )
@@ -99,8 +98,6 @@
},
attributes: {
src: { type: 'uri' , required: true },
- width: { type: 'string' , required: false },
- height: { type: 'string' , required: false },
refresh: { type: 'numeric', required: false },
colspan: { type: 'numeric', required: false },
rowspan: { type: 'numeric', required: false },
@@ -110,6 +107,7 @@
suffix: { type: 'list' , required: false, list: {'png': '.png', 'jpg': '.jpg', 'gif': '.gif', 'svg': '.svg', 'bmp': '.bmp'} }
},
elements: {
+ layout: { type: 'layout' , required: false, multi: false },
label: { type: 'string' , required: false, multi: false },
address: { type: 'address', required: true , multi: true }
},
Modified: CometVisu/trunk/visu/structure/pure/infotrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/infotrigger.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/infotrigger.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -18,7 +18,9 @@
basicdesign.addCreator('infotrigger', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget clearfix switch" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget clearfix switch" ' + style + '/>');
ret_val.setWidgetLayout($p);
// handle label
var labelElement = $p.find('label')[0];
@@ -161,6 +163,7 @@
rowspan: { type: 'numeric', required: false }
},
elements: {
+ layout: { type: 'layout' , required: false, multi: false },
label: { type: 'string' , required: false, multi: false },
address: { type: 'address', required: true , multi: true , options: {variant: ['', 'isbutton']} }
},
Modified: CometVisu/trunk/visu/structure/pure/multitrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/multitrigger.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/multitrigger.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -18,7 +18,9 @@
basicdesign.addCreator('multitrigger', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget clearfix switch" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget clearfix switch" ' + style + '/>');
ret_val.setWidgetLayout($p)
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
@@ -152,6 +154,7 @@
rowspan: { type: 'numeric', required: false }
},
elements: {
+ layout: { type: 'layout' , required: false, multi: false },
label: { type: 'string' , required: false, multi: false },
address: { type: 'address', required: true , multi: true }
},
Modified: CometVisu/trunk/visu/structure/pure/page.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/page.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/page.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -40,7 +40,9 @@
if ($p.attr('visible')=='false') {
ret_val=$('');
} else { // default is visible
- ret_val = $('<div class="widget clearfix link pagelink"/>');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ ret_val = $('<div class="widget clearfix link pagelink" ' + style + '/>');
ret_val.setWidgetLayout($p);
var tst = $('<div ' + wstyle + '><a href="javascript:scrollToPage(\''+path+'\')">' + name + '</a></div>');
@@ -112,6 +114,7 @@
floor: { type: 'addr' , required: false }
},
elements: {
+ layout: { type: 'layout' , required: false, multi: false }
},
update: function(e, data) {
var element = $(this);
Modified: CometVisu/trunk/visu/structure/pure/switch.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/switch.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/switch.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -18,7 +18,9 @@
basicdesign.addCreator('switch', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget clearfix switch" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget clearfix switch" ' + style + '/>');
ret_val.setWidgetLayout($p)
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
@@ -65,8 +67,9 @@
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 },
+ label: { type: 'string' , required: true , multi: false },
+ address: { type: 'address', required: true , multi: true }
},
content: false
});
\ No newline at end of file
Modified: CometVisu/trunk/visu/structure/pure/text.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/text.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/text.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -18,7 +18,9 @@
basicdesign.addCreator('text', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget clearfix text" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget clearfix text" ' + style + '/>');
ret_val.setWidgetLayout($p);
var style = '';
if( $p.attr('align') ) style += 'text-align:' + $p.attr('align') + ';';
@@ -32,6 +34,7 @@
rowspan: { type: 'numeric', required: false }
},
elements: {
+ layout: { type: 'layout' , required: false, multi: false }
},
content: { type: 'string', required: true }
});
\ No newline at end of file
Modified: CometVisu/trunk/visu/structure/pure/toggle.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/toggle.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/toggle.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -18,7 +18,9 @@
basicdesign.addCreator('toggle', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget clearfix toggle" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget clearfix toggle" ' + style + '/>');
ret_val.setWidgetLayout($p);
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
@@ -69,8 +71,9 @@
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 },
+ label: { type: 'string' , required: true, multi: false },
+ address: { type: 'address', required: true, multi: true }
},
content: false
});
\ No newline at end of file
Modified: CometVisu/trunk/visu/structure/pure/video.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/video.js 2012-04-14 15:23:12 UTC (rev 752)
+++ CometVisu/trunk/visu/structure/pure/video.js 2012-04-14 21:10:37 UTC (rev 753)
@@ -18,7 +18,9 @@
basicdesign.addCreator('video', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget clearfix video" />');
+ var layout = $p.find('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var ret_val = $('<div class="widget clearfix video" ' + style + '/>');
ret_val.setWidgetLayout($p);
var labelElement = $p.find('label')[0];
ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
@@ -40,6 +42,7 @@
rowspan: { type: 'numeric', required: false }
},
elements: {
+ layout: { type: 'layout' , required: false, multi: false },
label: { type: 'string' , required: false, multi: false }
},
content: false
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pf...@us...> - 2012-04-14 15:23:19
|
Revision: 752
http://openautomation.svn.sourceforge.net/openautomation/?rev=752&view=rev
Author: pfry
Date: 2012-04-14 15:23:12 +0000 (Sat, 14 Apr 2012)
Log Message:
-----------
PL30 Analyse des Aufrufgrundes
Modified Paths:
--------------
wiregate/plugin/generic/Ansagen.pl
Modified: wiregate/plugin/generic/Ansagen.pl
===================================================================
--- wiregate/plugin/generic/Ansagen.pl 2012-04-13 11:55:56 UTC (rev 751)
+++ wiregate/plugin/generic/Ansagen.pl 2012-04-14 15:23:12 UTC (rev 752)
@@ -28,12 +28,10 @@
my $event=undef;
if (!$plugin_initflag)
{ $event='restart'; } # Restart des daemons / Reboot
-elsif ((stat('/etc/wiregate/plugin/generic/' . $plugname))[9] > time()-10)
-# ab PL30:
-# elsif ($plugin_info{$plugname.'_lastsaved'} > $plugin_info{$plugname.'_last'})
+elsif ($plugin_info{$plugname.'_lastsaved'} > $plugin_info{$plugname.'_last'})
{ $event='modified'; } # Plugin modifiziert
elsif (%msg) { $event='bus'; } # Bustraffic
-#elsif ($fh) { $event='socket'; } # Netzwerktraffic
+elsif ($fh) { $event='socket'; } # Netzwerktraffic
else { $event='cycle'; } # Zyklus
chdir $speechdir;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pf...@us...> - 2012-04-13 11:56:02
|
Revision: 751
http://openautomation.svn.sourceforge.net/openautomation/?rev=751&view=rev
Author: pfry
Date: 2012-04-13 11:55:56 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
Modified Paths:
--------------
wiregate/plugin/generic/Ansagen.pl
wiregate/plugin/generic/conf.d/Ansagen.conf
Modified: wiregate/plugin/generic/Ansagen.pl
===================================================================
--- wiregate/plugin/generic/Ansagen.pl 2012-04-13 11:31:06 UTC (rev 750)
+++ wiregate/plugin/generic/Ansagen.pl 2012-04-13 11:55:56 UTC (rev 751)
@@ -8,7 +8,7 @@
use POSIX qw(floor);
-# Konfiguration vorbereiten und einlesen
+# Defaultkonfiguration
my $logfile='/var/log/Ansagen.log';
my $speechdir='/var/lib/Ansagen/Sprache/';
my %channels=('default'=>'welcome');
Modified: wiregate/plugin/generic/conf.d/Ansagen.conf
===================================================================
--- wiregate/plugin/generic/conf.d/Ansagen.conf 2012-04-13 11:31:06 UTC (rev 750)
+++ wiregate/plugin/generic/conf.d/Ansagen.conf 2012-04-13 11:55:56 UTC (rev 751)
@@ -1,3 +1,7 @@
+#!/usr/bin/perl
+#
+# Ansagen.pl - Konfiguration
+
# Voraussetzungen:
# 1. Im Verzeichnis $speechdir/Zahlen muessen folgende Dateien vorhanden sein:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pf...@us...> - 2012-04-13 11:31:15
|
Revision: 750
http://openautomation.svn.sourceforge.net/openautomation/?rev=750&view=rev
Author: pfry
Date: 2012-04-13 11:31:06 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
Konfiguration in ein separates File im conf.d-Verzeichnis verschoben
Modified Paths:
--------------
wiregate/plugin/generic/Ansagen.pl
Added Paths:
-----------
wiregate/plugin/generic/conf.d/Ansagen.conf
Modified: wiregate/plugin/generic/Ansagen.pl
===================================================================
--- wiregate/plugin/generic/Ansagen.pl 2012-04-13 08:14:14 UTC (rev 749)
+++ wiregate/plugin/generic/Ansagen.pl 2012-04-13 11:31:06 UTC (rev 750)
@@ -8,92 +8,21 @@
use POSIX qw(floor);
-# Voraussetzungen:
-
-# 1. Im Verzeichnis $speechdir/Zahlen muessen folgende Dateien vorhanden sein:
-
-# 1.1. Kardinalzahlen ("Null", "Eins"):
-# c0.wav...c19.wav, c20.wav...c90.wav, c100.wav, c1000.wav
-
-# 1.2. Ordinalzahlen ("Erster", "Zweiter"):
-# o0.wav...o19.wav, o20.wav...o90.wav, o100.wav, o1000.wav
-
-# 1.3. Zahlteile mit "und" wie "...undzwanzig", "...unddreissigster":
-# uc20.wav...uc90.wav, uo20.wav...uo90.wav
-
-# 1.4. Ziffern zur Zahlbildung ("ein"):
-# u1.wav...u9.wav (u1.wav="ein" als Bestandteil von "einunzwanzig",
-# u2.wav...u9.wav koennen identisch mit c2.wav...c9.wav sein)
-
-# 1.7. Spezielle Woerter:
-# minus.wav, Komma.wav, Grad.wav, Prozent.wav
-# auf.wav, zu.wav, hoch.wav, runter.wav, an.wav, aus.wav
-
-# 2. Im Verzeichnis $speechdir/Monate muessen die Namen der Monate liegen:
-# Januar.wav ... Dezember.wav
-
-# 3. Im Verzeichnis $speechdir/Wochentage muessen die Wochentagsnamen liegen:
-# Mo.wav ... So.wav
-
-# 4. Ein Piepton $speechdir/beep.wav mit Pieptoenen, die vor der Sprachausgabe
-# gesendet werden (weckt bei mir den Russound-Paging-Kanal auf, der sonst die
-# ersten Silben verschluckt). Bei mir ist das wiederum ein ganzes Verzeichnis
-# Beep mit Dateien 01.wav ... 32.wav in aufsteigender Dauer sortiert
-
-# 5. Im Verzeichnis $speechdir ausserdem:
-# Alle Woerter bzw. ganze Saetze, die vorgelesen werden sollen,
-# wobei zB ein Satz "Willkommen Fry" in der Datei $speechdir/Willkommen/Fry.wav
-# liegen darf
-
-# alle diese Audiodateien kann man sich online generieren, zB bei SVOX.
-
-# Plugin-Konfiguration ################################################
-
-# Ausgabekanal:
-# Die ALSA-Kanalunterscheidung wird durch die Namensgebung der GA
-# in eibga.conf getroffen. Das Muster ffuer dieKanalunterscheidung
-# steht in %channels.
-
-# Textteil: Der Rest des GA-Namens wird als Text "vorgelesen".
-# Das Plugin sucht dabei zunaechst nach einem "exact match" einer Datei
-# im Sprachverzeichnis. Wenn dieser Match nicht existieren sollte, werden
-# die Woerter getrennt und jedes einzeln gesucht.
-
-# Datenteil:
-# Am Ende des Textteils wird der Telegramminhalt aufgesagt,
-# wobei folgende Datentypen erlaubt sind:
-# 1.017: (keine Daten, nur den GA-Namen vorlesen)
-# 1.001: "An/Aus"
-# 1.008: "Hoch/Runter"
-# 1.009: "Auf/Zu"
-# 5.010 / 7.001: Ordinalzahl ("Einundzwanzigster")
-# 6.010 / 8.001: Kardinalzahl ("Einundzwanzig")
-# 6.001 / 5.001: Prozentwert ("dreiundfuenfzig Prozent")
-# 9.001: Temperatur ("minus drei komma fuenf Grad")
-# 11.001: # Datum ("elfter April")
-# 10.001: # Wochentag+Uhrzeit ("Montag elf Uhr fuenfzehn")
-
-# Hier meine Konfiguration als Beispiel:
-
-# ANsagen gehen auf ALSA-Kanal 'welcome' und kommen ueber einen eigenen
-# kleinen Verstaerker im Eingangsflur raus
-
-# DURCHsagen gehen auf ALSA-Kanal 'paging' und gehen ueber die Russound an
-# alle Lautsprecher im Haus. Dort muss ein Beep vorweggesendet werden
-
+# Konfiguration vorbereiten und einlesen
my $logfile='/var/log/Ansagen.log';
my $speechdir='/var/lib/Ansagen/Sprache/';
-my %channels=(
- '^WA_'=>'welcome', # zB "WA_Die Aussentemperatur betraegt"
- '^WD_'=>'paging', # zB "WD_Folgende Fenster sind geoeffnet"
- 'default'=>'welcome' # die GAs in additional_subscriptions
-);
+my %channels=('default'=>'welcome');
my $beepchannel='paging';
-my $beep = sprintf "Beep/%02d.wav", 3; # int(rand(32))+1 fuer Zufallsbeep
-#my @additional_subscriptions=qw(0/7/245 0/7/246 6/2/186);
+my $beep = "Beep/03d.wav";
my @additional_subscriptions=();
-############### Ende der Konfiguration #########################
+# Konfigurationsfile einlesen
+my $conf=$plugname; $conf=~s/\.pl$/.conf/;
+open FILE, "</etc/wiregate/plugin/generic/conf.d/$conf" || return "no config found";
+my @lines = <FILE>;
+close FILE;
+eval("@lines");
+return "config error" if $@;
# Aufrufgrund ermitteln
my $event=undef;
Added: wiregate/plugin/generic/conf.d/Ansagen.conf
===================================================================
--- wiregate/plugin/generic/conf.d/Ansagen.conf (rev 0)
+++ wiregate/plugin/generic/conf.d/Ansagen.conf 2012-04-13 11:31:06 UTC (rev 750)
@@ -0,0 +1,86 @@
+# Voraussetzungen:
+
+# 1. Im Verzeichnis $speechdir/Zahlen muessen folgende Dateien vorhanden sein:
+
+# 1.1. Kardinalzahlen ("Null", "Eins"):
+# c0.wav...c19.wav, c20.wav...c90.wav, c100.wav, c1000.wav
+
+# 1.2. Ordinalzahlen ("Erster", "Zweiter"):
+# o0.wav...o19.wav, o20.wav...o90.wav, o100.wav, o1000.wav
+
+# 1.3. Zahlteile mit "und" wie "...undzwanzig", "...unddreissigster":
+# uc20.wav...uc90.wav, uo20.wav...uo90.wav
+
+# 1.4. Ziffern zur Zahlbildung ("ein"):
+# u1.wav...u9.wav (u1.wav="ein" als Bestandteil von "einunzwanzig",
+# u2.wav...u9.wav koennen identisch mit c2.wav...c9.wav sein)
+
+# 1.7. Spezielle Woerter:
+# minus.wav, Komma.wav, Grad.wav, Prozent.wav
+# auf.wav, zu.wav, hoch.wav, runter.wav, an.wav, aus.wav
+
+# 2. Im Verzeichnis $speechdir/Monate muessen die Namen der Monate liegen:
+# Januar.wav ... Dezember.wav
+
+# 3. Im Verzeichnis $speechdir/Wochentage muessen die Wochentagsnamen liegen:
+# Mo.wav ... So.wav
+
+# 4. Ein Piepton $speechdir/beep.wav mit Pieptoenen, die vor der Sprachausgabe
+# gesendet werden (weckt bei mir den Russound-Paging-Kanal auf, der sonst die
+# ersten Silben verschluckt). Bei mir ist das wiederum ein ganzes Verzeichnis
+# Beep mit Dateien 01.wav ... 32.wav in aufsteigender Dauer sortiert
+
+# 5. Im Verzeichnis $speechdir ausserdem:
+# Alle Woerter bzw. ganze Saetze, die vorgelesen werden sollen,
+# wobei zB ein Satz "Willkommen Fry" in der Datei $speechdir/Willkommen/Fry.wav
+# liegen darf
+
+# alle diese Audiodateien kann man sich online generieren, zB bei SVOX.
+
+# Plugin-Konfiguration ################################################
+
+# Ausgabekanal:
+# Die ALSA-Kanalunterscheidung wird durch die Namensgebung der GA
+# in eibga.conf getroffen. Das Muster ffuer dieKanalunterscheidung
+# steht in %channels.
+
+# Textteil: Der Rest des GA-Namens wird als Text "vorgelesen".
+# Das Plugin sucht dabei zunaechst nach einem "exact match" einer Datei
+# im Sprachverzeichnis. Wenn dieser Match nicht existieren sollte, werden
+# die Woerter getrennt und jedes einzeln gesucht.
+
+# Datenteil:
+# Am Ende des Textteils wird der Telegramminhalt aufgesagt,
+# wobei folgende Datentypen erlaubt sind:
+# 1.017: (keine Daten, nur den GA-Namen vorlesen)
+# 1.001: "An/Aus"
+# 1.008: "Hoch/Runter"
+# 1.009: "Auf/Zu"
+# 5.010 / 7.001: Ordinalzahl ("Einundzwanzigster")
+# 6.010 / 8.001: Kardinalzahl ("Einundzwanzig")
+# 6.001 / 5.001: Prozentwert ("dreiundfuenfzig Prozent")
+# 9.001: Temperatur ("minus drei komma fuenf Grad")
+# 11.001: # Datum ("elfter April")
+# 10.001: # Wochentag+Uhrzeit ("Montag elf Uhr fuenfzehn")
+
+# Hier meine Konfiguration als Beispiel:
+
+# ANsagen gehen auf ALSA-Kanal 'welcome' und kommen ueber einen eigenen
+# kleinen Verstaerker im Eingangsflur raus
+
+# DURCHsagen gehen auf ALSA-Kanal 'paging' und gehen ueber die Russound an
+# alle Lautsprecher im Haus. Dort muss ein Beep vorweggesendet werden
+
+$logfile='/var/log/Ansagen.log';
+$speechdir='/var/lib/Ansagen/Sprache/';
+%channels=(
+ '^WA_'=>'welcome', # zB "WA_Die Aussentemperatur betraegt"
+ '^WD_'=>'paging', # zB "WD_Folgende Fenster sind geoeffnet"
+ 'default'=>'welcome' # die GAs in additional_subscriptions
+);
+$beepchannel='paging';
+$beep = sprintf "Beep/%02d.wav", 3; # int(rand(32))+1 fuer Zufallsbeep
+#my @additional_subscriptions=qw(0/7/245 0/7/246 6/2/186);
+@additional_subscriptions=();
+
+############### Ende der Konfiguration #########################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mic...@us...> - 2012-04-13 09:14:44
|
Revision: 749
http://openautomation.svn.sourceforge.net/openautomation/?rev=749&view=rev
Author: michi26206
Date: 2012-04-13 08:14:14 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
Added Paths:
-----------
wiregate/plugin/generic/Oder-Funktion.pl
Added: wiregate/plugin/generic/Oder-Funktion.pl
===================================================================
--- wiregate/plugin/generic/Oder-Funktion.pl (rev 0)
+++ wiregate/plugin/generic/Oder-Funktion.pl 2012-04-13 08:14:14 UTC (rev 749)
@@ -0,0 +1,78 @@
+######################################################################################
+#
+# Oder Verkn\xFCpfung
+# V0.1 2012-04-05
+# by Michi26206 - www.knx-user-forum.de
+#
+######################################################################################
+
+#########################
+### BEGINN DEFINITION ###
+#########################
+
+# Aufruf-Zyklus auf 300 Sekunden setzen
+$plugin_info{$plugname.'_cycle'} = 300;
+
+
+#GA\xB4s
+my $Oder1GA = '0/3/2';
+my $Oder2GA = '0/3/3';
+my $Oder3GA = '0/3/9';
+my $Oder4GA = '0/3/10';
+my $Oder5GA = '0/3/11';
+my $AusgangOderGA = '0/3/1';
+
+
+#Plugin auf GAs anmelden
+$plugin_subscribe{$Oder1GA}{$plugname} = 1;
+$plugin_subscribe{$Oder2GA}{$plugname} = 1;
+$plugin_subscribe{$Oder3GA}{$plugname} = 1;
+$plugin_subscribe{$Oder4GA}{$plugname} = 1;
+$plugin_subscribe{$Oder5GA}{$plugname} = 1;
+
+
+#########################
+### ENDE DEFINITION ###
+#########################
+
+# Plugin aufgrund eines eintreffenden Telegramms oder zyklisch bearbeiten
+# bei eintreffenden Telegrammen auf "Write" reagieren
+
+if ($msg{'apci'} eq "A_GroupValue_Write") {
+ if ($msg{'dst'} eq $Oder1GA) {
+ $plugin_info{$plugname.'_Oder1'} = int($msg{'data'});
+ }
+
+ if ($msg{'dst'} eq $Oder2GA) {
+ $plugin_info{$plugname.'_Oder2'} = int($msg{'data'});
+ }
+
+ if ($msg{'dst'} eq $Oder3GA) {
+ $plugin_info{$plugname.'_Oder3'} = int($msg{'data'});
+ }
+
+ if ($msg{'dst'} eq $Oder4GA) {
+ $plugin_info{$plugname.'_Oder4'} = int($msg{'data'});
+ }
+
+ if ($msg{'dst'} eq $Oder5GA) {
+ $plugin_info{$plugname.'_Oder5'} = int($msg{'data'});
+ }
+} else { # zyklischer Aufruf
+ #$plugin_info{$plugname.'_Oder1'} = knx_read($Oder1GA,300,1);
+ #$plugin_info{$plugname.'_Oder2'} = knx_read($Oder2GA,300,1);
+ #$plugin_info{$plugname.'_Oder3'} = knx_read($Oder3GA,300,1);
+ #$plugin_info{$plugname.'_Oder4'} = knx_read($Oder4GA,300,1);
+ #$plugin_info{$plugname.'_Oder5'} = knx_read($Oder5GA,300,1);
+}
+
+#Oder-Funktion
+if (($plugin_info{$plugname.'_Oder1'} == 1) || ($plugin_info{$plugname.'_Oder2'} == 1) || ($plugin_info{$plugname.'_Oder3'} == 1) || ($plugin_info{$plugname.'_Oder4'} == 1) || ($plugin_info{$plugname.'_Oder5'} == 1)) {
+ knx_write($AusgangOderGA,1,1);
+ $plugin_info{$plugname.'_Ausgang'} = 1;
+} else {
+ knx_write($AusgangOderGA,0,1);
+ $plugin_info{$plugname.'_Ausgang'} = 0;
+}
+
+return;
\ 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: <pf...@us...> - 2012-04-13 05:47:27
|
Revision: 748
http://openautomation.svn.sourceforge.net/openautomation/?rev=748&view=rev
Author: pfry
Date: 2012-04-13 05:47:21 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
dieses kleine Plugin hat sich f?\195?\131?\197?\146r mich als hilfreich erwiesen: es analysiert regelm?\195?\131?\226?\130?\172?\195?\131ig zu ALLEN Plugins die Namen der abonnierten GAs und zeigt sie ?\195?\131?\197?\146bersichtlich in der Webmin-Oberfl?\195?\131?\226?\130?\172che (unten bei den plugin_info-Variablen) an.
Dabei werden die Namen der GAs angezeigt, soweit definiert, ansonsten die numerischen GAs (ich pers?\195?\131?\194?\182nlich bevorzuge lesbare Namen!)
Falls sich bei einem Plugin die Liste der abonnierten GAs seit dem letzten Mal ge?\195?\131?\226?\130?\172ndert hat, gibt subscriptions.pl diese Liste zus?\195?\131?\226?\130?\172tzlich als return-Wert zur?\195?\131?\197?\146ck, so dass sie im plugin_log erscheint. Hilft beim Debuggen.
Added Paths:
-----------
wiregate/plugin/generic/Subscriptions.pl
Added: wiregate/plugin/generic/Subscriptions.pl
===================================================================
--- wiregate/plugin/generic/Subscriptions.pl (rev 0)
+++ wiregate/plugin/generic/Subscriptions.pl 2012-04-13 05:47:21 UTC (rev 748)
@@ -0,0 +1,57 @@
+#################
+# Subscriptions #
+#################
+# Wiregate-Plugin
+# (c) 2012 Fry under the GNU Public License version 2 or later
+
+# $plugin_info{$plugname.'_cycle'}=0; return "Subscriptions deaktiviert.";
+
+my %eibshort;
+
+for my $ga (keys %eibgaconf)
+{
+ next unless $eibgaconf{$ga}{name}=~/^(\S+)/;
+ my $short=$1;
+ $eibshort{$short}=$eibgaconf{$ga};
+ $eibshort{$short}{ga}=$ga;
+ $eibshort{$ga}=$short;
+}
+
+my %plugins=();
+
+delete $plugin_subscribe{''}; # delete stale subscriptions
+
+for my $ga (keys %plugin_subscribe)
+{
+ my $sh=$ga;
+ $sh=$eibshort{$ga} if defined $eibshort{$ga};
+
+ for my $pl (keys %{$plugin_subscribe{$ga}})
+ {
+ $plugins{$pl}{$sh}=1 if $plugin_subscribe{$ga}{$pl};
+ }
+}
+
+my @changedplugins=();
+
+for my $pl (keys %plugins)
+{
+ my $pluglist=join(',', sort grep { $plugins{$pl}{$_} } keys %{$plugins{$pl}});
+
+ $pluglist.=" => $pl";
+
+ unless($plugin_info{$plugname.'_'.$pl} eq $pluglist)
+ {
+ $plugin_info{$plugname.'_'.$pl} = $pluglist;
+ push @changedplugins, $pl;
+ }
+}
+
+my $retval="(".(join ") (", map { $plugin_info{$plugname."_".$_} } @changedplugins).")";
+
+$plugin_info{$plugname.'_cycle'}=10;
+
+return if $retval eq '()';
+
+return $retval;
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pf...@us...> - 2012-04-13 05:46:40
|
Revision: 747
http://openautomation.svn.sourceforge.net/openautomation/?rev=747&view=rev
Author: pfry
Date: 2012-04-13 05:46:33 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
Dieses Plugin ben?\195?\131?\194?\182tigt Ziffern, Zahlen und W?\195?\131?\194?\182rter als WAV-Dateien in einem besonderen Verzeichnis. Diese Audiodateien kann man sich bspw in der SVOX-Demo generieren, bzw. ich denke es ist auch kein Problem, wenn ich mein vorhandenes Verzeichnis "mitliefere".
Mit diesen Voraussetzungen kann das Plugin dann Dinge aufsagen wie "Guten Morgen, es ist Montag elf Uhr f?\195?\131?\197?\146nfundzwanzig" oder "Auf Wiedersehen, Aussentemperatur drei komma f?\195?\131?\197?\146nf Grad" oder "Heutiges Datum Elfter April".
Die Idee dabei ist, den GA-Namen, so wie er in eibga.conf hinterlegt ist, sowie den DPTSubId-Typen als Basis zu nehmen:
* Entspricht der GA-Name einem bestimmten Muster, so wird die GA abonniert ("subscribed"). Das zutreffende Muster entscheidet dabei ?\195?\131?\197?\146ber den ALSA-Ausgabekanal.
* Explizit abonnierte GAs, die keinem Muster entsprechen, werden im konfigurierten "default"-ALSA-Kanal gesprochen.
* Der GA-Name selbst (ohne den auf das Kanalmuster passenden Teil) ist der vorzulesende Text.
* An den Text angeh?\195?\131?\226?\130?\172ngt wird dann der Datenteil des Telegramms, wobei Kardinalzahlen bei S8/S16 (-32767...+32767), Ordinalzahlen bei U8/U16 (0..65535), Prozents?\195?\131?\226?\130?\172tze, Temperaturen mit einer Nachkommastelle, spezielle Angaben wie "hoch/runter", "auf/zu" und Datums- sowie Uhrzeitangaben (kompatibel zum Zeitversand des Wiregate) funktionieren.
Die eigentliche Sprachausgabe erfolgt durch aplay und der Zusammensetzung der vorhandenen wav-Dateien.
Added Paths:
-----------
wiregate/plugin/generic/Ansagen.pl
Added: wiregate/plugin/generic/Ansagen.pl
===================================================================
--- wiregate/plugin/generic/Ansagen.pl (rev 0)
+++ wiregate/plugin/generic/Ansagen.pl 2012-04-13 05:46:33 UTC (rev 747)
@@ -0,0 +1,491 @@
+###########
+# Ansagen #
+###########
+# Wiregate-Plugin
+# (c) 2012 Fry under the GNU Public License version 2 or later
+
+# $plugin_info{$plugname.'_cycle'}=0; return 'deaktiviert';
+
+use POSIX qw(floor);
+
+# Voraussetzungen:
+
+# 1. Im Verzeichnis $speechdir/Zahlen muessen folgende Dateien vorhanden sein:
+
+# 1.1. Kardinalzahlen ("Null", "Eins"):
+# c0.wav...c19.wav, c20.wav...c90.wav, c100.wav, c1000.wav
+
+# 1.2. Ordinalzahlen ("Erster", "Zweiter"):
+# o0.wav...o19.wav, o20.wav...o90.wav, o100.wav, o1000.wav
+
+# 1.3. Zahlteile mit "und" wie "...undzwanzig", "...unddreissigster":
+# uc20.wav...uc90.wav, uo20.wav...uo90.wav
+
+# 1.4. Ziffern zur Zahlbildung ("ein"):
+# u1.wav...u9.wav (u1.wav="ein" als Bestandteil von "einunzwanzig",
+# u2.wav...u9.wav koennen identisch mit c2.wav...c9.wav sein)
+
+# 1.7. Spezielle Woerter:
+# minus.wav, Komma.wav, Grad.wav, Prozent.wav
+# auf.wav, zu.wav, hoch.wav, runter.wav, an.wav, aus.wav
+
+# 2. Im Verzeichnis $speechdir/Monate muessen die Namen der Monate liegen:
+# Januar.wav ... Dezember.wav
+
+# 3. Im Verzeichnis $speechdir/Wochentage muessen die Wochentagsnamen liegen:
+# Mo.wav ... So.wav
+
+# 4. Ein Piepton $speechdir/beep.wav mit Pieptoenen, die vor der Sprachausgabe
+# gesendet werden (weckt bei mir den Russound-Paging-Kanal auf, der sonst die
+# ersten Silben verschluckt). Bei mir ist das wiederum ein ganzes Verzeichnis
+# Beep mit Dateien 01.wav ... 32.wav in aufsteigender Dauer sortiert
+
+# 5. Im Verzeichnis $speechdir ausserdem:
+# Alle Woerter bzw. ganze Saetze, die vorgelesen werden sollen,
+# wobei zB ein Satz "Willkommen Fry" in der Datei $speechdir/Willkommen/Fry.wav
+# liegen darf
+
+# alle diese Audiodateien kann man sich online generieren, zB bei SVOX.
+
+# Plugin-Konfiguration ################################################
+
+# Ausgabekanal:
+# Die ALSA-Kanalunterscheidung wird durch die Namensgebung der GA
+# in eibga.conf getroffen. Das Muster ffuer dieKanalunterscheidung
+# steht in %channels.
+
+# Textteil: Der Rest des GA-Namens wird als Text "vorgelesen".
+# Das Plugin sucht dabei zunaechst nach einem "exact match" einer Datei
+# im Sprachverzeichnis. Wenn dieser Match nicht existieren sollte, werden
+# die Woerter getrennt und jedes einzeln gesucht.
+
+# Datenteil:
+# Am Ende des Textteils wird der Telegramminhalt aufgesagt,
+# wobei folgende Datentypen erlaubt sind:
+# 1.017: (keine Daten, nur den GA-Namen vorlesen)
+# 1.001: "An/Aus"
+# 1.008: "Hoch/Runter"
+# 1.009: "Auf/Zu"
+# 5.010 / 7.001: Ordinalzahl ("Einundzwanzigster")
+# 6.010 / 8.001: Kardinalzahl ("Einundzwanzig")
+# 6.001 / 5.001: Prozentwert ("dreiundfuenfzig Prozent")
+# 9.001: Temperatur ("minus drei komma fuenf Grad")
+# 11.001: # Datum ("elfter April")
+# 10.001: # Wochentag+Uhrzeit ("Montag elf Uhr fuenfzehn")
+
+# Hier meine Konfiguration als Beispiel:
+
+# ANsagen gehen auf ALSA-Kanal 'welcome' und kommen ueber einen eigenen
+# kleinen Verstaerker im Eingangsflur raus
+
+# DURCHsagen gehen auf ALSA-Kanal 'paging' und gehen ueber die Russound an
+# alle Lautsprecher im Haus. Dort muss ein Beep vorweggesendet werden
+
+my $logfile='/var/log/Ansagen.log';
+my $speechdir='/var/lib/Ansagen/Sprache/';
+my %channels=(
+ '^WA_'=>'welcome', # zB "WA_Die Aussentemperatur betraegt"
+ '^WD_'=>'paging', # zB "WD_Folgende Fenster sind geoeffnet"
+ 'default'=>'welcome' # die GAs in additional_subscriptions
+);
+my $beepchannel='paging';
+my $beep = sprintf "Beep/%02d.wav", 3; # int(rand(32))+1 fuer Zufallsbeep
+#my @additional_subscriptions=qw(0/7/245 0/7/246 6/2/186);
+my @additional_subscriptions=();
+
+############### Ende der Konfiguration #########################
+
+# Aufrufgrund ermitteln
+my $event=undef;
+if (!$plugin_initflag)
+{ $event='restart'; } # Restart des daemons / Reboot
+elsif ((stat('/etc/wiregate/plugin/generic/' . $plugname))[9] > time()-10)
+# ab PL30:
+# elsif ($plugin_info{$plugname.'_lastsaved'} > $plugin_info{$plugname.'_last'})
+{ $event='modified'; } # Plugin modifiziert
+elsif (%msg) { $event='bus'; } # Bustraffic
+#elsif ($fh) { $event='socket'; } # Netzwerktraffic
+else { $event='cycle'; } # Zyklus
+
+chdir $speechdir;
+
+if($event=~/restart|modified/)
+{
+ my %gas=();
+
+ # Erstaufruf - an GAs anmelden, auf die die Muster in %channels zutreffen
+ for my $ga (keys %eibgaconf)
+ {
+ my $name=$eibgaconf{$ga}{'name'};
+ next unless defined $name;
+
+ for my $pat (keys %channels)
+ {
+ next if $pat eq 'default';
+
+ if($name=~/$pat/)
+ {
+ $plugin_subscribe{$ga}{$plugname}=1;
+ $gas{$channels{$pat}}++;
+ }
+ }
+ }
+
+ for my $ga (@additional_subscriptions)
+ {
+ $plugin_subscribe{$ga}{$plugname}=1;
+ $gas{$channels{default}}++;
+ }
+
+ $plugin_info{$plugname.'_cycle'}=0;
+
+ return join ' ', map $_.'->'.$gas{$_}, keys %gas;
+}
+elsif($event=~/bus/ && $msg{'apci'} eq 'A_GroupValue_Write')
+{
+ my $ga=$msg{'dst'};
+ my $dpt=$eibgaconf{$ga}{'DPTSubId'};
+ $dpt=1.017 unless defined $dpt; # = Trigger, bedeutet Textansage ohne Daten
+
+ my $name=$eibgaconf{$ga}{'name'};
+ my $channel=$channels{default};
+ my $pattern=$name;
+
+ for my $pat (keys %channels)
+ {
+ if($pattern=~s/$pat//)
+ {
+ $channel=$channels{$pat};
+ last;
+ }
+ }
+
+ # Hole alle verfuegbaren Durchsagedateien
+ my $find=checkexec('find');
+ my @speech=split /\n/, `$find . -name "*.wav"`;
+
+ return 'no speech files found' unless @speech;
+
+ my @statement=();
+
+ # Textteil (Gruppenadresse ausgesprochen)
+ if(defined $pattern)
+ {
+ push(@statement, words(\@speech, $pattern));
+ }
+
+ # Informationsteil (Inhalt des Telegramms)
+ if($dpt == 1.017)
+ {
+ # kein Datenzusatz
+ }
+ elsif($dpt == 1.001) # An/Aus
+ {
+ push(@statement, 'Zahlen/'.($msg{'value'}?'an':'aus').'.wav');
+ }
+ elsif($dpt == 1.008) # Hoch/Runter
+ {
+ push(@statement, 'Zahlen/'.($msg{'value'}?'hoch':'runter').'.wav');
+ }
+ elsif($dpt == 1.009) # Auf/Zu
+ {
+ push(@statement, 'Zahlen/'.($msg{'value'}?'auf':'zu').'.wav');
+ }
+ elsif($dpt == 5.010 || $dpt == 7.001) # Ordinalzahl
+ {
+ push(@statement, number(\@speech, $msg{'value'}, -1));
+ }
+ elsif($dpt == 6.010 || $dpt == 8.001) # Kardinalzahl
+ {
+ push(@statement, number(\@speech, $msg{'value'}));
+ }
+ elsif($dpt == 6.001 || $dpt == 5.001) # Prozent
+ {
+ push(@statement, number(\@speech, $msg{'value'}));
+ push(@statement, 'Zahlen/Prozent.wav');
+ }
+ elsif($dpt == 9.001) # Temperatur
+ {
+ push(@statement, number(\@speech, $msg{'value'}, 1));
+ push(@statement, 'Zahlen/Grad.wav');
+ }
+ elsif($dpt == 11.001) # Datum
+ {
+ if($msg{'value'}=~/^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])/)
+ {
+ my @monat=qw(Januar Februar Maerz April Mai Juni Juli August September Oktober November Dezember);
+ push(@statement, number(\@speech, $3, -1));
+ push(@statement, 'Monate/'.$monat[$2-1].'.wav') if defined $2 && $2>0 && $2<13;
+ }
+ else
+ {
+ return "Unbekanntes Datumsformat $msg{value}";
+ }
+ }
+ elsif($dpt == 10.001) # Uhrzeit
+ {
+ if($msg{'value'}=~/^(Mo|Di|Mi|Do|Fr|Sa|So)\s+([0-9][0-9])\:([0-9][0-9])/)
+ {
+ push(@statement, "Wochentage/$1.wav");
+ push(@statement, number(\@speech, $2));
+ push(@statement, "Zeiten/Uhr.wav");
+ push(@statement, number(\@speech, $3));
+ }
+ elsif($msg{'value'}=~/^([0-9][0-9])\:([0-9][0-9])}\:([0-9][0-9])/)
+ {
+ push(@statement, number(\@speech, $2));
+ push(@statement, "Zeiten/Uhr.wav");
+ push(@statement, number(\@speech, $3));
+ }
+ else
+ {
+ return "Unbekanntes Uhrzeitformat $msg{value}";
+ }
+ }
+ else
+ {
+ return "Datentyp $dpt nicht implementiert";
+ }
+
+ # Das komplette Statement in die Ausgabe geben
+ speak($channel, $name, @statement);
+
+ return $name.' '.$msg{value};
+}
+
+return;
+
+sub checkexec
+{
+ my @path = split /:/, $ENV{PATH};
+ map s|(.)/$|$1|, @path;
+ for (@path)
+ {
+ my $full="$_/$_[0]";
+ if(-x $full)
+ {
+ return "$_/$_[0]";
+ }
+ }
+ die "$_[0] must be in your PATH and executable.\n";
+}
+
+
+sub words
+{
+ my $speech=shift;
+ my $pattern=shift;
+
+ # Konstruiere die abzuspielenden File(s) aus dem GA-Kuerzel
+ # erster Versuch: eine Datei passt komplett auf das Muster im Kuerzel
+ my $pat1=$pattern;
+ $pat1=~s/[_\s]+/.*?/g; # allgemeine Fassung
+# $pat1=~s/\s+.*$//; # meine spezielle GA-Struktur
+# $pat1=~s/_+/.*?/g; # meine spezielle GA-Struktur
+ $pat1='.*'.$pat1.'.*\.wav$';
+
+ my @hits=();
+ my $hit=bestmatch($speech,$pat1);
+ push(@hits, $hit) if $hit; # gefunden
+
+ unless(@hits)
+ {
+ $pattern='_'.$pattern;
+ $pattern=~s/\s+/_/g; # allgemeine Fassung
+# $pattern=~s/\s+.*$//; # meine spezielle GA-Struktur
+
+ # zweiter Versuch: aus Kuerzeln die Bausteine zusammenbauen
+ while($pattern=~s/^_([^_]+)//)
+ {
+ my $pat2=$1.'\.wav$';
+ $hit=bestmatch($speech,$pat2);
+ push(@hits, $hit) if $hit; # gefunden
+ }
+
+ if($pattern)
+ {
+ $pattern=~s/_/.*/g; # Restnachricht
+ $pattern.='.*\.wav$';
+ $pattern='.*'.$pattern;
+
+ $hit=bestmatch($speech,$pattern);
+ push(@hits, $hit) if $hit; # gefunden
+ }
+ }
+
+ return @hits;
+}
+
+
+sub number
+{
+ my $speech=shift;
+ my $x=shift; $x=~s/,/./;
+ my $digits=0;
+ $digits=shift if @_; # max. Anzahl Nachkommastellen, -1 fuer Ordinalzahlen
+
+ my @hits=();
+
+ if($x<0)
+ {
+ push(@hits, 'Zahlen/minus.wav');
+ $x=-$x;
+ $digits=0 if $digits<0; # keine negativen Ordinalzahlen
+ }
+
+ my $t=$digits<0?'o':'c';
+ my $n=floor($x);
+ my $m=$x-$n;
+
+ # Manche Zahlen existieren direkt als WAV
+ # von 0-12, sowie die runden 10er und 100 sowie 1000
+ # MUESSEN existieren, und zwar als Kardinalzahlen (c4.wav),
+ # Ordinalzahlen (o6.wav), die Zehner ausserdem mit vorangestelltem 'und'
+ # (u30.wav, uo30.wav)
+
+ if(-f 'Zahlen/'.$t.$n.'.wav')
+ {
+ push(@hits, 'Zahlen/'.$t.$n.'.wav');
+ }
+ else
+ {
+ return if($n>=1000000); # Zahlen ueber eine Million nicht implementiert
+
+ if($n>=1000)
+ {
+ $digits=0 if $digits>0; # waere Pseudo-genauigkeit und zu langer Text
+
+ if($n==1000)
+ {
+ push(@hits, 'Zahlen/'.$t.'1000.wav');
+ $n = 0;
+ }
+ else
+ {
+ my $m=floor($n/1000);
+ @hits=number($speech,$m,0) if $m>1;
+ $n %= 1000;
+ if($n)
+ {
+ push(@hits, 'Zahlen/c1000.wav');
+ }
+ else
+ {
+ push(@hits, 'Zahlen/'.$t.'1000.wav');
+ }
+ }
+
+ if($n>=100 && $n<200)
+ {
+ push(@hits, 'Zahlen/u1.wav');
+ }
+ }
+
+ if(-f 'Zahlen/'.$t.$n.'.wav')
+ {
+ push(@hits, 'Zahlen/'.$t.$n.'.wav');
+ }
+ elsif($n>100)
+ {
+ $digits=0 if $digits>0; # waere Pseudo-genauigkeit und zu langer Text
+ my $h = int($n/100);
+ $n %= 100;
+ push(@hits, 'Zahlen/u'.$h.'.wav') if $h>1;
+ if($n)
+ {
+ push(@hits, 'Zahlen/c100.wav');
+ }
+ else
+ {
+ push(@hits, 'Zahlen/'.$t.'100.wav');
+ }
+ }
+
+ my $d = $n % 10;
+
+ if(-f 'Zahlen/'.$t.$n.'.wav')
+ {
+ push(@hits, 'Zahlen/'.$t.$n.'.wav');
+ }
+ else
+ {
+ my $z = $n-$d;
+
+ push(@hits, 'Zahlen/u'.$d.'.wav');
+ push(@hits, 'Zahlen/u'.$t.$z.'.wav');
+ }
+ }
+
+ if($digits>0)
+ {
+ $m = sprintf "%.$digits"."f", $m;
+
+ if($m>0)
+ {
+ push(@hits, 'Zahlen/Komma.wav');
+ for (1..$digits)
+ {
+ $m*=10.; my $d=floor($m); $m-=$d;
+ push(@hits, "Zahlen/c$d.wav");
+ }
+ }
+ }
+
+ return @hits;
+}
+
+sub bestmatch
+{
+ my $speech=shift;
+ my $pattern=shift;
+
+ my @hits=sort { length($a) cmp length($b) } grep /$pattern/i, @{$speech};
+
+ return @hits ? (shift @hits) : undef;
+}
+
+
+sub speak
+{
+ my $channel=shift; # ALSA-Channel
+ my $name=shift; # Name der Ansage (aus eibga.conf) - fuers Log
+
+ open LOG, ">>$logfile";
+ my $date=checkexec('date');
+ my $datetime=`$date +"%F %X"`;
+ $datetime=~s/\s*$//s;
+
+ if(@_)
+ {
+ my $aplay=checkexec('aplay');
+ my $mpc=checkexec('mpc');
+ system $mpc, 'pause';
+
+ # Nur fuer Russound-Paging: Star Trek 'Beep' vorweg weckt Russound auf
+ if($channel=~/$beepchannel/)
+ {
+ my $lastbeep=$plugin_info{$plugname.'_lastbeep'};
+
+ # max ein Beep pro Minute
+ if(!defined $lastbeep || time()>$lastbeep+60)
+ {
+ unshift(@_, $beep);
+ $plugin_info{$plugname.'_lastbeep'}=time();
+ }
+ }
+
+ system $aplay, '-c2', "-D$channel", @_;
+
+# map s!^.*/(.*?)\.wav!$1!, @_;
+ print LOG $datetime.' '.$channel.':'.(join ' ', @_)."\n";
+
+ system $mpc, 'toggle';
+ }
+ else
+ {
+ print LOG "$datetime $name - keine akustische Ansage moeglich\n";
+ }
+
+ close LOG;
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-04-09 12:07:48
|
Revision: 746
http://openautomation.svn.sourceforge.net/openautomation/?rev=746&view=rev
Author: mayerch
Date: 2012-04-09 12:07:39 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
Preparation for cleaner file structure and automated build script:
* create "release" directory for concatenated and (in future) minimized version
Modified Paths:
--------------
CometVisu/trunk/ChangeLog
CometVisu/trunk/Makefile
Added Paths:
-----------
CometVisu/trunk/build/
CometVisu/trunk/build/template/
CometVisu/trunk/build/template/assets/
CometVisu/trunk/build/template/assets/ac-js
CometVisu/trunk/build/template/assets/api-js
CometVisu/trunk/build/template/assets/api.css
CometVisu/trunk/build/template/assets/bg_hd.gif
CometVisu/trunk/build/template/assets/reset-fonts-grids-min.css
CometVisu/trunk/build/template/assets/yui.png
CometVisu/trunk/build/template/classmap.tmpl
CometVisu/trunk/build/template/index.tmpl
CometVisu/trunk/build/template/main.tmpl
Property Changed:
----------------
CometVisu/trunk/
Property changes on: CometVisu/trunk
___________________________________________________________________
Added: svn:ignore
+ release
docs
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2012-04-09 11:26:58 UTC (rev 745)
+++ CometVisu/trunk/ChangeLog 2012-04-09 12:07:39 UTC (rev 746)
@@ -32,7 +32,10 @@
* initial support for automatic documentation generation (using YUIdoc)
* switch from big structure_pure.js to one file per widget
* switch from big structure_pure.js to one file per widget - part 2
- * initial makefile that can reducde the multiple source files (e.g. for the widgets) into one to speed up network loading
+ * initial makefile that can reducde the multiple source files (e.g. for the
+ widgets) into one to speed up network loading
+ * create "release" directory for concatenated and (in future) minimized
+ version
- lots of little bugfixes and improvements
<Changes up to Revision 744 included>
Modified: CometVisu/trunk/Makefile
===================================================================
--- CometVisu/trunk/Makefile 2012-04-09 11:26:58 UTC (rev 745)
+++ CometVisu/trunk/Makefile 2012-04-09 12:07:39 UTC (rev 746)
@@ -39,16 +39,24 @@
lint:
${LINT} ${SRC}
-visu/designs/structure_pure.js: $(STRUCTURE_PURE_SRC)
- cat $^ > visu/designs/structure_pure.jss
- cp visu/index.html visu/index.min.html
+release:
+ cp -rfp visu release
+ find release -path "*/.svn" -exec rm -rf {} +
+
+release/designs/structure_pure.js: release $(STRUCTURE_PURE_SRC)
+ cat $(STRUCTURE_PURE_SRC) > release/designs/structure_pure.js
+ cp visu/index.html release/index.html
+ cp visu/edit_config.html release/edit_config.html
for SRC_FILE in $^; do \
SRC2_FILE=`echo $$SRC_FILE | sed 's_visu/__'`; \
- sed "s#.*<script src=\"$$SRC2_FILE\" type=\"text/javascript\"></script>.*##" -i visu/index.min.html; \
+ sed "s#.*<script src=\"$$SRC2_FILE\" type=\"text/javascript\"></script>.*##" -i release/index.html; \
done
- sed 's#<!-- Load the widgets: start -->#<script src="designs/structure_pure.js" type="text/javascript"></script>#' -i visu/index.min.html
+ sed 's#<!-- Load the widgets: start -->#<script src="designs/structure_pure.js" type="text/javascript"></script>#' -i release/index.html
+ sed 's#<!-- Load the widgets: start -->#<script src="designs/structure_pure.js" type="text/javascript"></script>#' -i release/edit_config.html
-build: $(SRC)
- echo $^
+build: release/designs/structure_pure.js
+
+clean:
+ rm -rf release
.PHONY: lint docs build
Added: CometVisu/trunk/build/template/assets/ac-js
===================================================================
--- CometVisu/trunk/build/template/assets/ac-js (rev 0)
+++ CometVisu/trunk/build/template/assets/ac-js 2012-04-09 12:07:39 UTC (rev 746)
@@ -0,0 +1,178 @@
+(function() {
+
+ var Event=YAHOO.util.Event,
+ Dom=YAHOO.util.Dom,
+ oACDS, oAutoComp,
+ show = {
+ 'private': false,
+ 'protected': false,
+ 'deprecated': false
+ },
+
+ ITEM_TEMPLATE = '<em>{host}</em> <span>{name}</span>',
+ // ITEM_TEMPLATE = '<em>{host}</em> <span>{params}</span> <span>{name}</span>',
+ // ITEM_TEMPLATE = '<em>{host}</em> <span>{params}</span> <span>{name}</span><div>{description}</div>',
+ yuidoc = YAHOO.namespace('yuidoc'),
+ propdata,
+ initialized = false;
+
+yuidoc.init = function(altdata) {
+ yuidoc.initUI(altdata);
+};
+
+yuidoc.initUI = function(altdata) {
+
+ if (initialized) {
+ return;
+ }
+
+ propdata = ALL_YUI_PROPS || altdata;
+
+ //Checkboxes are available..
+ var handleClick = function(e) {
+ var id, checked = false;
+ if (YAHOO.lang.isString(e)) {
+ id = e;
+ } else {
+ var tar = Event.getTarget(e);
+ id = tar.id;
+ }
+ var el = Dom.get(id);
+ checked = el.checked;
+
+ var className = id;
+ if (checked) {
+ show[id.replace('show_', '')] = true;
+ Dom.addClass(document.body, className);
+ YAHOO.util.Cookie.setSub('yuidoc', id, 'checked');
+ } else {
+ show[id.replace('show_', '')] = false;
+ Dom.removeClass(document.body, className);
+ YAHOO.util.Cookie.setSub('yuidoc', id, '');
+ }
+ };
+
+ var checkCookie = function(id) {
+ var value = YAHOO.util.Cookie.getSub('yuidoc', id),
+ el = Dom.get(id), checked = (value === 'checked');;
+
+ el.checked = checked;
+ return checked;
+ };
+
+ var els = ['show_deprecated', 'show_protected', 'show_private'],
+ reapplyHash = false;
+
+ for (var i = 0; i < els.length; i++) {
+ Event.on(els[i], 'click', handleClick);
+ reapplyHash = checkCookie(els[i]) || reapplyHash;
+ handleClick(els[i]);
+ }
+
+ // If we dynamically show private/protected/etc items during
+ // load, we need to reapply anchors so that the search feature
+ // works correctly for items that are initially hidden.
+ if (reapplyHash) {
+ var dl = document.location, hash = dl.hash;
+ if (hash) {
+ dl.hash = hash;
+ }
+ }
+
+};
+
+//Starting the AutoComplete code
+ var getResults = function(query) {
+ var results = [];
+ if (query && query.length > 0) {
+ var q = query.toLowerCase();
+ for (var i=0, len=propdata.length; i<len; ++i) {
+ var prop = propdata[i];
+ if (!show['protected'] && prop.access == "protected") {
+ // skip
+ } else if (!show['private'] && prop.access == "private") {
+ // skip
+ } else if (!show['deprecated'] && prop.deprecated) {
+ // skip
+ } else {
+ var s = (prop.host + "." + prop.name).toLowerCase();
+ if (s.indexOf(q) > -1 ) {
+ results.push([query, prop]);
+ }
+ }
+ }
+ }
+
+ return results;
+ };
+
+ // Define Custom Event handlers
+ var myOnDataReturn = function(sType, aArgs) {
+ var oAutoComp = aArgs[0];
+ var query = aArgs[1];
+ var aResults = aArgs[2];
+
+ if(aResults.length == 0) {
+ if (query.length > 0) {
+ oAutoComp.setBody("<div id=\"resultsdefault\">Not found</div>");
+ }
+ }
+ };
+
+ var myOnItemSelect = function(sType, aArgs) {
+ var ac = aArgs[0];
+ var item = aArgs[2];
+ location.href = item[1].url;
+ };
+
+
+ Event.onAvailable("searchresults", function() {
+
+ // Instantiate JS Function DataSource
+ oACDS = new YAHOO.widget.DS_JSFunction(getResults);
+ oACDS.maxCacheEntries = 30;
+
+ // Instantiate AutoComplete
+ oAutoComp = new YAHOO.widget.AutoComplete('searchinput','searchresults', oACDS);
+ //oAutoComp.alwaysShowContainer = true;
+ oAutoComp.queryDelay = 0.2;
+ oAutoComp.maxResultsDisplayed = 200;
+ oAutoComp.minQueryLength = 0;
+ oAutoComp.formatResult = function(oResultItem, query) {
+ // var sMarkup = "<em>" + oResultItem[1].host + '</em> <span>' + oResultItem[1].name + '</span>';
+ // return sMarkup;
+ // return "<em>" + oResultItem[1].host + '</em> <span>' + oResultItem[1].name + '</span>';
+ return YAHOO.lang.substitute(ITEM_TEMPLATE, oResultItem[1]);
+ };
+
+ // Subscribe to Custom Events
+ oAutoComp.dataReturnEvent.subscribe(myOnDataReturn);
+ oAutoComp.itemSelectEvent.subscribe(myOnItemSelect);
+
+ // Set initial content in the container
+ oAutoComp.sendQuery(Dom.get("searchinput").value);
+
+ });
+
+ var validateForm = function() {
+ return false;
+ };
+
+ YAHOO.util.Event.onAvailable('classTab', function() {
+ var tabs = new YAHOO.widget.TabView('classTab');
+ });
+
+ /*
+ YAHOO.util.Event.onAvailable('codeTree', function() {
+ var tree1 = new YAHOO.widget.TreeView('codeTree');
+ tree1.render();
+ });
+ */
+
+ YAHOO.util.Event.onDOMReady(function() {
+ if (typeof ALL_YUI_PROPS != "undefined") {
+ YAHOO.yuidoc.initUI();
+ }
+ });
+
+})();
Added: CometVisu/trunk/build/template/assets/api-js
===================================================================
--- CometVisu/trunk/build/template/assets/api-js (rev 0)
+++ CometVisu/trunk/build/template/assets/api-js 2012-04-09 12:07:39 UTC (rev 746)
@@ -0,0 +1,42 @@
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.7.0
+*/
+if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1]);}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,F="[object Array]",C="[object Function]",A=Object.prototype,E=["toString","valueOf"],D={isArray:function(G){return A.toString.apply(G)===F;},isBoolean:function(G){return typeof G==="boolean";},isFunction:function(G){return A.toString.apply(G)===C;},isNull:function(G){return G===null;},isNumber:function(G){return typeof G==="number"&&isFinite(G);},isObject:function(G){return(G&&(typeof G==="object"||B.isFunction(G)))||false;},isString:function(G){return typeof G==="string";},isUndefined:function(G){return typeof G==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(I,H){var G,K,J;for(G=0;G<E.length;G=G+1){K=E[G];J=H[K];if(B.isFunction(J)&&J!=A[K]){I[K]=J;}}}:function(){},extend:function(J,K,I){if(!K||!J){throw new Error("extend failed, please check that "+"all dependencies are included.");}var H=function(){},G;H.prototype=K.prototype;J.prototype=new H();J.prototype.constructor=J;J.superclass=K.prototype;if(K.prototype.constructor==A.constructor){K.prototype.constructor=K;}if(I){for(G in I){if(B.hasOwnProperty(I,G)){J.prototype[G]=I[G];}}B._IEEnumFix(J.prototype,I);}},augmentObject:function(K,J){if(!J||!K){throw new Error("Absorb failed, verify dependencies.");}var G=arguments,I,L,H=G[2];if(H&&H!==true){for(I=2;I<G.length;I=I+1){K[G[I]]=J[G[I]];}}else{for(L in J){if(H||!(L in K)){K[L]=J[L];}}B._IEEnumFix(K,J);}},augmentProto:function(J,I){if(!I||!J){throw new Error("Augment failed, verify dependencies.");}var G=[J.prototype,I.prototype],H;for(H=2;H<arguments.length;H=H+1){G.push(arguments[H]);}B.augmentObject.apply(this,G);},dump:function(G,L){var I,K,N=[],O="{...}",H="f(){...}",M=", ",J=" => ";if(!B.isObject(G)){return G+"";}else{if(G instanceof Date||("nodeType" in G&&"tagName" in G)){return G;}else{if(B.isFunction(G)){return H;}}}L=(B.isNumber(L))?L:3;if(B.isArray(G)){N.push("[");for(I=0,K=G.length;I<K;I=I+1){if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}if(N.length>1){N.pop();}N.push("]");}else{N.push("{");for(I in G){if(B.hasOwnProperty(G,I)){N.push(I+J);if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}}if(N.length>1){N.pop();}N.push("}");}return N.join("");},substitute:function(V,H,O){var L,K,J,R,S,U,Q=[],I,M="dump",P=" ",G="{",T="}",N;for(;;){L=V.lastIndexOf(G);if(L<0){break;}K=V.indexOf(T,L);if(L+1>=K){break;}I=V.substring(L+1,K);R=I;U=null;J=R.indexOf(P);if(J>-1){U=R.substring(J+1);R=R.substring(0,J);}S=H[R];if(O){S=O(R,S,U);}if(B.isObject(S)){if(B.isArray(S)){S=B.dump(S,parseInt(U,10));}else{U=U||"";N=U.indexOf(M);if(N>-1){U=U.substring(4);}if(S.toString===A.toString||N>-1){S=B.dump(S,parseInt(U,10));}else{S=S.toString();}}}else{if(!B.isString(S)&&!B.isNumber(S)){S="~-"+Q.length+"-~";Q[Q.length]=I;}}V=V.substring(0,L)+S+V.substring(K+1);}for(L=Q.length-1;L>=0;L=L-1){V=V.replace(new RegExp("~-"+L+"-~"),"{"+Q[L]+"}","g");}return V;},trim:function(G){try{return G.replace(/^\s+|\s+$/g,"");}catch(H){return G;}},merge:function(){var J={},H=arguments,G=H.length,I;for(I=0;I<G;I=I+1){B.augmentObject(J,H[I],true);}return J;},later:function(N,H,O,J,K){N=N||0;H=H||{};var I=O,M=J,L,G;if(B.isString(O)){I=H[O];}if(!I){throw new TypeError("method undefined");}if(!B.isArray(M)){M=[J];}L=function(){I.apply(H,M);};G=(K)?setInterval(L,N):setTimeout(L,N);return{interval:K,cancel:function(){if(this.interval){clearInterval(G);}else{clearTimeout(G);}}};},isValue:function(G){return(B.isObject(G)||B.isString(G)||B.isNumber(G)||B.isBoolean(G));}};B.hasOwnProperty=(A.hasOwnProperty)?function(G,H){return G&&G.hasOwnProperty(H);}:function(G,H){return !B.isUndefined(G[H])&&G.constructor.prototype[H]!==G[H];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1796"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},get:function(y){var AA,Y,z,x,G;if(y){if(y[l]||y.item){return y;}if(typeof y==="string"){AA=y;y=K.getElementById(y);if(y&&y.id===AA){return y;}else{if(y&&K.all){y=null;Y=K.all[AA];for(x=0,G=Y.length;x<G;++x){if(Y[x].id===AA){return Y[x];}}}}return y;}if(y.DOM_EVENTS){y=y.get("element");}if("length" in y){z=[];for(x=0,G=y.length;x<G;++x){z[z.length]=E.Dom.get(y[x]);}return z;}return y;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];G=S(AF[v],q);x=S(AF[v],R);if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC==c)){if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AB=L.trim(AB);AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom.getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom.getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom.getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});
+},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom.getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;Y.setAttribute(G,x);},getAttribute:function(Y,G){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;return Y.getAttribute(G);},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);
+}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1796"});YAHOO.util.CustomEvent=function(D,C,B,A){this.type=D;this.scope=C||window;this.silent=B;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(A,B,C){if(!A){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(A,B,C);}this.subscribers.push(new YAHOO.util.Subscriber(A,B,C));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(S,O,Q,R,P){var M=(YAHOO.lang.isString(S))?[S]:S;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:Q,overrideContext:R,checkReady:P});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(P,M,N,O){this.onAvailable(P,M,N,O,true);},onDOMReady:function(M,N,O){if(this.DOMReady){setTimeout(function(){var P=window;if(O){if(O===true){P=N;}else{P=O;}}M.call(P,"DOMReady",[],N);},0);}else{this.DOMReadyEvent.subscribe(M,N,O);}},_addListener:function(O,M,Y,S,W,b){if(!Y||!Y.call){return false;}if(this._isValidCollection(O)){var Z=true;for(var T=0,V=O.length;T<V;++T){Z=this.on(O[T],M,Y,S,W)&&Z;}return Z;}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R;}else{this.onAvailable(O,function(){YAHOO.util.Event.on(O,M,Y,S,W);});return true;}}}if(!O){return false;}if("unload"==M&&S!==this){J[J.length]=[O,M,Y,S,W];return true;}var N=O;if(W){if(W===true){N=S;}else{N=W;}}var P=function(c){return Y.call(N,YAHOO.util.Event.getEvent(c,O),S);};var a=[O,M,Y,P,N,S,W];var U=I.length;I[U]=a;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q);};}E[Q].push(a);}else{try{this._simpleAdd(O,M,P,b);}catch(X){this.lastError=X;this.removeListener(O,M,Y);return false;}}return true;},addListener:function(N,Q,M,O,P){return this._addListener(N,Q,M,O,P,false);},addFocusListener:function(N,M,O,P){return this._addListener(N,K,M,O,P,true);},removeFocusListener:function(N,M){return this.removeListener(N,K,M);},addBlurListener:function(N,M,O,P){return this._addListener(N,L,M,O,P,true);},removeBlurListener:function(N,M){return this.removeListener(N,L,M);},fireLegacyEvent:function(R,P){var T=true,M,V,U,N,S;V=E[P].slice();for(var O=0,Q=V.length;O<Q;++O){U=V[O];if(U&&U[this.WFN]){N=U[this.ADJ_SCOPE];S=U[this.WFN].call(N,R);T=(T&&S);}}M=G[P];if(M&&M[2]){M[2](R);}return T;},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return -1;}else{return B[M];}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N));},removeListener:function(N,M,V){var Q,T,X;if(typeof N=="string"){N=this.getEl(N);}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this.removeListener(N[Q],M,V)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[3];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break;}}}}else{try{this._simpleRemove(N,M,R[this.WFN],false);}catch(U){this.lastError=U;return false;}}delete I[S][this.WFN];delete I[S][this.FN];
+I.splice(S,1);return true;},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M);},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode;}}catch(M){}return N;},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft();}}return M;},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop();}}return N;},getXY:function(M){return[this.getPageX(M),this.getPageY(M)];},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement;}else{if(N.type=="mouseover"){M=N.fromElement;}}}return this.resolveTextNode(M);},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N;}catch(M){this.lastError=M;return N;}}return O.time;},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M);},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation();}else{M.cancelBubble=true;}},preventDefault:function(M){if(M.preventDefault){M.preventDefault();}else{M.returnValue=false;}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break;}P=P.caller;}}return N;},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M];}return M;},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O;}}return -1;},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N;}return N;},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined");}catch(M){return false;}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach();}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;if(this._interval){clearInterval(this._interval);this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.overrideContext){if(W.overrideContext===true){U=W.obj;}else{U=W.overrideContext;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null;}}else{T(P,Q);F[N]=null;}}else{R.push(Q);}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q);}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{if(this._interval){clearInterval(this._interval);this._interval=null;}}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this.removeListener(O,N.type,N.fn);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T);}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J];}else{if(M==="unload"){N=[J];}else{N=[I];}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],index:S});}}}}return(R.length)?R:null;},_unload:function(T){var N=YAHOO.util.Event,Q,P,O,S,R,U=J.slice(),M;for(Q=0,S=J.length;Q<S;++Q){O=U[Q];if(O){M=window;if(O[N.ADJ_SCOPE]){if(O[N.ADJ_SCOPE]===true){M=O[N.UNLOAD_OBJ];}else{M=O[N.ADJ_SCOPE];}}O[N.FN].call(M,N.getEvent(T,O[N.EL]),O[N.UNLOAD_OBJ]);U[Q]=null;}}O=null;M=null;J=null;if(I){for(P=I.length-1;P>-1;P--){O=I[P];if(O){N.removeListener(O[N.EL],O[N.TYPE],O[N.FN],P);}}O=null;}G=null;N._simpleRemove(window,"unload",N._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
+/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
+if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);
+}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].overrideContext);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1796"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.7.0", build: "1796"});
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.7.0
+*/
+(function(){var lang=YAHOO.lang,util=YAHOO.util,Ev=util.Event;util.DataSourceBase=function(oLiveData,oConfigs){if(oLiveData===null||oLiveData===undefined){return;}this.liveData=oLiveData;this._oQueue={interval:null,conn:null,requests:[]};this.responseSchema={};if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}var maxCacheEntries=this.maxCacheEntries;if(!lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}this._aIntervals=[];this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");var DS=util.DataSourceBase;this._sName="DataSource instance"+DS._nIndex;DS._nIndex++;};var DS=util.DataSourceBase;lang.augmentObject(DS,{TYPE_UNKNOWN:-1,TYPE_JSARRAY:0,TYPE_JSFUNCTION:1,TYPE_XHR:2,TYPE_JSON:3,TYPE_XML:4,TYPE_TEXT:5,TYPE_HTMLTABLE:6,TYPE_SCRIPTNODE:7,TYPE_LOCAL:8,ERROR_DATAINVALID:"Invalid data",ERROR_DATANULL:"Null data",_nIndex:0,_nTransactionId:0,issueCallback:function(callback,params,error,scope){if(lang.isFunction(callback)){callback.apply(scope,params);}else{if(lang.isObject(callback)){scope=callback.scope||scope||window;var callbackFunc=callback.success;if(error){callbackFunc=callback.failure;}if(callbackFunc){callbackFunc.apply(scope,params.concat([callback.argument]));}}}},parseString:function(oData){if(!lang.isValue(oData)){return null;}var string=oData+"";if(lang.isString(string)){return string;}else{return null;}},parseNumber:function(oData){if(!lang.isValue(oData)||(oData==="")){return null;}var number=oData*1;if(lang.isNumber(number)){return number;}else{return null;}},convertNumber:function(oData){return DS.parseNumber(oData);},parseDate:function(oData){var date=null;if(!(oData instanceof Date)){date=new Date(oData);}else{return oData;}if(date instanceof Date){return date;}else{return null;}},convertDate:function(oData){return DS.parseDate(oData);}});DS.Parser={string:DS.parseString,number:DS.parseNumber,date:DS.parseDate};DS.prototype={_sName:null,_aCache:null,_oQueue:null,_aIntervals:null,maxCacheEntries:0,liveData:null,dataType:DS.TYPE_UNKNOWN,responseType:DS.TYPE_UNKNOWN,responseSchema:null,toString:function(){return this._sName;},getCachedResponse:function(oRequest,oCallback,oCaller){var aCache=this._aCache;if(this.maxCacheEntries>0){if(!aCache){this._aCache=[];}else{var nCacheLength=aCache.length;if(nCacheLength>0){var oResponse=null;this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});if(i<nCacheLength-1){aCache.splice(i,1);this.addToCache(oRequest,oResponse);}oResponse.cached=true;break;}}return oResponse;}}}else{if(aCache){this._aCache=null;}}return null;},isCacheHit:function(oRequest,oCachedRequest){return(oRequest===oCachedRequest);},addToCache:function(oRequest,oResponse){var aCache=this._aCache;if(!aCache){return;}while(aCache.length>=this.maxCacheEntries){aCache.shift();}var oCacheElem={request:oRequest,response:oResponse};aCache[aCache.length]=oCacheElem;this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});},flushCache:function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}},setInterval:function(nMsec,oRequest,oCallback,oCaller){if(lang.isNumber(nMsec)&&(nMsec>=0)){var oSelf=this;var nId=setInterval(function(){oSelf.makeConnection(oRequest,oCallback,oCaller);},nMsec);this._aIntervals.push(nId);return nId;}else{}},clearInterval:function(nId){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){if(tracker[i]===nId){tracker.splice(i,1);clearInterval(nId);}}},clearAllIntervals:function(){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){clearInterval(tracker[i]);}tracker=[];},sendRequest:function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){DS.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);return null;}return this.makeConnection(oRequest,oCallback,oCaller);},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;},handleResponse:function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{tId:tId,request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller});var xhr=(this.dataType==DS.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oRawResponse&&oRawResponse.getResponseHeader)?oRawResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}else{if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}}switch(this.responseType){case DS.TYPE_JSARRAY:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);
+if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var arrayEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,arrayEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e1){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseArrayData(oRequest,oFullResponse);break;case DS.TYPE_JSON:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case DS.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){var el=document.createElement("div");el.innerHTML=oRawResponse.responseText;oFullResponse=el.getElementsByTagName("table")[0];}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case DS.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case DS.TYPE_TEXT:if(xhr&&lang.isString(oRawResponse.responseText)){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseData(oRequest,oFullResponse);break;}oParsedResponse=oParsedResponse||{};if(!oParsedResponse.results){oParsedResponse.results=[];}if(!oParsedResponse.meta){oParsedResponse.meta={};}if(oParsedResponse&&!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse;},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse;},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse;}return null;},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]};}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;if(p){parsers[fields[i].key]=p;}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}}results[i]=oResult;}}else{results=oFullResponse;}var oParsedResponse={results:results};return oParsedResponse;}return null;},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength);}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i<len;++i){var bError=false,sRecord=recordsarray[i];if(lang.isString(sRecord)&&(sRecord.length>0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1);}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1);}var field=fields[j];
+var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}else{bError=true;}}catch(e){bError=true;}}}else{oResult=fielddataarray;}if(!bError){oParsedResponse.results[recIdx++]=oResult;}}}}}return oParsedResponse;}}return null;},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)){var item=xmlNode.item(0);data=(item)?((item.text)?item.text:(item.textContent)?item.textContent:null):null;if(!data){var datapieces=[];for(var j=0,len=item.childNodes.length;j<len;j++){if(item.childNodes[j].nodeValue){datapieces[datapieces.length]=item.childNodes[j].nodeValue;}}if(datapieces.length>0){data=datapieces.join("");}}}}if(data===null){data="";}if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}}catch(e){}return oResult;},parseXMLData:function(oRequest,oFullResponse){var bError=false,schema=this.responseSchema,oParsedResponse={meta:{}},xmlList=null,metaNode=schema.metaNode,metaLocators=schema.metaFields||{},i,k,loc,v;try{xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;metaNode=metaNode?oFullResponse.getElementsByTagName...
[truncated message content] |
|
From: <ma...@us...> - 2012-04-09 11:27:04
|
Revision: 745
http://openautomation.svn.sourceforge.net/openautomation/?rev=745&view=rev
Author: mayerch
Date: 2012-04-09 11:26:58 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
Make ChangeLog up to date, it should reflect all changes till revision 744 now
Revision Links:
--------------
http://openautomation.svn.sourceforge.net/openautomation/?rev=744&view=rev
Modified Paths:
--------------
CometVisu/trunk/ChangeLog
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2012-04-08 13:13:08 UTC (rev 744)
+++ CometVisu/trunk/ChangeLog 2012-04-09 11:26:58 UTC (rev 745)
@@ -1,13 +1,47 @@
HEAD
====
+- New plugin: clock
+- New plugin: rsslog
+- New plugin: upnpcontroller
+- New widget: imagetrigger
+- New widget: include
+- New design: pitchblack (needs config-rewrite)
+- New feature: wirteonly attribute
+- New feature: 2D and 3D modes
- New feature: colspan (column-width is 8.33333%, i.e. 1/12)
- New feature: rowspan (row-height is height of <text>-widget)
-- Added rsslog-plugin
-- New design: pitchblack (needs config-rewrite)
+- New feature: Added handling for browser back button
+ => go one level higher in page hierarchy.
+- New feature: Option to show current status in multitrigger widget
+- change text-align in pure-design (switch/un/unpressed) to center
- diagram-Plugin: yaxismin, yaxismax, added diagram_info
+- updated jQuery to 1.7.1
+- updated jQuery UI to 1.8.16
+- attribute "variant" for address is now a select-list on a per-widget-basis;
+ will no longer be displayed when not available (declutter UI)
+- Bug fix: numbers between -1 and 0 didn't show a negative sign when the format
+ string was used.
+- Bug fix for #3468526: Initial read is repeated after COMET Timeout
+- cometvisu-client: Force full reload before index might overflow during long
+ periods without interesting bus traffic
+- Added jquery.ui.touch-punch.js; script simulates touch events as mouse events
+ on jquery ui elements like a slider.
+- Cleaner file structure and automated build script:
+ * separation of CometVisu libraries and external dependencies
+ * initial support for automatic documentation generation (using YUIdoc)
+ * switch from big structure_pure.js to one file per widget
+ * switch from big structure_pure.js to one file per widget - part 2
+ * initial makefile that can reducde the multiple source files (e.g. for the widgets) into one to speed up network loading
+- lots of little bugfixes and improvements
+<Changes up to Revision 744 included>
+0.6.2
+=====
+This is a bug fix release to address bug 3465482
+("Format string: wrong result for negative numbers above -1")
+
0.6.1
=====
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-04-08 13:13:16
|
Revision: 744
http://openautomation.svn.sourceforge.net/openautomation/?rev=744&view=rev
Author: mayerch
Date: 2012-04-08 13:13:08 +0000 (Sun, 08 Apr 2012)
Log Message:
-----------
Bug fix: The slider didn't respect a writeonly flag (discovered by Jan in http://knx-user-forum.de/221420-post36.html)
Modified Paths:
--------------
CometVisu/trunk/visu/structure/pure/slide.js
Modified: CometVisu/trunk/visu/structure/pure/slide.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/slide.js 2012-04-06 10:52:25 UTC (rev 743)
+++ CometVisu/trunk/visu/structure/pure/slide.js 2012-04-08 13:13:08 UTC (rev 744)
@@ -29,8 +29,9 @@
var src = this.textContent;
var transform = this.getAttribute('transform');
var readonly = this.getAttribute('readonly');
+ var writeonly = this.getAttribute('writeonly');
ga_list.push( src )
- address[ '_' + src ] = [ transform, readonly=='true' ];
+ address[ '_' + src ] = [ transform, readonly=='true', writeonly=='true' ];
if( Transform[ transform ] && Transform[ transform ].range )
{
if( !( datatype_min > Transform[ transform ].range.min ) )
@@ -54,7 +55,10 @@
'type' : 'dim',
'valueInternal': true
});
- for( var addr in address ) $actor.bind( addr, this.update );
+ for( var addr in address )
+ {
+ if( !address[addr][2] ) $actor.bind( addr, this.update ); // no writeonly
+ }
$actor.slider({
step: step,
min: min,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-04-06 10:52:31
|
Revision: 743
http://openautomation.svn.sourceforge.net/openautomation/?rev=743&view=rev
Author: makki1
Date: 2012-04-06 10:52:25 +0000 (Fri, 06 Apr 2012)
Log Message:
-----------
Editor - adapt * switch from big structure_pure.js to one file per widget
Modified Paths:
--------------
CometVisu/trunk/visu/edit_config.html
Modified: CometVisu/trunk/visu/edit_config.html
===================================================================
--- CometVisu/trunk/visu/edit_config.html 2012-04-03 22:18:18 UTC (rev 742)
+++ CometVisu/trunk/visu/edit_config.html 2012-04-06 10:52:25 UTC (rev 743)
@@ -8,14 +8,35 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="edit/style_edit.css" />
<link rel="stylesheet" type="text/css" href="edit/jquery-ui.css" />
- <script src="lib/jquery.js" type="text/javascript"></script>
+ <script src="dependencies/jquery.js" type="text/javascript"></script>
<script src="lib/compatibility.js" type="text/javascript"></script>
- <script src="lib/jquery-ui.js" type="text/javascript"></script>
- <script src="lib/scrollable.js" type="text/javascript"></script>
+ <script src="dependencies/jquery-ui.js" type="text/javascript"></script>
+ <script src="dependencies/scrollable.js" type="text/javascript"></script>
<script src="lib/cometvisu-client.js" type="text/javascript"></script>
<script src="lib/knx_decode.js" type="text/javascript"></script>
- <script src="designs/structure_pure.js" type="text/javascript"></script>
+ <!-- Load the widgets: start -->
+ <script src="structure/pure/_common.js" type="text/javascript"></script>
+ <script src="structure/pure/break.js" type="text/javascript"></script>
+ <script src="structure/pure/group.js" type="text/javascript"></script>
+ <script src="structure/pure/iframe.js" type="text/javascript"></script>
+ <script src="structure/pure/image.js" type="text/javascript"></script>
+ <script src="structure/pure/imagetrigger.js" type="text/javascript"></script>
+ <script src="structure/pure/include.js" type="text/javascript"></script>
+ <script src="structure/pure/info.js" type="text/javascript"></script>
+ <script src="structure/pure/infotrigger.js" type="text/javascript"></script>
+ <script src="structure/pure/line.js" type="text/javascript"></script>
+ <script src="structure/pure/multitrigger.js" type="text/javascript"></script>
+ <script src="structure/pure/page.js" type="text/javascript"></script>
+ <script src="structure/pure/slide.js" type="text/javascript"></script>
+ <script src="structure/pure/switch.js" type="text/javascript"></script>
+ <script src="structure/pure/text.js" type="text/javascript"></script>
+ <script src="structure/pure/toggle.js" type="text/javascript"></script>
+ <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="designs/structure_custom.js" type="text/javascript"></script>
+ <!-- Load the widgets: end -->
+ <script src="designs/structure_custom.js" type="text/javascript"></script>
<script type="text/javascript">
// always force Reload in Editor-Mode
forceReload = true;
@@ -25,7 +46,7 @@
<script src="transforms/transform_knx.js" type="text/javascript"></script>
<script src="edit/cometeditor.js" type="text/javascript"></script>
<script src="edit/visuconfig_edit.js" type="text/javascript"></script>
- <script src="lib/jquery.jnotify.js" type="text/javascript"></script>
+ <script src="dependencies/jquery.jnotify.js" type="text/javascript"></script>
<script src="edit/json2.js" type="text/javascript"></script>
<style type="text/css">
.loading { display: none; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-04-03 22:18:24
|
Revision: 742
http://openautomation.svn.sourceforge.net/openautomation/?rev=742&view=rev
Author: mayerch
Date: 2012-04-03 22:18:18 +0000 (Tue, 03 Apr 2012)
Log Message:
-----------
Preparation for cleaner file structure and automated build script:
* initial makefile that can reducde the multiple source files (e.g. for the widgets) into one to speed up network loading
Added Paths:
-----------
CometVisu/trunk/Makefile
CometVisu/trunk/VERSION
Added: CometVisu/trunk/Makefile
===================================================================
--- CometVisu/trunk/Makefile (rev 0)
+++ CometVisu/trunk/Makefile 2012-04-03 22:18:18 UTC (rev 742)
@@ -0,0 +1,54 @@
+PROJECT = "CometVisu"
+BUILD_DIR = build
+TARGET_DIR = release
+JS_ENGINE ?= `which node nodejs 2>/dev/null`
+LINT = ${JS_ENGINE} ${BUILD_DIR}/jslint.js
+
+VERSION = `cat VERSION`
+YUIDOCPATH = /home/cm/devel/yuidoc
+
+SRC = visu/designs/structure_pure.js
+
+STRUCTURE_PURE = visu/structure/pure
+STRUCTURE_PURE_SRC = \
+ ${STRUCTURE_PURE}/_common.js\
+ ${STRUCTURE_PURE}/break.js\
+ ${STRUCTURE_PURE}/group.js\
+ ${STRUCTURE_PURE}/iframe.js\
+ ${STRUCTURE_PURE}/image.js\
+ ${STRUCTURE_PURE}/imagetrigger.js\
+ ${STRUCTURE_PURE}/include.js\
+ ${STRUCTURE_PURE}/info.js\
+ ${STRUCTURE_PURE}/infotrigger.js\
+ ${STRUCTURE_PURE}/line.js\
+ ${STRUCTURE_PURE}/multitrigger.js\
+ ${STRUCTURE_PURE}/page.js\
+ ${STRUCTURE_PURE}/slide.js\
+ ${STRUCTURE_PURE}/switch.js\
+ ${STRUCTURE_PURE}/text.js\
+ ${STRUCTURE_PURE}/toggle.js\
+ ${STRUCTURE_PURE}/trigger.js\
+ ${STRUCTURE_PURE}/unknown.js\
+ ${STRUCTURE_PURE}/video.js
+
+docs:
+ ${YUIDOCPATH}/bin/yuidoc.py visu/lib visu/designs -p docs/parser -o docs -t build/template\
+ -v ${VERSION} -C "The CometVisu developers (please consult the AUTHORS file)" --showprivate -m ${PROJECT}\
+ -u "http://cometvisu.org/"
+
+lint:
+ ${LINT} ${SRC}
+
+visu/designs/structure_pure.js: $(STRUCTURE_PURE_SRC)
+ cat $^ > visu/designs/structure_pure.jss
+ cp visu/index.html visu/index.min.html
+ for SRC_FILE in $^; do \
+ SRC2_FILE=`echo $$SRC_FILE | sed 's_visu/__'`; \
+ sed "s#.*<script src=\"$$SRC2_FILE\" type=\"text/javascript\"></script>.*##" -i visu/index.min.html; \
+ done
+ sed 's#<!-- Load the widgets: start -->#<script src="designs/structure_pure.js" type="text/javascript"></script>#' -i visu/index.min.html
+
+build: $(SRC)
+ echo $^
+
+.PHONY: lint docs build
Added: CometVisu/trunk/VERSION
===================================================================
--- CometVisu/trunk/VERSION (rev 0)
+++ CometVisu/trunk/VERSION 2012-04-03 22:18:18 UTC (rev 742)
@@ -0,0 +1 @@
+SVN
\ 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...> - 2012-04-03 15:55:06
|
Revision: 741
http://openautomation.svn.sourceforge.net/openautomation/?rev=741&view=rev
Author: mayerch
Date: 2012-04-03 15:54:55 +0000 (Tue, 03 Apr 2012)
Log Message:
-----------
Preparation for cleaner file structure and automated build script:
* switch from big structure_pure.js to one file per widget - part 2
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_custom.js
CometVisu/trunk/visu/structure/pure/_common.js
CometVisu/trunk/visu/structure/pure/break.js
CometVisu/trunk/visu/structure/pure/group.js
CometVisu/trunk/visu/structure/pure/iframe.js
CometVisu/trunk/visu/structure/pure/image.js
CometVisu/trunk/visu/structure/pure/imagetrigger.js
CometVisu/trunk/visu/structure/pure/include.js
CometVisu/trunk/visu/structure/pure/info.js
CometVisu/trunk/visu/structure/pure/infotrigger.js
CometVisu/trunk/visu/structure/pure/line.js
CometVisu/trunk/visu/structure/pure/multitrigger.js
CometVisu/trunk/visu/structure/pure/page.js
CometVisu/trunk/visu/structure/pure/slide.js
CometVisu/trunk/visu/structure/pure/switch.js
CometVisu/trunk/visu/structure/pure/text.js
CometVisu/trunk/visu/structure/pure/toggle.js
CometVisu/trunk/visu/structure/pure/trigger.js
CometVisu/trunk/visu/structure/pure/unknown.js
CometVisu/trunk/visu/structure/pure/video.js
Modified: CometVisu/trunk/visu/designs/structure_custom.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_custom.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/designs/structure_custom.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -25,7 +25,7 @@
* @class VisuDesign_Custom
*/
function VisuDesign_Custom() {}; // do NOT change here
-VisuDesign_Custom.prototype = new VisuDesign(); // do NOT change here
+VisuDesign_Custom.prototype = basicdesign; // do NOT change here
/*
* Custom changes could go here and look e.g. like
Modified: CometVisu/trunk/visu/structure/pure/_common.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/_common.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/_common.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -370,4 +370,6 @@
if( layout.getAttribute('z' ) ) ret_val.z = layout.getAttribute('z' );
if( layout.getAttribute('floor') ) ret_val.floor = layout.getAttribute('floor');
return ret_val;
-}
\ No newline at end of file
+}
+
+var basicdesign = new VisuDesign();
\ No newline at end of file
Modified: CometVisu/trunk/visu/structure/pure/break.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/break.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/break.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('break', {
+basicdesign.addCreator('break', {
create: function( page, path ) {
return $( '<br />' );
},
Modified: CometVisu/trunk/visu/structure/pure/group.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/group.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/group.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('group', {
+basicdesign.addCreator('group', {
maturity: Maturity.development,
create: function( page, path, flavour ) {
var $p = $(page);
Modified: CometVisu/trunk/visu/structure/pure/iframe.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/iframe.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/iframe.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('iframe', {
+basicdesign.addCreator('iframe', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget iframe" />');
Modified: CometVisu/trunk/visu/structure/pure/image.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/image.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/image.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('image', {
+basicdesign.addCreator('image', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix image" />');
Modified: CometVisu/trunk/visu/structure/pure/imagetrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/imagetrigger.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/imagetrigger.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('imagetrigger', {
+basicdesign.addCreator('imagetrigger', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix image" />');
Modified: CometVisu/trunk/visu/structure/pure/include.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/include.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/include.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('include', {
+basicdesign.addCreator('include', {
maturity: Maturity.development,
create: function( page, path, flavour ) {
var p = $.get( $(page).attr('src') );
Modified: CometVisu/trunk/visu/structure/pure/info.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/info.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/info.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('info', {
+basicdesign.addCreator('info', {
create: function( element, path, flavour, type ) {
var $e = $(element);
var layout = $e.find('layout')[0];
Modified: CometVisu/trunk/visu/structure/pure/infotrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/infotrigger.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/infotrigger.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('infotrigger', {
+basicdesign.addCreator('infotrigger', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix switch" />');
Modified: CometVisu/trunk/visu/structure/pure/line.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/line.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/line.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('line', {
+basicdesign.addCreator('line', {
create: function( page, path ) {
return $( '<hr />' );
},
Modified: CometVisu/trunk/visu/structure/pure/multitrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/multitrigger.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/multitrigger.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('multitrigger', {
+basicdesign.addCreator('multitrigger', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix switch" />');
Modified: CometVisu/trunk/visu/structure/pure/page.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/page.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/page.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('page', {
+basicdesign.addCreator('page', {
create: function( page, path, flavour ) {
var $p = $(page);
Modified: CometVisu/trunk/visu/structure/pure/slide.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/slide.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/slide.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('slide', {
+basicdesign.addCreator('slide', {
create: function( page, path ) {
var $p = $(page);
var layout = $p.find('layout')[0];
Modified: CometVisu/trunk/visu/structure/pure/switch.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/switch.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/switch.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('switch', {
+basicdesign.addCreator('switch', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix switch" />');
Modified: CometVisu/trunk/visu/structure/pure/text.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/text.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/text.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('text', {
+basicdesign.addCreator('text', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix text" />');
Modified: CometVisu/trunk/visu/structure/pure/toggle.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/toggle.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/toggle.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('toggle', {
+basicdesign.addCreator('toggle', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix toggle" />');
Modified: CometVisu/trunk/visu/structure/pure/trigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/trigger.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/trigger.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('trigger', {
+basicdesign.addCreator('trigger', {
create: function( page, path ) {
var $p = $(page);
var layout = $p.find('layout')[0];
Modified: CometVisu/trunk/visu/structure/pure/unknown.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/unknown.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/unknown.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('unknown', {
+basicdesign.addCreator('unknown', {
create: function( page, path ) {
var ret_val = $('<div class="widget clearfix" />');
ret_val.append( '<pre>unknown: ' + page.nodeName + '</pre>' );
Modified: CometVisu/trunk/visu/structure/pure/video.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/video.js 2012-04-03 15:40:48 UTC (rev 740)
+++ CometVisu/trunk/visu/structure/pure/video.js 2012-04-03 15:54:55 UTC (rev 741)
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-VisuDesign.prototype.addCreator('video', {
+basicdesign.addCreator('video', {
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix video" />');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-04-03 15:41:01
|
Revision: 740
http://openautomation.svn.sourceforge.net/openautomation/?rev=740&view=rev
Author: mayerch
Date: 2012-04-03 15:40:48 +0000 (Tue, 03 Apr 2012)
Log Message:
-----------
Preparation for cleaner file structure and automated build script:
* switch from big structure_pure.js to one file per widget
Modified Paths:
--------------
CometVisu/trunk/visu/index.html
Added Paths:
-----------
CometVisu/trunk/visu/structure/
CometVisu/trunk/visu/structure/pure/
CometVisu/trunk/visu/structure/pure/_common.js
CometVisu/trunk/visu/structure/pure/break.js
CometVisu/trunk/visu/structure/pure/group.js
CometVisu/trunk/visu/structure/pure/iframe.js
CometVisu/trunk/visu/structure/pure/image.js
CometVisu/trunk/visu/structure/pure/imagetrigger.js
CometVisu/trunk/visu/structure/pure/include.js
CometVisu/trunk/visu/structure/pure/info.js
CometVisu/trunk/visu/structure/pure/infotrigger.js
CometVisu/trunk/visu/structure/pure/line.js
CometVisu/trunk/visu/structure/pure/multitrigger.js
CometVisu/trunk/visu/structure/pure/page.js
CometVisu/trunk/visu/structure/pure/slide.js
CometVisu/trunk/visu/structure/pure/switch.js
CometVisu/trunk/visu/structure/pure/text.js
CometVisu/trunk/visu/structure/pure/toggle.js
CometVisu/trunk/visu/structure/pure/trigger.js
CometVisu/trunk/visu/structure/pure/unknown.js
CometVisu/trunk/visu/structure/pure/video.js
Removed Paths:
-------------
CometVisu/trunk/visu/designs/structure_pure.js
Deleted: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-04-02 21:49:52 UTC (rev 739)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-04-03 15:40:48 UTC (rev 740)
@@ -1,1450 +0,0 @@
-/* visudesign_pure.js (c) 2010 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
- */
-
-/**
- * This module defines the widgets for the CometVisu visualisation.
- * @module Structure Pure
- * @title CometVisu Structure "pure"
-*/
-
-// Define ENUM of maturity levels for features, so that e.g. the editor can
-// ignore some widgets when they are not supported yet
-var Maturity = {
- release : 0,
- development : 1
-};
-
-/*
- * this function implements widget stylings
- *
- * implemented in: default_update, trigger-widget
- */
-$.fn.setWidgetStyling = function(value) {
- var styling = stylings[this.data('styling')];
- if (styling) {
- this.removeClass(styling['classnames']); // remove only styling classes
- if (styling[value]) { // fixed value
- this.addClass(styling[value]);
- } else { //
- value = parseFloat(value);
- var range = styling['range'];
- for( var min in range ) {
- if( min > value ) continue;
- if( range[min][0] < value ) continue; // check max
- this.addClass( range[min][1] );
- break;
- }
- }
- }
- return this;
-}
-
-/*
- * this function implements all widget layouts that are identical (JNK)
- *
- * implemented: rowspan, colspan
- */
-
-$.fn.setWidgetLayout = function(page) {
- this.data('colspan', page.attr('colspan') || $('head').data('colspanDefault'));
- if (page.attr('rowspan')) {
- this.data('rowspanClass', rowspanClass(page.attr('rowspan') || 1));
- this.addClass('innerrowspan');
- }
- return this;
- }
-
-/*
- * this function implements the widget label (JNK)
- */
-
-$.fn.makeWidgetLabel = function(page) {
- var labelElement = page.find('label')[0]; // get first label element
- if (labelElement) { // if exists, add it
- this.append($('<div class="label">' + labelElement.textContent + '</div>'));
- }
- return this;
-}
-
-/*
- * this function extracts all addresses with attributes (JNK)
- */
-
-function makeAddressList(page) {
- var address = {};
- page.find('address').each( function(){
- var src = this.textContent;
- var transform = this.getAttribute('transform');
- var readonly = this.getAttribute('readonly');
- var writeonly = this.getAttribute('writeonly');
- ga_list.push( src )
- address[ '_' + src ] = [ transform, readonly=='true', writeonly=='true' ];
- });
- return address;
-}
-
-/**
- * This class defines all the building blocks for a Visu in the "Pure" design
- * @class VisuDesign
- */
-
-function VisuDesign() {
- this.creators = {};
-
- this.addCreator = function (name, object) {
- this.creators[name] = object;
- }
-
- this.getCreator = function(name) {
- if (this.creators[name] === undefined) {
- return this.creators.unknown;
- }
- return this.creators[name];
- }
-
- this.popups = {};
-
- this.addPopup = function (name, object) {
- this.popups[name] = object;
- this.popups[name].type = name;
- }
-
- this.getPopup = function(name) {
- if (typeof this.popups[name] == undefined) {
- return this.popups.unknown;
- }
- return this.popups[name];
- }
-
- /*
- * The creators object contians all widgets creators and their mapping to the
- * XML config file tags
- */
- this.addCreator('page', {
- create: function( page, path, flavour ) {
- var $p = $(page);
-
- var address = {};
- if ($p.attr('ga')) {
- src = $p.attr('ga');
- ga_list.push($p.attr('ga'));
- address[ '_' + $p.attr('ga') ] = [ 'DPT:1.001', 0 ];
- }
-
- var pstyle = ( '0' != path ) ? 'display:none;' : ''; // subPage style
- var name = $p.attr('name');
- 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') + ';';
- if( wstyle != '' ) wstyle = 'style="' + wstyle + '"';
-
- var ret_val;
-
- if ($p.attr('visible')=='false') {
- ret_val=$('');
- } else { // default is visible
- ret_val = $('<div class="widget clearfix link pagelink"/>');
- ret_val.setWidgetLayout($p);
- var tst = $('<div ' + wstyle + '><a href="javascript:scrollToPage(\''+path+'\')">' + name + '</a></div>');
-
- ret_val.append(tst );
- }
-
- var childs = $p.children();
- //var container = $( '<div class="clearfix" />' );
-
- var subpage = $( '<div class="page" id="' + path + '" style="'+pstyle+';"/>' );
- var $container = $( '<div class="clearfix" path="'+path+'" style="height:100%;position:relative;" />');
- for( var addr in address ) $container.bind( addr, this.update );
- var container=$container;
-
- container.append( '<h1>' + name + '</h1>' );
- if( '2d' == type )
- {
- container.append( '<embed src="' + backdrop + '" style="position: absolute; top: 0px; left: 0px;z-index:-1;width:100%;height:100%;"/>' );
- } else if( '3d' == type )
- {
- var floorplan = JSFloorPlan3D( container, backdrop );
- floorplan.moveToRoom( 'Underground', false, true, false );
- container.data( 'JSFloorPlan3D', floorplan );
- container.find('canvas').css({position: 'absolute', top: '0px', left: '0px', 'z-index':'-1', width:'100%',height:'100%'});
- subpage.click( {JSFloorPlan3D:floorplan,callback:function(event){
- var j = this.JSFloorPlan3D;
- j.moveToRoom( j.getState('showFloor'), event.room.room, true, true, function(){
- container.trigger( 'update3d', j );
- });
- }}, floorplan.translateMouseEvent );
- $(window).bind( 'resize', function(){ floorplan.resize($('.page').width(), $('.page').height(), true);} );
- if ($p.attr('azimut')) {
- ga_list.push($p.attr('azimut'));
- address[ '_' + $p.attr('azimut') ] = [ 'DPT:5.001', 0, 'azimut' ];
- container.bind( '_' + $p.attr('azimut'), this.update );
- }
- if ($p.attr('elevation')) {
- ga_list.push($p.attr('elevation'));
- address[ '_' + $p.attr('elevation') ] = [ 'DPT:5.001', 0, 'elevation' ];
- container.bind( '_' + $p.attr('elevation'), this.update );
- };
- if ($p.attr('floor')) {
- ga_list.push($p.attr('floor'));
- address[ '_' + $p.attr('floor') ] = [ 'DPT:5.004', 0, 'floor' ];
- container.bind( '_' + $p.attr('floor'), this.update );
- };
- container.data( 'address', address );
- }
- $( childs ).each( function(i){
- container.append( create_pages( childs[i], path + '_' + i, flavour, type ) );
- } );
- subpage.append(container);
- if( flavour ) subpage.addClass( 'flavour_' + flavour );
- $('#pages').prepend( subpage );
- return ret_val;
- },
- attributes: {
- name: { type: 'string', required: true },
- align: { type: 'string', required: false },
- flavour: { type: 'string', required: false },
- ga: { type: 'addr', required: false },
- visible: { type: 'string', required: false },
- type: { type: 'string', required: false },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false },
- backdrop: { type: 'string', required: false },
- azimut: { type: 'addr', required: false },
- elevation:{ type: 'addr', required: false },
- floor: { type: 'addr', required: false }
- },
- elements: {
- },
- update: function(e, data) {
- var element = $(this);
- var value = defaultValueHandling( e, data, element );
- var type = element.data().address[ e.type ][2];
- switch( type )
- {
- case 'azimut':
- element.data().JSFloorPlan3D.setState('currentAzimut', value, true);
- element.trigger( 'update3d', element.data().JSFloorPlan3D );
- break;
-
- case 'elevation':
- element.data().JSFloorPlan3D.setState('currentElevation', value, true);
- element.trigger( 'update3d', element.data().JSFloorPlan3D );
- break;
-
- case 'floor':
- element.data().JSFloorPlan3D.moveToRoom( value, false, true, true, function(){
- element.trigger( 'update3d', element.data().JSFloorPlan3D );
- });
- break;
-
- default:
- if (data==01) {
- scrollToPage(this.attributes.path.nodeValue);
- visu.write(e.type.substr(1), transformEncode("DPT:1.001", 0));
- }
- }
- },
- content: true
- });
-
- this.addCreator('include', {
- maturity: Maturity.development,
- create: function( page, path, flavour ) {
- var p = $.get( $(page).attr('src') );
- var p = $.ajax({
- url: $(page).attr('src'),
- dataType: 'xml',
- async: false
- });
- var child = (p.responseXML.childNodes[0]);
- return create_pages( child, path , flavour );
- },
- attributes: {
- src: { type: 'string', required: true }
- },
- elements: {
- },
- content: true
- });
-
- this.addCreator('group', {
- maturity: Maturity.development,
- create: function( page, path, flavour ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix group" />');
- if( $p.attr('flavour') ) flavour = $p.attr('flavour');// sub design choice
- var hstyle = ''; // heading style
- if( $p.attr('align') ) hstyle += 'text-align:' + $p.attr('align') + ';';
- if( hstyle != '' ) hstyle = 'style="' + hstyle + '"';
- ret_val.setWidgetLayout($p);
- if ($p.attr('nowidget')=='true') {
- ret_val.removeClass('widget');
- }
- var childs = $p.children();
- var container = $( '<div class="clearfix"/>' );
- if( $p.attr('name') ) container.append( '<h2 ' + hstyle + '>' + $p.attr('name') + '</h2>' );
- $( childs ).each( function(i){
- container.append( create_pages( childs[i], path + '_' + i, flavour ) );
- } );
- if( flavour ) ret_val.addClass( 'flavour_' + flavour );
- ret_val.append( container );
- return ret_val;
- },
- attributes: {
- align: { type: 'string', required: false },
- flavour: { type: 'string', required: false },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false },
- nowidget: {type: 'string', required: false },
- name: { type: 'string', required: true }
- },
- elements: {
- },
- content: true
- });
-
- this.addCreator('line', {
- create: function( page, path ) {
- return $( '<hr />' );
- },
- attributes: {
- },
- content: false
- });
-
- this.addCreator('break', {
- create: function( page, path ) {
- return $( '<br />' );
- },
- attributes: {
- },
- elements: {
- },
- content: false
- });
-
- this.addCreator('text', {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix text" />');
- ret_val.setWidgetLayout($p);
- var style = '';
- if( $p.attr('align') ) style += 'text-align:' + $p.attr('align') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- ret_val.append( '<div ' + style + '>' + page.textContent + '</div>' );
- return ret_val;
- },
- attributes: {
- align: { type: 'string', required: false },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false }
- },
- elements: {
- },
- content: { type: 'string', required: true }
- });
-
- this.addCreator('info', {
- create: function( element, path, flavour, type ) {
- var $e = $(element);
- var layout = $e.find('layout')[0];
- var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
- 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({
- '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: defaultUpdate,
- update3d: defaultUpdate3d,
- attributes: {
- 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
- });
-
- this.addCreator('slide', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
- var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
- var ret_val = $('<div class="widget clearfix slide" ' + style + ' />');
- ret_val.setWidgetLayout($p).makeWidgetLabel($p);
- var address = {};
- var datatype_min = undefined;
- var datatype_max = undefined;
- $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 ] = [ transform, readonly=='true' ];
- if( Transform[ transform ] && Transform[ transform ].range )
- {
- if( !( datatype_min > Transform[ transform ].range.min ) )
- datatype_min = Transform[ transform ].range.min;
- if( !( datatype_max < Transform[ transform ].range.max ) )
- datatype_max = Transform[ transform ].range.max;
- }
- });
- var actor = $('<div class="actor">');
- var min = parseFloat( $p.attr('min') || datatype_min || 0 );
- var max = parseFloat( $p.attr('max') || datatype_max || 100 );
- var step = parseFloat( $p.attr('step') || 0.5 );
- var $actor = $(actor).data({
- 'events': $(actor).data( 'events' ),
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'min' : min,
- 'max' : max,
- 'step' : step,
- 'type' : 'dim',
- 'valueInternal': true
- });
- for( var addr in address ) $actor.bind( addr, this.update );
- $actor.slider({
- step: step,
- min: min,
- max: max,
- animate: true,
- start: this.slideStart,
- change: this.slideChange
- });
- ret_val.append( $actor );
- return ret_val;
- },
- update: function( e, data ) {
- var element = $(this);
- var value = transformDecode( element.data().address[ e.type ][0], data );
- if( element.data( 'value' ) != value )
- {
- element.data( 'value', value );
- element.data( 'valueInternal', false );
- element.slider('value', value);
- element.data( 'valueInternal', true );
- }
- },
- /*
- * Start a thread that regularily sends the silder position to the bus
- */
- slideStart:function(event,ui)
- {
- var actor = $( '.actor', $(this).parent() );
- actor.data( 'valueInternal', true );
- actor.data( 'updateFn', setInterval( function(){
- var data = actor.data();
- if( data.value == actor.slider('value') ) return;
- var asv = actor.slider('value');
- for( var addr in data.address )
- {
- if( data.address[addr][1] == true ) continue; // skip read only
- var dv = transformEncode( data.address[addr][0], asv );
- if( dv != transformEncode( data.address[addr][0], data.value ) )
- visu.write( addr.substr(1), dv );
- }
- data.value = actor.slider('value');
- }, 250 ) ); // update KNX every 250 ms
- },
- /*
- * Delete the update thread and send the final value of the slider to the bus
- */
- slideChange:function(event,ui)
- {
- var data = $(this).data();
- clearInterval( data.updateFn, ui.value);
- if( data.valueInternal && data.value != ui.value )
- for( var addr in data.address )
- {
- if( data.address[addr][1] == true ) continue; // skip read only
- var uv = transformEncode( data.address[addr][0], ui.value );
- if( uv != transformEncode( data.address[addr][0], data.value ) )
- visu.write( addr.substr(1), uv );
- }
- },
- attributes: {
- min: { type: 'numeric', required: false },
- max: { type: 'numeric', required: false },
- step: { type: 'numeric', 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
- });
-
- this.addCreator('switch', {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix switch" />');
- ret_val.setWidgetLayout($p)
- var labelElement = $p.find('label')[0];
- var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = makeAddressList($p);
- var actor = '<div class="actor switchUnpressed"><div class="value">-</div></div>';
- var $actor = $(actor).data( {
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'on_value' : $p.attr('on_value' ) || 1,
- 'off_value' : $p.attr('off_value') || 0,
- 'align' : $p.attr('align'),
- 'type' : 'switch'
- } ).bind( 'click', this.action );
- for( var addr in address )
- {
- if( !address[addr][2] ) $actor.bind( addr, this.update ); // no writeonly
- }
- ret_val.append( label ).append( $actor );
- return ret_val;
- },
- update: function(e,d) {
- var element = $(this);
- var value = defaultUpdate( e, d, element );
- var off = map( element.data( 'off_value' ), element );
- element.removeClass( value == off ? 'switchPressed' : 'switchUnpressed' );
- element.addClass( value == off ? 'switchUnpressed' : 'switchPressed' );
- },
- action: function() {
- var data = $(this).data();
- for( var addr in data.address )
- {
- if( data.address[addr][1] == true ) continue; // skip read only
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value == data.off_value ? data.on_value : data.off_value ) );
- }
- },
- attributes: {
- on_value: { type: 'string' , required: false },
- off_value: { type: 'string' , required: false },
- mapping: { type: 'mapping' , required: false },
- styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false },
- 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 }
- },
- content: false
- });
-
-
- this.addCreator('toggle', {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix toggle" />');
- ret_val.setWidgetLayout($p);
- var labelElement = $p.find('label')[0];
- var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = makeAddressList($p);
- var actor = '<div class="actor switchUnpressed"><div class="value">-</div></div>';
- var $actor = $(actor).data( {
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'align' : $p.attr('align'),
- 'type' : 'switch'
- } ).bind( 'click', this.action );
- for( var addr in address ) $actor.bind( addr, this.update );
- ret_val.append( label ).append( $actor );
- return ret_val;
- },
- update: function(e,d) {
- var element = $(this);
- var value = defaultUpdate( e, d, element );
- element.addClass('switchUnpressed');
- },
- action: function() {
- var data = $(this).data();
- var element_count = 0;
- var next_element;
- var first_element;
- for(var e in mappings[data.mapping])
- if(mappings[data.mapping].hasOwnProperty(e))
- {
- element_count++;
- if (e > data.value && !next_element)
- next_element = e;
- if (!first_element)
- first_element = e;
- }
- sendValue = (next_element) ? next_element : first_element;
- for( var addr in data.address )
- {
- if( data.address[addr][1] == true ) continue; // skip read only
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], sendValue ) );
- }
- },
- attributes: {
- mapping: { type: 'mapping' , required: false },
- styling: { type: 'styling' , required: false },
- align: { type: 'string' , 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 }
- },
- content: false
- });
-
- this.addCreator('multitrigger', {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix switch" />');
- ret_val.setWidgetLayout($p)
- var labelElement = $p.find('label')[0];
- var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = makeAddressList($p);
- var showstatus = $p.attr("showstatus") || "false";
- ret_val.append( label );
- var buttons = $('<div style="float:left"/>');
- var buttonCount = 0;
- if( $p.attr('button1label') )
- {
- //buttonCount++;
- var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
-
- actor += '<div class="value">' + $p.attr('button1label') + '</div>';
- actor += '</div>';
- var $actor = $(actor).data( {
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('button1value'),
- 'align' : $p.attr('align'),
- 'type' : 'switch'
- } ).bind( 'click', this.action );
- if( showstatus == "true" ) {
- for( var addr in address ) $actor.bind( addr, this.update );
- }
- buttons.append( $actor );
- if( 1 == (buttonCount++ % 2) ) buttons.append( $('<br/>') );
- }
- if( $p.attr('button2label') )
- {
- var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
- actor += '<div class="value">' + $p.attr('button2label') + '</div>';
- actor += '</div>';
- var $actor = $(actor).data( {
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('button2value'),
- 'type' : 'switch',
- 'align' : $p.attr('align')
- } ).bind( 'click', this.action );
- if( showstatus == "true" ) {
- for( var addr in address ) $actor.bind( addr, this.update );
- }
- buttons.append( $actor );
- if( 1 == (buttonCount++ % 2) ) buttons.append( $('<br/>') );
- }
- if( $p.attr('button3label') )
- {
- var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
- actor += '<div class="value">' + $p.attr('button3label') + '</div>';
- actor += '</div>';
- var $actor = $(actor).data( {
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('button3value'),
- 'type' : 'switch'
- } ).bind( 'click', this.action );
- if( showstatus == "true" ) {
- for( var addr in address ) $actor.bind( addr, this.update );
- }
- buttons.append( $actor );
- if( 1 == buttonCount++ % 2 ) buttons.append( $('<br/>') );
- }
- if( $p.attr('button4label') )
- {
- var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
- actor += '<div class="value">' + $p.attr('button4label') + '</div>';
- actor += '</div>';
- var $actor = $(actor).data( {
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('button4value'),
- 'type' : 'switch',
- } ).bind( 'click', this.action );
- if( showstatus == "true" ) {
- for( var addr in address ) $actor.bind( addr, this.update );
- }
- buttons.append( $actor );
- if( 1 == buttonCount++ % 2 ) buttons.append( $('<br/>') );
- }
- //for( var addr in address ) $actor.bind( addr, this.update );
- // ret_val.append( label ).append( $actor );
- return ret_val.append( buttons );
- },
- update: function(e,d) {
- var element = $(this);
- //var value = defaultUpdate( e, d, element );
- var thisTransform = element.data().address[ e.type ][0];
- var value = transformDecode( element.data().address[ e.type ][0], d );
- element.removeClass( value == element.data().value ? 'switchUnpressed' : 'switchPressed' );
- element.addClass( value == element.data().value ? 'switchPressed' : 'switchUnpressed' );
- },
- action: function() {
- var data = $(this).data();
- for( var addr in data.address )
- {
- if( data.address[addr][1] == true ) continue; // skip read only
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.value ) );
- }
- },
- attributes: {
- button1label: { type: 'string' , required: false },
- button1value: { type: 'string' , required: false },
- button2label: { type: 'string' , required: false },
- button2value: { type: 'string' , required: false },
- button3label: { type: 'string' , required: false },
- button3value: { type: 'string' , required: false },
- button4label: { type: 'string' , required: false },
- button4value: { type: 'string' , required: false },
- mapping: { type: 'mapping' , required: false },
- styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false },
- showstatus: { type: 'list' , required: true, list: {'true': "yes", 'false': "no"} },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false }
- },
- elements: {
- label: { type: 'string', required: false, multi: false },
- address: { type: 'address', required: true, multi: true }
- },
- content: false
- });
-
- this.addCreator('trigger', {
- create: function( page, path ) {
- var $p = $(page);
- var layout = $p.find('layout')[0];
- var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
- var value = $p.attr('value') ? $p.attr('value') : 0;
- var ret_val = $('<div class="widget clearfix switch" ' + style + ' />');
- ret_val.setWidgetLayout($p);
- var labelElement = $p.find('label')[0];
- var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = makeAddressList($p);
- var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
- var map = $p.attr('mapping');
- if( mappings[map] && mappings[map][value] )
- actor += '<div class="value">' + mappings[map][value] + '</div>';
- else
- actor += '<div class="value">' + value + '</div>';
- actor += '</div>';
- var $actor = $(actor).data( {
- 'address' : address,
- 'mapping' : $(page).attr('mapping'),
- 'styling' : $(page).attr('styling'),
- 'type' : 'trigger',
- 'align' : $p.attr('align'),
- 'sendValue': value
- } ).bind( 'click', this.action ).bind( 'mousedown', function(){
- $(this).removeClass('switchUnpressed').addClass('switchPressed');
- } ).bind( 'mouseup mouseout', function(){ // not perfect but simple
- $(this).removeClass('switchPressed').addClass('switchUnpressed');
- } ).setWidgetStyling(value);
- ret_val.append( label ).append( $actor );
- return ret_val;
- },
- action: function() {
- var data = $(this).data();
- for( var addr in data.address )
- {
- if( data.address[addr][1] == true ) continue; // skip read only
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], data.sendValue ) );
- }
- },
- attributes: {
- value: { type: 'string' , required: true },
- mapping: { type: 'mapping' , required: false },
- styling: { type: 'styling' , required: false },
- align: { type: 'string' , 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
- });
-
- this.addCreator('image', {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix image" />');
- ret_val.setWidgetLayout($p);
- var labelElement = $p.find('label')[0];
- ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
- var style = '';
- if( $p.attr('width' ) ) {
- style += 'width:' + $p.attr('width' ) + ';';
- } else {
- style += 'width: 100%;';
- }
- if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><img src="' +$p.attr('src') + '" ' + style + ' /></div>';
- var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
- ret_val.append( $(actor).data( {
- 'refresh': refresh
- } ).each(setupRefreshAction) ); // abuse "each" to call in context...
- return ret_val;
- },
- attributes: {
- src: { type: 'uri' , required: true },
- width: { type: 'string' , required: false },
- height: { type: 'string' , required: false },
- refresh: { type: 'numeric', required: false },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false }
- },
- elements: {
- label: { type: 'string', required: false, multi: false }
- },
- content: false
- });
-
- this.addCreator("imagetrigger", {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix image" />');
- ret_val.setWidgetLayout($p);
- ret_val.addClass ('imagetrigger');
- var value = $p.attr('value') ? $p.attr('value') : 0;
- var labelElement = $p.find('label')[0];
- ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
- var address = {};
- $p.find('address').each( function(){
- var src = this.textContent;
- ga_list.push( src )
- address[ '_' + src ] = [
- this.getAttribute('transform'), {
- 'readonly' : this.getAttribute('readonly'),
- 'writeonly' : this.getAttribute('writeonly')
- }
- ];
- });
- var style = ' style=" ';
- style += $p.attr('width' ) ? 'width:' + $p.attr('width' ) + ';' : 'width: 100%;';
- style += $p.attr('height' ) ? 'height:' + $p.attr('height' ) + ';"' : '"';
-
- var actor = '<div class="actor">';
- if ( $p.attr('type')=='show' )
- actor += '<img src="' + $p.attr('src') + '.' + $p.attr('suffix') + '" ' + style + ' />';
- else
- actor += '<img src="" ' + style + ' />';
- actor += '</div>';
-
- actor += '</div>';
- var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
- var $actor = $(actor).data( {
- 'address': address,
- 'refresh': refresh,
- 'src': $p.attr('src'),
- 'suffix': $p.attr('suffix'),
- 'type': $p.attr('type'),
- 'mapping': map,
- 'sendValue': $p.attr('sendValue') || ""
- } )
- .each(setupRefreshAction) // abuse "each" to call in context... refresh is broken with select right now
- .bind( 'click', this.action );
- for( var addr in address ) {
- $actor.bind( addr, this.update );
- }
- ret_val.append( $actor );
- return ret_val;
- },
- update: function(e,d) {
- var data = $(this).data();
- if ( data.address[e.type][1].writeonly == "true")
- return; // skip writeonly FIXME: writeonly shouldnt bind to update at all
- var val = transformDecode(data.address[e.type][0], d);
- if (data.type == "show")
- if (val == 0)
- $(this).children().hide();
- else
- $(this).children().attr("src", data.src + '.' + data.suffix ).show();
- else if (data.type == "select")
- if (val == 0)
- $(this).children().hide();
- else
- $(this).children().attr("src", data.src + val + '.' + data.suffix ).show();
-
- //FIXME: add value if mapping exists
- //FIXME: get image name from mapping
- //FIXME: add bitmask for multiple images
- //FIXME: add SVG-magics
- },
- action: function() {
- var data = $(this).data();
- sendValue = data.sendValue;
- for( var addr in data.address ) {
- if( data.address[addr][1].readonly == "true" )
- continue; // skip read only
- if( data.sendValue == "" )
- continue; // skip empty
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], sendValue ) );
- }
- },
- attributes: {
- src: { type: 'uri' , required: true },
- width: { type: 'string' , required: false },
- height: { type: 'string' , required: false },
- refresh: { type: 'numeric', required: false },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false },
- sendValue: { type: 'numeric', required: false },
- type: { type: 'list' , required: true, list: {'show': 'show', 'select': 'select' /* , 'bitmask': 'bitmask' */ } },
- mapping: { type: 'mapping', required: false },
- suffix: { type: 'list' , required: false, list: {'png': '.png', 'jpg': '.jpg', 'gif': '.gif', 'svg': '.svg', 'bmp': '.bmp'} }
- },
- elements: {
- label: { type: 'string', required: false, multi: false },
- address: { type: 'address', required: true, multi: true }
- },
- content: false
- });
-
- this.addCreator('video', {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix video" />');
- ret_val.setWidgetLayout($p);
- var labelElement = $p.find('label')[0];
- ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
- var autoplay = ($p.attr('autoplay') && $p.attr('autoplay')=='true') ? ' autoplay="autoplay"' : '';
- var style = '';
- if( $p.attr('width' ) ) style += 'width:' + $p.attr('width' ) + ';';
- if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><video src="' +$p.attr('src') + '" ' + style + autoplay + ' controls="controls" /></div>';
- ret_val.append( $(actor).data( {} ) );
- return ret_val;
- },
- attributes: {
- src: { type: 'uri' , required: true },
- width: { type: 'string' , required: false },
- height: { type: 'string' , required: false },
- autoplay:{ type: 'list' , required: true, list: {'true': "yes", 'false': "no"} },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false }
- },
- elements: {
- label: { type: 'string', required: false, multi: false }
- },
- content: false
- });
-
- this.addCreator('iframe', {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget iframe" />');
- ret_val.setWidgetLayout($p);
- ret_val.append( '<div class="label">' + page.textContent + '</div>' );
- var style = '';
- if( $p.attr('width' ) ) {
- style += 'width:' + $p.attr('width' ) + ';';
- } else { // default width is 100% of widget space (fix bug #3175343 part 1)
- style += 'width: 100%;';
- }
- if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
- if( $p.attr('frameborder') == "false" ) style += 'border: 0px ;';
- if( $p.attr('background') ) style += 'background-color:' + $p.attr('background') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><iframe src="' +$p.attr('src') + '" ' + style + '></iframe></div>';
-
- var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
- ret_val.append( $(actor).data( {
- 'refresh': refresh
- } ).each(setupRefreshAction) ); // abuse "each" to call in context...
- return ret_val;
- },
- attributes: {
- src: { type: 'uri' , required: true },
- width: { type: 'string', required: false },
- height: { type: 'string', required: false },
- frameborder: { type: 'list' , required: false, list: {'true': "yes", 'false': "no"} },
- background: { type: 'string', required: false },
- refresh: { type: 'numeric', required: false },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false }
- },
- elements: {
- label: { type: 'string', required: false, multi: false }
- },
- content: false
- });
-
- this.addCreator('infotrigger', {
- create: function( page, path ) {
- var $p = $(page);
- var ret_val = $('<div class="widget clearfix switch" />');
- ret_val.setWidgetLayout($p);
- // handle label
- var labelElement = $p.find('label')[0];
- var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- ret_val.append( label );
-
- // handle addresses
- var address = {};
- $p.find('address').each( function(){
- var src = this.textContent;
- var transform = this.getAttribute('transform');
- var readonly = this.getAttribute('readonly' ) == 'true';
- var isButton = this.getAttribute('variant' ) == 'button';
- address[ '_' + src ] = [ transform, readonly, isButton ];
- if( !isButton ) { // no need to listen to relative address
- ga_list.push( src );
- };
- });
-
- // create buttons + info
- var buttons = $('<div style="float:left;"/>');
- var buttonCount = 2;
-
- var actordown = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actordown += $p.attr( 'align' );
- actordown += '">';
- actordown += '<div class="value">' + ($p.attr('downlabel') ? $p.attr('downlabel') : '-') + '</div>';
- actordown += '</div>';
- var $actordown = $(actordown).data( {
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('downvalue') || 0,
- 'align' : $p.attr('align'),
- 'change' : $p.attr('change') || 'relative',
- 'min' : parseFloat($p.attr('min')) || 0,
- 'max' : parseFloat($p.attr('max')) || 255,
- 'type' : 'switch'
- } ).bind( 'click', this.action ).bind( 'mousedown', function(){
- $(this).removeClass('switchUnpressed').addClass('switchPressed');
- } ).bind( 'mouseup mouseout', function(){ // not perfect but simple
- $(this).removeClass('switchPressed').addClass('switchUnpressed');
- } );
-
- var actorup = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actorup += $p.attr( 'align' );
- actorup += '">';
- actorup += '<div class="value">' + ($p.attr('uplabel') ? $p.attr('uplabel') : '+') + '</div>';
- actorup += '</div>';
- var $actorup = $(actorup).data( {
- 'address' : address,
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'value' : $p.attr('upvalue') || 1,
- 'align' : $p.attr('align'),
- 'change' : $p.attr('change') || 'relative',
- 'min' : parseFloat($p.attr('min')) || 0,
- 'max' : parseFloat($p.attr('max')) || 255,
- 'type' : 'switch'
- } ).bind( 'click', this.action ).bind( 'mousedown', function(){
- $(this).removeClass('switchUnpressed').addClass('switchPressed');
- } ).bind( 'mouseup mouseout', function(){ // not perfect but simple
- $(this).removeClass('switchPressed').addClass('switchUnpressed');
- } );
-
- var actorinfo = '<div class="actor switchInvisible" ';
- if ( $p.attr( 'align' ) )
- actorinfo += 'style="text-align: '+$p.attr( 'align' )+'" ';
- actorinfo += '" ><div class="value">-</div></div>';
- var $actorinfo = $(actorinfo).data({
- 'address' : address,
- 'format' : $p.attr('format'),
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling'),
- 'align' : $p.attr('align'),
- });
- for( var addr in address )
- {
- if( !address[addr][2] ) // if NOT relative
- $actorinfo.bind( addr, this.update );
- }
-
- if ( $p.attr('infoposition' )==1 ) {
- buttons.append( $actordown );
- buttons.append( $actorinfo );
- buttons.append( $actorup );
- } else if ( $p.attr('infoposition' )==2 ) {
- buttons.append( $actordown );
- buttons.append( $actorup );
- buttons.append( $actorinfo );
- } else {
- buttons.append( $actorinfo );
- buttons.append( $actordown );
- buttons.append( $actorup );
- }
-
- ret_val.append( buttons );
- return ret_val;
- },
-
- update: function(e,d) {
- var element = $(this);
- var value = defaultUpdate( e, d, element );
- element.addClass('switchInvisible');
- },
- action: function() {
- var data = $(this).data();
- var value = data.value;
- var relative = ( data.change != 'absolute' );
- if( !relative )
- {
- value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
- value = value + parseFloat(data.value);
- if (value < data.min ) value = data.min;
- if( value > data.max ) value = data.max;
- }
- for( var addr in data.address )
- {
- if( data.address[addr][1] == true ) continue; // skip read only
- if( data.address[addr][2] != relative ) continue; // skip when address mode doesn't fit action mode
- visu.write( addr.substr(1), transformEncode( data.address[addr][0], value ) );
- }
- },
- attributes: {
- uplabel: { type: 'string' , required: false },
- upvalue: { type: 'string' , required: false },
- downlabel: { type: 'string' , required: false },
- downvalue: { type: 'string' , required: false },
- mapping: { type: 'mapping' , required: false },
- styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false },
- infoposition: { type: 'list' , required: true , list: {0: 'Info/Down/Up', 1: 'Down/Info/Up', 2: 'Down/Up/Info'} },
- format: { type: 'string' , required: false },
- change: { type: 'list' , required: false , list: {'relative': 'Send relative/delta values', 'absolute': 'Send absolute values'} },
- min: { type: 'numeric' , required: false },
- max: { type: 'numeric' , required: false },
- colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false }
- },
- elements: {
- label: { type: 'string', required: false, multi: false },
- address: { type: 'address', required: true, multi: true, options: {variant: ['', 'isbutton']} }
- },
- content: false
- });
-
- this.addCreator('unknown', {
- create: function( page, path ) {
- var ret_val = $('<div class="widget clearfix" />');
- ret_val.append( '<pre>unknown: ' + page.nodeName + '</pre>' );
- return ret_val;
- },
- attributes: {
- },
- content: {type: 'string', required: true}
- });
-
- this.addPopup('unknown', {
- create: function( attributes ) {
- var repositon = false;
- var ret_val = $('<div class="popup" style="display:none"/><div class="popup_background" style="display:none" />').appendTo('body');
- ret_val.addClass( this.type );
-
- if (attributes.title) {
- ret_val.filter(".popup").append( $('<div class="head" />').append(attributes.title));
- }
-
- if( attributes.content) {
- ret_val.filter(".popup").append( $('<div class="main" />').append(attributes.content));
- }
-
- if( attributes.width ) {
- ret_val.width( attributes.width );
- reposition = true;
- }
-
- if( attributes.height ) {
- ret_val.height( attributes.height );
- reposition = true;
- }
-
- var anchor = {x: -1, y: -1, w: 0, h: 0};
- var align;
- if( attributes.position )
- {
- if( attributes.position.offset )
- {
- var offset = attributes.position.offset();
- anchor.x = offset.left;
- anchor.y = offset.top;
- anchor.w = attributes.position.width();
- anchor.h = attributes.position.height();
- } else {
- if( attributes.position.hasOwnProperty('x') ) anchor.x = attributes.position.x;
- if( attributes.position.hasOwnProperty('y') ) anchor.y = attributes.position.y;
- if( attributes.position.hasOwnProperty('w') ) anchor.w = attributes.position.w;
- if( attributes.position.hasOwnProperty('h') ) anchor.h = attributes.position.h;
- if( anchor.w == 0 && anchor.h == 0 ) align = 5;
- }
- }
- if( attributes.align !== undefined ) align = attributes.align;
- var placement = placementStrategy(
- anchor,
- { w:ret_val.outerWidth(), h:ret_val.outerHeight() },
- { w:$(window).width() , h:$(window).height() },
- align
- );
- ret_val.css( 'left', placement.x );
- ret_val.css( 'top' , placement.y );
-
- ret_val.bind("click", function() {
- ret_val.remove();
- return false;
- });
-
- ret_val.css( 'display', 'block' );
- return ret_val;
- },
- attributes: {
- title: {type: 'string', required: false},
- content: {type: 'string', required: false},
- width: {type: 'string', required: false},
- height: {type: 'string', required: false},
- position: {type: 'object', required: false} // either {x:,y:} or an jQuery object
- }
- });
-
- this.addPopup('info' , $.extend(true, {}, this.getPopup('unknown')) );
- this.addPopup('warning', $.extend(true, {}, this.getPopup('unknown')) );
- this.addPopup('error' , $.extend(true, {}, this.getPopup('unknown')) ) ;
-
- this.slideAction = function(event,ui) {
- //alert(ui.value);
- var now = new Date().getTime();
- var data = $( '.actor', $(this).parent() ).data();
- if( data.last && (now - data.last) < 1000 ) return; // too fast => early exit
- $( '.actor', $(this).parent() ).data( 'last', now );
- //$(this).parent().data();
- // alert( data.GA + ' = ' + data.value );
- //visu.write( data.GA, data.value=='1' ? '0' : '1', data.datatype );
- //FIXME eigentlich richtig... visu.write( data.GA, ui.value, data.datatype );
- }
-
- /**
- * Setup a refresh interval in seconds if the 'refresh' in the .data()
- * ist bigger than 0
- */
- this.refreshAction = function(that) {
- var data = $(this).data();
- alert('this.refreshAction');
- }
-};
-
-/*
- * Figure out best placement of popup.
- * A preference can optionally be passed. The position is that of the numbers
- * on the numeric keypad. I.e. a value of "6" means centered above the anchor.
- * A value of "0" means centered to the page
- */
-function placementStrategy( anchor, popup, page, preference )
-{
- var position_order = [ 8, 2, 6, 4, 9, 3, 7, 1, 5, 0 ];
- if( preference !== undefined ) position_order.unshift( preference );
-
- for( pos in position_order )
- {
- var xy = {};
- switch(position_order[pos])
- {
- case 0: // page center - will allways work
- return { x: (page.w-popup.w)/2, y: (page.h-popup.h)/2 };
-
- case 1:
- xy.x = anchor.x - popup.w;
- xy.y = anchor.y + anchor.h;
- break;
-
- case 2:
- xy.x = anchor.x + anchor.w/2 - popup.w/2;
- xy.y = anchor.y + anchor.h;
- break;
-
- case 3:
- xy.x = anchor.x + anchor.w;
- xy.y = anchor.y + anchor.h;
- break;
-
- case 4:
- xy.x = anchor.x - popup.w;
- xy.y = anchor.y + anchor.h/2 - popup.h/2;
- break;
-
- case 5:
- xy.x = anchor.x + anchor.w/2 - popup.w/2;
- xy.y = anchor.y + anchor.h/2 - popup.h/2;
- break;
-
- case 6:
- xy.x = anchor.x + anchor.w;
- xy.y = anchor.y + anchor.h/2 - popup.h/2;
- break;
-
- case 7:
- xy.x = anchor.x - popup.w;
- xy.y = anchor.y - popup.h;
- break;
-
- case 8:
- xy.x = anchor.x + anchor.w/2 - popup.w/2;
- xy.y = anchor.y - popup.h;
- break;
-
- case 9:
- xy.x = anchor.x + anchor.w;
- xy.y = anchor.y - popup.h;
- break;
- }
-
- // test if that solution is valid
- if( xy.x >= 0 && xy.y >= 0 && xy.x+popup.w<=page.w && xy.y+popup.h<=page.h )
- return xy;
- }
-
- return { x: 0, y: 0 }; // sanity return
-}
-
-function defaultValueHandling( e, data, passedElement )
-{
- var element = passedElement || $(this);
- var thisTransform = element.data().address[ e.type ][0];
- var value = transformDecode( element.data().address[ e.type ][0], data );
-
- element.data( 'basicvalue', value );
- if( element.data( 'precision' ) )
- value = Number( value ).toPrecision( element.data( 'precision' ) );
- if( element.data( 'format' ) )
- value = sprintf( element.data( 'format' ), value );
- element.data( 'value', value );
- value = map( value, element );
- if( value.constructor == Date )
- {
- switch( thisTransform ) // special case for KNX
- {
- case 'DPT:10.001':
- value = value.toLocaleTimeString();
- break;
- case 'DPT:11.001':
- value = value.toLocaleDateString();
- break;
- }
- }
- return value;
-}
-
-function defaultUpdate( e, data, passedElement )
-{
-// var value = defaultValueHandling( e, data, passedElement )
- var element = passedElement || $(this);
- var value = defaultValueHandling( e, data, element );
-
- element.setWidgetStyling( element.data( 'basicvalue' ) );
-
- if( element.data( 'align' ) )
- element.addClass(element.data( 'align' ) );
-
- element.find('.value').text( value );
-
- return value;
-}
-
-function defaultUpdate3d( e, data, passedElement )
-{
- //var element = passedElement || $(this);
- var l = e.data.layout;
- var pos = data.building2screen( new THREE.Vector3( l.x, l.y, l.z ) );
- e.data.element.css( 'left', pos.x + 'px' );
- e.data.element.css( 'top' , pos.y + 'px' );
- //console.log( e, data, e.data, pos.x, pos.y );
-}
-
-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;
-}
-
-function extractLayout3d( layout )
-{
- var ret_val = {};
- if( layout.getAttribute('x' ) ) ret_val.x = layout.getAttribute('x' );
- if( layout.getAttribute('y' ) ) ret_val.y = layout.getAttribute('y' );
- if( layout.getAttribute('z' ) ) ret_val.z = layout.getAttribute('z' );
- if( layout.getAttribute('floor') ) ret_val.floor = layout.getAttribute('floor');
- return ret_val;
-}
\ No newline at end of file
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2012-04-02 21:49:52 UTC (rev 739)
+++ CometVisu/trunk/visu/index.html 2012-04-03 15:40:48 UTC (rev 740)
@@ -17,8 +17,28 @@
<script src="dependencies/jquery.svg.min.js" type="text/javascript"></script>
<script src="lib/cometvisu-client.js" type="text/javascript"></script>
<script src="lib/knx_decode.js" type="text/javascript"></script>
- <script src="designs/structure_pure.js" type="text/javascript"></script>
+ <!-- Load the widgets: start -->
+ <script src="structure/pure/_common.js" type="text/javascript"></script>
+ <script src="structure/pure/break.js" type="text/javascript"></script>
+ <script src="structure/pure/group.js" type="text/javascript"></script>
+ <script src="structure/pure/iframe.js" type="text/javascript"></script>
+ <script src="structure/pure/image.js" type="text/javascript"></script>
+ <script src="structure/pure/imagetrigger.js" type="text/javascript"></script>
+ <script src="structure/pure/include.js" type="text/javascript"></script>
+ <script src="structure/pure/info.js" type="text/javascript"></script>
+ <script src="structure/pure/infotrigger.js" type="text/javascript"></script>
+ <script src="structure/pure/line.js" type="text/javascript"></script>
+ <script src="structure/pure/multitrigger.js" type="text/javascript"></script>
+ <script src="structure/pure/page.js" type="text/javascript"></script>
+ <script src="structure/pure/slide.js" type="text/javascript"></script>
+ <script src="structure/pure/switch.js" type="text/javascript"></script>
+ <script src="structure/pure/text.js" type="text/javascript"></script>
+ <script src="structure/pure/toggle.js" type="text/javascript"></script>
+ <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="designs/structure_custom.js" type="text/javascript"></script>
+ <!-- Load the widgets: end -->
<script src="lib/templateengine.js" type="text/javascript"></script>
<script src="transforms/transform_default.js" type="text/javascript"></script>
<script src="transforms/transform_knx.js" type="text/javascript"></script>
Added: CometVisu/trunk/visu/structure/pure/_common.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/_common.js (rev 0)
+++ CometVisu/trunk/visu/structure/pure/_common.js 2012-...
[truncated message content] |
|
From: <ma...@us...> - 2012-04-02 21:49:59
|
Revision: 739
http://openautomation.svn.sourceforge.net/openautomation/?rev=739&view=rev
Author: mayerch
Date: 2012-04-02 21:49:52 +0000 (Mon, 02 Apr 2012)
Log Message:
-----------
Preparation for cleaner file structure and automated build script:
* initial support for automatic documentation generation (using YUIdoc)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_custom.js
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/lib/cometvisu-client.js
CometVisu/trunk/visu/lib/compatibility.js
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/designs/structure_custom.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_custom.js 2012-04-02 17:42:08 UTC (rev 738)
+++ CometVisu/trunk/visu/designs/structure_custom.js 2012-04-02 21:49:52 UTC (rev 739)
@@ -13,15 +13,21 @@
* 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
+ */
+
+/**
+ * This module defines the custom widget additions to the CometVisu visualisation.
+ * @module Structure custom
*/
/**
* This class defines all the custom changes to the visu
+ * @class VisuDesign_Custom
*/
function VisuDesign_Custom() {}; // do NOT change here
VisuDesign_Custom.prototype = new VisuDesign(); // do NOT change here
-/**
+/*
* Custom changes could go here and look e.g. like
****************************************
VisuDesign_Custom.prototype.addCreator("line", {
@@ -35,7 +41,7 @@
****************************************
*/
-/**
+/*
* This is a custom function that extends the available widgets.
* It's purpose is to change the design of the visu during runtime
* to demonstrate all available
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-04-02 17:42:08 UTC (rev 738)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-04-02 21:49:52 UTC (rev 739)
@@ -13,6 +13,12 @@
* 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
+ */
+
+/**
+ * This module defines the widgets for the CometVisu visualisation.
+ * @module Structure Pure
+ * @title CometVisu Structure "pure"
*/
// Define ENUM of maturity levels for features, so that e.g. the editor can
@@ -22,12 +28,11 @@
development : 1
};
-/**
+/*
* this function implements widget stylings
*
* implemented in: default_update, trigger-widget
*/
-
$.fn.setWidgetStyling = function(value) {
var styling = stylings[this.data('styling')];
if (styling) {
@@ -48,7 +53,7 @@
return this;
}
-/**
+/*
* this function implements all widget layouts that are identical (JNK)
*
* implemented: rowspan, colspan
@@ -63,7 +68,7 @@
return this;
}
- /**
+/*
* this function implements the widget label (JNK)
*/
@@ -75,9 +80,9 @@
return this;
}
-/**
- * this function extracts all addresses with attributes (JNK)
- */
+/*
+ * this function extracts all addresses with attributes (JNK)
+ */
function makeAddressList(page) {
var address = {};
@@ -94,6 +99,7 @@
/**
* This class defines all the building blocks for a Visu in the "Pure" design
+ * @class VisuDesign
*/
function VisuDesign() {
@@ -124,7 +130,7 @@
return this.popups[name];
}
- /**
+ /*
* The creators object contians all widgets creators and their mapping to the
* XML config file tags
*/
@@ -457,7 +463,7 @@
element.data( 'valueInternal', true );
}
},
- /**
+ /*
* Start a thread that regularily sends the silder position to the bus
*/
slideStart:function(event,ui)
@@ -478,7 +484,7 @@
data.value = actor.slider('value');
}, 250 ) ); // update KNX every 250 ms
},
- /**
+ /*
* Delete the update thread and send the final value of the slider to the bus
*/
slideChange:function(event,ui)
@@ -1297,7 +1303,7 @@
}
};
-/**
+/*
* Figure out best placement of popup.
* A preference can optionally be passed. The position is that of the numbers
* on the numeric keypad. I.e. a value of "6" means centered above the anchor.
Modified: CometVisu/trunk/visu/lib/cometvisu-client.js
===================================================================
--- CometVisu/trunk/visu/lib/cometvisu-client.js 2012-04-02 17:42:08 UTC (rev 738)
+++ CometVisu/trunk/visu/lib/cometvisu-client.js 2012-04-02 21:49:52 UTC (rev 739)
@@ -13,14 +13,19 @@
* 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 JavaScript library that implements the CometVisu protocol.
* @module CometVisu Client
* @title CometVisu Client
+ * @reqires jQuery
*/
/**
* Class that handles the communicaton of the client
* @class CometVisu
+ * @constructor foo
* @param {String} urlPrefix The address of the service
*/
function CometVisu( urlPrefix )
@@ -43,6 +48,7 @@
/**
* This function gets called once the communication is established and session information is available
+ * @method handleSession
*/
this.handleSession = function( json )
{
@@ -59,6 +65,7 @@
/**
* This function gets called once the communication is established and session information is available
+ * @method handleRead
*/
this.handleRead = function( json )
{
@@ -89,6 +96,7 @@
/**
* This function gets called on an error
* FIXME: this should be a prototype, so that the application developer can override it
+ * @method handleError
*/
this.handleError=function(xhr,str,excptObj)
{
@@ -113,6 +121,7 @@
/**
* Build the URL part that contains the addresses and filters
+ * @method buildRequest
*/
this.buildRequest = function()
{
@@ -124,6 +133,7 @@
/**
* Subscribe to the addresses in the parameter
* The second parameter (filter) is optional
+ * @method subscribe
*/
this.subscribe = function( addresses, filters )
{
@@ -137,7 +147,8 @@
/**
* This function starts the communication by a login and then runs the
- * ongoing communication task
+ * ongoing communication task
+ * @method login
*/
this.login = function()
{
@@ -150,6 +161,7 @@
/**
* This function stops an ongoing connection
+ * @method stop
*/
this.stop = function()
{
@@ -160,6 +172,7 @@
/**
* This function sends a value
+ * @method write
*/
this.write = function( address, value )
{
@@ -174,6 +187,7 @@
/**
* Restart the read request, e.g. when the watchdog kicks in
+ * @method restart
*/
this.restart = function()
{
@@ -185,6 +199,7 @@
/**
* The watchdog to recreate a read request when it stopped somehow
+ * @method watchdog
*/
var watchdog = (function(){
var last = new Date();
Modified: CometVisu/trunk/visu/lib/compatibility.js
===================================================================
--- CometVisu/trunk/visu/lib/compatibility.js 2012-04-02 17:42:08 UTC (rev 738)
+++ CometVisu/trunk/visu/lib/compatibility.js 2012-04-02 21:49:52 UTC (rev 739)
@@ -136,7 +136,7 @@
sprintf = sprintfWrapper.init;
-/**
+/*
* be able to access GET-Params
*/
$.extend({
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-04-02 17:42:08 UTC (rev 738)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-04-02 21:49:52 UTC (rev 739)
@@ -13,6 +13,9 @@
* 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
+ *
+ * @module Templateengine
+ * @title CometVisu templateengine
*/
var design = new VisuDesign_Custom();
@@ -111,7 +114,7 @@
return value;
}
-/**
+/*
* Make sure everything looks right when the window gets resized.
* This is necessary as the scroll effect requires a fixed element size
*/
@@ -440,7 +443,7 @@
}
}
-/**
+/*
* Show a popup of type "type".
* The attributes is an type dependend object
* This function returnes a jQuery object that points to the whole popup,
@@ -454,7 +457,7 @@
return design.popups[ type ].create( attributes );
}
-/**
+/*
* Remove the popup.
* The parameter is the jQuery object returned by the showPopup function
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-04-02 17:42:18
|
Revision: 738
http://openautomation.svn.sourceforge.net/openautomation/?rev=738&view=rev
Author: mayerch
Date: 2012-04-02 17:42:08 +0000 (Mon, 02 Apr 2012)
Log Message:
-----------
Preparation for cleaner file structure and automated build script:
* separation of CometVisu libraries and external dependencies
Modified Paths:
--------------
CometVisu/trunk/visu/index.html
CometVisu/trunk/visu/lib/cometvisu-client.js
Added Paths:
-----------
CometVisu/trunk/visu/dependencies/
CometVisu/trunk/visu/dependencies/jquery-ui.js
CometVisu/trunk/visu/dependencies/jquery-ui.min.js
CometVisu/trunk/visu/dependencies/jquery.jnotify.js
CometVisu/trunk/visu/dependencies/jquery.js
CometVisu/trunk/visu/dependencies/jquery.min.js
CometVisu/trunk/visu/dependencies/jquery.svg.min.js
CometVisu/trunk/visu/dependencies/jquery.tools.min.js
CometVisu/trunk/visu/dependencies/jquery.ui.touch-punch.js
CometVisu/trunk/visu/dependencies/jquery.ui.touch-punch.min.js
CometVisu/trunk/visu/dependencies/scrollable.js
CometVisu/trunk/visu/dependencies/scrollable.min.js
CometVisu/trunk/visu/dependencies/strftime-min.js
CometVisu/trunk/visu/dependencies/strftime.js
Removed Paths:
-------------
CometVisu/trunk/visu/lib/jquery-ui.js
CometVisu/trunk/visu/lib/jquery-ui.min.js
CometVisu/trunk/visu/lib/jquery.jnotify.js
CometVisu/trunk/visu/lib/jquery.js
CometVisu/trunk/visu/lib/jquery.min.js
CometVisu/trunk/visu/lib/jquery.svg.min.js
CometVisu/trunk/visu/lib/jquery.tools.min.js
CometVisu/trunk/visu/lib/jquery.ui.touch-punch.js
CometVisu/trunk/visu/lib/jquery.ui.touch-punch.min.js
CometVisu/trunk/visu/lib/scrollable.js
CometVisu/trunk/visu/lib/scrollable.min.js
CometVisu/trunk/visu/lib/strftime-min.js
CometVisu/trunk/visu/lib/strftime.js
Property Changed:
----------------
CometVisu/trunk/visu/
Property changes on: CometVisu/trunk/visu
___________________________________________________________________
Modified: svn:externals
- lib/jsfloorplan.js https://openautomation.svn.sourceforge.net/svnroot/openautomation/JSFloorPlan/trunk/src/jsfloorplan.js
lib/Three.js https://openautomation.svn.sourceforge.net/svnroot/openautomation/JSFloorPlan/trunk/lib/Three.js
lib/poly2tri.js https://openautomation.svn.sourceforge.net/svnroot/openautomation/JSFloorPlan/trunk/lib/poly2tri.js
media/demo_texture_512x512.png https://openautomation.svn.sourceforge.net/svnroot/openautomation/JSFloorPlan/trunk/media/demo_texture_512x512.png
+ dependencies/jsfloorplan.js https://openautomation.svn.sourceforge.net/svnroot/openautomation/JSFloorPlan/trunk/src/jsfloorplan.js
dependencies/Three.js https://openautomation.svn.sourceforge.net/svnroot/openautomation/JSFloorPlan/trunk/lib/Three.js
dependencies/poly2tri.js https://openautomation.svn.sourceforge.net/svnroot/openautomation/JSFloorPlan/trunk/lib/poly2tri.js
media/demo_texture_512x512.png https://openautomation.svn.sourceforge.net/svnroot/openautomation/JSFloorPlan/trunk/media/demo_texture_512x512.png
Copied: CometVisu/trunk/visu/dependencies/jquery-ui.js (from rev 737, CometVisu/trunk/visu/lib/jquery-ui.js)
===================================================================
--- CometVisu/trunk/visu/dependencies/jquery-ui.js (rev 0)
+++ CometVisu/trunk/visu/dependencies/jquery-ui.js 2012-04-02 17:42:08 UTC (rev 738)
@@ -0,0 +1,11767 @@
+/*!
+ * jQuery UI 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI
+ */
+(function( $, undefined ) {
+
+// prevent duplicate loading
+// this is only a problem because we proxy existing functions
+// and we don't want to double proxy them
+$.ui = $.ui || {};
+if ( $.ui.version ) {
+ return;
+}
+
+$.extend( $.ui, {
+ version: "1.8.16",
+
+ keyCode: {
+ ALT: 18,
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ COMMAND: 91,
+ COMMAND_LEFT: 91, // COMMAND
+ COMMAND_RIGHT: 93,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ MENU: 93, // COMMAND_RIGHT
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38,
+ WINDOWS: 91 // COMMAND
+ }
+});
+
+// plugins
+$.fn.extend({
+ propAttr: $.fn.prop || $.fn.attr,
+
+ _focus: $.fn.focus,
+ focus: function( delay, fn ) {
+ return typeof delay === "number" ?
+ this.each(function() {
+ var elem = this;
+ setTimeout(function() {
+ $( elem ).focus();
+ if ( fn ) {
+ fn.call( elem );
+ }
+ }, delay );
+ }) :
+ this._focus.apply( this, arguments );
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ },
+
+ zIndex: function( zIndex ) {
+ if ( zIndex !== undefined ) {
+ return this.css( "zIndex", zIndex );
+ }
+
+ if ( this.length ) {
+ var elem = $( this[ 0 ] ), position, value;
+ while ( elem.length && elem[ 0 ] !== document ) {
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
+ // This makes behavior of this function consistent across browsers
+ // WebKit always returns auto if the element is positioned
+ position = elem.css( "position" );
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+ // IE returns 0 when zIndex is not specified
+ // other browsers return a string
+ // we ignore the case of nested elements with an explicit value of 0
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+ value = parseInt( elem.css( "zIndex" ), 10 );
+ if ( !isNaN( value ) && value !== 0 ) {
+ return value;
+ }
+ }
+ elem = elem.parent();
+ }
+ }
+
+ return 0;
+ },
+
+ disableSelection: function() {
+ return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
+ ".ui-disableSelection", function( event ) {
+ event.preventDefault();
+ });
+ },
+
+ enableSelection: function() {
+ return this.unbind( ".ui-disableSelection" );
+ }
+});
+
+$.each( [ "Width", "Height" ], function( i, name ) {
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+ type = name.toLowerCase(),
+ orig = {
+ innerWidth: $.fn.innerWidth,
+ innerHeight: $.fn.innerHeight,
+ outerWidth: $.fn.outerWidth,
+ outerHeight: $.fn.outerHeight
+ };
+
+ function reduce( elem, size, border, margin ) {
+ $.each( side, function() {
+ size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
+ if ( border ) {
+ size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
+ }
+ if ( margin ) {
+ size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
+ }
+ });
+ return size;
+ }
+
+ $.fn[ "inner" + name ] = function( size ) {
+ if ( size === undefined ) {
+ return orig[ "inner" + name ].call( this );
+ }
+
+ return this.each(function() {
+ $( this ).css( type, reduce( this, size ) + "px" );
+ });
+ };
+
+ $.fn[ "outer" + name] = function( size, margin ) {
+ if ( typeof size !== "number" ) {
+ return orig[ "outer" + name ].call( this, size );
+ }
+
+ return this.each(function() {
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
+ });
+ };
+});
+
+// selectors
+function focusable( element, isTabIndexNotNaN ) {
+ var nodeName = element.nodeName.toLowerCase();
+ if ( "area" === nodeName ) {
+ var map = element.parentNode,
+ mapName = map.name,
+ img;
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
+ return false;
+ }
+ img = $( "img[usemap=#" + mapName + "]" )[0];
+ return !!img && visible( img );
+ }
+ return ( /input|select|textarea|button|object/.test( nodeName )
+ ? !element.disabled
+ : "a" == nodeName
+ ? element.href || isTabIndexNotNaN
+ : isTabIndexNotNaN)
+ // the element and all of its ancestors must be visible
+ && visible( element );
+}
+
+function visible( element ) {
+ return !$( element ).parents().andSelf().filter(function() {
+ return $.curCSS( this, "visibility" ) === "hidden" ||
+ $.expr.filters.hidden( this );
+ }).length;
+}
+
+$.extend( $.expr[ ":" ], {
+ data: function( elem, i, match ) {
+ return !!$.data( elem, match[ 3 ] );
+ },
+
+ focusable: function( element ) {
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
+ },
+
+ tabbable: function( element ) {
+ var tabIndex = $.attr( element, "tabindex" ),
+ isTabIndexNaN = isNaN( tabIndex );
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
+ }
+});
+
+// support
+$(function() {
+ var body = document.body,
+ div = body.appendChild( div = document.createElement( "div" ) );
+
+ $.extend( div.style, {
+ minHeight: "100px",
+ height: "auto",
+ padding: 0,
+ borderWidth: 0
+ });
+
+ $.support.minHeight = div.offsetHeight === 100;
+ $.support.selectstart = "onselectstart" in div;
+
+ // set display to none to avoid a layout bug in IE
+ // http://dev.jquery.com/ticket/4014
+ body.removeChild( div ).style.display = "none";
+});
+
+
+
+
+
+// deprecated
+$.extend( $.ui, {
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function( module, option, set ) {
+ var proto = $.ui[ module ].prototype;
+ for ( var i in set ) {
+ proto.plugins[ i ] = proto.plugins[ i ] || [];
+ proto.plugins[ i ].push( [ option, set[ i ] ] );
+ }
+ },
+ call: function( instance, name, args ) {
+ var set = instance.plugins[ name ];
+ if ( !set || !instance.element[ 0 ].parentNode ) {
+ return;
+ }
+
+ for ( var i = 0; i < set.length; i++ ) {
+ if ( instance.options[ set[ i ][ 0 ] ] ) {
+ set[ i ][ 1 ].apply( instance.element, args );
+ }
+ }
+ }
+ },
+
+ // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
+ contains: function( a, b ) {
+ return document.compareDocumentPosition ?
+ a.compareDocumentPosition( b ) & 16 :
+ a !== b && a.contains( b );
+ },
+
+ // only used by resizable
+ hasScroll: function( el, a ) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ( $( el ).css( "overflow" ) === "hidden") {
+ return false;
+ }
+
+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
+ has = false;
+
+ if ( el[ scroll ] > 0 ) {
+ return true;
+ }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[ scroll ] = 1;
+ has = ( el[ scroll ] > 0 );
+ el[ scroll ] = 0;
+ return has;
+ },
+
+ // these are odd functions, fix the API or move into individual plugins
+ isOverAxis: function( x, reference, size ) {
+ //Determines when x coordinate is over "b" element axis
+ return ( x > reference ) && ( x < ( reference + size ) );
+ },
+ isOver: function( y, x, top, left, height, width ) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
+ }
+});
+
+})( jQuery );
+/*!
+ * jQuery UI Widget 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Widget
+ */
+(function( $, undefined ) {
+
+// jQuery 1.4+
+if ( $.cleanData ) {
+ var _cleanData = $.cleanData;
+ $.cleanData = function( elems ) {
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ try {
+ $( elem ).triggerHandler( "remove" );
+ // http://bugs.jquery.com/ticket/8235
+ } catch( e ) {}
+ }
+ _cleanData( elems );
+ };
+} else {
+ var _remove = $.fn.remove;
+ $.fn.remove = function( selector, keepData ) {
+ return this.each(function() {
+ if ( !keepData ) {
+ if ( !selector || $.filter( selector, [ this ] ).length ) {
+ $( "*", this ).add( [ this ] ).each(function() {
+ try {
+ $( this ).triggerHandler( "remove" );
+ // http://bugs.jquery.com/ticket/8235
+ } catch( e ) {}
+ });
+ }
+ }
+ return _remove.call( $(this), selector, keepData );
+ });
+ };
+}
+
+$.widget = function( name, base, prototype ) {
+ var namespace = name.split( "." )[ 0 ],
+ fullName;
+ name = name.split( "." )[ 1 ];
+ fullName = namespace + "-" + name;
+
+ if ( !prototype ) {
+ prototype = base;
+ base = $.Widget;
+ }
+
+ // create selector for plugin
+ $.expr[ ":" ][ fullName ] = function( elem ) {
+ return !!$.data( elem, name );
+ };
+
+ $[ namespace ] = $[ namespace ] || {};
+ $[ namespace ][ name ] = function( options, element ) {
+ // allow instantiation without initializing for simple inheritance
+ if ( arguments.length ) {
+ this._createWidget( options, element );
+ }
+ };
+
+ var basePrototype = new base();
+ // we need to make the options hash a property directly on the new instance
+ // otherwise we'll modify the options hash on the prototype that we're
+ // inheriting from
+// $.each( basePrototype, function( key, val ) {
+// if ( $.isPlainObject(val) ) {
+// basePrototype[ key ] = $.extend( {}, val );
+// }
+// });
+ basePrototype.options = $.extend( true, {}, basePrototype.options );
+ $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
+ namespace: namespace,
+ widgetName: name,
+ widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
+ widgetBaseClass: fullName
+ }, prototype );
+
+ $.widget.bridge( name, $[ namespace ][ name ] );
+};
+
+$.widget.bridge = function( name, object ) {
+ $.fn[ name ] = function( options ) {
+ var isMethodCall = typeof options === "string",
+ args = Array.prototype.slice.call( arguments, 1 ),
+ returnValue = this;
+
+ // allow multiple hashes to be passed on init
+ options = !isMethodCall && args.length ?
+ $.extend.apply( null, [ true, options ].concat(args) ) :
+ options;
+
+ // prevent calls to internal methods
+ if ( isMethodCall && options.charAt( 0 ) === "_" ) {
+ return returnValue;
+ }
+
+ if ( isMethodCall ) {
+ this.each(function() {
+ var instance = $.data( this, name ),
+ methodValue = instance && $.isFunction( instance[options] ) ?
+ instance[ options ].apply( instance, args ) :
+ instance;
+ // TODO: add this back in 1.9 and use $.error() (see #5972)
+// if ( !instance ) {
+// throw "cannot call methods on " + name + " prior to initialization; " +
+// "attempted to call method '" + options + "'";
+// }
+// if ( !$.isFunction( instance[options] ) ) {
+// throw "no such method '" + options + "' for " + name + " widget instance";
+// }
+// var methodValue = instance[ options ].apply( instance, args );
+ if ( methodValue !== instance && methodValue !== undefined ) {
+ returnValue = methodValue;
+ return false;
+ }
+ });
+ } else {
+ this.each(function() {
+ var instance = $.data( this, name );
+ if ( instance ) {
+ instance.option( options || {} )._init();
+ } else {
+ $.data( this, name, new object( options, this ) );
+ }
+ });
+ }
+
+ return returnValue;
+ };
+};
+
+$.Widget = function( options, element ) {
+ // allow instantiation without initializing for simple inheritance
+ if ( arguments.length ) {
+ this._createWidget( options, element );
+ }
+};
+
+$.Widget.prototype = {
+ widgetName: "widget",
+ widgetEventPrefix: "",
+ options: {
+ disabled: false
+ },
+ _createWidget: function( options, element ) {
+ // $.widget.bridge stores the plugin instance, but we do it anyway
+ // so that it's stored even before the _create function runs
+ $.data( element, this.widgetName, this );
+ this.element = $( element );
+ this.options = $.extend( true, {},
+ this.options,
+ this._getCreateOptions(),
+ options );
+
+ var self = this;
+ this.element.bind( "remove." + this.widgetName, function() {
+ self.destroy();
+ });
+
+ this._create();
+ this._trigger( "create" );
+ this._init();
+ },
+ _getCreateOptions: function() {
+ return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
+ },
+ _create: function() {},
+ _init: function() {},
+
+ destroy: function() {
+ this.element
+ .unbind( "." + this.widgetName )
+ .removeData( this.widgetName );
+ this.widget()
+ .unbind( "." + this.widgetName )
+ .removeAttr( "aria-disabled" )
+ .removeClass(
+ this.widgetBaseClass + "-disabled " +
+ "ui-state-disabled" );
+ },
+
+ widget: function() {
+ return this.element;
+ },
+
+ option: function( key, value ) {
+ var options = key;
+
+ if ( arguments.length === 0 ) {
+ // don't return a reference to the internal hash
+ return $.extend( {}, this.options );
+ }
+
+ if (typeof key === "string" ) {
+ if ( value === undefined ) {
+ return this.options[ key ];
+ }
+ options = {};
+ options[ key ] = value;
+ }
+
+ this._setOptions( options );
+
+ return this;
+ },
+ _setOptions: function( options ) {
+ var self = this;
+ $.each( options, function( key, value ) {
+ self._setOption( key, value );
+ });
+
+ return this;
+ },
+ _setOption: function( key, value ) {
+ this.options[ key ] = value;
+
+ if ( key === "disabled" ) {
+ this.widget()
+ [ value ? "addClass" : "removeClass"](
+ this.widgetBaseClass + "-disabled" + " " +
+ "ui-state-disabled" )
+ .attr( "aria-disabled", value );
+ }
+
+ return this;
+ },
+
+ enable: function() {
+ return this._setOption( "disabled", false );
+ },
+ disable: function() {
+ return this._setOption( "disabled", true );
+ },
+
+ _trigger: function( type, event, data ) {
+ var callback = this.options[ type ];
+
+ event = $.Event( event );
+ event.type = ( type === this.widgetEventPrefix ?
+ type :
+ this.widgetEventPrefix + type ).toLowerCase();
+ data = data || {};
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if ( event.originalEvent ) {
+ for ( var i = $.event.props.length, prop; i; ) {
+ prop = $.event.props[ --i ];
+ event[ prop ] = event.originalEvent[ prop ];
+ }
+ }
+
+ this.element.trigger( event, data );
+
+ return !( $.isFunction(callback) &&
+ callback.call( this.element[0], event, data ) === false ||
+ event.isDefaultPrevented() );
+ }
+};
+
+})( jQuery );
+/*!
+ * jQuery UI Mouse 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Mouse
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ */
+(function( $, undefined ) {
+
+var mouseHandled = false;
+$( document ).mouseup( function( e ) {
+ mouseHandled = false;
+});
+
+$.widget("ui.mouse", {
+ options: {
+ cancel: ':input,option',
+ distance: 1,
+ delay: 0
+ },
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
+ $.removeData(event.target, self.widgetName + '.preventClickEvent');
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ if( mouseHandled ) { return };
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ // event.target.nodeName works around a bug in IE 8 with
+ // disabled inputs (#7620)
+ elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // Click event may never have fired (Gecko & Opera)
+ if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
+ $.removeData(event.target, this.widgetName + '.preventClickEvent');
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ event.preventDefault();
+
+ mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+
+ if (event.target == this._mouseDownEvent.target) {
+ $.data(event.target, this.widgetName + '.preventClickEvent', true);
+ }
+
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+});
+
+})(jQuery);
+/*
+ * jQuery UI Position 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Position
+ */
+(function( $, undefined ) {
+
+$.ui = $.ui || {};
+
+var horizontalPositions = /left|center|right/,
+ verticalPositions = /top|center|bottom/,
+ center = "center",
+ _position = $.fn.position,
+ _offset = $.fn.offset;
+
+$.fn.position = function( options ) {
+ if ( !options || !options.of ) {
+ return _position.apply( this, arguments );
+ }
+
+ // make a copy, we don't want to modify arguments
+ options = $.extend( {}, options );
+
+ var target = $( options.of ),
+ targetElem = target[0],
+ collision = ( options.collision || "flip" ).split( " " ),
+ offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
+ targetWidth,
+ targetHeight,
+ basePosition;
+
+ if ( targetElem.nodeType === 9 ) {
+ targetWidth = target.width();
+ targetHeight = target.height();
+ basePosition = { top: 0, left: 0 };
+ // TODO: use $.isWindow() in 1.9
+ } else if ( targetElem.setTimeout ) {
+ targetWidth = target.width();
+ targetHeight = target.height();
+ basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
+ } else if ( targetElem.preventDefault ) {
+ // force left top to allow flipping
+ options.at = "left top";
+ targetWidth = targetHeight = 0;
+ basePosition = { top: options.of.pageY, left: options.of.pageX };
+ } else {
+ targetWidth = target.outerWidth();
+ targetHeight = target.outerHeight();
+ basePosition = target.offset();
+ }
+
+ // force my and at to have valid horizontal and veritcal positions
+ // if a value is missing or invalid, it will be converted to center
+ $.each( [ "my", "at" ], function() {
+ var pos = ( options[this] || "" ).split( " " );
+ if ( pos.length === 1) {
+ pos = horizontalPositions.test( pos[0] ) ?
+ pos.concat( [center] ) :
+ verticalPositions.test( pos[0] ) ?
+ [ center ].concat( pos ) :
+ [ center, center ];
+ }
+ pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center;
+ pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center;
+ options[ this ] = pos;
+ });
+
+ // normalize collision option
+ if ( collision.length === 1 ) {
+ collision[ 1 ] = collision[ 0 ];
+ }
+
+ // normalize offset option
+ offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
+ if ( offset.length === 1 ) {
+ offset[ 1 ] = offset[ 0 ];
+ }
+ offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
+
+ if ( options.at[0] === "right" ) {
+ basePosition.left += targetWidth;
+ } else if ( options.at[0] === center ) {
+ basePosition.left += targetWidth / 2;
+ }
+
+ if ( options.at[1] === "bottom" ) {
+ basePosition.top += targetHeight;
+ } else if ( options.at[1] === center ) {
+ basePosition.top += targetHeight / 2;
+ }
+
+ basePosition.left += offset[ 0 ];
+ basePosition.top += offset[ 1 ];
+
+ return this.each(function() {
+ var elem = $( this ),
+ elemWidth = elem.outerWidth(),
+ elemHeight = elem.outerHeight(),
+ marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0,
+ marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0,
+ collisionWidth = elemWidth + marginLeft +
+ ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ),
+ collisionHeight = elemHeight + marginTop +
+ ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ),
+ position = $.extend( {}, basePosition ),
+ collisionPosition;
+
+ if ( options.my[0] === "right" ) {
+ position.left -= elemWidth;
+ } else if ( options.my[0] === center ) {
+ position.left -= elemWidth / 2;
+ }
+
+ if ( options.my[1] === "bottom" ) {
+ position.top -= elemHeight;
+ } else if ( options.my[1] === center ) {
+ position.top -= elemHeight / 2;
+ }
+
+ // prevent fractions (see #5280)
+ position.left = Math.round( position.left );
+ position.top = Math.round( position.top );
+
+ collisionPosition = {
+ left: position.left - marginLeft,
+ top: position.top - marginTop
+ };
+
+ $.each( [ "left", "top" ], function( i, dir ) {
+ if ( $.ui.position[ collision[i] ] ) {
+ $.ui.position[ collision[i] ][ dir ]( position, {
+ targetWidth: targetWidth,
+ targetHeight: targetHeight,
+ elemWidth: elemWidth,
+ elemHeight: elemHeight,
+ collisionPosition: collisionPosition,
+ collisionWidth: collisionWidth,
+ collisionHeight: collisionHeight,
+ offset: offset,
+ my: options.my,
+ at: options.at
+ });
+ }
+ });
+
+ if ( $.fn.bgiframe ) {
+ elem.bgiframe();
+ }
+ elem.offset( $.extend( position, { using: options.using } ) );
+ });
+};
+
+$.ui.position = {
+ fit: {
+ left: function( position, data ) {
+ var win = $( window ),
+ over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft();
+ position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left );
+ },
+ top: function( position, data ) {
+ var win = $( window ),
+ over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop();
+ position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top );
+ }
+ },
+
+ flip: {
+ left: function( position, data ) {
+ if ( data.at[0] === center ) {
+ return;
+ }
+ var win = $( window ),
+ over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(),
+ myOffset = data.my[ 0 ] === "left" ?
+ -data.elemWidth :
+ data.my[ 0 ] === "right" ?
+ data.elemWidth :
+ 0,
+ atOffset = data.at[ 0 ] === "left" ?
+ data.targetWidth :
+ -data.targetWidth,
+ offset = -2 * data.offset[ 0 ];
+ position.left += data.collisionPosition.left < 0 ?
+ myOffset + atOffset + offset :
+ over > 0 ?
+ myOffset + atOffset + offset :
+ 0;
+ },
+ top: function( position, data ) {
+ if ( data.at[1] === center ) {
+ return;
+ }
+ var win = $( window ),
+ over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(),
+ myOffset = data.my[ 1 ] === "top" ?
+ -data.elemHeight :
+ data.my[ 1 ] === "bottom" ?
+ data.elemHeight :
+ 0,
+ atOffset = data.at[ 1 ] === "top" ?
+ data.targetHeight :
+ -data.targetHeight,
+ offset = -2 * data.offset[ 1 ];
+ position.top += data.collisionPosition.top < 0 ?
+ myOffset + atOffset + offset :
+ over > 0 ?
+ myOffset + atOffset + offset :
+ 0;
+ }
+ }
+};
+
+// offset setter from jQuery 1.4
+if ( !$.offset.setOffset ) {
+ $.offset.setOffset = function( elem, options ) {
+ // set position first, in-case top/left are set even on static elem
+ if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
+ elem.style.position = "relative";
+ }
+ var curElem = $( elem ),
+ curOffset = curElem.offset(),
+ curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
+ curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
+ props = {
+ top: (options.top - curOffset.top) + curTop,
+ left: (options.left - curOffset.left) + curLeft
+ };
+
+ if ( 'using' in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ };
+
+ $.fn.offset = function( options ) {
+ var elem = this[ 0 ];
+ if ( !elem || !elem.ownerDocument ) { return null; }
+ if ( options ) {
+ return this.each(function() {
+ $.offset.setOffset( this, options );
+ });
+ }
+ return _offset.call( this );
+ };
+}
+
+}( jQuery ));
+/*
+ * jQuery UI Draggable 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function( $, undefined ) {
+
+$.widget("ui.draggable", $.ui.mouse, {
+ widgetEventPrefix: "drag",
+ options: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ },
+ _create: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+
+ return this;
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ // among others, prevent a drag on a resizable-handle
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ if ( o.iframeFix ) {
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ }
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.positionAbs = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this.position = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Trigger event + callbacks
+ if(this._trigger("start", event) === false) {
+ this._clear();
+ return false;
+ }
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+
+ //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
+ if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event);
+
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ if(this._trigger('drag', event, ui) === false) {
+ this._mouseUp({});
+ return false;
+ }
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ //if the original element is removed, don't bother to continue if helper is set to "original"
+ if((!this.element[0] || !this.element[0].parentNode) && this.options.helper == "original")
+ return false;
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ if(self._trigger("stop", event) !== false) {
+ self._clear();
+ }
+ });
+ } else {
+ if(this._trigger("stop", event) !== false) {
+ this._clear();
+ }
+ }
+
+ return false;
+ },
+
+ _mouseUp: function(event) {
+ if (this.options.iframeFix === true) {
+ $("div.ui-draggable-iframeFix").each(function() {
+ this.parentNode.removeChild(this);
+ }); //Remove frame helpers
+ }
+
+ //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
+ if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event);
+
+ return $.ui.mouse.prototype._mouseUp.call(this, event);
+ },
+
+ cancel: function() {
+
+ if(this.helper.is(".ui-draggable-dragging")) {
+ this._mouseUp({});
+ } else {
+ this._clear();
+ }
+
+ return this;
+
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if (typeof obj == 'string') {
+ obj = obj.split(' ');
+ }
+ if ($.isArray(obj)) {
+ obj = {left: +obj[0], top: +obj[1] || 0};
+ }
+ if ('left' in obj) {
+ this.offset.click.left = obj.left + this.margins.left;
+ }
+ if ('right' in obj) {
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ }
+ if ('top' in obj) {
+ this.offset.click.top = obj.top + this.margins.top;
+ }
+ if ('bottom' in obj) {
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ }
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0),
+ right: (parseInt(this.element.css("marginRight"),10) || 0),
+ bottom: (parseInt(this.element.css("marginBottom"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
+ o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
+ (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var c = $(o.containment);
+ var ce = c[0]; if(!ce) return;
+ var co = c.offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0),
+ (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0),
+ (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right,
+ (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom
+ ];
+ this.relative_container = c;
+
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+ var containment;
+ if(this.containment) {
+ if (this.relative_container){
+ var co = this.relative_container.offset();
+ containment = [ this.containment[0] + co.left,
+ this.containment[1] + co.top,
+ this.containment[2] + co.left,
+ this.containment[3] + co.top ];
+ }
+ else {
+ containment = this.containment;
+ }
+
+ if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
+ var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
+ pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
+ pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.Widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ originalPosition: this.originalPosition,
+ offset: this.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.draggable, {
+ version: "1.8.16"
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = i...
[truncated message content] |
|
From: <e....@us...> - 2012-03-30 14:10:37
|
Revision: 737
http://openautomation.svn.sourceforge.net/openautomation/?rev=737&view=rev
Author: e.max
Date: 2012-03-30 14:10:30 +0000 (Fri, 30 Mar 2012)
Log Message:
-----------
Neue query-Parameter:
-s text
Liste alle GA, deren Beschreibung 'text' enthaelt, ungeachtet Gross/Kleinschreibung
-S text
dto. Gross/Kleinschreibung beachtet
-H gruppe
listet alle GA inhauptgruppe 'gruppe'
-M listet alle GA dren Mittelgruppe 'gruppe' ist
-G listet alle GA dren Untergruppe 'gruppe' ist
Alle Suchkriterien werden in UND-Logik geprueft, d.h.: es muessen alle Kriterien uebereinstimmen.
Siehe auch 'perldoc knxquery.pl'
Modified Paths:
--------------
wiregate/tools/knxquery/knxquery.pl
Modified: wiregate/tools/knxquery/knxquery.pl
===================================================================
--- wiregate/tools/knxquery/knxquery.pl 2012-03-26 21:42:46 UTC (rev 736)
+++ wiregate/tools/knxquery/knxquery.pl 2012-03-30 14:10:30 UTC (rev 737)
@@ -24,7 +24,7 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
use strict;
-use Getopt::Long;
+use Getopt::Long qw(:config no_ignore_case bundling);
use Switch;
use EIBConnection;
@@ -36,7 +36,8 @@
my @gas = ();
my $eibgafile = '/etc/wiregate/eibga.conf';
-my ($dump_arg, $read_arg, $ga_arg, $age_arg, $dpt_arg, $help);
+my ($dump_arg, $read_arg, $isearch_arg, $search_arg,
+ $hgroup_arg, $mgroup_arg, $group_arg, $ga_arg, $age_arg, $dpt_arg, $help);
sub usage
{
@@ -86,7 +87,26 @@
"$gaName";
} # printGaInfo
+sub doSearch()
+{
+ # prints all ga containing text and/or hgroup and/or mgroup and/or group
+ foreach my $ga (sort keys %eibgaconf)
+ {
+ ($search_arg && $eibgaconf{$ga}{name} !~ /$search_arg/) and next;
+ ($isearch_arg && $eibgaconf{$ga}{name} !~ /$isearch_arg/i) and next;
+
+ my ($hg, $mg, $g);
+ ($ga =~ /(\d+)\/(\d+)\/(\d+)/) and ($hg, $mg, $g) = ($1, $2, $3);
+
+ ($hgroup_arg && $hgroup_arg ne $hg) and next;
+ ($mgroup_arg && $mgroup_arg ne $mg) and next;
+ ($group_arg && $group_arg ne $g) and next;
+ &printGaInfo($ga)
+ }
+} # doSearch
+
+
# sub addr2str {
# my $a = $_[0];
# my $b = $_[1] || 0; # 1 if local (group) address, else physical address
@@ -298,8 +318,7 @@
while(<IN>)
{
chomp;
- /^\s*$/ and next;
-
+ /^\s*$/ and next;
/^\s*\[\s*([\S]+)\]/ and $section = $1 and next;
$eibgaconf{$section}{$1} = $2 if ($section && /^\s*(\S+)\s*=\s*(.*)/);
}
@@ -308,17 +327,21 @@
# ------------- main
-usage() if ( ! GetOptions ('help|h|?' => \$help,
- 'd|dump' => \$dump_arg,
- 'r|read' => \$read_arg,
- 'ga|g=s' => \$ga_arg,
- 'age|a=i' => \$age_arg,
- 'dpt|t=s' => \$dpt_arg
+usage() if ( ! GetOptions ('help|h|?' => \$help,
+ 'd|dump' => \$dump_arg,
+ 's|search=s' => \$isearch_arg,
+ 'S|Search=s' => \$search_arg,
+ 'H|hgroup=s' => \$hgroup_arg,
+ 'M|mgroup=s' => \$mgroup_arg,
+ 'G|group=s' => \$group_arg,
+ 'r|read' => \$read_arg,
+ 'ga|g=s' => \$ga_arg,
+ 'age|a=i' => \$age_arg,
+ 'dpt|t=s' => \$dpt_arg
)
or defined $help );
-
if (-r $eibgafile)
{
&readCfg($eibgafile);
@@ -343,6 +366,12 @@
exit;
}
+if ($isearch_arg || $search_arg || $hgroup_arg || $mgroup_arg || $group_arg)
+{
+ &doSearch();
+ exit;
+}
+
@gas = split(/,/, $ga_arg);
if ($read_arg)
@@ -401,48 +430,48 @@
B<knxquery.pl> -d [-g GA]
+B<knxquery.pl> [-[sS] SEARCHARG] [-H HGROUP] [-M MGROUP] [-G GROUP]
+
=head1 BESCHREIBUNG
-B<knxquery.pl> liest einen Wert vom KNX-Bus und gibt diesen auf stdout aus.
+B<knxquery.pl> liest einen Wert vom KNX-Bus und gibt diesen auf stdout aus, erstellt eine Liste aller Gruppenadressen, macht eine Textsuche ueber alle Gruppenadressen oder listet Gruppenadressen nach Haupt-, Mittel- und Untergruppen auf.
=head1 OPTIONEN
=over
-=item B<-h | --help> Anzeige dieser Hilfe.
+=item * B<-h | --help> Anzeige dieser Hilfe.
-=item B<-r | --read> Liest einen Wert vom KNX-Bus. Der Parameter B-g <GA> fuer
-eine odere mehrere Gruppenandresse(n) muss/muessen angegeben werden. Wenn eine
-Gruppenadresse nicht in der Konfiguration hinterlegt ist, muss ausserdem der
-Datentyp Parameter B<-t DPT> angegeben werden.
+=item * B<-d | --dump> Gibt Informationen zu einer, zu mehreren oder zu allen Gruppenadressen aus. Wird keine Gruppenadresse angegeben, werden Informationen zu allen konfigurierten Adressen ausgegeben, ansonsten nur zu den im B<-g GA> Parameter angegeben Adressen.
-=item B<-d | --dump> Gibt Informationen zu einer, zu mehreren oder zu allen
-Gruppenadressen aus. Wird keine Gruppenadresse angegeben, werden Informationen
-zu allen konfigurierten Adressen ausgegeben, ansonsten nur zu den im B<-g GA>
-Parameter angegeben Adressen.
+=item * B<-s | --search> Listet alle Gruppenadressen auf, deren Beschreibung B<SEARCHARG> enthaelt. Die Suche unterscheidet nicht nach Gross- und Kleinschreibung.
-=item B<-g | --ga> Angabe der Gruppenadresse B<GA> deren Wert zu lesen ist
-oder zu der Informationen ausgegeben werden sollen. Die Adresse muss im
-Format B<H/M/U>, angegeben werden, wobei B<H> die Hauptgruppe, B<M> die
-Mittelgruppe und B<U> die Untergruppe ist. Es koennen auch mehrere B<GA>
-angegeben werden. Diese muessen durch Kommata, ohne Leerzeichen, voneinander
-getrennt werden, z.B: B<-ga 1/20/130,4/50/160>.
+=item * B<-S | --Search> Listet alle Gruppenadressen auf, deren Beschreibung B<SEARCHARG> enthaelt. Die Suche unterscheidet nach Gross- und Kleinschreibung.
-=item B<-a | --age> Maximales Cache-Alter B<AGE> der zu lesenden Werte in Sekunden.
-Unterlassungswert ist 1 Sekunde.
+=item * B<-H | --hgroup> Listet alle Gruppenadressen auf, die Teil der Hauptgruppe B<HGROUP> sind.
-=item B<-t | --dpt> Angabe des Datentyps B<DPT>. Dieser Wert muss nur
-angegeben werden, wenn die Gruppenadresse nicht in der Konfiguration
-erfasst ist. Es reicht der Haupttyp, also z.B. B<1, 2, 3> ... usw.
+=item * B<-M | --mgroup> Listet alle Gruppenadressen auf, deren Mittelgruppe B<MGROUP> ist, auch wenn sie aus unterschiedlichen Hauptgruppen sind.
+=item * B<-G | --group> Listet alle Gruppenadressen auf, deren Gruppe B<GROUP> ist, auch wenn sie aus unterschiedlichen Haupt- oder Mittelgruppen sind.
+
+=item * B<-r | --read> Liest einen Wert vom KNX-Bus. Der Parameter B-g <GA> fuer eine odere mehrere Gruppenandresse(n) muss/muessen angegeben werden. Wenn eine Gruppenadresse nicht in der Konfiguration hinterlegt ist, muss ausserdem der Datentyp Parameter B<-t DPT> angegeben werden.
+
+=item * B<-g | --ga> Angabe der Gruppenadresse B<GA> deren Wert zu lesen ist oder zu der Informationen ausgegeben werden sollen. Die Adresse muss im Format B<H/M/U>, angegeben werden, wobei B<H> die Hauptgruppe, B<M> die Mittelgruppe und B<U> die Untergruppe ist. Es koennen auch mehrere B<GA> angegeben werden. Diese muessen durch Kommata, ohne Leerzeichen, voneinander getrennt werden, z.B: B<-ga 1/20/130,4/50/160>.
+
+=item * B<-a | --age> Maximales Cache-Alter B<AGE> der zu lesenden Werte in Sekunden. Unterlassungswert ist 1 Sekunde.
+
+=item * B<-t | --dpt> Angabe des Datentyps B<DPT>. Dieser Wert muss nur angegeben werden, wenn die Gruppenadresse nicht in der Konfiguration erfasst ist. Es reicht der Haupttyp, also z.B. B<1, 2, 3> ... usw.
+
=back
+=head1 ANMERKUNG
+
+Die Suchargumente -[sS], -H, -M und -G sind UND-Argumente. D.h.: Eine Gruppenadresse wird nur dann gelistet, wenn alle Suchkriterien zutreffen.
+
=head1 VORAUSSETZUNGEN
-Das Script wurde fuer das B<Wiregate> Gateway geschrieben, und erwartet eine
-diesem Gateway entsprechende Konfiguration. Der Rechner muss an einen KNX-Bus
-angeschlossen sein, und Zugriff auf diesen Bus haben, z.B. per EIB-TPUART.
+Das Script wurde fuer das B<Wiregate> Gateway geschrieben, und erwartet eine diesem Gateway entsprechende Konfiguration. Der Rechner muss an einen KNX-Bus angeschlossen sein, und Zugriff auf diesen Bus haben, z.B. per EIB-TPUART.
=head1 MITWIRKENDE
@@ -450,6 +479,6 @@
=head1 COPYRIGHT
-Copyright (c) 2011 Edgar <emax> Hermanns, <emax at berlios punkt de>
+Copyright (c) 2011 Edgar <emax> Hermanns, <emax at launchpad dot net>
=cut
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-03-26 21:42:52
|
Revision: 736
http://openautomation.svn.sourceforge.net/openautomation/?rev=736&view=rev
Author: makki1
Date: 2012-03-26 21:42:46 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
DMX-Plugin with response and (tab-fixing)
Modified Paths:
--------------
wiregate/plugin/generic/DMX-Plugin.pl
Modified: wiregate/plugin/generic/DMX-Plugin.pl
===================================================================
--- wiregate/plugin/generic/DMX-Plugin.pl 2012-03-26 17:11:17 UTC (rev 735)
+++ wiregate/plugin/generic/DMX-Plugin.pl 2012-03-26 21:42:46 UTC (rev 736)
@@ -1,5 +1,5 @@
# Plugin DMX-Gateway
-# Version: 0.4 2012-01-05
+# Version: 0.41 2012-03-26
# Ben\xF6tigt DMX USB-Interface
##################
@@ -45,33 +45,36 @@
# Hauptverarbeitung
if (!$socket[$socknum]) { # socket erstellen
$socket[$socknum] = IO::Socket::INET->new(LocalPort => $dmx_recv_port,
- Proto => "udp",
- LocalAddr => $dmx_recv_ip,
- PeerPort => $dmx_send_port,
- PeerAddr => $dmx_send_ip,
- ReuseAddr => 1
- )
- or return ("open of $dmx_recv_ip : $dmx_recv_port failed: $!");
+ Proto => "udp",
+ LocalAddr => $dmx_recv_ip,
+ PeerPort => $dmx_send_port,
+ PeerAddr => $dmx_send_ip,
+ ReuseAddr => 1
+ )
+ or return ("open of $dmx_recv_ip : $dmx_recv_port failed: $!");
$socksel->add($socket[$socknum]); # add socket to select
$plugin_socket_subscribe{$socket[$socknum]} = $plugname; # subscribe plugin
for (my $i=0; $i<$dmx_channels;$i++) {
- $plugin_subscribe{$knx_startGA}{$plugname} = 1;
- $knx_startGA = addr2str(str2addr($knx_startGA)+1,1);
+ $plugin_subscribe{$knx_startGA}{$plugname} = 1;
+ $knx_startGA = addr2str(str2addr($knx_startGA)+1,1);
}
return "opened UDP-Socket $socknum";
}
if (%msg) { # telegramm vom KNX
- my $destN = str2addr($msg{'dst'});
- my $startN = str2addr($knx_startGA);
- my $dmxchan = $destN - $startN;
- if ($msg{'apci'} eq "A_GroupValue_Write" and $destN >= $startN and $destN <= $startN+$dmx_channels) {
- # send $dmxchan -> UDP as CaaaLvvv
+ my $destN = str2addr($msg{'dst'});
+ my $startN = str2addr($knx_startGA);
+ my $dmxchan = $destN - $startN;
+ if ($msg{'apci'} eq "A_GroupValue_Write" and $destN >= $startN and $destN <= $startN+$dmx_channels) {
+ # send $dmxchan -> UDP as CaaaLvvv
my $dgram = sprintf("C%03dL%03d\r\n",$dmxchan,$dimcurve[hex($msg{'data'})]);
- $socket[$socknum]->send($dgram) or return "send failed: $!";
- # debug chop($dgram);chop($dgram); # debug
- # debug return "sent $msg{'dst'} $msg{'value'} $dgram to DMX $dmxchan"; # debug
- return;
- }
+ $socket[$socknum]->send($dgram) or return "send failed: $!";
+ return;
+ }
+ elsif ($msg{'apci'} eq "A_GroupValue_Read" and $destN >= $startN and $destN <= $startN+$dmx_channels) {
+ # send response to KNX from eibd-cache
+ knx_write($msg{'dst'},knx_read($msg{'dst'},86400,5),5,1);
+ return "read $destN";
+ }
} elsif ($fh) {
my $buf;
recv($fh,$buf,255,0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <e....@us...> - 2012-03-26 17:11:27
|
Revision: 735
http://openautomation.svn.sourceforge.net/openautomation/?rev=735&view=rev
Author: e.max
Date: 2012-03-26 17:11:17 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
Dokumentation aller erlaubten und gueltigen Zeiteintraege.
Modified Paths:
--------------
wiregate/plugin/generic/conf.d/emx_uhr.conf.sample
Modified: wiregate/plugin/generic/conf.d/emx_uhr.conf.sample
===================================================================
--- wiregate/plugin/generic/conf.d/emx_uhr.conf.sample 2012-03-26 15:17:41 UTC (rev 734)
+++ wiregate/plugin/generic/conf.d/emx_uhr.conf.sample 2012-03-26 17:11:17 UTC (rev 735)
@@ -6,10 +6,75 @@
# 'my' hier nicht verwenden!
#-----------------------------------------------------------------------------
+#----------------------------------------------------
+# Hinweis zu den Eintraegen in der '@Zeiten' Tabelle
+# (Bitte auch die nachfolgenden Anmerkungen beachten):
+#----------------------------------------------------
+# Folgende Eintraege werden verarbeitet:
+# #
+# - Name Ein beliebiger Text. Ich habe nicht getestst, ob diser Leerstellen
+# enthalten darf. Statt dessen besser Unterstriche nehmen oder
+# ausprobieren. Dieser Text erscheint im Logfile sofern aktiviert.
+# Zwingende Angabe.
+# - Aktiv Wenn null, wird der Eintrag nicht ausgefuehrt.
+# Wenn nicht definiert, wird 'true' angenommen (Eintrag wird
+# ausgefuehrt).
+# Wahlweise Angabe.
+# - Min *) Minute, gueltige Werte 0-59.
+# Wenn definiert, wird der Eintrag zur angegeben Minute gueltig.
+# Wenn nicht definiert, ist jede Minute gueltig.
+# Wahlweise Angabe.#
+# - Std *) Stunde, gueltige Werte 0-23.
+# Wenn definiert, ist der Eintrag zur angegeben Stunde gueltig.
+# Wenn nicht definiert, ist jede Stunde gueltig.
+# Wahlweise Angabe.
+# - MTag *) Tag des Monats, gueltige Werte 1-31 (abhaengig vom Monat
+# natuerlich).
+# Wenn definiert, ist der Eintrag am angegegebenen Tag des Monats
+# gueltig.
+# Wenn nicht definiert, ist jeder Tag des Monats gueltig.
+# Wahlweise Angabe.
+# - Mon *) Monat, gueltige Werte 1-11.
+# Wenn definiert, ist der Eintrag im angegegebenen (Monat+1) gueltig.
+# Wenn nicht definiert, ist jeder Monat gueltig.
+# Wahlweise Angabe.
+# - WTag *) Wochentag, gueltige Werte 0-6. 0=Sonntag ... 6=Samstag.
+# Wenn definiert, ist der Eintragam angegebenen Wochentag gueltig.
+# Wenn nicht definiert, ist jeder Wochentag gueltig.
+# Wahlweise Angabe.
+# - Wert Auf den Bus zu schreibender Wert.
+# Zwingende Angabe.
+# - DPT EIB Datentyp.
+# Zwingende Angabe.
+# - GA Gruppenadresse in gueltigem Format.
+# Zwingende Angabe.
+# - Log Log schreiben. Gueltige Werte: 0 oder 1.
+# Wenn definiert und ungleich null, wird ein Logeintrag geschrieben
+# sofern das Telegramm gesendet wurde.
+# Wenn nicht definiert, wird kein Logeintrag geschrieben.
+# Wahlweise Angabe.
+#
+# Anmerkungen:
+#
+# - Die Schluesselworte 'Name', 'Aktiv', 'WTag' etc. muessen in exakter
+# Gross/Kleinschreibung angegeben werden!
+# - Die Verarbeitung ist auf Werte in einfachen Hochkommata ausgelegt.
+# - Statt fester Werte koennen auch Code-Referenzen angegeben werden.
+# Ein Beipiel dazu findet sich im knx-user-forum.de unter
+# http://knx-user-forum.de/wiregate/14892-zeitschaltuhr-plugin-8.html
+# Beitrag #76: http://knx-user-forum.de/183739-post76.html
+#
+# *) Es koennen Mehrfachwerte in gemischter Form von Listen und Bereichen
+# angegeben werden. z.B:
+# Min => '15,45' ist fuer Minute 15 und 45 gueltig.
+# Std => '0-18,20,23,24' ist in den Stunden 0 bis 18, 20, 23 und 24
+# gueltig.
+# WTag => '1-3,5,6' ist an den Wochentagen Mo, Di, Mi, Fr und
+# Sa gueltig.
+
#------------------------
# Konfigurierbare Werte
#------------------------
-
@Zeiten =
(
# Aussenlicht und Aussensteckdosen zyklisch ausschalten
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2012-03-26 15:17:52
|
Revision: 734
http://openautomation.svn.sourceforge.net/openautomation/?rev=734&view=rev
Author: swiss1
Date: 2012-03-26 15:17:41 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
Plugin wurde auf die Vorg?\195?\164ngerversion zur?\195?\188ckgesetzt da sich ein BUG eingeschlichen hatte.
Modified Paths:
--------------
wiregate/plugin/generic/schaltuhr.pl
Modified: wiregate/plugin/generic/schaltuhr.pl
===================================================================
--- wiregate/plugin/generic/schaltuhr.pl 2012-03-26 14:43:20 UTC (rev 733)
+++ wiregate/plugin/generic/schaltuhr.pl 2012-03-26 15:17:41 UTC (rev 734)
@@ -1,10 +1,10 @@
# Plugin zum Zeit abh\xE4ngigem schalten von GA's (Schaltuhr)
-# Version 0.6 BETA 25.03.2012
+# Version 0.6 BETA 29.02.2012
# Copyright: swiss (http://knx-user-forum.de/members/swiss.html)
# License: GPL (v2)
# Aufbau m\xF6glichst so, dass man unterhalb der Einstellungen nichts ver\xE4ndern muss!
-# Erweitert um Sonnenauf / - untergang von ZeitlerW (http://knx-user-forum.de/members/zeitlerw.html)
-# Inspiriert von kleinklausi's Rolladen - Plugin
+# -Erweitert um Sonnenauf / - untergang von ZeitlerW (http://knx-user-forum.de/members/zeitlerw.html)
+# -Inspiriert von kleinklausi's Rolladen - Plugin
####################
@@ -12,29 +12,26 @@
####################
# Die Standortdaten
-# Die Koordinaten des Hauses. Sehr einfach \xFCber http://www.getlatlon.com/ zu ermitteln.
+# Die Koordinaten des Hauses. Sehr einfach ?ber http://www.getlatlon.com/ zu ermitteln.
my ($lat, $lon) = (
50.27816466477597, # Breitengrad in Grad
- 11.64325475692749 # L\xE4ngengrad in Grad
+ 11.64325475692749 # L?ngengrad in Grad
);
#Winkel f\xFCr Beginn der D\xE4mmerung
# siehe auch: http://search.cpan.org/~rkhill/Astro-Sunrise-0.91/Sunrise.pm#DESCRIPTION
my $winkel=-3;
-
my @Schaltzeiten;
+
+
#Pro Schaltpunkt einfach den unten stehenden Eintrag kopieren und anpassen.
-#Sollen Schaltzeiten astronomisch geschaltet werden, so mu\xDF bei Astro 'a' f\xFCr Sonnenaufgang
+#Sollen Schaltzeiten astronomisch geschaltet werden, so muss bei Astro 'a' f\xFCr Sonnenaufgang
#und 'u' f\xFCr Sonnenuntergang eingetragen werden. Der Stunden und Minutenwert wird dann ignoriert.
-push @Schaltzeiten, { name => "Stern_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 16, Minuten => 00, Wert => 1, DPT => 1, ga => '0/0/34', KW => '', Monat => '', Astro => 'u' };
-push @Schaltzeiten, { name => "Stern_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 23, Minuten => 00, Wert => 0, DPT => 1, ga => '0/0/34', KW => '', Monat => '', Astro => '' };
-push @Schaltzeiten, { name => "Stern_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 06, Minuten => 00, Wert => 1, DPT => 1, ga => '0/0/34', KW => '', Monat => '', Astro => '' };
-push @Schaltzeiten, { name => "Stern_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 8, Minuten => 30, Wert => 0, DPT => 1, ga => '0/0/34', KW => '', Monat => '', Astro => 'a' };
-push @Schaltzeiten, { name => "Glasvase_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 16, Minuten => 00, Wert => 1, DPT => 1, ga => '0/0/35', KW => '', Monat => '', Astro => 'u' };
-push @Schaltzeiten, { name => "Glasvase_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 23, Minuten => 00, Wert => 0, DPT => 1, ga => '0/0/35', KW => '', Monat => '', Astro => '' };
-push @Schaltzeiten, { name => "Glasvase_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 06, Minuten => 00, Wert => 1, DPT => 1, ga => '0/0/35', KW => '', Monat => '', Astro => '' };
-push @Schaltzeiten, { name => "Glasvase_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 8, Minuten => 30, Wert => 0, DPT => 1, ga => '0/0/35', KW => '', Monat => '', Astro => 'a' };
+push @Schaltzeiten, { name => "weckzeit", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 0, sonntag => 0, Stunden => 05, Minuten => 45, Wert => 1, DPT => 1, ga => '1/5/4', KW => '', Monat => '', Astro => '' };
+
+
+
######################
##ENDE Einstellungen##
######################
@@ -44,15 +41,12 @@
# Wir brauchen auch Sonnenstandsberechnung
use Astro::Sunrise;
-
# Eigenen Aufruf-Zyklus auf 20sek. setzen
$plugin_info{$plugname.'_cycle'} = 20;
#Hier wird ein Array angelegt, um die Wochentagsnummer von localtime zu \xFCbersetzen
my @Wochentag = ('sonntag', 'montag', 'dienstag', 'mittwoch', 'donnerstag', 'freitag', 'samstag');
-my @sunrise=split(/:/,sun_rise($lon,$lat,$winkel));
-my @sunset=split(/:/,sun_set($lon,$lat,$winkel));
my $sec; #Sekunde
my $min; # Minute
my $hour; #Stunde
@@ -70,44 +64,35 @@
my $kw = getWeekNumber($year, $mon, $mday);
foreach my $element (@Schaltzeiten) {
- if (knx_read($element->{ga},0,$element->{DPT}) ne $element->{Wert}) {
- if ($element->{Astro} ne '') {
- if ($element->{Astro} eq 'a') {
- if ($isdst) {
- $element->{Stunden}=$sunrise[0]+1;
- } else {
- $element->{Stunden}=$sunrise[0];
- }
- $element->{Minuten}=$sunrise[1];
- } elsif ($element->{Astro} eq 'u') {
- if ($isdst) {
- $element->{Stunden}=$sunset[0]+1;
- } else {
- $element->{Stunden}=$sunset[0];
- }
- $element->{Minuten}=$sunset[1];
- }
- }
-
- if ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{KW} ne '') {
- if ($element->{KW} == $kw) {
- knx_write($element->{ga},$element->{Wert},$element->{DPT});
- next;
- } else {
- next;
- }
- } elsif ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{Monat} ne '') {
- if ($element->{Monat} == $mon) {
- knx_write($element->{ga},$element->{Wert},$element->{DPT});
- next;
- } else {
- next;
- }
- } elsif ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{KW} eq '' && $element->{Monat} eq '') {
- knx_write($element->{ga},$element->{Wert},$element->{DPT});
- next;
- }
- }
+ if (knx_read($element->{ga},0,$element->{DPT}) ne $element->{Wert}) {
+ if ($element->{Astro} ne '') {
+ if ($element->{Astro} eq 'a') {
+ $element->{Stunden}=$sunrise[0];
+ $element->{Minuten}=$sunrise[1];
+ } elsif ($element->{Astro} eq 'u') {
+ $element->{Stunden}=$sunset[0];
+ $element->{Minuten}=$sunset[1];
+ }
+ }
+ if ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{KW} ne '') {
+ if ($element->{KW} == $kw) {
+ knx_write($element->{ga},$element->{Wert},$element->{DPT});
+ next;
+ } else {
+ next;
+ }
+ } elsif ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{Monat} ne '') {
+ if ($element->{Monat} == $mon) {
+ knx_write($element->{ga},$element->{Wert},$element->{DPT});
+ next;
+ } else {
+ next;
+ }
+ } elsif ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{KW} eq '' && $element->{Monat} eq '') {
+ knx_write($element->{ga},$element->{Wert},$element->{DPT});
+ next;
+ }
+ }
next;
}
@@ -122,7 +107,7 @@
# Wochennummer des letzten Woche des letzten Jahres suchen
$weekNumber = checkWeekNumber(($year - 1), 12, 31);
-# wenn die Wochennummer gr\xF6\xDFer als 52 ist
+# wenn die Wochennummer gr??er als 52 ist
# dann pr\xFCfen ob diese Wochennummer korrekt ist oder
# sie bereits die erste Woche des aktuellen Jahres ist
if ($weekNumber gt 52)
@@ -136,7 +121,7 @@
}
}
}
-# wenn die Wochennummer gr\xF6\xDFer als 52 ist
+# wenn die Wochennummer gr\xF6sser als 52 ist
# dann pr\xFCfen ob diese Wochennummer korrekt ist oder
# sie bereits die erste Woche des n\xE4chsten Jahres ist
elsif ($weekNumber gt 52)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <e....@us...> - 2012-03-26 14:43:31
|
Revision: 733
http://openautomation.svn.sourceforge.net/openautomation/?rev=733&view=rev
Author: e.max
Date: 2012-03-26 14:43:20 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
Kleienerer Bugfix
Lesen der Konfiguration optimiert (Faktor 15)
Modified Paths:
--------------
wiregate/tools/knxquery/knxquery.pl
Modified: wiregate/tools/knxquery/knxquery.pl
===================================================================
--- wiregate/tools/knxquery/knxquery.pl 2012-03-26 09:21:07 UTC (rev 732)
+++ wiregate/tools/knxquery/knxquery.pl 2012-03-26 14:43:20 UTC (rev 733)
@@ -25,7 +25,6 @@
use strict;
use Getopt::Long;
-use Config::Std { def_sep => '=', read_config => 'my_read_cfg' };
use Switch;
use EIBConnection;
@@ -34,6 +33,8 @@
my $debug=0;
my %eibgaconf;
my $eib_url = "local:/tmp/eib";
+my @gas = ();
+my $eibgafile = '/etc/wiregate/eibga.conf';
my ($dump_arg, $read_arg, $ga_arg, $age_arg, $dpt_arg, $help);
@@ -49,12 +50,20 @@
# koennte man mit dem Dumper machen ...
# print Dumper(%eibgaconf), "\n";
# ... soll aber schoener aussehen:
+
+ my ($dptid, $dptsubid, $dptname, $gaName) = ('','','');
+
&printGaInfo($_) foreach (sort keys %eibgaconf);
} # dumpGa
sub printGaInfo
{
my $ga = shift || die "\n\n fehlender GA-paramater in printGaInfo()\n\n";
+
+ # koennte man mit dem Dumper machen ...
+ # print Dumper(%eibgaconf), "\n";
+ # ... soll aber schoener aussehen:
+
my ($dptid, $dptsubid, $dptname, $gaName) = ('','','');
if (!exists $eibgaconf{$ga})
@@ -280,6 +289,23 @@
}
}
+sub readCfg()
+{
+ my $file = shift or die "\n\nFEHLER: Dateiname für readCfg() fehlt\n\n";
+ open (IN, "< $file") or die "\n\nFEHLER: Kann Datei [$file] nicht öffnen: $!\n\n";
+ my $section;
+
+ while(<IN>)
+ {
+ chomp;
+ /^\s*$/ and next;
+
+ /^\s*\[\s*([\S]+)\]/ and $section = $1 and next;
+ $eibgaconf{$section}{$1} = $2 if ($section && /^\s*(\S+)\s*=\s*(.*)/);
+ }
+ close IN;
+} # readCfg
+
# ------------- main
usage() if ( ! GetOptions ('help|h|?' => \$help,
@@ -291,54 +317,71 @@
)
or defined $help );
-if (-e '/etc/wiregate/eibga.conf')
+
+
+if (-r $eibgafile)
{
- my_read_cfg '/etc/wiregate/eibga.conf' => %eibgaconf;
+ &readCfg($eibgafile);
+# my_read_cfg '/etc/wiregate/eibga.conf' => %eibgaconf;
}
else
{
- print "WARNUNG: unable to read config[/etc/wiregate/eibga.conf]\n";
+ print "WARNUNG: unable to read [$eibgafile]\n";
}
+!defined $ga_arg and $ga_arg='';
+
if ($dump_arg)
{
if ($ga_arg) {
- printGaInfo($ga_arg);
+ printGaInfo($_) foreach (@gas);
} else {
- dumpGa($ga_arg);
+ dumpGa();
}
exit;
}
+@gas = split(/,/, $ga_arg);
+
if ($read_arg)
{
if (!defined $ga_arg)
{
- print "FEHLER: Fuer READ bitte die Gruppenadresse angeben (EINGABETASTE druecken ...).";
+ print "FEHLER: Fuer READ bitte die Gruppenadresse(n) angeben (EINGABETASTE druecken ...) ";
getc(STDIN);
exit;
}
- if (!defined $dpt_arg && !exists $eibgaconf{$ga_arg})
+ if (!defined $dpt_arg)
{
- print "FEHLER: Unbekannte Gruppenadresse, bitte Datentyp angegeben (EINGABETASTE druecken ...).";
- getc(STDIN);
- exit;
+ foreach (@gas)
+ {
+ if (!exists $eibgaconf{$_})
+ {
+ print "FEHLER: Unbekannte GA[$_], bitte Datentyp angeben (EINGABETASTE druecken ...) ";
+ getc(STDIN);
+ exit;
+ }
+ }
}
-
+
(!$age_arg) and $age_arg = 1;
- my $res = knx_read($ga_arg, $age_arg, $dpt_arg);
- if ($res)
+ my ($res, $ga);
+ foreach $ga (@gas)
{
- print "GELESEN:ga[$ga_arg], res[$res]\n";
+ $res = knx_read($ga, $age_arg, $dpt_arg);
+ if (defined $res)
+ {
+ print "GELESEN:ga[$ga_arg], res[$res]\n";
+ }
+ else
+ {
+ print "FEHLER: READ ga[$ga_arg]\n";
+ }
}
- else
- {
- print "FEHLER: READ ga[$ga_arg]\n";
- }
exit;
}
@@ -354,7 +397,7 @@
B<knxquery.pl> -h
-B<knxquery.pl> -r -g GA [-a AGE] [-t DPT]
+B<knxquery.pl> -r -g GA[,GA ...] [-a AGE] [-t DPT]
B<knxquery.pl> -d [-g GA]
@@ -369,32 +412,35 @@
=item B<-h | --help> Anzeige dieser Hilfe.
-=item B<-r | --read> Liest einen Wert vom KNX-Bus. Die Gruppenandresse B<GA>
-muss angegeben werden. Wenn die Gruppenadresse nicht in der Konfiguration
-hinterlegt ist, muss ausserdem der datentyp B<DPT> angegeben werden.
+=item B<-r | --read> Liest einen Wert vom KNX-Bus. Der Parameter B-g <GA> fuer
+eine odere mehrere Gruppenandresse(n) muss/muessen angegeben werden. Wenn eine
+Gruppenadresse nicht in der Konfiguration hinterlegt ist, muss ausserdem der
+Datentyp Parameter B<-t DPT> angegeben werden.
-=item B<-d | --dump> Gibt Informationen zu einer oder zu allen Gruppenadressen
-aus. Wird eine B<GA> angegeben, werden Informationen nur zu dieser Adresse
-ausgegeben. Wird keine Gruppenadresse angegeben, werden Informationen zu allen
-konfigurierten Adressen ausgegeben.
+=item B<-d | --dump> Gibt Informationen zu einer, zu mehreren oder zu allen
+Gruppenadressen aus. Wird keine Gruppenadresse angegeben, werden Informationen
+zu allen konfigurierten Adressen ausgegeben, ansonsten nur zu den im B<-g GA>
+Parameter angegeben Adressen.
=item B<-g | --ga> Angabe der Gruppenadresse B<GA> deren Wert zu lesen ist
oder zu der Informationen ausgegeben werden sollen. Die Adresse muss im
Format B<H/M/U>, angegeben werden, wobei B<H> die Hauptgruppe, B<M> die
-Mittelgruppe und B<U> die Untergruppe ist.
+Mittelgruppe und B<U> die Untergruppe ist. Es koennen auch mehrere B<GA>
+angegeben werden. Diese muessen durch Kommata, ohne Leerzeichen, voneinander
+getrennt werden, z.B: B<-ga 1/20/130,4/50/160>.
-=item B<-a | --age> Maximales Cache-Alter B<AGE> des zu lesenden Wertes in Sekunden.
+=item B<-a | --age> Maximales Cache-Alter B<AGE> der zu lesenden Werte in Sekunden.
Unterlassungswert ist 1 Sekunde.
=item B<-t | --dpt> Angabe des Datentyps B<DPT>. Dieser Wert muss nur
angegeben werden, wenn die Gruppenadresse nicht in der Konfiguration
-erfasst ist. Es reicht der Haupttyp, also z.B. B<1, 2, 3> ... usw.
+erfasst ist. Es reicht der Haupttyp, also z.B. B<1, 2, 3> ... usw.
=back
=head1 VORAUSSETZUNGEN
-Das Script wurde f\xFCr das B<Wiregate> Gateway geschrieben, und erwartet eine
+Das Script wurde fuer das B<Wiregate> Gateway geschrieben, und erwartet eine
diesem Gateway entsprechende Konfiguration. Der Rechner muss an einen KNX-Bus
angeschlossen sein, und Zugriff auf diesen Bus haben, z.B. per EIB-TPUART.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <e....@us...> - 2012-03-26 09:21:13
|
Revision: 732
http://openautomation.svn.sourceforge.net/openautomation/?rev=732&view=rev
Author: e.max
Date: 2012-03-26 09:21:07 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
Berechnung auf Zeitpunkt nach Somemrzeitumstellung gesetzt.
Modified Paths:
--------------
wiregate/plugin/generic/emx_sonne.pl
Modified: wiregate/plugin/generic/emx_sonne.pl
===================================================================
--- wiregate/plugin/generic/emx_sonne.pl 2012-03-25 20:54:02 UTC (rev 731)
+++ wiregate/plugin/generic/emx_sonne.pl 2012-03-26 09:21:07 UTC (rev 732)
@@ -24,15 +24,26 @@
# ## who yyyymmdd bug# description
# -- --- -------- ----- ----------------------------------------
# . ... ........ ..... vorlage
+# 1 edh 20120326 ..... Berechnungszeitpunkt auf 3:xx Uhr verlegt,
+# weil die Zeiten sonst vor der
+# Umstellungsuhrzeit errechnet werden, und
+# das am Umstellungstag Winter->Sommer zu
+# zu Fehlern führt: An diesem Tag wären
+# dann die Sommerzeit noch nicht berück-
+# sichtigt.
# 0 edh 20111023 ----- erste Version
use Math::Trig;
use POSIX;
# Default: Berlin
-my $Breite = 52.5167;
-my $Laenge = 13.4;
+my $Breite = 52.5167;
+my $Laenge = 13.4;
+# updateUhrzeit 3:11:13, ungerade Zeit um Rechenstaus zu vermeiden
+my $updateZeit = 11473; # HH*3600 + MM*60 + SS = 3*3600 + 11*60 + 13 = 11473;
+my $einTag = 86400; # 24*3600;
+
sub calculateSun()
{
my ($yddd, $timezone) = @_;
@@ -94,5 +105,5 @@
$plugin_info{"$plugname.laenge"} != $Laenge ||
$plugin_info{"$plugname.breite"} != $Breite) and &calculateSun($yday, $timezone);
-# bis 1:00:27 Uhr warten, dann neu rechnen (ungerade Zeit zur Vermeidung von Plugin-Staus)
-$plugin_info{$plugname.'_cycle'} = (25-$hour) * 3600 - $min*60 - $sec + 27;
+# bis updateZeit warten, dann neu rechnen
+$plugin_info{$plugname.'_cycle'} = $einTag - ($hour*3600 + $min*60 + $sec) + $updateZeit;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2012-03-25 20:54:09
|
Revision: 731
http://openautomation.svn.sourceforge.net/openautomation/?rev=731&view=rev
Author: swiss1
Date: 2012-03-25 20:54:02 +0000 (Sun, 25 Mar 2012)
Log Message:
-----------
Sommerzeit f?\195?\188r die Austrofunktion nachger?\195?\188stet
Modified Paths:
--------------
wiregate/plugin/generic/schaltuhr.pl
Modified: wiregate/plugin/generic/schaltuhr.pl
===================================================================
--- wiregate/plugin/generic/schaltuhr.pl 2012-03-18 16:01:50 UTC (rev 730)
+++ wiregate/plugin/generic/schaltuhr.pl 2012-03-25 20:54:02 UTC (rev 731)
@@ -1,10 +1,10 @@
# Plugin zum Zeit abh\xE4ngigem schalten von GA's (Schaltuhr)
-# Version 0.6 BETA 29.02.2012
+# Version 0.6 BETA 25.03.2012
# Copyright: swiss (http://knx-user-forum.de/members/swiss.html)
# License: GPL (v2)
# Aufbau m\xF6glichst so, dass man unterhalb der Einstellungen nichts ver\xE4ndern muss!
-# -Erweitert um Sonnenauf / - untergang von ZeitlerW (http://knx-user-forum.de/members/zeitlerw.html)
-# -Inspiriert von kleinklausi's Rolladen - Plugin
+# Erweitert um Sonnenauf / - untergang von ZeitlerW (http://knx-user-forum.de/members/zeitlerw.html)
+# Inspiriert von kleinklausi's Rolladen - Plugin
####################
@@ -21,17 +21,20 @@
#Winkel f\xFCr Beginn der D\xE4mmerung
# siehe auch: http://search.cpan.org/~rkhill/Astro-Sunrise-0.91/Sunrise.pm#DESCRIPTION
my $winkel=-3;
+
my @Schaltzeiten;
-
-
#Pro Schaltpunkt einfach den unten stehenden Eintrag kopieren und anpassen.
#Sollen Schaltzeiten astronomisch geschaltet werden, so mu\xDF bei Astro 'a' f\xFCr Sonnenaufgang
#und 'u' f\xFCr Sonnenuntergang eingetragen werden. Der Stunden und Minutenwert wird dann ignoriert.
-push @Schaltzeiten, { name => "weckzeit", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 0, sonntag => 0, Stunden => 05, Minuten => 45, Wert => 1, DPT => 1, ga => '1/5/4', KW => '', Monat => '', Astro => '' };
-
-
-
+push @Schaltzeiten, { name => "Stern_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 16, Minuten => 00, Wert => 1, DPT => 1, ga => '0/0/34', KW => '', Monat => '', Astro => 'u' };
+push @Schaltzeiten, { name => "Stern_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 23, Minuten => 00, Wert => 0, DPT => 1, ga => '0/0/34', KW => '', Monat => '', Astro => '' };
+push @Schaltzeiten, { name => "Stern_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 06, Minuten => 00, Wert => 1, DPT => 1, ga => '0/0/34', KW => '', Monat => '', Astro => '' };
+push @Schaltzeiten, { name => "Stern_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 8, Minuten => 30, Wert => 0, DPT => 1, ga => '0/0/34', KW => '', Monat => '', Astro => 'a' };
+push @Schaltzeiten, { name => "Glasvase_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 16, Minuten => 00, Wert => 1, DPT => 1, ga => '0/0/35', KW => '', Monat => '', Astro => 'u' };
+push @Schaltzeiten, { name => "Glasvase_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 23, Minuten => 00, Wert => 0, DPT => 1, ga => '0/0/35', KW => '', Monat => '', Astro => '' };
+push @Schaltzeiten, { name => "Glasvase_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 06, Minuten => 00, Wert => 1, DPT => 1, ga => '0/0/35', KW => '', Monat => '', Astro => '' };
+push @Schaltzeiten, { name => "Glasvase_Wohnzimmer", montag => 1, dienstag => 1, mittwoch => 1, donnerstag => 1, freitag => 1, samstag => 1, sonntag => 1, Stunden => 8, Minuten => 30, Wert => 0, DPT => 1, ga => '0/0/35', KW => '', Monat => '', Astro => 'a' };
######################
##ENDE Einstellungen##
######################
@@ -41,12 +44,15 @@
# Wir brauchen auch Sonnenstandsberechnung
use Astro::Sunrise;
+
# Eigenen Aufruf-Zyklus auf 20sek. setzen
$plugin_info{$plugname.'_cycle'} = 20;
#Hier wird ein Array angelegt, um die Wochentagsnummer von localtime zu \xFCbersetzen
my @Wochentag = ('sonntag', 'montag', 'dienstag', 'mittwoch', 'donnerstag', 'freitag', 'samstag');
+my @sunrise=split(/:/,sun_rise($lon,$lat,$winkel));
+my @sunset=split(/:/,sun_set($lon,$lat,$winkel));
my $sec; #Sekunde
my $min; # Minute
my $hour; #Stunde
@@ -64,35 +70,44 @@
my $kw = getWeekNumber($year, $mon, $mday);
foreach my $element (@Schaltzeiten) {
- if (knx_read($element->{ga},0,$element->{DPT}) ne $element->{Wert}) {
- if ($element->{Astro} ne '') {
- if ($element->{Astro} eq 'a') {
- $element->{Stunden}=$sunrise[0];
- $element->{Minuten}=$sunrise[1];
- } elsif ($element->{Astro} eq 'u') {
- $element->{Stunden}=$sunset[0];
- $element->{Minuten}=$sunset[1];
- }
- }
- if ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{KW} ne '') {
- if ($element->{KW} == $kw) {
- knx_write($element->{ga},$element->{Wert},$element->{DPT});
- next;
- } else {
- next;
- }
- } elsif ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{Monat} ne '') {
- if ($element->{Monat} == $mon) {
- knx_write($element->{ga},$element->{Wert},$element->{DPT});
- next;
- } else {
- next;
- }
- } elsif ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{KW} eq '' && $element->{Monat} eq '') {
- knx_write($element->{ga},$element->{Wert},$element->{DPT});
- next;
- }
- }
+ if (knx_read($element->{ga},0,$element->{DPT}) ne $element->{Wert}) {
+ if ($element->{Astro} ne '') {
+ if ($element->{Astro} eq 'a') {
+ if ($isdst) {
+ $element->{Stunden}=$sunrise[0]+1;
+ } else {
+ $element->{Stunden}=$sunrise[0];
+ }
+ $element->{Minuten}=$sunrise[1];
+ } elsif ($element->{Astro} eq 'u') {
+ if ($isdst) {
+ $element->{Stunden}=$sunset[0]+1;
+ } else {
+ $element->{Stunden}=$sunset[0];
+ }
+ $element->{Minuten}=$sunset[1];
+ }
+ }
+
+ if ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{KW} ne '') {
+ if ($element->{KW} == $kw) {
+ knx_write($element->{ga},$element->{Wert},$element->{DPT});
+ next;
+ } else {
+ next;
+ }
+ } elsif ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{Monat} ne '') {
+ if ($element->{Monat} == $mon) {
+ knx_write($element->{ga},$element->{Wert},$element->{DPT});
+ next;
+ } else {
+ next;
+ }
+ } elsif ($element->{$Wochentag[$wday]} == 1 && $element->{Stunden} == $hour && $element->{Minuten} == $min && $element->{KW} eq '' && $element->{Monat} eq '') {
+ knx_write($element->{ga},$element->{Wert},$element->{DPT});
+ next;
+ }
+ }
next;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|