3 Commits 432a20487d ... a79dc830c5

Author SHA1 Message Date
  肖奇伟 a79dc830c5 Merge branch 'master' into 95三倍龙门码垛 1 week ago
  肖奇伟 5b46f9a021 升级库 1 week ago
  肖奇伟 8292e521a6 修复远程控制无法操作的bug 4 weeks ago

BIN
Lib/SCADA.CNC.FANUC.dll


BIN
Lib/SCADA.CommonCtrl.dll


BIN
Lib/SCADA.CommonLib.dll


+ 28 - 197
Lib/SCADA.CommonLib.xml

@@ -580,19 +580,6 @@
             <param name="isEncrypt">是否加密</param>
             <returns></returns>
         </member>
-        <member name="M:SCADA.CommonLib.AutoSaveParameterItem.Create``1(System.String,``0,System.String,System.String,System.Windows.Data.Binding,System.Boolean)">
-            <summary>
-            创建一个自动保存参数的对象
-            </summary>
-            <typeparam name="T"></typeparam>
-            <param name="parameterName">参数名称</param>
-            <param name="defaulValue">默认值</param>
-            <param name="displayName">显示名称</param>
-            <param name="isEnableBinding">使能绑定</param>
-            <param name="unit">单位</param>
-            <param name="isEncrypt">是否加密</param>
-            <returns></returns>
-        </member>
         <member name="P:SCADA.CommonLib.AutoSaveParameterItem.ParameterPath">
             <summary>
             参数在文件中的保存位置
@@ -930,6 +917,11 @@
             </summary>
             <param name="table"></param>
         </member>
+        <member name="M:SCADA.CommonLib.CommonModel.BaseQuery.#ctor">
+            <summary>
+            
+            </summary>
+        </member>
         <member name="M:SCADA.CommonLib.CommonModel.BaseQuery.#ctor(SCADA.CommonLib.Data.DIL.IDB,System.String)">
             <summary>
             
@@ -974,6 +966,11 @@
             </summary>
             <param name="table"></param>
         </member>
+        <member name="M:SCADA.CommonLib.CommonModel.CommonQuery.#ctor">
+            <summary>
+            
+            </summary>
+        </member>
         <member name="P:SCADA.CommonLib.CommonModel.CommonQuery.CreateTime">
             <summary>
             
@@ -6438,96 +6435,6 @@
             </summary>
             <param name="eventData"></param>
         </member>
-        <member name="T:SCADA.CommonLib.EventBus.EventBus">
-            <summary>
-            事件总线
-            </summary>
-        </member>
-        <member name="P:SCADA.CommonLib.EventBus.EventBus.IocContainer">
-            <summary>
-            
-            </summary>
-        </member>
-        <member name="P:SCADA.CommonLib.EventBus.EventBus.Default">
-            <summary>
-            
-            </summary>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.#ctor">
-            <summary>
-            
-            </summary>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.Register``1(SCADA.CommonLib.EventBus.IEventHandler)">
-            <summary>
-            手动绑定事件源与事件处理
-            </summary>
-            <typeparam name="TEventData"></typeparam>
-            <param name="eventHandler"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.Register``1(System.Action{``0})">
-            <summary>
-            注册Action事件处理器
-            </summary>
-            <typeparam name="TEventData"></typeparam>
-            <param name="action"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.Register(System.Type,System.Type)">
-            <summary>
-            手动绑定事件源与事件处理
-            </summary>
-            <param name="eventType"></param>
-            <param name="handlerType"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.RegisterAllEventHandlerFromAssembly(System.Reflection.Assembly)">
-            <summary>
-            提供入口支持注册其它程序集中实现的IEventHandler
-            </summary>
-            <param name="assembly"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.UnRegister``1(System.Type)">
-            <summary>
-            手动解除事件源与事件处理的绑定
-            </summary>
-            <typeparam name="TEventData"></typeparam>
-            <param name="handlerType"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.UnRegisterAll``1">
-            <summary>
-            卸载指定事件源上绑定的所有事件
-            </summary>
-            <typeparam name="TEventData"></typeparam>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.Trigger``1(``0)">
-            <summary>
-            根据事件源触发绑定的事件处理
-            </summary>
-            <typeparam name="TEventData"></typeparam>
-            <param name="eventData"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.Trigger``1(System.Type,``0)">
-            <summary>
-            触发指定EventHandler
-            </summary>
-            <param name="eventHandlerType"></param>
-            <param name="eventData"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.TriggerAsync``1(``0)">
-            <summary>
-            异步触发
-            </summary>
-            <typeparam name="TEventData"></typeparam>
-            <param name="eventData"></param>
-            <returns></returns>
-        </member>
-        <member name="M:SCADA.CommonLib.EventBus.EventBus.TriggerAsycn``1(System.Type,``0)">
-            <summary>
-            异步触发指定EventHandler
-            </summary>
-            <param name="eventHandlerType"></param>
-            <param name="eventData"></param>
-            <returns></returns>
-        </member>
         <member name="T:SCADA.CommonLib.EventBus.IEventBus">
             <summary>
             
@@ -7019,42 +6926,6 @@
             
             </summary>
         </member>
-        <member name="T:SCADA.CommonLib.Helper.BartenderHelper">
-            <summary>
-            bartender 标签打印帮助类
-            </summary>
-        </member>
-        <member name="M:SCADA.CommonLib.Helper.BartenderHelper.GetPrintPreviewImage``1(``0,System.String,System.String,System.Boolean,System.Collections.Generic.Dictionary{System.String,System.String})">
-            <summary>
-            
-            </summary>
-            <typeparam name="T"></typeparam>
-            <param name="obj"></param>
-            <param name="templetPath"></param>
-            <param name="imageFilePath"></param>
-            <param name="autoMapper"></param>
-            <param name="mapping"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.Helper.BartenderHelper.Print(System.Collections.Generic.Dictionary{System.String,System.String},System.String,System.String)">
-            <summary>
-            以键值对方式打印标签,key为标签中的数据标签
-            </summary>
-            <param name="printValues"></param>
-            <param name="templetPath"></param>
-            <param name="printer"></param>
-            <returns></returns>
-        </member>
-        <member name="M:SCADA.CommonLib.Helper.BartenderHelper.Print``1(``0,System.String,System.String,System.Boolean,System.Collections.Generic.Dictionary{System.String,System.String})">
-            <summary>
-            
-            </summary>
-            <typeparam name="T"></typeparam>
-            <param name="obj"></param>
-            <param name="templetPath"></param>
-            <param name="printer"></param>
-            <param name="autoMapper"></param>
-            <param name="mapping"></param>
-        </member>
         <member name="T:SCADA.CommonLib.Helper.BeepHelper">
             <summary>
             控制蜂鸣器
@@ -7352,39 +7223,6 @@
             <param name="type"></param>
             <returns></returns>
         </member>
-        <member name="T:SCADA.CommonLib.Helper.ColorHelper">
-            <summary>
-            
-            </summary>
-        </member>
-        <member name="M:SCADA.CommonLib.Helper.ColorHelper.ColorToHexString(System.Windows.Media.Color)">
-            <summary>
-            将ARGB颜色转换成16进制字符
-            </summary>
-            <param name="color">Color 类型的 ARGB颜色</param>
-            <returns>返回string 16进制的ARGB颜色</returns>
-        </member>
-        <member name="M:SCADA.CommonLib.Helper.ColorHelper.HexStringToColor(System.String)">
-            <summary>
-            将16进制类型的ARGB颜色 转换成 Color 类型
-            </summary>
-            <param name="strcolor">string类型的16进制ARGB颜色,00FF0000</param>
-            <returns>返回 Color 类型的ARGB颜色</returns>
-        </member>
-        <member name="M:SCADA.CommonLib.Helper.ColorHelper.ColorToArgbString(System.Windows.Media.Color)">
-            <summary>
-            将ARGB颜色转换成string
-            </summary>
-            <param name="color">Color 类型的 ARGB颜色</param>
-            <returns>返回string类型的ARGB颜色</returns>
-        </member>
-        <member name="M:SCADA.CommonLib.Helper.ColorHelper.ArgbStringToColor(System.String)">
-            <summary>
-            将string类型的ARGB颜色 转换成 Color 类型
-            </summary>
-            <param name="strcolor">string类型的ARGB颜色,以逗号分隔。如:255,255,128,255</param>
-            <returns>返回 Color 类型的ARGB颜色</returns>
-        </member>
         <member name="T:SCADA.CommonLib.Helper.ConvertEx">
             <summary>
             
@@ -8188,6 +8026,17 @@
             <param name="fileSize"></param>
             <param name="completedSize"></param>
         </member>
+        <member name="T:SCADA.CommonLib.Helper.GuidHelper">
+            <summary>
+            
+            </summary>
+        </member>
+        <member name="M:SCADA.CommonLib.Helper.GuidHelper.GetShortGuid">
+            <summary>
+            获取短Guid
+            </summary>
+            <returns></returns>
+        </member>
         <member name="T:SCADA.CommonLib.Helper.GzipHelper">
             <summary>
             
@@ -8270,13 +8119,6 @@
             <param name="obj"></param>
             <returns></returns>
         </member>
-        <member name="M:SCADA.CommonLib.Helper.JsonHelper.IsJsonString(System.String)">
-            <summary>
-            判断字符串是Json
-            </summary>
-            <param name="str"></param>
-            <returns></returns>
-        </member>
         <member name="M:SCADA.CommonLib.Helper.JsonHelper.JsonDeserialize``1(System.String)">
             <summary>
             JSON反序列化
@@ -8314,6 +8156,13 @@
             <param name="type"></param>
             <returns></returns>
         </member>
+        <member name="M:SCADA.CommonLib.Helper.JsonHelper.IsJsonString(System.String)">
+            <summary>
+            判断字符串是Json
+            </summary>
+            <param name="str"></param>
+            <returns></returns>
+        </member>
         <member name="T:SCADA.CommonLib.Helper.WhereBuilder">
             <summary>
             Generating SQL from expression trees, Part 2
@@ -9205,19 +9054,6 @@
             </summary>
             <param name="random">随机数填充</param>
         </member>
-        <member name="M:SCADA.CommonLib.Helper.ReflectionHelper.SetBindingValue(System.Windows.Data.Binding,System.Object)">
-            <summary>
-            
-            </summary>
-            <param name="binding"></param>
-            <param name="value"></param>
-        </member>
-        <member name="M:SCADA.CommonLib.Helper.ReflectionHelper.GetBindingValue(System.Windows.Data.Binding)">
-            <summary>
-            
-            </summary>
-            <param name="binding"></param>
-        </member>
         <member name="M:SCADA.CommonLib.Helper.ReflectionHelper.InvokeMatchPara(System.Reflection.MethodInfo,System.Object,System.Object)">
             <summary>
             自动匹配执行参数
@@ -11699,11 +11535,6 @@
             
             </summary>
         </member>
-        <member name="P:SCADA.CommonLib.Context.HttpContext">
-            <summary>
-            Http 上下文
-            </summary>
-        </member>
         <member name="T:SCADA.CommonLib.RpcPara">
             <summary>
             远程调用参数

BIN
Lib/SCADA.dll


+ 151 - 7
Lib/SCADA.xml

@@ -3255,14 +3255,17 @@
             接收到数据
             </summary>
         </member>
-        <member name="P:SCADA.Comm.DataReceivedEventArg.ReceivedData">
+        <member name="P:SCADA.Comm.DataReceivedEventArg.Comm">
             <summary>
             
             </summary>
         </member>
+        <member name="P:SCADA.Comm.DataReceivedEventArg.ReceivedData">
+            <summary> 
+            </summary>
+        </member>
         <member name="P:SCADA.Comm.DataReceivedEventArg.EF">
-            <summary>
-            
+            <summary> 
             </summary>
         </member>
         <member name="P:SCADA.Comm.DataReceivedEventArg.ResponseInfo">
@@ -3797,6 +3800,117 @@
             
             </summary>
         </member>
+        <member name="P:SCADA.Comm.Session.IsDisposed">
+            <summary>
+            
+            </summary>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReadBytes(System.Collections.Generic.List{System.Byte},SCADA.Comm.CommEndFlag)">
+            <summary>
+            
+            </summary>
+            <param name="bytesToSend"></param>
+            <param name="EF"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReadBytes(System.Collections.Generic.List{System.Byte},SCADA.Comm.ResponseInfo)">
+            <summary>
+            
+            </summary>
+            <param name="bytesToSend"></param>
+            <param name="responseInfo"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReadBytes(System.Collections.Generic.List{System.Byte},System.Collections.Generic.List{SCADA.Comm.CommEndFlag})">
+            <summary>
+            
+            </summary>
+            <param name="bytesToSend"></param>
+            <param name="efs"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReadBytes(System.Collections.Generic.List{System.Byte},System.Collections.Generic.List{SCADA.Comm.ResponseInfo})">
+            <summary>
+            
+            </summary>
+            <param name="bytesToSend"></param>
+            <param name="responseInfos"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReadBytes(SCADA.Comm.CommEndFlag)">
+            <summary>
+            
+            </summary>
+            <param name="EF"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReadBytes(SCADA.Comm.ResponseInfo)">
+            <summary>
+            
+            </summary>
+            <param name="responseInfo"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReadBytes(System.Collections.Generic.List{SCADA.Comm.CommEndFlag})">
+            <summary>
+            
+            </summary>
+            <param name="efs"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReadBytes(System.Collections.Generic.List{SCADA.Comm.ResponseInfo})">
+            <summary>
+            
+            </summary>
+            <param name="responseInfos"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.SendBytes(System.Collections.Generic.IEnumerable{System.Byte})">
+            <summary>
+            
+            </summary>
+            <param name="bytes"></param>
+            <returns></returns>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.OnBeginConnect">
+            <summary>
+            
+            </summary>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.OnConnected">
+            <summary>
+            
+            </summary>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.OnUnConnected">
+            <summary>
+            
+            </summary>
+            <exception cref="T:System.NotImplementedException"></exception>
+        </member>
+        <member name="M:SCADA.Comm.Session.ReceiveBytes(System.Collections.Generic.IEnumerable{SCADA.Comm.ResponseInfo})">
+            <summary>
+            
+            </summary>
+            <param name="responseInfos"></param>
+            <returns></returns>
+        </member>
+        <member name="M:SCADA.Comm.Session.Dispose">
+            <summary>
+            
+            </summary>
+        </member>
         <member name="T:SCADA.Comm.SocketEx">
             <summary>
             
@@ -6421,7 +6535,7 @@
         </member>
         <member name="T:SCADA.Drive.Inovance.H5UModbusRtu">
             <summary>
-            汇川PLC
+            汇川PLC  
             </summary>
         </member>
         <member name="M:SCADA.Drive.Inovance.H5UModbusRtu.#ctor(System.String)">
@@ -7721,6 +7835,16 @@
             <param name="dataLength"></param>
             <returns></returns>
         </member>
+        <member name="T:SCADA.Drive.Modbus.BaseModbusCmd">
+            <summary>
+            
+            </summary>
+        </member>
+        <member name="P:SCADA.Drive.Modbus.BaseModbusCmd.IsFiveBitAddress">
+            <summary>
+            
+            </summary>
+        </member>
         <member name="T:SCADA.Drive.Modbus.ModbusASCII">
             <summary>
             ModbusASCII  协议
@@ -7892,6 +8016,16 @@
             <param name="cmd"></param>
             <returns></returns>
         </member>
+        <member name="T:SCADA.Drive.Modbus.ModbusRtuCmd">
+            <summary>
+            
+            </summary>
+        </member>
+        <member name="M:SCADA.Drive.Modbus.ModbusRtuCmd.#ctor">
+            <summary>
+            
+            </summary>
+        </member>
         <member name="M:SCADA.Drive.Modbus.ModbusRtuCmd.#ctor(System.Collections.Generic.List{System.Byte})">
             <summary>
             解码
@@ -24067,25 +24201,28 @@
             <param name="regNames"></param>
             <returns></returns>
         </member>
-        <member name="M:SCADA.Drive.TagExtersion.TowByteSwap(System.Byte[])">
+        <member name="M:SCADA.Drive.TagExtersion.TowByteSwap(System.Byte[],System.Int32)">
             <summary>
             
             </summary>
             <param name="src"></param>
+            <param name="width"></param>
             <returns></returns>
         </member>
-        <member name="M:SCADA.Drive.TagExtersion.FourByteSwap(System.Byte[])">
+        <member name="M:SCADA.Drive.TagExtersion.FourByteSwap(System.Byte[],System.Int32)">
             <summary>
             
             </summary>
             <param name="src"></param>
+            <param name="width"></param>
             <returns></returns>
         </member>
-        <member name="M:SCADA.Drive.TagExtersion.OCTByteSwap(System.Byte[])">
+        <member name="M:SCADA.Drive.TagExtersion.OCTByteSwap(System.Byte[],System.Int32)">
             <summary>
             
             </summary>
             <param name="src"></param>
+            <param name="width">交换宽度</param>
             <returns></returns>
         </member>
         <member name="T:SCADA.Drive.TCPModel">
@@ -36565,6 +36702,13 @@
             虚拟设备
             </summary>
         </member>
+        <member name="M:SCADA.VirtualDevice.OnBeforeScan(System.Collections.Generic.List{System.String})">
+            <summary>
+            
+            </summary>
+            <param name="regNames"></param>
+            <returns></returns>
+        </member>
         <member name="T:SCADA.XmlHelper">
             <summary>
             Xml序列化

BIN
Lib/SCADA_DAQ.Plugin.Core.dll


BIN
Lib/SCADA_DAQ.Plugin.CoreUI.dll


BIN
Lib/SCADA_DAQ.Plugin.Machine.dll


BIN
Lib/SCADA_DAQ.Plugin.MachineUI.dll


BIN
Lib/SCADA_DAQ.Plugin.RESTful.dll


BIN
Lib/Xceed.Wpf.Toolkit.dll


+ 0 - 15
SCADA_DAQ/Bat/DBPublish.cmd

@@ -1,15 +0,0 @@
-@rem ¸üÐÂÊý¾Ý¿â
-
-@rem TargetDir
-set SrcPath=%1
-set SrcPath=%SrcPath:"=%
-
-@rem ProjectDir
-set ProjectDir=%2
-set ProjectDir=%ProjectDir:"=%
-
-@rem SolutionDir
-set SolutionDir=%3
-set SolutionDir=%SolutionDir:"=%
-
-"C:\Program Files\WinRAR\WinRAR.exe" a -ep1 -o+ -inul -r -ibck  "%ProjectDir%Data\QwPlatform.zip" "%SrcPath%Data\QwPlatform.db"

+ 0 - 12
SCADA_DAQ/Bat/DevicecfgPublish.cmd

@@ -1,12 +0,0 @@
-@rem ¸üÐÂÊý¾Ý¿â
-
-@rem TargetDir
-set SrcPath=%1
-set SrcPath=%SrcPath:"=%
-
-@rem ProjectDir
-set ProjectDir=%2
-set ProjectDir=%ProjectDir:"=%
-
-
-"C:\Program Files\WinRAR\WinRAR.exe" a -ep1 -o+ -inul -r -ibck  "%ProjectDir%Customer\Doc\DeviceCfg.zip" "%SrcPath%DeviceCfg.json"

+ 0 - 10
SCADA_DAQ/Bat/bulid.bat

@@ -1,10 +0,0 @@
-
-set SolutionDir=%1
-set SolutionDir=%SolutionDir:"=%
-
-set SolutionFileName=%1
-set SolutionFileName=%SolutionFileName:"=%
-
-MSBuild %SolutionFileName% /p:Configuration=Debug
-rem  MSBuild D:\ÏîÄ¿´úÂë¹ÜÀí\SCADA_DAQ2023\\"SCADA_DAQ3.0.sln" /p:Configuration=Debug
-pause

+ 6 - 6
SCADA_DAQ/Bat/publish.cmd

@@ -23,7 +23,7 @@ rem BinDir
 set OutDir=%5
 set OutDir=%OutDir:"=%
 set BatDir=%OutDir:"=%
-for %%a in ("%BatDir:~,-8%") do set PublishDirName=%%~nxa
+for %%a in ("%BatDir%..") do set PublishDirName=%%~nxa
 echo 上级目录名为:%PublishDirName%
 
 set TargetPath="D:\项目代码管理\发布管理\Updates\%PublishDirName%\"
@@ -83,11 +83,11 @@ xcopy  "%ProjectDir%Icon\*.*" "%TargetPath%Publish\Content\Img\" /Y
 if exist "%ProjectDir%Tools"  echo F | xcopy  "%ProjectDir%Tools\*.*" "%TargetPath%Publish\Tools\" /Y
 if exist "%ProjectDir%Customer\Doc\DeviceCfg.zip"  xcopy "%ProjectDir%Customer\Doc\DeviceCfg.zip" "%TargetPath%Publish"
 
-xcopy  "%OutDir%\plugin\SCADA.CommonLib.dll" %OutDir%  /Y
-xcopy  "%OutDir%\plugin\SCADA.CommonCtrl.dll" %OutDir%  /Y
-xcopy  "%OutDir%\plugin\SCADA.dll" %OutDir%  /Y
-xcopy  "%OutDir%\plugin\Opc.Ua.*.dll" %OutDir%  /Y
-xcopy  "%OutDir%\plugin\Magick.*.dll" %OutDir%  /Y
+xcopy  "%OutDir%\plugin\SCADA.CommonLib.dll" "%OutDir%"  /Y
+xcopy  "%OutDir%\plugin\SCADA.CommonCtrl.dll" "%OutDir%"  /Y
+xcopy  "%OutDir%\plugin\SCADA.dll" "%OutDir%"  /Y
+xcopy  "%OutDir%\plugin\Opc.Ua.*.dll" "%OutDir%"  /Y
+xcopy  "%OutDir%\plugin\Magick.*.dll" "%OutDir%" /Y
 
 del /f /q "%OutDir%\plugin\SCADA.CommonLib.dll"
 del /f /q "%OutDir%\plugin\SCADA.CommonCtrl.dll" 

BIN
SCADA_DAQ/Customer/Doc/DeviceCfg.zip


BIN
SCADA_DAQ/Data/Alarmdb.zip


BIN
SCADA_DAQ/Data/LocalApp.zip


BIN
SCADA_DAQ/Data/Platform.zip


+ 1 - 1
SCADA_DAQ/Env.cs

@@ -84,7 +84,7 @@ namespace SCADA_DAQ
                             {
                                 ResourceName="AlarmDB",
                                 DBType = DatabaseType.Sqlite,
-                                FilePath = @"Data\Platform.db"
+                                FilePath = @"Data\Aalarmdb.db"
                             },
                             new DataBaseConfig()
                             {

+ 21 - 25
SCADA_DAQ/SystemControl.cs

@@ -26,17 +26,13 @@ namespace SCADA_DAQ
         /// </summary>
         bool isShutDown = false;
         ILog Log { get; set; } = null;
-
         private EventWaitHandle evh;
         public App App { get; private set; }
         private static SystemControl systemControl;
-
         private static readonly object syncObj = new object();
-
         private readonly List<AdvanceTimer> Timers = new List<AdvanceTimer>();
         private readonly Task initTask;
         private readonly Task initServer;
-        private ServiceHost host = null;
         public string UidVersion { get; }
 
         private string SoftWareId { get; set; }
@@ -156,9 +152,6 @@ namespace SCADA_DAQ
                 var st = new Stopwatch();
                 st.Start();
                 EicpCoreManage.AppRuntime = App;
-                host = ServiceHost.Instance;
-                (App as IApp).ServiceHost = host;
-                host.Start(App);
                 try
                 {
                     App.RuntimeInfo.StartTime = DateTime.Now;
@@ -175,11 +168,15 @@ namespace SCADA_DAQ
                         { SCADA.CommonLib.LoggerHelper.LogLevel.None,log4net.Core.Level.Off},
                     };
                     LogManager.GetRepository().Threshold = logLevel[App.SystemConfig.LogLevel];
-                    Log.Info($"App {App.RuntimeInfo.ProductId} ({UidVersion}) is starting ……");
+                    Log.Info($"App {App.RuntimeInfo.ProductId} ({UidVersion}) [{App.SystemConfig.ComputerTag}] is starting ……");
                     Task.WaitAll(initServer);
                     Console.WriteLine($"系统初始化完成 {DateTime.Now:yyyy-MM-dd HH:mm:ss,fff}");
                     Func<bool> action = null;
                     LoadLicense();
+                    App.RuntimeInfo.ComputerId = App.RuntimeInfo.LicenseInfo.Computer.ComputerId;
+                    var host = ServiceHost.Instance;
+                    App.ServiceHost = host;
+                    host.Start(App);
                     App.Dispatcher.Invoke(new Action(() =>
                     {
                         if (App.MainWindow is MainWindow window)
@@ -200,7 +197,7 @@ namespace SCADA_DAQ
                     {
                         App.RuntimeInfo.LicenseInfo = LicenseManage.GetLicenseInfo(App.RuntimeInfo.ProductId);
                     }
-                    App.RuntimeInfo.ComputerId = App.RuntimeInfo.LicenseInfo.Computer.ComputerId;
+
 
                     App.Dispatcher.Invoke(new Action(() =>
                     {
@@ -277,19 +274,20 @@ namespace SCADA_DAQ
 
         private void ReportAppInfo(bool isOnline = true)
         {
-            if (App.RuntimeInfo.LicenseInfo != null && (App.RuntimeInfo.LicenseInfo.LicenseType == LicenseType.TempLicense || App.RuntimeInfo.LicenseInfo.LicenseType == LicenseType.Permanentlicense))
+            var license = App.RuntimeInfo.LicenseInfo;
+            if (license != null && (license.LicenseType == LicenseType.TempLicense || license.LicenseType == LicenseType.Permanentlicense))
             {
                 var reportInfo = new
                 {
                     SessionID = App.RuntimeInfo.SessionId,
-                    AppName = App.RuntimeInfo.LicenseInfo?.AppName,
+                    AppName = license?.AppName,
                     Version = UidVersion,
                     CustomerTag = App.SystemConfig.ComputerTag,
-                    ComputerId = App.RuntimeInfo.LicenseInfo?.Computer.ComputerId,
-                    LicenseId = App.RuntimeInfo.LicenseInfo?.LicenseId,
-                    LicenseType = App.RuntimeInfo.LicenseInfo?.LicenseType.ToString(),
-                    ActiveTime = App.RuntimeInfo.LicenseInfo?.ActiveTime,
-                    ExpireDate = App.RuntimeInfo.LicenseInfo?.ActiveTime.AddDays(App.RuntimeInfo.LicenseInfo.ExpireDays),
+                    ComputerId = license?.Computer.ComputerId,
+                    LicenseId = license?.LicenseId,
+                    LicenseType = license?.LicenseType.ToString(),
+                    ActiveTime = license?.ActiveTime,
+                    ExpireDate = license?.ActiveTime.AddDays(license.ExpireDays),
                     TotalOutputPcs = Env.TotalOutputPcs.Value,
                     TotalOutputQty = Env.TotalOutputQty.Value,
                     IsOnline = isOnline
@@ -305,18 +303,17 @@ namespace SCADA_DAQ
         private void FalatReport(Exception exception)
         {
             if (isShutDown) return;
-            if (App.RuntimeInfo.LicenseInfo != null &&
-                (App.RuntimeInfo.LicenseInfo.LicenseType == LicenseType.TempLicense ||
-                App.RuntimeInfo.LicenseInfo.LicenseType == LicenseType.Permanentlicense))
+            var license = App.RuntimeInfo.LicenseInfo;
+            if (license != null && (license.LicenseType == LicenseType.TempLicense || license.LicenseType == LicenseType.Permanentlicense))
             {
                 try
                 {
                     EicpCoreManage.FalatReport(new
                     {
                         SessionID = App.RuntimeInfo.SessionId,
-                        AppName = App.RuntimeInfo.LicenseInfo?.AppName,
+                        AppName = license?.AppName,
                         Version = UidVersion,
-                        ComputerId = App.RuntimeInfo.LicenseInfo?.Computer?.ComputerId,
+                        ComputerId = license?.Computer?.ComputerId,
                         SoftwareID = SoftWareId,
                         Customer = System.Windows.Forms.Application.CompanyName,
                         Message = exception.Message,
@@ -333,7 +330,7 @@ namespace SCADA_DAQ
         }
         public bool RestartHost()
         {
-            return host.Restart();
+            return App.ServiceHost.Restart();
         }
 
         private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
@@ -344,7 +341,6 @@ namespace SCADA_DAQ
             {
                 FalatReport(e.Exception);
             }
-
         }
 
         private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
@@ -373,7 +369,7 @@ namespace SCADA_DAQ
                 {"HCNETSDKLib.zip",null },
                 {"RunTime.zip",null },
                 {"SyntecLib_v4.zip",null},
-                {"FocasLib.zip",AppDomain.CurrentDomain.BaseDirectory },
+                {"Fwlib.zip",AppDomain.CurrentDomain.BaseDirectory },
                 {"DeviceCfg.zip",null},
                 {"x86_x64.zip",null },
             };
@@ -416,7 +412,7 @@ namespace SCADA_DAQ
         public void ApplicationDispose(int exitCode)
         {
             isShutDown = true;
-            if (host != null) host.Stop();
+            App.ServiceHost?.Stop();
             foreach (var item in Timers)
             {
                 item.Dispose();