parent
f6dac6ef13
commit
34e85d646c
|
|
@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- [PCBWay](https://www.pcbway.com)
|
- [PCBWay](https://www.pcbway.com)
|
||||||
- Support for ZIP/TAR/RAR generation.
|
- Support for ZIP/TAR/RAR generation.
|
||||||
- Makefile generation.
|
- Makefile generation.
|
||||||
|
- KiAuto time-out control.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Now the default output name applies to the DRC and ERC report names.
|
- Now the default output name applies to the DRC and ERC report names.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2020 Salvador E. Tropea
|
# Copyright (c) 2020-2021 Salvador E. Tropea
|
||||||
# Copyright (c) 2020 Instituto Nacional de Tecnología Industrial
|
# Copyright (c) 2020-2021 Instituto Nacional de Tecnología Industrial
|
||||||
# Copyright (c) 2018 John Beard
|
# Copyright (c) 2018 John Beard
|
||||||
# License: GPL-3.0
|
# License: GPL-3.0
|
||||||
# Project: KiBot (formerly KiPlot)
|
# Project: KiBot (formerly KiPlot)
|
||||||
|
|
@ -184,6 +184,8 @@ class CfgYamlReader(object):
|
||||||
# Transfer command line global overwrites
|
# Transfer command line global overwrites
|
||||||
GS.global_output = GS.global_from_cli.get('output', None)
|
GS.global_output = GS.global_from_cli.get('output', None)
|
||||||
GS.global_variant = GS.global_from_cli.get('variant', None)
|
GS.global_variant = GS.global_from_cli.get('variant', None)
|
||||||
|
GS.global_kiauto_wait_start = GS.global_from_cli.get('kiauto_wait_start', None)
|
||||||
|
GS.global_kiauto_time_out_scale = GS.global_from_cli.get('kiauto_time_out_scale', None)
|
||||||
# List of outputs
|
# List of outputs
|
||||||
outputs = []
|
outputs = []
|
||||||
version = None
|
version = None
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2020 Salvador E. Tropea
|
# Copyright (c) 2020-2021 Salvador E. Tropea
|
||||||
# Copyright (c) 2020 Instituto Nacional de Tecnología Industrial
|
# Copyright (c) 2020-2021 Instituto Nacional de Tecnología Industrial
|
||||||
# License: GPL-3.0
|
# License: GPL-3.0
|
||||||
# Project: KiBot (formerly KiPlot)
|
# Project: KiBot (formerly KiPlot)
|
||||||
from .gs import GS
|
from .gs import GS
|
||||||
|
|
@ -18,6 +18,10 @@ class Globals(FiltersOptions):
|
||||||
""" Default pattern for output file names """
|
""" Default pattern for output file names """
|
||||||
self.variant = ''
|
self.variant = ''
|
||||||
""" Default variant to apply to all outputs """
|
""" Default variant to apply to all outputs """
|
||||||
|
self.kiauto_wait_start = 0
|
||||||
|
""" Time to wait for KiCad in KiAuto operations """
|
||||||
|
self.kiauto_time_out_scale = 0.0
|
||||||
|
""" Time-out multiplier for KiAuto operations """
|
||||||
self.set_doc('filters', " [list(dict)] KiBot warnings to be ignored ")
|
self.set_doc('filters', " [list(dict)] KiBot warnings to be ignored ")
|
||||||
self._filter_what = 'KiBot warnings'
|
self._filter_what = 'KiBot warnings'
|
||||||
self._unkown_is_error = True
|
self._unkown_is_error = True
|
||||||
|
|
@ -36,6 +40,9 @@ class Globals(FiltersOptions):
|
||||||
super().config()
|
super().config()
|
||||||
GS.global_output = self.set_global(GS.global_output, self.output, 'output')
|
GS.global_output = self.set_global(GS.global_output, self.output, 'output')
|
||||||
GS.global_variant = self.set_global(GS.global_variant, self.variant, 'variant')
|
GS.global_variant = self.set_global(GS.global_variant, self.variant, 'variant')
|
||||||
|
GS.global_kiauto_wait_start = self.set_global(GS.global_kiauto_wait_start, self.kiauto_wait_start, 'kiauto_wait_start')
|
||||||
|
GS.global_kiauto_time_out_scale = self.set_global(GS.global_kiauto_time_out_scale, self.kiauto_time_out_scale,
|
||||||
|
'kiauto_time_out_scale')
|
||||||
set_filters(self.unparsed)
|
set_filters(self.unparsed)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,8 @@ class GS(object):
|
||||||
global_from_cli = {}
|
global_from_cli = {}
|
||||||
global_output = None
|
global_output = None
|
||||||
global_variant = None
|
global_variant = None
|
||||||
|
global_kiauto_wait_start = None
|
||||||
|
global_kiauto_time_out_scale = None
|
||||||
global_opts_class = None
|
global_opts_class = None
|
||||||
test_boolean = True
|
test_boolean = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,16 @@ def exec_with_retry(cmd):
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
def add_time_out_options(cmd):
|
||||||
|
if GS.global_kiauto_time_out_scale:
|
||||||
|
cmd.insert(1, str(GS.global_kiauto_time_out_scale))
|
||||||
|
cmd.insert(1, '--time_out_scale')
|
||||||
|
if GS.global_kiauto_wait_start:
|
||||||
|
cmd.insert(1, str(GS.global_kiauto_wait_start))
|
||||||
|
cmd.insert(1, '--wait_start')
|
||||||
|
return cmd
|
||||||
|
|
||||||
|
|
||||||
def load_board(pcb_file=None):
|
def load_board(pcb_file=None):
|
||||||
if GS.board is not None:
|
if GS.board is not None:
|
||||||
# Already loaded
|
# Already loaded
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ from tempfile import NamedTemporaryFile
|
||||||
from .pre_base import BasePreFlight
|
from .pre_base import BasePreFlight
|
||||||
from .error import (KiPlotConfigurationError)
|
from .error import (KiPlotConfigurationError)
|
||||||
from .gs import (GS)
|
from .gs import (GS)
|
||||||
from .kiplot import check_script, exec_with_retry
|
from .kiplot import check_script, exec_with_retry, add_time_out_options
|
||||||
from .misc import (CMD_PCBNEW_PRINT_LAYERS, URL_PCBNEW_PRINT_LAYERS, PDF_PCB_PRINT, KICAD_VERSION_5_99)
|
from .misc import (CMD_PCBNEW_PRINT_LAYERS, URL_PCBNEW_PRINT_LAYERS, PDF_PCB_PRINT, KICAD_VERSION_5_99)
|
||||||
from .out_base import VariantOptions
|
from .out_base import VariantOptions
|
||||||
from .macros import macros, document, output_class # noqa: F401
|
from .macros import macros, document, output_class # noqa: F401
|
||||||
|
|
@ -114,6 +114,7 @@ class PDF_Pcb_PrintOptions(VariantOptions):
|
||||||
if GS.debug_enabled:
|
if GS.debug_enabled:
|
||||||
cmd.insert(1, '-vv')
|
cmd.insert(1, '-vv')
|
||||||
cmd.insert(1, '-r')
|
cmd.insert(1, '-r')
|
||||||
|
cmd = add_time_out_options(cmd)
|
||||||
# Add the layers
|
# Add the layers
|
||||||
cmd.extend([la.layer for la in layers])
|
cmd.extend([la.layer for la in layers])
|
||||||
# Execute it
|
# Execute it
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import os
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
from .gs import (GS)
|
from .gs import (GS)
|
||||||
from .kiplot import check_eeschema_do, exec_with_retry
|
from .kiplot import check_eeschema_do, exec_with_retry, add_time_out_options
|
||||||
from .misc import (CMD_EESCHEMA_DO, PDF_SCH_PRINT)
|
from .misc import (CMD_EESCHEMA_DO, PDF_SCH_PRINT)
|
||||||
from .out_base import VariantOptions
|
from .out_base import VariantOptions
|
||||||
from .macros import macros, document, output_class # noqa: F401
|
from .macros import macros, document, output_class # noqa: F401
|
||||||
|
|
@ -50,6 +50,7 @@ class PDF_Sch_PrintOptions(VariantOptions):
|
||||||
if GS.debug_enabled:
|
if GS.debug_enabled:
|
||||||
cmd.insert(1, '-vv')
|
cmd.insert(1, '-vv')
|
||||||
cmd.insert(1, '-r')
|
cmd.insert(1, '-r')
|
||||||
|
cmd = add_time_out_options(cmd)
|
||||||
ret = exec_with_retry(cmd)
|
ret = exec_with_retry(cmd)
|
||||||
if ret:
|
if ret:
|
||||||
logger.error(CMD_EESCHEMA_DO+' returned %d', ret)
|
logger.error(CMD_EESCHEMA_DO+' returned %d', ret)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import os
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
from .gs import (GS)
|
from .gs import (GS)
|
||||||
from .kiplot import check_eeschema_do, exec_with_retry
|
from .kiplot import check_eeschema_do, exec_with_retry, add_time_out_options
|
||||||
from .misc import (CMD_EESCHEMA_DO, SVG_SCH_PRINT)
|
from .misc import (CMD_EESCHEMA_DO, SVG_SCH_PRINT)
|
||||||
from .out_base import VariantOptions
|
from .out_base import VariantOptions
|
||||||
from .macros import macros, document, output_class # noqa: F401
|
from .macros import macros, document, output_class # noqa: F401
|
||||||
|
|
@ -47,6 +47,7 @@ class SVG_Sch_PrintOptions(VariantOptions):
|
||||||
if GS.debug_enabled:
|
if GS.debug_enabled:
|
||||||
cmd.insert(1, '-vv')
|
cmd.insert(1, '-vv')
|
||||||
cmd.insert(1, '-r')
|
cmd.insert(1, '-r')
|
||||||
|
cmd = add_time_out_options(cmd)
|
||||||
ret = exec_with_retry(cmd)
|
ret = exec_with_retry(cmd)
|
||||||
if ret:
|
if ret:
|
||||||
logger.error(CMD_EESCHEMA_DO+' returned %d', ret)
|
logger.error(CMD_EESCHEMA_DO+' returned %d', ret)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from .macros import macros, pre_class # noqa: F401
|
||||||
from .error import (KiPlotConfigurationError)
|
from .error import (KiPlotConfigurationError)
|
||||||
from .gs import (GS)
|
from .gs import (GS)
|
||||||
from .optionable import Optionable
|
from .optionable import Optionable
|
||||||
from .kiplot import check_script, exec_with_retry, load_board
|
from .kiplot import check_script, exec_with_retry, load_board, add_time_out_options
|
||||||
from .misc import (CMD_PCBNEW_RUN_DRC, URL_PCBNEW_RUN_DRC, DRC_ERROR)
|
from .misc import (CMD_PCBNEW_RUN_DRC, URL_PCBNEW_RUN_DRC, DRC_ERROR)
|
||||||
from .log import (get_logger)
|
from .log import (get_logger)
|
||||||
|
|
||||||
|
|
@ -45,6 +45,7 @@ class Run_DRC(BasePreFlight): # noqa: F821
|
||||||
if GS.debug_enabled:
|
if GS.debug_enabled:
|
||||||
cmd.insert(1, '-vv')
|
cmd.insert(1, '-vv')
|
||||||
cmd.insert(1, '-r')
|
cmd.insert(1, '-r')
|
||||||
|
cmd = add_time_out_options(cmd)
|
||||||
logger.info('- Running the DRC')
|
logger.info('- Running the DRC')
|
||||||
ret = exec_with_retry(cmd)
|
ret = exec_with_retry(cmd)
|
||||||
if ret:
|
if ret:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from sys import (exit)
|
||||||
from .macros import macros, pre_class # noqa: F401
|
from .macros import macros, pre_class # noqa: F401
|
||||||
from .gs import (GS)
|
from .gs import (GS)
|
||||||
from .optionable import Optionable
|
from .optionable import Optionable
|
||||||
from .kiplot import check_eeschema_do, exec_with_retry, load_sch
|
from .kiplot import check_eeschema_do, exec_with_retry, load_sch, add_time_out_options
|
||||||
from .error import (KiPlotConfigurationError)
|
from .error import (KiPlotConfigurationError)
|
||||||
from .misc import (CMD_EESCHEMA_DO, ERC_ERROR)
|
from .misc import (CMD_EESCHEMA_DO, ERC_ERROR)
|
||||||
from .log import (get_logger)
|
from .log import (get_logger)
|
||||||
|
|
@ -45,6 +45,7 @@ class Run_ERC(BasePreFlight): # noqa: F821
|
||||||
if GS.debug_enabled:
|
if GS.debug_enabled:
|
||||||
cmd.insert(1, '-vv')
|
cmd.insert(1, '-vv')
|
||||||
cmd.insert(1, '-r')
|
cmd.insert(1, '-r')
|
||||||
|
cmd = add_time_out_options(cmd)
|
||||||
logger.info('- Running the ERC')
|
logger.info('- Running the ERC')
|
||||||
ret = exec_with_retry(cmd)
|
ret = exec_with_retry(cmd)
|
||||||
if ret:
|
if ret:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from sys import (exit)
|
||||||
from .macros import macros, pre_class # noqa: F401
|
from .macros import macros, pre_class # noqa: F401
|
||||||
from .error import (KiPlotConfigurationError)
|
from .error import (KiPlotConfigurationError)
|
||||||
from .gs import (GS)
|
from .gs import (GS)
|
||||||
from .kiplot import check_eeschema_do, exec_with_retry
|
from .kiplot import check_eeschema_do, exec_with_retry, add_time_out_options
|
||||||
from .misc import (CMD_EESCHEMA_DO, BOM_ERROR)
|
from .misc import (CMD_EESCHEMA_DO, BOM_ERROR)
|
||||||
from .log import (get_logger)
|
from .log import (get_logger)
|
||||||
|
|
||||||
|
|
@ -37,6 +37,7 @@ class Update_XML(BasePreFlight): # noqa: F821
|
||||||
if GS.debug_enabled:
|
if GS.debug_enabled:
|
||||||
cmd.insert(1, '-vv')
|
cmd.insert(1, '-vv')
|
||||||
cmd.insert(1, '-r')
|
cmd.insert(1, '-r')
|
||||||
|
cmd = add_time_out_options(cmd)
|
||||||
logger.info('- Updating BoM in XML format')
|
logger.info('- Updating BoM in XML format')
|
||||||
ret = exec_with_retry(cmd)
|
ret = exec_with_retry(cmd)
|
||||||
if ret:
|
if ret:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue