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  WX_STATUS_POPUP( aParent )
28 {
29  m_panel->SetBackgroundColour( wxColour( 64, 64, 64 ) );
30  m_statusLine = new wxStaticText( m_panel, wxID_ANY, wxEmptyString ) ;
31  m_topSizer->Add( m_statusLine, 1, wxALL | wxEXPAND, 5 );
32 }
33 
34 
36 {
37 }
38 
39 
41 {
42  PNS::MEANDER_PLACER_BASE* placer = dynamic_cast<PNS::MEANDER_PLACER_BASE*>( aRouter->Placer() );
43 
44  if( !placer )
45  return;
46 
47  m_statusLine->SetLabel( placer->TuningInfo() );
48 
49  wxColour color;
50 
51  switch( placer->TuningStatus() )
52  {
54  color = wxColour( 0, 255, 0 );
55  break;
57  color = wxColour( 255, 128, 128 );
58  break;
60  color = wxColour( 128, 128, 255 );
61  break;
62  }
63 
64  m_statusLine->SetForegroundColour( color );
65 
66  updateSize();
67 }
68 
Class WX_STATUS_POPUP.
Class MEANDER_PLACER_BASE.
wxBoxSizer * m_topSizer
virtual const wxString TuningInfo() const =0
Function TuningInfo()
PLACEMENT_ALGO * Placer()
Definition: pns_router.h:207
virtual TUNING_STATUS TuningStatus() const =0
Function TuningStatus()
PNS_TUNE_STATUS_POPUP(PCB_EDIT_FRAME *aParent)
void UpdateStatus(PNS::ROUTER *aRouter)