Explorar o código

核心线程,写PLC

kingwang1995 %!s(int64=7) %!d(string=hai) anos
pai
achega
85ebb065a4

+ 2 - 2
parkMonitor.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27130.2026
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "parkMonitor", "parkMonitor\parkMonitor.csproj", "{DD3DCAB1-41A7-4EED-ADEE-9E4BBCE6B4C0}"
 EndProject

+ 23 - 1
parkMonitor/App.config

@@ -26,10 +26,16 @@
     <add key="wheelbase" value="50" />
     <!---->
     <add key="ClientSettingsProvider.ServiceUri" value="" />
-    <!--激光设备通用配置-->  
+    <!--PLC通用配置-->
+    <add key="fetch_completed_address" value="9"/>
     <add key="park_command_address" value="0"/>
     <add key="park_completed_address" value="9"/>
     <add key="laser_countdown" value="30"/>
+    <!--激光数据地址-->
+    <add key="vehicleTypeLength_address" value="1"/>
+    <add key="vehicleTypeWidth_address" value="1"/>
+    <add key="vehicleTypeHeight_address" value="1"/>
+    <add key="vehicleTypeWheelbase_address" value="1"/>
     <!--一号激光设备配置-->
     <add key="laser1_status_address" value="1"/>
     <!--二号激光设备配置-->
@@ -38,6 +44,22 @@
     <add key="fetch_store_ratio" value="3"/>
     <!--上位机(中控端)IP地址及配置serverScoket的端口-->
     <add key ="WebConfig" value="127.0.0.1:9000"/>
+    
+    <!--PLC总控状态-->
+    <add key="equipmentStatus_address" value="0"/>
+    <!--取车写入PLC-->
+    <add key="startRobot_address" value="0"/>
+    <add key="parkingSpaceID_address" value="1"/>
+    <add key="parkingSpaceX_address" value="2"/>
+    <add key="parkingSpaceY_address" value="3"/>
+    <add key="parkingSpaceZ_address" value="4"/>
+    <!--停车启动机械手-->
+    <add key="parking_startRobot_address" value="0"/>
+    
+    <!--车库入口-->
+    <add key="parkingEntX" value="0"/>
+    <add key="parkingEntY" value="0"/>
+    <add key="parkingEntZ" value="0"/>
   </appSettings>
   <system.web>
     <membership defaultProvider="ClientAuthenticationMembershipProvider">

+ 184 - 13
parkMonitor/DB/DBOperation.cs

@@ -58,7 +58,14 @@ namespace parkMonitor.DB
             MySqlDataReader reader;
             string sql = "select vehicleTypeID from vehicle where numberPlate = '" + numberPlate + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             try
             {
@@ -85,7 +92,14 @@ namespace parkMonitor.DB
             MySqlDataReader reader;
             string sql = "select vehicleTypeLength,vehicleTypeWidth,vehicleTypeHeight,vehicleTypeWheelbase from vehicletype where vehicleTypeID = '" + vehicleTypeID + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             try
             {
@@ -127,7 +141,14 @@ namespace parkMonitor.DB
             MySqlDataReader reader;
             string sql = "select * from parkingspace where parkingSpaceState=0";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             try
             {
@@ -171,7 +192,14 @@ namespace parkMonitor.DB
             MySqlDataReader reader;
             string sql = "select * from garage where garageID = '" + garageID + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             try
             {
@@ -204,7 +232,14 @@ namespace parkMonitor.DB
         {
             string sql = "insert into parkingrecords(userID,numberPlate,parkingSpaceID,garageID,parkingRecordsState,realParkTime) values('" + userID + "','" + numberPlate + "','" + parkingSpaceID + "','" + garageID + "','" + parkingRecordsState + "','" + realParkTime + "')";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             oper.getInsert(cmd);
 
@@ -218,7 +253,14 @@ namespace parkMonitor.DB
         {
             string sql = "update vehicle set vehiclepParkState = '" + vehiclepParkState + "',scanEntryTime = '" + scanEntryTime + "',parkingRecordsID = '" + parkingRecordsID + "',parkingSpaceID = '" + parkingSpaceID + "',vehicleTypeConfirm = '" + vehicleTypeConfirm + "' where numberPlate = '" + numberPlate + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             oper.getUpdate(cmd);
             con.Close();
@@ -231,7 +273,14 @@ namespace parkMonitor.DB
             MySqlDataReader reader;
             string sql = "select * from garage where garageID = '" + garageID + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             try
             {
@@ -257,7 +306,14 @@ namespace parkMonitor.DB
         {
             string sql = "update garage set garageFreeSpace = '" + garageFreeSpace + "' where garageID = '" + garageID + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             oper.getUpdate(cmd);
             con.Close();
@@ -268,7 +324,14 @@ namespace parkMonitor.DB
         {
             string sql = "update vehicle set vehiclepParkState = '" + vehiclepParkState + "'where numberPlate = '" + numberPlate + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             oper.getUpdate(cmd);
             con.Close();
@@ -279,7 +342,14 @@ namespace parkMonitor.DB
         {
             string sql = "update parkingspace set parkingSpaceState = '" + parkingSpaceState + "'where parkingSpaceID = '" + parkingSpaceID + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             oper.getUpdate(cmd);
             con.Close();
@@ -290,7 +360,14 @@ namespace parkMonitor.DB
         {
             string sql = "update parkingrecords set parkingRecordsState = '" + parkingRecordsState + "',realGetTime = '" + realGetTime + "'where parkingRecordsID = '" + parkingRecordsID + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             oper.getUpdate(cmd);
             con.Close();
@@ -301,7 +378,14 @@ namespace parkMonitor.DB
         {
             string sql = "insert into messagequeue(userID,context,messageType) values('" + userID + "','" + context + "','" + messageType + "')";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             oper.getInsert(cmd);
             con.Close();
@@ -314,7 +398,14 @@ namespace parkMonitor.DB
             MySqlDataReader reader;
             string sql = "select * from garage where garageID = '" + garageID + "'";
             con = oper.getConn();
-            con.Open();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
             cmd = oper.getComm(sql, con);
             try
             {
@@ -334,5 +425,85 @@ namespace parkMonitor.DB
             con.Close();
             return garageName;
         }
+
+        //根据车牌查询
+        public Vehicle GetVehicle(string numberPlate)
+        {
+           // List<Vehicle> lVehicle = new List<Vehicle>();
+            Vehicle v = new Vehicle();
+            MySqlDataReader reader;
+            string sql = "select * from vehicle where numberPlate = '" + numberPlate + "'";
+            con = oper.getConn();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
+            cmd = oper.getComm(sql, con);
+            try
+            {
+                reader = oper.getResultSet(cmd);
+                while (reader.Read())
+                {
+                    if (reader.HasRows)
+                    {
+                        int parkingSpaceID = reader.GetInt32("parkingSpaceID");
+                        int garageID = reader.GetInt32("garageID");                      
+                        v.parkingSpaceID = parkingSpaceID;
+                        v.garageID = garageID;
+                        //lVehicle.Add(v);
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.ToString());
+            }
+            con.Close();
+            return v;
+        }
+
+        //根据车库id和车位id获得x,y,z
+        public Fetching_Space GetFetchingSpace(int parkingSpaceID, int garageID)
+        {
+            Fetching_Space fs = new Fetching_Space();
+            MySqlDataReader reader;
+            string sql = "select * from vehicle where parkingSpaceID = '" + parkingSpaceID + "',garageID='" + garageID + "'";
+            con = oper.getConn();
+            try
+            {
+                con.Open();
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+            }
+            cmd = oper.getComm(sql, con);
+            try
+            {
+                reader = oper.getResultSet(cmd);
+                while (reader.Read())
+                {
+                    if (reader.HasRows)
+                    {
+                        int parkingSpaceX = reader.GetInt32("parkingSpaceX");
+                        int parkingSpaceY = reader.GetInt32("parkingSpaceY");
+                        int parkingSpaceZ = reader.GetInt32("parkingSpaceZ");
+                        fs.parkingSpaceX = parkingSpaceX;
+                        fs.parkingSpaceY = parkingSpaceY;
+                        fs.parkingSpaceZ = parkingSpaceZ;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.ToString());
+            }
+            con.Close();
+            return fs;
+        }
     }
 }

+ 7 - 0
parkMonitor/DB/Parking_Space.cs

@@ -16,4 +16,11 @@ namespace parkMonitor.DB
         public int parkingSpaceY { get; set; }
         public int parkingSpaceZ { get; set; }
     }
+
+    class Fetching_Space
+    {
+        public int parkingSpaceX { get; set; }
+        public int parkingSpaceY { get; set; }
+        public int parkingSpaceZ { get; set; }
+    }
 }

+ 14 - 0
parkMonitor/DB/Vehicle.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace parkMonitor.DB
+{
+    class Vehicle
+    {
+        public int parkingSpaceID { get; set; }
+        public int garageID { get; set; }
+    }
+}

+ 30 - 8
parkMonitor/entity/AbstractMessage.cs

@@ -205,15 +205,15 @@ namespace parkMonitor.entity
     //Data component
     public class Data : ICloneable
     {
-        public float centerX { get; set; }
-        public float centerY { get; set; }
-        public float angleA { get; set; }
-        public float length { get; set; }
-        public float width { get; set; }
-        public float height { get; set; }
+        public int centerX { get; set; }
+        public int centerY { get; set; }
+        public int angleA { get; set; }
+        public int length { get; set; }
+        public int width { get; set; }
+        public int height { get; set; }
 
-        public Data() : this(0f, 0f, 0f, 0f, 0f, 0f) { }
-        public Data(float cx, float cy, float aa, float l, float w, float h)
+        public Data() : this(0, 0, 0, 0, 0, 0) { }
+        public Data(int cx, int cy, int aa, int l, int w, int h)
         {
             centerX = cx;
             centerY = cy;
@@ -260,4 +260,26 @@ namespace parkMonitor.entity
         }
     }
 
+    public class ParkingMessage : AbstractMessage
+    {
+        //发1:startLaser
+        //2:激光的6个数据,startRobot,车位信息4个
+        //3:停车完成,归零
+        //4:startRobot,车位信息4个
+        public int  status { get; set; }
+        public string startRobot { get; set; }
+        public string parkingSpaceID { get; set; }
+        public string parkingSpaceX { get; set; }
+        public string parkingSpaceY { get; set; }
+        public string parkingSpaceZ { get; set; }
+        public string startLaser { get; set; }
+        public string centerX { get; set; }
+        public string centerY { get; set; }
+        public string angleA { get; set; }
+        public string length { get; set; }
+        public string width { get; set; }
+        public string height { get; set; }
+    }
+
+
 }

+ 1 - 0
parkMonitor/parkMonitor.csproj

@@ -107,6 +107,7 @@
     <Compile Include="server\CoreThread\AllotParkingSpace.cs" />
     <Compile Include="server\CoreThread\AllotTest.cs" />
     <Compile Include="server\CoreThread\CoreThread.cs" />
+    <Compile Include="server\CoreThread\CoreThreadTest.cs" />
     <Compile Include="server\CoreThread\QueuingThread.cs" />
     <Compile Include="server\monitorServer\IMonitorCtl.cs" />
     <Compile Include="server\monitorServer\LaserMonitorCtl.cs" />

+ 170 - 24
parkMonitor/server/CoreThread/CoreThreadTest.cs

@@ -7,17 +7,66 @@ using parkMonitor.DB;
 using parkMonitor.LOG;
 using parkMonitor.entity;
 using parkMonitor.model;
+using System.Configuration;
+using System.Threading;
 
 namespace parkMonitor.server.CoreThread
 {
-    class CoreThreadTest:IEquipments,ICoreThreadDoWorking
+    class CoreThreadTest : IEquipments, ICoreThreadDoWorking
     {
+        string startRobot_address;//启动机械手地址
+        string parkingSpaceID_address;
+        string parkingSpaceX_address;
+        string parkingSpaceY_address;
+        string parkingSpaceZ_address;
+        int equipmentStatus_address;//设备总控状态地址
+        int park_completed_address;//停车完成地址
+        int parkingEntX;//入口
+        int parkingEntY;
+        int parkingEntZ;
+        string park_command_address;//启动激光
+        //int vehicleTypeLength_address;
+        //int vehicleTypeWidth_address;
+        //int vehicleTypeHeight_address;
+        //int vehicleTypeWheelbase_address;
+        string parking_startRobot_address;//停车启动
+        int fetch_completed_address;
         //获取PLC句柄
         IEquipments PLC = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.PLC);
         //获取队列句柄
-        QueuingThread queuingThread = new QueuingThread();
+        IEquipments queuingThread = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.Queue);
+        //QueuingThread queuingThread = new QueuingThread();
+        //数据库
+        DBOperation oper = new DBOperation();
+        //车位分配
+        CEntrance c = new CEntrance();
+        AllotParkingSpace aps = new AllotParkingSpace();
+
         public static CoreThread ins = new CoreThread();
-        string[] equipNames = new string[] { EquipmentName.PLC, EquipmentName.NumMachine,EquipmentName.Web};
+        string[] equipNames = new string[] { EquipmentName.PLC, EquipmentName.NumMachine, EquipmentName.Web, EquipmentName.Queue };
+
+        public CoreThreadTest()
+        {
+            startRobot_address = ConfigurationManager.AppSettings["startRobot_address"];
+            parkingSpaceID_address = ConfigurationManager.AppSettings["parkingSpaceID_address"];
+            parkingSpaceX_address = ConfigurationManager.AppSettings["parkingSpaceX_address"];
+            parkingSpaceY_address = ConfigurationManager.AppSettings["parkingSpaceY_address"];
+            parkingSpaceZ_address = ConfigurationManager.AppSettings["parkingSpaceZ_address"];
+            equipmentStatus_address = Convert.ToInt32(ConfigurationManager.AppSettings["equipmentStatus_address"]);
+            park_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["park_completed_address"]);
+            parkingEntX = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntX"]);
+            parkingEntY = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntY"]);
+            parkingEntZ = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntZ"]);
+            //启动激光
+            park_command_address = ConfigurationManager.AppSettings["park_command_address"];
+            ////激光测量数据
+            //vehicleTypeLength_address = Convert.ToInt32(ConfigurationManager.AppSettings["vehicleTypeLength_address"]);
+            //vehicleTypeWidth_address = Convert.ToInt32(ConfigurationManager.AppSettings["vehicleTypeWidth_address"]);
+            //vehicleTypeHeight_address = Convert.ToInt32(ConfigurationManager.AppSettings["vehicleTypeHeight_address"]);
+            //vehicleTypeWheelbase_address = Convert.ToInt32(ConfigurationManager.AppSettings["vehicleTypeWheelbase_address"]);
+            //取车完成
+            fetch_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["fetch_completed_address"]);
+        }
 
         public void Start()
         {
@@ -31,7 +80,7 @@ namespace parkMonitor.server.CoreThread
                 }
             }
 
-          
+
             //监听总状态改变消息
             //由监控线程发出
             AsyncCmdServer.ins.listen(AsyncCmdType.TotalStatusChanged, (AlarmStatus type) =>
@@ -67,34 +116,131 @@ namespace parkMonitor.server.CoreThread
 
         public void BeginWorking()
         {
-            PLCMessage PLCMsg;
-            Command queueCmd;
-            Task PLCTask = Task.Factory.StartNew(() =>
+            while (true)
             {
-                while (true)
+                PLCMessage PLCMsg = null;
+                Command queueCmd = null;
+                //等待PLC设备就绪状态
+                Task PLCTask = Task.Factory.StartNew(() =>
                 {
-                    PLCMsg = (PLCMessage)PLC.GetMessage();
-                    int normalStatus = Convert.ToInt32(PLCMsg.plcList[0].Value);
-                    //设备总控状态
-                    if (normalStatus == 1)
+                    while (true)
                     {
-                        break;
+                        PLCMsg = (PLCMessage)PLC.GetMessage();
+                        int normalStatus = Convert.ToInt32(PLCMsg.plcList[equipmentStatus_address].Value);
+                        //设备总控状态
+                        if (normalStatus == 1)
+                        {
+                            break;
+                        }
                     }
-                }
-            });
-            Task queueTask = Task.Factory.StartNew(() =>
-            {
-                while (true)
+                });
+                //等待号牌资源
+                Task queueTask = Task.Factory.StartNew(() =>
                 {
-                    queueCmd = (Command)queuingThread.GetMessage();
-                    if (queueCmd != null)
+                    while (true)
                     {
-                        break;
+                        queueCmd = (Command)queuingThread.GetMessage();
+                        if (queueCmd != null)
+                        {
+                            break;
+                        }
                     }
+                });
+                Task.WaitAll(PLCTask, queueTask);
+
+                if (queueCmd.commandType == 'f')
+                {
+                    Vehicle vehiclelist = oper.GetVehicle(queueCmd.LicenseNum);
+                    int parkingSpaceID = vehiclelist.parkingSpaceID;
+                    int garageID = vehiclelist.garageID;
+                    Fetching_Space fslist = oper.GetFetchingSpace(parkingSpaceID, garageID);
+                    int parkingSpaceX = fslist.parkingSpaceX;
+                    int parkingSpaceY = fslist.parkingSpaceY;
+                    int parkingSpaceZ = fslist.parkingSpaceZ;
+                    string startRobot = "1";
+                    PLC.SetMessage(new PLCNode(startRobot_address, Convert.ToString(startRobot)));
+                    PLC.SetMessage(new PLCNode(parkingSpaceID_address, Convert.ToString(parkingSpaceID)));
+                    PLC.SetMessage(new PLCNode(parkingSpaceX_address, Convert.ToString(parkingSpaceX)));
+                    PLC.SetMessage(new PLCNode(parkingSpaceY_address, Convert.ToString(parkingSpaceY)));
+                    PLC.SetMessage(new PLCNode(parkingSpaceZ_address, Convert.ToString(parkingSpaceZ)));
+                    //等待PLC取车完成信号
+                    Task signalFromPLC = Task.Factory.StartNew(() =>
+                    {
+                        while (true)
+                        {
+                            Thread.Sleep(2000);
+                            PLCMsg = (PLCMessage)PLC.GetMessage();
+                            int fetchingStatus = Convert.ToInt32(PLCMsg.plcList[fetch_completed_address].Value);
+                            //取车完成信号
+                            if (fetchingStatus == 1)
+                            {
+                                //fetchingStatus = 0;
+                                //PLC.SetMessage(new PLCNode(Convert.ToString(park_completed_address), Convert.ToString(fetchingStatus)));
+                                break;
+                            }
+                        }
+                    });
+                    Task.WaitAll(signalFromPLC);
+                    //数据库更新
                 }
-            });
-            Task.WaitAll(PLCTask, queueTask);
-            //if(queueCmd.command='f')
+
+                if (queueCmd.commandType == 's')
+                {
+                    c.parkingEntX = parkingEntX;
+                    c.parkingEntY = parkingEntY;
+                    c.parkingEntZ = parkingEntZ;
+                    Parking_Space ppp = new Parking_Space();
+                    ppp = aps.MallocParkingSpace(c);//得到车位
+                    int parkingSpaceID = ppp.parkingSpaceID;
+                    //int garageID = ppp.garageID;
+                    string numberPlate = queueCmd.LicenseNum;                    
+                    int userID = Convert.ToInt32(queueCmd.userID);
+                    int garageID = queueCmd.garageID;
+                    string realParkTime = queueCmd.TimeRecord;
+                    int parkingRecordsID = oper.InsertToParkingRecords(userID, numberPlate, parkingSpaceID, garageID, 3, realParkTime);//插入停车记录表
+                    string startLaser= "1";
+                    PLC.SetMessage(new PLCNode(park_command_address, Convert.ToString(startLaser)));//启动激光
+                   Task dataFromLaser = Task.Factory.StartNew(() =>
+                    {
+                        while (true)
+                        {
+                            PLCMsg = (PLCMessage)PLC.GetMessage();
+                            if (PLCMsg!=null)
+                            {
+                                if (PLCMsg.laser1.data != null)
+                                {
+                                    break;
+                                }
+                            }
+                        }
+                    });
+                   Task.WaitAll(dataFromLaser);
+                   int centerX;
+                   int centerY;
+                   int angleA;
+                   int length;
+                   int width;
+                   int height;
+                   if (PLCMsg.laser1.status == 0 || PLCMsg.laser1.status == 3)
+                   {
+                       centerX = PLCMsg.laser1.data.centerX;
+                       centerY = PLCMsg.laser1.data.centerY;
+                       angleA = PLCMsg.laser1.data.angleA;
+                       length = PLCMsg.laser1.data.length;
+                       width = PLCMsg.laser1.data.width;
+                       height = PLCMsg.laser1.data.height;
+                   }
+                   //int vehicleTypeLength = Convert.ToInt32(PLCMsg.plcList[vehicleTypeLength_address].Value);
+                   //int vehicleTypeWidth = Convert.ToInt32(PLCMsg.plcList[vehicleTypeWidth_address].Value);
+                   //int vehicleTypeHeight = Convert.ToInt32(PLCMsg.plcList[vehicleTypeHeight_address].Value);
+                   //int vehicleTypeWheelbase = Convert.ToInt32(PLCMsg.plcList[vehicleTypeWheelbase_address].Value);
+                   int vehicleTypeID = oper.getVehicleTypeID(numberPlate);
+                    //判断测量数据是否准确
+                   //bool isDataRight = oper.IsDataRight(vehicleTypeLength, vehicleTypeWidth, vehicleTypeHeight, vehicleTypeWheelbase, vehicleTypeID);
+
+
+                }
+            }
         }
 
         /// <summary>挂起</summary>