% var maxExperienceOffset = 2; // kg var uv = new app.units.Unit(json.buoyancy).as('kg'); var measure = uv.measure(); var minLead = Math.max(0, uv.value()); // most experienced var maxLead = Math.max(0, uv.value() + maxExperienceOffset); // least experienced var totalGasMass = json.totalGasMass ? new app.units.Unit(json.totalGasMass).as('kg') : new app.units.Unit({value: 0, unit: 'kg'}); var prediveLead = Math.max(0, minLead - totalGasMass.value()); // kg var safetyClass = (uv.value() < 0) ? ((-uv.value() < maxExperienceOffset) ? 'result-warning' : 'result-safe') : 'result-unsafe' ; var emptyCylinderOffset = 0.1; // up to 0.1 kg we consider the cylinders as empty. %>
The buoyancy is positive which could lead to an uncontrolled ascent during the dive.
<% } else { %>The buoyancy is <%=(uv.value().toFixed(1) == 0) ? 'neutral' : 'negative' %> which could allow to control the ascent at all time.
<% } %>Most exp. |
Least exp. |
<%=new app.units.Unit(minLead,'kg').as(config.units[measure]).format(1)%> | <%=new app.units.Unit(maxLead,'kg').as(config.units[measure]).format(1)%> |
Depending on your level of experience consider adding an amount of diving weight in the range above. |
Steps for a pre-dive weight check
Warning your gear selection does not contain a cylinder
<% } else if(totalGasMass.obj().value < emptyCylinderOffset) { %>Warning your cylinder selection are filled at a very low level
Get in the water with all the gears selected <% if (prediveLead > 0) { %> plus <%=new app.units.Unit(prediveLead,'kg').as(config.units[measure]).format(1)%> of diving weight <% } %>
Add/remove diving weight until floating at eye level at the surface with an empty BCD and while holding a normal breath
<% if(totalGasMass.obj().value >= emptyCylinderOffset) { %>Add <%=totalGasMass.as(config.units[measure]).format(1)%> of diving weight for the gas you will use during the dive
<% } %>Enjoy the dive