ZengTao
2024-01-18 ea46f28356e2acb3bc7cc69b9af3c52fab38c0b0
终止任务功能测试
13个文件已修改
1个文件已添加
557 ■■■■■ 已修改文件
CanadaMes-ui/src/api/home.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcLayout.java 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 324 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/api/home.js
@@ -286,9 +286,9 @@
    })
}
export function SwitchScanMethod(scansmethod) {s
export function SwitchScanMethod(scansmethod) {
    return request({
        url: '/home/SwitchScanMethod?Scanmethod='+scanmethod,
        url: '/home/SwitchScanMethod?scansmethod='+scansmethod,
        method: 'post',
        data:""
    })
CanadaMes-ui/src/lang/locales/en-US.json
@@ -1,6 +1,5 @@
{
  "ip": "localhost",
  "ip":"localhost",
  "systemTitle": "Login System",
  "usernamePlaceholder": "Please enter username",
  "passwordPlaceholder": "Please enter password",
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -1,5 +1,5 @@
{
  "ip": "localhost",
  "ip":"localhost",
  "systemTitle": "登录系统",
  "usernamePlaceholder": "请输入用户名",
  "passwordPlaceholder": "请输入密码",
CanadaMes-ui/src/views/home/index.vue
@@ -252,7 +252,7 @@
            <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"
@@ -389,10 +389,10 @@
                    A01.1:{{ ShowGlassIdList(4) }}</div>
                <div class="glass A01" style="top: 290px;left: 289px;position: absolute;"
                    @click="ClearGlassId('DB101.10.1,5')">A01.2:{{ ShowGlassIdList(5) }}</div>
                    @click="ClearGlassId('DB101.10.1,5',5)">A01.2:{{ ShowGlassIdList(5) }}</div>
                <div class="glass A02" style="top: 310px;left: 289px;position: absolute;"
                    @click="ClearGlassId('DB101.10.2,6')">A02:{{ ShowGlassIdList(6) }}</div>
                    @click="ClearGlassId('DB101.10.2,6',6)">A02:{{ ShowGlassIdList(6) }}</div>
                <div class="glass D03" style="top: 137px;left: 42px;position: absolute;"
                    @click="ClearGlassId('DB101.9.4', 7)">
@@ -583,14 +583,14 @@
                        }}</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;">
@@ -701,11 +701,11 @@
                        {{ $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">
@@ -980,7 +980,8 @@
            CurrentFrame: [],
            DeviceList: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
            GlassIdList: [],
            Scanningmethod: true
            Scanningmethod: true,
            CurrrentGlassId:""
        };
    },
    created() {
@@ -1028,14 +1029,15 @@
                    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, "");
                    }
                    //查询当前铝框信息
                    this.CurrentFrame = obj.CurrentFrame;
                    //获取设备状态
@@ -1120,10 +1122,13 @@
                    } 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);
@@ -1328,7 +1333,7 @@
            }
        },
        //获取扫码位和上片位数据
        SelectGlassByGlassIDs(parameter) {
        SelectGlassByGlassIDs() {
            this.showform3();
            // if (parameter == 1) {
            //     SelectGlassByGlassID(this.glassid2).then(res => {
@@ -2039,8 +2044,9 @@
        //清除玻璃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'),
@@ -2099,14 +2105,8 @@
        },
        //切换二维码获取方式
        SwitchScanMethod(){
            var Scanmethod;
            if(this.Scanningmethod == true){
                this.Scanmethod = 1;
            }else{
                this.Scanmethod = 0;
            }
            SwitchScanMethod(Scanmethod).then(res => {
                if (res.data.message == 200) {
            SwitchScanMethod(!this.Scanningmethod).then(res => {
                if(res.data.message == 200) {
                    this.$message.success(this.$t('Operation successful'));
                }
            });
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview.java
@@ -26,10 +26,10 @@
        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
    }
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -29,7 +29,7 @@
        // \\ TODO Auto-generated catch block
        e.printStackTrace();
      }
      if (S7control.getinstance().CheckConnected() == false) {
      // if (S7control.getinstance().CheckConnected() == false) {
        spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
        spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
        jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
@@ -165,7 +165,7 @@
        // 查询数据库
        // 推送到前端
      }
      // }
    }
  }
springboot-vue3/src/main/java/com/example/springboot/component/PlcLayout.java
New file
@@ -0,0 +1,116 @@
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();
                        }
                    }
                }
            }
        }
    }
}
springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
@@ -28,7 +28,7 @@
    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
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -121,171 +121,181 @@
            // 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) {
                // 获取当前扫码方式
                List<Short> Scanningmethod = S7control.getinstance().ReadWord("DB103.255", 1);
                jsonObject.append("Scanningmethod", Scanningmethod);
                // 获取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.58", 14).toString());
            // if (S7control.getinstance().CheckConnected() == true) {
            // 获取当前扫码方式
                GlassIdList.add(spianService.queGlassid("DB103.184", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.212", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.128", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.142", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.156", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.72", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.86", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.100", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.114", 14).toString());
                jsonObject.append("GlassIdList", GlassIdList);
                // 读去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<Boolean> Scanningmethods = S7control.getinstance().ReadBits("DB101.11.4", 1);
            if(Scanningmethods!=null){
                for (Boolean Scanningmethod : Scanningmethods) {
                    jsonObject.append("Scanningmethod", Scanningmethod);
                }
                // 获取进片车状态
                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) {
                    if (inglassInfo.size() > 0) {
                        jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
                    }
                }
                // // 获取铝框idDB106.DBW64,添加到出片队列
                // String frameno="X21763329601FB";
                String frameno = spianService.queGlassid("DB103.270", 14).toString();
                if (!frameno.equals(Plchome.FrameNo)) {
                    Plchome.FrameNo = frameno;
                    try {
                        Short num = 0;
                        List<north_glass_buffer1> north_glass_buffer1s = north_Glass_Buffer1Service
                                .SelectAluminumFrameInfoById(Plchome.FrameNo);
                        for (north_glass_buffer1 north_glass_buffer1 : north_glass_buffer1s) {
                            if (north_glass_buffer1.getstorageCage() == null) {
                                break;
                            }
                            num++;
                        }
                        if (num == north_glass_buffer1s.size()) {
                            north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo);
                        } else {
                            Plchome.AluminumFrame = north_glass_buffer1s;
                        }
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }
                if (AluminumFrame != null) {
                    jsonObject.append("AluminumFrame", AluminumFrame);
                }
                // 获取进片请求状态
                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);
                // 复位完成信号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);
                }
                // // 终止继续按钮
                // 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));
                // 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++) {
                // boolean value = resets.get(i);
                // resets2[i] = value ? (short) 1 : (short) 0;
                // }
                // for (short number : resets2) {
                // if (number == 1) {
                // jsonObject.append("Abort", anniuparams);
                // }
                // }
            }
            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.58", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.184", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.212", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.128", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.142", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.156", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.72", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.86", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.100", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.114", 14).toString());
            jsonObject.append("GlassIdList", GlassIdList);
            // 读去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);// 获取进片车状态
            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) {
                if (inglassInfo.size() > 0) {
                    jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
                }
            }
            // // 获取铝框idDB106.DBW64,添加到出片队列
            // String frameno="X21763329601FB";
            String frameno = spianService.queGlassid("DB103.270", 14).toString();
            if (!frameno.equals(Plchome.FrameNo)) {
                Plchome.FrameNo = frameno;
                try {
                    Short num = 0;
                    List<north_glass_buffer1> north_glass_buffer1s = north_Glass_Buffer1Service
                            .SelectAluminumFrameInfoById(Plchome.FrameNo);
                    for (north_glass_buffer1 north_glass_buffer1 : north_glass_buffer1s) {
                        if (north_glass_buffer1.getstorageCage() == null) {
                            break;
                        }
                        num++;
                    }
                    if (num == north_glass_buffer1s.size()) {
                        north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo);
                    } else {
                        Plchome.AluminumFrame = north_glass_buffer1s;
                    }
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            if (AluminumFrame != null) {
                jsonObject.append("AluminumFrame", AluminumFrame);
            }
            // 获取进片请求状态
            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);
            // 复位完成信号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);
            }
            // // 终止继续按钮
            // 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));
            // 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++) {
            // boolean value = resets.get(i);
            // resets2[i] = value ? (short) 1 : (short) 0;
            // }
            // for (short number : resets2) {
            // if (number == 1) {
            // jsonObject.append("Abort", anniuparams);
            // }
            // }
            // }
            storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
            dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -17,10 +17,10 @@
        //
        System.out.println("启动完成");
      //  new PlcHold().start();
       new PlcHold().start();
        new Plchome().start();
        new PlcLayout().start();
            new PlcLayout().start();
        new Plcalarm().start();
        new Plcsign().start();
@@ -36,10 +36,10 @@
        new PlcManualonePosition2().start();
        new PlcServoManualone().start();
        new PLCManualJog().start();
        //new Plclog().start();
        new Plclog().start();
        new PlcInteractionState().start();
        new PlcParameter1Review().start();
       // new PLCAutomaticParameterSettingReview().start();
        // new PlcParameter1Review().start();
      //  new PLCAutomaticParameterSettingReview().start();
    }
}
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -402,7 +402,7 @@
  @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);
@@ -454,8 +454,8 @@
  // 切换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);
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -58,7 +58,7 @@
  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);
  // 手动完成进片任务修改笼子数据
@@ -204,7 +204,7 @@
  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);
  //修改出片队列铝框状态
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -78,7 +78,7 @@
    @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);
    // 修改笼子信息(多片进片)
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -45,39 +45,41 @@
                } else if (storageTask.getGlassId() == 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");
                    }