The Converter
The converter is the step in the data processing pipeline responsible for transforming the standardized DiveLog ADT into a set of tabular columns for the final output file.
Its primary responsibilities are:
- Generating Column Headers: It creates a standard set of 24 column headers, appending the correct unit suffixes (e.g.,
(ft)vs.(m),(psi)vs.(bar)) based on theDiveMetadatafrom theDiveLog. - Formatting Data: It transforms the data from the
DiveSamplelist into string representations suitable for a CSV file. This includes key transformations like:- Negating depth values (e.g.,
30.5becomes-30.5). - Formatting numeric values to a consistent number of decimal places.
- Handling
nullvalues from the domain model and representing them as empty strings in the output.
- Negating depth values (e.g.,
- Producing a Base Telemetry Set: It generates the foundational set of 24 columns that form the core of the final output.
This step acts as the bridge between the pure, typed domain model of the dive and the specific, formatted representation required by Telemetry Overlay.
Interaction with Output Plugins
While the pipeline diagram shows a simple linear flow, the interaction between the converter and the OutputPlugin chain is a parallel process:
-> convert -> [Base 24 Columns] \
[DiveLogPlugin chain] -> DiveLog -> merge -> [Final Columns] -> write
-> [OutputPlugin chain] -> [Custom Columns] /- The final
DiveLogobject (after allDiveLogPlugintransformations) is used as the input for both the converter and theOutputPluginchain. - The converter processes the
DiveLogto create the base 24 columns. - Simultaneously, each
OutputPluginin the chain processes the exact sameDiveLogto generate its own set of custom columns. - Finally, the pipeline merges the converter's base columns with the columns from all output plugins to produce the final set of columns that gets written to the output file.
OutputPlugins do not receive the output of the converter; they work on the same input data to ensure all calculations are based on the same source of truth.
Base Output Columns
The converter generates the following 24 columns. The unit suffixes ($depthSuffix, $tempSuffix, $pressureSuffix) are dynamically replaced based on the dive's metadata.
Time (s)Actual Depth ($depthSuffix)First Stop DepthTime To SurfaceAverage PP02 (text)Fraction O2 (text)Fraction He (text)First Stop TimeCurrent NDLCurrent Circuit ModeWater Temp ($tempSuffix)Gas Switch NeededExternal PPO2Tank 1 pressure ($pressureSuffix)Tank 2 pressure ($pressureSuffix)Tank 3 pressure ($pressureSuffix)Tank 4 pressure ($pressureSuffix)SecondsDisplay Minutes (text)Display Seconds (text)Max Depth (text)Actual Time (text)AM/PM Indicator (text)Gas Mixture (text)