147 lines
3.3 KiB
C#
147 lines
3.3 KiB
C#
namespace OrpaonVision.Core.Configuration.Contracts;
|
|
|
|
/// <summary>
|
|
/// 规则配置草稿。
|
|
/// </summary>
|
|
public sealed class RuleConfigurationDraftDto
|
|
{
|
|
/// <summary>
|
|
/// 机种编码。
|
|
/// </summary>
|
|
public string ProductTypeCode { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 机种名称。
|
|
/// </summary>
|
|
public string ProductTypeName { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 层级配置集合。
|
|
/// </summary>
|
|
public IReadOnlyCollection<LayerConfigurationDto> Layers { get; init; } = Array.Empty<LayerConfigurationDto>();
|
|
|
|
/// <summary>
|
|
/// 部件配置集合。
|
|
/// </summary>
|
|
public IReadOnlyCollection<PartConfigurationDto> Parts { get; init; } = Array.Empty<PartConfigurationDto>();
|
|
|
|
/// <summary>
|
|
/// ROI 配置集合。
|
|
/// </summary>
|
|
public IReadOnlyCollection<RoiConfigurationDto> Rois { get; init; } = Array.Empty<RoiConfigurationDto>();
|
|
|
|
/// <summary>
|
|
/// 规则项集合。
|
|
/// </summary>
|
|
public IReadOnlyCollection<RuleItemConfigurationDto> Rules { get; init; } = Array.Empty<RuleItemConfigurationDto>();
|
|
|
|
/// <summary>
|
|
/// 草稿操作人。
|
|
/// </summary>
|
|
public string? UpdatedBy { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 层级配置。
|
|
/// </summary>
|
|
public sealed class LayerConfigurationDto
|
|
{
|
|
/// <summary>
|
|
/// 层号(从 1 开始)。
|
|
/// </summary>
|
|
public int LayerNo { get; init; }
|
|
|
|
/// <summary>
|
|
/// 层名称。
|
|
/// </summary>
|
|
public string LayerName { get; init; } = string.Empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 部件配置。
|
|
/// </summary>
|
|
public sealed class PartConfigurationDto
|
|
{
|
|
/// <summary>
|
|
/// 部件编码。
|
|
/// </summary>
|
|
public string PartCode { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 部件名称。
|
|
/// </summary>
|
|
public string PartName { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 所属层号。
|
|
/// </summary>
|
|
public int LayerNo { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// ROI 配置。
|
|
/// </summary>
|
|
public sealed class RoiConfigurationDto
|
|
{
|
|
/// <summary>
|
|
/// ROI 编码。
|
|
/// </summary>
|
|
public string RoiCode { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 关联部件编码。
|
|
/// </summary>
|
|
public string PartCode { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 左上角 X。
|
|
/// </summary>
|
|
public int X { get; init; }
|
|
|
|
/// <summary>
|
|
/// 左上角 Y。
|
|
/// </summary>
|
|
public int Y { get; init; }
|
|
|
|
/// <summary>
|
|
/// 宽度。
|
|
/// </summary>
|
|
public int Width { get; init; }
|
|
|
|
/// <summary>
|
|
/// 高度。
|
|
/// </summary>
|
|
public int Height { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 规则项配置。
|
|
/// </summary>
|
|
public sealed class RuleItemConfigurationDto
|
|
{
|
|
/// <summary>
|
|
/// 规则编码。
|
|
/// </summary>
|
|
public string RuleCode { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 规则名称。
|
|
/// </summary>
|
|
public string RuleName { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 规则类型。
|
|
/// </summary>
|
|
public string RuleType { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 规则参数 JSON。
|
|
/// </summary>
|
|
public string ParametersJson { get; init; } = "{}";
|
|
|
|
/// <summary>
|
|
/// 是否启用。
|
|
/// </summary>
|
|
public bool Enabled { get; init; } = true;
|
|
}
|