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


/**
 装置普测工程配置信息

 */
public class CmnModeCfg
{
	public byte[] prj_name = new byte[128]; //工程名称
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint line_idx;
	public int line_idx; //监测点序号，备用，配置文件按文件名区分
	public float un; //电压等级，一次值,单位kV
	public float u_run; //运行电压，一次值,单位kV
	public float pt_ratio; //pt变比
	public float ct_ratio; //ct变比

	public float fDL_Capability; //短路容量，单位MW
	public float fJZ_Capability; //基准容量，单位MW
	public float fSB_Capability; //设备容量，单位MW
	public float fXY_Capability; //协议容量，单位MW

	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint vol_sel;
	public int vol_sel; //电压接线方式选择 星型 三角形 V型 1 2 4
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint cur_sel;
	public int cur_sel; //电流接线方式选择 //IA和IC合成计算 IB //IA和IB合成计算 IC
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint sel_cur_input;
	public int sel_cur_input; //电流输入选择：各类电流钳或柔性环

	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint data_type;
	public int data_type; //记录数据类型
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint stat_min_time;
	public int stat_min_time; //分钟统计时间间隔,单位分钟，范围1-10
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint min_max_file_size;
	public int min_max_file_size; //分钟文件分配空间，单位MB
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint sec_max_file_size;
	public int sec_max_file_size; //3秒文件分配空间，单位MB
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint ms_max_file_size;
	public int ms_max_file_size; //200ms文件分配空间，单位MB
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint lb_max_file_size;
	public int lb_max_file_size; //暂态录波分配空间，单位MB
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint lb_max_file_num;
	public int lb_max_file_num; //录波文件最大个数

	//*********************************************************************************
	//数字化配置
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: ushort app_id_u;
	private short app_id_u; //电压通道APPID
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: ushort app_id_i;
	private short app_id_i; //电流通道APPID
	private byte[] mult_mac_u = new byte[6]; //电压通道组播MAC
	private byte[] mult_mac_i = new byte[6]; //电流通道组播MAC
	private int smp_rate; //采样率
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: ushort[] link_cfg = new ushort[8];
	private Short[] link_cfg = new Short[8]; //虚拟端子配置
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: ushort is_91_or_92;
	private Short is_91_or_92; //9-1 或9-2选择，初始化系数 // 0位置1选择9-1; 1位置1选择9-2;
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: ushort dig_is_use;
	private Short dig_is_use; //数字化是否投入,0:退出 1:投入
	//*********************************************************************************

	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public uint sel_vol_input;
	public int sel_vol_input; //电压输入选择：目前电阻分压回路不需要，备用
	public char[] by = new char[1024]; //1024个字节，留着后期扩展备用
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort uStatus;
	public short uStatus; //配置有效位
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort crc;
	public short crc; //校验码

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

		for (int i = 0; i < prj_name.length; i++)
		{
			prj_name[i] = bArray[iStep];
			iStep++;
		}
		line_idx = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		un = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		u_run = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		pt_ratio = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		ct_ratio = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		fDL_Capability = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		fJZ_Capability = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		fSB_Capability = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		fXY_Capability = Service.convertfloat(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		vol_sel = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		cur_sel = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		sel_cur_input = 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;
		stat_min_time = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		min_max_file_size = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		sec_max_file_size = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		ms_max_file_size = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		lb_max_file_size = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		lb_max_file_num = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;

		app_id_u = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		app_id_i = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		for (int i = 0; i < mult_mac_u.length; i++)
		{
			mult_mac_u[i] = bArray[iStep];
			iStep++;
		}
		for (int i = 0; i < mult_mac_i.length; i++)
		{
			mult_mac_i[i] = bArray[iStep];
			iStep++;
		}
		smp_rate = Service.convertInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		RefObject<Short[]> tempRef_link_cfg = new RefObject<Short[]>(link_cfg);
		iStep += Service.convertUInt16Array(bArray, iStep, tempRef_link_cfg);
		link_cfg = tempRef_link_cfg.argvalue;
		is_91_or_92 = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		dig_is_use = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;

		sel_vol_input = Service.convertUInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		for (int i = 0; i < by.length; i++)
		{
			by[i] = (char)bArray[iStep];
			iStep++;
		}
		uStatus = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		crc = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.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;

		for (int i = 0; i < prj_name.length; i++)
		{
			prj_name[i] = bArray[iStep];
			iStep++;
		}
		line_idx = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		un = Service.convertfloat_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		u_run = Service.convertfloat_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		pt_ratio = Service.convertfloat_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		ct_ratio = Service.convertfloat_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		fDL_Capability = Service.convertfloat_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		fJZ_Capability = Service.convertfloat_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		fSB_Capability = Service.convertfloat_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		fXY_Capability = Service.convertfloat_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep +=  Float.SIZE / Byte.SIZE;
		vol_sel = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		cur_sel = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		sel_cur_input = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		data_type = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		stat_min_time = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		min_max_file_size = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		sec_max_file_size = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		ms_max_file_size = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		lb_max_file_size = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		lb_max_file_num = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		sel_vol_input = Service.convertUInt32(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		for (int i = 0; i < by.length; i++)
		{
			by[i] = (char)bArray[iStep];
			iStep++;
		}
		uStatus = Service.convertUInt16(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		crc = Service.convertUInt16(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		return true;
	}
	public final int GetStructBuf(RefObject<Byte[]> bArray, int nHaveRead)
	{
		int nSize = bArray.argvalue.length;
		if (nSize < (nHaveRead + GetSize()))
		{
			return 0;
		}
		int iStep = nHaveRead;

		for (int i = 0; i < prj_name.length; i++)
		{
			bArray.argvalue[iStep] = (byte)prj_name[i];
			iStep++;
		}
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)line_idx, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Float)un, Service.enum_Value_type.Value_float);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Float)u_run, Service.enum_Value_type.Value_float);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Float)pt_ratio, Service.enum_Value_type.Value_float);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Float)ct_ratio, Service.enum_Value_type.Value_float);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Float)fDL_Capability, Service.enum_Value_type.Value_float);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Float)fJZ_Capability, Service.enum_Value_type.Value_float);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Float)fSB_Capability, Service.enum_Value_type.Value_float);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Float)fXY_Capability, Service.enum_Value_type.Value_float);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)vol_sel, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)cur_sel, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)sel_cur_input, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)data_type, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)stat_min_time, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)min_max_file_size, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)sec_max_file_size, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)ms_max_file_size, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)lb_max_file_size, Service.enum_Value_type.Value_uint);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)lb_max_file_num, Service.enum_Value_type.Value_uint);

		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)app_id_u, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)app_id_i, Service.enum_Value_type.Value_ushort);
		for (int i = 0; i < mult_mac_u.length; i++)
		{
			bArray.argvalue[iStep] = mult_mac_u[i];
			iStep++;
		}
		for (int i = 0; i < mult_mac_i.length; i++)
		{
			bArray.argvalue[iStep] = mult_mac_i[i];
			iStep++;
		}
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)smp_rate, Service.enum_Value_type.Value_int);
		for (int i = 0; i < link_cfg.length; i++)
		{
			iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)link_cfg[i], Service.enum_Value_type.Value_ushort);
		}
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)is_91_or_92, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)dig_is_use, Service.enum_Value_type.Value_ushort);

		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)sel_vol_input, Service.enum_Value_type.Value_uint);
		for (int i = 0; i < by.length; i++)
		{
			bArray.argvalue[iStep] = (byte)by[i];
			iStep++;
		}
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)uStatus, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)crc, Service.enum_Value_type.Value_ushort);
		return GetSize();
	}
}