| | |
| | | <el-table-column prop="timeons" :label="$t('timeon')"></el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <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-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> |
| | | |
| | |
| | | dialogFormVisible2: false, |
| | | dialogFormVisible3: false, |
| | | alarm: [], |
| | | alarm2: [] |
| | | alarm2: [], |
| | | CountDowns: "0", |
| | | EmergencyStop: false, |
| | | PromptSize: 250, |
| | | dialogFormCountDown:false |
| | | |
| | | } |
| | | }, |
| | | // components: { |
| | |
| | | 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]; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | 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;
|
| | |
|
| | |
|
| | | public Plchome() throws IOException {
|
| | | config = new Configuration("config.properties");
|
| | |
| | | // 获取进片车状态
|
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
|
| | | 1);// 获取进片车状态
|
| | | 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) {
|
| | |
| | | anniuparams[i] = value ? (short) 1 : (short) 0;
|
| | | }
|
| | |
|
| | |
|
| | | short[] resets2 = new short[resets.size()];
|
| | | for (int i = 0; i < resets.size(); i++) {
|
| | | boolean value = resets.get(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);
|
| | | 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 类型,则忽略该部分
|
| | |
| | |
|
| | | // 调用 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); |
| | | } |