Pārlūkot izejas kodu

Update orm
Update Analyzer UI

Zixuan 11 stundas atpakaļ
vecāks
revīzija
b0369bb3b3

+ 11 - 2
Analizer/ProximaAnalizer/Controls/AlarmPicker.xaml

@@ -16,9 +16,18 @@
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid Background="White">
-        <Button BorderBrush="{StaticResource DarkBorderColor}"  Click="Pop_Click" BorderThickness="1" HorizontalContentAlignment="Left" Background="Transparent">
-            <TextBlock Background="Transparent" Text="{Binding SelectedAlarm.Value}" Margin="4,0,0,0" VerticalAlignment="Center"/>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition Width="0"/>
+            <ColumnDefinition Width="auto"/>
+        </Grid.ColumnDefinitions>
+        <ScrollViewer Height="64" HorizontalContentAlignment="Left">
+            <TextBlock  Background="Transparent" Text="{Binding SelectedAlarm.Value}" Margin="4,0,0,0" VerticalAlignment="Center"/>
+        </ScrollViewer>
+        <Button Grid.Column="2" BorderBrush="{StaticResource DarkBorderColor}"  Click="Pop_Click" BorderThickness="0"  Background="Transparent">
+            <Image Source="{StaticResource Icon_Expander}" Width="20"></Image>
         </Button>
+        
         <Popup PopupAnimation="Slide" StaysOpen="False" IsOpen="{Binding ElementName=This, Path=IsPopOpen, Mode=TwoWay}">
             <Border BorderBrush="{StaticResource DarkBorderColor}" BorderThickness="1">
                 <Grid  Background="White">

+ 2 - 2
Analizer/ProximaAnalizer/ViewModels/LoadingViewModel.cs

@@ -20,8 +20,8 @@ internal partial class LoadingViewModel : ObservableObject
         //Thread.Sleep(2000);
         string dbString = "Database=TINReal;Password=123456;Host=10.4.6.87;Username=postgres;Persist Security Info=True";
 
-        this._sqlSugarCustom.Initialize(null);
-        if(!this._sqlSugarCustom.Open(dbString, SqlSugar.DbType.PostgreSQL,true))
+        this._sqlSugarCustom.Initialize();
+        if(!this._sqlSugarCustom.Open(dbString, DbType.PostgreSQL,true))
         {
             MessageBox.Show("Connect to db 10.4.6.87 Failed");
             App.Current.Shutdown();

+ 1 - 1
DataBase/DB_Proxima/RemoteToLocal.cs

@@ -17,7 +17,7 @@ public class RemoteToLocal
             return false;
         _orm = new SqlSugarCustom();
         _orm.CreateDataBase(dbName);
-        _orm.Initialize(null);
+        _orm.Initialize();
         string dbString = $"Database={dbName};Password={password};Host={host};Username={username};Persist Security Info=True";
         return _orm.Open(dbString, DbType.PostgreSQL, true);
     }

+ 60 - 99
DataBase/SqlSugarORM/SqlSugarCustom.cs

@@ -1,25 +1,14 @@
-using ORM;
-using SqlSugar;
+using SqlSugar;
 using System.Linq.Expressions;
-using Universal;
 
 namespace SqlSugarORM;
-public class SqlSugarCustom : IORM
+public class SqlSugarCustom
 {
-    public SqlSugarCustom()
-    {
-        this._logQueue = new(LogQueueHandler);
-    }
-
+    public SqlSugarClient? Client { get; private set; }
     #region Internal
-    private IOrmProvider? _provider;
-    private SqlSugarClient? _Client;
+
     private bool disposedValue;
-    private readonly EventQueue<(string, DateTime, LogLevel)> _logQueue;
-    private void LogQueueHandler((string log, DateTime time, LogLevel level) logItem)
-    {
-        _provider?.Log(logItem.log, logItem.time, logItem.level);
-    }
+
     private void Config(SqlSugarClient client)
     {
         client.Aop.OnLogExecuting = SqlLog;
@@ -27,36 +16,31 @@ public class SqlSugarCustom : IORM
     private void SqlLog(string sql, SugarParameter[] paras)
     {
         string log = UtilMethods.GetNativeSql(sql, paras);
-        _logQueue?.Enqueue(new(log, DateTime.Now, LogLevel.Original));
     }
     #endregion
 
-    bool IORM.Initialize(IOrmProvider? notify)
+    public bool Initialize()
     {
-        if (_provider is not null)
-            return false;
-
-        _provider = notify;
 
         return true;
     }
 
-    bool IORM.Open(string connectionString, ORM.DbType dbType, bool isAutoConnection)
+    public bool Open(string connectionString, SqlSugar.DbType dbType, bool isAutoConnection)
     {
-        if (this._Client is not null)
+        if (this.Client is not null)
             return false;
 
         ConnectionConfig config = new()
         {
             ConnectionString = connectionString,
-            DbType = (SqlSugar.DbType)dbType,
+            DbType = dbType,
             IsAutoCloseConnection = isAutoConnection
         };
         try
         {
             SqlSugarClient Db = new(config, Config);
             Db.DbMaintenance.CreateDatabase();
-            this._Client = Db;
+            this.Client = Db;
         }
         catch
         {
@@ -65,9 +49,9 @@ public class SqlSugarCustom : IORM
         return true;
     }
 
-    bool IORM.CreateDataBase(string dbName)
+    public bool CreateDataBase(string dbName)
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         if (string.IsNullOrEmpty(dbName))
@@ -75,32 +59,30 @@ public class SqlSugarCustom : IORM
 
         try
         {
-            this._Client.DbMaintenance.CreateDatabase(dbName);
+            this.Client.DbMaintenance.CreateDatabase(dbName);
         }
         catch
         {
-            _logQueue?.Enqueue(new($"Create DB {dbName} Failed", DateTime.Now, LogLevel.Error));
             return false;
         }
 
         return true;
     }
 
-    bool IORM.CreateTable<T>(string? tableName)
+    public bool CreateTable<T>(string? tableName)
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         try
         {
             if (string.IsNullOrEmpty(tableName))
-                this._Client.CodeFirst.InitTables<T>();
+                this.Client.CodeFirst.InitTables<T>();
             else
-                this._Client.CodeFirst.As(typeof(T), tableName).InitTables<T>();
+                this.Client.CodeFirst.As(typeof(T), tableName).InitTables<T>();
         }
         catch
         {
-            _logQueue?.Enqueue(new($"Create Table {tableName} Failed", DateTime.Now, LogLevel.Error));
             return false;
         }
 
@@ -109,17 +91,16 @@ public class SqlSugarCustom : IORM
     }
 
 
-    bool IORM.Insert<T>(T data)
+    public bool Insert<T>(T data) where T : class, new()
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
         try
         {
-            this._Client.Insertable(data).ExecuteCommand();
+            this.Client.Insertable(data).ExecuteCommand();
         }
         catch
         {
-            _logQueue?.Enqueue(new($"Insert {data.ToString} Failed", DateTime.Now, LogLevel.Error));
             return false;
         }
 
@@ -127,23 +108,19 @@ public class SqlSugarCustom : IORM
         return true;
     }
 
-    bool IORM.Insert<T>(string tablename, T data)
+    public bool Insert<T>(string tablename, T data) where T : class, new()
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
         try
         {
             if (string.IsNullOrEmpty(tablename))
-                this._Client.Insertable(data).ExecuteCommand();
+                this.Client.Insertable(data).ExecuteCommand();
             else
-                this._Client.Insertable(data).AS(tablename).ExecuteCommand();
+                this.Client.Insertable(data).AS(tablename).ExecuteCommand();
         }
         catch
         {
-            if (string.IsNullOrEmpty(tablename))
-                _logQueue?.Enqueue(new($"Insert {data.ToString} Failed", DateTime.Now, LogLevel.Error));
-            else
-                _logQueue?.Enqueue(new($"Insert {data.ToString} to table {tablename} Failed", DateTime.Now, LogLevel.Error));
             return false;
         }
 
@@ -151,29 +128,28 @@ public class SqlSugarCustom : IORM
     }
 
 
-    async Task<bool> IORM.Query<T>(Action<List<T>> results)
+    public async Task<bool> Query<T>(Action<List<T>> results)
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         return await Task<bool>.Factory.StartNew(() =>
         {
             try
             {
-                results?.Invoke(this._Client.Queryable<T>().ToList());
+                results?.Invoke(this.Client.Queryable<T>().ToList());
             }
             catch
             {
-                _logQueue?.Enqueue(new($"Query {typeof(T)} Failed", DateTime.Now, LogLevel.Error));
                 return false;
             }
             return true;
         });
     }
 
-    async Task<bool> IORM.Query<T>(string tableName, Action<List<T>> results)
+    public async Task<bool> Query<T>(string tableName, Action<List<T>> results)
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         return await Task<bool>.Factory.StartNew(() =>
@@ -181,30 +157,29 @@ public class SqlSugarCustom : IORM
             try
             {
                 if (string.IsNullOrEmpty(tableName))
-                    results?.Invoke(this._Client.Queryable<T>().ToList());
+                    results?.Invoke(this.Client.Queryable<T>().ToList());
                 else
-                    results?.Invoke(this._Client.Queryable<T>().AS(tableName).ToList());
+                    results?.Invoke(this.Client.Queryable<T>().AS(tableName).ToList());
             }
             catch
             {
-                _logQueue?.Enqueue(new($"Query {typeof(T)} Failed", DateTime.Now, LogLevel.Error));
                 return false;
             }
             return true;
         });
     }
 
-    bool IORM.Query<T>(string tableName, out List<T>? results)
+    public bool Query<T>(string tableName, out List<T>? results)
     {
         results = null;
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         try
         {
             results = string.IsNullOrEmpty(tableName) ?
-                      this._Client.Queryable<T>().ToList() :
-                      this._Client.Queryable<T>().AS(tableName).ToList();
+                      this.Client.Queryable<T>().ToList() :
+                      this.Client.Queryable<T>().AS(tableName).ToList();
         }
         catch
         {
@@ -214,15 +189,15 @@ public class SqlSugarCustom : IORM
         return true;
     }
 
-    bool IORM.Query<T>(out List<T>? results)
+    public bool Query<T>(out List<T>? results)
     {
         results = null;
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         try
         {
-            results = this._Client.Queryable<T>().ToList();
+            results = this.Client.Queryable<T>().ToList();
         }
         catch
         {
@@ -232,17 +207,17 @@ public class SqlSugarCustom : IORM
         return true;
     }
 
-    bool IORM.Query<T>(string tableName, Expression<Func<T, bool>> expression, out List<T>? results)
+    public bool Query<T>(string tableName, Expression<Func<T, bool>> expression, out List<T>? results)
     {
         results = default;
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         try
         {
             results = string.IsNullOrEmpty(tableName) ?
-                this._Client.Queryable<T>().Where(expression).ToList() :
-                this._Client.Queryable<T>().AS(tableName).Where(expression).ToList();
+                this.Client.Queryable<T>().Where(expression).ToList() :
+                this.Client.Queryable<T>().AS(tableName).Where(expression).ToList();
         }
         catch
         {
@@ -254,29 +229,28 @@ public class SqlSugarCustom : IORM
     }
 
 
-    async Task<bool> IORM.Query<T>(Expression<Func<T, bool>> expression, Action<List<T>> results)
+    public async Task<bool> Query<T>(Expression<Func<T, bool>> expression, Action<List<T>> results)
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         return await Task<bool>.Factory.StartNew(() =>
             {
                 try
                 {
-                    results?.Invoke(this._Client.Queryable<T>().Where(expression).ToList());
+                    results?.Invoke(this.Client.Queryable<T>().Where(expression).ToList());
                 }
                 catch
                 {
-                    _logQueue?.Enqueue(new($"Query {typeof(T)} Failed", DateTime.Now, LogLevel.Error));
                     return false;
                 }
                 return true;
             });
     }
 
-    async Task<bool> IORM.Query<T>(string tableName, Expression<Func<T, bool>> expression, Action<List<T>> results)
+    public async Task<bool> Query<T>(string tableName, Expression<Func<T, bool>> expression, Action<List<T>> results)
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         return await Task<bool>.Factory.StartNew(() =>
@@ -284,16 +258,12 @@ public class SqlSugarCustom : IORM
               try
               {
                   if (string.IsNullOrEmpty(tableName))
-                      results?.Invoke(this._Client.Queryable<T>().Where(expression).ToList());
+                      results?.Invoke(this.Client.Queryable<T>().Where(expression).ToList());
                   else
-                      results?.Invoke(this._Client.Queryable<T>().AS(tableName).Where(expression).ToList());
+                      results?.Invoke(this.Client.Queryable<T>().AS(tableName).Where(expression).ToList());
               }
               catch
               {
-                  if (string.IsNullOrEmpty(tableName))
-                      _logQueue?.Enqueue(new($"Query {typeof(T)} Failed", DateTime.Now, LogLevel.Error));
-                  else
-                      _logQueue?.Enqueue(new($"Query {typeof(T)} from Table {tableName} Failed", DateTime.Now, LogLevel.Error));
                   return false;
               }
 
@@ -301,13 +271,13 @@ public class SqlSugarCustom : IORM
           });
     }
 
-    bool IORM.Delete<T>(string tableName, Expression<Func<T, bool>> expression)
+    public bool Delete<T>(string tableName, Expression<Func<T, bool>> expression) where T : class, new()
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
         try
         {
-            this._Client.Deleteable<T>().AS(tableName).Where(expression).ExecuteCommand();
+            this.Client.Deleteable<T>().AS(tableName).Where(expression).ExecuteCommand();
         }
         catch
         {
@@ -316,30 +286,26 @@ public class SqlSugarCustom : IORM
         return true;
     }
 
-    bool IORM.AddOrUpdate<T>(string tableName, T data, Expression<Func<T, bool>> expression)
+    public bool AddOrUpdate<T>(string tableName, T data, Expression<Func<T, bool>> expression) where T : class, new()
     {
-        if (this._Client is null)
+        if (this.Client is null)
             return false;
 
         try
         {
             if (string.IsNullOrEmpty(tableName))
             {
-                if (this._Client.Updateable(data).Where(expression).ExecuteCommand() == 0)
-                    return (this as IORM).Insert(data);
+                if (this.Client.Updateable(data).Where(expression).ExecuteCommand() == 0)
+                    return this.Insert(data);
             }
             else
             {
-                if (this._Client.Updateable(data).Where(expression).AS(tableName).ExecuteCommand() == 0)
-                    return (this as IORM).Insert(tableName, data);
+                if (this.Client.Updateable(data).Where(expression).AS(tableName).ExecuteCommand() == 0)
+                    return this.Insert(tableName, data);
             }
         }
         catch
         {
-            if (string.IsNullOrEmpty(tableName))
-                _logQueue?.Enqueue(new($"Update {data.ToString} Failed", DateTime.Now, LogLevel.Error));
-            else
-                _logQueue?.Enqueue(new($"Update {data.ToString} to table {tableName} Failed", DateTime.Now, LogLevel.Error));
             return false;
         }
         return true;
@@ -352,13 +318,8 @@ public class SqlSugarCustom : IORM
         {
             if (disposing)
             {
-                while (_logQueue is not null && _logQueue.Count != 0)
-                    Thread.Sleep(200);
-
-                this._Client?.Dispose();
-                this._Client = null;
-                this._logQueue?.Dispose();
-                this._provider = null;
+                this.Client?.Dispose();
+                this.Client = null;
             }
 
             disposedValue = true;

+ 0 - 1
DataBase/SqlSugarORM/SqlSugarORM.csproj

@@ -14,7 +14,6 @@
 
   <ItemGroup>
     <ProjectReference Include="..\..\Universal\Universal.csproj" />
-    <ProjectReference Include="..\ORM\ORM.csproj" />
   </ItemGroup>
 
 </Project>

+ 14 - 14
EEMSMain.sln

@@ -37,12 +37,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DashBoard", "Module\DashBoa
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataBase", "DataBase", "{664E8B6F-4E97-4592-B7CA-F608871592CD}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ORM", "DataBase\ORM\ORM.csproj", "{E01EF058-A268-B0AE-ACE3-A67E6C7C1981}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlSugarORM", "DataBase\SqlSugarORM\SqlSugarORM.csproj", "{EA1B249C-B1A9-30E4-3598-68B82121C8AF}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntryFrameworkORM", "DataBase\EntryFrameworkORM\EntryFrameworkORM.csproj", "{3696975D-6327-4EBB-ABE5-8CE26DB699A6}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Communicator", "Communicator", "{2225F0CF-790B-4C48-A9F3-247DF1B8DE1C}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeplerCommunicator_DB", "Communicatror\KeplerCommunicator_DB\KeplerCommunicator_DB.csproj", "{BE3A768B-A520-4DB9-91FD-3B1C1B79145A}"
@@ -78,6 +74,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EEMSUIClientCore", "Server\
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceBase", "Server\ServiceBase\ServiceBase.csproj", "{4D7874BD-0AFD-1BDF-FC6D-74C2F1EE9448}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeplerAnalizer", "Analizer\KeplerAnalizer\KeplerAnalizer.csproj", "{D0F321B6-8271-5B67-31F8-0C64B3335FFA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProximaAnalizer", "Analizer\ProximaAnalizer\ProximaAnalizer.csproj", "{D08C45BA-A786-F084-11F5-245EDF58B758}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -132,18 +132,10 @@ Global
 		{C3B8BA88-50CB-48C9-954E-811B68280DE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{C3B8BA88-50CB-48C9-954E-811B68280DE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C3B8BA88-50CB-48C9-954E-811B68280DE8}.Release|Any CPU.Build.0 = Release|Any CPU
-		{E01EF058-A268-B0AE-ACE3-A67E6C7C1981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{E01EF058-A268-B0AE-ACE3-A67E6C7C1981}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{E01EF058-A268-B0AE-ACE3-A67E6C7C1981}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{E01EF058-A268-B0AE-ACE3-A67E6C7C1981}.Release|Any CPU.Build.0 = Release|Any CPU
 		{EA1B249C-B1A9-30E4-3598-68B82121C8AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{EA1B249C-B1A9-30E4-3598-68B82121C8AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{EA1B249C-B1A9-30E4-3598-68B82121C8AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{EA1B249C-B1A9-30E4-3598-68B82121C8AF}.Release|Any CPU.Build.0 = Release|Any CPU
-		{3696975D-6327-4EBB-ABE5-8CE26DB699A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{3696975D-6327-4EBB-ABE5-8CE26DB699A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{3696975D-6327-4EBB-ABE5-8CE26DB699A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{3696975D-6327-4EBB-ABE5-8CE26DB699A6}.Release|Any CPU.Build.0 = Release|Any CPU
 		{BE3A768B-A520-4DB9-91FD-3B1C1B79145A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{BE3A768B-A520-4DB9-91FD-3B1C1B79145A}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{BE3A768B-A520-4DB9-91FD-3B1C1B79145A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -192,6 +184,14 @@ Global
 		{4D7874BD-0AFD-1BDF-FC6D-74C2F1EE9448}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{4D7874BD-0AFD-1BDF-FC6D-74C2F1EE9448}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{4D7874BD-0AFD-1BDF-FC6D-74C2F1EE9448}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D0F321B6-8271-5B67-31F8-0C64B3335FFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D0F321B6-8271-5B67-31F8-0C64B3335FFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D0F321B6-8271-5B67-31F8-0C64B3335FFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D0F321B6-8271-5B67-31F8-0C64B3335FFA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D08C45BA-A786-F084-11F5-245EDF58B758}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D08C45BA-A786-F084-11F5-245EDF58B758}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D08C45BA-A786-F084-11F5-245EDF58B758}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D08C45BA-A786-F084-11F5-245EDF58B758}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -205,9 +205,7 @@ Global
 		{46863C36-9D19-40E7-8A0B-03EAB0944F1A} = {F81EF7E9-27B9-4DE0-95C9-CD1E7B58BA89}
 		{A7B0EC60-758A-3F1B-07BD-E6BDC72911F8} = {B8FCC141-1383-4797-AAD9-17F53945876E}
 		{C3B8BA88-50CB-48C9-954E-811B68280DE8} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
-		{E01EF058-A268-B0AE-ACE3-A67E6C7C1981} = {664E8B6F-4E97-4592-B7CA-F608871592CD}
 		{EA1B249C-B1A9-30E4-3598-68B82121C8AF} = {664E8B6F-4E97-4592-B7CA-F608871592CD}
-		{3696975D-6327-4EBB-ABE5-8CE26DB699A6} = {664E8B6F-4E97-4592-B7CA-F608871592CD}
 		{BE3A768B-A520-4DB9-91FD-3B1C1B79145A} = {2225F0CF-790B-4C48-A9F3-247DF1B8DE1C}
 		{DC93F4C8-DCF1-42FD-9373-DA7121BDAD2C} = {F81EF7E9-27B9-4DE0-95C9-CD1E7B58BA89}
 		{2F2D4070-6595-47DE-BE17-1EB7516E22C4} = {664E8B6F-4E97-4592-B7CA-F608871592CD}
@@ -217,6 +215,8 @@ Global
 		{0B0BF6F8-6BFC-4294-A9C9-014075A09392} = {A6000E18-5F55-4CD7-B3F5-82BB4A4A0E80}
 		{0C79BB69-475D-40CC-AC3A-583AFD8F7527} = {A6000E18-5F55-4CD7-B3F5-82BB4A4A0E80}
 		{4D7874BD-0AFD-1BDF-FC6D-74C2F1EE9448} = {A6000E18-5F55-4CD7-B3F5-82BB4A4A0E80}
+		{D0F321B6-8271-5B67-31F8-0C64B3335FFA} = {62F6EEA5-0B5B-44BC-88B8-8F875BF95424}
+		{D08C45BA-A786-F084-11F5-245EDF58B758} = {62F6EEA5-0B5B-44BC-88B8-8F875BF95424}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {331844F6-59F5-4D02-BFA4-2329C0EAB6EF}

+ 1 - 1
EEMSUIClient/Services/ClientService.cs

@@ -6,7 +6,7 @@ namespace EEMSUIClient.Services
     public class ClientService : IClientService, IClientProvider
     {
         private readonly IClientCaller _clientCaller;
-        private readonly HubBase _hubBase;
+        private readonly ClientCaller _hubBase;
 
         private bool disposedValue;
 

+ 9 - 4
Server/EEMSClientCore/ClientCaller.cs

@@ -1,8 +1,6 @@
-using Universal;
+namespace EEMSClientCore;
 
-namespace EEMSClientCore;
-
-public partial class HubBase : IClientCaller
+public partial class ClientCaller : IClientCaller
 {
     Task<Guid> IClientCaller.RegisterDevice(DeviceInfo deviceInfo)
     {
@@ -14,4 +12,11 @@ public partial class HubBase : IClientCaller
     {
         return this.Send("FilePack", guid, buffer, current, total);
     }
+
+    Task<bool> IClientCaller.UpdateRealTimeData(Dictionary<string, object> realtimeData)
+    {
+
+        return this.Send("UpdateRealTimeData", realtimeData);
+    }
+
 }

+ 1 - 1
Server/EEMSClientCore/HubBase.cs

@@ -2,7 +2,7 @@
 
 namespace EEMSClientCore;
 
-public partial class HubBase(IClientBaseProvider baseProvider) : IDisposable
+public partial class ClientCaller(IClientBaseProvider baseProvider) : IDisposable
 {
     private IClientProvider? _clientProvider;
     private HubConnection? _HubConnection;

+ 4 - 4
Server/EEMSService/EEMSBaseServer.cs

@@ -1,4 +1,4 @@
-using ORM;
+using SqlSugar;
 using SqlSugarORM;
 
 namespace EEMSServerCore;
@@ -14,9 +14,9 @@ public class EEMSBaseServer : IDisposable
         if (WebApplication is not null)
             return false;
 
-        IORM orm = new SqlSugarCustom();
+        SqlSugarCustom orm = new();
         orm.Initialize();
-        orm.Open("Database=EEMSServer;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True", DbType.PostgreSQL);
+        orm.Open("Database=EEMSServer;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True", DbType.PostgreSQL, true);
         orm.CreateTable<DeviceInfo>("Devices");
 
         WebApplicationBuilder builder = WebApplication.CreateBuilder();
@@ -34,7 +34,7 @@ public class EEMSBaseServer : IDisposable
         builder.Services.AddSingleton<IUIProvider, UICaller>();
         builder.Services.AddSingleton<IClientProvider>(clientProvider);
         builder.Services.AddSingleton<IEEMSBaseServerProvider>(provider);
-        builder.Services.AddSingleton<IORM>(orm);
+        builder.Services.AddSingleton<SqlSugarCustom>(orm);
 
         WebApplication = builder.Build();
         WebApplication.MapHub<UIHub>("/UIHub");

+ 7 - 2
Server/EEMSService/Hubs/ClientsMainHub.cs

@@ -1,9 +1,9 @@
 using Microsoft.AspNetCore.Http.Features;
-using ORM;
+using SqlSugarORM;
 
 namespace EEMSServerCore.Hubs;
 
-internal partial class ClientsMainHub(DeviceManager deviceManager, IEEMSBaseServerProvider provider, IORM orm) : Hub, IClientCaller
+internal partial class ClientsMainHub(DeviceManager deviceManager, IEEMSBaseServerProvider provider, SqlSugarCustom orm) : Hub, IClientCaller
 {
     public override Task OnConnectedAsync()
     {
@@ -38,4 +38,9 @@ internal partial class ClientsMainHub(DeviceManager deviceManager, IEEMSBaseServ
         ClientManager.DeviceClients[deviceInfo.Guid.Value] = Clients.Caller;
         return Task.FromResult(deviceInfo.Guid.Value);
     }
+
+    public Task<bool> UpdateRealTimeData(Dictionary<string, object> realtimeData)
+    {
+        throw new NotImplementedException();
+    }
 }

+ 1 - 1
Server/ServiceBase/ClientInterfaces.cs

@@ -9,7 +9,7 @@ public interface IClientCaller
 
     Task<bool> FilePack(Guid guid, byte[] buffer, int current, int total);
 
-
+    Task<bool> UpdateRealTimeData(Dictionary<string, object> realtimeData);
 }
 
 /// <summary>

+ 6 - 7
Test/DBTest.cs

@@ -3,7 +3,6 @@ using DB_Proxima;
 using Dm.util;
 using Mapster;
 using Newtonsoft.Json.Linq;
-using ORM;
 using SqlSugar;
 using SqlSugar.Extensions;
 using SqlSugarORM;
@@ -27,9 +26,9 @@ internal class DBTest
     {
         _orm = new SqlSugarCustom();
         _orm.CreateDataBase("DBTest");
-        _orm.Initialize(null);
+        _orm.Initialize();
         string dbString = "Database=DBTest;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True";
-        return _orm.Open(dbString, SqlSugar.DbType.PostgreSQL, true);
+        return _orm.Open(dbString, DbType.PostgreSQL, true);
 
     }
 
@@ -38,7 +37,7 @@ internal class DBTest
 
         SqlSugarCustom orm = new();
 
-        orm.Initialize(null);
+        orm.Initialize();
         string dbString = "Database=FROMTIN;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True";
         //string dbString = "Database=Kepler;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True";
 
@@ -130,7 +129,7 @@ internal class DBTest
     {
         SqlSugarCustom orm = new();
 
-        orm.Initialize(null);
+        orm.Initialize();
         string dbString = "Database=tin01_db;Password=123456;Host=10.4.6.48;Username=postgres;Persist Security Info=True";
 
         if (!orm.Open(dbString, SqlSugar.DbType.PostgreSQL, true))
@@ -197,7 +196,7 @@ internal class DBTest
     public void Test()
     {
         SqlSugarCustom orm = new();
-        orm.Initialize(null);
+        orm.Initialize();
 
         string dbString = "Database=tin01_db;Password=123456;Host=10.4.6.48;Username=postgres;Persist Security Info=True";
         if (!orm.Open(dbString, SqlSugar.DbType.PostgreSQL, true))
@@ -311,7 +310,7 @@ internal class DBTest
     {
         SqlSugarCustom orm = new();
 
-        orm.Initialize(null);
+        orm.Initialize();
         string dbString = "Database=tin01_db;Password=123456;Host=10.4.6.48;Username=postgres;Persist Security Info=True";
 
         if (!orm.Open(dbString, SqlSugar.DbType.PostgreSQL, true))

+ 1 - 3
TestSignalRClient/Program.cs

@@ -1,8 +1,6 @@
 using Device;
 using EEMSClientCore;
 using ServiceBase;
-using Universal;
-
 namespace TestSignalRClient;
 
 internal class Program
@@ -10,7 +8,7 @@ internal class Program
     static void Main(string[] args)
     {
         IClientBaseProvider baseProvider = new ClientBaseProvider();
-        HubBase hubSender = new(baseProvider);
+        ClientCaller hubSender = new(baseProvider);
         IClientCaller caller = hubSender;
         hubSender.Initialize();
         hubSender.Open("localhost", 50054, "ClientHub");