Cs Code Modules

Revision as of 13:10, 26 July 2021 by Sfws (talk | contribs) (New page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Crystal Clear info.png This document is 'Work In Progress' so content may not be complete.

Request for help from Wiki Readers

  • Do you understand how MX works?
  • Do you use hardware, or MX functionality, that is not yet documented? Can you begin that documenting?
  • Can you contribute simple text for novice users, examples of what you have done, correction of typing or factual errors, or supply missing details?
  • Will you make this page more useful by bringing content up-to-date as new releases change some information written for older releases?
  • Does any page need a section for novices, so they don't need to read more technical information further down that page?
  • Is there some information on this page, that should be on a separate page? Can you create the new page and move the less relevant information off this page, don't forget this page needs a link to the new page so people who expect to find it here know where it has moved to?

If you plan on contributing to the Wiki, then you will need an account.

  • Please use the Request Account form to apply for an account. Note that the Wiki is currently undergoing restructuring and is largely locked for editing, but please apply for an account if you wish to contribute in the future.
  • You will find help on how to contribute to this wiki at How to Edit.
  • If you need to consult others, please use the Cumulus Wiki suggestions forum.

Please be aware that information on this page may be incorrect.

Cumulus Version MX Specific This page is for technical users only. No novice user will ever encounter anything mentioned on this page.

Essentially, it works through the cs files on the git hub for Cumulus] and gives a brief indication of what each module does.

Modules compiled into ExportToMySQL.exe

This is simplest cumulus code, so described first.

iniFile.cs

This is the code that reads Cumulus.ini and extracts the information from that file that the utility needs.

Program.cs

This is the code that does all the work, connecting to the database server taking (host, port, username, password, database name) parameters from Cumulus.ini, taking compass point modifiers from any strings.ini file present, reading standard log files and dayfile.txt, and exporting data from within those files to the respective database tables named in Cumulus.ini using "insert ignore".

Modules compiled into CreateMissing.exe

This is of in-between complexity, it needs a few more code modules,

Cumulus.cs

This is the code that determines what needs to be read from Cumuklus.ini, in this case quite a lot of the settings affect what the utility needs to do; a few examples are units, decimal places, and whether Cumulus is calculating wind chill.

Dayfile.cs

This is the code that renames any existing file, creates new file, and adds the various daily summary values and times (either from old file or recalculated) to the new file.

iniFile.cs

See previous sub-section with same name.

MeteoLib.cs

This is the code that takes supplied temperatures, wind speeds, humidities, and others. It then calculates all the derived values, such as dew point, wind chill, and humidity index.

Program.cs in CreateMissing

The sub-section name is qualified because the content of this code module varies.

This is the code that sets the sequence for the processes involved. It outputs status messages, and keeps counts for such actions as the adding of new lines. It handles meteorological day, by working out what time in standard log files, the source file, represents a new date (and start of what needs to be considered for new line) in dayfile.txt, the destination file. As it works through the times, it can add new derivatives to the source file, for the destination file it updates any maxima and minima, and at the end of the day it extracts the total daily rainfall.

Utils.cs in CreateMissing

The utilities in this code include conversion of temperature units, conversion of wind speed units, and calculation of average bearing.

Modules compiled into CumulusMX.exe

This is big one!

AirQualityIndices.cs

No prizes for what this module calculates!

Alarm.cs

Handles the generation, and stopping, of alarm indications. Also handles the content of emails.

AlarmSettings.cs

Code for the setting page covering alarms.

Api.cs

Code for handling application programming interface (transfers data to and from the various internal web pages for showing data.

ApiTagprocessor

Code for other application programming interfaces, including alarms, and custom requests.

AstroLib.cs and Astrolib2.cs

Two code modules, the first handling various conversions, and sun position calculations (plus various Steve Loft calculations no longer used), and the second being updates on the various solar calculations by Mark Crossley.

CalibrationSettings.cs

Code for processing the Calibration page in the settings. This includes multipliers, offsets, spike settings, and limits.

CalibrationLimits.cs

Code for default settings on that calibration page.

CumulusService.Designer.cs

Fixed code referencing the name and components of the Cumulus service.

CumulusService.cs

This code reads the optional parameters supplied when the service is begun, it arranges to broadcast any status messages, and it can stop Cumulus safely.

DataEditor.cs

This code supports the web pages in the 'Edit menu.

DataStructure.cs

This code supports the JSON files by defining values that can be sent to an external web server.

DavisAirLink.cs

This code reads the data from an AirLink station.

DavisStation.cs

This code reads the data directly from a Davis weather station.

DavisWllStation.cs

This code reads the data from the Davis Weather Link Live source of weather data.

EasyWeather.cs

This code reads the data from old versions of EasyWeather text files (not the newer Access style database design).

EmailSender.cs

As you can guess, this code processes the sending of emails (triggered by Alarm.cs).

ExtraSensorSettings.cs

This code handles the reading/editing of Extra Sensor Files.

FOStation.cs

This code reads the data from old Fine Offset stations (sold under a number of brand names).

GW1000Station.cs

This code reads the data processed by GW1000 units (and equivalent models under other brand names).

GlobalSuppressions.cs

The author Goran Devic's contribution to Cumulus.

ImetStation.cs

This code reads the data from Instromet weather stations.

IniFile.cs

See first sub-section with the same name.

InternetSettings.cs

This code supports the Internet Settings page.

MeteoLib.cs

See first sub-section with the same name.

MoonriseMoonset.cs

No prizes for guessing what this code calculates.

MqttPublisher.cs

This code supports the MQTT functionality in MX.

MxFtpClient.cs

This code handles the transfer of a file to a web server using file transfer.

MysqlSettings.cs

This code supports the MySQL Settings page.

NOAA.cs, NOAAReports.cs and NOAASettings.cs

All these code modules relate to reports. The first module handles the various values, where they come from, and any transformation needed to present them in the reports. The second module handles the actual generation of the reports, and copes with meterological day issues. The third module supports the NOAA Settings page, and the various "normal" values.

Program.cs in CumulusMX

The sub-section name is qualified because the content of this code module varies.

This code controls the actions during starting and stopping of MX incuding dealing with optional parameters and differences between running interactively and as a service.

ProgramSettings.cs

This code supports the program settings page.

SQlite.cs

A library module to connect to, and run queries against the two sqlite databases cumulusmx.db and diary.db used by MX.

SelfInstaller.cs

Another code module.

ServiceCumulusInstaller.cs

This code sets up a Microsoft Windows Service.

SunriseSunset.cs

Another of the author Goran Devic's contributions to Cumulus returns various sun event timings.

ThirdPartySettings.cs

This code supports the third party upload settings page.

TokenParser.cs

This code is what examines any Cumulus_template_file, each time it finds a web tag, this code module will find the value to insert into the file replacing the tag.

Trig.cs

Another of the author Goran Devic's contributions to Cumulus, this one has all the trignometry formulae.

Utils.cs in CumulusMX

There are time conversions, conversions between variable types, and encoding utilities, in this module.

WM918Station.cs, WMR100Station.cs, WMR200Station, WMR928Station.cs, and WS2300Station.cs

These code modules read data from various station types.

WeatherData.cs

This code defines properties for wind speed, average wind speed, outdoor temperature, pressure, and rainfall total.

WeatherDataCollections.cs

This code simply defines the existance of a collection containing weather data.

WeatherLink.cs

Another of the author Goran Devic's contributions to Cumulus, this one reads data from a Vantage Pro weather station using the Loop data as source.

WeatherLinkDotCom.cs

This module reads data from the internet (WL.com).

WeatherStation.cs

This code takes the data, supplied by station specific modules, and does all the standard tasks that MX does with weather station data, like converting units, applying calibrations, and checking/updating extreme records. This code is where the rain earlier in the season is added on. This code is also responsible for collecting extra sensor data, converting its units, and looking up names for extra sensors.

WebSocket.cs

This code deals with the supply of data through web sockets, as alternative to HTTP transfers.