{"id":239,"date":"2018-08-12T19:11:04","date_gmt":"2018-08-13T02:11:04","guid":{"rendered":"http:\/\/dragonwarz.net\/?p=239"},"modified":"2018-08-15T00:54:28","modified_gmt":"2018-08-15T07:54:28","slug":"changes-and-improvements","status":"publish","type":"post","link":"https:\/\/dragonwarz.net\/?p=239","title":{"rendered":"Changes and Improvements"},"content":{"rendered":"<p>\u200bProbably no big surprise&nbsp;to anyone, I have changed the Sensor programs some more!&nbsp; Enough to deserve a couple of new screen shots.&nbsp;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/SensorApp.png\" rel=\"\" style=\"\" target=\"_blank\" title=\"\"><div id=\"attachment_247\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-247\" alt=\"\" class=\"size-large wp-image-247 wp-caption aligncenter\" height=\"348\" src=\"http:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/SensorApp-1024x574.png\" style=\"\" title=\"\" width=\"620\" srcset=\"https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/SensorApp-1024x574.png 1024w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/SensorApp-300x168.png 300w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/SensorApp-768x430.png 768w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/SensorApp.png 1681w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-247\" class=\"wp-caption-text\">Primary App, showing its Log, Graph window and Sensor details in the background HTML page.<\/p><\/div><\/a><\/p>\n<p style=\"text-align: center;\">&nbsp;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Graph_Demo1.png\" rel=\"\" style=\"\" target=\"_blank\" title=\"\"><div id=\"attachment_248\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-248\" alt=\"\" class=\"size-large wp-image-248 wp-caption aligncenter\" height=\"920\" src=\"http:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Graph_Demo1-690x1024.png\" style=\"\" title=\"\" width=\"620\" srcset=\"https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Graph_Demo1-690x1024.png 690w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Graph_Demo1-202x300.png 202w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Graph_Demo1-768x1140.png 768w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Graph_Demo1.png 1388w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-248\" class=\"wp-caption-text\">Graph demo with days worth of data and a&nbsp;gap&nbsp;when it was not recording.<\/p><\/div><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>There are a fair amount of both Major and Minor changes, both front facing to the user and on the back end.&nbsp;&nbsp;<\/p>\n<p><strong><u>Major Changes<\/u><\/strong><\/p>\n<ul>\n<li>Put Graphing into its own Window + made the time selection more accurate<\/li>\n<li>Separated Sensor checks for data retrieval vs checking online\n<ul>\n<li>Faster Online Checks<\/li>\n<li>Allows Different functions on same socket connection<\/li>\n<\/ul>\n<\/li>\n<li>Added SQL database Sizes to Sensor Information HTML page<\/li>\n<li>Updated SQL queries to handle more data points for graphing<\/li>\n<li>Added Motion detection recording to Sensors (Separate database, checking 4 times every second (0.25 seconds), recording if its change more then 0.05 since the last recording (If any axis changes that much, it records all data))<\/li>\n<li>Added Graphing option for the Motion Database\n<ul>\n<li>Motion graphing bypasses the &quot;Data Points To Skip&quot;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><u><strong>Minor Changes<\/strong><\/u><\/p>\n<ul>\n<li>Updated code to auto check selected sensors before trying to get data (database, current readings)<\/li>\n<li>Updated and cleaned up Log code (tracking progress through program)\n<ul>\n<li>Before writing new log data, remove all white space before and after text in the log window<\/li>\n<li>Add &quot;Relay&quot; functions in order to return better log details from custom imports<\/li>\n<\/ul>\n<\/li>\n<li>Updated some Variable and Function names to better match their actual function<\/li>\n<li>Broke up code into new def statements and used for statements to simplify code and make more readable.&nbsp;<\/li>\n<li>About 5 or so other changes I can&#39;t quite remember&#8230;&nbsp;&nbsp;<\/li>\n<\/ul>\n<p>I spent a great deal of time working with the SQL queries, especially because I had to convert the time text from the program date selection, into something I could compare to from the database.&nbsp; I could of saved a lot of time by making sure it printed out the 2 comparisons from the start all the time, but since I didn&#39;t&#8230; that was a good 10+ hours spent!&nbsp; Its all sorted out now and it should be much easier to spot future errors in input calculations.&nbsp;<\/p>\n<p>While dealing with the SQL queries them selves, I quickly found out, that too many data points in a SQL database, will make getting, holding and manipulating the data in a single grab, a no go (Goes slow, if too many points, just doesn&#39;t do the graph).&nbsp; Thanks to a misaligned threshold setting on my motion detection by 0.02, It was recording every few seconds&#8230;. sometimes more often.&nbsp; It quickly added up to a 6MB database.&nbsp; This gave&nbsp;me the chance to test my Graphing with large data sets, and it successfully graphed just shy of 160,000 data sets PER Time\/X\/Y\/Z.&nbsp; That&#39;s about 640,000 data entries!&nbsp; &nbsp;Even on my Ryzen system, it took about 10 seconds to process that.&nbsp; However, this is an unusual amount of data and most of my readings will never reach this level.&nbsp; Its still comforting to know I can process that much, as it will be useful for reviewing long term data.&nbsp; It may also become necessary to compare multiple sensors in&nbsp;a single graph, which would multiply the data entries by however many sensors you needed to compare.&nbsp;&nbsp;<\/p>\n<p>Here is how smokey it looks out side my window&#8230; I wish I could say that&#39;s clouds or mist, but its smoke at about 11AM in the morning on a Sunday&#8230;. Terrible terrible smoke&#8230;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Smokey1.jpg\" rel=\"\" style=\"\" target=\"_blank\" title=\"\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"size-large wp-image-259 aligncenter\" height=\"349\" src=\"http:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Smokey1-1024x576.jpg\" style=\"\" title=\"\" width=\"620\" srcset=\"https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Smokey1-1024x576.jpg 1024w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Smokey1-300x169.jpg 300w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Smokey1-768x432.jpg 768w, https:\/\/dragonwarz.net\/wp-content\/uploads\/2018\/08\/Smokey1.jpg 2048w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a>Super Smoke<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u200bProbably no big surprise&nbsp;to anyone, I have changed the Sensor programs some more!&nbsp; Enough to deserve a couple of new screen shots.&nbsp; &nbsp; &nbsp; There are a fair amount of both Major and Minor changes, both front facing to the &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/dragonwarz.net\/?p=239\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,3],"tags":[],"class_list":["post-239","post","type-post","status-publish","format-standard","hentry","category-python","category-random"],"_links":{"self":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=239"}],"version-history":[{"count":20,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/239\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/239\/revisions\/269"}],"wp:attachment":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}