Переглянути джерело

mxg:完善楼层缺失检查算法

mengxiangge 6 роки тому
батько
коміт
11d53a9bd8

+ 1 - 1
MBI/SAGA.MBI/Common/RegexConstPattern.cs

@@ -32,7 +32,7 @@ namespace SAGA.MBI.Common
 
         public const string IsRF = @"^RF(-saga)?$";
         public const string IsRFM = @"RFM\d*";
-        public const string IsOnground = @"^B\s*";
+        public const string IsOnground = @"^F\s*";
         public const string IsUnderground = @"^B\s*";
 
         public const string IsPhoneNumber = @"^1[3|4|5|7|8][0-9]\d{8}$";

+ 25 - 21
MBI/SAGA.MBI/ToolsData/ModeCheck/FloorMissCheck.cs

@@ -74,7 +74,7 @@ namespace SAGA.MBI.ToolsData.ModeCheck
                 {
                     var item0 = baseResults[i];
                     var item1 = baseResults[i + 1];
-                    if (item1.RFloorName == item0.RFloorName)
+                    if (item1.RPlanName == item0.RPlanName)
                     {
                         sequenceResult = false;
                         break;
@@ -128,7 +128,7 @@ namespace SAGA.MBI.ToolsData.ModeCheck
                     if (rbase == null)
                         continue;
 
-                    rowN.AddCell(0, rbase.RFloorName, style);
+                    rowN.AddCell(0, rbase.RPlanName, style);
                     rowN.AddCell(1, rbase.RFileName, style);
                     rowN.AddCell(2, rbase.RPath, style);
                     rowN.AddCell(3, rbase.RPlanName, style);
@@ -158,8 +158,8 @@ namespace SAGA.MBI.ToolsData.ModeCheck
         private static List<string> m_RuleFloorNames = new List<string> { RegexConstPattern.IsRF, RegexConstPattern.IsRFM, RegexConstPattern.IsOnground, RegexConstPattern.IsUnderground };
         public int Compare(SagaSignCheckResult x, SagaSignCheckResult y)
         {
-            string floorName0 = x.RFloorName;
-            string floorName1 = y.RFloorName;
+            string floorName0 = x.RPlanName;
+            string floorName1 = y.RPlanName;
             int result = 0;
             if (floorName0 == floorName1)
             {
@@ -194,10 +194,12 @@ namespace SAGA.MBI.ToolsData.ModeCheck
         {
             var str = Regex.Replace(name.Replace('M', '.'), @"[^0-9|.]+", "");
             var i = str.ToDouble();
+            if (Regex.IsMatch(name, RegexConstPattern.IsSandwich))
+                i = i + 0.001;
             //如果是地下,序号为负
             if (IsUnderground(name))
                 i = i * -1;
-            return i;
+            return i.Round(3);
         }
 
         private static bool IsRFoRFM(string name)
@@ -221,31 +223,33 @@ namespace SAGA.MBI.ToolsData.ModeCheck
         public static bool IsContinuous(SagaSignCheckResult x, SagaSignCheckResult y)
         {
             bool result = false;
-            string floorName0 = x.RFloorName;
-            string floorName1 = y.RFloorName;
+            string floorName0 = x.RPlanName;
+            string floorName1 = y.RPlanName;
             double i0 = GetFloorNameIndex(floorName0);
             double i1 = GetFloorNameIndex(floorName1);
             //有一个RF或RFM,判断为连续
-            if (IsRFoRFM(floorName0) || IsRFoRFM(floorName0))
+            if (IsRFoRFM(floorName0) || IsRFoRFM(floorName1))
+            {
                 result = true;
-            var diff = i0 - i1;
-            if ((diff).IsThanEq(0))
+            }
+            else
             {
-                if (diff.IsThan(2))
-                {
-                    result = false;
-                }
-                else if (diff.IsEqual(2))
-                {
-                    result = IsUpground(floorName0) && IsUnderground(floorName1);
-                }
-                else
+                var diff = i0 - i1;
+                if ((diff).IsBetween(0, 2))
                 {
-                    result = true;
+                    if (diff.IsThan(1))
+                    {
+                        result = IsUpground(floorName0) && IsUnderground(floorName1);
+                    }
+                    else
+                    {
+                        result = true;
+                    }
                 }
-            }
 
 
+            }
+
             return result;
         }
     }