view gwt-client/src/test/java/test/RunnerCreatorHelper.java @ 9390:f575ff573cbb

"Name der Peilung" columname minfo.
author gernotbelger
date Thu, 09 Aug 2018 15:22:31 +0200
parents dba14da43f23
children 46e3e23cca0b
line wrap: on
line source
/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
 * Software engineering by
 *  Björnsen Beratende Ingenieure GmbH
 *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
 *
 * This file is Free Software under the GNU AGPL (>=v3)
 * and comes with ABSOLUTELY NO WARRANTY! Check out the
 * documentation coming with Dive4Elements River for details.
 */
package test;

import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
import org.dive4elements.river.client.shared.exceptions.ServerException;

import test.BerechnungsartenTester.CalcMode;
import test.BerechnungsartenTester.FilenameMapper;
import test.BerechnungsartenTester.River;

/**
 * @author Domenico Nardi Tironi
 *
 */
public final class RunnerCreatorHelper {

    private final static String user = "belger";

    private final static String pw = "belger";

    private RunnerCreatorHelper() {
        throw new UnsupportedOperationException();
    }

    // HELPER-Methods:

    public final static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final FilenameMapper file, final double from, final double to,
            final River beispielfluss, final SimpleRecommendation rec0, final SimpleRecommendation rec1) throws ConnectionException, ServerException {
        // TODO: make recommendationPair to method parameter if needed
        final SinfoFlowdepthMinMaxRunner proof = new SinfoFlowdepthMinMaxRunner(user, pw, CalcMode.sinfo_calc_flow_depth_minmax, file, from, to, beispielfluss);
        proof.addRecommendationPair(rec0, rec1);

        return proof;
    }

    public static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final FilenameMapper file, final int from, final int to, final River river,
            final SimpleRecommendation simpleRecommendation0, final SimpleRecommendation simpleRecommendation1,
            final SimpleRecommendation simpleRecommendation2, final SimpleRecommendation simpleRecommendation3) throws ConnectionException, ServerException {
        final SinfoFlowdepthMinMaxRunner proof = (SinfoFlowdepthMinMaxRunner) createSinfoFlowdepthMinMaxTest(file, from, to, river, simpleRecommendation0,
                simpleRecommendation1);
        proof.addRecommendationPair(simpleRecommendation2, simpleRecommendation3);
        return proof;
    }

    public final static AbstractModuleRunner createSinfoFlowdepthTest(final FilenameMapper file, final double from, final double to, final River river,
            final boolean useTkh, final SimpleRecommendation rec0, final SimpleRecommendation rec1) throws ConnectionException, ServerException {
        final SinfoFlowdepthRunner proof = new SinfoFlowdepthRunner(user, pw, CalcMode.sinfo_calc_flow_depth, file, from, to, river, useTkh);
        proof.addRecommendationPair(rec0, rec1);

        return proof;
    }

    public final static AbstractModuleRunner createSinfoFlowdepthDevelopmentTest(final FilenameMapper file, final double from, final double to,
            final River river, final SimpleRecommendation rec0_curr, final SimpleRecommendation rec1_curr, final SimpleRecommendation rec0_hist,
            final SimpleRecommendation rec1_hist) throws ConnectionException, ServerException {
        final SinfoFlowdepthDevelopmentRunner proof = new SinfoFlowdepthDevelopmentRunner(user, pw, CalcMode.sinfo_calc_flow_depth_development, file, from, to,
                river);
        proof.addCurrentRecommendationPair(rec0_curr, rec1_curr);
        proof.addHistoricalRecommendationPair(rec0_hist, rec1_hist);
        return proof;
    }

    public final static AbstractModuleRunner createSinfoTkhTest(final FilenameMapper file, final double from, final double to, final River river,
            // final boolean useTkh,
            final double[] wasserspiegellage) throws ConnectionException, ServerException {
        final SinfoTkhRunner proof = new SinfoTkhRunner(user, pw, CalcMode.sinfo_calc_transport_bodies_heights, file, from, to, river, wasserspiegellage);

        return proof;
    }

}

http://dive4elements.wald.intevation.org