First version of zigbee node api and views

pull/593/head
Simon Stürz 2021-05-13 13:20:14 +02:00 committed by Michael Zanetti
parent 6c37b3a750
commit 0686bc2df2
8 changed files with 744 additions and 151 deletions

View File

@ -30,7 +30,10 @@
#include "zigbeemanager.h"
#include <QMetaEnum>
#include "engine.h"
#include "logging.h"
#include "jsonrpc/jsonrpcclient.h"
#include "zigbee/zigbeeadapter.h"
#include "zigbee/zigbeeadapters.h"
@ -39,9 +42,6 @@
#include "zigbee/zigbeenode.h"
#include "zigbee/zigbeenodes.h"
#include <QMetaEnum>
#include "logging.h"
NYMEA_LOGGING_CATEGORY(dcZigbee, "Zigbee")
ZigbeeManager::ZigbeeManager(QObject *parent) :

View File

@ -105,6 +105,7 @@ private:
ZigbeeAdapter *unpackAdapter(const QVariantMap &adapterMap);
ZigbeeNetwork *unpackNetwork(const QVariantMap &networkMap);
ZigbeeNode *unpackNode(const QVariantMap &nodeMap);
void fillNetworkData(ZigbeeNetwork *network, const QVariantMap &networkMap);
void addOrUpdateNode(ZigbeeNetwork *network, const QVariantMap &nodeMap);
};

View File

@ -56,13 +56,15 @@ void ZigbeeNodesProxy::setZigbeeNodes(ZigbeeNodes *zigbeeNodes)
qWarning() << "Set nodes to proxy" << m_zigbeeNodes->rowCount();
connect(m_zigbeeNodes, &ZigbeeNodes::countChanged, this, [this](){
sort(0, Qt::AscendingOrder);
emit countChanged();
});
setSourceModel(m_zigbeeNodes);
// Sort by network address so the coordinator will always be on the top
setSortRole(ZigbeeNodes::RoleNetworkAddress);
sort(0, Qt::DescendingOrder);
invalidateFilter();
sort(0, Qt::AscendingOrder);
emit countChanged();
}

View File

@ -263,5 +263,7 @@
<file>ui/images/setupwizard/wired-connection.svg</file>
<file>ui/images/setupwizard/wireless-connection.svg</file>
<file>ui/images/system-suspend.svg</file>
<file>ui/images/zigbee-enddevice.svg</file>
<file>ui/images/zigbee-router.svg</file>
</qresource>
</RCC>

View File

@ -0,0 +1,208 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96"
height="96"
id="svg4874"
version="1.1"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
viewBox="0 0 96 96.000001"
sodipodi:docname="zigbee-enddevice.svg">
<defs
id="defs4876" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="16.696087"
inkscape:cx="28.832295"
inkscape:cy="59.448636"
inkscape:document-units="px"
inkscape:current-layer="g4780"
showgrid="true"
showborder="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="2880"
inkscape:window-height="1663"
inkscape:window-x="0"
inkscape:window-y="76"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid5451"
empspacing="8" />
<sodipodi:guide
orientation="1,0"
position="8,-8.0000001"
id="guide4063"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="4,-8.0000001"
id="guide4065"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-8,88.000001"
id="guide4067"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-8,92.000001"
id="guide4069"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="104,4"
id="guide4071"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-5,8.0000001"
id="guide4073"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="92,-8.0000001"
id="guide4075"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="88,-8.0000001"
id="guide4077"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-8,84.000001"
id="guide4074"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="12,-8.0000001"
id="guide4076"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-5,12"
id="guide4078"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="84,-9.0000001"
id="guide4080"
inkscape:locked="false" />
<sodipodi:guide
position="48,83.568528"
orientation="1,0"
id="guide4170"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata4879">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(67.857146,-78.50504)">
<g
transform="matrix(0,-1,-1,0,373.50506,516.50504)"
id="g4845"
style="display:inline">
<g
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="next01.png"
transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
id="g4778"
inkscape:label="Layer 1">
<g
transform="matrix(-1,0,0,1,575.99999,611)"
id="g4780"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
id="rect4782"
width="96.037987"
height="96"
x="-438.00244"
y="345.36221"
transform="scale(-1,1)" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 362.97266,406.36133 c -7.15818,0 -13.00391,-5.84338 -13.00391,-13 0,-7.15663 5.84573,-13 13.00391,-13 7.15817,0 13.00586,5.84337 13.00586,13 0,7.15662 -5.84769,13 -13.00586,13 z m 0,-4 c 4.99683,0 9.0039,-4.00642 9.0039,-9 0,-4.99358 -4.00707,-9 -9.0039,-9 -4.99684,0 -9.00391,4.00642 -9.00391,9 0,4.99358 4.00707,9 9.00391,9 z"
id="path4184"
inkscape:connector-curvature="0" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 416.99414,379.36133 c -7.15817,0 -13.00391,-5.84338 -13.00391,-13 0,-7.15663 5.84574,-13 13.00391,-13 7.15817,0 13.00586,5.84337 13.00586,13 0,7.15662 -5.84769,13 -13.00586,13 z m 0,-4 c 4.99684,0 9.00391,-4.00642 9.00391,-9 0,-4.99358 -4.00707,-9 -9.00391,-9 -4.99684,0 -9.00391,4.00642 -9.00391,9 0,4.99358 4.00707,9 9.00391,9 z"
id="ellipse4187"
inkscape:connector-curvature="0" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 416.99414,433.36133 c -7.15817,0 -13.00391,-5.84338 -13.00391,-13 0,-7.15663 5.84574,-13 13.00391,-13 7.15817,0 13.00586,5.84337 13.00586,13 0,7.15662 -5.84769,13 -13.00586,13 z m 0,-4 c 4.99684,0 9.00391,-4.00642 9.00391,-9 0,-4.99358 -4.00707,-8.99805 -9.00391,-8.99805 -4.99684,0 -9.00391,4.00447 -9.00391,8.99805 0,4.99358 4.00707,9 9.00391,9 z"
id="ellipse4189"
inkscape:connector-curvature="0" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.71689701;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 408.12774,413.01849 c -0.89417,1.25396 -1.63869,2.59727 -2.23054,4.0082 l -33.82827,-15.32895 2.21603,-4.01697 z m -0.39434,-38.27963 -33.49925,15.74337 -2.27892,-3.98627 33.67827,-15.82669 c 0.54157,1.43042 1.25002,2.79005 2.0999,4.06959 z"
id="path4191"
inkscape:connector-curvature="0" />
<ellipse
style="display:inline;opacity:1;fill:#808080;fill-opacity:1;stroke:#808080;stroke-width:4.18019915;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="path837"
cx="-420.36221"
cy="-416.90497"
rx="5.9101963"
ry="5.9131913"
transform="matrix(0,-1,-1,0,0,0)" />
<ellipse
style="display:inline;opacity:1;fill:#808080;fill-opacity:1;stroke:#808080;stroke-width:4.18019915;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="path837-3"
cx="-366.36221"
cy="-416.99414"
rx="5.9101963"
ry="5.9131913"
transform="matrix(0,-1,-1,0,0,0)" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96"
height="96"
id="svg4874"
version="1.1"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
viewBox="0 0 96 96.000001"
sodipodi:docname="zigbee-router.svg">
<defs
id="defs4876" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="16.696087"
inkscape:cx="46.441211"
inkscape:cy="59.448636"
inkscape:document-units="px"
inkscape:current-layer="g4780"
showgrid="true"
showborder="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="2880"
inkscape:window-height="1663"
inkscape:window-x="0"
inkscape:window-y="76"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid5451"
empspacing="8" />
<sodipodi:guide
orientation="1,0"
position="8,-8.0000001"
id="guide4063"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="4,-8.0000001"
id="guide4065"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-8,88.000001"
id="guide4067"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-8,92.000001"
id="guide4069"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="104,4"
id="guide4071"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-5,8.0000001"
id="guide4073"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="92,-8.0000001"
id="guide4075"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="88,-8.0000001"
id="guide4077"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-8,84.000001"
id="guide4074"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="12,-8.0000001"
id="guide4076"
inkscape:locked="false" />
<sodipodi:guide
orientation="0,1"
position="-5,12"
id="guide4078"
inkscape:locked="false" />
<sodipodi:guide
orientation="1,0"
position="84,-9.0000001"
id="guide4080"
inkscape:locked="false" />
<sodipodi:guide
position="48,83.568528"
orientation="1,0"
id="guide4170"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata4879">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(67.857146,-78.50504)">
<g
transform="matrix(0,-1,-1,0,373.50506,516.50504)"
id="g4845"
style="display:inline">
<g
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="next01.png"
transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
id="g4778"
inkscape:label="Layer 1">
<g
transform="matrix(-1,0,0,1,575.99999,611)"
id="g4780"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
id="rect4782"
width="96.037987"
height="96"
x="-438.00244"
y="345.36221"
transform="scale(-1,1)" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 362.97266,406.36133 c -7.15818,0 -13.00391,-5.84338 -13.00391,-13 0,-7.15663 5.84573,-13 13.00391,-13 7.15817,0 13.00586,5.84337 13.00586,13 0,7.15662 -5.84769,13 -13.00586,13 z m 0,-4 c 4.99683,0 9.0039,-4.00642 9.0039,-9 0,-4.99358 -4.00707,-9 -9.0039,-9 -4.99684,0 -9.00391,4.00642 -9.00391,9 0,4.99358 4.00707,9 9.00391,9 z"
id="path4184"
inkscape:connector-curvature="0" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 416.99414,379.36133 c -7.15817,0 -13.00391,-5.84338 -13.00391,-13 0,-7.15663 5.84574,-13 13.00391,-13 7.15817,0 13.00586,5.84337 13.00586,13 0,7.15662 -5.84769,13 -13.00586,13 z m 0,-4 c 4.99684,0 9.00391,-4.00642 9.00391,-9 0,-4.99358 -4.00707,-9 -9.00391,-9 -4.99684,0 -9.00391,4.00642 -9.00391,9 0,4.99358 4.00707,9 9.00391,9 z"
id="ellipse4187"
inkscape:connector-curvature="0" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 416.99414,433.36133 c -7.15817,0 -13.00391,-5.84338 -13.00391,-13 0,-7.15663 5.84574,-13 13.00391,-13 7.15817,0 13.00586,5.84337 13.00586,13 0,7.15662 -5.84769,13 -13.00586,13 z m 0,-4 c 4.99684,0 9.00391,-4.00642 9.00391,-9 0,-4.99358 -4.00707,-8.99805 -9.00391,-8.99805 -4.99684,0 -9.00391,4.00447 -9.00391,8.99805 0,4.99358 4.00707,9 9.00391,9 z"
id="ellipse4189"
inkscape:connector-curvature="0" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.71689701;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 408.12774,413.01849 c -0.89417,1.25396 -1.63869,2.59727 -2.23054,4.0082 l -33.82827,-15.32895 2.21603,-4.01697 z m -0.39434,-38.27963 -33.49925,15.74337 -2.27892,-3.98627 33.67827,-15.82669 c 0.54157,1.43042 1.25002,2.79005 2.0999,4.06959 z"
id="path4191"
inkscape:connector-curvature="0" />
<ellipse
style="opacity:1;fill:#808080;fill-opacity:1;stroke:#808080;stroke-width:4.18019915;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="path837"
cx="-393.36221"
cy="-362.97278"
transform="matrix(0,-1,-1,0,0,0)"
rx="5.9101963"
ry="5.9131913" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -52,7 +52,6 @@ SettingsPageBase {
}
}
Connections {
target: root.zigbeeManager
onAddNetworkReply: {

View File

@ -46,6 +46,12 @@ SettingsPageBase {
backButtonVisible: true
onBackPressed: pageStack.pop()
HeaderButton {
imageSource: "/ui/images/help.svg"
text: qsTr("Network settings")
onClicked: pageStack.push(zigbeeHelpPage)
}
HeaderButton {
imageSource: "/ui/images/configure.svg"
text: qsTr("Network settings")
@ -54,6 +60,7 @@ SettingsPageBase {
}
busy: d.pendingCommandId != -1
QtObject {
id: d
property int pendingCommandId: -1
@ -91,13 +98,20 @@ SettingsPageBase {
text: qsTr("Network")
}
RowLayout {
Layout.fillWidth: true
ColumnLayout {
spacing: app.margins
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
RowLayout {
Layout.fillWidth: true
Label {
Layout.fillWidth: true
text: qsTr("Network state:")
}
Label {
//Layout.fillWidth: true
text: {
switch (network.networkState) {
case ZigbeeNetwork.ZigbeeNetworkStateOnline:
@ -134,31 +148,38 @@ SettingsPageBase {
}
}
RowLayout {
Layout.fillWidth: true
Label {
Layout.fillWidth: true
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
text: qsTr("Channel") + ": " + network.channel
text: qsTr("Channel")
}
Label {
text: network.channel
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
Label {
Layout.fillWidth: true
text: qsTr("Permit new devices:")
}
Label {
text: network.permitJoiningEnabled ? qsTr("Open for %0 s").arg(network.permitJoiningRemaining) : qsTr("Closed")
}
ColorIcon {
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
name: network.permitJoiningEnabled ? "/ui/images/lock-open.svg" : "/ui/images/lock-closed.svg"
visible: !network.permitJoiningEnabled
}
Canvas {
id: canvas
Layout.preferredHeight: Style.iconSize
@ -204,15 +225,14 @@ SettingsPageBase {
Button {
Layout.fillWidth: true
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
text: network.permitJoiningEnabled ? qsTr("Extend open duration") : qsTr("Open for new devices")
enabled: network.networkState === ZigbeeNetwork.ZigbeeNetworkStateOnline
onClicked: zigbeeManager.setPermitJoin(network.networkUuid)
}
}
SettingsPageSectionHeader {
text: qsTr("Zigbee nodes")
}
@ -225,25 +245,32 @@ SettingsPageBase {
}
delegate: BigTile {
property ZigbeeNode node: root.network.nodes.get(index)
Layout.fillWidth: true
interactive: false
property ZigbeeNode node: zigbeeNodesProxy.get(index)
contentItem: ColumnLayout {
spacing: app.margins
Loader {
id: nodeTypeLoader
Layout.fillWidth: true
sourceComponent: node.type === ZigbeeNode.ZigbeeNodeTypeCoordinator ? coordinatorComponent : deviceComponent
sourceComponent: node ? (node.type === ZigbeeNode.ZigbeeNodeTypeCoordinator ? zigbeeCoordinatorComponent : zigbeeDeviceComponent) : null
}
Component {
id: coordinatorComponent
id: zigbeeCoordinatorComponent
ColumnLayout {
RowLayout {
ColorIcon {
id: coordinatorIcon
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
name: "/ui/images/zigbee.svg"
}
Led {
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
@ -265,18 +292,19 @@ SettingsPageBase {
Label {
Layout.fillWidth: true
text: qsTr("Coordinator")
text: network.backend + " " + qsTr("network coordinator")
}
}
Label { text: network.backend }
Label {
visible: node.version !== ""
text: qsTr("Version") + ": " + network.firmwareVersion
}
Label {
text: qsTr("IEEE address") + ": " + node.ieeeAddress
}
Label {
text: qsTr("Network address") + ": 0x" + (node.networkAddress + Math.pow(16, 4)).toString(16).slice(-4).toUpperCase();
}
@ -284,15 +312,36 @@ SettingsPageBase {
}
Component {
id: deviceComponent
id: zigbeeDeviceComponent
ColumnLayout {
RowLayout {
id: nodeHeaderRowLayout
ColorIcon {
id: deviceTypeIcon
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
name: node ? (node.type === ZigbeeNode.ZigbeeNodeTypeRouter ? "/ui/images/zigbee-router.svg" : "/ui/images/zigbee-enddevice.svg") : "/ui/images/zigbee-enddevice.svg"
}
Led {
id: reachableLed
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
state: node.reachable ? "on" : "red"
state: {
if (!node)
return "off"
if (node.state !== ZigbeeNode.ZigbeeNodeStateInitialized) {
return "orange"
}
if (node.reachable) {
return "on"
} else {
return "red"
}
}
}
Connections {
@ -321,19 +370,49 @@ SettingsPageBase {
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
running: visible
visible: node.state !== ZigbeeNode.ZigbeeNodeStateInitialized
visible: node ? node.state !== ZigbeeNode.ZigbeeNodeStateInitialized : false
}
Label {
Layout.fillWidth: true
text: node.type === ZigbeeNode.ZigbeeNodeTypeRouter ? qsTr("Router") : qsTr("End device")
text: node ? node.model : ""
}
Label {
text: signalStrengthIcon.signalStrength + "%"
}
ColorIcon {
id: signalStrengthIcon
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
property int signalStrength: node ? Math.round(node.lqi * 100.0 / 255.0) : 0
name: {
if (!node || !node.reachable)
return "/ui/images/connections/nm-signal-00.svg"
if (signalStrength <= 25)
return "/ui/images/connections/nm-signal-25.svg"
if (signalStrength <= 50)
return "/ui/images/connections/nm-signal-50.svg"
if (signalStrength <= 75)
return "/ui/images/connections/nm-signal-75.svg"
if (signalStrength <= 100)
return "/ui/images/connections/nm-signal-100.svg"
}
}
Loader {
id: iconLoader
id: sleepyIconLoader
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
active: !node.rxOnWhenIdle
active: node ? !node.rxOnWhenIdle : false
visible: active
sourceComponent: sleepyDeviceComponent
}
@ -345,44 +424,146 @@ SettingsPageBase {
}
}
RowLayout {
id: nodeDescriptionRow
ColumnLayout {
Layout.fillWidth: true
Label {
text: node.manufacturer + " - " + node.model
text: node ? node.manufacturer + (node.version !== "" ? " (" + node.version + ")" : "") : ""
}
Label {
visible: node.version !== ""
text: qsTr("Version") + ": " + node.version
text: qsTr("IEEE address") + ": " + (node ? node.ieeeAddress : "")
}
Label {
text: qsTr("IEEE address") + ": " + node.ieeeAddress
Layout.fillWidth: true
text: qsTr("Network address") + (node ? ": 0x" + (node.networkAddress + Math.pow(16, 4)).toString(16).slice(-4).toUpperCase() : "")
}
}
ColumnLayout {
Item {
// Spacing item
Layout.fillHeight: true
}
ProgressButton {
size: Style.iconSize
imageSource: "/ui/images/delete.svg"
longpressEnabled: false
onClicked: {
var dialog = removeZigbeeNodeDialogComponent.createObject(app, {zigbeeNode: node})
dialog.open()
}
}
}
}
}
}
}
}
}
Component {
id: removeZigbeeNodeDialogComponent
MeaDialog {
id: removeZigbeeNodeDialog
property ZigbeeNode zigbeeNode
headerIcon: "/ui/images/zigbee.svg"
title: qsTr("Remove zigbee node") + " " + (zigbeeNode ? zigbeeNode.model : "")
text: qsTr("Are you sure you want to remove this node from the network?")
standardButtons: Dialog.Ok | Dialog.Cancel
Label {
text: qsTr("Please note that if this node has been assigned to a thing, it will also be removed from the system.")
Layout.fillWidth: true
wrapMode: Text.WordWrap
}
onAccepted: {
d.removeNode(zigbeeNode.networkUuid, zigbeeNode.ieeeAddress)
}
}
}
Component {
id: zigbeeHelpPage
SettingsPageBase {
id: root
title: qsTr("ZigBee network help")
header: NymeaHeader {
text: qsTr("ZigBee network help")
backButtonVisible: true
onBackPressed: pageStack.pop()
}
ColumnLayout {
Layout.fillWidth: true
Layout.topMargin: 2 * app.margins
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
RowLayout {
spacing: app.margins
ColorIcon {
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
name: "/ui/images/zigbee.svg"
}
Label {
text: qsTr("Network address") + ": 0x" + (node.networkAddress + Math.pow(16, 4)).toString(16).slice(-4).toUpperCase();
text: qsTr("Zigbee network coordinator")
}
}
RowLayout {
spacing: app.margins
ColorIcon {
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
name: "/ui/images/zigbee-router.svg"
}
Label {
text: qsTr("Signal strength") + ": " + Math.round(node.lqi * 100.0 / 255.0) + "%"
}
Button {
id: removeNodeButton
text: qsTr("Remove node")
onClicked: d.removeNode(network.networkUuid, node.ieeeAddress)
}
}
}
text: qsTr("Zigbee router")
}
}
RowLayout {
spacing: app.margins
ColorIcon {
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
name: "/ui/images/zigbee-enddevice.svg"
}
// NymeaSwipeDelegate {
// Layout.fillWidth: true
// iconName: "../images/zigbee.svg"
// text: node.manufacturer + " - " + node.model + " - " + node.version
// subText: node.ieeeAddress + " " + node.networkAddress
// }
Label {
text: qsTr("Zigbee end device")
}
}
RowLayout {
spacing: app.margins
ColorIcon {
Layout.preferredHeight: Style.iconSize
Layout.preferredWidth: Style.iconSize
name: "/ui/images/system-suspend.svg"
}
Label {
text: qsTr("Sleepy device")
}
}
}
}
}
}