示波器修改:visa连接方式+截图保存
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using Prism.Mvvm;
|
||||
|
||||
namespace UIShare.UIViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// VISA 连接配置(与 DeviceCommand.Base.Visa 保持字段一致)。
|
||||
/// <para>VISA 通过统一资源字符串寻址,无需区分 IP/端口,例如
|
||||
/// TCPIP0::192.168.20.125::inst0::INSTR、USB0::0x0699::0x0408::C012345::INSTR。</para>
|
||||
/// </summary>
|
||||
public class VisaConfigVM : BindableBase
|
||||
{
|
||||
private string _resourceName = "TCPIP0::127.0.0.1::inst0::INSTR";
|
||||
/// <summary>VISA 资源字符串(TCPIP / USB / GPIB / ASRL 等统一寻址)。</summary>
|
||||
public string ResourceName
|
||||
{
|
||||
get => _resourceName;
|
||||
set => SetProperty(ref _resourceName, value);
|
||||
}
|
||||
|
||||
private int _openTimeout = 3000;
|
||||
/// <summary>打开会话超时(毫秒)。</summary>
|
||||
public int OpenTimeout
|
||||
{
|
||||
get => _openTimeout;
|
||||
set => SetProperty(ref _openTimeout, value);
|
||||
}
|
||||
|
||||
private int _ioTimeout = 3000;
|
||||
/// <summary>读写 I/O 超时(毫秒)。</summary>
|
||||
public int IOTimeout
|
||||
{
|
||||
get => _ioTimeout;
|
||||
set => SetProperty(ref _ioTimeout, value);
|
||||
}
|
||||
|
||||
public VisaConfigVM() { }
|
||||
|
||||
/// <summary>拷贝构造,用于对话框编辑副本。</summary>
|
||||
public VisaConfigVM(VisaConfigVM? src)
|
||||
{
|
||||
if (src == null) return;
|
||||
ResourceName = src.ResourceName;
|
||||
OpenTimeout = src.OpenTimeout;
|
||||
IOTimeout = src.IOTimeout;
|
||||
}
|
||||
|
||||
/// <summary>把字段拷回目标对象(保存时用)。</summary>
|
||||
public void CopyTo(VisaConfigVM? dst)
|
||||
{
|
||||
if (dst == null) return;
|
||||
dst.ResourceName = ResourceName;
|
||||
dst.OpenTimeout = OpenTimeout;
|
||||
dst.IOTimeout = IOTimeout;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user