The program is designed for automatic coloring schemes of printed circuit boards for ease of installation. For his work requires some files with information on the printed circuit board, package generated P-CAD. The basic principle: each type of component (identical components) are marked with a unique symbol that has its own color and style. This simplifies the visual search component on the board. The program also generates a text list of components, where the marks, what type of components is associated with which character on the circuit board.
Manual translated from automatic translator, sorry.
How to
For the program will require four (or three) input file:
1,2: the installation diagram in the blanks format dxf, obtained export silk layer in P-CAD layout of the original board. Want to save as separate files upper and lower layers of silk. To this end, P-CAD 2006 to choose File-> Export-> DXF, (for P-CAD 98 just File-> DXF), then select the desired layers (eg, board to board borders and Top Silk with silk-screen printing), remove the tick Output Drill Symbols, specify a file name (for example, top.dxf), leave the unit inch (Inch). Then press Ok. Similarly, to get the file bott.dxf with the bottom layer silk.
3,4. A text file with a list of components. For the P-CAD 2004/2006 will be one such file, for P-CAD 98 such files will be two: one half of the data, half in another.
In P-CAD 2004/2006 this file is generated as follows: File-> Reports. Select Panel Style Format: Separated List. List Separator set ";". Select the list of Component Locations (cpl), click Customize, Format tab, verify that the panel Separated List are two checkboxes. Add to the Selection tab of all the fields in the following order: RefDes, Layer, LocationX, LocationY, Rotation, Fixed, Type, Value. Click Ok. Select the file name buttons Filename (for example, "info" - the expansion of P-CAD to supply yourself), and click Generate.
In P-CAD 98, this file is generated similarly, but there is no information about the type and value of the component, but it is present in .atr file, which must also be generated. Therefore, for P-CAD 98 you need: click File->Reports. Select the checkbox of Attributes (it generates an .atr file) and Component Locations (cpl) file, select the file name of the buttons Filename (for example, "info" - extension of P-CAD to supply yourself), click Generate. We obtain two different files and info.cpl info.atr.
Move all three (or four for P-CAD 98) received the file in the folder with the program PCBColorizer.exe. Open a text editor (eg notepad) settings.xml file and specify the file names. For the above example:
<InCPLFileName value="info.cpl">
<InATRFileName value="info.atr">
<InTopDXFFileName value="top.dxf"/>
<InBottDXFFileName value="bott.dxf"/>
For the P-CAD 2006 atr file is not needed, you can leave any file name.
Specify the output file name (or leave default):
<OutDXFFileName value="out.dxf"/>
<OutHTMLFileName value="out.htm"/>
Set the number of produced circuit boards:
<NumberOfSchemas value="2"/>
All of the different types of components will be divided into a specified number of assembly diagrams. At each such scheme will be painted only their components. The number of circuits is greater than one is recommended to ask for complex circuits with many different components, so as not to get one color unreadable blot from a coloring scheme.
Other settings in most cases, no need to change.
Save and close the configuration file. Run this program PCBColorizer.
In the console window will display the progress of the program: run through the list of layers produced with different types of components will then be made up of layers of silk provided dxf files, then the program has finished its work, press any key to close the window.
The result will be in the specified output files (for example, the current is out.dxf and out.htm).
out.dxf can be opened in many programs to work with vector graphics: AutoCAD, CorelDraw, etc. By tuning of the program is mainly to work correctly with AutoCAD. In CorelDraw file is also opened correctly with proper choice of measurement units: inches (Inch).
out.htm a tabular list of components and their associated symbols on the chart. Can be opened in any browser. The table shows:
1. The serial number of the line
2. Type of component
3. Value
4. The number of components in the form of "top layer of the bottom layer + = all"
5. Vehicle installation diagram. When NumberOfSchemas set is greater than unity, then the number of generated assembly diagrams, each painted in its components. In the dxf file are numbered from left to right, with two figures (for the upper and lower layer) is considered a installation diagram. Thus, if, for example, this column is the number 2, then you need to search for components in the second image among the images of the upper layer and the second image among the images of the lower layer.
6. Enumeration of the names of the components in the form of "C1, C2, C3", etc.
Typical problems and troubleshooting
The same type of components of the program is treated as a different and painted in different colors.
Most likely, the project used different components of the library, where the components are marked a little differently. Open the file *.cpl (in a text editor or in MS Excel, changing the extension to csv). Problem for the components you can see something like the following picture:
"C32"; "Top"; "8326.8"; "15753.9"; "90.0"; "No"; "CC0805"; "0.1"
"C33"; "Top"; "8879.9"; "16002.0"; "180.0"; "No"; "CAP 0805", "0.1mkF"
As can be seen, firstly, indicated a different seat components ("CC0805" and "CAP 0805"), as well as one of the components is not necessary dimension. For correct operation of the program must be manually and automatically better than using the "replacement" of the editor used to bring all the same components of the same species.
Size of symbols on the chart is too big / small for my components
You can try to change settings related to the size of the symbol:
<SymbolLen value="0.07"/><SymbolLen value="0.07"/> - character length
<SymbolWidth value="0.02"/> - the thickness of the symbol
<LineWidth value="90"/>- thickness of lines character (in any conventional, unknown to the author (nonlinear?) Units from zero to 100)
The symbols on the coloring scheme for some components are crooked, off-center.
Yes, the characters grow from the first leg component and pulled to the side of the body components (information from the fields LocationX, LocationY, Rotation). The program does not know the size of the component or its center. Therefore, the symbols (if correctly configured, their size) will be located approximately near the center of dvuhvyvodnyh components of a typical size (eg, 0805 or 0603), for large and mnogovyvodnyh components of the symbol will be about the first leg. There is nothing you can do about it, but you can adapt and use for their own purposes (learning, where the first leg of the installation).
Different copies of the scheme (or top and bottom layers) crawl on each other in the output file
Change your settings:
<BottomSideOffset value="10"/> - offset relative to the top of the lower layer in the vertical
<SchemasOffset value="10"/> - the offset between copies of circuit diagrams for the horizontal
Line drawing characters on a very thin, the color is very difficult to discern.
First, check what you type (see) drawing of the light weight lines. Secondly, try to change the setting
<LineWidth value="90"/>
In the end, change the line thickness by means of a graphical editor ...
Dxf file in a layer of silk off-color symbols for the components for a considerable distance. A bunch of characters separately, installation diagram separately.
This problem is probably due to confusion on the scale of P-CAD: inches and millimeters. This program is tuned for all P-CAD setup by default as they are when you install the P-CAD. If you're somewhere in the options have changed something, it may turn out that the drawing is generated in inches and millimeters cpl file, or vice versa ... Try playing with the settings in the extent of P-CAD or ... simply result in an output smasshtabiruyte dxf file means your editor. There is still an opportunity to play setting
<ScaleDivider value="1000"/>
It also affects the relative positions of characters and the drawing itself.
In the dxf file contains artifacts, the extra characters in the distance from the main cheretezha (circles, dots, etc.), and the same design slightly changed from the original silk fiber P-CAD.
Yes, this is a consequence of shallow knowledge dxf format, the author of the program in future versions, perhaps, the situation will improve ... While I advise you not to pay attention ...
Technical design of the program
The program uses the library:
dxflib - http://www.ribbonsoft.com/en/what-is-dxflib
xmlParser
csv_parser
First, read xml file with the settings using xmlParser. Then open the file with text information about the components (cpl) file is read out and the first character. For the P-CAD 2006 is the first character of the letter R (from the word Report). For the P-CAD 98 first character - quote. Since the program determines which version of the cpl file in front of her. Next by csv_parser cpl file is read, and if the version of the P-CAD is defined as an old (98), then with him to read and atr file. After successfully reading the information about the components are sorted in alphabetical order of all components created using the text string Type + Value. The components of the same Type + Value is classified as the same type and are grouped. Then, for each group is assigned a symbol of the algorithm:
For each subsequent component is assigned the following colors (from the color table, read from the settings). When the colors run out, changing the type of character to the next (eg, "v" to "="). The colors begin to move again. In parallel, the measured number of types of components placed on the scheme. If the number of components is exceeded, the following shall be appointed a copy of the scheme, the symbols and colors of counters are reset. In total, the program incorporated 10 different characters. The product of number of characters on the number of colors must be greater than the types of items, passing on one installation diagram. Otherwise there will be the same native character of the same color, but identifying the different elements.
After all these procedures start generating function of the output dxf file. First, the layers are generated by drawing for each type of component with a layer of a different color. It then starts a cycle depicting the colorful characters on the components (each symbol in the appropriate layer corresponding to the coordinates). After drawing the character input open dxf files with silkscreen, and copied to the output dfx drawing on the zero layer with zero thickness. In this bottom layer is shifted down and inverted BottomSideOffset coordinate X, so that installation diagram looks like the installer sees the opposite side of the board, not as it appears in the P-CAD. The operation is repeated several times if user is not given a single value NumberOfSchemas. In addition, each copy is shifted to the next SchemasOffset. It should be borne in mind that dxflib has no direct copying of the drawing functions, but only its parsing'a with the subsequent issuance of the coordinates of objects. Therefore it is necessary to re-essentially redraw the drawing board, using the coordinates of the issued dxflib. As a consequence, there may be some defects due to the redrawing of knowledge is very superficial dxf format, the author of this program. After generating the dxf file should be generated html tables with components in plain text without the use of libraries.
The program terminates.
It is also noteworthy work with colors. In AutoCAD has its own table of 255 colors, where they took out all the ... there is some kind of custom colors. Table numbers match the color and its RGB representation lies in the form of a table in the program and is taken from the "AutoCAD Color to RGB.html", watch it here somewhere in the folder. From these I selected the colors avtokadovskih more ... some of his color, which seemed to me the most colorful :) The list of numbers of colors available in the settings. You can change both the number of colors, and their number. In my inkjet printer more than 8 colors to distinguish between hard, so I left 8.