AOILayerRotation以及Mirror
AOILayerRotation 和“是否镜像”现在都是运行时从数据库 / VVS 相关元数据里取的,不是我写死的。
是否镜像来源是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解析成矩阵 - 再按矩阵符号判断是不是镜像层
AOILayerRotation来源是LayersInfoContainer.Data.AOILayerRotation。
当前代码里,如果设置选的是 AOILayerRotation,就在这里取:
BoardImageViewViewModel.cs
return (CadRotation)_dbService.GetAoiLayerRotation(jobName, layerName, lotName);
而 GetAoiLayerRotation(...) 里会先加载 LayersInfoContainer:
BoardImageDatabaseService.cs
然后直接读: BoardImageDatabaseService.cs
return container?.Data == null ? Rotation.None : (Rotation)container.Data.AOILayerRotation;
所以简化成一句话就是:
是否镜像:来自layer_infos.LayerBitmapMatrixAOILayerRotation:来自LayersInfoContainer.Data.AOILayerRotation
如果你愿意,我下一步可以顺手把这两个值临时显示到 StatusText 或日志里,这样你切层时能直接看到当前层到底读到了什么。
评论 0
发表评论
暂无评论,快来发表第一条评论吧!