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

public class DATA_RMS //有效值数据
{
	private RTC_Timer time; //数据时标
	private Float[] RMS; //9 相电压、线电压、电流有效值
	private Float[] UU_DEV; //6 相电压、线电压上偏差
	private Float[] UL_DEV; //6 相电压、线电压上偏差
	private Float[] THD; //6 电压电流畸变率
	private Float[] FREQ; //2 频率及频率偏差
	private Float[][] UI_SEQ; //2-5 电压电流序分量及不平衡度
	private Float[][] TOTAL_POWER; //4-3 分相及总功率P、Q、S
	private Float[] COS_PF; //4 视在功率因数
	private Float[] COS_DF; //4 位移功率因数
	public DATA_RMS()
	{
		time = new RTC_Timer();
		RMS = new Float[9];
		UU_DEV = new Float[6];
		UL_DEV = new Float[6];
		THD = new Float[6];
		FREQ = new Float[2];
		UI_SEQ = new Float[2][5];
		TOTAL_POWER = new Float[4][3];
		COS_PF = new Float[4];
		COS_DF = new Float[4];
	}
	public static int GetSize()
	{
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		return 6 * Short.SIZE + 59 *  Float.SIZE;
	}
	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.GetSize();
		RefObject<Float[]> tempRef_RMS = new RefObject<Float[]>(RMS);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_RMS);
		RMS = tempRef_RMS.argvalue;
		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_THD = new RefObject<Float[]>(THD);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_THD);
		THD = tempRef_THD.argvalue;
		RefObject<Float[]> tempRef_FREQ = new RefObject<Float[]>(FREQ);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_FREQ);
		FREQ = tempRef_FREQ.argvalue;
		RefObject<Float[][]> tempRef_UI_SEQ = new RefObject<Float[][]>(UI_SEQ);
		iStep += Service.convertFloatArrayTwo(bArray, iStep, tempRef_UI_SEQ);
		UI_SEQ = tempRef_UI_SEQ.argvalue;
		RefObject<Float[][]> tempRef_TOTAL_POWER = new RefObject<Float[][]>(TOTAL_POWER);
		iStep += Service.convertFloatArrayTwo(bArray, iStep, tempRef_TOTAL_POWER);
		TOTAL_POWER = tempRef_TOTAL_POWER.argvalue;
		RefObject<Float[]> tempRef_COS_PF = new RefObject<Float[]>(COS_PF);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_COS_PF);
		COS_PF = tempRef_COS_PF.argvalue;
		RefObject<Float[]> tempRef_COS_DF = new RefObject<Float[]>(COS_DF);
		iStep += Service.convertFloatArraySingle(bArray, iStep, tempRef_COS_DF);
		COS_DF = tempRef_COS_DF.argvalue;
		return true;
	}
}