Compare commits

...

3 Commits

80 changed files with 412 additions and 218 deletions

View File

@ -2,3 +2,117 @@
# CA1416: 验证平台兼容性 # CA1416: 验证平台兼容性
dotnet_diagnostic.CA1416.severity = silent 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

View File

@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.14.36221.1 VisualStudioVersion = 17.14.36221.1
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ATS", "ATS\ATS.csproj", "{000A2999-6535-43D3-94DA-EE372D19702F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{AEA71207-A57F-424A-9AA0-9AC9A4B681F1}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{AEA71207-A57F-424A-9AA0-9AC9A4B681F1}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceCommand", "DeviceCommand\DeviceCommand.csproj", "{13E7EF22-4595-D29C-1E97-91B321696C07}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceCommand", "DeviceCommand\DeviceCommand.csproj", "{13E7EF22-4595-D29C-1E97-91B321696C07}"
@ -22,16 +20,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "加密狗", "加密狗\加密狗.csproj", "{E4D76F6D-39C5-4F4F-B81A-31D9828A8CC6}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "加密狗", "加密狗\加密狗.csproj", "{E4D76F6D-39C5-4F4F-B81A-31D9828A8CC6}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BDU", "BDU\BDU.csproj", "{0C2B5CA2-D873-255B-1B76-741346ECA1BB}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{000A2999-6535-43D3-94DA-EE372D19702F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{000A2999-6535-43D3-94DA-EE372D19702F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{000A2999-6535-43D3-94DA-EE372D19702F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{000A2999-6535-43D3-94DA-EE372D19702F}.Release|Any CPU.Build.0 = Release|Any CPU
{AEA71207-A57F-424A-9AA0-9AC9A4B681F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AEA71207-A57F-424A-9AA0-9AC9A4B681F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEA71207-A57F-424A-9AA0-9AC9A4B681F1}.Debug|Any CPU.Build.0 = Debug|Any CPU {AEA71207-A57F-424A-9AA0-9AC9A4B681F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEA71207-A57F-424A-9AA0-9AC9A4B681F1}.Release|Any CPU.ActiveCfg = Release|Any CPU {AEA71207-A57F-424A-9AA0-9AC9A4B681F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -56,6 +52,10 @@ Global
{E4D76F6D-39C5-4F4F-B81A-31D9828A8CC6}.Debug|Any CPU.Build.0 = Debug|Any CPU {E4D76F6D-39C5-4F4F-B81A-31D9828A8CC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4D76F6D-39C5-4F4F-B81A-31D9828A8CC6}.Release|Any CPU.ActiveCfg = Release|Any CPU {E4D76F6D-39C5-4F4F-B81A-31D9828A8CC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4D76F6D-39C5-4F4F-B81A-31D9828A8CC6}.Release|Any CPU.Build.0 = Release|Any CPU {E4D76F6D-39C5-4F4F-B81A-31D9828A8CC6}.Release|Any CPU.Build.0 = Release|Any CPU
{0C2B5CA2-D873-255B-1B76-741346ECA1BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C2B5CA2-D873-255B-1B76-741346ECA1BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C2B5CA2-D873-255B-1B76-741346ECA1BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C2B5CA2-D873-255B-1B76-741346ECA1BB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -1,8 +1,8 @@
<Application x:Class="ATS.App" <Application x:Class="BDU.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ATS" xmlns:local="clr-namespace:BDU"
xmlns:converters="clr-namespace:ATS.Converters" xmlns:converters="clr-namespace:BDU.Converters"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
StartupUri="Windows/Login.xaml"> StartupUri="Windows/Login.xaml">

View File

@ -1,9 +1,9 @@
using ATS.Tools; using BDU.Tools;
using System.Configuration; using System.Configuration;
using System.Data; using System.Data;
using System.Windows; using System.Windows;
namespace ATS namespace BDU
{ {
/// <summary> /// <summary>
/// Interaction logic for App.xaml /// Interaction logic for App.xaml
@ -12,12 +12,13 @@ namespace ATS
{ {
protected override void OnStartup(StartupEventArgs e) protected override void OnStartup(StartupEventArgs e)
{ {
if (SecurityDongle.Verify() <= 0) //先注释加密狗,要进行测试
{ //if (SecurityDongle.Verify() <= 0)
MessageBox.Show("加密狗到期或检测失败!\n"); //{
App.Current.Shutdown(); // MessageBox.Show("加密狗到期或检测失败!\n");
return; // App.Current.Shutdown();
} // return;
//}
base.OnStartup(e); base.OnStartup(e);
} }
} }

View File

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class BoolInverseConverter : IValueConverter public class BoolInverseConverter : IValueConverter
{ {

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class BooleanToVisibilityConverter : IValueConverter public class BooleanToVisibilityConverter : IValueConverter
{ {

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class DeviceNameConverter : IValueConverter public class DeviceNameConverter : IValueConverter
{ {

View File

@ -1,4 +1,4 @@
using ATS.Models; using BDU.Models;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -9,7 +9,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class DeviceSettingWindowConverter : IValueConverter public class DeviceSettingWindowConverter : IValueConverter
{ {

View File

@ -3,7 +3,7 @@ using System.Globalization;
using System.Linq; using System.Linq;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class EnumValueConverter : IMultiValueConverter public class EnumValueConverter : IMultiValueConverter
{ {

View File

@ -2,7 +2,7 @@
using System.Globalization; using System.Globalization;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class EnumValuesConverter : IValueConverter public class EnumValuesConverter : IValueConverter
{ {

View File

@ -1,10 +1,10 @@
using ATS.Models; using BDU.Models;
using System; using System;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class FilteredParametersConverter : IMultiValueConverter public class FilteredParametersConverter : IMultiValueConverter
{ {

View File

@ -1,4 +1,4 @@
using ATS.Windows; using BDU.Windows;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
@ -7,7 +7,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class GuidToParameterNameConverter : IValueConverter public class GuidToParameterNameConverter : IValueConverter
{ {

View File

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class HexConverter : IValueConverter public class HexConverter : IValueConverter
{ {

View File

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class HexToDecimalConverter : IValueConverter public class HexToDecimalConverter : IValueConverter
{ {

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class IsEnumTypeConverter : IValueConverter public class IsEnumTypeConverter : IValueConverter
{ {

View File

@ -5,9 +5,9 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Data; using System.Windows.Data;
using static ATS.Models.ParameterModel; using static BDU.Models.ParameterModel;
namespace ATS.Converters namespace BDU.Converters
{ {
public class ParameterCategoryToStringConverter : IValueConverter public class ParameterCategoryToStringConverter : IValueConverter
{ {

View File

@ -6,9 +6,9 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
using static ATS.Models.ParameterModel; using static BDU.Models.ParameterModel;
namespace ATS.Converters namespace BDU.Converters
{ {
public class ParameterCategoryToVisibilityConverter : IValueConverter public class ParameterCategoryToVisibilityConverter : IValueConverter
{ {

View File

@ -1,4 +1,4 @@
using ATS.Windows; using BDU.Windows;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
@ -8,7 +8,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
internal class ParameterToGotoSettingStringConverter : IValueConverter internal class ParameterToGotoSettingStringConverter : IValueConverter
{ {

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class ParameterTypeToBoolConverter : IValueConverter public class ParameterTypeToBoolConverter : IValueConverter
{ {

View File

@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class ParameterValueToStringConverter : IValueConverter public class ParameterValueToStringConverter : IValueConverter
{ {

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class StepResultToStringConverter : IValueConverter public class StepResultToStringConverter : IValueConverter
{ {

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
namespace ATS.Converters namespace BDU.Converters
{ {
public class StringToVisibilityConverter : IValueConverter public class StringToVisibilityConverter : IValueConverter
{ {

View File

@ -1,6 +1,6 @@
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using ATS.Windows; using BDU.Windows;
using DeviceCommand.Base; using DeviceCommand.Base;
using DocumentFormat.OpenXml.Drawing.Charts; using DocumentFormat.OpenXml.Drawing.Charts;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -13,7 +13,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using TSMasterCAN; using TSMasterCAN;
namespace ATS.Logic namespace BDU.Logic
{ {
public static class DeviceConnect public static class DeviceConnect
{ {

View File

@ -1,7 +1,7 @@
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using ATS.Views; using BDU.Views;
using ATS.Windows; using BDU.Windows;
using ATS_DBContext; using ATS_DBContext;
using ATS_DBContext.Models; using ATS_DBContext.Models;
using ControlzEx.Standard; using ControlzEx.Standard;
@ -17,9 +17,9 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using static ATS.Models.ParameterModel; using static BDU.Models.ParameterModel;
namespace ATS.Logic namespace BDU.Logic
{ {
public static class StepRunning public static class StepRunning
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
public class CANSignalModel public class CANSignalModel
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
public class DeviceConnectSettingModel public class DeviceConnectSettingModel
{ {

View File

@ -7,7 +7,7 @@ using System.Reflection.Metadata;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
[AddINotifyPropertyChangedInterface] [AddINotifyPropertyChangedInterface]
public class DeviceModel public class DeviceModel

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
[AddINotifyPropertyChangedInterface] [AddINotifyPropertyChangedInterface]
public class MethodModel public class MethodModel

View File

@ -7,7 +7,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
[AddINotifyPropertyChangedInterface] [AddINotifyPropertyChangedInterface]
public class ParameterModel public class ParameterModel

View File

@ -7,7 +7,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
namespace ATS.Models namespace BDU.Models
{ {
[AddINotifyPropertyChangedInterface] [AddINotifyPropertyChangedInterface]
public class ProgramModel public class ProgramModel

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
public enum IsPass public enum IsPass
{ {

View File

@ -7,7 +7,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
[AddINotifyPropertyChangedInterface] [AddINotifyPropertyChangedInterface]
public class StepModel public class StepModel

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
public class SubProgramItem public class SubProgramItem
{ {

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ATS.Models namespace BDU.Models
{ {
[AddINotifyPropertyChangedInterface] [AddINotifyPropertyChangedInterface]
public class UserModel public class UserModel

View File

@ -1,10 +1,10 @@
using ATS.Tools; using BDU.Tools;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
namespace ATS namespace BDU
{ {
public class SystemConfig public class SystemConfig
{ {
@ -29,24 +29,27 @@ namespace ATS
} }
[JsonIgnore] [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 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 string DefaultSubProgramFilePath { get; set; } = "";
// 配置加载方法 // 配置加载方法
public void LoadFromFile() public void LoadFromFile()
{ {
if (!Directory.Exists(SystemPath))
Directory.CreateDirectory(SystemPath);
string configPath = Path.Combine(SystemPath, "system.config"); string configPath = Path.Combine(SystemPath, "system.config");
if (!File.Exists(configPath)) if (!File.Exists(configPath))
@ -83,7 +86,7 @@ namespace ATS
{ {
if (!Directory.Exists(SystemPath)) if (!Directory.Exists(SystemPath))
Directory.CreateDirectory(SystemPath); Directory.CreateDirectory(SystemPath);
string configPath = Path.Combine(SystemPath, "system.config"); string configPath = Path.Combine(SystemPath, "system.config");
string json = JsonConvert.SerializeObject(this, Formatting.Indented); string json = JsonConvert.SerializeObject(this, Formatting.Indented);

View File

@ -14,7 +14,7 @@ using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
using VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment; using VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment;
namespace ATS.Tools namespace BDU.Tools
{ {
public static class DataGridExportToExcel public static class DataGridExportToExcel
{ {

View File

@ -6,7 +6,7 @@ using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using NCalc; using NCalc;
namespace ATS.Tools namespace BDU.Tools
{ {
public class ExpressionEvaluator public class ExpressionEvaluator
{ {

View File

@ -5,7 +5,7 @@ using System.Text;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading; using System.Windows.Threading;
namespace ATS.Tools namespace BDU.Tools
{ {
public static class Log public static class Log
{ {

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using ; using ;
namespace ATS.Tools namespace BDU.Tools
{ {
public class SecurityDongle public class SecurityDongle
{ {

View File

@ -1,11 +1,11 @@
<mah:MetroWindow x:Class="ATS.Views.CANCatchSingalView" <mah:MetroWindow x:Class="BDU.Views.CANCatchSingalView"
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls" xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ATS.Views" xmlns:local1="clr-namespace:ATS.Converters" xmlns:local="clr-namespace:BDU.Views" xmlns:local1="clr-namespace:BDU.Converters"
mc:Ignorable="d" mc:Ignorable="d"
Title="CAN采集信号配置界面" Height="450" Width="1100"> Title="CAN采集信号配置界面" Height="450" Width="1100">
<Grid> <Grid>

View File

@ -1,4 +1,4 @@
using ATS.Models; using BDU.Models;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using PropertyChanged; using PropertyChanged;
using System; using System;
@ -17,7 +17,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using TSMasterCAN; using TSMasterCAN;
namespace ATS.Views namespace BDU.Views
{ {
/// <summary> /// <summary>
/// CANCatchSingalView.xaml 的交互逻辑 /// CANCatchSingalView.xaml 的交互逻辑

View File

@ -1,9 +1,9 @@
<UserControl x:Class="ATS.Views.CommandTreeView" <UserControl x:Class="BDU.Views.CommandTreeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ATS.Views" xmlns:local="clr-namespace:BDU.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d" mc:Ignorable="d"
Loaded="UserControl_Loaded" Loaded="UserControl_Loaded"

View File

@ -1,7 +1,7 @@
using ATS.Logic; using BDU.Logic;
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using ATS.Windows; using BDU.Windows;
using Common.Attributes; using Common.Attributes;
using GongSolutions.Wpf.DragDrop.Utilities; using GongSolutions.Wpf.DragDrop.Utilities;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -25,11 +25,11 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Xml; using System.Xml;
using static ATS.Models.ParameterModel; using static BDU.Models.ParameterModel;
using static Common.Attributes.ATSCommandAttribute; using static Common.Attributes.ATSCommandAttribute;
using Path = System.IO.Path; using Path = System.IO.Path;
namespace ATS.Views namespace BDU.Views
{ {
/// <summary> /// <summary>
/// CommandTreeView.xaml 的交互逻辑 /// CommandTreeView.xaml 的交互逻辑
@ -125,7 +125,7 @@ namespace ATS.Views
var parameters = method.GetParameters(); var parameters = method.GetParameters();
if (parameters.Length > 0) if (parameters.Length > 0)
{ {
memberName += "(" + string.Join(",", parameters.Select(p => p.ParameterType.FullName)) + ")"; memberName += "(" + string.Join(",", parameters.Select(p => p.ParameterType.FullName?.Replace('+', '.'))) + ")";
} }
// 查找注释节点 // 查找注释节点

View File

@ -1,9 +1,9 @@
<UserControl <UserControl
x:Class="ATS.Views.LogArea" x:Class="BDU.Views.LogArea"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ATS.Views" xmlns:local="clr-namespace:BDU.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"

View File

@ -1,4 +1,4 @@
using ATS.Tools; using BDU.Tools;
using PropertyChanged; using PropertyChanged;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -10,7 +10,7 @@ using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading; using System.Windows.Threading;
namespace ATS.Views namespace BDU.Views
{ {
public partial class LogArea : UserControl public partial class LogArea : UserControl
{ {

View File

@ -1,9 +1,9 @@
<UserControl x:Class="ATS.Views.ParametersManager" <UserControl x:Class="BDU.Views.ParametersManager"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ATS.Views" xmlns:local="clr-namespace:BDU.Views"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:ParametersManager}" d:DataContext="{d:DesignInstance Type=local:ParametersManager}"

View File

@ -1,7 +1,7 @@
using ATS.Logic; using BDU.Logic;
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using ATS.Windows; using BDU.Windows;
using DeviceCommand.Base; using DeviceCommand.Base;
using Newtonsoft.Json; using Newtonsoft.Json;
using PropertyChanged; using PropertyChanged;
@ -23,10 +23,10 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using static ATS.Models.ParameterModel; using static BDU.Models.ParameterModel;
using static MaterialDesignThemes.Wpf.Theme.ToolBar; using static MaterialDesignThemes.Wpf.Theme.ToolBar;
namespace ATS.Views namespace BDU.Views
{ {
/// <summary> /// <summary>
/// ParametersManager.xaml 的交互逻辑 /// ParametersManager.xaml 的交互逻辑

View File

@ -1,11 +1,11 @@
<UserControl <UserControl
x:Class="ATS.Views.SingleStepEdit" x:Class="BDU.Views.SingleStepEdit"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ATS.Views" xmlns:local="clr-namespace:BDU.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converters="clr-namespace:ATS.Converters" xmlns:converters="clr-namespace:BDU.Converters"
d:DataContext="{d:DesignInstance Type=local:SingleStepEdit}" d:DataContext="{d:DesignInstance Type=local:SingleStepEdit}"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"

View File

@ -1,6 +1,6 @@
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using ATS.Windows; using BDU.Windows;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -16,7 +16,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ATS.Views namespace BDU.Views
{ {
/// <summary> /// <summary>
/// SingleStepEdit.xaml 的交互逻辑 /// SingleStepEdit.xaml 的交互逻辑

View File

@ -1,9 +1,9 @@
<UserControl x:Class="ATS.Views.StepsManager" <UserControl x:Class="BDU.Views.StepsManager"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dd="urn:gong-wpf-dragdrop" xmlns:dd="urn:gong-wpf-dragdrop"
xmlns:local="clr-namespace:ATS.Views" xmlns:local="clr-namespace:BDU.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DataContext="{d:DesignInstance Type=local:StepsManager}" d:DataContext="{d:DesignInstance Type=local:StepsManager}"
d:DesignHeight="450" d:DesignHeight="450"

View File

@ -1,6 +1,6 @@
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using ATS.Windows; using BDU.Windows;
using PropertyChanged; using PropertyChanged;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -22,7 +22,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using Timer = System.Timers.Timer; using Timer = System.Timers.Timer;
namespace ATS.Views namespace BDU.Views
{ {
/// <summary> /// <summary>
/// StepsManager.xaml 的交互逻辑 /// StepsManager.xaml 的交互逻辑

View File

@ -1,11 +1,11 @@
<UserControl x:Class="ATS.Views.ToolBar" <UserControl x:Class="BDU.Views.ToolBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ATS.Views" xmlns:local="clr-namespace:BDU.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converters="clr-namespace:ATS.Tools" xmlns:converters="clr-namespace:BDU.Tools"
d:DataContext="{d:DesignInstance Type=local:ToolBar}" d:DataContext="{d:DesignInstance Type=local:ToolBar}"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d" mc:Ignorable="d"

View File

@ -1,7 +1,7 @@
using ATS.Logic; using BDU.Logic;
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using ATS.Windows; using BDU.Windows;
using ATS_DBContext; using ATS_DBContext;
using MaterialDesignThemes.Wpf; using MaterialDesignThemes.Wpf;
using Microsoft.Win32; using Microsoft.Win32;
@ -23,10 +23,10 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using TSMasterCAN; using TSMasterCAN;
using static ATS.Models.ParameterModel; using static BDU.Models.ParameterModel;
using Path = System.IO.Path; using Path = System.IO.Path;
namespace ATS.Views namespace BDU.Views
{ {
/// <summary> /// <summary>
/// ToolBar.xaml 的交互逻辑 /// ToolBar.xaml 的交互逻辑

View File

@ -1,10 +1,10 @@
<mah:MetroWindow x:Class="ATS.Windows.DeviceManageWindow" <mah:MetroWindow x:Class="BDU.Windows.DeviceManageWindow"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
mc:Ignorable="d" mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:DeviceManageWindow}" d:DataContext="{d:DesignInstance Type=local:DeviceManageWindow}"
WindowStyle="None" WindowStyle="None"

View File

@ -1,5 +1,5 @@
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using Newtonsoft.Json; using Newtonsoft.Json;
using PropertyChanged; using PropertyChanged;
@ -19,7 +19,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ATS.Windows namespace BDU.Windows
{ {
/// <summary> /// <summary>
/// DeviceManageWindow.xaml 的交互逻辑 /// DeviceManageWindow.xaml 的交互逻辑

View File

@ -1,10 +1,10 @@
<mah:MetroWindow x:Class="ATS.Windows.DeviceSettingWindow" <mah:MetroWindow x:Class="BDU.Windows.DeviceSettingWindow"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
mc:Ignorable="d" mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:DeviceSettingWindow}" d:DataContext="{d:DesignInstance Type=local:DeviceSettingWindow}"
WindowStyle="None" WindowStyle="None"

View File

@ -1,4 +1,4 @@
using ATS.Models; using BDU.Models;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using Newtonsoft.Json; using Newtonsoft.Json;
using NPOI.XSSF.Streaming.Values; using NPOI.XSSF.Streaming.Values;
@ -18,7 +18,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ATS.Windows namespace BDU.Windows
{ {
/// <summary> /// <summary>
/// DeviceSettingWindow.xaml 的交互逻辑 /// DeviceSettingWindow.xaml 的交互逻辑
@ -206,11 +206,12 @@ namespace ATS.Windows
{ {
try try
{ {
string filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SystemConfig.Instance.PreDefineDevicesPath); string filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SystemConfig.Instance.PreDefineDevicesPath);
if (!System.IO.File.Exists(filePath)) if (!System.IO.File.Exists(filePath))
{ {
// 如果文件不存在,创建一个空的配置文件 // 如果文件不存在,创建一个空的配置文件
var emptyList = new ObservableCollection<DeviceModel>(); var emptyList = new ObservableCollection<DeviceModel>();
string json = JsonConvert.SerializeObject(emptyList, Formatting.Indented); string json = JsonConvert.SerializeObject(emptyList, Formatting.Indented);
System.IO.File.WriteAllText(filePath, json); System.IO.File.WriteAllText(filePath, json);

View File

@ -1,13 +1,13 @@
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" <mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
x:Class="ATS.Windows.Login" x:Class="BDU.Windows.Login"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
mc:Ignorable="d" mc:Ignorable="d"
Title="ATS系统" Title="BDU系统"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
Height="315" Height="315"
Width="420" Width="420"
@ -61,6 +61,10 @@
</Window.Resources> </Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="11*"/>
<ColumnDefinition Width="94*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="40" /> <RowDefinition Height="40" />
@ -73,7 +77,7 @@
CornerRadius="5" CornerRadius="5"
BorderThickness="1" BorderThickness="1"
BorderBrush="#E0E0E0" BorderBrush="#E0E0E0"
Padding="30,20"> Padding="30,20" Grid.ColumnSpan="2">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -144,11 +148,11 @@
</Border> </Border>
<!-- 底部版权信息 --> <!-- 底部版权信息 -->
<TextBlock Grid.Row="2" <TextBlock Grid.Row="1"
Text="© 2025 ATS系统" Text="© 2025 BDU系统"
Foreground="#777" Foreground="#777"
FontSize="12" FontSize="12"
HorizontalAlignment="Center" HorizontalAlignment="Left"
Margin="0,10" /> Margin="123,10,0,10" Grid.Column="1" />
</Grid> </Grid>
</mah:MetroWindow> </mah:MetroWindow>

View File

@ -1,5 +1,5 @@
using ATS.Models; using BDU.Models;
using ATS.Windows; using BDU.Windows;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -19,7 +19,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using Path = System.IO.Path; using Path = System.IO.Path;
namespace ATS.Windows namespace BDU.Windows
{ {
/// <summary> /// <summary>
/// Login.xaml 的交互逻辑 /// Login.xaml 的交互逻辑
@ -51,6 +51,7 @@ namespace ATS.Windows
UserList.Add(new() UserList.Add(new()
{ {
UserName = "超级管理员", UserName = "超级管理员",
UserAccount ="admin",
UserId = Guid.NewGuid(), UserId = Guid.NewGuid(),
PassWord = "admin", PassWord = "admin",
Role = 2 Role = 2

View File

@ -1,16 +1,16 @@
<mah:MetroWindow x:Class="ATS.Windows.MainWindow" <mah:MetroWindow x:Class="BDU.Windows.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:vs="clr-namespace:ATS.Views" xmlns:vs="clr-namespace:BDU.Views"
mc:Ignorable="d" mc:Ignorable="d"
Loaded="MetroWindow_Loaded" Loaded="MetroWindow_Loaded"
d:DataContext="{d:DesignInstance Type=local:MainWindow}" d:DataContext="{d:DesignInstance Type=local:MainWindow}"
Title="ATS_MainWindow" Title="BDU_MainWindow"
Height="580" Height="580"
Width="1099"> Width="1099">
<Grid> <Grid>

View File

@ -1,5 +1,5 @@
using ATS.Models; using BDU.Models;
using ATS.Tools; using BDU.Tools;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using MathNet.Numerics; using MathNet.Numerics;
using Microsoft.Win32; using Microsoft.Win32;
@ -22,7 +22,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ATS.Windows namespace BDU.Windows
{ {
/// <summary> /// <summary>
/// MainWindow.xaml 的交互逻辑 /// MainWindow.xaml 的交互逻辑
@ -163,7 +163,7 @@ namespace ATS.Windows
Title = $"{parentPath} > {subProgramName}"; Title = $"{parentPath} > {subProgramName}";
// 通知 StepsManager 更新 Title 显示子程序名称 // 通知 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) if (_isInSubProgramMode && _currentSubProgramNameStack.Count > 0)
{ {
// 如果还在子程序模式中(多层嵌套),显示上一层子程序名称 // 如果还在子程序模式中(多层嵌套),显示上一层子程序名称
ATS.Views.StepsManager.Instance?.UpdateTitle(_currentSubProgramNameStack.Peek()); BDU.Views.StepsManager.Instance?.UpdateTitle(_currentSubProgramNameStack.Peek());
} }
else else
{ {
// 返回主程序 // 返回主程序
ATS.Views.StepsManager.Instance?.UpdateTitle(); BDU.Views.StepsManager.Instance?.UpdateTitle();
} }
} }
} }

View File

@ -1,8 +1,8 @@
<mah:MetroWindow x:Class="ATS.Windows.ParameterSettingWindow" <mah:MetroWindow x:Class="BDU.Windows.ParameterSettingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="ParameterSettingWindow" Title="ParameterSettingWindow"

View File

@ -1,4 +1,4 @@
using ATS.Models; using BDU.Models;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using PropertyChanged; using PropertyChanged;
using System; using System;
@ -16,9 +16,9 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using TSMaster; using TSMaster;
using static ATS.Models.ParameterModel; using static BDU.Models.ParameterModel;
namespace ATS.Windows namespace BDU.Windows
{ {
/// <summary> /// <summary>
/// ParameterSettingWindow.xaml 的交互逻辑 /// ParameterSettingWindow.xaml 的交互逻辑

View File

@ -1,10 +1,10 @@
<mah:MetroWindow x:Class="ATS.Windows.SystemConfigWindow" <mah:MetroWindow x:Class="BDU.Windows.SystemConfigWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
mc:Ignorable="d" mc:Ignorable="d"
Title="SystemConfigWindow" Title="SystemConfigWindow"
Width="420" Width="420"

View File

@ -1,4 +1,4 @@
using ATS; using BDU;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
@ -7,7 +7,7 @@ using System.Reflection;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
namespace ATS.Windows namespace BDU.Windows
{ {
public partial class SystemConfigWindow : MetroWindow public partial class SystemConfigWindow : MetroWindow
{ {

View File

@ -1,8 +1,8 @@
<mah:MetroWindow x:Class="ATS.Windows.TestDataInfomationWindow" <mah:MetroWindow x:Class="BDU.Windows.TestDataInfomationWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="TestDataInfomationWindow" Title="TestDataInfomationWindow"

View File

@ -1,4 +1,4 @@
using ATS.Tools; using BDU.Tools;
using ATS_DBContext; using ATS_DBContext;
using ATS_DBContext.Models; using ATS_DBContext.Models;
using ClosedXML.Excel; using ClosedXML.Excel;
@ -13,7 +13,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
namespace ATS.Windows namespace BDU.Windows
{ {
[AddINotifyPropertyChangedInterface] [AddINotifyPropertyChangedInterface]
public partial class TestDataInfomationWindow : MetroWindow public partial class TestDataInfomationWindow : MetroWindow

View File

@ -1,10 +1,10 @@
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" <mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
x:Class="ATS.Windows.UserSettingWindow" x:Class="BDU.Windows.UserSettingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
d:DataContext="{d:DesignInstance Type=local:UserSettingWindow}" d:DataContext="{d:DesignInstance Type=local:UserSettingWindow}"
mc:Ignorable="d" mc:Ignorable="d"
ShowTitleBar="False" ShowTitleBar="False"

View File

@ -1,4 +1,4 @@
using ATS.Models; using BDU.Models;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using PropertyChanged; using PropertyChanged;
using System; using System;
@ -18,7 +18,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ATS.Windows namespace BDU.Windows
{ {
/// <summary> /// <summary>
/// UsersAdd.xaml 的交互逻辑 /// UsersAdd.xaml 的交互逻辑

View File

@ -1,10 +1,10 @@
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" <mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
x:Class="ATS.Windows.UsersManage" x:Class="BDU.Windows.UsersManage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ATS.Windows" xmlns:local="clr-namespace:BDU.Windows"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
d:DataContext="{d:DesignInstance Type=local:UsersManage}" d:DataContext="{d:DesignInstance Type=local:UsersManage}"
mc:Ignorable="d" mc:Ignorable="d"

View File

@ -1,4 +1,4 @@
using ATS.Models; using BDU.Models;
using DocumentFormat.OpenXml.Spreadsheet; using DocumentFormat.OpenXml.Spreadsheet;
using MahApps.Metro.Controls; using MahApps.Metro.Controls;
using PropertyChanged; using PropertyChanged;
@ -22,7 +22,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using Path = System.IO.Path; using Path = System.IO.Path;
namespace ATS.Windows namespace BDU.Windows
{ {
/// <summary> /// <summary>
/// UsersManage.xaml 的交互逻辑 /// UsersManage.xaml 的交互逻辑

View File

@ -13,9 +13,12 @@ namespace DeviceCommand.Device
/// 直流电源——阿美泰克直流电源 /// 直流电源——阿美泰克直流电源
/// </summary> /// </summary>
[ATSCommand] [ATSCommand]
[DeviceCategory("阿美泰克直流电源\r\n")] [DeviceCategory("阿美泰克直流电源")]
public class AMETEKSGX : Tcp public class AMETEKSGX : Tcp
{ {
/// <summary>
/// 信号量锁
/// </summary>
public SemaphoreSlim semaphoreSlimLock { get; set; } = new(1, 1); public SemaphoreSlim semaphoreSlimLock { get; set; } = new(1, 1);
/// <summary> /// <summary>

View File

@ -16,11 +16,28 @@ namespace DeviceCommand.Device
[DeviceCategory("三通道可编程直流电源")] [DeviceCategory("三通道可编程直流电源")]
public class IT_N6322B : Tcp public class IT_N6322B : Tcp
{ {
/// <summary>
/// 信号量锁
/// </summary>
public SemaphoreSlim semaphoreSlimLock { get; set; } = new(1, 1); public SemaphoreSlim semaphoreSlimLock { get; set; } = new(1, 1);
/// <summary>
/// 通道枚举
/// </summary>
public enum ChannelList_Enum public enum ChannelList_Enum
{ {
CH1 = 1, CH2 = 2, CH3 = 3 /// <summary>
/// 通道1
/// </summary>
CH1 = 1,
/// <summary>
/// 通道2
/// </summary>
CH2 = 2,
/// <summary>
/// 通道3
/// </summary>
CH3 = 3
} }
@ -32,6 +49,7 @@ namespace DeviceCommand.Device
/// <returns></returns> /// <returns></returns>
public async Task Set_RemoteMode(Tcp client, CancellationToken ct = default) public async Task Set_RemoteMode(Tcp client, CancellationToken ct = default)
{ {
await semaphoreSlimLock.WaitAsync(ct);
try try
{ {
await SendAsync(client, $"SYST:REM\n", ct); await SendAsync(client, $"SYST:REM\n", ct);
@ -69,15 +87,17 @@ namespace DeviceCommand.Device
} }
} }
/// <summary> /// <summary>
/// 设置源指定通道对应通道输出电压 /// 设置源指定通道过电压保护电平
/// </summary> /// </summary>
/// <param name="client">设备</param> /// <param name="client">设备</param>
/// <param name="channel">通道</param> /// <param name="channel">通道</param>
/// <param name="voltage">电压</param> /// <param name="voltage">输出频率</param>
/// <param name="ct">支持中途取消发送指令</param> /// <param name="ct">支持中途取消发送指令</param>
/// <returns></returns> /// <returns></returns>
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); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -103,7 +123,7 @@ namespace DeviceCommand.Device
/// <param name="voltage">输出频率</param> /// <param name="voltage">输出频率</param>
/// <param name="ct">支持中途取消发送指令</param> /// <param name="ct">支持中途取消发送指令</param>
/// <returns></returns> /// <returns></returns>
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); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -129,7 +149,7 @@ namespace DeviceCommand.Device
/// <param name="current">输出频率</param> /// <param name="current">输出频率</param>
/// <param name="ct">支持中途取消发送指令</param> /// <param name="ct">支持中途取消发送指令</param>
/// <returns></returns> /// <returns></returns>
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); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -155,7 +175,7 @@ namespace DeviceCommand.Device
/// <param name="current">电压</param> /// <param name="current">电压</param>
/// <param name="ct">支持中途取消发送指令</param> /// <param name="ct">支持中途取消发送指令</param>
/// <returns></returns> /// <returns></returns>
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); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -182,7 +202,7 @@ namespace DeviceCommand.Device
/// <param name="current">电流</param> /// <param name="current">电流</param>
/// <param name="ct">支持中途取消发送指令</param> /// <param name="ct">支持中途取消发送指令</param>
/// <returns></returns> /// <returns></returns>
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); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -207,7 +227,7 @@ namespace DeviceCommand.Device
/// <param name="channel">通道</param> /// <param name="channel">通道</param>
/// <param name="ct">取消令牌</param> /// <param name="ct">取消令牌</param>
/// <returns>返回值是:定通道电源输出的实际电压值 (Amps)</returns> /// <returns>返回值是:定通道电源输出的实际电压值 (Amps)</returns>
public async Task<string> QueryVoltage(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) public async Task<string> Query_ITVoltage(Tcp client, ChannelList_Enum channel, CancellationToken ct = default)
{ {
await semaphoreSlimLock.WaitAsync(ct); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -230,7 +250,7 @@ namespace DeviceCommand.Device
/// <param name="channel">通道</param> /// <param name="channel">通道</param>
/// <param name="ct">取消令牌</param> /// <param name="ct">取消令牌</param>
/// <returns>返回值是:设置的电流值 (Amps)</returns> /// <returns>返回值是:设置的电流值 (Amps)</returns>
public async Task<string> QueryCurrent(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) public async Task<string> Query_ITCurrent(Tcp client, ChannelList_Enum channel, CancellationToken ct = default)
{ {
await semaphoreSlimLock.WaitAsync(ct); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -251,7 +271,7 @@ namespace DeviceCommand.Device
/// <param name="channel">通道</param> /// <param name="channel">通道</param>
/// <param name="ct">取消令牌</param> /// <param name="ct">取消令牌</param>
/// <returns>返回值是:指定通道电源输出的实际功率值 (Amps)</returns> /// <returns>返回值是:指定通道电源输出的实际功率值 (Amps)</returns>
public async Task<string> QueryPower(Tcp client, ChannelList_Enum channel, CancellationToken ct = default) public async Task<string> Query_ITPower(Tcp client, ChannelList_Enum channel, CancellationToken ct = default)
{ {
await semaphoreSlimLock.WaitAsync(ct); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -273,7 +293,7 @@ namespace DeviceCommand.Device
/// <param name="channel">通道</param> /// <param name="channel">通道</param>
/// <param name="ct">支持中途取消发送指令</param> /// <param name="ct">支持中途取消发送指令</param>
/// <returns></returns> /// <returns></returns>
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); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -299,7 +319,7 @@ namespace DeviceCommand.Device
/// <param name="channel">通道</param> /// <param name="channel">通道</param>
/// <param name="ct">支持中途取消发送指令</param> /// <param name="ct">支持中途取消发送指令</param>
/// <returns></returns> /// <returns></returns>
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); await semaphoreSlimLock.WaitAsync(ct);
try try
@ -316,11 +336,5 @@ namespace DeviceCommand.Device
} }
} }
} }
} }

View File

@ -185,7 +185,6 @@ namespace DeviceCommand.Device
/// 启动DC电压和比例测量禁用或启用自动归零模式 /// 启动DC电压和比例测量禁用或启用自动归零模式
/// </summary> /// </summary>
/// <param name="client">设备</param> /// <param name="client">设备</param>
/// <param name="range">量程</param>
/// <param name="ct">支持中途取消发送指令</param> /// <param name="ct">支持中途取消发送指令</param>
/// <returns></returns> /// <returns></returns>
public async Task Start_VoltageDCAUTO_ZERO(Tcp client, CancellationToken ct = default) public async Task Start_VoltageDCAUTO_ZERO(Tcp client, CancellationToken ct = default)

View File

@ -32,20 +32,59 @@ namespace DeviceCommand.Device
/// </summary> /// </summary>
public enum ChannelName_Single_Enum public enum ChannelName_Single_Enum
{ {
CH1 = 1, CH2 = 2, CH3 = 3, CH4 = 4 /// <summary>
/// 通道1
/// </summary>
CH1 = 1,
/// <summary>
/// 通道2
/// </summary>
CH2 = 2,
/// <summary>
/// 通道3
/// </summary>
CH3 = 3,
/// <summary>
/// 通道4
/// </summary>
CH4 = 4
} }
/// <summary> /// <summary>
/// 测试项(1到9) /// 测量项枚举RTM3004支持8个独立的测量项
/// </summary> /// </summary>
public enum Measurement_Enum public enum Measurement_Enum
{ {
MEAS1 = 1, MEAS2 = 2, MEAS3 = 3, MEAS4 = 4, MEAS5 = 5, MEAS6 = 6, MEAS7 = 7, MEAS8 = 8 /// <summary>测量项1</summary>
MEAS1 = 1,
/// <summary>测量项2</summary>
MEAS2 = 2,
/// <summary>测量项3</summary>
MEAS3 = 3,
/// <summary>测量项4</summary>
MEAS4 = 4,
/// <summary>测量项5</summary>
MEAS5 = 5,
/// <summary>测量项6</summary>
MEAS6 = 6,
/// <summary>测量项7</summary>
MEAS7 = 7,
/// <summary>测量项8</summary>
MEAS8 = 8
} }
/// <summary>
/// 通道耦合模式枚举
/// </summary>
public enum CouplingMode public enum CouplingMode
{ {
/// <summary>直流限制耦合</summary>
DCLimit, DCLimit,
/// <summary>交流限制耦合</summary>
ACLimit, ACLimit,
GND, //手册有 GND 耦合 /// <summary>接地耦合,用于参考电平</summary>
GND,
/// <summary>直流耦合</summary>
DC DC
} }
@ -54,17 +93,25 @@ namespace DeviceCommand.Device
/// </summary> /// </summary>
public enum AcquisitionState public enum AcquisitionState
{ {
/// <summary>运行中,持续采集波形</summary>
RUN, RUN,
STOPping,//采集完成后停止采集 /// <summary>采集完成后停止采集</summary>
COMPlete,//设置:不可用 STOPping,
BREak//设置:立即中断当前采集 /// <summary>采集完成(设置:不可用)</summary>
COMPlete,
/// <summary>立即中断当前采集</summary>
BREak
} }
/// <summary>
/// 带宽限制(手册 CH<x>:BANdwidth 支持值) /// 带宽限制(手册 CH<x>:BANdwidth 支持值)
/// </summary>
public enum BandwidthLimit public enum BandwidthLimit
{ {
FULL,//使用全部带宽 /// <summary>使用全部带宽,无限制</summary>
B20//频率限制为20 MHz。高频信号被移除以降低 FULL,
/// <summary>频率限制为20 MHz高频信号被移除以降低噪声</summary>
B20
} }
/// <summary> /// <summary>
@ -72,32 +119,39 @@ namespace DeviceCommand.Device
/// </summary> /// </summary>
public enum TriggerMode public enum TriggerMode
{ {
AUTO, // 自动 /// <summary>自动模式,无触发时自动扫描</summary>
NORMal, // 正常 AUTO,
/// <summary>正常模式,仅在触发时采集</summary>
NORMal,
} }
/// <summary> /// <summary>
/// 触发模式(手册 TRIGger:A:MODe 支持值) /// 触发斜率/边沿枚举
/// </summary> /// </summary>
public enum Slope_Enum public enum Slope_Enum
{ {
POSitive, //上升沿,正电压变化 /// <summary>上升沿触发,检测电压正向变化</summary>
NEGative,//下降沿,负电压变化 POSitive,
EITHer //上升和下降的边缘 /// <summary>下降沿触发,检测电压负向变化</summary>
NEGative,
/// <summary>上升和下降沿都触发</summary>
EITHer
} }
/// <summary> /// <summary>
/// 测试项信号水平的百分比(手册 TRIGger:A:MODe 支持值) /// 参考电平百分比模式枚举
/// 用于设置上升/下降时间测量的上下参考电平
/// </summary> /// </summary>
public enum Relative_Mode public enum Relative_Mode
{ {
TEN, //10, 50 and 90% /// <summary>10%、50%和90%参考电平</summary>
TWENty,// 20, 50 and 80% TEN,
FIVE,// 5, 50 and 95 % /// <summary>20%、50%和80%参考电平</summary>
USER//层级定义采用REFLevel参数 TWENty,
/// <summary>5%、50%和95%参考电平</summary>
FIVE,
/// <summary>用户自定义参考电平需配合REFLevel参数使用</summary>
USER
} }
#endregion #endregion