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 "pns_tune_status_popup.h"
23 #include "pns_router.h"
24 #include "pns_meander_placer.h"
25 
27  STATUS_TEXT_POPUP( aParent )
28 {
29  m_panel->SetBackgroundColour( wxColour( 64, 64, 64 ) );
30 }
31 
32 
34 {
35  PNS::MEANDER_PLACER_BASE* placer = dynamic_cast<PNS::MEANDER_PLACER_BASE*>( aRouter->Placer() );
36 
37  if( !placer )
38  return;
39 
40  SetText( placer->TuningInfo() );
41 
42  switch( placer->TuningStatus() )
43  {
45  SetTextColor( wxColour( 0, 255, 0 ) );
46  break;
48  SetTextColor( wxColour( 255, 128, 128 ) );
49  break;
51  SetTextColor( wxColour( 128, 128, 255 ) );
52  break;
53  }
54 }
55 
Class MEANDER_PLACER_BASE.
void SetTextColor(const wxColour &aColor)
Change text color.
virtual const wxString TuningInfo() const =0
Function TuningInfo()
Class STATUS_TEXT_POPUP.
Definition: status_popup.h:77
PLACEMENT_ALGO * Placer()
Definition: pns_router.h:216
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
Definition: draw_frame.h:63
virtual TUNING_STATUS TuningStatus() const =0
Function TuningStatus()
wxPanel * m_panel
Definition: status_popup.h:66
void UpdateStatus(PNS::ROUTER *aRouter)
PNS_TUNE_STATUS_POPUP(EDA_DRAW_FRAME *aParent)
void SetText(const wxString &aText)
Display a text.