利珀光源控制器联调

merge-requests/5/merge
Your Name 4 years ago
parent 5b7fe884c1
commit f6ab3f46d8

@ -77,6 +77,8 @@ public class ConfigProperties {
public static class LightSource{
private Integer type;
private String info;
private Integer num;
private Integer index;
}
@Data

@ -87,13 +87,13 @@ public class StreetController {
if(configProperties.getLightSource().getType() == 1){
JYDAMEquip equip = JYDamHelper.Connect(lightSource.getIp(),lightSource.getPort());
JYDamHelper.openDO(equip,obj.getInteger("index"));
Integer status = JYDamHelper.ReadStatus(equip,obj.getInteger("num"),obj.getInteger("index"));
JYDamHelper.openDO(equip,configProperties.getLightSource().getIndex());
Integer status = JYDamHelper.ReadStatus(equip,configProperties.getLightSource().getNum(),configProperties.getLightSource().getIndex());
log.info("ip:{},status:{}",lightSource.getIp(),status);
equip.DisConnect();
}else if(configProperties.getLightSource().getType() == 2){
HikControlSocket.openLight(lightSource.getIp(),lightSource.getPort(),1,1);
HikControlSocket.openLight(lightSource.getIp(),lightSource.getPort(),configProperties.getLightSource().getIndex(),1);
}
});
@ -116,7 +116,7 @@ public class StreetController {
Integer status = JYDamHelper.ReadStatus(equip,obj.getInteger("num"),obj.getInteger("index"));
log.info("ip:{},status:{}",lightSource.getIp(),status);
}else if(configProperties.getLightSource().getType() == 2){
HikControlSocket.openLight(lightSource.getIp(),lightSource.getPort(),1,0);
HikControlSocket.openLight(lightSource.getIp(),lightSource.getPort(),4,0);
}
});

@ -16,10 +16,17 @@ public class TestController {
@Resource
private TestService testService;
@ApiOperation("新增")
@ApiOperation("自动盘点")
@GetMapping("/check/{id}/{leftRight}")
public Result test(@PathVariable Integer id,@PathVariable Integer leftRight){
testService.CheckTest(id,leftRight);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
testService.CheckTest(id,leftRight);
}
});
thread.start();
return Result.success();
}

@ -118,7 +118,7 @@ public class JoywareLoginModuleImpl implements CameraControlLoginModule {
if(m_hLoginHandle.longValue()==0){
return null;
}
log.info("hik login success");
log.info("joyware login success");
return m_hLoginHandle;
}

@ -23,8 +23,7 @@ public class TestService {
public void CheckTest(Integer StreetId,Integer leftRight){
if(!isRunning){
isRunning = Boolean.TRUE;
Street street = streetService.streetById(StreetId);
Integer row = street.getLeftRow();
Integer column = street.getLeftColumn();
@ -45,7 +44,7 @@ public class TestService {
} catch (InterruptedException e) {
e.printStackTrace();
}
plcService.gyrateCameraByCode(street.getCamera1Id(),"C5");
plcService.gyrateCameraByCode(plcService.getCameraByPlcCmd(plcCmdInfo,leftRight),"C5");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
@ -53,11 +52,5 @@ public class TestService {
}
}
}
isRunning = Boolean.FALSE;
return;
}
log.info("test running");
}
}

@ -30,15 +30,16 @@ public class HikControlSocket {
InputStream is = null;
try {
socket.connect(new InetSocketAddress(ip,port),3000);
socket.setSoTimeout(10000);
//socket.setSoTimeout(10000);
os = socket.getOutputStream();
Thread.sleep(100);
controlCmd(os,bool,index);
is = socket.getInputStream();
String s = read(socket.getInputStream());
//is = socket.getInputStream();
//String s = read(socket.getInputStream());
//log.info("hik receieve:{}",s);
socket.close();
} catch (IOException e) {
log.error("sick time out,ip:{},info:{}",ip,e);
log.error("hik contro time out,ip:{},info:{}",ip,e);
}finally {
if(os != null){
try {
@ -75,6 +76,7 @@ public class HikControlSocket {
private static void controlCmd(OutputStream os,int bool,int index) throws IOException {
String startCmd = "<"+index+","+bool+","+"post>";
byte [] bytes = startCmd.getBytes(StandardCharsets.UTF_8);
log.info("hik contro light:{}",startCmd);
os.write(bytes);
}

@ -19,56 +19,56 @@ spring:
validationQuery: SELECT 1 FROM DUAL
# --------本服务端口号
server:
port: 8099
port: 8100
#--------------
# ------用户中心地址
userUrl: http://115.236.65.98:11001
# -----------
# ----默认摄像头的连接信息
cameraConfig:
# ------------球機選擇--- 0:中威 1海康
cameraType: 1
# ------------球機選擇--- 0:利珀 1海康
cameraType: 0
cameraPassword: a1234567
cameraUser: admin
# ------海康默认是8000 中威是37777
cameraPort: 37777
#相机抓图延迟 毫秒
delayCaptureTime: 2000
cameraPort: 8000
videoServer: 127.0.0.1:8083
#相机抓图延迟 毫秒,这个延迟是等待球机球机转动到位,然后拍照的
delayCaptureTime: 3500
# 下载mp4延迟 海康的下载mp4需要2分钟
# 中威延迟10s就可
# 利珀延迟10s就可
# 单位毫秒
delayDownloadMp4: 120000
# ------------
# -----图片 mp4下载地址
savePath:
mediaPath: d:\\data\media\
mp4Path: d:\\data\mp4\
mp4Path: d://data/mp4/
# ------------服务端类型 0TCP(罗伯泰克) 1:KSEC(JSON)(昆船)
serverMode: 1
ksec:
ip: 127.0.0.1
#ip: 192.168.43.46
port: 9000
port: 3000
# ------------ 实时视频流 全部页面的格式 行列数量
videoStyleConfig:
videoStyleRow: 3
videoStyleColumn: 3
videoStyleRow: 2
videoStyleColumn: 2
# ------------光源---
# -------------type 0:没有光源 1JYDam
# -----------1:JYDam 配置num和index
# -------------type 0:没有光源 1利珀光源控制器JYDam 2利珀视觉控制器
# ----------- num:总共多少个光源端口 index:需要控制的是哪个
# ------------ 利珀视觉控制器id从1开始光源控制器从0开始
lightSource:
type: 1
info: "{'num':2,'index':0}"
type: 2
num: 4
index: 1
# -----------扫码枪
# ------------type 1: sick
sensor:
type: 1
# -----tray 托盘
# -----goods 货物
# 扫码模式 1球机扫码 2扫码枪 0:不用扫码
# 扫码模式 1球机扫码 2扫码枪
scanCodeMode:
tray: 2
tray: 0
goods: 1
goodsCodeTypes:
- 14

@ -19,15 +19,15 @@ spring:
validationQuery: SELECT 1 FROM DUAL
# --------本服务端口号
server:
port: 8099
port: 8100
#--------------
# ------用户中心地址
userUrl: http://115.236.65.98:11001
# -----------
# ----默认摄像头的连接信息
cameraConfig:
# ------------球機選擇--- 0:中威 1海康
cameraType: 1
# ------------球機選擇--- 0:利珀 1海康
cameraType: 0
cameraPassword: a1234567
cameraUser: admin
cameraPort: 8000
@ -35,7 +35,7 @@ cameraConfig:
#相机抓图延迟 毫秒,这个延迟是等待球机球机转动到位,然后拍照的
delayCaptureTime: 3500
# 下载mp4延迟 海康的下载mp4需要2分钟
# 中威延迟10s就可
# 利珀延迟10s就可
# 单位毫秒
delayDownloadMp4: 120000
# ------------
@ -53,13 +53,13 @@ videoStyleConfig:
videoStyleRow: 2
videoStyleColumn: 2
# ------------光源---
# -------------type 0:没有光源 1JYDam 2视觉控制器
# -----------1:JYDam 配置num和index num:总共多少个控制口 index:需要控制的是哪个
# -------------type 0:没有光源 1利珀光源控制器JYDam 2利珀视觉控制器
# ----------- num:总共多少个光源端口 index:需要控制的是哪个
# ------------ 利珀视觉控制器id从1开始光源控制器从0开始
lightSource:
type: 1
info: "{'num':2,'index':0}"
num: 2
index: 0
type: 2
num: 4
index: 1
# -----------扫码枪
# ------------type 1: sick
sensor:

@ -14,35 +14,35 @@ spring:
testWhileIdle: false
timeBetweenEvictionRunsMillis: 60000
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://115.236.65.98:12004/lia_duoji?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
url: jdbc:mysql://127.0.0.1:3306/lia_duoji?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
username: root
validationQuery: SELECT 1 FROM DUAL
# --------本服务端口号
server:
port: 8099
port: 8100
#--------------
# ------用户中心地址
userUrl: http://115.236.65.98:11001
# -----------
# ----默认摄像头的连接信息
cameraConfig:
# ------------球機選擇--- 0:中威 1海康
# ------------球機選擇--- 0:利珀 1海康
cameraType: 0
cameraPassword: a1234567
cameraUser: admin
cameraPort: 37777
cameraPort: 8000
videoServer: 127.0.0.1:8083
#相机抓图延迟 毫秒
delayCaptureTime: 2000
#相机抓图延迟 毫秒,这个延迟是等待球机球机转动到位,然后拍照的
delayCaptureTime: 3500
# 下载mp4延迟 海康的下载mp4需要2分钟
# 中威延迟10s就可
# 利珀延迟10s就可
# 单位毫秒
delayDownloadMp4: 120000
# ------------
# -----图片 mp4下载地址
savePath:
mediaPath: d:\\data\media\
mp4Path: d:\\data\mp4\
mp4Path: d://data/mp4/
# ------------服务端类型 0TCP(罗伯泰克) 1:KSEC(JSON)(昆船)
serverMode: 1
ksec:
@ -53,11 +53,13 @@ videoStyleConfig:
videoStyleRow: 2
videoStyleColumn: 2
# ------------光源---
# -------------type 0:没有光源 1JYDam
# -----------1:JYDam 配置num和index
# -------------type 0:没有光源 1利珀光源控制器JYDam 2利珀视觉控制器
# ----------- num:总共多少个光源端口 index:需要控制的是哪个
# ------------ 利珀视觉控制器id从1开始光源控制器从0开始
lightSource:
type: 1
info: "{'num':2,'index':0}"
type: 2
num: 4
index: 1
# -----------扫码枪
# ------------type 1: sick
sensor:
@ -66,7 +68,7 @@ sensor:
# -----goods 货物
# 扫码模式 1球机扫码 2扫码枪
scanCodeMode:
tray: 2
tray: 0
goods: 1
goodsCodeTypes:
- 14

Loading…
Cancel
Save