检测模块_0 成连续编号
This commit is contained in:
@@ -364,23 +364,24 @@ namespace XplorePlane.Services.Cnc
|
||||
private static IReadOnlyList<CncNode> RenumberNodes(List<CncNode> nodes)
|
||||
{
|
||||
var result = new List<CncNode>(nodes.Count);
|
||||
int referencePointNumber = 0;
|
||||
int savePositionNumber = 0;
|
||||
int inspectionModuleNumber = 0;
|
||||
|
||||
for (int i = 0; i < nodes.Count; i++)
|
||||
{
|
||||
result.Add(ApplyDefaultNodeName(nodes[i] with { Index = i }, i));
|
||||
var indexedNode = nodes[i] with { Index = i };
|
||||
result.Add(indexedNode switch
|
||||
{
|
||||
ReferencePointNode referencePointNode => referencePointNode with { Name = $"\u53C2\u8003\u70B9_{referencePointNumber++}" },
|
||||
SavePositionNode savePositionNode => savePositionNode with { Name = $"\u4FDD\u5B58\u4F4D\u7F6E_{savePositionNumber++}" },
|
||||
InspectionModuleNode inspectionModuleNode => inspectionModuleNode with { Name = $"\u68C0\u6D4B\u6A21\u5757_{inspectionModuleNumber++}" },
|
||||
_ => indexedNode
|
||||
});
|
||||
}
|
||||
return result.AsReadOnly();
|
||||
}
|
||||
|
||||
private static CncNode ApplyDefaultNodeName(CncNode node, int index)
|
||||
{
|
||||
return node switch
|
||||
{
|
||||
ReferencePointNode referencePointNode => referencePointNode with { Name = $"参考点_{index}" },
|
||||
SavePositionNode savePositionNode => savePositionNode with { Name = $"保存位置_{index}" },
|
||||
_ => node
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>创建参考点节点 | Create reference point node</summary>
|
||||
private ReferencePointNode CreateReferencePointNode(Guid id, int index)
|
||||
{
|
||||
@@ -424,7 +425,7 @@ namespace XplorePlane.Services.Cnc
|
||||
private SavePositionNode CreateSavePositionNode(Guid id, int index)
|
||||
{
|
||||
return new SavePositionNode(
|
||||
id, index, $"保存位置_{index}",
|
||||
id, index, $"检测位置_{index}",
|
||||
MotionState: _appStateService.MotionState);
|
||||
}
|
||||
private double TryReadCurrent()
|
||||
|
||||
Reference in New Issue
Block a user