diff --git a/KiBOM_CLI.py b/KiBOM_CLI.py index 318697a..6c2988c 100755 --- a/KiBOM_CLI.py +++ b/KiBOM_CLI.py @@ -8,7 +8,7 @@ - Components are automatically grouped into BoM rows (grouping is configurable) - Component groups count number of components and list component designators - Rows are automatically sorted by component reference(s) - - Supports board revisions + - Supports board variants Extended options are available in the "bom.ini" config file in the PCB directory (this file is auto-generated with default options the first time the script is executed). @@ -60,7 +60,7 @@ def isExtensionSupported(filename): parser.add_argument("output", default="", help='BoM output file name.\nUse "%%O" when running from within KiCad to use the default output name (csv file).\nFor e.g. HTML output, use "%%O.html"') parser.add_argument("-n", "--number", help="Number of boards to build (default = 1)", type=int, default=1) parser.add_argument("-v", "--verbose", help="Enable verbose output", action='count') -parser.add_argument("-r", "--revision", help="Board variant, used to determine which components are output to the BoM", type=str, default=None) +parser.add_argument("-r", "--variant", help="Board variant, used to determine which components are output to the BoM", type=str, default=None) parser.add_argument("--cfg", help="BoM config file (script will try to use 'bom.ini' if not specified here)") parser.add_argument("-s","--separator",help="CSV Separator (default ',')",type=str, default=None) @@ -99,9 +99,9 @@ def isExtensionSupported(filename): pref.boards = args.number pref.separatorCSV = args.separator -if args.revision is not None: - pref.pcbConfig = args.revision - print("PCB Revision:",args.revision) +if args.variant is not None: + pref.pcbConfig = args.variant + print("PCB variant:", args.variant) #write preference file back out (first run will generate a file with default preferences) if not have_cfile: diff --git a/README.md b/README.md index d2696a1..eb52074 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ The *KiBOM_CLI* script can be run directly from KiCad or from the command line. `python KiBOM_CLI.py -h` ~~~~ +usage: KiBOM_CLI.py [-h] [-n NUMBER] [-v] [-r VARIANT] [--cfg CFG] + [-s SEPARATOR] + netlist output + KiBOM Bill of Materials generator script positional arguments: @@ -30,12 +34,14 @@ optional arguments: -n NUMBER, --number NUMBER Number of boards to build (default = 1) -v, --verbose Enable verbose output - -r REVISION, --revision REVISION + -r VARIANT, --variant VARIANT Board variant, used to determine which components are output to the BoM --cfg CFG BoM config file (script will try to use 'bom.ini' if not specified here) -s SEPARATOR, --separator SEPARATOR + CSV Separator (default ',') + ~~~~ @@ -52,7 +58,7 @@ optional arguments: **-v --verbose** Enable extra debugging information -**-r --revision** Specify the PCB *revision*. Support for arbitrary PCB configurations allows individual components to be marked as 'fitted' or 'not fitted' in a given configuration. +**-r --variant** Specify the PCB *variant*. Support for arbitrary PCB variants allows individual components to be marked as 'fitted' or 'not fitted' in a given variant. **--cfg** If provided, this is the BOM config file that will be used. If not provided, options will be loaded from "bom.ini" @@ -133,17 +139,17 @@ To specify a part as DNF (do not fit), the *fit_field* field can be set to one o If the *Value* field for the component contains any of these values, the component will also not be included -**PCB Configurations** +**PCB Variants** -To generate a BoM with a custom *Configuration*, the --revision flag can be used at the command line to specify which revision/configuration is to be used. +To generate a BoM with a custom *Variant*, the --variant flag can be used at the command line to specify which variant is to be used. -If a revision is specified, the value of the *fit_field* field is used to determine if a component will be included in the BoM, as follows: +If a variant is specified, the value of the *fit_field* field is used to determine if a component will be included in the BoM, as follows: -* If the *fit_field* value is empty / blank then it will be loaded in ALL configuration. -* If the *fit_field* begins with a '-' character, if will be excluded from the matching configuration. -* If the *fit_field* begins with a '+' character, if will ONLY be included in the matching configuration. +* If the *fit_field* value is empty / blank then it will be loaded in ALL variants. +* If the *fit_field* begins with a '-' character, if will be excluded from the matching variant. +* If the *fit_field* begins with a '+' character, if will ONLY be included in the matching variant. -Multiple configurations can be addressed as the *fit_field* can contain multiple comma-separated values. +Multiple variants can be addressed as the *fit_field* can contain multiple comma-separated values. e.g. if we have a PCB with three components that have the following values in the *fit_field* field: @@ -151,9 +157,9 @@ e.g. if we have a PCB with three components that have the following values in th * C2 -> "+production" * R1 -> "" -If the script is run with the flag *--revision production* then C2 and R1 will be loaded. +If the script is run with the flag *--variant production* then C2 and R1 will be loaded. -If the script is run without the *--revision production* flag, then C1 and R1 will be loaded +If the script is run without the *--variant production* flag, then C1 and R1 will be loaded ### Regular Expression Matching