From 5853f0890ed8e1120edfa4b101b1abc8e067804b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 26 Sep 2021 16:10:17 +0200 Subject: [PATCH] Gerber job file: fix a bug that prevent writing dielectric constants for impedance controlled boards. --- pcbnew/board_stackup_manager/board_stackup.cpp | 5 +++-- pcbnew/exporters/gerber_jobfile_writer.cpp | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pcbnew/board_stackup_manager/board_stackup.cpp b/pcbnew/board_stackup_manager/board_stackup.cpp index 8a8b03c4f6..efc9cf1e19 100644 --- a/pcbnew/board_stackup_manager/board_stackup.cpp +++ b/pcbnew/board_stackup_manager/board_stackup.cpp @@ -476,6 +476,9 @@ bool BOARD_STACKUP::SynchronizeWithBoard( BOARD_DESIGN_SETTINGS* aSettings ) } } + // Transfert layer settings: + *this = stackup; + // Transfer other stackup settings from aSettings const BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor(); m_HasDielectricConstrains = source_stackup.m_HasDielectricConstrains; @@ -484,8 +487,6 @@ bool BOARD_STACKUP::SynchronizeWithBoard( BOARD_DESIGN_SETTINGS* aSettings ) m_EdgePlating = source_stackup.m_EdgePlating; m_FinishType = source_stackup.m_FinishType; - *this = stackup; - return change; } diff --git a/pcbnew/exporters/gerber_jobfile_writer.cpp b/pcbnew/exporters/gerber_jobfile_writer.cpp index 0048f77bbf..c2d42d6603 100644 --- a/pcbnew/exporters/gerber_jobfile_writer.cpp +++ b/pcbnew/exporters/gerber_jobfile_writer.cpp @@ -50,6 +50,7 @@ #include #include + GERBER_JOBFILE_WRITER::GERBER_JOBFILE_WRITER( BOARD* aPcb, REPORTER* aReporter ) { m_pcb = aPcb; @@ -287,6 +288,9 @@ void GERBER_JOBFILE_WRITER::addJSONGeneralSpecs() if( !brd_stackup.m_FinishType.IsEmpty() ) m_json["GeneralSpecs"]["Finish"] = brd_stackup.m_FinishType; + if( brd_stackup.m_HasDielectricConstrains ) + m_json["GeneralSpecs"]["ImpedanceControlled"] = true; + if( brd_stackup.m_CastellatedPads ) m_json["GeneralSpecs"]["Castellated"] = true; @@ -666,6 +670,7 @@ void GERBER_JOBFILE_WRITER::addJSONMaterialStackup() // These constrains are only written if the board has impedance controlled tracks. // If the board is not impedance controlled, they are useless. // Do not add constrains that create more expensive boards. + if( brd_stackup.m_HasDielectricConstrains ) { // Generate Epsilon R if > 1.0 (value <= 1.0 means not specified: it is not