fix: 日志文件乱码修复日志配置,修复读取信号转换异常
This commit is contained in:
@@ -126,9 +126,9 @@ public class ItemProtocol {
|
|||||||
|
|
||||||
public int getOpcIntegerValue(String protocol) {
|
public int getOpcIntegerValue(String protocol) {
|
||||||
Integer value = this.driver.getIntegeregerValue(protocol);
|
Integer value = this.driver.getIntegeregerValue(protocol);
|
||||||
if(ObjectUtil.isEmpty(value)){
|
if (ObjectUtil.isEmpty(value)) {
|
||||||
deviceStatus = true;
|
deviceStatus = true;
|
||||||
}else if (item_heartbeat.equals(protocol)){
|
} else if (item_heartbeat.equals(protocol)) {
|
||||||
deviceStatus = false;
|
deviceStatus = false;
|
||||||
}
|
}
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
@@ -138,6 +138,9 @@ public class ItemProtocol {
|
|||||||
setIsonline(true);
|
setIsonline(true);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
if (item_mode.equals(protocol)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
last_inst_message = inst_message;
|
last_inst_message = inst_message;
|
||||||
if ("true".equals(this.device.getExtraValue().get("ship_device_update"))) {
|
if ("true".equals(this.device.getExtraValue().get("ship_device_update"))) {
|
||||||
this.requiresShipDeviceUpdate = false;
|
this.requiresShipDeviceUpdate = false;
|
||||||
if (mode > 0) {
|
if (mode >= 0) {
|
||||||
shipDeviceUpdate();
|
shipDeviceUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -358,7 +358,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
Instruction instruction = null;
|
Instruction instruction = null;
|
||||||
List toInstructions;
|
List toInstructions;
|
||||||
if(mode > 0) {
|
if (mode > 0) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 1:
|
case 1:
|
||||||
log.debug("设备运转模式:等待工作");
|
log.debug("设备运转模式:等待工作");
|
||||||
@@ -615,10 +615,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
move = "有托盘有货";
|
move = "有托盘有货";
|
||||||
jo.put("hasGoods", true);
|
jo.put("hasGoods", true);
|
||||||
}
|
}
|
||||||
if(deviceStatus){
|
if (deviceStatus) {
|
||||||
iserror = true;
|
iserror = true;
|
||||||
}
|
}
|
||||||
if(error == 0 && !deviceStatus){
|
if (error == 0 && !deviceStatus) {
|
||||||
iserror = false;
|
iserror = false;
|
||||||
}
|
}
|
||||||
if (this.carrier_direction == 1) {
|
if (this.carrier_direction == 1) {
|
||||||
@@ -630,7 +630,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if (this.requireSucess) {
|
if (this.requireSucess) {
|
||||||
requireSucess = "1";
|
requireSucess = "1";
|
||||||
}
|
}
|
||||||
if(error == 0 && iserror){
|
if (error == 0 && iserror) {
|
||||||
message = "信号连接异常!";
|
message = "信号连接异常!";
|
||||||
}
|
}
|
||||||
jo.put("device_name", this.getDevice().getDevice_name());
|
jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
@@ -1086,7 +1086,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
apply.put("type", "2");
|
apply.put("type", "2");
|
||||||
String str = acsToWmsService.applyTaskToWms(apply);
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请空盘入库,请求参数:" + apply + ",响应参数:" + JSON.toJSONString(str));
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请空盘入库,请求参数:" + apply + ",响应参数:" + JSON.toJSONString(str));
|
||||||
message = "申请空盘入库任务,请求参数:" + apply + "响应参数: "+ str;
|
message = "申请空盘入库任务,请求参数:" + apply + "响应参数: " + str;
|
||||||
|
|
||||||
JSONObject jo = JSON.parseObject(str);
|
JSONObject jo = JSON.parseObject(str);
|
||||||
if (ObjectUtil.isEmpty(jo)) {
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
|
|||||||
@@ -150,13 +150,13 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
/**
|
/**
|
||||||
* 下发目标站
|
* 下发目标站
|
||||||
*/
|
*/
|
||||||
int to_target = 0;
|
String to_target = null;
|
||||||
int last_to_target = 0;
|
String last_to_target = null;
|
||||||
/**
|
/**
|
||||||
* 下发任务号
|
* 下发任务号
|
||||||
*/
|
*/
|
||||||
int to_task = 0;
|
String to_task = null;
|
||||||
int last_to_task = 0;
|
String last_to_task = null;
|
||||||
/**
|
/**
|
||||||
* 下发接纯数字托盘号
|
* 下发接纯数字托盘号
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -110,15 +110,15 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_task);
|
return this.getOpcIntegerValue(item_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_task() {
|
public String getTo_task() {
|
||||||
return this.getOpcIntegerValue(item_to_task);
|
return this.getOpcStringValue(item_to_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public int getTotarget() {
|
public String getTotarget() {
|
||||||
return this.getOpcIntegerValue(item_to_target);
|
return this.getOpcStringValue(item_to_target);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTo_command() {
|
public String getTo_command() {
|
||||||
|
|||||||
@@ -121,8 +121,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
String to_task = null;
|
String to_task = null;
|
||||||
String last_to_task = null;
|
String last_to_task = null;
|
||||||
|
|
||||||
int to_container_type = 0;
|
String to_container_type = null;
|
||||||
int last_to_container_type = 0;
|
String last_to_container_type = null;
|
||||||
|
|
||||||
String to_height_level = null;
|
String to_height_level = null;
|
||||||
String last_to_height_level = null;
|
String last_to_height_level = null;
|
||||||
|
|||||||
@@ -148,8 +148,8 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_container_type);
|
return this.getOpcIntegerValue(item_container_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_container_type(){
|
public String getTo_container_type(){
|
||||||
return this.getOpcIntegerValue(item_to_container_type);
|
return this.getOpcStringValue(item_to_container_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTo_height_level(){
|
public String getTo_height_level(){
|
||||||
|
|||||||
@@ -30,11 +30,9 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<withJansi>true</withJansi>
|
<withJansi>true</withJansi>
|
||||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
<pattern>${log.pattern}</pattern>
|
<pattern>${log.pattern}</pattern>
|
||||||
<charset>${log.charset}</charset>
|
<!--<charset>${log.charset}</charset>-->
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
|
||||||
<!-- 按照每天生成日志文件 -->
|
<!-- 按照每天生成日志文件 -->
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
@@ -50,6 +48,7 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>${log.charset}</charset>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user