|
|
|
package com.zhonglai.luhui.smart.feeder.dto;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
|
|
|
|
public enum ConfigurationParameter {
|
|
|
|
ifVeiw(false, Boolean.class,"sys_config"),//是否显示
|
|
|
|
captureNumber(0, Integer.class,"sys_config"),//摄像头编号
|
|
|
|
reflectionThreshold(100, Integer.class,"sys_config"),//反光阈值
|
|
|
|
kernelSize(3, Integer.class,"sys_config"),//去噪调整内核大小,用来消除小的物体或噪声
|
|
|
|
maxValue(255.0, Double.class,"sys_config"), //最大反光阈值
|
|
|
|
gear_command (new HashMap<Integer,String>(),HashMap.class,"gear_command"), //档位对应的指令
|
|
|
|
absValue_command (new ArrayList<FishCurveControlCondition>(),ArrayList.class,"absValue_command"), //斜率范围对应的档位
|
|
|
|
VeiwDto_isFrame(false, Boolean.class,"sys_config"), //是否显示原图
|
|
|
|
VeiwDto_isBinaryImage(false, Boolean.class,"sys_config"), //是否显示临时图
|
|
|
|
VeiwDto_isSize(false, Boolean.class,"sys_config"), //是否显示面积
|
|
|
|
VeiwDto_isAbsValue(false, Boolean.class,"sys_config"), //是否显示斜率
|
|
|
|
absValue(0.0, Double.class,"sys_config"), //显示斜率
|
|
|
|
FishGroupImageRecognition(true, Boolean.class,"sys_config"), //鱼群图像识别是否开启
|
|
|
|
FeedingControl(true, Boolean.class,"sys_config"), //鱼群图像识别投料控制是否开启
|
|
|
|
SerialPortConfig(new SerialPortConfig().defaultSerialPortConfig(),com.zhonglai.luhui.smart.feeder.dto.SerialPortConfig.class,"sys_config"),//串口配置
|
|
|
|
ifVeiw(false, Boolean.class,"sys_config","是否显示"),//是否显示
|
|
|
|
captureNumber(0, Integer.class,"sys_config","摄像头编号"),//摄像头编号
|
|
|
|
reflectionThreshold(100, Integer.class,"sys_config","反光阈值"),//反光阈值
|
|
|
|
kernelSize(3, Integer.class,"sys_config","去噪调整内核大小,用来消除小的物体或噪声"),//去噪调整内核大小,用来消除小的物体或噪声
|
|
|
|
maxValue(255, Integer.class,"sys_config","最大反光阈值"), //最大反光阈值
|
|
|
|
gear_command (new HashMap<String,String>(),HashMap.class,"gear_command","档位对应的指令"), //档位对应的指令
|
|
|
|
absValue_command (new ArrayList<FishCurveControlCondition>(),ArrayList.class,"absValue_command","斜率范围对应的档位"), //斜率范围对应的档位
|
|
|
|
VeiwDto_isFrame(false, Boolean.class,"sys_config","是否显示原图"), //是否显示原图
|
|
|
|
VeiwDto_isBinaryImage(false, Boolean.class,"sys_config","是否显示临时图"), //是否显示临时图
|
|
|
|
VeiwDto_isSize(false, Boolean.class,"sys_config","是否显示面积"), //是否显示面积
|
|
|
|
VeiwDto_isAbsValue(false, Boolean.class,"sys_config","是否显示斜率"), //是否显示斜率
|
|
|
|
absValue(0.0, Double.class,"sys_config","显示斜率"), //显示斜率
|
|
|
|
FishGroupImageRecognition(true, Boolean.class,"sys_config","鱼群图像识别是否开启"), //鱼群图像识别是否开启
|
|
|
|
FeedingControl(true, Boolean.class,"sys_config","鱼群图像识别投料控制是否开启"), //鱼群图像识别投料控制是否开启
|
|
|
|
SerialPortConfig(new SerialPortConfig().defaultSerialPortConfig(),com.zhonglai.luhui.smart.feeder.dto.SerialPortConfig.class,"sys_config","串口配置"),//串口配置
|
|
|
|
;
|
|
|
|
|
|
|
|
private Object value;
|
|
|
|
private Class<?> valuType;
|
|
|
|
private String tableName;
|
|
|
|
|
|
|
|
ConfigurationParameter(Object value,Class valuType,String tableName) {
|
|
|
|
private String describe;
|
|
|
|
|
|
|
|
ConfigurationParameter(Object value,Class valuType,String tableName,String describe) {
|
|
|
|
this.value = value;
|
|
|
|
this.valuType = valuType;
|
|
|
|
this.tableName = tableName;
|
|
|
|
this.describe = describe;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Object getValue()
|
|
...
|
...
|
@@ -44,4 +50,25 @@ public enum ConfigurationParameter { |
|
|
|
public String getTableName() {
|
|
|
|
return tableName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDescribe() {
|
|
|
|
return describe;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String valueToString(Object o)
|
|
|
|
{
|
|
|
|
switch (getValuType().getName()) {
|
|
|
|
case "java.lang.Boolean":
|
|
|
|
return ((Boolean)o).toString();
|
|
|
|
case "java.lang.Integer":
|
|
|
|
return o+"";
|
|
|
|
case "java.lang.Double":
|
|
|
|
return o+"";
|
|
|
|
case "com.zhonglai.luhui.smart.feeder.dto.SerialPortConfig":
|
|
|
|
return JSONObject.toJSONString(o);
|
|
|
|
default:
|
|
|
|
throw new RuntimeException("配置参数类型不正确" + name() + o);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} |
...
|
...
|
|