MDRT Code Conventions - nickcounts/MDRT GitHub Wiki

Conventions for MDRT Developers and Administrators

Conventions for FDs

Conventions for Variables in code

Data Naming Conventions:

FD Names for Modified Data

Some FDs may require additional processing such as smoothing, filtering, or subsampling. In these cases, append the appropriate descriptive word to the full string version of the FD and to the .Name property of the timeseries object.

Subsampled Data Sets

Lightweight is reserved for FDs with high sample rates, or which for any reason have had original data points removed without altering the values of the remaining data.

fd.FullString = 'DCVNC-8030 Solenoid Voltage - Lightweight';
fd.ts.Name    = 'DCVNC-8030 Solenoid Voltage - Lightweight';

Filtered Data Sets

The Filtered tag should be properly applied to any set that has been passed through a matlab filter or that specifically targets the removal of certain frequencies from the data.

fd.FullString = 'LN2 PT-3918 Press Sensor  Mon - Filtered'
fd.ts.Name    = 'LN2 PT-3918 Press Sensor  Mon - Filtered'

Smoothed Data Sets

The Smoothed keyword may be applied to any FD that has been modified in such a way as to make jittery or noisy data appear smooth (continuous derivative). This can include moving/sliding averaging techniques.

fd.FullString = 'Ghe PT-4919 Press Sensor  Mon - Smoothed'
fd.ts.Name    = 'Ghe PT-4919 Press Sensor  Mon - Smoothed'

Variable Naming Conventions:

Constants

MDRT Style prefers all capital letters with underscores separating words for constant definitions.

PAGE_WIDTH_INCHES = 8.5;

Class Names

Class Names should be human readable, give an indication of their function, and use Camel Case, with the first letter capitalized.

FileListBox
MDRTConfig

File Names

MDRT uses a variant of Hungarian notation for clarity when dealing with file names.

rootDir_path = uigetdir();
backupFileName_str = 'backup.ext';
backupFullFile     = fullfile(rootDir_path, backupFileName_str);
backupFileFID      = open(backupFullFile)

True/False - boolean

For typical single booleans, MDRT style prefers the is or has prefix for semantic readability. In the case of boolean vectors, the prefix bv is preferred for clarity.

bvFilterIndex   = [true, true, false, true];
isValidName     = true;
hasErrorMessage = false;