Index: trunk/doc/user/09_appendix/action_details.html =================================================================== --- trunk/doc/user/09_appendix/action_details.html (revision 20642) +++ trunk/doc/user/09_appendix/action_details.html (revision 20643) @@ -622,6 +622,198 @@

Prompts the user for a coordinate, if one is not already selected. +

import

+

+Imports subcircuits and netlist data from the schematics (or some other source). The first parameter, which is optional, is the mode. If not specified, the + +import::mode + + attribute in the board is used. Possible values: + +gnetlist + + means gnetlist is used to obtain the information from the schematics; + +make + + invokes make, assuming the user has a Makefile in the current directory. The Makefile will be invoked with the following variables set: +

+ + + + + + + + + +
+PCB + + The name of the .pcb file +
+ SRCLIST + + A space-separated list of source files +
+ OUT + + The name of the file in which to put the command script, which may contain any @pcb{} actions. By default, this is a temporary file selected by @pcb{}, but if you specify an + +import::outfile + + attribute, that file name is used instead (and not automatically deleted afterwards). +
+ +

+ The target specified to be built is the first of these that apply: +

+ +

+ If you specify an + +import::makefile + + attribute, then "-f + +that file + +" will be added to the command line. +

+ If you specify the mode, you may also specify the source files (schematics). If you do not specify any, the list of schematics is obtained by reading the + +import::srcN + + attributes (like + +import::src0 + +, + +import::src1 + +, etc). +

+ For compatibility with future extensions to the import file format, the generated file + +must not + + start with the two characters #%. +

+ If a temporary file is needed the + +TMPDIR + + environment variable is used to select its location. +

+ Note that the programs + +gnetlist + + and + +make + + must be configured. +

+ If pcb-rnd cannot determine which schematic(s) to import from, the GUI is called to let user choose (see +importgui() +). +

+ Note that +import() + doesn't delete anything - after an Import, subcircuits which shouldn't be on the board are selected and may be removed once it's determined that the deletion is appropriate. TODO: is this still true? +

+ If +import() + is called with +setnewpoint +, then the location of new components can be specified. This is where parts show up when they're added to the board. The default is the center of the board. Argument combinations: +

+ + + + + + + + + + + +
+ Import(setnewpoint) + + Prompts the user to click on the board somewhere, uses that point. If called by a hotkey, uses the current location of the crosshair. +
+ Import(setnewpoint,mark) + + Uses the location of the mark. If no mark is present, the point is not changed. +
+ Import(setnewpoint,center) + + Resets the point to the center of the board. +
+ Import(setnewpoint,X,Y,units) + + Sets the point to the specific coordinates given. +
+ + +Import(setnewpoint,50,25,mm) + + +
+ +

+ Note that the +X + and +Y + locations are stored in attributes named + +import::newX + + and + +import::newY} + + so you could change them manually if you wished. +

+ Calling + +Import(setdisperse,D,units) + + sets how much the newly placed subcircuits are dispersed relative to the set point. For example, + +Import(setdisperse,10,mm) + + will offset each part randomly up to 10mm away from the point. The default dispersion is 1/10th of the smallest board dimension. Dispersion is saved in the + +import::disperse + + attribute. +

l

Loads a new datafile (layout) and, if confirmed, overwrites any existing unsaved data. If no filename is specified a file select box will popup. Index: trunk/doc/user/09_appendix/action_reference.html =================================================================== --- trunk/doc/user/09_appendix/action_reference.html (revision 20642) +++ trunk/doc/user/09_appendix/action_reference.html (revision 20643) @@ -12,7 +12,7 @@

Action Reference

@@ -99,7 +99,7 @@ - + @@ -244,10 +244,10 @@ - - + + - + @@ -264,14 +264,14 @@ - + - + - + @@ -284,8 +284,8 @@ - - + +
\n -This is pcb-rnd 2.0.0 (svn r18442) an interactive printed circuit board editor , Revision: 20632 +This is pcb-rnd 2.0.0 (svn r18442) an interactive printed circuit board editor , Revision: 20642
Action Description Syntax Plugin
AboutPresent the about boxAbout()dialogs plugin
GlobalPullerPull all traces tight.pcb_act_GlobalPuller([Found|Selected])puller plugin
GridSet the grid.grid(set, [name:]size[@offs][!unit])
grid(+|up)
grid(-|down)
grid(#N)
grid(idx, N)
GroupPropGuiChange group flags and propertiesGroupPropGui(groupid)dialogs plugin
ImportImport schematics.Import()
Import([gnetlist|make[,source,source,...]])
Import(setnewpoint[,(mark|center|X,Y)])
Import(setdisperse,D,units)
import_sch plugin
ImportImport schematics.Import()
Import([gnetlist|make[,source,source,...]])
Import(setnewpoint[,(mark|center|X,Y)])
Import(setdisperse,D,units)
import_sch plugin
ImportcpcbFromLoads the auto-routed tracks from the specified c-pcb output.ImportcpcbFrom(filename)cpcb plugin
LayerBindingChange the layer binding.LayerBinding(object)
LayerBinding(selected)
LayerBinding(buffer)
dialogs plugin
LayerPropGuiChange layer flags and propertiesLayerPropGui(layerid)dialogs plugin
javascriptExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
jostleMake room by moving wires away.Jostle(diameter)jostle plugin
jsExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
lLoads layout data.l [name] [format]shand_cmd plugin
leLoads an element (subcircuit, footprint) into the current buffer.le [name]shand_cmd plugin
lLoads layout data.l [name] [format]shand_cmd plugin
leLoads an element (subcircuit, footprint) into the current buffer.le [name]shand_cmd plugin
luaExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
mLoads a layout into the current buffer.m [name]shand_cmd plugin
mLoads a layout into the current buffer.m [name]shand_cmd plugin
mawkExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
meshgenerate a mesh for simulationmesh()openems HID
millCalculate toolpath for milling away coppermill()millpath plugin
pyExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
pythonExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
q!Quits the application without confirming.q!shand_cmd plugin
qQuits the application after confirming.qshand_cmd plugin
qQuits the application after confirming.qshand_cmd plugin
queryPerform various queries on PCB data.query(dump, expr) - dry run: compile and dump an expression
regpolyGenerate regular polygon. Where is x;y and radius is either r or rx;ry. Rotation is in degrees.regpoly([where,] corners, radius [,rotation])shape plugin
rehashReload all gpmi scriptsTODOGPMI plugin cookie
rnReads netlist.rn [name]shand_cmd plugin
rnReads netlist.rn [name]shand_cmd plugin
roundrectGenerate a rectangle with round cornersroundrect([where,] width[;height] [,rx[;ry] [,rotation]])shape plugin
rubyExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
sSaves layout data.s [name]
w [name]
shand_cmd plugin
sSaves layout data.s [name]
w [name]
shand_cmd plugin
shapeInteractive shape generator.shape()shape plugin
sklineTool for drawing sketch linesskline()sketch_route plugin
skretriangulateReconstruct CDT on all layer groupsskretriangulate()sketch_route plugin
tangDraw a line to be tangential to a circletang()ddraft plugin
tclExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
trimUse one or more objects as cutting edge and trim or split other objects. First argument is the cutting edgetrim([selected|found|object], [selected|found|object])
split([selected|found|object], [selected|found|object])
ddraft plugin
wSaves layout data.s [name]
w [name]
shand_cmd plugin
wqSaves the layout data and quits.wqshand_cmd plugin
wSaves layout data.s [name]
w [name]
shand_cmd plugin
wqSaves the layout data and quits.wqshand_cmd plugin
Index: trunk/doc/user/09_appendix/action_src/import.html =================================================================== --- trunk/doc/user/09_appendix/action_src/import.html (nonexistent) +++ trunk/doc/user/09_appendix/action_src/import.html (revision 20643) @@ -0,0 +1,94 @@ +Imports subcircuits and netlist data from the schematics (or some other +source). The first parameter, which is optional, is the mode. If not +specified, the import::mode attribute in the board is used. +Possible values: +gnetlist means gnetlist is used to obtain the information from +the schematics; make invokes make, assuming the user +has a Makefile in the current directory. The Makefile +will be invoked with the following variables set: +

+ + +
PCB + The name of the .pcb file + +
SRCLIST + A space-separated list of source files + +
OUT + The name of the file in which to put the command script, which may + contain any @pcb{} actions. By default, this is a temporary file + selected by @pcb{}, but if you specify an import::outfile + attribute, that file name is used instead (and not automatically + deleted afterwards). +
+

+The target specified to be built is the first of these that apply: + +

+ +

+If you specify an import::makefile attribute, then "-f that +file" will be added to the command line. +

+If you specify the mode, you may also specify the source files +(schematics). If you do not specify any, the list of schematics is +obtained by reading the import::srcN attributes (like +import::src0, import::src1, etc). +

+For compatibility with future extensions to the import file format, +the generated file must not start with the two characters +#%. +

+If a temporary file is needed the TMPDIR environment variable +is used to select its location. +

+Note that the programs gnetlist and make must be +configured. +

+If pcb-rnd cannot determine which schematic(s) to import from, the GUI +is called to let user choose (see ImportGUI()). +

+Note that Import() doesn't delete anything - after an Import, subcircuits +which shouldn't be on the board are selected and may be removed once +it's determined that the deletion is appropriate. TODO: is this still true? +

+If Import() is called with setnewpoint, then the location +of new components can be specified. This is where parts show up when +they're added to the board. The default is the center of the board. + +Argument combinations: +

+ +
Import(setnewpoint) + Prompts the user to click on the board somewhere, uses that point. If + called by a hotkey, uses the current location of the crosshair. + +
Import(setnewpoint,mark) + Uses the location of the mark. If no mark is present, the point is + not changed. + +
Import(setnewpoint,center) + Resets the point to the center of the board. + +
Import(setnewpoint,X,Y,units) + Sets the point to the specific coordinates given.
+ Import(setnewpoint,50,25,mm) + +
+ +

+Note that the X and Y locations are stored in attributes named +import::newX and import::newY} so you could change them +manually if you wished. +

+Calling Import(setdisperse,D,units) sets how much the newly +placed subcircuits are dispersed relative to the set point. For example, +Import(setdisperse,10,mm) will offset each part randomly up to +10mm away from the point. The default dispersion is 1/10th of the +smallest board dimension. Dispersion is saved in the +import::disperse attribute. Index: trunk/src_plugins/import_sch/import_sch.c =================================================================== --- trunk/src_plugins/import_sch/import_sch.c (revision 20642) +++ trunk/src_plugins/import_sch/import_sch.c (revision 20643) @@ -61,122 +61,13 @@ extern fgw_error_t pcb_act_ExecuteFile(fgw_arg_t *ores, int oargc, fgw_arg_t *oargv); -/* ---------------------------------------------------------------- */ static const char pcb_acts_Import[] = "Import()\n" - "Import([gnetlist|make[,source,source,...]])\n" "Import(setnewpoint[,(mark|center|X,Y)])\n" "Import(setdisperse,D,units)\n"; - + "Import([gnetlist|make[,source,source,...]])\n" + "Import(setnewpoint[,(mark|center|X,Y)])\n" + "Import(setdisperse,D,units)\n"; static const char pcb_acth_Import[] = "Import schematics."; - -/* %start-doc actions Import - -Imports subcircuits and netlist data from the schematics (or some other -source). The first parameter, which is optional, is the mode. If not -specified, the @code{import::mode} attribute in the PCB is used. -@code{gnetlist} means gnetlist is used to obtain the information from -the schematics. @code{make} invokes @code{make}, assuming the user -has a @code{Makefile} in the current directory. The @code{Makefile} -will be invoked with the following variables set: - -@table @code - -@item PCB -The name of the .pcb file - -@item SRCLIST -A space-separated list of source files - -@item OUT -The name of the file in which to put the command script, which may -contain any @pcb{} actions. By default, this is a temporary file -selected by @pcb{}, but if you specify an @code{import::outfile} -attribute, that file name is used instead (and not automatically -deleted afterwards). - -@end table - -The target specified to be built is the first of these that apply: - -@itemize @bullet - -@item -The target specified by an @code{import::target} attribute. - -@item -The output file specified by an @code{import::outfile} attribute. - -@item -If nothing else is specified, the target is @code{pcb_import}. - -@end itemize - -If you specify an @code{import::makefile} attribute, then "-f " will be added to the command line. - -If you specify the mode, you may also specify the source files -(schematics). If you do not specify any, the list of schematics is -obtained by reading the @code{import::src@var{N}} attributes (like -@code{import::src0}, @code{import::src1}, etc). - -For compatibility with future extensions to the import file format, -the generated file @emph{must not} start with the two characters -@code{#%}. - -If a temporary file is needed the @code{TMPDIR} environment variable -is used to select its location. -*/ - -/* -Note that the programs @code{gnetlist} and @code{make} must be -configured. - -If @pcb{} cannot determine which schematic(s) to import from, the GUI -is called to let user choose (see @code{ImportGUI()}). - -Note that Import() doesn't delete anything - after an Import, subcircuits -which shouldn't be on the board are selected and may be removed once -it's determined that the deletion is appropriate. - -If @code{Import()} is called with @code{setnewpoint}, then the location -of new components can be specified. This is where parts show up when -they're added to the board. The default is the center of the board. - -@table @code - -@item Import(setnewpoint) - -Prompts the user to click on the board somewhere, uses that point. If -called by a hotkey, uses the current location of the crosshair. - -@item Import(setnewpoint,mark) - -Uses the location of the mark. If no mark is present, the point is -not changed. - -@item Import(setnewpoint,center) - -Resets the point to the center of the board. - -@item Import(setnewpoint,X,Y,units) - -Sets the point to the specific coordinates given. Example: -@code{Import(setnewpoint,50,25,mm)} - -@end table - -Note that the X and Y locations are stored in attributes named -@code{import::newX} and @code{import::newY} so you could change them -manually if you wished. - -Calling @code{Import(setdisperse,D,units)} sets how much the newly -placed subcircuits are dispersed relative to the set point. For example, -@code{Import(setdisperse,10,mm)} will offset each part randomly up to -10mm away from the point. The default dispersion is 1/10th of the -smallest board dimension. Dispersion is saved in the -@code{import::disperse} attribute. - -%end-doc */ - +/* DOC: import.html */ static fgw_error_t pcb_act_Import(fgw_arg_t *res, int argc, fgw_arg_t *argv) { const char *mode = NULL;