| | |
| | | // 更改笼子数量 |
| | | @PostMapping("/UpdateStroageCageByCell") |
| | | public Result UpdateStroageCageByCell(Integer cell, Integer num) { |
| | | return storageCageService.UpdateStroageCageByCell(cell, num); |
| | | return storageCageService.UpdateStroageCageByCells(cell, num); |
| | | } |
| | | |
| | | @PostMapping("/AddOutGlass") |
| | | public Result AddOutGlass(Integer cell, Integer glasstype) { |
| | | return storageCageService.AddOutGlass(cell,glasstype); |
| | | } |
| | | |
| | | |
| | | // 手动完成任务 |
| | | @PostMapping("/FinishTask") |
| | | public Result FinishTask(Integer id) { |
| | | return storageCageService.FinishTask(); |
| | | } |
| | | |
| | | // 手动结束任务 |
| | | @PostMapping("/TerminateTask") |
| | | public Result TerminateTask(Integer id) { |
| | |
| | | public Result StartChange(String flowcard,Integer orderstate) { |
| | | return storageCageService.StartChange(flowcard,orderstate); |
| | | } |
| | | |
| | | // 开始/暂停出片队列 |
| | | @PostMapping("/UpdateOutTask") |
| | | public Result UpdateOutTask(Integer id,Integer state) { |
| | |
| | | System.out.println("控制器:" + num); |
| | | return storageCageService.deleteTasks(num); |
| | | } |
| | | |
| | | //删除出片队列 |
| | | @PostMapping("/DeleteOutTask") |
| | | public Result DeleteOutTask(Integer id) { |
| | |
| | | |
| | | @GetMapping("/writeValue") |
| | | public Result writeValue(String address, float value, String type) { |
| | | |
| | | if ("0".equals(type)) { |
| | | System.err.println("写入word" + address + "+" + value); |
| | | S7control.getinstance().WriteWord(address, (short) value); |
| | | } else if("1".equals(type)) { |
| | | |
| | | System.err.println("写入float" + address + "+" + value); |
| | | S7control.getinstance().writeFloat32(address, value); |
| | | }else if("2".equals(type)) { |
| | | System.err.println("写入bit" + address + "+" + value); |
| | | S7control.getinstance().WriteBit(address, true); |
| | | Boolean boolvue; |
| | | if (value == 0) { |
| | | boolvue = false; |
| | | } else { |
| | | boolvue = true; |
| | | } |
| | | S7control.getinstance().WriteBit(address, boolvue); |
| | | System.err.println("写入bit" + address + "+" + boolvue); |
| | | }else{ |
| | | S7control.getinstance().writetime(address, (long)value); |
| | | System.err.println("写入time" + address + "+" + value); |
| | |
| | | } |
| | | // S7control.getinstance().WriteBit(address, false); |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | |
| | | |
| | | @GetMapping("/writeButton") |
| | | public Result writeButton(String address, float value, String type) { |
| | | if(value==0){ |
| | | System.err.println("写入bit" + address + "+" + value); |
| | | String pd = String.valueOf(S7control.getinstance().ReadBits(address, 1).get(0)); |
| | | if ("true".equals(pd)) { |
| | | System.err.println("写入bit" + address + "+" + false); |
| | | S7control.getinstance().WriteBit(address, false); |
| | | }else{ |
| | | System.err.println("写入bit" + address + "+" + value); |
| | | System.err.println("写入bit" + address + "+" + true); |
| | | S7control.getinstance().WriteBit(address, true); |
| | | } |
| | | |
| | | if(value==0){ |
| | | System.err.println("写入bit" + address + "+" + false); |
| | | // S7control.getinstance().WriteBit(address, false); |
| | | }else{ |
| | | System.err.println("写入bit" + address + "+" + true); |
| | | // S7control.getinstance().WriteBit(address, true); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |