From 36a93ca92c13a18cbc142f244c75bfd72981e766 Mon Sep 17 00:00:00 2001 From: ouyangrui Date: Mon, 16 Mar 2026 13:25:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E5=BC=80=E5=90=AF=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=EF=BC=8C=E4=BF=AE=E6=94=B9:1.app.xaml=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E4=BA=86=E5=8A=A0=E5=AF=86=E7=8B=97=EF=BC=8C=E8=A6=81?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=B5=8B=E8=AF=95=202.=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E4=BA=86systemconfig=E7=9A=84=E8=B7=AF=E5=BE=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=203.=E6=9B=B4=E6=94=B9=E4=BA=86=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=EF=BC=8C4.=E4=BF=AE=E5=A4=8D=E4=BA=86?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=AE=BE=E5=A4=87=E6=8C=87=E4=BB=A4=E6=97=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=A8=E9=87=8A=E6=8F=90=E7=A4=BA(CommandTree?= =?UTF-8?q?=E9=87=8Cxml=E7=9B=B8=E5=85=B3=E6=96=B9=E6=B3=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 114 ++++++++++++++++++ ATS/App.xaml | 6 +- ATS/App.xaml.cs | 17 +-- ATS/{ATS.csproj => BDU.csproj} | 0 ATS/Converters/BoolInverseConverter.cs | 2 +- .../BooleanToVisibilityConverter.cs | 2 +- ATS/Converters/DeviceNameConverter.cs | 2 +- .../DeviceSettingWindowConverter.cs | 4 +- ATS/Converters/EnumValueConverter.cs | 2 +- ATS/Converters/EnumValuesConverter.cs | 2 +- ATS/Converters/FilteredParametersConverter.cs | 4 +- .../GuidToParameterNameConverter.cs | 4 +- ATS/Converters/HexConverter.cs | 2 +- ATS/Converters/HexToDecimalConverter.cs | 2 +- ATS/Converters/IsEnumTypeConverter .cs | 2 +- .../ParameterCategoryToStringConverter.cs | 4 +- .../ParameterCategoryToVisibilityConverter.cs | 4 +- .../ParameterToGotoSettingStringConverter.cs | 4 +- .../ParameterTypeToBoolConverter.cs | 2 +- .../ParameterValueToStringConverter.cs | 2 +- ATS/Converters/StepResultToStringConverter.cs | 2 +- ATS/Converters/StringToVisibilityConverter.cs | 2 +- ATS/Logic/DeviceConnect.cs | 8 +- ATS/Logic/StepRunning.cs | 12 +- ATS/Models/CANSignalModel.cs | 2 +- ATS/Models/DeviceConnectSettingModel.cs | 2 +- ATS/Models/DeviceModel.cs | 2 +- ATS/Models/MethodModel.cs | 2 +- ATS/Models/ParameterModel.cs | 2 +- ATS/Models/ProgramModel.cs | 2 +- ATS/Models/ReportModel.cs | 2 +- ATS/Models/StepModel.cs | 2 +- ATS/Models/SubProgramItem.cs | 2 +- ATS/Models/UserModel.cs | 2 +- ATS/SystemConfig.cs | 21 ++-- ATS/Tools/DataGridExportToExcel.cs | 2 +- ATS/Tools/ExpressionEvaluator.cs | 2 +- ATS/Tools/Log.cs | 2 +- ATS/Tools/SecurityDongle.cs | 2 +- ATS/Views/CANCatchSingalView.xaml | 4 +- ATS/Views/CANCatchSingalView.xaml.cs | 4 +- ATS/Views/CommandTreeView.xaml | 4 +- ATS/Views/CommandTreeView.xaml.cs | 14 +-- ATS/Views/LogArea.xaml | 4 +- ATS/Views/LogArea.xaml.cs | 4 +- ATS/Views/ParametersManager.xaml | 4 +- ATS/Views/ParametersManager.xaml.cs | 12 +- ATS/Views/SingleStepEdit.xaml | 6 +- ATS/Views/SingleStepEdit.xaml.cs | 8 +- ATS/Views/StepsManager.xaml | 4 +- ATS/Views/StepsManager.xaml.cs | 8 +- ATS/Views/ToolBar.xaml | 6 +- ATS/Views/ToolBar.xaml.cs | 12 +- ATS/Windows/DeviceManageWindow.xaml | 4 +- ATS/Windows/DeviceManageWindow.xaml.cs | 6 +- ATS/Windows/DeviceSettingWindow.xaml | 4 +- ATS/Windows/DeviceSettingWindow.xaml.cs | 7 +- ATS/Windows/Login.xaml | 20 +-- ATS/Windows/Login.xaml.cs | 7 +- ATS/Windows/MainWindow.xaml | 8 +- ATS/Windows/MainWindow.xaml.cs | 12 +- ATS/Windows/ParameterSettingWindow.xaml | 4 +- ATS/Windows/ParameterSettingWindow.xaml.cs | 6 +- ATS/Windows/SystemConfigWindow.xaml | 4 +- ATS/Windows/SystemConfigWindow.xaml.cs | 4 +- ATS/Windows/TestDataInfomationWindow.xaml | 4 +- ATS/Windows/TestDataInfomationWindow.xaml.cs | 4 +- ATS/Windows/UserSettingWindow.xaml | 4 +- ATS/Windows/UserSettingWindow.xaml.cs | 4 +- ATS/Windows/UsersManage.xaml | 4 +- ATS/Windows/UsersManage.xaml.cs | 4 +- ATS.sln => BDU.sln | 2 +- DeviceCommand/Device/AMETEKSGX.cs | 5 +- DeviceCommand/Device/IT_N6322B.cs | 54 ++++++--- DeviceCommand/Device/KeySight_Truevolt.cs | 1 - DeviceCommand/Device/RTM3004.cs | 100 +++++++++++---- 76 files changed, 407 insertions(+), 213 deletions(-) rename ATS/{ATS.csproj => BDU.csproj} (100%) rename ATS.sln => BDU.sln (97%) diff --git a/.editorconfig b/.editorconfig index cb53e99..89e663a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,3 +2,117 @@ # CA1416: 验证平台兼容性 dotnet_diagnostic.CA1416.severity = silent + +[*.cs] +#### 命名样式 #### + +# 命名规则 + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# 符号规范 + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# 命名样式 + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case +csharp_using_directive_placement = outside_namespace:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_conditional_delegate_call = true:suggestion +csharp_style_var_for_built_in_types = false:silent + +[*.vb] +#### 命名样式 #### + +# 命名规则 + +dotnet_naming_rule.interface_should_be_以_i_开始.severity = suggestion +dotnet_naming_rule.interface_should_be_以_i_开始.symbols = interface +dotnet_naming_rule.interface_should_be_以_i_开始.style = 以_i_开始 + +dotnet_naming_rule.类型_should_be_帕斯卡拼写法.severity = suggestion +dotnet_naming_rule.类型_should_be_帕斯卡拼写法.symbols = 类型 +dotnet_naming_rule.类型_should_be_帕斯卡拼写法.style = 帕斯卡拼写法 + +dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.severity = suggestion +dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.symbols = 非字段成员 +dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.style = 帕斯卡拼写法 + +# 符号规范 + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.类型.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.类型.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected +dotnet_naming_symbols.类型.required_modifiers = + +dotnet_naming_symbols.非字段成员.applicable_kinds = property, event, method +dotnet_naming_symbols.非字段成员.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected +dotnet_naming_symbols.非字段成员.required_modifiers = + +# 命名样式 + +dotnet_naming_style.以_i_开始.required_prefix = I +dotnet_naming_style.以_i_开始.required_suffix = +dotnet_naming_style.以_i_开始.word_separator = +dotnet_naming_style.以_i_开始.capitalization = pascal_case + +dotnet_naming_style.帕斯卡拼写法.required_prefix = +dotnet_naming_style.帕斯卡拼写法.required_suffix = +dotnet_naming_style.帕斯卡拼写法.word_separator = +dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case + +dotnet_naming_style.帕斯卡拼写法.required_prefix = +dotnet_naming_style.帕斯卡拼写法.required_suffix = +dotnet_naming_style.帕斯卡拼写法.word_separator = +dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case + +[*.{cs,vb}] +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_property = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_event = false:silent +end_of_line = crlf \ No newline at end of file diff --git a/ATS/App.xaml b/ATS/App.xaml index 2d2c712..9fcedbc 100644 --- a/ATS/App.xaml +++ b/ATS/App.xaml @@ -1,8 +1,8 @@ - diff --git a/ATS/App.xaml.cs b/ATS/App.xaml.cs index fcaad57..721c44c 100644 --- a/ATS/App.xaml.cs +++ b/ATS/App.xaml.cs @@ -1,9 +1,9 @@ -using ATS.Tools; +using BDU.Tools; using System.Configuration; using System.Data; using System.Windows; -namespace ATS +namespace BDU { /// /// Interaction logic for App.xaml @@ -12,12 +12,13 @@ namespace ATS { protected override void OnStartup(StartupEventArgs e) { - if (SecurityDongle.Verify() <= 0) - { - MessageBox.Show("加密狗到期或检测失败!\n"); - App.Current.Shutdown(); - return; - } + //先注释加密狗,要进行测试 + //if (SecurityDongle.Verify() <= 0) + //{ + // MessageBox.Show("加密狗到期或检测失败!\n"); + // App.Current.Shutdown(); + // return; + //} base.OnStartup(e); } } diff --git a/ATS/ATS.csproj b/ATS/BDU.csproj similarity index 100% rename from ATS/ATS.csproj rename to ATS/BDU.csproj diff --git a/ATS/Converters/BoolInverseConverter.cs b/ATS/Converters/BoolInverseConverter.cs index 05cdccf..aeca2dd 100644 --- a/ATS/Converters/BoolInverseConverter.cs +++ b/ATS/Converters/BoolInverseConverter.cs @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class BoolInverseConverter : IValueConverter { diff --git a/ATS/Converters/BooleanToVisibilityConverter.cs b/ATS/Converters/BooleanToVisibilityConverter.cs index a93f291..163bba3 100644 --- a/ATS/Converters/BooleanToVisibilityConverter.cs +++ b/ATS/Converters/BooleanToVisibilityConverter.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class BooleanToVisibilityConverter : IValueConverter { diff --git a/ATS/Converters/DeviceNameConverter.cs b/ATS/Converters/DeviceNameConverter.cs index 1f8087e..a55579b 100644 --- a/ATS/Converters/DeviceNameConverter.cs +++ b/ATS/Converters/DeviceNameConverter.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class DeviceNameConverter : IValueConverter { diff --git a/ATS/Converters/DeviceSettingWindowConverter.cs b/ATS/Converters/DeviceSettingWindowConverter.cs index 8b80a76..0bcbdce 100644 --- a/ATS/Converters/DeviceSettingWindowConverter.cs +++ b/ATS/Converters/DeviceSettingWindowConverter.cs @@ -1,4 +1,4 @@ -using ATS.Models; +using BDU.Models; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -9,7 +9,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class DeviceSettingWindowConverter : IValueConverter { diff --git a/ATS/Converters/EnumValueConverter.cs b/ATS/Converters/EnumValueConverter.cs index 9bcef69..69a58d3 100644 --- a/ATS/Converters/EnumValueConverter.cs +++ b/ATS/Converters/EnumValueConverter.cs @@ -3,7 +3,7 @@ using System.Globalization; using System.Linq; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class EnumValueConverter : IMultiValueConverter { diff --git a/ATS/Converters/EnumValuesConverter.cs b/ATS/Converters/EnumValuesConverter.cs index 51b5807..0cf6480 100644 --- a/ATS/Converters/EnumValuesConverter.cs +++ b/ATS/Converters/EnumValuesConverter.cs @@ -2,7 +2,7 @@ using System.Globalization; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class EnumValuesConverter : IValueConverter { diff --git a/ATS/Converters/FilteredParametersConverter.cs b/ATS/Converters/FilteredParametersConverter.cs index 531218c..b80ab19 100644 --- a/ATS/Converters/FilteredParametersConverter.cs +++ b/ATS/Converters/FilteredParametersConverter.cs @@ -1,10 +1,10 @@ -using ATS.Models; +using BDU.Models; using System; using System.Globalization; using System.Linq; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class FilteredParametersConverter : IMultiValueConverter { diff --git a/ATS/Converters/GuidToParameterNameConverter.cs b/ATS/Converters/GuidToParameterNameConverter.cs index 89a1b1d..15686c6 100644 --- a/ATS/Converters/GuidToParameterNameConverter.cs +++ b/ATS/Converters/GuidToParameterNameConverter.cs @@ -1,4 +1,4 @@ -using ATS.Windows; +using BDU.Windows; using System; using System.Collections.Generic; using System.Globalization; @@ -7,7 +7,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class GuidToParameterNameConverter : IValueConverter { diff --git a/ATS/Converters/HexConverter.cs b/ATS/Converters/HexConverter.cs index 78d7512..ec87fc3 100644 --- a/ATS/Converters/HexConverter.cs +++ b/ATS/Converters/HexConverter.cs @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class HexConverter : IValueConverter { diff --git a/ATS/Converters/HexToDecimalConverter.cs b/ATS/Converters/HexToDecimalConverter.cs index 17bcd14..6e0f606 100644 --- a/ATS/Converters/HexToDecimalConverter.cs +++ b/ATS/Converters/HexToDecimalConverter.cs @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class HexToDecimalConverter : IValueConverter { diff --git a/ATS/Converters/IsEnumTypeConverter .cs b/ATS/Converters/IsEnumTypeConverter .cs index 00eedb1..ba24ae4 100644 --- a/ATS/Converters/IsEnumTypeConverter .cs +++ b/ATS/Converters/IsEnumTypeConverter .cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class IsEnumTypeConverter : IValueConverter { diff --git a/ATS/Converters/ParameterCategoryToStringConverter.cs b/ATS/Converters/ParameterCategoryToStringConverter.cs index d1d4c76..5ec2fbc 100644 --- a/ATS/Converters/ParameterCategoryToStringConverter.cs +++ b/ATS/Converters/ParameterCategoryToStringConverter.cs @@ -5,9 +5,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; -using static ATS.Models.ParameterModel; +using static BDU.Models.ParameterModel; -namespace ATS.Converters +namespace BDU.Converters { public class ParameterCategoryToStringConverter : IValueConverter { diff --git a/ATS/Converters/ParameterCategoryToVisibilityConverter.cs b/ATS/Converters/ParameterCategoryToVisibilityConverter.cs index 6ed94fc..6ab546f 100644 --- a/ATS/Converters/ParameterCategoryToVisibilityConverter.cs +++ b/ATS/Converters/ParameterCategoryToVisibilityConverter.cs @@ -6,9 +6,9 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -using static ATS.Models.ParameterModel; +using static BDU.Models.ParameterModel; -namespace ATS.Converters +namespace BDU.Converters { public class ParameterCategoryToVisibilityConverter : IValueConverter { diff --git a/ATS/Converters/ParameterToGotoSettingStringConverter.cs b/ATS/Converters/ParameterToGotoSettingStringConverter.cs index 58e903a..84673b5 100644 --- a/ATS/Converters/ParameterToGotoSettingStringConverter.cs +++ b/ATS/Converters/ParameterToGotoSettingStringConverter.cs @@ -1,4 +1,4 @@ -using ATS.Windows; +using BDU.Windows; using System; using System.Collections.Generic; using System.Globalization; @@ -8,7 +8,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { internal class ParameterToGotoSettingStringConverter : IValueConverter { diff --git a/ATS/Converters/ParameterTypeToBoolConverter.cs b/ATS/Converters/ParameterTypeToBoolConverter.cs index f00819c..669bfde 100644 --- a/ATS/Converters/ParameterTypeToBoolConverter.cs +++ b/ATS/Converters/ParameterTypeToBoolConverter.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class ParameterTypeToBoolConverter : IValueConverter { diff --git a/ATS/Converters/ParameterValueToStringConverter.cs b/ATS/Converters/ParameterValueToStringConverter.cs index 20b393a..ed542ac 100644 --- a/ATS/Converters/ParameterValueToStringConverter.cs +++ b/ATS/Converters/ParameterValueToStringConverter.cs @@ -8,7 +8,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class ParameterValueToStringConverter : IValueConverter { diff --git a/ATS/Converters/StepResultToStringConverter.cs b/ATS/Converters/StepResultToStringConverter.cs index 015edb1..2eae231 100644 --- a/ATS/Converters/StepResultToStringConverter.cs +++ b/ATS/Converters/StepResultToStringConverter.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class StepResultToStringConverter : IValueConverter { diff --git a/ATS/Converters/StringToVisibilityConverter.cs b/ATS/Converters/StringToVisibilityConverter.cs index 29c5c7b..41741fb 100644 --- a/ATS/Converters/StringToVisibilityConverter.cs +++ b/ATS/Converters/StringToVisibilityConverter.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -namespace ATS.Converters +namespace BDU.Converters { public class StringToVisibilityConverter : IValueConverter { diff --git a/ATS/Logic/DeviceConnect.cs b/ATS/Logic/DeviceConnect.cs index 356804b..77aae4c 100644 --- a/ATS/Logic/DeviceConnect.cs +++ b/ATS/Logic/DeviceConnect.cs @@ -1,6 +1,6 @@ -using ATS.Models; -using ATS.Tools; -using ATS.Windows; +using BDU.Models; +using BDU.Tools; +using BDU.Windows; using DeviceCommand.Base; using DocumentFormat.OpenXml.Drawing.Charts; using Newtonsoft.Json; @@ -13,7 +13,7 @@ using System.Threading.Tasks; using System.Windows; using TSMasterCAN; -namespace ATS.Logic +namespace BDU.Logic { public static class DeviceConnect { diff --git a/ATS/Logic/StepRunning.cs b/ATS/Logic/StepRunning.cs index 503c70e..2b9b0b8 100644 --- a/ATS/Logic/StepRunning.cs +++ b/ATS/Logic/StepRunning.cs @@ -1,7 +1,7 @@ -using ATS.Models; -using ATS.Tools; -using ATS.Views; -using ATS.Windows; +using BDU.Models; +using BDU.Tools; +using BDU.Views; +using BDU.Windows; using ATS_DBContext; using ATS_DBContext.Models; using ControlzEx.Standard; @@ -17,9 +17,9 @@ using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; using System.Windows; -using static ATS.Models.ParameterModel; +using static BDU.Models.ParameterModel; -namespace ATS.Logic +namespace BDU.Logic { public static class StepRunning { diff --git a/ATS/Models/CANSignalModel.cs b/ATS/Models/CANSignalModel.cs index 2c42b83..429b99b 100644 --- a/ATS/Models/CANSignalModel.cs +++ b/ATS/Models/CANSignalModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { public class CANSignalModel { diff --git a/ATS/Models/DeviceConnectSettingModel.cs b/ATS/Models/DeviceConnectSettingModel.cs index 8045f88..4e6ea63 100644 --- a/ATS/Models/DeviceConnectSettingModel.cs +++ b/ATS/Models/DeviceConnectSettingModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { public class DeviceConnectSettingModel { diff --git a/ATS/Models/DeviceModel.cs b/ATS/Models/DeviceModel.cs index 6b720c8..164f7e2 100644 --- a/ATS/Models/DeviceModel.cs +++ b/ATS/Models/DeviceModel.cs @@ -7,7 +7,7 @@ using System.Reflection.Metadata; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { [AddINotifyPropertyChangedInterface] public class DeviceModel diff --git a/ATS/Models/MethodModel.cs b/ATS/Models/MethodModel.cs index 334b71b..28ab0ab 100644 --- a/ATS/Models/MethodModel.cs +++ b/ATS/Models/MethodModel.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { [AddINotifyPropertyChangedInterface] public class MethodModel diff --git a/ATS/Models/ParameterModel.cs b/ATS/Models/ParameterModel.cs index 53aa7e5..b721777 100644 --- a/ATS/Models/ParameterModel.cs +++ b/ATS/Models/ParameterModel.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { [AddINotifyPropertyChangedInterface] public class ParameterModel diff --git a/ATS/Models/ProgramModel.cs b/ATS/Models/ProgramModel.cs index a5074ec..cd0b2a6 100644 --- a/ATS/Models/ProgramModel.cs +++ b/ATS/Models/ProgramModel.cs @@ -7,7 +7,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Controls; -namespace ATS.Models +namespace BDU.Models { [AddINotifyPropertyChangedInterface] public class ProgramModel diff --git a/ATS/Models/ReportModel.cs b/ATS/Models/ReportModel.cs index c6e6975..47ca5ce 100644 --- a/ATS/Models/ReportModel.cs +++ b/ATS/Models/ReportModel.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { public enum IsPass { diff --git a/ATS/Models/StepModel.cs b/ATS/Models/StepModel.cs index 03398a0..89a2830 100644 --- a/ATS/Models/StepModel.cs +++ b/ATS/Models/StepModel.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { [AddINotifyPropertyChangedInterface] public class StepModel diff --git a/ATS/Models/SubProgramItem.cs b/ATS/Models/SubProgramItem.cs index 55b28bd..37bc5e0 100644 --- a/ATS/Models/SubProgramItem.cs +++ b/ATS/Models/SubProgramItem.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { public class SubProgramItem { diff --git a/ATS/Models/UserModel.cs b/ATS/Models/UserModel.cs index 11e2987..5b7e18a 100644 --- a/ATS/Models/UserModel.cs +++ b/ATS/Models/UserModel.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ATS.Models +namespace BDU.Models { [AddINotifyPropertyChangedInterface] public class UserModel diff --git a/ATS/SystemConfig.cs b/ATS/SystemConfig.cs index b727555..9e757a7 100644 --- a/ATS/SystemConfig.cs +++ b/ATS/SystemConfig.cs @@ -1,10 +1,10 @@ -using ATS.Tools; +using BDU.Tools; using Newtonsoft.Json; using System; using System.IO; using System.Reflection; -namespace ATS +namespace BDU { public class SystemConfig { @@ -29,24 +29,27 @@ namespace ATS } [JsonIgnore] - public string SystemPath { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ATS系统"); + public string SystemPath { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "BDU系统"); public int PerformanceLevel { get; set; } = 50; - public string LogFilePath { get; set; } = @"D:\ATS\日志\"; + public string LogFilePath { get; set; } = @"D:\BDU\日志\"; - public string DLLFilePath { get; set; } = @"D:\ATS\指令\"; + public string DLLFilePath { get; set; } = @"D:\BDU\指令\"; - public string SubProgramFilePath { get; set; } = @"D:\ATS\子程序\"; + public string SubProgramFilePath { get; set; } = @"D:\BDU\子程序\"; - public string PreDefineDevicesPath { get; set; } = @"D:\ATS\设备预设\PreDefineDevices.json"; + public string PreDefineDevicesPath { get; set; } = @"D:\BDU\设备预设\PreDefineDevices.json"; - public string DBCFilePath { get; set; } = @"D:\ATS\DBC文件\ZSDB123500_HY11_HS11_800V_ADCU20_HVEnergeCAN_230901_Fit.dbc"; + public string DBCFilePath { get; set; } = @"D:\BDU\DBC文件\ZSDB123500_HY11_HS11_800V_ADCU20_HVEnergeCAN_230901_Fit.dbc"; public string DefaultSubProgramFilePath { get; set; } = ""; // 配置加载方法 public void LoadFromFile() { + if (!Directory.Exists(SystemPath)) + Directory.CreateDirectory(SystemPath); + string configPath = Path.Combine(SystemPath, "system.config"); if (!File.Exists(configPath)) @@ -83,7 +86,7 @@ namespace ATS { if (!Directory.Exists(SystemPath)) Directory.CreateDirectory(SystemPath); - + string configPath = Path.Combine(SystemPath, "system.config"); string json = JsonConvert.SerializeObject(this, Formatting.Indented); diff --git a/ATS/Tools/DataGridExportToExcel.cs b/ATS/Tools/DataGridExportToExcel.cs index 1ea9712..d0adfe4 100644 --- a/ATS/Tools/DataGridExportToExcel.cs +++ b/ATS/Tools/DataGridExportToExcel.cs @@ -14,7 +14,7 @@ using System.Windows.Controls; using System.Windows.Data; using VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment; -namespace ATS.Tools +namespace BDU.Tools { public static class DataGridExportToExcel { diff --git a/ATS/Tools/ExpressionEvaluator.cs b/ATS/Tools/ExpressionEvaluator.cs index 559035b..1952292 100644 --- a/ATS/Tools/ExpressionEvaluator.cs +++ b/ATS/Tools/ExpressionEvaluator.cs @@ -6,7 +6,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using NCalc; -namespace ATS.Tools +namespace BDU.Tools { public class ExpressionEvaluator { diff --git a/ATS/Tools/Log.cs b/ATS/Tools/Log.cs index 188ae06..7cddb9d 100644 --- a/ATS/Tools/Log.cs +++ b/ATS/Tools/Log.cs @@ -5,7 +5,7 @@ using System.Text; using System.Windows.Media; using System.Windows.Threading; -namespace ATS.Tools +namespace BDU.Tools { public static class Log { diff --git a/ATS/Tools/SecurityDongle.cs b/ATS/Tools/SecurityDongle.cs index 926828b..847cb75 100644 --- a/ATS/Tools/SecurityDongle.cs +++ b/ATS/Tools/SecurityDongle.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using System.Windows; using 加密狗; -namespace ATS.Tools +namespace BDU.Tools { public class SecurityDongle { diff --git a/ATS/Views/CANCatchSingalView.xaml b/ATS/Views/CANCatchSingalView.xaml index 2d51aac..a4615bb 100644 --- a/ATS/Views/CANCatchSingalView.xaml +++ b/ATS/Views/CANCatchSingalView.xaml @@ -1,11 +1,11 @@ - diff --git a/ATS/Views/CANCatchSingalView.xaml.cs b/ATS/Views/CANCatchSingalView.xaml.cs index c4491cd..747f4d1 100644 --- a/ATS/Views/CANCatchSingalView.xaml.cs +++ b/ATS/Views/CANCatchSingalView.xaml.cs @@ -1,4 +1,4 @@ -using ATS.Models; +using BDU.Models; using MahApps.Metro.Controls; using PropertyChanged; using System; @@ -17,7 +17,7 @@ using System.Windows.Media.Imaging; using System.Windows.Shapes; using TSMasterCAN; -namespace ATS.Views +namespace BDU.Views { /// /// CANCatchSingalView.xaml 的交互逻辑 diff --git a/ATS/Views/CommandTreeView.xaml b/ATS/Views/CommandTreeView.xaml index 825bc9b..ccc0f42 100644 --- a/ATS/Views/CommandTreeView.xaml +++ b/ATS/Views/CommandTreeView.xaml @@ -1,9 +1,9 @@ - /// CommandTreeView.xaml 的交互逻辑 @@ -125,7 +125,7 @@ namespace ATS.Views var parameters = method.GetParameters(); if (parameters.Length > 0) { - memberName += "(" + string.Join(",", parameters.Select(p => p.ParameterType.FullName)) + ")"; + memberName += "(" + string.Join(",", parameters.Select(p => p.ParameterType.FullName?.Replace('+', '.'))) + ")"; } // 查找注释节点 diff --git a/ATS/Views/LogArea.xaml b/ATS/Views/LogArea.xaml index 438dc83..5e13582 100644 --- a/ATS/Views/LogArea.xaml +++ b/ATS/Views/LogArea.xaml @@ -1,9 +1,9 @@  /// ParametersManager.xaml 的交互逻辑 diff --git a/ATS/Views/SingleStepEdit.xaml b/ATS/Views/SingleStepEdit.xaml index 2d6bd4f..6cab769 100644 --- a/ATS/Views/SingleStepEdit.xaml +++ b/ATS/Views/SingleStepEdit.xaml @@ -1,11 +1,11 @@  /// SingleStepEdit.xaml 的交互逻辑 diff --git a/ATS/Views/StepsManager.xaml b/ATS/Views/StepsManager.xaml index 0881b9c..744ff7a 100644 --- a/ATS/Views/StepsManager.xaml +++ b/ATS/Views/StepsManager.xaml @@ -1,9 +1,9 @@ - /// StepsManager.xaml 的交互逻辑 diff --git a/ATS/Views/ToolBar.xaml b/ATS/Views/ToolBar.xaml index cc4edfa..0d9dc9c 100644 --- a/ATS/Views/ToolBar.xaml +++ b/ATS/Views/ToolBar.xaml @@ -1,11 +1,11 @@ - /// ToolBar.xaml 的交互逻辑 diff --git a/ATS/Windows/DeviceManageWindow.xaml b/ATS/Windows/DeviceManageWindow.xaml index f5ccb89..cb1394d 100644 --- a/ATS/Windows/DeviceManageWindow.xaml +++ b/ATS/Windows/DeviceManageWindow.xaml @@ -1,10 +1,10 @@ - /// DeviceManageWindow.xaml 的交互逻辑 diff --git a/ATS/Windows/DeviceSettingWindow.xaml b/ATS/Windows/DeviceSettingWindow.xaml index 9adf68f..8f0c750 100644 --- a/ATS/Windows/DeviceSettingWindow.xaml +++ b/ATS/Windows/DeviceSettingWindow.xaml @@ -1,10 +1,10 @@ - /// DeviceSettingWindow.xaml 的交互逻辑 @@ -206,11 +206,12 @@ namespace ATS.Windows { try { + string filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SystemConfig.Instance.PreDefineDevicesPath); if (!System.IO.File.Exists(filePath)) { - // 如果文件不存在,创建一个空的配置文件 + // 如果文件不存在,创建一个空的配置文件 var emptyList = new ObservableCollection(); string json = JsonConvert.SerializeObject(emptyList, Formatting.Indented); System.IO.File.WriteAllText(filePath, json); diff --git a/ATS/Windows/Login.xaml b/ATS/Windows/Login.xaml index 6e7b424..3066793 100644 --- a/ATS/Windows/Login.xaml +++ b/ATS/Windows/Login.xaml @@ -1,13 +1,13 @@  + + + + @@ -73,7 +77,7 @@ CornerRadius="5" BorderThickness="1" BorderBrush="#E0E0E0" - Padding="30,20"> + Padding="30,20" Grid.ColumnSpan="2"> @@ -144,11 +148,11 @@ - + HorizontalAlignment="Left" + Margin="123,10,0,10" Grid.Column="1" /> \ No newline at end of file diff --git a/ATS/Windows/Login.xaml.cs b/ATS/Windows/Login.xaml.cs index 0c4eadc..d807fb7 100644 --- a/ATS/Windows/Login.xaml.cs +++ b/ATS/Windows/Login.xaml.cs @@ -1,5 +1,5 @@ -using ATS.Models; -using ATS.Windows; +using BDU.Models; +using BDU.Windows; using MahApps.Metro.Controls; using System; using System.Collections.Generic; @@ -19,7 +19,7 @@ using System.Windows.Media.Imaging; using System.Windows.Shapes; using Path = System.IO.Path; -namespace ATS.Windows +namespace BDU.Windows { /// /// Login.xaml 的交互逻辑 @@ -51,6 +51,7 @@ namespace ATS.Windows UserList.Add(new() { UserName = "超级管理员", + UserAccount ="admin", UserId = Guid.NewGuid(), PassWord = "admin", Role = 2 diff --git a/ATS/Windows/MainWindow.xaml b/ATS/Windows/MainWindow.xaml index dd27d7c..1aae898 100644 --- a/ATS/Windows/MainWindow.xaml +++ b/ATS/Windows/MainWindow.xaml @@ -1,16 +1,16 @@ - diff --git a/ATS/Windows/MainWindow.xaml.cs b/ATS/Windows/MainWindow.xaml.cs index cc081ca..e86664b 100644 --- a/ATS/Windows/MainWindow.xaml.cs +++ b/ATS/Windows/MainWindow.xaml.cs @@ -1,5 +1,5 @@ -using ATS.Models; -using ATS.Tools; +using BDU.Models; +using BDU.Tools; using MahApps.Metro.Controls; using MathNet.Numerics; using Microsoft.Win32; @@ -22,7 +22,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; -namespace ATS.Windows +namespace BDU.Windows { /// /// MainWindow.xaml 的交互逻辑 @@ -163,7 +163,7 @@ namespace ATS.Windows Title = $"{parentPath} > {subProgramName}"; // 通知 StepsManager 更新 Title 显示子程序名称 - ATS.Views.StepsManager.Instance?.UpdateTitle(subProgramName); + BDU.Views.StepsManager.Instance?.UpdateTitle(subProgramName); } @@ -203,12 +203,12 @@ namespace ATS.Windows if (_isInSubProgramMode && _currentSubProgramNameStack.Count > 0) { // 如果还在子程序模式中(多层嵌套),显示上一层子程序名称 - ATS.Views.StepsManager.Instance?.UpdateTitle(_currentSubProgramNameStack.Peek()); + BDU.Views.StepsManager.Instance?.UpdateTitle(_currentSubProgramNameStack.Peek()); } else { // 返回主程序 - ATS.Views.StepsManager.Instance?.UpdateTitle(); + BDU.Views.StepsManager.Instance?.UpdateTitle(); } } } diff --git a/ATS/Windows/ParameterSettingWindow.xaml b/ATS/Windows/ParameterSettingWindow.xaml index 18435ad..aa023bf 100644 --- a/ATS/Windows/ParameterSettingWindow.xaml +++ b/ATS/Windows/ParameterSettingWindow.xaml @@ -1,8 +1,8 @@ - /// ParameterSettingWindow.xaml 的交互逻辑 diff --git a/ATS/Windows/SystemConfigWindow.xaml b/ATS/Windows/SystemConfigWindow.xaml index 99288f5..0ef8c14 100644 --- a/ATS/Windows/SystemConfigWindow.xaml +++ b/ATS/Windows/SystemConfigWindow.xaml @@ -1,10 +1,10 @@ - /// UsersAdd.xaml 的交互逻辑 diff --git a/ATS/Windows/UsersManage.xaml b/ATS/Windows/UsersManage.xaml index 50f810c..230b70e 100644 --- a/ATS/Windows/UsersManage.xaml +++ b/ATS/Windows/UsersManage.xaml @@ -1,10 +1,10 @@  /// UsersManage.xaml 的交互逻辑 diff --git a/ATS.sln b/BDU.sln similarity index 97% rename from ATS.sln rename to BDU.sln index 349e881..969ad85 100644 --- a/ATS.sln +++ b/BDU.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.14.36221.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ATS", "ATS\ATS.csproj", "{000A2999-6535-43D3-94DA-EE372D19702F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BDU", "ATS\BDU.csproj", "{000A2999-6535-43D3-94DA-EE372D19702F}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{AEA71207-A57F-424A-9AA0-9AC9A4B681F1}" EndProject diff --git a/DeviceCommand/Device/AMETEKSGX.cs b/DeviceCommand/Device/AMETEKSGX.cs index 256b83d..43070b2 100644 --- a/DeviceCommand/Device/AMETEKSGX.cs +++ b/DeviceCommand/Device/AMETEKSGX.cs @@ -13,9 +13,12 @@ namespace DeviceCommand.Device /// 直流电源——阿美泰克直流电源 /// [ATSCommand] - [DeviceCategory("阿美泰克直流电源\r\n")] + [DeviceCategory("阿美泰克直流电源")] public class AMETEKSGX : Tcp { + /// + /// 信号量锁 + /// public SemaphoreSlim semaphoreSlimLock { get; set; } = new(1, 1); /// diff --git a/DeviceCommand/Device/IT_N6322B.cs b/DeviceCommand/Device/IT_N6322B.cs index f4dec6f..e8d639c 100644 --- a/DeviceCommand/Device/IT_N6322B.cs +++ b/DeviceCommand/Device/IT_N6322B.cs @@ -16,11 +16,28 @@ namespace DeviceCommand.Device [DeviceCategory("三通道可编程直流电源")] public class IT_N6322B : Tcp { + /// + /// 信号量锁 + /// public SemaphoreSlim semaphoreSlimLock { get; set; } = new(1, 1); + /// + /// 通道枚举 + /// public enum ChannelList_Enum { - CH1 = 1, CH2 = 2, CH3 = 3 + /// + /// 通道1 + /// + CH1 = 1, + /// + /// 通道2 + /// + CH2 = 2, + /// + /// 通道3 + /// + CH3 = 3 } @@ -32,6 +49,7 @@ namespace DeviceCommand.Device /// public async Task Set_RemoteMode(Tcp client, CancellationToken ct = default) { + await semaphoreSlimLock.WaitAsync(ct); try { await SendAsync(client, $"SYST:REM\n", ct); @@ -69,15 +87,17 @@ namespace DeviceCommand.Device } } + + /// - /// 设置源指定通道对应通道输出电压 + /// 设置源指定通道过电压保护电平 /// /// 设备 /// 通道 - /// 电压 + /// 输出频率 /// 支持中途取消发送指令 /// - public async Task Set_OutputVoltage(Tcp client, ChannelList_Enum channel, float voltage, CancellationToken ct = default) + public async Task Set_OutputITVoltage(Tcp client, ChannelList_Enum channel, float voltage, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -103,7 +123,7 @@ namespace DeviceCommand.Device /// 输出频率 /// 支持中途取消发送指令 /// - public async Task Set_MaxVoltage(Tcp client, ChannelList_Enum channel, float voltage, CancellationToken ct = default) + public async Task Set_MaxITVoltage(Tcp client, ChannelList_Enum channel, float voltage, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -129,7 +149,7 @@ namespace DeviceCommand.Device /// 输出频率 /// 支持中途取消发送指令 /// - public async Task Set_OutputCurrent(Tcp client, ChannelList_Enum channel, float current, CancellationToken ct = default) + public async Task Set_OutputITCurrent(Tcp client, ChannelList_Enum channel, float current, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -155,7 +175,7 @@ namespace DeviceCommand.Device /// 电压 /// 支持中途取消发送指令 /// - public async Task Set_MaxCurrent(Tcp client, ChannelList_Enum channel, float current, CancellationToken ct = default) + public async Task Set_MaxITCurrent(Tcp client, ChannelList_Enum channel, float current, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -182,7 +202,7 @@ namespace DeviceCommand.Device /// 电流 /// 支持中途取消发送指令 /// - public async Task Set_MaxCurrent(Tcp client, ChannelList_Enum channel, float voltage, float current, CancellationToken ct = default) + public async Task Set_CurrentAndVoltage(Tcp client, ChannelList_Enum channel, float voltage, float current, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -207,7 +227,7 @@ namespace DeviceCommand.Device /// 通道 /// 取消令牌 /// 返回值是:定通道电源输出的实际电压值 (Amps) - public async Task QueryVoltage(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) + public async Task Query_ITVoltage(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -230,7 +250,7 @@ namespace DeviceCommand.Device /// 通道 /// 取消令牌 /// 返回值是:设置的电流值 (Amps) - public async Task QueryCurrent(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) + public async Task Query_ITCurrent(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -251,7 +271,7 @@ namespace DeviceCommand.Device /// 通道 /// 取消令牌 /// 返回值是:指定通道电源输出的实际功率值 (Amps) - public async Task QueryPower(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) + public async Task Query_ITPower(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -273,7 +293,7 @@ namespace DeviceCommand.Device /// 通道 /// 支持中途取消发送指令 /// - public async Task Set_Power_ON(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) + public async Task Set_ITPower_ON(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -299,7 +319,7 @@ namespace DeviceCommand.Device /// 通道 /// 支持中途取消发送指令 /// - public async Task Set_Power_OFF(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) + public async Task Set_ITPower_OFF(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) { await semaphoreSlimLock.WaitAsync(ct); try @@ -316,11 +336,5 @@ namespace DeviceCommand.Device } } } - - - - - - - } + diff --git a/DeviceCommand/Device/KeySight_Truevolt.cs b/DeviceCommand/Device/KeySight_Truevolt.cs index 0f0632a..df7f1d6 100644 --- a/DeviceCommand/Device/KeySight_Truevolt.cs +++ b/DeviceCommand/Device/KeySight_Truevolt.cs @@ -185,7 +185,6 @@ namespace DeviceCommand.Device /// 启动DC电压和比例测量禁用或启用自动归零模式 /// /// 设备 - /// 量程 /// 支持中途取消发送指令 /// public async Task Start_VoltageDCAUTO_ZERO(Tcp client, CancellationToken ct = default) diff --git a/DeviceCommand/Device/RTM3004.cs b/DeviceCommand/Device/RTM3004.cs index f352c25..a812faa 100644 --- a/DeviceCommand/Device/RTM3004.cs +++ b/DeviceCommand/Device/RTM3004.cs @@ -32,20 +32,59 @@ namespace DeviceCommand.Device /// public enum ChannelName_Single_Enum { - CH1 = 1, CH2 = 2, CH3 = 3, CH4 = 4 + /// + /// 通道1 + /// + CH1 = 1, + /// + /// 通道2 + /// + CH2 = 2, + /// + /// 通道3 + /// + CH3 = 3, + /// + /// 通道4 + /// + CH4 = 4 } + /// - /// 测试项(1到9) + /// 测量项枚举,RTM3004支持8个独立的测量项 /// public enum Measurement_Enum { - MEAS1 = 1, MEAS2 = 2, MEAS3 = 3, MEAS4 = 4, MEAS5 = 5, MEAS6 = 6, MEAS7 = 7, MEAS8 = 8 + /// 测量项1 + MEAS1 = 1, + /// 测量项2 + MEAS2 = 2, + /// 测量项3 + MEAS3 = 3, + /// 测量项4 + MEAS4 = 4, + /// 测量项5 + MEAS5 = 5, + /// 测量项6 + MEAS6 = 6, + /// 测量项7 + MEAS7 = 7, + /// 测量项8 + MEAS8 = 8 } + + /// + /// 通道耦合模式枚举 + /// public enum CouplingMode { + /// 直流限制耦合 DCLimit, + /// 交流限制耦合 ACLimit, - GND, //手册有 GND 耦合 + /// 接地耦合,用于参考电平 + GND, + /// 直流耦合 DC } @@ -54,17 +93,25 @@ namespace DeviceCommand.Device /// public enum AcquisitionState { + /// 运行中,持续采集波形 RUN, - STOPping,//采集完成后停止采集 - COMPlete,//设置:不可用 - BREak//设置:立即中断当前采集 + /// 采集完成后停止采集 + STOPping, + /// 采集完成(设置:不可用) + COMPlete, + /// 立即中断当前采集 + BREak } + /// /// 带宽限制(手册 CH:BANdwidth 支持值) + /// public enum BandwidthLimit { - FULL,//使用全部带宽 - B20//频率限制为20 MHz。高频信号被移除以降低 + /// 使用全部带宽,无限制 + FULL, + /// 频率限制为20 MHz,高频信号被移除以降低噪声 + B20 } /// @@ -72,32 +119,39 @@ namespace DeviceCommand.Device /// public enum TriggerMode { - AUTO, // 自动 - NORMal, // 正常 + /// 自动模式,无触发时自动扫描 + AUTO, + /// 正常模式,仅在触发时采集 + NORMal, } /// - /// 触发模式(手册 TRIGger:A:MODe 支持值) + /// 触发斜率/边沿枚举 /// public enum Slope_Enum { - POSitive, //上升沿,正电压变化 - NEGative,//下降沿,负电压变化 - EITHer //上升和下降的边缘 - + /// 上升沿触发,检测电压正向变化 + POSitive, + /// 下降沿触发,检测电压负向变化 + NEGative, + /// 上升和下降沿都触发 + EITHer } - /// - /// 测试项信号水平的百分比(手册 TRIGger:A:MODe 支持值) + /// 参考电平百分比模式枚举 + /// 用于设置上升/下降时间测量的上下参考电平 /// public enum Relative_Mode { - TEN, //10, 50 and 90% - TWENty,// 20, 50 and 80% - FIVE,// 5, 50 and 95 % - USER//层级定义采用REFLevel参数 - + /// 10%、50%和90%参考电平 + TEN, + /// 20%、50%和80%参考电平 + TWENty, + /// 5%、50%和95%参考电平 + FIVE, + /// 用户自定义参考电平,需配合REFLevel参数使用 + USER } #endregion