package com.njcn.advance.model.responsibility;

import com.sun.jna.Structure;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

public class QvvrStruct extends HIKSDKStructure implements Serializable {
    public static final int MAX_P_NODE = 200; //功率节点个数限制，按200个限制
    public static final int MAX_P_NUM = 96 * 100; //功率数据按15分钟间隔，100天处理
    public static final int MAX_HARM_NUM = 1440 * 100; //谐波数据按一分钟间隔，100天处理
    public static final int MAX_WIN_LEN = 96 * 10; //按15分钟算10天
    public static final int MIN_WIN_LEN = 4; //按15分钟算1小时


    //输入参数
    public int cal_flag; //计算标志，0默认用电压和功率数据计算相关系数和责任，1用代入的动态相关系数计算责任
    public int harm_num;     //谐波数据个数
    public int p_num;        //功率数据个数
    public int p_node;       //功率负荷节点数
    public int win;          //数据窗大小
    public int res_num;      //代入的责任数据个数
    public float harm_mk;             //谐波电压门槛
    public float harm_data[];           //谐波数据序列
    public PDataStruct p_data[];  //功率数据序列
    public PDataStruct sim_data[];    //动态相关系数数据序列，可作为输入或者输出
    public PDataStruct FKdata[];      //不包含背景动态谐波责任数据序列，可作为输入或者输出
    public HKDataStruct HKdata[];    //包含背景动态谐波责任数据序列，可作为输入或者输出
    public float Core[];                    //典则相关系数
    public float BjCore[];                  //包含背景典则相关系数

    //输出结果
    public int cal_ok;  //是否计算正确标志，置位0表示未计算，置位1表示计算完成
    public float sumFKdata[];//不包含背景谐波责任
    public float sumHKdata[];//包含背景谐波责任

    public QvvrStruct() {
        cal_flag = 0;
        harm_data = new float[MAX_HARM_NUM];
        p_data = new PDataStruct[MAX_P_NUM];
        sim_data = new PDataStruct[MAX_P_NUM];
        FKdata = new PDataStruct[MAX_P_NUM];
        HKdata = new HKDataStruct[MAX_P_NUM];
        Core = new float[MAX_P_NUM];
        BjCore = new float[MAX_P_NUM];
        sumFKdata = new float[MAX_P_NODE];
        sumHKdata = new float[MAX_P_NODE + 1];
    }

    public static class ByReference extends QvvrStruct implements Structure.ByReference {

    }

    public static class ByValue extends QvvrStruct implements Structure.ByValue {

    }


    public PDataStruct[] getFKdata() {
        return FKdata;
    }

    public void setFKdata(PDataStruct[] FKdata) {
        this.FKdata = FKdata;
    }

    public HKDataStruct[] getHKdata() {
        return HKdata;
    }

    public void setHKdata(HKDataStruct[] HKdata) {
        this.HKdata = HKdata;
    }

    public float[] getSumFKdata() {
        return sumFKdata;
    }

    public void setSumFKdata(float[] sumFKdata) {
        this.sumFKdata = sumFKdata;
    }

    public float[] getSumHKdata() {
        return sumHKdata;
    }

    public void setSumHKdata(float[] sumHKdata) {
        this.sumHKdata = sumHKdata;
    }

    public int getCal_flag() {
        return cal_flag;
    }

    public void setCal_flag(int cal_flag) {
        this.cal_flag = cal_flag;
    }

    public int getHarm_num() {
        return harm_num;
    }

    public void setHarm_num(int harm_num) {
        this.harm_num = harm_num;
    }

    public float getHarm_mk() {
        return harm_mk;
    }

    public void setHarm_mk(float harm_mk) {
        this.harm_mk = harm_mk;
    }

    public float[] getHarm_data() {
        return harm_data;
    }

    public void setHarm_data(float[] harm_data) {
        this.harm_data = harm_data;
    }

    public float[] getCore() {
        return Core;
    }

    public void setCore(float[] core) {
        Core = core;
    }

    public float[] getBjCore() {
        return BjCore;
    }

    public void setBjCore(float[] bjCore) {
        BjCore = bjCore;
    }

    public int getCal_ok() {
        return cal_ok;
    }

    public void setCal_ok(int cal_ok) {
        this.cal_ok = cal_ok;
    }

    public int getP_num() {
        return p_num;
    }

    public void setP_num(int p_num) {
        this.p_num = p_num;
    }

    public int getP_node() {
        return p_node;
    }

    public void setP_node(int p_node) {
        this.p_node = p_node;
    }

    public int getWin() {
        return win;
    }

    public void setWin(int win) {
        this.win = win;
    }

    public int getRes_num() {
        return res_num;
    }

    public void setRes_num(int res_num) {
        this.res_num = res_num;
    }

    public PDataStruct[] getP_data() {
        return p_data;
    }

    public void setP_data(PDataStruct[] p_data) {
        this.p_data = p_data;
    }

    public PDataStruct[] getSim_data() {
        return sim_data;
    }

    public void setSim_data(PDataStruct[] sim_data) {
        this.sim_data = sim_data;
    }

    @Override
    protected List getFieldOrder() {
        return Arrays.asList(
                "cal_flag", "harm_num", "p_num", "p_node", "win",
                "res_num", "harm_mk", "harm_data", "p_data", "sim_data",
                "FKdata", "HKdata", "Core", "BjCore", "cal_ok",
                "sumFKdata",
                "sumHKdata");
    }
}
