opt: 三色灯回退,OPC连接优化

This commit is contained in:
yanps
2024-02-23 15:38:33 +08:00
parent 2498dea59f
commit d4c89bc50f
6 changed files with 49 additions and 11 deletions

View File

@@ -1143,7 +1143,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
} }
/*if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver();
// hongXiangConveyorDeviceDriver.writing("to_close_door", "1"); // hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
@@ -1162,7 +1162,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
} }
}*/ }
this.writing("to_command", "5"); this.writing("to_command", "5");
this.setNow_steps_type(6); this.setNow_steps_type(6);
this.setNow_steps_type(0); this.setNow_steps_type(0);

View File

@@ -130,7 +130,6 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
@Override @Override
public void execute() { public void execute() {
String message = null;
try { try {
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode(); mode = this.itemProtocol.getMode();
@@ -162,13 +161,12 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
message = "未联机"; message = "未联机";
//有报警 //有报警
} else { } else if (error != 0) {
this.setIserror(true);
message = "有报警";
}else {
this.setIsonline(true); this.setIsonline(true);
this.setIserror(false); this.setIserror(false);
if (error != 0) {
this.setIserror(true);
message = "有报警";
}
message = ""; message = "";
Instruction instruction = null; Instruction instruction = null;
List toInstructions; List toInstructions;
@@ -179,7 +177,6 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
case 2: case 2:
break; break;
} }
} }
last_mode = mode; last_mode = mode;
last_error = error; last_error = error;

View File

@@ -2,7 +2,10 @@ package org.nl.acs.opc;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.acs.auto.run.AbstractAutoRunnable; import org.nl.acs.auto.run.AbstractAutoRunnable;
import org.nl.acs.auto.run.AutoRunService;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.udw.UnifiedDataAccessor;
import org.nl.acs.udw.UnifiedDataAccessorFactory;
import org.nl.config.thread.TheadFactoryName; import org.nl.config.thread.TheadFactoryName;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -15,6 +18,8 @@ import java.util.concurrent.*;
public class DeviceExecuteAutoRun extends AbstractAutoRunnable { public class DeviceExecuteAutoRun extends AbstractAutoRunnable {
@Autowired @Autowired
DeviceAppService deviceAppService; DeviceAppService deviceAppService;
@Autowired
private AutoRunService autoRunService;
int cache_thread = 3; int cache_thread = 3;
int corePoolSize = 50; int corePoolSize = 50;
@@ -78,6 +83,10 @@ public class DeviceExecuteAutoRun extends AbstractAutoRunnable {
log.info("设备执行线程等待opc同步线程..."); log.info("设备执行线程等待opc同步线程...");
Thread.sleep(1000L); Thread.sleep(1000L);
if (i > 60) { if (i > 60) {
UnifiedDataAccessor accessor_value = UnifiedDataAccessorFactory.getAccessor(OpcConfig.udw_opc_value_key);
if(accessor_value.getAllKey().size() < 1){
autoRunService.startThread("DeviceOpcSynchronizeAutoRun");
}
log.info("设备执行线程放弃等待opc同步线程..."); log.info("设备执行线程放弃等待opc同步线程...");
break; break;
} }
@@ -109,7 +118,6 @@ public class DeviceExecuteAutoRun extends AbstractAutoRunnable {
if (!this.runs.keySet().contains(deviceDriver.getDeviceCode())) { if (!this.runs.keySet().contains(deviceDriver.getDeviceCode())) {
this.runs.put(deviceDriver.getDeviceCode(), runnable); this.runs.put(deviceDriver.getDeviceCode(), runnable);
} }
runnable.setIndex(this.runs); runnable.setIndex(this.runs);
this.executorService.submit(runnable); this.executorService.submit(runnable);
} }

View File

@@ -72,6 +72,7 @@
"vue-echarts": "^5.0.0-beta.0", "vue-echarts": "^5.0.0-beta.0",
"vue-highlightjs": "^1.3.3", "vue-highlightjs": "^1.3.3",
"vue-image-crop-upload": "^2.5.0", "vue-image-crop-upload": "^2.5.0",
"vue-particles": "^1.0.9",
"vue-print-nb": "^1.7.5", "vue-print-nb": "^1.7.5",
"vue-router": "3.0.2", "vue-router": "3.0.2",
"vue-seamless-scroll": "^1.1.23", "vue-seamless-scroll": "^1.1.23",

View File

@@ -9,6 +9,9 @@ import 'font-awesome/css/font-awesome.css'
import mavonEditor from 'mavon-editor' import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css' import 'mavon-editor/dist/css/index.css'
import VueParticles from 'vue-particles'
Vue.use(VueParticles)
// 数据字典 // 数据字典
import dict from './components/Dict' import dict from './components/Dict'

View File

@@ -1,5 +1,23 @@
<template> <template>
<div class="login" :style="'background-image:url('+ Background +');'"> <div class="login" :style="'background-image:url('+ Background +');'">
<vue-particles
class="lizi"
color="#dedede"
:particleOpacity="0.7"
:particlesNumber="80"
shapeType="circle"
:particleSize="4"
linesColor="#dedede"
:linesWidth="1"
:lineLinked="true"
:lineOpacity="0.4"
:linesDistance="150"
:moveSpeed="3"
:hoverEffect="true"
hoverMode="grab"
:clickEffect="true"
clickMode="push"
/>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
<h3 class="title"> <h3 class="title">
{{title}}</h3> {{title}}</h3>
@@ -169,7 +187,18 @@ export default {
align-items: center; align-items: center;
height: 100%; height: 100%;
background-size: cover; background-size: cover;
} z-index: 999;
}
.lizi {
background-size: cover;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.title { .title {
margin: 0 auto 30px auto; margin: 0 auto 30px auto;
text-align: center; text-align: center;