package com.njcn.advance.pojo.dto.waveAnalysis;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.sun.jna.Structure;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.List;

/**
 * 输出参数
 * qvvr_cata_cause 暂降原因（目前算法不支持，不填）
 * qvvr_phasetype 暂降相别 1：一相 2：两相 3：三相
 * qvvr_cata_type 暂降类型
 * 持续时间（单位秒）
 * hold_time_rms 有效值算法持续时间
 * hold_time_dq dq变换算法持续时间
 * 波形起始点（单位度）
 * POW_a A相波形起始点
 * POW_b B相波形起始点
 * POW_c C相波形起始点
 * 跳变段电压变化率（单位V/S）
 * Voltagechange_Va A相跳变段电压变化率
 * Voltagechange_Vb B相跳变段电压变化率
 * Voltagechange_Vc C相跳变段电压变化率
 * 分段信息
 * SEG_T_num 分段数目
 * SEG_T0_idx 原始分段位置
 * SEG_T_idx 修正分段位置
 * 有效值分段信息
 * SEG_RMS_T_num 分段数目
 * SEG_RMS_T_idx 分段位置
 * 特征幅值（单位V）
 * u_min_num 特征值个数
 * ua_min A相电压特征值
 * ub_min B相电压特征值
 * uc_min C相电压特征值
 * u3_min 三相电压特征值
 * order_min_idx 最小值位置
 * 相位跳变(单位度)
 * angle_diff_ap A相相位正跳变
 * angle_diff_bp B相相位正跳变
 * angle_diff_cp C相相位正跳变
 * angle_diff_an A相相位负跳变
 * angle_diff_bn B相相位负跳变
 * angle_diff_cn C相相位负跳变
 * bph_max_value 不平衡度（单位%）
 */
@JsonIgnoreProperties(ignoreUnknown = true,value = {"pointer"})
public class BackData extends Structure {
	public int qvvr_cata_cause[] = new int[256];
	public int qvvr_phasetype[] = new int[256];
	public int qvvr_cata_type[] = new int[256];
	public float hold_time_rms;
	public float hold_time_dq;
	public float POW_a;
	public float POW_b;
	public float POW_c;
	public float Voltagechange_Va;
	public float Voltagechange_Vb;
	public float Voltagechange_Vc;
	public int SEG_T_num;
	public int SEG_T0_idx[] = new int[256];
	public int SEG_T_idx[] = new int[256];
	public int SEG_RMS_T_num;
	public int SEG_RMS_T_idx[] = new int[256];
	public int u_min_num;
	public float ua_min[] = new float[256];
	public float ub_min[] = new float[256];
	public float uc_min[] = new float[256];
	public float u3_min[] = new float[256];
	public int order_min_idx[] = new int[256];
	public float angle_diff_ap[] = new float[256];
	public float angle_diff_bp[] = new float[256];
	public float angle_diff_cp[] = new float[256];
	public float angle_diff_an[] = new float[256];
	public float angle_diff_bn[] = new float[256];
	public float angle_diff_cn[] = new float[256];
	public float bph_max_value[] = new float[256];

	@Data
	@NoArgsConstructor
	public static class ByReference extends BackData implements Structure.ByReference {

	}

	@Data
	@NoArgsConstructor
	public static class ByValue extends BackData implements Structure.ByValue {

	}

	@Override
	protected List<String> getFieldOrder() {
		return Arrays.asList(new String[] { "qvvr_cata_cause", "qvvr_phasetype", "qvvr_cata_type", "hold_time_rms",
				"hold_time_dq", "POW_a", "POW_b", "POW_c", "Voltagechange_Va", "Voltagechange_Vb", "Voltagechange_Vc",
				"SEG_T_num", "SEG_T0_idx", "SEG_T_idx","SEG_RMS_T_num","SEG_RMS_T_idx", "u_min_num", "ua_min", "ub_min", "uc_min", "u3_min",
				"order_min_idx", "angle_diff_ap", "angle_diff_bp", "angle_diff_cp", "angle_diff_an", "angle_diff_bn",
				"angle_diff_cn", "bph_max_value" });
	}
}
