diff --git a/fhem/FHEM/00_ZWDongle.pm b/fhem/FHEM/00_ZWDongle.pm index b05730bd3..88cb00552 100755 --- a/fhem/FHEM/00_ZWDongle.pm +++ b/fhem/FHEM/00_ZWDongle.pm @@ -141,6 +141,7 @@ ZWDongle_Define($$) return $ret; } +##################################### sub ZWDongle_fhemwebFn($$$$) { @@ -150,7 +151,7 @@ ZWDongle_fhemwebFn($$$$) my $np = AttrVal($d,'neighborListPos','360,430'); return - "
". + "". "". "". ' JSEND } + +sub +ZWDongle_nlData($) +{ + my ($d) = @_; + my @a = devspec2array("TYPE=ZWave,FILTER=IODev=$d"); + my (@dn, %nb, @ret); + + for my $e (@a) { + my $nl = ReadingsVal($e, "neighborList", ""); $nl =~ s/,/ /g; + my $pos = AttrVal($e, "neighborListPos", ""); + push @dn, $e if($nl =~ m/\b$d\b/); + $nl = '"'.join('","',split(" ", $nl)).'"' if($nl); + push @ret, "\"$e\":{\"txt\":\"$e\",\"pos\":[$pos],". + "\"class\":\"zwBox\",\"neighbors\":[$nl] }"; + $nb{$e} = $nl; + } + my $pos = AttrVal($d, "neighborListPos", ""); + my $nl = (@dn ? '"'.join('","',@dn).'"' : ''); + push @ret, "\"$d\":{\"txt\":\"$d\", \"pos\":[$pos],". + "\"class\":\"zwDongle\",\"neighbors\":[$nl] }"; + return "{ \"saveFn\":\"attr {1} neighborListPos {2}\",". + "\"el\":{".join(",",@ret)."} }"; +} + ##################################### sub ZWDongle_Undef($$) diff --git a/fhem/FHEM/ZWLib.pm b/fhem/FHEM/ZWLib.pm index a5be96732..29c440a0c 100644 --- a/fhem/FHEM/ZWLib.pm +++ b/fhem/FHEM/ZWLib.pm @@ -241,4 +241,4 @@ zwlib_parseNodeInfo(@) return join(" ", @list); } -1; \ No newline at end of file +1; diff --git a/fhem/www/pgm2/brightstyle.css b/fhem/www/pgm2/brightstyle.css index f9097194e..65d8f83b0 100644 --- a/fhem/www/pgm2/brightstyle.css +++ b/fhem/www/pgm2/brightstyle.css @@ -107,3 +107,10 @@ div#svgmarker { } div.detLink { display:inline-block; margin-right:0.5em; } + +.zwBox { stroke:#333333; stroke-width:2px; fill:#eeeeee; } +.zwDongle { stroke:red; stroke-width:2px; fill:#eeeeee; } +.zwMargin { stroke:#333333; stroke-width:1px; fill:none; } +.zwLine { stroke:#333333; stroke-width:1px; } +.zwArrowHead { fill:#333333; stroke-width:1px; } +svg.zw_nr { height:auto; width:auto; margin:0; } diff --git a/fhem/www/pgm2/darkCommon.css b/fhem/www/pgm2/darkCommon.css index 608c9ee26..a362b5c9c 100644 --- a/fhem/www/pgm2/darkCommon.css +++ b/fhem/www/pgm2/darkCommon.css @@ -19,3 +19,4 @@ div.detLink { display:inline-block; margin-right:0.5em; } .zwMargin { stroke:#fff; stroke-width:1px; fill:none; } .zwLine { stroke:#fff; stroke-width:1px; } .zwArrowHead { fill:#fff; stroke-width:1px; } +svg.zw_nr { height:auto; width:auto; margin:0; } diff --git a/fhem/www/pgm2/defaultCommon.css b/fhem/www/pgm2/defaultCommon.css index 09161e52d..48a62b3f3 100644 --- a/fhem/www/pgm2/defaultCommon.css +++ b/fhem/www/pgm2/defaultCommon.css @@ -79,7 +79,7 @@ span.sort-item-delete-link { .set .set { margin-bottom:2px; margin-top:3px; } /* timepicker */ pre { white-space: pre-wrap; } -svg:not(.zw_nr) { height:32px; width:32px; vertical-align:middle; margin:2px 0;} +svg { height:32px; width:32px; vertical-align:middle; margin:2px 0;} svg:not([fill]):not(.jssvg) { fill:#278727; } svg.on,svg.FS20_on { fill:orange!important; } @@ -138,3 +138,4 @@ select [value^=l8] { color: yellow; } .zwMargin { stroke:#278727; stroke-width:1px; fill:none; } .zwLine { stroke:#278727; stroke-width:1px; } .zwArrowHead { fill:#278727; stroke-width:1px; } +svg.zw_nr { height:auto; width:auto; margin:0; } diff --git a/fhem/www/pgm2/ios6Common.css b/fhem/www/pgm2/ios6Common.css index 1939c249b..aec2af48e 100644 --- a/fhem/www/pgm2/ios6Common.css +++ b/fhem/www/pgm2/ios6Common.css @@ -255,3 +255,4 @@ div#svgmarker { .zwMargin { stroke:#c0c0c0; stroke-width:1px; fill:none; } .zwLine { stroke:#c0c0c0; stroke-width:1px; } .zwArrowHead { fill:#c0c0c0; stroke-width:1px; } +svg.zw_nr { height:auto; width:auto; margin:0; } diff --git a/fhem/www/pgm2/ios7Common.css b/fhem/www/pgm2/ios7Common.css index 6ea5c6c62..4450b88c7 100644 --- a/fhem/www/pgm2/ios7Common.css +++ b/fhem/www/pgm2/ios7Common.css @@ -34,3 +34,4 @@ div#svgmarker { .zwMargin { stroke:#c0c0c0; stroke-width:1px; fill:none; } .zwLine { stroke:#c0c0c0; stroke-width:1px; } .zwArrowHead { fill:#147bff; stroke-width:1px; } +svg.zw_nr { height:auto; width:auto; margin:0; } diff --git a/fhem/www/pgm2/zwave_neighborlist.js b/fhem/www/pgm2/zwave_neighborlist.js index bb23ec227..38c57b483 100644 --- a/fhem/www/pgm2/zwave_neighborlist.js +++ b/fhem/www/pgm2/zwave_neighborlist.js @@ -2,15 +2,14 @@ var zw_visible; var svgns = 'xmlns="http://www.w3.org/2000/svg"'; function -zw_nr(dongle, dpos) +zw_nl(fhemFn) { - log("ZWNR called for "+dongle+": "+zw_visible); + log("ZWNL called with "+fhemFn); zw_visible = !zw_visible; var txt = (zw_visible ? 'Hide' : 'Show'); - var width=720,height=480; - $('#ZWDongleNr') - .html(''+txt+' neighbor list'); + var width=960,height=480; + $('#ZWDongleNr').html(''+txt+' neighbor map'); if(!zw_visible) { $("#ZWDongleNrSVG") @@ -19,49 +18,32 @@ zw_nr(dongle, dpos) return; } - var h={}, ldev, xpos=20, ypos=20; - var dp = dpos.split(","); - - h[dongle] = { txt:dongle, pos:[ parseInt(dp[0]), parseInt(dp[1]) ], lines:[], - width:40, height:30, class:'zwDongle', neighbors:[] }; + FW_cmd(FW_root+"?cmd={"+fhemFn+"}&XHR=1", function(r){ + var xpos=20, ypos=20, fnRet = JSON.parse(r); - var cmd = FW_root+"?cmd=list ZWaveSubDevice=no,FILTER=IODev="+dongle+ - " neighborList timeToAck neighborListPos&XHR=1"; - FW_cmd(cmd, function(r){ - console.log(r); - var la = r.split("\n"); - for(var i1=0; i1