From 3f54876cfb73fbc7d1f70a5a84fcca4a568141ef Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Mon, 24 Feb 2014 10:55:21 +0000 Subject: [PATCH] SVG: ploteditor attribute from justme1968 git-svn-id: https://svn.fhem.de/fhem/trunk@5038 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/01_FHEMWEB.pm | 19 +++++++++++++++++-- fhem/FHEM/98_SVG.pm | 37 +++++++++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 9217f32f8..039c88942 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -135,6 +135,7 @@ FHEMWEB_Initialize($) longpoll:0,1 longpollSVG:1,0 menuEntries + ploteditor:always,onClick,never plotfork:1,0 plotmode:gnuplot,gnuplot-scroll,SVG plotsize @@ -2540,6 +2541,13 @@ FW_ActivateInform() is not used if the SVG has the attribute startDate defined.

+ +
  • ploteditor
    + Configures if the Plot editor should be shown + in the SVG detail view. + Can be set to always, onClick or never. Default is always. +

  • +
  • plotfork
    If set, generate the logs in a parallel process. Note: do not use it @@ -2696,7 +2704,7 @@ FW_ActivateInform() need some help from the #FileLog definition in the .gplot file: the filter used there (second parameter) must either contain only the deviceName or have the form deviceName.event or deviceName.*. This is - always the case when using the Plot + always the case when using the Plot editor. The SVG will be reloaded for any event triggered by this deviceName. Default is off. @@ -3021,6 +3029,13 @@ FW_ActivateInform() Attribut startDate benutzt wird.

  • + +
  • ploteditor
    + Gibt an ob der Plot Editor in der SVG detail + ansicht angezeigt werden soll. Kann auf always, onClick oder never + gesetzt werden. Der Default ist always. +

  • +
  • plotfork
    Normalerweise wird die Ploterstellung im Hauptprozess ausgeführt, @@ -3180,7 +3195,7 @@ FW_ActivateInform() Lädt SVG Instanzen erneut, falls ein Ereignis dessen Inhalt ändert. Funktioniert nur, falls der dazugehörige #FileLog Definition in der .gplot Datei folgenden Form hat: deviceName.Event - bzw. deviceName.*. Wenn man den Plot + bzw. deviceName.*. Wenn man den Plot Editor benutzt, ist das übrigens immer der Fall. Die SVG Datei wird bei jedem auslösenden Event dieses Gerätes neu geladen. Standard ist aus. diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm index 79c7b5913..8ca8ed32d 100755 --- a/fhem/FHEM/98_SVG.pm +++ b/fhem/FHEM/98_SVG.pm @@ -242,6 +242,10 @@ SVG_PEdit($$$$) { my ($FW_wname,$d,$room,$pageHash) = @_; + my $pe = AttrVal($FW_wname, "ploteditor", "always"); + + return "" if( $pe eq 'never' ); + my $ld = $defs{$d}{LOGDEVICE}; my $ldt = $defs{$ld}{TYPE}; @@ -251,9 +255,22 @@ SVG_PEdit($$$$) my %conf = SVG_digestConf($cfg, $plot); my $ret = "
    "; - $ret .= "
    Show Plot Editor"; + $pestyle = 'style="display:none"'; + } + + $ret .= ""; - $ret .= FW_hidden("detail", $d); + $ret .= "Plot Editor"; + $ret .= FW_hidden("gplotName", $gp); $ret .= FW_hidden("gplotName", $gp); $ret .= FW_hidden("logdevicetype", $ldt); $ret .= ""; @@ -1768,9 +1785,10 @@ plotAsPng(@) Plot-Editor -
      +
      This editor is visible on the detail screen of the SVG instance. Most features are obvious here, up to some exceptions: +
      • if you want to omit the title for a Diagram label, enter notitle in the input field.
      • if you want to specify a fixed value (not taken from a column) if a @@ -1786,6 +1804,8 @@ plotAsPng(@) Write .gplot file again
    + The visibility of the ploteditor can be configured with the FHEMWEB attribute + ploteditor.
    @@ -1915,7 +1935,8 @@ plotAsPng(@) Kurve(FileLog)
    • Fhem config:
      - attr wl_1 label "Max $data{max1}, Current $data{currval1}"
    • + attr wl_1 label "Max $data{max1}, Current + $data{currval1}"
    • Eintrag in der .gplot-Datei:
      set title <L1>
    @@ -1950,7 +1971,8 @@ plotAsPng(@)
  • #DbLog <SPEC1>
    mit:
    - attr <SVGdevice> plotfunction "Garage_Raumtemp:temperature::"
    + attr <SVGdevice> plotfunction + "Garage_Raumtemp:temperature::"
    anstelle von:
    #DbLog Garage_Raumtemp:temperature::
  • @@ -1961,10 +1983,11 @@ plotAsPng(@) Plot-Editor -
      +
      Dieser Editor ist in der Detailansicht der SVG-Instanz zu sehen. Die meisten Features sind hier einleuchtend und bekannt, es gibt aber auch einige Ausnahmen: +
      • wenn für ein Diagramm die Überschrift unterdrückt werden soll, muss im Eingabefeld notitle eingetragen werden.
      • @@ -1985,6 +2008,8 @@ plotAsPng(@)
    + Die sichtbarkeit des Plot-Editors kann mit dem FHEMWEB Attribut ploteditor konfiguriert werden.