# KiBot Drawing Tables Output Group

kibot:
  version: 1

groups:
  - name: tables
    outputs:
      - @NAME_CSV_IMPEDANCE_TABLE_OUTPUT@
      - @NAME_CSV_COMP_COUNT_OUPUT@
      - @NAME_CSV_DRILL_TABLE_OUTPUT@
      - @NAME_CSV_TP_OUTPUT@
      - @NAME_CSV_TP_TOP_OUTPUT@
      - @NAME_CSV_TP_BOTTOM_OUTPUT@

import:

  # Impedance and Component Count Reports
  - file: outputs/kibot_out_csv_report.yaml
    definitions:
      NAME: @NAME_CSV_IMPEDANCE_TABLE_OUTPUT@
      COMMENT: Impedance Table in CSV format
      DIR: @FABRICATION_DIR@
      OUTPUT_ID: impedance_table
      TEMPLATE: @IMPEDANCE_TABLE_TEMPLATE@

  - file: outputs/kibot_out_csv_report.yaml
    definitions:
      NAME: @NAME_CSV_COMP_COUNT_OUPUT@
      COMMENT: Component Report in CSV format
      DIR: @ASSEMBLY_DIR@
      OUTPUT_ID: components_count
      TEMPLATE: total_components

  # CSV Test Point Files
  - file: outputs/kibot_out_csv_testpoints.yaml
    definitions:
      NAME: @NAME_CSV_TP_OUTPUT@
      COMMENT: Testpoint report in CSV format
      DIR: @TESTPOINTS_DIR@
      EXCLUDE_FILTER: @FILT_TP_ONLY@

  - file: outputs/kibot_out_csv_testpoints_simple.yaml
    definitions:
      NAME: @NAME_CSV_TP_TOP_OUTPUT@
      COMMENT: Top testpoint report in CSV format
      DIR: @TESTPOINTS_DIR@
      SUFFIX: -top
      EXCLUDE_FILTER: @FILT_TP_TOP_ONLY@

  - file: outputs/kibot_out_csv_testpoints_simple.yaml
    definitions:
      NAME: @NAME_CSV_TP_BOTTOM_OUTPUT@
      COMMENT: Bottom testpoint report in CSV format
      DIR: @TESTPOINTS_DIR@
      SUFFIX: -bottom
      EXCLUDE_FILTER: @FILT_TP_BOTTOM_ONLY@

outputs:
  - name: @NAME_CSV_DRILL_TABLE_OUTPUT@
    comment: Drill Table in CSV format
    type: excellon
    category: '@DRILL_TABLE_DIR@'
    dir: '@DRILL_TABLE_DIR@'
    options:
      generate_drill_files: false
      table:
        unify_pth_and_npth: '@DRILL_TABLE_UNIFY_PTH_NPTH@'
        group_slots_and_round_holes: @DRILL_TABLE_GROUP_ROUND_SLOTS@

...
definitions:
  # Directories
  FABRICATION_DIR: manufacturing/fabrication
  DRILL_TABLE_DIR: manufacturing/fabrication/drill-tables
  ASSEMBLY_DIR: manufacturing/assembly
  TESTPOINTS_DIR: test/testpoints

  # Output Names
  NAME_CSV_IMPEDANCE_TABLE_OUTPUT: csv_impedance_table
  NAME_CSV_COMP_COUNT_OUPUT: csv_comp_count
  NAME_CSV_DRILL_TABLE_OUTPUT: csv_drill_table
  NAME_CSV_TP_OUTPUT: csv_testpoints
  NAME_CSV_TP_TOP_OUTPUT: csv_testpoints_top
  NAME_CSV_TP_BOTTOM_OUTPUT: csv_testpoints_bottom

  # Table Configuration
  IMPEDANCE_TABLE_TEMPLATE: notes/impedance-table.txt
  DRILL_TABLE_UNIFY_PTH_NPTH: 'yes'
  DRILL_TABLE_GROUP_ROUND_SLOTS: True
  FILT_TP_ONLY: only_testpoints
  FILT_TP_TOP_ONLY: only_testpoints_top
  FILT_TP_BOTTOM_ONLY: only_testpoints_bottom
