class UcteRegulation implements UcteRecord {

    @Override
    public void fix() {
        if (phaseRegulation != null) {
            if (phaseRegulation.getU() <= 0) {
                LOGGER.warn("Phase regulation of transformer '{}' has a bad target voltage {}, set to undefined",
                        transfoId, phaseRegulation.getU());
                phaseRegulation.setU(Float.NaN);
            }
            // FIXME: N should be stricly positive and NP in [-n, n]
            if (phaseRegulation.getN() == null || phaseRegulation.getN() == 0
                || phaseRegulation.getNp() == null || Float.isNaN(phaseRegulation.getDu())) {
                LOGGER.warn("Phase regulation of transformer '{}' removed because incomplete", transfoId);
                phaseRegulation = null;
            }
        }
        if (angleRegulation != null) {
            // FIXME: N should be stricly positive and NP in [-n, n]
            if (angleRegulation.getN() == null || angleRegulation.getN() == 0
                    || angleRegulation.getNp() == null || Float.isNaN(angleRegulation.getDu())
                    || Float.isNaN(angleRegulation.getTheta())) {
                LOGGER.warn("Angle regulation of transformer '{}' removed because incomplete", transfoId);
                angleRegulation = null;
            } else {
                // FIXME: type should not be null
                if (angleRegulation.getType() == null) {
                    LOGGER.warn("Type is missing for angle regulation of transformer '{}', default to {}", transfoId, UcteAngleRegulationType.ASYM);
                    angleRegulation.setType(UcteAngleRegulationType.ASYM);
                }
            }
        }
    }

    public  UcteRegulation(UcteElementId transfoId, UctePhaseRegulation phaseRegulation, UcteAngleRegulation angleRegulation);

}