27#include "wx/sstream.h"
50 auto appendProperty = [&](
const wxString& aName,
const wxString& aValue )
52 aRows.push_back( { aName, aValue } );
56 appendProperty( wxT(
"Finish" ), aStackup.
m_FinishType );
61 appendProperty( wxT(
"Impedance Controlled" ), wxT(
"yes" ) );
64 appendProperty( wxT(
"Plated edges" ), wxT(
"yes" ) );
68 wxString conn = wxT(
"yes" );
71 conn << wxT(
",bevelled" );
73 appendProperty( wxT(
"EdgeConnector" ), conn );
90 if( !item->IsEnabled() )
95 wxString sublayer_text;
97 if( item->GetSublayersCount() )
99 sublayer_text.Printf( wxT(
"\n sublayer \"1/%d\"" ),
100 item->GetSublayersCount() );
103 txt.Printf( wxT(
"layer \"%s\" type \"%s\"%s" ),
104 item->FormatDielectricLayerName(),
110 txt.Printf( wxT(
"layer \"%s\" type \"%s\"" ),
111 item->GetLayerName(),
112 item->GetTypeName() );
117 for(
int idx = 0; idx < item->GetSublayersCount(); idx++ )
121 txt.Printf( wxT(
"\n sublayer \"%d/%d\"" ), idx+1, item->GetSublayersCount() );
125 if( item->IsColorEditable() )
127 txt.Printf( wxT(
" Color \"%s\"" ), item->GetColor( idx ) );
131 if( item->IsThicknessEditable() )
133 txt.Printf( wxT(
" Thickness %s" ),
139 txt.Printf( wxT(
" Locked" ) );
144 if( item->IsMaterialEditable() )
146 txt.Printf( wxT(
" Material \"%s\"" ), item->GetMaterial( idx ) );
150 if( item->HasEpsilonRValue() )
152 txt.Printf( wxT(
" EpsilonR %s" ), item->FormatEpsilonR( idx ) );
156 if( item->HasLossTangentValue() )
158 txt.Printf( wxT(
" LossTg %s" ), item->FormatLossTangent( idx ) );
167 txt.Printf( wxT(
"Finish \"%s\"" ), aStackup.
m_FinishType );
171 report << wxT(
" Option \"Impedance Controlled\"" );
174 report << wxT(
" Option \"Plated edges\"" );
178 wxString conn_txt = wxT(
"yes" );
181 conn_txt << wxT(
",bevelled" );
183 txt.Printf( wxT(
" EdgeConnector \"%s\"" ), conn_txt );
195 std::vector<std::vector<wxString>> rows;
198 std::vector<wxString> header = { wxT(
"Layer" ), wxT(
"Type" ), wxT(
"Sublayer" ) };
202 header.push_back( wxT(
"Thickness" ) );
203 header.push_back( wxT(
"Locked" ) );
207 header.push_back( wxT(
"Material" ) );
210 header.push_back( wxT(
"Color" ) );
213 header.push_back( wxT(
"EpsilonR" ) );
216 header.push_back( wxT(
"LossTg" ) );
218 rows.push_back( header );
222 if( !item->IsEnabled() )
225 int sublayerCount = item->GetSublayersCount();
227 if( sublayerCount <= 0 )
230 for(
int idx = 0; idx < sublayerCount; idx++ )
232 const bool hasSublayerData = item->GetSublayersCount() > 0;
233 std::vector<wxString> row;
236 row.push_back( item->GetTypeName() );
239 row.push_back( wxString::Format( wxT(
"%d/%d" ), idx + 1, item->GetSublayersCount() ) );
241 row.push_back( wxEmptyString );
247 if( item->IsThicknessEditable() && hasSublayerData )
253 row.push_back( thickness );
257 row.push_back(
locked ? wxT(
"yes" ) : wxEmptyString );
262 row.push_back( ( item->IsMaterialEditable() && hasSublayerData ) ? item->GetMaterial( idx )
267 row.push_back( item->IsColorEditable() ? item->GetColor() : wxString() );
271 row.push_back( ( item->HasEpsilonRValue() && hasSublayerData ) ? item->FormatEpsilonR( idx )
277 row.push_back( ( item->HasLossTangentValue() && hasSublayerData ) ? item->FormatLossTangent( idx )
281 rows.push_back( row );
287 rows.push_back( {} );
288 rows.push_back( { wxT(
"Property" ), wxT(
"Value" ) } );
292 wxStringOutputStream os;
296 return os.GetString();
constexpr EDA_IU_SCALE pcbIUScale
@ BS_EDGE_CONNECTOR_BEVELLED
@ BS_ITEM_TYPE_DIELECTRIC
wxString BuildStackupCsv(BOARD_STACKUP &aStackup, EDA_UNITS aUnits, const STACKUP_CSV_OPTIONS &aOptions)
wxString BuildStackupReport(BOARD_STACKUP &aStackup, EDA_UNITS aUnits)
static wxString layerDisplayName(const BOARD_STACKUP_ITEM *aItem)
static void appendCsvProperties(std::vector< std::vector< wxString > > &aRows, BOARD_STACKUP &aStackup, const STACKUP_CSV_OPTIONS &aOptions)
Manage one layer needed to make a physical board.
wxString FormatDielectricLayerName() const
wxString GetLayerName() const
BOARD_STACKUP_ITEM_TYPE GetType() const
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
bool m_HasDielectricConstrains
True if some layers have impedance controlled tracks or have specific constrains for micro-wave appli...
bool m_EdgePlating
True if the edge board is plated.
BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints
If the board has edge connector cards, some constrains can be specified in job file: BS_EDGE_CONNECTO...
wxString m_FinishType
The name of external copper finish.
void WriteLines(const std::vector< std::vector< wxString > > &aRows)
Write a vector of rows to the stream.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
KICOMMON_API wxString StringFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Return the string from aValue according to aUnits (inch, mm ...) for display.
Options controlling which stackup fields are included in CSV exports.