Sfoglia il codice sorgente

Merge remote-tracking branch 'yct_v2_in_jw's_remote/dev' into dev

# Conflicts:
#	PLCLinker/centralController/sdk/PLC/PLCS7.dll
#	PLCLinker/newPLCConnector/PLC/PLCS7.dll
#	PLCLinker/newPLCConnector/PLC/PLCS7.xml
#	PLCLinker/newPLCS7/PLCS7.cs
yc_t 6 anni fa
parent
commit
e8c53d2944

+ 1 - 1
PLCLinker/centralController/App.config

@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <startup>
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>

+ 2 - 2
PLCLinker/centralController/WebServer/WebServer.cs

@@ -311,8 +311,8 @@ namespace centralController.WebServer
                                 {
                                     try
                                     {
-                                        //id = 1;
-                                        id = Monitor.Monitor.numMachineLinker.GetLicenseID(msg.context.Split('.')[2]);
+                                        id = 1;
+                                        //id = Monitor.Monitor.numMachineLinker.GetLicenseID(msg.context.Split('.')[2]);
                                     }
                                     catch { Console.WriteLine("号牌截取异常"); }
                                 }

BIN
PLCLinker/centralController/sdk/PLC/PLCS7.dll


BIN
PLCLinker/newPLCConnector/PLC/PLCS7.dll


+ 9 - 9
PLCLinker/newPLCS7/PLCS7.cs

@@ -29,10 +29,10 @@ namespace PLCS7
     }
     public abstract class AbstractPLCLinker : IPLCS7
     {
-        //protected const int mainBlockOffset = 52;
-        protected const int parkingSpaceOffset = 18;
-        protected const int terminalLength = 46;
-        protected const int parkingSpaceLength = 48;
+        protected const int mainBlockOffset = 52;
+        protected const int parkingSpaceOffset = 22;
+        protected const int terminalLength = 50;
+        protected const int parkingSpaceLength = 56;
         /// <summary>
         /// PLC 连接状态flag
         /// </summary>
@@ -350,7 +350,7 @@ namespace PLCS7
                             if (ts.licenseCodeC != -1) { plc.WriteBytes(DataType.DataBlock, terminalDB, 16 + offset, BitConverter.GetBytes(BytesRevert(ts.licenseCodeC))); }
                             if (ts.licenseCodeD != -1) { plc.WriteBytes(DataType.DataBlock, terminalDB, 20 + offset, BitConverter.GetBytes(BytesRevert(ts.licenseCodeD))); }
                             if (ts.receiptNum != -1) { plc.WriteBytes(DataType.DataBlock, terminalDB, 24 + offset, BitConverter.GetBytes(BytesRevert(ts.receiptNum))); }
-                            if (ts.termHeartbeat != 0) { plc.WriteBytes(DataType.DataBlock, terminalDB, 44 + offset, BitConverter.GetBytes(BytesRevert(ts.termHeartbeat))); }
+                            if (ts.termHeartbeat != 0) { plc.WriteBytes(DataType.DataBlock, terminalDB, 48 + offset, BitConverter.GetBytes(BytesRevert(ts.termHeartbeat))); }
                         }
                     }
                     else if (msg.abstractPLCMsg.GetType().Equals(typeof(MainBlockStru)) && msg.whoami.Equals(PLCDataType.central))
@@ -358,10 +358,10 @@ namespace PLCS7
                         //只允许中控写入
                         MainBlockStru mbs = (MainBlockStru)msg.abstractPLCMsg;
                         //byte[] temp = BitConverter.GetBytes(BytesRevert(mbs.licenseReceived));
-                        if (mbs.centralHearbeat != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, 60, BitConverter.GetBytes(BytesRevert(mbs.centralHearbeat))); }
-                        if (mbs.licenseReceived != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, 52, BitConverter.GetBytes(BytesRevert(mbs.licenseReceived))); }
-                        if (mbs.bookParkCmd != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, 48, BitConverter.GetBytes(BytesRevert(mbs.bookParkCmd))); }
-                        if (mbs.bookFetchCmd != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, 50, BitConverter.GetBytes(BytesRevert(mbs.bookFetchCmd))); }
+                        if (mbs.centralHearbeat != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, mainBlockOffset + 8, BitConverter.GetBytes(BytesRevert(mbs.centralHearbeat))); }
+                        if (mbs.licenseReceived != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, mainBlockOffset, BitConverter.GetBytes(BytesRevert(mbs.licenseReceived))); }
+                        if (mbs.bookParkCmd != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, mainBlockOffset - 4, BitConverter.GetBytes(BytesRevert(mbs.bookParkCmd))); }
+                        if (mbs.bookFetchCmd != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, mainBlockOffset - 2, BitConverter.GetBytes(BytesRevert(mbs.bookFetchCmd))); }
                         if (mbs.processCompleted != (short)-1) { plc.WriteBytes(DataType.DataBlock, centralDB, 16, BitConverter.GetBytes(BytesRevert(mbs.processCompleted))); }
                         //ErrorCode ec = plc.WriteBytes(DataType.DataBlock, centralDB, mainBlockOffset, temp);
                         //if (!ec.Equals(ErrorCode.NoError)) { return false; }

+ 18 - 18
PLCLinker/newPLCS7/entity.cs

@@ -66,30 +66,30 @@ namespace PLCS7
         /// <summary>
         /// X坐标
         /// </summary>
-        public short coordX;//PLC
+        public int coordX;//PLC, 36
         /// <summary>
         /// Y坐标
         /// </summary>
-        public short coordY;//PLC
+        public int coordY;//PLC,40
         /// <summary>
         /// 地感信号
         /// </summary>
-        public short groundStatus;
+        public short groundStatus;//44
         /// <summary>
         /// 启动对应号牌机
         /// </summary>
-        public short numMachineLaunch;
+        public short numMachineLaunch;//46
         /// <summary>
         /// 终端心跳
         /// </summary>
-        public short termHeartbeat;
+        public short termHeartbeat;//48
 
         public override string ToString()
         {
             return "[终端id(0):" + terminalID + ",终端状态(2):" + terminalStatus + ",按钮状态(4):" + btnStatus + ",终端指令(6):" + cmd + ",用户id(8):" + licenseCodeA + ","
                 + licenseCodeB + "," + licenseCodeC + "," + licenseCodeD + ",凭证号(24):" + receiptNum + ",支付状态(28):" + paymentStatus
-                + ",号牌验证(30):" + licVerification + ",停车费用(32):" + parkingFee + ",用户类型(34):" + userType + ",X坐标(36):" + coordX + ",Y坐标(38):" + coordY +
-                ",地感信号(40):" + groundStatus + ",启动号牌机(42):" + numMachineLaunch + ",终端心跳(44):" + termHeartbeat + "]";
+                + ",号牌验证(30):" + licVerification + ",停车费用(32):" + parkingFee + ",用户类型(34):" + userType + ",X坐标(36):" + coordX + ",Y坐标(40):" + coordY +
+                ",地感信号(44):" + groundStatus + ",启动号牌机(46):" + numMachineLaunch + ",终端心跳(48):" + termHeartbeat + "]";
         }
 
         public override bool Equals(object obj)
@@ -292,37 +292,37 @@ namespace PLCS7
         /// <summary>
         /// 楼层编号
         /// </summary>
-        public short floorNo;
-        public short coordX;
-        public short coordY;
+        public short floorNo;//8
+        public int coordX;//10
+        public int coordY;//14
         /// <summary>
         /// 凭证号
         /// </summary>
-        public int receiptNum;
+        public int receiptNum;//18
         /// <summary>
         /// 车位状态,0空位-1占用-2保留-3已预约-4故障
         /// </summary>
-        public short spaceStatus;
+        public short spaceStatus;//22
         /// <summary>
         /// 前轮距
         /// </summary>
-        public short frontWheelbase;
+        public short frontWheelbase;//24
         /// <summary>
         /// 后轮距
         /// </summary>
-        public short rearWheelbase;
+        public short rearWheelbase;//26
 
-        public int startTimeA;
+        public int startTimeA;//28
         public int startTimeB;
         public int startTimeC;
         public int endTimeA;
         public int endTimeB;
-        public int endTimeC;
+        public int endTimeC;//52
 
         public override string ToString()
         {
-            return "[车位编号(0):" + parkingSpace + ",长(2):" + length + ",宽(4):" + width + ",高(6):" + height + ",楼层(8):" + floorNo + ",X坐标(10):" + coordX + ",Y坐标(12):" + coordY + ",凭证号(14):" + receiptNum
-                + ",车位状态(16):" + spaceStatus + ",前轮距(18):" + frontWheelbase + ",后轮距(20):" + rearWheelbase + "]";
+            return "[车位编号(0):" + parkingSpace + ",长(2):" + length + ",宽(4):" + width + ",高(6):" + height + ",楼层(8):" + floorNo + ",X坐标(10):" + coordX + ",Y坐标(14):" + coordY + ",凭证号(18):" + receiptNum
+                + ",车位状态(22):" + spaceStatus + ",前轮距(24):" + frontWheelbase + ",后轮距(26):" + rearWheelbase + "]";
         }
         public override int GetHashCode()
         {