#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 * 512];

    char sn[64];
    strcpy_s(sn, "5fbaaf9e-dfcf-4e97-9fb1-31d03293f654");

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

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

void CivUpstreamTrackingTest::test(char* uri)
{
    // 追踪节点编号
    char sn[64];
    strcpy(sn, "5fbaaf9e-dfcf-4e97-9fb1-31d03293f654");

    char result[1024 * 128];

    bool isSucc = upstreamTracking(uri, sn, result);

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


/**
   下游追踪
*/
void CivDownStreamTrackingTest::test(char* uri)
{
    // 追踪节点编号
    char sn[64];
    strcpy(sn, "5fbaaf9e-dfcf-4e97-9fb1-31d03293f654");

    char result[1024 * 512];

    bool isSucc = downstreamTracking(uri, sn, result);

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


/**
   水源供水范围分析
*/
void CivWaterSupplyScopeTest::test(char* uri)
{
    // 追踪节点编号
    char sn[512];
    strcpy(sn, "ffd0f63d-b8c3-4354-aea5-aedc52cb8e16");

    char result[1024 * 32];

    bool isSucc = waterSupplyScopeAnalysis(uri, sn, result);

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

void CivProjSimulationTest::test(char* uri)
{
    // 追踪节点编号
    char projCode[512];
    strcpy(projCode, "ba01c9a8-f113-4131-b566-5f7f1ce25e5c");

    char time[512];
    strcpy(time, "2020-09-24 09:00:00");

    bool isSucc = projSimulation(uri, projCode, time);

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