11 changed files with 615 additions and 55 deletions
-
2eeschema/CMakeLists.txt
-
73eeschema/dialogs/dialog_signal_list.cpp
-
53eeschema/dialogs/dialog_signal_list.h
-
46eeschema/dialogs/dialog_signal_list_base.cpp
-
213eeschema/dialogs/dialog_signal_list_base.fbp
-
51eeschema/dialogs/dialog_signal_list_base.h
-
97eeschema/sim/sim_plot_frame.cpp
-
16eeschema/sim/sim_plot_frame.h
-
17eeschema/sim/sim_plot_frame_base.cpp
-
98eeschema/sim/sim_plot_frame_base.fbp
-
4eeschema/sim/sim_plot_frame_base.h
@ -0,0 +1,73 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2016 CERN |
|||
* @author Maciej Suminski <maciej.suminski@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, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include "dialog_signal_list.h"
|
|||
#include <sim/sim_plot_frame.h>
|
|||
|
|||
#include <sim/netlist_exporter_pspice_sim.h>
|
|||
|
|||
DIALOG_SIGNAL_LIST::DIALOG_SIGNAL_LIST( SIM_PLOT_FRAME* aParent, NETLIST_EXPORTER_PSPICE_SIM* aExporter ) |
|||
: DIALOG_SIGNAL_LIST_BASE( aParent ), m_plotFrame( aParent ), m_exporter( aExporter ) |
|||
{ |
|||
} |
|||
|
|||
|
|||
bool DIALOG_SIGNAL_LIST::TransferDataFromWindow() |
|||
{ |
|||
if( !DIALOG_SIGNAL_LIST_BASE::TransferDataFromWindow() ) |
|||
return false; |
|||
|
|||
addSelectionToPlotFrame(); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
|
|||
bool DIALOG_SIGNAL_LIST::TransferDataToWindow() |
|||
{ |
|||
// Create a list of possible signals
|
|||
// TODO switch( m_exporter->GetSimType() )
|
|||
// {
|
|||
|
|||
if( m_exporter ) |
|||
{ |
|||
for( const auto& net : m_exporter->GetNetIndexMap() ) |
|||
{ |
|||
if( net.first != "GND" ) |
|||
m_signals->Append( net.first ); |
|||
} |
|||
} |
|||
|
|||
return DIALOG_SIGNAL_LIST_BASE::TransferDataToWindow(); |
|||
} |
|||
|
|||
|
|||
void DIALOG_SIGNAL_LIST::addSelectionToPlotFrame() |
|||
{ |
|||
for( unsigned int i = 0; i < m_signals->GetCount(); ++i ) |
|||
{ |
|||
if( m_signals->IsSelected( i ) ) |
|||
m_plotFrame->AddVoltagePlot( m_signals->GetString( i ) ); |
|||
} |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2016 CERN |
|||
* @author Maciej Suminski <maciej.suminski@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, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef DIALOG_SIGNAL_LIST_H |
|||
#define DIALOG_SIGNAL_LIST_H |
|||
|
|||
#include "dialog_signal_list_base.h" |
|||
|
|||
class SIM_PLOT_FRAME; |
|||
class NETLIST_EXPORTER_PSPICE_SIM; |
|||
|
|||
class DIALOG_SIGNAL_LIST : public DIALOG_SIGNAL_LIST_BASE |
|||
{ |
|||
public: |
|||
DIALOG_SIGNAL_LIST( SIM_PLOT_FRAME* aParent, NETLIST_EXPORTER_PSPICE_SIM* aExporter ); |
|||
|
|||
bool TransferDataFromWindow() override; |
|||
bool TransferDataToWindow() override; |
|||
|
|||
private: |
|||
void onSignalAdd( wxCommandEvent& event ) override |
|||
{ |
|||
addSelectionToPlotFrame(); |
|||
} |
|||
|
|||
void addSelectionToPlotFrame(); |
|||
|
|||
SIM_PLOT_FRAME* m_plotFrame; |
|||
NETLIST_EXPORTER_PSPICE_SIM* m_exporter; |
|||
}; |
|||
|
|||
#endif /* DIALOG_SIGNAL_LIST_H */ |
|||
@ -0,0 +1,46 @@ |
|||
///////////////////////////////////////////////////////////////////////////
|
|||
// C++ code generated with wxFormBuilder (version Jun 24 2016)
|
|||
// http://www.wxformbuilder.org/
|
|||
//
|
|||
// PLEASE DO "NOT" EDIT THIS FILE!
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "dialog_signal_list_base.h"
|
|||
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
DIALOG_SIGNAL_LIST_BASE::DIALOG_SIGNAL_LIST_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) |
|||
{ |
|||
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); |
|||
|
|||
wxBoxSizer* bSizer6; |
|||
bSizer6 = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
m_signals = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_MULTIPLE|wxLB_NEEDED_SB|wxLB_SORT ); |
|||
bSizer6->Add( m_signals, 1, wxALL|wxEXPAND, 5 ); |
|||
|
|||
m_sdbSizer = new wxStdDialogButtonSizer(); |
|||
m_sdbSizerOK = new wxButton( this, wxID_OK ); |
|||
m_sdbSizer->AddButton( m_sdbSizerOK ); |
|||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); |
|||
m_sdbSizer->AddButton( m_sdbSizerCancel ); |
|||
m_sdbSizer->Realize(); |
|||
|
|||
bSizer6->Add( m_sdbSizer, 0, wxEXPAND, 5 ); |
|||
|
|||
|
|||
this->SetSizer( bSizer6 ); |
|||
this->Layout(); |
|||
|
|||
this->Centre( wxBOTH ); |
|||
|
|||
// Connect Events
|
|||
m_signals->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_SIGNAL_LIST_BASE::onSignalAdd ), NULL, this ); |
|||
} |
|||
|
|||
DIALOG_SIGNAL_LIST_BASE::~DIALOG_SIGNAL_LIST_BASE() |
|||
{ |
|||
// Disconnect Events
|
|||
m_signals->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_SIGNAL_LIST_BASE::onSignalAdd ), NULL, this ); |
|||
|
|||
} |
|||
@ -0,0 +1,213 @@ |
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
|||
<wxFormBuilder_Project> |
|||
<FileVersion major="1" minor="13" /> |
|||
<object class="Project" expanded="1"> |
|||
<property name="class_decoration"></property> |
|||
<property name="code_generation">C++</property> |
|||
<property name="disconnect_events">1</property> |
|||
<property name="disconnect_mode">source_name</property> |
|||
<property name="disconnect_php_events">0</property> |
|||
<property name="disconnect_python_events">0</property> |
|||
<property name="embedded_files_path">res</property> |
|||
<property name="encoding">UTF-8</property> |
|||
<property name="event_generation">connect</property> |
|||
<property name="file">dialog_signal_list_base</property> |
|||
<property name="first_id">1000</property> |
|||
<property name="help_provider">none</property> |
|||
<property name="internationalize">1</property> |
|||
<property name="name">DIALOG_SIGNAL_LIST_BASE</property> |
|||
<property name="namespace"></property> |
|||
<property name="path">.</property> |
|||
<property name="precompiled_header"></property> |
|||
<property name="relative_path">1</property> |
|||
<property name="skip_lua_events">1</property> |
|||
<property name="skip_php_events">1</property> |
|||
<property name="skip_python_events">1</property> |
|||
<property name="ui_table">UI</property> |
|||
<property name="use_enum">0</property> |
|||
<property name="use_microsoft_bom">0</property> |
|||
<object class="Dialog" expanded="1"> |
|||
<property name="aui_managed">0</property> |
|||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property> |
|||
<property name="bg"></property> |
|||
<property name="center">wxBOTH</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="enabled">1</property> |
|||
<property name="event_handler">impl_virtual</property> |
|||
<property name="extra_style"></property> |
|||
<property name="fg"></property> |
|||
<property name="font"></property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">DIALOG_SIGNAL_LIST_BASE</property> |
|||
<property name="pos"></property> |
|||
<property name="size">424,535</property> |
|||
<property name="style">wxDEFAULT_DIALOG_STYLE</property> |
|||
<property name="subclass"></property> |
|||
<property name="title"></property> |
|||
<property name="tooltip"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnActivate"></event> |
|||
<event name="OnActivateApp"></event> |
|||
<event name="OnAuiFindManager"></event> |
|||
<event name="OnAuiPaneButton"></event> |
|||
<event name="OnAuiPaneClose"></event> |
|||
<event name="OnAuiPaneMaximize"></event> |
|||
<event name="OnAuiPaneRestore"></event> |
|||
<event name="OnAuiRender"></event> |
|||
<event name="OnChar"></event> |
|||
<event name="OnClose"></event> |
|||
<event name="OnEnterWindow"></event> |
|||
<event name="OnEraseBackground"></event> |
|||
<event name="OnHibernate"></event> |
|||
<event name="OnIconize"></event> |
|||
<event name="OnIdle"></event> |
|||
<event name="OnInitDialog"></event> |
|||
<event name="OnKeyDown"></event> |
|||
<event name="OnKeyUp"></event> |
|||
<event name="OnKillFocus"></event> |
|||
<event name="OnLeaveWindow"></event> |
|||
<event name="OnLeftDClick"></event> |
|||
<event name="OnLeftDown"></event> |
|||
<event name="OnLeftUp"></event> |
|||
<event name="OnMiddleDClick"></event> |
|||
<event name="OnMiddleDown"></event> |
|||
<event name="OnMiddleUp"></event> |
|||
<event name="OnMotion"></event> |
|||
<event name="OnMouseEvents"></event> |
|||
<event name="OnMouseWheel"></event> |
|||
<event name="OnPaint"></event> |
|||
<event name="OnRightDClick"></event> |
|||
<event name="OnRightDown"></event> |
|||
<event name="OnRightUp"></event> |
|||
<event name="OnSetFocus"></event> |
|||
<event name="OnSize"></event> |
|||
<event name="OnUpdateUI"></event> |
|||
<object class="wxBoxSizer" expanded="1"> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">bSizer6</property> |
|||
<property name="orient">wxVERTICAL</property> |
|||
<property name="permission">none</property> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALL|wxEXPAND</property> |
|||
<property name="proportion">1</property> |
|||
<object class="wxListBox" expanded="1"> |
|||
<property name="BottomDockable">1</property> |
|||
<property name="LeftDockable">1</property> |
|||
<property name="RightDockable">1</property> |
|||
<property name="TopDockable">1</property> |
|||
<property name="aui_layer"></property> |
|||
<property name="aui_name"></property> |
|||
<property name="aui_position"></property> |
|||
<property name="aui_row"></property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="choices"></property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="dock">Dock</property> |
|||
<property name="dock_fixed">0</property> |
|||
<property name="docking">Left</property> |
|||
<property name="enabled">1</property> |
|||
<property name="fg"></property> |
|||
<property name="floatable">1</property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="max_size"></property> |
|||
<property name="maximize_button">0</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="min_size"></property> |
|||
<property name="minimize_button">0</property> |
|||
<property name="minimum_size"></property> |
|||
<property name="moveable">1</property> |
|||
<property name="name">m_signals</property> |
|||
<property name="pane_border">1</property> |
|||
<property name="pane_position"></property> |
|||
<property name="pane_size"></property> |
|||
<property name="permission">protected</property> |
|||
<property name="pin_button">1</property> |
|||
<property name="pos"></property> |
|||
<property name="resize">Resizable</property> |
|||
<property name="show">1</property> |
|||
<property name="size"></property> |
|||
<property name="style">wxLB_MULTIPLE|wxLB_NEEDED_SB|wxLB_SORT</property> |
|||
<property name="subclass"></property> |
|||
<property name="toolbar_pane">0</property> |
|||
<property name="tooltip"></property> |
|||
<property name="validator_data_type"></property> |
|||
<property name="validator_style">wxFILTER_NONE</property> |
|||
<property name="validator_type">wxDefaultValidator</property> |
|||
<property name="validator_variable"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnChar"></event> |
|||
<event name="OnEnterWindow"></event> |
|||
<event name="OnEraseBackground"></event> |
|||
<event name="OnKeyDown"></event> |
|||
<event name="OnKeyUp"></event> |
|||
<event name="OnKillFocus"></event> |
|||
<event name="OnLeaveWindow"></event> |
|||
<event name="OnLeftDClick"></event> |
|||
<event name="OnLeftDown"></event> |
|||
<event name="OnLeftUp"></event> |
|||
<event name="OnListBox"></event> |
|||
<event name="OnListBoxDClick">onSignalAdd</event> |
|||
<event name="OnMiddleDClick"></event> |
|||
<event name="OnMiddleDown"></event> |
|||
<event name="OnMiddleUp"></event> |
|||
<event name="OnMotion"></event> |
|||
<event name="OnMouseEvents"></event> |
|||
<event name="OnMouseWheel"></event> |
|||
<event name="OnPaint"></event> |
|||
<event name="OnRightDClick"></event> |
|||
<event name="OnRightDown"></event> |
|||
<event name="OnRightUp"></event> |
|||
<event name="OnSetFocus"></event> |
|||
<event name="OnSize"></event> |
|||
<event name="OnUpdateUI"></event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxStdDialogButtonSizer" expanded="1"> |
|||
<property name="Apply">0</property> |
|||
<property name="Cancel">1</property> |
|||
<property name="ContextHelp">0</property> |
|||
<property name="Help">0</property> |
|||
<property name="No">0</property> |
|||
<property name="OK">1</property> |
|||
<property name="Save">0</property> |
|||
<property name="Yes">0</property> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">m_sdbSizer</property> |
|||
<property name="permission">protected</property> |
|||
<event name="OnApplyButtonClick"></event> |
|||
<event name="OnCancelButtonClick"></event> |
|||
<event name="OnContextHelpButtonClick"></event> |
|||
<event name="OnHelpButtonClick"></event> |
|||
<event name="OnNoButtonClick"></event> |
|||
<event name="OnOKButtonClick"></event> |
|||
<event name="OnSaveButtonClick"></event> |
|||
<event name="OnYesButtonClick"></event> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</wxFormBuilder_Project> |
|||
@ -0,0 +1,51 @@ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version Jun 24 2016) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO "NOT" EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#ifndef __DIALOG_SIGNAL_LIST_BASE_H__ |
|||
#define __DIALOG_SIGNAL_LIST_BASE_H__ |
|||
|
|||
#include <wx/artprov.h> |
|||
#include <wx/xrc/xmlres.h> |
|||
#include <wx/intl.h> |
|||
#include <wx/string.h> |
|||
#include <wx/listbox.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/button.h> |
|||
#include <wx/dialog.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class DIALOG_SIGNAL_LIST_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class DIALOG_SIGNAL_LIST_BASE : public wxDialog |
|||
{ |
|||
private: |
|||
|
|||
protected: |
|||
wxListBox* m_signals; |
|||
wxStdDialogButtonSizer* m_sdbSizer; |
|||
wxButton* m_sdbSizerOK; |
|||
wxButton* m_sdbSizerCancel; |
|||
|
|||
// Virtual event handlers, overide them in your derived class |
|||
virtual void onSignalAdd( wxCommandEvent& event ) { event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
|
|||
DIALOG_SIGNAL_LIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 424,535 ), long style = wxDEFAULT_DIALOG_STYLE ); |
|||
~DIALOG_SIGNAL_LIST_BASE(); |
|||
|
|||
}; |
|||
|
|||
#endif //__DIALOG_SIGNAL_LIST_BASE_H__ |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue