Browse Source

版本更新

Shun 2 years ago
parent
commit
3fb72ec1de

+ 3 - 6
src/YSAI.DAQ/YSAI.Beckhoff/BeckhoffData.cs

@@ -32,16 +32,14 @@ namespace YSAI.Beckhoff
             /// 端口
             /// </summary>
             [Description("端口")]
-            [Verify(@"^[0-9]*[1-9][0-9]*$", "输入有误")]
-            [Display(true, true, Core.data.ParamStructure.dataCate.unmber)]
+            [Display(true, true, true, Core.data.ParamStructure.dataCate.unmber)]
             public int Port { get; set; } = 851;
 
             /// <summary>
             /// 任务数量
             /// </summary>
             [Description("任务数量")]
-            [Verify(@"^[0-9]*[1-9][0-9]*$", "输入有误")]
-            [Display(true, true, Core.data.ParamStructure.dataCate.unmber)]
+            [Display(true, true, true, Core.data.ParamStructure.dataCate.unmber)]
             public int TaskNumber { get; set; } = 5;
 
             /// <summary>
@@ -49,8 +47,7 @@ namespace YSAI.Beckhoff
             /// </summary>
             [Description("任务处理间隔")]
             [Unit("ms")]
-            [Verify(@"^[0-9]*[1-9][0-9]*$", "输入有误")]
-            [Display(true, true, Core.data.ParamStructure.dataCate.unmber)]
+            [Display(true, true, true, Core.data.ParamStructure.dataCate.unmber)]
             public int TaskHandleInterval { get; set; } = 100;
         }
     }

+ 13 - 4
src/YSAI.DAQ/YSAI.Beckhoff/BeckhoffOperate.cs

@@ -773,16 +773,25 @@ namespace YSAI.Beckhoff
                     VerifyAttribute? verifyAttribute = typeof(BeckhoffData.Basics).GetProperty(lib.Name).GetCustomAttribute<VerifyAttribute>();
                     //单位特性
                     UnitAttribute? unitAttribute = typeof(BeckhoffData.Basics).GetProperty(lib.Name).GetCustomAttribute<UnitAttribute>();
+                    //描述上加单位
+                    string Describe = lib.Describe;
+                    if (unitAttribute != null && !string.IsNullOrWhiteSpace(unitAttribute.Unit))
+                    {
+                        Describe += $"({unitAttribute.Unit})";
+                    }
 
                     ParamStructure.subset.propertie propertie = new ParamStructure.subset.propertie
                     {
                         PropertyName = lib.Name,
-                        Description = lib.Describe,
-                        Show = displayAttribute?.Show,
-                        Use = displayAttribute?.Use,
-                        DataCate = displayAttribute?.DataCate,
+                        Description = Describe,
+                        Show = displayAttribute?.Show ?? false,
+                        Use = displayAttribute?.Use ?? false,
+                        MustFillIn = displayAttribute?.MustFillIn ?? false,
+                        DataCate = displayAttribute?.DataCate ?? null,
+
                         Regex = verifyAttribute?.Regex ?? null,
                         FailTips = verifyAttribute?.FailTips ?? null,
+
                         Default = Default
                     };
 

+ 1 - 1
src/YSAI.DAQ/YSAI.Core/YSAI.Core.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <Version>1.0.0.76</Version>
+    <Version>1.0.0.77</Version>
     <Authors>Shun</Authors>
     <Company>YSAI</Company>
     <Product>SCADA</Product>

+ 2 - 1
src/YSAI.DAQ/YSAI.Core/attribute/DisplayAttribute.cs

@@ -16,11 +16,12 @@ namespace YSAI.Core.attribute
         /// <param name="Show">是否显示</param>
         /// <param name="MustFillIn">必须填写</param>
         /// <param name="DataCate">数据类型</param>
-        public DisplayAttribute(bool Use, bool Show,bool MustFillIn, ParamStructure.dataCate DataCate)
+        public DisplayAttribute(bool Use, bool Show, bool MustFillIn, ParamStructure.dataCate DataCate)
         {
             this.Use = Use;
             this.Show = Show;
             this.DataCate = DataCate;
+            this.MustFillIn = MustFillIn;
         }
 
         /// <summary>