From 710b6c0b6b740a5e1d7544a83db314ec70714a8a Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Wed, 30 Oct 2019 17:08:06 +0800
Subject: [PATCH] update
Former-commit-id: 3956ab3edd344fdd184b93f317633a81f994252c
---
projects/IoTCenter/Views/Home/Node.cshtml | 10 ++-
projects/IoTCenter/iotcenter.db | Bin 462848 -> 462848 bytes
.../Assets/StreamingAssets/wwwroot/js/node.js | 66 +++++++++++++++++-
.../Assets/StreamingAssets/wwwroot/node.html | 10 ++-
projects/IoTNode/iotnode.db | Bin 499712 -> 499712 bytes
5 files changed, 80 insertions(+), 6 deletions(-)
diff --git a/projects/IoTCenter/Views/Home/Node.cshtml b/projects/IoTCenter/Views/Home/Node.cshtml
index 508228d4..59a108de 100644
--- a/projects/IoTCenter/Views/Home/Node.cshtml
+++ b/projects/IoTCenter/Views/Home/Node.cshtml
@@ -108,7 +108,12 @@
@section scripts{
+
-
}
\ No newline at end of file
diff --git a/projects/IoTCenter/iotcenter.db b/projects/IoTCenter/iotcenter.db
index d0336941f57ecdd332e5b6a3bd44d2cbdbf339c5..6db246fd83852b9dee80de83094b01a56f8b0f97 100644
GIT binary patch
delta 1129
zcmbVLO=uHA6rTN^Z8q6hs}!-t)TTCCH|*~0HoH
Vy@8~1mytpN7H_uMqwilsOmrP<@SBTjd$VsF-@_^gQdQt*RsfbA)rj?-6}6A`AD
zQfx~}*vOP^*YadtH(l9DAYD$nih^|HDW2tam4Plw+OBEa1QWAl-7-AcG>|RFY$xV9
zhMv%okuC!bPggD5uw*0I?#McF+hwcWOvtD`<|GnH-EnlKvkYuWIF_ZFUQ*VRNRxF#
z^JLppld|i1hGKa(LW-9vy>@A9W_7ta_BG$(+s@Z<1ujWiToYn?c=jfHoHVpA#5`kg
zp@oT1UHHmolG4kmvy!+}xgfqE!SLwUFhdSo`Woh>?@;Im8$maXg%H274RphA@Ei>D
z^N%@<~V(iR;lY$Sm@7f_4k6NIy?~J4MsCGd@aJa!2>FJtq
z(&rFgfC3;Z2bzKvETxu_{j{c*en$8>ML!=Y*<1LR@0x4ofFvvl!OOuGY0}>q_!!6u
zOEr1lw6wG4i`Xqr`1&3-t$Hg22=Ewa&L>Ez#(GQzAmWf3RZM(DgepGihdUS)Rq-o7
zGnH#Op|_f`J4Xli=Zg94(2!;rpQgrVr*8Z3warY}+1EuV*VnFa
zRb!t$g+s;6{;Z|UUz%JTJ--GA-%w#Z?StDmq(m+4vIw=k{xQ%1a;br`;7lh8b#*Hx
zj7)#!{<~yV{u<7r*ut5I3lpc7Wv36OE0fr;Jc4S>ygO4IKAI^G7V;X3E#7)Cd-3d_
zDZqnqLRVjl?}|{tGa`(2{s4!GEeQWV>Z|z;!&%j`{+7E-N&zWF!XaXx|I&>9Q7jaP
z93r`SEzSpEjM1V9-wD9O{KEa)b7Qwk4H8UKl!*s|a4@j^Hb3@cZseqf8zl*2lmxM{FqMTi=1}h3f8hd(
zAX-QuQ-~r23n3;&^d?}T*9mEClz>fxr|E-*EpFO$Z%aJc5~u~|OHCTKwy
z^@+&2W;&7ceuTO;XBq3K0mKgvW5OtnpR+8&E4^mHvjyifH7Es46eO*8f;twi@@FzZm8%b^zslMmIywga|
z>unF3JXk_DT{JyDauPW*O15BirzUmbL+)ltE7h-k=(2-18$Wh;%~Swau)VTUhCBXI
Q_w!NzptmZuI^)Fu0a4I*)Bpeg
diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/node.js b/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/node.js
index ab80916d..1c186035 100644
--- a/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/node.js
+++ b/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/node.js
@@ -457,9 +457,71 @@ function init() {
Vue.nextTick(function () {
ajax(url, null, 'get');
});
+ },
+ getLightColor(h, s, v) {
+ return hsvToRgb(parseInt(h * 360 / 255), parseInt(s * 100 / 255), parseInt(v * 100 / 255));
}
}
});
}
-/*exec*/
-loadData();
+function hsvToRgb(h, s, v) {
+ if (h == "") h = 0;
+ if (s == "") s = 0;
+ if (v == "") v = 0;
+ h = parseFloat(h);
+ s = parseFloat(s);
+ v = parseFloat(v);
+ if (h < 0) h = 0;
+ if (s < 0) s = 0;
+ if (v < 0) v = 0;
+ if (h >= 360) h = 359;
+ if (s > 100) s = 100;
+ if (v > 100) v = 100;
+ s /= 100.0;
+ v /= 100.0;
+ C = v * s;
+ hh = h / 60.0;
+ X = C * (1.0 - Math.abs((hh % 2) - 1.0));
+ r = g = b = 0;
+ if (hh >= 0 && hh < 1) {
+ r = C;
+ g = X;
+ }
+ else if (hh >= 1 && hh < 2) {
+ r = X;
+ g = C;
+ }
+ else if (hh >= 2 && hh < 3) {
+ g = C;
+ b = X;
+ }
+ else if (hh >= 3 && hh < 4) {
+ g = X;
+ b = C;
+ }
+ else if (hh >= 4 && hh < 5) {
+ r = X;
+ b = C;
+ }
+ else {
+ r = C;
+ b = X;
+ }
+ m = v - C;
+ r += m;
+ g += m;
+ b += m;
+ r *= 255.0;
+ g *= 255.0;
+ b *= 255.0;
+ r = Math.round(r);
+ g = Math.round(g);
+ b = Math.round(b);
+ hex = r * 65536 + g * 256 + b;
+ hex = hex.toString(16, 6);
+ len = hex.length;
+ if (len < 6)
+ for (i = 0; i < 6 - len; i++)
+ hex = '0' + hex;
+ return '#' + hex;
+}
\ No newline at end of file
diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html b/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html
index ae3d6f62..313c2111 100644
--- a/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html
+++ b/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html
@@ -77,7 +77,12 @@