相机格式更改

This commit is contained in:
Admin
2025-04-28 09:44:35 +08:00
parent 6a9e7e4343
commit bc0ed5d574
6 changed files with 167 additions and 87 deletions

View File

@ -10,6 +10,7 @@ using System.Windows.Forms;
using AntdUI;
using DH.Commons.Base;
using DH.Commons.Enums;
using DVPCameraType;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Window = AntdUI.Window;
@ -26,9 +27,36 @@ namespace DHSoftware.Views
InitializeComponent();
sltCamType.TextChanged += SltCamTpye_TextChanged;
sltPicType.TextChanged += SltPicTpye_TextChanged;
InitData();
BindData();
}
private void SltPicTpye_TextChanged(object? sender, EventArgs e)
{
if (sender is Select slt && !string.IsNullOrEmpty(slt.Text))
{
// 将文本转换为枚举值
if (Enum.TryParse<dvpStreamFormat>(slt.Text, out var plcType))
{
switch (plcType)
{
case dvpStreamFormat.S_RGB24:
case dvpStreamFormat.S_MONO8:
break;
default:
break;
}
}
else
{
}
}
}
private void SltCamTpye_TextChanged(object? sender, EventArgs e)
{
if (sender is Select slt && !string.IsNullOrEmpty(slt.Text))
@ -77,6 +105,7 @@ namespace DHSoftware.Views
{
sltCamType.DataBindings.Add("Text", CameraBase, "CamType", true, DataSourceUpdateMode.OnPropertyChanged, "");
sltPicType.DataBindings.Add("Text", CameraBase, "DvpImageFormat", true, DataSourceUpdateMode.OnPropertyChanged, "");
sthPic.DataBindings.Add(nameof(sthPic.Checked), CameraBase, nameof(CameraBase.IsSavePicEnabled),
true, DataSourceUpdateMode.OnPropertyChanged);
sthAllPic.DataBindings.Add(nameof(sthAllPic.Checked), CameraBase, nameof(CameraBase.IsAllPicEnabled),
@ -126,9 +155,15 @@ namespace DHSoftware.Views
{
sltCamType.Items.Add(value.ToString());
}
sltPicType.Items.Clear();
foreach (dvpStreamFormat value in Enum.GetValues(typeof(dvpStreamFormat)))
{
sltPicType.Items.Add(value.ToString());
}
// 初始化下拉框选项
sltAcquisitionMode.Items.AddRange(new[] { "连续模式", "触发模式" });
sltTriggerMode.Items.AddRange(new[] { "软触发", "硬触发" });
// 设置初始选择
sltAcquisitionMode.SelectedIndex = CameraBase.IsContinueMode ? 0 : 1;