#include "CivHydrTest.h"
#include "CivHydrFuncInter.h"
#include <iostream>


// 水力测试
void CivConHydrTest::test(char* uri)
{
    int succ = hdyrSimulation(uri);
    std::cout << "测试结果：" << succ << std::endl;
}

// 水质测试
void CivConQuaTest::test(char* uri)
{
    int succ = qualitySimulation(uri);
    std::cout << "测试结果：" << succ << std::endl;
}

// 追踪分析
void CivConTrackTest::test(char* uri)
{
    char result[1024 * 32];

    char sn[32];
    strcpy_s(sn, "JD00000680");

    int succ = trackingSimulation(uri, sn, 3, result);

    std::cout << result << std::endl;
    std::cout << "测试结果：" << succ << std::endl;
}

/**
  获取时段数据
*/
void CivConGetDataTest::test(char* uri)
{
    const char* date = "2020-07-17";
    char* dates = const_cast<char*>(date);

    const char* interval = "4";

    char* intervals = const_cast<char*>(interval);

    bool isSucces = getDataByInterval(uri, dates, intervals);
    std::cout << "测试结果：" << isSucces << std::endl;
};

void CivConGetRptTest::test(char* uri)
{
    std::string condtion = "\"日期\"='2020-07-13' and \"时段\"=1";
    std::string type = "管段";
    char result[1024 * 128];

    char newCondition[256];
    strcpy(newCondition, condtion.c_str());
    char newType[32];
    strcpy(newType, type.c_str());

    bool isSucc = getRptByCondition(uri, newType, newCondition, result);

    std::cout << result << std::endl;
    std::cout << "测试结果：" << isSucc << std::endl;
}
