Ejemplo n.º 1
0
        /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
        /// <summary>
        /// Resets the state machine values necessary for plotting to the defaults
        /// </summary>
        public void ResetForPlot()
        {
            lastPlotXCoord  = 0;
            lastPlotYCoord  = 0;
            lastDCodeXCoord = 0;
            lastDCodeYCoord = 0;
            if (ApertureCollection.Count() > 0)
            {
                CurrentAperture = ApertureCollection.ApertureList[0];
            }
            else
            {
                currentAperture = new GerberLine_ADCode("", "", 0);
            }

            ApertureCollection.DisposeAllPens();
            //padCenterPointList = new List<GerberPad>();

            gerberFileInterpolationMode = DEFAULT_INTERPOLATION_MODE;
            gerberFileInterpolationCircularDirectionMode = DEFAULT_INTERPOLATIONCIRCULARDIRECTION_MODE;
            gerberFileInterpolationCircularQuadrantMode  = DEFAULT_INTERPOLATIONCIRCULARQUADRANT_MODE;
            gerberFileLayerPolarity = DEFAULT_LAYERPOLARITY;

            contourDrawingModeEnabled = DEFAULT_CONTOURMODE;
            complexObjectList_DCode   = new List <GerberLine_DCode>();
        }
Ejemplo n.º 2
0
        /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
        /// <summary>
        /// Parses out the line and gets the required information from it
        /// </summary>
        /// <param name="processedLineStr">a line string without block terminator or format parameters</param>
        /// <param name="stateMachine">The state machine containing the implied modal values</param>
        /// <returns>z success, nz fail</returns>
        public override int ParseLine(string processedLineStr, GerberFileStateMachine stateMachine)
        {
            LogMessage("ParseLine(LP) started");

            if (processedLineStr == null)
            {
                return(100);
            }
            if (processedLineStr.StartsWith(GerberFile.RS274_LP_CMD) == false)
            {
                return(200);
            }

            // we just do a simple search for the word POS or NEG here
            if (processedLineStr.Contains("LPC") == true)
            {
                // clear polarity now set
                layerPolarity = GerberLayerPolarityEnum.CLEAR;
            }
            else
            {
                // default to this
                layerPolarity = GerberLayerPolarityEnum.DARK;
            }

            return(0);
        }