| | |
| | | import VueI18n from 'vue-i18n' |
| | | import zhCN from './lang/locales/zh-CN.json' // 中文语言包 |
| | | import enUS from './lang/locales/en-US.json' // 英文语言包 |
| | | import websocketPlugin from './api/websocketPlugin'; // 引入插件文件 |
| | | //import websocketPlugin from './api/websocketPlugin'; // 引入插件文件 |
| | | // import store from './store' |
| | | |
| | | // import store from './store' |
| | | Vue.use(VueI18n) |
| | | Vue.use(websocketPlugin, { |
| | | ip: 'localhost', // 替换成你的 WebSocket 服务器 IP 地址 |
| | | }); |
| | | // Vue.use(websocketPlugin, { |
| | | // ip: 'localhost', // 替换成你的 WebSocket 服务器 IP 地址 |
| | | // }); |
| | | |
| | | const i18n = new VueI18n({ |
| | | locale: 'en-US', |
| | |
| | | .hide {
|
| | | display: none;
|
| | | }
|
| | |
|
| | | .el-table .cell {
|
| | | display: flex;
|
| | | }
|
| | | /* .el-table td,
|
| | | .el-table th {
|
| | | padding: 0px 0;
|
| | |
| | | <el-table :data="this.OutSlice" :height="700" :span-method="objectSpanMethod" border :cell-style="cellStyle"
|
| | | style="width: 100%;overflow: auto;font-size: 18px;">
|
| | | <el-table-column :min-width="175" prop="glassId" :label="$t('Barcode')"></el-table-column>
|
| | | <el-table-column :min-width="90" prop="storageCage.orderId" :label="$t('Order No')"></el-table-column>
|
| | | <el-table-column :min-width="70" prop="storageCage.listId" :label="$t('List No')"></el-table-column>
|
| | | <el-table-column :min-width="70" prop="storageCage.boxId" :label="$t('Box No')"></el-table-column>
|
| | | <el-table-column :min-width="100" prop="storageCage.glasswidthmm" :label="$t('Length')"></el-table-column>
|
| | | <el-table-column :min-width="100" prop="storageCage.glassheightmm" :label="$t('Width')"></el-table-column>
|
| | | <el-table-column :min-width="90" prop="orderId" :label="$t('Order No')"></el-table-column>
|
| | | <el-table-column :min-width="70" prop="listId" :label="$t('List No')"></el-table-column>
|
| | | <el-table-column :min-width="70" prop="boxId" :label="$t('Box No')"></el-table-column>
|
| | | <el-table-column :min-width="100" prop="glasswidthmm" :label="$t('Length')"></el-table-column>
|
| | | <el-table-column :min-width="100" prop="glassheightmm" :label="$t('Width')"></el-table-column>
|
| | | <el-table-column :min-width="90" prop="state" :label="$t('Glass State')">
|
| | | <template slot-scope='scope'>
|
| | | {{ scope.row.state == 0 ? $t('Waiting') : scope.row.state == 1 ? $t('Outing') : scope.row.state == 2
|
| | |
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column prop="sequence" :label="$t('Sequence')"></el-table-column>
|
| | | <el-table-column :min-width="90" prop="barcode" :label="$t('Complete')">Complete
|
| | | <template slot-scope='scope' style="height:100px;height:100px;">
|
| | | <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
|
| | | :disabled="(!isAllowQueue || scope.row.state != 1)"
|
| | | @click="CompleteQueue(scope.row.id, scope.row.barcode, scope.row.glassId)">{{ $t('Complete')
|
| | | }}</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column :min-width="300" prop="position" :label="$t('Position')" style="font-size: 20px;">
|
| | | <template slot-scope='scope'>
|
| | | <!-- {{ scope.row.position == 1 ? "<>▄▄▄" : "▋" }} -->
|
| | |
| | | </el-table-column>
|
| | | <el-table-column prop="position" :label="$t('Flipped')" :min-width="200">
|
| | | <template slot-scope='scope'>
|
| | | {{ scope.row.flip == true ? $t('EXTERIQR OUT AND BYPASS TO THE LEFT') : $t('EXTERIQR OUT AND BYPASS TO THE RIGHT') }}
|
| | | {{ scope.row.flip == true ? $t('EXTERIQR OUT AND BYPASS TO THE LEFT') : $t('EXTERIQR OUT AND BYPASS
|
| | | TO THE RIGHT') }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column prop="barcode" :label="$t('Frame No')"></el-table-column>
|
| | |
|
| | | <el-table-column prop="barcode" :label="$t('Complete')">
|
| | | <template slot-scope='scope'>
|
| | | <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
|
| | | :disabled="(!isAllowQueue || scope.row.state != 1)"
|
| | | @click="CompleteQueue(scope.row.id, scope.row.barcode, scope.row.glassId)">{{ $t('Complete')
|
| | | }}</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | |
| | | <el-table-column :width="280" :label="$t('Operate')">
|
| | | <template slot-scope='scope'>
|
| | | <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)"
|
| | |
| | | this.dialogFormVisible2 = false;
|
| | | }
|
| | | //是否急停
|
| | | if (obj.emergencystop != null) {
|
| | | this.EmergencyStop = obj.emergencystop[0];
|
| | | }
|
| | |
|
| | | //复位倒计时
|
| | | if(obj.countdown!=null){
|
| | | if ((obj.countdown[0] == true && this.CountDowns == 0) || this.EmergencyStop == true) {
|
| | | this.CountDown();
|
| | | }
|
| | | }
|
| | | |
| | | //复位完成信号
|
| | | console.log(this.reset);
|
| | | if( obj.reset!=null){
|
| | | this.reset = obj.reset[0];
|
| | | }
|
| | | |
| | | //是否有进片请求
|
| | | if(obj.D01RequestState!=null){
|
| | | this.D01RequestState = obj.D01RequestState[0];
|
| | | }
|
| | | |
| | |
|
| | | //是否允许出片
|
| | | this.isAllowQueue = obj.isAllowQueue[0];
|
| | |
| | | rowIndex = column;
|
| | | let style = "";
|
| | | if (columnIndex === 8) {
|
| | | style = "font-size:200px;text-align: center;height:200px;";
|
| | | style = "font-size:200px;text-align: center;";
|
| | | }
|
| | | // if (columnIndex === 9 && row.flip == 1) {
|
| | | // style = "background-Color:yellow;";
|
| | |
| | | if (rowIndex != 0) {
|
| | | barcode2 = arrOutSlice[rowIndex - 1].barcode;
|
| | | }
|
| | | if (columnIndex === 12||columnIndex === 8) {
|
| | | if (columnIndex === 12 || columnIndex === 9|| columnIndex === 10|| columnIndex === 11) {
|
| | | if (barcode != barcode2) {
|
| | | // this.FrameNoFlag = barcode;
|
| | | for (let i = rowIndex; i < this.OutSlice.length; i++) {
|
| | |
| | | // 是否需要人工确认上片玻璃
|
| | | jsonObject.append("isConfirm", isConfirm);
|
| | |
|
| | | // 读去Plc进片车与出片车位置W
|
| | | List<String> addressList = new ArrayList<String>();
|
| | | addressList.add("DB106.12");
|
| | | addressList.add("DB106.0");
|
| | | List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
|
| | | if (paramlist != null) {
|
| | | jsonObject.append("params", paramlist);
|
| | | }
|
| | | // 获取进片车状态
|
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
|
| | | 1);// 获取进片车状态
|
| | | boolean exist1 = datas1ListState.contains((short) 0);
|
| | | jsonObject.append("zhuangtai", exist1);
|
| | | // 获取进片玻璃信息
|
| | | List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
|
| | | if (inglassInfo != null) {
|
| | | if (inglassInfo.size() > 0)
|
| | | jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
|
| | | }
|
| | | // // 读去Plc进片车与出片车位置W
|
| | | // List<String> addressList = new ArrayList<String>();
|
| | | // addressList.add("DB106.12");
|
| | | // addressList.add("DB106.0");
|
| | | // List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
|
| | | // if (paramlist != null) {
|
| | | // jsonObject.append("params", paramlist);
|
| | | // }
|
| | | // // 获取进片车状态
|
| | | // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
|
| | | // 1);// 获取进片车状态
|
| | | // boolean exist1 = datas1ListState.contains((short) 0);
|
| | | // jsonObject.append("zhuangtai", exist1);
|
| | | // // 获取进片玻璃信息
|
| | | // List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
|
| | | // if (inglassInfo != null) {
|
| | | // if (inglassInfo.size() > 0)
|
| | | // jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
|
| | | // }
|
| | |
|
| | |
|
| | | // 获取铝框idDB106.DBW64
|
| | | String frameno=spianService.queGlassid("DB103.270",14).toString();
|
| | | if(frameno!=Plchome.FrameNo&&frameno!=""){
|
| | | Plchome.FrameNo=frameno;
|
| | | }
|
| | | try {
|
| | | north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo);
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | // // 获取铝框idDB106.DBW64
|
| | | // String frameno=spianService.queGlassid("DB103.270",14).toString();
|
| | | // if(frameno!=Plchome.FrameNo&&frameno!=""){
|
| | | // Plchome.FrameNo=frameno;
|
| | | // }
|
| | | // try {
|
| | | // north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo);
|
| | | // } catch (SQLException e) {
|
| | | // // TODO Auto-generated catch block
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | |
|
| | | // 获取进片请求状态
|
| | | List<Short> D01Request = S7control.getinstance().ReadWord("DB106.24", 1);
|
| | | boolean D01RequestState = D01Request.contains((short) 1);
|
| | | // boolean D01RequestState =true;
|
| | | jsonObject.append("D01RequestState", D01RequestState);
|
| | | // // 获取进片请求状态
|
| | | // List<Short> D01Request = S7control.getinstance().ReadWord("DB106.24", 1);
|
| | | // boolean D01RequestState = D01Request.contains((short) 1);
|
| | | // // boolean D01RequestState =true;
|
| | | // jsonObject.append("D01RequestState", D01RequestState);
|
| | |
|
| | | // 复位倒计时
|
| | | // 地址104.9.6
|
| | | List<Boolean> countdown = S7control.getinstance().ReadBits("DB104.9.6", 1);
|
| | | for (Boolean countdowns : countdown) {
|
| | | jsonObject.append("countdown", countdowns);
|
| | | }
|
| | | // jsonObject.append("countdown", true);
|
| | | // 复位完成信号
|
| | | List<Boolean> resets = S7control.getinstance().ReadBits("DB103.284", 1);
|
| | | for (Boolean reset : resets) {
|
| | | jsonObject.append("reset", reset);
|
| | | }
|
| | | // // 复位倒计时
|
| | | // // 地址104.9.6
|
| | | // List<Boolean> countdown = S7control.getinstance().ReadBits("DB104.9.6", 1);
|
| | | // for (Boolean countdowns : countdown) {
|
| | | // jsonObject.append("countdown", countdowns);
|
| | | // }
|
| | | // // jsonObject.append("countdown", true);
|
| | | // // 复位完成信号
|
| | | // List<Boolean> resets = S7control.getinstance().ReadBits("DB103.284", 1);
|
| | | // for (Boolean reset : resets) {
|
| | | // jsonObject.append("reset", reset);
|
| | | // }
|
| | |
|
| | | // 是否急停
|
| | | List<Boolean> emergencystops = S7control.getinstance().ReadBits("DB104.5.1", 1);
|
| | | for (Boolean emergencystop : emergencystops) {
|
| | | jsonObject.append("emergencystop", emergencystop);
|
| | | }
|
| | | // // 是否急停
|
| | | // List<Boolean> emergencystops = S7control.getinstance().ReadBits("DB104.5.1", 1);
|
| | | // for (Boolean emergencystop : emergencystops) {
|
| | | // jsonObject.append("emergencystop", emergencystop);
|
| | | // }
|
| | |
|
| | | // 铝框线交互
|
| | |
|
| | |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | new PlcHold().start(); |
| | | // new PlcHold().start(); |
| | | |
| | | new Plchome().start(); |
| | | |
| | | new Plcalarm().start(); |
| | | // new Plcalarm().start(); |
| | | |
| | | new Plcsign().start(); |
| | | // new Plcsign().start(); |
| | | |
| | | |
| | | new Plcstate().start(); |
| | | new PlcPositioning1().start(); |
| | | // new Plcstate().start(); |
| | | // new PlcPositioning1().start(); |
| | | |
| | | new PlcParameter2().start(); |
| | | // new PlcParameter2().start(); |
| | | |
| | | new PLCAutomaticParameterSetting().start(); |
| | | // new PLCAutomaticParameterSetting().start(); |
| | | |
| | | new PlcManualonePosition().start(); |
| | | new PlcManualonePosition2().start(); |
| | | new PlcServoManualone().start(); |
| | | new PLCManualJog().start(); |
| | | // new PlcManualonePosition().start(); |
| | | // new PlcManualonePosition2().start(); |
| | | // new PlcServoManualone().start(); |
| | | // new PLCManualJog().start(); |
| | | } |
| | | } |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | homeMapper.UpdateTask(types, glassid); |
| | | if (types == 0) { |
| | | homeMapper.UpdateCageTask1(glassid); |
| | | // homeMapper.UpdateCageTask1(glassid); |
| | | spianService.overtask(glassid); |
| | | } else if(types==1) { |
| | | // homeMapper.DeleteByGlassID(glassid); |
| | | spianService.overtask(glassid); |
| | | } else if (types == 2) {//终止进片任务 |
| | | spianService.overtask(glassid); |
| | | StorageCage glassinfor = homeMapper.SelectGlassInfo(glassid); |
| | | spianMapper.UpdataOutCage1(glassinfor.getGlassWidth(), glassinfor.getCage(), glassinfor.getCell()); |
| | | homeMapper.DeleteByGlassID(glassid); |
| | | }else{ |
| | | StorageCage glass = homeMapper.SelectGlassInfo(glassid); |
| | | spianMapper.UpdataOutCage1(glass.getGlassWidth(), glass.getCage(), glass.getCell()); |
| | | homeMapper.DeleteByGlassID(glassid); |
| | | //发送终止任务信号 |
| | | // S7control.getinstance().WriteWord("DB105.18", (short) 0); |
| | | // 发送终止进片任务信号 |
| | | }else{//终止出片任务 |
| | | spianService.overtask(glassid); |
| | | homeMapper.UpdateOutSliceGlass(glassid); |
| | | } |
| | | map.put("message3", "200"); |
| | | return Result.success(map); |
| | |
| | | int sequence = homeMapper.SelectMaxSquence(); |
| | | homeMapper.AddOutSliceS(glassid, flip, north_glass_buffer1.getFrameBarcode(), |
| | | north_glass_buffer1.getglasslengthmm().toString(), north_glass_buffer1.getglassheightmm().toString(), |
| | | sequence, position, (short)0); |
| | | sequence, position, (short) 0, north_glass_buffer1.getordernumber(), north_glass_buffer1.getlistnumber(), |
| | | north_glass_buffer1.getboxnumber(), north_glass_buffer1.getglasslength().toString(), |
| | | north_glass_buffer1.getglassheight().toString()); |
| | | |
| | | map.put("message2", "200"); |
| | | } else { |
| | | map.put("message2", "300"); |
| | |
| | | private String time;//修改时间 |
| | | private int sequence;//出片顺序 |
| | | private String position;//玻璃摆放位置 |
| | | private String orderId;//玻璃id |
| | | private String listId;//集合id |
| | | private String boxId;//箱子id |
| | | private double glasswidthmm;//玻璃宽mm |
| | | private double glassheightmm;//玻璃高mm |
| | | |
| | | public String getPosition() { |
| | | return position; |
| | |
| | | public void setSequence(int sequence) { |
| | | this.sequence = sequence; |
| | | } |
| | | |
| | | public String getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public Double getGlassWidthMm() { |
| | | return glasswidthmm; |
| | | } |
| | | |
| | | public void setGlassWidthMm(Double glasswidthmm) { |
| | | this.glasswidthmm = glasswidthmm; |
| | | } |
| | | |
| | | public Double getGlassHeightMm() { |
| | | return glassheightmm; |
| | | } |
| | | |
| | | public void setGlassHeightMm(Double glassheightmm) { |
| | | this.glassheightmm = glassheightmm; |
| | | } |
| | | public String getListId() { |
| | | return listId; |
| | | } |
| | | |
| | | public void setListno(String listId) { |
| | | this.listId = listId; |
| | | } |
| | | |
| | | public String getBoxId() { |
| | | return boxId; |
| | | } |
| | | |
| | | public void setBoxno(String boxId) { |
| | | this.boxId = boxId; |
| | | } |
| | | } |
| | |
| | | Out_slice SelectQueueByglassid(String getbarcode); |
| | | |
| | | //添加出片队列 |
| | | @Insert("INSERT INTO out_slice( `glassId`, `barcode`, `glasswidth`, `glassheight`, `state`, `flip`, `sequence`, `time` ,`position`) VALUES ( #{glassid}, #{FrameNo}, #{glasslengthMm}, #{glassheightMm}, #{state}, #{flip}, #{sequence}, now(), #{position});") |
| | | void AddOutSliceS(String glassid, String flip, String FrameNo, String glasslengthMm, String glassheightMm, int sequence, String position, Short state); |
| | | @Insert("INSERT INTO out_slice( `glassId`, `barcode`, `glasswidth`, `glassheight`, `state`, `flip`, `sequence`, `time` ,`position` ,`orderid` ,`listid` ,`boxid` ,`glasswidthmm` ,`glassheightmm`) VALUES ( #{glassid}, #{FrameNo}, #{glasslengthMm}, #{glassheightMm}, #{state}, #{flip}, #{sequence}, now(), #{position}, #{orderid}, #{listid}, #{boxid}, #{glasswidth}, #{glassheight});") |
| | | void AddOutSliceS(String glassid, String flip, String FrameNo, String glasslengthMm, String glassheightMm, int sequence, String position, Short state,String orderid, String listid, String boxid, String glasswidth, String glassheight); |
| | | |
| | | //出片队列调序 |
| | | @Update("update out_slice set sequence=#{sequence} where glassid=#{glassId}") |
| | |
| | | @Select("Select width from storage_cage where cage=#{cage} and cell=#{cell} limit 1") |
| | | Double SelectCageWidth(short cage, short cell); |
| | | |
| | | @Select("update out_slice set state=3 where glassId=#{glassid}") |
| | | void UpdateOutSliceGlass(String glassid); |
| | | |
| | | } |
| | |
| | | } |
| | | homeMapper.AddOutSliceS(north_glass_buffer1.getbarcode(), flip, FrameBarcode, |
| | | north_glass_buffer1.getglasslengthmm().toString(), |
| | | north_glass_buffer1.getglassheightmm().toString(), sequence, position, state); |
| | | north_glass_buffer1.getglassheightmm().toString(), sequence, position, state, |
| | | north_glass_buffer1.getordernumber(), north_glass_buffer1.getlistnumber(), |
| | | north_glass_buffer1.getboxnumber(), north_glass_buffer1.getglasslength().toString(), |
| | | north_glass_buffer1.getglassheight().toString()); |
| | | sequence += 1; |
| | | } |
| | | } |
| | |
| | | private JdbcConnections jdbcConnections; |
| | | |
| | | public void AddOutSliceS(String[][] AluminumFrames) throws SQLException { |
| | | int sequence = homeMapper.SelectMaxSquence(); |
| | | // int sequence = homeMapper.SelectMaxSquence(); |
| | | |
| | | // 添加到数据库 |
| | | for (String[] item : AluminumFrames) { |
| | | if (item[1] == "true") { |
| | | Short state=0; |
| | | String position = jdbcConnections.SelectPositionByFrameBarcode(item[3]); |
| | | homeMapper.AddOutSliceS(item[0], item[2], item[3], item[4], item[5], sequence, position,state ); |
| | | sequence += 1; |
| | | } |
| | | } |
| | | // for (String[] item : AluminumFrames) { |
| | | // if (item[1] == "true") { |
| | | // Short state=0; |
| | | // String position = jdbcConnections.SelectPositionByFrameBarcode(item[3]); |
| | | // homeMapper.AddOutSliceS(item[0], item[2], item[3], item[4], item[5], sequence, position,state ); |
| | | // sequence += 1; |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | // 查询出片队列 |
| | | public List<Out_slice> SelectProductionqueue() { |
| | | List<Out_slice> listoutslice = homeMapper.SelectProductionqueue(); |
| | | for (Out_slice out_slice : listoutslice) { |
| | | out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId())); |
| | | } |
| | | // for (Out_slice out_slice : listoutslice) { |
| | | // out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId())); |
| | | // } |
| | | return listoutslice; |
| | | } |
| | | |
| | | //完成出片任务 |
| | | public Result CompleteQueue(String id, String frameid, String glassid) { |
| | | homeMapper.CompleteQueue(id); |
| | | Short num = homeMapper.SelectCountByFrameNo(frameid); |