Files
UniversalTestSoftware/client/script/parse/Parse_53066c93b4864ee2b612d43aa9c56066.java

62 lines
1.6 KiB
Java
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.cbsd.client.parse;
import com.cbsd.client.parse.IParseDataInterface;
public class Parse_53066c93b4864ee2b612d43aa9c56066 implements IParseDataInterface {
/**
* 从数据解析物理值
*
* @param sn 当前字段序号
* @param sourceData 源数据
* @param fieldData 当前字段数据
* @param endian BIG大端序 LITTLE小端序
* @param binStr 二进制字符串
* @return 解析后的数据值
*/
@Override
public String parsePhysicalFromData(int sn, byte[] sourceData, byte[] fieldData, String endian, String binStr) {
String high2Bit = binStr.substring(0, 2);
String low2Bit = binStr.substring(2, 4);
String highStatus = "";
String lowStatus = "";
switch (high2Bit) {
case "00":
highStatus = "高本振失锁";
break;
case "01":
highStatus = "高本振锁定";
break;
default:
highStatus = "高本振未定义";
break;
}
switch (low2Bit) {
case "00":
lowStatus = "低本振失锁";
break;
case "01":
lowStatus = "低本振锁定";
break;
default:
lowStatus = "低本振未定义";
break;
}
return lowStatus + "" + highStatus;
}
/**
* 描述
*
* @return 描述内容
*/
@Override
public String comment() {
return "时频锁定指示";
}
}