LSET::UIOrder and LSET::Technicals now match layer widget order

Fixes: lp:1673792
* https://bugs.launchpad.net/kicad/+bug/1673792
This commit is contained in:
Jon Evans 2018-01-11 22:32:14 -05:00 committed by Maciej Suminski
parent 63e55e9180
commit 6eb5733a0b
2 changed files with 40 additions and 15 deletions

View File

@ -190,18 +190,18 @@ LSEQ LSET::Technicals( LSET aSetToOmit ) const
{ {
// desired sequence // desired sequence
static const PCB_LAYER_ID sequence[] = { static const PCB_LAYER_ID sequence[] = {
B_Adhes,
F_Adhes, F_Adhes,
B_Paste, B_Adhes,
F_Paste, F_Paste,
B_SilkS, B_Paste,
F_SilkS, F_SilkS,
B_Mask, B_SilkS,
F_Mask, F_Mask,
B_CrtYd, B_Mask,
F_CrtYd, F_CrtYd,
B_Fab, B_CrtYd,
F_Fab, F_Fab,
B_Fab,
}; };
LSET subset = ~aSetToOmit & *this; LSET subset = ~aSetToOmit & *this;
@ -226,6 +226,33 @@ LSEQ LSET::Users() const
} }
LSEQ LSET::TechAndUserUIOrder() const
{
static const PCB_LAYER_ID sequence[] = {
F_Adhes,
B_Adhes,
F_Paste,
B_Paste,
F_SilkS,
B_SilkS,
F_Mask,
B_Mask,
Dwgs_User,
Cmts_User,
Eco1_User,
Eco2_User,
Edge_Cuts,
Margin,
F_CrtYd,
B_CrtYd,
F_Fab,
B_Fab,
};
return Seq( sequence, DIM( sequence ) );
}
std::string LSET::FmtBin() const std::string LSET::FmtBin() const
{ {
std::string ret; std::string ret;
@ -758,16 +785,11 @@ LSET LSET::BackMask()
LSEQ LSET::UIOrder() const LSEQ LSET::UIOrder() const
{ {
PCB_LAYER_ID order[PCB_LAYER_ID_COUNT]; LSEQ order = CuStack();
LSEQ techuser = TechAndUserUIOrder();
order.insert( order.end(), techuser.begin(), techuser.end() );
// Assmuming that the PCB_LAYER_ID order is according to preferred UI order, as of return order;
// today this is true. When that becomes not true, its easy to change the order
// in here to compensate.
for( unsigned i=0; i<DIM(order); ++i )
order[i] = PCB_LAYER_ID( i );
return Seq( order, DIM( order ) );
} }

View File

@ -546,6 +546,9 @@ public:
/// *_User layers. /// *_User layers.
LSEQ Users() const; LSEQ Users() const;
/// Returns the technical and user layers in the order shown in layer widget
LSEQ TechAndUserUIOrder() const;
LSEQ UIOrder() const; LSEQ UIOrder() const;
/** /**