{"id":288,"date":"2008-07-28T15:15:27","date_gmt":"2008-07-28T15:15:27","guid":{"rendered":"http:\/\/dalelane.co.uk\/blog\/?p=288"},"modified":"2008-07-28T15:21:26","modified_gmt":"2008-07-28T15:21:26","slug":"revisiting-a-windows-gui-for-currentcost","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=288","title":{"rendered":"Revisiting a Windows GUI for CurrentCost"},"content":{"rendered":"<p><a href=\"http:\/\/www.flickr.com\/photos\/dalelane\/2585909618\/\" title=\"tweaking the CurrentCost GUI by dalelane, on Flickr\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3173\/2585909618_385fe4db63_m.jpg\" hspace=\"10\" vspace=\"10\" align=\"left\" width=\"240\" height=\"186\" alt=\"tweaking the CurrentCost GUI\" \/><\/a>I spent a couple of evenings last month knocking together a quick example of <a href=\"http:\/\/dalelane.co.uk\/blog\/?p=281\" target=\"_blank\">a Windows GUI for the data you get from CurrentCost<\/a> home electricity use monitors. And then promptly put it to one side and kinda forgot about it.<\/p>\n<p>As a quick recap, I created a Windows app which grabbed the history data from the CurrentCost serial output, and drew a few bar graphs from it &#8211; to represent the hours, days, and months data. The app also persisted the history data in the user&#8217;s &#8220;Application Data&#8221; folder, so that older data is kept by the GUI even after it is lost by the CurrentCost meter itself. <\/p>\n<p>I&#8217;m thinking about picking it up again, so spent a bit of time idea-storming what I could do with the code. These aren&#8217;t all my own ideas &#8211; they&#8217;re a random collection of ideas and notes taken from discussions with others. I&#8217;m posting them here for feedback &#8211; new ideas are welcome, as are comments on the usefulness of the stuff I&#8217;ve suggested. <\/p>\n<p><!--more--><strong>Stuff to display<\/strong><\/p>\n<ul>\n<li>Display <strong>usage data in different units<\/strong> &#8211; e.g. electricity units, kWh, &#163;, etc. &#8211; with ability to switch between them\n<\/li>\n<li><strong>Customizable date range <\/strong> &#8211; &#8220;show me usage for days between date X and date Y&#8221;\n<\/li>\n<li>Show changes in resting rate over time. Large spikes in usage of more than a kW (e.g. from a kettle) make it harder to clearly see differences in resting rates. If we could ignore the impact of these short-lived spikes, it would make it easier to distinguish longer term changes. A mode where we <strong>lop off spikes<\/strong> is one option. A <strong>customizable Y scale<\/strong> might be another.\n<\/li>\n<li><strong>Text-based representation of trends<\/strong> as an alternative \/ addition to bar graphs &#8211; &#8220;you used 5% more during weekends than you did last month&#8221;\n<\/li>\n<\/ul>\n<p><strong>Interface improvements<\/strong><\/p>\n<ul>\n<li><strong>Scrollable interface<\/strong> when there is more data than you have space for  &#8211; rather than the current static approach of showing a fixed number of  most recent data\n<\/li>\n<li>Currently hard to <strong>distinguish between one day and the next<\/strong> &#8211; provide a way for the interface to:\n<ul>\n<li> highlight different days when showing more than 24 hours\n<\/li>\n<li> highlight different months when showing more than 31 days\n<\/li>\n<li> highlight different years when showing more than 12 months\n<\/li>\n<\/ul>\n<\/li>\n<li>Display <strong>progress bars<\/strong> when:\n<ul>\n<li>accessing serial port\n<\/li>\n<li>reading persisted history data on startup\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>New features<\/strong><\/p>\n<ul>\n<li>Dynamically switch <strong>interface based on whether history data is included<\/strong> &#8211; if no history data included in the serial port data after a few retries then switch to a dashboard-y view without graphs. Might make the app more useful to people with v1 CurrentCost meters, which don&#8217;t include history data. (Although, if there isn&#8217;t any history data to collect, is there much benefit to showing live data on the GUI which the physical LCD display does anyway?)\n<\/li>\n<li> Integrated MQTT client for <strong>posting history data to web<\/strong> server for sharing with others\n<\/li>\n<\/ul>\n<p><strong>Implementation<\/strong><\/p>\n<ul>\n<li>Write the app in <strong>Java rather than .NET<\/strong>? The current app was written in .NET &#8211; the reasoning behind this was that the app was sort of aimed at less-technical users who would benefit from a single executable that they could just run without any setup or install. There are some problems with this. Firstly, and most obviously, it means Linux people can&#8217;t play with it. Secondly, I wrote it using .NET v3 because of the improved graphics libraries compared with .NET v2. However, this doesn&#8217;t seem to be as widely installed as I&#8217;d thought and I did get comments from people who struggled to install .NET 3.5, either because this was too complicated, or because of install restrictions on corporate or shared computers. I could:\n<ul>\n<li>Write a new version of the app in Java &#8211; this makes it available for Windows and Linux users, but potentially adds complexity to both setup and running the app. What is the simplest overhead for giving a non-technical user a Java app to run?\n<\/li>\n<li>Write a new version of the app using .NET v2 libraries &#8211; writing my own versions of whatever graphics libraries I used from .NET 3.5. This still makes an assumption &#8211; is .NET v2 a reasonable assumption as a pre-req?\n<\/li>\n<li>Write a new version of the app in C++ making no use of .NET &#8211; lots of re-inventing the wheel potential here. Probably more work than I really want to do on this app. But at least would probably work on any Windows machine, and without any setup or pre-req needs.\n<\/li>\n<li>Provide a setup.exe installer that handles installing .NET 3.5 either by including and running a redistributable version of the .NET framework (simple for the user, but makes what is otherwise a simple app huge!), or by opening a web-page where .NET can be downloaded if it&#8217;s found not to be installed (simple for me, but still leaves the user with the task of installing .NET which may be too complex and\/or forbidden on some machines).\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Any other ideas?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent a couple of evenings last month knocking together a quick example of a Windows GUI for the data you get from CurrentCost home electricity use monitors. And then promptly put it to one side and kinda forgot about it. As a quick recap, I created a Windows app which grabbed the history data [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[194],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-code","tag-currentcost"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}