AOILayerRotation以及Mirror

AOILayerRotation 和“是否镜像”现在都是运行时从数据库 / VVS 相关元数据里取的,不是我写死的。

  1. 是否镜像 来源是 layer_infos.LayerBitmapMatrix

当前代码里先查这两个字段: BoardImageDatabaseService.cs

SELECT LayerBitmap AS ImageBytes, LayerBitmapMatrix AS MatrixBytes
FROM layer_infos
WHERE id = @LayerId

然后在这里判断: BoardImageViewViewModel.cs

IsLayerMirrored = layerData?.MatrixBytes != null &&
                  layerData.MatrixBytes.Length > 0 &&
                  CDB_Connector.IsLayerMirrored(layerData.MatrixBytes);

这个 IsLayerMirrored(...) 的规则本身来自 VVS/CDB SDK: SupportFunctions.cs

也就是:

  • 先把 LayerBitmapMatrix 解析成矩阵
  • 再按矩阵符号判断是不是镜像层
  1. AOILayerRotation 来源是 LayersInfoContainer.Data.AOILayerRotation

当前代码里,如果设置选的是 AOILayerRotation,就在这里取: BoardImageViewViewModel.cs

return (CadRotation)_dbService.GetAoiLayerRotation(jobName, layerName, lotName);

GetAoiLayerRotation(...) 里会先加载 LayersInfoContainerBoardImageDatabaseService.cs

然后直接读: BoardImageDatabaseService.cs

return container?.Data == null ? Rotation.None : (Rotation)container.Data.AOILayerRotation;

所以简化成一句话就是:

  • 是否镜像:来自 layer_infos.LayerBitmapMatrix
  • AOILayerRotation:来自 LayersInfoContainer.Data.AOILayerRotation

如果你愿意,我下一步可以顺手把这两个值临时显示到 StatusText 或日志里,这样你切层时能直接看到当前层到底读到了什么。

评论 0

发表评论
支持 Markdown 格式
验证码
点击图片可刷新验证码
💬

暂无评论,快来发表第一条评论吧!