コード例 #1
0
        /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
        /// <summary>
        /// If we draw a line with an aperture it will not always have linear ends
        /// for example if the aperture is a circle it will have half circle ends. Each
        /// line that is drawn calls this to make it look right visually
        /// </summary>
        /// <param name="graphicsObj">a graphics object to draw on</param>
        /// <param name="workingBrush">a brush to draw with</param>
        /// <param name="workingPen">the pen used for the line, we get the width from this</param>
        /// <param name="x1">the first x value</param>
        /// <param name="y1">the first y value</param>
        /// <param name="x2">the second x value</param>
        /// <param name="y2">the second y value</param>
        /// <param name="xyComp">the xy compensation factor</param>
        /// <returns>z success, nz fail</returns>
        public void FixupLineEndpointsForGCodePlot(IsoPlotBuilder isoPlotBuilder, GerberFileStateMachine stateMachine, int x1, int y1, int x2, int y2, int radius, int xyComp)
        {
            if (isoPlotBuilder == null)
            {
                return;
            }
            if (stateMachine == null)
            {
                return;
            }

            if (ADCodeAperture == null)
            {
                return;
            }
            try
            {
                ADCodeAperture.FixupLineEndpointsForGCodePlot(isoPlotBuilder, stateMachine, x1, y1, x2, y2, radius, xyComp);
            }
            catch (Exception ex)
            {
                // rethrow with line number
                throw new Exception("Line Number:" + LineNumber.ToString() + ", " + ex.Message);
            }
        }
コード例 #2
0
 /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
 /// <summary>
 /// If we draw a line with an aperture it will not always have linear ends
 /// for example if the aperture is a circle it will have half circle ends. Each
 /// line that is drawn calls this to make it look right visually
 /// </summary>
 /// <param name="graphicsObj">a graphics object to draw on</param>
 /// <param name="workingBrush">a brush to draw with</param>
 /// <param name="workingPen">the pen used for the line, we get the width from this</param>
 /// <param name="x1">the first x value</param>
 /// <param name="y1">the first y value</param>
 /// <param name="x2">the second x value</param>
 /// <param name="y2">the second y value</param>
 /// <returns>z success, nz fail</returns>
 public void FixupLineEndpointsForGerberPlot(GerberFileStateMachine stateMachine, Graphics graphicsObj, Brush workingBrush, Pen workingPen, float x1, float y1, float x2, float y2)
 {
     if (ADCodeAperture == null)
     {
         return;
     }
     try
     {
         ADCodeAperture.FixupLineEndpointsForGerberPlot(stateMachine, graphicsObj, workingBrush, workingPen, x1, y1, x2, y2);
     }
     catch (Exception ex)
     {
         // rethrow with line number
         throw new Exception("Line Number:" + LineNumber.ToString() + ", " + ex.Message);
     }
 }
コード例 #3
0
 /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
 /// <summary>
 /// Flash the aperture
 /// </summary>
 /// <param name="isoPlotBuilder">the builder opbject</param>
 /// <param name="stateMachine">the statemachine</param>
 /// <param name="xyComp">the xy compensation factor</param>
 /// <param name="x1">the first x value</param>
 /// <param name="y1">the first y value</param>
 /// <returns>z success, nz fail</returns>
 public void FlashApertureForGCodePlot(IsoPlotBuilder isoPlotBuilder, GerberFileStateMachine stateMachine, int x1, int y1, int xyComp)
 {
     if (ADCodeAperture == null)
     {
         return;
     }
     try
     {
         // macros need to reset
         ADCodeAperture.ResetForFlash();
         // flash it
         ADCodeAperture.FlashApertureForGCodePlot(isoPlotBuilder, stateMachine, x1, y1, xyComp);
     }
     catch (Exception ex)
     {
         // rethrow with line number
         throw new Exception("Line Number:" + LineNumber.ToString() + ", " + ex.Message);
     }
 }
コード例 #4
0
 /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
 /// <summary>
 /// If we fill a shape with the aperture at the current coordinates. This
 /// simulates the aperture flash of a Gerber plotter
 /// </summary>
 /// <param name="graphicsObj">a graphics object to draw on</param>
 /// <param name="workingBrush">a brush to draw with</param>
 /// <param name="x1">the x center value</param>
 /// <param name="y1">the y center value</param>
 /// <returns>z success, nz fail</returns>
 public void FlashApertureForGerberPlot(GerberFileStateMachine stateMachine, Graphics graphicsObj, Brush workingBrush, float x1, float y1)
 {
     if (ADCodeAperture == null)
     {
         return;
     }
     try
     {
         // macros need to reset
         ADCodeAperture.ResetForFlash();
         // flash it
         ADCodeAperture.FlashApertureForGerberPlot(stateMachine, graphicsObj, workingBrush, x1, y1);
     }
     catch (Exception ex)
     {
         // rethrow with line number
         throw new Exception("Line Number:" + LineNumber.ToString() + ", " + ex.Message);
     }
 }