60 lines
2.0 KiB
C#
60 lines
2.0 KiB
C#
// ============================================================================
|
|
// Copyright © 2026 Hexagon Technology Center GmbH. All Rights Reserved.
|
|
// 文件名: ProcessorParameter.cs
|
|
// 描述: 图像处理算子参数定义类,用于描述算子的可配置参数
|
|
// 功能:
|
|
// - 定义参数的基本属性(名称、类型、默认值)
|
|
// - 支持参数范围约束(最小值、最大值)
|
|
// - 支持枚举类型参数(下拉选项)
|
|
// - 提供参数描述信息用于UI显示
|
|
// - 统一的参数管理机制
|
|
// 作者: 李伟 wei.lw.li@hexagon.com
|
|
// ============================================================================
|
|
|
|
namespace ImageProcessing.Core;
|
|
|
|
/// <summary>
|
|
/// 图像处理算子参数定义
|
|
/// </summary>
|
|
public class ProcessorParameter
|
|
{
|
|
/// <summary>参数名称(代码中使用)</summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>显示名称(UI中显示)</summary>
|
|
public string DisplayName { get; set; }
|
|
|
|
/// <summary>参数类型</summary>
|
|
public Type ValueType { get; set; }
|
|
|
|
/// <summary>当前值</summary>
|
|
public object Value { get; set; }
|
|
|
|
/// <summary>最小值(可选)</summary>
|
|
public object? MinValue { get; set; }
|
|
|
|
/// <summary>最大值(可选)</summary>
|
|
public object? MaxValue { get; set; }
|
|
|
|
/// <summary>参数描述</summary>
|
|
public string Description { get; set; }
|
|
|
|
/// <summary>可选值列表(用于下拉框)</summary>
|
|
public string[]? Options { get; set; }
|
|
|
|
/// <summary>参数是否可见</summary>
|
|
public bool IsVisible { get; set; } = true;
|
|
|
|
public ProcessorParameter(string name, string displayName, Type valueType, object defaultValue,
|
|
object? minValue = null, object? maxValue = null, string description = "", string[]? options = null)
|
|
{
|
|
Name = name;
|
|
DisplayName = displayName;
|
|
ValueType = valueType;
|
|
Value = defaultValue;
|
|
MinValue = minValue;
|
|
MaxValue = maxValue;
|
|
Description = description;
|
|
Options = options;
|
|
}
|
|
} |