wu
2024-04-11 fdf078d0adec8aaa4bdf39a61db38ed68184b50d
Merge branch 'master' of http://10.153.19.25:10101/r/Albania_Mes

# Conflicts:
# Albania_Mes-ui/src/views/home/index.vue
# springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java
11个文件已修改
1个文件已添加
531 ■■■■ 已修改文件
Albania_Mes-ui/src/views/Electrical/Action.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/views/Electrical/AutomaticParameterSetting.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/views/Electrical/InteractionState.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/views/Electrical/Servomanual.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/views/home/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PlcAlbania.json 414 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/views/Electrical/Action.vue
@@ -12,7 +12,7 @@
      }}</router-link> -->
      <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
      }}</router-link>
       <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
       <router-link to="/Electrical/AlbaniaServo" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
      }}</router-link>
    </el-breadcrumb>
    
Albania_Mes-ui/src/views/Electrical/AutomaticParameterSetting.vue
@@ -11,7 +11,7 @@
      }}</router-link> -->
      <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
      }}</router-link>
      <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{
      <router-link to="/Electrical/AlbaniaServo" tag="el-button" type="text" active-class="blue-button">{{
        $t('Parameter')
      }}</router-link>
    </el-breadcrumb>
Albania_Mes-ui/src/views/Electrical/InteractionState.vue
@@ -32,7 +32,7 @@
        >{{ $t("Sign") }}</router-link
      >
      <router-link
        to="/Electrical/Servomanual"
        to="/Electrical/AlbaniaServo"
        tag="el-button"
        type="text"
        active-class="blue-button"
Albania_Mes-ui/src/views/Electrical/Servomanual.vue
@@ -23,7 +23,7 @@
      <!-- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualJog')
      }}</router-link> -->
<!--
       <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualonePosition')
      }}</router-link>
@@ -39,7 +39,7 @@
  
      <router-link   v-if="hasPermission" to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
        $t('Speed parameter settings')
      }}</router-link>
      }}</router-link> -->
<router-link  v-if="hasPermission"
        to="/Electrical/InteractionState"
Albania_Mes-ui/src/views/home/index.vue
@@ -513,9 +513,7 @@
                    <span class="measuretitle">{{ $t('Height') }}:</span> <span class="measureValue">{{
                this.LastQueue.glassheight }}</span> <span class="measureUnit">mm</span>
                    <br>
                    <span class="measuretitle">{{ $t('Thickness') }}:</span> <span class="measureValue">{{
                this.LastQueue.thickness }}</span> <span class="measureUnit">mm</span>
                    <br>
                    <span class="measuretitle">{{ $t('Measure Width') }}:</span> <span class="measureValue">{{
                this.LastQueue.glasswidthmm }}</span> <span class="measureUnit">mm</span>
                    <br>
@@ -523,8 +521,8 @@
                this.LastQueue.glassheightmm }}</span> <span class="measureUnit">mm</span>
                    <br>
                    <span class="measuretitle">{{ $t('Matching results') }}:</span> <span class="measureValue">{{
                this.LastQueue.state > 0 ? $t('Matching successful') : (this.LastQueue.state == 0 ? $t('Multiple data
                        matching'):$t('Matching failed')) }}</span>
                this.LastQueue.state > 0 ? $t('Matching successful') :
                (this.LastQueue.state == 0 ? $t('Multiple data matching'):$t('Matching failed')) }}</span>
                    <br>
                </div>
            </div>
@@ -853,7 +851,6 @@
                    this.tableData1 = obj.OrderTask[0];
                    this.LastQueue = obj.LastQueue[0];
                    //是否允许出片
                    this.isAllowQueue = obj.isAllowQueue[0];
PlcAlbania.json
New file
@@ -0,0 +1,414 @@
{
   "plcAddressBegin":"DB14.0",
   "plcAddressLenght":"208",
   "dataType":"word",
   "parameteInfor":[
      {
         "codeId": "PLCToMES",
         "addressIndex":"0",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
          "codeId": "IDStatus1",
          "addressIndex":"2",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"m/min"
       },
       {
          "codeId": "IDStatus2",
          "addressIndex":"4",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"m/min"
       },
       {
          "codeId": "IDStatus3",
          "addressIndex":"6",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "IDStatus4",
          "addressIndex":"8",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "IDStatus5",
          "addressIndex":"10",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       }
       ,
       {
          "codeId": "IDStatus6",
          "addressIndex":"12",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "StautsID1",
          "addressIndex":"14",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       }
       ,
       {
          "codeId": "StautsID2",
          "addressIndex":"16",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       }
       ,
       {
          "codeId": "StautsID3",
          "addressIndex":"18",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       }
       ,
       {
          "codeId": "StautsID4",
          "addressIndex":"20",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       }
       ,
       {
          "codeId": "StautsID5",
          "addressIndex":"22",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "StautsID6",
          "addressIndex":"24",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "GaToMES",
          "addressIndex":"26",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "Height",
          "addressIndex":"28",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "width",
          "addressIndex":"30",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "ExportTOMES1",
          "addressIndex":"32",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       }
       ,
       {
          "codeId": "ExportToMES2",
          "addressIndex":"34",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       } ,
       {
          "codeId": "MESToPLC",
          "addressIndex":"36",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       } ,
       {
          "codeId": "MESID1",
          "addressIndex":"38",
          "addressLenght":"14",
          "ratio":"1",
          "unit":"mm/S"
       } ,
       {
          "codeId": "MESID2",
          "addressIndex":"54",
          "addressLenght":"14",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "MESID3",
          "addressIndex":"70",
          "addressLenght":"14",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "MESID4",
          "addressIndex":"86",
          "addressLenght":"14",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "MESID5",
          "addressIndex":"102",
          "addressLenght":"14",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "MESID6",
          "addressIndex":"118",
          "addressLenght":"14",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "MESToPLCStart1",
          "addressIndex":"134",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },{
         "codeId": "MESToPLCStart2",
         "addressIndex":"136",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCStart3",
         "addressIndex":"138",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      }
      ,{
         "codeId": "MESToPLCStart4",
         "addressIndex":"140",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      }
      ,{
         "codeId": "MESToPLCStart5",
         "addressIndex":"142",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      }
      ,{
         "codeId": "MESToPLCStart6",
         "addressIndex":"144",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCTarget1",
         "addressIndex":"146",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCTarget2",
         "addressIndex":"148",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCTarget3",
         "addressIndex":"150",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCTarget4",
         "addressIndex":"152",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCTarget5",
         "addressIndex":"154",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCTarget6",
         "addressIndex":"156",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCStatus1",
         "addressIndex":"158",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCStatus2",
         "addressIndex":"160",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCStatus3",
         "addressIndex":"162",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCStatus4",
         "addressIndex":"164",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCStatus5",
         "addressIndex":"166",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToPLCStatus6",
         "addressIndex":"168",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "MESToGaStatus",
         "addressIndex":"170",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "A01Err",
         "addressIndex":"172",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "A02Err",
         "addressIndex":"174",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "B01Err",
         "addressIndex":"176",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "C01Err",
         "addressIndex":"178",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "C02Err",
         "addressIndex":"180",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "ErrSpace1",
         "addressIndex":"182",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "ErrSpace2",
         "addressIndex":"184",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "ErrSpace3",
         "addressIndex":"186",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "B01Position",
         "addressIndex":"188",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "C01Position",
         "addressIndex":"190",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "C02Position",
         "addressIndex":"192",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "DeviceState",
         "addressIndex":"194",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "AllFVRun",
         "addressIndex":"196",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "A01State",
         "addressIndex":"198",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "A02State",
         "addressIndex":"200",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "B01State",
         "addressIndex":"202",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "C01State",
         "addressIndex":"204",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },{
         "codeId": "C02State",
         "addressIndex":"206",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      }
   ]
}
springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java
@@ -7,6 +7,7 @@
import com.example.springboot.entity.device.PlcParameterObject;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
@@ -16,6 +17,11 @@
public class InitUtil {
    //初始化word
    public static PlcParameterObject initword(String jsonFilePath) {
        // File file=new File(jsonFilePath);
        // if (!file.exists()) {
        //     System.out.println(jsonFilePath);
        //     return null;
        // }
        try {
            FileReader fileReader = new FileReader(jsonFilePath);
            BufferedReader bufferedReader = new BufferedReader(fileReader);
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java
@@ -24,7 +24,8 @@
    // 单例实例
    private static PLCAutoMes instance;
    private static String PlcAlbania = PLCAutoMes.class.getResource("/JsonFile/PlcAlbania.json").getPath();
    private static String PlcAlbania ="D:/Code/Albania_Mes/PlcAlbania.json";
    //  PLCAutoMes.class.getResource("/JsonFile/PlcAlbania.json").getPath();
    public static PlcParameterObject PlcMesObject = initUtil.initword(PlcAlbania);
  
    // 私有构造函数
springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
@@ -87,6 +87,7 @@
      // 根据地址读取PCL数据
      List<Boolean> plclist = S7control.getinstance().ReadBits("DB15.0.0", Plccount);
      // System.out.println(plclist);
//      List<Boolean> plclist = S7control.getinstance().ReadBits(PlcAddress, Plccount);
      // Boolean[] values = { false, false, true, false, true, false, true, false,
      // true, false, true, false, true, false,
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -123,9 +123,7 @@
                // if(plcmes.==null){
                // }
                // 获取测量的长,宽
                boolean istest = true;
                // String PlcRequest = "1";
@@ -135,27 +133,30 @@
                // 匹配
                // System.err.println(PlcRequest+","+MesSend+","+width+","+height);
                // String PlcRequest = plcmes.getPlcParameter("GaToMES").getValue();// 请求
                // String MesSend = plcmes.getPlcParameter("MESToGaStatus").getValue();// 发送
                // double width = Double.valueOf(plcmes.getPlcParameter("width").getValue());// 宽
                // double height = Double.valueOf(plcmes.getPlcParameter("Height").getValue());// 高
                // if ("0".equals(PlcRequest) && istest) {
                //     S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 0);
                // }
                // if ("1".equals(PlcRequest) && "0".equals(MesSend)) {
                //     boolean is = HomeService.Normal(width, height, "1");
                //     if (is && istest) {
                //         // 测量成功
                //         S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
                //                 (short) 1);
                if (plcmes.getPlcParameter("GaToMES").getValue() != null) {
                    String PlcRequest = plcmes.getPlcParameter("GaToMES").getValue();// 请求
                    String MesSend = plcmes.getPlcParameter("MESToGaStatus").getValue();// 发送
                    double width = Double.valueOf(plcmes.getPlcParameter("width").getValue());// 宽
                    double height = Double.valueOf(plcmes.getPlcParameter("Height").getValue());// 高
                    if ("0".equals(PlcRequest) && istest) {
                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
                                (short) 0);
                    }
                    if ("1".equals(PlcRequest) && "0".equals(MesSend)) {
                        boolean is = HomeService.Normal(width, height, "1");
                        if (is && istest) {
                            // 测量成功
                            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
                                    (short) 1);
                //     } else if (istest) {
                //         // 重新测量
                //         S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
                //                 (short) 4);
                //     }
                        } else if (istest) {
                            // 重新测量
                            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
                                    (short) 4);
                        }
                    }
                }
                // }
                // S7control.getinstance().WriteWord("DB14.170", (short)0);
                Queue LastQueue = QueueMapper.selectLastQueue();
                if (LastQueue == null) {
@@ -192,27 +193,28 @@
                List<FlowCard> OrderTask = storageCageService.SelectOrderTask();
                jsonObject.append("OrderTask", OrderTask);
                // jsonObject.append("params", new short[] { 30, 40, });
                // System.out.println("jsonObject:" + jsonObject);
                ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home");
                if (sendwServer != null) {
                    for (WebSocketServer webserver : sendwServer) {
                        webserver.sendMessage(jsonObject.toString());
                        if (webserver != null) {
                            List<String> messages = webserver.getMessages();
                            if (!messages.isEmpty()) {
                                // // 将最后一个消息转换为整数类型的列表
                                webserver.clearMessages();
                            }
                        }
                    }
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            // jsonObject.append("params", new short[] { 30, 40, });
            ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home");
            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/Plcsign.java
@@ -74,8 +74,6 @@
      }
       List<String> addressList21 = Arrays.asList(config.getProperty("PlcIO.State").split(","));
       List<Boolean> plclist = S7control.getinstance().readBits(addressList21);
      //  List<String> addressListName = Arrays.asList(config.getProperty("PlcIO.Name").split(","));
      //  List<String> addressListName1 = Arrays.asList(config.getProperty("PlcIO.Name1").split(","));
      //  System.out.println("急停"+S7control.getinstance().ReadBits("DB10.0.5", 1));
      
      if (plclist != null) {
@@ -89,8 +87,6 @@
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.append("sig", Intlist);
        // jsonObject.append("addressListName", addressListName);
        // jsonObject.append("addressListName1", addressListName1);
//        WebSocketServer sendwServer3 = WebSocketServer.sessionMap.get("Sign");
//        if (sendwServer3 != null) {
//          sendwServer3.sendMessage(jsonObject.toString());
springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
@@ -18,7 +18,7 @@
     * 数据库连接参数
     * driver,url,username,password
     */
    private static final String DRIVER = "com.mysql.jdbc.Driver";
    private static final String DRIVER = "com.mysql.cj.jdbc.Driver";
    private static final String URL = "jdbc:mysql://10.153.19.150:3306/canadames";
    private static final String USERNAME = "root";
    private static final String PASSWORD = "beibo.123/";