diff --git a/applications/fpvviewer/fpvectorialsrc/avisocncgcodewriter.pas b/applications/fpvviewer/fpvectorialsrc/avisocncgcodewriter.pas index cc31e608a..eddb18cad 100644 --- a/applications/fpvviewer/fpvectorialsrc/avisocncgcodewriter.pas +++ b/applications/fpvviewer/fpvectorialsrc/avisocncgcodewriter.pas @@ -36,6 +36,10 @@ var i, j: Integer; Str: string; APath: TPath; + CurSegment: T2DSegment; + Cur3DSegment: T3DSegment; + Cur2DBezierSegment: T2DBezierSegment; + Cur3DBezierSegment: T3DBezierSegment; begin AStrings.Clear; @@ -51,25 +55,39 @@ begin // levanta a broca AStrings.Add('P01 // Sobe a cabeça de gravação'); // vai para o ponto inicial + CurSegment := T2DSegment(APath.Points); AStrings.Add(Format('G01 X%f Y%f', - [APath.Points[0].X, APath.Points[0].Y])); + [CurSegment.X, CurSegment.Y])); AStrings.Add('P02 // Abaixa a cabeça de gravação'); for j := 1 to APath.Len - 1 do begin - case APath.Points[j].SegmentType of + CurSegment := T2DSegment(CurSegment.Next); + case CurSegment.SegmentType of st2DLine: AStrings.Add(Format('G01 X%f Y%f', - [APath.Points[j].X, APath.Points[j].Y])); - st3DLine: AStrings.Add(Format('G01 X%f Y%f Z%f', - [APath.Points[j].X, APath.Points[j].Y, APath.Points[j].Z])); - st2DBezier: AStrings.Add(Format('B02 X%f Y%f X%f Y%f X%f Y%f', - [APath.Points[j].X2, APath.Points[j].Y2, - APath.Points[j].X3, APath.Points[j].Y3, - APath.Points[j].X, APath.Points[j].Y])); - st3DBezier: AStrings.Add(Format('B03 X%f Y%f Z%f X%f Y%f Z%f X%f Y%f Z%f', - [APath.Points[j].X2, APath.Points[j].Y2, APath.Points[j].Z2, - APath.Points[j].X3, APath.Points[j].Y3, APath.Points[j].Z3, - APath.Points[j].X, APath.Points[j].Y, APath.Points[j].Z])); + [CurSegment.X, CurSegment.Y])); + st3DLine: + begin + Cur3DSegment := T3DSegment(CurSegment); + AStrings.Add(Format('G01 X%f Y%f Z%f', + [Cur3DSegment.X, Cur3DSegment.Y, Cur3DSegment.Z])); + end; + st2DBezier: + begin + Cur2DBezierSegment := T2DBezierSegment(CurSegment); + AStrings.Add(Format('B02 X%f Y%f X%f Y%f X%f Y%f', + [Cur2DBezierSegment.X2, Cur2DBezierSegment.Y2, + Cur2DBezierSegment.X3, Cur2DBezierSegment.Y3, + Cur2DBezierSegment.X, Cur2DBezierSegment.Y])); + end; + st3DBezier: + begin + Cur3DBezierSegment := T3DBezierSegment(CurSegment); + AStrings.Add(Format('B03 X%f Y%f Z%f X%f Y%f Z%f X%f Y%f Z%f', + [Cur3DBezierSegment.X2, Cur3DBezierSegment.Y2, Cur3DBezierSegment.Z2, + Cur3DBezierSegment.X3, Cur3DBezierSegment.Y3, Cur3DBezierSegment.Z3, + Cur3DBezierSegment.X, Cur3DBezierSegment.Y, Cur3DBezierSegment.Z])); + end; end; end; end; diff --git a/applications/fpvviewer/fpvectorialsrc/fpvectorialpkg.lpk b/applications/fpvviewer/fpvectorialsrc/fpvectorialpkg.lpk new file mode 100644 index 000000000..419c157aa --- /dev/null +++ b/applications/fpvviewer/fpvectorialsrc/fpvectorialpkg.lpk @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/applications/fpvviewer/fpvectorialsrc/fpvectorialpkg.pas b/applications/fpvviewer/fpvectorialsrc/fpvectorialpkg.pas new file mode 100644 index 000000000..29d0e2a80 --- /dev/null +++ b/applications/fpvviewer/fpvectorialsrc/fpvectorialpkg.pas @@ -0,0 +1,23 @@ +{ This file was automatically created by Lazarus. Do not edit! + This source is only used to compile and install the package. + } + +unit fpvectorialpkg; + +interface + +uses + svgvectorialwriter, pdfvrsintatico, pdfvrsemantico, pdfvrlexico, + pdfvectorialreader, fpvtocanvas, fpvectorial, fpvectbuildunit, + dxfvectorialreader, cdrvectorialreader, avisozlib, avisocncgcodewriter, + avisocncgcodereader, LazarusPackageIntf; + +implementation + +procedure Register; +begin +end; + +initialization + RegisterPackage('fpvectorialpkg', @Register); +end. diff --git a/applications/fpvviewer/fpvectorialsrc/fpvtocanvas.pas b/applications/fpvviewer/fpvectorialsrc/fpvtocanvas.pas index d8b95337b..4a6e530b3 100644 --- a/applications/fpvviewer/fpvectorialsrc/fpvtocanvas.pas +++ b/applications/fpvviewer/fpvectorialsrc/fpvtocanvas.pas @@ -11,7 +11,7 @@ uses {$ifdef USE_LCL_CANVAS} Graphics, LCLIntf, {$else} - fpcanvas, + fpcanvas, fpimage, {$endif} fpvectorial; @@ -295,7 +295,11 @@ begin SetLength(Points, 3); if CurDim.DimensionRight.Y = CurDim.DimensionLeft.Y then begin + {$ifdef USE_LCL_CANVAS} ADest.Brush.Color := clBlack; + {$else} + ADest.Brush.FPColor := colBlack; + {$endif} ADest.Brush.Style := bsSolid; // Left arrow Points[0] := Point(CoordToCanvasX(CurDim.DimensionLeft.X), CoordToCanvasY(CurDim.DimensionLeft.Y)); @@ -317,7 +321,11 @@ begin end else begin + {$ifdef USE_LCL_CANVAS} ADest.Brush.Color := clBlack; + {$else} + ADest.Brush.FPColor := colBlack; + {$endif} ADest.Brush.Style := bsSolid; // There is no upper/lower preference for DimensionLeft/Right, so we need to check if CurDim.DimensionLeft.Y > CurDim.DimensionRight.Y then @@ -364,7 +372,11 @@ begin CurText := ASource.GetText(i); ADest.Font.Size := Round(AmulX * CurText.FontSize); ADest.Pen.Style := psSolid; + {$ifdef USE_LCL_CANVAS} ADest.Pen.Color := clBlack; + {$else} + ADest.Pen.FPColor := colBlack; + {$endif} ADest.Brush.Style := bsClear; LowerDim.Y := CurText.Y + CurText.FontSize; ADest.TextOut(CoordToCanvasX(CurText.X), CoordToCanvasY(LowerDim.Y), CurText.Value); diff --git a/applications/fpvviewer/fpvviewer.lpi b/applications/fpvviewer/fpvviewer.lpi index 86c1ad362..43a81c03a 100644 --- a/applications/fpvviewer/fpvviewer.lpi +++ b/applications/fpvviewer/fpvviewer.lpi @@ -28,14 +28,17 @@ - + - - + - + + + + + diff --git a/applications/fpvviewer/fpvviewer.lpr b/applications/fpvviewer/fpvviewer.lpr index eb44a52c9..5445318d2 100644 --- a/applications/fpvviewer/fpvviewer.lpr +++ b/applications/fpvviewer/fpvviewer.lpr @@ -7,7 +7,7 @@ uses cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset - Forms, fpvv_mainform, dxftokentotree, fpvv_drawer + Forms, fpvv_mainform, dxftokentotree, fpvv_drawer, fpvectorialpkg { you can add units after this }; {$R *.res}