Files
universaltestsoftware_clien…/public/template/PreTreatmentTemplate.java
2026-07-13 13:39:10 +08:00

46 lines
1.3 KiB
Java
Raw 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.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为协议字段属性名labelvalue为物理值
* @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 "根据命中次数累加拼接";
}
}