From b47af5405774237dc4cc5a30613c1a7877a40a7e Mon Sep 17 00:00:00 2001 From: Ace Date: Fri, 7 Aug 2015 18:34:52 +0530 Subject: [PATCH 1/3] Adding script to persist bulb status data --- .../src/statistics/IOT_Sensor_Analytics.tbox | Bin 5405 -> 4906 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/modules/distribution/src/statistics/IOT_Sensor_Analytics.tbox b/modules/distribution/src/statistics/IOT_Sensor_Analytics.tbox index bcf83b9627ee4b4833bee4fbb5fa1348d076df8b..8e8b83d3201c43743a529647b6503f4815c58f63 100644 GIT binary patch delta 2271 zcmaKu2{fDO8pprb5{WHKaW%G7sU^17GIkYIb+M%>Rhn8#ETfoes7BHDhQW|VEoqCY zBFc0yXsg?`RGI26QlyL8iqhLyX3%kF-b{O28Ry>QykAbv`91&l|Gwur|L41;SFN49 zUu72(!b8+(Y9u{AJSfhH>>~|{&)h8`6KmSY-R>c;Vv$LgCGb2K^Nez zl*7l1FG@fVg9t%efCh^T+s1GORi+y&=ZX%+mF>cHzFyG1b;^;etZkiB_*fjloYkwC zGOwqX`GvC&NAn#_PkoFsjP>;FveZ4MW%TUjqHi2|ImBjqsi6OK4N1n1nId^!A{KMFroO-;N){^Idf_zW^ zd72{kRk3@Royw2BRke>C5@8%yirBA$qkGfM%x!y>cszZyq9x+T2rmN}3ySgLwt!sp z=E3yXk>U&&NbgpS&2*oRvum}O{btVTTt*wy z1gD8J^Hq}dB@sAJ7E2!rN+|DdAFMF9jge2B)y`_GqtZ)r+ZC1BT8lIJmsP)s*03D> zjhMhrYz~?pOUCon%(?k@oOVWPwRG2-GrL{Fd5K3pEKP|7mnv%+(|dLYVaaHp?nvzckIi$0|jQt9XJCv9EK^3#Nc zzc`OF(lGZ;AAq_GGHmm#|6^43Ryj8!dH;#odbr-K4&{n(OcMkzo*!)~SW7P2V^^rH zob?|6)(|0q(1c5+jVCedZ5XTdD|=e6>Dm;#PiB7G5K5_X=n9o3(w$o$!55ZeXubJE z^&uB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|Oa*bviMNFwIY=6>?<)-*g|20$D zJ*-(`GuAF;Q?3TcQj{Y9`|i74JLI=xeRt6xXCB)ge&qOf*op_kwaF#f`T>*+H?#i? zi=At`(DD?_e`(_78uvSVi( zjtYlOKaJKVc#^>bY~nCOoHaykqbX{}DkRV&o46vP>hx@hU(dQXdYw=Vo@C;Jh~wjJ z)Znh;rO--Uf(Z=~M=-QdjoABk5o$(ko^BUJ#t}^15aF|N_G)Cqaotcq_P=E5#1FDO zwX*Ydx@;qYY8VYHH}8k=N>{*<sMUQ2t1r`O@i?xZ2*{y$PrC2 zRjopzy_!`hKcqcF1Jux@Xd#6w>Emu700VT@Eke|y$D{U(m|e5-6ZPdUHkT>zFZDtd zHxr5b^Eif8RB=2>1v+Rzp*nvggBJrhnIuHwf@%zAt(y1<73J+QQ+` zwIQk!cd{h~Y{_h*K2>>2G!laufsFZR2`Vw9P+cdL;tRJ{y>gwNIrQF8Zvwjv#=1>#ZC}4hpSP_Xk3`srv4utnpUlt+6zbebg=p#{VWSBSrl0L0G~6Nhs}w$y;2x(M HsGj}- Date: Fri, 7 Aug 2015 18:41:12 +0530 Subject: [PATCH 2/3] fixing events stats --- .../jaggeryapps/iotserver/modules/event.js | 31 +++++-------------- .../events/public/templates/event-stream.hbs | 2 +- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/event.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/event.js index 75594e97..bf4a01de 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/event.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/event.js @@ -39,30 +39,13 @@ eventModule = function () { var eventsData = []; - // -- start of dummy data - - var timeInterval = 30; - var i, rnd; - var currentDay = new Date(); - var startDate = currentDay.getTime() - (60 * 60 * 24 * 5); - var endDate = currentDay.getTime(); - - var i = parseInt(startDate / 1000); - while (i < parseInt(endDate / 1000)) { - rnd = rnd = Math.random() * 50; - eventsData.push({time: i*1000, deviceName: 'device' + rnd, activity:'Event number ' + rnd}); - i += timeInterval; - } - - // -- end of dummy data - - // for (var i = 0; i < fetchedData.size(); i++) { - // eventsData.push({ - // time: fetchedData.get(i).getTime(), - // deviceName: fetchedData.get(i).getDeviceName(), - // activity: fetchedData.get(i).getDeviceActivity() - // }); - // }; + for (var i = 0; i < fetchedData.size(); i++) { + eventsData.push({ + time: fetchedData.get(i).getTime(), + deviceId: fetchedData.get(i).getDeviceId(), + activity: fetchedData.get(i).getDeviceActivity() + }); + }; return eventsData; }; diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/events/public/templates/event-stream.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/events/public/templates/event-stream.hbs index a80c4042..f26e5d0e 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/events/public/templates/event-stream.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/events/public/templates/event-stream.hbs @@ -11,7 +11,7 @@ {{#each data}} {{time}} - {{deviceName}} + {{deviceId}} {{activity}} {{/each}} From 554e146be6ed378f1d03f0ec507d8aff43d62a32 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Fri, 7 Aug 2015 18:57:39 +0530 Subject: [PATCH 3/3] remove tmp files --- .gitignore | 1 + .../src/statistics/IOT_Sensor_Analytics.tbox | Bin 4906 -> 5538 bytes 2 files changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3a90e233..dca84b42 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ target .project *.iml .idea +.DS_Store diff --git a/modules/distribution/src/statistics/IOT_Sensor_Analytics.tbox b/modules/distribution/src/statistics/IOT_Sensor_Analytics.tbox index 8e8b83d3201c43743a529647b6503f4815c58f63..326f121ed30d91eca22e7cc26777a57e26e02c40 100644 GIT binary patch delta 1702 zcmZ3bwn)1^z?+$civa|Brm?$&8Bju$L59K8KO{alHLp0oDBdwIF{iR5Gr3qlG=!6Z znSbMv&@vz{t>9*0WckX-z`!B`)QB*y56w7vtj5Iv%}YczSp>JqAR9Osb|k-cJF@Dn zTr!Zi3y6)enhZ2}@*aML$z`m9>`>=T?qki=hnT@Ih21?ows7`z76yiTT?PgVoMr^` zt4aX<>#^oYC$`rU`E>tFuZm2$7MEho&nkd$}=doOzz>A zQ#WRS7zXq|!;;1oxXc1(6I~yq91L@~ delta 1102 zcmZ3ay-F=9z?+$civa|7C%<+BGoS<)gA7ArUSdvVNoI1ferO0M1M{nW3qp0*90@J0 z;AUWCdBM!U046|YhyZnQFfdGEcMp#(oIRa|fuUZPfk7E)#^lwE8lvt%T}J3SH@{$< z%QE?*fEbG$NFAS`!o=T#>`-GT3o~ZMLtJ(Y&1Kv`)x{-6sfoERscCr-r~LssO$*%u z1_p%FB3ABqi|b#gCc((SAi>7KAPcf`7oP#lzRe%`WEf>&9?6d1<8~m_-0vpPTU&rS z)IqAVd97foC$HgsDspDUez%`@u3KFJD%uECqzF4Ep`v~rX#5PI@$w)OA~=lTCQRgb zJozb`0E+@hf{)!8F5$s`zn+mvju}_PN&rm+0Re`$jvyL2npq*yj1k2k^KeBn#5|xA z8J0A2wT)&(hs6LxlbMikC zUUM`bKmrUiogn-EAu!tjQw=;JPM$6-C!~a8g#a)jfoVr&k_az6j-`RB6j4+;asyQ* z2qO$yC?qE&kD{c22dE^1Lvb>@FfTuvTPNRV6BANEQNDl|sGN^oX>zX+uRM}+R$ve@ PFmMB*JustR)m