lijun 8 months ago
parent
commit
881b51a2b8
2 changed files with 7 additions and 3 deletions
  1. 3 1
      TestPoint/Program.cs
  2. 4 2
      TestPoint/ScadaService.cs

+ 3 - 1
TestPoint/Program.cs

@@ -1,4 +1,6 @@
-using System.Windows.Forms;
+using NewLife.Reflection;
+using System;
+using System.Windows.Forms;
 
 
 namespace ScadaTcpService
 namespace ScadaTcpService
 {
 {

+ 4 - 2
TestPoint/ScadaService.cs

@@ -7,6 +7,7 @@ using NewLife;
 using NewLife.Data;
 using NewLife.Data;
 using NewLife.Log;
 using NewLife.Log;
 using NewLife.Net;
 using NewLife.Net;
+using NewLife.Reflection;
 using NewLife.Serialization;
 using NewLife.Serialization;
 using OPC_Client;
 using OPC_Client;
 
 
@@ -29,6 +30,7 @@ namespace ScadaTcpService
             };
             };
             _tcpServer.Start();
             _tcpServer.Start();
             CreateScada();
             CreateScada();
+         
         }
         }
 
 
 
 
@@ -67,7 +69,7 @@ namespace ScadaTcpService
                             .ToList();
                             .ToList();
                     var sendData = new
                     var sendData = new
                     {
                     {
-                        cmd = "getAllData",
+                        cmd = "sendData",
                         data = dataList
                         data = dataList
                     };
                     };
                     if (_tcpServer.SessionCount >= 1)
                     if (_tcpServer.SessionCount >= 1)
@@ -116,7 +118,7 @@ namespace ScadaTcpService
                     c.id,
                     c.id,
                     c.quality,
                     c.quality,
                     c.DateTime1
                     c.DateTime1
-                })
+                }).ToList()
             };
             };
             Send(new Packet(data.ToJson().GetBytes()));
             Send(new Packet(data.ToJson().GetBytes()));
             base.OnConnected();
             base.OnConnected();