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

/**
 工程数据文件信息

 */
public class PrjRecordInfo
{
	public pqv_dev_info_int dev_info; //装置信息
	public CmnModeCfg cfg; //测试记录工程配置
	public prj_store_info store_mag; //存储管理缓冲
	public int tv_sec_s; //开始记录时间
	public int tv_sec_e; //结束记录时间
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint status;
	public int status; //测试工程数据是否有效标志

	public PrjRecordInfo()
	{
		dev_info = new pqv_dev_info_int();
		cfg = new CmnModeCfg();
		store_mag = new prj_store_info();
	}
	public static int GetSize() //用于定义Byte数组
	{
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		int nSize = 2 * Integer.SIZE / Byte.SIZE + 1 * Integer.SIZE / Byte.SIZE + pqv_dev_info_int.GetSize() + CmnModeCfg.GetSize() + prj_store_info.GetSize(); //CComtradeDataItem数据结构数据长度
		return nSize;
	}
	public final boolean SetStructBuf(byte[] bArray, int nHaveRead)
	{
		int nByteSize = bArray.length;
		if (nByteSize < GetSize())
		{
			return false;
		}
		int iStep = nHaveRead;

		dev_info.SetStructBuf(bArray, iStep);
		iStep = iStep + pqv_dev_info_int.GetSize();
		cfg.SetStructBuf(bArray, iStep);
		iStep = iStep + CmnModeCfg.GetSize();
		store_mag.SetStructBuf(bArray, iStep);
		iStep = iStep + prj_store_info.GetSize();
		tv_sec_s = Service.convertInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		tv_sec_e = Service.convertInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		status = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		return true;
	}

	public final boolean SetStructBuf_net(byte[] bArray, int nHaveRead) //处理文件解析时 需要处理报文大小头
	{
		int nByteSize = bArray.length;
		if (nByteSize < GetSize())
		{
			return false;
		}
		int iStep = nHaveRead;

		dev_info.SetStructBuf(bArray, iStep);
		iStep = iStep + pqv_dev_info_int.GetSize();
		cfg.SetStructBuf_net(bArray, iStep);
		iStep = iStep + CmnModeCfg.GetSize();
		store_mag.SetStructBuf_net(bArray, iStep);
		iStep = iStep + prj_store_info.GetSize();
		tv_sec_s = Service.convertInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		tv_sec_e = Service.convertInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		status = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		return true;
	}
}