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: <vl...@us...> - 2011-10-19 15:24:14
|
Revision: 455
http://openautomation.svn.sourceforge.net/openautomation/?rev=455&view=rev
Author: vlamers
Date: 2011-10-19 15:24:07 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
Plugin um die Stati der I-Buttons zur Anwesenheitskontrolle zu verwenden. Begruessung per mpd
Added Paths:
-----------
wiregate/plugin/generic/I-Button.pl
Added: wiregate/plugin/generic/I-Button.pl
===================================================================
--- wiregate/plugin/generic/I-Button.pl (rev 0)
+++ wiregate/plugin/generic/I-Button.pl 2011-10-19 15:24:07 UTC (rev 455)
@@ -0,0 +1,87 @@
+##########################################################
+# Script zur Anwesenheits Steuerung per I-Buttons
+# Version 0.3
+#
+# Allgemeine Hinweise:
+# Begruessung per mpd Instanz
+# die globale definition der I-Buttons (Farben) dient um das Plugin auf die GA anzumelden
+# die merker definition dient dazu die telegram wiederholung alle 300s abzufangen und nicht jedesmal
+# begruesst zu werden.
+# Die Audio Files zur Begruessung sind als "Besitzer" definiert. jeweils als "Besitzer".mp3 in der
+# Datenbank der mpd Instanz
+
+## GA\xB4s der mpd Instanz
+my $schwarz= '13/2/1';
+my $blau= '13/2/2';
+my $gelb= '13/2/4';
+my $rot = '13/2/3';
+my $Anwesenheit = '13/2/0';
+
+# mpd
+my $IP = "192.168.178.33";
+my $Port = "6602";
+my $Lautstaerke = "70";
+
+# subscribe plugin and call it only when necessary, script will be activated if telegrams to the deffined GA are send.
+$plugin_subscribe{$schwarz}{$plugname} = 1;
+$plugin_subscribe{$gelb}{$plugname} = 1;
+$plugin_subscribe{$blau}{$plugname} = 1;
+$plugin_subscribe{$rot}{$plugname} = 1;
+$plugin_info{$plugname.'_cycle'} = 0;
+
+# ein Array der Objecte mit definierten namen, und den dazugeh\xF6rigen GA\xB4s
+# GA => GA des I-Buttons
+# merker => merker GA des jeweiligen I-Buttons um die Telegram Wiederholung abzufangen
+# besitzer => Name der mp3 (Begruessung) ohne Dateiendung
+my @AlleButtons;
+push @AlleButtons, {besitzer => "Elisa", name => "rot", GA => "13/2/3", merker => "13/2/8"};
+push @AlleButtons, {besitzer => "Volker", name => "schwarz", GA => "13/2/1", merker => "13/2/10"};
+push @AlleButtons, {besitzer => "Samuel", name => "blau", GA => "13/2/2", merker => "13/2/9"};
+push @AlleButtons, {besitzer => "Christina", name => "gelb", GA => "13/2/4", merker => "13/2/7"};
+
+#################################################################
+# do not change anything below, all config stays above
+#################################################################
+
+ # Plugin f\xFCr jedes oben definiertes Element ausf\xFChren
+foreach my $element (@AlleButtons) {
+#nur ausf\xFChren wenn das Ziel die definierte GA ist und das Telegram ein Write Telegram ist und kein Read oder Response Telegram. Der Status der Elemente wird unten im Plugin "gemerkt"
+ if ($msg{'dst'} eq ($element->{GA}) && ($msg{'apci'} eq 'A_GroupValue_Write') && knx_read($msg{'dst'},0,1) != $plugin_info{$plugname.'_' . ($element->{name}) })
+ {
+ ## Status der GA\xB4s holen
+ my $status = knx_read($Anwesenheit ,0,1);
+ my $rot_stat = knx_read($rot,0,1);
+ my $schwarz_stat = knx_read($schwarz,0,1);
+ my $gelb_stat = knx_read($gelb,0,1);
+ my $blau_stat = knx_read($blau,0,1);
+ my $stat = knx_read($element->{merker},0,1);
+ ## definierte if else anweisung die ausgef\xFChrt werden soll nach bestimmten zust\xE4nden
+ if (($msg{'value'} == 01) && ($status == 00)) {
+ knx_write($Anwesenheit ,1,1);
+ plugin_log($plugname,"name: " . $status);
+ }
+ if (($msg{'value'} == 01) && ($stat == 00)) {
+ knx_write($element->{merker}, 1,1);
+ my $debug = `MPD_HOST=$IP MPD_PORT=$Port mpc clear && MPD_HOST=$IP MPD_PORT=$Port mpc add $element->{besitzer}.mp3 && MPD_HOST=$IP MPD_PORT=$Port mpc volume $Lautstaerke && MPD_HOST=$IP MPD_PORT=$Port mpc play`;
+ }
+
+ if (($msg{'value'} == 00) && ($stat == 01)) {
+ knx_write($element->{merker}, 0,1);
+ }
+
+ elsif (($msg{'value'} == 00) && ($rot_stat == 00) && ($gelb_stat == 00) && ($schwarz_stat == 00) && ($blau_stat == 00)) {
+ knx_write($Anwesenheit ,0,1);
+ plugin_log($plugname,"name: " . $element->{name} . "; aus: ");
+ }
+
+ #merken der Zust\xE4nde:
+ $plugin_info{$plugname.'_' . ($element->{name}) } = knx_read($element->{GA} ,0,1);
+ $plugin_info{$plugname.'_' . ($Anwesenheit) } = knx_read($Anwesenheit ,0,1);
+ $plugin_info{$plugname.'_' . ($element->{merker}) } = knx_read($element->{merker} ,0,1);
+ }
+ # wenn keine der oben genannten bedingungen zutrifft dann das n\xE4chste Element abarbbeiten
+ else {
+ next;
+ }
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-17 23:52:21
|
Revision: 454
http://openautomation.svn.sourceforge.net/openautomation/?rev=454&view=rev
Author: makki1
Date: 2011-10-17 23:52:15 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
russconnectd: interims commit, WiP
Modified Paths:
--------------
tools/russconnectd/trunk/ChangeLog
tools/russconnectd/trunk/README
tools/russconnectd/trunk/debian/docs
tools/russconnectd/trunk/russ_galist.ods
tools/russconnectd/trunk/src/main.c
Added Paths:
-----------
tools/russconnectd/trunk/cfgmaker.pl
Modified: tools/russconnectd/trunk/ChangeLog
===================================================================
--- tools/russconnectd/trunk/ChangeLog 2011-10-17 21:07:20 UTC (rev 453)
+++ tools/russconnectd/trunk/ChangeLog 2011-10-17 23:52:15 UTC (rev 454)
@@ -1,6 +1,8 @@
*** 0.2 - 2011-10-15
- global UDP-socket sending with listen port as source to make socat happy
-- parse partial/fragmented messages from Russound
+- parse partial/fragmented messages from Russound (WiP still pending fragments with multiple msg)
+- change DPT for Bass,Treble,Balance from 5.010 (uchar) to DPT 6.001 (signed char -10 .. +10)
+- small additions and fixes
*** 0.1
-- initial release, see README
\ No newline at end of file
+- initial release, see README
Modified: tools/russconnectd/trunk/README
===================================================================
--- tools/russconnectd/trunk/README 2011-10-17 21:07:20 UTC (rev 453)
+++ tools/russconnectd/trunk/README 2011-10-17 23:52:15 UTC (rev 454)
@@ -36,5 +36,6 @@
*** Outlook
- *maybe* make much more modular and other interfaces (simple UDP/TCP server like C0 Z1 VolUp?)
+-> implement RIO protocal partially
- don't depend on libeibclient then
- *maybe* add outgoing interfaces for KNX-> mpd,vdr,.. to stick multiroom togehter
Added: tools/russconnectd/trunk/cfgmaker.pl
===================================================================
--- tools/russconnectd/trunk/cfgmaker.pl (rev 0)
+++ tools/russconnectd/trunk/cfgmaker.pl 2011-10-17 23:52:15 UTC (rev 454)
@@ -0,0 +1,228 @@
+#!/usr/bin/perl
+use strict;
+
+my $ZONES_PER_CONTROLLER = 6; #static
+my @gfuncnames = qw(SetAllZonesPower WRITEONLYACT NA3 NA4 NA5 AllZonesPowerState);
+my @funcnames = qw(SetPower SetSource SetVol SetBass SetTreble SetLoudness SetBalance SetParty SetDnD SetOnVol SourceSetCMD SourceKeypadCMD SetVolRelative);
+my @statenames = qw(PowerState SourceSelected VolumeState BassState TrebleState LoudnessState BalanceState PartyState DnDState OnVolState);
+my $NamePrefix = "Multiroom";
+my @SourceNames = qw(UKW-Tuner vdr/mpd Denon-WZ WG1 WG2 Hobby);
+### End config - Don't change below ###
+#######################################
+
+use File::Copy;
+use Config::Tiny;
+#print "install libconfig-tiny-perl!";
+use Getopt::Std;
+use Data::Dumper;
+use XML::Simple;
+getopts("a:z:n:f:", \my %opts);
+my $conf = Config::Tiny->new;
+
+my @funcdpts = qw (1.001 5.010 5.001 6.001 6.001 1.001 6.001 1.001 1.001 5.001 5.010 5.010 1.008);
+my @funcdpts_sub = qw (DPT_Switch DPT_Value_1_Ucount DPT_Scaling DPT_Percent_V8 DPT_Percent_V8 DPT_Switch DPT_Percent_V8 DPT_Switch DPT_Switch DPT_Scaling DPT_Value_1_Ucount DPT_Value_1_Ucount DPT_UpDown);
+my @statedpts = qw(1.001 5.010 5.001 6.001 6.001 1.001 6.001 1.001 1.001 5.001);
+my @statedpts_sub = qw (DPT_Switch DPT_Value_1_Ucount DPT_Scaling DPT_Percent_V8 DPT_Percent_V8 DPT_Switch DPT_Percent_V8 DPT_Switch DPT_Switch DPT_Scaling);
+
+my %EISmap = (
+ 1.001 => "EIS 1 'Switching' (1 Bit)",
+ 1.008 => "EIS 1 'Switching' (1 Bit)",
+ 5.001 => "Uncertain (1 Byte)",
+ 5.010 => "Uncertain (1 Byte)",
+ 6.001 => "Uncertain (1 Byte)" );
+
+if (!$opts{a} or !$opts{z} or !$opts{n} or $opts{h}) {
+ print("\n$0 Tool to create GA-config\nUsage: $0 -a <startaddress> -z <zones> -n <name1,name2,...>\n"
+ . "Example: $0 -a 10/1/0 -z 6 -n Küche,Bad,Zone3,Zone4,Zone5,Zone6 >> /etc/wiregate/eibga.conf\n"
+ . "Optional to write new config in-place: -f <path-to-eibga.conf> - Example: -f /etc/wiregate/eibga.conf\n");
+ exit();
+}
+
+if (-e $opts{f}) {
+ $conf = Config::Tiny->read($opts{f});
+ print STDERR "read config $opts{f}\n";
+}
+
+my @zonenames = split(",",$opts{n});
+my $startga = str2addr($opts{a},1);
+
+# ESF output for poor guys
+open ESF, ">", "export.esf" or die $!;
+open XML, ">:encoding(UTF-8)", "linknx.xml" or die $!;
+
+# some visu_config snipplet for CometVisu - :encoding(UTF-8)??
+open VISU1, ">", "visu_snipplet_rooms.xml" or die $!;
+open VISU2, ">", "visu_snipplet_room_pages.xml" or die $!;
+open VISU3, ">", "visu_snipplet_room_pages_all.xml" or die $!;
+
+print VISU1 " <page name=\"$NamePrefix\">\n";
+
+# Globals
+$conf->{addr2str($startga+1,1)}->{'name'} = $NamePrefix . " " . $gfuncnames[0];
+$conf->{addr2str($startga+1,1)}->{'DPTSubId'} = 1.001;
+$conf->{addr2str($startga+1,1)}->{'DPTId'} = 1;
+#$conf->{addr2str($startga+1,1)}->{'DPT_SubTypeName'} = 'DPT_Switch';
+print ESF "Multiroom-export\n";
+print ESF "$NamePrefix.Controller." . addr2str($startga+1,1) . "\t$NamePrefix $gfuncnames[0]\t" . $EISmap{'1.001'} . "\tLow\n";
+
+print XML "#<?xml version=\"1.0\" ?>\n<config>\n\t<objects>\n";
+print XML "\t\t<object id=\"$NamePrefix"."_$gfuncnames[0]\" gad=\"" . addr2str($startga+1,1) . "\" type=\"1.001\">$NamePrefix $gfuncnames[0]</object>\n";
+
+for (my $zone=0;$zone<$opts{z};$zone++) {
+ #sendKNXdgram (0x80,1,(knxstartaddress+30)+(zone*40)+(controller*256),val);
+ my $ctrl = int($zone/$ZONES_PER_CONTROLLER);
+ my $czone = int($zone%$ZONES_PER_CONTROLLER);
+ my $basega = $startga+10 + ($czone*40) + ($ctrl*256);
+ my $basegastr = addr2str($basega,1);
+ print STDERR "Zone " . ($zone+1) . " is $zonenames[$zone] base: $basegastr\n";
+ # funcs
+ for (my $i=0;$i<$#funcnames+1;$i++) {
+ $conf->{addr2str($basega+$i,1)}->{'name'} = "$NamePrefix C" . ($ctrl+1) . "-Z" . ($czone+1) . " $zonenames[$zone] $funcnames[$i]";
+ $conf->{addr2str($basega+$i,1)}->{'DPTSubId'} = $funcdpts[$i];
+ $conf->{addr2str($basega+$i,1)}->{'DPTId'} = split(".",$funcdpts[$i],1);
+ #$conf->{addr2str($basega+$i,1)}->{'DPT_SubTypeName'} = $funcdpts_sub[$i];
+ print ESF "$NamePrefix.Controller$ctrl." . addr2str($basega+$i,1) . "\t" . "$NamePrefix $zonenames[$zone] C" . ($ctrl+1) . "-Z" . ($czone+1) . " $funcnames[$i]" . "\t" . $EISmap{$funcdpts[$i]} . "\tLow\n";
+ print XML "\t\t<object id=\"$zonenames[$zone]_C" . ($ctrl+1) . "_Z" . ($czone+1) . "_" . "$funcnames[$i]\" gad=\"" . addr2str($basega+$i,1) . "\" type=\"$funcdpts[$i]\">" . "$NamePrefix $zonenames[$zone] (C" . ($ctrl+1) . "/Z" . ($czone+1) . ") $funcnames[$i]" . "</object>\n";
+ }
+ #states
+ for (my $i=0;$i<$#statenames+1;$i++) {
+ $conf->{addr2str($basega+$i+20,1)}->{'name'} = "$NamePrefix C" . ($ctrl+1) . "-Z" . ($czone+1) . " $zonenames[$zone] $statenames[$i]";
+ $conf->{addr2str($basega+$i+20,1)}->{'DPTSubId'} = $statedpts[$i];
+ $conf->{addr2str($basega+$i+20,1)}->{'DPTId'} = split(".",$statedpts[$i],1);
+ #$conf->{addr2str($basega+$i+20,1)}->{'DPT_SubTypeName'} = $statedpts_sub[$i];
+ print ESF "$NamePrefix.Controller$ctrl." . addr2str($basega+$i+20,1) . "\t" . "$NamePrefix $zonenames[$zone] C" . ($ctrl+1) . "-Z" . ($czone+1) . " $statenames[$i]" . "\t" . $EISmap{$statedpts[$i]} . "\tLow\n";
+ print XML "\t\t<object id=\"$zonenames[$zone]_C" . ($ctrl+1) . "_Z" . ($czone+1) . "_" . "$statenames[$i]\" gad=\"" . addr2str($basega+$i+20,1) . "\" type=\"$statedpts[$i]\">" . "$NamePrefix $zonenames[$zone] (C" . ($ctrl+1) . "/Z" . ($czone+1) . ") $statenames[$i]" . "</object>\n";
+ }
+ print VISU1 ' <switch mapping="OnOff" styling="RedGreen">'
+ ."\n <label>$zonenames[$zone]</label>\n"
+ .' <address transform="DPT:1.001" readonly="false" type="">' . addr2str($basega,1) . "</address>\n"
+ .' <address transform="DPT:1.001" readonly="true" type="">' . addr2str($basega+20,1) . "</address>\n"
+ ." </switch>\n";
+ print VISU1 ' <slide min="0" max="100">'
+ ."\n <label>$zonenames[$zone] Vol</label>\n"
+ .' <address transform="DPT:5.001" readonly="false" type="">' . addr2str($basega+2,1) . "</address>\n"
+ .' <address transform="DPT:5.001" readonly="true" type="">' . addr2str($basega+22,1) . "</address>\n"
+ ." </slide>\n";
+ print VISU2 " <page name=\"$NamePrefix $zonenames[$zone]\">\n";
+ print VISU2 ' <switch mapping="OnOff" styling="RedGreen">'
+ ."\n <label>Power</label>\n"
+ .' <address transform="DPT:1.001" readonly="false" type="">' . addr2str($basega,1) . "</address>\n"
+ .' <address transform="DPT:1.001" readonly="true" type="">' . addr2str($basega+20,1) . "</address>\n"
+ ." </switch>\n";
+ print VISU2 ' <slide min="0" max="100">'
+ ."\n <label>Vol</label>\n"
+ .' <address transform="DPT:5.001" readonly="false" type="">' . addr2str($basega+2,1) . "</address>\n"
+ .' <address transform="DPT:5.001" readonly="true" type="">' . addr2str($basega+22,1) . "</address>\n"
+ ." </slide>\n";
+ print VISU2 ' <info format="">'
+ ."\n <label>Source</label>\n"
+ .' <address transform="DPT:5.010" readonly="false" type="">' . addr2str($basega+1,1) . "</address>\n"
+ .' <address transform="DPT:5.010" readonly="true" type="">' . addr2str($basega+21,1) . "</address>\n"
+ ." </info>\n";
+ print VISU2 " <multitrigger button1label=\"$SourceNames[0]\" button1value=\"0\" button2label=\"$SourceNames[1]\" button2value=\"1\" button3label=\"$SourceNames[2]\" button3value=\"2\" button4label=\"$SourceNames[3]\" button4value=\"3\">"
+ ."\n <label>Source</label>\n"
+ .' <address transform="DPT:5.010" readonly="false" type="">' . addr2str($basega+1,1) . "</address>\n"
+ .' <address transform="DPT:5.010" readonly="true" type="">' . addr2str($basega+21,1) . "</address>\n"
+ ." </multitrigger>\n";
+ print VISU2 " <multitrigger button1label=\"$SourceNames[4]\" button1value=\"4\" button2label=\"$SourceNames[5]\" button2value=\"5\">"
+ ."\n <label>Source</label>\n"
+ .' <address transform="DPT:5.010" readonly="false" type="">' . addr2str($basega+1,1) . "</address>\n"
+ .' <address transform="DPT:5.010" readonly="true" type="">' . addr2str($basega+21,1) . "</address>\n"
+ ." </multitrigger>\n";
+ print VISU2 ' <switch mapping="OnOff" styling="RedGreen">'
+ ."\n <label>Loudness</label>\n"
+ .' <address transform="DPT:1.001" readonly="false" type="">' . addr2str($basega+5,1) . "</address>\n"
+ .' <address transform="DPT:1.001" readonly="true" type="">' . addr2str($basega+25,1) . "</address>\n"
+ ." </switch>\n";
+ print VISU2 ' <infotrigger button1label="+" button1value="1" button2label="-" button2value="0" align="center" infoposition="1" format="%.0f %%">'
+ ."\n <label>Volume</label>\n"
+ .' <address transform="DPT:1.008" readonly="false" type="">' . addr2str($basega+12,1) . "</address>\n"
+ .' <address transform="DPT:5.001" readonly="true" type="">' . addr2str($basega+2,1) . "</address>\n"
+ .' <address transform="DPT:5.001" readonly="true" type="">' . addr2str($basega+22,1) . "</address>\n"
+ ." </infotrigger>\n";
+ print VISU2 ' <info format="%.0f %%">'
+ ."\n <label>TurnOn Vol</label>\n"
+ .' <address transform="DPT:5.001" readonly="false" type="">' . addr2str($basega+9,1) . "</address>\n"
+ .' <address transform="DPT:5.001" readonly="true" type="">' . addr2str($basega+29,1) . "</address>\n"
+ ." </info>\n";
+ print VISU2 ' <slide min="0" max="100">'
+ ."\n <label>TurnOn Vol</label>\n"
+ .' <address transform="DPT:5.001" readonly="false" type="">' . addr2str($basega+9,1) . "</address>\n"
+ .' <address transform="DPT:5.001" readonly="true" type="">' . addr2str($basega+29,1) . "</address>\n"
+ ." </slide>\n";
+ print VISU2 ' <slide min="-10" max="10">'
+ ."\n <label>Bass</label>\n"
+ .' <address transform="DPT:6.001" readonly="false" type="">' . addr2str($basega+3,1) . "</address>\n"
+ .' <address transform="DPT:6.001" readonly="true" type="">' . addr2str($basega+23,1) . "</address>\n"
+ ." </slide>\n";
+ print VISU2 ' <slide min="-10" max="10">'
+ ."\n <label>Treble</label>\n"
+ .' <address transform="DPT:6.001" readonly="false" type="">' . addr2str($basega+4,1) . "</address>\n"
+ .' <address transform="DPT:6.001" readonly="true" type="">' . addr2str($basega+24,1) . "</address>\n"
+ ." </slide>\n";
+ print VISU2 ' <slide min="-10" max="10">'
+ ."\n <label>Balance</label>\n"
+ .' <address transform="DPT:6.001" readonly="false" type="">' . addr2str($basega+6,1) . "</address>\n"
+ .' <address transform="DPT:6.001" readonly="true" type="">' . addr2str($basega+26,1) . "</address>\n"
+ ." </slide>\n";
+ print VISU2 ' <switch mapping="OnOff" styling="RedGreen">'
+ ."\n <label>Party</label>\n"
+ .' <address transform="DPT:1.001" readonly="false" type="">' . addr2str($basega+7,1) . "</address>\n"
+ .' <address transform="DPT:1.001" readonly="true" type="">' . addr2str($basega+27,1) . "</address>\n"
+ ." </switch>\n";
+ print VISU2 ' <switch mapping="OnOff" styling="RedGreen">'
+ ."\n <label>DnD</label>\n"
+ .' <address transform="DPT:1.001" readonly="false" type="">' . addr2str($basega+8,1) . "</address>\n"
+ .' <address transform="DPT:1.001" readonly="true" type="">' . addr2str($basega+28,1) . "</address>\n"
+ ." </switch>\n";
+ print VISU2 " </page>\n";
+}
+
+close ESF;
+print XML "\t</objects>\n</config>\n";
+close XML;
+
+print VISU1 " </page>\n";
+close VISU1;
+close VISU2;
+close VISU3;
+
+#print "CONF:" . Dumper($conf);
+if (-e $opts{f}) { # wite config in place
+ copy($opts{f},$opts{f} . '.bak' );
+ $conf->write( $opts{f} . '.new' );
+ move( $opts{f} . '.new',$opts{f} );
+} else { # dump to STDOUT
+ $conf->write( '-' );
+}
+
+######
+# END
+######
+### copied global funcs
+# addr2str: Convert an integer to an EIB address string, in the form "1/2/3" or "1.2.3"
+sub addr2str {
+ my $a = $_[0];
+ my $b = $_[1] || 0; # 1 if local (group) address, else physical address
+ my $str ;
+ if ($b == 1) { # logical address used
+ $str = sprintf "%d/%d/%d", ($a >> 11) & 0xf, ($a >> 8) & 0x7, $a & 0xff;
+ }
+ else { # physical address used
+ $str = sprintf "%d.%d.%d", $a >> 12, ($a >> 8) & 0xf, $a & 0xff;
+ }
+ return $str;
+}
+
+# str2addr: Convert an EIB address string in the form "1/2/3" or "1.2.3" to an integer
+sub str2addr {
+ my $str = $_[0];
+ if ($str =~ /(\d+)\/(\d+)\/(\d+)/) { # logical address
+ return ($1 << 11) | ($2 << 8) | $3;
+ } elsif ($str =~ /(\d+)\.(\d+)\.(\d+)/) { # physical address
+ return ($1 << 12) | ($2 << 8) | $3;
+ } else {
+ #bad
+ return;
+ }
+}
Property changes on: tools/russconnectd/trunk/cfgmaker.pl
___________________________________________________________________
Added: svn:executable
+ *
Modified: tools/russconnectd/trunk/debian/docs
===================================================================
--- tools/russconnectd/trunk/debian/docs 2011-10-17 21:07:20 UTC (rev 453)
+++ tools/russconnectd/trunk/debian/docs 2011-10-17 23:52:15 UTC (rev 454)
@@ -1,4 +1,5 @@
NEWS
README
russ_galist.ods
+cfgmaker.pl
Modified: tools/russconnectd/trunk/russ_galist.ods
===================================================================
(Binary files differ)
Modified: tools/russconnectd/trunk/src/main.c
===================================================================
--- tools/russconnectd/trunk/src/main.c 2011-10-17 21:07:20 UTC (rev 453)
+++ tools/russconnectd/trunk/src/main.c 2011-10-17 23:52:15 UTC (rev 454)
@@ -38,17 +38,18 @@
#define DEBUG 1
#define DAEMON_NAME "russconnectd"
-#define USAGESTRING "\n\t-d\tRun as daemon/No debug output\n\t-p <pidfile>\tPID-filename\n\t-i <ip:port>\tIP-Address:Port to send UDP-packets to russound\n\t-l <UDP-port>\tUDP port to listen on\n\t-a <KNX address>\tKNX start-address (see README)\n\t-z <number>\tNumber of Zones to support\n\t-u <eib url>\tURL to conatct eibd like localo:/tmp/eib or ip:192.168.0.101\n"
+#define USAGESTRING "\n\t-d\tRun as daemon/No debug output\n\t-p <pidfile>\tPID-filename\n\t-i <ip:port>\tIP-Address:Port to send UDP-packets to russound\n\t-l <UDP-port>\tUDP port to listen on\n\t-a <KNX address>\tKNX start-address (see README)\n\t-z <number>\tNumber of Zones to support\n\t-u <eib url>\tURL to conatct eibd like localo:/tmp/eib or ip:192.168.0.101\n\t-s\t(Optional) send all values to KNX on startup of daemon\n"
#define NUM_THREADS 2
#define MAX_ZONES 31
#define RETRY_TIME 5
#define BUFLEN 1024
-#define POLLING_INTERVAL 60
+#define POLLING_INTERVAL 10
#define ZONES_PER_CONTROLLER 6
#define RUSS_KEYPAD_ID 0x70
pthread_mutex_t zonelock = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t initlock = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t standbylock = PTHREAD_MUTEX_INITIALIZER;
//FIXME:make struct zone dynamic
typedef struct Zone_t {
@@ -79,6 +80,7 @@
int numzones = ZONES_PER_CONTROLLER;
int pidFilehandle;
char *pidfilename = "/var/run/russconnectd.pid";
+int sendOnStart = 0;
//FIXME: also handle serial-port directly?
struct sockaddr_in si_me, si_other;
@@ -137,6 +139,7 @@
void *sendrussPolling(unsigned char zone) {
syslog(LOG_DEBUG, "polling zone %d",zone);
+ pthread_mutex_trylock(&standbylock);
char buf_onvol[25] = { 0xF0, 0, 0, 0x7F, 0, 0, RUSS_KEYPAD_ID, 0x01, 0x05, 0x02, 0, 0, 0, 0x04, 0, 0, 0, 0xF7 };
buf_onvol[1] = zone/ZONES_PER_CONTROLLER;
buf_onvol[11] = zone%ZONES_PER_CONTROLLER;
@@ -158,8 +161,12 @@
void *sendrussFunc(int controller, int zone, int func, int val) {
syslog(LOG_DEBUG,"write ctrl %d zone %d func %d val 0x%02X",controller,zone,func,val);
-
+
//TODO: send on-telegram to actuator
+
+ //block here until something is received from russound (it's turned off)
+ pthread_mutex_lock(&standbylock);
+ pthread_mutex_unlock(&standbylock);
char buf_msg1[25] = { 0, 0, 0, 0x7F, 0, 0, RUSS_KEYPAD_ID, 0x05, 0x02, 0x02, 0, 0, 0xF1, 0x23, 0, 0, 0, 0, 0, 0x01, 0, 0xF7 };
buf_msg1[1] = controller;
buf_msg1[17] = zone;
@@ -207,7 +214,10 @@
case 6: //bal
buf_msg2[0] = 0xF0;
buf_msg2[13] = 0x03;
- buf_msg2[21] = val;
+ if (val>127)
+ buf_msg2[21] = val-256+10;
+ else
+ buf_msg2[21] = val+10;
break;
case 7: //party
buf_msg2[0] = 0xF0;
@@ -298,6 +308,12 @@
buf[2] = val;
len=3;
break;
+ case 6:
+ case 6001:
+ //FIXME: This is basically wrong but as we get a uchar we expect the sender to know..
+ buf[2] = val;
+ len=3;
+ break;
/*
case 9:
fval=atof(data);
@@ -351,11 +367,17 @@
break;
case 3:
case 23:
- sendKNXdgram (0x40,51,dest,zones[zone].bass);
+ if (zones[zone].bass<10)
+ sendKNXdgram (0x40,51,dest,zones[zone].bass-10+256);
+ else
+ sendKNXdgram (0x40,51,dest,zones[zone].bass-10);
break;
case 4:
case 24:
- sendKNXdgram (0x40,51,dest,zones[zone].treble);
+ if (zones[zone].treble<10)
+ sendKNXdgram (0x40,51,dest,zones[zone].treble-10+256);
+ else
+ sendKNXdgram (0x40,51,dest,zones[zone].treble-10);
break;
case 5:
case 25:
@@ -363,7 +385,10 @@
break;
case 6:
case 26:
- sendKNXdgram (0x40,51,dest,zones[zone].balance);
+ if (zones[zone].balance<10)
+ sendKNXdgram (0x40,51,dest,zones[zone].balance-10+256);
+ else
+ sendKNXdgram (0x40,51,dest,zones[zone].balance-10);
break;
case 27:
sendKNXdgram (0x40,1,dest,zones[zone].partymode);
@@ -467,7 +492,7 @@
syslog(LOG_DEBUG, "update Zone %d val %d func %d",num,val,func);
int controller = num/ZONES_PER_CONTROLLER;
int zone = num%ZONES_PER_CONTROLLER;
- //TODO IMPORTANT!: lock mutex befor updating
+ //lock mutex befor updating
pthread_mutex_lock (&zonelock);
switch (func) {
case 1:
@@ -487,13 +512,21 @@
break;
case 4:
zones[num].bass =val;
- if (zones[num].inited)
- sendKNXdgram (0x80,51,(knxstartaddress+33)+(zone*40)+(controller*256),val);
+ if (zones[num].inited) {
+ if (val<10)
+ sendKNXdgram (0x80,51,(knxstartaddress+33)+(zone*40)+(controller*256),val-10+256);
+ else
+ sendKNXdgram (0x80,51,(knxstartaddress+33)+(zone*40)+(controller*256),val-10);
+ }
break;
case 5:
zones[num].treble =val;
- if (zones[num].inited)
- sendKNXdgram (0x80,51,(knxstartaddress+34)+(zone*40)+(controller*256),val);
+ if (zones[num].inited) {
+ if (val<10)
+ sendKNXdgram (0x80,51,(knxstartaddress+34)+(zone*40)+(controller*256),val-10+256);
+ else
+ sendKNXdgram (0x80,51,(knxstartaddress+34)+(zone*40)+(controller*256),val-10);
+ }
break;
case 6:
zones[num].loudness =val;
@@ -502,8 +535,12 @@
break;
case 7:
zones[num].balance =val;
- if (zones[num].inited)
- sendKNXdgram (0x80,51,(knxstartaddress+36)+(zone*40)+(controller*256),val);
+ if (zones[num].inited) {
+ if (val<10)
+ sendKNXdgram (0x80,51,(knxstartaddress+36)+(zone*40)+(controller*256),val-10+256);
+ else
+ sendKNXdgram (0x80,51,(knxstartaddress+36)+(zone*40)+(controller*256),val-10);
+ }
break;
case 8:
zones[num].partymode =val;
@@ -527,113 +564,134 @@
return 0;
}
+void *parseRussMsg(unsigned char* buf, int len) {
+ int i;
+ if ((len==34) && (buf[0]==0xF0) && (buf[9]==0x04)) { //zone-status
+ syslog(LOG_DEBUG,"russ Controller:%d Zone:%d Status:%d src:%d vol:%d bass:%d treb:%d loud:%d bal:%d sys:%d shrsrc:%d party:%d,DnD:%d\n",
+ buf[4],buf[12],buf[20],buf[21],buf[22],buf[23],buf[24],buf[25],buf[26],buf[27],buf[28],buf[29],buf[30]);
+ buf[12] = (buf[4]*ZONES_PER_CONTROLLER)+buf[12]; //controller + zonenumber
+ if (sendOnStart)
+ zones[buf[12]].inited = 1;
+
+ if (buf[20] != zones[buf[12]].zonepower)
+ updateZone(buf[12],buf[20],1);
+ if (buf[21] != zones[buf[12]].srcid)
+ updateZone(buf[12],buf[21],2);
+ if (buf[22] != zones[buf[12]].volume)
+ updateZone(buf[12],buf[22],3);
+ if (buf[23] != zones[buf[12]].bass)
+ updateZone(buf[12],buf[23],4);
+ if (buf[24] != zones[buf[12]].treble)
+ updateZone(buf[12],buf[24],5);
+ if (buf[25] != zones[buf[12]].loudness)
+ updateZone(buf[12],buf[25],6);
+ if (buf[26] != zones[buf[12]].balance)
+ updateZone(buf[12],buf[26],7);
+ if (buf[29] != zones[buf[12]].partymode)
+ updateZone(buf[12],buf[29],8);
+ if (buf[30] != zones[buf[12]].dnd)
+ updateZone(buf[12],buf[30],9);
+ zones[buf[12]].inited = 1;
+ } else if ((len==24) && (buf[0]==0xF0) && (buf[9]==0x05) && (buf[13]==0x00)) { //zone turn-on volume
+ //FIXME: this *might* be wrong andf trigger also on other msgs, as it's written otherwise in the docs, the checked bytes are just a guess!
+ syslog(LOG_DEBUG,"russ Controller:%d Zone:%d TurnOnVolume:%d",
+ buf[4],buf[12],buf[21]);
+ buf[12] = (buf[4]*ZONES_PER_CONTROLLER)+buf[12]; //controller + zonenumber
+ if (buf[21] != zones[buf[12]].onvolume)
+ updateZone(buf[12],buf[21],10);
+ } else {
+ //FIXME: just for debugging
+ //for (i=0; i<len; i++)
+ // printf("%d:0x%02X ",i,buf[i]);
+ printf(" unknown len: %d ",len);
+ for (i=0; i<len; i++)
+ printf("0x%02X ",buf[i]);
+ printf("\n");
+ }
+ return 0;
+}
+
void *russhandler()
{
- int i;
+ int cflag,worked;
unsigned char buf[BUFLEN];
unsigned char prevbuf[BUFLEN];
int prevlen = 0;
syslog(LOG_DEBUG, "Russound reader thread started");
while (1) {
+ //unlock standby-mutex as we received something
+ pthread_mutex_unlock(&standbylock);
int len = recvfrom(udpSocket, buf, BUFLEN, 0, (struct sockaddr *) &si_other, &slen);
if (len==-1) {
syslog(LOG_WARNING, "russ: recvfrom failed");
sleep(RETRY_TIME);
break;
}
+
/* Stick together fragmented telegrams, start is F0, end is F7
- */
//FIXME: we assume either complete telegrams or fragmented but no overlapping messages in sep. udp dgrams!
-
- //DEBUG
+ int i,pos;
+
//for (i=0; i<len; i++)
// printf("PRE-parse: %d:0x%02X ",i,buf[i]);
printf( "PRE-Parse: %d -> ",len);
for (i=0; i<len; i++)
printf( "0x%02X ",buf[i]);
printf( "\n");
- //END DEBUG code
+ */
if ((len + prevlen) > BUFLEN) {
syslog(LOG_INFO, "Message too large: %d + %d !!",len,prevlen);
prevlen=0;
continue;
}
- if (buf[0] == 0xF0 && buf[len-1] == 0xF7) { // complete message
- syslog(LOG_DEBUG, "----> COMPLETE <---- message received, size %d \n", len);
- } else if (buf[0] == 0xF0) { // start of new message
- printf("..START..\n");
- prevlen = len;
- memcpy(prevbuf,buf,len);
+ worked = 0;
+ //while (worked < len) {
+ if (buf[0] == 0xF0 && buf[len-1] == 0xF7) { // complete message
+ syslog(LOG_DEBUG, "----> COMPLETE <---- message received, size %d \n", len);
+ } else if (buf[0] == 0xF0) { // start of new message
+ //printf("..START..\n");
+ prevlen = len;
+ worked += len;
+ memcpy(prevbuf,buf,len);
+ cflag = 1;
+ continue;
+ } else if (prevlen > 0 && prevbuf[0] == 0xF0 && buf[len-1] == 0xF7) { // message complete
+ //printf("..complete..%d %d\n",prevlen,len);
+ memcpy(prevbuf+prevlen,buf,len);
+ len += prevlen;
+ prevlen = 0;
+ memcpy(buf,prevbuf,len);
+ } else if (prevlen > 0 && prevbuf[0] == 0xF0) { //continuation message
+ //printf("..continue..%d %d\n",prevlen,len);
+ memcpy(prevbuf+prevlen,buf,len);
+ prevlen += len;
+ worked += len;
+ cflag = 1;
+ continue;
+ } else { //DUNNO!!
+ syslog(LOG_DEBUG,"---> DUNNO <--- !!! resetting message buffers!");
+ prevlen = 0;
+ prevbuf[0] = 0x0;
+ cflag = 1;
+ continue;
+ }
+ /*
+ printf( "POST-Parse: %d -> ",len);
+ for (i=0; i<len; i++)
+ printf( "0x%02X ",prevbuf[i]);
+ printf( "\n");
+ */
+
+ //TODO: Checksum calculation / check of russound-message
+ parseRussMsg(buf,len);
+ //} //end while worked
+ if (cflag)
continue;
- } else if (prevlen > 0 && prevbuf[0] == 0xF0 && buf[len-1] == 0xF7) { // message complete
- printf("..complete..%d %d\n",prevlen,len);
- memcpy(prevbuf+prevlen,buf,len);
- len += prevlen;
- prevlen = 0;
- memcpy(buf,prevbuf,len);
- } else if (prevlen > 0 && prevbuf[0] == 0xF0) { //continuation message
- printf("..continue..%d %d\n",prevlen,len);
- memcpy(prevbuf+prevlen,buf,len);
- prevlen += len;
- continue;
- } else { //DUNNO!!
- syslog(LOG_DEBUG,"---> DUNNO <--- !!! resetting message buffers!");
- prevlen = 0;
- prevbuf[0] = 0x0;
- continue;
- }
- //DEBUG
- printf( "POST-Parse: %d -> ",len);
- for (i=0; i<len; i++)
- printf( "0x%02X ",prevbuf[i]);
- printf( "\n");
- //END DEBUG code
-
- //TODO: Checksum calculation / check of russound-message
- if ((len==34) && (buf[0]==0xF0) && (buf[9]==0x04)) { //zone-status
- syslog(LOG_DEBUG,"russ Controller:%d Zone:%d Status:%d src:%d vol:%d bass:%d treb:%d loud:%d bal:%d sys:%d shrsrc:%d party:%d,DnD:%d\n",
- buf[4],buf[12],buf[20],buf[21],buf[22],buf[23],buf[24],buf[25],buf[26],buf[27],buf[28],buf[29],buf[30]);
- buf[12] = (buf[4]*ZONES_PER_CONTROLLER)+buf[12]; //controller + zonenumber
- if (buf[20] != zones[buf[12]].zonepower)
- updateZone(buf[12],buf[20],1);
- if (buf[21] != zones[buf[12]].srcid)
- updateZone(buf[12],buf[21],2);
- if (buf[22] != zones[buf[12]].volume)
- updateZone(buf[12],buf[22],3);
- if (buf[23] != zones[buf[12]].bass)
- updateZone(buf[12],buf[23],4);
- if (buf[24] != zones[buf[12]].treble)
- updateZone(buf[12],buf[24],5);
- if (buf[25] != zones[buf[12]].loudness)
- updateZone(buf[12],buf[25],6);
- if (buf[26] != zones[buf[12]].balance)
- updateZone(buf[12],buf[26],7);
- if (buf[29] != zones[buf[12]].partymode)
- updateZone(buf[12],buf[29],8);
- if (buf[30] != zones[buf[12]].dnd)
- updateZone(buf[12],buf[30],9);
- zones[buf[12]].inited = 1;
- } else if ((len==24) && (buf[0]==0xF0) && (buf[9]==0x05) && (buf[13]==0x00)) { //zone turn-on volume
- //FIXME: this *might* be wrong andf trigger also on other msgs, as it's written otherwise in the docs, the checked bytes are just a guess!
- syslog(LOG_DEBUG,"russ Controller:%d Zone:%d TurnOnVolume:%d",
- buf[4],buf[12],buf[21]);
- buf[12] = (buf[4]*ZONES_PER_CONTROLLER)+buf[12]; //controller + zonenumber
- if (buf[21] != zones[buf[12]].onvolume)
- updateZone(buf[12],buf[21],10);
- } else {
- //FIXME: just for debugging
- for (i=0; i<len; i++)
- printf("%d:0x%02X ",i,buf[i]);
- printf(" unknown len: %d\n",len);
- for (i=0; i<len; i++)
- printf("0x%02X ",buf[i]);
- printf("\n");
- }
- }
+ } //end with recvfrom
syslog(LOG_WARNING,"russ: closed socket"); //break in read-loop
pthread_exit(NULL);
-}
+} //end func russhandler
eibaddr_t readgaddr (const char *addr) {
int a, b, c;
@@ -682,11 +740,14 @@
char *p;
char pidstr[255];
- while ((c = getopt (argc, argv, "dp:i:l:a:z:u:")) != -1)
+ while ((c = getopt (argc, argv, "dp:i:l:a:z:u:s")) != -1)
switch (c) {
case 'd':
daemonize = 1;
break;
+ case 's':
+ sendOnStart = 1;
+ break;
case 'p':
pidfilename = optarg;
break;
@@ -782,6 +843,7 @@
// PTHREAD_CREATE_DETACHED?
knxthread = pthread_create(&threads[1], NULL, knxhandler, NULL); //id, thread attributes, subroutine, arguments
russthread = pthread_create(&threads[2], NULL, russhandler, NULL); //id, thread attributes, subroutine, arguments
+ syslog(LOG_DEBUG,"Threads created: %d %d",knxthread,russthread);
//TODO: Maybe another console/TCP-server/Logging thread?
while (1) {
syslog(LOG_DEBUG, "%s daemon running", DAEMON_NAME);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tho...@us...> - 2011-10-17 21:07:29
|
Revision: 453
http://openautomation.svn.sourceforge.net/openautomation/?rev=453&view=rev
Author: thomas_s
Date: 2011-10-17 21:07:20 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
- removed some 'using' from headers
- did some refactoring
- implemented clean shutdown with CTRL-C and SIGTERM
- use range-based for loop (just for fun)
- some preperations for unit-testing
Modified Paths:
--------------
xPLHAL/branches/thomas_s_dev/CMakeLists.txt
xPLHAL/branches/thomas_s_dev/cmake/Modules/FindxPL.cmake
xPLHAL/branches/thomas_s_dev/src/CMakeLists.txt
xPLHAL/branches/thomas_s_dev/src/devicemanager.cpp
xPLHAL/branches/thomas_s_dev/src/devicemanager.h
xPLHAL/branches/thomas_s_dev/src/globals.h
xPLHAL/branches/thomas_s_dev/src/main.cpp
xPLHAL/branches/thomas_s_dev/src/xhcp.cpp
xPLHAL/branches/thomas_s_dev/src/xhcp.h
xPLHAL/branches/thomas_s_dev/src/xhcpthread.cpp
xPLHAL/branches/thomas_s_dev/src/xhcpthread.h
xPLHAL/branches/thomas_s_dev/src/xplcache.cpp
xPLHAL/branches/thomas_s_dev/src/xplcache.h
xPLHAL/branches/thomas_s_dev/src/xplhandler.cpp
xPLHAL/branches/thomas_s_dev/src/xplhandler.h
xPLHAL/branches/thomas_s_dev/src/xplmessagequeue.cpp
xPLHAL/branches/thomas_s_dev/src/xplmessagequeue.h
Added Paths:
-----------
xPLHAL/branches/thomas_s_dev/ChangeLog
xPLHAL/branches/thomas_s_dev/src/i_properties.h
xPLHAL/branches/thomas_s_dev/src/xpldevice.h
xPLHAL/branches/thomas_s_dev/src/xplmessage.h
xPLHAL/branches/thomas_s_dev/test/
xPLHAL/branches/thomas_s_dev/test/CMakeLists.txt
xPLHAL/branches/thomas_s_dev/test/test_test.cpp
Modified: xPLHAL/branches/thomas_s_dev/CMakeLists.txt
===================================================================
--- xPLHAL/branches/thomas_s_dev/CMakeLists.txt 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/CMakeLists.txt 2011-10-17 21:07:20 UTC (rev 453)
@@ -37,7 +37,7 @@
#set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
-find_package(Boost 1.38 COMPONENTS thread system filesystem date_time regex )
+find_package(Boost 1.38 COMPONENTS thread system filesystem date_time regex unit_test_framework)
find_package(xPL REQUIRED)
set(LIBS ${LIBS} ${Boost_LIBRARIES} ${xPL_LIBRARIES} pthread)
@@ -65,4 +65,5 @@
endif(Boost_USE_STATIC_LIBS)
add_subdirectory(src)
+add_subdirectory(test)
Added: xPLHAL/branches/thomas_s_dev/ChangeLog
===================================================================
--- xPLHAL/branches/thomas_s_dev/ChangeLog (rev 0)
+++ xPLHAL/branches/thomas_s_dev/ChangeLog 2011-10-17 21:07:20 UTC (rev 453)
@@ -0,0 +1,8 @@
+
+2011-10-17:
+Experimentally using c++0x features available with gcc-4.6.
+To compile create clean 'build' directory and call from build-dir:
+"CXX=g++-4.6 cmake .."
+
+Boost-Test is not working yet.
+
Modified: xPLHAL/branches/thomas_s_dev/cmake/Modules/FindxPL.cmake
===================================================================
--- xPLHAL/branches/thomas_s_dev/cmake/Modules/FindxPL.cmake 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/cmake/Modules/FindxPL.cmake 2011-10-17 21:07:20 UTC (rev 453)
@@ -3,11 +3,13 @@
find_path( xPL_INCLUDE_DIR
NAMES xPL.h
PATHS /usr/local/include
+ PATHS /home/thomas/projects/xPLLib
)
find_library( xPL_LIBRARY
NAMES libxPL.so
PATHS /usr/local/lib
+ PATHS /home/thomas/projects/xPLLib
)
set( xPL_FOUND TRUE )
Modified: xPLHAL/branches/thomas_s_dev/src/CMakeLists.txt
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/CMakeLists.txt 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/src/CMakeLists.txt 2011-10-17 21:07:20 UTC (rev 453)
@@ -17,6 +17,8 @@
project(xPLHAL)
cmake_minimum_required(VERSION 2.6)
+#set(CMAKE_CXX_FLAGS "-g -O2 -std=c++0x")
+set(CMAKE_CXX_FLAGS "-g -std=c++0x")
set(xPLHAL_SRCS xplmessagequeue.cpp devicemanager.cpp xplhandler.cpp xplcache.cpp xhcpthread.cpp log.cpp xhcp.cpp main.cpp)
add_executable(xPLHAL ${xPLHAL_SRCS})
Modified: xPLHAL/branches/thomas_s_dev/src/devicemanager.cpp
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/devicemanager.cpp 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/src/devicemanager.cpp 2011-10-17 21:07:20 UTC (rev 453)
@@ -1,20 +1,20 @@
/*
- xPLHAL implementation in C++
- Copyright (C) 2009 by Christian Mayer - xpl at ChristianMayer dot de
+ xPLHAL implementation in C++
+ Copyright (C) 2009 by Christian Mayer - xpl 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 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.
+ 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, see <http://www.gnu.org/licenses/>.
-*/
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
@@ -23,379 +23,370 @@
using namespace boost::algorithm;
#include "log.h"
-
#include "devicemanager.h"
+using namespace boost::posix_time;
+
void deviceManagerClass::add( const xPLDevice& device ) const
{
- writeLog( "deviceManagerClass::add("+device.VDI+")", logLevel::debug );
- if( contains( device.VDI ) )
- update( device );
- else
- {
- string newtag = "device." + device.VDI + ".";
- ptime expires = second_clock::local_time() + minutes( 2*device.Interval + 1 );
+ writeLog( "deviceManagerClass::add("+device.VDI+")", logLevel::debug );
+ if( contains( device.VDI ) ) {
+ update( device );
+ } else {
+ std::string newtag = "device." + device.VDI + ".";
+ ptime expires = second_clock::local_time() + minutes( 2*device.Interval + 1 );
- xPLCache->updateEntry(newtag + "vdi", device.VDI, false);
- xPLCache->updateEntry(newtag + "configdone", device.ConfigDone?"true":"false", false);
- xPLCache->updateEntry(newtag + "configmissing", device.ConfigMissing?"true":"false", false);
- xPLCache->updateEntry(newtag + "configsource", device.ConfigSource, false);
- xPLCache->updateEntry(newtag + "configtype", device.ConfigType?"true":"false", false);
- xPLCache->updateEntry(newtag + "waitingconfig", device.WaitingConfig?"true":"false", false);
- xPLCache->updateEntry(newtag + "current", device.Current?"true":"false", false);
- xPLCache->updateEntry(newtag + "configlistsent", device.ConfigListSent?"true":"false", false);
- xPLCache->updateEntry(newtag + "suspended", device.Suspended?"true":"false", false);
- xPLCache->updateEntry(newtag + "interval", lexical_cast<string>(device.Interval), false);
- xPLCache->updateEntry(newtag + "expires", timeConverter( expires ), false);
- }
+ xPLCache->updateEntry(newtag + "vdi", device.VDI, false);
+ xPLCache->updateEntry(newtag + "configdone", device.ConfigDone?"true":"false", false);
+ xPLCache->updateEntry(newtag + "configmissing", device.ConfigMissing?"true":"false", false);
+ xPLCache->updateEntry(newtag + "configsource", device.ConfigSource, false);
+ xPLCache->updateEntry(newtag + "configtype", device.ConfigType?"true":"false", false);
+ xPLCache->updateEntry(newtag + "waitingconfig", device.WaitingConfig?"true":"false", false);
+ xPLCache->updateEntry(newtag + "current", device.Current?"true":"false", false);
+ xPLCache->updateEntry(newtag + "configlistsent", device.ConfigListSent?"true":"false", false);
+ xPLCache->updateEntry(newtag + "suspended", device.Suspended?"true":"false", false);
+ xPLCache->updateEntry(newtag + "interval", lexical_cast<std::string>(device.Interval), false);
+ xPLCache->updateEntry(newtag + "expires", timeConverter( expires ), false);
+ }
}
-bool deviceManagerClass::remove( const string& deviceTag ) const
+bool deviceManagerClass::remove( const std::string& deviceTag ) const
{
- writeLog( "deviceManagerClass::remove("+deviceTag+")", logLevel::debug );
- if( contains( deviceTag ) )
- {
- vector<string> list = xPLCache->childNodes( "device." + deviceTag );
- for( vector<string>::const_iterator it = list.begin(); it != list.end(); it++ )
- xPLCache->deleteEntry( *it );
- return true;
- } else
- return false;
+ writeLog( "deviceManagerClass::remove("+deviceTag+")", logLevel::debug );
+ if( contains( deviceTag ) ) {
+ std::vector<std::string> list = xPLCache->childNodes( "device." + deviceTag );
+ //for( std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); it++ )
+ for( auto it : list )
+ xPLCache->deleteEntry( it );
+ return true;
+ } else {
+ return false;
+ }
}
-bool deviceManagerClass::removeConfig( const string& deviceTag ) const
+bool deviceManagerClass::removeConfig( const std::string& deviceTag ) const
{
- writeLog( "deviceManagerClass::remove("+deviceTag+")", logLevel::debug );
- if( containsConfig( deviceTag ) )
- {
- vector<string> list = xPLCache->childNodes( "config." + deviceTag );
- for( vector<string>::const_iterator it = list.begin(); it != list.end(); it++ )
- xPLCache->deleteEntry( *it );
- return true;
- } else
- return false;
+ writeLog( "deviceManagerClass::remove("+deviceTag+")", logLevel::debug );
+ if( containsConfig( deviceTag ) ) {
+ std::vector<std::string> list = xPLCache->childNodes( "config." + deviceTag );
+ //for( std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); it++ )
+ for (auto it : list)
+ xPLCache->deleteEntry( it );
+ return true;
+ } else {
+ return false;
+ }
}
-xPLDevice deviceManagerClass::getDevice( const string& deviceTag ) const
+xPLDevice deviceManagerClass::getDevice( const std::string& deviceTag ) const
{
- xPLDevice retval;
- if( contains( deviceTag ) )
- {
- retval.ConfigDone = xPLCache->objectValue( "device." + deviceTag + ".configdone" ) == "true";
- retval.ConfigMissing = xPLCache->objectValue( "device." + deviceTag + ".configmissing" ) == "true";
- retval.ConfigSource = xPLCache->objectValue( "device." + deviceTag + ".configsource" );
- retval.ConfigType = xPLCache->objectValue( "device." + deviceTag + ".configtype" ) == "true";
- retval.Current = xPLCache->objectValue( "device." + deviceTag + ".current" ) == "true";
- retval.Expires = timeConverter( xPLCache->objectValue( "device." + deviceTag + ".expires" ) );
- retval.Interval = atoi(xPLCache->objectValue( "device." + deviceTag + ".interval" ).c_str());
- retval.VDI = xPLCache->objectValue( "device." + deviceTag + ".vdi" );
- retval.WaitingConfig = xPLCache->objectValue( "device." + deviceTag + ".waitingconfig" ) == "true";
- retval.ConfigListSent = xPLCache->objectValue( "device." + deviceTag + ".configlistsent" ) == "true";
- retval.Suspended = xPLCache->objectValue( "device." + deviceTag + ".suspended" ) == "true";
- }
- return retval;
+ xPLDevice retval;
+ if( contains( deviceTag ) ) {
+ retval.ConfigDone = xPLCache->objectValue( "device." + deviceTag + ".configdone" ) == "true";
+ retval.ConfigMissing = xPLCache->objectValue( "device." + deviceTag + ".configmissing" ) == "true";
+ retval.ConfigSource = xPLCache->objectValue( "device." + deviceTag + ".configsource" );
+ retval.ConfigType = xPLCache->objectValue( "device." + deviceTag + ".configtype" ) == "true";
+ retval.Current = xPLCache->objectValue( "device." + deviceTag + ".current" ) == "true";
+ retval.Expires = timeConverter( xPLCache->objectValue( "device." + deviceTag + ".expires" ) );
+ retval.Interval = atoi(xPLCache->objectValue( "device." + deviceTag + ".interval" ).c_str());
+ retval.VDI = xPLCache->objectValue( "device." + deviceTag + ".vdi" );
+ retval.WaitingConfig = xPLCache->objectValue( "device." + deviceTag + ".waitingconfig" ) == "true";
+ retval.ConfigListSent = xPLCache->objectValue( "device." + deviceTag + ".configlistsent" ) == "true";
+ retval.Suspended = xPLCache->objectValue( "device." + deviceTag + ".suspended" ) == "true";
+ }
+ return retval;
}
-vector<string> deviceManagerClass::getAllDeviceNames() const
+std::vector<std::string> deviceManagerClass::getAllDeviceNames() const
{
- vector<string> retval;
- vector<string> nodes = xPLCache->childNodes( "device." );
- for( vector<string>::iterator it = nodes.begin(); it != nodes.end(); ++it )
- {
- if( ends_with( *it, ".vdi" ) )
- {
- retval.push_back( it->substr( 7, it->size() - 7 - 4 ) ); // leave "device." and ".vdi" away
- writeLog( "deviceManagerClass::getAllDeviceNames() = "+ it->substr( 7, it->size() - 7 - 4 ), logLevel::debug );
+ std::vector<std::string> retval;
+ std::vector<std::string> nodes = xPLCache->childNodes( "device." );
+// for( std::vector<std::string>::iterator it = nodes.begin(); it != nodes.end(); ++it )
+ for (auto node : nodes) {
+ if( ends_with( node, ".vdi" ) ) {
+ retval.push_back( node.substr( 7, node.size() - 7 - 4 ) ); // leave "device." and ".vdi" away
+ writeLog( "deviceManagerClass::getAllDeviceNames() = "+ node.substr( 7, node.size() - 7 - 4 ), logLevel::debug );
+ }
}
- }
- return retval;
+ return retval;
}
void deviceManagerClass::update( const xPLDevice& device ) const
{
- writeLog( "deviceManagerClass::update("+device.VDI+") - known: "+ (contains( device.VDI )?"true":"false"), logLevel::debug );
+ writeLog( "deviceManagerClass::update("+device.VDI+") - known: "+ (contains( device.VDI )?"true":"false"), logLevel::debug );
- if( contains( device.VDI ) )
- remove( device.VDI );
- writeLog( "deviceManagerClass::update("+device.VDI+") -> add", logLevel::debug );
- add( device );
+ if( contains( device.VDI ) ) {
+ remove( device.VDI );
+ }
+ writeLog( "deviceManagerClass::update("+device.VDI+") -> add", logLevel::debug );
+ add( device );
}
void deviceManagerClass::processConfigList( const xPL_MessagePtr message ) const
{
- string source = string("")
- + xPL_getSourceVendor ( message ) + "-"
- + xPL_getSourceDeviceID ( message ) + "."
- + xPL_getSourceInstanceID( message );
- xPLDevice device = getDevice( source );
- writeLog( "deviceManagerClass::processConfigList("+source+") - found ["+device.VDI+"]", logLevel::debug );
- if( "" == device.VDI )
- { // A config list turned up that we haven't asked for...
- // create a new device...
- const char* intervalString = xPL_getMessageNamedValue( message, "interval" );
- int interval = intervalString ? atoi(intervalString) : 5; // default to 5 minutes
- ptime expires = second_clock::local_time() + minutes( 2*interval + 1 );
- device.VDI = source; // vendor / device / instance = unique id
- device.ConfigDone = false; // false = new waiting check, true = sent/not required
- device.ConfigMissing = false; // true = no config file, no response from device, false = have/waiting config
- device.ConfigSource = "objectcache"; // v-d.xml / v-d.cache.xml or empty
- device.ConfigType = true; // true = config. false = hbeat.
- device.WaitingConfig = false; // false = waiting check or not needed, true = manual intervention
- device.Current = false; // asked for current config
- device.ConfigListSent = true; // Have we asked this device for it's config?
- device.Suspended = false; // lost heartbeat
- device.Interval = interval; // current heartbeat interval
- device.Expires = expires; // time expires
- update( device );
- }
+ std::string source = std::string("")
+ + xPL_getSourceVendor ( message ) + "-"
+ + xPL_getSourceDeviceID ( message ) + "."
+ + xPL_getSourceInstanceID( message );
+ xPLDevice device = getDevice( source );
+ writeLog( "deviceManagerClass::processConfigList("+source+") - found ["+device.VDI+"]", logLevel::debug );
+ if( "" == device.VDI ) {
+ // A config list turned up that we haven't asked for...
+ // create a new device...
+ const char* intervalString = xPL_getMessageNamedValue( message, "interval" );
+ int interval = intervalString ? atoi(intervalString) : 5; // default to 5 minutes
+ ptime expires = second_clock::local_time() + minutes( 2*interval + 1 );
+ device.VDI = source; // vendor / device / instance = unique id
+ device.ConfigDone = false; // false = new waiting check, true = sent/not required
+ device.ConfigMissing = false; // true = no config file, no response from device, false = have/waiting config
+ device.ConfigSource = "objectcache"; // v-d.xml / v-d.cache.xml or empty
+ device.ConfigType = true; // true = config. false = hbeat.
+ device.WaitingConfig = false; // false = waiting check or not needed, true = manual intervention
+ device.Current = false; // asked for current config
+ device.ConfigListSent = true; // Have we asked this device for it's config?
+ device.Suspended = false; // lost heartbeat
+ device.Interval = interval; // current heartbeat interval
+ device.Expires = expires; // time expires
+ update( device );
+ }
- xPL_NameValueListPtr nvList = xPL_getMessageBody( message );
- xPL_NameValuePairPtr nvPair = NULL;
- int nvCount = xPL_getNamedValueCount(nvList);
- for( int nvIndex = 0; nvIndex < nvCount; nvIndex++ )
- {
- string newtag = "config." + source + ".options.";
- nvPair = xPL_getNamedValuePairAt( nvList, nvIndex );
- string value = nvPair->itemValue; to_lower( value );
- string key = nvPair->itemName ; to_lower( key );
- boost::regex re( "([a-z0-9]{1,16})\\[(\\d{1,3})\\]" );
- boost::smatch matches;
- if( boost::regex_match( value, matches, re) )
- {
- xPLCache->updateEntry( newtag + matches[1] , "" , false );
- xPLCache->updateEntry( newtag + matches[1] + ".type" , key , false );
- xPLCache->updateEntry( newtag + matches[1] + ".count", matches[2], false );
- } else {
- xPLCache->updateEntry( newtag + value , "" , false );
- xPLCache->updateEntry( newtag + value + ".type" , key , false );
- xPLCache->updateEntry( newtag + value + ".count", "" , false );
+ xPL_NameValueListPtr nvList = xPL_getMessageBody( message );
+ xPL_NameValuePairPtr nvPair = NULL;
+ int nvCount = xPL_getNamedValueCount(nvList);
+ for( int nvIndex = 0; nvIndex < nvCount; nvIndex++ ) {
+ std::string newtag = "config." + source + ".options.";
+ nvPair = xPL_getNamedValuePairAt( nvList, nvIndex );
+ std::string value = nvPair->itemValue; to_lower( value );
+ std::string key = nvPair->itemName ; to_lower( key );
+ boost::regex re( "([a-z0-9]{1,16})\\[(\\d{1,3})\\]" );
+ boost::smatch matches;
+ if( boost::regex_match( value, matches, re) ) {
+ xPLCache->updateEntry( newtag + matches[1] , "" , false );
+ xPLCache->updateEntry( newtag + matches[1] + ".type" , key , false );
+ xPLCache->updateEntry( newtag + matches[1] + ".count", matches[2], false );
+ } else {
+ xPLCache->updateEntry( newtag + value , "" , false );
+ xPLCache->updateEntry( newtag + value + ".type" , key , false );
+ xPLCache->updateEntry( newtag + value + ".count", "" , false );
+ }
}
- }
- // send the config response, but only if we have a config (e.g. from the use via XHCP)
- if( xPLCache->exists( "config." + source + ".current" ) )
- {
- xPLCache->updateEntry( "device." + source + ".configdone", "true", false );
- sendConfigResponse( source, false );
- } else {
- // try to get at least the current config
- xPLMessage::namedValueList command_request; command_request.push_back( make_pair( "command", "request" ) );
- xPL->sendMessage( xPL_MESSAGE_COMMAND,
- xPL_getSourceVendor( message ), xPL_getSourceDeviceID( message ), xPL_getSourceInstanceID( message ),
- "config", "current", command_request );
- }
+ // send the config response, but only if we have a config (e.g. from the use via XHCP)
+ if( xPLCache->exists( "config." + source + ".current" ) ) {
+ xPLCache->updateEntry( "device." + source + ".configdone", "true", false );
+ sendConfigResponse( source, false );
+ } else {
+ // try to get at least the current config
+ xPLMessage::namedValueList command_request; command_request.push_back( std::make_pair( "command", "request" ) );
+ xPL->sendMessage( xPL_MESSAGE_COMMAND,
+ xPL_getSourceVendor( message ), xPL_getSourceDeviceID( message ), xPL_getSourceInstanceID( message ),
+ "config", "current", command_request );
+ }
}
void deviceManagerClass::processConfigHeartBeat( const xPL_MessagePtr message ) const
{
- string source = string("")
- + xPL_getSourceVendor ( message ) + "-"
- + xPL_getSourceDeviceID ( message ) + "."
- + xPL_getSourceInstanceID( message );
- xPLDevice device = getDevice( source );
- writeLog( "deviceManagerClass::processConfigHeartBeat("+source+") - found ["+device.VDI+"]", logLevel::debug );
- if( "" == device.VDI )
- { // this handles a new application that identifies itself with a hbeat straight away.
- // it must either be storing it's config locally, can't be configured, or is configured somewhere else.
- const char* intervalString = xPL_getMessageNamedValue( message, "interval" );
- int interval = intervalString ? atoi(intervalString) : 5; // default to 5 minutes
- ptime expires = second_clock::local_time() + minutes( 2*interval + 1 );
- device.VDI = source; // vendor / device / instance = unique id
- device.ConfigDone = false; // false = new waiting check, true = sent/not required
- device.ConfigMissing = true; // true = no config file, no response from device, false = have/waiting config
- device.ConfigSource = "xplmessage"; // v-d.xml / v-d.cache.xml or empty
- device.ConfigType = true; // true = config. false = hbeat.
- device.WaitingConfig = true; // false = waiting check or not needed, true = manual intervention
- device.Current = false; // asked for current config
- device.ConfigListSent = false; // Have we asked this device for it's config?
- device.Suspended = false; // lost heartbeat
- device.Interval = interval; // current heartbeat interval
- device.Expires = expires; // time expires
- update( device );
- } else {
- xPLCache->updateEntry( "device." + source + ".expires", timeConverter( second_clock::local_time() + minutes( 2*device.Interval + 1 ) ), false );
- // FIXME - that line look like that in the VB code - but it seems really strange!
- xPLCache->updateEntry( "device." + source + ".expires.configdone", "objectcache", false );
- }
+ std::string source = std::string("")
+ + xPL_getSourceVendor ( message ) + "-"
+ + xPL_getSourceDeviceID ( message ) + "."
+ + xPL_getSourceInstanceID( message );
+ xPLDevice device = getDevice( source );
+ writeLog( "deviceManagerClass::processConfigHeartBeat("+source+") - found ["+device.VDI+"]", logLevel::debug );
+ if( "" == device.VDI ) {
+ // this handles a new application that identifies itself with a hbeat straight away.
+ // it must either be storing it's config locally, can't be configured, or is configured somewhere else.
+ const char* intervalString = xPL_getMessageNamedValue( message, "interval" );
+ int interval = intervalString ? atoi(intervalString) : 5; // default to 5 minutes
+ ptime expires = second_clock::local_time() + minutes( 2*interval + 1 );
+ device.VDI = source; // vendor / device / instance = unique id
+ device.ConfigDone = false; // false = new waiting check, true = sent/not required
+ device.ConfigMissing = true; // true = no config file, no response from device, false = have/waiting config
+ device.ConfigSource = "xplmessage"; // v-d.xml / v-d.cache.xml or empty
+ device.ConfigType = true; // true = config. false = hbeat.
+ device.WaitingConfig = true; // false = waiting check or not needed, true = manual intervention
+ device.Current = false; // asked for current config
+ device.ConfigListSent = false; // Have we asked this device for it's config?
+ device.Suspended = false; // lost heartbeat
+ device.Interval = interval; // current heartbeat interval
+ device.Expires = expires; // time expires
+ update( device );
+ } else {
+ xPLCache->updateEntry( "device." + source + ".expires", timeConverter( second_clock::local_time() + minutes( 2*device.Interval + 1 ) ), false );
+ // FIXME - that line look like that in the VB code - but it seems really strange!
+ xPLCache->updateEntry( "device." + source + ".expires.configdone", "objectcache", false );
+ }
- // ask device for configuration (if haven't asked it before...)
- if( !device.ConfigListSent )
- {
- xPLMessage::namedValueList command_request; command_request.push_back( make_pair( "command", "request" ) );
- xPL->sendMessage( xPL_MESSAGE_COMMAND,
- xPL_getSourceVendor( message ), xPL_getSourceDeviceID( message ), xPL_getSourceInstanceID( message ),
- "config", "list", command_request );
- xPLCache->updateEntry( "device." + source + ".configlistsend", "true", false );
- }
+ // ask device for configuration (if haven't asked it before...)
+ if( !device.ConfigListSent ) {
+ xPLMessage::namedValueList command_request; command_request.push_back( std::make_pair( "command", "request" ) );
+ xPL->sendMessage( xPL_MESSAGE_COMMAND,
+ xPL_getSourceVendor( message ), xPL_getSourceDeviceID( message ), xPL_getSourceInstanceID( message ),
+ "config", "list", command_request );
+ xPLCache->updateEntry( "device." + source + ".configlistsend", "true", false );
+ }
}
void deviceManagerClass::processCurrentConfig( const xPL_MessagePtr message ) const
{
- string source = string("")
- + xPL_getSourceVendor ( message ) + "-"
- + xPL_getSourceDeviceID ( message ) + "."
- + xPL_getSourceInstanceID( message );
- xPLDevice device = getDevice( source );
- writeLog( "deviceManagerClass::processCurrentConfig("+source+") - found ["+device.VDI+"]", logLevel::debug );
- if( "" == device.VDI )
- { // A current config turned up for a device that we don't know...
- // Processing the current config doesn't make sense as long as we don't know the config list
- // => just treat it like an heartbeat
- return processConfigHeartBeat( message );
- } else {
- xPLCache->updateEntry( "config." + source + ".expires", timeConverter( second_clock::local_time() + minutes( 2*device.Interval + 1 ) ), false );
- xPLCache->updateEntry( "config." + source + ".current", "true", false );
- }
+ std::string source = std::string("")
+ + xPL_getSourceVendor ( message ) + "-"
+ + xPL_getSourceDeviceID ( message ) + "."
+ + xPL_getSourceInstanceID( message );
+ xPLDevice device = getDevice( source );
+ writeLog( "deviceManagerClass::processCurrentConfig("+source+") - found ["+device.VDI+"]", logLevel::debug );
+ if( "" == device.VDI ) {
+ // A current config turned up for a device that we don't know...
+ // Processing the current config doesn't make sense as long as we don't know the config list
+ // => just treat it like an heartbeat
+ return processConfigHeartBeat( message );
+ } else {
+ xPLCache->updateEntry( "config." + source + ".expires", timeConverter( second_clock::local_time() + minutes( 2*device.Interval + 1 ) ), false );
+ xPLCache->updateEntry( "config." + source + ".current", "true", false );
+ }
- xPL_NameValueListPtr nvList = xPL_getMessageBody( message );
- xPL_NameValuePairPtr nvPair = NULL;
- int nvCount = xPL_getNamedValueCount(nvList);
- string multiKey;
- int multiCount = 0;
- for( int nvIndex = 0; nvIndex < nvCount; nvIndex++ )
- {
- nvPair = xPL_getNamedValuePairAt( nvList, nvIndex );
- string value = nvPair->itemValue; to_lower( value );
- string key = nvPair->itemName ; to_lower( key );
- string count = xPLCache->objectValue( "config." + source + ".options." + key + ".count" );
- if( "" != count )
- {
- if( multiKey == key )
- multiCount++;
- else
- {
- multiKey = key;
- multiCount = 0;
- }
- char buf[6];
- snprintf( buf, 6, "{%.3d}", multiCount );
- key += buf;
+ xPL_NameValueListPtr nvList = xPL_getMessageBody( message );
+ xPL_NameValuePairPtr nvPair = NULL;
+ int nvCount = xPL_getNamedValueCount(nvList);
+ std::string multiKey;
+ int multiCount = 0;
+ for( int nvIndex = 0; nvIndex < nvCount; nvIndex++ ) {
+ nvPair = xPL_getNamedValuePairAt( nvList, nvIndex );
+ std::string value = nvPair->itemValue; to_lower( value );
+ std::string key = nvPair->itemName ; to_lower( key );
+ std::string count = xPLCache->objectValue( "config." + source + ".options." + key + ".count" );
+ if( "" != count ) {
+ if( multiKey == key ) {
+ multiCount++;
+ } else {
+ multiKey = key;
+ multiCount = 0;
+ }
+ char buf[6];
+ snprintf( buf, 6, "{%.3d}", multiCount );
+ key += buf;
+ }
+ xPLCache->updateEntry( "config." + source + ".current." + key, value, false );
}
- xPLCache->updateEntry( "config." + source + ".current." + key, value, false );
- }
}
void deviceManagerClass::processHeartbeat( xPL_MessagePtr message ) const
{
- string source = string("")
- + xPL_getSourceVendor ( message ) + "-"
- + xPL_getSourceDeviceID ( message ) + "."
- + xPL_getSourceInstanceID( message );
+ std::string source = std::string("")
+ + xPL_getSourceVendor ( message ) + "-"
+ + xPL_getSourceDeviceID ( message ) + "."
+ + xPL_getSourceInstanceID( message );
- xPLDevice device = getDevice( source );
- int interval = atoi(string( xPL_getMessageNamedValue( message, "interval" ) ).c_str());
- ptime expires = second_clock::local_time() + minutes( 2*interval + 1 );
- writeLog( "deviceManagerClass::processHeartbeat("+source+") - found ["+device.VDI+"]", logLevel::debug );
+ xPLDevice device = getDevice( source );
+ int interval = atoi(std::string( xPL_getMessageNamedValue( message, "interval" ) ).c_str());
+ ptime expires = second_clock::local_time() + minutes( 2*interval + 1 );
+ writeLog( "deviceManagerClass::processHeartbeat("+source+") - found ["+device.VDI+"]", logLevel::debug );
- if( "" == device.VDI )
- {
- // this handles a new application that identifies itself with a hbeat straight away.
- // it must either be storing it's config locally, can't be configured, or is configured somewhere else.
- device.VDI = source; // vendor / device / instance = unique id
- device.ConfigDone = true; // false = new waiting check, true = sent/not required
- device.ConfigMissing = true; // true = no config file, no response from device, false = have/waiting config
- device.ConfigSource = "objectcache"; // v-d.xml / v-d.cache.xml or empty
- device.ConfigType = false; // true = config. false = hbeat.
- device.WaitingConfig = false; // false = waiting check or not needed, true = manual intervention
- device.Current = false; // asked for current config
- device.ConfigListSent = true; // Have we asked this device for it's config?
- device.Suspended = false; // lost heartbeat
- device.Interval = interval; // current heartbeat interval
- device.Expires = expires; // time expires
- update( device );
+ if( "" == device.VDI ) {
+ // this handles a new application that identifies itself with a hbeat straight away.
+ // it must either be storing it's config locally, can't be configured, or is configured somewhere else.
+ device.VDI = source; // vendor / device / instance = unique id
+ device.ConfigDone = true; // false = new waiting check, true = sent/not required
+ device.ConfigMissing = true; // true = no config file, no response from device, false = have/waiting config
+ device.ConfigSource = "objectcache"; // v-d.xml / v-d.cache.xml or empty
+ device.ConfigType = false; // true = config. false = hbeat.
+ device.WaitingConfig = false; // false = waiting check or not needed, true = manual intervention
+ device.Current = false; // asked for current config
+ device.ConfigListSent = true; // Have we asked this device for it's config?
+ device.Suspended = false; // lost heartbeat
+ device.Interval = interval; // current heartbeat interval
+ device.Expires = expires; // time expires
+ update( device );
- // Throw it a config request anyway, see what turns up..
- xPLMessage::namedValueList command_request; command_request.push_back( make_pair( "command", "request" ) );
- xPL->sendMessage( xPL_MESSAGE_COMMAND,
- xPL_getSourceVendor( message ), xPL_getSourceDeviceID( message ), xPL_getSourceInstanceID( message ),
- "config", "list" , command_request );
- /* // that code below was from the VB - but we don't need it as processConfigList will
- // itself send the config.current request...
- xPL->sendMessage( xPL_MESSAGE_COMMAND,
- xPL_getSourceVendor( message ), xPL_getSourceDeviceID( message ), xPL_getSourceInstanceID( message ),
- "config", "current", command_request );
- */
- } else {
- xPLCache->updateEntry( "device." + source + ".expires", timeConverter( expires ), false );
- }
+ // Throw it a config request anyway, see what turns up..
+ xPLMessage::namedValueList command_request; command_request.push_back( std::make_pair( "command", "request" ) );
+ xPL->sendMessage( xPL_MESSAGE_COMMAND,
+ xPL_getSourceVendor( message ), xPL_getSourceDeviceID( message ), xPL_getSourceInstanceID( message ),
+ "config", "list" , command_request );
+ /* // that code below was from the VB - but we don't need it as processConfigList will
+ // itself send the config.current request...
+ xPL->sendMessage( xPL_MESSAGE_COMMAND,
+ xPL_getSourceVendor( message ), xPL_getSourceDeviceID( message ), xPL_getSourceInstanceID( message ),
+ "config", "current", command_request );
+ */
+ } else {
+ xPLCache->updateEntry( "device." + source + ".expires", timeConverter( expires ), false );
+ }
}
void deviceManagerClass::processRemove( xPL_MessagePtr message ) const
{
- string source = string("")
- + xPL_getSourceVendor ( message ) + "-"
- + xPL_getSourceDeviceID ( message ) + "."
- + xPL_getSourceInstanceID( message );
+ std::string source = std::string("")
+ + xPL_getSourceVendor ( message ) + "-"
+ + xPL_getSourceDeviceID ( message ) + "."
+ + xPL_getSourceInstanceID( message );
- remove( source );
- removeConfig( source );
+ remove( source );
+ removeConfig( source );
}
-void deviceManagerClass::sendConfigResponse( const string& source, const bool removeOldValue ) const
+void deviceManagerClass::sendConfigResponse( const std::string& source, const bool removeOldValue ) const
{
- writeLog( "deviceManagerClass::sendConfigResponse("+source+", "+(removeOldValue?"true":"false")+")", logLevel::debug );
- boost::regex re( "config\\." + source + "\\.current\\.([a-z0-9]{1,16})(?:\\{([0-9]{1,3})\\})?" );
- vector<string> entries = xPLCache->filterByRegEx( re );
- xPLMessage::namedValueList list;
- for( vector<string>::const_iterator it = entries.begin(); it != entries.end(); ++it )
- {
- boost::smatch matches;
- boost::regex_match( *it, matches, re );
- writeLog( "deviceManagerClass::sendConfigResponse: ["+*it+"] -> ["+matches[1]+"]("+matches[2]+")",logLevel::debug );
- if( matches.size() > 1 )
- list.push_back( make_pair( matches[1], xPLCache->objectValue( *it ) ) );
- }
+ writeLog( "deviceManagerClass::sendConfigResponse("+source+", "+(removeOldValue?"true":"false")+")", logLevel::debug );
+ boost::regex re( "config\\." + source + "\\.current\\.([a-z0-9]{1,16})(?:\\{([0-9]{1,3})\\})?" );
+ std::vector<std::string> entries = xPLCache->filterByRegEx( re );
+ xPLMessage::namedValueList list;
+// for( std::vector<std::string>::const_iterator it = entries.begin(); it != entries.end(); ++it )
+ for( auto entry : entries) {
+ boost::smatch matches;
+ boost::regex_match( entry, matches, re );
+ writeLog( "deviceManagerClass::sendConfigResponse: ["+entry+"] -> ["+matches[1]+"]("+matches[2]+")",logLevel::debug );
+ if( matches.size() > 1 ) {
+ list.push_back( std::make_pair( matches[1], xPLCache->objectValue( entry ) ) );
+ }
+ }
- if( list.size() > 0 )
- {
- xPL->sendMessage( xPL_MESSAGE_COMMAND, source, "config", "response", list );
- xPLCache->updateEntry( "config." + source + ".configmissing", "false", false );
- xPLCache->updateEntry( "config." + source + ".waitingconfig", "false", false );
- xPLCache->updateEntry( "config." + source + ".configdone" , "true" , false ); // FIXME the VB code says "false"...
- }
+ if( list.size() > 0 ) {
+ xPL->sendMessage( xPL_MESSAGE_COMMAND, source, "config", "response", list );
+ xPLCache->updateEntry( "config." + source + ".configmissing", "false", false );
+ xPLCache->updateEntry( "config." + source + ".waitingconfig", "false", false );
+ xPLCache->updateEntry( "config." + source + ".configdone" , "true" , false ); // FIXME the VB code says "false"...
+ }
- if( removeOldValue )
- {
- remove( source );
- removeConfig( source );
- }
+ if( removeOldValue ) {
+ remove( source );
+ removeConfig( source );
+ }
}
-bool deviceManagerClass::storeNewConfig( const string& source, const string& config ) const
+bool deviceManagerClass::storeNewConfig( const std::string& source, const std::string& config ) const
{
- writeLog( "deviceManagerClass::storeNewConfig("+source+", "+config+")", logLevel::debug );
- if( !contains( source ) )
- return false;
+ writeLog( "deviceManagerClass::storeNewConfig("+source+", "+config+")", logLevel::debug );
+ if( !contains( source ) ) {
+ return false;
+ }
- vector<string> list;
- split( list, config, is_any_of("\r\n"), token_compress_on );
- string multiKey;
- int multiCount = 0;
- for( vector<string>::const_iterator it = list.begin(); it != list.end(); ++it )
- {
- vector<string> tags;
- split( tags, *it, is_any_of("=") );
- to_lower( tags[0] );
- to_lower( tags[1] );
- string count = xPLCache->objectValue( "config." + source + ".options." + tags[0] + ".count" );
- if( "" != count )
- {
- if( multiKey != tags[0] )
- {
- multiKey = tags[0];
- multiCount = 0;
- } else
- multiCount++;
+ std::vector<std::string> list;
+ split( list, config, is_any_of("\r\n"), token_compress_on );
+ std::string multiKey;
+ int multiCount = 0;
+// for( std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it )
+ for( auto it : list) {
+ std::vector<std::string> tags;
+ split( tags, it, is_any_of("=") );
+ to_lower( tags[0] );
+ to_lower( tags[1] );
+ std::string count = xPLCache->objectValue( "config." + source + ".options." + tags[0] + ".count" );
+ if( "" != count ) {
+ if( multiKey != tags[0] ) {
+ multiKey = tags[0];
+ multiCount = 0;
+ } else {
+ multiCount++;
+ }
- char buf[6];
- snprintf( buf, 6, "{%.3d}", multiCount );
- tags[0] += buf;
+ char buf[6];
+ snprintf( buf, 6, "{%.3d}", multiCount );
+ tags[0] += buf;
+ }
+ xPLCache->updateEntry( "config." + source + ".current." + tags[0], tags[1], false );
}
- xPLCache->updateEntry( "config." + source + ".current." + tags[0], tags[1], false );
- }
- if( xPLCache->childNodes( "config." + source + ".current" ).size() > 0 )
- {
- sendConfigResponse( source, false ); // FIXME the VB said true - but why should I delete the values that I've just stored?!?
- }
- return true;
+ if( xPLCache->childNodes( "config." + source + ".current" ).size() > 0 ) {
+ sendConfigResponse( source, false ); // FIXME the VB said true - but why should I delete the values that I've just stored?
+ }
+ return true;
}
Modified: xPLHAL/branches/thomas_s_dev/src/devicemanager.h
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/devicemanager.h 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/src/devicemanager.h 2011-10-17 21:07:20 UTC (rev 453)
@@ -20,52 +20,34 @@
#define DEVICEMANAGER_H
#include <string>
-#include <boost/date_time/posix_time/posix_time.hpp>
-using namespace std;
-using namespace boost::posix_time;
-
// this is also including the xPL.h with its data structures:
#include "xplhandler.h"
#include "xplcache.h"
#include "globals.h"
+#include "xpldevice.h"
-struct xPLDevice
-{
- string VDI; /** \brief vendor / device / instance = unique id */
- ptime Expires; /** \brief time expires */
- int Interval; /** \brief current heartbeat interval */
- bool ConfigType; /** \brief true = config. false = hbeat. */
- bool ConfigDone; /** \brief false = new waiting check, true = sent/not required */
- bool WaitingConfig; /** \brief false = waiting check or not needed, true = manual intervention */
- bool ConfigListSent; /** \brief Have we asked this device for it's config? */
- string ConfigSource; /** \brief v-d.xml / v-d.cache.xml or empty */
- bool ConfigMissing; /** \brief true = no config file, no response from device, false = have/waiting config */
- bool Suspended; /** \brief lost heartbeat */
- bool Current; /** \brief asked for current */
-};
-
class deviceManagerClass
{
public:
/** \brief Looks if the device deviceTag is known. */
- bool contains( const string& deviceTag ) const
+ bool contains( const std::string& deviceTag ) const
{ return xPLCache->childNodes( "device." + deviceTag ).size() > 0; }
/** \brief Looks if the config configTag is known. */
- bool containsConfig( const string& configTag ) const
+ bool containsConfig( const std::string& configTag ) const
{ return xPLCache->childNodes( "config." + configTag ).size() > 0; }
void add( const xPLDevice& device ) const;
- bool remove( const string& deviceTag ) const;
- bool removeConfig( const string& deviceTag ) const;
+ bool remove( const std::string& deviceTag ) const;
+ bool removeConfig( const std::string& deviceTag ) const;
/** \brief Returns the device deviceTag when it's known or an empty device */
- xPLDevice getDevice( const string& deviceTag ) const;
+ xPLDevice getDevice( const std::string& deviceTag ) const;
/** \brief Returns all known device names */
- vector<string> getAllDeviceNames() const;
+ std::vector<std::string> getAllDeviceNames() const;
void update( const xPLDevice& device ) const;
@@ -80,10 +62,10 @@
void processHeartbeat ( const xPL_MessagePtr message ) const;
void processRemove ( const xPL_MessagePtr message ) const;
- void sendConfigResponse( const string& source, const bool removeOldValue ) const;
+ void sendConfigResponse( const std::string& source, const bool removeOldValue ) const;
/** \brief A new configuration arrived via XHCP, handle it... */
- bool storeNewConfig( const string& source, const string& config ) const;
+ bool storeNewConfig( const std::string& source, const std::string& config ) const;
};
#endif // DEVICEMANAGER_H
Modified: xPLHAL/branches/thomas_s_dev/src/globals.h
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/globals.h 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/src/globals.h 2011-10-17 21:07:20 UTC (rev 453)
@@ -20,7 +20,6 @@
#define GLOBALS_H
#include "boost/filesystem.hpp"
-using namespace boost::filesystem;
/**
* Define all global variables:
@@ -41,9 +40,9 @@
extern xPLMessageQueueClass *xPLMessageQueue;
/** The working directories */
-extern path xPLHalRootFolder;
-extern path DataFileFolder;
-extern path ScriptEngineFolder;
-extern path rulesFolder;
+extern boost::filesystem::path xPLHalRootFolder;
+extern boost::filesystem::path DataFileFolder;
+extern boost::filesystem::path ScriptEngineFolder;
+extern boost::filesystem::path rulesFolder;
#endif // GLOBALS_H
Added: xPLHAL/branches/thomas_s_dev/src/i_properties.h
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/i_properties.h (rev 0)
+++ xPLHAL/branches/thomas_s_dev/src/i_properties.h 2011-10-17 21:07:20 UTC (rev 453)
@@ -0,0 +1,23 @@
+#ifndef __I_PROPERTIES_H__
+#define __I_PROPERTIES_H__
+
+//! \brief Properties Interface
+class IProperties
+{
+ public:
+ virtual ~IProperties() {};
+
+ /** \returns true if the element name exists. */
+ virtual bool hasValue(const std::string& name) const = 0;
+
+ /** \returns the value of element name if it exists - or an empty std::string otherwise. */
+ virtual std::string getValue(const std::string& name) const = 0;
+
+ /** \brief sets value of property */
+ virtual void setValue(const std::string& name, const std::string& value) = 0;
+
+ /** \brief deletes property */
+ virtual void deleteProperty(const std::string& name) = 0;
+};
+
+#endif
Modified: xPLHAL/branches/thomas_s_dev/src/main.cpp
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/main.cpp 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/src/main.cpp 2011-10-17 21:07:20 UTC (rev 453)
@@ -16,6 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <signal.h>
#include "log.h"
#include "xplcache.h"
#include "devicemanager.h"
@@ -23,6 +24,7 @@
// load globas and give them their space to live
#include "globals.h"
+using namespace boost::filesystem;
path xPLHalRootFolder;
path DataFileFolder;
@@ -34,91 +36,119 @@
xPLHandler *xPL;
xPLMessageQueueClass *xPLMessageQueue;
-//bool xPLHandlerInitialized = false;
+static boost::condition_variable g_exit_condition;
+static boost::mutex g_exit_mutex;
+static bool g_exit = false;
+void handle_signal(int signal)
+{
+ if (signal == SIGINT || signal == SIGTERM) {
+ g_exit_mutex.lock();
+ g_exit = true;
+ g_exit_condition.notify_one();
+ g_exit_mutex.unlock();
+ }
+}
+
/**
* Setup the whole program.
*/
int main(int UNUSED argc, char** UNUSED argv)
{
- /** Make sure the necessary infrastructure exists: */
- xPLHalRootFolder = initial_path();
- DataFileFolder = xPLHalRootFolder / "data";
- ScriptEngineFolder = DataFileFolder / "scripts";
- rulesFolder = DataFileFolder / "determinator";
- //vendorFileFolder = DataFileFolder / "vendors";
- //ConfigFileFolder = DataFileFolder / "configs";
+ /** Make sure the necessary infrastructure exists: */
+ xPLHalRootFolder = initial_path();
+ DataFileFolder = xPLHalRootFolder / "data";
+ ScriptEngineFolder = DataFileFolder / "scripts";
+ rulesFolder = DataFileFolder / "determinator";
+ //vendorFileFolder = DataFileFolder / "vendors";
+ //ConfigFileFolder = DataFileFolder / "configs";
- // FIXME : add exception handling for directory operations!!!
- if(false)//FIXME if( !QDir::setCurrent( xPLHalRootFolder.path() ) )
- {
- writeLog( "Error changing to working directory \"" + xPLHalRootFolder.string() + "\"!", logLevel::error );
- return -1;
- }
+ signal(SIGINT, handle_signal);
+ signal(SIGTERM, handle_signal);
- if( !exists( DataFileFolder ) )
- {
- writeLog( "Directory \"" + DataFileFolder.string() + "\" for DataFileFolder doesn't exist. Creating it...", logLevel::debug );
- if( !create_directory( DataFileFolder ) )
+ // FIXME : add exception handling for directory operations!!!
+ if(false)//FIXME if( !QDir::setCurrent( xPLHalRootFolder.path() ) )
{
- writeLog( "Error creating data directory \"" + DataFileFolder.string() + "\"!", logLevel::error );
- return -1;
+ writeLog( "Error changing to working directory \"" + xPLHalRootFolder.string() + "\"!", logLevel::error );
+ return -1;
}
- }
- if( !exists( ScriptEngineFolder ) )
- {
- writeLog( "Directory \"" + ScriptEngineFolder.string() + "\" for ScriptEngineFolder doesn't exist. Creating it...", logLevel::debug );
- if( !create_directory( ScriptEngineFolder ) )
+ if( !exists( DataFileFolder ) )
{
- writeLog( "Error creating script directory \"" + ScriptEngineFolder.string() + "\"!", logLevel::error );
- return -1;
+ writeLog( "Directory \"" + DataFileFolder.string() + "\" for DataFileFolder doesn't exist. Creating it...", logLevel::debug );
+ if( !create_directory( DataFileFolder ) )
+ {
+ writeLog( "Error creating data directory \"" + DataFileFolder.string() + "\"!", logLevel::error );
+ return -1;
+ }
}
- }
- if( !exists( rulesFolder ) )
- {
- writeLog( "Directory \"" + rulesFolder.string() + "\" for rulesFolder doesn't exist. Creating it...", logLevel::debug );
- if( !create_directory( rulesFolder ) )
+ if( !exists( ScriptEngineFolder ) )
{
- writeLog( "Error creating determinator directory \"" + rulesFolder.string() + "\"!", logLevel::error );
- return -1;
+ writeLog( "Directory \"" + ScriptEngineFolder.string() + "\" for ScriptEngineFolder doesn't exist. Creating it...", logLevel::debug );
+ if( !create_directory( ScriptEngineFolder ) )
+ {
+ writeLog( "Error creating script directory \"" + ScriptEngineFolder.string() + "\"!", logLevel::error );
+ return -1;
+ }
}
- }
- xPLMessageQueue = new xPLMessageQueueClass;
- xPLCache = new xPLCacheClass;
- XHCPServer *xhcpServer = new XHCPServer();
- xPL = new xPLHandler( boost::asio::ip::host_name() ); //xPL->start();
- deviceManager = new deviceManagerClass();
- writeLog( "started", logLevel::all );
+ if( !exists( rulesFolder ) )
+ {
+ writeLog( "Directory \"" + rulesFolder.string() + "\" for rulesFolder doesn't exist. Creating it...", logLevel::debug );
+ if( !create_directory( rulesFolder ) )
+ {
+ writeLog( "Error creating determinator directory \"" + rulesFolder.string() + "\"!", logLevel::error );
+ return -1;
+ }
+ }
- // force everyone to send their configuration so that we start up to date...
- xPLMessage::namedValueList command_request; command_request.push_back( make_pair( "command", "request" ) );
- xPL->sendBroadcastMessage( "config", "list", command_request );
+ xPLMessageQueue = new xPLMessageQueueClass;
+ xPLCache = new xPLCacheClass;
+ XHCPServer *xhcpServer = new XHCPServer();
+ xPL = new xPLHandler( boost::asio::ip::host_name() ); //xPL->start();
+ deviceManager = new deviceManagerClass();
+ writeLog( "started", logLevel::all );
- // main loop
- for( int count = 0;; ++count )
- {
- sleep( 10 );
- writeLog( "main: run events", logLevel::all ); // run events
+ // force everyone to send their configuration so that we start up to date...
+ xPLMessage::namedValueList command_request; command_request.push_back( std::make_pair( "command", "request" ) );
+ xPL->sendBroadcastMessage( "config", "list", command_request );
- if( 0 == count%6 )
+ // main loop
+ for( int count = 0;; ++count )
{
- writeLog( "main: <tick>", logLevel::all );
- writeLog( "xPLCache:\n" + xPLCache->listAllObjects(), logLevel::debug );
+ {
+ boost::mutex::scoped_lock lock(g_exit_mutex);
+ if (g_exit) break;
+ boost::system_time const wait_until = boost::get_system_time() + boost::posix_time::seconds(10);
+ g_exit_condition.timed_wait(lock, wait_until);
+ if (g_exit) break;
+ }
+
+ writeLog( "main: run events", logLevel::all ); // run events
+
+ if( 0 == count%6 )
+ {
+ writeLog( "main: <tick>", logLevel::all );
+ writeLog( "xPLCache:\n" + xPLCache->listAllObjects(), logLevel::debug );
+ }
+ if( 30 == count ) // every 5 minutes
+ {
+ writeLog( "main: flush cache", logLevel::all );
+ xPLCache->flushExpiredEntries(); // flush cache
+ count = 0;
+ }
}
- if( 30 == count ) // every 5 minutes
- {
- writeLog( "main: flush cache", logLevel::all );
- xPLCache->flushExpiredEntries(); // flush cache
- count = 0;
- }
- }
+
+ writeLog( "main: shutdown xPLHal", logLevel::all );
- // clean up
- delete xhcpServer;
- delete deviceManager;
- delete xPLCache;
- delete xPL;
+ // clean up
+ delete xhcpServer;
+ writeLog( "main: xhcp shutdown", logLevel::all );
+ delete deviceManager;
+ writeLog( "main: deviceManager shutdown", logLevel::all );
+ delete xPLCache;
+ writeLog( "main: xPLCache shutdown", logLevel::all );
+ delete xPL;
+ writeLog( "main: xPL shutdown", logLevel::all );
}
Modified: xPLHAL/branches/thomas_s_dev/src/xhcp.cpp
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/xhcp.cpp 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/src/xhcp.cpp 2011-10-17 21:07:20 UTC (rev 453)
@@ -21,26 +21,50 @@
#include "xhcp.h"
+using boost::asio::ip::tcp;
+
XHCPServer::XHCPServer()
: acceptor(io_service, tcp::endpoint(tcp::v4(), 3865)),
- m_stoprequested(false),
+ m_stoprequested(false),
m_thread(boost::bind(&XHCPServer::waitForConnection, this))
-{}
+{
+ startAccept();
+}
-void XHCPServer::waitForConnection( void )
+XHCPServer::~XHCPServer()
{
- writeLog( "XHCPServer::waitForConnection", logLevel::debug );
- while (!m_stoprequested)
- {
- std::cerr << "for(;;) start \n";
+ m_stoprequested = true;
+ acceptor.cancel();
+ acceptor.close();
+ io_service.stop();
+ m_thread.join();
+}
+
+void XHCPServer::startAccept()
+{
socket_ptr sockPtr(new tcp::socket(io_service));
- std::cerr << "for(;;) 1 \n";
- acceptor.accept(*sockPtr);
- std::cerr << "for(;;) 2 \n";
- //boost::thread t(boost::bind(&XHCPServer::session, this, sock));
- std::cerr << "for(;;) use_count: " << sockPtr.use_count() << "\n";
+ acceptor.async_accept(*sockPtr, boost::bind(&XHCPServer::handleAccept, this, sockPtr));
+}
+
+void XHCPServer::handleAccept(socket_ptr sockPtr)
+{
+ startAccept();
XHCPThread* foo = new XHCPThread( sockPtr );
- std::cerr << "for(;;) foo: " << int(foo) << "\n";
- std::cerr << "for(;;) end \n";
- }
}
+
+void XHCPServer::waitForConnection( void )
+{
+ writeLog( "XHCPServer::waitForConnection", logLevel::debug );
+ io_service.run();
+ /*
+ while (!m_stoprequested)
+ {
+ socket_ptr sockPtr(new tcp::socket(io_service));
+ writeLog("XHCPServer::waitForConnection in accept", logLevel::debug);
+ acceptor.accept(*sockPtr);
+ writeLog("XHCPServer::waitForConnection left accept", logLevel::debug);
+
+ XHCPThread* foo = new XHCPThread( sockPtr );
+ }
+ */
+}
Modified: xPLHAL/branches/thomas_s_dev/src/xhcp.h
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/xhcp.h 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/src/xhcp.h 2011-10-17 21:07:20 UTC (rev 453)
@@ -23,8 +23,8 @@
#include <boost/thread.hpp>
#include "xplcache.h"
+#include "xhcpthread.h"
-using boost::asio::ip::tcp;
/**
* \brief Manage all XHCP connetions.
@@ -32,21 +32,19 @@
class XHCPServer
{
boost::asio::io_service io_service;
- tcp::acceptor acceptor;
+ boost::asio::ip::tcp::tcp::acceptor acceptor;
volatile bool m_stoprequested;
boost::thread m_thread;
public:
XHCPServer();
- ~XHCPServer()
- {
- m_stoprequested = true;
- m_thread.join();
- }
+ ~XHCPServer();
protected:
/** \brief Create a new XHCPThread for a new connection. */
void waitForConnection( void );
+ void handleAccept(socket_ptr sockPtr);
+ void startAccept();
};
#endif // XHCP_H
Modified: xPLHAL/branches/thomas_s_dev/src/xhcpthread.cpp
===================================================================
--- xPLHAL/branches/thomas_s_dev/src/xhcpthread.cpp 2011-10-17 20:29:50 UTC (rev 452)
+++ xPLHAL/branches/thomas_s_dev/src/xhcpthread.cpp 2011-10-17 21:07:20 UTC (rev 453)
@@ -28,13 +28,15 @@
#include "xhcpthread.h"
using namespace boost::algorithm;
+using boost::asio::ip::tcp;
XHCPThread::XHCPThread( socket_ptr socket )
: m_stoprequested(false), tab( "\t" ), newLine( "\r\n" ), endMultiLine( ".\r\n" ),
sock( socket ), quit( false ),
inMultilineRequest( false ), multilineRequestHandler( 0 ),
m_thread(boost::bind(&XHCPThread::run, this))
-{}
+{
+}
XHCPThread::~XHCPThread()
{
@@ -50,17 +52,17 @@
*/
bool endDifferent( std::string str, std::string end )
{
- size_t str_l = str.size();
- size_t end_l = end.size();
- if( str_l < end_l ) return true;
- return str.compare( str_l-end_l, end_l, end );
+ size_t str_l = str.size();
+ size_t end_l = end.size();
+ if( str_l < end_l ) return true;
+ ...
[truncated message content] |
|
From: <tho...@us...> - 2011-10-17 20:29:56
|
Revision: 452
http://openautomation.svn.sourceforge.net/openautomation/?rev=452&view=rev
Author: thomas_s
Date: 2011-10-17 20:29:50 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
Added development branch
Added Paths:
-----------
xPLHAL/branches/thomas_s_dev/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-16 01:35:32
|
Revision: 451
http://openautomation.svn.sourceforge.net/openautomation/?rev=451&view=rev
Author: makki1
Date: 2011-10-16 01:35:25 +0000 (Sun, 16 Oct 2011)
Log Message:
-----------
russconnectd: change udp-socket and fragmented msg-parsing to work with socat (WiP)
Modified Paths:
--------------
tools/russconnectd/trunk/ChangeLog
tools/russconnectd/trunk/README
tools/russconnectd/trunk/configure.ac
tools/russconnectd/trunk/debian/control
tools/russconnectd/trunk/src/main.c
Modified: tools/russconnectd/trunk/ChangeLog
===================================================================
--- tools/russconnectd/trunk/ChangeLog 2011-10-15 21:34:46 UTC (rev 450)
+++ tools/russconnectd/trunk/ChangeLog 2011-10-16 01:35:25 UTC (rev 451)
@@ -1,2 +1,6 @@
+*** 0.2 - 2011-10-15
+- global UDP-socket sending with listen port as source to make socat happy
+- parse partial/fragmented messages from Russound
-
+*** 0.1
+- initial release, see README
\ No newline at end of file
Modified: tools/russconnectd/trunk/README
===================================================================
--- tools/russconnectd/trunk/README 2011-10-15 21:34:46 UTC (rev 450)
+++ tools/russconnectd/trunk/README 2011-10-16 01:35:25 UTC (rev 451)
@@ -27,10 +27,14 @@
*** TODO:
- see various TODO/FIXME in source
- reconnection/error-handling if network-problems occur (mainly eibd?)
-- prettify code
-- fix dependency on uclibc++ on OpenWRT
+- prettify code / split main.c
+- fix dependency on uclibc++ (?) in OpenWRT Makefile
+- change russ UDP-socket to be shared for send/receive with listening (-l) sourceport for outgoing
+ (makes usage with socat udp-recvfrom easier)
+- supply examples for socat
+- directly connect serialport
*** Outlook
-- *maybe* make much more modular and other interfaces (simple UDP/TCP server)
+- *maybe* make much more modular and other interfaces (simple UDP/TCP server like C0 Z1 VolUp?)
- don't depend on libeibclient then
-- *maybe* add outgoing interfaces for mpd,vdr,.. to stick multiroom togehter
+- *maybe* add outgoing interfaces for KNX-> mpd,vdr,.. to stick multiroom togehter
Modified: tools/russconnectd/trunk/configure.ac
===================================================================
--- tools/russconnectd/trunk/configure.ac 2011-10-15 21:34:46 UTC (rev 450)
+++ tools/russconnectd/trunk/configure.ac 2011-10-16 01:35:25 UTC (rev 451)
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
dnl Created by Anjuta application wizard.
-AC_INIT(russconnectd, 0.1)
+AC_INIT(russconnectd, 0.2, de...@wi..., , http://openautomation.sourceforge.net)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
Modified: tools/russconnectd/trunk/debian/control
===================================================================
--- tools/russconnectd/trunk/debian/control 2011-10-15 21:34:46 UTC (rev 450)
+++ tools/russconnectd/trunk/debian/control 2011-10-16 01:35:25 UTC (rev 451)
@@ -2,7 +2,7 @@
Section: unknown
Priority: extra
Maintainer: Michael Markstaller <de...@wi...>
-Build-Depends: debhelper (>= 7.0), autotools-dev
+Build-Depends: debhelper (>= 5.0), autotools-dev
Standards-Version: 3.9.1
Homepage: <insert the upstream URL, if relevant>
#Vcs-Git: git://git.debian.org/collab-maint/russconnectd.git
Modified: tools/russconnectd/trunk/src/main.c
===================================================================
--- tools/russconnectd/trunk/src/main.c 2011-10-15 21:34:46 UTC (rev 450)
+++ tools/russconnectd/trunk/src/main.c 2011-10-16 01:35:25 UTC (rev 451)
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
@@ -39,7 +38,7 @@
#define DEBUG 1
#define DAEMON_NAME "russconnectd"
-#define USAGESTRING "\n\t-d\tRun as daemon/No debug output\n\t-p <pidfile>\tPID-filename\n\t-i <ip:port>\tIP-Address:Port to send UDP-packets to russound\n\t-l <UDP-port>\tUDP port to listen on\n\t-a <KNX address>\tKNX start-address (see README)\n\t-z <number>\tNumber of Zones to support\n\t-u <eib url>\tURL to conatct eibd like localo:/tmp/eib or ip:192.168.0.101\n"
+#define USAGESTRING "\n\t-d\tRun as daemon/No debug output\n\t-p <pidfile>\tPID-filename\n\t-i <ip:port>\tIP-Address:Port to send UDP-packets to russound\n\t-l <UDP-port>\tUDP port to listen on\n\t-a <KNX address>\tKNX start-address (see README)\n\t-z <number>\tNumber of Zones to support\n\t-u <eib url>\tURL to conatct eibd like localo:/tmp/eib or ip:192.168.0.101\n"
#define NUM_THREADS 2
#define MAX_ZONES 31
#define RETRY_TIME 5
@@ -81,8 +80,14 @@
int pidFilehandle;
char *pidfilename = "/var/run/russconnectd.pid";
+//FIXME: also handle serial-port directly?
+struct sockaddr_in si_me, si_other;
+int udpSocket;
+socklen_t slen=sizeof(si_other);
+
void daemonShutdown() {
//FIXME: clean exit pthread_exit(NULL); pthread_cancel(..);
+ close(udpSocket);
syslog(LOG_INFO, "%s daemon exiting", DAEMON_NAME);
fprintf(stderr, "%s daemon exiting", DAEMON_NAME);
close(pidFilehandle);
@@ -110,6 +115,18 @@
}
char *russChecksum(char* buf, int len) {
+ //FIXME: handle invert character
+ /* The Invert Character is used in special cases as part of the Message Body. If the data in an
+ RNETTM message body includes any byte values that have the MSB set to 1 (they have a Hex
+ value greater than 0x7F) the byte will be rejected as only the lower 7 bits are used to hold data.
+ In order to allow values greater than 0x7F to be accepted, the byte must first be bitwise inverted
+ (e.g., 10010101 = 01101010), and the special Invert Character (0xF1) is inserted just prior to
+ the inverted byte. When an RNETTM packet is received, the system must detect the 0xF1 invert
+ character. The 0xF1 character is then discarded and the following byte is inverted back to its
+ original value (e.g., 01101010 = 10010101).
+ F1 = Special Invert Character
+ 6A = Inverted Character (actual value 0x95)
+ */
int i,j=0;
for (i=0;i<len;i++)
j+=buf[i];
@@ -120,52 +137,28 @@
void *sendrussPolling(unsigned char zone) {
syslog(LOG_DEBUG, "polling zone %d",zone);
- struct sockaddr_in si_other;
- int s, slen=sizeof(si_other);
- if ((s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1)
- syslog(LOG_WARNING,"socket failed!");
- memset((char *) &si_other, 0, sizeof(si_other));
- si_other.sin_family = AF_INET;
- si_other.sin_port = htons(russport);
- if (inet_aton(russipaddr, &si_other.sin_addr)==0) {
- syslog(LOG_WARNING, "inet_aton() for %s failed", russipaddr);
- daemonShutdown();
- }
-
char buf_onvol[25] = { 0xF0, 0, 0, 0x7F, 0, 0, RUSS_KEYPAD_ID, 0x01, 0x05, 0x02, 0, 0, 0, 0x04, 0, 0, 0, 0xF7 };
buf_onvol[1] = zone/ZONES_PER_CONTROLLER;
buf_onvol[11] = zone%ZONES_PER_CONTROLLER;
buf_onvol[16] = (int) russChecksum (buf_onvol,18-2);
- if (sendto(s, buf_onvol, 18, 0, (struct sockaddr *) &si_other, slen)==-1)
+ if (sendto(udpSocket, buf_onvol, 18, 0, (struct sockaddr *) &si_other, slen)==-1)
syslog(LOG_WARNING,"sendto failed!");
- usleep(20*1000); //throttle a little (20ms)
+ usleep(20*1000); //FIXME: throttle a little (20ms)
char buf_getzone[25] = { 0xF0, 0, 0, 0x7F, 0, 0, RUSS_KEYPAD_ID, 0x01, 0x04, 0x02, 0, 0, 0x07, 0, 0, 0, 0xF7 };
buf_getzone[1] = zone/ZONES_PER_CONTROLLER;
buf_getzone[11] = zone%ZONES_PER_CONTROLLER;
- buf_getzone[15] = (int) russChecksum (buf_onvol,17-2);
- if (sendto(s, buf_getzone, 17, 0, (struct sockaddr *) &si_other, slen)==-1)
+ buf_getzone[15] = (int) russChecksum (buf_getzone,17-2);
+ if (sendto(udpSocket, buf_getzone, 17, 0, (struct sockaddr *) &si_other, slen)==-1)
syslog(LOG_WARNING,"sendto failed!");
- usleep(50*1000); //throttle a little (20ms)
- close(s);
+ usleep(50*1000); //FIXME: throttle a little (50ms)
return 0;
}
void *sendrussFunc(int controller, int zone, int func, int val) {
- struct sockaddr_in si_other;
- int s, slen=sizeof(si_other);
syslog(LOG_DEBUG,"write ctrl %d zone %d func %d val 0x%02X",controller,zone,func,val);
- if ((s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1)
- syslog(LOG_WARNING,"sendrussfunc: socket failed!");
- memset((char *) &si_other, 0, sizeof(si_other));
- si_other.sin_family = AF_INET;
- si_other.sin_port = htons(russport);
- if (inet_aton(russipaddr, &si_other.sin_addr)==0) {
- syslog(LOG_WARNING, "sendrussfunc: inet_aton() for %s failed", russipaddr);
- daemonShutdown();
- }
-
+
//TODO: send on-telegram to actuator
char buf_msg1[25] = { 0, 0, 0, 0x7F, 0, 0, RUSS_KEYPAD_ID, 0x05, 0x02, 0x02, 0, 0, 0xF1, 0x23, 0, 0, 0, 0, 0, 0x01, 0, 0xF7 };
buf_msg1[1] = controller;
@@ -258,15 +251,14 @@
buf_msg2[22] = (int) russChecksum (buf_msg2,24-2);
if (buf_msg1[0])
- if (sendto(s, buf_msg1, 22, 0, (struct sockaddr *) &si_other, slen)==-1)
+ if (sendto(udpSocket, buf_msg1, 22, 0, (struct sockaddr *) &si_other, slen)==-1)
syslog(LOG_WARNING,"sendrussfunc sendto failed!");
if (buf_msg2[0])
- if (sendto(s, buf_msg2, 24, 0, (struct sockaddr *) &si_other, slen)==-1)
+ if (sendto(udpSocket, buf_msg2, 24, 0, (struct sockaddr *) &si_other, slen)==-1)
syslog(LOG_WARNING,"sendrussfunc sendto failed!");
- usleep(20*1000); //throttle a little (20ms)
+ usleep(20*1000); //FIXME: throttle a little (20ms)
if (buf_msg1[0] || buf_msg2[0])
sendrussPolling (zone+(controller*ZONES_PER_CONTROLLER)); //fire update of states
- close(s);
return 0;
}
@@ -275,7 +267,7 @@
EIBConnection *con;
unsigned char buf[255] = { 0, 0x80 };
buf[1] = type; //0x40 response, 0x80 write
- syslog(LOG_DEBUG,"send knx dgram t %d d %d dest %d val %d",type,dpt,dest,val);
+ syslog(LOG_DEBUG,"Send KNX dgram Type %d DPT %d dest %d val %d",type,dpt,dest,val);
con = EIBSocketURL (eibd_url);
if (!con)
syslog(LOG_WARNING,"sendknxdgram: Open failed");
@@ -537,77 +529,109 @@
void *russhandler()
{
- //FIXME: also handle serial-port directly?
- struct sockaddr_in si_me, si_other;
- int s, i;
- socklen_t slen=sizeof(si_other);
+ int i;
unsigned char buf[BUFLEN];
+ unsigned char prevbuf[BUFLEN];
+ int prevlen = 0;
syslog(LOG_DEBUG, "Russound reader thread started");
while (1) {
- if ((s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1) {
- syslog(LOG_WARNING, "russ: Socket failed");
+ int len = recvfrom(udpSocket, buf, BUFLEN, 0, (struct sockaddr *) &si_other, &slen);
+ if (len==-1) {
+ syslog(LOG_WARNING, "russ: recvfrom failed");
sleep(RETRY_TIME);
+ break;
+ }
+ /* Stick together fragmented telegrams, start is F0, end is F7
+ */
+ //FIXME: we assume either complete telegrams or fragmented but no overlapping messages in sep. udp dgrams!
+
+ //DEBUG
+ //for (i=0; i<len; i++)
+ // printf("PRE-parse: %d:0x%02X ",i,buf[i]);
+ printf( "PRE-Parse: %d -> ",len);
+ for (i=0; i<len; i++)
+ printf( "0x%02X ",buf[i]);
+ printf( "\n");
+ //END DEBUG code
+ if ((len + prevlen) > BUFLEN) {
+ syslog(LOG_INFO, "Message too large: %d + %d !!",len,prevlen);
+ prevlen=0;
continue;
}
- memset(&si_me, 0, sizeof(si_me));
- si_me.sin_family = AF_INET;
- si_me.sin_port = htons(listenport);
- si_me.sin_addr.s_addr = htonl(INADDR_ANY);
- if (bind(s, (struct sockaddr *) &si_me, sizeof(si_me))==-1) {
- syslog(LOG_WARNING, "russ: Bind failed");
- sleep(RETRY_TIME);
+
+ if (buf[0] == 0xF0 && buf[len-1] == 0xF7) { // complete message
+ syslog(LOG_DEBUG, "----> COMPLETE <---- message received, size %d \n", len);
+ } else if (buf[0] == 0xF0) { // start of new message
+ printf("..START..\n");
+ prevlen = len;
+ memcpy(prevbuf,buf,len);
continue;
+ } else if (prevlen > 0 && prevbuf[0] == 0xF0 && buf[len-1] == 0xF7) { // message complete
+ printf("..complete..%d %d\n",prevlen,len);
+ memcpy(prevbuf+prevlen,buf,len);
+ len += prevlen;
+ prevlen = 0;
+ memcpy(buf,prevbuf,len);
+ } else if (prevlen > 0 && prevbuf[0] == 0xF0) { //continuation message
+ printf("..continue..%d %d\n",prevlen,len);
+ memcpy(prevbuf+prevlen,buf,len);
+ prevlen += len;
+ continue;
+ } else { //DUNNO!!
+ syslog(LOG_DEBUG,"---> DUNNO <--- !!! resetting message buffers!");
+ prevlen = 0;
+ prevbuf[0] = 0x0;
+ continue;
}
- while (1) {
- int len = recvfrom(s, buf, BUFLEN, 0, (struct sockaddr *) &si_other, &slen);
- //TODO: Checksum calculation / check of russound-message
- if (len==-1) {
- syslog(LOG_WARNING, "russ: recvfrom failed");
- sleep(RETRY_TIME);
- break;
- } else if ((len==34) && (buf[0]==0xF0) && (buf[9]==0x04)) { //zone-status
-// syslog(LOG_DEBUG,"russ Controller:%d Zone:%d Status:%d src:%d vol:%d bass:%d treb:%d loud:%d bal:%d sys:%d shrsrc:%d party:%d,DnD:%d\n",
-// buf[4],buf[12],buf[20],buf[21],buf[22],buf[23],buf[24],buf[25],buf[26],buf[27],buf[28],buf[29],buf[30]);
- buf[12] = (buf[4]*ZONES_PER_CONTROLLER)+buf[12]; //controller + zonenumber
- if (buf[20] != zones[buf[12]].zonepower)
- updateZone(buf[12],buf[20],1);
- if (buf[21] != zones[buf[12]].srcid)
- updateZone(buf[12],buf[21],2);
- if (buf[22] != zones[buf[12]].volume)
- updateZone(buf[12],buf[22],3);
- if (buf[23] != zones[buf[12]].bass)
- updateZone(buf[12],buf[23],4);
- if (buf[24] != zones[buf[12]].treble)
- updateZone(buf[12],buf[24],5);
- if (buf[25] != zones[buf[12]].loudness)
- updateZone(buf[12],buf[25],6);
- if (buf[26] != zones[buf[12]].balance)
- updateZone(buf[12],buf[26],7);
- if (buf[29] != zones[buf[12]].partymode)
- updateZone(buf[12],buf[29],8);
- if (buf[30] != zones[buf[12]].dnd)
- updateZone(buf[12],buf[30],9);
- zones[buf[12]].inited = 1;
- } else if ((len==24) && (buf[0]==0xF0) && (buf[9]==0x05) && (buf[13]==0x00)) { //zone turn-on volume
- //FIXME: this *might* be wrong andf trigger also on other msgs, as it's written otherwise in the docs, the checked bytes are just a guess!
-// syslog(LOG_DEBUG,"russ Controller:%d Zone:%d TurnOnVolume:%d",
-// buf[4],buf[12],buf[21]);
- buf[12] = (buf[4]*ZONES_PER_CONTROLLER)+buf[12]; //controller + zonenumber
- if (buf[21] != zones[buf[12]].onvolume)
- updateZone(buf[12],buf[21],10);
- } else {
- //FIXME: just for debugging
- for (i=0; i<len; i++)
- printf("%d:0x%02X ",i,buf[i]);
- printf(" unknown len: %d\n",len);
- for (i=0; i<len; i++)
- printf("0x%02X ",buf[i]);
- printf("\n");
- }
+ //DEBUG
+ printf( "POST-Parse: %d -> ",len);
+ for (i=0; i<len; i++)
+ printf( "0x%02X ",prevbuf[i]);
+ printf( "\n");
+ //END DEBUG code
+
+ //TODO: Checksum calculation / check of russound-message
+ if ((len==34) && (buf[0]==0xF0) && (buf[9]==0x04)) { //zone-status
+ syslog(LOG_DEBUG,"russ Controller:%d Zone:%d Status:%d src:%d vol:%d bass:%d treb:%d loud:%d bal:%d sys:%d shrsrc:%d party:%d,DnD:%d\n",
+ buf[4],buf[12],buf[20],buf[21],buf[22],buf[23],buf[24],buf[25],buf[26],buf[27],buf[28],buf[29],buf[30]);
+ buf[12] = (buf[4]*ZONES_PER_CONTROLLER)+buf[12]; //controller + zonenumber
+ if (buf[20] != zones[buf[12]].zonepower)
+ updateZone(buf[12],buf[20],1);
+ if (buf[21] != zones[buf[12]].srcid)
+ updateZone(buf[12],buf[21],2);
+ if (buf[22] != zones[buf[12]].volume)
+ updateZone(buf[12],buf[22],3);
+ if (buf[23] != zones[buf[12]].bass)
+ updateZone(buf[12],buf[23],4);
+ if (buf[24] != zones[buf[12]].treble)
+ updateZone(buf[12],buf[24],5);
+ if (buf[25] != zones[buf[12]].loudness)
+ updateZone(buf[12],buf[25],6);
+ if (buf[26] != zones[buf[12]].balance)
+ updateZone(buf[12],buf[26],7);
+ if (buf[29] != zones[buf[12]].partymode)
+ updateZone(buf[12],buf[29],8);
+ if (buf[30] != zones[buf[12]].dnd)
+ updateZone(buf[12],buf[30],9);
+ zones[buf[12]].inited = 1;
+ } else if ((len==24) && (buf[0]==0xF0) && (buf[9]==0x05) && (buf[13]==0x00)) { //zone turn-on volume
+ //FIXME: this *might* be wrong andf trigger also on other msgs, as it's written otherwise in the docs, the checked bytes are just a guess!
+ syslog(LOG_DEBUG,"russ Controller:%d Zone:%d TurnOnVolume:%d",
+ buf[4],buf[12],buf[21]);
+ buf[12] = (buf[4]*ZONES_PER_CONTROLLER)+buf[12]; //controller + zonenumber
+ if (buf[21] != zones[buf[12]].onvolume)
+ updateZone(buf[12],buf[21],10);
+ } else {
+ //FIXME: just for debugging
+ for (i=0; i<len; i++)
+ printf("%d:0x%02X ",i,buf[i]);
+ printf(" unknown len: %d\n",len);
+ for (i=0; i<len; i++)
+ printf("0x%02X ",buf[i]);
+ printf("\n");
}
- syslog(LOG_WARNING,"russ: closed socket"); //break in read-loop
- close(s);
}
+ syslog(LOG_WARNING,"russ: closed socket"); //break in read-loop
pthread_exit(NULL);
}
@@ -624,6 +648,34 @@
return 0;
}
+int openUDPsocket() {
+ if ((udpSocket=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1) {
+ syslog(LOG_WARNING, "openUDPsock: Socket failed");
+ //TODO: handle error;
+ return 1;
+ }
+ memset(&si_me, 0, sizeof(si_me));
+ si_me.sin_family = AF_INET;
+ si_me.sin_port = htons(listenport);
+ si_me.sin_addr.s_addr = htonl(INADDR_ANY);
+
+ memset((char *) &si_other, 0, sizeof(si_other));
+ si_other.sin_family = AF_INET;
+ si_other.sin_port = htons(russport);
+ if (inet_aton(russipaddr, &si_other.sin_addr)==0) {
+ syslog(LOG_WARNING, "inet_aton() for %s failed", russipaddr);
+ daemonShutdown();
+ }
+
+ if (bind(udpSocket, (struct sockaddr *) &si_me, sizeof(si_me))==-1) {
+ syslog(LOG_WARNING, "russ: Bind failed");
+ //sleep(RETRY_TIME);
+ //TODO: handle error;
+ return 2;
+ }
+ return 0;
+}
+
int main(int argc, char **argv) {
int daemonize = 0;
int c;
@@ -721,6 +773,10 @@
sprintf(pidstr,"%d\n",getpid());
c = write(pidFilehandle, pidstr, strlen(pidstr));
+ if (openUDPsocket() != 0) {
+ syslog(LOG_INFO, "Failed to create UDP socket, exiting");
+ exit(EXIT_FAILURE);
+ }
int knxthread,russthread;
pthread_t threads[NUM_THREADS];
// PTHREAD_CREATE_DETACHED?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 21:34:52
|
Revision: 450
http://openautomation.svn.sourceforge.net/openautomation/?rev=450&view=rev
Author: mayerch
Date: 2011-10-15 21:34:46 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Show format attribute of the infotrigger in the editor
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 21:25:26 UTC (rev 449)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 21:34:46 UTC (rev 450)
@@ -747,7 +747,8 @@
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
align: { type: 'string' , required: false },
- infoposition: { type: 'numeric' , required: false }
+ infoposition: { type: 'numeric' , required: false },
+ format: { type: 'string' , required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 21:25:32
|
Revision: 449
http://openautomation.svn.sourceforge.net/openautomation/?rev=449&view=rev
Author: mayerch
Date: 2011-10-15 21:25:26 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Show infoposition attribute of the infotrigger in the editor
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 16:00:41 UTC (rev 448)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 21:25:26 UTC (rev 449)
@@ -746,7 +746,8 @@
downvalue: { type: 'string' , required: false },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ align: { type: 'string' , required: false },
+ infoposition: { type: 'numeric' , required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 16:00:47
|
Revision: 448
http://openautomation.svn.sourceforge.net/openautomation/?rev=448&view=rev
Author: makki1
Date: 2011-10-15 16:00:41 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Add some missing links for DPT sub-types (incomplete; see Artifact 3424149)
Modified Paths:
--------------
CometVisu/trunk/visu/transforms/transform_knx.js
Modified: CometVisu/trunk/visu/transforms/transform_knx.js
===================================================================
--- CometVisu/trunk/visu/transforms/transform_knx.js 2011-10-15 11:03:10 UTC (rev 447)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2011-10-15 16:00:41 UTC (rev 448)
@@ -33,6 +33,18 @@
'1': {
link : '1.001'
},
+ '1.002': {
+ link : '1.001'
+ },
+ '1.003': {
+ link : '1.001'
+ },
+ '1.008': {
+ link : '1.001'
+ },
+ '1.009': {
+ link : '1.001'
+ },
'2': {
link : '1.001'
@@ -185,6 +197,18 @@
'9.004': {
link : '9.001'
},
+ '9.007': {
+ link : '9.001'
+ },
+ '9.008': {
+ link : '9.001'
+ },
+ '9.020': {
+ link : '9.001'
+ },
+ '9.021': {
+ link : '9.001'
+ },
'9': {
link : '9.001'
},
@@ -407,4 +431,4 @@
}
}
}
-}
\ No newline at end of file
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 11:03:17
|
Revision: 447
http://openautomation.svn.sourceforge.net/openautomation/?rev=447&view=rev
Author: mayerch
Date: 2011-10-15 11:03:10 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Whitespace clean up (DON'T USE TABS!)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 10:48:18 UTC (rev 446)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-10-15 11:03:10 UTC (rev 447)
@@ -351,11 +351,11 @@
}
},
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 }
+ 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 }
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -384,11 +384,11 @@
if( $p.attr('button1label') )
{
//buttonCount++;
- var actor = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
-
+ 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( {
@@ -396,18 +396,18 @@
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'value' : $p.attr('button1value'),
- 'align' : $p.attr('align'),
- 'type' : 'switch'
+ 'align' : $p.attr('align'),
+ 'type' : 'switch'
} ).bind( 'click', this.action );
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 += '">';
+ 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( {
@@ -415,18 +415,18 @@
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'value' : $p.attr('button2value'),
- 'type' : 'switch',
- 'align' : $p.attr('align')
+ 'type' : 'switch',
+ 'align' : $p.attr('align')
} ).bind( 'click', this.action );
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 += '">';
+ 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( {
@@ -434,17 +434,17 @@
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
'value' : $p.attr('button3value'),
- 'type' : 'switch'
+ 'type' : 'switch'
} ).bind( 'click', this.action );
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 += '">';
+ 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( {
@@ -453,7 +453,7 @@
'styling' : $p.attr('styling'),
'value' : $p.attr('button4value'),
'type' : 'switch',
- } ).bind( 'click', this.action );
+ } ).bind( 'click', this.action );
buttons.append( $actor );
if( 1 == buttonCount++ % 2 ) buttons.append( $('<br/>') );
}
@@ -510,10 +510,10 @@
ga_list.push( src )
address[ '_' + src ] = [ transform, readonly=='true' ];
});
- var actor = '<div class="actor switchUnpressed '
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
+ 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>';
@@ -525,7 +525,7 @@
'mapping' : $(page).attr('mapping'),
'styling' : $(page).attr('styling'),
'type' : 'trigger',
- 'align' : $p.attr('align'),
+ 'align' : $p.attr('align'),
'sendValue': value
} ).bind( 'click', this.action );
ret_val.append( label ).append( $actor );
@@ -543,7 +543,7 @@
value: { type: 'string' , required: true },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false },
+ align: { type: 'string' , required: false },
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -643,93 +643,93 @@
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget switch" />');
-
- // handle label
- var labelElement = $p.find('label')[0];
+
+ // 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 = {};
- var addrread = {};
- $p.find('address').each( function(){
+ var address = {};
+ var addrread = {};
+ $p.find('address').each( function(){
var src = this.textContent;
var transform = this.getAttribute('transform');
var readonly = this.getAttribute('readonly');
ga_list.push( src )
if (readonly=='true') {
- addrread[ '_' + src ] = [ transform, readonly=='true' ];
- } else {
- address[ '_' + src ] = [ transform, readonly=='true' ];
- };
+ addrread[ '_' + src ] = [ transform, readonly=='true' ];
+ } else {
+ address[ '_' + src ] = [ transform, readonly=='true' ];
+ };
});
-
- // create buttons + info
+
+ // 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>';
+
+ 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'),
- 'type' : 'switch'
+ 'align' : $p.attr('align'),
+ 'type' : 'switch'
} ).bind( 'click', this.action );
-
+
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>';
+ 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'),
- 'type' : 'switch'
+ 'align' : $p.attr('align'),
+ 'type' : 'switch'
} ).bind( 'click', this.action );
-
+
var actorinfo = '<div class="actor switchInvisible"><div class="value">-</div></div>';
var $actorinfo = $(actorinfo).data({
'address' : addrread,
'format' : $p.attr('format'),
'mapping' : $p.attr('mapping'),
'styling' : $p.attr('styling'),
- 'align' : $p.attr('align'),
+ 'align' : $p.attr('align'),
});
- for( var addr in addrread ) $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 );
- }
-
+ for( var addr in addrread ) $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;
+ return ret_val;
},
-
+
update: function(e,d) {
var element = $(this);
var value = defaultUpdate( e, d, element );
- element.addClass('switchInvisible');
+ element.addClass('switchInvisible');
},
action: function() {
var data = $(this).data();
@@ -746,7 +746,7 @@
downvalue: { type: 'string' , required: false },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ align: { type: 'string' , required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -768,72 +768,72 @@
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 );
+ 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.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.content) {
+ ret_val.filter(".popup").append( $('<div class="main" />').append(attributes.content));
+ }
- if( attributes.width ) {
- ret_val.width( attributes.width );
- reposition = true;
- }
+ if( attributes.width ) {
+ ret_val.width( attributes.width );
+ reposition = true;
+ }
- if( attributes.height ) {
- ret_val.height( attributes.height );
- 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;
- })
+ 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.css( 'display', 'block' );
- return ret_val;
- },
+ 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
- }
+ 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')) );
@@ -966,7 +966,7 @@
if( element.data( 'align' ) )
element.addClass(element.data( 'align' ) );
-
+
if( element.data( 'precision' ) )
value = Number( value ).toPrecision( element.data( 'precision' ) );
if( element.data( 'format' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 10:48:24
|
Revision: 446
http://openautomation.svn.sourceforge.net/openautomation/?rev=446&view=rev
Author: mayerch
Date: 2011-10-15 10:48:18 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Whitespace clean up (DON'T USE TABS!)
Modified Paths:
--------------
CometVisu/trunk/visu/visu_config_demo.xml
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2011-10-15 10:26:28 UTC (rev 445)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2011-10-15 10:48:18 UTC (rev 446)
@@ -271,10 +271,10 @@
</slide>
<diagram_popup rrd="200_DALI_Linie_1_Strom" unit="mA" series="day" refresh="300">DALI Strom L1</diagram_popup>
<diagram_inline rrd="200_DALI_Linie_1_Strom" width="600" height="400"/>
- <infotrigger uplabel="wärmer" downlabel="kälter" upvalue="1" downvalue="0" align="center" format="%.1f °C">
- <label>Temperatur Sollwert</label>
- <address transform="DPT:1.001">4/1/3</address>
- <address transform="DPT:9" readonly="true">4/2/3</address>
- </infotrigger>
+ <infotrigger uplabel="wärmer" downlabel="kälter" upvalue="1" downvalue="0" align="center" format="%.1f °C">
+ <label>Temperatur Sollwert</label>
+ <address transform="DPT:1.001">4/1/3</address>
+ <address transform="DPT:9" readonly="true">4/2/3</address>
+ </infotrigger>
</page>
</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-15 10:26:37
|
Revision: 445
http://openautomation.svn.sourceforge.net/openautomation/?rev=445&view=rev
Author: mayerch
Date: 2011-10-15 10:26:28 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Move files to the trunk directory
Added Paths:
-----------
xPLHAL/trunk/CMakeLists.txt
xPLHAL/trunk/Doxyfile
xPLHAL/trunk/cmake/
xPLHAL/trunk/src/
Removed Paths:
-------------
xPLHAL/CMakeLists.txt
xPLHAL/Doxyfile
xPLHAL/cmake/
xPLHAL/src/
Deleted: xPLHAL/CMakeLists.txt
===================================================================
--- xPLHAL/CMakeLists.txt 2011-10-15 10:22:52 UTC (rev 444)
+++ xPLHAL/CMakeLists.txt 2011-10-15 10:26:28 UTC (rev 445)
@@ -1,68 +0,0 @@
-# xPLHAL implementation in C++
-# Copyright (C) 2009 by Christian Mayer - xpl 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, see <http://www.gnu.org/licenses/>.
-
-project(xPLHAL)
-cmake_minimum_required(VERSION 2.6)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
-
-message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
-set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic")
-#set(COMPILE_FLAGS "-Wall -Wextra -pedantic")
-#set(CMAKE_CXX_COMPILER lsbc++)
-message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
-
-set(create_STATIC_build ON)
-
-if(create_STATIC_build)
- message("Creating a static build...")
- set(Boost_USE_STATIC_LIBS ON)
- #set(CMAKE_EXE_LINKER_FLAGS -static)
-else(create_STATIC_build)
- message("Creating a dynamic build...")
- set(Boost_USE_STATIC_LIBS OFF)
-endif(create_STATIC_build)
-
-#set(Boost_USE_STATIC_LIBS ON)
-set(Boost_USE_MULTITHREADED ON)
-find_package(Boost 1.38 COMPONENTS thread system filesystem date_time regex )
-
-find_package(xPL REQUIRED)
-set(LIBS ${LIBS} ${Boost_LIBRARIES} ${xPL_LIBRARIES} pthread)
-
-
-#link_directories ( ${Boost_LIBRARY_DIRS} /usr/local/lib/ )
-link_directories ( ${Boost_LIBRARY_DIRS})
-include_directories(${Boost_INCLUDE_DIRS} ${xPL_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} )
-
-#message(STATUS "Top: Boost_LIBRARIES=${Boost_LIBRARIES}")
-#message(STATUS "Top: Boost_USE_STATIC_LIBS=${Boost_USE_STATIC_LIBS}")
-
-message( "Building type: ${CMAKE_BUILD_TYPE}" )
-if(Boost_USE_STATIC_LIBS)
- message("Linking Boost statically...")
- #message(STATUS "Prior: Boost_LIBRARIES=${Boost_LIBRARIES}")
- #message(STATUS "Prior: LINK_SEARCH_END_STATIC=${LINK_SEARCH_END_STATIC}")
- set( LINK_SEARCH_END_STATIC ON )
- # force inclusion of pthread...
- set(Boost_LIBRARIES ${Boost_LIBRARIES} pthread)
- #message(STATUS "Post: Boost_LIBRARIES=${Boost_LIBRARIES}")
- #message(STATUS "Post: LINK_SEARCH_END_STATIC=${LINK_SEARCH_END_STATIC}")
-else(Boost_USE_STATIC_LIBS)
- message("Linking Boost dynamically...")
-endif(Boost_USE_STATIC_LIBS)
-
-add_subdirectory(src)
-
Deleted: xPLHAL/Doxyfile
===================================================================
--- xPLHAL/Doxyfile 2011-10-15 10:22:52 UTC (rev 444)
+++ xPLHAL/Doxyfile 2011-10-15 10:26:28 UTC (rev 445)
@@ -1,1514 +0,0 @@
-# Doxyfile 1.6.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = xPLHAL
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = 0.0
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = doc
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
-
-LAYOUT_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = src
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS =
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE =
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP)
-# there is already a search function so this one should typically
-# be disabled.
-
-SEARCHENGINE = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = YES
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-...
[truncated message content] |
|
From: <ma...@us...> - 2011-10-15 10:22:58
|
Revision: 444
http://openautomation.svn.sourceforge.net/openautomation/?rev=444&view=rev
Author: mayerch
Date: 2011-10-15 10:22:52 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
New subdirs for better project management
Added Paths:
-----------
xPLHAL/branches/
xPLHAL/tags/
xPLHAL/trunk/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-10 20:10:10
|
Revision: 443
http://openautomation.svn.sourceforge.net/openautomation/?rev=443&view=rev
Author: mayerch
Date: 2011-10-10 20:10:04 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Remove other test
Removed Paths:
-------------
CometVisu/branches/release_0.0.0-test1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-10 20:07:43
|
Revision: 442
http://openautomation.svn.sourceforge.net/openautomation/?rev=442&view=rev
Author: mayerch
Date: 2011-10-10 20:07:37 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Creating release branch 0.0.0-test1
Added Paths:
-----------
CometVisu/branches/release_0.0.0-test1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-10 20:06:27
|
Revision: 441
http://openautomation.svn.sourceforge.net/openautomation/?rev=441&view=rev
Author: mayerch
Date: 2011-10-10 20:06:21 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Remove test
Removed Paths:
-------------
CometVisu/branches/release_0.0.0-test0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-10 19:57:27
|
Revision: 440
http://openautomation.svn.sourceforge.net/openautomation/?rev=440&view=rev
Author: mayerch
Date: 2011-10-10 19:57:21 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Creating release branch 0.0.0-test0
Added Paths:
-----------
CometVisu/branches/release_0.0.0-test0/trunk/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-10 19:54:33
|
Revision: 439
http://openautomation.svn.sourceforge.net/openautomation/?rev=439&view=rev
Author: mayerch
Date: 2011-10-10 19:54:27 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Creating release branch 0.0.0-test0
Added Paths:
-----------
CometVisu/branches/release_0.0.0-test0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-10 18:51:58
|
Revision: 438
http://openautomation.svn.sourceforge.net/openautomation/?rev=438&view=rev
Author: mayerch
Date: 2011-10-10 18:51:51 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Show version in status bar. (The release script will replace the SVN string by the current version string)
Modified Paths:
--------------
CometVisu/trunk/visu/visu_config.xml
CometVisu/trunk/visu/visu_config_demo.xml
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2011-10-10 17:34:36 UTC (rev 437)
+++ CometVisu/trunk/visu/visu_config.xml 2011-10-10 18:51:51 UTC (rev 438)
@@ -21,6 +21,7 @@
]]></status>
<status type="html"><![CDATA[
- <a href="check_config.php">Check Config</a>
+ <div style="float:right;padding-right:0.5em">Version: SVN</div>
]]></status>
</statusbar>
</meta>
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2011-10-10 17:34:36 UTC (rev 437)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2011-10-10 18:51:51 UTC (rev 438)
@@ -56,6 +56,7 @@
]]></status>
<status type="html"><![CDATA[
- <a href="check_config.php">Check Config</a>
+ <div style="float:right;padding-right:0.5em">Version: SVN</div>
]]></status>
</statusbar>
</meta>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <e....@us...> - 2011-10-10 17:34:43
|
Revision: 437
http://openautomation.svn.sourceforge.net/openautomation/?rev=437&view=rev
Author: e.max
Date: 2011-10-10 17:34:36 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Bug in null-Wert Verarbeitung gefixt
Modified Paths:
--------------
wiregate/plugin/generic/emx_uhr.pl
Modified: wiregate/plugin/generic/emx_uhr.pl
===================================================================
--- wiregate/plugin/generic/emx_uhr.pl 2011-10-09 20:04:30 UTC (rev 436)
+++ wiregate/plugin/generic/emx_uhr.pl 2011-10-10 17:34:36 UTC (rev 437)
@@ -14,6 +14,16 @@
# ## who yyyymmdd bug# description
# -- --- -------- ----- ----------------------------------------
# . ... ........ ..... vorlage
+# 4 edh 20111010 ..... - Null-Werte wurden falsch verarbeitet
+# - Zyklusberechnung konnte wg. Rundung
+# in underruns (Minuten-Unterschreitung)
+# resultieren, wird jetzt durch Addition
+# eines Zusatzwertes vermieden.
+# Allerdings sind tw. immer noch solche
+# Underruns zu beobachten, die anscheinend
+# wg. unkorrektem timings von 'aussen'
+# verursacht werden. Das Script fängt
+# diese underruns allerdings ebenfalls ab.
# 3 edh 20110910 ..... Zykluszeit wurde nicht korrekt verarbeitet,
# Zyklus-Anpassung nun exakt in Sekunden,
# - dadurch keine 1-Sekunden leer-Zyklen mehr,
@@ -66,24 +76,40 @@
my $version = 8;
#-----------------------------------------------------------------------------
+# Numerischen string als Zahl zurückgeben
+# - blanks entfernen
+# - führende Nullen entfernen
+#-----------------------------------------------------------------------------
+sub toNumber
+{
+ my $value = shift;
+ (!defined $value) and return 0;
+
+ $value =~ s/\s+//g; # whitespace entfernen
+ $value =~ s/^0+(.)$/$1/g; # fuehrende Nullen entfernen
+ return $value;
+} # toNumber
+
+
+#-----------------------------------------------------------------------------
# Auswertung von Bereichs und Listenvergleichen
# Prueft, ob ein Wert zu einer Liste oder in einen Bereich passt
#-----------------------------------------------------------------------------
sub matches
{
my ($value, $def) = @_; # Zu pruefender Wert, Bereichsdefinition
- (!$def) and return 1;
+ (!defined $def) and return 1;
+ $value = &toNumber($value);
foreach (split(/,/, $def))
{
- s/\s+//g;
- s/^0+//g; # fuehrende Nullen entfernen
+ $_ = &toNumber($_);
# Vergleich auf Alpha-Basis (vermeidet Laufzeit-Fehler)
(/^$value$/) and return 1;
(/^([\d]+)-(\d+)/) and return ($value >= $1 && $value <= $2);
}
return 0;
-}
+} # matches
#-----------------------------------------------------------------------------
# Zykluszeit setzen
@@ -94,7 +120,7 @@
my $curSec = $seconds%60;
if ( $curSec >= $slotEnd)
{
- $plugin_info{$plugname.'_cycle'} = $cycleTime - $curSec - $uSec/1000000;
+ $plugin_info{$plugname.'_cycle'} = $cycleTime - $curSec - $uSec/1000000 + 0.1; # avoid rounding underruns
plugin_log($plugname, "cycle time set to $plugin_info{$plugname.'_cycle'} second");
}
else
@@ -103,7 +129,6 @@
}
}
-
#=============================================================================
# main()
#=============================================================================
@@ -114,6 +139,7 @@
# kontrollierte Startkonditionen setzen
if (!defined $plugin_info{"$plugname.$version.firstRun"})
{
+ plugin_log($plugname, "Starting plugin version $version, will execute with first time-slot.");
# obsolete Versionen von $plugin_info bereinigen
foreach (keys %plugin_info)
{
@@ -123,7 +149,6 @@
plugin_log($plugname, "deleted plugin_info[$_]");
}
}
- plugin_log($plugname, "Started plugin version $version, will execute with first time-slot.");
$plugin_info{"$plugname.$version.firstRun"} = 1;
&setCycle();
}
@@ -132,7 +157,11 @@
($curSec >= $slotEnd && $plugin_info{"$plugname.$version.firstRun"} == 1) and return;
# pruefen, ob in dieser Minute bereits ausgefuehrt
-(defined $plugin_info{"$plugname.$version.lastMinute"} && $plugin_info{"$plugname.$version.lastMinute"} == $curMin) and return;
+if (defined $plugin_info{"$plugname.$version.lastMinute"} && $plugin_info{"$plugname.$version.lastMinute"} == $curMin)
+{
+ &setCycle();
+ return;
+}
foreach my $Zeit (@Zeiten)
{
@@ -144,7 +173,7 @@
(defined $Zeit->{Mon} && !&matches($curMon, $Zeit->{Mon})) and next;
(defined $Zeit->{WTag} && !&matches($curWTag, $Zeit->{WTag})) and next;
(defined $Zeit->{Log} && $Zeit->{Log} eq '1') and
- plugin_log($plugname, "Sending $Zeit->{Name}, GA[$Zeit->{GA}], Value[$Zeit->{Wert}]");
+ plugin_log($plugname, "Sending Value[$Zeit->{Wert}] to GA[$Zeit->{GA}], $Zeit->{Name}");
knx_write($Zeit->{GA},$Zeit->{Wert}, $Zeit->{DPT});
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-09 20:04:36
|
Revision: 436
http://openautomation.svn.sourceforge.net/openautomation/?rev=436&view=rev
Author: mayerch
Date: 2011-10-09 20:04:30 +0000 (Sun, 09 Oct 2011)
Log Message:
-----------
Backport of changelog changes in the RC1
Modified Paths:
--------------
CometVisu/trunk/ChangeLog
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2011-10-09 20:03:45 UTC (rev 435)
+++ CometVisu/trunk/ChangeLog 2011-10-09 20:04:30 UTC (rev 436)
@@ -4,7 +4,15 @@
0.6.0-RC1
=========
+- Update flot to version 0.7 to have a better fix for bug 3175343
+- Refinement of the "pure" design
- added frameborder and background to iframe
+- Plugins RSS and Yahoo-weather
+- Add gweather (Google)-Plugin, withdraw zweather
+- Fix Bug #3376682
+- Add DPT16 to transform_knx
+- Design Alaska: multiple fixes
+- New Feature: widgets can be (optionally) marked by a maturity value
0.6.0-pre1
==========
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-09 20:03:51
|
Revision: 435
http://openautomation.svn.sourceforge.net/openautomation/?rev=435&view=rev
Author: mayerch
Date: 2011-10-09 20:03:45 +0000 (Sun, 09 Oct 2011)
Log Message:
-----------
Updated changelog by past commit messages
Modified Paths:
--------------
CometVisu/branches/release_0.6.0-RC1/ChangeLog
Modified: CometVisu/branches/release_0.6.0-RC1/ChangeLog
===================================================================
--- CometVisu/branches/release_0.6.0-RC1/ChangeLog 2011-10-09 17:35:07 UTC (rev 434)
+++ CometVisu/branches/release_0.6.0-RC1/ChangeLog 2011-10-09 20:03:45 UTC (rev 435)
@@ -1,7 +1,15 @@
0.6.0-RC1
=========
+- Update flot to version 0.7 to have a better fix for bug 3175343
+- Refinement of the "pure" design
- added frameborder and background to iframe
+- Plugins RSS and Yahoo-weather
+- Add gweather (Google)-Plugin, withdraw zweather
+- Fix Bug #3376682
+- Add DPT16 to transform_knx
+- Design Alaska: multiple fixes
+- New Feature: widgets can be (optionally) marked by a maturity value
0.6.0-pre1
==========
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-09 17:35:14
|
Revision: 434
http://openautomation.svn.sourceforge.net/openautomation/?rev=434&view=rev
Author: mayerch
Date: 2011-10-09 17:35:07 +0000 (Sun, 09 Oct 2011)
Log Message:
-----------
Update for release 0.6.0-RC1
Modified Paths:
--------------
CometVisu/branches/release_0.6.0-RC1/ChangeLog
CometVisu/trunk/ChangeLog
Modified: CometVisu/branches/release_0.6.0-RC1/ChangeLog
===================================================================
--- CometVisu/branches/release_0.6.0-RC1/ChangeLog 2011-10-09 17:29:41 UTC (rev 433)
+++ CometVisu/branches/release_0.6.0-RC1/ChangeLog 2011-10-09 17:35:07 UTC (rev 434)
@@ -1,5 +1,5 @@
-HEAD
-====
+0.6.0-RC1
+=========
- added frameborder and background to iframe
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2011-10-09 17:29:41 UTC (rev 433)
+++ CometVisu/trunk/ChangeLog 2011-10-09 17:35:07 UTC (rev 434)
@@ -1,6 +1,9 @@
HEAD
====
+0.6.0-RC1
+=========
+
- added frameborder and background to iframe
0.6.0-pre1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-09 17:29:47
|
Revision: 433
http://openautomation.svn.sourceforge.net/openautomation/?rev=433&view=rev
Author: mayerch
Date: 2011-10-09 17:29:41 +0000 (Sun, 09 Oct 2011)
Log Message:
-----------
Creating release branch 0.6.0-RC1
Added Paths:
-----------
CometVisu/branches/release_0.6.0-RC1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2011-10-08 22:21:37
|
Revision: 432
http://openautomation.svn.sourceforge.net/openautomation/?rev=432&view=rev
Author: netzkind
Date: 2011-10-08 22:21:30 +0000 (Sat, 08 Oct 2011)
Log Message:
-----------
fixed: attribute variant for addresses
Modified Paths:
--------------
CometVisu/trunk/visu/edit/cometeditor.js
CometVisu/trunk/visu/edit/visuconfig_edit.js
Modified: CometVisu/trunk/visu/edit/cometeditor.js
===================================================================
--- CometVisu/trunk/visu/edit/cometeditor.js 2011-10-08 10:42:25 UTC (rev 431)
+++ CometVisu/trunk/visu/edit/cometeditor.js 2011-10-08 22:21:30 UTC (rev 432)
@@ -95,7 +95,7 @@
objData.textContent = "";
objData._attributes = {};
objData._attributes.transform = "";
- objData._attributes.type = "";
+ objData._attributes.variant = "";
objData._attributes.readonly = false;
var elementDiv = HTMLLayer.createAddressEditorElement(objData);
@@ -469,7 +469,7 @@
myElement._attributes.transform = jQuery(element).attr("transform");
myElement._attributes.readonly = jQuery(element).attr("readonly");
- myElement._attributes.type = jQuery(element).attr("type") || "";
+ myElement._attributes.variant = jQuery(element).attr("variant") || "";
break;
default:
// mostly labels
@@ -620,15 +620,15 @@
elementDiv.find(".title").append(t.find("option[value=" + elementData.textContent + "]").text());
elementDiv.find(".value").append(elementData.textContent);
elementDiv.find(".transform").append(elementData._attributes.transform);
- if (elementData._attributes.type != "undefined" && elementData._attributes.type != "") {
- elementDiv.find(".variant").append(elementData._attributes.type).show();
+ if (elementData._attributes.variant != "undefined" && elementData._attributes.variant != "") {
+ elementDiv.find(".variant").append(elementData._attributes.variant).show();
} else {
elementDiv.find(".variant").hide();
}
elementDiv.find(".readonly").append(elementData._attributes.readonly == "true" ? "readonly" : "")
elementDiv.data("transform", elementData._attributes.transform)
- .data("variant", elementData._attributes.type)
+ .data("variant", elementData._attributes.variant)
.data("readonly", elementData._attributes.readonly == "true" ? true : false)
.data("address", elementData.textContent);
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-10-08 10:42:25 UTC (rev 431)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-10-08 22:21:30 UTC (rev 432)
@@ -292,7 +292,7 @@
objData.textContent = $e.find("input.add_address").val();
objData._attributes = {};
objData._attributes.transform = $e.find(".add_transform").val();
- objData._attributes.type = $e.find(".add_variant").val();
+ objData._attributes.variant = $e.find(".add_variant").val();
objData._attributes.readonly = $e.find(".add_readonly:checked").val();
// remove this item and insert a new one instead
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2011-10-08 10:42:34
|
Revision: 431
http://openautomation.svn.sourceforge.net/openautomation/?rev=431&view=rev
Author: netzkind
Date: 2011-10-08 10:42:25 +0000 (Sat, 08 Oct 2011)
Log Message:
-----------
editor goes OO, php-files go failsave, editor force-reloads always
Modified Paths:
--------------
CometVisu/trunk/visu/designs/discreet/basic.css
CometVisu/trunk/visu/edit/get_addresses.php
CometVisu/trunk/visu/edit/get_widget_diagram.php
CometVisu/trunk/visu/edit/style_edit.css
CometVisu/trunk/visu/edit/visuconfig_edit.js
CometVisu/trunk/visu/edit_config.html
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
Added Paths:
-----------
CometVisu/trunk/visu/edit/cometeditor.js
Modified: CometVisu/trunk/visu/designs/discreet/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet/basic.css 2011-10-01 09:00:10 UTC (rev 430)
+++ CometVisu/trunk/visu/designs/discreet/basic.css 2011-10-08 10:42:25 UTC (rev 431)
@@ -1,385 +1,386 @@
-@font-face { font-family: Liberation; src:url(fonts/liberationsans-regular.ttf); }
-@font-face { font-family: Liberation; font-weight: bold; src:url(fonts/liberationsans-bold.ttf); }
-
-body
-{
- color: white;
- font-family: Liberation;
- font-size: 5.5mm;
- overflow: hidden;
- margin:0;
- background: #1d1d1d; /* url(images/body_bg.png) repeat-x; */
-}
-
-h1
-{
- font-size: 2em;
- padding-left: 15px;
-}
-
-h2
-{
- font-size: 1.25em;
- margin-left: 15px;
- margin-top: 5px;
- margin-bottom: 5px;
-}
-
-body hr
-{
- clear:both;
- color: #81664b;
- background-color: #81664b;
- height: 1px;
- border:none;
- padding:0px;
- margin:0.1em;
-}
-
-#pages hr {
- border: 0; height: 30px; margin: 0 .1em;
- background: transparent url(images/hr_bg.png) 50% repeat-x;
- clear: both;
-}
-
-
-body br
-{
- clear:both;
-}
-
-div#top {
- padding-top: 8px;
- border-top: 3px solid #1d1d1d;
- border-bottom: 1px solid #0a0a0a;
- background-color: #121212;
- padding-bottom: 2px;
-}
-
-.page h1 {
- margin-top: 0;
- padding-top: 1em;
- background: #121212 url(images/head_bg.png) scroll repeat-x bottom;
-}
-
-.nav_path
-{
- color: #81664b;
- margin-left: 15px;
-}
-.nav_path a
-{
- color: white;
- text-decoration:none;
-}
-
-.footer,
-.footer *
-{
- color: #000000;
- font-size: 0.9em;
- vertical-align: middle;
-}
-
-.widget
-{
- float:left;
- width:48%;
- margin: .2em;
- padding: 0.3em;
- /* border:yellow 1px solid; */
- border-color: #020202;
- border-style: solid;
- border-width: 2px 0px 0px 2px;
- -moz-border-radius: 8px;
- -webkit-border-radius: 8px;
- border-radius: 8px;
- min-height: 2em;
- background-color: #101010;
-}
-
-.widget .widget
-{
- width:98%;
-}
-
-.text > div,
-.link > a {
- float:left;
- text-align:left;
- padding-left: 1em;
-}
-
-.widget .label,
-.widget.info .actor,
-.text > div,
-.link > a {
- line-height: 2em;
-}
-
-.widget .label
-{
- float:left;
- width:49%;
-/* color:red; */
-/* padding-right:0.25em; */
- text-align:left;
- padding-left: 1em;
-/* border:blue 1px solid; */
-}
-.widget .actor
-{
- float:left;
- margin-left:1em;
- text-align:left;
-}
-.widget .actor div
-{
- float:left;
- white-space: pre-wrap;
-}
-
-
-.green.switchPressed div, .green.switchUnpressed div{
- background: transparent url(images/dot_green.png) no-repeat center center;
- color: white !important;
-}
-.red.switchPressed div, .red.switchUnpressed div{
- background: transparent url(images/dot_red.png) no-repeat center center;
- color: white !important;
-}
-
-
-.red
-{
- color:#f44;
- font-weight:bold;
-}
-
-.green
-{
- color:#4f4;
-}
-
-.blue
-{
- color:#44f;
-}
-
-.purple
-{
- color:#f4f;
-}
-
-.link a
-{
- color: #81664b;
- width: 49%;
-}
-
-.page
-{
- float:left;
- width: 900px;
- overflow: auto;
- position: relative;
-}
-
-.switchPressed, .switchUnpressed {
- border-style: solid;
- -moz-border-radius: 12px;
- -webkit-border-radius: 12px;
- border-radius: 12px;
- padding: 1px;
- background: url(images/button_bg.png) #171717 repeat-x;
-}
-
-.switchUnpressed
-{
- border-width: 1px 2px 2px 1px;
- border-color: #282828 #010101 #010101 #282828;
- margin-top: 0px;
- background-color: #3A3A3A;
- background-position: center +2px;
-}
-.switchUnpressed div, .switchPressed div
-{
- padding: 5px;
- width: 5em;
- float: left;
- background: transparent;
- text-align: center;
- cursor: pointer;
-}
-
-.switchPressed
-{
- border-width: 2px 1px 1px 2px;
- border-color: #010101 #282828 #282828 #010101;
- margin-top: 1px;
- background-position: center -2px;
-}
-
-.switchUnpressed div {
- margin-left: -1px;
-}
-
-.switchPressed div {
- margin-top: -1px;
-}
-
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }
-.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; }
-.ui-widget-content a { color: #333333; }
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
-.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-
-.dim .actor
-{
- width: 3em;
-}
-.widget .ui-slider
-{
- width: 30%;
- float: left;
- margin-left: 10px;
- margin-left: 1em;
- margin-top: 0.5em;
- border-color: #010101 #282828 #282828 #010101;
- background: url(images/gradient.png) #a7a7a7 repeat-y;
-}
-
-.widget .ui-slider-handle
-{
- border-style: solid;
- -moz-border-radius: 12px;
- -webkit-border-radius: 12px;
- border-radius: 12px;
- padding: 1px;
- background: url(images/button_bg.png) #171717 repeat-x;
- border-width: 1px 2px 2px 1px;
- border-color: #282828 #010101 #010101 #282828;
-}
-/* Clearfix */
-.clearfix:after {
- content: ".";
- display: block;
- clear: both;
- visibility: hidden;
- line-height: 0;
- height: 0;
-}
-
-.clearfix {
- display: inline-block;
-}
-
-html[xmlns] .clearfix {
- display: block;
-}
-
-*:first-child+html .clearfix {
- min-height: 0;
-}
-
-* html .clearfix {
- height: 1%;
-}
-
-* html>body .clearfix {
- display: inline-block;
- width: 100%;
-}
-
-* html .clearfix {
- /* Hides from IE-mac \*/
- height: 1%;
- /* End hide from IE-mac */
-}
-
-.loading {
- display: block !important;
-}
-
-div#loading {
- display: none !important;
-}
-
-
-.popup,
-.popup_background {
- position: absolute;
- width: 90%;
- height: 90%;
- top: 5%;
- left: 5%;
-}
-
-.popup {
- z-index: 101;
- background: transparent;
-}
-
-
-.popup_background {
- z-index: 100;
- border-color: #020202;
- border-style: solid;
- border-width: 2px 0px 0px 2px;
- -moz-border-radius: 8px;
- -webkit-border-radius: 8px;
- border-radius: 8px;
- background: #101010;
- opacity: .98;
-}
-
-.popup div {
- margin: 4px;
-}
-
-.popup div.head {
- border-bottom: 1px solid;
-}
-
-.popup_background.error {
- background: #800000;
- border: #f00;
-}
-
-.clickable {
- cursor: pointer;
-}
-
-.diagram_inline {
- width: 320px;
- height: 180px;
-}
-
-.diagram_preview {
- width: 240px;
- height: 2em;
-}
-
-#diagramTooltip {
- z-index: 1000;
- color: black;
- border: 1px solid #fdd;
- padding: 2px;
- background-color: #fee;
- opacity: 0.80;
+@font-face { font-family: Liberation; src:url(fonts/liberationsans-regular.ttf); }
+@font-face { font-family: Liberation; font-weight: bold; src:url(fonts/liberationsans-bold.ttf); }
+
+body
+{
+ color: white;
+ font-family: Liberation;
+ font-size: 5.5mm;
+ overflow: hidden;
+ margin:0;
+ background: #1d1d1d; /* url(images/body_bg.png) repeat-x; */
+}
+
+h1
+{
+ font-size: 2em;
+ padding-left: 15px;
+}
+
+h2
+{
+ font-size: 1.25em;
+ margin-left: 15px;
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+
+body hr
+{
+ clear:both;
+ color: #81664b;
+ background-color: #81664b;
+ height: 1px;
+ border:none;
+ padding:0px;
+ margin:0.1em;
+}
+
+#pages hr {
+ border: 0; height: 30px; margin: 0 .1em;
+ background: transparent url(images/hr_bg.png) 50% repeat-x;
+ clear: both;
+}
+
+
+body br
+{
+ clear:both;
+}
+
+div#top {
+ padding-top: 8px;
+ border-top: 3px solid #1d1d1d;
+ border-bottom: 1px solid #0a0a0a;
+ background-color: #121212;
+ padding-bottom: 2px;
+}
+
+.page h1 {
+ margin-top: 0;
+ padding-top: 1em;
+ background: #121212 url(images/head_bg.png) scroll repeat-x bottom;
+}
+
+.nav_path
+{
+ color: #81664b;
+ margin-left: 15px;
+}
+.nav_path a
+{
+ color: white;
+ text-decoration:none;
+}
+
+.footer,
+.footer *
+{
+ color: #000000;
+ font-size: 0.9em;
+ vertical-align: middle;
+}
+
+.widget
+{
+ float:left;
+ width:48%;
+ margin: .2em;
+ padding: 0.3em;
+ /* border:yellow 1px solid; */
+ border-color: #020202;
+ border-style: solid;
+ border-width: 2px 0px 0px 2px;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ min-height: 2em;
+ background-color: #101010;
+}
+
+.widget .widget
+{
+ width:98%;
+}
+
+.text > div,
+.link > a {
+ float:left;
+ text-align:left;
+ padding-left: 1em;
+}
+
+.widget .label,
+.widget.info .actor,
+.text > div,
+.link > a {
+ line-height: 2em;
+}
+
+.widget .label
+{
+ float:left;
+ width:49%;
+/* color:red; */
+/* padding-right:0.25em; */
+ text-align:left;
+ padding-left: 1em;
+/* border:blue 1px solid; */
+}
+.widget .actor
+{
+ float:left;
+ margin-left:1em;
+ text-align:left;
+}
+.widget .actor div
+{
+ float:left;
+ white-space: pre-wrap;
+}
+
+
+.green.switchPressed div, .green.switchUnpressed div{
+ background: transparent url(images/dot_green.png) no-repeat center center;
+ color: white !important;
+}
+.red.switchPressed div, .red.switchUnpressed div{
+ background: transparent url(images/dot_red.png) no-repeat center center;
+ color: white !important;
+}
+
+
+.red
+{
+ color:#f44;
+ font-weight:bold;
+}
+
+.green
+{
+ color:#4f4;
+}
+
+.blue
+{
+ color:#44f;
+}
+
+.purple
+{
+ color:#f4f;
+}
+
+.link a
+{
+ color: #81664b;
+ width: 49%;
+}
+
+.page
+{
+ float:left;
+ width: 900px;
+ overflow: auto;
+ position: relative;
+}
+
+.switchPressed, .switchUnpressed {
+ border-style: solid;
+ -moz-border-radius: 12px;
+ -webkit-border-radius: 12px;
+ border-radius: 12px;
+ padding: 1px;
+ background: url(images/button_bg.png) #171717 repeat-x;
+}
+
+.switchUnpressed
+{
+ border-width: 1px 2px 2px 1px;
+ border-color: #282828 #010101 #010101 #282828;
+ margin-top: 0px;
+ background-color: #3A3A3A;
+ background-position: center +2px;
+}
+.switchUnpressed div, .switchPressed div
+{
+ padding: 5px;
+ width: 5em;
+ float: left;
+ background: transparent;
+ text-align: center;
+ cursor: pointer;
+}
+
+.switchPressed
+{
+ border-width: 2px 1px 1px 2px;
+ border-color: #010101 #282828 #282828 #010101;
+ margin-top: 1px;
+ background-position: center -2px;
+}
+
+.switchUnpressed div {
+ margin-left: -1px;
+}
+
+.switchPressed div {
+ margin-top: -1px;
+}
+
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }
+.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; }
+.ui-widget-content a { color: #333333; }
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
+.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
+
+.dim .actor
+{
+ width: 3em;
+}
+.widget .ui-slider
+{
+ width: 30%;
+ float: left;
+ margin-left: 10px;
+ margin-left: 1em;
+ margin-top: 0.5em;
+ border-color: #010101 #282828 #282828 #010101;
+ background: url(images/gradient.png) #a7a7a7 repeat-y;
+}
+
+.widget .ui-slider-handle
+{
+ border-style: solid;
+ -moz-border-radius: 12px;
+ -webkit-border-radius: 12px;
+ border-radius: 12px;
+ padding: 1px;
+ background: url(images/button_bg.png) #171717 repeat-x;
+ border-width: 1px 2px 2px 1px;
+ border-color: #282828 #010101 #010101 #282828;
+}
+/* Clearfix */
+.clearfix:after {
+ content: ".";
+ display: block;
+ clear: both;
+ visibility: hidden;
+ line-height: 0;
+ height: 0;
+}
+
+.clearfix {
+ display: inline-block;
+}
+
+html[xmlns] .clearfix {
+ display: block;
+}
+
+*:first-child+html .clearfix {
+ min-height: 0;
+}
+
+* html .clearfix {
+ height: 1%;
+}
+
+* html>body .clearfix {
+ display: inline-block;
+ width: 100%;
+}
+
+* html .clearfix {
+ /* Hides from IE-mac \*/
+ height: 1%;
+ /* End hide from IE-mac */
+}
+
+.loading {
+ display: block !important;
+}
+
+div#loading {
+ display: none !important;
+}
+
+
+.popup,
+.popup_background {
+ position: absolute;
+ width: 90%;
+ height: 90%;
+ top: 5%;
+ left: 5%;
+}
+
+.popup {
+ z-index: 101;
+ background: transparent;
+}
+
+
+.popup_background {
+ z-index: 100;
+ border-color: #020202;
+ border-style: solid;
+ border-width: 2px 0px 0px 2px;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ background: #101010;
+ opacity: .98;
+}
+
+.popup div {
+ margin: 4px;
+}
+
+.popup div.head {
+ border-bottom: 1px solid;
+}
+
+.popup_background.error {
+ background: #800000;
+ border: #f00;
+}
+
+.clickable {
+ cursor: pointer;
+}
+
+.diagram_inline {
+ margin-left: 1em;
+ width: 320px;
+ height: 180px;
+}
+
+.diagram_preview {
+ width: 240px;
+ height: 2em;
+}
+
+#diagramTooltip {
+ z-index: 1000;
+ color: black;
+ border: 1px solid #fdd;
+ padding: 2px;
+ background-color: #fee;
+ opacity: 0.80;
}
\ No newline at end of file
Added: CometVisu/trunk/visu/edit/cometeditor.js
===================================================================
--- CometVisu/trunk/visu/edit/cometeditor.js (rev 0)
+++ CometVisu/trunk/visu/edit/cometeditor.js 2011-10-08 10:42:25 UTC (rev 431)
@@ -0,0 +1,637 @@
+var CometEditor = function() {
+ var Editor = this;
+ Editor.cache = {};
+
+
+ Editor.cacheServerData = function(url, variable) {
+ // get all GAs from the server
+ $.ajax({
+ url: url,
+ type: "GET",
+ dataType: "json",
+ success: function(data) {
+ Editor.cache[variable] = data;
+ },
+ error: function(xhr, textStatus, e) {
+ Editor.cache[variable] = false;
+ $("#StatusBar").jnotifyAddMessage({
+ text: lingua("bad_get_" + variable, textStatus + " " + e),
+ permanent: false,
+ type: "error",
+ disappearTime: 30000
+ });
+ }
+ });
+ }
+
+ Editor.refreshEditor = function(val) {
+ // the type has been changed
+ // we need to change the input-field accordingly to match
+ // what attributes we need
+
+
+ // get all the info we need to edit this piece of work
+ var creator = design.getCreator(val);
+ var attributes = creator.attributes || {};
+ var elements = creator.elements || {};
+
+ // find old input-fields in the editor to remember those values ...
+ // this is need in case someone switches types while editing - and sure they want to keep their settings
+ var container = $("#addMaster div.inputs");
+ var values = $.extend({}, $("#addMaster").data("widgetdata"));
+
+ if (!$("#pages .inedit").is(".widget")) {
+ // this needs to be changed for the new settings-layout - it's completely broken right now!
+ // alte Werte zwischenspeichern
+ container.find(":input").each(function() {
+ if ($(this).val() != "") {
+ var name = $(this).data("name");
+ values[name] = $(this).val();
+ }
+ })
+ }
+ container.empty();
+
+ // we will need this variable later on to store our fieldset in.
+ var set;
+ if (typeof creator.content.type != "undefined" && creator.content.type == "string") {
+
+ var element = $("<div />").addClass("add_input").addClass("content")
+ .append($("<label />").attr("for", "add_textContent").html("text-content"))
+ .append($("<div class=\"input\" />")
+ .append($("<input type=\"text\" id=\"add_textContent\"/>"))
+ );
+ if (typeof values["textContent"] != "undefined") {
+ element.find("input").val(values["textContent"]);
+ }
+
+ element.find(":input").data("required", creator.content.required);
+
+ container.append(element);
+ delete element;
+ }
+
+ if (false === jQuery.isEmptyObject(elements)) {
+ // we've got elements we need to addit :)
+ container.append(set = jQuery("<fieldset />").addClass("elements"));
+ jQuery.each(elements, function(index, e) {
+ var $line = $("<div />").addClass("add_input")
+ .append($("<label />").attr("for", "add_" + index).html(index))
+ .append($("<div class=\"input\" />"));
+ var $input = $line.find("div.input");
+
+ switch (e.type) {
+ case "address":
+ // create a fake input-element to store our data later on
+ $input.append(jQuery("<input type=\"hidden\" id=\"add_" + index + "\" class=\"multi address\" />"));
+
+ // create the real inputs-thingy-thing
+ $input.append('<div><div class="add_element">+</div><div class="multi_element address" /></div>');
+ $input.find(".add_element").click(function() {
+ // insert a new, empty sub-element
+ var objData = {};
+ // don't try to hide it: this is hardcoded and works for addresses only
+ objData.type = "address";
+ objData.textContent = "";
+ objData._attributes = {};
+ objData._attributes.transform = "";
+ objData._attributes.type = "";
+ objData._attributes.readonly = false;
+
+ var elementDiv = HTMLLayer.createAddressEditorElement(objData);
+ $input.find("div.multi_element").append(elementDiv);
+ });
+
+ if (typeof values._elements != "undefined"
+ && typeof values._elements[index] != "undefined") {
+ $.each(values._elements[index], function(i, e) {
+ var elementDiv = HTMLLayer.createAddressEditorElement(e);
+ $input.find("div.multi_element").append(elementDiv);
+ });
+ }
+ break;
+ default:
+ // add an unknown element (e.g. the label)
+ if (e.multi == false) {
+ // this element can appear only once
+ $input.append(jQuery("<input type=\"text\" id=\"add_" + index + "\" />"));
+
+ if (typeof values._elements != "undefined"
+ && typeof values._elements[index] != "undefined") {
+ $.each(values._elements[index], function(i, e) {
+ $input.find("input").val(values._elements[index][0].textContent);
+ });
+ }
+ } else {
+ // handling for "if an element can appear more than once"
+ // TODO: needs to be coded once someone wants to use it :)
+ }
+ break;
+ }
+
+ // remember how to name and how to validate this input
+ $line.find(":input")
+ .data("name", index)
+ .data("required", e.required)
+ .data("type", e.type);
+
+ // add this "line" to the editor
+ set.append($line);
+ delete $line;
+ });
+ }
+
+ if (false === jQuery.isEmptyObject(attributes)) {
+ // we've got attributes to addit :)
+ container.append(set = jQuery("<fieldset />").addClass("attributes"));
+ $.each(attributes, function (index, e) {
+ var $line = $("<div />").addClass("add_input")
+ .append($("<label />").attr("for", "add_" + index).html(index))
+ .append($("<div class=\"input\" />"));
+ var $input = $line.find("div.input");
+
+ switch (e.type) {
+ case "mapping":
+ $input.append($("<select id=\"add_mapping\" />")
+ .append($("<option />").attr("value", "").html("-")));
+ jQuery.each(mappings, function(i, tmp) {
+ $input.find("select#add_mapping").append($("<option />").attr("value", i).html(i));
+ });
+
+ if (typeof values._attributes != "undefined"
+ && typeof values._attributes[index] != "undefined") {
+ $input.find("option[value=" + values._attributes[index] + "]").attr("selected", "selected");
+ }
+
+ break;
+
+ case "styling":
+ $input.append($("<select id=\"add_styling\" />")
+ .append($("<option />").attr("value", "").html("-")));
+ jQuery.each(stylings, function(i, tmp) {
+ $input.find("select#add_styling").append($("<option />").attr("value", i).html(i));
+ });
+
+ if (typeof values._attributes != "undefined"
+ && typeof values._attributes[index] != "undefined") {
+ $input.find("option[value=" + values._attributes[index] + "]").attr("selected", "selected");
+ }
+
+ break;
+ case "datatype":
+ break;
+ case "list":
+ $input.append($("<select id=\"add_" + index + "\" />")
+ .append($("<option />").attr("value", "").html("-")));
+ jQuery.each(e.list, function (i, val) {
+ $input.find("select#add_" + index).append($("<option />").attr("value", i).html(val));
+ });
+
+ if (typeof values._attributes != "undefined"
+ && typeof values._attributes[index] != "undefined") {
+ $input.find("option[value=" + values._attributes[index] + "]").attr("selected", "selected");
+ }
+
+ break;
+ default:
+ $input.append($("<input type=\"text\" id=\"add_" + index + "\" />"));
+
+ if (typeof values._attributes != "undefined"
+ && typeof values._attributes[index] != "undefined") {
+ $input.find("input").val(values._attributes[index]);
+ }
+
+ break;
+ }
+
+ if ($line.find("select")[0]) {
+ var select = $line.find("select");
+ select.change(function() {
+ // update the input-field
+ jQuery(this).parent().find("input").val(jQuery(this).val());
+ })
+ }
+
+ $line.find(":input")
+ .data("name", index)
+ .data("required", e.required)
+ .data("type", e.type);
+
+ set.append($line);
+ delete $line;
+ });
+ }
+ }
+
+
+ Editor.saveElement = function() {
+ // Daten aus den Eingabefeldner übernehmen
+ // einfach alle rein - wir haben ja nur die passenden Felder
+
+ var container = $("#addMaster div.inputs");
+
+ // dataObject needs to be a real dom-object, so we need to go all the
+ // way through parsing an xml-string ...
+ var name = jQuery("#addMaster #add_type").val();
+ var text = container.find("#add_textContent:input").val();
+ var xml = "<" + name + ">" + text + "</" + name + ">";
+ var dataObject;
+
+ if (window.DOMParser) {
+ var parser = new DOMParser();
+ dataObject = parser.parseFromString(xml, "text/xml");
+ } else {
+ // Internet Explorer
+ dataObject = new ActiveXObject("Microsoft.XMLDOM");
+ dataObject.async="false";
+ dataObject.loadXML(xml);
+ }
+
+ dataObject = jQuery(dataObject.documentElement);
+ if (typeof (dataObject.nodeName) == "undefined" || dataObject.nodeName == "") {
+ dataObject.nodeName = name;
+ }
+ if (typeof (text) != "undefined"
+ && (typeof (dataObject.textContent) == "undefined" || dataObject.textContent == "")) {
+ dataObject.textContent = text;
+ }
+
+ var error = false;
+
+ // get the settings for all sub-elements
+ container.find("fieldset.elements :input").each(function() {
+ var name = $(this).data("name");
+
+ if (!$(this).is(".multi")) {
+ if ($(this).val() != "") {
+ // validating
+ if (false === Editor.validateInput($(this).val(), $(this).data("type"))) {
+ $('#StatusBar').jnotifyAddMessage({
+ text: lingua("value_invalid", name),
+ permanent: false,
+ type: 'error'
+ });
+ // do not save
+ error = true;
+ }
+ dataObject.append($("<" + name + " />").append($(this).val()));
+ } else if ($(this).data("required") === true) {
+ // do not save
+ $('#StatusBar').jnotifyAddMessage({
+ text: lingua("value_required", name),
+ permanent: false,
+ type: 'error'
+ });
+ error = true;
+ }
+ } else {
+ // multi-element-input
+ if ($(this).is(".address")) {
+ $elements = jQuery(this).closest("div.input").find(".multi_element .element");
+ $elements.each(function (index, e) {
+ $address = $("<address />")
+ .attr("transform", $(e).data("transform"))
+ .attr("variant", $(e).data("variant"))
+ .attr("readonly", $(e).data("readonly") == true ? "true" : "false")
+ .append($(e).data("address"));
+ dataObject.append($address);
+ });
+ }
+ }
+ });
+
+ // get the settings for all attributes
+ container.find("fieldset.attributes :input").each(function() {
+ var name = $(this).data("name");
+
+ if ($(this).val() != "") {
+ // validating
+ if (false === Editor.validateInput($(this).val(), $(this).data("type"))) {
+ $('#StatusBar').jnotifyAddMessage({
+ text: lingua("value_invalid", name),
+ permanent: false,
+ type: 'error'
+ });
+ // do not save
+ error = true;
+ }
+ dataObject.attr(name, $(this).val());
+ } else if ($(this).data("required") === true) {
+ // do not save
+ $('#StatusBar').jnotifyAddMessage({
+ text: lingua("value_required", name),
+ permanent: false,
+ type: 'error'
+ });
+ error = true;
+ }
+ });
+
+ if (error !== false) {
+ return;
+ }
+
+ // als path verwenden wir einfach den aktuellen UNIX-Timestamp
+ // der wird nicht schon belegt sein
+ var path = $(".page:visible:last").attr("id");
+ path = path + "_" + new Date().getTime();
+ var newWidget = create_pages(dataObject, path);
+
+ // falls es eine page war dann muss die HINTER das aktuelle Element
+ $("#" + path + ".page").insertAfter($(".page:visible:last"));
+
+ if ($("#pages .inedit").is(".widget")) {
+ $("#pages .inedit").replaceWith(newWidget);
+ } else {
+ jQuery(".page:visible:last > div").append(newWidget);
+ }
+ jQuery("#pages").triggerHandler("done");
+
+ // und dann noch mich wieder verstecken
+ jQuery("#addMaster").trigger("hide").trigger("cleanup");
+
+ };
+
+ Editor.validateInput = function (val, type) {
+ /**
+ * check whether a user-given value matches the type-criterias and thus is valid
+ */
+
+ if (typeof type == "undefined" || type == null) {
+ // nicht mit Geistern rumschlagen
+ return true;
+ }
+ if (typeof type == "object") {
+ // wohl ein regulärer Ausdruck
+ try {
+ if (val.match(type)) {
+ return true;
+ } else {
+ return false;
+ }
+
+ } catch (e) {
+ $('#StatusBar').jnotifyAddMessage({
+ text: lingua("regexp_invalid", name),
+ permanent: false,
+ type: 'error'
+ });
+ return false;
+ }
+ }
+
+ switch (type) {
+ case "address":
+ return Boolean(val.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,3}$/) != null);
+ break;
+ case "datatype":
+ case "numeric":
+ return Boolean(val.match(/^-?\d+([\.,]\d+)?$/g));
+ break;
+ case "string":
+ case "uri":
+ return Boolean(typeof val == "string");
+ break;
+ case "mapping":
+ return Boolean(typeof mappings[val] != "undefined");
+ break;
+ case "styling":
+ return Boolean(typeof stylings[val] != "undefined");
+ break;
+ }
+ }
+
+ Editor.saveConfig = function() {
+ var configData = Editor.createObjectFromPage("#0.page");
+ var configDataJSON = JSON.stringify(configData);
+ delete configData;
+
+ var configSuffix = "";
+ if ($.getUrlVar("config")) {
+ configSuffix = "_" + $.getUrlVar("config");
+ }
+
+ $.ajax({
+ type: "POST",
+ data: {data: configDataJSON, config: configSuffix},
+ url: "edit/save_config.php",
+ cache: false,
+ dataType: "json",
+ error: function(XMLHttpRequest, textStatus, errorThrown) {
+ $('#StatusBar').jnotifyAddMessage({
+ text: lingua("save_bad", errorThrown),
+ permanent: false,
+ type: 'error',
+ disappearTime: 30000
+ });
+ },
+ success: function(data, textStatus, XMLHttpRequest) {
+ if (data != 1) {
+ $('#StatusBar').jnotifyAddMessage({
+ text: lingua("save_bad", data),
+ permanent: false,
+ type: 'error',
+ disappearTime: 30000
+ });
+ return;
+ }
+ $('#StatusBar').jnotifyAddMessage({
+ text: lingua("save_good"),
+ permanent: false,
+ type: 'message'
+ });
+ }
+ });
+ }
+
+ Editor.getWidgetData = function(element, nodive) {
+ var myObj = {};
+
+ var e = $(element);
+
+ myObj._type = e.data("nodeName");
+ myObj.textContent = e.data("textContent");
+ myObj._attributes = e.data("configData").attributes;
+
+ if (e.data("configData").elements) {
+ // Sub-Elements must be processed differently.
+ var myElements = {};
+ $.each(e.data("configData").elements, function (index, elementGroup) {
+ $.each(elementGroup, function (index, element) {
+ var myElement = {};
+ element = jQuery(element).get(0);
+ switch (element.nodeName) {
+ case "address":
+ myElement._type = "address";
+ myElement.textContent = element.textContent;
+
+ myElement._attributes = {};
+
+ myElement._attributes.transform = jQuery(element).attr("transform");
+ myElement._attributes.readonly = jQuery(element).attr("readonly");
+ myElement._attributes.type = jQuery(element).attr("type") || "";
+ break;
+ default:
+ // mostly labels
+ myElement._type = element.nodeName;
+ myElement.textContent = element.textContent;
+ break;
+ }
+ if (typeof(myElements[element.nodeName]) == "undefined") {
+ myElements[element.nodeName] = [];
+ }
+ myElements[element.nodeName].push(myElement);
+ });
+ });
+ // add it to the object-to-be-saved
+ myObj._elements = myElements;
+ }
+
+ if (e.is(".pagelink")) {
+ // it's a page, we need to dive in
+ // eine Sub-Seite
+ // versuchen die Seiten-Id durch den Link zu bekommen
+ var s = e.find("a");
+ var href = s.attr("href");
+ var matches = href.match(/(\d+_)*\d+/);
+
+ var subElements = new Array();
+ if (matches && (typeof nodive == "undefined" || !nodive)) {
+ // wenn wir eine Id haben, dann suchen wir die Seite
+ // und serialisieren sie auch
+ var page = $("#pages").find("#" + matches[0] + ".page");
+ var subObject = Editor.createObjectFromPage(page);
+ if (subObject._elements.length > 0) {
+ myObj = subObject;
+ }
+ }
+ }
+
+ return myObj;
+ }
+
+ Editor.createObjectFromPage = function(pageObject) {
+ var obj = {};
+ var elements = new Array();
+ $(pageObject).find("h1, .widget").each(function(index, element) {
+ if ($(element).is("h1")) {
+ // Seitenname
+ obj.name = $(element).text();
+ obj._type = "page";
+ if ($(element).parents("div.page").data("configData")) {
+ var data = $(element).parents("div.page").data("configData");
+ obj = jQuery.extend(obj, data.attributes);
+ }
+ } else {
+ var myObj = {};
+ myObj = Editor.getWidgetData(element);
+ if (typeof myObj != "undefined" && typeof myObj._type != "undefined") {
+ elements.push(myObj);
+ }
+ }
+
+ });
+
+ obj._elements = elements;
+ return obj;
+ }
+
+ Editor.getAddressesObject = function() {
+
+ if (typeof Editor.cache.cachedAddressesObject == "object") {
+ return Editor.cache.cachedAddressesObject.clone();
+ }
+
+ element = $("<select />");
+
+ $.each(Editor.cache.addresses, function(hg, sub) {
+ $.each(sub, function(mg, addresses) {
+ element.append(
+ $("<optgroup />").attr("label", hg + " - " + mg)
+ );
+ $.each(addresses, function (i, address) {
+ element.find("optgroup:last")
+ .append($("<option />").attr("value", address.address)
+ .addClass("dpt_DPT:" + address.dpt)
+ .html(address.name)
+ )
+ });
+ });
+ });
+
+ Editor.cache.cachedAddressesObject = element.children();
+
+ return Editor.cache.cachedAddressesObject;
+ }
+
+ Editor.getDPTObject = function() {
+
+ if (typeof Editor.cache.cachedDPTObject == "object") {
+ return Editor.cache.cachedDPTObject.clone();
+ }
+
+ var element = $("<select />");
+
+ var lastMajor = "";
+
+ $.each(Editor.cache.dpts, function(i, dptDefinition) {
+ var myMajor = lastMajor;
+ var t = dptDefinition.dpt.match(/^([0-9]+)\./);
+ if (typeof (t[1]) != "undefined") {
+ myMajor = t[1];
+ }
+
+ if (lastMajor != myMajor) {
+ if (element.is("optgroup")) {
+ element = element.closest("select");
+ }
+ element.append($("<optgroup />").attr("label", "DPT " + myMajor));
+ lastMajor = myMajor;
+ }
+
+ element.find("optgroup:last").append($("<option />").attr("value", "DPT:" + dptDefinition.dpt)
+ .html("" + dptDefinition.dpt + ": " + dptDefinition.name)
+ );
+ });
+
+ Editor.cache.cachedDPTObject = element.children();
+
+ return Editor.cache.cachedDPTObject;
+ }
+
+};
+
+var CometEditorHTMLLayer = function() {
+
+ var Layer = this;
+
+ /**
+ * Create a sub-element for the multi-editor to edit an address-entry.
+ */
+ Layer.createAddressEditorElement = function(elementData) {
+ var elementDiv = jQuery("<div class=\"element clearfix\" />");
+ elementDiv.append("<div class=\"title\" />")
+ .append("<div class=\"value editable\" />")
+ .append("<div class=\"transform editable\" />")
+ .append("<div class=\"variant editable\" />")
+ .append("<div class=\"readonly editable\" />");
+ //myDiv.find(".title").append();
+ var t = Editor.getAddressesObject();
+ elementDiv.find(".title").append(t.find("option[value=" + elementData.textContent + "]").text());
+ elementDiv.find(".value").append(elementData.textContent);
+ elementDiv.find(".transform").append(elementData._attributes.transform);
+ if (elementData._attributes.type != "undefined" && elementData._attributes.type != "") {
+ elementDiv.find(".variant").append(elementData._attributes.type).show();
+ } else {
+ elementDiv.find(".variant").hide();
+ }
+ elementDiv.find(".readonly").append(elementData._attributes.readonly == "true" ? "readonly" : "")
+
+ elementDiv.data("transform", elementData._attributes.transform)
+ .data("variant", elementData._attributes.type)
+ .data("readonly", elementData._attributes.readonly == "true" ? true : false)
+ .data("address", elementData.textContent);
+
+ return elementDiv;
+ }
+}
\ No newline at end of file
Modified: CometVisu/trunk/visu/edit/get_addresses.php
===================================================================
--- CometVisu/trunk/visu/edit/get_addresses.php 2011-10-01 09:00:10 UTC (rev 430)
+++ CometVisu/trunk/visu/edit/get_addresses.php 2011-10-08 10:42:25 UTC (rev 431)
@@ -3,11 +3,21 @@
define('FILE_HG', "/etc/wiregate/eibga_hg.conf");
define('FILE_MG', "/etc/wiregate/eibga_mg.conf");
-$arrGA = parse_ini_file(FILE_GA, true);
-$arrHG = parse_ini_file(FILE_HG, true);
-$arrMG = parse_ini_file(FILE_MG, true);
+$arrGA = array();
+$arrHG = array();
+$arrMG = array();
+if (true === file_exists(FILE_GA)) {
+ $arrGA = parse_ini_file(FILE_GA, true);
+}
+if (true === file_exists(FILE_HG)) {
+ $arrHG = parse_ini_file(FILE_HG, true);
+}
+if (true === file_exists(FILE_MG)) {
+ $arrMG = parse_ini_file(FILE_MG, true);
+}
+
$arrAdresses = array();
foreach ($arrGA as $strGA => $arrData) {
$arrGAParts = explode("/", $strGA, 3);
Modified: CometVisu/trunk/visu/edit/get_widget_diagram.php
===================================================================
--- CometVisu/trunk/visu/edit/get_widget_diagram.php 2011-10-01 09:00:10 UTC (rev 430)
+++ CometVisu/trunk/visu/edit/get_widget_diagram.php 2011-10-08 10:42:25 UTC (rev 431)
@@ -3,9 +3,17 @@
define('FILE_OW', "/etc/wiregate/owsensors.conf");
define('DIR_RRD', "/var/www/rrd/*.rrd");
-$arrOW = parse_ini_file(FILE_OW, true);
-$arrGA = parse_ini_file(FILE_GA, true);
+$arrOW = array();
+if (true === file_exists(FILE_OW)) {
+ $arrOW = parse_ini_file(FILE_OW, true);
+}
+
+$arrGA = array();
+if (true === file_exists(FILE_GA)) {
+ $arrGA = parse_ini_file(FILE_GA, true);
+}
+
$arrAdresses = array();
foreach (glob(DIR_RRD) as $filename) {
Modified: CometVisu/trunk/visu/edit/style_edit.css
===================================================================
--- CometVisu/trunk/visu/edit/style_edit.css 2011-10-01 09:00:10 UTC (rev 430)
+++ CometVisu/trunk/visu/edit/style_edit.css 2011-10-08 10:42:25 UTC (rev 431)
@@ -124,7 +124,7 @@
height: 1em;
}
-.element .value, .element .transform, .element .readonly, .element .addresstype {
+.element .value, .element .transform, .element .readonly, .element .variant {
font-weight: normal;
height: 1em;
font-size: small;
@@ -143,17 +143,17 @@
font-style: italic;
}
-.element .addresstype {
+.element .variant {
float: left;
margin-left: .4em;
font-weight: bold;
}
-.element .addresstype:before {
+.element .variant:before {
content: "(";
}
-.element .addresstype:after {
+.element .variant:after {
content: ")";
}
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-10-01 09:00:10 UTC (rev 430)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-10-08 10:42:25 UTC (rev 431)
@@ -1,16 +1,16 @@
var lingua = function(element, param) {
var texts = {
- confirm_delete: "Delete '%s' from this page?",
- confirm_save: "Save config?",
- prompt_rename: "Rename page '%s' to ...",
- save_good: "Config has been successfully saved.",
- save_bad: "Config not saved. Error: '%s'",
- value_required: "Field '%s' is required but empty. Please correct your input.",
- value_invalid: "The value for field '%s' is invalid. Please correct your input.",
- regexp_invalid: "There's something wrong with the cable.",
- getaddr_bad: "Failed to get address-config. Error: '%s'.",
- getdpt_bad: "Failed to get DPT-config. Error: '%s'.",
- getrrd_bad: "Failed to get available RRDs. Error: '%s'."
+ confirm_delete: "Delete '%s' from this page?",
+ confirm_save: "Save config?",
+ prompt_rename: "Rename page '%s' to ...",
+ save_good: "Config has been successfully saved.",
+ save_bad: "Config not saved. Error: '%s'",
+ value_required: "Field '%s' is required but empty. Please correct your input.",
+ value_invalid: "The value for field '%s' is invalid. Please correct your input.",
+ regexp_invalid: "There's something wrong with the cable.",
+ bad_get_addresses: "Failed to get address-config. Error: '%s'.",
+ bad_get_dpts: "Failed to get DPT-config. Error: '%s'.",
+ bad_get_rrds: "Failed to get available RRDs. Error: '%s'."
}
if (typeof texts[element] == "undefined") {
@@ -26,13 +26,40 @@
return myText;
}
-var addressesCache;
-var dptCache;
-var rrdCache
+/**
+ * Rename a page
+ * uses simple javascript-prompt to request a new name from the user
+ */
+function renamePage(widget) {
+ var data = Editor.getWidgetData(widget, true);
+ var newText = prompt(lingua("prompt_rename", data._attributes.name), data._attributes.name);
+ if (!newText) {
+ return;
+ }
+
+ var path = widget.data("path");
+
+ widget.find("a").html(newText);
+ widget.data("name", newText);
+ $("#pages").find("#" + path + ".page").find("h1").html(newText);
+ // update configData or next "edit" will show old name
+ widget.data("configData").attributes.name = newText;
+}
+
+
+var Editor = new CometEditor();
+var HTMLLayer = new CometEditorHTMLLayer();
+
jQuery(document).ready(function() {
+ $('#StatusBar').jnotifyInizialize({oneAtTime: false})
- $('#StatusBar').jnotifyInizialize({ oneAtTime: false })
+ // get all rrds from the server
+ Editor.cacheServerData("edit/get_widget_diagram.php", "rrdCache");
+ // get all GAs from the server
+ Editor.cacheServerData("edit/get_addresses.php", "addresses");
+ // get all known dpt from the server
+ Editor.cacheServerData("edit/dpt_list.json", "dpts");
jQuery("div#addwidgetcontrol").bind("click", function() {
$("#addMaster").triggerHandler("cleanup");
@@ -40,66 +67,9 @@
});
$("#saveconfigcontrol").bind("click", function () {
- saveConfig();
+ Editor.saveConfig();
});
- // get all GAs from the server
- $.ajax({
- url: "edit/get_addresses.php",
- type: "GET",
- dataType: "json",
- success: function(data) {
- addressesCache = data;
- },
- error: function(xhr, textStatus, e) {
- addressesCache = false;
- $('#StatusBar').jnotifyAddMessage({
- text: lingua("getaddr_bad", textStatus + " " +e),
- permanent: false,
- type: 'error',
- disappearTime: 30000
- });
- }
- });
-
- // get all known dpt from the server
- $.ajax({
- url: "edit/dpt_list.json",
- type: "GET",
- dataType: "json",
- success: function(data) {
- dptCache = data;
- },
- error: function(xhr, textStatus, e) {
- dptCache = false;
- $('#StatusBar').jnotifyAddMessage({
- text: lingua("getdpt_bad", textStatus + " " +e),
- permanent: false,
- type: 'error',
- disappearTime: 30000
- });
- }
- });
-
- // get all rrds from the server
- $.ajax({
- url: "edit/get_widget_diagram.php",
- type: "GET",
- dataType: "json",
- success: function(data) {
- rrdCache = data;
- },
- error: function(xhr, textStatus, e) {
- rrdCache = false;
- $('#StatusBar').jnotifyAddMessage({
- text: lingua("getrrd_bad", textStatus + " " +e),
- permanent: false,
- type: 'error',
- disappearTime: 30000
- });
- }
- });
-
jQuery("#pages").bind("done", function() {
$("#pages hr, #pages br").each(function() {
if ($(this).closest(".widget").length == 0) {
@@ -138,11 +108,12 @@
// "unknown" is not a good choice for a new widget :)
return;
}
- if( design.creators[index].maturity > use_maturity )
- {
+
+ if (design.creators[index].maturity > use_maturity) {
// widget is not mature enough to show in the edior
return;
}
+
$("#addMaster").find("select#add_type").append(
$("<option />").attr("value", index).html(index)
);
@@ -151,7 +122,7 @@
jQuery(".removecontrol").live("click", function() {
var widget = $(this).parents("div.widget");
- var data = getWidgetData(widget, true);
+ var data = Editor.getWidgetData(widget, true);
var t;
if (data._type == "page") {
@@ -174,7 +145,7 @@
return renamePage(widget);
}
- var data = getWidgetData(widget, true);
+ var data = Editor.getWidgetData(widget, true);
// kennzeichnen welches Element grade bearbeitet wird
widget.addClass("inedit");
@@ -215,7 +186,7 @@
myElement.find(":input").val($e.text());
}
- if (typeof addressesCache != undefined && addressesCache != false) {
+ if (typeof Editor.cache.addresses != undefined && Editor.cache.addresses != false) {
var input = myElement.find("input");
input.attr("disabled", "disabled");
myElement.append($("<input type=\"checkbox\" name=\"enable_address\" checked=\"checked\" />")
@@ -233,7 +204,7 @@
myElement.append($("<select class=\"add_address\" />")
.append($("<option />").attr("value", "").html("-")));
- myElement.find("select:first").append(getAddressesObject());
+ myElement.find("select:first").append(Editor.getAddressesObject());
myElement.find("select").bind("change", function() {
// on changing the address, the coresponding datatype-field is
@@ -255,7 +226,7 @@
}
if ($e.hasClass("transform")) {
element.find("label").html("transform");
- if (typeof dptCache == undefined || dptCache == false) {
+ if (typeof Editor.cache.dpts == undefined || Editor.cache.dpts == false) {
// appearantly we were unable to load the list of datatypes from the server
// we will provide an input-field instead
myElement.append($("<input class=\"add_transform\" />"));
@@ -267,7 +238,7 @@
myElement.append($("<select class=\"add_transform\" />")
.append($("<option />").attr("value", "").html("-")));
- myElement.find("select:first").append(getDPTObject());
+ myElement.find("select:first").append(Editor.getDPTObject());
if (typeof $e.text() != "undefined") {
myElement.find("option[value=" + $e.text() + "]").attr("selected", "selected");
@@ -283,9 +254,9 @@
}
}
- if ($e.hasClass("addresstype")) {
- element.find("label").html("addresstype");
- myElement.append($("<input class=\"add_addresstype\" />"));
+ if ($e.hasClass("variant")) {
+ element.find("label").html("variant");
+ myElement.append($("<input class=\"add_variant\" />"));
if (typeof $e.text() != "undefined") {
// pre-set the value
myElement.find(":input").val($e.text());
@@ -321,11 +292,11 @@
objData.textContent = $e.find("input.add_address").val();
objData._attributes = {};
objData._attributes.transform = $e.find(".add_transform").val();
- objData._attributes.type = $e.find(".add_addresstype").val();
+ objData._attributes.type = $e.find(".add_variant").val();
objData._attributes.readonly = $e.find(".add_readonly:checked").val();
// remove this item and insert a new one instead
- var elementDiv = createAddressEditorElement(objData);
+ var elementDiv = HTMLLayer.createAddressEditorElement(objData);
$this.closest(".element").replaceWith(elementDiv);
}))
@@ -342,11 +313,7 @@
}))
);
});
-});
-
-jQuery(function() {
- // dem addMaster Leben einhauchen
jQuery("#addMaster")
.bind("show", function() {
if ($("#pages .inedit").is(".widget")) {
@@ -384,633 +351,15 @@
// the type has been changed
// we need to change the input-field accordingly to match
// what attributes we need
- var val = jQuery(this).val();
-
- // get all the info we need to edit this piece of work
- var creator = design.getCreator(val);
- var attributes = creator.attributes || {};
- var elements = creator.elements || {};
-
- // find old input-fields in the editor to remember those values ...
- // this is need in case someone switches types while editing - and sure they want to keep their settings
- var container = $("#addMaster div.inputs");
- var values = $.extend({}, $("#addMaster").data("widgetdata"));
-
- if (!$("#pages .inedit").is(".widget")) {
- // this needs to be changed for the new settings-layout - it's completely broken right now!
- // alte Werte zwischenspeichern
- container.find(":input").each(function() {
- if ($(this).val() != "") {
- var name = $(this).data("name");
- values[name] = $(this).val();
- }
- })
- }
- container.empty();
-
- // we will need this variable later on to store our fieldset in.
- var set;
- if (typeof creator.content.type != "undefined" && creator.content.type == "string") {
-
- var element = $("<div />").addClass("add_input").addClass("content")
- .append($("<label />").attr("for", "add_textContent").html("text-content"))
- .append($("<div class=\"input\" />")
- .append($("<input type=\"text\" id=\"add_textContent\"/>"))
- );
- if (typeof values["textContent"] != "undefined") {
- element.find("input").val(values["textContent"]);
- }
-
- element.find(":input").data("required", creator.content.required);
-
- container.append(element);
- delete element;
- }
-
- if (false === jQuery.isEmptyObject(elements)) {
- // we've got elements we need to addit :)
- container.append(set = jQuery("<fieldset />").addClass("elements"));
- jQuery.each(elements, function(index, e) {
- var $line = $("<div />").addClass("add_input")
- .append($("<label />").attr("for", "add_" + index).html(index))
- .append($("<div class=\"input\" />"));
- var $input = $line.find("div.input");
-
- switch (e.type) {
- case "address":
- // create a fake input-element to store our data later on
- $input.append(jQuery("<input type=\"hidden\" id=\"add_" + index + "\" class=\"multi address\" />"));
-
- // create the real inputs-thingy-thing
- $input.append('<div><div class="add_element">+</div><div class="multi_element address" /></div>');
- $input.find(".add_element").click(function() {
- // insert a new, empty sub-element
- var objData = {};
- // don't try to hide it: this is hardcoded and works for addresses only
- objData.type = "address";
- objData.textContent = "";
- objData._attributes = {};
- objData._attributes.transform = "";
- objData._attributes.type = "";
- objData._attributes.readonly = false;
-
- var elementDiv = createAddressEditorElement(objData);
- $input.find("div.multi_element").append(elementDiv);
- });
-
- if (typeof values._elements != "undefined"
- && typeof values._elements[index] != "undefined") {
- $.each(values._elements[index], function(i, e) {
- var elementDiv = createAddressEditorElement(e);
- $input.find("div.multi_element").append(elementDiv);
- });
- }
- break;
- default:
- // add an unknown element (e.g. the label)
- if (e.multi == false) {
- // this element can appear only once
- $input.append(jQuery("<input type=\"text\" id=\"add_" + index + "\" />"));
-
- if (typeof values._elements != "undefined"
- && typeof values._elements[index] != "undefined") {
- ...
[truncated message content] |