#include "CivHydrFuncInter.h"
#include "CivHydrCalc.h"

bool DLLEXPORT simulation(char* uri, char* netName, char* flag)
{

    char fileName[256];
    char rptR[256];
    char outBinFile[256];

    strcpy_s(fileName, "test.inp");
    strcpy_s(rptR, "test.rpt");
    strcpy_s(outBinFile, "test.bin");

    CivHydrCalc* calc = new CivHydrCalc(uri, netName);

    bool msg = false;;
    if (strcmp(flag,"HDY")==0)
        msg = calc->hydrSimulation( fileName, rptR, outBinFile);
    else if(strcmp(flag, "QUALITY")==0)
        msg = calc->qualitySimulation(fileName, rptR, outBinFile);

    delete calc;
    return msg;
}


bool DLLEXPORT hdySimulation(char* uri, char* netName)
{
    return true;
}

bool DLLEXPORT qualitySimulation(char* uri, char* netName, char* type)
{
    return true;
}

bool DLLEXPORT qualityTrackingSimulation(char* uri, char* netName, char* nodeSn)
{
    return true;
}

bool DLLEXPORT getDataByInterval(char* uri, char* date, char* interval)
{
    CivHydrCalc* calc = new CivHydrCalc(uri, "");
    bool flag = calc->getDataByInterval(date, interval);
    delete calc;
    return flag;
}