function onVolumeChanged()

in ui/src/app/common/components/indigo-components/directives/stoich-table/services/reagents/reagents-calculation.service.js [270:302]


    function onVolumeChanged(row) {
        if (!row.isVolumePresent()) {
            resetVolume(row);

            return;
        }

        if (row.isMolarityPresent()) {
            var mol = mathCalculation.computeDissolvedMol(row.molarity.value, row.volume.value);
            row.setComputedMol(mol, onMolChanged);

            return;
        }

        if (row.isDensityPresent()) {
            var weight = mathCalculation.computeWeightByDensity(row.volume.value, row.density.value);
            row.setComputedWeight(weight, onWeightChanged);

            return;
        }

        if (!row.isSolventRow()) {
            row.resetFields([fieldTypes.weight, fieldTypes.mol, fieldTypes.eq]);

            if (row.isLimiting() && !canBeLimiting(row)) {
                var nextRow = getRowAfterLimiting();
                if (nextRow) {
                    nextRow.limiting.value = true;
                }
                row.limiting.value = false;
            }
        }
    }