コード例 #1
0
ファイル: PnPProcDoc.cs プロジェクト: Witawat/GerberTools
        void BuildPostBom()
        {
            BPost = new BOM();
            BOMNumberSet s = new BOMNumberSet();

            BPost.MergeBOM(B, s, 0, 0, 0, 0, 0);
            BPost.FixupAngles();
        }
コード例 #2
0
ファイル: PnPProcDoc.cs プロジェクト: valor7/GerberTools
        public void BuildPostBom()
        {
            BPost = new BOM();
            BOMNumberSet s = new BOMNumberSet();

            switch (FlipBoard)
            {
            case FlipMode.NoFlip:
                FixOffset = new PointD(Set.BoundingBox.TopLeft.X, Set.BoundingBox.TopLeft.Y);
                break;

            case FlipMode.FlipDiagonal:
                FixOffset = new PointD(Set.BoundingBox.TopLeft.X, Set.BoundingBox.TopLeft.Y);
                break;

            case FlipMode.FlipHorizontal:
                FixOffset = new PointD(Set.BoundingBox.TopLeft.X, Set.BoundingBox.TopLeft.Y);
                break;
            }

            BPost.MergeBOM(B, s, 0, 0, -FixOffset.X, -FixOffset.Y, 0);

            FixSet = new GerberImageCreator();
            FixSet.CopyFrom(Set);

            switch (FlipBoard)
            {
            case FlipMode.NoFlip:
                FixSet.SetBottomLeftToZero();
                break;

            case FlipMode.FlipDiagonal:
                FixSet.SetBottomRightToZero();
                FixSet.FlipXY();
                FixSet.Translate(0, FixSet.BoundingBox.Height());
                BPost.SwapXY();
                BPost.FlipSides();
                //                    BPost.Translate(0, FixSet.BoundingBox.Height());
                break;

            case FlipMode.FlipHorizontal:
                FixSet.SetBottomRightToZero();
                FixSet.FlipX();
                BPost.FlipSides();
                BPost.FlipX();
                BPost.Translate(FixSet.BoundingBox.Width(), 0);
                break;
            }
            BPost.FixupAngles(StockDoc);
            BPost.WriteJLCPnpFile(B.OriginalBasefolder, B.OriginalPnpName + "_rotated", true);
            BPost.WriteQuantPnPFiles(B.OriginalBasefolder, B.OriginalPnpName + "_QUANTSET");
            BPost.WriteQuantBOMFile(B.OriginalBasefolder, B.OriginalPnpName + "_QUANTSET");

            BPost.WriteRefDesGerber(Path.Combine(B.OriginalBasefolder, B.OriginalPnpName + "_refdes.gbr"));
        }