package com.njcn.csharmonic.offline.mincfg.vo;

//新版 3秒，分钟统计结构

import lombok.Data;

@Data
public class tagPQDataCmn
{
	public short name; ///监测点号 12 /// </summary>
	public short Data_Type; ///数据类型 2 /// </summary>
	public int DataTag; // 标记 1：暂态标记 2：无效数据
	public RTC_Timer_MS time; ///时间 /// </summary>
	public Float[] Rms; ///电压A B C  电流A B C  线电压AB BC CA/// </summary>
	public Float[] UU_Deviation; ///电压上偏差相电压abc，线电压AB BC CA /// </summary>
	public Float[] UL_Deviation; ///电压下偏差相电压abc，线电压AB BC CA/// </summary>
	public Float[] F_Deviation; ///频率偏差 8 /// </summary>
	public Float[][] UI_Seq; ///电压电流零、正、负序、不平衡度32 第一个[]电压，电流；第二个[]零、正、负序、不平衡度/// </summary>
	public Float[][] FuHarm; ///整次谐波 电压A B C N 电流A B C N 1200 /// </summary>
	public Float[][] FuHarmPhase; ///谐波相角-送一半数据 600 /// </summary>
	public Float[][] InHarm; ///间谐波-送一半数据 1200 /// </summary>
	public Float[][] Total_Power; ///a,b,c,total 总功率(P.Q.S) 48 /// </summary>
	public Float[][][] Harm_Power; ///谐波功率-送一半数据 1200 /// </summary>
	public Float[][] Harm_Contain; ///谐波含有率 xxx.xx 600 /// </summary>
	public Float[] Harm_Aberrance; ///谐波畸变率 xxx.xx 12 /// </summary>
	public Float[] Cos_PF; ///视在功率因数 =P/S xx.xxx 8 /// </summary>
	public Float[] Cos_DF; ///位移功率因数=P/S1 xx.xxx 8 /// </summary>
	public Float[] U_Fluctuation; ///电压波动 xx.xxx 6 /// </summary>
	public Float[] U_Flicker; ///电压闪变 xx.xxx 6 /// </summary>
	public Float[] UL_Flicker; ///电压长闪变 xx.xxx 6 /// </summary>
	public static int GetSize()
	{
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		int nLen = RTC_Timer_MS.GetSize() + 1 * Integer.SIZE / Byte.SIZE + 2 * Short.SIZE / Byte.SIZE + 1866 *  Float.SIZE / Byte.SIZE;
		return nLen;
	}
	public tagPQDataCmn()
	{
		time = new RTC_Timer_MS();
		Rms = new Float[9];
		UU_Deviation = new Float[6];
		UL_Deviation = new Float[6];
		F_Deviation = new Float[2];
		UI_Seq = new Float[2][4];
		FuHarm = new Float[6][50];
		FuHarmPhase = new Float[6][50];
		InHarm = new Float[6][50];
		Total_Power = new Float[4][3];
		Harm_Power = new Float[4][50][3];
		Harm_Contain = new Float[6][50];
		Harm_Aberrance = new Float[6];
		Cos_PF = new Float[4];
		Cos_DF = new Float[4];
		U_Fluctuation = new Float[3];
		U_Flicker = new Float[3];
		UL_Flicker = new Float[3];
	}
	public final boolean SetStructBuf(byte[] bArray, int nHaveRead)
	{
		int nSize = bArray.length;
		int nStep = nHaveRead; //读取数据的步长

		if (nSize < (GetSize() + nHaveRead))
		{
			return false;
		}
		name = Service.convertInt16_net(bArray, nStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		nStep += Short.SIZE / Byte.SIZE;
		Data_Type = Service.convertInt16_net(bArray, nStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		nStep += Short.SIZE / Byte.SIZE;
		DataTag = Service.convertInt32_net(bArray, nStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		nStep += Integer.SIZE / Byte.SIZE;
		time.SetStructBuf(bArray, nStep);
		nStep += RTC_Timer_MS.GetSize();
		RefObject<Float[]> tempRef_Rms = new RefObject<Float[]>(Rms);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_Rms);
		Rms = tempRef_Rms.argvalue;
		RefObject<Float[]> tempRef_UU_Deviation = new RefObject<Float[]>(UU_Deviation);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_UU_Deviation);
		UU_Deviation = tempRef_UU_Deviation.argvalue;
		RefObject<Float[]> tempRef_UL_Deviation = new RefObject<Float[]>(UL_Deviation);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_UL_Deviation);
		UL_Deviation = tempRef_UL_Deviation.argvalue;
		RefObject<Float[]> tempRef_F_Deviation = new RefObject<Float[]>(F_Deviation);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_F_Deviation);
		F_Deviation = tempRef_F_Deviation.argvalue;
		RefObject<Float[][]> tempRef_UI_Seq = new RefObject<Float[][]>(UI_Seq);
		nStep += Service.convertFloatArrayTwo(bArray, nStep, tempRef_UI_Seq);
		UI_Seq = tempRef_UI_Seq.argvalue;
		RefObject<Float[][]> tempRef_FuHarm = new RefObject<Float[][]>(FuHarm);
		nStep += Service.convertFloatArrayTwo(bArray, nStep, tempRef_FuHarm);
		FuHarm = tempRef_FuHarm.argvalue;
		RefObject<Float[][]> tempRef_FuHarmPhase = new RefObject<Float[][]>(FuHarmPhase);
		nStep += Service.convertFloatArrayTwo(bArray, nStep, tempRef_FuHarmPhase);
		FuHarmPhase = tempRef_FuHarmPhase.argvalue;
		RefObject<Float[][]> tempRef_InHarm = new RefObject<Float[][]>(InHarm);
		nStep += Service.convertFloatArrayTwo(bArray, nStep, tempRef_InHarm);
		InHarm = tempRef_InHarm.argvalue;
		RefObject<Float[][]> tempRef_Total_Power = new RefObject<Float[][]>(Total_Power);
		nStep += Service.convertFloatArrayTwo(bArray, nStep, tempRef_Total_Power);
		Total_Power = tempRef_Total_Power.argvalue;
		RefObject<Float[][][]> tempRef_Harm_Power = new RefObject<Float[][][]>(Harm_Power);
		nStep += Service.convertFloatArrayThree(bArray, nStep, tempRef_Harm_Power);
		Harm_Power = tempRef_Harm_Power.argvalue;
		RefObject<Float[][]> tempRef_Harm_Contain = new RefObject<Float[][]>(Harm_Contain);
		nStep += Service.convertFloatArrayTwo(bArray, nStep, tempRef_Harm_Contain);
		Harm_Contain = tempRef_Harm_Contain.argvalue;
		RefObject<Float[]> tempRef_Harm_Aberrance = new RefObject<Float[]>(Harm_Aberrance);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_Harm_Aberrance);
		Harm_Aberrance = tempRef_Harm_Aberrance.argvalue;
		RefObject<Float[]> tempRef_Cos_PF = new RefObject<Float[]>(Cos_PF);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_Cos_PF);
		Cos_PF = tempRef_Cos_PF.argvalue;
		RefObject<Float[]> tempRef_Cos_DF = new RefObject<Float[]>(Cos_DF);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_Cos_DF);
		Cos_DF = tempRef_Cos_DF.argvalue;
		RefObject<Float[]> tempRef_U_Fluctuation = new RefObject<Float[]>(U_Fluctuation);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_U_Fluctuation);
		U_Fluctuation = tempRef_U_Fluctuation.argvalue;
		RefObject<Float[]> tempRef_U_Flicker = new RefObject<Float[]>(U_Flicker);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_U_Flicker);
		U_Flicker = tempRef_U_Flicker.argvalue;
		RefObject<Float[]> tempRef_UL_Flicker = new RefObject<Float[]>(UL_Flicker);
		nStep += Service.convertFloatArraySingle(bArray, nStep, tempRef_UL_Flicker);
		UL_Flicker = tempRef_UL_Flicker.argvalue;
		return true;
	}
}