class StaticVarCompensatorsValidation {

    private static boolean checkSVCsValues(String id, double p, double q, double vControlled, double vController,
        double nominalVcontroller, double reactivePowerSetpoint, double voltageSetpoint,
        RegulationMode regulationMode, double bMin, double bMax, ValidationConfig config) {
        boolean validated = true;
        // active power should be equal to 0
        if (Math.abs(p) > config.getThreshold()) {
            LOGGER.warn("{} {}: {}: P={}", ValidationType.SVCS, ValidationUtils.VALIDATION_ERROR, id, p);
            validated = false;
        }

        double vAux = vController;
        if (vAux == 0 || Double.isNaN(vAux)) {
            vAux = nominalVcontroller;
        }
        double qMin = -bMax * vAux * vAux;
        double qMax = -bMin * vAux * vAux;

        if (reactivePowerRegulationModeKo(regulationMode, q, qMin, qMax, reactivePowerSetpoint, config)) {
            LOGGER.warn(
                "{} {}: {}: regulator mode={} - Q={} qMin={} qMax={} bMin={} bMax={} Vcontroller={} nominalV={} reactivePowerSetpoint={}",
                ValidationType.SVCS, ValidationUtils.VALIDATION_ERROR, id, regulationMode, q, qMin, qMax, bMin, bMax,
                vController, nominalVcontroller, reactivePowerSetpoint);
            validated = false;
        }

        if (voltageRegulationModeKo(regulationMode, q, qMin, qMax, vControlled, voltageSetpoint, config)) {
            LOGGER.warn(
                "{} {}: {}: regulator mode={} - Q={} qMin={} qMax={} bMin={} bMax={} Vcontroller={} Vcontrolled={} targetV={}",
                ValidationType.SVCS, ValidationUtils.VALIDATION_ERROR, id, regulationMode, q, qMin, qMax, bMin, bMax,
                vController, vControlled, voltageSetpoint);
            validated = false;
        }

        if (offRegulationModeKo(regulationMode, q, config)) {
            LOGGER.warn("{} {}: {}: regulator mode={} - Q={} ", ValidationType.SVCS, ValidationUtils.VALIDATION_ERROR,
                id, regulationMode, q);
            validated = false;
        }
        return validated;
    }

    private  StaticVarCompensatorsValidation();

}