diff --git a/DeviceCommand/Devices/Chroma61800.cs b/DeviceCommand/Devices/Chroma61800.cs
index 95d697e..7827041 100644
--- a/DeviceCommand/Devices/Chroma61800.cs
+++ b/DeviceCommand/Devices/Chroma61800.cs
@@ -10,6 +10,9 @@ using System.Threading.Tasks;
namespace DeviceCommand.Devices
{
+ ///
+ /// 交流源 一拖三
+ ///
[ACPCommand]
public class Chroma61800 : Tcp
{
diff --git a/DeviceCommand/Devices/DG1000Z.cs b/DeviceCommand/Devices/DG1000Z.cs
index 5abec61..e88aea8 100644
--- a/DeviceCommand/Devices/DG1000Z.cs
+++ b/DeviceCommand/Devices/DG1000Z.cs
@@ -8,6 +8,9 @@ using System.Threading.Tasks;
namespace DeviceCommand.Devices
{
+ ///
+ /// 信号源 一拖三
+ ///
#region 枚举定义
///
diff --git a/DeviceCommand/Devices/IOBoard.cs b/DeviceCommand/Devices/IOBoard.cs
index d77b570..06ffe84 100644
--- a/DeviceCommand/Devices/IOBoard.cs
+++ b/DeviceCommand/Devices/IOBoard.cs
@@ -11,6 +11,9 @@ using System.Threading.Tasks;
namespace DeviceCommand.Devices
{
+ ///
+ /// IO板卡 一对一由于板卡映射不完全一样采用IOGroup
+ ///
//[ACPCommand]
public class IOBoard : ModbusTcp
{
diff --git a/DeviceCommand/Devices/IT6015C.cs b/DeviceCommand/Devices/IT6015C.cs
index 6259335..2215ece 100644
--- a/DeviceCommand/Devices/IT6015C.cs
+++ b/DeviceCommand/Devices/IT6015C.cs
@@ -8,7 +8,9 @@ using System.Threading.Tasks;
namespace DeviceCommand.Devices
{
-
+ ///
+ /// 低压直流源载一体机 一对一
+ ///
[ACPCommand]
public class IT6015C : Tcp
{
diff --git a/DeviceCommand/Devices/IT6036C .cs b/DeviceCommand/Devices/IT6036C .cs
index bdc9bd3..c9b2c6f 100644
--- a/DeviceCommand/Devices/IT6036C .cs
+++ b/DeviceCommand/Devices/IT6036C .cs
@@ -8,6 +8,9 @@ using System.Threading.Tasks;
namespace DeviceCommand.Devices
{
+ ///
+ ///高压直流源载一体机 一对一
+ ///
#region 枚举定义
///
diff --git a/DeviceCommand/Devices/IT6720 .cs b/DeviceCommand/Devices/IT6720.cs
similarity index 97%
rename from DeviceCommand/Devices/IT6720 .cs
rename to DeviceCommand/Devices/IT6720.cs
index 12197f8..cfa996c 100644
--- a/DeviceCommand/Devices/IT6720 .cs
+++ b/DeviceCommand/Devices/IT6720.cs
@@ -9,17 +9,19 @@ using System.Threading.Tasks;
namespace DeviceCommand.Devices
{
+ ///
+ /// 低压电源 一拖三
+ ///
[ACPCommand]
- public class IT6720 : Serial_Port // 直接继承您提供的 Serial_Port 基类
+ public class IT6720: Serial_Port // 直接继承您提供的 Serial_Port 基类
{
// 帧格式:同步头 AA + 地址 + 命令字 + 数据[4-25] + 校验和,共 26 字节
private const byte FrameSyncByte = 0xAA;
private const int FrameLength = 26;
- private readonly byte _deviceAddress; // 电源地址
+ private readonly byte _deviceAddress = 0x00; // 电源地址
- public IT6720(SerialPortConfig config, byte address = 0x00) : base(config)
+ public IT6720(SerialPortConfig config) : base(config)
{
- _deviceAddress = address;
}
#region 核心协议封装(不变)
diff --git a/DeviceCommand/Devices/IT7800E.cs b/DeviceCommand/Devices/IT7800E.cs
deleted file mode 100644
index ae85451..0000000
--- a/DeviceCommand/Devices/IT7800E.cs
+++ /dev/null
@@ -1,263 +0,0 @@
-using Common.Attributes;
-using DeviceCommand.Base;
-using Model.Models;
-using System;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace DeviceCommand.Devices
-{
- #region 枚举定义
-
- ///
- /// 电源电气/耦合模式
- ///
- public enum PowerCouplingMode
- {
- /// 纯交流模式
- AC,
- /// 纯直流模式
- DC,
- /// 交直流混合模式
- ACDC,
- /// 直交流混合模式
- DCAC
- }
-
- ///
- /// 设备操作运行角色/模式
- ///
- public enum DeviceOperationMode
- {
- /// 电压源模式(常规源)
- VOLTage,
- /// 电子负载模式(放电拉载)
- LOAD,
- /// 电流源模式
- CURRent
- }
-
- #endregion
-
- [ACPCommand]
- public class IT7800E : Tcp
- {
- // 八台产品共用一个,使用换行符 \n (ASCII 0x0A) 作为 SCPI 结束符[cite: 1]
- private const string ScpiDelimiter = "\n";
-
- public IT7800E(TcpConfig config) : base(config)
- {
- }
-
- #region 1. IEEE 488.2 公共命令
-
- public virtual async Task 清除错误队列和状态字节(CancellationToken ct = default)
- {
- await SendAsync($"*CLS{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- public virtual async Task 查询设备标识(CancellationToken ct = default)
- {
- return await WriteReadAsync($"*IDN?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- public virtual async Task 重置设备(CancellationToken ct = default)
- {
- await SendAsync($"*RST{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- public virtual async Task 读取状态字节(CancellationToken ct = default)
- {
- return await WriteReadAsync($"*STB?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- #endregion
-
- #region 2. 耦合模式与拉载开关控制
-
- ///
- /// 设置电源输出源的电气模式/工作耦合模式 (AC, DC, ACDC, DCAC)[cite: 1]
- ///
- public virtual async Task 设置电源模式(PowerCouplingMode 模式, CancellationToken ct = default)
- {
- await SendAsync($":SOURce:FUNCtion {模式}{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- ///
- /// 查询电源当前的工作电气模式[cite: 1]
- ///
- public virtual async Task 查询电源模式(CancellationToken ct = default)
- {
- return await WriteReadAsync($":SOURce:FUNCtion?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- public virtual async Task 设置DC输出(bool 开启, CancellationToken ct = default)
- {
- string 参数 = 开启 ? "ON" : "OFF"; //[cite: 1]
- await SendAsync($":OUTPut {参数}{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- public virtual async Task 查询DC输出状态(CancellationToken ct = default)
- {
- return await WriteReadAsync($":OUTPut?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- #endregion
-
- #region 3. 设定输出参数设置 (AC 电压/频率/DC 电压)
-
- public virtual async Task 设置交流电压(double 电压, CancellationToken ct = default)
- {
- string cmd = string.Format(CultureInfo.InvariantCulture, ":SOURce:VOLTage {0:F2}{1}", 电压, ScpiDelimiter); //[cite: 1]
- await SendAsync(cmd, ct);
- }
-
- public virtual async Task 设置直流电压(double 电压, CancellationToken ct = default)
- {
- string cmd = string.Format(CultureInfo.InvariantCulture, ":SOURce:VOLTage:DC {0:F2}{1}", 电压, ScpiDelimiter); //[cite: 1]
- await SendAsync(cmd, ct);
- }
-
- public virtual async Task 设置频率(double 频率, CancellationToken ct = default)
- {
- string cmd = string.Format(CultureInfo.InvariantCulture, ":SOURce:FREQuency {0:F2}{1}", 频率, ScpiDelimiter); //[cite: 1]
- await SendAsync(cmd, ct);
- }
-
- public virtual async Task 设置电流(double 电流, CancellationToken ct = default)
- {
- string cmd = string.Format(CultureInfo.InvariantCulture, ":SOURce:CURRent {0:F3}{1}", 电流, ScpiDelimiter); //[cite: 1]
- await SendAsync(cmd, ct);
- }
-
- #endregion
-
- #region 4. 测量与数据回测(高频数据轮询核心)
-
- [Monitorable("交流电源电压")]
- public virtual async Task 查询实际电压(CancellationToken ct = default)
- {
- return await WriteReadAsync($":MEASure:VOLTage?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- [Monitorable("交流电源电流")]
- public virtual async Task 查询实际电流(CancellationToken ct = default)
- {
- return await WriteReadAsync($":MEASure:CURRent?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- [Monitorable("交流电源功率")]
- public virtual async Task 查询实际功率(CancellationToken ct = default)
- {
- return await WriteReadAsync($":MEASure:POWer?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- public virtual async Task 查询视在功率(CancellationToken ct = default)
- {
- return await WriteReadAsync($":MEASure:POWer:APParent?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- public virtual async Task 查询实际频率(CancellationToken ct = default)
- {
- return await WriteReadAsync($":MEASure:FREQuency?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- public virtual async Task 查询功率因数(CancellationToken ct = default)
- {
- return await WriteReadAsync($":MEASure:POWer:PFACtor?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- #endregion
-
- #region 5. 保护参数设置与系统监控
-
- public virtual async Task 设置过流保护_OCP(double 电流, CancellationToken ct = default)
- {
- string cmd = string.Format(CultureInfo.InvariantCulture, ":SOURce:CURRent:PROTection:RMS {0:F3}{1}", 电流, ScpiDelimiter); //[cite: 1]
- await SendAsync(cmd, ct);
- }
-
- public virtual async Task 设置过压保护_OVP(double 电压, CancellationToken ct = default)
- {
- string cmd = string.Format(CultureInfo.InvariantCulture, ":SOURce:VOLTage:PROTection:PEAK {0:F2}{1}", 电压, ScpiDelimiter); //[cite: 1]
- await SendAsync(cmd, ct);
- }
-
- public virtual async Task 查询错误信息(CancellationToken ct = default)
- {
- return await WriteReadAsync($":SYSTem:ERRor?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- public virtual async Task 切换远程控制模式(CancellationToken ct = default)
- {
- await SendAsync($":SYSTem:REMote{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- public virtual async Task 切换本地控制模式(CancellationToken ct = default)
- {
- await SendAsync($":SYSTem:LOCal{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- public virtual async Task 清除保护告警(CancellationToken ct = default)
- {
- await SendAsync($":OUTPut:PROTection:CLEar{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- #endregion
-
- #region 6. 充放电与能量统计扩展命令
-
- ///
- /// 清除最近的安时(Ah)与瓦时(Wh)统计数据[cite: 1]
- ///
- public virtual async Task 清除充放电电量统计(CancellationToken ct = default)
- {
- await SendAsync($"SENSe:AHOur:RESet{ScpiDelimiter}", ct); //[cite: 1]
- await SendAsync($"SENSe:WHOur:RESet{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- ///
- /// 读取当前充放电累计的安时值 (单位: Ah)[cite: 1]
- ///
- public virtual async Task 查询累计安时_Ah(CancellationToken ct = default)
- {
- return await WriteReadAsync($"FETCh:AHOur?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- ///
- /// 读取当前充放电累计的瓦时值 (单位: Wh)[cite: 1]
- ///
- public virtual async Task 查询累计瓦时_Wh(CancellationToken ct = default)
- {
- return await WriteReadAsync($"FETCh:WHOur?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- ///
- /// 读取充放电积分持续时间 (单位: 秒)[cite: 1]
- ///
- public virtual async Task 查询积分时间(CancellationToken ct = default)
- {
- return await WriteReadAsync($"FETCh:ENERgy:TIME?{ScpiDelimiter}", ScpiDelimiter, ct); //[cite: 1]
- }
-
- ///
- /// 切换设备的操作模式 (VOLTage: 电源模式, LOAD: 负载模式/放电, CURRent: 电流源)[cite: 1]
- ///
- public virtual async Task 设置操作模式(DeviceOperationMode 模式, CancellationToken ct = default)
- {
- await SendAsync($"SYSTem:OPERation:MODE {模式}{ScpiDelimiter}", ct); //[cite: 1]
- }
-
- ///
- /// 设置放电截止电压/电压下限 (单位: V,用于防止电池过放)[cite: 1]
- ///
- public virtual async Task 设置电压下限(double 电压, CancellationToken ct = default)
- {
- string cmd = string.Format(CultureInfo.InvariantCulture, ":SOURce:VOLTage:LIMit:LOW {0:F2}{1}", 电压, ScpiDelimiter); //[cite: 1]
- await SendAsync(cmd, ct);
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/DeviceCommand/Devices/MCc06U.cs b/DeviceCommand/Devices/MCc06U.cs
new file mode 100644
index 0000000..df04ca3
--- /dev/null
+++ b/DeviceCommand/Devices/MCc06U.cs
@@ -0,0 +1,17 @@
+using DeviceCommand.Base;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DeviceCommand.Devices
+{
+ ///
+ /// 水冷机 一拖三
+ ///
+ public class MCc06U:ModbusTcp
+ {
+
+ }
+}
diff --git a/DeviceCommand/Devices/PW8001.cs b/DeviceCommand/Devices/PW8001.cs
index 0b2bd70..266e6d9 100644
--- a/DeviceCommand/Devices/PW8001.cs
+++ b/DeviceCommand/Devices/PW8001.cs
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace DeviceCommand.Device
{
///
- /// 功率分析仪(型号:HIOKI PW8001)
+ /// 功率分析仪(型号:HIOKI PW8001) 一拖三
///
public class PW8001 : Tcp
diff --git a/DeviceCommand/Devices/RLT1000.cs b/DeviceCommand/Devices/RLT1000.cs
index 4048ea7..76c9da8 100644
--- a/DeviceCommand/Devices/RLT1000.cs
+++ b/DeviceCommand/Devices/RLT1000.cs
@@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace DeviceCommand.Devices
{
+ ///
+ /// 环境箱(型号:RLT1000) 一拖三
+ ///
[ACPCommand]
public class RLT1000 : ModbusTcp
{
diff --git a/DeviceCommand/Devices/TektronixMSO.cs b/DeviceCommand/Devices/TektronixMSO.cs
index 1a8ffa5..81ed7e8 100644
--- a/DeviceCommand/Devices/TektronixMSO.cs
+++ b/DeviceCommand/Devices/TektronixMSO.cs
@@ -8,6 +8,9 @@ using System.Threading.Tasks;
namespace DeviceCommand.Devices
{
+ ///
+ /// 示波器 一拖三
+ ///
#region 枚举定义
///
diff --git a/DeviceEditModule/ViewModels/IT7800EViewModel.cs b/DeviceEditModule/ViewModels/IT7800EViewModel.cs
deleted file mode 100644
index ef01228..0000000
--- a/DeviceEditModule/ViewModels/IT7800EViewModel.cs
+++ /dev/null
@@ -1,310 +0,0 @@
-using DeviceCommand.Devices;
-using Prism.Commands;
-using Prism.Ioc;
-using System;
-using System.Threading;
-using System.Windows.Input;
-using UIShare.GlobalVariable;
-using UIShare.ViewModelBase;
-
-namespace DeviceEditModule.ViewModels
-{
- ///
- /// IT7800E 交直流电源控制面板 ViewModel。
- ///
- /// 注册为 Navigation View,既可由 Region 导航进入,
- /// 也可由外部直接实例化后作为 Tab 内容塞入 DialogMangerView:
- ///
- /// var view = container.Resolve<IT7800EView>();
- /// (view.DataContext as IT7800EViewModel)?.Initialize("IT7800E");
- /// _eventAggregator.GetEvent<AddDialogTabEvent>().Publish(
- /// new DialogTabInfo { Title = "IT7800E", Content = view });
- ///
- ///
- ///
- public class IT7800EViewModel : NavigateViewModelBase, IDisposable
- {
- #region 私有字段
-
- private readonly DeviceManager _deviceManager;
- private IT7800E? _device;
- private CancellationTokenSource? _cts;
-
- #endregion
-
- #region 设备信息属性
-
- private string _deviceName = "IT7800E";
- public string DeviceName
- {
- get => _deviceName;
- set => SetProperty(ref _deviceName, value);
- }
-
- private bool _isConnected;
- public bool IsConnected
- {
- get => _isConnected;
- set => SetProperty(ref _isConnected, value);
- }
-
- private bool _isBusy;
- /// 正在执行设备命令时为 true,用于 UI 忙碌状态指示。
- public bool IsBusy
- {
- get => _isBusy;
- set => SetProperty(ref _isBusy, value);
- }
-
- #endregion
-
- #region 输入参数属性
-
- private double _acVoltage = 220.0;
- /// 待设置的交流电压值(V)。
- public double AcVoltage
- {
- get => _acVoltage;
- set => SetProperty(ref _acVoltage, value);
- }
-
- private double _dcVoltage = 0.0;
- /// 待设置的直流偏置电压值(V)。
- public double DcVoltage
- {
- get => _dcVoltage;
- set => SetProperty(ref _dcVoltage, value);
- }
-
- private double _frequency = 50.0;
- /// 待设置的交流频率(Hz)。
- public double Frequency
- {
- get => _frequency;
- set => SetProperty(ref _frequency, value);
- }
-
- private double _currentLimit = 10.0;
- /// 待设置的限流值(A)。
- public double CurrentLimit
- {
- get => _currentLimit;
- set => SetProperty(ref _currentLimit, value);
- }
-
- private PowerCouplingMode _selectedMode = PowerCouplingMode.AC;
- /// 待设置的电源工作模式:AC / DC / ACDC。
- public PowerCouplingMode SelectedMode
- {
- get => _selectedMode;
- set => SetProperty(ref _selectedMode, value);
- }
-
- private double _ovpValue = 260.0;
- /// 过压保护值(V)。
- public double OvpValue
- {
- get => _ovpValue;
- set => SetProperty(ref _ovpValue, value);
- }
-
- private double _ocpValue = 15.0;
- /// 过流保护值(A)。
- public double OcpValue
- {
- get => _ocpValue;
- set => SetProperty(ref _ocpValue, value);
- }
-
- #endregion
-
- #region 测量结果属性
-
- private string _measuredVoltage = "—";
- public string MeasuredVoltage
- {
- get => _measuredVoltage;
- set => SetProperty(ref _measuredVoltage, value);
- }
-
- private string _measuredCurrent = "—";
- public string MeasuredCurrent
- {
- get => _measuredCurrent;
- set => SetProperty(ref _measuredCurrent, value);
- }
-
- private string _measuredPower = "—";
- public string MeasuredPower
- {
- get => _measuredPower;
- set => SetProperty(ref _measuredPower, value);
- }
-
- private string _measuredFrequency = "—";
- public string MeasuredFrequency
- {
- get => _measuredFrequency;
- set => SetProperty(ref _measuredFrequency, value);
- }
-
- private string _responseLog = string.Empty;
- /// 命令响应日志(最新消息在顶部)。
- public string ResponseLog
- {
- get => _responseLog;
- set => SetProperty(ref _responseLog, value);
- }
-
- #endregion
-
- #region 命令
-
- public ICommand QueryIdentityCommand { get; }
- public ICommand ResetDeviceCommand { get; }
- public ICommand OutputOnCommand { get; }
- public ICommand OutputOffCommand { get; }
- public ICommand SetModeCommand { get; }
- public ICommand SetAcVoltageCommand { get; }
- public ICommand SetDcVoltageCommand { get; }
- public ICommand SetFrequencyCommand { get; }
- public ICommand SetCurrentCommand { get; }
- public ICommand QueryAllMeasureCommand { get; }
- public ICommand SetRemoteModeCommand { get; }
- public ICommand SetLocalModeCommand { get; }
- public ICommand SetOvpCommand { get; }
- public ICommand SetOcpCommand { get; }
- public ICommand ClearAlarmCommand { get; }
- public ICommand ClearErrorCommand { get; }
-
- #endregion
-
- public IT7800EViewModel(IContainerProvider containerProvider) : base(containerProvider)
- {
- _deviceManager = containerProvider.Resolve();
-
- QueryIdentityCommand = new DelegateCommand(async () => await Exec(async () => AppendLog("IDN: " + await _device!.查询设备标识(Ct()))));
- ResetDeviceCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.重置设备(Ct()); AppendLog("设备已重置"); }));
- OutputOnCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置DC输出(true, Ct()); AppendLog("输出已开启"); }));
- OutputOffCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置DC输出(false, Ct()); AppendLog("输出已关闭"); }));
- SetModeCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置电源模式(SelectedMode, Ct()); AppendLog($"模式已设为 {SelectedMode}"); }));
- SetAcVoltageCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置交流电压(AcVoltage, Ct()); AppendLog($"AC电压已设为 {AcVoltage} V"); }));
- SetDcVoltageCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置直流电压(DcVoltage, Ct()); AppendLog($"DC偏置已设为 {DcVoltage} V"); }));
- SetFrequencyCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置频率(Frequency, Ct()); AppendLog($"频率已设为 {Frequency} Hz"); }));
- SetCurrentCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置电流(CurrentLimit, Ct()); AppendLog($"限流已设为 {CurrentLimit} A"); }));
- SetOvpCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置过压保护_OVP(OvpValue, Ct()); AppendLog($"OVP已设为 {OvpValue} V"); }));
- SetOcpCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置过流保护_OCP(OcpValue, Ct()); AppendLog($"OCP已设为 {OcpValue} A"); }));
- SetRemoteModeCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.切换远程控制模式(Ct()); AppendLog("已切换到远程控制模式"); }));
- SetLocalModeCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.切换本地控制模式(Ct()); AppendLog("已切换到本地控制模式"); }));
- ClearAlarmCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.清除保护告警(Ct()); AppendLog("保护告警已清除"); }));
- ClearErrorCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.清除错误队列和状态字节(Ct()); AppendLog("错误队列已清除"); }));
-
- QueryAllMeasureCommand = new DelegateCommand(async () => await Exec(async () =>
- {
- MeasuredVoltage = await _device!.查询实际电压(Ct());
- MeasuredCurrent = await _device!.查询实际电流(Ct());
- MeasuredPower = await _device!.查询实际功率(Ct());
- MeasuredFrequency = await _device!.查询实际频率(Ct());
- AppendLog($"测量 → 电压:{MeasuredVoltage}V 电流:{MeasuredCurrent}A 功率:{MeasuredPower}W 频率:{MeasuredFrequency}Hz");
- }));
-
- Initialize();
- }
-
- #region 初始化 / Navigation
-
- ///
- /// 从 DeviceManager 中查找 IT7800E 设备实例。
- /// 优先按 查找,否则取第一个匹配类型的设备。
- ///
- public void Initialize(string? deviceName = null)
- {
- IT7800E? found = null;
- string? foundName = null;
-
- if (deviceName != null &&
- _deviceManager.DeviceMap.TryGetValue(deviceName, out var d) &&
- d is IT7800E e)
- {
- found = e;
- foundName = deviceName;
- }
- else
- {
- foreach (var kv in _deviceManager.DeviceMap)
- {
- if (kv.Value is IT7800E it)
- {
- found = it;
- foundName = kv.Key;
- break;
- }
- }
- }
-
- _device = found;
- DeviceName = foundName ?? "IT7800E (未找到)";
- IsConnected = _device?.IsConnected ?? false;
-
- AppendLog(found != null
- ? $"已关联设备 [{DeviceName}],连接状态:{(IsConnected ? "已连接" : "未连接")}"
- : "未在 DeviceManager 中找到 IT7800E 设备,请先初始化设备配置。");
- }
-
- public override void OnNavigatedTo(NavigationContext context)
- {
- var name = context.Parameters.GetValue("DeviceName");
- Initialize(name);
- }
-
- #endregion
-
- #region 辅助
-
- private CancellationToken Ct() => (_cts = new CancellationTokenSource(TimeSpan.FromSeconds(10))).Token;
-
- private async Task Exec(Func action)
- {
- if (_device == null)
- {
- AppendLog("错误:未关联到设备实例,请检查设备配置。");
- return;
- }
- if (IsBusy) return;
- IsBusy = true;
- try
- {
- await action();
- IsConnected = _device.IsConnected;
- }
- catch (OperationCanceledException)
- {
- AppendLog("命令超时或已取消。");
- }
- catch (Exception ex)
- {
- AppendLog($"错误:{ex.Message}");
- }
- finally
- {
- IsBusy = false;
- }
- }
-
- private void AppendLog(string message)
- {
- var line = $"[{DateTime.Now:HH:mm:ss}] {message}";
- ResponseLog = ResponseLog.Length > 4000
- ? line + "\n" + ResponseLog[..3000]
- : line + "\n" + ResponseLog;
- }
-
- #endregion
-
- public void Dispose()
- {
- _cts?.Cancel();
- _cts?.Dispose();
- }
- }
-}
diff --git a/DeviceEditModule/Views/IT7800EView.xaml b/DeviceEditModule/Views/IT7800EView.xaml
deleted file mode 100644
index b1af3e5..0000000
--- a/DeviceEditModule/Views/IT7800EView.xaml
+++ /dev/null
@@ -1,272 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/DeviceEditModule/Views/IT7800EView.xaml.cs b/DeviceEditModule/Views/IT7800EView.xaml.cs
deleted file mode 100644
index 2569458..0000000
--- a/DeviceEditModule/Views/IT7800EView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace DeviceEditModule.Views
-{
- ///
- /// IT7800EView.xaml 的交互逻辑
- ///
- public partial class IT7800EView : UserControl
- {
- public IT7800EView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/UIShare/GlobalVariable/SystemConfig.cs b/UIShare/GlobalVariable/SystemConfig.cs
index d945803..488603c 100644
--- a/UIShare/GlobalVariable/SystemConfig.cs
+++ b/UIShare/GlobalVariable/SystemConfig.cs
@@ -51,22 +51,6 @@ namespace UIShare.GlobalVariable
Name = "台架序号",
Value = 1,
IsEditable=false
- },
- new ParameterVM
- {
- Category = ParameterCategory.Input,
- Type = typeof(int),
- Name = "直流负载通道",
- Value = 1,
- IsEditable=false
- },
- new ParameterVM
- {
- Category = ParameterCategory.Input,
- Type = typeof(int),
- Name = "交流电源通道",
- Value = 1,
- IsEditable=false
},
new ParameterVM
{
@@ -113,63 +97,112 @@ namespace UIShare.GlobalVariable
//{
// new DeviceInfoVM
// {
-// DeviceName = "IT7800E",
-// DeviceType = "IT7800E",
-// Remark = "交流可编程电源供应器",
+// DeviceName = "Chroma61800",
+// DeviceType = "Chroma61800",
+// Remark = "可编程交流电源",
// ConnectionType = "Tcp",
// IsEnabled = true,
// IsConnected = false
// },
-
- // new DeviceInfoVM
- // {
- // DeviceName = "N36200",
- // DeviceType = "N36200",
- // Remark = "宽范围可编程直流电源",
- // ConnectionType = "Tcp",
- // IsEnabled = true,
- // IsConnected = false
- // },
-
- // new DeviceInfoVM
- // {
- // DeviceName = "N36600",
- // DeviceType = "N36600",
- // Remark = "便携式宽范围可编程直流电源",
- // ConnectionType = "Tcp",
- // IsEnabled = false,
- // IsConnected = false
- // },
-
- // new DeviceInfoVM
- // {
- // DeviceName = "N69200",
- // DeviceType = "N69200",
- // Remark = "可编程直流电子负载",
- // ConnectionType = "Tcp",
- // IsEnabled = true,
- // IsConnected = false
- // },
-
- // new DeviceInfoVM
- // {
- // DeviceName = "SDS2000X_HD",
- // DeviceType = "SDS2000X_HD",
- // Remark = "数字存储示波器",
- // ConnectionType = "Tcp",
- // IsEnabled = true,
- // IsConnected = false
- // },
-
- // new DeviceInfoVM
- // {
- // DeviceName = "SPAW7000",
- // DeviceType = "SPAW7000",
- // Remark = "功率分析记录仪",
- // ConnectionType = "Tcp",
- // IsEnabled = true,
- // IsConnected = false
- // }
- //};
+// new DeviceInfoVM
+// {
+// DeviceName = "DG1000Z",
+// DeviceType = "DG1000Z",
+// Remark = "信号发生器",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "IT6015C",
+// DeviceType = "IT6015C",
+// Remark = "低压直流源载一体机",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "IT6036C",
+// DeviceType = "IT6036C",
+// Remark = "高压直流源载一体机",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "IT6720",
+// DeviceType = "IT6720",
+// Remark = "低压电源",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "MCc06U",
+// DeviceType = "MCc06U",
+// Remark = "水冷机",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "PW8001",
+// DeviceType = "PW8001",
+// Remark = "功率分析记录仪",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "RLT1000",
+// DeviceType = "RLT1000",
+// Remark = "环境箱",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "TektronixMSO",
+// DeviceType = "TektronixMSO",
+// Remark = "示波器",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "IOBoard1",
+// DeviceType = "IOBoard",
+// Remark = "IO板卡1",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "IOBoard2",
+// DeviceType = "IOBoard",
+// Remark = "IO板卡2",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// },
+// new DeviceInfoVM
+// {
+// DeviceName = "IOBoard3",
+// DeviceType = "IOBoard",
+// Remark = "IO板卡3",
+// ConnectionType = "Tcp",
+// IsEnabled = true,
+// IsConnected = false
+// }
+//};
}
}