19 Commits 8d15dd6a70 ... 69345289f9

Author SHA1 Message Date
  mengshunguo 69345289f9 东洋设备驱动 1 month ago
  mengshunguo ffac228996 Merge branch 'master' into 89越南数采 1 month ago
  mengshunguo f1cbb0e1fa Merge branch 'master' of http://imaodou.com.cn:30030/c_jack/EICP3.0_69 1 month ago
  mengshunguo 0707cd6b5c 临时提交 1 month ago
  肖奇伟 d8860a6e62 升级库 1 month ago
  mengshunguo e63992c279 提交 1 month ago
  肖奇伟 bb9e8503b2 更新库 1 month ago
  mengshunguo ef22e01ee8 提交 1 month ago
  mengshunguo 18bed55122 提交 1 month ago
  mengshunguo 5728a42054 Merge branch 'master' into 89越南数采 1 month ago
  mengshunguo be30b4bff6 Merge branch 'master' of http://imaodou.com.cn:30030/c_jack/EICP3.0_69 1 month ago
  肖奇伟 b2594025f1 更新库 1 month ago
  mengshunguo d2fbcfee8a Merge branch 'master' into 89越南数采 1 month ago
  mengshunguo 96b432203d Merge branch 'master' of http://imaodou.com.cn:30030/c_jack/EICP3.0_69 1 month ago
  肖奇伟 9e0518a040 升级库 1 month ago
  mengshunguo 1517590031 Merge branch 'master' into 89越南数采 1 month ago
  mengshunguo edb427c1d6 Merge branch 'master' of http://imaodou.com.cn:30030/c_jack/EICP3.0_69 1 month ago
  mengshunguo 87cd4bcb3d 提交 1 month ago
  肖奇伟 edcd124b31 升级库 1 month ago

BIN
Lib/Microsoft.AspNetCore.Hosting.Abstractions.dll


BIN
Lib/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll


BIN
Lib/Microsoft.AspNetCore.Http.Extensions.dll


BIN
Lib/Microsoft.AspNetCore.Http.dll


BIN
Lib/Microsoft.AspNetCore.WebUtilities.dll


BIN
Lib/Microsoft.Extensions.Configuration.Abstractions.dll


BIN
Lib/Microsoft.Extensions.FileProviders.Abstractions.dll


BIN
Lib/Microsoft.Extensions.ObjectPool.dll


BIN
Lib/Microsoft.Extensions.Options.dll


BIN
Lib/Microsoft.Net.Http.Headers.dll


BIN
Lib/SCADA.CNC.FANUC.dll


BIN
Lib/SCADA.CommonCtrl.dll


BIN
Lib/SCADA.CommonLib.dll


+ 136 - 19
Lib/SCADA.CommonLib.xml

@@ -580,6 +580,19 @@
             <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>
             参数在文件中的保存位置
@@ -610,6 +623,21 @@
             
             </summary>
         </member>
+        <member name="P:SCADA.CommonLib.AutoSaveParameterItem.IsEnableBinding">
+            <summary>
+            绑定使能
+            </summary>
+        </member>
+        <member name="P:SCADA.CommonLib.AutoSaveParameterItem.VisibilityBinding">
+            <summary>
+            可视性绑定
+            </summary>
+        </member>
+        <member name="P:SCADA.CommonLib.AutoSaveParameterItem.Command">
+            <summary>
+            
+            </summary>
+        </member>
         <member name="M:SCADA.CommonLib.AutoSaveParameterItem.OnParameterChanged">
             <summary>
             
@@ -6975,6 +7003,42 @@
             
             </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>
             控制蜂鸣器
@@ -7272,6 +7336,39 @@
             <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>
             
@@ -8157,6 +8254,13 @@
             <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反序列化
@@ -8194,13 +8298,6 @@
             <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
@@ -9092,6 +9189,19 @@
             </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>
             自动匹配执行参数
@@ -11573,6 +11683,11 @@
             
             </summary>
         </member>
+        <member name="P:SCADA.CommonLib.Context.HttpContext">
+            <summary>
+            Http 上下文
+            </summary>
+        </member>
         <member name="T:SCADA.CommonLib.RpcPara">
             <summary>
             远程调用参数
@@ -12215,8 +12330,7 @@
             </summary>
         </member>
         <member name="M:SCADA.CommonLib.Scheduler.BaseJob.OnExcuteCompleted(SCADA.CommonLib.Scheduler.JobExcuteFinishEventArgs)">
-            <summary>
-            
+            <summary> 执行结束
             </summary>
             <param name="excuteCompleted"></param>
         </member>
@@ -12236,28 +12350,23 @@
             </summary>
         </member>
         <member name="P:SCADA.CommonLib.Scheduler.BaseJob.LastExcuteTime">
-            <summary>
-            最后一次执行时间
+            <summary> 最后一次执行时间
             </summary>
         </member>
         <member name="P:SCADA.CommonLib.Scheduler.BaseJob.ExcutePolicy">
-            <summary>
-            执行策略
+            <summary> 执行策略
             </summary>
         </member>
         <member name="P:SCADA.CommonLib.Scheduler.BaseJob.NextExcuteTime">
-            <summary>
-            下次执行时间
+            <summary> 下次执行时间
             </summary>
         </member>
         <member name="P:SCADA.CommonLib.Scheduler.BaseJob.ExcuteStatus">
-            <summary>
-            执行状态   运行中,等待运行
+            <summary> 执行状态   运行中,等待运行
             </summary>
         </member>
         <member name="P:SCADA.CommonLib.Scheduler.BaseJob.JobName">
-            <summary>
-            任务名称
+            <summary> 任务名称
             </summary>
         </member>
         <member name="P:SCADA.CommonLib.Scheduler.BaseJob.ExcuteHandler">
@@ -12347,7 +12456,15 @@
             
             </summary>
         </member>
+        <member name="P:SCADA.CommonLib.Scheduler.JobServer.Instance">
+            <summary>
+            </summary>
+        </member>
         <member name="E:SCADA.CommonLib.Scheduler.JobServer.JobExcuteFinish">
+            <summary> 
+            </summary>
+        </member>
+        <member name="P:SCADA.CommonLib.Scheduler.JobServer.AppRunTime">
             <summary>
             
             </summary>

BIN
Lib/SCADA.dll


+ 167 - 12
Lib/SCADA.xml

@@ -1447,6 +1447,11 @@
             <summary> 读取失败超过 N 此引发连接断开
             </summary>
         </member>
+        <member name="F:SCADA.BaseDevice.ReadCount">
+            <summary>
+            读取次数
+            </summary>
+        </member>
         <member name="P:SCADA.BaseDevice.ReadNGCnt">
             <summary> 当前读取失败次数
             </summary>
@@ -2621,7 +2626,7 @@
         </member>
         <member name="P:SCADA.Comm.BaseComm.LastDataReceivedTime">
             <summary>
-            
+            最后一次接收到数据的时间
             </summary>
         </member>
         <member name="M:SCADA.Comm.BaseComm.OnBeginConnect">
@@ -3792,6 +3797,47 @@
             
             </summary>
         </member>
+        <member name="T:SCADA.Comm.SocketEx">
+            <summary>
+            
+            </summary>
+        </member>
+        <member name="M:SCADA.Comm.SocketEx.SafeClose(System.Net.Sockets.Socket)">
+            <summary>
+            
+            </summary>
+            <param name="socket"></param>
+        </member>
+        <member name="M:SCADA.Comm.SocketEx.IsConnected(System.Net.Sockets.Socket)">
+            <summary>
+            
+            </summary>
+            <param name="socket"></param>
+            <returns></returns>
+        </member>
+        <member name="M:SCADA.Comm.SocketEx.KeepAlive(System.Net.Sockets.Socket,System.Int32,System.Int32,System.Int32)">
+            <summary>
+            
+            </summary>
+            <param name="socket"></param>
+            <param name="onOff"></param>
+            <param name="keepAliveTime"></param>
+            <param name="keepAliveInterval"></param>
+        </member>
+        <member name="M:SCADA.Comm.SocketEx.PortIsUsed(System.Int32)">
+            <summary>
+            检查TCP端口是否被占用
+            </summary>
+            <param name="port"></param>
+            <returns></returns>
+        </member>
+        <member name="M:SCADA.Comm.SocketEx.UdpPortIsUsed(System.Int32)">
+            <summary>
+            检查TCP端口是否被占用
+            </summary>
+            <param name="port"></param>
+            <returns></returns>
+        </member>
         <member name="T:SCADA.Comm.TcpComm">
             <summary>
             TCP测试通道
@@ -3903,13 +3949,6 @@
             <param name="port"></param>
             <returns></returns>
         </member>
-        <member name="M:SCADA.Comm.TcpServer.GetSocket(System.String)">
-            <summary>
-            
-            </summary>
-            <param name="sessionId"></param>
-            <returns></returns>
-        </member>
         <member name="M:SCADA.Comm.TcpServer.Dispose">
             <summary>
             
@@ -8892,7 +8931,6 @@
         </member>
         <member name="P:SCADA.Drive.RegAnnotation.StringEncoding">
             <summary>
-            
             </summary>
         </member>
         <member name="P:SCADA.Drive.RegAnnotation.OutputLog">
@@ -8917,13 +8955,11 @@
             </summary>
         </member>
         <member name="P:SCADA.Drive.RegAnnotation._encoding">
-            <summary>
-            
+            <summary> 
             </summary>
         </member>
         <member name="M:SCADA.Drive.RegAnnotation.GetEncoding">
             <summary>
-            
             </summary>
             <returns></returns>
         </member>
@@ -8932,6 +8968,11 @@
             数据字典
             </summary>
         </member>
+        <member name="P:SCADA.Drive.RegAnnotation.RegKind">
+            <summary>
+            
+            </summary>
+        </member>
         <member name="P:SCADA.Drive.RegAnnotation.DataDictionary">
             <summary>
             
@@ -9378,6 +9419,16 @@
             内存
             </summary>
         </member>
+        <member name="F:SCADA.Drive.RegKind.Const">
+            <summary>
+            常量
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.RegKind.Ref">
+            <summary>
+            引用
+            </summary>
+        </member>
         <member name="T:SCADA.Drive.RegReadValueChangedEventArgs">
             <summary>
             寄存器的读数发生变化
@@ -23354,6 +23405,46 @@
             
             </summary>
         </member>
+        <member name="T:SCADA.Drive.Siemens.CNC840Dsl">
+            <summary>
+            
+            </summary>
+        </member>
+        <member name="M:SCADA.Drive.Siemens.CNC840Dsl.#ctor(SCADA.Comm.IComm,System.String)">
+            <summary>
+            
+            </summary>
+            <param name="commWay"></param>
+            <param name="address"></param>
+        </member>
+        <member name="M:SCADA.Drive.Siemens.CNC840Dsl.#ctor(SCADA.Comm.IComm,System.Int32)">
+            <summary>
+            S7-200Smart 通信
+            </summary>
+            <param name="commWay"></param>
+            <param name="address"></param>
+        </member>
+        <member name="M:SCADA.Drive.Siemens.CNC840Dsl.Handshake">
+            <summary>
+            
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:SCADA.Drive.Siemens.CNC840Dsl.ReadNReg(System.String,System.Int32)">
+            <summary>
+            
+            </summary>
+            <param name="regName"></param>
+            <param name="length"></param>
+            <returns></returns>
+        </member>
+        <member name="M:SCADA.Drive.Siemens.CNC840Dsl.ReadNReg(System.String)">
+            <summary>
+            
+            </summary>
+            <param name="regNameRange"></param>
+            <returns></returns>
+        </member>
         <member name="T:SCADA.Drive.Siemens.PPI.S7Cmd">
             <summary>
             
@@ -23451,6 +23542,70 @@
             DB号
             </summary>
         </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NckArea.N">
+            <summary> NCK
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NckArea.B">
+            <summary> Mode group
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NckArea.C">
+            <summary>channel
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NckArea.T">
+            <summary>Tool 
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NckArea.V">
+            <summary> Feed Drive
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.TO">
+            <summary> Tool Data
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.RP">
+            <summary> Arithmetic parameters 
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.M">
+            <summary>Machine state 
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.DIAGN">
+            <summary>NCK Module: DIAGN - Diagnostic data (0x3b)
+             </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.SEGA">
+            <summary>  State data:Geometry axes in tool offset memory(extend)
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.SSP">
+            <summary>
+            NCK Module: SSP - State data: Spindle (0x72)
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.SPARPP">
+            <summary>
+            NCK Module: SPARPP - Program pointer in automatic operation (0x7a)
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.SMA">
+            <summary>
+            NCK Module: S - State data:Machine axes (0x74)
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.StateData">
+            <summary>
+            NCK Module: S - State data (0x7f)
+            </summary>
+        </member>
+        <member name="F:SCADA.Drive.Siemens.S7Comm.NCKModule.Unknow">
+            <summary>Unknow
+            </summary>
+        </member>
         <member name="P:SCADA.Drive.Siemens.S7Comm.S7CommDataItem.TransportSize">
             <summary>
             //数据类型 0x03 bit  0x04 byte

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


+ 1 - 1
SCADA_DAQ/App.config

@@ -69,7 +69,7 @@
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
         <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-8.0.1.1" newVersion="4.0.1.1" />
+        <bindingRedirect oldVersion="0.0.0.0-8.0.1.1" newVersion="4.0.1.2" />
       </dependentAssembly>
     </assemblyBinding>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

+ 4 - 4
SCADA_DAQ/Customer/Jobs/CustomerJob.cs

@@ -42,12 +42,12 @@ namespace SCADA_DAQ.Customer.Jobs
         /// <summary>
         /// 任务执行
         /// </summary>
-        protected override Func<IJobExecutionContext,ILog, JobExcuteFinishEventArgs> ExcuteHandler => (context,log) =>
+        protected override Func<IJobExecutionContext, ILog, JobExcuteFinishEventArgs> ExcuteHandler => (context, log) =>
         {
-            var para = (CustomerJobConfig)JobServer.JobParameters[context.JobDetail.Key.ToString()];
-            var excuteMsg =new JobExcuteFinishEventArgs();
+            var para = (CustomerJobConfig)JobServer.Instance.JobParameters[context.JobDetail.Key.ToString()];
+            var excuteMsg = new JobExcuteFinishEventArgs();
             //TODO:这里执行需要的逻辑
-            excuteMsg.IsSuccess= true;
+            excuteMsg.IsSuccess = true;
             return excuteMsg;
         };
     }

+ 186 - 0
SCADA_DAQ/Customer/Machines/TOYOSampleMachine.cs

@@ -0,0 +1,186 @@
+using NPOI.SS.Formula.Functions;
+using SCADA;
+using SCADA.BarcodeReader;
+using SCADA.Comm;
+using SCADA.Drive;
+using SCADA_DAQ.Plugin.Machine;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SCADA_DAQ.Customer.Machines
+{
+    [DisplayName("东洋(TOYO)")]
+    public class TOYOSampleMachine : VirtualDevice
+    {
+        public TOYOSampleMachine()
+        {
+
+        }
+        public TOYOSampleMachine(IComm comm, int address)
+        {
+            ListenReg.Add("报警时间", new RegInfo
+            {
+                RegName = "AlarmTime",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "AlarmTime", Annotation = "报警时间", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("报警代码", new RegInfo
+            {
+                RegName = "AlarmCode",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "AlarmCode", Annotation = "报警代码", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("报警信息", new RegInfo
+            {
+                RegName = "AlarmInfo",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "AlarmInfo", Annotation = "报警信息", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("报警DATA1", new RegInfo
+            {
+                RegName = "AlarmDATA1",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "AlarmDATA1", Annotation = "报警DATA1", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("报警DATA2", new RegInfo
+            {
+                RegName = "AlarmDATA2",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "AlarmDATA2", Annotation = "报警DATA2", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("模式切换时间", new RegInfo
+            {
+                RegName = "ModeTime",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "ModeTime", Annotation = "模式切换时间", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("模式代码", new RegInfo
+            {
+                RegName = "ModeCode",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "ModeCode", Annotation = "模式代码", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("模式信息", new RegInfo
+            {
+                RegName = "ModeInfo",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "ModeInfo", Annotation = "模式信息", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("产量推送时间", new RegInfo
+            {
+                RegName = "OutPutTime",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "OutPutTime", Annotation = "产量推送时间", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            ListenReg.Add("产量", new RegInfo
+            {
+                RegName = "OutPutQty",
+                Protocol = this,
+                RegKind = RegKind.IO,
+                StringValue = null,
+                Comment = new RegAnnotation { Variable = "OutPutQty", Annotation = "产量", IsReadOnly = true, ViewType = RegViewType.String }
+            });
+            //comm.ResponseInfos = 
+            if (comm != null)
+            {
+                comm.ResponseInfos = new List<ResponseInfo>() { new ResponseInfo() { ResponseType = ResponseType.UnKnown } };
+                comm.DataReceived += Comm_DataReceived;
+                Comm = comm;
+            }
+
+        }
+        public TOYOSampleMachine(IComm comm, string address) : this(comm, 0)
+        {
+
+        }
+
+        public override void Dispose()
+        {
+            if (Comm != null)
+            {
+                Comm.DataReceived -= Comm_DataReceived;
+            }
+            base.Dispose();
+        }
+        private void Comm_DataReceived(object sender, DataReceivedEventArg e)
+        {
+            string triggerTime;
+            string identifier;
+            string schemaCode;
+            string patternCharacters;
+            string data1;
+            string data2;
+            string qty;
+            var receiveMSGStr = e.ReceiveMsg.Replace(" ", "");
+            var receiveMSGArray = receiveMSGStr.Split(',');
+            identifier = receiveMSGArray[1];
+            if (identifier == "32" || identifier == "30")
+            {
+                if (identifier == "32")
+                {
+                    triggerTime = $"{receiveMSGArray[2]}/{receiveMSGArray[3]}";
+                    schemaCode = receiveMSGArray[4];
+                    patternCharacters = receiveMSGArray[5];
+                    ListenReg["模式时间"].StringValue = triggerTime;
+                    ListenReg["模式代码"].StringValue = schemaCode;
+                    ListenReg["模式信息"].StringValue = patternCharacters;
+                    //log($"收到设备模式数据,设备名{MachieID},触发时间{triggerTime},模式代码{schemaCode},模式字符{patternCharacters}");
+                }
+                else
+                {
+                    triggerTime = $"{receiveMSGArray[2]}/{receiveMSGArray[3]}";
+                    schemaCode = receiveMSGArray[4];
+                    data1 = receiveMSGArray[5];
+                    data2 = receiveMSGArray[6];
+                    patternCharacters = receiveMSGArray[7];
+                    ListenReg["报警触发时间"].StringValue = triggerTime;
+                    ListenReg["报警代码"].StringValue = schemaCode;
+                    ListenReg["报警信息"].StringValue = patternCharacters;
+                    ListenReg["报警DATA1"].StringValue = data1;
+                    ListenReg["报警DATA2"].StringValue = data2;
+                    //Log.Info($"收到设备报警数据,设备名{MachieID},触发时间{triggerTime},报警代码{schemaCode},报警字符{patternCharacters},DATA1{data1},DATA2{data2}");
+                }
+
+            }
+            else if (identifier == "33")
+            {
+                triggerTime = $"{receiveMSGArray[2]}-{receiveMSGArray[3]}-{receiveMSGArray[4]}/{receiveMSGArray[5]}:{receiveMSGArray[6]}:{receiveMSGArray[7]}";
+                qty = receiveMSGArray[8];
+                ListenReg["产量推送时间"].StringValue = triggerTime;
+                ListenReg["产量信息"].StringValue = qty;
+                //Log.Info($"收到设备报警数据,设备名{MachieID},生产时间{triggerTime},产量{qty}PCS");
+            }
+        }
+
+        //public string MachieID;
+
+        public override ExecuteResult<bool> WriteReg(string regName, params int[] @params)
+        {
+            throw new NotImplementedException();
+
+        }
+
+    }
+}

File diff suppressed because it is too large
+ 51 - 275
SCADA_DAQ/SCADA_DAQ.csproj


Some files were not shown because too many files changed in this diff