#pragma once

#ifndef __WINDDATAFILEOPERATOR_H__
#define __WINDDATAFILEOPERATOR_H__
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <memory.h>
#include <cstdint>
#include <string>
#include <vector>
#include <map>
#include <fstream>
#include "WindDataOperator_global.h"

/*
* 风场数据格式说明
* 'LAMPWINDDASASET', Height , Width , TIMENUM ,// : int32
* 'TIMEARR', TIME1 , TIME2 , .... , TIMEn , // : int64
* 'GEOTRANSFORMER',ESPGCODE,T1,T2,T3,T4,T5,T6
* "WINUV" UArr[HxWxN],Varr[HxWxN] // double
*/




extern "C" {

    // 变量信息结构

    struct DataFileInfo { 
        int64_t Height;
        int64_t Width;
        int64_t Num;
        int64_t firstTimestamp;
        int64_t lastTimestamp;
        double minLon;
        double maxLon;
        double minLat;
        double maxLat;
        int64_t ESPGCODE;
        double T11;
        double T12;
        double T13;
        double T21;
        double T22;
        double T23;
        int64_t fileSize;
    };

    LAMPWindDataDLL DataFileInfo getDataFileInfo(const char* filepath);

    LAMPWindDataDLL int32_t get_WindDataFileTimeArr(const char* filepath, DataFileInfo info, int64_t* timeArr);

    LAMPWindDataDLL int32_t Read_WindDataFile(const char* filepath, DataFileInfo datafileinfo,int32_t timeID, double* UArr, double* VArr);

    LAMPWindDataDLL int32_t Write_WindDataFile(const char* filepath,DataFileInfo datafileinfo, int64_t timeInt,int32_t timeID,double* UArr,double* VArr);

}




















#endif // !WINDDATAFILEOPERATOR
