林豪 左 2 gadi atpakaļ
vecāks
revīzija
37478b1335

+ 1 - 1
OPP WCS.sln

@@ -26,7 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		.editorconfig = .editorconfig
 	EndProjectSection
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WCS.DataCollectionService", "Projects\永冠OPP\WCS.Service\WCS.DataCollectionService.csproj", "{0C1638C8-68C1-4493-A731-186E58CEC4F0}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WCS.DataCollectionService2D", "Projects\永冠OPP\WCS.Service\WCS.DataCollectionService2D.csproj", "{0C1638C8-68C1-4493-A731-186E58CEC4F0}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logs", "Logs\Logs.csproj", "{31B6E0FC-524C-4B52-9088-6EA4690E6B36}"
 EndProject

+ 86 - 86
Projects/永冠OPP/WCS.Service/ProtocolProxy.cs

@@ -94,65 +94,65 @@ namespace WCS.Service
         //static ConcurrentQueue<PackInfo> Packs = new ConcurrentQueue<PackInfo>();
         private static Dictionary<string, Playerback> Clients = new Dictionary<string, Playerback>();
 
-        //private static RedisClient Redis;
+        private static RedisClient Redis;
 
-        public static RedisClient LiaotcRedis;
+        //public static RedisClient LiaotcRedis;
 
         //public static RedisClient YGWMS150Redis;
-        public static RedisClient YGWCS150Redis;
+        //public static RedisClient YGWCS150Redis;
 
         static ProtocolProxy()
         {
             MessagePackSerializer.DefaultOptions = StandardResolver.Options.WithCompression(MessagePackCompression.Lz4Block);
             //Redis = new RedisClient("192.168.249.120,password=123456,database=11");
 
-            //#region 公用云服务器
+            #region 公用云服务器
 
-            //Redis = new RedisClient("212.64.66.35,database=10");
-            //Redis.Serialize = obj =>
-            //{
-            //    var bytes = MessagePackSerializer.Serialize(obj);
-            //    return bytes;
-            //};
-            //Redis.DeserializeRaw = (bytes, type) =>
-            //{
-            //    var obj = MessagePackSerializer.Deserialize(type, bytes);
-            //    return obj;
-            //};
-
-            //#endregion 公用云服务器
-
-            #region 私用云服务器
-
-            LiaotcRedis = new RedisClient("liaotc.com,database=10");
-            LiaotcRedis.Serialize = obj =>
+            Redis = new RedisClient("212.64.66.35,database=10");
+            Redis.Serialize = obj =>
             {
                 var bytes = MessagePackSerializer.Serialize(obj);
                 return bytes;
             };
-            LiaotcRedis.DeserializeRaw = (bytes, type) =>
+            Redis.DeserializeRaw = (bytes, type) =>
             {
                 var obj = MessagePackSerializer.Deserialize(type, bytes);
                 return obj;
             };
 
-            #endregion 用云服务器
+            #endregion 公用云服务器
 
-            #region 永冠服务
+            //#region 私用云服务器
 
-            YGWCS150Redis = new RedisClient("192.168.249.150,password=123456,database=10");
-            YGWCS150Redis.Serialize = obj =>
-            {
-                var bytes = MessagePackSerializer.Serialize(obj);
-                return bytes;
-            };
-            YGWCS150Redis.DeserializeRaw = (bytes, type) =>
-            {
-                var obj = MessagePackSerializer.Deserialize(type, bytes);
-                return obj;
-            };
+            //LiaotcRedis = new RedisClient("liaotc.com,database=10");
+            //LiaotcRedis.Serialize = obj =>
+            //{
+            //    var bytes = MessagePackSerializer.Serialize(obj);
+            //    return bytes;
+            //};
+            //LiaotcRedis.DeserializeRaw = (bytes, type) =>
+            //{
+            //    var obj = MessagePackSerializer.Deserialize(type, bytes);
+            //    return obj;
+            //};
+
+            //#endregion 私用云服务器
 
-            #endregion 永冠服务
+            //#region 永冠服务
+
+            //YGWCS150Redis = new RedisClient("192.168.249.150,password=123456,database=10");
+            //YGWCS150Redis.Serialize = obj =>
+            //{
+            //    var bytes = MessagePackSerializer.Serialize(obj);
+            //    return bytes;
+            //};
+            //YGWCS150Redis.DeserializeRaw = (bytes, type) =>
+            //{
+            //    var obj = MessagePackSerializer.Deserialize(type, bytes);
+            //    return obj;
+            //};
+
+            //#endregion 永冠服务
         }
 
         public override void Publish(string code, WCS_PROTOCOLDATA obj)
@@ -237,72 +237,72 @@ namespace WCS.Service
                     p.SetValue(pack, coll);
                 }
 
-                //var sw = new Stopwatch();
-                //sw.Start();
-                //Redis.Set(nameof(DeviceDataPack), pack);
-                //sw.Stop();
-                //Console.ForegroundColor = ConsoleColor.Blue;
-                //Console.WriteLine($"Redis耗时{sw.ElapsedMilliseconds}");
-                //Console.ResetColor();
-
-                var se = new Stopwatch();
-                se.Start();
-                YGWCS150Redis.Set(nameof(DeviceDataPack), pack);
-                se.Stop();
+                var sw = new Stopwatch();
+                sw.Start();
+                Redis.Set(nameof(DeviceDataPack), pack);
+                sw.Stop();
                 Console.ForegroundColor = ConsoleColor.Blue;
-                Console.WriteLine($"YGWCS150Redis耗时{se.ElapsedMilliseconds}");
+                Console.WriteLine($"Redis耗时{sw.ElapsedMilliseconds}");
                 Console.ResetColor();
 
-                var sr = new Stopwatch();
-                sr.Start();
-                LiaotcRedis.Set(nameof(DeviceDataPack), pack);
-                sr.Stop();
-                Console.ForegroundColor = ConsoleColor.Blue;
-                Console.WriteLine($"LiaotcRedis耗时{sr.ElapsedMilliseconds}");
-                Console.ResetColor();
-                /////
-                //var st = new Stopwatch();
-                //st.Start();
-                //Redis.RPush("Packs", pack);
-                //st.Stop();
+                //var se = new Stopwatch();
+                //se.Start();
+                //YGWCS150Redis.Set(nameof(DeviceDataPack), pack);
+                //se.Stop();
                 //Console.ForegroundColor = ConsoleColor.Blue;
-                //Console.WriteLine($"Redis耗时{st.ElapsedMilliseconds}");
+                //Console.WriteLine($"YGWCS150Redis耗时{se.ElapsedMilliseconds}");
                 //Console.ResetColor();
 
-                var sy = new Stopwatch();
-                sy.Start();
-                YGWCS150Redis.RPush("Packs", pack);
-                sy.Stop();
+                //var sr = new Stopwatch();
+                //sr.Start();
+                //LiaotcRedis.Set(nameof(DeviceDataPack), pack);
+                //sr.Stop();
+                //Console.ForegroundColor = ConsoleColor.Blue;
+                //Console.WriteLine($"LiaotcRedis耗时{sr.ElapsedMilliseconds}");
+                //Console.ResetColor();
+                /////
+                var st = new Stopwatch();
+                st.Start();
+                Redis.RPush("Packs", pack);
+                st.Stop();
                 Console.ForegroundColor = ConsoleColor.Blue;
-                Console.WriteLine($"YGWCS150Redis耗时{sy.ElapsedMilliseconds}");
+                Console.WriteLine($"Redis耗时{st.ElapsedMilliseconds}");
                 Console.ResetColor();
 
-                var su = new Stopwatch();
-                su.Start();
-                LiaotcRedis.RPush("Packs", pack);
-                su.Stop();
-                Console.ForegroundColor = ConsoleColor.Blue;
-                Console.WriteLine($"LiaotcRedis耗时{su.ElapsedMilliseconds}");
-                Console.ResetColor();
+                //var sy = new Stopwatch();
+                //sy.Start();
+                //YGWCS150Redis.RPush("Packs", pack);
+                //sy.Stop();
+                //Console.ForegroundColor = ConsoleColor.Blue;
+                //Console.WriteLine($"YGWCS150Redis耗时{sy.ElapsedMilliseconds}");
+                //Console.ResetColor();
+
+                //var su = new Stopwatch();
+                //su.Start();
+                //LiaotcRedis.RPush("Packs", pack);
+                //su.Stop();
+                //Console.ForegroundColor = ConsoleColor.Blue;
+                //Console.WriteLine($"LiaotcRedis耗时{su.ElapsedMilliseconds}");
+                //Console.ResetColor();
 
                 //Redis.RPush("Packs", pack);
                 //YGWCS150Redis.RPush("Packs", pack);
                 //LiaotcRedis.RPush("Packs", pack);
 
-                //if (Redis.LLen("Packs") > 100000)
-                //{
-                //    Redis.LTrim("Packs", 5000, -1);
-                //}
-
-                if (YGWCS150Redis.LLen("Packs") > 200000)
+                if (Redis.LLen("Packs") > 100000)
                 {
-                    YGWCS150Redis.LTrim("Packs", 20000, -1);
+                    Redis.LTrim("Packs", 5000, -1);
                 }
 
-                if (LiaotcRedis.LLen("Packs") > 100000)
-                {
-                    LiaotcRedis.LTrim("Packs", 5000, -1);
-                }
+                //if (YGWCS150Redis.LLen("Packs") > 200000)
+                //{
+                //    YGWCS150Redis.LTrim("Packs", 20000, -1);
+                //}
+
+                //if (LiaotcRedis.LLen("Packs") > 100000)
+                //{
+                //    LiaotcRedis.LTrim("Packs", 5000, -1);
+                //}
 
                 foreach (var data in AllDatas)
                 {

+ 0 - 0
Projects/永冠OPP/WCS.Service/WCS.DataCollectionService.csproj → Projects/永冠OPP/WCS.Service/WCS.DataCollectionService2D.csproj