Files
2026-07-13 13:39:10 +08:00

46 lines
1.4 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.check;
import com.cbsd.client.check.ICheckInterface;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 检查脚本示例, 实现 ICheckInterface 接口
*/
public class CheckTemplate implements ICheckInterface {
/**
* 检查
*
* @param originalCommand 原始指令数据
* @param preTreatmentCommand 预处理指令数据,若无预处理,则为原始指令数据
* @param repeatCount 重复次数
* @param hitCount 命中次数
* @param latestHitTime 最后命中时间
* @param dataMap 数据集合key为协议字段属性名labelvalue为物理值
* @return 日志信息列表
*/
@Override
public List<String> check(String originalCommand, String preTreatmentCommand, int repeatCount, int hitCount, String latestHitTime, Map<String, String> dataMap) {
List<String> list = new ArrayList<>();
String temperatureStr = dataMap.get("temperature");
if (temperatureStr != null && !temperatureStr.isEmpty()) {
double temperature = Double.parseDouble(temperatureStr);
list.add("检查温度:" + temperature + "");
}
return list;
}
/**
* 描述
*
* @return 描述内容
*/
@Override
public String comment() {
return "打印检查日志";
}
}