CNC数据存储问题,包括中间的处理情况的缓存

This commit is contained in:
zhengxuan.zhang
2026-04-21 07:32:28 +08:00
parent d9d3e31e57
commit 238e97d110
7 changed files with 1871 additions and 111 deletions
@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
namespace XplorePlane.Models
{
public enum InspectionAssetType
{
RunSourceImage,
NodeInputImage,
NodeResultImage
}
public enum InspectionNodeStatus
{
Succeeded,
Failed,
PartialSuccess,
AssetMissing
}
public class InspectionRunRecord
{
public Guid RunId { get; set; } = Guid.NewGuid();
public string ProgramName { get; set; } = string.Empty;
public string WorkpieceId { get; set; } = string.Empty;
public string SerialNumber { get; set; } = string.Empty;
public DateTime StartedAt { get; set; } = DateTime.UtcNow;
public DateTime? CompletedAt { get; set; }
public bool OverallPass { get; set; }
public string SourceImagePath { get; set; } = string.Empty;
public string ResultRootPath { get; set; } = string.Empty;
public int NodeCount { get; set; }
}
public class InspectionNodeResult
{
public Guid RunId { get; set; }
public Guid NodeId { get; set; } = Guid.NewGuid();
public int NodeIndex { get; set; }
public string NodeName { get; set; } = string.Empty;
public Guid PipelineId { get; set; }
public string PipelineName { get; set; } = string.Empty;
public string PipelineVersionHash { get; set; } = string.Empty;
public bool NodePass { get; set; }
public string SourceImagePath { get; set; } = string.Empty;
public string ResultImagePath { get; set; } = string.Empty;
public InspectionNodeStatus Status { get; set; } = InspectionNodeStatus.Succeeded;
public long DurationMs { get; set; }
}
public class InspectionMetricResult
{
public Guid RunId { get; set; }
public Guid NodeId { get; set; }
public string MetricKey { get; set; } = string.Empty;
public string MetricName { get; set; } = string.Empty;
public double MetricValue { get; set; }
public string Unit { get; set; } = string.Empty;
public double? LowerLimit { get; set; }
public double? UpperLimit { get; set; }
public bool IsPass { get; set; }
public int DisplayOrder { get; set; }
}
public class InspectionAssetRecord
{
public Guid RunId { get; set; }
public Guid? NodeId { get; set; }
public InspectionAssetType AssetType { get; set; }
public string RelativePath { get; set; } = string.Empty;
public string FileFormat { get; set; } = string.Empty;
public int Width { get; set; }
public int Height { get; set; }
}
public class PipelineExecutionSnapshot
{
public Guid RunId { get; set; }
public Guid NodeId { get; set; }
public string PipelineName { get; set; } = string.Empty;
public string PipelineDefinitionJson { get; set; } = string.Empty;
public string PipelineHash { get; set; } = string.Empty;
}
public class InspectionAssetWriteRequest
{
public InspectionAssetType AssetType { get; set; }
public string FileName { get; set; } = string.Empty;
public string SourceFilePath { get; set; } = string.Empty;
public byte[] Content { get; set; }
public string FileFormat { get; set; } = string.Empty;
public int Width { get; set; }
public int Height { get; set; }
}
public class InspectionRunQuery
{
public string ProgramName { get; set; } = string.Empty;
public string WorkpieceId { get; set; } = string.Empty;
public string SerialNumber { get; set; } = string.Empty;
public string PipelineName { get; set; } = string.Empty;
public DateTime? From { get; set; }
public DateTime? To { get; set; }
public int? Skip { get; set; }
public int? Take { get; set; }
}
public class InspectionRunDetail
{
public InspectionRunRecord Run { get; set; } = new();
public IReadOnlyList<InspectionNodeResult> Nodes { get; set; } = Array.Empty<InspectionNodeResult>();
public IReadOnlyList<InspectionMetricResult> Metrics { get; set; } = Array.Empty<InspectionMetricResult>();
public IReadOnlyList<InspectionAssetRecord> Assets { get; set; } = Array.Empty<InspectionAssetRecord>();
public IReadOnlyList<PipelineExecutionSnapshot> PipelineSnapshots { get; set; } = Array.Empty<PipelineExecutionSnapshot>();
}
}