From 27735cc97c4dc513a0fac1d8ba6b2dd7032e59e1 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Fri, 21 Aug 2020 18:07:07 -0300 Subject: [PATCH 001/116] Start to separate --- LaserGRBL.sln | 6 +++--- LaserGRBL/{LaserGRBL.csproj => LaserGRBL.UI.csproj} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename LaserGRBL/{LaserGRBL.csproj => LaserGRBL.UI.csproj} (100%) diff --git a/LaserGRBL.sln b/LaserGRBL.sln index 2d5ed74b9..35015fd6b 100644 --- a/LaserGRBL.sln +++ b/LaserGRBL.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.2037 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30406.217 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaserGRBL", "LaserGRBL\LaserGRBL.csproj", "{839698EC-FE05-4112-ACCB-A5D7556714F0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaserGRBL.UI", "LaserGRBL\LaserGRBL.UI.csproj", "{839698EC-FE05-4112-ACCB-A5D7556714F0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/LaserGRBL/LaserGRBL.csproj b/LaserGRBL/LaserGRBL.UI.csproj similarity index 100% rename from LaserGRBL/LaserGRBL.csproj rename to LaserGRBL/LaserGRBL.UI.csproj From 7a6f799bac2a4f112d6ab3cf2873ac73d14c59d2 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Fri, 21 Aug 2020 18:16:04 -0300 Subject: [PATCH 002/116] Move CsPotrace and SvgLibrary --- .../CsPotrace/BezierToBiarc/Algorithm.cs | 0 .../CsPotrace/BezierToBiarc/Arc.cs | 0 .../CsPotrace/BezierToBiarc/BiArc.cs | 0 .../CsPotrace/BezierToBiarc/Complex.cs | 0 .../CsPotrace/BezierToBiarc/CubicBezier.cs | 0 .../CsPotrace/BezierToBiarc/Line.cs | 0 .../CsPotrace/BezierToBiarc/Tuple.cs | 0 .../CsPotrace/BezierToBiarc/Vector2.cs | 0 .../CsPotrace/CsPotrace.cs | 0 .../CsPotrace/CsPotraceExport.cs | 0 .../CsPotrace/CsPotraceExportGCODE.cs | 0 LaserGRBL.Lib/LaserGRBL.Lib.csproj | 296 ++++++++++++++++++ LaserGRBL.Lib/Properties/AssemblyInfo.cs | 36 +++ .../SvgLibrary/Basic Shapes/DOM.cd | 0 .../SvgLibrary/Basic Shapes/SvgCircle.cs | 0 .../SvgLibrary/Basic Shapes/SvgEllipse.cs | 0 .../SvgLibrary/Basic Shapes/SvgImage.cs | 0 .../SvgLibrary/Basic Shapes/SvgLine.cs | 0 .../Basic Shapes/SvgPathBasedElement.cs | 0 .../SvgLibrary/Basic Shapes/SvgPolygon.cs | 0 .../SvgLibrary/Basic Shapes/SvgPolyline.cs | 0 .../SvgLibrary/Basic Shapes/SvgRectangle.cs | 0 .../SvgLibrary/Basic Shapes/SvgVisibility.cs | 0 .../Basic Shapes/SvgVisualElement.cs | 0 .../Basic Shapes/SvgVisualElementStyle.cs | 0 .../Clipping and Masking/ISvgClipable.cs | 0 .../Clipping and Masking/SvgClipPath.cs | 0 .../Clipping and Masking/SvgClipRule.cs | 0 .../Clipping and Masking/SvgMask.cs | 0 .../SvgLibrary/Css/CssQuery.cs | 0 .../SvgLibrary/Css/SvgElementOps.cs | 0 .../DataTypes/ISvgSupportsCoordinateUnits.cs | 0 .../SvgLibrary/DataTypes/ISvgViewPort.cs | 0 .../SvgLibrary/DataTypes/SvgAspectRatio.cs | 0 .../DataTypes/SvgAspectRatioConverter.cs | 0 .../DataTypes/SvgColourInterpolation.cs | 0 .../DataTypes/SvgCoordinateUnits.cs | 0 .../SvgLibrary/DataTypes/SvgElementStyle.cs | 0 .../SvgLibrary/DataTypes/SvgFontStyle.cs | 0 .../SvgLibrary/DataTypes/SvgFontVariant.cs | 0 .../SvgLibrary/DataTypes/SvgFontWeight.cs | 0 .../SvgLibrary/DataTypes/SvgMarkerUnits.cs | 0 .../SvgLibrary/DataTypes/SvgOrient.cs | 0 .../DataTypes/SvgOrientConverter.cs | 0 .../SvgLibrary/DataTypes/SvgOverflow.cs | 0 .../SvgLibrary/DataTypes/SvgPoint.cs | 0 .../DataTypes/SvgPointCollection.cs | 0 .../SvgLibrary/DataTypes/SvgTextDecoration.cs | 0 .../DataTypes/SvgTextLengthAdjust.cs | 0 .../SvgLibrary/DataTypes/SvgTextPathMethod.cs | 0 .../DataTypes/SvgTextPathSpacing.cs | 0 .../SvgLibrary/DataTypes/SvgUnit.cs | 0 .../SvgLibrary/DataTypes/SvgUnitCollection.cs | 0 .../SvgLibrary/DataTypes/SvgUnitConverter.cs | 0 .../SvgLibrary/DataTypes/SvgViewBox.cs | 0 .../SvgLibrary/DataTypes/XmlSpaceHandling.cs | 0 .../Document Structure/SvgDefinitionList.cs | 0 .../Document Structure/SvgDescription.cs | 0 .../Document Structure/SvgDocumentMetadata.cs | 0 .../Document Structure/SvgFragment.cs | 0 .../SvgLibrary/Document Structure/SvgGroup.cs | 0 .../Document Structure/SvgSwitch.cs | 0 .../Document Structure/SvgSymbol.cs | 0 .../SvgLibrary/Document Structure/SvgTitle.cs | 0 .../SvgLibrary/Document Structure/SvgUse.cs | 0 .../SvgLibrary/Exceptions/SvgException.cs | 0 .../Exceptions/SvgMemoryException.cs | 0 .../Extensibility/SvgForeignObject.cs | 0 .../ExtensionMethods/UriExtensions.cs | 0 .../SvgLibrary/Extensions.cs | 0 .../SvgLibrary/External/ExCSS/IToString.cs | 0 .../SvgLibrary/External/ExCSS/Lexer.cs | 0 .../External/ExCSS/Model/Enumerations.cs | 0 .../Model/Extensions/CharacterExtensions.cs | 0 .../Model/Extensions/StringExtensions.cs | 0 .../External/ExCSS/Model/FunctionBuffer.cs | 0 .../External/ExCSS/Model/HtmlEncoding.cs | 0 .../External/ExCSS/Model/ICssRules.cs | 0 .../External/ExCSS/Model/ICssSelector.cs | 0 .../External/ExCSS/Model/IStyleDeclaration.cs | 0 .../External/ExCSS/Model/ISupportsMedia.cs | 0 .../External/ExCSS/Model/MediaTypeList.cs | 0 .../ExCSS/Model/Rules/AggregateRule.cs | 0 .../ExCSS/Model/Rules/CharacterSetRule.cs | 0 .../ExCSS/Model/Rules/ConditionalRule.cs | 0 .../ExCSS/Model/Rules/DocumentRule.cs | 0 .../ExCSS/Model/Rules/FontFaceRule.cs | 0 .../External/ExCSS/Model/Rules/GenericRule.cs | 0 .../ExCSS/Model/Rules/IRuleContainer.cs | 0 .../External/ExCSS/Model/Rules/ImportRule.cs | 0 .../ExCSS/Model/Rules/KeyframeRule.cs | 0 .../ExCSS/Model/Rules/KeyframesRule.cs | 0 .../External/ExCSS/Model/Rules/MediaRule.cs | 0 .../ExCSS/Model/Rules/NamespaceRule.cs | 0 .../External/ExCSS/Model/Rules/PageRule.cs | 0 .../External/ExCSS/Model/Rules/RuleSet.cs | 0 .../ExCSS/Model/Rules/StyleDeclaration.cs | 0 .../External/ExCSS/Model/Rules/StyleRule.cs | 0 .../ExCSS/Model/Rules/SupportsRule.cs | 0 .../Model/Selector/AggregateSelectorList.cs | 0 .../ExCSS/Model/Selector/BaseSelector.cs | 0 .../Model/Selector/CombinatorSelector.cs | 0 .../ExCSS/Model/Selector/ComplexSelector.cs | 0 .../Model/Selector/FirstChildSelector.cs | 0 .../ExCSS/Model/Selector/LastChildSelector.cs | 0 .../Model/Selector/MultipleSelectorList.cs | 0 .../ExCSS/Model/Selector/NthChildSelector.cs | 0 .../Model/Selector/NthFirstChildSelector.cs | 0 .../Model/Selector/NthLastChildSelector.cs | 0 .../Model/Selector/NthLastOfTypeSelector.cs | 0 .../ExCSS/Model/Selector/NthOfTypeSelector.cs | 0 .../ExCSS/Model/Selector/SelectorFactory.cs | 0 .../ExCSS/Model/Selector/SelectorList.cs | 0 .../ExCSS/Model/Selector/SimpleSelector.cs | 0 .../External/ExCSS/Model/Specification.cs | 0 .../External/ExCSS/Model/TextBlocks/Block.cs | 0 .../ExCSS/Model/TextBlocks/BracketBlock.cs | 0 .../ExCSS/Model/TextBlocks/CharacterBlock.cs | 0 .../ExCSS/Model/TextBlocks/CommentBlock.cs | 0 .../ExCSS/Model/TextBlocks/DelimiterBlock.cs | 0 .../ExCSS/Model/TextBlocks/MatchBlock.cs | 0 .../ExCSS/Model/TextBlocks/NumericBlock.cs | 0 .../ExCSS/Model/TextBlocks/PipeBlock.cs | 0 .../ExCSS/Model/TextBlocks/RangeBlock.cs | 0 .../Model/TextBlocks/SpecialCharacter.cs | 0 .../ExCSS/Model/TextBlocks/StringBlock.cs | 0 .../ExCSS/Model/TextBlocks/SymbolBlock.cs | 0 .../ExCSS/Model/TextBlocks/UnitBlock.cs | 0 .../ExCSS/Model/Values/GenericFunction.cs | 0 .../External/ExCSS/Model/Values/HtmlColor.cs | 0 .../ExCSS/Model/Values/InheritTerm.cs | 0 .../ExCSS/Model/Values/PrimitiveTerm.cs | 0 .../External/ExCSS/Model/Values/Property.cs | 0 .../External/ExCSS/Model/Values/Term.cs | 0 .../External/ExCSS/Model/Values/TermList.cs | 0 .../External/ExCSS/Parser.Blocks.cs | 0 .../SvgLibrary/External/ExCSS/Parser.cs | 0 .../External/ExCSS/Parser.generated.cs | 0 .../SvgLibrary/External/ExCSS/ParserX.cs | 0 .../SvgLibrary/External/ExCSS/StyleSheet.cs | 0 .../External/ExCSS/StylesheetParseError.cs | 0 .../External/ExCSS/StylesheetReader.cs | 0 .../SvgLibrary/External/Fizzler/Either.cs | 0 .../Fizzler/HumanReadableSelectorGenerator.cs | 0 .../External/Fizzler/IElementOps.cs | 0 .../External/Fizzler/ISelectorGenerator.cs | 0 .../External/Fizzler/NamespacePrefix.cs | 0 .../SvgLibrary/External/Fizzler/Parser.cs | 0 .../SvgLibrary/External/Fizzler/Reader.cs | 0 .../SvgLibrary/External/Fizzler/Selector.cs | 0 .../External/Fizzler/SelectorGenerator.cs | 0 .../External/Fizzler/SelectorGeneratorTee.cs | 0 .../Fizzler/SelectorsCachingCompiler.cs | 0 .../SvgLibrary/External/Fizzler/Token.cs | 0 .../SvgLibrary/External/Fizzler/TokenKind.cs | 0 .../SvgLibrary/External/Fizzler/Tokener.cs | 0 .../Filter Effects/ISvgFilterable.cs | 0 .../SvgLibrary/Filter Effects/ImageBuffer.cs | 0 .../SvgLibrary/Filter Effects/SvgFilter.cs | 0 .../Filter Effects/SvgFilterPrimitive.cs | 0 .../feColourMatrix/SvgColourMatrix.cs | 0 .../feColourMatrix/SvgColourMatrixType.cs | 0 .../feGaussianBlur/RawBitmap.cs | 0 .../feGaussianBlur/SvgGaussianBlur.cs | 0 .../Filter Effects/feMerge/SvgMerge.cs | 0 .../Filter Effects/feMerge/SvgMergeNode.cs | 0 .../Filter Effects/feOffset/SvgOffset.cs | 0 .../SvgLibrary/NonSvgElement.cs | 0 .../SvgLibrary/Painting/EnumConverters.cs | 0 .../SvgLibrary/Painting/GenericBoundable.cs | 0 .../SvgLibrary/Painting/ISvgBoundable.cs | 0 .../SvgLibrary/Painting/ISvgStylable.cs | 0 .../SvgLibrary/Painting/SvgColourConverter.cs | 0 .../SvgLibrary/Painting/SvgColourServer.cs | 0 .../Painting/SvgDeferredPaintServer.cs | 0 .../Painting/SvgFallbackPaintServer .cs | 0 .../SvgLibrary/Painting/SvgFillRule.cs | 0 .../SvgLibrary/Painting/SvgGradientServer.cs | 0 .../Painting/SvgGradientSpreadMethod.cs | 0 .../SvgLibrary/Painting/SvgGradientStop.cs | 0 .../Painting/SvgLinearGradientServer.cs | 0 .../SvgLibrary/Painting/SvgMarker.cs | 0 .../SvgLibrary/Painting/SvgPaintServer.cs | 0 .../Painting/SvgPaintServerFactory.cs | 0 .../SvgLibrary/Painting/SvgPatternServer.cs | 0 .../Painting/SvgRadialGradientServer.cs | 0 .../SvgLibrary/Painting/SvgStrokeLineCap.cs | 0 .../SvgLibrary/Painting/SvgStrokeLineJoin.cs | 0 .../SvgLibrary/Paths/CoordinateParser.cs | 0 .../SvgLibrary/Paths/SvgArcSegment.cs | 0 .../SvgLibrary/Paths/SvgClosePathSegment.cs | 0 .../SvgLibrary/Paths/SvgCubicCurveSegment.cs | 0 .../SvgLibrary/Paths/SvgLineSegment.cs | 0 .../SvgLibrary/Paths/SvgMoveToSegment.cs | 0 .../SvgLibrary/Paths/SvgPath.cs | 0 .../SvgLibrary/Paths/SvgPathBuilder.cs | 0 .../SvgLibrary/Paths/SvgPathSegment.cs | 0 .../SvgLibrary/Paths/SvgPathSegmentList.cs | 0 .../Paths/SvgQuadraticCurveSegment.cs | 0 .../SvgLibrary/Rendering/IGraphicsProvider.cs | 0 .../SvgLibrary/Rendering/ISvgRenderer.cs | 0 .../SvgLibrary/Rendering/SvgPathRenderer.cs | 0 .../SvgLibrary/Rendering/SvgRenderer.cs | 0 .../SvgLibrary/Rendering/SvgRendering.cs | 0 .../SvgLibrary/Resources/svg11.dtd | 0 .../SvgLibrary/SvgAttributeAttribute.cs | 0 .../SvgLibrary/SvgAttributeCollection.cs | 0 .../SvgLibrary/SvgContentNode.cs | 0 .../SvgLibrary/SvgDefinitionDefaults.cs | 0 .../SvgLibrary/SvgDocument.cs | 0 .../SvgLibrary/SvgDtdResolver.cs | 0 .../SvgLibrary/SvgElement.cs | 0 .../SvgLibrary/SvgElementAttribute.cs | 0 .../SvgLibrary/SvgElementCollection.cs | 0 .../SvgLibrary/SvgElementFactory.cs | 0 .../SvgLibrary/SvgElementIdManager.cs | 0 .../SvgLibrary/SvgElementStyle.cs | 0 .../SvgLibrary/SvgExtentions.cs | 0 .../SvgLibrary/SvgNodeReader.cs | 0 .../SvgLibrary/SvgTextReader.cs | 0 .../SvgLibrary/SvgUnknownElement.cs | 0 .../SvgLibrary/Text/FontFamily.cs | 0 .../SvgLibrary/Text/GdiFontDefn.cs | 0 .../SvgLibrary/Text/IFontDefn.cs | 0 .../SvgLibrary/Text/PathStatistics.cs | 0 .../SvgLibrary/Text/SvgFont.cs | 0 .../SvgLibrary/Text/SvgFontDefn.cs | 0 .../SvgLibrary/Text/SvgFontFace.cs | 0 .../SvgLibrary/Text/SvgFontFaceSrc.cs | 0 .../SvgLibrary/Text/SvgFontFaceUri.cs | 0 .../SvgLibrary/Text/SvgGlyph.cs | 0 .../SvgLibrary/Text/SvgKern.cs | 0 .../SvgLibrary/Text/SvgMissingGlyph.cs | 0 .../SvgLibrary/Text/SvgText.cs | 0 .../SvgLibrary/Text/SvgTextAnchor.cs | 0 .../SvgLibrary/Text/SvgTextBase.cs | 0 .../SvgLibrary/Text/SvgTextPath.cs | 0 .../SvgLibrary/Text/SvgTextRef.cs | 0 .../SvgLibrary/Text/SvgTextSpan.cs | 0 .../Transforms/ISvgTransformable.cs | 0 .../SvgLibrary/Transforms/SvgMatrix.cs | 0 .../SvgLibrary/Transforms/SvgRotate.cs | 0 .../SvgLibrary/Transforms/SvgScale.cs | 0 .../SvgLibrary/Transforms/SvgShear.cs | 0 .../SvgLibrary/Transforms/SvgSkew.cs | 0 .../SvgLibrary/Transforms/SvgTransform.cs | 0 .../Transforms/SvgTransformCollection.cs | 0 .../Transforms/SvgTransformConverter.cs | 0 .../SvgLibrary/Transforms/SvgTranslate.cs | 0 .../SvgLibrary/Web/SvgHandler.cs | 0 LaserGRBL.sln | 6 + LaserGRBL/LaserGRBL.UI.csproj | 252 +-------------- 252 files changed, 344 insertions(+), 246 deletions(-) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/BezierToBiarc/Algorithm.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/BezierToBiarc/Arc.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/BezierToBiarc/BiArc.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/BezierToBiarc/Complex.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/BezierToBiarc/CubicBezier.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/BezierToBiarc/Line.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/BezierToBiarc/Tuple.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/BezierToBiarc/Vector2.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/CsPotrace.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/CsPotraceExport.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/CsPotrace/CsPotraceExportGCODE.cs (100%) create mode 100644 LaserGRBL.Lib/LaserGRBL.Lib.csproj create mode 100644 LaserGRBL.Lib/Properties/AssemblyInfo.cs rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/DOM.cd (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgCircle.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgEllipse.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgImage.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgLine.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgPathBasedElement.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgPolygon.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgPolyline.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgRectangle.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgVisibility.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgVisualElement.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Basic Shapes/SvgVisualElementStyle.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Clipping and Masking/ISvgClipable.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Clipping and Masking/SvgClipPath.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Clipping and Masking/SvgClipRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Clipping and Masking/SvgMask.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Css/CssQuery.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Css/SvgElementOps.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/ISvgSupportsCoordinateUnits.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/ISvgViewPort.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgAspectRatio.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgAspectRatioConverter.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgColourInterpolation.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgCoordinateUnits.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgElementStyle.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgFontStyle.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgFontVariant.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgFontWeight.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgMarkerUnits.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgOrient.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgOrientConverter.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgOverflow.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgPoint.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgPointCollection.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgTextDecoration.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgTextLengthAdjust.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgTextPathMethod.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgTextPathSpacing.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgUnit.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgUnitCollection.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgUnitConverter.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/SvgViewBox.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/DataTypes/XmlSpaceHandling.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgDefinitionList.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgDescription.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgDocumentMetadata.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgFragment.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgGroup.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgSwitch.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgSymbol.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgTitle.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Document Structure/SvgUse.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Exceptions/SvgException.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Exceptions/SvgMemoryException.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Extensibility/SvgForeignObject.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/ExtensionMethods/UriExtensions.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Extensions.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/IToString.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Lexer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Enumerations.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Extensions/CharacterExtensions.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Extensions/StringExtensions.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/FunctionBuffer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/HtmlEncoding.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/ICssRules.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/ICssSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/IStyleDeclaration.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/ISupportsMedia.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/MediaTypeList.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/AggregateRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/CharacterSetRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/ConditionalRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/DocumentRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/FontFaceRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/GenericRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/IRuleContainer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/ImportRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/KeyframeRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/KeyframesRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/MediaRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/NamespaceRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/PageRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/RuleSet.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/StyleDeclaration.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/StyleRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Rules/SupportsRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/AggregateSelectorList.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/BaseSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/CombinatorSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/ComplexSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/FirstChildSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/LastChildSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/MultipleSelectorList.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/NthChildSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/NthFirstChildSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/NthLastChildSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/NthLastOfTypeSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/NthOfTypeSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/SelectorFactory.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/SelectorList.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Selector/SimpleSelector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Specification.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/Block.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/BracketBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/CharacterBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/CommentBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/DelimiterBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/MatchBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/NumericBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/PipeBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/RangeBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/SpecialCharacter.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/StringBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/SymbolBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/TextBlocks/UnitBlock.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Values/GenericFunction.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Values/HtmlColor.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Values/InheritTerm.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Values/PrimitiveTerm.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Values/Property.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Values/Term.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Model/Values/TermList.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Parser.Blocks.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Parser.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/Parser.generated.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/ParserX.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/StyleSheet.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/StylesheetParseError.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/ExCSS/StylesheetReader.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/Either.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/HumanReadableSelectorGenerator.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/IElementOps.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/ISelectorGenerator.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/NamespacePrefix.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/Parser.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/Reader.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/Selector.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/SelectorGenerator.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/SelectorGeneratorTee.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/SelectorsCachingCompiler.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/Token.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/TokenKind.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/External/Fizzler/Tokener.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/ISvgFilterable.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/ImageBuffer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/SvgFilter.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/SvgFilterPrimitive.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrix.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrixType.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/feGaussianBlur/RawBitmap.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/feGaussianBlur/SvgGaussianBlur.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/feMerge/SvgMerge.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/feMerge/SvgMergeNode.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Filter Effects/feOffset/SvgOffset.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/NonSvgElement.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/EnumConverters.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/GenericBoundable.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/ISvgBoundable.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/ISvgStylable.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgColourConverter.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgColourServer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgDeferredPaintServer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgFallbackPaintServer .cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgFillRule.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgGradientServer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgGradientSpreadMethod.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgGradientStop.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgLinearGradientServer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgMarker.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgPaintServer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgPaintServerFactory.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgPatternServer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgRadialGradientServer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgStrokeLineCap.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Painting/SvgStrokeLineJoin.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/CoordinateParser.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgArcSegment.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgClosePathSegment.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgCubicCurveSegment.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgLineSegment.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgMoveToSegment.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgPath.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgPathBuilder.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgPathSegment.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgPathSegmentList.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Paths/SvgQuadraticCurveSegment.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Rendering/IGraphicsProvider.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Rendering/ISvgRenderer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Rendering/SvgPathRenderer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Rendering/SvgRenderer.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Rendering/SvgRendering.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Resources/svg11.dtd (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgAttributeAttribute.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgAttributeCollection.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgContentNode.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgDefinitionDefaults.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgDocument.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgDtdResolver.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgElement.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgElementAttribute.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgElementCollection.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgElementFactory.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgElementIdManager.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgElementStyle.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgExtentions.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgNodeReader.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgTextReader.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/SvgUnknownElement.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/FontFamily.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/GdiFontDefn.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/IFontDefn.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/PathStatistics.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgFont.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgFontDefn.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgFontFace.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgFontFaceSrc.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgFontFaceUri.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgGlyph.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgKern.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgMissingGlyph.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgText.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgTextAnchor.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgTextBase.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgTextPath.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgTextRef.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Text/SvgTextSpan.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/ISvgTransformable.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgMatrix.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgRotate.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgScale.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgShear.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgSkew.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgTransform.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgTransformCollection.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgTransformConverter.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Transforms/SvgTranslate.cs (100%) rename {LaserGRBL => LaserGRBL.Lib}/SvgLibrary/Web/SvgHandler.cs (100%) diff --git a/LaserGRBL/CsPotrace/BezierToBiarc/Algorithm.cs b/LaserGRBL.Lib/CsPotrace/BezierToBiarc/Algorithm.cs similarity index 100% rename from LaserGRBL/CsPotrace/BezierToBiarc/Algorithm.cs rename to LaserGRBL.Lib/CsPotrace/BezierToBiarc/Algorithm.cs diff --git a/LaserGRBL/CsPotrace/BezierToBiarc/Arc.cs b/LaserGRBL.Lib/CsPotrace/BezierToBiarc/Arc.cs similarity index 100% rename from LaserGRBL/CsPotrace/BezierToBiarc/Arc.cs rename to LaserGRBL.Lib/CsPotrace/BezierToBiarc/Arc.cs diff --git a/LaserGRBL/CsPotrace/BezierToBiarc/BiArc.cs b/LaserGRBL.Lib/CsPotrace/BezierToBiarc/BiArc.cs similarity index 100% rename from LaserGRBL/CsPotrace/BezierToBiarc/BiArc.cs rename to LaserGRBL.Lib/CsPotrace/BezierToBiarc/BiArc.cs diff --git a/LaserGRBL/CsPotrace/BezierToBiarc/Complex.cs b/LaserGRBL.Lib/CsPotrace/BezierToBiarc/Complex.cs similarity index 100% rename from LaserGRBL/CsPotrace/BezierToBiarc/Complex.cs rename to LaserGRBL.Lib/CsPotrace/BezierToBiarc/Complex.cs diff --git a/LaserGRBL/CsPotrace/BezierToBiarc/CubicBezier.cs b/LaserGRBL.Lib/CsPotrace/BezierToBiarc/CubicBezier.cs similarity index 100% rename from LaserGRBL/CsPotrace/BezierToBiarc/CubicBezier.cs rename to LaserGRBL.Lib/CsPotrace/BezierToBiarc/CubicBezier.cs diff --git a/LaserGRBL/CsPotrace/BezierToBiarc/Line.cs b/LaserGRBL.Lib/CsPotrace/BezierToBiarc/Line.cs similarity index 100% rename from LaserGRBL/CsPotrace/BezierToBiarc/Line.cs rename to LaserGRBL.Lib/CsPotrace/BezierToBiarc/Line.cs diff --git a/LaserGRBL/CsPotrace/BezierToBiarc/Tuple.cs b/LaserGRBL.Lib/CsPotrace/BezierToBiarc/Tuple.cs similarity index 100% rename from LaserGRBL/CsPotrace/BezierToBiarc/Tuple.cs rename to LaserGRBL.Lib/CsPotrace/BezierToBiarc/Tuple.cs diff --git a/LaserGRBL/CsPotrace/BezierToBiarc/Vector2.cs b/LaserGRBL.Lib/CsPotrace/BezierToBiarc/Vector2.cs similarity index 100% rename from LaserGRBL/CsPotrace/BezierToBiarc/Vector2.cs rename to LaserGRBL.Lib/CsPotrace/BezierToBiarc/Vector2.cs diff --git a/LaserGRBL/CsPotrace/CsPotrace.cs b/LaserGRBL.Lib/CsPotrace/CsPotrace.cs similarity index 100% rename from LaserGRBL/CsPotrace/CsPotrace.cs rename to LaserGRBL.Lib/CsPotrace/CsPotrace.cs diff --git a/LaserGRBL/CsPotrace/CsPotraceExport.cs b/LaserGRBL.Lib/CsPotrace/CsPotraceExport.cs similarity index 100% rename from LaserGRBL/CsPotrace/CsPotraceExport.cs rename to LaserGRBL.Lib/CsPotrace/CsPotraceExport.cs diff --git a/LaserGRBL/CsPotrace/CsPotraceExportGCODE.cs b/LaserGRBL.Lib/CsPotrace/CsPotraceExportGCODE.cs similarity index 100% rename from LaserGRBL/CsPotrace/CsPotraceExportGCODE.cs rename to LaserGRBL.Lib/CsPotrace/CsPotraceExportGCODE.cs diff --git a/LaserGRBL.Lib/LaserGRBL.Lib.csproj b/LaserGRBL.Lib/LaserGRBL.Lib.csproj new file mode 100644 index 000000000..63c0199e9 --- /dev/null +++ b/LaserGRBL.Lib/LaserGRBL.Lib.csproj @@ -0,0 +1,296 @@ + + + + + Debug + AnyCPU + {32D33447-815B-448A-968F-D8810D6440B1} + Library + Properties + LaserGRBL + LaserGRBL.Lib + v3.5 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LaserGRBL.Lib/Properties/AssemblyInfo.cs b/LaserGRBL.Lib/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..e828e04e5 --- /dev/null +++ b/LaserGRBL.Lib/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("LaserGRBL.Lib")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LaserGRBL.Lib")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("32d33447-815b-448a-968f-d8810d6440b1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/DOM.cd b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/DOM.cd similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/DOM.cd rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/DOM.cd diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgCircle.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgCircle.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgCircle.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgCircle.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgEllipse.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgEllipse.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgEllipse.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgEllipse.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgImage.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgImage.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgImage.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgImage.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgLine.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgLine.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgLine.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgLine.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgPathBasedElement.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgPathBasedElement.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgPathBasedElement.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgPathBasedElement.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgPolygon.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgPolygon.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgPolygon.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgPolygon.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgPolyline.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgPolyline.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgPolyline.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgPolyline.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgRectangle.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgRectangle.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgRectangle.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgRectangle.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgVisibility.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgVisibility.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgVisibility.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgVisibility.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgVisualElement.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgVisualElement.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgVisualElement.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgVisualElement.cs diff --git a/LaserGRBL/SvgLibrary/Basic Shapes/SvgVisualElementStyle.cs b/LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgVisualElementStyle.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Basic Shapes/SvgVisualElementStyle.cs rename to LaserGRBL.Lib/SvgLibrary/Basic Shapes/SvgVisualElementStyle.cs diff --git a/LaserGRBL/SvgLibrary/Clipping and Masking/ISvgClipable.cs b/LaserGRBL.Lib/SvgLibrary/Clipping and Masking/ISvgClipable.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Clipping and Masking/ISvgClipable.cs rename to LaserGRBL.Lib/SvgLibrary/Clipping and Masking/ISvgClipable.cs diff --git a/LaserGRBL/SvgLibrary/Clipping and Masking/SvgClipPath.cs b/LaserGRBL.Lib/SvgLibrary/Clipping and Masking/SvgClipPath.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Clipping and Masking/SvgClipPath.cs rename to LaserGRBL.Lib/SvgLibrary/Clipping and Masking/SvgClipPath.cs diff --git a/LaserGRBL/SvgLibrary/Clipping and Masking/SvgClipRule.cs b/LaserGRBL.Lib/SvgLibrary/Clipping and Masking/SvgClipRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Clipping and Masking/SvgClipRule.cs rename to LaserGRBL.Lib/SvgLibrary/Clipping and Masking/SvgClipRule.cs diff --git a/LaserGRBL/SvgLibrary/Clipping and Masking/SvgMask.cs b/LaserGRBL.Lib/SvgLibrary/Clipping and Masking/SvgMask.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Clipping and Masking/SvgMask.cs rename to LaserGRBL.Lib/SvgLibrary/Clipping and Masking/SvgMask.cs diff --git a/LaserGRBL/SvgLibrary/Css/CssQuery.cs b/LaserGRBL.Lib/SvgLibrary/Css/CssQuery.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Css/CssQuery.cs rename to LaserGRBL.Lib/SvgLibrary/Css/CssQuery.cs diff --git a/LaserGRBL/SvgLibrary/Css/SvgElementOps.cs b/LaserGRBL.Lib/SvgLibrary/Css/SvgElementOps.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Css/SvgElementOps.cs rename to LaserGRBL.Lib/SvgLibrary/Css/SvgElementOps.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/ISvgSupportsCoordinateUnits.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/ISvgSupportsCoordinateUnits.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/ISvgSupportsCoordinateUnits.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/ISvgSupportsCoordinateUnits.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/ISvgViewPort.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/ISvgViewPort.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/ISvgViewPort.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/ISvgViewPort.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgAspectRatio.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgAspectRatio.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgAspectRatio.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgAspectRatio.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgAspectRatioConverter.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgAspectRatioConverter.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgAspectRatioConverter.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgAspectRatioConverter.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgColourInterpolation.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgColourInterpolation.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgColourInterpolation.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgColourInterpolation.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgCoordinateUnits.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgCoordinateUnits.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgCoordinateUnits.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgCoordinateUnits.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgElementStyle.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgElementStyle.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgElementStyle.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgElementStyle.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgFontStyle.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgFontStyle.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgFontStyle.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgFontStyle.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgFontVariant.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgFontVariant.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgFontVariant.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgFontVariant.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgFontWeight.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgFontWeight.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgFontWeight.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgFontWeight.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgMarkerUnits.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgMarkerUnits.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgMarkerUnits.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgMarkerUnits.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgOrient.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgOrient.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgOrient.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgOrient.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgOrientConverter.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgOrientConverter.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgOrientConverter.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgOrientConverter.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgOverflow.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgOverflow.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgOverflow.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgOverflow.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgPoint.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgPoint.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgPoint.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgPoint.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgPointCollection.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgPointCollection.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgPointCollection.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgPointCollection.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgTextDecoration.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgTextDecoration.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgTextDecoration.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgTextDecoration.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgTextLengthAdjust.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgTextLengthAdjust.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgTextLengthAdjust.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgTextLengthAdjust.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgTextPathMethod.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgTextPathMethod.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgTextPathMethod.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgTextPathMethod.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgTextPathSpacing.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgTextPathSpacing.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgTextPathSpacing.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgTextPathSpacing.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgUnit.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgUnit.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgUnit.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgUnit.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgUnitCollection.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgUnitCollection.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgUnitCollection.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgUnitCollection.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgUnitConverter.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgUnitConverter.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgUnitConverter.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgUnitConverter.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/SvgViewBox.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/SvgViewBox.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/SvgViewBox.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/SvgViewBox.cs diff --git a/LaserGRBL/SvgLibrary/DataTypes/XmlSpaceHandling.cs b/LaserGRBL.Lib/SvgLibrary/DataTypes/XmlSpaceHandling.cs similarity index 100% rename from LaserGRBL/SvgLibrary/DataTypes/XmlSpaceHandling.cs rename to LaserGRBL.Lib/SvgLibrary/DataTypes/XmlSpaceHandling.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgDefinitionList.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgDefinitionList.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgDefinitionList.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgDefinitionList.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgDescription.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgDescription.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgDescription.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgDescription.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgDocumentMetadata.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgDocumentMetadata.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgDocumentMetadata.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgDocumentMetadata.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgFragment.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgFragment.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgFragment.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgFragment.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgGroup.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgGroup.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgGroup.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgGroup.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgSwitch.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgSwitch.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgSwitch.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgSwitch.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgSymbol.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgSymbol.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgSymbol.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgSymbol.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgTitle.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgTitle.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgTitle.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgTitle.cs diff --git a/LaserGRBL/SvgLibrary/Document Structure/SvgUse.cs b/LaserGRBL.Lib/SvgLibrary/Document Structure/SvgUse.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Document Structure/SvgUse.cs rename to LaserGRBL.Lib/SvgLibrary/Document Structure/SvgUse.cs diff --git a/LaserGRBL/SvgLibrary/Exceptions/SvgException.cs b/LaserGRBL.Lib/SvgLibrary/Exceptions/SvgException.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Exceptions/SvgException.cs rename to LaserGRBL.Lib/SvgLibrary/Exceptions/SvgException.cs diff --git a/LaserGRBL/SvgLibrary/Exceptions/SvgMemoryException.cs b/LaserGRBL.Lib/SvgLibrary/Exceptions/SvgMemoryException.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Exceptions/SvgMemoryException.cs rename to LaserGRBL.Lib/SvgLibrary/Exceptions/SvgMemoryException.cs diff --git a/LaserGRBL/SvgLibrary/Extensibility/SvgForeignObject.cs b/LaserGRBL.Lib/SvgLibrary/Extensibility/SvgForeignObject.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Extensibility/SvgForeignObject.cs rename to LaserGRBL.Lib/SvgLibrary/Extensibility/SvgForeignObject.cs diff --git a/LaserGRBL/SvgLibrary/ExtensionMethods/UriExtensions.cs b/LaserGRBL.Lib/SvgLibrary/ExtensionMethods/UriExtensions.cs similarity index 100% rename from LaserGRBL/SvgLibrary/ExtensionMethods/UriExtensions.cs rename to LaserGRBL.Lib/SvgLibrary/ExtensionMethods/UriExtensions.cs diff --git a/LaserGRBL/SvgLibrary/Extensions.cs b/LaserGRBL.Lib/SvgLibrary/Extensions.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Extensions.cs rename to LaserGRBL.Lib/SvgLibrary/Extensions.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/IToString.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/IToString.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/IToString.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/IToString.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Lexer.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Lexer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Lexer.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Lexer.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Enumerations.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Enumerations.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Enumerations.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Enumerations.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Extensions/CharacterExtensions.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Extensions/CharacterExtensions.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Extensions/CharacterExtensions.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Extensions/CharacterExtensions.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Extensions/StringExtensions.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Extensions/StringExtensions.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Extensions/StringExtensions.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Extensions/StringExtensions.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/FunctionBuffer.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/FunctionBuffer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/FunctionBuffer.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/FunctionBuffer.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/HtmlEncoding.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/HtmlEncoding.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/HtmlEncoding.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/HtmlEncoding.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/ICssRules.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/ICssRules.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/ICssRules.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/ICssRules.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/ICssSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/ICssSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/ICssSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/ICssSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/IStyleDeclaration.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/IStyleDeclaration.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/IStyleDeclaration.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/IStyleDeclaration.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/ISupportsMedia.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/ISupportsMedia.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/ISupportsMedia.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/ISupportsMedia.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/MediaTypeList.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/MediaTypeList.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/MediaTypeList.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/MediaTypeList.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/AggregateRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/AggregateRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/AggregateRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/AggregateRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/CharacterSetRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/CharacterSetRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/CharacterSetRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/CharacterSetRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/ConditionalRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/ConditionalRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/ConditionalRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/ConditionalRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/DocumentRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/DocumentRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/DocumentRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/DocumentRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/FontFaceRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/FontFaceRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/FontFaceRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/FontFaceRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/GenericRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/GenericRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/GenericRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/GenericRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/IRuleContainer.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/IRuleContainer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/IRuleContainer.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/IRuleContainer.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/ImportRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/ImportRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/ImportRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/ImportRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/KeyframeRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/KeyframeRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/KeyframeRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/KeyframeRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/KeyframesRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/KeyframesRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/KeyframesRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/KeyframesRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/MediaRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/MediaRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/MediaRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/MediaRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/NamespaceRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/NamespaceRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/NamespaceRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/NamespaceRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/PageRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/PageRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/PageRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/PageRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/RuleSet.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/RuleSet.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/RuleSet.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/RuleSet.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/StyleDeclaration.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/StyleDeclaration.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/StyleDeclaration.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/StyleDeclaration.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/StyleRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/StyleRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/StyleRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/StyleRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/SupportsRule.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/SupportsRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Rules/SupportsRule.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Rules/SupportsRule.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/AggregateSelectorList.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/AggregateSelectorList.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/AggregateSelectorList.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/AggregateSelectorList.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/BaseSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/BaseSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/BaseSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/BaseSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/CombinatorSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/CombinatorSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/CombinatorSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/CombinatorSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/ComplexSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/ComplexSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/ComplexSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/ComplexSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/FirstChildSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/FirstChildSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/FirstChildSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/FirstChildSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/LastChildSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/LastChildSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/LastChildSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/LastChildSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/MultipleSelectorList.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/MultipleSelectorList.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/MultipleSelectorList.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/MultipleSelectorList.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthChildSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthChildSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthChildSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthChildSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthFirstChildSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthFirstChildSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthFirstChildSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthFirstChildSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthLastChildSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthLastChildSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthLastChildSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthLastChildSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthLastOfTypeSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthLastOfTypeSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthLastOfTypeSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthLastOfTypeSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthOfTypeSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthOfTypeSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/NthOfTypeSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/NthOfTypeSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/SelectorFactory.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/SelectorFactory.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/SelectorFactory.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/SelectorFactory.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/SelectorList.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/SelectorList.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/SelectorList.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/SelectorList.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/SimpleSelector.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/SimpleSelector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Selector/SimpleSelector.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Selector/SimpleSelector.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Specification.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Specification.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Specification.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Specification.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/Block.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/Block.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/Block.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/Block.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/BracketBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/BracketBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/BracketBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/BracketBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/CharacterBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/CharacterBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/CharacterBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/CharacterBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/CommentBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/CommentBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/CommentBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/CommentBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/DelimiterBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/DelimiterBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/DelimiterBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/DelimiterBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/MatchBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/MatchBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/MatchBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/MatchBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/NumericBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/NumericBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/NumericBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/NumericBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/PipeBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/PipeBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/PipeBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/PipeBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/RangeBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/RangeBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/RangeBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/RangeBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/SpecialCharacter.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/SpecialCharacter.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/SpecialCharacter.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/SpecialCharacter.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/StringBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/StringBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/StringBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/StringBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/SymbolBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/SymbolBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/SymbolBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/SymbolBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/UnitBlock.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/UnitBlock.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/TextBlocks/UnitBlock.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/TextBlocks/UnitBlock.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/GenericFunction.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/GenericFunction.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/GenericFunction.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/GenericFunction.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/HtmlColor.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/HtmlColor.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/HtmlColor.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/HtmlColor.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/InheritTerm.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/InheritTerm.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/InheritTerm.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/InheritTerm.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/PrimitiveTerm.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/PrimitiveTerm.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/PrimitiveTerm.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/PrimitiveTerm.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/Property.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/Property.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/Property.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/Property.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/Term.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/Term.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/Term.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/Term.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/TermList.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/TermList.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Model/Values/TermList.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Model/Values/TermList.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Parser.Blocks.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Parser.Blocks.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Parser.Blocks.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Parser.Blocks.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Parser.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Parser.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Parser.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Parser.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/Parser.generated.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/Parser.generated.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/Parser.generated.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/Parser.generated.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/ParserX.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/ParserX.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/ParserX.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/ParserX.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/StyleSheet.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/StyleSheet.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/StyleSheet.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/StyleSheet.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/StylesheetParseError.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/StylesheetParseError.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/StylesheetParseError.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/StylesheetParseError.cs diff --git a/LaserGRBL/SvgLibrary/External/ExCSS/StylesheetReader.cs b/LaserGRBL.Lib/SvgLibrary/External/ExCSS/StylesheetReader.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/ExCSS/StylesheetReader.cs rename to LaserGRBL.Lib/SvgLibrary/External/ExCSS/StylesheetReader.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/Either.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/Either.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/Either.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/Either.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/HumanReadableSelectorGenerator.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/HumanReadableSelectorGenerator.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/HumanReadableSelectorGenerator.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/HumanReadableSelectorGenerator.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/IElementOps.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/IElementOps.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/IElementOps.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/IElementOps.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/ISelectorGenerator.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/ISelectorGenerator.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/ISelectorGenerator.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/ISelectorGenerator.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/NamespacePrefix.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/NamespacePrefix.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/NamespacePrefix.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/NamespacePrefix.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/Parser.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/Parser.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/Parser.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/Parser.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/Reader.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/Reader.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/Reader.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/Reader.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/Selector.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/Selector.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/Selector.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/Selector.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/SelectorGenerator.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/SelectorGenerator.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/SelectorGenerator.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/SelectorGenerator.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/SelectorGeneratorTee.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/SelectorGeneratorTee.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/SelectorGeneratorTee.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/SelectorGeneratorTee.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/SelectorsCachingCompiler.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/SelectorsCachingCompiler.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/SelectorsCachingCompiler.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/SelectorsCachingCompiler.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/Token.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/Token.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/Token.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/Token.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/TokenKind.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/TokenKind.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/TokenKind.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/TokenKind.cs diff --git a/LaserGRBL/SvgLibrary/External/Fizzler/Tokener.cs b/LaserGRBL.Lib/SvgLibrary/External/Fizzler/Tokener.cs similarity index 100% rename from LaserGRBL/SvgLibrary/External/Fizzler/Tokener.cs rename to LaserGRBL.Lib/SvgLibrary/External/Fizzler/Tokener.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/ISvgFilterable.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/ISvgFilterable.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/ISvgFilterable.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/ISvgFilterable.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/ImageBuffer.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/ImageBuffer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/ImageBuffer.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/ImageBuffer.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/SvgFilter.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/SvgFilter.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/SvgFilter.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/SvgFilter.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/SvgFilterPrimitive.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/SvgFilterPrimitive.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/SvgFilterPrimitive.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/SvgFilterPrimitive.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrix.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrix.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrix.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrix.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrixType.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrixType.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrixType.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/feColourMatrix/SvgColourMatrixType.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/feGaussianBlur/RawBitmap.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/feGaussianBlur/RawBitmap.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/feGaussianBlur/RawBitmap.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/feGaussianBlur/RawBitmap.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/feGaussianBlur/SvgGaussianBlur.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/feGaussianBlur/SvgGaussianBlur.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/feGaussianBlur/SvgGaussianBlur.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/feGaussianBlur/SvgGaussianBlur.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/feMerge/SvgMerge.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/feMerge/SvgMerge.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/feMerge/SvgMerge.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/feMerge/SvgMerge.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/feMerge/SvgMergeNode.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/feMerge/SvgMergeNode.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/feMerge/SvgMergeNode.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/feMerge/SvgMergeNode.cs diff --git a/LaserGRBL/SvgLibrary/Filter Effects/feOffset/SvgOffset.cs b/LaserGRBL.Lib/SvgLibrary/Filter Effects/feOffset/SvgOffset.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Filter Effects/feOffset/SvgOffset.cs rename to LaserGRBL.Lib/SvgLibrary/Filter Effects/feOffset/SvgOffset.cs diff --git a/LaserGRBL/SvgLibrary/NonSvgElement.cs b/LaserGRBL.Lib/SvgLibrary/NonSvgElement.cs similarity index 100% rename from LaserGRBL/SvgLibrary/NonSvgElement.cs rename to LaserGRBL.Lib/SvgLibrary/NonSvgElement.cs diff --git a/LaserGRBL/SvgLibrary/Painting/EnumConverters.cs b/LaserGRBL.Lib/SvgLibrary/Painting/EnumConverters.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/EnumConverters.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/EnumConverters.cs diff --git a/LaserGRBL/SvgLibrary/Painting/GenericBoundable.cs b/LaserGRBL.Lib/SvgLibrary/Painting/GenericBoundable.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/GenericBoundable.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/GenericBoundable.cs diff --git a/LaserGRBL/SvgLibrary/Painting/ISvgBoundable.cs b/LaserGRBL.Lib/SvgLibrary/Painting/ISvgBoundable.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/ISvgBoundable.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/ISvgBoundable.cs diff --git a/LaserGRBL/SvgLibrary/Painting/ISvgStylable.cs b/LaserGRBL.Lib/SvgLibrary/Painting/ISvgStylable.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/ISvgStylable.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/ISvgStylable.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgColourConverter.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgColourConverter.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgColourConverter.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgColourConverter.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgColourServer.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgColourServer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgColourServer.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgColourServer.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgDeferredPaintServer.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgDeferredPaintServer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgDeferredPaintServer.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgDeferredPaintServer.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgFallbackPaintServer .cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgFallbackPaintServer .cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgFallbackPaintServer .cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgFallbackPaintServer .cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgFillRule.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgFillRule.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgFillRule.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgFillRule.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgGradientServer.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgGradientServer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgGradientServer.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgGradientServer.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgGradientSpreadMethod.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgGradientSpreadMethod.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgGradientSpreadMethod.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgGradientSpreadMethod.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgGradientStop.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgGradientStop.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgGradientStop.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgGradientStop.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgLinearGradientServer.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgLinearGradientServer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgLinearGradientServer.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgLinearGradientServer.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgMarker.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgMarker.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgMarker.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgMarker.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgPaintServer.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgPaintServer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgPaintServer.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgPaintServer.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgPaintServerFactory.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgPaintServerFactory.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgPaintServerFactory.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgPaintServerFactory.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgPatternServer.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgPatternServer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgPatternServer.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgPatternServer.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgRadialGradientServer.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgRadialGradientServer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgRadialGradientServer.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgRadialGradientServer.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgStrokeLineCap.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgStrokeLineCap.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgStrokeLineCap.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgStrokeLineCap.cs diff --git a/LaserGRBL/SvgLibrary/Painting/SvgStrokeLineJoin.cs b/LaserGRBL.Lib/SvgLibrary/Painting/SvgStrokeLineJoin.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Painting/SvgStrokeLineJoin.cs rename to LaserGRBL.Lib/SvgLibrary/Painting/SvgStrokeLineJoin.cs diff --git a/LaserGRBL/SvgLibrary/Paths/CoordinateParser.cs b/LaserGRBL.Lib/SvgLibrary/Paths/CoordinateParser.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/CoordinateParser.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/CoordinateParser.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgArcSegment.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgArcSegment.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgArcSegment.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgArcSegment.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgClosePathSegment.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgClosePathSegment.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgClosePathSegment.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgClosePathSegment.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgCubicCurveSegment.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgCubicCurveSegment.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgCubicCurveSegment.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgCubicCurveSegment.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgLineSegment.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgLineSegment.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgLineSegment.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgLineSegment.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgMoveToSegment.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgMoveToSegment.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgMoveToSegment.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgMoveToSegment.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgPath.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgPath.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgPath.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgPath.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgPathBuilder.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgPathBuilder.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgPathBuilder.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgPathBuilder.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgPathSegment.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgPathSegment.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgPathSegment.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgPathSegment.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgPathSegmentList.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgPathSegmentList.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgPathSegmentList.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgPathSegmentList.cs diff --git a/LaserGRBL/SvgLibrary/Paths/SvgQuadraticCurveSegment.cs b/LaserGRBL.Lib/SvgLibrary/Paths/SvgQuadraticCurveSegment.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Paths/SvgQuadraticCurveSegment.cs rename to LaserGRBL.Lib/SvgLibrary/Paths/SvgQuadraticCurveSegment.cs diff --git a/LaserGRBL/SvgLibrary/Rendering/IGraphicsProvider.cs b/LaserGRBL.Lib/SvgLibrary/Rendering/IGraphicsProvider.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Rendering/IGraphicsProvider.cs rename to LaserGRBL.Lib/SvgLibrary/Rendering/IGraphicsProvider.cs diff --git a/LaserGRBL/SvgLibrary/Rendering/ISvgRenderer.cs b/LaserGRBL.Lib/SvgLibrary/Rendering/ISvgRenderer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Rendering/ISvgRenderer.cs rename to LaserGRBL.Lib/SvgLibrary/Rendering/ISvgRenderer.cs diff --git a/LaserGRBL/SvgLibrary/Rendering/SvgPathRenderer.cs b/LaserGRBL.Lib/SvgLibrary/Rendering/SvgPathRenderer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Rendering/SvgPathRenderer.cs rename to LaserGRBL.Lib/SvgLibrary/Rendering/SvgPathRenderer.cs diff --git a/LaserGRBL/SvgLibrary/Rendering/SvgRenderer.cs b/LaserGRBL.Lib/SvgLibrary/Rendering/SvgRenderer.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Rendering/SvgRenderer.cs rename to LaserGRBL.Lib/SvgLibrary/Rendering/SvgRenderer.cs diff --git a/LaserGRBL/SvgLibrary/Rendering/SvgRendering.cs b/LaserGRBL.Lib/SvgLibrary/Rendering/SvgRendering.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Rendering/SvgRendering.cs rename to LaserGRBL.Lib/SvgLibrary/Rendering/SvgRendering.cs diff --git a/LaserGRBL/SvgLibrary/Resources/svg11.dtd b/LaserGRBL.Lib/SvgLibrary/Resources/svg11.dtd similarity index 100% rename from LaserGRBL/SvgLibrary/Resources/svg11.dtd rename to LaserGRBL.Lib/SvgLibrary/Resources/svg11.dtd diff --git a/LaserGRBL/SvgLibrary/SvgAttributeAttribute.cs b/LaserGRBL.Lib/SvgLibrary/SvgAttributeAttribute.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgAttributeAttribute.cs rename to LaserGRBL.Lib/SvgLibrary/SvgAttributeAttribute.cs diff --git a/LaserGRBL/SvgLibrary/SvgAttributeCollection.cs b/LaserGRBL.Lib/SvgLibrary/SvgAttributeCollection.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgAttributeCollection.cs rename to LaserGRBL.Lib/SvgLibrary/SvgAttributeCollection.cs diff --git a/LaserGRBL/SvgLibrary/SvgContentNode.cs b/LaserGRBL.Lib/SvgLibrary/SvgContentNode.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgContentNode.cs rename to LaserGRBL.Lib/SvgLibrary/SvgContentNode.cs diff --git a/LaserGRBL/SvgLibrary/SvgDefinitionDefaults.cs b/LaserGRBL.Lib/SvgLibrary/SvgDefinitionDefaults.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgDefinitionDefaults.cs rename to LaserGRBL.Lib/SvgLibrary/SvgDefinitionDefaults.cs diff --git a/LaserGRBL/SvgLibrary/SvgDocument.cs b/LaserGRBL.Lib/SvgLibrary/SvgDocument.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgDocument.cs rename to LaserGRBL.Lib/SvgLibrary/SvgDocument.cs diff --git a/LaserGRBL/SvgLibrary/SvgDtdResolver.cs b/LaserGRBL.Lib/SvgLibrary/SvgDtdResolver.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgDtdResolver.cs rename to LaserGRBL.Lib/SvgLibrary/SvgDtdResolver.cs diff --git a/LaserGRBL/SvgLibrary/SvgElement.cs b/LaserGRBL.Lib/SvgLibrary/SvgElement.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgElement.cs rename to LaserGRBL.Lib/SvgLibrary/SvgElement.cs diff --git a/LaserGRBL/SvgLibrary/SvgElementAttribute.cs b/LaserGRBL.Lib/SvgLibrary/SvgElementAttribute.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgElementAttribute.cs rename to LaserGRBL.Lib/SvgLibrary/SvgElementAttribute.cs diff --git a/LaserGRBL/SvgLibrary/SvgElementCollection.cs b/LaserGRBL.Lib/SvgLibrary/SvgElementCollection.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgElementCollection.cs rename to LaserGRBL.Lib/SvgLibrary/SvgElementCollection.cs diff --git a/LaserGRBL/SvgLibrary/SvgElementFactory.cs b/LaserGRBL.Lib/SvgLibrary/SvgElementFactory.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgElementFactory.cs rename to LaserGRBL.Lib/SvgLibrary/SvgElementFactory.cs diff --git a/LaserGRBL/SvgLibrary/SvgElementIdManager.cs b/LaserGRBL.Lib/SvgLibrary/SvgElementIdManager.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgElementIdManager.cs rename to LaserGRBL.Lib/SvgLibrary/SvgElementIdManager.cs diff --git a/LaserGRBL/SvgLibrary/SvgElementStyle.cs b/LaserGRBL.Lib/SvgLibrary/SvgElementStyle.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgElementStyle.cs rename to LaserGRBL.Lib/SvgLibrary/SvgElementStyle.cs diff --git a/LaserGRBL/SvgLibrary/SvgExtentions.cs b/LaserGRBL.Lib/SvgLibrary/SvgExtentions.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgExtentions.cs rename to LaserGRBL.Lib/SvgLibrary/SvgExtentions.cs diff --git a/LaserGRBL/SvgLibrary/SvgNodeReader.cs b/LaserGRBL.Lib/SvgLibrary/SvgNodeReader.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgNodeReader.cs rename to LaserGRBL.Lib/SvgLibrary/SvgNodeReader.cs diff --git a/LaserGRBL/SvgLibrary/SvgTextReader.cs b/LaserGRBL.Lib/SvgLibrary/SvgTextReader.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgTextReader.cs rename to LaserGRBL.Lib/SvgLibrary/SvgTextReader.cs diff --git a/LaserGRBL/SvgLibrary/SvgUnknownElement.cs b/LaserGRBL.Lib/SvgLibrary/SvgUnknownElement.cs similarity index 100% rename from LaserGRBL/SvgLibrary/SvgUnknownElement.cs rename to LaserGRBL.Lib/SvgLibrary/SvgUnknownElement.cs diff --git a/LaserGRBL/SvgLibrary/Text/FontFamily.cs b/LaserGRBL.Lib/SvgLibrary/Text/FontFamily.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/FontFamily.cs rename to LaserGRBL.Lib/SvgLibrary/Text/FontFamily.cs diff --git a/LaserGRBL/SvgLibrary/Text/GdiFontDefn.cs b/LaserGRBL.Lib/SvgLibrary/Text/GdiFontDefn.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/GdiFontDefn.cs rename to LaserGRBL.Lib/SvgLibrary/Text/GdiFontDefn.cs diff --git a/LaserGRBL/SvgLibrary/Text/IFontDefn.cs b/LaserGRBL.Lib/SvgLibrary/Text/IFontDefn.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/IFontDefn.cs rename to LaserGRBL.Lib/SvgLibrary/Text/IFontDefn.cs diff --git a/LaserGRBL/SvgLibrary/Text/PathStatistics.cs b/LaserGRBL.Lib/SvgLibrary/Text/PathStatistics.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/PathStatistics.cs rename to LaserGRBL.Lib/SvgLibrary/Text/PathStatistics.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgFont.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgFont.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgFont.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgFont.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgFontDefn.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgFontDefn.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgFontDefn.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgFontDefn.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgFontFace.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgFontFace.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgFontFace.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgFontFace.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgFontFaceSrc.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgFontFaceSrc.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgFontFaceSrc.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgFontFaceSrc.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgFontFaceUri.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgFontFaceUri.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgFontFaceUri.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgFontFaceUri.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgGlyph.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgGlyph.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgGlyph.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgGlyph.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgKern.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgKern.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgKern.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgKern.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgMissingGlyph.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgMissingGlyph.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgMissingGlyph.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgMissingGlyph.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgText.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgText.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgText.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgText.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgTextAnchor.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgTextAnchor.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgTextAnchor.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgTextAnchor.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgTextBase.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgTextBase.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgTextBase.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgTextBase.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgTextPath.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgTextPath.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgTextPath.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgTextPath.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgTextRef.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgTextRef.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgTextRef.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgTextRef.cs diff --git a/LaserGRBL/SvgLibrary/Text/SvgTextSpan.cs b/LaserGRBL.Lib/SvgLibrary/Text/SvgTextSpan.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Text/SvgTextSpan.cs rename to LaserGRBL.Lib/SvgLibrary/Text/SvgTextSpan.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/ISvgTransformable.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/ISvgTransformable.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/ISvgTransformable.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/ISvgTransformable.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgMatrix.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgMatrix.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgMatrix.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgMatrix.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgRotate.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgRotate.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgRotate.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgRotate.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgScale.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgScale.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgScale.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgScale.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgShear.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgShear.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgShear.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgShear.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgSkew.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgSkew.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgSkew.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgSkew.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgTransform.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgTransform.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgTransform.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgTransform.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgTransformCollection.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgTransformCollection.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgTransformCollection.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgTransformCollection.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgTransformConverter.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgTransformConverter.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgTransformConverter.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgTransformConverter.cs diff --git a/LaserGRBL/SvgLibrary/Transforms/SvgTranslate.cs b/LaserGRBL.Lib/SvgLibrary/Transforms/SvgTranslate.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Transforms/SvgTranslate.cs rename to LaserGRBL.Lib/SvgLibrary/Transforms/SvgTranslate.cs diff --git a/LaserGRBL/SvgLibrary/Web/SvgHandler.cs b/LaserGRBL.Lib/SvgLibrary/Web/SvgHandler.cs similarity index 100% rename from LaserGRBL/SvgLibrary/Web/SvgHandler.cs rename to LaserGRBL.Lib/SvgLibrary/Web/SvgHandler.cs diff --git a/LaserGRBL.sln b/LaserGRBL.sln index 35015fd6b..f8e47e6bc 100644 --- a/LaserGRBL.sln +++ b/LaserGRBL.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30406.217 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaserGRBL.UI", "LaserGRBL\LaserGRBL.UI.csproj", "{839698EC-FE05-4112-ACCB-A5D7556714F0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaserGRBL.Lib", "LaserGRBL.Lib\LaserGRBL.Lib.csproj", "{32D33447-815B-448A-968F-D8810D6440B1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {839698EC-FE05-4112-ACCB-A5D7556714F0}.Debug|Any CPU.Build.0 = Debug|Any CPU {839698EC-FE05-4112-ACCB-A5D7556714F0}.Release|Any CPU.ActiveCfg = Release|Any CPU {839698EC-FE05-4112-ACCB-A5D7556714F0}.Release|Any CPU.Build.0 = Release|Any CPU + {32D33447-815B-448A-968F-D8810D6440B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32D33447-815B-448A-968F-D8810D6440B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32D33447-815B-448A-968F-D8810D6440B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32D33447-815B-448A-968F-D8810D6440B1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/LaserGRBL/LaserGRBL.UI.csproj b/LaserGRBL/LaserGRBL.UI.csproj index 5d753058a..49403dc9e 100644 --- a/LaserGRBL/LaserGRBL.UI.csproj +++ b/LaserGRBL/LaserGRBL.UI.csproj @@ -174,238 +174,6 @@ SvgModeForm.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -517,17 +285,6 @@ ConnectLogForm.cs - - - - - - - - - - - Form @@ -1532,8 +1289,6 @@ MaterialDB.xsd - - @@ -1597,7 +1352,12 @@ - + + + + {32d33447-815b-448a-968f-d8810d6440b1} + LaserGRBL.Lib + + \ No newline at end of file diff --git a/LaserGRBL/LaserGRBL.UI.csproj b/LaserGRBL/LaserGRBL.UI.csproj index 89d773f5f..028c559f9 100644 --- a/LaserGRBL/LaserGRBL.UI.csproj +++ b/LaserGRBL/LaserGRBL.UI.csproj @@ -1,1261 +1,38 @@ - - - + + - Debug - AnyCPU - {839698EC-FE05-4112-ACCB-A5D7556714F0} WinExe - Properties - LaserGRBL + netcoreapp3.1 + true LaserGRBL - v3.5 - 512 - True - False - False - obj\$(Configuration)\ - OnBuildSuccess - False - C:\Users\Diego\AppData\Roaming\ICSharpCode\SharpDevelop5\Settings.SourceAnalysis - Grafica\LaserGrbl.ico - - false - - - - - 3.5 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - AnyCPU - true - Full - False - bin\Debug\ - TRACE;DEBUG;timedebug - prompt - 4 - Off - false - C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\Rule Sets\MinimumRecommendedRules.ruleset - true - - - AnyCPU - PdbOnly - True - bin\Release\ - TRACE - prompt - 4 - true - false - Off - - - False - obj\ - - - 4194304 - False - Auto - - - False - obj\ - Project - - - - - LaserGRBL.Program + LaserGRBL + - - - 3.5 - - - - - - - - - - - - - ..\packages\WebSocketSharp.1.0.3-rc11\lib\websocket-sharp.dll - - + + + + - - Form - - - AutotraceTest.cs - - - - - Form - - - ExceptionManager.cs - - - Form - - - FlashGrbl.cs - - - Form - - - LicenseForm.cs - - - - MaterialDB.xsd - - - True + + + + + + + True - MaterialDB.xsd - - - Form - - - PSEditorForm.cs - - - Form - - - PSHelperForm.cs - - - Form - - - SaveOptionForm.cs - - - - - Form - - - ConvertSizeAndOptionForm.cs - - - Form - - - SvgModeForm.cs - - - - - - Form - - - RunFromPositionForm.cs - - - Form - - - GrblConfig.cs - - - Form - - - EmulatorUI.cs - - - - - - - - - UserControl - - - ConnectLogForm.cs - - - - Form - - - CustomButtonForm.cs - - - - - Form - - - HotkeyManagerForm.cs - - - - Form - - - IssueDetectorForm.cs - - - UserControl - - - JogForm.cs - - - - Form - - - MainForm.cs - - - Form - - - NewVersionForm.cs - - - Component - - - UserControl - - - PreviewForm.cs - - - - - Form - - - ResumeJobForm.cs - - True - True - Strings.resx - - - Form - - - ConvertSizeAndOptionForm.cs - - - Form - - - RasterToLaserForm.cs - - - Form - - - ResolutionHelperForm.cs - - - Form - - - SettingsForm.cs - - - Form - - - SplashScreenForm.cs - - - - Form - - - - - - UserControl - - - ColorProgressBar.cs - - - - Component - - - ColorSlider.cs - - - Component - - - UserControl - - - CommandLog.cs - - - UserControl - - - DoubleProgressBar.cs - - - UserControl - - - GrblPanel.cs - - - Component - - - GrblTextBox.cs - - - UserControl - - - ImageButton.cs - - - - UserControl - - - Component - - - MyPictureBox.cs - - - UserControl - - - UserControl - - - DecimalInputBase.cs - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - LabelTB.cs - - - Component - - - UserControl - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - Always - - - Designer - - - - - AutotraceTest.cs - - - NewVersionForm.cs - - - NewVersionForm.cs - - - NewVersionForm.cs - - - NewVersionForm.cs - - - NewVersionForm.cs - - - NewVersionForm.cs - - - NewVersionForm.cs - - - NewVersionForm.cs - - - NewVersionForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - Designer - - - ConnectLogForm.cs - - - ConnectLogForm.cs - - - ConnectLogForm.cs - Designer - - - ConnectLogForm.cs - - - CustomButtonForm.cs - Designer - - - CustomButtonForm.cs - - - CustomButtonForm.cs - - - CustomButtonForm.cs - - - CustomButtonForm.cs - - - CustomButtonForm.cs - - - CustomButtonForm.cs - - - CustomButtonForm.cs - - - ExceptionManager.cs - - - ExceptionManager.cs - - - ExceptionManager.cs - - - FlashGrbl.cs - - - CustomButtonForm.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - GrblConfig.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - HotkeyManagerForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - IssueDetectorForm.cs - - - LicenseForm.cs - - - LicenseForm.cs - - - MainForm.cs - - - MainForm.cs - - - MainForm.cs - - - MainForm.cs - - - MainForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - - - PSEditorForm.cs - - - PSEditorForm.cs - - - PSEditorForm.cs - Designer - - - PSEditorForm.cs - - - PSHelperForm.cs - - - PSHelperForm.cs - - - PSHelperForm.cs - - - PSHelperForm.cs - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - ResumeJobForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - GrblConfig.cs - Designer - - - CustomButtonForm.cs - - - CustomButtonForm.cs - - - CustomButtonForm.cs - - - EmulatorUI.cs - - - HotkeyManagerForm.cs - - - IssueDetectorForm.cs - - - JogForm.cs - - - MainForm.cs - - - MainForm.cs - - - MainForm.cs - - - MainForm.cs - - - MainForm.cs - - - MainForm.cs - - - MainForm.cs - - - NewVersionForm.cs - - - MainForm.cs - - - MainForm.cs - Designer - - - PreviewForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - - - PreviewForm.cs - Designer - - - ResumeJobForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - RunFromPositionForm.cs - - - SaveOptionForm.cs - - - SaveOptionForm.cs - - - SaveOptionForm.cs - - - SaveOptionForm.cs - - - SaveOptionForm.cs - - - SaveOptionForm.cs - - - SettingsForm.cs - - - SettingsForm.cs - - - SettingsForm.cs - - - SettingsForm.cs - - - SettingsForm.cs - - - SettingsForm.cs - - - Strings.resx - - - Strings.resx - - - Strings.resx - - - ResXFileCodeGenerator - Strings.Designer.cs - - - Strings.resx - - - Strings.resx - - - Strings.resx - - - Strings.resx - - - Strings.resx - - - Strings.resx - - - Strings.resx - - - Strings.resx - - - Strings.resx - Designer - - - Strings.resx - Designer - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - Designer - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - - - RasterToLaserForm.cs - Designer - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - ResolutionHelperForm.cs - - - SettingsForm.cs - - - SettingsForm.cs - Designer - - - SettingsForm.cs - - - SettingsForm.cs - - - SettingsForm.cs - - - SettingsForm.cs - Designer - - - SettingsForm.cs - - - SettingsForm.cs - Designer - - - SplashScreenForm.cs - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - - - ConvertSizeAndOptionForm.cs - Designer - - - ConvertSizeAndOptionForm.cs - - - SvgModeForm.cs - - - ColorSlider.cs - - - CommandLog.cs - - - GrblPanel.cs - - - LabelTB.cs - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - MaterialDB.xsd - - - Designer + + + + + MSDataSetGenerator MaterialDB.Designer.cs - - MaterialDB.xsd - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - - - - - - {32d33447-815b-448a-968f-d8810d6440b1} - LaserGRBL.Lib - - - {5b2828b8-fc5f-4962-8508-382b914fe67c} - MSSVG - - - + \ No newline at end of file diff --git a/LaserGRBL/MainForm.cs b/LaserGRBL/MainForm.cs index 8cbb2c189..1cc62cb15 100644 --- a/LaserGRBL/MainForm.cs +++ b/LaserGRBL/MainForm.cs @@ -7,7 +7,6 @@ using System; using System.Drawing; using System.Windows.Forms; -using System.Windows.Threading; namespace LaserGRBL { @@ -633,7 +632,7 @@ private void activateExtendedLogToolStripMenuItem_Click(object sender, EventArgs } } - private DispatcherTimer dropDispatcherTimer; + private Timer dropDispatcherTimer; private string droppedFile; private void MainForm_DragEnter(object sender, DragEventArgs e) @@ -656,8 +655,8 @@ private void MainForm_DragDrop(object sender, DragEventArgs e) // call via DispatcherTimer to unblock the source of the drag-event (e.g. Explorer-Window) if (dropDispatcherTimer == null) { - this.dropDispatcherTimer = new DispatcherTimer(); - this.dropDispatcherTimer.Interval = TimeSpan.FromSeconds(0.5); + this.dropDispatcherTimer = new Timer(); + this.dropDispatcherTimer.Interval = 500; this.dropDispatcherTimer.Tick += new EventHandler(dropDispatcherTimer_Tick); } this.dropDispatcherTimer.Start(); diff --git a/LaserGRBL/PSHelper/MaterialDB.Designer.cs b/LaserGRBL/PSHelper/MaterialDB.Designer.cs index a4b2ef8cc..b5e94b7ab 100644 --- a/LaserGRBL/PSHelper/MaterialDB.Designer.cs +++ b/LaserGRBL/PSHelper/MaterialDB.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Il codice è stato generato da uno strumento. -// Versione runtime:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se -// il codice viene rigenerato. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -29,7 +29,7 @@ public partial class MaterialDB : global::System.Data.DataSet { private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public MaterialDB() { this.BeginInit(); this.InitClass(); @@ -40,7 +40,7 @@ public MaterialDB() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] protected MaterialDB(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context, false) { if ((this.IsBinarySerialized(info, context) == true)) { @@ -76,7 +76,7 @@ protected MaterialDB(global::System.Runtime.Serialization.SerializationInfo info } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public MaterialsDataTable Materials { @@ -86,7 +86,7 @@ public MaterialsDataTable Materials { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.BrowsableAttribute(true)] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { @@ -99,7 +99,7 @@ public MaterialsDataTable Materials { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] public new global::System.Data.DataTableCollection Tables { get { @@ -108,7 +108,7 @@ public MaterialsDataTable Materials { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] public new global::System.Data.DataRelationCollection Relations { get { @@ -117,7 +117,7 @@ public MaterialsDataTable Materials { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] protected override void InitializeDerivedDataSet() { this.BeginInit(); this.InitClass(); @@ -125,7 +125,7 @@ protected override void InitializeDerivedDataSet() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public override global::System.Data.DataSet Clone() { MaterialDB cln = ((MaterialDB)(base.Clone())); cln.InitVars(); @@ -134,19 +134,19 @@ protected override void InitializeDerivedDataSet() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] protected override bool ShouldSerializeTables() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] protected override bool ShouldSerializeRelations() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) { if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { this.Reset(); @@ -171,7 +171,7 @@ protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() { global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream(); this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null)); @@ -180,13 +180,13 @@ protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] internal void InitVars() { this.InitVars(true); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] internal void InitVars(bool initTable) { this.tableMaterials = ((MaterialsDataTable)(base.Tables["Materials"])); if ((initTable == true)) { @@ -197,7 +197,7 @@ internal void InitVars(bool initTable) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] private void InitClass() { this.DataSetName = "MaterialDB"; this.Prefix = ""; @@ -209,13 +209,13 @@ private void InitClass() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] private bool ShouldSerializeMaterials() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { this.InitVars(); @@ -223,7 +223,7 @@ private void SchemaChanged(object sender, global::System.ComponentModel.Collecti } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { MaterialDB ds = new MaterialDB(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); @@ -269,7 +269,7 @@ private void SchemaChanged(object sender, global::System.ComponentModel.Collecti return type; } - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public delegate void MaterialsRowChangeEventHandler(object sender, MaterialsRowChangeEvent e); /// @@ -300,7 +300,7 @@ public partial class MaterialsDataTable : global::System.Data.TypedTableBase ///Row event argument class /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public class MaterialsRowChangeEvent : global::System.EventArgs { private MaterialsRow eventRow; @@ -831,14 +831,14 @@ public class MaterialsRowChangeEvent : global::System.EventArgs { private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public MaterialsRowChangeEvent(MaterialsRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public MaterialsRow Row { get { return this.eventRow; @@ -846,7 +846,7 @@ public MaterialsRow Row { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; diff --git a/LaserGRBL/PSHelper/MaterialDB.cs b/LaserGRBL/PSHelper/MaterialDB.cs index cb971adfa..fc9aea897 100644 --- a/LaserGRBL/PSHelper/MaterialDB.cs +++ b/LaserGRBL/PSHelper/MaterialDB.cs @@ -5,171 +5,171 @@ namespace LaserGRBL.PSHelper { - partial class MaterialDB - { - partial class MaterialsDataTable - { - public override void EndInit() - { - base.EndInit(); - TableNewRow += MaterialsDataTable_TableNewRow; - } - - private void MaterialsDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e) - { - //throw new NotImplementedException(); - } - - protected override void OnTableNewRow(DataTableNewRowEventArgs e) - { - base.OnTableNewRow(e); - - MaterialsRow target = e.Row as MaterialsRow; - MaterialsRow last = GetLastNotDeleted(); - - if (target != null) - { - target.id = Guid.NewGuid(); - - if (last != null) - { - target.Model = last.Model; - target.Material = last.Material; - } - } - } - - private MaterialsRow GetLastNotDeleted() - { - for (int i = Rows.Count - 1; i >= 0; i--) - if (Rows[i].RowState != DataRowState.Deleted) - return Rows[i] as MaterialsRow; - - return null; - } - - protected override void OnColumnChanging(DataColumnChangeEventArgs e) - { - if (e.Column == PowerColumn && (int)e.ProposedValue < 5) - throw new Exception("Please enter a valid power level (Min 5%)"); - if (e.Column == PowerColumn && (int)e.ProposedValue > 100) - throw new Exception("Please enter a valid power level (Max 100%)"); - - if (e.Column == SpeedColumn && (int)e.ProposedValue < 1) - throw new Exception("Please enter a valid speed (Min 1 mm/min)"); - if (e.Column == SpeedColumn && (int)e.ProposedValue > 100000) - throw new Exception("Please enter a valid speed (Max 100000 mm/min)"); - - if (e.Column == CyclesColumn && (int)e.ProposedValue < 1) - throw new Exception("Please enter a valid cycles number (Min 1 cycles)"); - if (e.Column == CyclesColumn && (int)e.ProposedValue >= 100) - throw new Exception("Please enter a valid cycles number (Max 99 cycles)"); - - base.OnColumnChanging(e); - } - - private IEnumerable EnabledRows { get => this.Where(x => x.Visible); } - - - internal object[] Models() - { - return EnabledRows.Select(x => x.Model).Distinct().OrderBy(s => s).ToArray(); - } - - internal object[] Materials(string model) - { - return EnabledRows.Where(x => x.Model == model).Select(x => x.Material).Distinct().OrderBy(s => s).ToArray(); - } - - internal object[] Thickness(string model, string material, string action) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Action == action).Select(x => x.Thickness).Distinct().OrderBy(s => s).ToArray(); - } - - - internal object[] Actions(string model, string material) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material).Select(x => x.Action).Distinct().OrderBy(s => s).ToArray(); - } - - internal MaterialsRow GetResult(string model, string material, string action, string thickness) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Thickness == thickness && x.Action == action).First(); - } - } - - private MaterialsDataTable FromServer = new MaterialsDataTable(); - - public static MaterialDB Load() - { - MaterialDB rv = new MaterialDB(); - try - { - MaterialsDataTable user = new MaterialsDataTable() { Namespace = rv.Namespace }; - MaterialsDataTable server = new MaterialsDataTable() { Namespace = rv.Namespace }; - - if (System.IO.File.Exists(UserFile)) - user.ReadXml(UserFile); - - if (System.IO.File.Exists(ServerFile)) - server.ReadXml(ServerFile); - - foreach (var row in user) - rv.Materials.ImportRow(row); - - if (rv.Materials.Rows.Count == 0) - { - foreach (var row in server) - rv.Materials.ImportRow(row); - } - else - { - foreach (var row in server) - if (rv.Materials.FindByid(row.id) == null) - rv.FromServer.ImportRow(row); //nuove dal server - } - } - catch { } - - rv.Materials.AcceptChanges(); - return rv; - } - - internal void SaveChanges() - { - try - { - if (Materials.GetChanges() != null) - { - Materials.AcceptChanges(); - Materials.WriteXml(UserFile); - } - } - catch { } - } - - internal int GetNewCount() - { - int count = 0; - foreach (var row in FromServer) - if (Materials.FindByid(row.id) == null) - count++; - return count; - } - - internal void ImportServer() - { - try - { - foreach (var row in FromServer) - if (Materials.FindByid(row.id) == null) - Materials.ImportRow(row); //nuove dal server - } - catch { } - } - - - private static string UserFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.DataPath, "UserMaterials.psh"); } - private static string ServerFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.ExePath, "StandardMaterials.psh"); } - } + partial class MaterialDB + { + partial class MaterialsDataTable + { + public override void EndInit() + { + base.EndInit(); + TableNewRow += MaterialsDataTable_TableNewRow; + } + + private void MaterialsDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e) + { + //throw new NotImplementedException(); + } + + protected override void OnTableNewRow(DataTableNewRowEventArgs e) + { + base.OnTableNewRow(e); + + MaterialsRow target = e.Row as MaterialsRow; + MaterialsRow last = GetLastNotDeleted(); + + if (target != null) + { + target.id = Guid.NewGuid(); + + if (last != null) + { + target.Model = last.Model; + target.Material = last.Material; + } + } + } + + private MaterialsRow GetLastNotDeleted() + { + for (int i = Rows.Count - 1; i >= 0; i--) + if (Rows[i].RowState != DataRowState.Deleted) + return Rows[i] as MaterialsRow; + + return null; + } + + protected override void OnColumnChanging(DataColumnChangeEventArgs e) + { + if (e.Column == PowerColumn && (int)e.ProposedValue < 5) + throw new Exception("Please enter a valid power level (Min 5%)"); + if (e.Column == PowerColumn && (int)e.ProposedValue > 100) + throw new Exception("Please enter a valid power level (Max 100%)"); + + if (e.Column == SpeedColumn && (int)e.ProposedValue < 1) + throw new Exception("Please enter a valid speed (Min 1 mm/min)"); + if (e.Column == SpeedColumn && (int)e.ProposedValue > 100000) + throw new Exception("Please enter a valid speed (Max 100000 mm/min)"); + + if (e.Column == CyclesColumn && (int)e.ProposedValue < 1) + throw new Exception("Please enter a valid cycles number (Min 1 cycles)"); + if (e.Column == CyclesColumn && (int)e.ProposedValue >= 100) + throw new Exception("Please enter a valid cycles number (Max 99 cycles)"); + + base.OnColumnChanging(e); + } + + private IEnumerable EnabledRows { get => this.Where(x => x.Visible); } + + + internal object[] Models() + { + return EnabledRows.Select(x => x.Model).Distinct().OrderBy(s => s).ToArray(); + } + + internal object[] Materials(string model) + { + return EnabledRows.Where(x => x.Model == model).Select(x => x.Material).Distinct().OrderBy(s => s).ToArray(); + } + + internal object[] Thickness(string model, string material, string action) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Action == action).Select(x => x.Thickness).Distinct().OrderBy(s => s).ToArray(); + } + + + internal object[] Actions(string model, string material) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material).Select(x => x.Action).Distinct().OrderBy(s => s).ToArray(); + } + + internal MaterialsRow GetResult(string model, string material, string action, string thickness) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Thickness == thickness && x.Action == action).First(); + } + } + + private MaterialsDataTable FromServer = new MaterialsDataTable(); + + public static MaterialDB Load() + { + MaterialDB rv = new MaterialDB(); + try + { + MaterialsDataTable user = new MaterialsDataTable() { Namespace = rv.Namespace }; + MaterialsDataTable server = new MaterialsDataTable() { Namespace = rv.Namespace }; + + if (System.IO.File.Exists(UserFile)) + user.ReadXml(UserFile); + + if (System.IO.File.Exists(ServerFile)) + server.ReadXml(ServerFile); + + foreach (var row in user) + rv.Materials.ImportRow(row); + + if (rv.Materials.Rows.Count == 0) + { + foreach (var row in server) + rv.Materials.ImportRow(row); + } + else + { + foreach (var row in server) + if (rv.Materials.FindByid(row.id) == null) + rv.FromServer.ImportRow(row); //nuove dal server + } + } + catch { } + + rv.Materials.AcceptChanges(); + return rv; + } + + internal void SaveChanges() + { + try + { + if (Materials.GetChanges() != null) + { + Materials.AcceptChanges(); + Materials.WriteXml(UserFile); + } + } + catch { } + } + + internal int GetNewCount() + { + int count = 0; + foreach (var row in FromServer) + if (Materials.FindByid(row.id) == null) + count++; + return count; + } + + internal void ImportServer() + { + try + { + foreach (var row in FromServer) + if (Materials.FindByid(row.id) == null) + Materials.ImportRow(row); //nuove dal server + } + catch { } + } + + + private static string UserFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.DataPath, "UserMaterials.psh"); } + private static string ServerFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.ExePath, "StandardMaterials.psh"); } + } } diff --git a/LaserGRBL/SvgConverter/SvgModeForm.cs b/LaserGRBL/SvgConverter/SvgModeForm.cs index 6354f5ced..c2171509e 100644 --- a/LaserGRBL/SvgConverter/SvgModeForm.cs +++ b/LaserGRBL/SvgConverter/SvgModeForm.cs @@ -1,15 +1,9 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; namespace LaserGRBL.SvgConverter { - public partial class SvgModeForm : Form + public partial class SvgModeForm : Form { public Mode Result { get; private set; } = Mode.None; @@ -35,13 +29,13 @@ internal static Mode CreateAndShow(string filename) private void CreatePreview(string filename) { - - string fcontent = System.IO.File.ReadAllText(filename); - Svg.SvgDocument svg = Svg.SvgDocument.FromSvg(fcontent); - svg.Ppi = 600; - - PbImage.Image = svg.Draw(); - PbVector.Image = svg.Draw(true); + throw new NotImplementedException(); + //string fcontent = System.IO.File.ReadAllText(filename); + //Svg.SvgDocument svg = Svg.SvgDocument.FromSvg(fcontent); + //svg.Ppi = 600; + // + //PbImage.Image = svg.Draw(); + //PbVector.Image = svg.Draw(true); } private void PbVector_Click(object sender, EventArgs e) diff --git a/LaserGRBL/Tools/ThreadClass.cs b/LaserGRBL/Tools/ThreadClass.cs index 1d56e510e..64c0a54a1 100644 --- a/LaserGRBL/Tools/ThreadClass.cs +++ b/LaserGRBL/Tools/ThreadClass.cs @@ -131,7 +131,7 @@ public virtual void Stop() if (TH != null && TH.ThreadState != System.Threading.ThreadState.Stopped) { System.Diagnostics.Debug.WriteLine(string.Format("Devo forzare la terminazione del Thread '{0}'", TH.Name)); - TH.Abort(); + TH.Interrupt(); } } else diff --git a/LaserGRBL/UserControls/GrblPanel.cs b/LaserGRBL/UserControls/GrblPanel.cs index 5aefacace..b2aecfce1 100644 --- a/LaserGRBL/UserControls/GrblPanel.cs +++ b/LaserGRBL/UserControls/GrblPanel.cs @@ -157,7 +157,7 @@ private void AbortCreation() { if (TH != null) { - TH.Abort(); + TH.Interrupt(); TH = null; } } diff --git a/LaserGRBL/AssemblyInfo.cs b/LaserGRBL_/AssemblyInfo.cs similarity index 100% rename from LaserGRBL/AssemblyInfo.cs rename to LaserGRBL_/AssemblyInfo.cs From 56ac56b4ed67528b187fef0cd5750581bc7a0715 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:25:18 -0300 Subject: [PATCH 073/116] Old files --- LaserGRBL.Console/LaserGRBL.Console.csproj | 53 -------------------- LaserGRBL.Console/Program.cs | 19 ------- LaserGRBL.Console/Properties/AssemblyInfo.cs | 36 ------------- LaserGRBL_/AssemblyInfo.cs | 35 ------------- 4 files changed, 143 deletions(-) delete mode 100644 LaserGRBL.Console/LaserGRBL.Console.csproj delete mode 100644 LaserGRBL.Console/Program.cs delete mode 100644 LaserGRBL.Console/Properties/AssemblyInfo.cs delete mode 100644 LaserGRBL_/AssemblyInfo.cs diff --git a/LaserGRBL.Console/LaserGRBL.Console.csproj b/LaserGRBL.Console/LaserGRBL.Console.csproj deleted file mode 100644 index 19e6c8a30..000000000 --- a/LaserGRBL.Console/LaserGRBL.Console.csproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Debug - AnyCPU - {D1A14FB6-BD47-46D4-A516-27718B63D124} - Exe - LaserGRBL.Console - LaserGRBL.Console - v3.5 - 512 - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - {839698ec-fe05-4112-accb-a5d7556714f0} - LaserGRBL.UI - - - - \ No newline at end of file diff --git a/LaserGRBL.Console/Program.cs b/LaserGRBL.Console/Program.cs deleted file mode 100644 index eed664633..000000000 --- a/LaserGRBL.Console/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LaserGRBL -{ - class Program - { - static void Main(string[] args) - { - if (args.Length == 0) - { - Console.WriteLine(); - } - - } - } -} diff --git a/LaserGRBL.Console/Properties/AssemblyInfo.cs b/LaserGRBL.Console/Properties/AssemblyInfo.cs deleted file mode 100644 index 61cef8a29..000000000 --- a/LaserGRBL.Console/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LaserGRBL.Console")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("LaserGRBL.Console")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d1a14fb6-bd47-46d4-a516-27718b63d124")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LaserGRBL_/AssemblyInfo.cs b/LaserGRBL_/AssemblyInfo.cs deleted file mode 100644 index 73e1d0de0..000000000 --- a/LaserGRBL_/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Resources; - -// Le informazioni generali relative a un assembly sono controllate dal seguente -// set di attributi. Per modificare le informazioni associate a un assembly -// occorre quindi modificare i valori di questi attributi. -[assembly: AssemblyTitle ("Laser GRBL")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("Laser GRBL")] -[assembly: AssemblyCopyright ("Copyright © 2016 - Diego Settimi")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili -// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da -// COM, impostare su true l'attributo ComVisible per tale tipo. -[assembly: ComVisible (false)] -// Se il progetto viene esposto a COM, il GUID che segue verrà utilizzato per creare l'ID della libreria dei tipi -[assembly: Guid ("1f25f4e2-cd6f-43ba-b7e8-b4e9f0c885b5")] -// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: -// -// Numero di versione principale -// Numero di versione secondario -// Numero build -// Revisione -// -// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build -// utilizzando l'asterisco (*) come descritto di seguito: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion ("3.7.1")] -[assembly: NeutralResourcesLanguage("en")] From ebc3aad46a70b542264b4e2c7affbe4ff9174e05 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:27:24 -0300 Subject: [PATCH 074/116] Completed Console --- LaserGRBL.CmdLine/LaserGRBL.CmdLine.csproj | 64 ++++--------------- LaserGRBL.CmdLine_/CommandProcessor.cs | 47 ++++++++++++++ .../Commands/GCodeBitmapCommand.cs | 60 +++++++++++++++++ .../Commands/GCodeSvgCommand.cs | 46 +++++++++++++ LaserGRBL.CmdLine_/Commands/HelpCommand.cs | 48 ++++++++++++++ LaserGRBL.CmdLine_/Commands/UnknowCommand.cs | 16 +++++ LaserGRBL.CmdLine_/ICommand.cs | 10 +++ LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj | 60 +++++++++++++++++ LaserGRBL.CmdLine_/Program.cs | 25 ++++++++ .../Properties/AssemblyInfo.cs | 0 LaserGRBL.sln | 12 ++-- 11 files changed, 329 insertions(+), 59 deletions(-) create mode 100644 LaserGRBL.CmdLine_/CommandProcessor.cs create mode 100644 LaserGRBL.CmdLine_/Commands/GCodeBitmapCommand.cs create mode 100644 LaserGRBL.CmdLine_/Commands/GCodeSvgCommand.cs create mode 100644 LaserGRBL.CmdLine_/Commands/HelpCommand.cs create mode 100644 LaserGRBL.CmdLine_/Commands/UnknowCommand.cs create mode 100644 LaserGRBL.CmdLine_/ICommand.cs create mode 100644 LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj create mode 100644 LaserGRBL.CmdLine_/Program.cs rename {LaserGRBL.CmdLine => LaserGRBL.CmdLine_}/Properties/AssemblyInfo.cs (100%) diff --git a/LaserGRBL.CmdLine/LaserGRBL.CmdLine.csproj b/LaserGRBL.CmdLine/LaserGRBL.CmdLine.csproj index b9bdb6505..9a1b83143 100644 --- a/LaserGRBL.CmdLine/LaserGRBL.CmdLine.csproj +++ b/LaserGRBL.CmdLine/LaserGRBL.CmdLine.csproj @@ -1,60 +1,18 @@ - - - + + - Debug - AnyCPU - {6D4E9909-2352-41E4-A51E-098989C98CAB} Exe - LaserGRBL.CmdLine - LaserGRBL.CmdLine - v3.5 - 512 - true + netcoreapp3.1 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - + - - - - - - - - + + - - {32d33447-815b-448a-968f-d8810d6440b1} - LaserGRBL.Lib - + + + - - \ No newline at end of file + + diff --git a/LaserGRBL.CmdLine_/CommandProcessor.cs b/LaserGRBL.CmdLine_/CommandProcessor.cs new file mode 100644 index 000000000..6e9c7473c --- /dev/null +++ b/LaserGRBL.CmdLine_/CommandProcessor.cs @@ -0,0 +1,47 @@ +using LaserGRBL.CmdLine.Commands; +using System.Linq; + +namespace LaserGRBL.CmdLine +{ + public class CommandProcessor + { + UnknowCommand unknowCommand; + + ICommand[] commands; + public CommandProcessor() + { + unknowCommand = new UnknowCommand(); + commands = new ICommand[] + { + unknowCommand, + new HelpCommand(), + new GCodeBitmapCommand(), + new GCodeSvgCommand(), + }; + + foreach (var cmd in commands) cmd.Initialize(this); + } + + public ICommand[] GetCommands() + { + return commands.ToArray(); + } + + public void ProcessCommand(string command, string[] args) + { + var cmd = commands + .Where(c => c.AttendTo != null) + .FirstOrDefault(commands => commands + .AttendTo + .Contains(command)); + if (cmd == null) + { + unknowCommand.Process(command, args); + } + else + { + cmd.Process(command, args); + } + } + } +} \ No newline at end of file diff --git a/LaserGRBL.CmdLine_/Commands/GCodeBitmapCommand.cs b/LaserGRBL.CmdLine_/Commands/GCodeBitmapCommand.cs new file mode 100644 index 000000000..06e0a5a45 --- /dev/null +++ b/LaserGRBL.CmdLine_/Commands/GCodeBitmapCommand.cs @@ -0,0 +1,60 @@ +using LaserGRBL.RasterConverter; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; + +namespace LaserGRBL.CmdLine.Commands +{ + public class GCodeBitmapCommand : ICommand + { + public string[] AttendTo => new string[] {"-bmp2g"}; + + public string HelpText() + { + return "Convert SVG to GCode\nUsage: -bmp2g InputFile OutputFile"; + } + + public void Initialize(CommandProcessor processor) { } + + public bool Process(string command, string[] args) + { + if (args.Length < 2) + { + Console.WriteLine("Invalid arguments, see --help"); + return false; + } + + var fI = new FileInfo(args[1]); + var fO = new FileInfo(args[2]); + + if (!fI.Exists) + { + Console.WriteLine("Input file not found"); + return false; + } + + var file = new GrblFile(0, 0, 200, 300); + + ImageProcessor IP = new ImageProcessor(file, fI.FullName, Size.Empty, false); + IP.WhiteClip = 5; + IP.Brightness = 100; + IP.Contrast = 100; + IP.Quality = 3; + IP.FillingQuality = 3; + IP.BorderSpeed = 1000; + IP.LaserOff = "M5"; + IP.LaserOn = "M3"; + IP.MarkSpeed = 1000; + IP.MaxPower = 1000; + IP.GenerateGCodeSync(); + file.SaveProgram(fO.FullName, true, true, false, 1); + + Console.WriteLine("Conversion finished"); + + return true; + } + } +} diff --git a/LaserGRBL.CmdLine_/Commands/GCodeSvgCommand.cs b/LaserGRBL.CmdLine_/Commands/GCodeSvgCommand.cs new file mode 100644 index 000000000..6cbbc741e --- /dev/null +++ b/LaserGRBL.CmdLine_/Commands/GCodeSvgCommand.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace LaserGRBL.CmdLine.Commands +{ + public class GCodeSvgCommand : ICommand + { + public string[] AttendTo => new string[] {"-svg2g"}; + + public string HelpText() + { + return "Convert SVG to GCode\nUsage: -svg2g InputFile OutputFile"; + } + + public void Initialize(CommandProcessor processor) { } + + public bool Process(string command, string[] args) + { + if (args.Length < 2) + { + Console.WriteLine("Invalid arguments, see --help"); + return false; + } + + var fI = new FileInfo(args[1]); + var fO = new FileInfo(args[2]); + + if (!fI.Exists) + { + Console.WriteLine("Input file not found"); + return false; + } + + var file = new GrblFile(0, 0, 200, 300); + file.LoadImportedSVG(fI.FullName, false); + file.SaveProgram(fO.FullName, true, true, false, 1); + + Console.WriteLine("Conversion finished"); + + return true; + } + } +} diff --git a/LaserGRBL.CmdLine_/Commands/HelpCommand.cs b/LaserGRBL.CmdLine_/Commands/HelpCommand.cs new file mode 100644 index 000000000..8bb92a1dc --- /dev/null +++ b/LaserGRBL.CmdLine_/Commands/HelpCommand.cs @@ -0,0 +1,48 @@ +using System; +using System.Linq; + +namespace LaserGRBL.CmdLine.Commands +{ + public class HelpCommand : ICommand + { + private CommandProcessor processor; + + public string[] AttendTo => new string[] { "--help" }; + public void Initialize(CommandProcessor processor) + { + this.processor = processor; + } + public string HelpText() => null; + public bool Process(string command, string[] args) + { + Console.WriteLine(@" Usage: +> [Command] [Args] +List of Commands:"); + foreach (var cmd in processor.GetCommands()) + { + string cmdText = ""; + if (cmd.AttendTo != null && cmd.AttendTo.Length > 0) cmdText = cmd.AttendTo[0]; + + if (string.IsNullOrEmpty(cmdText)) continue; + + string alises = ""; + if (cmd.AttendTo != null) + { + alises = string.Join(", ", cmd.AttendTo.Skip(1).ToArray()); + } + + Console.WriteLine($"Command: {cmdText}"); + if(!string.IsNullOrEmpty(alises)) Console.WriteLine($" Alisases: {alises}"); + string help = cmd.HelpText(); + if (!string.IsNullOrEmpty(help)) + { + Console.Write($" Command Text: "); + Console.WriteLine(cmd.HelpText()); + } + Console.WriteLine(); + + } + return true; + } + } +} diff --git a/LaserGRBL.CmdLine_/Commands/UnknowCommand.cs b/LaserGRBL.CmdLine_/Commands/UnknowCommand.cs new file mode 100644 index 000000000..a76db8d84 --- /dev/null +++ b/LaserGRBL.CmdLine_/Commands/UnknowCommand.cs @@ -0,0 +1,16 @@ +using System; + +namespace LaserGRBL.CmdLine.Commands +{ + public class UnknowCommand : ICommand + { + public string[] AttendTo => new string[0]; + public void Initialize(CommandProcessor processor) { } + public string HelpText() => null; + public bool Process(string command, string[] args) + { + Console.WriteLine("Type --help for instructions"); + return true; + } + } +} diff --git a/LaserGRBL.CmdLine_/ICommand.cs b/LaserGRBL.CmdLine_/ICommand.cs new file mode 100644 index 000000000..11a6e644f --- /dev/null +++ b/LaserGRBL.CmdLine_/ICommand.cs @@ -0,0 +1,10 @@ +namespace LaserGRBL.CmdLine +{ + public interface ICommand + { + string[] AttendTo { get; } + void Initialize(CommandProcessor processor); + bool Process(string command, string[] args); + string HelpText(); + } +} \ No newline at end of file diff --git a/LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj b/LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj new file mode 100644 index 000000000..b9bdb6505 --- /dev/null +++ b/LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj @@ -0,0 +1,60 @@ + + + + + Debug + AnyCPU + {6D4E9909-2352-41E4-A51E-098989C98CAB} + Exe + LaserGRBL.CmdLine + LaserGRBL.CmdLine + v3.5 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + {32d33447-815b-448a-968f-d8810d6440b1} + LaserGRBL.Lib + + + + \ No newline at end of file diff --git a/LaserGRBL.CmdLine_/Program.cs b/LaserGRBL.CmdLine_/Program.cs new file mode 100644 index 000000000..0c19ef012 --- /dev/null +++ b/LaserGRBL.CmdLine_/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace LaserGRBL.CmdLine +{ + class Program + { + static void Main(string[] args) + { + Settings.Initialize(null); + + var processor = new CommandProcessor(); + if (args.Length == 0) + { + processor.ProcessCommand("", args); + } + else + { + processor.ProcessCommand(args[0], args); + } + } + } +} diff --git a/LaserGRBL.CmdLine/Properties/AssemblyInfo.cs b/LaserGRBL.CmdLine_/Properties/AssemblyInfo.cs similarity index 100% rename from LaserGRBL.CmdLine/Properties/AssemblyInfo.cs rename to LaserGRBL.CmdLine_/Properties/AssemblyInfo.cs diff --git a/LaserGRBL.sln b/LaserGRBL.sln index 2ee66070c..3b3f0722c 100644 --- a/LaserGRBL.sln +++ b/LaserGRBL.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.30406.217 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaserGRBL.UI", "LaserGRBL\LaserGRBL.UI.csproj", "{839698EC-FE05-4112-ACCB-A5D7556714F0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaserGRBL.CmdLine", "LaserGRBL.CmdLine\LaserGRBL.CmdLine.csproj", "{6D4E9909-2352-41E4-A51E-098989C98CAB}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CsPotrace", "CsPotrace\CsPotrace.csproj", "{359E9637-A541-45D0-B3C7-75B9580C622E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cyotek.Drawing", "Cyotek.Drawing\Cyotek.Drawing.csproj", "{89EE1C7F-13B9-4FA2-B5BA-6BAAF4362DC1}" @@ -15,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSSVG", "MSSVG\MSSVG.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaserGRBL.Lib", "LaserGRBL.Lib\LaserGRBL.Lib.csproj", "{9A56FB43-C965-4995-88B4-3EF404146525}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaserGRBL.CmdLine", "LaserGRBL.CmdLine\LaserGRBL.CmdLine.csproj", "{20F4A673-CF14-4DE1-8191-F7CA27EAD19A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -25,10 +25,6 @@ Global {839698EC-FE05-4112-ACCB-A5D7556714F0}.Debug|Any CPU.Build.0 = Debug|Any CPU {839698EC-FE05-4112-ACCB-A5D7556714F0}.Release|Any CPU.ActiveCfg = Release|Any CPU {839698EC-FE05-4112-ACCB-A5D7556714F0}.Release|Any CPU.Build.0 = Release|Any CPU - {6D4E9909-2352-41E4-A51E-098989C98CAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D4E9909-2352-41E4-A51E-098989C98CAB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D4E9909-2352-41E4-A51E-098989C98CAB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D4E9909-2352-41E4-A51E-098989C98CAB}.Release|Any CPU.Build.0 = Release|Any CPU {359E9637-A541-45D0-B3C7-75B9580C622E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {359E9637-A541-45D0-B3C7-75B9580C622E}.Debug|Any CPU.Build.0 = Debug|Any CPU {359E9637-A541-45D0-B3C7-75B9580C622E}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -45,6 +41,10 @@ Global {9A56FB43-C965-4995-88B4-3EF404146525}.Debug|Any CPU.Build.0 = Debug|Any CPU {9A56FB43-C965-4995-88B4-3EF404146525}.Release|Any CPU.ActiveCfg = Release|Any CPU {9A56FB43-C965-4995-88B4-3EF404146525}.Release|Any CPU.Build.0 = Release|Any CPU + {20F4A673-CF14-4DE1-8191-F7CA27EAD19A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20F4A673-CF14-4DE1-8191-F7CA27EAD19A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20F4A673-CF14-4DE1-8191-F7CA27EAD19A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20F4A673-CF14-4DE1-8191-F7CA27EAD19A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From db86387e3bb15117a267288f3f85c4edcc238054 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:32:03 -0300 Subject: [PATCH 075/116] Old files --- LaserGRBL.CmdLine_/CommandProcessor.cs | 47 --------------- .../Commands/GCodeBitmapCommand.cs | 60 ------------------- .../Commands/GCodeSvgCommand.cs | 46 -------------- LaserGRBL.CmdLine_/Commands/HelpCommand.cs | 48 --------------- LaserGRBL.CmdLine_/Commands/UnknowCommand.cs | 16 ----- LaserGRBL.CmdLine_/ICommand.cs | 10 ---- LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj | 60 ------------------- LaserGRBL.CmdLine_/Program.cs | 25 -------- LaserGRBL.CmdLine_/Properties/AssemblyInfo.cs | 36 ----------- LaserGRBL.Lib/Tools/OSVersionInfo.cs | 5 +- LaserGRBL/Autotrace/AutotraceTest.cs | 6 +- 11 files changed, 3 insertions(+), 356 deletions(-) delete mode 100644 LaserGRBL.CmdLine_/CommandProcessor.cs delete mode 100644 LaserGRBL.CmdLine_/Commands/GCodeBitmapCommand.cs delete mode 100644 LaserGRBL.CmdLine_/Commands/GCodeSvgCommand.cs delete mode 100644 LaserGRBL.CmdLine_/Commands/HelpCommand.cs delete mode 100644 LaserGRBL.CmdLine_/Commands/UnknowCommand.cs delete mode 100644 LaserGRBL.CmdLine_/ICommand.cs delete mode 100644 LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj delete mode 100644 LaserGRBL.CmdLine_/Program.cs delete mode 100644 LaserGRBL.CmdLine_/Properties/AssemblyInfo.cs diff --git a/LaserGRBL.CmdLine_/CommandProcessor.cs b/LaserGRBL.CmdLine_/CommandProcessor.cs deleted file mode 100644 index 6e9c7473c..000000000 --- a/LaserGRBL.CmdLine_/CommandProcessor.cs +++ /dev/null @@ -1,47 +0,0 @@ -using LaserGRBL.CmdLine.Commands; -using System.Linq; - -namespace LaserGRBL.CmdLine -{ - public class CommandProcessor - { - UnknowCommand unknowCommand; - - ICommand[] commands; - public CommandProcessor() - { - unknowCommand = new UnknowCommand(); - commands = new ICommand[] - { - unknowCommand, - new HelpCommand(), - new GCodeBitmapCommand(), - new GCodeSvgCommand(), - }; - - foreach (var cmd in commands) cmd.Initialize(this); - } - - public ICommand[] GetCommands() - { - return commands.ToArray(); - } - - public void ProcessCommand(string command, string[] args) - { - var cmd = commands - .Where(c => c.AttendTo != null) - .FirstOrDefault(commands => commands - .AttendTo - .Contains(command)); - if (cmd == null) - { - unknowCommand.Process(command, args); - } - else - { - cmd.Process(command, args); - } - } - } -} \ No newline at end of file diff --git a/LaserGRBL.CmdLine_/Commands/GCodeBitmapCommand.cs b/LaserGRBL.CmdLine_/Commands/GCodeBitmapCommand.cs deleted file mode 100644 index 06e0a5a45..000000000 --- a/LaserGRBL.CmdLine_/Commands/GCodeBitmapCommand.cs +++ /dev/null @@ -1,60 +0,0 @@ -using LaserGRBL.RasterConverter; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; - -namespace LaserGRBL.CmdLine.Commands -{ - public class GCodeBitmapCommand : ICommand - { - public string[] AttendTo => new string[] {"-bmp2g"}; - - public string HelpText() - { - return "Convert SVG to GCode\nUsage: -bmp2g InputFile OutputFile"; - } - - public void Initialize(CommandProcessor processor) { } - - public bool Process(string command, string[] args) - { - if (args.Length < 2) - { - Console.WriteLine("Invalid arguments, see --help"); - return false; - } - - var fI = new FileInfo(args[1]); - var fO = new FileInfo(args[2]); - - if (!fI.Exists) - { - Console.WriteLine("Input file not found"); - return false; - } - - var file = new GrblFile(0, 0, 200, 300); - - ImageProcessor IP = new ImageProcessor(file, fI.FullName, Size.Empty, false); - IP.WhiteClip = 5; - IP.Brightness = 100; - IP.Contrast = 100; - IP.Quality = 3; - IP.FillingQuality = 3; - IP.BorderSpeed = 1000; - IP.LaserOff = "M5"; - IP.LaserOn = "M3"; - IP.MarkSpeed = 1000; - IP.MaxPower = 1000; - IP.GenerateGCodeSync(); - file.SaveProgram(fO.FullName, true, true, false, 1); - - Console.WriteLine("Conversion finished"); - - return true; - } - } -} diff --git a/LaserGRBL.CmdLine_/Commands/GCodeSvgCommand.cs b/LaserGRBL.CmdLine_/Commands/GCodeSvgCommand.cs deleted file mode 100644 index 6cbbc741e..000000000 --- a/LaserGRBL.CmdLine_/Commands/GCodeSvgCommand.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace LaserGRBL.CmdLine.Commands -{ - public class GCodeSvgCommand : ICommand - { - public string[] AttendTo => new string[] {"-svg2g"}; - - public string HelpText() - { - return "Convert SVG to GCode\nUsage: -svg2g InputFile OutputFile"; - } - - public void Initialize(CommandProcessor processor) { } - - public bool Process(string command, string[] args) - { - if (args.Length < 2) - { - Console.WriteLine("Invalid arguments, see --help"); - return false; - } - - var fI = new FileInfo(args[1]); - var fO = new FileInfo(args[2]); - - if (!fI.Exists) - { - Console.WriteLine("Input file not found"); - return false; - } - - var file = new GrblFile(0, 0, 200, 300); - file.LoadImportedSVG(fI.FullName, false); - file.SaveProgram(fO.FullName, true, true, false, 1); - - Console.WriteLine("Conversion finished"); - - return true; - } - } -} diff --git a/LaserGRBL.CmdLine_/Commands/HelpCommand.cs b/LaserGRBL.CmdLine_/Commands/HelpCommand.cs deleted file mode 100644 index 8bb92a1dc..000000000 --- a/LaserGRBL.CmdLine_/Commands/HelpCommand.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Linq; - -namespace LaserGRBL.CmdLine.Commands -{ - public class HelpCommand : ICommand - { - private CommandProcessor processor; - - public string[] AttendTo => new string[] { "--help" }; - public void Initialize(CommandProcessor processor) - { - this.processor = processor; - } - public string HelpText() => null; - public bool Process(string command, string[] args) - { - Console.WriteLine(@" Usage: -> [Command] [Args] -List of Commands:"); - foreach (var cmd in processor.GetCommands()) - { - string cmdText = ""; - if (cmd.AttendTo != null && cmd.AttendTo.Length > 0) cmdText = cmd.AttendTo[0]; - - if (string.IsNullOrEmpty(cmdText)) continue; - - string alises = ""; - if (cmd.AttendTo != null) - { - alises = string.Join(", ", cmd.AttendTo.Skip(1).ToArray()); - } - - Console.WriteLine($"Command: {cmdText}"); - if(!string.IsNullOrEmpty(alises)) Console.WriteLine($" Alisases: {alises}"); - string help = cmd.HelpText(); - if (!string.IsNullOrEmpty(help)) - { - Console.Write($" Command Text: "); - Console.WriteLine(cmd.HelpText()); - } - Console.WriteLine(); - - } - return true; - } - } -} diff --git a/LaserGRBL.CmdLine_/Commands/UnknowCommand.cs b/LaserGRBL.CmdLine_/Commands/UnknowCommand.cs deleted file mode 100644 index a76db8d84..000000000 --- a/LaserGRBL.CmdLine_/Commands/UnknowCommand.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace LaserGRBL.CmdLine.Commands -{ - public class UnknowCommand : ICommand - { - public string[] AttendTo => new string[0]; - public void Initialize(CommandProcessor processor) { } - public string HelpText() => null; - public bool Process(string command, string[] args) - { - Console.WriteLine("Type --help for instructions"); - return true; - } - } -} diff --git a/LaserGRBL.CmdLine_/ICommand.cs b/LaserGRBL.CmdLine_/ICommand.cs deleted file mode 100644 index 11a6e644f..000000000 --- a/LaserGRBL.CmdLine_/ICommand.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LaserGRBL.CmdLine -{ - public interface ICommand - { - string[] AttendTo { get; } - void Initialize(CommandProcessor processor); - bool Process(string command, string[] args); - string HelpText(); - } -} \ No newline at end of file diff --git a/LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj b/LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj deleted file mode 100644 index b9bdb6505..000000000 --- a/LaserGRBL.CmdLine_/LaserGRBL.CmdLine.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Debug - AnyCPU - {6D4E9909-2352-41E4-A51E-098989C98CAB} - Exe - LaserGRBL.CmdLine - LaserGRBL.CmdLine - v3.5 - 512 - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - {32d33447-815b-448a-968f-d8810d6440b1} - LaserGRBL.Lib - - - - \ No newline at end of file diff --git a/LaserGRBL.CmdLine_/Program.cs b/LaserGRBL.CmdLine_/Program.cs deleted file mode 100644 index 0c19ef012..000000000 --- a/LaserGRBL.CmdLine_/Program.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LaserGRBL.CmdLine -{ - class Program - { - static void Main(string[] args) - { - Settings.Initialize(null); - - var processor = new CommandProcessor(); - if (args.Length == 0) - { - processor.ProcessCommand("", args); - } - else - { - processor.ProcessCommand(args[0], args); - } - } - } -} diff --git a/LaserGRBL.CmdLine_/Properties/AssemblyInfo.cs b/LaserGRBL.CmdLine_/Properties/AssemblyInfo.cs deleted file mode 100644 index fe28a0d21..000000000 --- a/LaserGRBL.CmdLine_/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LaserGRBL.CmdLine")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("LaserGRBL.CmdLine")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6d4e9909-2352-41e4-a51e-098989c98cab")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LaserGRBL.Lib/Tools/OSVersionInfo.cs b/LaserGRBL.Lib/Tools/OSVersionInfo.cs index e154ca9e3..d887e7242 100644 --- a/LaserGRBL.Lib/Tools/OSVersionInfo.cs +++ b/LaserGRBL.Lib/Tools/OSVersionInfo.cs @@ -1,12 +1,11 @@ -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Runtime.InteropServices; namespace Tools { - internal static class OSVersionInfo + internal static class OSVersionInfo { #region ENUMS public enum SoftwareArchitecture diff --git a/LaserGRBL/Autotrace/AutotraceTest.cs b/LaserGRBL/Autotrace/AutotraceTest.cs index d980a1046..79003cfe6 100644 --- a/LaserGRBL/Autotrace/AutotraceTest.cs +++ b/LaserGRBL/Autotrace/AutotraceTest.cs @@ -5,18 +5,14 @@ // You should have received a copy of the GPLv3 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. using System; using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; using System.Diagnostics; namespace LaserGRBL { - public partial class AutotraceTest : Form + public partial class AutotraceTest : Form { public AutotraceTest() { From 2f47e87f82c6673c341829bc53d5acdc9ea34da0 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:36:42 -0300 Subject: [PATCH 076/116] Revert file --- LaserGRBL/PSHelper/MaterialDB.cs | 334 +++++++++++++++---------------- 1 file changed, 167 insertions(+), 167 deletions(-) diff --git a/LaserGRBL/PSHelper/MaterialDB.cs b/LaserGRBL/PSHelper/MaterialDB.cs index fc9aea897..cb971adfa 100644 --- a/LaserGRBL/PSHelper/MaterialDB.cs +++ b/LaserGRBL/PSHelper/MaterialDB.cs @@ -5,171 +5,171 @@ namespace LaserGRBL.PSHelper { - partial class MaterialDB - { - partial class MaterialsDataTable - { - public override void EndInit() - { - base.EndInit(); - TableNewRow += MaterialsDataTable_TableNewRow; - } - - private void MaterialsDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e) - { - //throw new NotImplementedException(); - } - - protected override void OnTableNewRow(DataTableNewRowEventArgs e) - { - base.OnTableNewRow(e); - - MaterialsRow target = e.Row as MaterialsRow; - MaterialsRow last = GetLastNotDeleted(); - - if (target != null) - { - target.id = Guid.NewGuid(); - - if (last != null) - { - target.Model = last.Model; - target.Material = last.Material; - } - } - } - - private MaterialsRow GetLastNotDeleted() - { - for (int i = Rows.Count - 1; i >= 0; i--) - if (Rows[i].RowState != DataRowState.Deleted) - return Rows[i] as MaterialsRow; - - return null; - } - - protected override void OnColumnChanging(DataColumnChangeEventArgs e) - { - if (e.Column == PowerColumn && (int)e.ProposedValue < 5) - throw new Exception("Please enter a valid power level (Min 5%)"); - if (e.Column == PowerColumn && (int)e.ProposedValue > 100) - throw new Exception("Please enter a valid power level (Max 100%)"); - - if (e.Column == SpeedColumn && (int)e.ProposedValue < 1) - throw new Exception("Please enter a valid speed (Min 1 mm/min)"); - if (e.Column == SpeedColumn && (int)e.ProposedValue > 100000) - throw new Exception("Please enter a valid speed (Max 100000 mm/min)"); - - if (e.Column == CyclesColumn && (int)e.ProposedValue < 1) - throw new Exception("Please enter a valid cycles number (Min 1 cycles)"); - if (e.Column == CyclesColumn && (int)e.ProposedValue >= 100) - throw new Exception("Please enter a valid cycles number (Max 99 cycles)"); - - base.OnColumnChanging(e); - } - - private IEnumerable EnabledRows { get => this.Where(x => x.Visible); } - - - internal object[] Models() - { - return EnabledRows.Select(x => x.Model).Distinct().OrderBy(s => s).ToArray(); - } - - internal object[] Materials(string model) - { - return EnabledRows.Where(x => x.Model == model).Select(x => x.Material).Distinct().OrderBy(s => s).ToArray(); - } - - internal object[] Thickness(string model, string material, string action) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Action == action).Select(x => x.Thickness).Distinct().OrderBy(s => s).ToArray(); - } - - - internal object[] Actions(string model, string material) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material).Select(x => x.Action).Distinct().OrderBy(s => s).ToArray(); - } - - internal MaterialsRow GetResult(string model, string material, string action, string thickness) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Thickness == thickness && x.Action == action).First(); - } - } - - private MaterialsDataTable FromServer = new MaterialsDataTable(); - - public static MaterialDB Load() - { - MaterialDB rv = new MaterialDB(); - try - { - MaterialsDataTable user = new MaterialsDataTable() { Namespace = rv.Namespace }; - MaterialsDataTable server = new MaterialsDataTable() { Namespace = rv.Namespace }; - - if (System.IO.File.Exists(UserFile)) - user.ReadXml(UserFile); - - if (System.IO.File.Exists(ServerFile)) - server.ReadXml(ServerFile); - - foreach (var row in user) - rv.Materials.ImportRow(row); - - if (rv.Materials.Rows.Count == 0) - { - foreach (var row in server) - rv.Materials.ImportRow(row); - } - else - { - foreach (var row in server) - if (rv.Materials.FindByid(row.id) == null) - rv.FromServer.ImportRow(row); //nuove dal server - } - } - catch { } - - rv.Materials.AcceptChanges(); - return rv; - } - - internal void SaveChanges() - { - try - { - if (Materials.GetChanges() != null) - { - Materials.AcceptChanges(); - Materials.WriteXml(UserFile); - } - } - catch { } - } - - internal int GetNewCount() - { - int count = 0; - foreach (var row in FromServer) - if (Materials.FindByid(row.id) == null) - count++; - return count; - } - - internal void ImportServer() - { - try - { - foreach (var row in FromServer) - if (Materials.FindByid(row.id) == null) - Materials.ImportRow(row); //nuove dal server - } - catch { } - } - - - private static string UserFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.DataPath, "UserMaterials.psh"); } - private static string ServerFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.ExePath, "StandardMaterials.psh"); } - } + partial class MaterialDB + { + partial class MaterialsDataTable + { + public override void EndInit() + { + base.EndInit(); + TableNewRow += MaterialsDataTable_TableNewRow; + } + + private void MaterialsDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e) + { + //throw new NotImplementedException(); + } + + protected override void OnTableNewRow(DataTableNewRowEventArgs e) + { + base.OnTableNewRow(e); + + MaterialsRow target = e.Row as MaterialsRow; + MaterialsRow last = GetLastNotDeleted(); + + if (target != null) + { + target.id = Guid.NewGuid(); + + if (last != null) + { + target.Model = last.Model; + target.Material = last.Material; + } + } + } + + private MaterialsRow GetLastNotDeleted() + { + for (int i = Rows.Count - 1; i >= 0; i--) + if (Rows[i].RowState != DataRowState.Deleted) + return Rows[i] as MaterialsRow; + + return null; + } + + protected override void OnColumnChanging(DataColumnChangeEventArgs e) + { + if (e.Column == PowerColumn && (int)e.ProposedValue < 5) + throw new Exception("Please enter a valid power level (Min 5%)"); + if (e.Column == PowerColumn && (int)e.ProposedValue > 100) + throw new Exception("Please enter a valid power level (Max 100%)"); + + if (e.Column == SpeedColumn && (int)e.ProposedValue < 1) + throw new Exception("Please enter a valid speed (Min 1 mm/min)"); + if (e.Column == SpeedColumn && (int)e.ProposedValue > 100000) + throw new Exception("Please enter a valid speed (Max 100000 mm/min)"); + + if (e.Column == CyclesColumn && (int)e.ProposedValue < 1) + throw new Exception("Please enter a valid cycles number (Min 1 cycles)"); + if (e.Column == CyclesColumn && (int)e.ProposedValue >= 100) + throw new Exception("Please enter a valid cycles number (Max 99 cycles)"); + + base.OnColumnChanging(e); + } + + private IEnumerable EnabledRows { get => this.Where(x => x.Visible); } + + + internal object[] Models() + { + return EnabledRows.Select(x => x.Model).Distinct().OrderBy(s => s).ToArray(); + } + + internal object[] Materials(string model) + { + return EnabledRows.Where(x => x.Model == model).Select(x => x.Material).Distinct().OrderBy(s => s).ToArray(); + } + + internal object[] Thickness(string model, string material, string action) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Action == action).Select(x => x.Thickness).Distinct().OrderBy(s => s).ToArray(); + } + + + internal object[] Actions(string model, string material) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material).Select(x => x.Action).Distinct().OrderBy(s => s).ToArray(); + } + + internal MaterialsRow GetResult(string model, string material, string action, string thickness) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Thickness == thickness && x.Action == action).First(); + } + } + + private MaterialsDataTable FromServer = new MaterialsDataTable(); + + public static MaterialDB Load() + { + MaterialDB rv = new MaterialDB(); + try + { + MaterialsDataTable user = new MaterialsDataTable() { Namespace = rv.Namespace }; + MaterialsDataTable server = new MaterialsDataTable() { Namespace = rv.Namespace }; + + if (System.IO.File.Exists(UserFile)) + user.ReadXml(UserFile); + + if (System.IO.File.Exists(ServerFile)) + server.ReadXml(ServerFile); + + foreach (var row in user) + rv.Materials.ImportRow(row); + + if (rv.Materials.Rows.Count == 0) + { + foreach (var row in server) + rv.Materials.ImportRow(row); + } + else + { + foreach (var row in server) + if (rv.Materials.FindByid(row.id) == null) + rv.FromServer.ImportRow(row); //nuove dal server + } + } + catch { } + + rv.Materials.AcceptChanges(); + return rv; + } + + internal void SaveChanges() + { + try + { + if (Materials.GetChanges() != null) + { + Materials.AcceptChanges(); + Materials.WriteXml(UserFile); + } + } + catch { } + } + + internal int GetNewCount() + { + int count = 0; + foreach (var row in FromServer) + if (Materials.FindByid(row.id) == null) + count++; + return count; + } + + internal void ImportServer() + { + try + { + foreach (var row in FromServer) + if (Materials.FindByid(row.id) == null) + Materials.ImportRow(row); //nuove dal server + } + catch { } + } + + + private static string UserFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.DataPath, "UserMaterials.psh"); } + private static string ServerFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.ExePath, "StandardMaterials.psh"); } + } } From 524333d2236a6a9d16cfebe01137386903106d2f Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:38:41 -0300 Subject: [PATCH 077/116] Create dotnet-core.yml --- .github/workflows/dotnet-core.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/dotnet-core.yml diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml new file mode 100644 index 000000000..347cb805b --- /dev/null +++ b/.github/workflows/dotnet-core.yml @@ -0,0 +1,25 @@ +name: .NET Core + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.301 + - name: Install dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --no-restore --verbosity normal From 292bf3b9088e7902ab0ffae4a6150d55c4672bc5 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:40:10 -0300 Subject: [PATCH 078/116] Create dotnet-core-desktop.yml --- .github/workflows/dotnet-core-desktop.yml | 115 ++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/dotnet-core-desktop.yml diff --git a/.github/workflows/dotnet-core-desktop.yml b/.github/workflows/dotnet-core-desktop.yml new file mode 100644 index 000000000..fcd104256 --- /dev/null +++ b/.github/workflows/dotnet-core-desktop.yml @@ -0,0 +1,115 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow will build, test, sign and package a WPF or Windows Forms desktop application +# built on .NET Core. +# To learn how to migrate your existing application to .NET Core, +# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework +# +# To configure this workflow: +# +# 1. Configure environment variables +# GitHub sets default environment variables for every workflow run. +# Replace the variables relative to your project in the "env" section below. +# +# 2. Signing +# Generate a signing certificate in the Windows Application +# Packaging Project or add an existing signing certificate to the project. +# Next, use PowerShell to encode the .pfx file using Base64 encoding +# by running the following Powershell script to generate the output string: +# +# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte +# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' +# +# Open the output file, SigningCertificate_Encoded.txt, and copy the +# string inside. Then, add the string to the repo as a GitHub secret +# and name it "Base64_Encoded_Pfx." +# For more information on how to configure your signing certificate for +# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing +# +# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". +# See "Build the Windows Application Packaging project" below to see how the secret is used. +# +# For more information on GitHub Actions, refer to https://github.com/features/actions +# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, +# refer to https://github.com/microsoft/github-actions-for-desktop-apps + +name: .NET Core Desktop + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + strategy: + matrix: + configuration: [Debug, Release] + + runs-on: windows-latest # For a list of available runner types, refer to + # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on + + env: + Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln. + Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. + Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. + Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # Install the .NET Core workload + - name: Install .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.101 + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@2008f912f56e61277eefaac6d1888b750582aa16 + + # Execute all unit tests in the solution + - name: Execute unit tests + run: dotnet test + + # Restore the application to populate the obj folder with RuntimeIdentifiers + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration + env: + Configuration: ${{ matrix.configuration }} + + # Decode the base 64 encoded pfx and save the Signing_Certificate + - name: Decode the pfx + run: | + $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") + $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx + [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) + + # Create the app package by building and packaging the Windows Application Packaging project + - name: Create the app package + run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} + env: + Appx_Bundle: Always + Appx_Bundle_Platforms: x86|x64 + Appx_Package_Build_Mode: StoreUpload + Configuration: ${{ matrix.configuration }} + + # Remove the pfx + - name: Remove the pfx + run: Remove-Item -path $env:Wap_Project_Directory\$env:Signing_Certificate + + # Upload the MSIX package: https://github.com/marketplace/actions/upload-artifact + - name: Upload build artifacts + uses: actions/upload-artifact@v2 + with: + name: MSIX Package + path: ${{ env.Wap_Project_Directory }}\AppPackages From c2ce5d2716ea6d38a35fcb093774ea08ebed4727 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:41:08 -0300 Subject: [PATCH 079/116] Wrong action --- .github/workflows/dotnet-core.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/dotnet-core.yml diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml deleted file mode 100644 index 347cb805b..000000000 --- a/.github/workflows/dotnet-core.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: .NET Core - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.301 - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - name: Test - run: dotnet test --no-restore --verbosity normal From fd3eeb0c91b68fb25c0a11647601d1b76077e8a4 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:44:31 -0300 Subject: [PATCH 080/116] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e367dafc8..9cd687370 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +! This is the DotNet Core Fork + # LaserGRBL [![Donation](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/pools/c/8cQ1Lo4sRA) Official website [http://lasergrbl.com](http://lasergrbl.com) From f318fe04d6cefd8a8b279bfd2f2adb7ecdd3e169 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 22 Aug 2020 19:50:46 -0300 Subject: [PATCH 081/116] Release Only, do not upload --- .github/workflows/dotnet-core-desktop.yml | 45 +++-------------------- README.md | 2 +- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/.github/workflows/dotnet-core-desktop.yml b/.github/workflows/dotnet-core-desktop.yml index fcd104256..f57c63ffb 100644 --- a/.github/workflows/dotnet-core-desktop.yml +++ b/.github/workflows/dotnet-core-desktop.yml @@ -50,16 +50,14 @@ jobs: strategy: matrix: - configuration: [Debug, Release] + configuration: [Release] runs-on: windows-latest # For a list of available runner types, refer to # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on env: - Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. - Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. - Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. + Solution_Name: LaserGRBL.sln # Replace with your solution name, i.e. MyWpfApp.sln. + #Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. steps: - name: Checkout @@ -78,38 +76,5 @@ jobs: uses: microsoft/setup-msbuild@2008f912f56e61277eefaac6d1888b750582aa16 # Execute all unit tests in the solution - - name: Execute unit tests - run: dotnet test - - # Restore the application to populate the obj folder with RuntimeIdentifiers - - name: Restore the application - run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration - env: - Configuration: ${{ matrix.configuration }} - - # Decode the base 64 encoded pfx and save the Signing_Certificate - - name: Decode the pfx - run: | - $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") - $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx - [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) - - # Create the app package by building and packaging the Windows Application Packaging project - - name: Create the app package - run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} - env: - Appx_Bundle: Always - Appx_Bundle_Platforms: x86|x64 - Appx_Package_Build_Mode: StoreUpload - Configuration: ${{ matrix.configuration }} - - # Remove the pfx - - name: Remove the pfx - run: Remove-Item -path $env:Wap_Project_Directory\$env:Signing_Certificate - - # Upload the MSIX package: https://github.com/marketplace/actions/upload-artifact - - name: Upload build artifacts - uses: actions/upload-artifact@v2 - with: - name: MSIX Package - path: ${{ env.Wap_Project_Directory }}\AppPackages + #- name: Execute unit tests + # run: dotnet test diff --git a/README.md b/README.md index 9cd687370..e540bb98b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -! This is the DotNet Core Fork +! This is the DotNet Core Fork ![.NET Core Desktop](https://github.com/RafaelEstevamReis/LaserGRBL/workflows/.NET%20Core%20Desktop/badge.svg) # LaserGRBL [![Donation](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/pools/c/8cQ1Lo4sRA) Official website [http://lasergrbl.com](http://lasergrbl.com) From a7401ed83ad082070e06c0db5c469520a72ccc64 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 17:29:55 -0300 Subject: [PATCH 082/116] Separate CsPotrace classes to different files --- CsPotrace/CsPotrace.cs | 125 +++-------------------------------------- CsPotrace/Curve.cs | 70 +++++++++++++++++++++++ CsPotrace/Enums.cs | 19 +++++++ CsPotrace/dPoint.cs | 42 ++++++++++++++ 4 files changed, 138 insertions(+), 118 deletions(-) create mode 100644 CsPotrace/Curve.cs create mode 100644 CsPotrace/Enums.cs create mode 100644 CsPotrace/dPoint.cs diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index dce6ee863..314f6b2ae 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -12,112 +12,7 @@ // You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. namespace CsPotrace -#region auxiliary classes -{ /// - /// Kind of Curve : Line or Bezier - /// - public enum CurveKind - { - Line, - Bezier - } - /// - /// Holds the coordinates of a Point - /// - public class dPoint - { - /// - /// x-coordinate - /// - public double X; - /// - /// y-coordinate - /// - public double Y; - /// - /// Creates a point - /// - /// x-coordinate - /// y-coordinate - public dPoint(double x, double y) - { - this.X = x; - this.Y = y; - } - public dPoint copy() - { - return new dPoint(X, Y); - } - public dPoint() - { } - } - /// - /// Holds the information about der produced curves - /// - /// - public struct Curve - { - /// - /// Bezier or Line - /// - public CurveKind Kind; - /// - /// Startpoint - /// - public dPoint A; - /// - /// ControlPoint - /// - public dPoint ControlPointA; - /// - /// ControlPoint - /// - public dPoint ControlPointB; - /// - /// Endpoint - /// - public dPoint B; - /// - /// Creates a curve - /// - /// - /// Startpoint - /// Controlpoint - /// Controlpoint - /// Endpoint - public Curve(CurveKind Kind, dPoint A, dPoint ControlPointA, dPoint ControlPointB, dPoint B) - { - - this.Kind = Kind; - this.A = A; - this.B = B; - this.ControlPointA = ControlPointA; - this.ControlPointB = ControlPointB; - - } - - public double LinearLenght - { - get - { - double dX = B.X - A.X; - double dY = B.Y - A.Y; - return Math.Sqrt(dX * dX + dY * dY); - } - } - } - public enum TurnPolicy - { - minority, - majority, - right, - black, - white - - - - } - #endregion +{ public partial class Potrace { #region Potrace classes and contants @@ -180,8 +75,11 @@ public int size } public bool at(int x, int y) { - return ((x >= 0) && (x < this.w) && (y >= 0) && (y < this.h) && - (this.data[this.w * y + x] == 1)); + return (x >= 0) + && (x < this.w) + && (y >= 0) + && (y < this.h) + && (this.data[this.w * y + x] == 1); } public byte[] data = null; public Point index(int i) @@ -460,9 +358,6 @@ static double tangent(dPoint p0, dPoint p1, dPoint p2, dPoint p3, dPoint q0, dPo } - - - /* determine the center and slope of the line i..j. Assume i pathlist = new List(); - - - - - static void tracetoList(List> ListOfPathes) { if (ListOfPathes == null) return; @@ -1853,5 +1743,4 @@ public static string getSVG() } #endregion } - } diff --git a/CsPotrace/Curve.cs b/CsPotrace/Curve.cs new file mode 100644 index 000000000..067762666 --- /dev/null +++ b/CsPotrace/Curve.cs @@ -0,0 +1,70 @@ +using System; + + +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +namespace CsPotrace +#region auxiliary classes +{ + /// + /// Holds the information about der produced curves + /// + /// + public struct Curve + { + /// + /// Bezier or Line + /// + public CurveKind Kind; + /// + /// Startpoint + /// + public dPoint A; + /// + /// ControlPoint + /// + public dPoint ControlPointA; + /// + /// ControlPoint + /// + public dPoint ControlPointB; + /// + /// Endpoint + /// + public dPoint B; + /// + /// Creates a curve + /// + /// + /// Startpoint + /// Controlpoint + /// Controlpoint + /// Endpoint + public Curve(CurveKind Kind, dPoint A, dPoint ControlPointA, dPoint ControlPointB, dPoint B) + { + + this.Kind = Kind; + this.A = A; + this.B = B; + this.ControlPointA = ControlPointA; + this.ControlPointB = ControlPointB; + + } + + public double LinearLenght + { + get + { + double dX = B.X - A.X; + double dY = B.Y - A.Y; + return Math.Sqrt(dX * dX + dY * dY); + } + } + } + +} \ No newline at end of file diff --git a/CsPotrace/Enums.cs b/CsPotrace/Enums.cs new file mode 100644 index 000000000..94bba91ca --- /dev/null +++ b/CsPotrace/Enums.cs @@ -0,0 +1,19 @@ +namespace CsPotrace +{ + /// + /// Kind of Curve : Line or Bezier + /// + public enum CurveKind + { + Line, + Bezier + } + public enum TurnPolicy + { + minority, + majority, + right, + black, + white + } +} diff --git a/CsPotrace/dPoint.cs b/CsPotrace/dPoint.cs new file mode 100644 index 000000000..dd45240c6 --- /dev/null +++ b/CsPotrace/dPoint.cs @@ -0,0 +1,42 @@ +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +namespace CsPotrace +#region auxiliary classes +{ + /// + /// Holds the coordinates of a Point + /// + public class dPoint + { + /// + /// x-coordinate + /// + public double X; + /// + /// y-coordinate + /// + public double Y; + /// + /// Creates a point + /// + /// x-coordinate + /// y-coordinate + public dPoint(double x, double y) + { + this.X = x; + this.Y = y; + } + public dPoint copy() + { + return new dPoint(X, Y); + } + public dPoint() + { } + } + +} \ No newline at end of file From 29df56448a48899c3ff28d98d19031b026a1c1cc Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 17:40:18 -0300 Subject: [PATCH 083/116] Create CsPotrace Unittest project --- CsPotrace.UnitTest/CsPotrace.UnitTest.csproj | 20 ++++++++++++++++++++ LaserGRBL.sln | 8 +++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 CsPotrace.UnitTest/CsPotrace.UnitTest.csproj diff --git a/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj b/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj new file mode 100644 index 000000000..2544780ee --- /dev/null +++ b/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp3.1 + + false + + + + + + + + + + + + + + diff --git a/LaserGRBL.sln b/LaserGRBL.sln index 3b3f0722c..6a2536c9f 100644 --- a/LaserGRBL.sln +++ b/LaserGRBL.sln @@ -13,7 +13,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSSVG", "MSSVG\MSSVG.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaserGRBL.Lib", "LaserGRBL.Lib\LaserGRBL.Lib.csproj", "{9A56FB43-C965-4995-88B4-3EF404146525}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaserGRBL.CmdLine", "LaserGRBL.CmdLine\LaserGRBL.CmdLine.csproj", "{20F4A673-CF14-4DE1-8191-F7CA27EAD19A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaserGRBL.CmdLine", "LaserGRBL.CmdLine\LaserGRBL.CmdLine.csproj", "{20F4A673-CF14-4DE1-8191-F7CA27EAD19A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsPotrace.UnitTest", "CsPotrace.UnitTest\CsPotrace.UnitTest.csproj", "{6112FB06-EA24-4B16-BBD5-99B24DA51E4D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -45,6 +47,10 @@ Global {20F4A673-CF14-4DE1-8191-F7CA27EAD19A}.Debug|Any CPU.Build.0 = Debug|Any CPU {20F4A673-CF14-4DE1-8191-F7CA27EAD19A}.Release|Any CPU.ActiveCfg = Release|Any CPU {20F4A673-CF14-4DE1-8191-F7CA27EAD19A}.Release|Any CPU.Build.0 = Release|Any CPU + {6112FB06-EA24-4B16-BBD5-99B24DA51E4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6112FB06-EA24-4B16-BBD5-99B24DA51E4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6112FB06-EA24-4B16-BBD5-99B24DA51E4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6112FB06-EA24-4B16-BBD5-99B24DA51E4D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 3a73642aeb515051c1f85188a5d81a99b96f5d73 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 17:41:32 -0300 Subject: [PATCH 084/116] Fix region --- CsPotrace/Curve.cs | 1 - CsPotrace/dPoint.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/CsPotrace/Curve.cs b/CsPotrace/Curve.cs index 067762666..eebd57d86 100644 --- a/CsPotrace/Curve.cs +++ b/CsPotrace/Curve.cs @@ -9,7 +9,6 @@ // You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. namespace CsPotrace -#region auxiliary classes { /// /// Holds the information about der produced curves diff --git a/CsPotrace/dPoint.cs b/CsPotrace/dPoint.cs index dd45240c6..66c08746d 100644 --- a/CsPotrace/dPoint.cs +++ b/CsPotrace/dPoint.cs @@ -6,7 +6,6 @@ // You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. namespace CsPotrace -#region auxiliary classes { /// /// Holds the coordinates of a Point From d6d07344ba36f1ceba476890d183d8c5d52dad04 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 17:41:59 -0300 Subject: [PATCH 085/116] Remov Tuple.cs --- CsPotrace/BezierToBiarc/Tuple.cs | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 CsPotrace/BezierToBiarc/Tuple.cs diff --git a/CsPotrace/BezierToBiarc/Tuple.cs b/CsPotrace/BezierToBiarc/Tuple.cs deleted file mode 100644 index 4ed9b7fa1..000000000 --- a/CsPotrace/BezierToBiarc/Tuple.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Created by SharpDevelop. - * User: Diego - * Date: 11/01/2017 - * Time: 00:02 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -namespace CsPotrace.BezierToBiarc -{ - /// - /// Description of Tuple. - /// - public class Tuple - { - public T1 Item1 { get; } - public T2 Item2 { get; } - - public Tuple(T1 item1, T2 item2) { - Item1 = item1; - Item2 = item2; - } - - } -} \ No newline at end of file From ce82c81fcae94dcdbe5287f3994c7c72cbc94f99 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 19:22:54 -0300 Subject: [PATCH 086/116] Remove Point Struct --- CsPotrace/CsPotrace.cs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index 314f6b2ae..acfa7c257 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -22,7 +22,7 @@ public partial class Potrace //----------------------Potrace Constants and aux functions const int POTRACE_CORNER = 1; const int POTRACE_CURVETO = 2; - static double COS179 = Math.Cos(179 * Math.PI / 180); + //static double COS179 = Math.Cos(179 * Math.PI / 180); /// /// area of largest path to be ignored @@ -46,17 +46,17 @@ public partial class Potrace public static double Treshold = 0.5; - /// - struct Point - { - public Point(int x, int y) - { - this.x = x; - this.y = y; - } - public int x; - public int y; - } + // /// + //struct Point + //{ + // public Point(int x, int y) + // { + // this.x = x; + // this.y = y; + // } + // public int x; + // public int y; + //} //Holds the binaray bitmap class Bitmap_p @@ -975,8 +975,7 @@ close to linear since the inner loop tends to be short. */ if it lies outside. Return 1 with errno set on error; 0 on success. */ - /* calculate "optimal" point-slope representation for each line - segment */ + /* calculate "optimal" point-slope representation for each line segment */ @@ -1631,7 +1630,6 @@ static void tracetoList(List> ListOfPathes) public static void Clear() { - Potrace.bm = null; Potrace.pathlist.Clear(); @@ -1662,6 +1660,7 @@ public static List> PotraceTrace(Bitmap Bitmap) } #endregion #region create svg + /* static string toString(double value) { return string.Format(System.Globalization.CultureInfo.GetCultureInfo("en-US"), "{0:0.000}", value); @@ -1741,6 +1740,7 @@ public static string getSVG() // svg +="Z \"/>"; return svg; } + */ #endregion } } From 8f18a65894d7313b4d7de50f3b44aece534ba6dc Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 19:29:56 -0300 Subject: [PATCH 087/116] Separate Bitmap_p --- CsPotrace/Bitmap_p.cs | 56 ++++++++++++++++ CsPotrace/CsPotrace.cs | 142 +++++++++++++---------------------------- 2 files changed, 101 insertions(+), 97 deletions(-) create mode 100644 CsPotrace/Bitmap_p.cs diff --git a/CsPotrace/Bitmap_p.cs b/CsPotrace/Bitmap_p.cs new file mode 100644 index 000000000..47db245de --- /dev/null +++ b/CsPotrace/Bitmap_p.cs @@ -0,0 +1,56 @@ +using System.Drawing; + +namespace CsPotrace +{ + //Holds the binaray bitmap + public class Bitmap_p + { + public Bitmap_p(int w, int h) + { + this.w = w; + this.h = h; + data = new byte[size]; + } + public int w = 0; + public int h = 0; + public int size + { + get { return w * h; } + } + public bool at(int x, int y) + { + return (x >= 0) + && (x < this.w) + && (y >= 0) + && (y < this.h) + && (this.data[this.w * y + x] == 1); + } + public byte[] data = null; + public Point index(int i) + { + int y = i / w; + return new Point(i - y * w, y); + } + public void flip(int x, int y) + { + if (this.at(x, y)) + { + this.data[this.w * y + x] = 0; + } + else + { + this.data[this.w * y + x] = 1; + } + } + public Bitmap_p copy() + { + Bitmap_p Result = new Bitmap_p(w, h); + for (int i = 0; i < size; i++) + { + Result.data[i] = data[i]; + + } + return Result; + } + } +} diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index acfa7c257..d539dfe72 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -51,65 +51,13 @@ public partial class Potrace //{ // public Point(int x, int y) // { - // this.x = x; - // this.y = y; + // this.X = x; + // this.Y = y; // } // public int x; // public int y; //} - //Holds the binaray bitmap - class Bitmap_p - { - public Bitmap_p(int w, int h) - { - this.w = w; - this.h = h; - data = new byte[size]; - } - public int w = 0; - public int h = 0; - public int size - { - get { return w * h; } - } - public bool at(int x, int y) - { - return (x >= 0) - && (x < this.w) - && (y >= 0) - && (y < this.h) - && (this.data[this.w * y + x] == 1); - } - public byte[] data = null; - public Point index(int i) - { - int y = i / w; - return new Point(i - y * w, y); - } - public void flip(int x, int y) - { - if (this.at(x, y)) - { - this.data[this.w * y + x] = 0; - } - else - { - this.data[this.w * y + x] = 1; - } - } - public Bitmap_p copy() - { - Bitmap_p Result = new Bitmap_p(w, h); - for (int i = 0; i < size; i++) - { - Result.data[i] = data[i]; - - } - return Result; - } - - } class Path { public int m = 0; @@ -263,7 +211,7 @@ static double xprod(dPoint p1, dPoint p2) /* calculate p1 x p2 */ static int xprodi(Point p1, Point p2) { - return p1.x * p2.y - p1.y * p2.x; + return p1.X * p2.Y - p1.Y * p2.X; } /* return 1 if a <= b < c < a, in a cyclic sense (mod n) */ static bool cyclic(double a, double b, double c) @@ -499,7 +447,7 @@ static void ConvertBitmap(Bitmap bitmap) /// y index in the source Matrix static bool findNext(Bitmap_p bm1, Point point, ref Point result) { - int i = bm1.w * point.y + point.x; + int i = bm1.w * point.Y + point.X; while ((i < bm1.size) && (bm1.data[i] != 1)) { i++; @@ -522,13 +470,13 @@ static bool findNext(Bitmap_p bm1, Point point, ref Point result) static Path findPath(Bitmap_p bm1, Point point) { Path path = new Path(); - int x = point.x; - int y = point.y; + int x = point.X; + int y = point.Y; int dirx = 0; int diry = 1; int tmp = -1; - path.sign = bm.at(point.x, point.y) ? "+" : "-"; + path.sign = bm.at(point.X, point.Y) ? "+" : "-"; while (true) { @@ -547,7 +495,7 @@ static Path findPath(Bitmap_p bm1, Point point) y += diry; path.area -= x * diry; - if (x == point.x && y == point.y) + if (x == point.X && y == point.Y) break; bool l = bm1.at(x + (dirx + diry - 1) / 2, y + (diry - dirx - 1) / 2); @@ -622,13 +570,13 @@ static Path bmToPathlist() } static void xorPath(Bitmap_p bm1, Path path) { - int y1 = path.pt[0].y, + int y1 = path.pt[0].Y, len = path.len, x, y, maxX, minY, i, j; for (i = 1; i < len; i++) { - x = path.pt[i].x; - y = path.pt[i].y; + x = path.pt[i].X; + y = path.pt[i].Y; if (y != y1) { @@ -654,16 +602,16 @@ static void calcSums(Path path) { double x, y; // origin - path.x0 = path.pt[0].x; - path.y0 = path.pt[0].y; + path.x0 = path.pt[0].X; + path.y0 = path.pt[0].Y; List s = path.sums; s.Add(new Sum(0, 0, 0, 0, 0)); for (int i = 0; i < path.len; i++) { - x = path.pt[i].x - path.x0; - y = path.pt[i].y - path.y0; + x = path.pt[i].X - path.x0; + y = path.pt[i].Y - path.y0; s.Add(new Sum(s[i].x + x, s[i].y + y, s[i].xy + x * y, s[i].x2 + x * x, s[i].y2 + y * y)); } @@ -711,10 +659,10 @@ static double penalty3(Path path, int i, int j) k = j + 1 - i + n; } - px = (pt[i].x + pt[j].x) / 2.0 - pt[0].x; - py = (pt[i].y + pt[j].y) / 2.0 - pt[0].y; - ey = (pt[j].x - pt[i].x); - ex = -(pt[j].y - pt[i].y); + px = (pt[i].X + pt[j].X) / 2.0 - pt[0].X; + py = (pt[i].Y + pt[j].Y) / 2.0 - pt[0].Y; + ey = (pt[j].X - pt[i].X); + ex = -(pt[j].Y - pt[i].Y); a = ((x2 - 2 * x * px) / k + px * px); b = ((xy - x * py - y * px) / k + px * py); @@ -760,7 +708,7 @@ always a direction change at 0 (due to the path decomposition for (int i = n - 1; i >= 0; i--) { - if (pt[i].x != pt[k].x && pt[i].y != pt[k].y) + if (pt[i].X != pt[k].X && pt[i].Y != pt[k].Y) { k = i + 1; } @@ -770,22 +718,22 @@ always a direction change at 0 (due to the path decomposition for (int i = n - 1; i >= 0; i--) { ct[0] = ct[1] = ct[2] = ct[3] = 0; - dir = (3 + 3 * (pt[mod(i + 1, n)].x - pt[i].x) + - (pt[mod(i + 1, n)].y - pt[i].y)) / 2; + dir = (3 + 3 * (pt[mod(i + 1, n)].X - pt[i].X) + + (pt[mod(i + 1, n)].Y - pt[i].Y)) / 2; ct[dir]++; - constraint[0].x = 0; - constraint[0].y = 0; - constraint[1].x = 0; - constraint[1].y = 0; + constraint[0].X = 0; + constraint[0].Y = 0; + constraint[1].X = 0; + constraint[1].Y = 0; k = nc[i]; k1 = i; while (true) { foundk = 0; - dir = (3 + 3 * sign(pt[k].x - pt[k1].x) + - sign(pt[k].y - pt[k1].y)) / 2; + dir = (3 + 3 * sign(pt[k].X - pt[k1].X) + + sign(pt[k].Y - pt[k1].Y)) / 2; ct[dir]++; if ((ct[0] == 1) && (ct[1] == 1) && (ct[2] == 1) && (ct[3] == 1)) @@ -795,33 +743,33 @@ always a direction change at 0 (due to the path decomposition break; } - cur.x = pt[k].x - pt[i].x; - cur.y = pt[k].y - pt[i].y; + cur.X = pt[k].X - pt[i].X; + cur.Y = pt[k].Y - pt[i].Y; if (xprodi(constraint[0], cur) < 0 || xprodi(constraint[1], cur) > 0) { break; } - if (Math.Abs(cur.x) <= 1 && Math.Abs(cur.y) <= 1) + if (Math.Abs(cur.X) <= 1 && Math.Abs(cur.Y) <= 1) { } else { - off.x = cur.x + ((cur.y >= 0 && (cur.y > 0 || cur.x < 0)) ? 1 : -1); - off.y = cur.y + ((cur.x <= 0 && (cur.x < 0 || cur.y < 0)) ? 1 : -1); + off.X = cur.X + ((cur.Y >= 0 && (cur.Y > 0 || cur.X < 0)) ? 1 : -1); + off.Y = cur.Y + ((cur.X <= 0 && (cur.X < 0 || cur.Y < 0)) ? 1 : -1); if (xprodi(constraint[0], off) >= 0) { - constraint[0].x = off.x; - constraint[0].y = off.y; + constraint[0].X = off.X; + constraint[0].Y = off.Y; } - off.x = cur.x + ((cur.y <= 0 && (cur.y < 0 || cur.x < 0)) ? 1 : -1); - off.y = cur.y + ((cur.x >= 0 && (cur.x > 0 || cur.y < 0)) ? 1 : -1); + off.X = cur.X + ((cur.Y <= 0 && (cur.Y < 0 || cur.X < 0)) ? 1 : -1); + off.Y = cur.Y + ((cur.X >= 0 && (cur.X > 0 || cur.Y < 0)) ? 1 : -1); if (xprodi(constraint[1], off) <= 0) { - constraint[1].x = off.x; - constraint[1].y = off.y; + constraint[1].X = off.X; + constraint[1].Y = off.Y; } } k1 = k; @@ -833,10 +781,10 @@ always a direction change at 0 (due to the path decomposition } if (foundk == 0) { - dk.x = sign(pt[k].x - pt[k1].x); - dk.y = sign(pt[k].y - pt[k1].y); - cur.x = pt[k1].x - pt[i].x; - cur.y = pt[k1].y - pt[i].y; + dk.X = sign(pt[k].X - pt[k1].X); + dk.Y = sign(pt[k].Y - pt[k1].Y); + cur.X = pt[k1].X - pt[i].X; + cur.Y = pt[k1].Y - pt[i].Y; a = xprodi(constraint[0], cur); b = xprodi(constraint[0], dk); @@ -1054,8 +1002,8 @@ the two lines. */ Quad Q = new Quad(); dPoint w = new dPoint(); /* let s be the vertex, in coordinates relative to x0/y0 */ - s.X = pt[po[i]].x - x0; - s.Y = pt[po[i]].y - y0; + s.X = pt[po[i]].X - x0; + s.Y = pt[po[i]].Y - y0; /* intersect segments i-1 and i */ j = mod(i - 1, m); /* add quadratic forms */ From 51d572c0c14de2014ed441e6e58e8a21ebdecb0c Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 19:32:24 -0300 Subject: [PATCH 088/116] Moved Path, Sum and privcurve --- CsPotrace/CsPotrace.cs | 76 +----------------------------------- CsPotrace/CsPotraceExport.cs | 1 - CsPotrace/Path.cs | 26 ++++++++++++ CsPotrace/Sum.cs | 16 ++++++++ CsPotrace/privcurve.cs | 33 ++++++++++++++++ 5 files changed, 76 insertions(+), 76 deletions(-) create mode 100644 CsPotrace/Path.cs create mode 100644 CsPotrace/Sum.cs create mode 100644 CsPotrace/privcurve.cs diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index d539dfe72..601dd4f8f 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -45,67 +45,6 @@ public partial class Potrace public static double Treshold = 0.5; - - // /// - //struct Point - //{ - // public Point(int x, int y) - // { - // this.X = x; - // this.Y = y; - // } - // public int x; - // public int y; - //} - - class Path - { - public int m = 0; - public int area = 0; - public int len = 0; - public string sign = "?"; - // curve - public List pt = new List(); - public int minX = 100000; - public int minY = 100000; - public int maxX = -1; - public int maxY = -1; - public double x0; - public double y0; - public int[] po; - public int[] lon = null; - public List sums = new List(); - public privcurve curve = null; - - } - - class privcurve - { - - public int n; /* number of segments */ - public int[] tag; /* tag[n]: POTRACE_CORNER or POTRACE_CURVETO */ - // public dPoint[,] ControlPoints; /* c[n][i]: control points. - // c[n][0] is unused for tag[n]=POTRACE_CORNER */ - public dPoint[] vertex; /* for POTRACE_CORNER, this equals c[1] */ - /* (*c)[3]; /* c[n][i]: control points. - c[n][0] is unused for tag[n]=POTRACE_CORNER */ - public dPoint[] c = null; // HelpPoint - public double[] alpha; /* only for POTRACE_CURVETO */ - public double[] alpha0; /* "uncropped" alpha parameter - for debug output only */ - public double[] beta; - public int alphacurve = 0; - public privcurve(int Count) - { - n = Count; - tag = new int[n]; - // ControlPoints = new dPoint[n, 3]; - vertex = new dPoint[n]; - alpha = new double[n]; - alpha0 = new double[n]; - beta = new double[n]; - c = new dPoint[n * 3]; - } - } #endregion #region auxiliary functions /* range over the straight line segment [a,b] when lambda ranges over [0,1] */ @@ -189,20 +128,7 @@ static double ddist(dPoint p, dPoint q) { return Math.Sqrt((p.X - q.X) * (p.X - q.X) + (p.Y - q.Y) * (p.Y - q.Y)); } - struct Sum - { - public Sum(double x, double y, double xy, double x2, double y2) - { - this.x = x; - this.y = y; - this.xy = xy; - this.x2 = x2; - this.y2 = y2; - } - public double x, y, xy, x2, y2; - - } - + /* calculate p1 x p2 */ static double xprod(dPoint p1, dPoint p2) { diff --git a/CsPotrace/CsPotraceExport.cs b/CsPotrace/CsPotraceExport.cs index 2c9906a07..1c9c37532 100644 --- a/CsPotrace/CsPotraceExport.cs +++ b/CsPotrace/CsPotraceExport.cs @@ -14,7 +14,6 @@ namespace CsPotrace { public partial class Potrace { - /// /// Exports a figure, created by Potrace from a Bitmap to a svg-formatted string ///It should be SVG-formattted diff --git a/CsPotrace/Path.cs b/CsPotrace/Path.cs new file mode 100644 index 000000000..993c377ab --- /dev/null +++ b/CsPotrace/Path.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Drawing; + +namespace CsPotrace +{ + public class Path + { + public int m = 0; + public int area = 0; + public int len = 0; + public string sign = "?"; + // curve + public List pt = new List(); + public int minX = 100000; + public int minY = 100000; + public int maxX = -1; + public int maxY = -1; + public double x0; + public double y0; + public int[] po; + public int[] lon = null; + public List sums = new List(); + public privcurve curve = null; + + } +} diff --git a/CsPotrace/Sum.cs b/CsPotrace/Sum.cs new file mode 100644 index 000000000..e8203b9cb --- /dev/null +++ b/CsPotrace/Sum.cs @@ -0,0 +1,16 @@ +namespace CsPotrace +{ + public struct Sum + { + public Sum(double x, double y, double xy, double x2, double y2) + { + this.x = x; + this.y = y; + this.xy = xy; + this.x2 = x2; + this.y2 = y2; + } + public double x, y, xy, x2, y2; + + } +} diff --git a/CsPotrace/privcurve.cs b/CsPotrace/privcurve.cs new file mode 100644 index 000000000..abee601c3 --- /dev/null +++ b/CsPotrace/privcurve.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CsPotrace +{ + public class privcurve + { + public int n; /* number of segments */ + public int[] tag; /* tag[n]: POTRACE_CORNER or POTRACE_CURVETO */ + // public dPoint[,] ControlPoints; /* c[n][i]: control points. + // c[n][0] is unused for tag[n]=POTRACE_CORNER */ + public dPoint[] vertex; /* for POTRACE_CORNER, this equals c[1] */ + /* (*c)[3]; /* c[n][i]: control points. + c[n][0] is unused for tag[n]=POTRACE_CORNER */ + public dPoint[] c = null; // HelpPoint + public double[] alpha; /* only for POTRACE_CURVETO */ + public double[] alpha0; /* "uncropped" alpha parameter - for debug output only */ + public double[] beta; + public int alphacurve = 0; + public privcurve(int Count) + { + n = Count; + tag = new int[n]; + // ControlPoints = new dPoint[n, 3]; + vertex = new dPoint[n]; + alpha = new double[n]; + alpha0 = new double[n]; + beta = new double[n]; + c = new dPoint[n * 3]; + } + } +} From e6038f449eeda94494306cf88d7e6740b6de3a5f Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 19:34:55 -0300 Subject: [PATCH 089/116] Moved Quad --- CsPotrace/CsPotrace.cs | 17 +---------------- CsPotrace/Quad.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 CsPotrace/Quad.cs diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index 601dd4f8f..b8fb62106 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -231,7 +231,6 @@ static double tangent(dPoint p0, dPoint p1, dPoint p2, dPoint p3, dPoint q0, dPo } } - /* determine the center and slope of the line i..j. Assume i= 0 ? a / n : -1 - (-1 - a) / n; } - #endregion #region Static function of Potrace /// @@ -1429,19 +1427,7 @@ curve cyclically ### */ ocurve.alphacurve = 1; path.curve = ocurve; } - class Quad - { - public Quad() - { - - } - public double at(int x, int y) - { - return this.data[x * 3 + y]; - } - public double[] data = new double[9]; - } - + static Bitmap_p bm = null; static bool majority(Bitmap_p bm1, int x, int y) @@ -1506,7 +1492,6 @@ public static void Clear() { Potrace.bm = null; Potrace.pathlist.Clear(); - } public static List> PotraceTrace(Bitmap Bitmap) diff --git a/CsPotrace/Quad.cs b/CsPotrace/Quad.cs new file mode 100644 index 000000000..c2c848719 --- /dev/null +++ b/CsPotrace/Quad.cs @@ -0,0 +1,13 @@ +namespace CsPotrace +{ + public class Quad + { + public double[] data = new double[9]; + + public double at(int x, int y) + { + return this.data[x * 3 + y]; + } + } + +} \ No newline at end of file From ae1eaa26ab31dda41d24e3e1c3db75b73ee59f66 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 19:40:07 -0300 Subject: [PATCH 090/116] Starting to move static helpers --- CsPotrace/CsPotrace.cs | 12 ------------ CsPotrace/CsPotraceExportGCODE.cs | 15 --------------- CsPotrace/CsPotraceStatic.cs | 25 +++++++++++++++++++++++++ CsPotrace/Opti.cs | 12 ++++++++++++ 4 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 CsPotrace/CsPotraceStatic.cs create mode 100644 CsPotrace/Opti.cs diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index b8fb62106..05959627c 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -18,7 +18,6 @@ public partial class Potrace #region Potrace classes and contants public static TurnPolicy turnpolicy = TurnPolicy.minority; - //----------------------Potrace Constants and aux functions const int POTRACE_CORNER = 1; const int POTRACE_CURVETO = 2; @@ -1128,17 +1127,6 @@ static void smooth(Path path) /* ---------------------------------------------------------------------- */ /* Stage 5: Curve optimization (Sec. 2.4) */ - /* a private type for the result of opti_penalty */ - class Opti - { - public double pen = 0; - public dPoint[] c = new dPoint[2];// [new dPoint() , new dPoint()]; - public double t = 0; - public double s = 0; - public double alpha = 0; - - } - /* calculate best fit from i+.5 to j+.5. Assume i public partial class Potrace { - /// /// Exports a figure, created by Potrace from a Bitmap to a svg-formatted string /// @@ -154,19 +153,5 @@ private static string GetArcGC(Arc arc, double oX, double oY, double scale, Grap } - private static string formatnumber(double number, double scale) - { - double num = number / scale; - if (!double.IsNaN(num)) - return num.ToString("0.###", System.Globalization.CultureInfo.InvariantCulture); - else - return "0"; - } - - public static PointF AsPointF(Vector2 v) - { - return new PointF(v.X, v.Y); - } - } } diff --git a/CsPotrace/CsPotraceStatic.cs b/CsPotrace/CsPotraceStatic.cs new file mode 100644 index 000000000..67545c2cd --- /dev/null +++ b/CsPotrace/CsPotraceStatic.cs @@ -0,0 +1,25 @@ +using CsPotrace.BezierToBiarc; +using System.Drawing; +using System.Globalization; + +namespace CsPotrace +{ + public partial class Potrace + { + + private static string formatnumber(double number, double scale) + { + double num = number / scale; + if (!double.IsNaN(num)) + return num.ToString("0.###", CultureInfo.InvariantCulture); + else + return "0"; + } + + public static PointF AsPointF(Vector2 v) + { + return new PointF(v.X, v.Y); + } + + } +} diff --git a/CsPotrace/Opti.cs b/CsPotrace/Opti.cs new file mode 100644 index 000000000..72b80d1ff --- /dev/null +++ b/CsPotrace/Opti.cs @@ -0,0 +1,12 @@ +namespace CsPotrace +{ + /* a private type for the result of opti_penalty */ + public class Opti + { + public double pen = 0; + public dPoint[] c = new dPoint[2];// [new dPoint() , new dPoint()]; + public double t = 0; + public double s = 0; + public double alpha = 0; + } +} From 581ee8599aa631b67203f4bdb75913099086010e Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 19:42:29 -0300 Subject: [PATCH 091/116] Move static 'auxiliary functions' --- CsPotrace/CsPotrace.cs | 289 +---------------------------------- CsPotrace/CsPotraceStatic.cs | 281 ++++++++++++++++++++++++++++++++++ 2 files changed, 284 insertions(+), 286 deletions(-) diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index 05959627c..a65163037 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -45,287 +45,7 @@ public partial class Potrace public static double Treshold = 0.5; #endregion - #region auxiliary functions - /* range over the straight line segment [a,b] when lambda ranges over [0,1] */ - static dPoint interval(double lambda, dPoint a, dPoint b) - { - dPoint res = new dPoint(); - - res.X = a.X + lambda * (b.X - a.X); - res.Y = a.Y + lambda * (b.Y - a.Y); - return res; - } - /* return a direction that is 90 degrees counterclockwise from p2-p0, - but then restricted to one of the major wind directions (n, nw, w, etc) */ - static dPoint dorth_infty(dPoint p0, dPoint p2) - { - dPoint r = new dPoint(); - - r.Y = sign(p2.X - p0.X); - r.X = -sign(p2.Y - p0.Y); - - return r; - } - /* ddenom/dpara have the property that the square of radius 1 centered - at p1 intersects the line p0p2 iff |dpara(p0,p1,p2)| <= ddenom(p0,p2) */ - static double ddenom(dPoint p0, dPoint p2) - { - dPoint r = dorth_infty(p0, p2); - - return r.Y * (p2.X - p0.X) - r.X * (p2.Y - p0.Y); - } - /* return (p1-p0)x(p2-p0), the area of the parallelogram */ - static double dpara(dPoint p0, dPoint p1, dPoint p2) - { - double x1, y1, x2, y2; - - x1 = p1.X - p0.X; - y1 = p1.Y - p0.Y; - x2 = p2.X - p0.X; - y2 = p2.Y - p0.Y; - - return x1 * y2 - x2 * y1; - } - /* calculate (p1-p0)x(p3-p2) */ - static double cprod(dPoint p0, dPoint p1, dPoint p2, dPoint p3) - { - double x1, y1, x2, y2; - - x1 = p1.X - p0.X; - y1 = p1.Y - p0.Y; - x2 = p3.X - p2.X; - y2 = p3.Y - p2.Y; - - return x1 * y2 - x2 * y1; - } - /* calculate (p1-p0)*(p2-p0) */ - static double iprod(dPoint p0, dPoint p1, dPoint p2) - { - double x1, y1, x2, y2; - - x1 = p1.X - p0.X; - y1 = p1.Y - p0.Y; - x2 = p2.X - p0.X; - y2 = p2.Y - p0.Y; - - return x1 * x2 + y1 * y2; - } - /* calculate (p1-p0)*(p3-p2) */ - static double iprod1(dPoint p0, dPoint p1, dPoint p2, dPoint p3) - { - double x1, y1, x2, y2; - - x1 = p1.X - p0.X; - y1 = p1.Y - p0.Y; - x2 = p3.X - p2.X; - y2 = p3.Y - p2.Y; - - return x1 * x2 + y1 * y2; - } - /* calculate distance between two points */ - static double ddist(dPoint p, dPoint q) - { - return Math.Sqrt((p.X - q.X) * (p.X - q.X) + (p.Y - q.Y) * (p.Y - q.Y)); - } - - /* calculate p1 x p2 */ - static double xprod(dPoint p1, dPoint p2) - { - return p1.X * p2.Y - p1.Y * p2.X; - } - /* calculate p1 x p2 */ - static int xprodi(Point p1, Point p2) - { - return p1.X * p2.Y - p1.Y * p2.X; - } - /* return 1 if a <= b < c < a, in a cyclic sense (mod n) */ - static bool cyclic(double a, double b, double c) - { - if (a <= c) - { - return (a <= b && b < c); - } - else - { - return (a <= b || b < c); - } - } - - static int sign(double i) - { - return i > 0 ? 1 : i < 0 ? -1 : 0; - } - /* Apply quadratic form Q to vector w = (w.x,w.y) */ - static double quadform(Quad Q, dPoint w) - { - double sum = 0; - double[] v = new double[3]; - v[0] = w.X; - v[1] = w.Y; - v[2] = 1; - sum = 0.0; - - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - sum += v[i] * Q.at(i, j) * v[j]; - } - } - return sum; - } - - /* calculate point of a bezier curve */ - static dPoint bezier(double t, dPoint p0, dPoint p1, dPoint p2, dPoint p3) - { - double s = 1 - t; dPoint res = new dPoint(); - /* Note: a good optimizing compiler (such as gcc-3) reduces the - following to 16 multiplications, using common subexpression - elimination. */ - res.X = s * s * s * p0.X + 3 * (s * s * t) * p1.X + 3 * (t * t * s) * p2.X + t * t * t * p3.X; - res.Y = s * s * s * p0.Y + 3 * (s * s * t) * p1.Y + 3 * (t * t * s) * p2.Y + t * t * t * p3.Y; - - return res; - } - /* calculate the point t in [0..1] on the (convex) bezier curve - (p0,p1,p2,p3) which is tangent to q1-q0. Return -1.0 if there is no - solution in [0..1]. */ - static double tangent(dPoint p0, dPoint p1, dPoint p2, dPoint p3, dPoint q0, dPoint q1) - { - double A, B, C; /* (1-t)^2 A + 2(1-t)t B + t^2 C = 0 */ - - double a, b, c; /* a t^2 + b t + c = 0 */ - double d, s, r1, r2; - A = cprod(p0, p1, q0, q1); - B = cprod(p1, p2, q0, q1); - C = cprod(p2, p3, q0, q1); - - a = A - 2 * B + C; - b = -2 * A + 2 * B; - c = A; - - d = b * b - 4 * a * c; - - if (a == 0 || d < 0) - { - return -1.0; - } - s = Math.Sqrt(d); - - r1 = (-b + s) / (2 * a); - r2 = (-b - s) / (2 * a); - - if (r1 >= 0 && r1 <= 1) - { - return r1; - } - else if (r2 >= 0 && r2 <= 1) - { - return r2; - } - else - { - return -1.0; - } - } - - /* determine the center and slope of the line i..j. Assume i sums = path.sums; - double x, y, x2, xy, y2; - double a, b, c, lambda2, l; - int k = 0; - /* assume i= n) - { - j -= n; - r += 1; - } - while (i >= n) - { - i -= n; - r -= 1; - } - while (j < 0) - { - j += n; - r -= 1; - } - while (i < 0) - { - i += n; - r += 1; - } - - x = sums[j + 1].x - sums[i].x + r * sums[n].x; - y = sums[j + 1].y - sums[i].y + r * sums[n].y; - x2 = sums[j + 1].x2 - sums[i].x2 + r * sums[n].x2; - xy = sums[j + 1].xy - sums[i].xy + r * sums[n].xy; - y2 = sums[j + 1].y2 - sums[i].y2 + r * sums[n].y2; - k = j + 1 - i + r * n; - - ctr.X = x / k; - ctr.Y = y / k; - - a = (x2 - x * x / k) / k; - b = (xy - x * y / k) / k; - c = (y2 - y * y / k) / k; - - lambda2 = (a + c + Math.Sqrt((a - c) * (a - c) + 4 * b * b)) / 2; /* larger e.value */ - - a -= lambda2; - c -= lambda2; - - if (Math.Abs(a) >= Math.Abs(c)) - { - l = Math.Sqrt(a * a + b * b); - if (l != 0) - { - dir.X = -b / l; - dir.Y = a / l; - } - } - else - { - l = Math.Sqrt(c * c + b * b); - if (l != 0) - { - dir.X = -c / l; - dir.Y = b / l; - } - } - if (l == 0) - { - dir.X = dir.Y = 0; /* sometimes this can happen when k=4: - the two eigenvalues coincide */ - } - } - - /* integer arithmetic */ - - static int abs(int a) { return ((a) > 0 ? (a) : -(a)); } - static int min(int a, int b) { return ((a) < (b) ? (a) : (b)); } - static int max(int a, int b) { return ((a) > (b) ? (a) : (b)); } - static int sq(int a) { return ((a) * (a)); } - static int cu(int a) { return ((a) * (a) * (a)); } - - static int mod(int a, int n) - { - return a >= n ? a % n : a >= 0 ? a : n - 1 - (-1 - a) % n; - } - static int floordiv(int a, int n) - { - return a >= 0 ? a / n : -1 - (-1 - a) / n; - } - - #endregion #region Static function of Potrace /// /// @@ -848,9 +568,6 @@ close to linear since the inner loop tends to be short. */ /* calculate "optimal" point-slope representation for each line segment */ - - - static void adjustVertices(Path path) { @@ -1046,7 +763,6 @@ on boundary of square */ } } - /* ---------------------------------------------------------------------- */ /* Stage 4: smoothing and corner analysis (Sec. 2.3.3) */ static void reverse(Path path) @@ -1506,8 +1222,9 @@ public static List> PotraceTrace(Bitmap Bitmap) return rv; } #endregion - #region create svg + /* + #region create svg static string toString(double value) { return string.Format(System.Globalization.CultureInfo.GetCultureInfo("en-US"), "{0:0.000}", value); @@ -1587,7 +1304,7 @@ public static string getSVG() // svg +="Z \"/>"; return svg; } +#endregion */ - #endregion } } diff --git a/CsPotrace/CsPotraceStatic.cs b/CsPotrace/CsPotraceStatic.cs index 67545c2cd..476138dd9 100644 --- a/CsPotrace/CsPotraceStatic.cs +++ b/CsPotrace/CsPotraceStatic.cs @@ -1,4 +1,6 @@ using CsPotrace.BezierToBiarc; +using System; +using System.Collections.Generic; using System.Drawing; using System.Globalization; @@ -6,6 +8,285 @@ namespace CsPotrace { public partial class Potrace { + #region auxiliary functions + /* range over the straight line segment [a,b] when lambda ranges over [0,1] */ + static dPoint interval(double lambda, dPoint a, dPoint b) + { + dPoint res = new dPoint(); + + res.X = a.X + lambda * (b.X - a.X); + res.Y = a.Y + lambda * (b.Y - a.Y); + return res; + } + /* return a direction that is 90 degrees counterclockwise from p2-p0, + but then restricted to one of the major wind directions (n, nw, w, etc) */ + static dPoint dorth_infty(dPoint p0, dPoint p2) + { + dPoint r = new dPoint(); + + r.Y = sign(p2.X - p0.X); + r.X = -sign(p2.Y - p0.Y); + + return r; + } + /* ddenom/dpara have the property that the square of radius 1 centered + at p1 intersects the line p0p2 iff |dpara(p0,p1,p2)| <= ddenom(p0,p2) */ + static double ddenom(dPoint p0, dPoint p2) + { + dPoint r = dorth_infty(p0, p2); + + return r.Y * (p2.X - p0.X) - r.X * (p2.Y - p0.Y); + } + /* return (p1-p0)x(p2-p0), the area of the parallelogram */ + static double dpara(dPoint p0, dPoint p1, dPoint p2) + { + double x1, y1, x2, y2; + + x1 = p1.X - p0.X; + y1 = p1.Y - p0.Y; + x2 = p2.X - p0.X; + y2 = p2.Y - p0.Y; + + return x1 * y2 - x2 * y1; + } + /* calculate (p1-p0)x(p3-p2) */ + static double cprod(dPoint p0, dPoint p1, dPoint p2, dPoint p3) + { + double x1, y1, x2, y2; + + x1 = p1.X - p0.X; + y1 = p1.Y - p0.Y; + x2 = p3.X - p2.X; + y2 = p3.Y - p2.Y; + + return x1 * y2 - x2 * y1; + } + /* calculate (p1-p0)*(p2-p0) */ + static double iprod(dPoint p0, dPoint p1, dPoint p2) + { + double x1, y1, x2, y2; + + x1 = p1.X - p0.X; + y1 = p1.Y - p0.Y; + x2 = p2.X - p0.X; + y2 = p2.Y - p0.Y; + + return x1 * x2 + y1 * y2; + } + /* calculate (p1-p0)*(p3-p2) */ + static double iprod1(dPoint p0, dPoint p1, dPoint p2, dPoint p3) + { + double x1, y1, x2, y2; + + x1 = p1.X - p0.X; + y1 = p1.Y - p0.Y; + x2 = p3.X - p2.X; + y2 = p3.Y - p2.Y; + + return x1 * x2 + y1 * y2; + } + /* calculate distance between two points */ + static double ddist(dPoint p, dPoint q) + { + return Math.Sqrt((p.X - q.X) * (p.X - q.X) + (p.Y - q.Y) * (p.Y - q.Y)); + } + + /* calculate p1 x p2 */ + static double xprod(dPoint p1, dPoint p2) + { + return p1.X * p2.Y - p1.Y * p2.X; + } + /* calculate p1 x p2 */ + static int xprodi(Point p1, Point p2) + { + return p1.X * p2.Y - p1.Y * p2.X; + } + /* return 1 if a <= b < c < a, in a cyclic sense (mod n) */ + static bool cyclic(double a, double b, double c) + { + if (a <= c) + { + return (a <= b && b < c); + } + else + { + return (a <= b || b < c); + } + } + + static int sign(double i) + { + return i > 0 ? 1 : i < 0 ? -1 : 0; + } + /* Apply quadratic form Q to vector w = (w.x,w.y) */ + static double quadform(Quad Q, dPoint w) + { + double sum = 0; + double[] v = new double[3]; + v[0] = w.X; + v[1] = w.Y; + v[2] = 1; + sum = 0.0; + + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + { + sum += v[i] * Q.at(i, j) * v[j]; + } + } + return sum; + } + + /* calculate point of a bezier curve */ + static dPoint bezier(double t, dPoint p0, dPoint p1, dPoint p2, dPoint p3) + { + double s = 1 - t; dPoint res = new dPoint(); + /* Note: a good optimizing compiler (such as gcc-3) reduces the + following to 16 multiplications, using common subexpression + elimination. */ + res.X = s * s * s * p0.X + 3 * (s * s * t) * p1.X + 3 * (t * t * s) * p2.X + t * t * t * p3.X; + res.Y = s * s * s * p0.Y + 3 * (s * s * t) * p1.Y + 3 * (t * t * s) * p2.Y + t * t * t * p3.Y; + + return res; + } + /* calculate the point t in [0..1] on the (convex) bezier curve + (p0,p1,p2,p3) which is tangent to q1-q0. Return -1.0 if there is no + solution in [0..1]. */ + static double tangent(dPoint p0, dPoint p1, dPoint p2, dPoint p3, dPoint q0, dPoint q1) + { + double A, B, C; /* (1-t)^2 A + 2(1-t)t B + t^2 C = 0 */ + + double a, b, c; /* a t^2 + b t + c = 0 */ + double d, s, r1, r2; + A = cprod(p0, p1, q0, q1); + B = cprod(p1, p2, q0, q1); + C = cprod(p2, p3, q0, q1); + + a = A - 2 * B + C; + b = -2 * A + 2 * B; + c = A; + + d = b * b - 4 * a * c; + + if (a == 0 || d < 0) + { + return -1.0; + } + + s = Math.Sqrt(d); + + r1 = (-b + s) / (2 * a); + r2 = (-b - s) / (2 * a); + + if (r1 >= 0 && r1 <= 1) + { + return r1; + } + else if (r2 >= 0 && r2 <= 1) + { + return r2; + } + else + { + return -1.0; + } + } + + /* determine the center and slope of the line i..j. Assume i sums = path.sums; + double x, y, x2, xy, y2; + double a, b, c, lambda2, l; + int k = 0; + /* assume i= n) + { + j -= n; + r += 1; + } + while (i >= n) + { + i -= n; + r -= 1; + } + while (j < 0) + { + j += n; + r -= 1; + } + while (i < 0) + { + i += n; + r += 1; + } + + x = sums[j + 1].x - sums[i].x + r * sums[n].x; + y = sums[j + 1].y - sums[i].y + r * sums[n].y; + x2 = sums[j + 1].x2 - sums[i].x2 + r * sums[n].x2; + xy = sums[j + 1].xy - sums[i].xy + r * sums[n].xy; + y2 = sums[j + 1].y2 - sums[i].y2 + r * sums[n].y2; + k = j + 1 - i + r * n; + + ctr.X = x / k; + ctr.Y = y / k; + + a = (x2 - x * x / k) / k; + b = (xy - x * y / k) / k; + c = (y2 - y * y / k) / k; + + lambda2 = (a + c + Math.Sqrt((a - c) * (a - c) + 4 * b * b)) / 2; /* larger e.value */ + + a -= lambda2; + c -= lambda2; + + if (Math.Abs(a) >= Math.Abs(c)) + { + l = Math.Sqrt(a * a + b * b); + if (l != 0) + { + dir.X = -b / l; + dir.Y = a / l; + } + } + else + { + l = Math.Sqrt(c * c + b * b); + if (l != 0) + { + dir.X = -c / l; + dir.Y = b / l; + } + } + if (l == 0) + { + dir.X = dir.Y = 0; /* sometimes this can happen when k=4: + the two eigenvalues coincide */ + } + } + + /* integer arithmetic */ + + static int abs(int a) { return ((a) > 0 ? (a) : -(a)); } + static int min(int a, int b) { return ((a) < (b) ? (a) : (b)); } + static int max(int a, int b) { return ((a) > (b) ? (a) : (b)); } + static int sq(int a) { return ((a) * (a)); } + static int cu(int a) { return ((a) * (a) * (a)); } + + static int mod(int a, int n) + { + return a >= n ? a % n : a >= 0 ? a : n - 1 - (-1 - a) % n; + } + static int floordiv(int a, int n) + { + return a >= 0 ? a / n : -1 - (-1 - a) / n; + } + #endregion private static string formatnumber(double number, double scale) { From 7b8a25da1a6b02332c6b5811bb65cc532ce6fade Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 19:55:01 -0300 Subject: [PATCH 092/116] Update CsPotrace.cs --- CsPotrace/CsPotrace.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index a65163037..790c86fd0 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -41,9 +41,11 @@ public partial class Potrace /// curve optimization tolerance /// public static double opttolerance = 0.2; - public static double Treshold = 0.5; + static Bitmap_p bm = null; + static List pathlist = new List(); + #endregion #region Static function of Potrace @@ -1132,8 +1134,6 @@ curve cyclically ### */ path.curve = ocurve; } - static Bitmap_p bm = null; - static bool majority(Bitmap_p bm1, int x, int y) { int i; @@ -1161,7 +1161,6 @@ static bool majority(Bitmap_p bm1, int x, int y) return false; } - static List pathlist = new List(); static void tracetoList(List> ListOfPathes) { From 05b75383a8c1e29882ad28518a0ceb37549d1e7b Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 20:12:17 -0300 Subject: [PATCH 093/116] Make CsPotrace non-static --- CsPotrace/CsPotrace.cs | 20 +++++++++---------- LaserGRBL.Lib/GrblFile.cs | 4 +++- .../RasterConverter/ImageProcessor.cs | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index 790c86fd0..723a5613d 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -43,8 +43,8 @@ public partial class Potrace public static double opttolerance = 0.2; public static double Treshold = 0.5; - static Bitmap_p bm = null; - static List pathlist = new List(); + Bitmap_p bm = null; + List pathlist = new List(); #endregion @@ -57,7 +57,7 @@ public partial class Potrace /// /// A Bitmap, which will be transformed to a binary Matrix /// Returns a binaray boolean Matrix - static void ConvertBitmap(Bitmap bitmap) + void ConvertBitmap(Bitmap bitmap) { byte[] Result = new byte[bitmap.Width * bitmap.Height]; @@ -112,7 +112,7 @@ static bool findNext(Bitmap_p bm1, Point point, ref Point result) /// /// x index in the source Matrix /// y index in the source Matrix - static Path findPath(Bitmap_p bm1, Point point) + Path findPath(Bitmap_p bm1, Point point) { Path path = new Path(); int x = point.X; @@ -186,7 +186,7 @@ static Path findPath(Bitmap_p bm1, Point point) /// /// A binary bitmap which holds the imageinformations. /// List of Path objects - static Path bmToPathlist() + Path bmToPathlist() { Bitmap_p bm1 = bm.copy(); @@ -1162,7 +1162,7 @@ static bool majority(Bitmap_p bm1, int x, int y) } - static void tracetoList(List> ListOfPathes) + void tracetoList(List> ListOfPathes) { if (ListOfPathes == null) return; for (int i = 0; i < pathlist.Count; i++) @@ -1191,13 +1191,13 @@ static void tracetoList(List> ListOfPathes) } } - public static void Clear() + void Clear() { - Potrace.bm = null; - Potrace.pathlist.Clear(); + bm = null; + pathlist.Clear(); } - public static List> PotraceTrace(Bitmap Bitmap) + public List> PotraceTrace(Bitmap Bitmap) { Clear(); diff --git a/LaserGRBL.Lib/GrblFile.cs b/LaserGRBL.Lib/GrblFile.cs index 1113009b6..b145e20e9 100644 --- a/LaserGRBL.Lib/GrblFile.cs +++ b/LaserGRBL.Lib/GrblFile.cs @@ -220,6 +220,8 @@ public void LoadImagePotrace(Bitmap bmp, string filename, bool UseSpotRemoval, i if (!append) list.Clear(); + Potrace potrace = new Potrace(); + //list.Add(new GrblCommand("G90")); //absolute (Moved to custom Header) mRange.ResetRange(); @@ -229,7 +231,7 @@ public void LoadImagePotrace(Bitmap bmp, string filename, bool UseSpotRemoval, i Potrace.opttolerance = UseOptimize ? (double)Optimize : 0.2; Potrace.curveoptimizing = UseOptimize; //optimize the path p, replacing sequences of Bezier segments by a single segment when possible. - List> plist = Potrace.PotraceTrace(bmp); + List> plist = potrace.PotraceTrace(bmp); if (c.dir != RasterConverter.Direction.None) { diff --git a/LaserGRBL.Lib/RasterConverter/ImageProcessor.cs b/LaserGRBL.Lib/RasterConverter/ImageProcessor.cs index 0bdd8812b..5ceb146ab 100644 --- a/LaserGRBL.Lib/RasterConverter/ImageProcessor.cs +++ b/LaserGRBL.Lib/RasterConverter/ImageProcessor.cs @@ -1156,7 +1156,7 @@ private void PreviewVector(Bitmap bmp) if (MustExitTH) return; - List> plist = Potrace.PotraceTrace(bmp); + List> plist = new Potrace().PotraceTrace(bmp); if (MustExitTH) return; From 9e73fabae91d6f44392b1d47709f96c3d5d4dbb7 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 20:19:06 -0300 Subject: [PATCH 094/116] Remove more static fields --- CsPotrace/CsPotrace.cs | 25 ++++++++----------- LaserGRBL.Lib/GrblFile.cs | 8 +++--- .../RasterConverter/ImageProcessor.cs | 11 ++++---- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index 723a5613d..fee163fbb 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -15,39 +15,34 @@ namespace CsPotrace { public partial class Potrace { - #region Potrace classes and contants - public static TurnPolicy turnpolicy = TurnPolicy.minority; - //----------------------Potrace Constants and aux functions const int POTRACE_CORNER = 1; const int POTRACE_CURVETO = 2; - //static double COS179 = Math.Cos(179 * Math.PI / 180); + public TurnPolicy turnpolicy = TurnPolicy.minority; /// /// area of largest path to be ignored /// - public static int turdsize = 2; + public int turdsize = 2; /// /// corner threshold /// - public static double alphamax = 1.0; + public double alphamax = 1.0; /// /// use curve optimization /// optimize the path p, replacing sequences of Bezier segments by a /// single segment when possible. /// - public static bool curveoptimizing = true; + public bool curveoptimizing = true; /// /// curve optimization tolerance /// - public static double opttolerance = 0.2; - public static double Treshold = 0.5; + public double opttolerance = 0.2; + public double Treshold = 0.5; Bitmap_p bm = null; List pathlist = new List(); - #endregion - #region Static function of Potrace /// /// @@ -784,7 +779,7 @@ static void reverse(Path path) } /* Always succeeds and returns 0 */ - static void smooth(Path path) + static void smooth(Path path, double alphamax) { int m = path.curve.n; privcurve curve = path.curve; @@ -1011,7 +1006,7 @@ static int opti_penalty(Path path, int i, int j, Opti res, double opttolerance, /* optimize the path p, replacing sequences of Bezier segments by a single segment when possible. Return 0 on success, 1 with errno set on failure. */ - static void optiCurve(Path path) + static void optiCurve(Path path, double opttolerance) { privcurve curve = path.curve; int m = curve.n; @@ -1210,9 +1205,9 @@ public List> PotraceTrace(Bitmap Bitmap) bestPolygon(pathlist[i]); adjustVertices(pathlist[i]); - smooth(pathlist[i]); + smooth(pathlist[i], alphamax); if (curveoptimizing) - optiCurve(pathlist[i]); + optiCurve(pathlist[i], opttolerance); } diff --git a/LaserGRBL.Lib/GrblFile.cs b/LaserGRBL.Lib/GrblFile.cs index b145e20e9..da4994376 100644 --- a/LaserGRBL.Lib/GrblFile.cs +++ b/LaserGRBL.Lib/GrblFile.cs @@ -226,10 +226,10 @@ public void LoadImagePotrace(Bitmap bmp, string filename, bool UseSpotRemoval, i mRange.ResetRange(); - Potrace.turdsize = (int)(UseSpotRemoval ? SpotRemoval : 2); - Potrace.alphamax = UseSmoothing ? (double)Smoothing : 0.0; - Potrace.opttolerance = UseOptimize ? (double)Optimize : 0.2; - Potrace.curveoptimizing = UseOptimize; //optimize the path p, replacing sequences of Bezier segments by a single segment when possible. + potrace.turdsize = (int)(UseSpotRemoval ? SpotRemoval : 2); + potrace.alphamax = UseSmoothing ? (double)Smoothing : 0.0; + potrace.opttolerance = UseOptimize ? (double)Optimize : 0.2; + potrace.curveoptimizing = UseOptimize; //optimize the path p, replacing sequences of Bezier segments by a single segment when possible. List> plist = potrace.PotraceTrace(bmp); diff --git a/LaserGRBL.Lib/RasterConverter/ImageProcessor.cs b/LaserGRBL.Lib/RasterConverter/ImageProcessor.cs index 5ceb146ab..9d92e4808 100644 --- a/LaserGRBL.Lib/RasterConverter/ImageProcessor.cs +++ b/LaserGRBL.Lib/RasterConverter/ImageProcessor.cs @@ -1148,15 +1148,16 @@ private void PreviewLineByLine(Bitmap bmp) private void PreviewVector(Bitmap bmp) { - Potrace.turdsize = (int)(UseSpotRemoval ? SpotRemoval : 2); - Potrace.alphamax = UseSmoothing ? (double)Smoothing : 0.0; - Potrace.opttolerance = UseOptimize ? (double)Optimize : 0.2; - Potrace.curveoptimizing = UseOptimize; //optimize the path p, replacing sequences of Bezier segments by a single segment when possible. + var potrace = new Potrace(); + potrace.turdsize = (int)(UseSpotRemoval ? SpotRemoval : 2); + potrace.alphamax = UseSmoothing ? (double)Smoothing : 0.0; + potrace.opttolerance = UseOptimize ? (double)Optimize : 0.2; + potrace.curveoptimizing = UseOptimize; //optimize the path p, replacing sequences of Bezier segments by a single segment when possible. if (MustExitTH) return; - List> plist = new Potrace().PotraceTrace(bmp); + List> plist = potrace.PotraceTrace(bmp); if (MustExitTH) return; From ee289c1cc866add1444d6ebb984fb85b48da1d10 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 20:19:26 -0300 Subject: [PATCH 095/116] Add Potrace tests --- CsPotrace.UnitTest/CsPotrace.UnitTest.csproj | 4 + .../CsPotraceTests/PotraceTraceTests.cs | 98 +++++++++++++++++++ CsPotrace.UnitTest/Export2GCodeTests.cs | 80 +++++++++++++++ 3 files changed, 182 insertions(+) create mode 100644 CsPotrace.UnitTest/CsPotraceTests/PotraceTraceTests.cs create mode 100644 CsPotrace.UnitTest/Export2GCodeTests.cs diff --git a/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj b/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj index 2544780ee..b51d805f9 100644 --- a/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj +++ b/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj @@ -17,4 +17,8 @@ + + + + diff --git a/CsPotrace.UnitTest/CsPotraceTests/PotraceTraceTests.cs b/CsPotrace.UnitTest/CsPotraceTests/PotraceTraceTests.cs new file mode 100644 index 000000000..8e016861d --- /dev/null +++ b/CsPotrace.UnitTest/CsPotraceTests/PotraceTraceTests.cs @@ -0,0 +1,98 @@ +using System.Drawing; +using System.Linq; +using Xunit; + +namespace CsPotrace.UnitTest.CsPotraceTests +{ + // A lot of this tests were implemented long after the library was in-use, + // My main first goal is to asssure that what was woking will continue working the SAME way + // I any bug appears, it will be frozen broken in this tests and later fixed + + public class PotraceTraceTests + { + [Fact] + public void CsPotrace_PotraceTrace_LoadBitmap_CurveCount() + { + using var bmp = getSquare(); + Potrace po = new Potrace(); + var result = po.PotraceTrace(bmp); + Assert.Single(result); // External List + Assert.Equal(4, result[0].Count); + } + [Fact] + public void CsPotrace_PotraceTrace_LoadBitmap_CurveCountInverted() + { + using var bmp = getSquareInverted(); + Potrace po = new Potrace(); + var result = po.PotraceTrace(bmp); + + var points = result[0].SelectMany(p => new dPoint[] { p.A, p.B }).ToArray(); + Assert.Equal(16, points.Length); + } + [Fact] + public void CsPotrace_PotraceTrace_LoadBitmap_CurveCountCircle() + { + using var bmp = getCircle(); + Potrace po = new Potrace(); + var result = po.PotraceTrace(bmp); + + var points = result[0].SelectMany(p => new dPoint[] { p.A, p.B }).ToArray(); + Assert.Equal(8, points.Length); + } + + [Fact] + public void CsPotrace_PotraceTrace_LoadBitmap_Points() + { + using var bmp = getSquare(); + Potrace po = new Potrace(); + var result = po.PotraceTrace(bmp); + + var points = result[0].SelectMany(p => new dPoint[] { p.A, p.B }).ToArray(); + Assert.Equal(8, points.Length); + + Assert.Equal(2, points[0].X); + Assert.Equal(5, points[0].Y); + Assert.Equal(5, points[1].X); + Assert.Equal(8, points[1].Y); + Assert.Equal(5, points[2].X); + Assert.Equal(8, points[2].Y); + Assert.Equal(8, points[3].X); + Assert.Equal(5, points[3].Y); + Assert.Equal(8, points[4].X); + Assert.Equal(5, points[4].Y); + Assert.Equal(5, points[5].X); + Assert.Equal(2, points[5].Y); + Assert.Equal(5, points[6].X); + Assert.Equal(2, points[6].Y); + Assert.Equal(2, points[7].X); + Assert.Equal(5, points[7].Y); + } + + + + internal static Bitmap getCircle() + { + var bmp = new Bitmap(10, 10); + using var g = Graphics.FromImage(bmp); + g.Clear(Color.White); + g.FillEllipse(Brushes.Black, new Rectangle(2, 2, 6, 6)); + return bmp; + } + internal static Bitmap getSquare() + { + var bmp = new Bitmap(10, 10); + using var g = Graphics.FromImage(bmp); + g.Clear(Color.White); + g.FillRectangle(Brushes.Black, new Rectangle(2, 2, 6, 6)); + return bmp; + } + internal static Bitmap getSquareInverted() + { + var bmp = new Bitmap(10, 10); + using var g = Graphics.FromImage(bmp); + g.Clear(Color.Black); + g.FillRectangle(Brushes.White, new Rectangle(2, 2, 6, 6)); + return bmp; + } + } +} diff --git a/CsPotrace.UnitTest/Export2GCodeTests.cs b/CsPotrace.UnitTest/Export2GCodeTests.cs new file mode 100644 index 000000000..5b61ed212 --- /dev/null +++ b/CsPotrace.UnitTest/Export2GCodeTests.cs @@ -0,0 +1,80 @@ +using CsPotrace.UnitTest.CsPotraceTests; +using System.IO; +using Xunit; + +namespace CsPotrace.UnitTest +{ + // A lot of this tests were implemented long after the library was in-use, + // My main first goal is to asssure that what was woking will continue working the SAME way + // I any bug appears, it will be frozen broken in this tests and later fixed + + public class Export2GCodeTests + { + [Fact] + public void CsPotrace_Export2GCode_Export2GCode_0010() + { + using var bmp = PotraceTraceTests.getSquare(); + var trace = new Potrace().PotraceTrace(bmp); + // Image size is only used for DEBUG (static variable hardocded to FALSE) + var gcodeLines = Potrace.Export2GCode(trace, 0, 0, 10, "ON", "OFF", bmp.Size); + + Assert.Equal(11, gcodeLines.Count); + Assert.Equal("G0 X0.2 Y0.5", gcodeLines[0]); + Assert.Equal("ON", gcodeLines[1]); + Assert.Equal("G1 X0.288 Y0.712", gcodeLines[2]); + Assert.Equal("G2 X0.5 Y0.8 I0.212 J-0.212", gcodeLines[3]); + Assert.Equal("G2 X0.712 Y0.712 I0 J-0.3", gcodeLines[4]); + Assert.Equal("G1 X0.8 Y0.5", gcodeLines[5]); + Assert.Equal("G1 X0.712 Y0.288", gcodeLines[6]); + Assert.Equal("G2 X0.5 Y0.2 I-0.212 J0.212", gcodeLines[7]); + Assert.Equal("G2 X0.288 Y0.288 I0 J0.3", gcodeLines[8]); + Assert.Equal("G1 X0.2 Y0.5", gcodeLines[9]); + Assert.Equal("OFF", gcodeLines[10]); + } + + [Fact] + public void CsPotrace_Export2GCode_Export2GCode_5520() + { + using var bmp = PotraceTraceTests.getSquare(); + var trace = new Potrace().PotraceTrace(bmp); + // Image size is only used for DEBUG (static variable hardocded to FALSE) + var gcodeLines = Potrace.Export2GCode(trace, 5, 5, 20, "ON", "OFF", bmp.Size); + + Assert.Equal(11, gcodeLines.Count); + Assert.Equal("G0 X5.1 Y5.25", gcodeLines[0]); + Assert.Equal("ON", gcodeLines[1]); + Assert.Equal("G1 X5.144 Y5.356", gcodeLines[2]); + Assert.Equal("G2 X5.25 Y5.4 I0.106 J-0.106", gcodeLines[3]); + Assert.Equal("G2 X5.356 Y5.356 I0 J-0.15", gcodeLines[4]); + Assert.Equal("G1 X5.4 Y5.25", gcodeLines[5]); + Assert.Equal("G1 X5.356 Y5.144", gcodeLines[6]); + Assert.Equal("G2 X5.25 Y5.1 I-0.106 J0.106", gcodeLines[7]); + Assert.Equal("G2 X5.144 Y5.144 I0 J0.15", gcodeLines[8]); + Assert.Equal("G1 X5.1 Y5.25", gcodeLines[9]); + Assert.Equal("OFF", gcodeLines[10]); + } + + [Fact] + public void CsPotrace_Export2GCode_Export2GCode_N5520() + { + using var bmp = PotraceTraceTests.getSquare(); + var trace = new Potrace().PotraceTrace(bmp); + // Image size is only used for DEBUG (static variable hardocded to FALSE) + var gcodeLines = Potrace.Export2GCode(trace, -5, -5, 20, "ON", "OFF", bmp.Size); + + Assert.Equal(11, gcodeLines.Count); + Assert.Equal("G0 X-4.9 Y-4.75", gcodeLines[0]); + Assert.Equal("ON", gcodeLines[1]); + Assert.Equal("G1 X-4.856 Y-4.644", gcodeLines[2]); + Assert.Equal("G2 X-4.75 Y-4.6 I0.106 J-0.106", gcodeLines[3]); + Assert.Equal("G2 X-4.644 Y-4.644 I0 J-0.15", gcodeLines[4]); + Assert.Equal("G1 X-4.6 Y-4.75", gcodeLines[5]); + Assert.Equal("G1 X-4.644 Y-4.856", gcodeLines[6]); + Assert.Equal("G2 X-4.75 Y-4.9 I-0.106 J0.106", gcodeLines[7]); + Assert.Equal("G2 X-4.856 Y-4.856 I0 J0.15", gcodeLines[8]); + Assert.Equal("G1 X-4.9 Y-4.75", gcodeLines[9]); + Assert.Equal("OFF", gcodeLines[10]); + } + + } +} From 1901c138b765ff91b4d71a1a0acb891ee899f78a Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 20:36:59 -0300 Subject: [PATCH 096/116] Remove Vector2 --- CsPotrace/BezierToBiarc/Algorithm.cs | 1 + CsPotrace/BezierToBiarc/Arc.cs | 1 + CsPotrace/BezierToBiarc/BiArc.cs | 1 + CsPotrace/BezierToBiarc/CubicBezier.cs | 1 + CsPotrace/BezierToBiarc/Line.cs | 2 + CsPotrace/BezierToBiarc/Vector2.cs | 606 ------------------------- CsPotrace/CsPotraceExportGCODE.cs | 25 +- CsPotrace/CsPotraceStatic.cs | 5 +- 8 files changed, 22 insertions(+), 620 deletions(-) delete mode 100644 CsPotrace/BezierToBiarc/Vector2.cs diff --git a/CsPotrace/BezierToBiarc/Algorithm.cs b/CsPotrace/BezierToBiarc/Algorithm.cs index a4ab0459c..9547259be 100644 --- a/CsPotrace/BezierToBiarc/Algorithm.cs +++ b/CsPotrace/BezierToBiarc/Algorithm.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Numerics; namespace CsPotrace.BezierToBiarc { diff --git a/CsPotrace/BezierToBiarc/Arc.cs b/CsPotrace/BezierToBiarc/Arc.cs index b08cc9b6b..65853cace 100644 --- a/CsPotrace/BezierToBiarc/Arc.cs +++ b/CsPotrace/BezierToBiarc/Arc.cs @@ -1,4 +1,5 @@ using System; +using System.Numerics; namespace CsPotrace.BezierToBiarc { diff --git a/CsPotrace/BezierToBiarc/BiArc.cs b/CsPotrace/BezierToBiarc/BiArc.cs index 8aeca6790..2013f43f6 100644 --- a/CsPotrace/BezierToBiarc/BiArc.cs +++ b/CsPotrace/BezierToBiarc/BiArc.cs @@ -1,4 +1,5 @@ using System; +using System.Numerics; namespace CsPotrace.BezierToBiarc { diff --git a/CsPotrace/BezierToBiarc/CubicBezier.cs b/CsPotrace/BezierToBiarc/CubicBezier.cs index 551e0a1d9..de4392d9b 100644 --- a/CsPotrace/BezierToBiarc/CubicBezier.cs +++ b/CsPotrace/BezierToBiarc/CubicBezier.cs @@ -1,4 +1,5 @@ using System; +using System.Numerics; namespace CsPotrace.BezierToBiarc { diff --git a/CsPotrace/BezierToBiarc/Line.cs b/CsPotrace/BezierToBiarc/Line.cs index fded7134c..c6a1bfb85 100644 --- a/CsPotrace/BezierToBiarc/Line.cs +++ b/CsPotrace/BezierToBiarc/Line.cs @@ -1,4 +1,6 @@  +using System.Numerics; + namespace CsPotrace.BezierToBiarc { /// diff --git a/CsPotrace/BezierToBiarc/Vector2.cs b/CsPotrace/BezierToBiarc/Vector2.cs deleted file mode 100644 index 1b97e056e..000000000 --- a/CsPotrace/BezierToBiarc/Vector2.cs +++ /dev/null @@ -1,606 +0,0 @@ -using System; -using System.Globalization; -using System.Text; - -namespace CsPotrace.BezierToBiarc -{ - public struct Vector2 : IEquatable, IFormattable - { - /// Componente X del vettore. - - public float X; - /// Componente Y del vettore. - - public float Y; - - /// Restituisce un vettore i cui 2 elementi sono uguali a zero. - /// Vettore i cui due elementi sono uguali a zero (ovvero, restituisce il vettore (0,0)). - - public static Vector2 Zero - { - get - { - return new Vector2(); - } - } - - /// Ottiene un vettore i cui 2 elementi sono uguali a uno. - /// Vettore i cui due elementi sono uguali a uno (ovvero, restituisce il vettore (1,1)). - - public static Vector2 One - { - get - { - return new Vector2(1f, 1f); - } - } - - /// Ottiene il vettore (1,0). - /// Vettore (1,0). - - public static Vector2 UnitX - { - get - { - return new Vector2(1f, 0.0f); - } - } - - /// Ottiene il vettore (0,1). - /// Vettore (0,1). - - public static Vector2 UnitY - { - get - { - return new Vector2(0.0f, 1f); - } - } - - /// Crea un nuovo oggetto i cui due elementi hanno lo stesso valore. - /// Valore da assegnare a entrambi gli elementi. - - - public Vector2(float value) - { - this = new Vector2(value, value); - } - - /// Crea un vettore i cui elementi hanno i valori specificati. - /// Valore da assegnare al campo . - /// Valore da assegnare al campo . - - - public Vector2(float x, float y) - { - this.X = x; - this.Y = y; - } - - /// Somma due vettori. - /// Vettore sommato. - /// Primo vettore da sommare. - /// Secondo vettore da sommare. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator +(Vector2 left, Vector2 right) - { - return new Vector2(left.X + right.X, left.Y + right.Y); - } - - /// Sottrae il secondo vettore dal primo. - /// Vettore risultante dalla sottrazione di da . - /// Primo vettore. - /// Secondo vettore. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator -(Vector2 left, Vector2 right) - { - return new Vector2(left.X - right.X, left.Y - right.Y); - } - - /// Moltiplica due vettori. - /// Vettore prodotto. - /// Primo vettore. - /// Secondo vettore. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator *(Vector2 left, Vector2 right) - { - return new Vector2(left.X * right.X, left.Y * right.Y); - } - - /// Moltiplica il valore scalare per il vettore specificato. - /// Vettore scalato. - /// Vettore. - /// Valore scalare. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator *(float left, Vector2 right) - { - return new Vector2(left, left) * right; - } - - /// Moltiplica il vettore specificato per il valore scalare specificato. - /// Vettore scalato. - /// Vettore. - /// Valore scalare. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator *(Vector2 left, float right) - { - return left * new Vector2(right, right); - } - - /// Divide il primo vettore per il secondo. - /// Vettore risultante dalla divisione di per . - /// Primo vettore. - /// Secondo vettore. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator /(Vector2 left, Vector2 right) - { - return new Vector2(left.X / right.X, left.Y / right.Y); - } - - /// Divide il vettore specificato per un valore scalare specificato. - /// Risultato della divisione. - /// Vettore. - /// Valore scalare. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator /(Vector2 value1, float value2) - { - float num = 1f / value2; - return new Vector2(value1.X * num, value1.Y * num); - } - - /// Nega il vettore specificato. - /// Vettore negato. - /// Vettore da negare. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator -(Vector2 value) - { - return Vector2.Zero - value; - } - - /// Restituisce un valore che indica se le coppie di elementi in due vettori specificati sono uguali. - /// true se e sono uguali; in caso contrario, false. - /// Primo vettore da confrontare. - /// Secondo vettore da confrontare. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Vector2 left, Vector2 right) - { - return left.Equals(right); - } - - /// Restituisce un valore che indica se due vettori specificati non sono uguali. - /// true se e non sono uguali; in caso contrario, false. - /// Primo vettore da confrontare. - /// Secondo vettore da confrontare. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector2 left, Vector2 right) - { - return !(left == right); - } - - /// Restituisce il codice hash per l'istanza. - /// Codice hash. - - public override int GetHashCode() - { - return this.X.GetHashCode() ^ this.Y.GetHashCode(); - } - - /// Restituisce un valore che indica se questa istanza è uguale a un oggetto specificato. - /// true se l'istanza corrente è uguale a ; in caso contrario, false. Se è null, il metodo restituisce false. - /// Oggetto da confrontare con l'istanza corrente. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool Equals(object obj) - { - if (!(obj is Vector2)) - return false; - return this.Equals((Vector2)obj); - } - - /// Restituisce la rappresentazione di stringa dell'istanza corrente usando la formattazione predefinita. - /// Rappresentazione di stringa dell'istanza corrente. - - public override string ToString() - { - return this.ToString("G", (IFormatProvider)CultureInfo.CurrentCulture); - } - - /// Restituisce la rappresentazione di stringa dell'istanza corrente usando la stringa di formato specificata per formattare i singoli elementi. - /// Rappresentazione di stringa dell'istanza corrente. - /// Stringa di formato standard o numerico personalizzato che definisce il formato dei singoli elementi. - - public string ToString(string format) - { - return this.ToString(format, (IFormatProvider)CultureInfo.CurrentCulture); - } - - /// Restituisce la rappresentazione di stringa dell'istanza corrente usando la stringa di formato specificata per formattare i singoli elementi e il provider di formato specificato per definire la formattazione specifica delle impostazioni cultura. - /// Rappresentazione di stringa dell'istanza corrente. - /// Stringa di formato standard o numerico personalizzato che definisce il formato dei singoli elementi. - /// Provider di formato che fornisce informazioni di formattazione specifiche delle impostazioni cultura. - - public string ToString(string format, IFormatProvider formatProvider) - { - StringBuilder stringBuilder = new StringBuilder(); - string numberGroupSeparator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - stringBuilder.Append('<'); - stringBuilder.Append(this.X.ToString(format, formatProvider)); - stringBuilder.Append(numberGroupSeparator); - stringBuilder.Append(' '); - stringBuilder.Append(this.Y.ToString(format, formatProvider)); - stringBuilder.Append('>'); - return stringBuilder.ToString(); - } - - /// Restituisce la lunghezza del vettore. - /// Lunghezza del vettore. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public float Length() - { - return (float)Math.Sqrt((double)this.X * (double)this.X + (double)this.Y * (double)this.Y); - } - - /// Restituisce la lunghezza del vettore al quadrato. - /// Lunghezza al quadrato del vettore. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public float LengthSquared() - { - return (float)((double)this.X * (double)this.X + (double)this.Y * (double)this.Y); - } - - /// Calcola la distanza euclidea tra due punti specificati. - /// Distanza. - /// Primo punto. - /// Secondo punto. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Distance(Vector2 value1, Vector2 value2) - { - float num1 = value1.X - value2.X; - float num2 = value1.Y - value2.Y; - return (float)Math.Sqrt((double)num1 * (double)num1 + (double)num2 * (double)num2); - } - - /// Restituisce la distanza euclidea quadratica tra due punti specificati. - /// Distanza quadratica. - /// Primo punto. - /// Secondo punto. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float DistanceSquared(Vector2 value1, Vector2 value2) - { - float num1 = value1.X - value2.X; - float num2 = value1.Y - value2.Y; - return (float)((double)num1 * (double)num1 + (double)num2 * (double)num2); - } - - /// Restituisce un vettore con la stessa direzione del vettore specificato, ma con una lunghezza di uno. - /// Vettore normalizzato. - /// Vettore da normalizzare. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Normalize(Vector2 value) - { - float num1 = 1f / (float)Math.Sqrt((double)value.X * (double)value.X + (double)value.Y * (double)value.Y); - return new Vector2(value.X * num1, value.Y * num1); - } - - /// Restituisce la reflection di un vettore da una superficie con la normale specificata. - /// Vettore riflesso. - /// Vettore di origine. - /// Normale della superficie riflessa. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Reflect(Vector2 vector, Vector2 normal) - { - float num1 = (float)((double)vector.X * (double)normal.X + (double)vector.Y * (double)normal.Y); - return new Vector2(vector.X - 2f * num1 * normal.X, vector.Y - 2f * num1 * normal.Y); - } - - /// Limita un vettore tra un valore minimo e un valore massimo. - /// Vettore limitato. - /// Vettore da limitare. - /// Valore minimo. - /// Valore massimo. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max) - { - float x1 = value1.X; - float num1 = (double)x1 > (double)max.X ? max.X : x1; - float x2 = (double)num1 < (double)min.X ? min.X : num1; - float y1 = value1.Y; - float num2 = (double)y1 > (double)max.Y ? max.Y : y1; - float y2 = (double)num2 < (double)min.Y ? min.Y : num2; - return new Vector2(x2, y2); - } - - /// Esegue un'interpolazione lineare tra due vettori in base al peso specificato. - /// Vettore interpolato. - /// Primo vettore. - /// Secondo vettore. - /// Valore compreso tra 0 e 1 che indica il peso di . - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount) - { - return new Vector2(value1.X + (value2.X - value1.X) * amount, value1.Y + (value2.Y - value1.Y) * amount); - } - - // /// Trasforma un vettore in base a una matrice 3x2 specificata. - // /// Vettore trasformato. - // /// Vettore da trasformare. - // /// Matrice di trasformazione. - // - // //[MethodImpl(MethodImplOptions.AggressiveInlining)] - // public static Vector2 Transform(Vector2 position, Matrix3x2 matrix) - // { - // return new Vector2((float) ((double) position.X * (double) matrix.M11 + (double) position.Y * (double) matrix.M21) + matrix.M31, (float) ((double) position.X * (double) matrix.M12 + (double) position.Y * (double) matrix.M22) + matrix.M32); - // } - - // /// Trasforma un vettore in base a una matrice 4x4 specificata. - // /// Vettore trasformato. - // /// Vettore da trasformare. - // /// Matrice di trasformazione. - // - // //[MethodImpl(MethodImplOptions.AggressiveInlining)] - // public static Vector2 Transform(Vector2 position, Matrix4x4 matrix) - // { - // return new Vector2((float) ((double) position.X * (double) matrix.M11 + (double) position.Y * (double) matrix.M21) + matrix.M41, (float) ((double) position.X * (double) matrix.M12 + (double) position.Y * (double) matrix.M22) + matrix.M42); - // } - - // /// Trasforma la normale di un vettore in base alla matrice 3x2 specificata. - // /// Vettore trasformato. - // /// Vettore di origine. - // /// Matrice. - // - // //[MethodImpl(MethodImplOptions.AggressiveInlining)] - // public static Vector2 TransformNormal(Vector2 normal, Matrix3x2 matrix) - // { - // return new Vector2((float) ((double) normal.X * (double) matrix.M11 + (double) normal.Y * (double) matrix.M21), (float) ((double) normal.X * (double) matrix.M12 + (double) normal.Y * (double) matrix.M22)); - // } - - // /// Trasforma la normale di un vettore in base alla matrice 4x4 specificata. - // /// Vettore trasformato. - // /// Vettore di origine. - // /// Matrice. - // - // //[MethodImpl(MethodImplOptions.AggressiveInlining)] - // public static Vector2 TransformNormal(Vector2 normal, Matrix4x4 matrix) - // { - // return new Vector2((float) ((double) normal.X * (double) matrix.M11 + (double) normal.Y * (double) matrix.M21), (float) ((double) normal.X * (double) matrix.M12 + (double) normal.Y * (double) matrix.M22)); - // } - - /// Trasforma un vettore in base al valore di rotazione Quaternion specificato. - /// Vettore trasformato. - /// Vettore da ruotare. - /// Rotazione da applicare. - - // //[MethodImpl(MethodImplOptions.AggressiveInlining)] - // public static Vector2 Transform(Vector2 value, Quaternion rotation) - // { - // float num1 = rotation.X + rotation.X; - // float num2 = rotation.Y + rotation.Y; - // float num3 = rotation.Z + rotation.Z; - // float num4 = rotation.W * num3; - // float num5 = rotation.X * num1; - // float num6 = rotation.X * num2; - // float num7 = rotation.Y * num2; - // float num8 = rotation.Z * num3; - // return new Vector2((float) ((double) value.X * (1.0 - (double) num7 - (double) num8) + (double) value.Y * ((double) num6 - (double) num4)), (float) ((double) value.X * ((double) num6 + (double) num4) + (double) value.Y * (1.0 - (double) num5 - (double) num8))); - // } - - /// Somma due vettori. - /// Vettore sommato. - /// Primo vettore da sommare. - /// Secondo vettore da sommare. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Add(Vector2 left, Vector2 right) - { - return left + right; - } - - /// Sottrae il secondo vettore dal primo. - /// Vettore differenza. - /// Primo vettore. - /// Secondo vettore. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Subtract(Vector2 left, Vector2 right) - { - return left - right; - } - - /// Moltiplica due vettori. - /// Vettore prodotto. - /// Primo vettore. - /// Secondo vettore. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Multiply(Vector2 left, Vector2 right) - { - return left * right; - } - - /// Moltiplica un vettore per un valore scalare specificato. - /// Vettore scalato. - /// Vettore da moltiplicare. - /// Valore scalare. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Multiply(Vector2 left, float right) - { - return left * right; - } - - /// Moltiplica un valore scalare per un vettore specificato. - /// Vettore scalato. - /// Valore scalato. - /// Vettore. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Multiply(float left, Vector2 right) - { - return left * right; - } - - /// Divide il primo vettore per il secondo. - /// Vettore risultante dalla divisione. - /// Primo vettore. - /// Secondo vettore. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Divide(Vector2 left, Vector2 right) - { - return left / right; - } - - /// Divide il vettore specificato per un valore scalare specificato. - /// Vettore risultante dalla divisione. - /// Vettore. - /// Valore scalare. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Divide(Vector2 left, float divisor) - { - return left / divisor; - } - - /// Nega un vettore specificato. - /// Vettore negato. - /// Vettore da negare. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Negate(Vector2 value) - { - return -value; - } - - /// Copia gli elementi del vettore nella matrice specificata. - /// Matrice di destinazione. - /// - /// è null. - /// Il numero di elementi nell'istanza corrente è maggiore della matrice. - /// - /// è multidimensionale. - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTo(float[] array) - { - this.CopyTo(array, 0); - } - - /// Copia gli elementi del vettore nella matrice specificata, partendo dalla posizione dell'indice specificata. - /// Matrice di destinazione. - /// Indice in cui copiare il primo elemento del vettore. - /// - /// è null. - /// Il numero di elementi nell'istanza corrente è maggiore della matrice. - /// - /// è minore di zero.-oppure- è maggiore o uguale alla lunghezza della matrice. - /// - /// è multidimensionale. - - public void CopyTo(float[] array, int index) - { - if (array == null) - throw new NullReferenceException("Arg_NullArgumentNullRef"); - if (index < 0 || index >= array.Length) - throw new ArgumentOutOfRangeException("Arg_ArgumentOutOfRangeException"); - if (array.Length - index < 2) - throw new ArgumentException("Arg_ElementsInSourceIsGreaterThanDestination"); - array[index] = this.X; - array[index + 1] = this.Y; - } - - /// Restituisce un valore che indica se questa istanza è uguale a un altro vettore. - /// true se i due vettori sono uguali; in caso contrario, false. - /// L'altro vettore. - - - public bool Equals(Vector2 other) - { - if ((double)this.X == (double)other.X) - return (double)this.Y == (double)other.Y; - return false; - } - - /// Restituisce il prodotto scalare di due vettori. - /// Prodotto scalare. - /// Primo vettore. - /// Secondo vettore. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Dot(Vector2 value1, Vector2 value2) - { - return (float)((double)value1.X * (double)value2.X + (double)value1.Y * (double)value2.Y); - } - - /// Restituisce un vettore che contiene il valore più basso da ognuna delle coppie di elementi nei due vettori specificati. - /// Vettore minimizzato. - /// Primo vettore. - /// Secondo vettore. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Min(Vector2 value1, Vector2 value2) - { - return new Vector2((double)value1.X < (double)value2.X ? value1.X : value2.X, (double)value1.Y < (double)value2.Y ? value1.Y : value2.Y); - } - - /// Restituisce un vettore che contiene il valore più alto da ognuna delle coppie di elementi nei due vettori specificati. - /// Vettore massimizzato. - /// Primo vettore. - /// Secondo vettore. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Max(Vector2 value1, Vector2 value2) - { - return new Vector2((double)value1.X > (double)value2.X ? value1.X : value2.X, (double)value1.Y > (double)value2.Y ? value1.Y : value2.Y); - } - - /// Restituisce un vettore i cui elementi sono i valori assoluti di ognuno degli elementi del vettore specificato. - /// Valore assoluto del vettore. - /// Vettore. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Abs(Vector2 value) - { - return new Vector2(Math.Abs(value.X), Math.Abs(value.Y)); - } - - /// Restituisce un vettore i cui elementi sono la radice quadrata di ognuno degli elementi del vettore specificato. - /// Vettore radice quadrata. - /// Vettore. - - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 SquareRoot(Vector2 value) - { - return new Vector2((float)Math.Sqrt((double)value.X), (float)Math.Sqrt((double)value.Y)); - } - } -} \ No newline at end of file diff --git a/CsPotrace/CsPotraceExportGCODE.cs b/CsPotrace/CsPotraceExportGCODE.cs index 60e7db3a8..5894f3512 100644 --- a/CsPotrace/CsPotraceExportGCODE.cs +++ b/CsPotrace/CsPotraceExportGCODE.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using CsPotrace.BezierToBiarc; using System.Drawing; +using System.Numerics; namespace CsPotrace { @@ -23,25 +24,25 @@ public partial class Potrace /// Width of the exportd cvg-File /// Height of the exportd cvg-File /// - public static List Export2GCode(List> list, float oX, float oY, double scale, string lOn, string lOff, Size originalImageSize) + public static List Export2GCode(List> list, float oX, float oY, double scale, string lOn, string lOff, Size originalImageSize) { bool debug = false; Bitmap bmp = null; - System.Drawing.Graphics g = null; + Graphics g = null; if (debug) { bmp = new Bitmap(originalImageSize.Width, originalImageSize.Height); - g = System.Drawing.Graphics.FromImage(bmp); + g = Graphics.FromImage(bmp); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; - g.Clear(System.Drawing.Color.White); + g.Clear(Color.White); } List rv = new List(); list.Reverse(); - foreach (List Curves in list) + foreach (List Curves in list) rv.AddRange(GetPathGC(Curves, lOn, lOff, oX * scale, oY * scale, scale, g)); if (debug) @@ -54,13 +55,13 @@ public static List Export2GCode(List> list, float return rv; } - private static List GetPathGC(List Curves, string lOn, string lOff, double oX, double oY, double scale, Graphics g) + private static List GetPathGC(List Curves, string lOn, string lOff, double oX, double oY, double scale, Graphics g) { List rv = new List(); OnPathBegin(Curves, lOn, oX, oY, scale, rv); - foreach (CsPotrace.Curve Curve in Curves) + foreach (Curve Curve in Curves) OnPathSegment(Curve, oX, oY, scale, rv, g); OnPathEnd(Curves, lOff, oX, oY, scale, rv); @@ -68,21 +69,21 @@ private static List GetPathGC(List Curves, string lOn, return rv; } - private static void OnPathSegment(CsPotrace.Curve Curve, double oX, double oY, double scale, List rv, Graphics g) + private static void OnPathSegment(Curve Curve, double oX, double oY, double scale, List rv, Graphics g) { if (double.IsNaN(Curve.LinearLenght)) // problem? return; - if (Curve.Kind == CsPotrace.CurveKind.Line) + if (Curve.Kind == CurveKind.Line) { //trace line if (g != null) g.DrawLine(Pens.DarkGray, (float)Curve.A.X, (float)Curve.A.Y, (float)Curve.B.X, (float)Curve.B.Y); - rv.Add(String.Format("G1 X{0} Y{1}", formatnumber(Curve.B.X + oX, scale), formatnumber(Curve.B.Y + oY, scale))); + rv.Add(string.Format("G1 X{0} Y{1}", formatnumber(Curve.B.X + oX, scale), formatnumber(Curve.B.Y + oY, scale))); } - if (Curve.Kind == CsPotrace.CurveKind.Bezier) + if (Curve.Kind == CurveKind.Bezier) { CubicBezier cb = new CubicBezier(new Vector2((float)Curve.A.X, (float)Curve.A.Y), new Vector2((float)Curve.ControlPointA.X, (float)Curve.ControlPointA.Y), @@ -110,7 +111,7 @@ private static void OnPathSegment(CsPotrace.Curve Curve, double oX, double oY, d catch { if (g != null) g.DrawLine(Pens.DarkGray, (float)Curve.A.X, (float)Curve.A.Y, (float)Curve.B.X, (float)Curve.B.Y); - rv.Add(String.Format("G1 X{0} Y{1}", formatnumber(Curve.B.X + oX, scale), formatnumber(Curve.B.Y + oY, scale))); + rv.Add(string.Format("G1 X{0} Y{1}", formatnumber(Curve.B.X + oX, scale), formatnumber(Curve.B.Y + oY, scale))); } } diff --git a/CsPotrace/CsPotraceStatic.cs b/CsPotrace/CsPotraceStatic.cs index 476138dd9..6b1fbb88a 100644 --- a/CsPotrace/CsPotraceStatic.cs +++ b/CsPotrace/CsPotraceStatic.cs @@ -3,11 +3,12 @@ using System.Collections.Generic; using System.Drawing; using System.Globalization; +using System.Numerics; namespace CsPotrace { - public partial class Potrace - { + public partial class Potrace + { #region auxiliary functions /* range over the straight line segment [a,b] when lambda ranges over [0,1] */ static dPoint interval(double lambda, dPoint a, dPoint b) From 2e1c7c1287daaa9662c118063b26a4ec2890b268 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sat, 29 Aug 2020 22:41:29 -0300 Subject: [PATCH 097/116] Cleanup --- CsPotrace/Curve.cs | 1 - CsPotrace/privcurve.cs | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/CsPotrace/Curve.cs b/CsPotrace/Curve.cs index eebd57d86..9aa04079a 100644 --- a/CsPotrace/Curve.cs +++ b/CsPotrace/Curve.cs @@ -1,6 +1,5 @@ using System; - //Copyright (C) 2001-2016 Peter Selinger //Copyright (C) 2009-2016 Wolfgang Nagl diff --git a/CsPotrace/privcurve.cs b/CsPotrace/privcurve.cs index abee601c3..98ef72ccf 100644 --- a/CsPotrace/privcurve.cs +++ b/CsPotrace/privcurve.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace CsPotrace +namespace CsPotrace { - public class privcurve + public class privcurve { public int n; /* number of segments */ public int[] tag; /* tag[n]: POTRACE_CORNER or POTRACE_CURVETO */ From 3c6aa7115d21e3e813ea04c7ec55eef8a5db5e0c Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 12:38:56 -0300 Subject: [PATCH 098/116] Added Copyright on files Added Copyright notice of Peter Selinger and Wolfgang Nagl in all Potrace files without one --- CsPotrace/BezierToBiarc/Algorithm.cs | 7 +++++++ CsPotrace/BezierToBiarc/Arc.cs | 7 +++++++ CsPotrace/BezierToBiarc/BiArc.cs | 7 +++++++ CsPotrace/BezierToBiarc/Complex.cs | 2 -- CsPotrace/BezierToBiarc/CubicBezier.cs | 7 +++++++ CsPotrace/BezierToBiarc/Line.cs | 12 +++++++++--- CsPotrace/Bitmap_p.cs | 7 +++++++ CsPotrace/CsPotrace.cs | 1 - CsPotrace/CsPotraceExport.cs | 1 - CsPotrace/CsPotraceStatic.cs | 12 +++++++++--- CsPotrace/Enums.cs | 10 +++++++++- CsPotrace/Opti.cs | 10 +++++++++- CsPotrace/Path.cs | 7 +++++++ CsPotrace/Quad.cs | 10 +++++++++- CsPotrace/Sum.cs | 11 +++++++++-- CsPotrace/privcurve.cs | 10 +++++++++- 16 files changed, 105 insertions(+), 16 deletions(-) diff --git a/CsPotrace/BezierToBiarc/Algorithm.cs b/CsPotrace/BezierToBiarc/Algorithm.cs index 9547259be..50b58778a 100644 --- a/CsPotrace/BezierToBiarc/Algorithm.cs +++ b/CsPotrace/BezierToBiarc/Algorithm.cs @@ -2,6 +2,13 @@ using System.Collections.Generic; using System.Numerics; +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + namespace CsPotrace.BezierToBiarc { public class Algorithm diff --git a/CsPotrace/BezierToBiarc/Arc.cs b/CsPotrace/BezierToBiarc/Arc.cs index 65853cace..c74c20840 100644 --- a/CsPotrace/BezierToBiarc/Arc.cs +++ b/CsPotrace/BezierToBiarc/Arc.cs @@ -1,6 +1,13 @@ using System; using System.Numerics; +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + namespace CsPotrace.BezierToBiarc { /// diff --git a/CsPotrace/BezierToBiarc/BiArc.cs b/CsPotrace/BezierToBiarc/BiArc.cs index 2013f43f6..40105d51c 100644 --- a/CsPotrace/BezierToBiarc/BiArc.cs +++ b/CsPotrace/BezierToBiarc/BiArc.cs @@ -1,6 +1,13 @@ using System; using System.Numerics; +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + namespace CsPotrace.BezierToBiarc { public struct BiArc diff --git a/CsPotrace/BezierToBiarc/Complex.cs b/CsPotrace/BezierToBiarc/Complex.cs index 9797e55aa..0d2cbbf65 100644 --- a/CsPotrace/BezierToBiarc/Complex.cs +++ b/CsPotrace/BezierToBiarc/Complex.cs @@ -11,8 +11,6 @@ namespace CsPotrace.BezierToBiarc { - - /// Rappresenta un numero complesso. [Serializable] diff --git a/CsPotrace/BezierToBiarc/CubicBezier.cs b/CsPotrace/BezierToBiarc/CubicBezier.cs index de4392d9b..68836bc8e 100644 --- a/CsPotrace/BezierToBiarc/CubicBezier.cs +++ b/CsPotrace/BezierToBiarc/CubicBezier.cs @@ -1,6 +1,13 @@ using System; using System.Numerics; +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + namespace CsPotrace.BezierToBiarc { public struct CubicBezier diff --git a/CsPotrace/BezierToBiarc/Line.cs b/CsPotrace/BezierToBiarc/Line.cs index c6a1bfb85..0cd958b25 100644 --- a/CsPotrace/BezierToBiarc/Line.cs +++ b/CsPotrace/BezierToBiarc/Line.cs @@ -1,5 +1,11 @@ - -using System.Numerics; +using System.Numerics; + +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. namespace CsPotrace.BezierToBiarc { @@ -111,6 +117,6 @@ private static float Slope(Vector2 P1, Vector2 P2) return (P2.Y - P1.Y) / (P2.X - P1.X); } } - } } + diff --git a/CsPotrace/Bitmap_p.cs b/CsPotrace/Bitmap_p.cs index 47db245de..c28668df8 100644 --- a/CsPotrace/Bitmap_p.cs +++ b/CsPotrace/Bitmap_p.cs @@ -1,5 +1,12 @@ using System.Drawing; +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + namespace CsPotrace { //Holds the binaray bitmap diff --git a/CsPotrace/CsPotrace.cs b/CsPotrace/CsPotrace.cs index fee163fbb..17007f543 100644 --- a/CsPotrace/CsPotrace.cs +++ b/CsPotrace/CsPotrace.cs @@ -3,7 +3,6 @@ using System.Drawing; using System.Drawing.Imaging; - //Copyright (C) 2001-2016 Peter Selinger //Copyright (C) 2009-2016 Wolfgang Nagl diff --git a/CsPotrace/CsPotraceExport.cs b/CsPotrace/CsPotraceExport.cs index 1c9c37532..9a5b45ba1 100644 --- a/CsPotrace/CsPotraceExport.cs +++ b/CsPotrace/CsPotraceExport.cs @@ -5,7 +5,6 @@ //Copyright (C) Dileep.M //E-mail : m.dileep@gmail.com, - // This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. diff --git a/CsPotrace/CsPotraceStatic.cs b/CsPotrace/CsPotraceStatic.cs index 6b1fbb88a..bf040d512 100644 --- a/CsPotrace/CsPotraceStatic.cs +++ b/CsPotrace/CsPotraceStatic.cs @@ -1,13 +1,19 @@ -using CsPotrace.BezierToBiarc; -using System; +using System; using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.Numerics; +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + namespace CsPotrace { - public partial class Potrace + public partial class Potrace { #region auxiliary functions /* range over the straight line segment [a,b] when lambda ranges over [0,1] */ diff --git a/CsPotrace/Enums.cs b/CsPotrace/Enums.cs index 94bba91ca..da3fc0ae7 100644 --- a/CsPotrace/Enums.cs +++ b/CsPotrace/Enums.cs @@ -1,4 +1,12 @@ -namespace CsPotrace + +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +namespace CsPotrace { /// /// Kind of Curve : Line or Bezier diff --git a/CsPotrace/Opti.cs b/CsPotrace/Opti.cs index 72b80d1ff..4e81a6f8d 100644 --- a/CsPotrace/Opti.cs +++ b/CsPotrace/Opti.cs @@ -1,4 +1,12 @@ -namespace CsPotrace + +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +namespace CsPotrace { /* a private type for the result of opti_penalty */ public class Opti diff --git a/CsPotrace/Path.cs b/CsPotrace/Path.cs index 993c377ab..fa6f2692b 100644 --- a/CsPotrace/Path.cs +++ b/CsPotrace/Path.cs @@ -1,6 +1,13 @@ using System.Collections.Generic; using System.Drawing; +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + namespace CsPotrace { public class Path diff --git a/CsPotrace/Quad.cs b/CsPotrace/Quad.cs index c2c848719..7fe6ce9aa 100644 --- a/CsPotrace/Quad.cs +++ b/CsPotrace/Quad.cs @@ -1,4 +1,12 @@ -namespace CsPotrace + +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +namespace CsPotrace { public class Quad { diff --git a/CsPotrace/Sum.cs b/CsPotrace/Sum.cs index e8203b9cb..ca87641da 100644 --- a/CsPotrace/Sum.cs +++ b/CsPotrace/Sum.cs @@ -1,4 +1,12 @@ -namespace CsPotrace + +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +namespace CsPotrace { public struct Sum { @@ -11,6 +19,5 @@ public Sum(double x, double y, double xy, double x2, double y2) this.y2 = y2; } public double x, y, xy, x2, y2; - } } diff --git a/CsPotrace/privcurve.cs b/CsPotrace/privcurve.cs index 98ef72ccf..564ff32ab 100644 --- a/CsPotrace/privcurve.cs +++ b/CsPotrace/privcurve.cs @@ -1,4 +1,12 @@ -namespace CsPotrace + +//Copyright (C) 2001-2016 Peter Selinger +//Copyright (C) 2009-2016 Wolfgang Nagl + +// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +namespace CsPotrace { public class privcurve { From bf68307199294e301d9065837948bfc0ffa8b410 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 15:10:39 -0300 Subject: [PATCH 099/116] Added ArcTests --- .../BezierToBiarcTests/ArcTests.cs | 164 ++++++++++++++++++ CsPotrace.UnitTest/CsPotrace.UnitTest.csproj | 4 - .../CsPotraceTests/PotraceTraceTests.cs | 4 +- CsPotrace.UnitTest/Export2GCodeTests.cs | 4 +- 4 files changed, 168 insertions(+), 8 deletions(-) create mode 100644 CsPotrace.UnitTest/BezierToBiarcTests/ArcTests.cs diff --git a/CsPotrace.UnitTest/BezierToBiarcTests/ArcTests.cs b/CsPotrace.UnitTest/BezierToBiarcTests/ArcTests.cs new file mode 100644 index 000000000..78d1f1610 --- /dev/null +++ b/CsPotrace.UnitTest/BezierToBiarcTests/ArcTests.cs @@ -0,0 +1,164 @@ +using CsPotrace.BezierToBiarc; +using Newtonsoft.Json.Bson; +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Text; +using Xunit; + +namespace CsPotrace.UnitTest.BezierToBiarcTests +{ + // A lot of this tests were implemented long after the library was in-use, + // My first goal is to asssure that what was woking will continue working the SAME way + // If any bug appears, it will be frozen broken in this tests and will be fixed later + + public class ArcTests + { + // Is already stated at Arc class that are redundant information + + const int floatPrecision = 6; + + [Fact] + public void CsPotrace_Arc_EmptyCtorIsZero() + { + var arc = new Arc(); + Assert.Equal(0f, arc.C.X); + Assert.Equal(0f, arc.C.Y); + + Assert.Equal(0f, arc.r); + Assert.Equal(0f, arc.startAngle); + Assert.Equal(0f, arc.sweepAngle); + + Assert.Equal(0f, arc.P1.X); + Assert.Equal(0f, arc.P1.Y); + Assert.Equal(0f, arc.P2.X); + Assert.Equal(0f, arc.P2.Y); + } + [Fact] + public void CsPotrace_Arc_EmptyCtorIsNonZero() + { + var arc = new Arc(new Vector2(0.1f, 0.2f), + 0.3f, 0.4f, 0.5f, + new Vector2(0.6f, 0.7f), + new Vector2(0.8f, 0.9f)); + + Assert.Equal(0.1f, arc.C.X); + Assert.Equal(0.2f, arc.C.Y); + + Assert.Equal(0.3f, arc.r); + Assert.Equal(0.4f, arc.startAngle); + Assert.Equal(0.5f, arc.sweepAngle); + + Assert.Equal(0.6f, arc.P1.X); + Assert.Equal(0.7f, arc.P1.Y); + Assert.Equal(0.8f, arc.P2.X); + Assert.Equal(0.9f, arc.P2.Y); + } + + [Fact] + public void CsPotrace_Arc_IsClockwise() + { + Arc arc = new Arc(); + // as today, zero is NOT clockwise + Assert.False(arc.IsClockwise); + + arc = new Arc(Vector2.Zero, 0, 0, 1, Vector2.Zero, Vector2.Zero); + Assert.True(arc.IsClockwise); + + arc = new Arc(Vector2.Zero, 0, 0, -1, Vector2.Zero, Vector2.Zero); + Assert.False(arc.IsClockwise); + } + + [Fact] + public void CsPotrace_Arc_PoitAt() + { + var unity = unityCircle(); + // 0 + Vector2Equal(unity.P1, unity.PointAt(0f)); + // 2Pi + Vector2Equal(unity.P2, unity.PointAt(1f)); + // 1Pi + Vector2Equal(new Vector2(0, 1), unity.PointAt(0.25f)); + // 3Pi/2 + Vector2Equal(new Vector2(0, -1), unity.PointAt(0.75f)); + } + [Fact] + public void CsPotrace_Arc_Length() + { + var unity = unityCircle(); + Assert.Equal(2 * Math.PI, unity.Length, floatPrecision); + } + [Fact] + public void CsPotrace_Arc_BiggerLength() + { + // 10x bigger, use less precision !! + var unity = biggerCircle(); + Assert.Equal(20 * Math.PI, unity.Length, 4); + } + [Fact] + public void CsPotrace_Arc_HalfLength() + { + var unity = new Arc(C: Vector2.Zero, + r: 1, + startAngle: 0, + sweepAngle: (float)(Math.PI), // 180deg + P1: new Vector2(1, 0), + P2: new Vector2(-1, 0)); + + Assert.Equal(Math.PI, unity.Length, floatPrecision); + } + [Fact] + public void CsPotrace_Arc_LinearLength() + { + var unity = unityCircle(); // Unity Circle has a ZERO LinearLength + Assert.Equal(0, unity.LinearLength); + } + [Fact] + public void CsPotrace_Arc_HalfArcLinearLength() + { + var unity = new Arc(C: Vector2.Zero, + r: 1, + startAngle: 0, + sweepAngle: (float)(Math.PI), // 180deg + P1: new Vector2(1, 0), + P2: new Vector2(-1, 0)); + Assert.Equal(2, unity.LinearLength); // From -1 to 1 + } + [Fact] + public void CsPotrace_Arc_TranslatedHalfArcLinearLength() + { + var unity = new Arc(C: new Vector2(1, 1), // translated + r: 1, + startAngle: 0, + sweepAngle: (float)(Math.PI), // 180deg + P1: new Vector2(1, 0), + P2: new Vector2(-1, 0)); + Assert.Equal(2, unity.LinearLength); // From -1 to 1 + } + + private static void Vector2Equal(Vector2 v1, Vector2 v2) + { + Assert.Equal(v1.X, v2.X, floatPrecision); + Assert.Equal(v1.Y, v2.Y, floatPrecision); + } + + private static Arc unityCircle() + { + return new Arc(C: Vector2.Zero, + r: 1, + startAngle: 0, + sweepAngle: (float)(2 * Math.PI), // 360deg + P1: new Vector2(1, 0), + P2: new Vector2(1, 0)); + } + private static Arc biggerCircle() + { + return new Arc(C: Vector2.Zero, + r: 10, + startAngle: 0, + sweepAngle: (float)(2 * Math.PI), // 360deg + P1: new Vector2(10, 0), + P2: new Vector2(10, 0)); + } + } +} diff --git a/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj b/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj index b51d805f9..2544780ee 100644 --- a/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj +++ b/CsPotrace.UnitTest/CsPotrace.UnitTest.csproj @@ -17,8 +17,4 @@ - - - - diff --git a/CsPotrace.UnitTest/CsPotraceTests/PotraceTraceTests.cs b/CsPotrace.UnitTest/CsPotraceTests/PotraceTraceTests.cs index 8e016861d..948347a02 100644 --- a/CsPotrace.UnitTest/CsPotraceTests/PotraceTraceTests.cs +++ b/CsPotrace.UnitTest/CsPotraceTests/PotraceTraceTests.cs @@ -5,8 +5,8 @@ namespace CsPotrace.UnitTest.CsPotraceTests { // A lot of this tests were implemented long after the library was in-use, - // My main first goal is to asssure that what was woking will continue working the SAME way - // I any bug appears, it will be frozen broken in this tests and later fixed + // My first goal is to asssure that what was woking will continue working the SAME way + // If any bug appears, it will be frozen broken in this tests and will be fixed later public class PotraceTraceTests { diff --git a/CsPotrace.UnitTest/Export2GCodeTests.cs b/CsPotrace.UnitTest/Export2GCodeTests.cs index 5b61ed212..b0d606a36 100644 --- a/CsPotrace.UnitTest/Export2GCodeTests.cs +++ b/CsPotrace.UnitTest/Export2GCodeTests.cs @@ -5,8 +5,8 @@ namespace CsPotrace.UnitTest { // A lot of this tests were implemented long after the library was in-use, - // My main first goal is to asssure that what was woking will continue working the SAME way - // I any bug appears, it will be frozen broken in this tests and later fixed + // My first goal is to asssure that what was woking will continue working the SAME way + // If any bug appears, it will be frozen broken in this tests and will be fixed later public class Export2GCodeTests { From 9f3056c5daef56d5d2c2aafa98f1085f8f051f95 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 15:25:24 -0300 Subject: [PATCH 100/116] Replace internal Complex for the System.Numerics one --- CsPotrace/BezierToBiarc/Complex.cs | 637 ----------------------------- 1 file changed, 637 deletions(-) delete mode 100644 CsPotrace/BezierToBiarc/Complex.cs diff --git a/CsPotrace/BezierToBiarc/Complex.cs b/CsPotrace/BezierToBiarc/Complex.cs deleted file mode 100644 index 0d2cbbf65..000000000 --- a/CsPotrace/BezierToBiarc/Complex.cs +++ /dev/null @@ -1,637 +0,0 @@ -/* - * Created by SharpDevelop. - * User: Diego - * Date: 08/01/2017 - * Time: 16:44 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ -using System; -using System.Globalization; - -namespace CsPotrace.BezierToBiarc -{ - /// Rappresenta un numero complesso. - - [Serializable] - public struct Complex : IEquatable, IFormattable - { - /// Restituisce una nuova istanza di con un numero reale uguale a zero e un numero immaginario uguale a zero. - - public static readonly Complex Zero = new Complex(0.0, 0.0); - /// Restituisce una nuova istanza di con un numero reale uguale a uno e un numero immaginario uguale a zero. - - public static readonly Complex One = new Complex(1.0, 0.0); - /// Restituisce una nuova istanza di con un numero reale uguale a zero e un numero immaginario uguale a uno. - - public static readonly Complex ImaginaryOne = new Complex(0.0, 1.0); - private double m_real; - private double m_imaginary; - private const double LOG_10_INV = 0.43429448190325; - - /// Ottiene il componente reale dell'oggetto corrente. - /// Componente reale di un numero complesso. - - public double Real - { - get - { - return this.m_real; - } - } - - /// Ottiene il componente immaginario dell'oggetto corrente. - /// Componente immaginario di un numero complesso. - - public double Imaginary - { - get - { - return this.m_imaginary; - } - } - - /// Ottiene la grandezza (o valore assoluto) di un numero complesso. - /// Grandezza dell'istanza corrente. - - public double Magnitude - { - get - { - return Complex.Abs(this); - } - } - - /// Ottiene la fase di un numero complesso. - /// Fase di un numero complesso, in radianti. - - public double Phase - { - get - { - return Math.Atan2(this.m_imaginary, this.m_real); - } - } - - /// Inizializza una nuova istanza della struttura usando i valori reali e immaginari specificati. - /// Parte reale del numero complesso. - /// Parte immaginaria del numero complesso. - - public Complex(double real, double imaginary) - { - this.m_real = real; - this.m_imaginary = imaginary; - } - - /// Definisce una conversione implicita di un Intero con segno a 16 bit in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(short value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un Intero con segno a 32 bit in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(int value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un Intero con segno a 64 bit in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(long value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un intero senza segno a 16 bit in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(ushort value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un intero senza segno a 32 bit in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(uint value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un intero senza segno a 64 bit in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(ulong value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un byte con segno in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(sbyte value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un byte senza segno in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(byte value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un numero a virgola mobile a precisione singola in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(float value) - { - return new Complex((double)value, 0.0); - } - - /// Definisce una conversione implicita di un numero a virgola mobile a precisione doppia in un numero complesso. - /// Oggetto contenente il valore del parametro come parte reale e zero come parte immaginaria. - /// Valore da convertire in un numero complesso. - - public static implicit operator Complex(double value) - { - return new Complex(value, 0.0); - } - - // /// Definisce una conversione esplicita di un valore in un numero complesso. - // /// Numero complesso contenente un componente reale uguale a e un componente immaginario uguale a zero. - // /// Valore da convertire in un numero complesso. - // - // public static explicit operator Complex(BigInteger value) - // { - // return new Complex((double) value, 0.0); - // } - - /// Definisce una conversione esplicita di un valore in un numero complesso. - /// Numero complesso contenente un componente reale uguale a e un componente immaginario uguale a zero. - /// Valore da convertire in un numero complesso. - - public static explicit operator Complex(Decimal value) - { - return new Complex((double)value, 0.0); - } - - /// Restituisce l'inverso additivo di un numero complesso specificato. - /// Risultato dei componenti e del parametro moltiplicato per -1. - /// Valore da negare. - - public static Complex operator -(Complex value) - { - return new Complex(-value.m_real, -value.m_imaginary); - } - - /// Somma due numeri complessi. - /// Somma di e . - /// Primo valore da sommare. - /// Secondo valore da sommare. - - public static Complex operator +(Complex left, Complex right) - { - return new Complex(left.m_real + right.m_real, left.m_imaginary + right.m_imaginary); - } - - /// Sottrae un numero complesso da un altro numero complesso. - /// Risultato della sottrazione di da . - /// Valore da cui sottrarre (minuendo). - /// Valore da sottrarre (sottraendo). - - public static Complex operator -(Complex left, Complex right) - { - return new Complex(left.m_real - right.m_real, left.m_imaginary - right.m_imaginary); - } - - /// Moltiplica due numeri complessi specificati. - /// Prodotto di e . - /// Primo valore da moltiplicare. - /// Secondo valore da moltiplicare. - - public static Complex operator *(Complex left, Complex right) - { - return new Complex(left.m_real * right.m_real - left.m_imaginary * right.m_imaginary, left.m_imaginary * right.m_real + left.m_real * right.m_imaginary); - } - - /// Divide un numero complesso specificato per un altro numero complesso specificato. - /// Risultato della divisione di in base a . - /// Valore da dividere. - /// Valore per cui dividere. - - public static Complex operator /(Complex left, Complex right) - { - double real1 = left.m_real; - double imaginary1 = left.m_imaginary; - double real2 = right.m_real; - double imaginary2 = right.m_imaginary; - if (Math.Abs(imaginary2) < Math.Abs(real2)) - { - double num = imaginary2 / real2; - return new Complex((real1 + imaginary1 * num) / (real2 + imaginary2 * num), (imaginary1 - real1 * num) / (real2 + imaginary2 * num)); - } - double num1 = real2 / imaginary2; - return new Complex((imaginary1 + real1 * num1) / (imaginary2 + real2 * num1), (-real1 + imaginary1 * num1) / (imaginary2 + real2 * num1)); - } - - /// Restituisce un valore che indica se due numeri complessi sono uguali. - /// true se i parametri e presentano lo stesso valore; in caso contrario, false. - /// Primo numero complesso da confrontare. - /// Secondo numero complesso da confrontare. - - public static bool operator ==(Complex left, Complex right) - { - if (left.m_real == right.m_real) - return left.m_imaginary == right.m_imaginary; - return false; - } - - /// Restituisce un valore che indica se due numeri complessi non sono uguali. - /// true se e non sono uguali; in caso contrario, false. - /// Primo valore da confrontare. - /// Secondo valore da confrontare. - - public static bool operator !=(Complex left, Complex right) - { - if (left.m_real == right.m_real) - return left.m_imaginary != right.m_imaginary; - return true; - } - - /// Crea un numero complesso dalle coordinate polari di un punto. - /// Numero complesso. - /// La grandezza che è la distanza dall'origine (l'intersezione dell'asse x con l'asse y) al numero. - /// La fase che è l'angolo dalla riga all'asse orizzontale, espresso nei radianti. - - public static Complex FromPolarCoordinates(double magnitude, double phase) - { - return new Complex(magnitude * Math.Cos(phase), magnitude * Math.Sin(phase)); - } - - /// Restituisce l'inverso additivo di un numero complesso specificato. - /// Risultato dei componenti e del parametro moltiplicato per -1. - /// Numero complesso. - - public static Complex Negate(Complex value) - { - return -value; - } - - /// Somma due numeri complessi e restituisce il risultato. - /// Somma di e . - /// Primo numero complesso da sommare. - /// Secondo numero complesso da sommare. - - public static Complex Add(Complex left, Complex right) - { - return left + right; - } - - /// Sottrae un numero complesso da un altro e restituisce il risultato. - /// Risultato della sottrazione di da . - /// Valore da cui sottrarre (minuendo). - /// Valore da sottrarre (sottraendo). - - public static Complex Subtract(Complex left, Complex right) - { - return left - right; - } - - /// Restituisce il prodotto di due numeri complessi. - /// Prodotto dei parametri e . - /// Primo numero complesso da moltiplicare. - /// Secondo numero complesso da moltiplicare. - - public static Complex Multiply(Complex left, Complex right) - { - return left * right; - } - - /// Divide un numero complesso per un altro e restituisce il risultato. - /// Quoziente della divisione. - /// Numero complesso da dividere. - /// Numero complesso per cui dividere. - - public static Complex Divide(Complex dividend, Complex divisor) - { - return dividend / divisor; - } - - /// Ottiene il valore assoluto (o grandezza) di un numero complesso. - /// Valore assoluto di . - /// Numero complesso. - - public static double Abs(Complex value) - { - if (double.IsInfinity(value.m_real) || double.IsInfinity(value.m_imaginary)) - return double.PositiveInfinity; - double num1 = Math.Abs(value.m_real); - double num2 = Math.Abs(value.m_imaginary); - if (num1 > num2) - { - double num3 = num2 / num1; - return num1 * Math.Sqrt(1.0 + num3 * num3); - } - if (num2 == 0.0) - return num1; - double num4 = num1 / num2; - return num2 * Math.Sqrt(1.0 + num4 * num4); - } - - /// Calcola il coniugato di un numero complesso e restituisce il risultato. - /// Coniugato di . - /// Numero complesso. - - public static Complex Conjugate(Complex value) - { - return new Complex(value.m_real, -value.m_imaginary); - } - - /// Restituisce il reciproco moltiplicativo di un numero complesso. - /// Reciproco di . - /// Numero complesso. - - public static Complex Reciprocal(Complex value) - { - if (value.m_real == 0.0 && value.m_imaginary == 0.0) - return Complex.Zero; - return Complex.One / value; - } - - /// Restituisce un valore che indica se l'istanza corrente e un oggetto specificato hanno lo stesso valore. - /// true se il parametro è un oggetto o un tipo in grado di eseguire la conversione implicita in un oggetto e il relativo valore è uguale all'oggetto corrente. In caso contrario, false. - /// Oggetto da confrontare. - - public override bool Equals(object obj) - { - if (!(obj is Complex)) - return false; - return this == (Complex)obj; - } - - /// Restituisce un valore che indica se l'istanza corrente e un numero complesso specificato hanno lo stesso valore. - /// true se questo numero complesso e presentano lo stesso valore. In caso contrario, false. - /// Numero complesso da confrontare. - - public bool Equals(Complex value) - { - if (this.m_real.Equals(value.m_real)) - return this.m_imaginary.Equals(value.m_imaginary); - return false; - } - - /// Converte il valore del numero complesso corrente nella relativa rappresentazione di stringa equivalente in formato cartesiano. - /// Rappresentazione di stringa dell'istanza corrente in formato cartesiano. - - public override string ToString() - { - return string.Format((IFormatProvider)CultureInfo.CurrentCulture, "({0}, {1})", new object[2] - { - (object) this.m_real, - (object) this.m_imaginary - }); - } - - /// Converte il valore del numero complesso corrente nella relativa rappresentazione di stringa equivalente in formato cartesiano usando il formato specificato per le parti reale e immaginaria. - /// Rappresentazione di stringa dell'istanza corrente in formato cartesiano. - /// Stringa di formato numerico standard o personalizzato. - /// - /// non è una stringa in formato valido. - - public string ToString(string format) - { - return string.Format((IFormatProvider)CultureInfo.CurrentCulture, "({0}, {1})", new object[2] - { - (object) this.m_real.ToString(format, (IFormatProvider) CultureInfo.CurrentCulture), - (object) this.m_imaginary.ToString(format, (IFormatProvider) CultureInfo.CurrentCulture) - }); - } - - /// Converte il valore del numero complesso corrente nella relativa rappresentazione di stringa equivalente in formato cartesiano usando le informazioni di formattazione relative alle impostazioni cultura specificate. - /// Rappresentazione di stringa dell'istanza corrente in formato cartesiano, come specificato da . - /// Oggetto che fornisce informazioni di formattazione specifiche delle impostazioni cultura. - - public string ToString(IFormatProvider provider) - { - return string.Format(provider, "({0}, {1})", new object[2] - { - (object) this.m_real, - (object) this.m_imaginary - }); - } - - /// Converte il valore del numero complesso corrente nella relativa rappresentazione di stringa equivalente in formato cartesiano usando il formato specificato e le informazioni sul formato relative alle impostazioni cultura per le parti reale e immaginaria. - /// Rappresentazione di stringa dell'istanza corrente in formato cartesiano, come specificato da e da . - /// Stringa di formato numerico standard o personalizzato. - /// Oggetto che fornisce informazioni di formattazione specifiche delle impostazioni cultura. - /// - /// non è una stringa in formato valido. - - public string ToString(string format, IFormatProvider provider) - { - return string.Format(provider, "({0}, {1})", new object[2] - { - (object) this.m_real.ToString(format, provider), - (object) this.m_imaginary.ToString(format, provider) - }); - } - - /// Restituisce il codice hash per l'oggetto corrente. - /// Codice hash di un intero con segno a 32 bit. - - public override int GetHashCode() - { - return this.m_real.GetHashCode() % 99999997 ^ this.m_imaginary.GetHashCode(); - } - - /// Restituisce il seno del numero complesso specificato. - /// Seno di . - /// Numero complesso. - - public static Complex Sin(Complex value) - { - double real = value.m_real; - double imaginary = value.m_imaginary; - return new Complex(Math.Sin(real) * Math.Cosh(imaginary), Math.Cos(real) * Math.Sinh(imaginary)); - } - - /// Restituisce il seno iperbolico del numero complesso specificato. - /// Seno iperbolico di . - /// Numero complesso. - - public static Complex Sinh(Complex value) - { - double real = value.m_real; - double imaginary = value.m_imaginary; - return new Complex(Math.Sinh(real) * Math.Cos(imaginary), Math.Cosh(real) * Math.Sin(imaginary)); - } - - /// Restituisce l'angolo che costituisce l'arcoseno del numero complesso specificato. - /// Angolo che costituisce l'arcoseno di . - /// Numero complesso. - - public static Complex Asin(Complex value) - { - return -Complex.ImaginaryOne * Complex.Log(Complex.ImaginaryOne * value + Complex.Sqrt(Complex.One - value * value)); - } - - /// Restituisce il coseno del numero complesso specificato. - /// Coseno di . - /// Numero complesso. - - public static Complex Cos(Complex value) - { - double real = value.m_real; - double imaginary = value.m_imaginary; - return new Complex(Math.Cos(real) * Math.Cosh(imaginary), -(Math.Sin(real) * Math.Sinh(imaginary))); - } - - /// Restituisce il coseno iperbolico del numero complesso specificato. - /// Coseno iperbolico di . - /// Numero complesso. - - public static Complex Cosh(Complex value) - { - double real = value.m_real; - double imaginary = value.m_imaginary; - return new Complex(Math.Cosh(real) * Math.Cos(imaginary), Math.Sinh(real) * Math.Sin(imaginary)); - } - - /// Restituisce l'angolo che costituisce l'arcocoseno del numero complesso specificato. - /// Angolo espresso in radianti che costituisce l'arcocoseno di . - /// Numero complesso che rappresenta un coseno. - - public static Complex Acos(Complex value) - { - return -Complex.ImaginaryOne * Complex.Log(value + Complex.ImaginaryOne * Complex.Sqrt(Complex.One - value * value)); - } - - /// Restituisce la tangente del numero complesso specificato. - /// Tangente di . - /// Numero complesso. - - public static Complex Tan(Complex value) - { - return Complex.Sin(value) / Complex.Cos(value); - } - - /// Restituisce la tangente iperbolica del numero complesso specificato. - /// Tangente iperbolica di . - /// Numero complesso. - - public static Complex Tanh(Complex value) - { - return Complex.Sinh(value) / Complex.Cosh(value); - } - - /// Restituisce l'angolo che costituisce l'arcotangente del numero complesso specificato. - /// Angolo che costituisce l'arcotangente di . - /// Numero complesso. - - public static Complex Atan(Complex value) - { - Complex complex = new Complex(2.0, 0.0); - return Complex.ImaginaryOne / complex * (Complex.Log(Complex.One - Complex.ImaginaryOne * value) - Complex.Log(Complex.One + Complex.ImaginaryOne * value)); - } - - /// Restituisce e, la base del logaritmo naturale del numero complesso specificato. - /// Logaritmo naturale (base e) di . - /// Numero complesso. - - public static Complex Log(Complex value) - { - return new Complex(Math.Log(Complex.Abs(value)), Math.Atan2(value.m_imaginary, value.m_real)); - } - - /// Restituisce il logaritmo del numero complesso specificato nella base specificata. - /// Logaritmo di in base . - /// Numero complesso. - /// Base del logaritmo. - - public static Complex Log(Complex value, double baseValue) - { - return Complex.Log(value) / Complex.Log((Complex)baseValue); - } - - /// Restituisce il logaritmo in base 10 del numero complesso specificato. - /// Logaritmo in base 10 di . - /// Numero complesso. - - public static Complex Log10(Complex value) - { - return Complex.Scale(Complex.Log(value), 0.43429448190325); - } - - /// Restituisce e elevato alla potenza specificata da un numero complesso. - /// Numero e elevato alla potenza . - /// Numero complesso che specifica una potenza. - - public static Complex Exp(Complex value) - { - double num = Math.Exp(value.m_real); - return new Complex(num * Math.Cos(value.m_imaginary), num * Math.Sin(value.m_imaginary)); - } - - /// Restituisce la radice quadrata del numero complesso specificato. - /// Radice quadrata di . - /// Numero complesso. - - public static Complex Sqrt(Complex value) - { - return Complex.FromPolarCoordinates(Math.Sqrt(value.Magnitude), value.Phase / 2.0); - } - - /// Restituisce un numero complesso specificato elevato a una potenza specificata da un numero complesso. - /// Numero complesso elevato alla potenza . - /// Numero complesso da elevare a una potenza. - /// Numero complesso che specifica una potenza. - - public static Complex Pow(Complex value, Complex power) - { - if (power == Complex.Zero) - return Complex.One; - if (value == Complex.Zero) - return Complex.Zero; - double real1 = value.m_real; - double imaginary1 = value.m_imaginary; - double real2 = power.m_real; - double imaginary2 = power.m_imaginary; - double num1 = Complex.Abs(value); - double num2 = Math.Atan2(imaginary1, real1); - double num3 = real2 * num2 + imaginary2 * Math.Log(num1); - double num4 = Math.Pow(num1, real2) * Math.Pow(Math.E, -imaginary2 * num2); - return new Complex(num4 * Math.Cos(num3), num4 * Math.Sin(num3)); - } - - /// Restituisce un numero complesso specificato elevato a una potenza specificata da un numero a virgola mobile a precisione doppia. - /// Numero complesso elevato alla potenza . - /// Numero complesso da elevare a una potenza. - /// Numero a virgola mobile a precisione doppia che specifica una potenza. - - public static Complex Pow(Complex value, double power) - { - return Complex.Pow(value, new Complex(power, 0.0)); - } - - private static Complex Scale(Complex value, double factor) - { - return new Complex(factor * value.m_real, factor * value.m_imaginary); - } - } -} \ No newline at end of file From 9f5458e61d90c36b2f793a6e460c5c3f7332cb66 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 16:12:56 -0300 Subject: [PATCH 101/116] Add CubicBezier tests --- .../BezierToBiarcTests/CubicBezierTests.cs | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 CsPotrace.UnitTest/BezierToBiarcTests/CubicBezierTests.cs diff --git a/CsPotrace.UnitTest/BezierToBiarcTests/CubicBezierTests.cs b/CsPotrace.UnitTest/BezierToBiarcTests/CubicBezierTests.cs new file mode 100644 index 000000000..e9c8c9ed3 --- /dev/null +++ b/CsPotrace.UnitTest/BezierToBiarcTests/CubicBezierTests.cs @@ -0,0 +1,87 @@ +using CsPotrace.BezierToBiarc; +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Text; +using Xunit; + +namespace CsPotrace.UnitTest.BezierToBiarcTests +{ + public class CubicBezierTests + { + [Fact] + public void CsPotrace_CubicBezier_EmptyCtorIsZero() + { + var cb = new CubicBezier(); + Assert.Equal(Vector2.Zero, cb.P1); + Assert.Equal(Vector2.Zero, cb.P2); + Assert.Equal(Vector2.Zero, cb.C1); + Assert.Equal(Vector2.Zero, cb.C2); + } + + [Fact] + public void CsPotrace_CubicBezier_CtorNonZero() + { + // P1, C1, C2, P2 + var cb = new CubicBezier(new Vector2(1f, 2f), + new Vector2(3f, 4f), + new Vector2(5f, 6f), + new Vector2(7f, 8f)); + + Assert.Equal(1f, cb.P1.X); + Assert.Equal(2f, cb.P1.Y); + Assert.Equal(3f, cb.C1.X); + Assert.Equal(4f, cb.C1.Y); + Assert.Equal(5f, cb.C2.X); + Assert.Equal(6f, cb.C2.Y); + Assert.Equal(7f, cb.P2.X); + Assert.Equal(8f, cb.P2.Y); + } + [Fact] + public void CsPotrace_CubicBezier_IsClockWise() + { + var cb = simpleSemiArc(); + Assert.True(cb.IsClockwise); + } + [Fact] + public void CsPotrace_CubicBezier_IsClockWiseReversed() + { + var cb = simpleSemiArcReversed(); + Assert.False(cb.IsClockwise); + } + [Fact] + public void CsPotrace_CubicBezier_Example() + { + // https://stackoverflow.com/a/1165943/734639 + // This posts states that + // point[0] = (5, 0) edge[0]: (6 - 5)(4 + 0) = 4 + // point[1] = (6, 4) edge[1]: (4 - 6)(5 + 4) = -18 + // point[2] = (4, 5) edge[2]: (1 - 4)(5 + 5) = -30 + // point[3] = (1, 5) edge[3]: (1 - 1)(0 + 5) = 0 + // point[4] = (1, 0) edge[4]: (5 - 1)(0 + 0) = 0 + // Is Counter Clock Wise + + var cb = new CubicBezier(new Vector2(5f, 0f), + new Vector2(6f, 5f), + new Vector2(4f, 5f), + new Vector2(1f, 5f)); + Assert.False(cb.IsClockwise); + } + + + private static CubicBezier simpleSemiArc() + { + return new CubicBezier(new Vector2(0f, 0f), + new Vector2(0f, 1f), + new Vector2(1f, 1f), + new Vector2(1f, 0f)); + } + private static CubicBezier simpleSemiArcReversed() + { + return new CubicBezier(new Vector2(1f, 0f), + new Vector2(1f, 1f), + new Vector2(0f, 1f), + new Vector2(0f, 0f)); + } + } +} From ce247d8b8cb720d4c54de98842b09b2bdf8f28d5 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 16:13:12 -0300 Subject: [PATCH 102/116] Fix IsClockwise error --- CsPotrace/BezierToBiarc/CubicBezier.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CsPotrace/BezierToBiarc/CubicBezier.cs b/CsPotrace/BezierToBiarc/CubicBezier.cs index 68836bc8e..39ff24eab 100644 --- a/CsPotrace/BezierToBiarc/CubicBezier.cs +++ b/CsPotrace/BezierToBiarc/CubicBezier.cs @@ -81,7 +81,7 @@ public bool IsClockwise sum += (C2.X - C1.X) * (C2.Y + C1.Y); sum += (P2.X - C2.X) * (P2.Y + C2.Y); sum += (P1.X - P2.X) * (P1.Y + P2.Y); - return sum < 0; + return sum > 0; } } From a9a081579fea77e8e814662fa6fd065c9a66631d Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 17:23:24 -0300 Subject: [PATCH 103/116] CubicBezierTests --- .../BezierToBiarcTests/CubicBezierTests.cs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CsPotrace.UnitTest/BezierToBiarcTests/CubicBezierTests.cs b/CsPotrace.UnitTest/BezierToBiarcTests/CubicBezierTests.cs index e9c8c9ed3..84940de2a 100644 --- a/CsPotrace.UnitTest/BezierToBiarcTests/CubicBezierTests.cs +++ b/CsPotrace.UnitTest/BezierToBiarcTests/CubicBezierTests.cs @@ -68,6 +68,49 @@ public void CsPotrace_CubicBezier_Example() Assert.False(cb.IsClockwise); } + [Fact] + public void CsPotrace_CubicBezier_InflexionPoints() + { + var cb = simpleSemiArc(); + var inflexionPoints = cb.InflexionPoints; + + Assert.Equal(0.5, inflexionPoints.Item1.Real); + Assert.Equal(-0.5, inflexionPoints.Item1.Imaginary); + + Assert.Equal(0.5, inflexionPoints.Item2.Real); + Assert.Equal(0.5, inflexionPoints.Item2.Imaginary); + } + + [Fact] + public void CsPotrace_CubicBezier_Split() + { + var cb = simpleSemiArc(); + var split = cb.Split(0.5f); + + // Check ends points + Assert.Equal(cb.P1, split.Item1.P1); + Assert.Equal(cb.P2, split.Item2.P2); + + // Check if the ends match + Assert.Equal(split.Item1.P2, split.Item2.P1); + } + + [Fact] + public void CsPotrace_CubicBezier_PointAt() + { + var cb = simpleSemiArc(); + var point0 = cb.PointAt(0); + var point25 = cb.PointAt(0.25f); + var point50 = cb.PointAt(0.50f); + var point75 = cb.PointAt(0.75f); + var point1 = cb.PointAt(1); + + Assert.Equal(cb.P1, point0); + Assert.Equal(new Vector2(0.15625f, 0.5625f), point25); + Assert.Equal(new Vector2(0.5f, 0.75f), point50); + Assert.Equal(new Vector2(0.84375f, 0.5625f), point75); + Assert.Equal(cb.P2, point1); + } private static CubicBezier simpleSemiArc() { From ca5c3a541f24553b6a5136ac87ce03de7450ff22 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 17:23:36 -0300 Subject: [PATCH 104/116] Remove unused summary --- CsPotrace/BezierToBiarc/CubicBezier.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CsPotrace/BezierToBiarc/CubicBezier.cs b/CsPotrace/BezierToBiarc/CubicBezier.cs index 39ff24eab..cedddb488 100644 --- a/CsPotrace/BezierToBiarc/CubicBezier.cs +++ b/CsPotrace/BezierToBiarc/CubicBezier.cs @@ -41,7 +41,6 @@ public CubicBezier(Vector2 P1, Vector2 C1, Vector2 C2, Vector2 P2) /// Implement the parametric equation. /// /// Parameter of the curve. Must be in [0,1] - /// public Vector2 PointAt(float t) { return (float)Math.Pow(1 - t, 3) * P1 + @@ -54,7 +53,6 @@ public Vector2 PointAt(float t) /// Split a bezier curve at a given parameter value. It returns both of the new ones /// /// Parameter of the curve. Must be in [0,1] - /// public Tuple Split(float t) { Vector2 p0 = P1 + t * (C1 - P1); @@ -88,8 +86,6 @@ public bool IsClockwise /// /// Inflexion points of the Bezier curve. They only valid if they are real and in the range of [0,1] /// - /// - /// public Tuple InflexionPoints { get From 23ac99eb2c84f38569ff2fbd31b0168bff56d00d Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:02:29 -0300 Subject: [PATCH 105/116] Fix spacing --- CsPotrace/Bitmap_p.cs | 98 +++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/CsPotrace/Bitmap_p.cs b/CsPotrace/Bitmap_p.cs index c28668df8..f5d26c47f 100644 --- a/CsPotrace/Bitmap_p.cs +++ b/CsPotrace/Bitmap_p.cs @@ -11,53 +11,53 @@ namespace CsPotrace { //Holds the binaray bitmap public class Bitmap_p - { - public Bitmap_p(int w, int h) - { - this.w = w; - this.h = h; - data = new byte[size]; - } - public int w = 0; - public int h = 0; - public int size - { - get { return w * h; } - } - public bool at(int x, int y) - { - return (x >= 0) - && (x < this.w) - && (y >= 0) - && (y < this.h) - && (this.data[this.w * y + x] == 1); - } - public byte[] data = null; - public Point index(int i) - { - int y = i / w; - return new Point(i - y * w, y); - } - public void flip(int x, int y) - { - if (this.at(x, y)) - { - this.data[this.w * y + x] = 0; - } - else - { - this.data[this.w * y + x] = 1; - } - } - public Bitmap_p copy() - { - Bitmap_p Result = new Bitmap_p(w, h); - for (int i = 0; i < size; i++) - { - Result.data[i] = data[i]; + { + public Bitmap_p(int w, int h) + { + this.w = w; + this.h = h; + data = new byte[size]; + } + public int w = 0; + public int h = 0; + public int size + { + get { return w * h; } + } + public bool at(int x, int y) + { + return (x >= 0) + && (x < this.w) + && (y >= 0) + && (y < this.h) + && (this.data[this.w * y + x] == 1); + } + public byte[] data = null; + public Point index(int i) + { + int y = i / w; + return new Point(i - y * w, y); + } + public void flip(int x, int y) + { + if (this.at(x, y)) + { + this.data[this.w * y + x] = 0; + } + else + { + this.data[this.w * y + x] = 1; + } + } + public Bitmap_p copy() + { + Bitmap_p Result = new Bitmap_p(w, h); + for (int i = 0; i < size; i++) + { + Result.data[i] = data[i]; - } - return Result; - } - } -} + } + return Result; + } + } +} \ No newline at end of file From cc55922238a21447d3caad08f2419a4284e23eb9 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:03:09 -0300 Subject: [PATCH 106/116] Refactor bitmap --- CsPotrace/Bitmap_p.cs | 45 +++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/CsPotrace/Bitmap_p.cs b/CsPotrace/Bitmap_p.cs index f5d26c47f..32b687c46 100644 --- a/CsPotrace/Bitmap_p.cs +++ b/CsPotrace/Bitmap_p.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System; +using System.Drawing; //Copyright (C) 2001-2016 Peter Selinger //Copyright (C) 2009-2016 Wolfgang Nagl @@ -12,27 +13,41 @@ namespace CsPotrace //Holds the binaray bitmap public class Bitmap_p { + + public int w { get; } + public int h { get; } + + private byte[] _data; + public byte[] data + { + get => _data; + set + { + if (data.Length != value.Length) + throw new InvalidOperationException("Lenght mismatch"); + _data = value; + } + } + public Bitmap_p(int w, int h) { this.w = w; this.h = h; - data = new byte[size]; + _data = new byte[size]; } - public int w = 0; - public int h = 0; public int size { get { return w * h; } } + public bool at(int x, int y) { return (x >= 0) - && (x < this.w) + && (x < w) && (y >= 0) - && (y < this.h) - && (this.data[this.w * y + x] == 1); + && (y < h) + && (data[w * y + x] == 1); } - public byte[] data = null; public Point index(int i) { int y = i / w; @@ -40,24 +55,20 @@ public Point index(int i) } public void flip(int x, int y) { - if (this.at(x, y)) + if (at(x, y)) { - this.data[this.w * y + x] = 0; + data[w * y + x] = 0; } else { - this.data[this.w * y + x] = 1; + data[w * y + x] = 1; } } public Bitmap_p copy() { Bitmap_p Result = new Bitmap_p(w, h); - for (int i = 0; i < size; i++) - { - Result.data[i] = data[i]; - - } + Buffer.BlockCopy(_data, 0, Result._data, 0, _data.Length); return Result; } } -} \ No newline at end of file +} From b5a7e280b4576c34be93539d7033b0f973033a7a Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:03:18 -0300 Subject: [PATCH 107/116] Add BitmapPTests --- CsPotrace.UnitTest/BitmapPTests.cs | 71 ++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 CsPotrace.UnitTest/BitmapPTests.cs diff --git a/CsPotrace.UnitTest/BitmapPTests.cs b/CsPotrace.UnitTest/BitmapPTests.cs new file mode 100644 index 000000000..d49cd1574 --- /dev/null +++ b/CsPotrace.UnitTest/BitmapPTests.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using Xunit; + +namespace CsPotrace.UnitTest +{ + public class BitmapPTests + { + [Fact] + public void CsPotrace_BitmapP_Ctor() + { + Bitmap_p b = new Bitmap_p(9, 11); + Assert.Equal(9, b.w); + Assert.Equal(11, b.h); + Assert.Equal(99, b.size); + Assert.Equal(99, b.data.Length); + } + + [Fact] + public void CsPotrace_BitmapP_atOutBounds() + { + Bitmap_p b = new Bitmap_p(9, 11); + for (int i = 0; i < b.data.Length; i++) b.data[i] = 1; + + Assert.False(b.at(-1, 0)); + Assert.False(b.at(0, -1)); + + Assert.False(b.at(9, 0)); + Assert.False(b.at(0, 11)); + } + [Fact] + public void CsPotrace_BitmapP_atInBounds() + { + Bitmap_p b = new Bitmap_p(9, 11); + for (int i = 0; i < b.data.Length; i++) b.data[i] = 1; + + Assert.True(b.at(0, 0)); + Assert.True(b.at(8, 10)); + } + [Fact] + public void CsPotrace_BitmapP_index() + { + Bitmap_p b = new Bitmap_p(9, 11); + + Assert.Equal(new Point(0, 0), b.index(0)); // zero + Assert.Equal(new Point(1, 0), b.index(1)); // first + Assert.Equal(new Point(8, 0), b.index(8)); // last of first row + Assert.Equal(new Point(0, 1), b.index(9)); + + // Last rows + Assert.Equal(new Point(8, 9), b.index(89)); + Assert.Equal(new Point(0, 10), b.index(90)); + Assert.Equal(new Point(8, 10), b.index(98)); + } + [Fact] + public void CsPotrace_BitmapP_copy() + { + Bitmap_p b = new Bitmap_p(9, 11); + for (int i = 0; i < b.data.Length; i++) b.data[i] = (byte)i; + + var bCopy = b.copy(); + + Assert.Equal(b.w, bCopy.w); + Assert.Equal(b.h, bCopy.h); + + Assert.Equal(b.data, bCopy.data); + } + } +} From e8f64003f757c9e6f58f6f2c86e001f6ae6b0eaf Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:12:38 -0300 Subject: [PATCH 108/116] Improve readability --- CsPotrace.UnitTest/BitmapPTests.cs | 17 ++++++++++++++++- CsPotrace/Bitmap_p.cs | 19 +++++++++++-------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/CsPotrace.UnitTest/BitmapPTests.cs b/CsPotrace.UnitTest/BitmapPTests.cs index d49cd1574..d66c6843d 100644 --- a/CsPotrace.UnitTest/BitmapPTests.cs +++ b/CsPotrace.UnitTest/BitmapPTests.cs @@ -40,7 +40,7 @@ public void CsPotrace_BitmapP_atInBounds() Assert.True(b.at(8, 10)); } [Fact] - public void CsPotrace_BitmapP_index() + public void CsPotrace_BitmapP_indexPoint() { Bitmap_p b = new Bitmap_p(9, 11); @@ -55,6 +55,21 @@ public void CsPotrace_BitmapP_index() Assert.Equal(new Point(8, 10), b.index(98)); } [Fact] + public void CsPotrace_BitmapP_indexInt() + { + Bitmap_p b = new Bitmap_p(9, 11); + + Assert.Equal(0, b.index(0, 0)); // zero + Assert.Equal(1, b.index(1,0)); // first + Assert.Equal(8, b.index(8,0)); // last of first row + Assert.Equal(9, b.index(0, 1)); + + // Last rows + Assert.Equal(89, b.index(8, 9)); + Assert.Equal(90, b.index(0,10)); + Assert.Equal(98, b.index(8,10)); + } + [Fact] public void CsPotrace_BitmapP_copy() { Bitmap_p b = new Bitmap_p(9, 11); diff --git a/CsPotrace/Bitmap_p.cs b/CsPotrace/Bitmap_p.cs index 32b687c46..4c775759d 100644 --- a/CsPotrace/Bitmap_p.cs +++ b/CsPotrace/Bitmap_p.cs @@ -13,7 +13,6 @@ namespace CsPotrace //Holds the binaray bitmap public class Bitmap_p { - public int w { get; } public int h { get; } @@ -42,26 +41,30 @@ public int size public bool at(int x, int y) { - return (x >= 0) - && (x < w) - && (y >= 0) - && (y < h) - && (data[w * y + x] == 1); + // check bounds + if (x < 0 || y < 0) return false; + if (x >= w || y >= h) return false; + // check content + return data[index(x, y)] == 1; } public Point index(int i) { int y = i / w; return new Point(i - y * w, y); } + public int index(int x, int y) + { + return w * y + x; + } public void flip(int x, int y) { if (at(x, y)) { - data[w * y + x] = 0; + data[index(x, y)] = 0; } else { - data[w * y + x] = 1; + data[index(x, y)] = 1; } } public Bitmap_p copy() From daa2f667fe933759e5d5985c25115996dee9efef Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:24:52 -0300 Subject: [PATCH 109/116] Add BitmapP Flip Tests --- CsPotrace.UnitTest/BitmapPTests.cs | 40 ++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/CsPotrace.UnitTest/BitmapPTests.cs b/CsPotrace.UnitTest/BitmapPTests.cs index d66c6843d..31bdab3e1 100644 --- a/CsPotrace.UnitTest/BitmapPTests.cs +++ b/CsPotrace.UnitTest/BitmapPTests.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Drawing; using System.Text; +using System.Xml.Schema; using Xunit; namespace CsPotrace.UnitTest @@ -60,15 +61,44 @@ public void CsPotrace_BitmapP_indexInt() Bitmap_p b = new Bitmap_p(9, 11); Assert.Equal(0, b.index(0, 0)); // zero - Assert.Equal(1, b.index(1,0)); // first - Assert.Equal(8, b.index(8,0)); // last of first row + Assert.Equal(1, b.index(1, 0)); // first + Assert.Equal(8, b.index(8, 0)); // last of first row Assert.Equal(9, b.index(0, 1)); // Last rows Assert.Equal(89, b.index(8, 9)); - Assert.Equal(90, b.index(0,10)); - Assert.Equal(98, b.index(8,10)); + Assert.Equal(90, b.index(0, 10)); + Assert.Equal(98, b.index(8, 10)); } + [Fact] + public void CsPotrace_BitmapP_flip() + { + Bitmap_p b = new Bitmap_p(2, 2); + b.data = new byte[] { 0, 1, 1, 0 }; + b.flip(0, 0); + Assert.Equal(new byte[] { 1, 1, 1, 0 }, b.data); + b.flip(1, 0); + Assert.Equal(new byte[] { 1, 0, 1, 0 }, b.data); + } + [Fact] + public void CsPotrace_BitmapP_flipAll() + { + Bitmap_p b = new Bitmap_p(3, 3); + b.data = new byte[9] { 0, 1, 0, + 1, 0, 1, + 0, 1, 0 }; + + var inverted = new byte[9] { 1, 0, 1, + 0, 1, 0, + 1, 0, 1 }; + // Flip all + for (int x = 0; x < 3; x++) + for (int y = 0; y < 3; y++) + b.flip(x, y); + + Assert.Equal(inverted, b.data); + } + [Fact] public void CsPotrace_BitmapP_copy() { @@ -83,4 +113,4 @@ public void CsPotrace_BitmapP_copy() Assert.Equal(b.data, bCopy.data); } } -} +} \ No newline at end of file From f75f888ca5e08b4ede610b3ed523981c1b813b62 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:25:15 -0300 Subject: [PATCH 110/116] Reduce number of calls --- CsPotrace/Bitmap_p.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CsPotrace/Bitmap_p.cs b/CsPotrace/Bitmap_p.cs index 4c775759d..b5e257c7a 100644 --- a/CsPotrace/Bitmap_p.cs +++ b/CsPotrace/Bitmap_p.cs @@ -58,13 +58,14 @@ public int index(int x, int y) } public void flip(int x, int y) { - if (at(x, y)) + int idx = index(x, y); + if(data[idx] == 1) { - data[index(x, y)] = 0; + data[idx] = 0; } else { - data[index(x, y)] = 1; + data[idx] = 1; } } public Bitmap_p copy() From f59f8ab82018981826dfcb086315bcfbe459ed2b Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:30:34 -0300 Subject: [PATCH 111/116] Create dotnet-core.yml --- .github/workflows/dotnet-core.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/dotnet-core.yml diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml new file mode 100644 index 000000000..ef321926f --- /dev/null +++ b/.github/workflows/dotnet-core.yml @@ -0,0 +1,25 @@ +name: .NET Core + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.301 + - name: Install dependencies + run: dotnet restore + - name: Build + run: dotnet build LaserGRBL.CmdLine --configuration Release --no-restore + - name: Test + run: dotnet test --no-restore --verbosity normal From 76273526acaa709e7b3b911c22b685a85de6004e Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:40:12 -0300 Subject: [PATCH 112/116] Test workflow --- .github/workflows/dotnet-core-desktop.yml | 4 ++-- .github/workflows/dotnet-core.yml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet-core-desktop.yml b/.github/workflows/dotnet-core-desktop.yml index f57c63ffb..f31cf20f5 100644 --- a/.github/workflows/dotnet-core-desktop.yml +++ b/.github/workflows/dotnet-core-desktop.yml @@ -39,8 +39,8 @@ name: .NET Core Desktop on: - push: - branches: [ master ] + #push: + # branches: [ master ] pull_request: branches: [ master ] diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index ef321926f..1f99fbc8f 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -18,7 +18,11 @@ jobs: with: dotnet-version: 3.1.301 - name: Install dependencies - run: dotnet restore + run: dotnet restore ./CsPotrace/CsPotrace.csproj + run: dotnet restore ./Cyotek.Drawing/Cyotek.Drawing.csproj + run: dotnet restore ./LaserGRBL.Lib/LaserGRBL.Lib.csproj + run: dotnet restore ./LaserGRBL.CmdLine/LaserGRBL.CmdLine.csproj + run: dotnet restore ./CsPotrace.UnitTest/CsPotrace.UnitTest.csproj - name: Build run: dotnet build LaserGRBL.CmdLine --configuration Release --no-restore - name: Test From 519829e7a3969e68b13a17dfd6d76719fa10b45f Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Sun, 30 Aug 2020 19:41:58 -0300 Subject: [PATCH 113/116] Update dotnet-core.yml --- .github/workflows/dotnet-core.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 1f99fbc8f..22289841e 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -18,11 +18,12 @@ jobs: with: dotnet-version: 3.1.301 - name: Install dependencies - run: dotnet restore ./CsPotrace/CsPotrace.csproj - run: dotnet restore ./Cyotek.Drawing/Cyotek.Drawing.csproj - run: dotnet restore ./LaserGRBL.Lib/LaserGRBL.Lib.csproj - run: dotnet restore ./LaserGRBL.CmdLine/LaserGRBL.CmdLine.csproj - run: dotnet restore ./CsPotrace.UnitTest/CsPotrace.UnitTest.csproj + run: | + dotnet restore ./CsPotrace/CsPotrace.csproj + dotnet restore ./Cyotek.Drawing/Cyotek.Drawing.csproj + dotnet restore ./LaserGRBL.Lib/LaserGRBL.Lib.csproj + dotnet restore ./LaserGRBL.CmdLine/LaserGRBL.CmdLine.csproj + dotnet restore ./CsPotrace.UnitTest/CsPotrace.UnitTest.csproj - name: Build run: dotnet build LaserGRBL.CmdLine --configuration Release --no-restore - name: Test From d6ab99943bcdb1690615192efb1950b7c48484c8 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Fri, 4 Sep 2020 01:30:52 -0300 Subject: [PATCH 114/116] Add DotNet Framework compatibility (4.6.1) --- CsPotrace/CsPotrace.csproj | 12 +- Cyotek.Drawing/Cyotek.Drawing.csproj | 8 +- LaserGRBL.Lib/LaserGRBL.Lib.csproj | 11 +- LaserGRBL/LaserGRBL.UI.csproj | 13 +- LaserGRBL/PSHelper/MaterialDB.cs | 334 +++++++++++++-------------- 5 files changed, 197 insertions(+), 181 deletions(-) diff --git a/CsPotrace/CsPotrace.csproj b/CsPotrace/CsPotrace.csproj index 4b6d3bd37..198b3056c 100644 --- a/CsPotrace/CsPotrace.csproj +++ b/CsPotrace/CsPotrace.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + netcoreapp3.1;net451 @@ -12,8 +12,14 @@ true + + + 4.7.0 + + + - + diff --git a/Cyotek.Drawing/Cyotek.Drawing.csproj b/Cyotek.Drawing/Cyotek.Drawing.csproj index 4b6d3bd37..bc9c44425 100644 --- a/Cyotek.Drawing/Cyotek.Drawing.csproj +++ b/Cyotek.Drawing/Cyotek.Drawing.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + netcoreapp3.1;net451 @@ -12,8 +12,10 @@ true - - + + + 4.7.0 + diff --git a/LaserGRBL.Lib/LaserGRBL.Lib.csproj b/LaserGRBL.Lib/LaserGRBL.Lib.csproj index 6f81cf81c..64fe434dd 100644 --- a/LaserGRBL.Lib/LaserGRBL.Lib.csproj +++ b/LaserGRBL.Lib/LaserGRBL.Lib.csproj @@ -1,13 +1,14 @@ - + - netcoreapp3.1 + netcoreapp3.1;net451 - - + + + 4.7.0 + - diff --git a/LaserGRBL/LaserGRBL.UI.csproj b/LaserGRBL/LaserGRBL.UI.csproj index 028c559f9..9504cae8a 100644 --- a/LaserGRBL/LaserGRBL.UI.csproj +++ b/LaserGRBL/LaserGRBL.UI.csproj @@ -2,22 +2,29 @@ WinExe - netcoreapp3.1 + netcoreapp3.1;NET461 true LaserGRBL LaserGRBL - + - + + + + + + + + diff --git a/LaserGRBL/PSHelper/MaterialDB.cs b/LaserGRBL/PSHelper/MaterialDB.cs index cb971adfa..fc9aea897 100644 --- a/LaserGRBL/PSHelper/MaterialDB.cs +++ b/LaserGRBL/PSHelper/MaterialDB.cs @@ -5,171 +5,171 @@ namespace LaserGRBL.PSHelper { - partial class MaterialDB - { - partial class MaterialsDataTable - { - public override void EndInit() - { - base.EndInit(); - TableNewRow += MaterialsDataTable_TableNewRow; - } - - private void MaterialsDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e) - { - //throw new NotImplementedException(); - } - - protected override void OnTableNewRow(DataTableNewRowEventArgs e) - { - base.OnTableNewRow(e); - - MaterialsRow target = e.Row as MaterialsRow; - MaterialsRow last = GetLastNotDeleted(); - - if (target != null) - { - target.id = Guid.NewGuid(); - - if (last != null) - { - target.Model = last.Model; - target.Material = last.Material; - } - } - } - - private MaterialsRow GetLastNotDeleted() - { - for (int i = Rows.Count - 1; i >= 0; i--) - if (Rows[i].RowState != DataRowState.Deleted) - return Rows[i] as MaterialsRow; - - return null; - } - - protected override void OnColumnChanging(DataColumnChangeEventArgs e) - { - if (e.Column == PowerColumn && (int)e.ProposedValue < 5) - throw new Exception("Please enter a valid power level (Min 5%)"); - if (e.Column == PowerColumn && (int)e.ProposedValue > 100) - throw new Exception("Please enter a valid power level (Max 100%)"); - - if (e.Column == SpeedColumn && (int)e.ProposedValue < 1) - throw new Exception("Please enter a valid speed (Min 1 mm/min)"); - if (e.Column == SpeedColumn && (int)e.ProposedValue > 100000) - throw new Exception("Please enter a valid speed (Max 100000 mm/min)"); - - if (e.Column == CyclesColumn && (int)e.ProposedValue < 1) - throw new Exception("Please enter a valid cycles number (Min 1 cycles)"); - if (e.Column == CyclesColumn && (int)e.ProposedValue >= 100) - throw new Exception("Please enter a valid cycles number (Max 99 cycles)"); - - base.OnColumnChanging(e); - } - - private IEnumerable EnabledRows { get => this.Where(x => x.Visible); } - - - internal object[] Models() - { - return EnabledRows.Select(x => x.Model).Distinct().OrderBy(s => s).ToArray(); - } - - internal object[] Materials(string model) - { - return EnabledRows.Where(x => x.Model == model).Select(x => x.Material).Distinct().OrderBy(s => s).ToArray(); - } - - internal object[] Thickness(string model, string material, string action) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Action == action).Select(x => x.Thickness).Distinct().OrderBy(s => s).ToArray(); - } - - - internal object[] Actions(string model, string material) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material).Select(x => x.Action).Distinct().OrderBy(s => s).ToArray(); - } - - internal MaterialsRow GetResult(string model, string material, string action, string thickness) - { - return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Thickness == thickness && x.Action == action).First(); - } - } - - private MaterialsDataTable FromServer = new MaterialsDataTable(); - - public static MaterialDB Load() - { - MaterialDB rv = new MaterialDB(); - try - { - MaterialsDataTable user = new MaterialsDataTable() { Namespace = rv.Namespace }; - MaterialsDataTable server = new MaterialsDataTable() { Namespace = rv.Namespace }; - - if (System.IO.File.Exists(UserFile)) - user.ReadXml(UserFile); - - if (System.IO.File.Exists(ServerFile)) - server.ReadXml(ServerFile); - - foreach (var row in user) - rv.Materials.ImportRow(row); - - if (rv.Materials.Rows.Count == 0) - { - foreach (var row in server) - rv.Materials.ImportRow(row); - } - else - { - foreach (var row in server) - if (rv.Materials.FindByid(row.id) == null) - rv.FromServer.ImportRow(row); //nuove dal server - } - } - catch { } - - rv.Materials.AcceptChanges(); - return rv; - } - - internal void SaveChanges() - { - try - { - if (Materials.GetChanges() != null) - { - Materials.AcceptChanges(); - Materials.WriteXml(UserFile); - } - } - catch { } - } - - internal int GetNewCount() - { - int count = 0; - foreach (var row in FromServer) - if (Materials.FindByid(row.id) == null) - count++; - return count; - } - - internal void ImportServer() - { - try - { - foreach (var row in FromServer) - if (Materials.FindByid(row.id) == null) - Materials.ImportRow(row); //nuove dal server - } - catch { } - } - - - private static string UserFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.DataPath, "UserMaterials.psh"); } - private static string ServerFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.ExePath, "StandardMaterials.psh"); } - } + partial class MaterialDB + { + partial class MaterialsDataTable + { + public override void EndInit() + { + base.EndInit(); + TableNewRow += MaterialsDataTable_TableNewRow; + } + + private void MaterialsDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e) + { + //throw new NotImplementedException(); + } + + protected override void OnTableNewRow(DataTableNewRowEventArgs e) + { + base.OnTableNewRow(e); + + MaterialsRow target = e.Row as MaterialsRow; + MaterialsRow last = GetLastNotDeleted(); + + if (target != null) + { + target.id = Guid.NewGuid(); + + if (last != null) + { + target.Model = last.Model; + target.Material = last.Material; + } + } + } + + private MaterialsRow GetLastNotDeleted() + { + for (int i = Rows.Count - 1; i >= 0; i--) + if (Rows[i].RowState != DataRowState.Deleted) + return Rows[i] as MaterialsRow; + + return null; + } + + protected override void OnColumnChanging(DataColumnChangeEventArgs e) + { + if (e.Column == PowerColumn && (int)e.ProposedValue < 5) + throw new Exception("Please enter a valid power level (Min 5%)"); + if (e.Column == PowerColumn && (int)e.ProposedValue > 100) + throw new Exception("Please enter a valid power level (Max 100%)"); + + if (e.Column == SpeedColumn && (int)e.ProposedValue < 1) + throw new Exception("Please enter a valid speed (Min 1 mm/min)"); + if (e.Column == SpeedColumn && (int)e.ProposedValue > 100000) + throw new Exception("Please enter a valid speed (Max 100000 mm/min)"); + + if (e.Column == CyclesColumn && (int)e.ProposedValue < 1) + throw new Exception("Please enter a valid cycles number (Min 1 cycles)"); + if (e.Column == CyclesColumn && (int)e.ProposedValue >= 100) + throw new Exception("Please enter a valid cycles number (Max 99 cycles)"); + + base.OnColumnChanging(e); + } + + private IEnumerable EnabledRows { get => this.Where(x => x.Visible); } + + + internal object[] Models() + { + return EnabledRows.Select(x => x.Model).Distinct().OrderBy(s => s).ToArray(); + } + + internal object[] Materials(string model) + { + return EnabledRows.Where(x => x.Model == model).Select(x => x.Material).Distinct().OrderBy(s => s).ToArray(); + } + + internal object[] Thickness(string model, string material, string action) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Action == action).Select(x => x.Thickness).Distinct().OrderBy(s => s).ToArray(); + } + + + internal object[] Actions(string model, string material) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material).Select(x => x.Action).Distinct().OrderBy(s => s).ToArray(); + } + + internal MaterialsRow GetResult(string model, string material, string action, string thickness) + { + return EnabledRows.Where(x => x.Model == model && x.Material == material && x.Thickness == thickness && x.Action == action).First(); + } + } + + private MaterialsDataTable FromServer = new MaterialsDataTable(); + + public static MaterialDB Load() + { + MaterialDB rv = new MaterialDB(); + try + { + MaterialsDataTable user = new MaterialsDataTable() { Namespace = rv.Namespace }; + MaterialsDataTable server = new MaterialsDataTable() { Namespace = rv.Namespace }; + + if (System.IO.File.Exists(UserFile)) + user.ReadXml(UserFile); + + if (System.IO.File.Exists(ServerFile)) + server.ReadXml(ServerFile); + + foreach (var row in user) + rv.Materials.ImportRow(row); + + if (rv.Materials.Rows.Count == 0) + { + foreach (var row in server) + rv.Materials.ImportRow(row); + } + else + { + foreach (var row in server) + if (rv.Materials.FindByid(row.id) == null) + rv.FromServer.ImportRow(row); //nuove dal server + } + } + catch { } + + rv.Materials.AcceptChanges(); + return rv; + } + + internal void SaveChanges() + { + try + { + if (Materials.GetChanges() != null) + { + Materials.AcceptChanges(); + Materials.WriteXml(UserFile); + } + } + catch { } + } + + internal int GetNewCount() + { + int count = 0; + foreach (var row in FromServer) + if (Materials.FindByid(row.id) == null) + count++; + return count; + } + + internal void ImportServer() + { + try + { + foreach (var row in FromServer) + if (Materials.FindByid(row.id) == null) + Materials.ImportRow(row); //nuove dal server + } + catch { } + } + + + private static string UserFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.DataPath, "UserMaterials.psh"); } + private static string ServerFile { get => System.IO.Path.Combine(LaserGRBL.GrblCore.ExePath, "StandardMaterials.psh"); } + } } From cf5cdd604a0ff09c982e29102332d16fb4d7212d Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Fri, 4 Sep 2020 01:35:21 -0300 Subject: [PATCH 115/116] Update README.md --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e540bb98b..f0715f1d8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,15 @@ -! This is the DotNet Core Fork ![.NET Core Desktop](https://github.com/RafaelEstevamReis/LaserGRBL/workflows/.NET%20Core%20Desktop/badge.svg) + This forks adds: + * Added .Net Core 3.1 support + * Upgraded to .Net Framework 4.6 + * Compiles both with .Net Core and .Net Framework + * Isolation between UI and Login (is a long work yet in progress) + * Added Tests (in progress...) + +Status: + +![.NET Core Desktop](https://github.com/RafaelEstevamReis/LaserGRBL/workflows/.NET%20Core%20Desktop/badge.svg) + +---------------- # LaserGRBL [![Donation](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/pools/c/8cQ1Lo4sRA) Official website [http://lasergrbl.com](http://lasergrbl.com) From 6e25ce1fb174581b8c87eef7f9ccef2e20297de6 Mon Sep 17 00:00:00 2001 From: RafaelEstevamReis Date: Mon, 14 Sep 2020 11:06:40 -0300 Subject: [PATCH 116/116] Add error checking --- .../Commands/GCodeBitmapCommand.cs | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/LaserGRBL.CmdLine/Commands/GCodeBitmapCommand.cs b/LaserGRBL.CmdLine/Commands/GCodeBitmapCommand.cs index 06e0a5a45..344f2711b 100644 --- a/LaserGRBL.CmdLine/Commands/GCodeBitmapCommand.cs +++ b/LaserGRBL.CmdLine/Commands/GCodeBitmapCommand.cs @@ -33,12 +33,39 @@ public bool Process(string command, string[] args) if (!fI.Exists) { Console.WriteLine("Input file not found"); + Console.WriteLine($" > current path: {Environment.CurrentDirectory}"); return false; } + try + { + processFile(fI.FullName, fO.FullName); + } + catch(TypeInitializationException ex) + { + Console.WriteLine("Unable to initialize a component"); + Console.WriteLine($" > {ex.Message}"); + if(ex.InnerException != null) Console.WriteLine($" > {ex.InnerException.Message}"); + return false; + } + catch(DllNotFoundException ex) + { + Console.WriteLine("Unable to load shared library"); + Console.WriteLine($" > {ex.Message}"); + if(ex.InnerException != null) Console.WriteLine($" > {ex.InnerException.Message}"); + return false; + } + + Console.WriteLine("Conversion finished"); + + return true; + } + + private void processFile(string input, string output) + { var file = new GrblFile(0, 0, 200, 300); - ImageProcessor IP = new ImageProcessor(file, fI.FullName, Size.Empty, false); + ImageProcessor IP = new ImageProcessor(file, input, Size.Empty, false); IP.WhiteClip = 5; IP.Brightness = 100; IP.Contrast = 100; @@ -50,11 +77,7 @@ public bool Process(string command, string[] args) IP.MarkSpeed = 1000; IP.MaxPower = 1000; IP.GenerateGCodeSync(); - file.SaveProgram(fO.FullName, true, true, false, 1); - - Console.WriteLine("Conversion finished"); - - return true; + file.SaveProgram(output, true, true, false, 1); } } }