81 lines
2.6 KiB
C#
81 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace XplorePlane.Models
|
|
{
|
|
// ── 矩阵单元格状态枚举 | Matrix Cell Status Enumeration ──────────
|
|
|
|
/// <summary>矩阵单元格执行状态 | Matrix cell execution status</summary>
|
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
|
public enum MatrixCellStatus
|
|
{
|
|
NotExecuted,
|
|
Executing,
|
|
Completed,
|
|
Error,
|
|
Disabled
|
|
}
|
|
|
|
// ── 矩阵数据模型 | Matrix Data Models ────────────────────────────
|
|
|
|
/// <summary>矩阵单元格(不可变)| Matrix cell (immutable)</summary>
|
|
public record MatrixCell(
|
|
int Row,
|
|
int Column,
|
|
double OffsetX,
|
|
double OffsetY,
|
|
bool IsEnabled,
|
|
MatrixCellStatus Status,
|
|
string ErrorMessage
|
|
);
|
|
|
|
/// <summary>矩阵布局(不可变)| Matrix layout (immutable)</summary>
|
|
public record MatrixLayout(
|
|
Guid Id,
|
|
int Rows,
|
|
int Columns,
|
|
double RowSpacing,
|
|
double ColumnSpacing,
|
|
double StartOffsetX,
|
|
double StartOffsetY,
|
|
string CncProgramPath,
|
|
IReadOnlyList<MatrixCell> Cells,
|
|
string CncProgramContent = null
|
|
);
|
|
|
|
// ── 矩阵执行摘要模型(用于 matrix_summary.json 序列化)────────────
|
|
|
|
/// <summary>矩阵执行摘要文件根对象 | Matrix execution summary file root object</summary>
|
|
public class MatrixSummaryFile
|
|
{
|
|
public MatrixSummaryConfig Config { get; set; }
|
|
public string ProgramName { get; set; }
|
|
public string StartTime { get; set; } // ISO 8601
|
|
public double DurationSeconds { get; set; }
|
|
public int TotalCells { get; set; }
|
|
public int EnabledCells { get; set; }
|
|
public int CompletedCells { get; set; }
|
|
public int FailedCells { get; set; }
|
|
public List<MatrixCellSummaryEntry> Cells { get; set; }
|
|
}
|
|
|
|
/// <summary>矩阵配置信息 | Matrix configuration</summary>
|
|
public class MatrixSummaryConfig
|
|
{
|
|
public int Rows { get; set; }
|
|
public int Columns { get; set; }
|
|
public double RowSpacing { get; set; }
|
|
public double ColumnSpacing { get; set; }
|
|
}
|
|
|
|
/// <summary>矩阵单元格摘要条目 | Matrix cell summary entry</summary>
|
|
public class MatrixCellSummaryEntry
|
|
{
|
|
public string RunId { get; set; }
|
|
public int Row { get; set; }
|
|
public int Column { get; set; }
|
|
public string Status { get; set; }
|
|
public bool? Pass { get; set; }
|
|
}
|
|
} |