Php webtags: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
667 bytes added ,  20:27, 17 May 2021
m
 
(One intermediate revision by the same user not shown)
Line 72: Line 72:


== Option 3: JavaScript Object Notation ==
== Option 3: JavaScript Object Notation ==
Anybody using Cumulus MX is already using this option if they are set up to use the example web pages provided in the software package.


This is a lightweight data-interchange format (JSON) that is easy for humans to read and write, but critically it is easy for machines to parse and generate for transferring the variables in a portable way.
This is a lightweight data-interchange format (JSON) that is easy for humans to read and write, but critically it is easy for machines to parse and generate for transferring the variables in a portable way.


Cumulus MX uses this approach to provide variables for plotting the charts on your web site (Trends web page).
The 3.10.1 release of MX has functionality to optionally generate and upload many more json files for transfers to the external web server - see [[:Category:JSON_Files#Data_Transfer_Format]].
 
<div style="background: LemonChiffon;padding:5px; margin:2px;">
[[File:Crystal Clear info.png|40px]] This document was written for a MX release that is no longer latest!
 
'''The 3.10.1 release of MX changes the settings referenced below'''
</div>
 
Cumulus MX beta (and releases up to 3.9.8) uses this approach solely to provide variables for plotting the charts on your web site (Trends web page).
*To have the json files uploaded to your web site, you must enable '''Include standard files''' within the ''Web/FTP settings'' section of '''Internet Settings'''.
*To have the json files uploaded to your web site, you must enable '''Include standard files''' within the ''Web/FTP settings'' section of '''Internet Settings'''.
*Cumulus MX has one json file per weather chart
*Cumulus MX has one json file per weather chart
Line 82: Line 92:
*The interval between sub-arrays (time and value pairs) depends on the chart, for daily rain and daily temperature there is a sub array for each day; but for most there is a sub-array for every minute (assuming Cumulus is left running for long enough) for a full 24 hours.  
*The interval between sub-arrays (time and value pairs) depends on the chart, for daily rain and daily temperature there is a sub array for each day; but for most there is a sub-array for every minute (assuming Cumulus is left running for long enough) for a full 24 hours.  


For the admin interface, the Cumulus MX engine has to pass information to and from the admin interface, this is done using an application programming interface for each transfer (and each interface uses json format).
For the admin interface, the Cumulus MX engine has to pass information to and from the admin interface, this is done using an [[MX_Administrative_Interface#The_API_interface|application programming interface]] for each transfer (and each interface uses json format).


If you want to set up your own json files, you may follow the same approach but need to choose the interval between such sub-arrays that suits your use in your web pages.
If you want to set up your own json files, you may follow the same approach but need to choose the interval between such sub-arrays that suits your use in your web pages.
5,838

edits

Navigation menu