Commit 6452389e authored by wanghao's avatar wanghao

1 老化柜层 加上 上料 和 下料操作

2 设置 回零 和 停止操作 机械臂
parent bffaa226
...@@ -80,6 +80,22 @@ public class TStoreyInfoController extends BaseController ...@@ -80,6 +80,22 @@ public class TStoreyInfoController extends BaseController
return tStoreyInfoService.powerOutage(tStoreyInfo); return tStoreyInfoService.powerOutage(tStoreyInfo);
} }
/**
* 处理喂食
*/
@GetMapping(value = "/handleFeeding")
public AjaxResult handleFeeding(String command) {
return tStoreyInfoService.handleFeeding(command);
}
/**
* 处理消 blanking
*/
@GetMapping(value = "/handleBlanking")
public AjaxResult handleBlanking(String command) {
return tStoreyInfoService.handleBlanking(command);
}
/** /**
* 批量读取老化柜状态 * 批量读取老化柜状态
*/ */
......
...@@ -70,6 +70,8 @@ public interface IRobotArmCommandService ...@@ -70,6 +70,8 @@ public interface IRobotArmCommandService
void sendStopCommand(); void sendStopCommand();
void sendCommand(String command);
void markCommandTimeout(Long commandId); void markCommandTimeout(Long commandId);
public void processPendingCommands(); public void processPendingCommands();
} }
...@@ -49,6 +49,10 @@ public interface ITStoreyInfoService ...@@ -49,6 +49,10 @@ public interface ITStoreyInfoService
public AjaxResult powerOnAllStore(); public AjaxResult powerOnAllStore();
public AjaxResult handleFeeding(String command);
public AjaxResult handleBlanking(String command);
/** /**
* 新增老化层信息 * 新增老化层信息
* *
......
...@@ -157,6 +157,19 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService ...@@ -157,6 +157,19 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
); );
} }
/**
* 发送指令
* @param command c
*/
@Override
public void sendCommand(String command) {
SocketAddress robotAddress = getRobotAddress();
udpCommandSender.sendCommandWithId(
robotAddress,
command
);
}
@Override @Override
@Transactional @Transactional
public void completeCommand(Long commandId) { public void completeCommand(Long commandId) {
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.net.SocketAddress;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
...@@ -16,6 +17,7 @@ import com.zehong.common.utils.StringUtils; ...@@ -16,6 +17,7 @@ import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TEquipmentInfo; import com.zehong.system.domain.TEquipmentInfo;
import com.zehong.system.mapper.TEquipmentInfoMapper; import com.zehong.system.mapper.TEquipmentInfoMapper;
import com.zehong.system.modbus.util.Modbus4jUtils; import com.zehong.system.modbus.util.Modbus4jUtils;
import com.zehong.system.service.IRobotArmCommandService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TStoreyInfoMapper; import com.zehong.system.mapper.TStoreyInfoMapper;
...@@ -39,6 +41,9 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService ...@@ -39,6 +41,9 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
@Resource @Resource
private TEquipmentInfoMapper equipmentInfoMapper; private TEquipmentInfoMapper equipmentInfoMapper;
@Resource
private IRobotArmCommandService robotArmCommandService;
private final ExecutorService executorService = Executors.newFixedThreadPool(10); private final ExecutorService executorService = Executors.newFixedThreadPool(10);
/** /**
...@@ -227,6 +232,30 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService ...@@ -227,6 +232,30 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return AjaxResult.success(); return AjaxResult.success();
} }
/**
* 批量处理
* @param command c
* @return r
*/
@Override
public AjaxResult handleFeeding(String command) {
// 发送UDP指令
robotArmCommandService.sendCommand(command);
return AjaxResult.success();
}
/**
* 批量关灯
* @return r
*/
@Override
public AjaxResult handleBlanking(String command) {
// 发送UDP指令
robotArmCommandService.sendCommand(command);
return AjaxResult.success();
}
/** /**
* 批量开灯 * 批量开灯
* @return r * @return r
......
...@@ -77,6 +77,19 @@ export function PowerOutage( query) { ...@@ -77,6 +77,19 @@ export function PowerOutage( query) {
}) })
} }
export function feeding(command) {
return request({
url: '/storey/handleFeeding/' + command,
method: 'get'
})
}
export function blanking(command) {
return request({
url: '/storey/handleBlanking/' + command,
method: 'get'
})
}
export function batchReadingCabinetStatus(fEquipmentCode) { export function batchReadingCabinetStatus(fEquipmentCode) {
return request({ return request({
url: '/storey/batchReadingCabinetStatus/' + fEquipmentCode, url: '/storey/batchReadingCabinetStatus/' + fEquipmentCode,
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="info"
plain plain
icon="el-icon-reading" icon="el-icon-reading"
size="mini" size="mini"
...@@ -65,22 +65,42 @@ ...@@ -65,22 +65,42 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="danger"
plain plain
icon="el-icon-reading" icon="el-icon-circle-plus"
size="mini" size="mini"
@click="handleAllPowerOn" @click="handleAllPowerOn"
>所有设备上电</el-button> >所有设备上电</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="danger"
plain plain
icon="el-icon-reading" icon="el-icon-remove"
size="mini" size="mini"
@click="handleAllPowerOff" @click="handleAllPowerOff"
>所有设备断电</el-button> >所有设备断电</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-refresh"
size="mini"
@click="handleHome"
>机械臂回零</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-circle-close"
size="mini"
@click="handleStop"
>机械臂停止</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -127,20 +147,31 @@ ...@@ -127,20 +147,31 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handlePowerOn(scope.row)" @click="handlePowerOn(scope.row)"
>上电</el-button> >上电</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handlePowerOutage(scope.row)" @click="handlePowerOutage(scope.row)"
>断电</el-button> >断电</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleFeeding(scope.row)"
>上料</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleBlanking(scope.row)"
>下料</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -202,7 +233,11 @@ ...@@ -202,7 +233,11 @@
</template> </template>
<script> <script>
import { listStorey, getStorey, delStorey, addStorey, updateStorey, exportStorey,PowerOn,PowerOutage ,batchReadingCabinetStatus,powerOnAllStore,powerOffAllStore} from "@/api/storey/storey"; import { listStorey, getStorey, delStorey, addStorey, updateStorey,
exportStorey,PowerOn,PowerOutage ,
batchReadingCabinetStatus,powerOnAllStore,powerOffAllStore,
feeding, blanking} from "@/api/storey/storey";
import {sendHomeCommand, sendStopCommand} from "@/api/robotArm/robotArmCommand";
export default { export default {
name: "Info", name: "Info",
...@@ -365,6 +400,34 @@ export default { ...@@ -365,6 +400,34 @@ export default {
this.msgSuccess("上电成功"); this.msgSuccess("上电成功");
}).catch(() => {}); }).catch(() => {});
}, },
// 上料
handleFeeding(row) {
const fIp = row.fIp;
this.$confirm('是否确认给设备IP为"' + fIp + '"的设备上料?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return feeding(row.feedingCommand);
}).then(() => {
this.getList();
this.msgSuccess("上电成功");
}).catch(() => {});
},
// 下料
handleBlanking(row) {
const fIp = row.fIp;
this.$confirm('是否确认给设备IP为"' + fIp + '"的设备下料?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return blanking(row.blankingCommand);
}).then(() => {
this.getList();
this.msgSuccess("上电成功");
}).catch(() => {});
},
// 断电 // 断电
handlePowerOutage(row) { handlePowerOutage(row) {
const fIp = row.fIp; const fIp = row.fIp;
...@@ -430,6 +493,20 @@ export default { ...@@ -430,6 +493,20 @@ export default {
this.msgSuccess("上电成功"); this.msgSuccess("上电成功");
}).catch(() => {}); }).catch(() => {});
}, },
// 回零
handleHome() {
sendHomeCommand().then( response => {
this.$message.success("已发送");
})
},
// 停止
handleStop() {
sendStopCommand().then( response => {
this.$message.success("已发送");
})
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment