summaryrefslogtreecommitdiff
path: root/pcbnew/router/pns_tune_status_popup.cpp
diff options
context:
space:
mode:
authorsaurabhb172020-02-26 16:01:28 +0530
committerGitHub2020-02-26 16:01:28 +0530
commitd51317f0193609fb43e932730d78aa86a4984083 (patch)
tree6acee185a4dc19113fcbf0f9a3d6941085dedaf7 /pcbnew/router/pns_tune_status_popup.cpp
parent0db48f6533517ecebfd9f0693f89deca28408b76 (diff)
parent886d9cb772e81d2e5262284bc3082664f084337f (diff)
downloadKiCad-eSim-d51317f0193609fb43e932730d78aa86a4984083.tar.gz
KiCad-eSim-d51317f0193609fb43e932730d78aa86a4984083.tar.bz2
KiCad-eSim-d51317f0193609fb43e932730d78aa86a4984083.zip
Merge pull request #2 from FOSSEE/develop
Develop
Diffstat (limited to 'pcbnew/router/pns_tune_status_popup.cpp')
-rw-r--r--pcbnew/router/pns_tune_status_popup.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/pcbnew/router/pns_tune_status_popup.cpp b/pcbnew/router/pns_tune_status_popup.cpp
new file mode 100644
index 0000000..40be366
--- /dev/null
+++ b/pcbnew/router/pns_tune_status_popup.cpp
@@ -0,0 +1,67 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2014-2015 CERN
+ * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "pns_tune_status_popup.h"
+#include "pns_router.h"
+#include "pns_meander_placer.h"
+
+PNS_TUNE_STATUS_POPUP::PNS_TUNE_STATUS_POPUP( PCB_EDIT_FRAME* aParent ) :
+ WX_STATUS_POPUP( aParent )
+{
+ m_panel->SetBackgroundColour( wxColour( 64, 64, 64 ) );
+ m_statusLine = new wxStaticText( m_panel, wxID_ANY, wxEmptyString ) ;
+ m_topSizer->Add( m_statusLine, 1, wxALL | wxEXPAND, 5 );
+}
+
+
+PNS_TUNE_STATUS_POPUP::~PNS_TUNE_STATUS_POPUP()
+{
+}
+
+
+void PNS_TUNE_STATUS_POPUP::UpdateStatus( PNS_ROUTER* aRouter )
+{
+ PNS_MEANDER_PLACER_BASE* placer = dynamic_cast<PNS_MEANDER_PLACER_BASE*>( aRouter->Placer() );
+
+ if( !placer )
+ return;
+
+ m_statusLine->SetLabel( placer->TuningInfo() );
+
+ wxColour color;
+
+ switch( placer->TuningStatus() )
+ {
+ case PNS_MEANDER_PLACER::TUNED:
+ color = wxColour( 0, 255, 0 );
+ break;
+ case PNS_MEANDER_PLACER::TOO_SHORT:
+ color = wxColour( 255, 128, 128 );
+ break;
+ case PNS_MEANDER_PLACER::TOO_LONG:
+ color = wxColour( 128, 128, 255 );
+ break;
+ }
+
+ m_statusLine->SetForegroundColour( color );
+
+ updateSize();
+}
+