Production Dox Module (tendril.dox.production)

This module provides functions to generate production related documentation. The functions here use the tendril.dox.render module to actually produce the output files after constructing the appropriate stage.

See also

tendril.dox

Document Generators

gen_pcb_am(configname, outfolder[, sno, ...]) Generates a PCB Assembly Manifest for a ‘card’, a card being defined as a gEDA project, with a specified configname.
gen_production_order(outfolder, prod_sno, ...) Generates a Production Order for a production order defined in a .yaml file.
tendril.dox.production.gen_pcb_am(configname, outfolder, sno=None, productionorderno=None, indentsno=None, scaffold=False, verbose=True, session=None)[source]

Generates a PCB Assembly Manifest for a ‘card’, a card being defined as a gEDA project, with a specified configname.

In the present implementation, the project could provide either a PCB or a Cable.

  • In case the project provides the card, the schematic for the cable is included along with the assembly manifest.
  • In case the project provides a PCB, the schematic is not included with the assembly manifest.

This behavior is not really intuitive nor universally desirable. This rationale should be changed to something that makes more sense.

Note

This function does not register the document in the tendril.dox.docstore. You should use the output file path (returned by this function) to register the document when desired.

See also

Todo

Update this function to also handle registering once the main scripts are better integrated into the core.

Parameters:
  • configname (str) – The name of the project configuration to use.
  • outfolder (str) – The folder within which the output file should be created.
  • sno (str) – The serial number of the card for which you want the Assembly Manifest.
  • productionorderno (str) – The serial number of the Production Order for the card.
  • indentsno (str) – The serial number of the Stock Indent which accounts for the components used in this card.
Returns:

The path of the generated file.

Template Used

tendril/dox/templates/production/pcb-assem-manifest.tex (Included version)

Stage Keys Provided

sno The serial number of the card.
configname The configuration name of the card.
pcbname The name of the PCB provided by the gEDA project.
title Whether the device is a PCB or a Cable.
desc The description of the card.
lines List of tendril.boms.outputbase.OutputBomLine instances.
stockindent The serial number of the Stock Indent which accounts for the components used in this card.
productionorderno The serial number of the Production Order for the card.
repopath The root of the VCS repository which contains the gEDA project.
evenpages Whether to render PDF with even number of pages by adding an extra page if needed (useful for bulk printing).
tendril.dox.production.gen_delta_pcb_am(orig_cardname, target_cardname, outfolder=None, sno=None, productionorderno=None, indentsno=None, scaffold=False, verbose=True, session=None)[source]

Generates a Delta PCB Assembly Manifest for converting one card to another. This is typically only useful when the two cards are very closely related and use the same PCB..

In the present implementation, the cardname could represent either a PCB or a Cable.

Note

This function does not register the document in the tendril.dox.docstore. You should use the output file path (returned by this function) to register the document when desired.

See also

Todo

Update this function to also handle registering once the main scripts are better integrated into the core.

Parameters:
  • orig_cardname (str) – The name of the original card. This should be present in entityhub.projects.cards
  • target_cardname (str) – The name of the target card. This should be present in entityhub.projects.cards
  • outfolder (str) – The folder within which the output file should be created.
  • sno (str) – The serial number of the card for which you want the Delta Assembly Manifest.
  • productionorderno (str) – The serial number of the Production Order for the modification.
  • indentsno (str) – The serial number of the Stock Indent which accounts for the components used in this card.
Returns:

The path of the generated file.

Template Used

tendril/dox/templates/production/delta-assem-manifest.tex (Included version)

Stage Keys Provided

sno The serial number of the card.
orig_configname The configuration name of the original card.
target_configname The configuration name of the target card.
pcbname The name of the original PCB.
title Whether the device is a PCB or a Cable.
desc The description of the modification.
addition_lines List of tendril.boms.outputbase.OutputBomLine instances.
subtraction_lines List of tendril.boms.outputbase.OutputBomLine instances.
stockindent The serial number of the Stock Indent which accounts for the components used in this card.
productionorderno The serial number of the Production Order for the card.
original_repopath The root of the VCS repository which contains the original gEDA project.
target_repopath The root of the VCS repository which contains the target gEDA project.
evenpages Whether to render PDF with even number of pages by adding an extra page if needed (useful for bulk printing).
tendril.dox.production.gen_production_order(outfolder, prod_sno, sourcedata, snos, sourcing_orders=None, root_orders=None, verbose=True)[source]

Generates a Production Order for a production order defined in a .yaml file.

Note

This function does not register the document in the tendril.dox.docstore. You should use the output file path (returned by this function) to register the document when desired.

Todo

Update this function to also handle registering once the main scripts are better integrated into the core.

Todo

Document the format of the .yaml file.

Parameters:
  • outfolder (str) – The folder within which the output file should be created.
  • prod_sno (str) – The serial number of the Production Order to generate.
  • sourcedata (dict) – The source data loaded from a .yaml file.
  • snos (list of dict) – A list of serial numbers to produce, along with whatever other information should be included in the order. See the template for details.
  • sourcing_orders (list of str) – A list of sourcing orders which were made to obtain raw materials for this production order.
  • root_orders (list of str) – A list of root orders which is production order is intended to fulfill.
Returns:

The path to the output PDF file.

Template Used

tendril\dox\templates\production\production-order-template.tex (Included version)

Stage Keys Provided

sno The serial number of the production order.
title The title of the production order.
cards A list of different card types to be produced, and quantities of each.
snos A list of cards to produce, with serial numbers and other included information.
sourcing_orders A list of sourcing orders which were made to obtain raw materials for this production order.
root_orders A list of root orders which is production order is intended to fulfill.
tendril.dox.production.get_production_order_manifest_set(serialno)[source]
tendril.dox.production.get_production_strategy(cardname)[source]
tendril.dox.production.get_all_prodution_order_snos(limit=None)[source]
tendril.dox.production.get_all_prodution_order_snos_strings(limit=None)[source]
tendril.dox.production.get_all_production_orders_docs(limit=None)[source]