示例#1
0
        /// <summary>
        /// Loads the PNG bitmap contained by the file filename and returns it inside a <see cref="BitmapScanner"/> class.
        /// </summary>
        /// <param name="filename">Filename of the PNG file.</param>
        /// <returns>A <see cref="BitmapScanner"/> object containing the loaded bitmap.</returns>
        private static BitmapScanner LoadAndScan(string filename)
        {
            MonochromeBitmapAccessor layer = new MonochromeBitmapAccessor(filename);

            Console.WriteLine($"Loading {filename}");

            var result = new BitmapScanner(layer);

            result.PrepareAll();
            return(result);
        }
示例#2
0
        /// <summary>
        /// Generates the links to the external bitmaps in the HTML file.
        /// </summary>
        /// <param name="scanner">The bitmap scanner to be used.</param>
        /// <param name="path">The pathname of the PNG file to be scanned.</param>
        /// <returns>A list of strings containing the HTML lines with the net lists.</returns>
        private static List <string> GenerateNetLinks(BitmapScanner scanner, string path)
        {
            var result = new List <string>();
            int line   = 1;

            foreach (int netId in scanner.GetNetIds())
            {
                result.Add($"<option value=\"{path}/Net_{line}.png\">Net_{line}</option>");
                line++;
            }

            return(result);
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DrillScanner"/> class.
 /// </summary>
 /// <param name="drillBitmap">BitmapScanner that has already processed the drill bitmap.</param>
 public DrillScanner(BitmapScanner drillBitmap)
 {
     this.drillBitmap = drillBitmap;
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DrillConnector"/> class.
 /// This class builds the connection between nets on the top and bottom layers of the PCB by means
 /// of the drills layer.
 /// </summary>
 /// <param name="top">BitmapScanner of the top layer.</param>
 /// <param name="bottom">BitmapScanner of the bottom layer layer.</param>
 /// <param name="drill">DrillScanner of the drill layer.</param>
 public DrillConnector(BitmapScanner top, BitmapScanner bottom, DrillScanner drill)
 {
     this.top    = top;
     this.bottom = bottom;
     this.drill  = drill;
 }