KiCad PCB EDA Suite
pns_tune_status_popup.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2014-2015 CERN
5  * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 2 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #include "draw_frame.h"
23 #include "pns_tune_status_popup.h"
24 #include "pns_router.h"
25 #include "pns_meander_placer.h"
26 
28 {
29  PNS::MEANDER_PLACER_BASE* placer = dynamic_cast<PNS::MEANDER_PLACER_BASE*>( aRouter->Placer() );
30 
31  if( !placer )
32  return;
33 
34  SetText( placer->TuningInfo( m_frame->GetUserUnits() ) );
35 
36  switch( placer->TuningStatus() )
37  {
39  SetTextColor( wxColour( 0, 255, 0 ) );
40  break;
42  SetTextColor( wxColour( 255, 128, 128 ) );
43  break;
45  SetTextColor( wxColour( 128, 128, 255 ) );
46  break;
47  }
48 }
49 
EDA_DRAW_FRAME * m_frame
Definition: status_popup.h:65
Class MEANDER_PLACER_BASE.
void SetTextColor(const wxColour &aColor)
Change text color.
PLACEMENT_ALGO * Placer()
Definition: pns_router.h:216
virtual TUNING_STATUS TuningStatus() const =0
Function TuningStatus()
virtual const wxString TuningInfo(EDA_UNITS_T aUnits) const =0
Function TuningInfo()
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:284
void UpdateStatus(PNS::ROUTER *aRouter)
void SetText(const wxString &aText)
Display a text.