| | |
| | | <el-menu-item index="1-1" @click="logout">{{ $t('exit') }}</el-menu-item> |
| | | <el-menu-item index="1-2" @click="showChangePasswordDialog">{{ $t('changePassword') }}</el-menu-item> |
| | | </el-submenu> |
| | | |
| | | |
| | | </template> |
| | | <template> |
| | | <el-dialog :title="$t('changePassword')" :visible.sync="dialogVisible" width="30%"> |
| | |
| | | <el-table-column prop="timeons" :label="$t('timeon')"></el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="dialogFormVisible3" > |
| | | |
| | | <el-button :class="{ 'blue-button': receivedData === 1 }" @click="toggleButtonValue(1)">{{ $t('A01Abort/ResumeTasks') }}</el-button> |
| | | <el-button :class="{ 'blue-button': receivedData2 === 1 }" @click="toggleButtonValue(2)">{{ $t('A02Abort/ResumeTasks') }}</el-button> |
| | | |
| | | <el-dialog :visible.sync="dialogFormCountDown" :title="$t('Approximately resettable time')" top="5vh"> |
| | | <div :style="'font-size: ' + PromptSize + 'px;text-align: center;'"> |
| | | <!-- {{ this.CountDowns }} --> |
| | | {{ this.CountDowns }} |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="dialogFormVisible3"> |
| | | |
| | | <el-button :class="{ 'blue-button': receivedData === 1 }" @click="toggleButtonValue(1)">{{ |
| | | $t('A01Abort/ResumeTasks') }}</el-button> |
| | | <el-button :class="{ 'blue-button': receivedData2 === 1 }" @click="toggleButtonValue(2)">{{ |
| | | $t('A02Abort/ResumeTasks') }}</el-button> |
| | | |
| | | </el-dialog> |
| | | |
| | | </el-container> |
| | |
| | | return { |
| | | activeTag: '', // 当前激活的标签 |
| | | dialogVisible: false, |
| | | receivedData:0, |
| | | receivedData2:0, |
| | | receivedData: 0, |
| | | receivedData2: 0, |
| | | formData: { |
| | | oldPassword: '', |
| | | newPassword: '', |
| | |
| | | dialogFormVisible2: false, |
| | | dialogFormVisible3: false, |
| | | alarm: [], |
| | | alarm2: [] |
| | | alarm2: [], |
| | | CountDowns: "0", |
| | | EmergencyStop: false, |
| | | PromptSize: 250, |
| | | dialogFormCountDown:false |
| | | |
| | | } |
| | | }, |
| | | // components: { |
| | |
| | | // }, |
| | | created() { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | selectList(this.menuListForm).then(res => { |
| | | this.menuList = res.data |
| | | |
| | |
| | | toggleButtonValue(buttonNumber) { |
| | | |
| | | MessageBox.confirm(this.$t('Are you sure to perform this operation?'), this.$t('prompt'), { |
| | | confirmButtonText: this.$t('confirm'), |
| | | cancelButtonText: this.$t('cancel'), |
| | | type: 'warning' |
| | | }).then(() => { |
| | | // 点击确认按钮后执行的操作 |
| | | if (buttonNumber === 1) { |
| | | this.receivedData = this.receivedData === 0 ? 1 : 0; |
| | | } else if (buttonNumber === 2) { |
| | | this.receivedData2 = this.receivedData2 === 0 ? 1 : 0; |
| | | } |
| | | console.log(this.receivedData,this.receivedData2) |
| | | confirmButtonText: this.$t('confirm'), |
| | | cancelButtonText: this.$t('cancel'), |
| | | type: 'warning' |
| | | }).then(() => { |
| | | // 点击确认按钮后执行的操作 |
| | | if (buttonNumber === 1) { |
| | | this.receivedData = this.receivedData === 0 ? 1 : 0; |
| | | } else if (buttonNumber === 2) { |
| | | this.receivedData2 = this.receivedData2 === 0 ? 1 : 0; |
| | | } |
| | | console.log(this.receivedData, this.receivedData2) |
| | | |
| | | |
| | | const data3 = []; |
| | | const resetButtonValues3 = [this.receivedData,this.receivedData2]; |
| | | const resetButtonValues3 = [this.receivedData, this.receivedData2]; |
| | | |
| | | // 将得到的值添加到 data 数组中 |
| | | data3.push(resetButtonValues3.flat()); |
| | | |
| | | |
| | | // 在 data3 数组前面添加两个空数组 |
| | | |
| | | // 创建 jsonObject3 对象,并添加 data3 属性 |
| | |
| | | console.log("急停后中止/继续选择:", jsonString3); |
| | | socket?.send(jsonString3); |
| | | setTimeout(() => { |
| | | this.dialogFormVisible3 = false; |
| | | }, 1000); // 延迟时间为1秒(1000毫秒) |
| | | this.dialogFormVisible3 = false; |
| | | }, 1000); // 延迟时间为1秒(1000毫秒) |
| | | }).catch(() => { |
| | | // 点击取消按钮后执行的操作 |
| | | }); |
| | | |
| | | |
| | | // 点击取消按钮后执行的操作 |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | |
| | | socket.onmessage = function (msg) { |
| | | //console.log("收到数据====" + msg.data); |
| | | let obj = JSON.parse(msg.data); |
| | | if(obj.alarmmg){ |
| | | if (obj.alarmmg) { |
| | | |
| | | |
| | | if (obj.alarmmg[0].length > 0) { |
| | | if (this.alarm.length > 0) { |
| | | if (this.alarm[this.alarm.length - 1].id != obj.alarmmg[0][obj.alarmmg[0].length-1].id) { |
| | | |
| | | if (obj.alarmmg[0].length > 0) { |
| | | if (this.alarm.length > 0) { |
| | | if (this.alarm[this.alarm.length - 1].id != obj.alarmmg[0][obj.alarmmg[0].length - 1].id) { |
| | | this.alarm = obj.alarmmg[0]; |
| | | this.dialogFormVisible2 = true; |
| | | } |
| | | } else { |
| | | this.alarm = obj.alarmmg[0]; |
| | | this.dialogFormVisible2 = true; |
| | | } |
| | | } else { |
| | | this.alarm = obj.alarmmg[0]; |
| | | this.dialogFormVisible2 = true; |
| | | } |
| | | }else{ |
| | | this.alarm = obj.alarmmg[0]; |
| | | this.dialogFormVisible2 = false; |
| | | } |
| | | //是否急停 |
| | | if (obj.emergencystop != null) { |
| | | this.EmergencyStop = obj.emergencystop[0]; |
| | | } |
| | | |
| | | //复位倒计时 |
| | | console.log(obj.countdown); |
| | | if (obj.countdown != null) { |
| | | if ((obj.countdown[0] == true && this.CountDowns == 0) || this.EmergencyStop == true) { |
| | | this.CountDown(); |
| | | } |
| | | } |
| | | |
| | | //复位完成信号 |
| | | if (obj.reset != null) { |
| | | this.reset = obj.reset[0]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if(obj.Abort){ |
| | | |
| | | if (obj.Abort[0].length > 0) { |
| | | this.receivedData=obj.Abort[0][0]; |
| | | this.receivedData2=obj.Abort[0][1]; |
| | | this.dialogFormVisible3 = true; |
| | | |
| | | |
| | | if (obj.Abort) { |
| | | |
| | | if (obj.Abort[0].length > 0) { |
| | | this.receivedData = obj.Abort[0][0]; |
| | | this.receivedData2 = obj.Abort[0][1]; |
| | | this.dialogFormVisible3 = true; |
| | | } |
| | | } |
| | | } |
| | | this.$forceUpdate(); |
| | | this.$forceUpdate(); |
| | | |
| | | }.bind(this); |
| | | //关闭事件 |
| | |
| | | console.log("websocket发生了错误"); |
| | | } |
| | | } |
| | | }, |
| | | //45秒复位倒数计时 |
| | | CountDown() { |
| | | let count = 45; |
| | | let timer = setInterval( |
| | | () => { |
| | | if (this.EmergencyStop == true) { |
| | | this.dialogFormCountDown = false; |
| | | clearInterval(timer); |
| | | this.CountDowns = "0"; |
| | | } else { |
| | | if (count > 0) { |
| | | this.PromptSize = 500; |
| | | this.CountDowns = count; |
| | | count--; |
| | | this.dialogFormCountDown = true; |
| | | } |
| | | else { |
| | | this.PromptSize = 200; |
| | | this.CountDowns = "Waiting for reset"; |
| | | if (this.reset == true) { |
| | | clearInterval(timer); |
| | | this.dialogFormCountDown = false; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | 1000 |
| | | ); |
| | | |
| | | }, |
| | | logout: function () { |
| | | removeToken() |
| | |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | |
| | | .blue-button { |
| | | background-color: green; |
| | | color: white; |
| | | } |
| | | |
| | | .el-header { |
| | | |
| | | background-color: #576574; |
| | |
| | | FileInputStream fileInputStream; |
| | | try { |
| | | // 从文件中读取字节数据存入 fileInputStream |
| | | fileInputStream = new FileInputStream("D:/canadames/Alarm.json"); |
| | | fileInputStream = new FileInputStream("D:/code/canadames/Alarm.json"); |
| | | // 读取 fileInputStream 中字节并将其解码为字符 |
| | | InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8"); |
| | | // 提高读取效率,在 BufferedReader 内包装 InputStreamReader |
| | |
| | |
|
| | | private Configuration config;
|
| | |
|
| | |
|
| | |
|
| | | private StorageCageService storageCageService;
|
| | |
|
| | | private StorageCageService storageCageService;
|
| | |
|
| | | public Plchome() throws IOException {
|
| | | config = new Configuration("config.properties");
|
| | |
| | | // 获取进片车状态
|
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
|
| | | 1);// 获取进片车状态
|
| | | boolean exist1 = datas1ListState.contains((short) 0);
|
| | | if(datas1ListState!=null){
|
| | | boolean exist1 = datas1ListState.contains((short) 0);
|
| | | jsonObject.append("zhuangtai", exist1);
|
| | | }
|
| | | |
| | | // 获取进片玻璃信息
|
| | | List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
|
| | | if (inglassInfo != null) {
|
| | |
| | | jsonObject.append("emergencystop", emergencystop);
|
| | | }
|
| | |
|
| | | //终止继续按钮
|
| | | // 终止继续按钮
|
| | | List<String> niuanaddressList3 = Arrays.asList(config.getProperty("Parameter2.stop").split(","));
|
| | | List<Boolean> anniuread = S7control.getinstance().readBits(niuanaddressList3);
|
| | | // Boolean[] value4 = { false, false};
|
| | | // List<Boolean> anniuread = new ArrayList<>(Arrays.asList(value4));
|
| | | // Boolean[] value5 = { true};
|
| | | // List<Boolean> resets = new ArrayList<>(Arrays.asList(value5));
|
| | | // Boolean[] value4 = { false, false};
|
| | | // List<Boolean> anniuread = new ArrayList<>(Arrays.asList(value4));
|
| | | // Boolean[] value5 = { true};
|
| | | // List<Boolean> resets = new ArrayList<>(Arrays.asList(value5));
|
| | | short[] anniuparams = new short[anniuread.size()];
|
| | | for (int i = 0; i < anniuread.size(); i++) {
|
| | | boolean value = anniuread.get(i);
|
| | | anniuparams[i] = value ? (short) 1 : (short) 0;
|
| | | }
|
| | |
|
| | |
|
| | | short[] resets2 = new short[resets.size()];
|
| | | for (int i = 0; i < resets.size(); i++) {
|
| | |
| | | resets2[i] = value ? (short) 1 : (short) 0;
|
| | | }
|
| | |
|
| | | System.out.println(resets);
|
| | | for (short number : resets2) {
|
| | |
|
| | | if (number == 1) {
|
| | | System.out.println(resets);
|
| | | jsonObject.append("Abort", anniuparams);
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | // 铝框线交互
|
| | |
|
| | |
| | |
|
| | | if (webserver != null) {
|
| | |
|
| | |
|
| | | List<String> messages = webserver.getMessages();
|
| | |
|
| | | if (!messages.isEmpty()) {
|
| | | // 将最后一个消息转换为整数类型的列表
|
| | | String lastMessage = messages.get(messages.size() - 1);
|
| | | // System.out.println("lastMessage:" + lastMessage);
|
| | | // System.out.println("lastMessage:" + lastMessage);
|
| | | JSONArray messageArray = new JSONArray(lastMessage);
|
| | |
|
| | |
|
| | | try {
|
| | | // 检查索引是否有效
|
| | |
| | | boolean val = "1".equals(cleanedValue.trim());
|
| | | // 将布尔值添加到布尔值列表中
|
| | | sValue.add(val);
|
| | | System.out.println("messageValue: " + Arrays.asList(val) + " added to the list");
|
| | |
|
| | | System.out.println(
|
| | | "messageValue: " + Arrays.asList(val) + " added to the list");
|
| | |
|
| | | } catch (NumberFormatException e) {
|
| | | // 如果无法解析为 boolean 类型,则忽略该部分
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | // 终止进片任务
|
| | | // 终止进片任务
|
| | | boolean Value1 = sValue.get(0);
|
| | | boolean Value2 = sValue.get(1);
|
| | |
|
| | |
| | |
|
| | | // 调用 S7control.getinstance().WriteBit 方法将布尔值列表写入地址列表
|
| | | S7control.getinstance().WriteBit(niuanaddressList3, sValue);
|
| | | System.out.println("Values " + sValue + " written to PLC at address " + niuanaddressList3);
|
| | | System.out.println(
|
| | | "Values " + sValue + " written to PLC at address " + niuanaddressList3);
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | | webserver.clearMessages();
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | //new PlcHold().start(); |
| | | new PlcHold().start(); |
| | | |
| | | // new Plchome().start(); |
| | | // |
| | | // new Plcalarm().start(); |
| | | // |
| | | // new Plcsign().start(); |
| | | // |
| | | // |
| | | // new Plcstate().start(); |
| | | // new PlcPositioning1().start(); |
| | | // |
| | | // new PlcParameter2().start(); |
| | | // |
| | | // new PLCAutomaticParameterSetting().start(); |
| | | // new PlcManualonePosition().start(); |
| | | // new PlcManualonePosition2().start(); |
| | | // new PlcServoManualone().start(); |
| | | // new PLCManualJog().start(); |
| | | new Plchome().start(); |
| | | |
| | | new Plcalarm().start(); |
| | | |
| | | new Plcsign().start(); |
| | | |
| | | new Plcstate().start(); |
| | | new PlcPositioning1().start(); |
| | | |
| | | new PlcParameter2().start(); |
| | | |
| | | new PLCAutomaticParameterSetting().start(); |
| | | |
| | | new PlcManualonePosition().start(); |
| | | new PlcManualonePosition2().start(); |
| | | new PlcServoManualone().start(); |
| | | new PLCManualJog().start(); |
| | | new Plclog().start(); |
| | | } |
| | | } |
| | |
| | | @Select("select COUNT(if(a.state1=0,cell,0))as cell,ROUND(id/2)as id from (select *,max(state)as state1 from storage_cage a GROUP BY cage,cell)as a where (a.cage=#{cage1}-1 or a.cage=#{cage1}+1)and if(a.cage<6,a.cage>0 and a.cage<6,a.cage>5) and disabled=0 GROUP BY cage ORDER BY cell desc LIMIT 1") |
| | | int selectCage(int cage1); |
| | | // 获取订单号排序的空订单笼子 |
| | | @Select("select a.cage,FrameBarcode,COUNT(if(a.order_id=#{orderids},a.order_id,null))as orderid,b.shu,c.shu2,a.cell,min(a.state)as state1,disabled,FrameBarcode from storage_cage a left join (select COUNT(*)shu,cage from storage_cage where order_id=#{orderids} GROUP BY cage)as b on a.cage=b.cage left join(select cage ,COUNT(glass_id)as shu2 from storage_cage GROUP BY cage)c on a.cage=c.cage where (order_id=#{orderids} or ''='') GROUP BY cage,cell HAVING state1=0 ORDER BY FrameBarcode=#{Fbarcode} desc,shu desc,shu2,cage asc; ") |
| | | @Select("select a.cage,FrameBarcode,COUNT(if(a.order_id=#{orderids},a.order_id,null))as orderid,b.shu,c.shu2,a.cell,min(a.state)as state1,disabled,FrameBarcode from storage_cage a left join (select COUNT(*)shu,cage from storage_cage where order_id=#{orderids} GROUP BY cage)as b on a.cage=b.cage left join(select cage ,COUNT(glass_id)as shu2 from storage_cage GROUP BY cage)c on a.cage=c.cage where (order_id=#{orderids} or ''='') GROUP BY cage,cell HAVING state1=0 ORDER BY (FrameBarcode=#{Fbarcode} or ''='') desc,shu desc,shu2,cage asc; ") |
| | | List<StorageCage> selectAll(String orderids,String Fbarcode); |
| | | |
| | | // 获取判断该格子是否需要把外片推入内片位置 |
| | |
| | | void UpdataAddCage(String orderid, String glassid, double width, int cage, int cell, int id, int state); |
| | | |
| | | @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{glass.ordernumber},glasswidth=#{glass.glasslengthmm},glassheight=#{glass.glassheightmm},glasswidthmm=#{glass.glasslength},glassheightmm=#{glass.glassheight},listid=#{glass.listnumber},boxid=#{glass.boxnumber},FrameBarcode=#{glass.FrameBarcode} where id=#{id};") |
| | | void UpdataAddCage2(String orderid, String glassid, north_glass_buffer1 glass, int cage, int cell, int id, |
| | | int state); |
| | | void UpdataAddCage2(String orderid, String glassid, north_glass_buffer1 glass, int cage, int cell, int id,int state); |
| | | |
| | | // 修改笼子信息(多片进片) |
| | | @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where cage=#{cage} and cell=#{cell} and tier=#{tier};") |
| | |
| | | void UpdataOutCage1(double width, int cage, int cell); |
| | | |
| | | // 调拨更换笼子信息 |
| | | @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=#{tier})as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=2,a.glasswidth=b.glasswidth,a.glassheight=b.glassheight,a.glasswidthmm=b.glasswidthmm,a.glassheightmm=b.glassheightmm,a.listid=b.listid,a.boxid=b.boxid where a.id=#{id1}") |
| | | @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=#{tier})as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1,a.glasswidth=b.glasswidth,a.glassheight=b.glassheight,a.glasswidthmm=b.glasswidthmm,a.glassheightmm=b.glassheightmm,a.listid=b.listid,a.boxid=b.boxid where a.id=#{id1}") |
| | | void UpdateDBCage(int id1, int cage, int cell, int tier); |
| | | |
| | | // @Insert("insert into user(name, date, address, user_no) values (#{name}, |
| | |
| | | spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度 |
| | | spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(), prctier);// 新增任务 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | System.out.println("出片任务|" + datas); |
| | | System.out.println("进片任务|" + datas); |
| | | |
| | | } else { |
| | | // 数据库修改笼子表新增一条玻璃 |
| | |
| | | spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度 |
| | | spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(), prctier);// 新增任务 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | System.out.println("出片任务|" + datas); |
| | | System.out.println("进片任务|" + datas); |
| | | |
| | | // S7control.getinstance().WriteByte("DB105.16",glassid); |
| | | } |