| | |
| | | })
|
| | | }
|
| | |
|
| | | export function SwitchScanMethod(scansmethod) {s
|
| | | export function SwitchScanMethod(scansmethod) {
|
| | | return request({
|
| | | url: '/home/SwitchScanMethod?Scanmethod='+scanmethod,
|
| | | url: '/home/SwitchScanMethod?scansmethod='+scansmethod,
|
| | | method: 'post',
|
| | | data:""
|
| | | })
|
| | |
| | | "max":9999
|
| | | },
|
| | | {
|
| | | "name": "B01小车当前任务位",
|
| | | "name": "B01小车当前任务位置",
|
| | | "read": 22,
|
| | | "sending": 0,
|
| | | "unit": "mm",
|
| | |
| | | }, "type": "1"
|
| | | },
|
| | | {
|
| | | "name": "B02小车当前位置",
|
| | | "name": "B02小车当前任务位置",
|
| | | "read": 22,
|
| | | "sending": 0,
|
| | | "unit": "mm",
|
| | |
| | | {
|
| | | |
| | | "ip": "localhost",
|
| | | "Clear":"Clear",
|
| | | "ip":"localhost",
|
| | | "systemTitle": "Login System",
|
| | | "usernamePlaceholder": "Please enter username",
|
| | | "passwordPlaceholder": "Please enter password",
|
| | |
| | | {
|
| | | "ip": "localhost",
|
| | | "Clear":"清除",
|
| | | "ip":"localhost",
|
| | | "systemTitle": "登录系统",
|
| | | "usernamePlaceholder": "请输入用户名",
|
| | | "passwordPlaceholder": "请输入密码",
|
| | |
| | | const specialChars = /[^\w\s]/g; |
| | | if(obj.zuhe1){ |
| | | |
| | | //console.log(obj); |
| | | console.log(obj); |
| | | |
| | | for (let i = 0; i < jsondata2.length; i++) { |
| | | const item = jsondata2[i]; |
| | |
| | | }, |
| | | |
| | | updateButtonValue(dataGroup, itemIndex) { |
| | | console.log(dataGroup) |
| | | console.log(itemIndex) |
| | | |
| | | if (dataGroup[itemIndex].button.value2 === 1) { |
| | | // 如果当前按钮的值是 0,将其设为 1 |
| | | this.$set(dataGroup[itemIndex].button, "value2", 0); |
| | |
| | | <div style="display:flex;justify-content: space-around;width: 9zz5%;margin: 0 auto;">
|
| | | <!-- <el-input style="width:15%;" :placeholder="$t('Enter the glass barcode')" v-model="glassid1"
|
| | | :class="ManuallyInfeedGlass == true ? 'hide' : ''"></el-input> -->
|
| | | <el-button type="primary" @click="SelectGlassByGlassIDs(2)" :disabled="ManuallyInfeedGlass"
|
| | | <el-button type="primary" @click="SelectGlassByGlassIDs()" :disabled="ManuallyInfeedGlass"
|
| | | :class="ManuallyInfeedGlass == true ? 'hide' : ''">
|
| | | {{ $t('Manually Infeed Glass') }}</el-button>
|
| | | <el-button type="primary" @click="showform2()" :disabled="OrderInfo"
|
| | |
| | | <div class="device" :style="'top: 262px;left: 150px;background-color: ' + ShowDeviceList(8) + ';'">D05</div>
|
| | | <div class="device" :style="'top: 339px;left: 150px;background-color: ' + ShowDeviceList(9) + ';'">D06</div>
|
| | |
|
| | | <div class="glass D01" style="top: 54px;left: 1055px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.9.2', 0)">{{ ShowGlassIdList(0) }}</div>
|
| | | <div class="glass D02" style="top: 132px;left: 1055px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.9.2', 1)">{{ ShowGlassIdList(1) }}</div>
|
| | | <div class="glass B01" style="top: 270px;left: 640px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.10.2', 2)">
|
| | | B01:{{ ShowGlassIdList(2) }}</div>
|
| | | <div class="glass B02" style="top: 290px;left: 640px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.10.3', 3)">B02:{{ ShowGlassIdList(3) }}</div>
|
| | | <div class="glass A01" style="top: 270px;left: 289px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.10.0', 4)">
|
| | | A01.1:{{ ShowGlassIdList(4) }}</div>
|
| | | <div class="glass D01" style="top: 39px;left: 1055px;position: absolute;">{{ ShowGlassIdList(0) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 0)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | | <div class="glass D02" style="top: 117px;left: 1055px;position: absolute;">{{ ShowGlassIdList(1) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 1)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | | <div class="glass B01" style="top: 270px;left: 640px;position: absolute;">
|
| | | B01:{{ ShowGlassIdList(2) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2', 2)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | | <div class="glass B02" style="top: 315px;left: 640px;position: absolute;">B02:{{ ShowGlassIdList(3) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.3', 3)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | | <div class="glass A01" style="top: 270px;left: 289px;position: absolute;">
|
| | | A01.1:{{ ShowGlassIdList(4) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.0', 4)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | |
|
| | | <div class="glass A01" style="top: 290px;left: 289px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.10.1,5')">A01.2:{{ ShowGlassIdList(5) }}</div>
|
| | | <div class="glass A01" style="top: 315px;left: 289px;position: absolute;">A01.2:{{ ShowGlassIdList(5) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1,5', 5)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | |
|
| | | <div class="glass A02" style="top: 310px;left: 289px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.10.2,6')">A02:{{ ShowGlassIdList(6) }}</div>
|
| | | <div class="glass A02" style="top: 360px;left: 289px;position: absolute;">A02:{{ ShowGlassIdList(6) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2,6', 6)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | |
|
| | | <div class="glass D03" style="top: 137px;left: 42px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.9.4', 7)">
|
| | | {{ ShowGlassIdList(7) }}</div>
|
| | | <div class="glass D04" style="top: 213px;left: 42px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.9.5', 8)">
|
| | | {{ ShowGlassIdList(8) }}</div>
|
| | | <div class="glass D05" style="top: 290px;left: 42px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.9.6', 9)">
|
| | | {{ ShowGlassIdList(9) }}</div>
|
| | | <div class="glass D06" style="top: 367px;left: 42px;position: absolute;"
|
| | | @click="ClearGlassId('DB101.9.5', 10)">
|
| | | {{ ShowGlassIdList(10) }}</div>
|
| | | <div class="glass D03" style="top: 122px;left: 42px;position: absolute;">
|
| | | {{ ShowGlassIdList(7) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.4', 7)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | | <div class="glass D04" style="top: 198px;left: 42px;position: absolute;">
|
| | | {{ ShowGlassIdList(8) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.5', 8)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | | <div class="glass D05" style="top: 275px;left: 42px;position: absolute;">
|
| | | {{ ShowGlassIdList(9) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.6', 9)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | | <div class="glass D06" style="top: 352px;left: 42px;position: absolute;">
|
| | | {{ ShowGlassIdList(10) }}
|
| | | <br />
|
| | | <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.5', 10)">
|
| | | {{ $t('Clear') }}</el-button>
|
| | | </div>
|
| | |
|
| | |
|
| | | </div>
|
| | |
| | | }}</el-button>
|
| | | </el-form-item> -->
|
| | | <el-form-item>
|
| | | {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Not Allow') : $t('Allow') }}
|
| | | {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}
|
| | | <el-button type="primary" @click="isConfirmState()">
|
| | | {{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}</el-button>
|
| | | {{ this.isConfirm == true ? $t('Not Allow') : $t('Allow') }}</el-button>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | {{ $t('Current State') }}:{{ this.Scanningmethod==true?$t('Automatic'):$t('Hand Movement')}}
|
| | | {{ $t('Current State') }}:{{ this.Scanningmethod == false ? $t('Automatic') : $t('Hand Movement') }}
|
| | | <el-button type="primary" @click="SwitchScanMethod()">{{ $t('Switch')
|
| | | }}</el-button>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-input style="width:70%;" maxlength="14" :placeholder="$t('Enter the glass barcode')"
|
| | | <el-input style="width:70%;" maxlength="13" :placeholder="$t('Enter the glass barcode')"
|
| | | v-model="glassid1"></el-input>
|
| | | <el-button type="primary" :disabled="Scanningmethod" @click="WriteGlassID()">{{ $t('Add')
|
| | | <el-button type="primary" :disabled="!Scanningmethod" @click="WriteGlassID()">{{ $t('Add')
|
| | | }}</el-button>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | {{ $t('Barcode') }}:
|
| | | <el-input style="width:70%;" maxlength="14" :disabled="true" v-model="glassid1"></el-input>
|
| | | <el-input style="width:70%;" maxlength="14" :disabled="true" v-model="CurrrentGlassId"></el-input>
|
| | | </el-form-item>
|
| | | </div>
|
| | | <div style="display: flex;justify-content: space-around;">
|
| | | <label for="">{{ $t('Upper film position') }}</label>
|
| | | |
| | |
|
| | | <label for="">{{ $t('Scan Code Point') }}</label>
|
| | | </div>
|
| | | <div style="display: flex;justify-content: space-around;height: 40px;">
|
| | |
| | | {{ $t('Confirm') }}</el-button>
|
| | | </div>
|
| | | </el-form>
|
| | | <template #footer>
|
| | | <!-- <template #footer>
|
| | | <span class="dialog-footer">
|
| | | <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
|
| | | </span>
|
| | | </template>
|
| | | </template> -->
|
| | | </el-dialog>
|
| | |
|
| | | <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Outing Queue')" top="5vh">
|
| | |
| | | CurrentFrame: [],
|
| | | DeviceList: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
| | | GlassIdList: [],
|
| | | Scanningmethod: true
|
| | | Scanningmethod: true,
|
| | | CurrrentGlassId: ""
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.load();
|
| | |
|
| | | this.init();
|
| | | }
|
| | | ,
|
| | |
| | | this.alarm = obj.alarmmg[0];
|
| | | //获取当前扫码方式
|
| | | if (obj.Scanningmethod != null) {
|
| | | if (obj.Scanningmethod == 0) {
|
| | | this.Scanningmethod = true;
|
| | | }
|
| | | else {
|
| | | this.Scanningmethod = false;
|
| | | }
|
| | | this.Scanningmethod = obj.Scanningmethod[0];
|
| | | }
|
| | |
|
| | | //获取当前扫码枪玻璃id
|
| | | if (obj.CurrrentGlassId != null) {
|
| | | const specialChars = /[^\w\s]/g;
|
| | | this.CurrrentGlassId = obj.CurrrentGlassId[0].replace(specialChars, "");
|
| | | }
|
| | |
|
| | | //查询当前铝框信息
|
| | |
| | | } else {
|
| | | this.form3 = {};
|
| | | }
|
| | |
|
| | | if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) {
|
| | | this.loadglassheight1 = 70;
|
| | | if (this.form5.glassId != obj.form3[0].glassId) {
|
| | | this.showform3();
|
| | | }
|
| | | this.form5 = obj.form3[0];
|
| | | this.showform3();
|
| | | this.glassid1 = "";
|
| | | if (this.D01RequestState == true) {
|
| | | this.Sizerange(this.form5, 3);
|
| | |
| | | },
|
| | | //手动上片
|
| | | sbumitglassid() {
|
| | | console.log(1111111);
|
| | | if (this.form.order != "") {
|
| | | if (this.form.height < 380 || this.form.width < 390 || this.form.height > 1810 || this.form.width > 2760) {
|
| | | this.$message.error(this.$t('The glass size is not within the range'));
|
| | |
| | | },
|
| | | //手动写入plc扫码位玻璃id
|
| | | WriteGlassID() {
|
| | | if (this.glassid1.length ==14) {
|
| | | if (this.glassid1.length == 14) {
|
| | | WriteGlassID(this.glassid1).then(res => {
|
| | | console.log(res.data);
|
| | | this.$message.success(this.$t('Successful operation'));
|
| | | });
|
| | | }else{
|
| | | } else {
|
| | | this.$message.error(this.$t('Please enter the correct glassID'));
|
| | | }
|
| | | },
|
| | | //获取扫码位和上片位数据
|
| | | SelectGlassByGlassIDs(parameter) {
|
| | | SelectGlassByGlassIDs() {
|
| | | this.showform3();
|
| | | // if (parameter == 1) {
|
| | | // SelectGlassByGlassID(this.glassid2).then(res => {
|
| | |
| | | if (res.data.message == 200) {
|
| | | this.form5 = {};
|
| | | this.$message.success(this.$t('Operation successful'));
|
| | | }
|
| | | else if (res.data.message == 400) {
|
| | | this.$message.error(this.$t('The glass size is not within the range'));
|
| | | } else {
|
| | | this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
|
| | | }
|
| | |
| | | //清除玻璃id
|
| | | ClearGlassId(position, num) {
|
| | | if (this.ClearGlassID == false) {
|
| | | if (this.DeviceList[position] == 0) {
|
| | | if (this.GlassIdList[num].length == 14) {
|
| | | console.log(this.DeviceList, num);
|
| | | if (this.DeviceList[num] == 0) {
|
| | | if (this.GlassIdList[num].length <= 14) {
|
| | | this.$confirm(this.$t('Are you sure to clear this barcode ?'), this.$t('confirm'), {
|
| | | confirmButtonText: this.$t('Yes'),
|
| | | cancelButtonText: this.$t('No'),
|
| | |
| | | });
|
| | | },
|
| | | //切换二维码获取方式
|
| | | SwitchScanMethod(){
|
| | | var Scanmethod;
|
| | | if(this.Scanningmethod == true){
|
| | | this.Scanmethod = 1;
|
| | | }else{
|
| | | this.Scanmethod = 0;
|
| | | }
|
| | | SwitchScanMethod(Scanmethod).then(res => {
|
| | | SwitchScanMethod() {
|
| | | SwitchScanMethod(!this.Scanningmethod).then(res => {
|
| | | if (res.data.message == 200) {
|
| | | this.$message.success(this.$t('Operation successful'));
|
| | | }
|
| | |
| | | this.storageCageService = storageCageService; |
| | | this.plcParameterObject = new PlcParameterObject(); |
| | | this.plcBitObject = new PlcBitObject(); |
| | | String jsonFilePath = "JsonFile/PlcParameter.json"; |
| | | InitUtil.initword(jsonFilePath); // 初始化 PlcParameterObject |
| | | String jsonFilePath2 = "JsonFile/PlcSign.json"; |
| | | InitUtil.initbit(jsonFilePath2); // 初始化 PlcSign |
| | | // String jsonFilePath = "JsonFile/PlcParameter.json"; |
| | | // InitUtil.initword(jsonFilePath); // 初始化 PlcParameterObject |
| | | // String jsonFilePath2 = "JsonFile/PlcSign.json"; |
| | | // InitUtil.initbit(jsonFilePath2); // 初始化 PlcSign |
| | | |
| | | |
| | | } |
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.example.springboot.service.JdbcConnections; |
| | |
| | | while (this != null) { |
| | | try { |
| | | |
| | | Thread.sleep(50); |
| | | Thread.sleep(100); |
| | | } catch (InterruptedException e) { |
| | | // \\ TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // if (S7control.getinstance().CheckConnected() == false) { |
| | | spianService = WebSocketServer.applicationContext.getBean(SpianService.class); |
| | | spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); |
| | |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // } |
| | | |
| | | |
| | | // 出片任务//////////////////////////////// |
| | | List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态 |
| | | List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动 |
| | | |
| | | boolean Plcadd = spianService.listbool("DB106.62"); // 出片请求字 |
| | | |
| | | if(Plcadd==false){ |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为0 |
| | | } |
| | | |
| | | |
| | | |
| | | // StringBuilder writedstrIdOut = new StringBuilder(); |
| | | // 获取已下发的出片id |
| | | byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14); |
| | |
| | | if (outstate == true) {// 当出片车空闲时,且出片启动为1时,任务启动改为0 |
| | | if (outstate1 == true) { |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 0);// 出片任务启动改为0 |
| | | System.out.println("关闭启动" + LocalDateTime.now()); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.16", 1);// 获取进片车任务是否启动 |
| | | |
| | | boolean B01backs = spianService.listbool("DB106.60");// b01汇报 |
| | | boolean B02backs = spianService.listbool("DB106.62");// b02汇报 |
| | | |
| | | boolean B02backs = spianService.listbool("DB106.62");// b02汇报 |
| | | StringBuilder B01glassid = spianService.queGlassid("DB103.184", 14);// BO1的玻璃id |
| | | StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02的玻璃id |
| | | |
| | | // 当进片小车完成任务时 |
| | | if (B01backs == true) { |
| | | // 当B01小车汇报完成时更改玻璃状态 为1 |
| | | // spianService.overtask(B01glassid.toString());// 完成任务 |
| | | // S7control.getinstance().WriteWord("DB106.60", (short) 0);// 恢复B01小车应答改为0 |
| | | boolean yingda = spianService.listbool("DB106.60");// b01汇报 |
| | | System.out.println("汇报时B01|第" + aaa + "次" + B01glassid + "应答" + yingda); |
| | | aaa += 1; |
| | | // 判断是否汇报正确的id |
| | | int HB = spianMapper.SelectHB(B01glassid.toString()); |
| | | if (HB > 0) { |
| | | // 当B01小车汇报完成时更改玻璃状态 为1 |
| | | S7control.getinstance().WriteWord("DB106.60", (short) 0);// 恢复B01小车应答改为0 |
| | | boolean yingda = spianService.listbool("DB106.60");// b01汇报 |
| | | if (yingda == false) { |
| | | spianService.overtask(B01glassid.toString());// 完成任务 |
| | | } |
| | | System.out.println("汇报时B01|第" + aaa + "次" + B01glassid + "应答" + yingda); |
| | | aaa += 1; |
| | | } |
| | | |
| | | } |
| | | |
| | | // 当出片小车完成任务时 |
| | | if (B02backs == true) { |
| | | // 当B02小车汇报完成时更改玻璃状态为0 |
| | | // spianService.overtask(B02glassid.toString());// 完成任务 |
| | | // S7control.getinstance().WriteWord("DB106.62", (short) 0);// 恢复B02小车应答改为0 |
| | | // 判断是否汇报正确的id |
| | | int HB = spianMapper.SelectHB(B02glassid.toString()); |
| | | System.out.println("汇报时B02|" + B02glassid); |
| | | boolean yingda1 = spianService.listbool("DB106.62");// b02汇报 |
| | | System.out.println("汇报时B02|第" + aaa + "次" + B02glassid + "应答" + yingda1); |
| | | if (HB > 0) { |
| | | // 当B02小车汇报完成时更改玻璃状态为0 |
| | | |
| | | S7control.getinstance().WriteWord("DB106.62", (short) 0);// 恢复B02小车应答改为0 |
| | | System.out.println("汇报时B02|" + B02glassid); |
| | | boolean yingda = spianService.listbool("DB106.62");// b02汇报 |
| | | if (yingda == false) { |
| | | spianService.overtask(B02glassid.toString());// 完成任务 |
| | | } |
| | | System.out.println("汇报时B02|第" + aaa + "次" + B02glassid + "应答" + yingda); |
| | | } |
| | | } |
| | | |
| | | |
| | | boolean Plcout = spianService.listbool("DB106.62"); // 进片请求字 |
| | | if(Plcout==false){ |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 0);// 进片任务发送字改为0 |
| | | } |
| | | |
| | | |
| | | // 获取DO1数据 |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | if (queueid2 != null) { |
| | | // 写入D02的数据到上片队列表 |
| | | if (glass2 == null) { |
| | |
| | | |
| | | } |
| | | |
| | | // if (outstate == true) { // 出片车状态空闲时 |
| | | // Integer state = spianMapper.Selectoutstate(); |
| | | // String orderid = spianMapper.SelectOrderout(); |
| | | |
| | | // if (orderid != null && state == 0) { |
| | | // spianService.selectout(orderid); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // 查询数据库 |
| | | // 推送到前端 |
| | |
| | | List<String> addresses5 = Arrays.asList(config.getProperty("PlcInteractionState.MEStaskinformation").split(",")); |
| | | List<String> arraylist5 = S7control.getinstance().readStringsandword(addresses5); |
| | | |
| | | List<String> addresses6 = Arrays.asList(config.getProperty("PlcInteractionState.MEStaskinformation2").split(",")); |
| | | List<String> arraylist6 = S7control.getinstance().readStringsandword(addresses6); |
| | | |
| | | |
| | | // String[] values = { ".x11","x21 ","x21 ","x21 ","x21 ","x21"}; |
| | | // List<String> arraylist = new ArrayList<>(Arrays.asList(values)); |
| | |
| | | // List<String> arraylist3 = new ArrayList<>(Arrays.asList(values3)); |
| | | // String[] values4 = { ".x11 ","x21 ","x21 ","x21 "}; |
| | | // List<String> arraylist4 = new ArrayList<>(Arrays.asList(values4)); |
| | | // String[] values5 = { ".x11 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 "}; |
| | | // String[] values5 = { ".x11 ","x21 ","x21 ","b02","x21 ","x21 "}; |
| | | // List<String> arraylist5 = new ArrayList<>(Arrays.asList(values5)); |
| | | // |
| | | // String[] values6 = { "x21 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 "}; |
| | | // List<String> arraylist6 = new ArrayList<>(Arrays.asList(values6)); |
| | | |
| | | |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | |
| | | jsonArray.put(arraylist3); |
| | | jsonArray.put(arraylist4); |
| | | jsonArray.put(arraylist5); |
| | | jsonArray.put(arraylist6); |
| | | jsonObject.put("zuhe1", jsonArray); |
| | | |
| | | |
New file |
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | |
| | | import java.io.IOException; |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import com.example.springboot.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import com.example.springboot.entity.Out_slice; |
| | | import com.example.springboot.entity.Queue; |
| | | import com.example.springboot.entity.StorageCage; |
| | | import com.example.springboot.entity.alarmmg; |
| | | import com.example.springboot.entity.north_glass_buffer1; |
| | | import com.example.springboot.mapper.HomeMapper; |
| | | import com.example.springboot.mapper.SpianMapper; |
| | | |
| | | public class PlcLayout extends Thread { |
| | | |
| | | @Autowired |
| | | private HomeMapper homeMapper; |
| | | @Autowired |
| | | // 出片队列是否允许出片 |
| | | public static Boolean isAllowQueue = true; |
| | | public static Boolean isAllowReordering = true; |
| | | // 出片队列警告 |
| | | public static Boolean isQueueWarning = false; |
| | | // 铝框id |
| | | public static String FrameNo = ""; |
| | | // 是否需要手动确认玻璃 |
| | | public static Boolean isConfirm = false; |
| | | // 待确认的出片队列 |
| | | public static List<north_glass_buffer1> AluminumFrame; |
| | | |
| | | // private Configuration config; |
| | | |
| | | private StorageCageService storageCageService; |
| | | |
| | | // public Plchome() throws IOException { |
| | | // config = new Configuration("config.properties"); |
| | | // } |
| | | |
| | | // public static Map b=new HashMap<>(); |
| | | // b.put() |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(1000); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | // 注入mapper |
| | | |
| | | homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class); |
| | | |
| | | |
| | | if (S7control.getinstance().CheckConnected() == true) { |
| | | |
| | | |
| | | |
| | | // 查询报警信息 |
| | | List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo(); |
| | | jsonObject.append("alarmmg", alarmmg); |
| | | |
| | | // 复位倒计时 |
| | | // 地址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); |
| | | // 复位完成信号ss |
| | | List<Boolean> resetss = S7control.getinstance().ReadBits("DB103.284", 1); |
| | | for (Boolean reset : resetss) { |
| | | jsonObject.append("reset", reset); |
| | | } |
| | | |
| | | // 是否急停 |
| | | List<Boolean> emergencystops = S7control.getinstance().ReadBits("DB104.5.1", 1); |
| | | for (Boolean emergencystop : emergencystops) { |
| | | jsonObject.append("emergencystop", emergencystop); |
| | | } |
| | | |
| | | } |
| | | |
| | | // jsonObject.append("params", new short[] { 30, 40, }); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Layout"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | |
| | | if (webserver != null) { |
| | | |
| | | List<String> messages = webserver.getMessages(); |
| | | |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | List<String> B02start = Arrays.asList(config.getProperty("mlp.B02start")); |
| | | |
| | | // 故障地址 |
| | | List<String> waddresses5 = Arrays.asList(config.getProperty("PlcManualonePosition.fault2").split(",")); |
| | | |
| | | |
| | | // 复位地址 |
| | | List<String> waddresses6 = Arrays.asList(config.getProperty("PlcManualonePosition.Reset").split(",")); |
| | | List<Boolean> readreast = S7control.getinstance().readBits(waddresses6); |
| | | short[] reast6 = PLCBooleanConverter.convertListsToBinaryShortArray(readreast); |
| | | |
| | | // 回零地址 |
| | | List<String> waddresses7 = Arrays.asList(config.getProperty("PlcManualonePosition.Zero").split(",")); |
| | | List<Boolean> readhuiling = S7control.getinstance().readBits(waddresses7); |
| | | short[] huiling7 = PLCBooleanConverter.convertListsToBinaryShortArray(readhuiling); |
| | | |
| | | List<Boolean> A01readstart = S7control.getinstance().readBits(A01start); |
| | | List<Boolean> A02readstart = S7control.getinstance().readBits(A02start); |
| | | List<Boolean> B01readstart = S7control.getinstance().readBits(B01start); |
| | |
| | | jsonObject.append("guzhang", params2); |
| | | jsonObject.append("weihuiling", params3); |
| | | jsonObject.append("qidong", combinedBinaryShortArray); |
| | | jsonObject.append("fuwei", reast6); |
| | | jsonObject.append("huiling", huiling7); |
| | | |
| | | // WebSocketServer sendwServer = WebSocketServer.sessionMap.get("ManualonePosition"); |
| | | // if (sendwServer != null) { |
| | |
| | | List<String> messages = webserver.getMessages(); |
| | | |
| | | |
| | | // 故障地址 |
| | | List<String> waddresses5 = Arrays.asList(config.getProperty("PlcManualonePosition.fault2").split(",")); |
| | | |
| | | |
| | | // 复位地址 |
| | | List<String> waddresses6 = Arrays.asList(config.getProperty("PlcManualonePosition.Reset").split(",")); |
| | | |
| | | |
| | | // 回零地址 |
| | | List<String> waddresses7 = Arrays.asList(config.getProperty("PlcManualonePosition.Zero").split(",")); |
| | | |
| | | |
| | | |
| | |
| | | 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 |
| | |
| | |
|
| | | // List<Short> listd17 = S7control.getinstance().ReadWord("DB17.0",10);
|
| | | // String id=spianService.queGlassid("DB17.10", 14).toString();
|
| | | // |
| | | //
|
| | | // // 铝框线交互
|
| | | // try {
|
| | | // if (CurrentFrame != null) {
|
| | | // spianService.outmesid(CurrentFrame.getBarCode(), "DB17.0");
|
| | | // }
|
| | | // List<Short> framerequests = S7control.getinstance().ReadWord("铝框id请求字地址", 1);
|
| | | // for (Short framerequest : framerequests) {
|
| | | // if (framerequest == 1) {
|
| | | // // 铝框id
|
| | | // String franmeno = spianService.queGlassid("DB17.10", 14).toString();
|
| | | // String position;
|
| | | // try {
|
| | | // position = dbserve.SelectPositionByFrameBarcode(franmeno);
|
| | | // } catch (SQLException e) {
|
| | | // // TODO Auto-generated catch block
|
| | | // position = "0";
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // Short send;
|
| | | // if (position == "0") {
|
| | | // send = 0;
|
| | | // } else {
|
| | | // send = 1;
|
| | | // }
|
| | | // S7control.getinstance().WriteWord("铝框翻转发送地址", (short) send);
|
| | | // }
|
| | | // }
|
| | | // if (CurrentFrame != null) {
|
| | | // spianService.outmesid(CurrentFrame.getBarCode(), "DB17.0");
|
| | | // }
|
| | | // List<Short> framerequests = S7control.getinstance().ReadWord("铝框id请求字地址", 1);
|
| | | // for (Short framerequest : framerequests) {
|
| | | // if (framerequest == 1) {
|
| | | // // 铝框id
|
| | | // String franmeno = spianService.queGlassid("DB17.10", 14).toString();
|
| | | // String position;
|
| | | // try {
|
| | | // position = dbserve.SelectPositionByFrameBarcode(franmeno);
|
| | | // } catch (SQLException e) {
|
| | | // // TODO Auto-generated catch block
|
| | | // position = "0";
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // Short send;
|
| | | // if (position == "0") {
|
| | | // send = 0;
|
| | | // } else {
|
| | | // send = 1;
|
| | | // }
|
| | | // S7control.getinstance().WriteWord("铝框翻转发送地址", (short) send);
|
| | | // }
|
| | | // }
|
| | | // } catch (Exception e) {
|
| | | // // TODO: handle exception
|
| | | // // TODO: handle exception
|
| | | // }
|
| | |
|
| | | if (S7control.getinstance().CheckConnected() == true) {
|
| | | // if (S7control.getinstance().CheckConnected() == true) {
|
| | | // 获取当前扫码方式
|
| | | List<Short> Scanningmethod = S7control.getinstance().ReadWord("DB103.255", 1);
|
| | | jsonObject.append("Scanningmethod", Scanningmethod);
|
| | |
|
| | | List<Boolean> Scanningmethods = S7control.getinstance().ReadBits("DB101.11.4", 1);
|
| | | if (Scanningmethods != null) {
|
| | | for (Boolean Scanningmethod : Scanningmethods) {
|
| | | jsonObject.append("Scanningmethod", Scanningmethod);
|
| | | }
|
| | | }
|
| | |
|
| | | String CurrrentGlassId = spianService.queGlassid("DB103.256", 14).toString();
|
| | | jsonObject.append("CurrrentGlassId", CurrrentGlassId);
|
| | |
|
| | | // 获取D01-D06,A01,A02,B01,B02状态
|
| | | List<Short> DeviceList = S7control.getinstance().ReadWord("DB103.0", 10);
|
| | | jsonObject.append("DeviceList", DeviceList);
|
| | | // 获取D01-D06,A01,A02,B01,B02玻璃id
|
| | | List<String> GlassIdList = new ArrayList<String>();
|
| | | GlassIdList.add(spianService.queGlassid("DB103.40", 14).toString());
|
| | | GlassIdList.add(spianService.queGlassid("DB103.44", 14).toString());
|
| | | GlassIdList.add(spianService.queGlassid("DB103.58", 14).toString());
|
| | |
|
| | | GlassIdList.add(spianService.queGlassid("DB103.184", 14).toString());
|
| | |
| | | // }
|
| | |
|
| | | // }
|
| | | }
|
| | | // }
|
| | |
|
| | | storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
|
| | | dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
|
| | |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | new PlcHold().start(); |
| | | new PlcHold().start(); |
| | | |
| | | new Plchome().start(); |
| | | new PlcLayout().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(); |
| | | |
| | | // 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(); |
| | | |
| | | // new PlcInteractionState().start(); |
| | | // new PlcParameter1Review().start(); |
| | | // new PLCAutomaticParameterSettingReview().start(); |
| | | new PlcInteractionState().start(); |
| | | //new PlcParameter1Review().start(); |
| | | // new PLCAutomaticParameterSettingReview().start(); |
| | | } |
| | | } |
| | |
| | | @PostMapping("/InsertQueueGlassId") |
| | | public Result InsertQueueGlassId(Short id, @RequestBody Queue queue) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Short zhi=200; |
| | | short result = homeMapper.SelectStorageByGlassId(queue.getglassId()); |
| | | if (result > 0) { |
| | | map.put("message", "300"); |
| | | } else { |
| | | homeMapper.InsertQueueGlassId(queue, id); |
| | | |
| | | if (id == 1) { |
| | | // 调用伍存储过程 |
| | | spianService.selectAll(queue.getglassId()); |
| | | zhi=spianService.selectAll(queue.getglassId()); |
| | | if(zhi==200){ |
| | | homeMapper.InsertQueueGlassId(queue, id); |
| | | } |
| | | } |
| | | map.put("message", "200"); |
| | | |
| | | map.put("message",zhi); |
| | | } |
| | | return Result.success(map); |
| | | } |
| | |
| | | @PostMapping("/WriteGlassID") |
| | | public Result WriteGlassID(String glassid) { |
| | | // 扫码位写入玻璃id |
| | | spianService.outmesid(glassid, "DB103.256"); |
| | | spianService.outmesid(glassid, "DB103.286"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | |
| | | |
| | | // 切换PLC获取二维码方式 |
| | | @PostMapping("/SwitchScanMethod") |
| | | public Result SwitchScanMethod(Short scansmethod) { |
| | | S7control.getinstance().WriteWord("DB103.255", scansmethod); |
| | | public Result SwitchScanMethod(Boolean scansmethod) { |
| | | S7control.getinstance().WriteBit("DB101.11.4", scansmethod); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | |
| | | short SelectInTask(); |
| | | |
| | | // 手动完成任务 |
| | | @Update("update storage_task set task_state=2 where task_type=#{task_type} and glass_id=#{glassid}") |
| | | @Update("update storage_task set task_state=1 where task_type=#{task_type} and glass_id=#{glassid}") |
| | | void UpdateTask(@Param("task_type") Integer task_type,String glassid); |
| | | |
| | | // 手动完成进片任务修改笼子数据 |
| | |
| | | void UpdateOutSliceGlass(String glassid); |
| | | |
| | | //查询未完成的任务 |
| | | @Select("select * from storage_task where task_state!=2 and task_type=#{task_type}") |
| | | @Select("select * from storage_task where task_state=0 and task_type=#{task_type}") |
| | | List<StorageTask> SelectTaskByState(int task_type); |
| | | |
| | | //修改出片队列铝框状态 |
| | |
| | | @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where id=#{id};") |
| | | 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};") |
| | | @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); |
| | | |
| | | // 修改笼子信息(多片进片) |
| | |
| | | //判断玻璃是否禁用 |
| | | @Select(" select disabled from storage_cage where glass_id=#{glassid} limit 1;") |
| | | int SelectCageGlassState(String glassid); |
| | | //判断汇报的id是否正确 |
| | | @Select("SELECT count(*) FROM `storage_cage` where state!=0 and state!=1 and glass_id=#{glassid}") |
| | | int SelectHB(String glassid); |
| | | } |
| | |
| | | package com.example.springboot.service; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | import com.example.springboot.mapper.SpianMapper; |
| | | import com.google.common.primitives.Bytes; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | |
| | | @Service |
| | | public class SpianService { |
| | | @Autowired |
| | |
| | | // @GetMapping("/all") |
| | | public Short selectAll(String glassid) { |
| | | |
| | | int cage1=0; |
| | | int cage1 = 0; |
| | | int cells; |
| | | int ids; |
| | | int prcid; |
| | |
| | | double minwidth = 0; |
| | | |
| | | north_glass_buffer1 glasslist = spianMapper.selectGlass(glassid); // 获取玻璃参数 |
| | | //如果没有此id时 |
| | | // 如果没有此id时 |
| | | if (glasslist == null) { |
| | | return (300); |
| | | } |
| | | |
| | | |
| | | double widths = glasslist.getglasslengthmm(); |
| | | String orderids = glasslist.getordernumber(); |
| | | String FrameBarcode = glasslist.getFrameBarcode(); |
| | |
| | | |
| | | // String orderid="A001"; |
| | | // 获取订单相关度最高的笼子排序 |
| | | List<StorageCage> storageCage = spianMapper.selectAllFbarcode(FrameBarcode,widths,400); |
| | | //判断铝框指定空格是否需要间隔空间 |
| | | |
| | | |
| | | List<StorageCage> storageCage = spianMapper.selectAllFbarcode(FrameBarcode, widths, 400); |
| | | // 判断铝框指定空格是否需要间隔空间 |
| | | |
| | | if (storageCage.size() == 0) { |
| | | storageCage = spianMapper.selectAll(orderids, FrameBarcode); |
| | | } |
| | |
| | | spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度 |
| | | spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(), prctier);// 新增任务 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 1);// 进片任务发送字改为1 |
| | | System.out.println("进片任务|" + datas); |
| | | |
| | | } else { |
| | |
| | | spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度 |
| | | spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(), prctier);// 新增任务 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 1);// 进片任务发送字改为1 |
| | | System.out.println("进片任务|" + datas); |
| | | |
| | | // S7control.getinstance().WriteByte("DB105.16",glassid); |
| | |
| | | |
| | | spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, state);// 新增任务 |
| | | // int state = spianMapper.selectGlassState(cage, cell);//获取格子数量 |
| | | if (state == 2) { |
| | | spianMapper.UpdateDBCage1(cage, cell);// 将内片数据更新到外片里 |
| | | spianMapper.UpdateDBCage2(cage, cell);// 清除内片数据 |
| | | } |
| | | // if (state == 2) { |
| | | // spianMapper.UpdateDBCage1(cage, cell);// 将内片数据更新到外片里 |
| | | // spianMapper.UpdateDBCage2(cage, cell);// 清除内片数据 |
| | | // } |
| | | System.out.println("出片任务|" + datas); |
| | | S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务 |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为1 |
| | | outmesid(glassid, "DB105.34");// 派发出片ID |
| | | |
| | | return (200);// 结束 |
| | |
| | | System.out.println("出片任务|" + datas); |
| | | outmesid(glassid, "DB105.34");// 派发出片ID |
| | | S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务 |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为1 |
| | | |
| | | return (200);// 结束 |
| | | |
| | |
| | | // 传输mes数据,坐标,数据 |
| | | System.out.println("出片任务|" + datas); |
| | | S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务 |
| | | |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为1 |
| | | outmesid(glassids, "DB105.34");// 派发调拨玻璃ID |
| | | return (200); // 结束 |
| | | |
| | |
| | | // 传输mes数据,坐标,数据 |
| | | System.out.println("出片任务|" + datas); |
| | | S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务 |
| | | |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为1 |
| | | outmesid(glassids, "DB105.34");// 派发调拨玻璃ID |
| | | return (200);// 结束 |
| | | |
| | |
| | | byte[] bytes = Bytes.toArray(glassidlist); |
| | | System.out.println("outmesidbytes:" + bytes.length); |
| | | S7control.getinstance().WriteByte(address, bytes);// 派发出片id |
| | | |
| | | } |
| | | |
| | | // 获取地址内的玻璃id转字符串 |
| | |
| | | // } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | String A01glassid2 = spianService.queGlassid("DB103.142", 14).toString(); |
| | | String A02glassid1 = spianService.queGlassid("DB103.156", 14).toString(); |
| | | String B01glassid = spianService.queGlassid("DB103.184", 14).toString(); |
| | | String B02glassid = spianService.queGlassid("DB103.198", 14).toString(); |
| | | String B02glassid = spianService.queGlassid("DB103.212", 14).toString(); |
| | | List<Short> DeviceList = S7control.getinstance().ReadWord("DB103.0", 10); |
| | | if (types == 0) {// 终止进片任务 |
| | | List<StorageTask> cageList = homeMapper.SelectTaskByState(types); |
| | | for (StorageTask storageTask : cageList) { |
| | | // 判断出片任务位置并清除对应玻璃id |
| | | if ((storageTask.getGlassId() == A01glassid1 || storageTask.getGlassId() == A01glassid2)&&DeviceList.get(4)==0) { |
| | | if ((storageTask.getGlassId().equals(A01glassid1)|| storageTask.getGlassId().equals(A01glassid2))&&DeviceList.get(4)==0) { |
| | | outSliceServive.StopTask(storageTask.getGlassId(), types); |
| | | ClearGlassId("DB101.10.0"); |
| | | } else if (storageTask.getGlassId() == B01glassid&&DeviceList.get(2)==0) { |
| | | } |
| | | if (storageTask.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0) { |
| | | outSliceServive.StopTask(storageTask.getGlassId(), types); |
| | | ClearGlassId("DB101.10.2"); |
| | | } else if (storageTask.getGlassId() == B02glassid&&DeviceList.get(3)==0) { |
| | | } |
| | | if (storageTask.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0) { |
| | | ClearGlassId("DB101.10.3"); |
| | | outSliceServive.StopTask(storageTask.getGlassId(), types); |
| | | }\ |
| | | } |
| | | } |
| | | // 发送终止进片任务信号 |
| | | } else {// 终止出片任务 |
| | | List<StorageTask> cageLists = homeMapper.SelectTaskByState(types); |
| | | List<StorageTask> cageList2 = homeMapper.SelectTaskByState(2); |
| | | if (cageList2!=null) { |
| | | if (cageList2.size()>0) { |
| | | cageLists.add(cageList2.get(0)); |
| | | } |
| | | for (StorageTask cageList : cageLists) { |
| | | if (cageList.getTaskType().equals("1")) { |
| | | if(cageList.getGlassId() ==A02glassid1&&DeviceList.get(5)==0){ |
| | | System.out.println(DeviceList.get(5)); |
| | | if(cageList.getGlassId().equals(A02glassid1)&&DeviceList.get(5)==0){ |
| | | outSliceServive.StopTask(cageList.getGlassId(), types); |
| | | ClearGlassId("DB101.10.1"); |
| | | } |
| | | else if(cageList.getGlassId() ==B01glassid&&DeviceList.get(2)==0){ |
| | | if(cageList.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0){ |
| | | outSliceServive.StopTask(cageList.getGlassId(), types); |
| | | ClearGlassId("DB101.10.2"); |
| | | } |
| | | else if(cageList.getGlassId() ==B02glassid&&DeviceList.get(3)==0){ |
| | | if(cageList.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0){ |
| | | outSliceServive.StopTask(cageList.getGlassId(), types); |
| | | ClearGlassId("DB101.10.3"); |
| | | } |
| | | }else if (cageList.getTaskType().equals("2")) { |
| | | if(cageList.getGlassId() ==A02glassid1&&DeviceList.get(5)==0){ |
| | | if(cageList.getGlassId().equals(A02glassid1)&&DeviceList.get(5)==0){ |
| | | outSliceServive.StopTask(cageList.getGlassId(), 2); |
| | | ClearGlassId("DB101.10.1"); |
| | | } |
| | | else if(cageList.getGlassId() ==B01glassid&&DeviceList.get(2)==0){ |
| | | if(cageList.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0){ |
| | | outSliceServive.StopTask(cageList.getGlassId(), 2); |
| | | ClearGlassId("DB101.10.2"); |
| | | } |
| | | else if(cageList.getGlassId() ==B02glassid&&DeviceList.get(3)==0){ |
| | | if(cageList.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0){ |
| | | outSliceServive.StopTask(cageList.getGlassId(), 2); |
| | | ClearGlassId("DB101.10.3"); |
| | | } |
| | |
| | | PlcInteractionState.PLCProductiontask=DB106.20,DB106.16,DB106.18,DB103.156-169
|
| | |
|
| | | #任务信息
|
| | | PlcInteractionState.MEStaskinformation=DB105.48,DB105.50,DB105.48,DB105.50,DB106.42,DB106.48,DB106.50,DB106.58,DB103.128-141,DB103.142-155,DB103.156-169,DB103.184-197,DB103.212-225
|
| | | PlcInteractionState.MEStaskinformation=DB105.48,DB105.50,DB105.48,DB105.50,DB106.42,DB106.48
|
| | |
|
| | |
|
| | |
|
| | | #任务信息2
|
| | | PlcInteractionState.MEStaskinformation2=DB106.52,DB106.58,DB103.128-141,DB103.142-155,DB103.156-169,DB103.184-197,DB103.212-225
|
| | |
|
| | |
|
| | |
|