📄 parsev3pmdatafile.java
字号:
.error(
("ParseV3DataFile.parseFileAndInsertDB: NEA_GetCounterGroup_Error"),
e);
}
// 计数器组内计数器的个数
int counterCnt = msgInStream.readShort();
count = count + 2;
// 该计数器组下的dn的个数
int measObjCnt = msgInStream.readShort();
count = count + 2;
log.debug(ParseV3PMDataFile.class, new StringBuilder().append(
"计数器组ID ").append(groupId).append("/组内计数器个数:").append(
counterCnt).append("/测量对象个数 ").append(measObjCnt)
.toString());
// 在该计数器组内的结束时间的Set
Set<Date> endTimeSetInV3Group = new HashSet<Date>();
// 对于计数器组ID为22的需要特殊处理
if (groupId == 22) {
// log.debug(NewParseV3DataFile.class, new StringBuilder()
// .append("parse pmdata file : 计数器组ID ").append(
// groupId).append("测量对象个数 ").append(
// measObjCnt).toString());
for (int i = 0; i < measObjCnt; i++) {
GuideLineData guideLineData = new GuideLineData();
// add by liuyuan 2007-7-19 增加设置计数器组ID
guideLineData.setCounterGroupId(groupId);
// end by liuyuan
/* dn */
NeMoi nemoi = new NeMoi();
nemoi.setMoc(msgInStream.readInt());
// count = count + 4;
nemoi.setMoi(msgInStream.readBytes(8));
String dn = IimUtil.NeMoitoDn(type, nemoi);
count = count + 12;
// log.debug(ParseV3DataFile.class, new StringBuilder()
// .append("parse pmdata file : dn_").append(i)
// .append(" ").append(dn).toString());
guideLineData.setDn(dn);
readTimeInfo(msgInStream, guideLineData,
endTimeSetInV3Group);
count = count + 8;
// add by liuyuan 2007-8-22
/** 后7个Bit代表7个Slot,对应位置为1表示下行 */
long status = msgInStream.readUInt();
// add by liuyuan 2007-9-13
count = count + 4;
long[] values = new long[7];
// modify by liuyuan 2007-8-28 7bit从左到右是时隙0到时隙6
// values[0] = status & 0x00000001;
// values[1] = (status & 0x00000002) >> 1;
// values[2] = (status & 0x00000004) >> 2;
// values[3] = (status & 0x00000008) >> 3;
// values[4] = (status & 0x00000010) >> 4;
// values[5] = (status & 0x00000020) >> 5;
// values[6] = (status & 0x00000040) >> 6;
values[6] = status & 0x00000001;
values[5] = (status & 0x00000002) >> 1;
values[4] = (status & 0x00000004) >> 2;
values[3] = (status & 0x00000008) >> 3;
values[2] = (status & 0x00000010) >> 4;
values[1] = (status & 0x00000020) >> 5;
values[0] = (status & 0x00000040) >> 6;
// end modify by liuyuan 2007-8-28
/** 上行时隙个数 */
int upcount = 0;
int index = 0;
for (int k = 0; k < values.length; k++) {
if (values[k] == 0) {
upcount++;
}
}
List<NameValue> nvs = new ArrayList<NameValue>();
// 上行时隙个数
NameValue nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(upcount);
nvs.add(nv);
// log.debug(nv.getName() + " : " + nv.getValue());
// 下行时隙个数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(7 - upcount);
nvs.add(nv);
/**
* 7个时隙,每个时隙有6个计数器 平均干扰功率 最大干扰功率 上行时隙 平均接受功率 下行时隙 平均发射功率
* 上行时隙 最大接受功率 下行时隙 最大发射功率
*
*/
for (int p = 0; p < values.length; p++) {
/** 如果是上行时隙 */
/** CRMCN00002983 V3的PC需要对22组计数器的值进行换算后入库 */
if (values[p] == 0) {
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(PmUtil
.DisturbPowTransform(msgInStream
.readUInt()));
nvs.add(nv);
count = count + 4;
// log.debug(nv.getName() + " : " +
// nv.getValue());
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(PmUtil
.DisturbPowTransform(msgInStream
.readUInt()));
nvs.add(nv);
count = count + 4;
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 上行时隙 平均接受功率
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(PmUtil
.ReceivePowTransform(msgInStream
.readUInt()));
nvs.add(nv);
count = count + 4;
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 上行时隙时,下行时隙的平均发射功率应该为null
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 上行时隙 最大接受功率
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(PmUtil
.ReceivePowTransform(msgInStream
.readUInt()));
nvs.add(nv);
count = count + 4;
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 上行时隙时,下行时隙的最大发射功率应该为null
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
}
/** 如果是下行时隙 */
else {
// 下行时隙时,平均干扰功率不用转换,直接填入即可(虽然此时是无效的)
// (wangxin 080914)
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
count = count + 4;
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 下行时隙时,最大干扰功率不用转换,直接填入即可(虽然此时是无效的)
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
count = count + 4;
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 下行时隙时,上行时隙的平均接受功率应该为null
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 下行时隙 平均发射功率
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 下行时隙时,上行时隙的最大接受功率应该为null
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// log.debug(nv.getName() + " : " +
// nv.getValue());
// 下行时隙 最大发射功率
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
}
}
// 上下行BRU的处理(从1到7号6个时隙)
for (int p = 1; p < values.length; p++) {
if (values[p] == 0) {// 如果是上行时隙
// 上行时隙,BRU平均占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
// 下行时隙,BRU平均占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// 上行时隙,BRU最大占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
// 下行时隙,BRU最大占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
}
/** 如果是下行时隙 */
else {
// 上行时隙,BRU平均占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// 下行时隙,BRU平均占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
// 上行时隙,BRU最大占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// 下行时隙,BRU最大占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
}
}
/** 剩余的计数器 */
// for (int w = 0; w < 30; w++) {
// V4.00.00中22组计数器的个数又从59-->61,因此,30-->32
// for (int w = 0; w < 32; w++) {
// 将BRU拆分后,32-->18
for (int w = 0; w < 18; w++) {
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
}
if (values[0] == 0) {// 如果时隙0是上行
// 上行时隙,BRU平均占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
// 下行时隙,BRU平均占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// 上行时隙,BRU最大占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
// 下行时隙,BRU最大占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
}
else {// 如果时隙0是下行
// 上行时隙,BRU平均占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// 下行时隙,BRU平均占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
// 上行时隙,BRU最大占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(0);
nv.setTypeOfLimit(1);// 设置为1 表示这个计数器值是无效的
nvs.add(nv);
// 下行时隙,BRU最大占用数
nv = new NameValue();
nv.setName(names.get(index++));
nv.setValue(msgInStream.readUInt());
nvs.add(nv);
count = count + 4;
}
guideLineData.setNvs(nvs);
// gldata.add(guideLineData);
// dataCount++;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -