# KiBot BOM Output Group

kibot:
  version: 1

groups:
  - name: bom
    outputs:
      - @NAME_CSV_BOM_OUTPUT@
      - @NAME_HTML_BOM_OUTPUT@
      - @NAME_HTML_IBOM_OUTPUT@

outputs:
  - name: @NAME_CSV_BOM_OUTPUT@
    comment: Bill of Materials in CSV format
    type: bom
    category: '@DIR@'
    dir: '@DIR@'
    options:
      format: CSV
      csv:
        hide_pcb_info: true
        hide_stats_info: true

      group_fields: ['@MPN_FIELD@', '@IPN_FIELD@', 'Value']
      columns:
        - "Row"
        - "Quantity Per PCB"
        - "References"
        - "Value"
        - "Datasheet"
        - "Footprint"
        - "Description"
        - "@IPN_FIELD@"
        - "@MFG_FIELD@"
        - "@MPN_FIELD@"
        - "LCSC"

  - name: @NAME_HTML_BOM_OUTPUT@
    comment: Bill of Materials in HTML format
    type: bom
    category: '@DIR@'
    dir: '@DIR@'
    options:
      format: HTML
      html:
        title: 'Bill of Materials'
        datasheet_as_link: "Datasheet"
        lcsc_link: true
        logo: false
        style: modern-blue

      group_fields: ['@MPN_FIELD@', '@IPN_FIELD@', 'Value']
      columns:
        - "Row"
        - "Quantity Per PCB"
        - "References"
        - "Value"
        - "Datasheet"
        - "Footprint"
        - "Description"
        - "@IPN_FIELD@"
        - "@MFG_FIELD@"
        - "@MPN_FIELD@"
        - "LCSC"

  - name: @NAME_HTML_IBOM_OUTPUT@
    comment: Interactive Bill of Materials in HTML Format
    type: ibom
    dir: '@DIR@'
    category: '@DIR@'
    options:
      # extra_data_file: '%F.net'
      dark_mode: true
      show_fields: 'Value,Footprint,@IPN_FIELD@,@MPN_FIELD@'
      group_fields: 'Value,@IPN_FIELD@,@MPN_FIELD@'
      show_fabrication: true
      highlight_pin1: "selected"
      exclude_filter: '@EXCLUDE_FILTER@'
      hide_excluded: true
      forced_name: '@IBOM_TITLE@'
      mark_when_checked: 'Placed'

...
definitions:
  # Output Directory
  DIR: +manufacturing/assembly

  # Output Names
  NAME_CSV_BOM_OUTPUT: csv_bom
  NAME_HTML_BOM_OUTPUT: html_bom
  NAME_HTML_IBOM_OUTPUT: html_bom_interactive

  # BOM Configuration
  IPN_FIELD: 'Asymworks IPN'
  MFG_FIELD: 'Manufacturer PN'
  MPN_FIELD: 'Manufacturer'
  IBOM_TITLE: ''
  EXCLUDE_FILTER: exclude_testpoints
