Dispenser/DispenserUI/ViewModels/DTO/CameraParams.cs

296 lines
5.8 KiB
C#
Raw Permalink Normal View History

2024-08-16 07:20:09 +00:00
using System.ComponentModel;
using System.Runtime.CompilerServices;
using DispenserCommon.Atrributes;
using DispenserHal.Camera.DTO;
namespace DispenserUI.ViewModels.DTO;
public class CameraParams : INotifyPropertyChanged
{
// 白平衡值
private IntValue? _balanceRatio;
// 是否自动白平衡
private bool? _balanceWhiteAuto;
//灰度值
private FloatValue? _blackLevel;
// 黑电平调节使能
private bool _blackLevelEnable;
// 设备序列号
private StringValue? _deviceSerialNumber;
/// <summary>
/// 自动曝光
/// </summary>
private bool? _exposureAuto;
// 曝光时间
private FloatValue? _exposureTime;
// 增益
private FloatValue? _gain;
/// <summary>
/// 自动增益
/// 0:Off
/// 1:Once
/// 2:Continuous
/// </summary>
private EnumValue? _gainAuto;
// gamma 值
private FloatValue? _gamma;
/// <summary>
/// 是否gamma使能
/// </summary>
private bool _gammaEnable;
/// <summary>
/// IO 模式
/// 0:Input
/// 1:Output
/// 2:Trigger
/// 8:Strobe
/// </summary>
private EnumValue? _lineMode;
/// <summary>
/// IO 选择
/// 0:Line0
/// 1:Line1
/// 2:Line2
/// 3:Line3
/// 4:Line4
/// </summary>
private EnumValue? _lineSelector;
//帧率-待确定
private FloatValue? _resultingFrameRate;
/// <summary>
/// 0:RisingEdge
/// 1:FallingEdge
/// 2:LevelHigh
/// 3:LevelLow
/// </summary>
private EnumValue? _triggerActivation;
/// <summary>
/// 触发模式
/// 0:Off 1:On
/// </summary>
private EnumValue? _triggerMode;
/// <summary>
/// 0:Line0
/// 1:Line1
/// 2:Line2
/// 3.Line3
/// 4:Counter0
/// 7:Software
/// 8:FrequencyConverter
/// </summary>
private EnumValue? _triggerSource;
[Description("设备序列号")]
public StringValue? DeviceSerialNumber
{
get => _deviceSerialNumber;
set
{
_deviceSerialNumber = value;
OnPropertyChanged();
}
}
[Description("曝光时间"), Property(Max = 2000)]
public FloatValue? ExposureTime
{
get => _exposureTime;
set
{
_exposureTime = value;
OnPropertyChanged();
}
}
[Description("自动曝光")]
public bool? ExposureAuto
{
get => _exposureAuto;
set
{
_exposureAuto = value;
OnPropertyChanged();
}
}
[Description("增益")]
public FloatValue? Gain
{
get => _gain;
set
{
_gain = value;
OnPropertyChanged();
}
}
[Description("自动增益")]
public EnumValue? GainAuto
{
get => _gainAuto;
set
{
_gainAuto = value;
OnPropertyChanged();
}
}
[Description("灰度值")]
public FloatValue? BlackLevel
{
get => _blackLevel;
set
{
_blackLevel = value;
OnPropertyChanged();
}
}
[Description("黑电平调节使能")]
public bool BlackLevelEnable
{
get => _blackLevelEnable;
set
{
_blackLevelEnable = value;
OnPropertyChanged();
}
}
[Description("白平衡值")]
public IntValue? BalanceRatio
{
get => _balanceRatio;
set
{
_balanceRatio = value;
OnPropertyChanged();
}
}
[Description("自动白平衡")]
public bool? BalanceWhiteAuto
{
get => _balanceWhiteAuto;
set
{
_balanceWhiteAuto = value;
OnPropertyChanged();
}
}
[Description("触发激活")]
public EnumValue? TriggerActivation
{
get => _triggerActivation;
set
{
_triggerActivation = value;
OnPropertyChanged();
}
}
[Description("实际采集帧率fps")]
public FloatValue? ResultingFrameRate
{
get => _resultingFrameRate;
set
{
_resultingFrameRate = value;
OnPropertyChanged();
}
}
[Description("gamma值")]
public FloatValue? Gamma
{
get => _gamma;
set
{
_gamma = value;
OnPropertyChanged();
}
}
[Description("是否gamma使能")]
public bool GammaEnable
{
get => _gammaEnable;
set
{
_gammaEnable = value;
OnPropertyChanged();
}
}
[Description("IO 选择")]
public EnumValue? LineSelector
{
get => _lineSelector;
set
{
_lineSelector = value;
OnPropertyChanged();
}
}
[Description("IO 模式")]
public EnumValue? LineMode
{
get => _lineMode;
set
{
_lineMode = value;
OnPropertyChanged();
}
}
[Description("触发模式")]
public EnumValue? TriggerMode
{
get => _triggerMode;
set
{
_triggerMode = value;
OnPropertyChanged();
}
}
[Description("触发源")]
public EnumValue? TriggerSource
{
get => _triggerSource;
set
{
_triggerSource = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler? PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}