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

//风电光伏功率区间数据 //数据时标
public class PowerReg
{
	public RTC_Timer_MS time;
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint line;
	public int line; //监测点
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint reg;
	public int reg; //功率区间
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint data_type;
	public int data_type; //数据类型
	//1平均值 2最大值 4最小值 8CP95值
	public Float u_blance; //电压不平衡度
	public Float i_blance; //电流不平衡度
	public Float[] uu_dev; //电压上偏差 3
	public Float[] ul_dev; //电压下偏差 3
	public Float[] harmu_thd; //谐波电压畸变率 3
	public Float[] harmi_thd; //谐波电流畸变率 3
	public Float[][] harmu; //谐波电压含有率 3-50
	public Float[][] harmi; //谐波电流幅值 3-50
	public Float[][] inharmu; //间谐波电压含有率 3-50
	public Float[][] inharmi; //间谐波电流幅值 3-50
	public Float[] flick; //短时闪变 3
	public Float freq; //频率

	public Float[] fluct; //电压波动
	public Float[] lflick; //长时闪变
	public Float[] udd_ss; //稳态变动
	public Float[] udd_max; //最大变动
	public Float[] p; //总有功
	public Float[] p_fund; //总基波有功
	public Float[] q; //总无功
	public Float[] q_fund; //总基波无功
	// 高频谐波增加的数据 *************************************************************
	//中心频率从2.1kHz到8.9kHz,以200Hz为间隔
	public Float[][] hf_harmu; //高频谐波电压
	public Float[][] hf_harmi; //高频谐波电流
	public Float[] data_by_2; //备用
	public PowerReg()
	{
		time = new RTC_Timer_MS();
		uu_dev = new Float[3];
		ul_dev = new Float[3];
		harmu_thd = new Float[3];
		harmi_thd = new Float[3];
		harmu = new Float[3][50];
		harmi = new Float[3][50];
		inharmu = new Float[3][50];
		inharmi = new Float[3][50];
		flick = new Float[3];


		fluct = new Float[3];
		lflick = new Float[3];
		udd_ss = new Float[3];
		udd_max = new Float[3];
		p = new Float[4];
		p_fund = new Float[4];
		q = new Float[4];
		q_fund = new Float[4];

		hf_harmu = new Float[3][35];
		hf_harmi = new Float[3][35];
		data_by_2 = new Float[210];
	}
	public static int GetSize()
	{
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		int len = 7 * Short.SIZE / Byte.SIZE + 3 * Integer.SIZE / Byte.SIZE + (15 + 600 + 3 + 28 + 420) *  Float.SIZE / Byte.SIZE;
		return len;
	}

	public final boolean SetStructBuf(byte[] bArray, int nHaveRead)
	{
		int nByteSize = bArray.length;
		if (nByteSize < GetSize())
		{
			return false;
		}

		int iStep = nHaveRead;
		time.SetStructBuf(bArray, iStep);
		iStep = iStep + RTC_Timer_MS.GetSize();
		line = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		reg = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		data_type = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		u_blance = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		i_blance = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		RefObject<Float[]> tempRef_uu_dev = new RefObject<Float[]>(uu_dev);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_uu_dev);
		uu_dev = tempRef_uu_dev.argvalue;
		RefObject<Float[]> tempRef_ul_dev = new RefObject<Float[]>(ul_dev);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_ul_dev);
		ul_dev = tempRef_ul_dev.argvalue;
		RefObject<Float[]> tempRef_harmu_thd = new RefObject<Float[]>(harmu_thd);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_harmu_thd);
		harmu_thd = tempRef_harmu_thd.argvalue;
		RefObject<Float[]> tempRef_harmi_thd = new RefObject<Float[]>(harmi_thd);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_harmi_thd);
		harmi_thd = tempRef_harmi_thd.argvalue;
		RefObject<Float[][]> tempRef_harmu = new RefObject<Float[][]>(harmu);
		iStep += Service.convertFloatArrayTwo(bArray, iStep, tempRef_harmu);
		harmu = tempRef_harmu.argvalue;
		RefObject<Float[][]> tempRef_harmi = new RefObject<Float[][]>(harmi);
		iStep += Service.convertFloatArrayTwo(bArray, iStep, tempRef_harmi);
		harmi = tempRef_harmi.argvalue;
		RefObject<Float[][]> tempRef_inharmu = new RefObject<Float[][]>(inharmu);
		iStep += Service.convertFloatArrayTwo(bArray, iStep, tempRef_inharmu);
		inharmu = tempRef_inharmu.argvalue;
		RefObject<Float[][]> tempRef_inharmi = new RefObject<Float[][]>(inharmi);
		iStep += Service.convertFloatArrayTwo(bArray, iStep, tempRef_inharmi);
		inharmi = tempRef_inharmi.argvalue;
		RefObject<Float[]> tempRef_flick = new RefObject<Float[]>(flick);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_flick);
		flick = tempRef_flick.argvalue;
		freq = Service.convertfloat(bArray, iStep);
		RefObject<Float[]> tempRef_fluct = new RefObject<Float[]>(fluct);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_fluct);
		fluct = tempRef_fluct.argvalue;
		RefObject<Float[]> tempRef_lflick = new RefObject<Float[]>(lflick);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_lflick);
		lflick = tempRef_lflick.argvalue;
		RefObject<Float[]> tempRef_udd_ss = new RefObject<Float[]>(udd_ss);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_udd_ss);
		udd_ss = tempRef_udd_ss.argvalue;
		RefObject<Float[]> tempRef_udd_max = new RefObject<Float[]>(udd_max);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_udd_max);
		udd_max = tempRef_udd_max.argvalue;
		RefObject<Float[]> tempRef_p = new RefObject<Float[]>(p);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_p);
		p = tempRef_p.argvalue;
		RefObject<Float[]> tempRef_p_fund = new RefObject<Float[]>(p_fund);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_p_fund);
		p_fund = tempRef_p_fund.argvalue;
		RefObject<Float[]> tempRef_q = new RefObject<Float[]>(q);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_q);
		q = tempRef_q.argvalue;
		RefObject<Float[]> tempRef_q_fund = new RefObject<Float[]>(q_fund);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_q_fund);
		q_fund = tempRef_q_fund.argvalue;

		RefObject<Float[][]> tempRef_hf_harmu = new RefObject<Float[][]>(hf_harmu);
		iStep += Service.convertFloatArrayTwo(bArray, iStep, tempRef_hf_harmu);
		hf_harmu = tempRef_hf_harmu.argvalue;
		RefObject<Float[][]> tempRef_hf_harmi = new RefObject<Float[][]>(hf_harmi);
		iStep += Service.convertFloatArrayTwo(bArray, iStep, tempRef_hf_harmi);
		hf_harmi = tempRef_hf_harmi.argvalue;
		RefObject<Float[]> tempRef_data_by_2 = new RefObject<Float[]>(data_by_2);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_data_by_2);
		data_by_2 = tempRef_data_by_2.argvalue;
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;

		return true;
	}
}