Category:Cumulus MX: Difference between revisions

6,183 bytes removed ,  13:42, 13 April 2020
m
Line 437: Line 437:


Some days later, I have tried out more MX features, been happy with those, and as MX is now doing all I want I have stopped using Cumulus 1.  I still use my own PHP script to update my database tables, I tried the custom SQL and it does not do all I want.  I have done a little editing of the user interface, partly to discover how easy it is to edit, partly to understand better how it works. For each file I have edited (HTML or CSS) I have kept copy of original and made a second copy of my edited version, so I cam easily go back to original and if I download a new release I won't lose the copies of my edited versions of files.
Some days later, I have tried out more MX features, been happy with those, and as MX is now doing all I want I have stopped using Cumulus 1.  I still use my own PHP script to update my database tables, I tried the custom SQL and it does not do all I want.  I have done a little editing of the user interface, partly to discover how easy it is to edit, partly to understand better how it works. For each file I have edited (HTML or CSS) I have kept copy of original and made a second copy of my edited version, so I cam easily go back to original and if I download a new release I won't lose the copies of my edited versions of files.
== Editing the User Interface ==
The general advice is do not change any files that are part of the MX package, they are a package and therefore there are interdependencies. Also updating to a newer release is more complicated if you have edited any files. The files as provided in the MX package are a compromise, for example they include reporting on solar measurements but not all weather stations include such measurements. Given that the user interface is not shared with anyone else, it could be argued its look and content is not that important. In particular this interface is the only way to change settings, so do not change anything that stops those setting screens from working!
Remember, if you decide to download a new release to not overwrite any file(s) that you have edited, or your edit will be lost. It is  less likely that a new release will change the interface files than other files, but some releases do change these files. Remember, each release zip contains all MX files, even those not changed since previous release. The release notice will usually give some idea of whether interface files have changed, but it may not list which interface files have been added, modified, or removed.
If you do decide to change any file, I suggest you maintain a back-up copy of the original elsewhere (so it can be gone back to) and you save the edited file under a new name (so you can't lose my edited file by installing a new release).
If you are editing files, use Notetab lite,  notepad++ (for  windows),  or BB-edit on a Mac, i.e. use an editor designed for code, do not use a word processor, a Microsoft or Google editor or Dreamweaver or any other web editor. The encoding that should be used in UTF, if your editor does not mention encoding, it is the wrong sort of editor!
=== Changing the look ===
You need some understanding of Cascading Style Sheets (CSS) to do this, but all you need to do is to edit the relevant style sheet either in '''\CumulusMX\interface\css''' or in the relevant folder within the lib folder.
You may feel that the default look of grey, black, and white, is either boring or does not offer sufficient contrast for you, perhaps you feel certain font sizes are too small, or you want to change the page background. Well, you can change the look, it is all defined in .css files. However, because MX makes use of standard libraries (bootstrap, datatables, alcapa etc.) there are a multitude of .css files used and it might not be easy to work out which one to edit. Each HTML page has links to a number of css files. You will probably make use of developer functions in your browser to inspect any element whose look you wish to change to see where its different properties are defined. It is better to make any such edits at a high level, rather than on any CSS just for that particular element. As always when editing, keep a copy of original so you can go back to it; keep a copy of your edited file, so installing a new release does not lose you edited file.
=== Removing Solar Figures ===
If your weather station does not have solar instrumentation you might wish to remove some of the display elements that relate to that. You need some understanding of Hyper-Text Markup Language to do this correctly, but here are simple examples.
# Navigate to '''\CumulusMX\interface''' folder.
# Open the file '''now.html''' in an editor designed for code (e.g. Notepad++ for Windows, Notetab Lite)
# Near the bottom of the file edit it by inserting HTML comment delimiters (opening after </thead>, closing before </table>) so it looks like this:
<pre><table id="SolarTable" style="width:100%">
      <thead>
          <tr>
              <th>&nbsp;Solar</th>
              <th></th>
              <th></th>
        </tr>
      </thead>
  <!--
        <tr>
              <td>Solar Radiation</td>
              <td><span id="SolarRad">--</span></td>
              <td>W/m<sup>2</sup></td>
        </tr>
        <tr>
              <td>Sunshine Today</td>
              <td><span id="SunshineHours">--</span></td>
              <td>hrs</td>
        </tr>
        <tr>
                <td>UV</td>
                <td><span id="UVindex">--</span></td>
                <td></td>
        </tr>
  -->
</table> </pre>
IMPORTANT NOTES:
#The above approach works on "now.html", but it does not work on other pages where table rows are dynamically created by an external script, so the existing rows in the table body are dummies whose content is ignored.
*An alternative technique is to delete the whole table and any "&lt;div> .. &lt;/div>" that surrounds only that table, that will work on all the HTML pages.
=== Adding derivatives not shown on the existing interface page ===
It is a JavaScript file '''\CumulusMX\interface\js\dashboard.js''' that reads the real-time file and inserts particular content into position indicated by values of the HTML attribute "id" on the interface screens. The standard '''\CumulusMX\interface\now.html''' does not include temperature trend for example, but because there is a '''temptrend: inp.TempTrend.toString()''' defined in the JavaScript file, you can easily add it to the "now" page by a simple insert of the middle row here:
<pre><tr>
          <td>Outdoor Temperature</td>
          <td><span id="OutdoorTemp">--</span></td>
          <td><span class="TempUnit">--</span></td>
</tr>
<tr>
          <td>Trend</td>
          <td><span id="TempTrend">--</span></td>
          <td><span class="TempUnit">--</span>&nbsp;hour<sup>-1</sup></td>
</tr>
<tr>
          <td>Dew Point</td>
          <td><span id="OutdoorDewpoint">--</span></td>
          <td><span class="TempUnit">--</span></td>
</tr></pre>
You can't add any derivatives into any table unless the value (for the derivative you want to add) is already defined in the related files.
There is a section of the support forum devoted to [https://cumulus.hosiene.co.uk/viewforum.php?f=28 Cumulus MX interface customisation], so you can see what other people are doing.  There is also [https://cumulus.hosiene.co.uk/viewforum.php?f=36 another sub-forum] for making suggestions on what you would like added to MX.


== Changing Settings ==
== Changing Settings ==
5,838

edits