first commit
This commit is contained in:
45
public/template/PreTreatmentTemplate.java
Normal file
45
public/template/PreTreatmentTemplate.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.cbsd.client.pretreatment;
|
||||
|
||||
import com.cbsd.client.pretreatment.CalculateUtils;
|
||||
import com.cbsd.client.pretreatment.IPreTreatmentInterface;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 预处理脚本示例, 实现 IPreTreatmentInterface 接口
|
||||
* 累加预处理
|
||||
*/
|
||||
public class PreTreatmentTemplate implements IPreTreatmentInterface {
|
||||
|
||||
/**
|
||||
* 预处理
|
||||
*
|
||||
* @param command 指令内容
|
||||
* @param repeatCount 重复次数
|
||||
* @param hitCount 命中次数
|
||||
* @param latestHitTime 最后命中时间
|
||||
* @param dataMap 数据集合,key为协议字段属性名(label),value为物理值
|
||||
* @param calculateUtils 计算工具类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String pretreatment(String command, int repeatCount, int hitCount, String latestHitTime, Map<String, String> dataMap, CalculateUtils calculateUtils) {
|
||||
String resultCommand = "";
|
||||
if (hitCount < 10) {
|
||||
resultCommand += "0" + hitCount;
|
||||
} else {
|
||||
resultCommand = String.valueOf(hitCount);
|
||||
}
|
||||
return resultCommand;
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*
|
||||
* @return 描述内容
|
||||
*/
|
||||
@Override
|
||||
public String comment() {
|
||||
return "根据命中次数累加拼接";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user