diff --git a/CHANGELOG.md b/CHANGELOG.md index bec290c0..fe3354f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Problems when connection timed-out - Sub PCB separation using annotation method for some edeges and KiCad versions (#496) +- Problems when using NET_NAME(n) for a value (#511) ## [1.6.3] - 2023-06-26 diff --git a/kibot/kicad/config.py b/kibot/kicad/config.py index 575802b2..d07bd553 100644 --- a/kibot/kicad/config.py +++ b/kibot/kicad/config.py @@ -108,7 +108,8 @@ def expand_env(val, env, extra_env, used_extra=None): replaced = True else: success = False - if var not in reported: + # Note: We can't expand NET_NAME(n) + if var not in reported and not var.startswith('NET_NAME('): logger.error('Unable to expand `{}` in `{}`'.format(var, val)) reported.add(var) return val diff --git a/kibot/kiplot.py b/kibot/kiplot.py index b184a539..ba299a19 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -24,7 +24,7 @@ from .registrable import RegOutput from .misc import (PLOT_ERROR, CORRUPTED_PCB, EXIT_BAD_ARGS, CORRUPTED_SCH, version_str2tuple, EXIT_BAD_CONFIG, WRONG_INSTALL, UI_SMD, UI_VIRTUAL, TRY_INSTALL_CHECK, MOD_SMD, MOD_THROUGH_HOLE, MOD_VIRTUAL, W_PCBNOSCH, W_NONEEDSKIP, W_WRONGCHAR, name2make, W_TIMEOUT, W_KIAUTO, W_VARSCH, - NO_SCH_FILE, NO_PCB_FILE, W_VARPCB, NO_YAML_MODULE, WRONG_ARGUMENTS, FAILED_EXECUTE, + NO_SCH_FILE, NO_PCB_FILE, W_VARPCB, NO_YAML_MODULE, WRONG_ARGUMENTS, FAILED_EXECUTE, W_VALMISMATCH, MOD_EXCLUDE_FROM_POS_FILES, MOD_EXCLUDE_FROM_BOM, MOD_BOARD_ONLY, hide_stderr, W_MAXDEPTH) from .error import PlotError, KiPlotConfigurationError, config_error from .config_reader import CfgYamlReader @@ -296,6 +296,10 @@ def get_board_comps_data(comps): logger.warning(W_PCBNOSCH + '`{}` component in board, but not in schematic'.format(ref)) continue for c in comps_hash[ref]: + new_value = m.GetValue() + if new_value != c.value and '${' not in c.value: + logger.warning(f"{W_VALMISMATCH}Value field mismatch for `{ref}` (SCH: `{c.value}` PCB: `{new_value}`)") + c.value = new_value c.bottom = m.IsFlipped() c.footprint_rot = m.GetOrientationDegrees() center = GS.get_center(m) diff --git a/kibot/misc.py b/kibot/misc.py index afee7ce1..861127fb 100644 --- a/kibot/misc.py +++ b/kibot/misc.py @@ -286,6 +286,8 @@ W_NEWGROUP = '(W130) ' W_NOTINBOM = '(W131) ' W_MISSDIR = '(W132) ' W_EXTRAINVAL = '(W133) ' +W_BADANGLE = '(W134) ' +W_VALMISMATCH = '(W135) ' # Somehow arbitrary, the colors are real, but can be different PCB_MAT_COLORS = {'fr1': "937042", 'fr2': "949d70", 'fr3': "adacb4", 'fr4': "332B16", 'fr5': "6cc290"} PCB_FINISH_COLORS = {'hal': "8b898c", 'hasl': "8b898c", 'imag': "8b898c", 'enig': "cfb96e", 'enepig': "cfb96e",