Move simulator to tool framework.
|
@ -481,6 +481,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
|||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_run].emplace_back( BITMAPS::sim_run, wxT( "sim_run_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_stop].emplace_back( BITMAPS::sim_stop, wxT( "sim_stop_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_tune].emplace_back( BITMAPS::sim_tune, wxT( "sim_tune_24.png" ), 24, wxT( "light" ) );
|
||||
|
|
|
@ -351,6 +351,7 @@ if( KICAD_SPICE )
|
|||
dialogs/dialog_sim_command_base.cpp
|
||||
dialogs/dialog_sim_model.cpp
|
||||
dialogs/dialog_sim_model_base.cpp
|
||||
tools/simulator_control.cpp
|
||||
sim/ngspice_circuit_model.cpp
|
||||
sim/ngspice.cpp
|
||||
sim/sim_panel_base.cpp
|
||||
|
@ -362,6 +363,7 @@ if( KICAD_SPICE )
|
|||
sim/sim_workbook.cpp
|
||||
sim/spice_simulator.cpp
|
||||
sim/spice_value.cpp
|
||||
sim/toolbars_sim_plot_frame.cpp
|
||||
widgets/tuner_slider.cpp
|
||||
widgets/tuner_slider_base.cpp
|
||||
)
|
||||
|
|
|
@ -253,7 +253,7 @@ void SCH_EDIT_FRAME::doReCreateMenuBar()
|
|||
|
||||
#ifdef KICAD_SPICE
|
||||
inspectMenu->AppendSeparator();
|
||||
inspectMenu->Add( EE_ACTIONS::runSimulation );
|
||||
inspectMenu->Add( EE_ACTIONS::showSimulator );
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -769,9 +769,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
|||
}
|
||||
}
|
||||
|
||||
SIM_PLOT_FRAME* simFrame = (SIM_PLOT_FRAME*) Kiway().Player( FRAME_SIMULATOR, false );
|
||||
|
||||
if( simFrame && !simFrame->Close() ) // Can close the simulator?
|
||||
if( !Kiway().PlayerClose( FRAME_SIMULATOR, false ) ) // Can close the simulator?
|
||||
return false;
|
||||
|
||||
// We may have gotten multiple events; don't clean up twice
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2021 Sylwester Kocjan <s.kocjan@o2.pl>
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2023 CERN
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -91,24 +92,24 @@ wxColour SIM_PLOT_COLORS::GetPlotColor( COLOR_SET aColorId )
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_COLORS::FillDefaultColorList( bool aWhiteBg )
|
||||
void SIM_PLOT_COLORS::FillDefaultColorList( bool aDarkMode )
|
||||
{
|
||||
m_colorList.clear();
|
||||
|
||||
if( aWhiteBg )
|
||||
{
|
||||
m_colorList.emplace_back( 255, 255, 255 ); // Bg color
|
||||
m_colorList.emplace_back( 0, 0, 0 ); // Fg color (texts)
|
||||
m_colorList.emplace_back( 130, 130, 130 ); // Axis color
|
||||
m_colorList.emplace_back( 0, 0, 0 ); // cursors color
|
||||
}
|
||||
else
|
||||
if( aDarkMode )
|
||||
{
|
||||
m_colorList.emplace_back( 0, 0, 0 ); // Bg color
|
||||
m_colorList.emplace_back( 255, 255, 255 ); // Fg color (texts)
|
||||
m_colorList.emplace_back( 130, 130, 130 ); // Axis color
|
||||
m_colorList.emplace_back( 255, 255, 255 ); // cursors color
|
||||
}
|
||||
else
|
||||
{
|
||||
m_colorList.emplace_back( 255, 255, 255 ); // Bg color
|
||||
m_colorList.emplace_back( 0, 0, 0 ); // Fg color (texts)
|
||||
m_colorList.emplace_back( 130, 130, 130 ); // Axis color
|
||||
m_colorList.emplace_back( 0, 0, 0 ); // cursors color
|
||||
}
|
||||
|
||||
// Add a list of color for traces, starting at index SIM_TRACE_COLOR
|
||||
m_colorList.emplace_back( 0xE4, 0x1A, 0x1C );
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016-2022 CERN
|
||||
* Copyright (C) 2016-2023 CERN
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
|
@ -25,7 +25,6 @@
|
|||
*/
|
||||
|
||||
#include <wx/debug.h>
|
||||
#include <wx/stc/stc.h>
|
||||
|
||||
// For some obscure reason, needed on msys2 with some wxWidgets versions (3.0) to avoid
|
||||
// undefined symbol at link stage (due to use of #include <pegtl.hpp>)
|
||||
|
@ -34,15 +33,19 @@
|
|||
|
||||
#include <project/project_file.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <eeschema_id.h>
|
||||
#include <kiway.h>
|
||||
#include <confirm.h>
|
||||
#include <bitmaps.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <widgets/tuner_slider.h>
|
||||
#include <dialogs/dialog_signal_list.h>
|
||||
#include <scintilla_tricks.h>
|
||||
#include "string_utils.h"
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tool/tool_dispatcher.h>
|
||||
#include <tool/action_manager.h>
|
||||
#include <tool/action_toolbar.h>
|
||||
#include <tool/common_control.h>
|
||||
#include <tools/simulator_control.h>
|
||||
#include <tools/ee_actions.h>
|
||||
#include <string_utils.h>
|
||||
#include <pgm_base.h>
|
||||
#include "ngspice.h"
|
||||
#include "sim_plot_frame.h"
|
||||
|
@ -50,12 +53,9 @@
|
|||
#include "spice_simulator.h"
|
||||
#include "spice_reporter.h"
|
||||
#include <menus_helpers.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/ee_actions.h>
|
||||
#include <eeschema_settings.h>
|
||||
#include <wx/ffile.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx_filename.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
SIM_PLOT_TYPE operator|( SIM_PLOT_TYPE aFirst, SIM_PLOT_TYPE aSecond )
|
||||
|
@ -109,6 +109,7 @@ private:
|
|||
SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
SIM_PLOT_FRAME_BASE( aParent ),
|
||||
m_lastSimPlot( nullptr ),
|
||||
m_darkMode( true ),
|
||||
m_plotNumber( 0 ),
|
||||
m_simFinished( false )
|
||||
{
|
||||
|
@ -116,9 +117,7 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
m_signalsIconColorList = nullptr;
|
||||
|
||||
m_schematicFrame = (SCH_EDIT_FRAME*) Kiway().Player( FRAME_SCH, false );
|
||||
|
||||
if( m_schematicFrame == nullptr )
|
||||
throw std::runtime_error( "There is no schematic window" );
|
||||
wxASSERT( m_schematicFrame );
|
||||
|
||||
// Give an icon
|
||||
wxIcon icon;
|
||||
|
@ -126,30 +125,28 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
SetIcon( icon );
|
||||
|
||||
m_simulator = SIMULATOR::CreateInstance( "ngspice" );
|
||||
|
||||
if( !m_simulator )
|
||||
{
|
||||
throw std::runtime_error( "Could not create simulator instance" );
|
||||
return;
|
||||
}
|
||||
wxASSERT( m_simulator );
|
||||
|
||||
// Get the previous size and position of windows:
|
||||
LoadSettings( config() );
|
||||
|
||||
// Prepare the color list to plot traces
|
||||
SIM_PLOT_COLORS::FillDefaultColorList( GetPlotBgOpt() );
|
||||
|
||||
// Give icons to menuitems
|
||||
setIconsForMenuItems();
|
||||
SIM_PLOT_COLORS::FillDefaultColorList( m_darkMode );
|
||||
|
||||
m_simulator->Init();
|
||||
|
||||
m_reporter = new SIM_THREAD_REPORTER( this );
|
||||
m_simulator->SetReporter( m_reporter );
|
||||
|
||||
m_circuitModel.reset( new NGSPICE_CIRCUIT_MODEL( &m_schematicFrame->Schematic(), this ) );
|
||||
m_circuitModel = std::make_shared<NGSPICE_CIRCUIT_MODEL>( &m_schematicFrame->Schematic(), this );
|
||||
|
||||
Bind( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME::menuExit ), this,
|
||||
setupTools();
|
||||
setupUIConditions();
|
||||
|
||||
ReCreateHToolbar();
|
||||
ReCreateMenuBar();
|
||||
|
||||
Bind( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME::onExit ), this,
|
||||
wxID_EXIT );
|
||||
|
||||
Bind( EVT_SIM_UPDATE, &SIM_PLOT_FRAME::onSimUpdate, this );
|
||||
|
@ -158,56 +155,11 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
Bind( EVT_SIM_FINISHED, &SIM_PLOT_FRAME::onSimFinished, this );
|
||||
Bind( EVT_SIM_CURSOR_UPDATE, &SIM_PLOT_FRAME::onCursorUpdate, this );
|
||||
|
||||
// Toolbar buttons
|
||||
m_toolSimulate = m_toolBar->AddTool( ID_SIM_RUN, _( "Run/Stop Simulation" ),
|
||||
KiBitmap( BITMAPS::sim_run ), _( "Run Simulation" ), wxITEM_NORMAL );
|
||||
m_toolAddSignals = m_toolBar->AddTool( ID_SIM_ADD_SIGNALS, _( "Add Signals" ),
|
||||
KiBitmap( BITMAPS::sim_add_signal ), _( "Add signals to plot" ), wxITEM_NORMAL );
|
||||
m_toolProbe = m_toolBar->AddTool( ID_SIM_PROBE, _( "Probe" ),
|
||||
KiBitmap( BITMAPS::sim_probe ), _( "Probe signals on the schematic" ), wxITEM_NORMAL );
|
||||
m_toolTune = m_toolBar->AddTool( ID_SIM_TUNE, _( "Tune" ),
|
||||
KiBitmap( BITMAPS::sim_tune ), _( "Tune component values" ), wxITEM_NORMAL );
|
||||
m_toolSettings = m_toolBar->AddTool( wxID_ANY, _( "Sim Command" ),
|
||||
KiBitmap( BITMAPS::config ), _( "Simulation command and settings" ), wxITEM_NORMAL );
|
||||
|
||||
// Start all toolbar buttons except settings as disabled
|
||||
m_toolSimulate->Enable( false );
|
||||
m_toolAddSignals->Enable( false );
|
||||
m_toolProbe->Enable( false );
|
||||
m_toolTune->Enable( false );
|
||||
m_toolSettings->Enable( true );
|
||||
|
||||
Bind( wxEVT_UPDATE_UI, &SIM_PLOT_FRAME::menuSimulateUpdate, this, m_toolSimulate->GetId() );
|
||||
Bind( wxEVT_UPDATE_UI, &SIM_PLOT_FRAME::menuAddSignalsUpdate, this,
|
||||
m_toolAddSignals->GetId() );
|
||||
Bind( wxEVT_UPDATE_UI, &SIM_PLOT_FRAME::menuProbeUpdate, this, m_toolProbe->GetId() );
|
||||
Bind( wxEVT_UPDATE_UI, &SIM_PLOT_FRAME::menuTuneUpdate, this, m_toolTune->GetId() );
|
||||
|
||||
Bind( wxEVT_COMMAND_TOOL_CLICKED, &SIM_PLOT_FRAME::onSimulate, this, m_toolSimulate->GetId() );
|
||||
Bind( wxEVT_COMMAND_TOOL_CLICKED, &SIM_PLOT_FRAME::onAddSignal, this,
|
||||
m_toolAddSignals->GetId() );
|
||||
Bind( wxEVT_COMMAND_TOOL_CLICKED, &SIM_PLOT_FRAME::onProbe, this, m_toolProbe->GetId() );
|
||||
Bind( wxEVT_COMMAND_TOOL_CLICKED, &SIM_PLOT_FRAME::onTune, this, m_toolTune->GetId() );
|
||||
Bind( wxEVT_COMMAND_TOOL_CLICKED, &SIM_PLOT_FRAME::onSettings, this, m_toolSettings->GetId() );
|
||||
|
||||
Bind( EVT_WORKBOOK_MODIFIED, &SIM_PLOT_FRAME::onWorkbookModified, this );
|
||||
Bind( EVT_WORKBOOK_CLR_MODIFIED, &SIM_PLOT_FRAME::onWorkbookClrModified, this );
|
||||
|
||||
// Bind toolbar buttons event to existing menu event handlers, so they behave the same
|
||||
Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onSimulate, this,
|
||||
m_runSimulation->GetId() );
|
||||
Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onAddSignal, this, m_addSignals->GetId() );
|
||||
Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onProbe, this, m_probeSignals->GetId() );
|
||||
Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onTune, this, m_tuneValue->GetId() );
|
||||
Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onShowNetlist, this,
|
||||
m_showNetlist->GetId() );
|
||||
Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onSettings, this,
|
||||
m_boardAdapter->GetId() );
|
||||
|
||||
m_toolBar->Realize();
|
||||
|
||||
#ifndef wxHAS_NATIVE_TABART
|
||||
// Non-native default tab art has ugly gradients we don't want
|
||||
// Default non-native tab art has ugly gradients we don't want
|
||||
m_workbook->SetArtProvider( new wxAuiSimpleTabArt() );
|
||||
#endif
|
||||
|
||||
|
@ -241,6 +193,25 @@ SIM_PLOT_FRAME::~SIM_PLOT_FRAME()
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::setupTools()
|
||||
{
|
||||
// Create the manager
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
m_toolManager->SetEnvironment( nullptr, nullptr, nullptr, config(), this );
|
||||
|
||||
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
|
||||
|
||||
// Attach the events to the tool dispatcher
|
||||
Bind( wxEVT_CHAR, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
|
||||
Bind( wxEVT_CHAR_HOOK, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
|
||||
|
||||
// Register tools
|
||||
m_toolManager->RegisterTool( new COMMON_CONTROL );
|
||||
m_toolManager->RegisterTool( new SIMULATOR_CONTROL );
|
||||
m_toolManager->InitTools();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||
{
|
||||
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( aCfg );
|
||||
|
@ -255,7 +226,7 @@ void SIM_PLOT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
|||
m_splitterPlotAndConsoleSashPosition = cfg->m_Simulator.plot_panel_height;
|
||||
m_splitterSignalsSashPosition = cfg->m_Simulator.signal_panel_height;
|
||||
m_splitterTuneValuesSashPosition = cfg->m_Simulator.cursors_panel_height;
|
||||
m_plotUseWhiteBg = cfg->m_Simulator.white_background;
|
||||
m_darkMode = !cfg->m_Simulator.white_background;
|
||||
}
|
||||
|
||||
PROJECT_FILE& project = Prj().GetProjectFile();
|
||||
|
@ -280,7 +251,7 @@ void SIM_PLOT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
|||
cfg->m_Simulator.plot_panel_height = m_splitterPlotAndConsole->GetSashPosition();
|
||||
cfg->m_Simulator.signal_panel_height = m_splitterSignals->GetSashPosition();
|
||||
cfg->m_Simulator.cursors_panel_height = m_splitterTuneValues->GetSashPosition();
|
||||
cfg->m_Simulator.white_background = m_plotUseWhiteBg;
|
||||
cfg->m_Simulator.white_background = !m_darkMode;
|
||||
}
|
||||
|
||||
if( !m_isNonUserClose ) // If we're exiting the project has already been released.
|
||||
|
@ -357,78 +328,6 @@ void SIM_PLOT_FRAME::updateTitle()
|
|||
}
|
||||
|
||||
|
||||
// A small helper struct to handle bitmaps initialization in menus
|
||||
struct BM_MENU_INIT_ITEM
|
||||
{
|
||||
int m_MenuId;
|
||||
BITMAPS m_Bitmap;
|
||||
};
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::setIconsForMenuItems()
|
||||
{
|
||||
// Give icons to menuitems of the main menubar
|
||||
BM_MENU_INIT_ITEM bm_list[]
|
||||
{
|
||||
// File menu:
|
||||
{ wxID_NEW, BITMAPS::simulator },
|
||||
{ wxID_OPEN, BITMAPS::directory_open },
|
||||
{ wxID_SAVE, BITMAPS::save },
|
||||
{ wxID_CLOSE, BITMAPS::exit },
|
||||
|
||||
// simulator menu:
|
||||
{ ID_MENU_RUN_SIM, BITMAPS::sim_run },
|
||||
{ ID_MENU_ADD_SIGNAL, BITMAPS::sim_add_signal },
|
||||
{ ID_MENU_PROBE_SIGNALS, BITMAPS::sim_probe },
|
||||
{ ID_MENU_TUNE_SIGNALS, BITMAPS::sim_tune },
|
||||
{ ID_MENU_SHOW_NETLIST, BITMAPS::netlist },
|
||||
{ ID_MENU_SET_SIMUL, BITMAPS::config },
|
||||
|
||||
// View menu
|
||||
{ wxID_ZOOM_IN, BITMAPS::zoom_in },
|
||||
{ wxID_ZOOM_OUT, BITMAPS::zoom_out },
|
||||
{ wxID_ZOOM_FIT, BITMAPS::zoom_fit_in_page },
|
||||
{ ID_MENU_SHOW_GRID, BITMAPS::grid },
|
||||
{ ID_MENU_SHOW_LEGEND, BITMAPS::text },
|
||||
{ ID_MENU_DOTTED, BITMAPS::add_dashed_line },
|
||||
{ ID_MENU_WHITE_BG, BITMAPS::swap_layer },
|
||||
|
||||
{ 0, BITMAPS::INVALID_BITMAP } // Sentinel
|
||||
};
|
||||
|
||||
// wxMenuItems are already created and attached to the m_mainMenu wxMenuBar.
|
||||
// A problem is the fact setting bitmaps in wxMenuItems after they are attached
|
||||
// to a wxMenu do not work in all cases.
|
||||
// So the trick is:
|
||||
// Remove the wxMenuItem from its wxMenu
|
||||
// Set the bitmap
|
||||
// Insert the modified wxMenuItem to its previous place
|
||||
for( int ii = 0; bm_list[ii].m_MenuId; ++ii )
|
||||
{
|
||||
wxMenuItem* item = m_mainMenu->FindItem( bm_list[ii].m_MenuId );
|
||||
|
||||
if( !item || ( bm_list[ii].m_Bitmap == BITMAPS::INVALID_BITMAP ) )
|
||||
continue;
|
||||
|
||||
wxMenu* menu = item->GetMenu();
|
||||
|
||||
// Calculate the initial index of item inside the wxMenu parent.
|
||||
wxMenuItemList& mlist = menu->GetMenuItems();
|
||||
int mpos = mlist.IndexOf( item );
|
||||
|
||||
if( mpos >= 0 ) // Should be always the case
|
||||
{
|
||||
// Modify the bitmap
|
||||
menu->Remove( item );
|
||||
AddBitmapToMenuItem( item, KiBitmap( bm_list[ii].m_Bitmap ) );
|
||||
|
||||
// Insert item to its the initial index
|
||||
menu->Insert( mpos, item );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::setSubWindowsSashSize()
|
||||
{
|
||||
if( m_splitterLeftRightSashPosition > 0 )
|
||||
|
@ -447,7 +346,7 @@ void SIM_PLOT_FRAME::setSubWindowsSashSize()
|
|||
|
||||
void SIM_PLOT_FRAME::StartSimulation( const wxString& aSimCommand )
|
||||
{
|
||||
wxCHECK_RET( m_circuitModel->CommandToSimType( getCurrentSimCommand() ) != ST_UNKNOWN,
|
||||
wxCHECK_RET( m_circuitModel->CommandToSimType( GetCurrentSimCommand() ) != ST_UNKNOWN,
|
||||
wxT( "Unknown simulation type" ) );
|
||||
|
||||
m_simConsole->Clear();
|
||||
|
@ -455,7 +354,7 @@ void SIM_PLOT_FRAME::StartSimulation( const wxString& aSimCommand )
|
|||
if( aSimCommand != wxEmptyString )
|
||||
m_circuitModel->SetSimCommandOverride( aSimCommand );
|
||||
|
||||
m_circuitModel->SetSimOptions( getCurrentOptions() );
|
||||
m_circuitModel->SetSimOptions( GetCurrentOptions() );
|
||||
|
||||
wxString errors;
|
||||
WX_STRING_REPORTER reporter( &errors );
|
||||
|
@ -516,7 +415,7 @@ SIM_PANEL_BASE* SIM_PLOT_FRAME::NewPlotPanel( wxString aSimCommand, int aOptions
|
|||
if( SIM_PANEL_BASE::IsPlottable( simType ) )
|
||||
{
|
||||
SIM_PLOT_PANEL* panel;
|
||||
panel = new SIM_PLOT_PANEL( aSimCommand, aOptions, m_workbook, this, wxID_ANY );
|
||||
panel = new SIM_PLOT_PANEL( aSimCommand, aOptions, m_workbook, wxID_ANY );
|
||||
|
||||
panel->GetPlotWin()->EnableMouseWheelPan(
|
||||
Pgm().GetCommonSettings()->m_Input.scroll_modifier_zoom != 0 );
|
||||
|
@ -935,7 +834,7 @@ void SIM_PLOT_FRAME::applyTuners()
|
|||
}
|
||||
|
||||
|
||||
bool SIM_PLOT_FRAME::loadWorkbook( const wxString& aPath )
|
||||
bool SIM_PLOT_FRAME::LoadWorkbook( const wxString& aPath )
|
||||
{
|
||||
m_workbook->DeleteAllPages();
|
||||
|
||||
|
@ -1087,7 +986,7 @@ bool SIM_PLOT_FRAME::loadWorkbook( const wxString& aPath )
|
|||
}
|
||||
|
||||
|
||||
bool SIM_PLOT_FRAME::saveWorkbook( const wxString& aPath )
|
||||
bool SIM_PLOT_FRAME::SaveWorkbook( const wxString& aPath )
|
||||
{
|
||||
wxFileName filename = aPath;
|
||||
filename.SetExt( WorkbookFileExtension );
|
||||
|
@ -1169,37 +1068,6 @@ bool SIM_PLOT_FRAME::saveWorkbook( const wxString& aPath )
|
|||
}
|
||||
|
||||
|
||||
wxString SIM_PLOT_FRAME::getDefaultFilename()
|
||||
{
|
||||
wxFileName filename = m_simulator->Settings()->GetWorkbookFilename();
|
||||
|
||||
if( filename.GetName().IsEmpty() )
|
||||
{
|
||||
if( Prj().GetProjectName().IsEmpty() )
|
||||
{
|
||||
filename.SetName( _( "noname" ) );
|
||||
filename.SetExt( WorkbookFileExtension );
|
||||
}
|
||||
else
|
||||
{
|
||||
filename.SetName( Prj().GetProjectName() );
|
||||
filename.SetExt( WorkbookFileExtension );
|
||||
}
|
||||
}
|
||||
|
||||
return filename.GetFullName();
|
||||
}
|
||||
|
||||
|
||||
wxString SIM_PLOT_FRAME::getDefaultPath()
|
||||
{
|
||||
wxFileName path = m_simulator->Settings()->GetWorkbookFilename();
|
||||
|
||||
path.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS, Prj().GetProjectPath() );
|
||||
return path.GetPath();
|
||||
}
|
||||
|
||||
|
||||
SIM_PLOT_TYPE SIM_PLOT_FRAME::getXAxisType( SIM_TYPE aType ) const
|
||||
{
|
||||
switch( aType )
|
||||
|
@ -1215,200 +1083,12 @@ SIM_PLOT_TYPE SIM_PLOT_FRAME::getXAxisType( SIM_TYPE aType ) const
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuNewPlot( wxCommandEvent& aEvent )
|
||||
void SIM_PLOT_FRAME::ToggleDarkModePlots()
|
||||
{
|
||||
SIM_TYPE type = m_circuitModel->GetSimType();
|
||||
|
||||
if( SIM_PANEL_BASE::IsPlottable( type ) )
|
||||
NewPlotPanel( m_circuitModel->GetSimCommand(), m_circuitModel->GetSimOptions() );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuOpenWorkbook( wxCommandEvent& event )
|
||||
{
|
||||
wxFileDialog openDlg( this, _( "Open simulation workbook" ), getDefaultPath(), "",
|
||||
WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
if( openDlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
|
||||
loadWorkbook( openDlg.GetPath() );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuSaveWorkbook( wxCommandEvent& event )
|
||||
{
|
||||
if( !m_workbook->IsModified() )
|
||||
return;
|
||||
|
||||
wxString filename = m_simulator->Settings()->GetWorkbookFilename();
|
||||
|
||||
if( filename.IsEmpty() )
|
||||
{
|
||||
menuSaveWorkbookAs( event );
|
||||
return;
|
||||
}
|
||||
|
||||
saveWorkbook( Prj().AbsolutePath( m_simulator->Settings()->GetWorkbookFilename() ) );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuSaveWorkbookAs( wxCommandEvent& event )
|
||||
{
|
||||
wxFileDialog saveAsDlg( this, _( "Save Simulation Workbook As" ), getDefaultPath(),
|
||||
getDefaultFilename(), WorkbookFileWildcard(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
|
||||
if( saveAsDlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
|
||||
saveWorkbook( Prj().AbsolutePath( saveAsDlg.GetPath() ) );
|
||||
}
|
||||
|
||||
void SIM_PLOT_FRAME::menuSaveImage( wxCommandEvent& event )
|
||||
{
|
||||
if( !GetCurrentPlot() )
|
||||
return;
|
||||
|
||||
wxFileDialog saveDlg( this, _( "Save Plot as Image" ), "", "", PngFileWildcard(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
|
||||
if( saveDlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
|
||||
GetCurrentPlot()->GetPlotWin()->SaveScreenshot( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuSaveCsv( wxCommandEvent& event )
|
||||
{
|
||||
if( !GetCurrentPlot() )
|
||||
return;
|
||||
|
||||
const wxChar SEPARATOR = ';';
|
||||
|
||||
wxFileDialog saveDlg( this, _( "Save Plot Data" ), "", "", CsvFileWildcard(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
|
||||
if( saveDlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
|
||||
wxFFile out( saveDlg.GetPath(), "wb" );
|
||||
|
||||
std::map<wxString, TRACE *> traces = GetCurrentPlot()->GetTraces();
|
||||
|
||||
if( traces.size() == 0 )
|
||||
return;
|
||||
|
||||
SIM_TYPE simType = m_circuitModel->GetSimType();
|
||||
|
||||
std::size_t rowCount = traces.begin()->second->GetDataX().size();
|
||||
|
||||
// write column header names on the first row
|
||||
wxString xAxisName( m_simulator->GetXAxis( simType ) );
|
||||
out.Write( wxString::Format( wxT( "%s%c" ), xAxisName, SEPARATOR ) );
|
||||
|
||||
for( const auto& [name, trace] : traces )
|
||||
out.Write( wxString::Format( wxT( "%s%c" ), name, SEPARATOR ) );
|
||||
|
||||
out.Write( wxS( "\r\n" ) );
|
||||
|
||||
// write each row's numerical value
|
||||
for ( std::size_t curRow=0; curRow < rowCount; curRow++ )
|
||||
{
|
||||
double xAxisValue = traces.begin()->second->GetDataX().at( curRow );
|
||||
out.Write( wxString::Format( wxT( "%g%c" ), xAxisValue, SEPARATOR ) );
|
||||
|
||||
for( const auto& [name, trace] : traces )
|
||||
{
|
||||
double yAxisValue = trace->GetDataY().at( curRow );
|
||||
out.Write( wxString::Format( wxT( "%g%c" ), yAxisValue, SEPARATOR ) );
|
||||
}
|
||||
|
||||
out.Write( wxS( "\r\n" ) );
|
||||
}
|
||||
|
||||
out.Close();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuZoomIn( wxCommandEvent& event )
|
||||
{
|
||||
if( GetCurrentPlot() )
|
||||
GetCurrentPlot()->GetPlotWin()->ZoomIn();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuZoomOut( wxCommandEvent& event )
|
||||
{
|
||||
if( GetCurrentPlot() )
|
||||
GetCurrentPlot()->GetPlotWin()->ZoomOut();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuZoomFit( wxCommandEvent& event )
|
||||
{
|
||||
if( GetCurrentPlot() )
|
||||
GetCurrentPlot()->GetPlotWin()->Fit();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuShowGrid( wxCommandEvent& event )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
|
||||
if( plot )
|
||||
plot->ShowGrid( !plot->IsGridShown() );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuShowGridUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
|
||||
event.Check( plot ? plot->IsGridShown() : false );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuShowLegend( wxCommandEvent& event )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
|
||||
if( plot )
|
||||
plot->ShowLegend( !plot->IsLegendShown() );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuShowLegendUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
event.Check( plot ? plot->IsLegendShown() : false );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuShowDotted( wxCommandEvent& event )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
|
||||
if( plot )
|
||||
plot->SetDottedCurrentPhase( !plot->GetDottedCurrentPhase() );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuShowDottedUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
|
||||
event.Check( plot ? plot->GetDottedCurrentPhase() : false );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuWhiteBackground( wxCommandEvent& event )
|
||||
{
|
||||
m_plotUseWhiteBg = not m_plotUseWhiteBg;
|
||||
m_darkMode = !m_darkMode;
|
||||
|
||||
// Rebuild the color list to plot traces
|
||||
SIM_PLOT_COLORS::FillDefaultColorList( GetPlotBgOpt() );
|
||||
SIM_PLOT_COLORS::FillDefaultColorList( m_darkMode );
|
||||
|
||||
// Now send changes to all SIM_PLOT_PANEL
|
||||
for( size_t page = 0; page < m_workbook->GetPageCount(); page++ )
|
||||
|
@ -1425,30 +1105,6 @@ void SIM_PLOT_FRAME::menuWhiteBackground( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuSimulateUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( m_circuitModel->CommandToSimType( getCurrentSimCommand() ) != ST_UNKNOWN );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuAddSignalsUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( m_simFinished );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuProbeUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( m_simFinished );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuTuneUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( m_simFinished );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onPlotClose( wxAuiNotebookEvent& event )
|
||||
{
|
||||
}
|
||||
|
@ -1541,16 +1197,7 @@ void SIM_PLOT_FRAME::onWorkbookClrModified( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onSimulate( wxCommandEvent& event )
|
||||
{
|
||||
if( m_simulator->IsRunning() )
|
||||
m_simulator->Stop();
|
||||
else
|
||||
StartSimulation();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onSettings( wxCommandEvent& event )
|
||||
void SIM_PLOT_FRAME::EditSimCommand()
|
||||
{
|
||||
SIM_PANEL_BASE* plotPanelWindow = getCurrentPlotWindow();
|
||||
DIALOG_SIM_COMMAND dlg( this, m_circuitModel, m_simulator->Settings() );
|
||||
|
@ -1617,128 +1264,6 @@ void SIM_PLOT_FRAME::onSettings( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onAddSignal( wxCommandEvent& event )
|
||||
{
|
||||
wxCHECK_RET( m_simFinished, wxT( "No simulation results available" ) );
|
||||
|
||||
SIM_PLOT_PANEL* plotPanel = GetCurrentPlot();
|
||||
|
||||
if( !plotPanel || !m_circuitModel || plotPanel->GetType() != m_circuitModel->GetSimType() )
|
||||
{
|
||||
DisplayInfoMessage( this, _( "You need to run plot-providing simulation first." ) );
|
||||
return;
|
||||
}
|
||||
|
||||
DIALOG_SIGNAL_LIST dialog( this, m_circuitModel.get() );
|
||||
dialog.ShowModal();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onProbe( wxCommandEvent& event )
|
||||
{
|
||||
wxCHECK_RET( m_simFinished, wxT( "No simulation results available" ) );
|
||||
|
||||
if( m_schematicFrame == nullptr )
|
||||
return;
|
||||
|
||||
wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
|
||||
|
||||
if( blocking_dialog )
|
||||
blocking_dialog->Close( true );
|
||||
|
||||
m_schematicFrame->GetToolManager()->RunAction( EE_ACTIONS::simProbe );
|
||||
m_schematicFrame->Raise();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onTune( wxCommandEvent& event )
|
||||
{
|
||||
wxCHECK_RET( m_simFinished, wxT( "No simulation results available" ) );
|
||||
|
||||
if( m_schematicFrame == nullptr )
|
||||
return;
|
||||
|
||||
wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
|
||||
|
||||
if( blocking_dialog )
|
||||
blocking_dialog->Close( true );
|
||||
|
||||
m_schematicFrame->GetToolManager()->RunAction( EE_ACTIONS::simTune );
|
||||
m_schematicFrame->Raise();
|
||||
}
|
||||
|
||||
|
||||
class NETLIST_VIEW_DIALOG : public DIALOG_SHIM
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
MARGIN_LINE_NUMBERS
|
||||
};
|
||||
|
||||
void onClose( wxCloseEvent& evt )
|
||||
{
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
|
||||
}
|
||||
|
||||
NETLIST_VIEW_DIALOG( wxWindow* parent, const wxString& source) :
|
||||
DIALOG_SHIM( parent, wxID_ANY, _( "SPICE Netlist" ), wxDefaultPosition,
|
||||
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
|
||||
{
|
||||
wxStyledTextCtrl* textCtrl = new wxStyledTextCtrl( this, wxID_ANY );
|
||||
textCtrl->SetMinSize( wxSize( 600, 400 ) );
|
||||
|
||||
textCtrl->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
|
||||
textCtrl->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) );
|
||||
textCtrl->StyleSetBackground( wxSTC_STYLE_LINENUMBER, wxColour( 220, 220, 220 ) );
|
||||
textCtrl->SetMarginType( MARGIN_LINE_NUMBERS, wxSTC_MARGIN_NUMBER );
|
||||
|
||||
wxFont fixedFont = KIUI::GetMonospacedUIFont();
|
||||
|
||||
for( int i = 0; i < wxSTC_STYLE_MAX; ++i )
|
||||
textCtrl->StyleSetFont( i, fixedFont );
|
||||
|
||||
textCtrl->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set
|
||||
|
||||
textCtrl->SetWrapMode( wxSTC_WRAP_WORD );
|
||||
|
||||
textCtrl->SetText( source );
|
||||
|
||||
textCtrl->SetLexer( wxSTC_LEX_SPICE );
|
||||
|
||||
wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
|
||||
sizer->Add( textCtrl, 1, wxEXPAND | wxALL, 5 );
|
||||
SetSizer( sizer );
|
||||
|
||||
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ),
|
||||
nullptr, this );
|
||||
|
||||
m_scintillaTricks = std::make_unique<SCINTILLA_TRICKS>( textCtrl, wxT( "{}" ), false );
|
||||
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
std::unique_ptr<SCINTILLA_TRICKS> m_scintillaTricks;
|
||||
};
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event )
|
||||
{
|
||||
if( m_schematicFrame == nullptr || m_simulator == nullptr )
|
||||
return;
|
||||
|
||||
wxString errors;
|
||||
WX_STRING_REPORTER reporter( &errors );
|
||||
STRING_FORMATTER formatter;
|
||||
|
||||
m_circuitModel->SetSimOptions( getCurrentOptions() );
|
||||
m_circuitModel->GetNetlist( &formatter, reporter );
|
||||
|
||||
NETLIST_VIEW_DIALOG dlg( this, errors.IsEmpty() ? wxString( formatter.GetString() ) : errors );
|
||||
dlg.ShowModal();
|
||||
}
|
||||
|
||||
|
||||
bool SIM_PLOT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||
{
|
||||
if( m_workbook->IsModified() )
|
||||
|
@ -1764,7 +1289,7 @@ bool SIM_PLOT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
|||
return HandleUnsavedChanges( this, msg,
|
||||
[&]() -> bool
|
||||
{
|
||||
return saveWorkbook( Prj().AbsolutePath( fullFilename ) );
|
||||
return SaveWorkbook( Prj().AbsolutePath( fullFilename ) );
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -1839,16 +1364,100 @@ void SIM_PLOT_FRAME::onCursorUpdate( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::setupUIConditions()
|
||||
{
|
||||
EDA_BASE_FRAME::setupUIConditions();
|
||||
|
||||
ACTION_MANAGER* mgr = m_toolManager->GetActionManager();
|
||||
wxASSERT( mgr );
|
||||
|
||||
auto showGridCondition =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
return plot && plot->IsGridShown();
|
||||
};
|
||||
|
||||
auto showLegendCondition =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
return plot && plot->IsLegendShown();
|
||||
};
|
||||
|
||||
auto showDottedCondition =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = GetCurrentPlot();
|
||||
return plot && plot->GetDottedSecondary();
|
||||
};
|
||||
|
||||
auto darkModePlotCondition =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
return m_darkMode;
|
||||
};
|
||||
|
||||
auto haveCommand =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
return m_circuitModel->CommandToSimType( GetCurrentSimCommand() ) != ST_UNKNOWN;
|
||||
};
|
||||
|
||||
auto simRunning =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
return m_simulator && m_simulator->IsRunning();
|
||||
};
|
||||
|
||||
auto simFinished =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
return m_simFinished;
|
||||
};
|
||||
|
||||
auto havePlot =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
return GetCurrentPlot() != nullptr;
|
||||
};
|
||||
|
||||
#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
|
||||
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
|
||||
|
||||
mgr->SetConditions( EE_ACTIONS::openWorkbook, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||
mgr->SetConditions( EE_ACTIONS::saveWorkbook, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||
mgr->SetConditions( EE_ACTIONS::saveWorkbookAs, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||
|
||||
mgr->SetConditions( EE_ACTIONS::exportPlotAsPNG, ENABLE( havePlot ) );
|
||||
mgr->SetConditions( EE_ACTIONS::exportPlotAsCSV, ENABLE( havePlot ) );
|
||||
|
||||
mgr->SetConditions( EE_ACTIONS::toggleGrid, CHECK( showGridCondition ) );
|
||||
mgr->SetConditions( EE_ACTIONS::toggleLegend, CHECK( showLegendCondition ) );
|
||||
mgr->SetConditions( EE_ACTIONS::toggleDottedSecondary, CHECK( showDottedCondition ) );
|
||||
mgr->SetConditions( EE_ACTIONS::toggleDarkModePlots, CHECK( darkModePlotCondition ) );
|
||||
|
||||
mgr->SetConditions( EE_ACTIONS::simCommand, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||
mgr->SetConditions( EE_ACTIONS::runSimulation, ENABLE( haveCommand && !simRunning ) );
|
||||
mgr->SetConditions( EE_ACTIONS::stopSimulation, ENABLE( simRunning ) );
|
||||
mgr->SetConditions( EE_ACTIONS::addSignals, ENABLE( simFinished ) );
|
||||
mgr->SetConditions( EE_ACTIONS::simProbe, ENABLE( simFinished ) );
|
||||
mgr->SetConditions( EE_ACTIONS::simTune, ENABLE( simFinished ) );
|
||||
mgr->SetConditions( EE_ACTIONS::showNetlist, ENABLE( SELECTION_CONDITIONS::ShowAlways ) );
|
||||
|
||||
#undef CHECK
|
||||
#undef ENABLE
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onSimStarted( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_toolBar->SetToolNormalBitmap( ID_SIM_RUN, KiBitmap( BITMAPS::sim_stop ) );
|
||||
SetCursor( wxCURSOR_ARROWWAIT );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_toolBar->SetToolNormalBitmap( ID_SIM_RUN, KiBitmap( BITMAPS::sim_run ) );
|
||||
SetCursor( wxCURSOR_ARROW );
|
||||
|
||||
SIM_TYPE simType = m_circuitModel->GetSimType();
|
||||
|
@ -2061,13 +1670,9 @@ void SIM_PLOT_FRAME::CURSOR_CONTEXT_MENU::onMenuEvent( wxMenuEvent& aEvent )
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::menuExit( wxCommandEvent& event )
|
||||
void SIM_PLOT_FRAME::onExit( wxCommandEvent& event )
|
||||
{
|
||||
if( event.GetId() == wxID_EXIT )
|
||||
Kiway().OnKiCadExit();
|
||||
|
||||
if( event.GetId() == wxID_CLOSE )
|
||||
Close( false );
|
||||
Kiway().OnKiCadExit();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016-2022 CERN
|
||||
* Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 CERN
|
||||
* Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
|
@ -29,8 +29,8 @@
|
|||
#define __SIM_PLOT_FRAME__
|
||||
|
||||
|
||||
#include "sim_plot_frame_base.h"
|
||||
#include "sim_types.h"
|
||||
#include <sim/sim_plot_frame_base.h>
|
||||
#include <sim/sim_types.h>
|
||||
|
||||
#include <kiway_player.h>
|
||||
#include <dialogs/dialog_sim_command.h>
|
||||
|
@ -48,16 +48,14 @@ class SPICE_SIMULATOR;
|
|||
class SPICE_SIMULATOR_SETTINGS;
|
||||
class NGSPICE_CIRCUIT_MODEL;
|
||||
|
||||
#include "sim_plot_panel.h"
|
||||
#include "sim_panel_base.h"
|
||||
#include "sim_workbook.h"
|
||||
#include <sim/sim_plot_panel.h>
|
||||
#include <sim/sim_panel_base.h>
|
||||
#include <sim/sim_workbook.h>
|
||||
|
||||
class SIM_THREAD_REPORTER;
|
||||
class TUNER_SLIDER;
|
||||
|
||||
/**
|
||||
* Implementing SIM_PLOT_FRAME_BASE
|
||||
*/
|
||||
|
||||
class SIM_PLOT_FRAME : public SIM_PLOT_FRAME_BASE
|
||||
{
|
||||
public:
|
||||
|
@ -75,6 +73,12 @@ public:
|
|||
*/
|
||||
SIM_PANEL_BASE* NewPlotPanel( wxString aSimCommand, int aSimOptions );
|
||||
|
||||
/**
|
||||
* Shows a dialog for editing the current tab's simulation command, or creating a new tab
|
||||
* with a different simulation command type.
|
||||
*/
|
||||
void EditSimCommand();
|
||||
|
||||
/**
|
||||
* Add a voltage plot for a given net name.
|
||||
*
|
||||
|
@ -126,10 +130,27 @@ public:
|
|||
const NGSPICE_CIRCUIT_MODEL* GetExporter() const;
|
||||
|
||||
/**
|
||||
* @return the current background option for plotting.
|
||||
* false for drak bg, true for clear bg
|
||||
* Toggle dark-mode of the plot.
|
||||
*/
|
||||
bool GetPlotBgOpt() const { return m_plotUseWhiteBg; }
|
||||
void ToggleDarkModePlots();
|
||||
|
||||
void ReCreateHToolbar();
|
||||
|
||||
/**
|
||||
* Load plot settings from a file.
|
||||
*
|
||||
* @param aPath is the file name.
|
||||
* @return True if successful.
|
||||
*/
|
||||
bool LoadWorkbook( const wxString& aPath );
|
||||
|
||||
/**
|
||||
* Save plot settings to a file.
|
||||
*
|
||||
* @param aPath is the file name.
|
||||
* @return True if successful.
|
||||
*/
|
||||
bool SaveWorkbook( const wxString& aPath );
|
||||
|
||||
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
|
||||
|
||||
|
@ -137,10 +158,37 @@ public:
|
|||
|
||||
WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override;
|
||||
|
||||
SCH_EDIT_FRAME* GetSchematicFrame() const { return m_schematicFrame; }
|
||||
|
||||
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> GetCircuitModel() const { return m_circuitModel; }
|
||||
|
||||
std::shared_ptr<SPICE_SIMULATOR> GetSimulator() const { return m_simulator; }
|
||||
|
||||
wxString GetCurrentSimCommand() const
|
||||
{
|
||||
if( getCurrentPlotWindow() == nullptr )
|
||||
return m_circuitModel->GetSheetSimCommand();
|
||||
else
|
||||
return m_workbook->GetSimCommand( getCurrentPlotWindow() );
|
||||
}
|
||||
|
||||
int GetCurrentOptions() const
|
||||
{
|
||||
if( getCurrentPlotWindow() == nullptr )
|
||||
return m_circuitModel->GetSimOptions();
|
||||
else
|
||||
return m_workbook->GetSimOptions( getCurrentPlotWindow() );
|
||||
}
|
||||
|
||||
// Simulator doesn't host a tool framework
|
||||
wxWindow* GetToolCanvas() const override { return nullptr; }
|
||||
|
||||
private:
|
||||
void setupTools();
|
||||
void doReCreateMenuBar() override;
|
||||
|
||||
void setupUIConditions() override;
|
||||
|
||||
/**
|
||||
* Load the currently active workbook stored in the project settings. If there is none,
|
||||
* generate a filename for the currently active workbook and store it in the project settings.
|
||||
|
@ -152,11 +200,6 @@ private:
|
|||
*/
|
||||
void updateTitle();
|
||||
|
||||
/**
|
||||
* Give icons to menuitems of the main menubar.
|
||||
*/
|
||||
void setIconsForMenuItems();
|
||||
|
||||
/**
|
||||
* Add a new plot to the current panel.
|
||||
*
|
||||
|
@ -195,32 +238,6 @@ private:
|
|||
*/
|
||||
void applyTuners();
|
||||
|
||||
/**
|
||||
* Load plot settings from a file.
|
||||
*
|
||||
* @param aPath is the file name.
|
||||
* @return True if successful.
|
||||
*/
|
||||
bool loadWorkbook( const wxString& aPath );
|
||||
|
||||
/**
|
||||
* Save plot settings to a file.
|
||||
*
|
||||
* @param aPath is the file name.
|
||||
* @return True if successful.
|
||||
*/
|
||||
bool saveWorkbook( const wxString& aPath );
|
||||
|
||||
/**
|
||||
* Return the default filename (with extension) to be used in file browser dialog.
|
||||
*/
|
||||
wxString getDefaultFilename();
|
||||
|
||||
/**
|
||||
* Return the default path to be used in file browser dialog.
|
||||
*/
|
||||
wxString getDefaultPath();
|
||||
|
||||
/**
|
||||
* Return the currently opened plot panel (or NULL if there is none).
|
||||
*/
|
||||
|
@ -232,55 +249,11 @@ private:
|
|||
/**
|
||||
*
|
||||
*/
|
||||
wxString getCurrentSimCommand() const
|
||||
{
|
||||
if( getCurrentPlotWindow() == nullptr )
|
||||
return m_circuitModel->GetSheetSimCommand();
|
||||
else
|
||||
return m_workbook->GetSimCommand( getCurrentPlotWindow() );
|
||||
}
|
||||
|
||||
int getCurrentOptions() const
|
||||
{
|
||||
if( getCurrentPlotWindow() == nullptr )
|
||||
return m_circuitModel->GetSimOptions();
|
||||
else
|
||||
return m_workbook->GetSimOptions( getCurrentPlotWindow() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return X axis for a given simulation type.
|
||||
*/
|
||||
SIM_PLOT_TYPE getXAxisType( SIM_TYPE aType ) const;
|
||||
|
||||
// Menu handlers
|
||||
void menuNewPlot( wxCommandEvent& aEvent ) override;
|
||||
void menuOpenWorkbook( wxCommandEvent& event ) override;
|
||||
void menuSaveWorkbook( wxCommandEvent& event ) override;
|
||||
void menuSaveWorkbookAs( wxCommandEvent& event ) override;
|
||||
void menuExit( wxCommandEvent& event ) override;
|
||||
void menuSaveImage( wxCommandEvent& event ) override;
|
||||
void menuSaveCsv( wxCommandEvent& event ) override;
|
||||
void menuZoomIn( wxCommandEvent& event ) override;
|
||||
void menuZoomOut( wxCommandEvent& event ) override;
|
||||
void menuZoomFit( wxCommandEvent& event ) override;
|
||||
void menuShowGrid( wxCommandEvent& event ) override;
|
||||
void menuShowGridUpdate( wxUpdateUIEvent& event ) override;
|
||||
void menuShowLegend( wxCommandEvent& event ) override;
|
||||
void menuShowLegendUpdate( wxUpdateUIEvent& event ) override;
|
||||
void menuShowDotted( wxCommandEvent& event ) override;
|
||||
void menuShowDottedUpdate( wxUpdateUIEvent& event ) override;
|
||||
void menuWhiteBackground( wxCommandEvent& event ) override;
|
||||
void menuShowWhiteBackgroundUpdate( wxUpdateUIEvent& event ) override
|
||||
{
|
||||
event.Check( m_plotUseWhiteBg );
|
||||
}
|
||||
|
||||
void menuSimulateUpdate( wxUpdateUIEvent& event ) override;
|
||||
void menuAddSignalsUpdate( wxUpdateUIEvent& event ) override;
|
||||
void menuProbeUpdate( wxUpdateUIEvent& event ) override;
|
||||
void menuTuneUpdate( wxUpdateUIEvent& event ) override;
|
||||
|
||||
// Event handlers
|
||||
void onPlotClose( wxAuiNotebookEvent& event ) override;
|
||||
void onPlotClosed( wxAuiNotebookEvent& event ) override;
|
||||
|
@ -295,13 +268,6 @@ private:
|
|||
void onWorkbookModified( wxCommandEvent& event );
|
||||
void onWorkbookClrModified( wxCommandEvent& event );
|
||||
|
||||
void onSimulate( wxCommandEvent& event );
|
||||
void onSettings( wxCommandEvent& event );
|
||||
void onAddSignal( wxCommandEvent& event );
|
||||
void onProbe( wxCommandEvent& event );
|
||||
void onTune( wxCommandEvent& event );
|
||||
void onShowNetlist( wxCommandEvent& event );
|
||||
|
||||
bool canCloseWindow( wxCloseEvent& aEvent ) override;
|
||||
void doCloseWindow() override;
|
||||
|
||||
|
@ -311,27 +277,14 @@ private:
|
|||
void onSimStarted( wxCommandEvent& aEvent );
|
||||
void onSimFinished( wxCommandEvent& aEvent );
|
||||
|
||||
void onExit( wxCommandEvent& event );
|
||||
|
||||
// adjust the sash dimension of splitter windows after reading
|
||||
// the config settings
|
||||
// must be called after the config settings are read, and once the
|
||||
// frame is initialized (end of the Ctor)
|
||||
void setSubWindowsSashSize();
|
||||
|
||||
// Toolbar buttons
|
||||
wxToolBarToolBase* m_toolSimulate;
|
||||
wxToolBarToolBase* m_toolAddSignals;
|
||||
wxToolBarToolBase* m_toolProbe;
|
||||
wxToolBarToolBase* m_toolTune;
|
||||
wxToolBarToolBase* m_toolSettings;
|
||||
|
||||
SCH_EDIT_FRAME* m_schematicFrame;
|
||||
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> m_circuitModel;
|
||||
std::shared_ptr<SPICE_SIMULATOR> m_simulator;
|
||||
SIM_THREAD_REPORTER* m_reporter;
|
||||
|
||||
///< List of currently displayed tuners
|
||||
std::list<TUNER_SLIDER*> m_tuners;
|
||||
|
||||
enum CONTEXT_MENU_EVENTS
|
||||
{
|
||||
REMOVE_SIGNAL = 944,
|
||||
|
@ -365,21 +318,29 @@ private:
|
|||
SIM_PLOT_FRAME* m_plotFrame;
|
||||
};
|
||||
|
||||
private:
|
||||
SCH_EDIT_FRAME* m_schematicFrame;
|
||||
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> m_circuitModel;
|
||||
std::shared_ptr<SPICE_SIMULATOR> m_simulator;
|
||||
SIM_THREAD_REPORTER* m_reporter;
|
||||
|
||||
std::list<TUNER_SLIDER*> m_tuners;
|
||||
|
||||
///< Panel that was used as the most recent one for simulations
|
||||
SIM_PANEL_BASE* m_lastSimPlot;
|
||||
SIM_PANEL_BASE* m_lastSimPlot;
|
||||
|
||||
///< imagelists used to add a small colored icon to signal names
|
||||
///< and cursors name, the same color as the corresponding signal traces
|
||||
wxImageList* m_signalsIconColorList;
|
||||
wxImageList* m_signalsIconColorList;
|
||||
|
||||
// Variables for temporary storage:
|
||||
int m_splitterLeftRightSashPosition;
|
||||
int m_splitterPlotAndConsoleSashPosition;
|
||||
int m_splitterSignalsSashPosition;
|
||||
int m_splitterTuneValuesSashPosition;
|
||||
bool m_plotUseWhiteBg;
|
||||
unsigned int m_plotNumber;
|
||||
bool m_simFinished;
|
||||
int m_splitterLeftRightSashPosition;
|
||||
int m_splitterPlotAndConsoleSashPosition;
|
||||
int m_splitterSignalsSashPosition;
|
||||
int m_splitterTuneValuesSashPosition;
|
||||
bool m_darkMode;
|
||||
unsigned int m_plotNumber;
|
||||
bool m_simFinished;
|
||||
};
|
||||
|
||||
// Commands
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "tool/action_toolbar.h"
|
||||
|
||||
#include "sim_plot_frame_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -13,115 +15,9 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
{
|
||||
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
|
||||
|
||||
m_mainMenu = new wxMenuBar( 0 );
|
||||
m_fileMenu = new wxMenu();
|
||||
wxMenuItem* m_newPlot;
|
||||
m_newPlot = new wxMenuItem( m_fileMenu, wxID_NEW, wxString( _("New Plot") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_fileMenu->Append( m_newPlot );
|
||||
|
||||
m_fileMenu->AppendSeparator();
|
||||
|
||||
wxMenuItem* m_openWorkbook;
|
||||
m_openWorkbook = new wxMenuItem( m_fileMenu, wxID_OPEN, wxString( _("Open Workbook...") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_fileMenu->Append( m_openWorkbook );
|
||||
|
||||
wxMenuItem* m_saveWorkbook;
|
||||
m_saveWorkbook = new wxMenuItem( m_fileMenu, wxID_SAVE, wxString( _("Save Workbook") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_fileMenu->Append( m_saveWorkbook );
|
||||
|
||||
wxMenuItem* m_saveWorkbookAs;
|
||||
m_saveWorkbookAs = new wxMenuItem( m_fileMenu, wxID_SAVEAS, wxString( _("Save Workbook As...") ) + wxT('\t') + wxT("SHIFT+CTRL+S"), wxEmptyString, wxITEM_NORMAL );
|
||||
m_fileMenu->Append( m_saveWorkbookAs );
|
||||
|
||||
m_fileMenu->AppendSeparator();
|
||||
|
||||
wxMenuItem* m_saveImage;
|
||||
m_saveImage = new wxMenuItem( m_fileMenu, ID_SAVE_AS_IMAGE, wxString( _("Export Current Plot as PNG...") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_fileMenu->Append( m_saveImage );
|
||||
|
||||
wxMenuItem* m_saveCsv;
|
||||
m_saveCsv = new wxMenuItem( m_fileMenu, ID_SAVE_AS_CSV, wxString( _("Export Current Plot as CSV...") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_fileMenu->Append( m_saveCsv );
|
||||
|
||||
m_fileMenu->AppendSeparator();
|
||||
|
||||
wxMenuItem* m_exitSim;
|
||||
m_exitSim = new wxMenuItem( m_fileMenu, wxID_CLOSE, wxString( _("Close") ) + wxT('\t') + wxT("CTRL+W"), wxEmptyString, wxITEM_NORMAL );
|
||||
m_fileMenu->Append( m_exitSim );
|
||||
|
||||
m_mainMenu->Append( m_fileMenu, _("File") );
|
||||
|
||||
m_simulationMenu = new wxMenu();
|
||||
m_runSimulation = new wxMenuItem( m_simulationMenu, ID_MENU_RUN_SIM, wxString( _("Run Simulation") ) + wxT('\t') + wxT("Ctrl+R"), wxEmptyString, wxITEM_NORMAL );
|
||||
m_simulationMenu->Append( m_runSimulation );
|
||||
m_runSimulation->Enable( false );
|
||||
|
||||
m_simulationMenu->AppendSeparator();
|
||||
|
||||
m_addSignals = new wxMenuItem( m_simulationMenu, ID_MENU_ADD_SIGNAL, wxString( _("Add Signals...") ) + wxT('\t') + wxT("Ctrl+A"), wxEmptyString, wxITEM_NORMAL );
|
||||
m_simulationMenu->Append( m_addSignals );
|
||||
m_addSignals->Enable( false );
|
||||
|
||||
m_probeSignals = new wxMenuItem( m_simulationMenu, ID_MENU_PROBE_SIGNALS, wxString( _("Probe from schematics") ) + wxT('\t') + wxT("Ctrl+P"), wxEmptyString, wxITEM_NORMAL );
|
||||
m_simulationMenu->Append( m_probeSignals );
|
||||
m_probeSignals->Enable( false );
|
||||
|
||||
m_tuneValue = new wxMenuItem( m_simulationMenu, ID_MENU_TUNE_SIGNALS, wxString( _("Tune Component Value") ) + wxT('\t') + wxT("Ctrl+T"), wxEmptyString, wxITEM_NORMAL );
|
||||
m_simulationMenu->Append( m_tuneValue );
|
||||
m_tuneValue->Enable( false );
|
||||
|
||||
m_simulationMenu->AppendSeparator();
|
||||
|
||||
m_showNetlist = new wxMenuItem( m_simulationMenu, ID_MENU_SHOW_NETLIST, wxString( _("Show SPICE Netlist...") ) , _("Shows current simulation's netlist. Useful for debugging SPICE errors."), wxITEM_NORMAL );
|
||||
m_simulationMenu->Append( m_showNetlist );
|
||||
|
||||
m_simulationMenu->AppendSeparator();
|
||||
|
||||
m_boardAdapter = new wxMenuItem( m_simulationMenu, ID_MENU_SET_SIMUL, wxString( _("Settings...") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_simulationMenu->Append( m_boardAdapter );
|
||||
|
||||
m_mainMenu->Append( m_simulationMenu, _("Simulation") );
|
||||
|
||||
m_viewMenu = new wxMenu();
|
||||
wxMenuItem* m_zoomIn;
|
||||
m_zoomIn = new wxMenuItem( m_viewMenu, wxID_ZOOM_IN, wxString( _("Zoom In") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_viewMenu->Append( m_zoomIn );
|
||||
|
||||
wxMenuItem* m_zoomOut;
|
||||
m_zoomOut = new wxMenuItem( m_viewMenu, wxID_ZOOM_OUT, wxString( _("Zoom Out") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_viewMenu->Append( m_zoomOut );
|
||||
|
||||
wxMenuItem* m_zoomFit;
|
||||
m_zoomFit = new wxMenuItem( m_viewMenu, wxID_ZOOM_FIT, wxString( _("Fit on Screen") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
m_viewMenu->Append( m_zoomFit );
|
||||
|
||||
m_viewMenu->AppendSeparator();
|
||||
|
||||
wxMenuItem* m_showGrid;
|
||||
m_showGrid = new wxMenuItem( m_viewMenu, ID_MENU_SHOW_GRID, wxString( _("Show &Grid") ) , wxEmptyString, wxITEM_CHECK );
|
||||
m_viewMenu->Append( m_showGrid );
|
||||
|
||||
wxMenuItem* m_showLegend;
|
||||
m_showLegend = new wxMenuItem( m_viewMenu, ID_MENU_SHOW_LEGEND, wxString( _("Show &Legend") ) , wxEmptyString, wxITEM_CHECK );
|
||||
m_viewMenu->Append( m_showLegend );
|
||||
|
||||
m_viewMenu->AppendSeparator();
|
||||
|
||||
wxMenuItem* m_showDotted;
|
||||
m_showDotted = new wxMenuItem( m_viewMenu, ID_MENU_DOTTED, wxString( _("Dotted Current/Phase") ) , wxEmptyString, wxITEM_CHECK );
|
||||
m_viewMenu->Append( m_showDotted );
|
||||
|
||||
wxMenuItem* m_showWhiteBackground;
|
||||
m_showWhiteBackground = new wxMenuItem( m_viewMenu, ID_MENU_WHITE_BG, wxString( _("White Background") ) , wxEmptyString, wxITEM_CHECK );
|
||||
m_viewMenu->Append( m_showWhiteBackground );
|
||||
|
||||
m_mainMenu->Append( m_viewMenu, _("View") );
|
||||
|
||||
this->SetMenuBar( m_mainMenu );
|
||||
|
||||
m_sizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT );
|
||||
m_toolBar = new ACTION_TOOLBAR( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_DEFAULT_STYLE|wxAUI_TB_HORZ_LAYOUT|wxAUI_TB_PLAIN_BACKGROUND );
|
||||
m_toolBar->Realize();
|
||||
|
||||
m_sizerMain->Add( m_toolBar, 0, wxEXPAND, 5 );
|
||||
|
@ -276,28 +172,6 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuNewPlot ), this, m_newPlot->GetId());
|
||||
m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuOpenWorkbook ), this, m_openWorkbook->GetId());
|
||||
m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbook ), this, m_saveWorkbook->GetId());
|
||||
m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbookAs ), this, m_saveWorkbookAs->GetId());
|
||||
m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveImage ), this, m_saveImage->GetId());
|
||||
m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveCsv ), this, m_saveCsv->GetId());
|
||||
m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuExit ), this, m_exitSim->GetId());
|
||||
this->Connect( m_runSimulation->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuSimulateUpdate ) );
|
||||
this->Connect( m_addSignals->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuAddSignalsUpdate ) );
|
||||
this->Connect( m_probeSignals->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuProbeUpdate ) );
|
||||
this->Connect( m_tuneValue->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuTuneUpdate ) );
|
||||
m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomIn ), this, m_zoomIn->GetId());
|
||||
m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomOut ), this, m_zoomOut->GetId());
|
||||
m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomFit ), this, m_zoomFit->GetId());
|
||||
m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowGrid ), this, m_showGrid->GetId());
|
||||
this->Connect( m_showGrid->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) );
|
||||
m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegend ), this, m_showLegend->GetId());
|
||||
this->Connect( m_showLegend->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) );
|
||||
m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowDotted ), this, m_showDotted->GetId());
|
||||
this->Connect( m_showDotted->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowDottedUpdate ) );
|
||||
m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuWhiteBackground ), this, m_showWhiteBackground->GetId());
|
||||
this->Connect( m_showWhiteBackground->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowWhiteBackgroundUpdate ) );
|
||||
m_workbook->Connect( wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotDragged ), NULL, this );
|
||||
m_workbook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this );
|
||||
m_workbook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this );
|
||||
|
@ -310,14 +184,6 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
SIM_PLOT_FRAME_BASE::~SIM_PLOT_FRAME_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect( ID_MENU_RUN_SIM, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuSimulateUpdate ) );
|
||||
this->Disconnect( ID_MENU_ADD_SIGNAL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuAddSignalsUpdate ) );
|
||||
this->Disconnect( ID_MENU_PROBE_SIGNALS, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuProbeUpdate ) );
|
||||
this->Disconnect( ID_MENU_TUNE_SIGNALS, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuTuneUpdate ) );
|
||||
this->Disconnect( ID_MENU_SHOW_GRID, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) );
|
||||
this->Disconnect( ID_MENU_SHOW_LEGEND, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) );
|
||||
this->Disconnect( ID_MENU_DOTTED, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowDottedUpdate ) );
|
||||
this->Disconnect( ID_MENU_WHITE_BG, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowWhiteBackgroundUpdate ) );
|
||||
m_workbook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotDragged ), NULL, this );
|
||||
m_workbook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this );
|
||||
m_workbook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this );
|
||||
|
|
|
@ -57,367 +57,16 @@
|
|||
<property name="window_name">SIM_PLOT_FRAME</property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<property name="xrc_skip_sizer">1</property>
|
||||
<object class="wxMenuBar" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</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">m_mainMenu</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; </property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<object class="wxMenu" expanded="1">
|
||||
<property name="label">File</property>
|
||||
<property name="name">m_fileMenu</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">wxID_NEW</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">New Plot</property>
|
||||
<property name="name">m_newPlot</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuNewPlot</event>
|
||||
</object>
|
||||
<object class="separator" expanded="0">
|
||||
<property name="name">m_separator3</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">wxID_OPEN</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Open Workbook...</property>
|
||||
<property name="name">m_openWorkbook</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuOpenWorkbook</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">wxID_SAVE</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Save Workbook</property>
|
||||
<property name="name">m_saveWorkbook</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuSaveWorkbook</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">wxID_SAVEAS</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Save Workbook As...</property>
|
||||
<property name="name">m_saveWorkbookAs</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut">SHIFT+CTRL+S</property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuSaveWorkbookAs</event>
|
||||
</object>
|
||||
<object class="separator" expanded="0">
|
||||
<property name="name">m_separator1</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_SAVE_AS_IMAGE</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Export Current Plot as PNG...</property>
|
||||
<property name="name">m_saveImage</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuSaveImage</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_SAVE_AS_CSV</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Export Current Plot as CSV...</property>
|
||||
<property name="name">m_saveCsv</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuSaveCsv</event>
|
||||
</object>
|
||||
<object class="separator" expanded="0">
|
||||
<property name="name">m_separator4</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">wxID_CLOSE</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Close</property>
|
||||
<property name="name">m_exitSim</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut">CTRL+W</property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuExit</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxMenu" expanded="1">
|
||||
<property name="label">Simulation</property>
|
||||
<property name="name">m_simulationMenu</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">0</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_RUN_SIM</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Run Simulation</property>
|
||||
<property name="name">m_runSimulation</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="shortcut">Ctrl+R</property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnUpdateUI">menuSimulateUpdate</event>
|
||||
</object>
|
||||
<object class="separator" expanded="0">
|
||||
<property name="name">m_separator31</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">0</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_ADD_SIGNAL</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Add Signals...</property>
|
||||
<property name="name">m_addSignals</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="shortcut">Ctrl+A</property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnUpdateUI">menuAddSignalsUpdate</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">0</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_PROBE_SIGNALS</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Probe from schematics</property>
|
||||
<property name="name">m_probeSignals</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="shortcut">Ctrl+P</property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnUpdateUI">menuProbeUpdate</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">0</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_TUNE_SIGNALS</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Tune Component Value</property>
|
||||
<property name="name">m_tuneValue</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="shortcut">Ctrl+T</property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnUpdateUI">menuTuneUpdate</event>
|
||||
</object>
|
||||
<object class="separator" expanded="0">
|
||||
<property name="name">m_separator7</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help">Shows current simulation's netlist. Useful for debugging SPICE errors.</property>
|
||||
<property name="id">ID_MENU_SHOW_NETLIST</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Show SPICE Netlist...</property>
|
||||
<property name="name">m_showNetlist</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
</object>
|
||||
<object class="separator" expanded="0">
|
||||
<property name="name">m_separator41</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_SET_SIMUL</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Settings...</property>
|
||||
<property name="name">m_boardAdapter</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxMenu" expanded="1">
|
||||
<property name="label">View</property>
|
||||
<property name="name">m_viewMenu</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">wxID_ZOOM_IN</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Zoom In</property>
|
||||
<property name="name">m_zoomIn</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuZoomIn</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">wxID_ZOOM_OUT</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Zoom Out</property>
|
||||
<property name="name">m_zoomOut</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuZoomOut</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">wxID_ZOOM_FIT</property>
|
||||
<property name="kind">wxITEM_NORMAL</property>
|
||||
<property name="label">Fit on Screen</property>
|
||||
<property name="name">m_zoomFit</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuZoomFit</event>
|
||||
</object>
|
||||
<object class="separator" expanded="0">
|
||||
<property name="name">m_separator2</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_SHOW_GRID</property>
|
||||
<property name="kind">wxITEM_CHECK</property>
|
||||
<property name="label">Show &Grid</property>
|
||||
<property name="name">m_showGrid</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuShowGrid</event>
|
||||
<event name="OnUpdateUI">menuShowGridUpdate</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_SHOW_LEGEND</property>
|
||||
<property name="kind">wxITEM_CHECK</property>
|
||||
<property name="label">Show &Legend</property>
|
||||
<property name="name">m_showLegend</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuShowLegend</event>
|
||||
<event name="OnUpdateUI">menuShowLegendUpdate</event>
|
||||
</object>
|
||||
<object class="separator" expanded="0">
|
||||
<property name="name">m_separator21</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_DOTTED</property>
|
||||
<property name="kind">wxITEM_CHECK</property>
|
||||
<property name="label">Dotted Current/Phase</property>
|
||||
<property name="name">m_showDotted</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuShowDotted</event>
|
||||
<event name="OnUpdateUI">menuShowDottedUpdate</event>
|
||||
</object>
|
||||
<object class="wxMenuItem" expanded="0">
|
||||
<property name="bitmap"></property>
|
||||
<property name="checked">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="help"></property>
|
||||
<property name="id">ID_MENU_WHITE_BG</property>
|
||||
<property name="kind">wxITEM_CHECK</property>
|
||||
<property name="label">White Background</property>
|
||||
<property name="name">m_showWhiteBackground</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="shortcut"></property>
|
||||
<property name="unchecked_bitmap"></property>
|
||||
<event name="OnMenuSelection">menuWhiteBackground</event>
|
||||
<event name="OnUpdateUI">menuShowWhiteBackgroundUpdate</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxToolBar" expanded="0">
|
||||
<object class="wxAuiToolBar" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -446,6 +95,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label_visible">0</property>
|
||||
<property name="margins"></property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
|
@ -466,10 +116,12 @@
|
|||
<property name="separation">5</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="style">wxAUI_TB_DEFAULT_STYLE|wxAUI_TB_HORZ_LAYOUT|wxAUI_TB_PLAIN_BACKGROUND</property>
|
||||
<property name="subclass">ACTION_TOOLBAR; tool/action_toolbar.h; forward_declare</property>
|
||||
<property name="toolbar_label">label</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="use_explicit_ids">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
|
|
@ -10,20 +10,18 @@
|
|||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class ACTION_TOOLBAR;
|
||||
class wxListView;
|
||||
|
||||
#include "sim_workbook.h"
|
||||
#include "kiway_player.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/menu.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/aui/aui.h>
|
||||
#include <wx/aui/auibar.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/toolbar.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/aui/auibook.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
|
@ -35,18 +33,6 @@ class wxListView;
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define ID_SAVE_AS_IMAGE 1000
|
||||
#define ID_SAVE_AS_CSV 1001
|
||||
#define ID_MENU_RUN_SIM 1002
|
||||
#define ID_MENU_ADD_SIGNAL 1003
|
||||
#define ID_MENU_PROBE_SIGNALS 1004
|
||||
#define ID_MENU_TUNE_SIGNALS 1005
|
||||
#define ID_MENU_SHOW_NETLIST 1006
|
||||
#define ID_MENU_SET_SIMUL 1007
|
||||
#define ID_MENU_SHOW_GRID 1008
|
||||
#define ID_MENU_SHOW_LEGEND 1009
|
||||
#define ID_MENU_DOTTED 1010
|
||||
#define ID_MENU_WHITE_BG 1011
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class SIM_PLOT_FRAME_BASE
|
||||
|
@ -56,18 +42,8 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER
|
|||
private:
|
||||
|
||||
protected:
|
||||
wxMenuBar* m_mainMenu;
|
||||
wxMenu* m_fileMenu;
|
||||
wxMenu* m_simulationMenu;
|
||||
wxMenuItem* m_runSimulation;
|
||||
wxMenuItem* m_addSignals;
|
||||
wxMenuItem* m_probeSignals;
|
||||
wxMenuItem* m_tuneValue;
|
||||
wxMenuItem* m_showNetlist;
|
||||
wxMenuItem* m_boardAdapter;
|
||||
wxMenu* m_viewMenu;
|
||||
wxBoxSizer* m_sizerMain;
|
||||
wxToolBar* m_toolBar;
|
||||
ACTION_TOOLBAR* m_toolBar;
|
||||
wxSplitterWindow* m_splitterLeftRight;
|
||||
wxPanel* m_panelLeft;
|
||||
wxBoxSizer* m_sizer11;
|
||||
|
@ -94,28 +70,6 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER
|
|||
wxBoxSizer* m_tuneSizer;
|
||||
|
||||
// Virtual event handlers, override them in your derived class
|
||||
virtual void menuNewPlot( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuOpenWorkbook( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuSaveWorkbook( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuSaveWorkbookAs( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuSaveImage( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuSaveCsv( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuExit( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuSimulateUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void menuAddSignalsUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void menuProbeUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void menuTuneUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void menuZoomIn( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuZoomOut( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuZoomFit( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuShowGrid( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuShowGridUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void menuShowLegend( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuShowLegendUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void menuShowDotted( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuShowDottedUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void menuWhiteBackground( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void menuShowWhiteBackgroundUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void onPlotDragged( wxAuiNotebookEvent& event ) { event.Skip(); }
|
||||
virtual void onPlotChanged( wxAuiNotebookEvent& event ) { event.Skip(); }
|
||||
virtual void onPlotClose( wxAuiNotebookEvent& event ) { event.Skip(); }
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 CERN
|
||||
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
|
@ -302,14 +302,13 @@ void CURSOR::UpdateReference()
|
|||
|
||||
|
||||
SIM_PLOT_PANEL::SIM_PLOT_PANEL( const wxString& aCommand, int aOptions, wxWindow* parent,
|
||||
SIM_PLOT_FRAME* aMainFrame, wxWindowID id, const wxPoint& pos,
|
||||
const wxSize& size, long style, const wxString& name )
|
||||
wxWindowID id, const wxPoint& pos, const wxSize& size, long style,
|
||||
const wxString& name )
|
||||
: SIM_PANEL_BASE( aCommand, aOptions, parent, id, pos, size, style, name ),
|
||||
m_axis_x( nullptr ),
|
||||
m_axis_y1( nullptr ),
|
||||
m_axis_y2( nullptr ),
|
||||
m_dotted_cp( false ),
|
||||
m_masterFrame( aMainFrame )
|
||||
m_dotted_cp( false )
|
||||
{
|
||||
m_sizer = new wxBoxSizer( wxVERTICAL );
|
||||
m_plotWin = new mpWindow( this, wxID_ANY, pos, size, style );
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 CERN
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
|
@ -168,13 +168,13 @@ public:
|
|||
|
||||
|
||||
protected:
|
||||
CURSOR* m_cursor;
|
||||
CURSOR* m_cursor;
|
||||
SIM_PLOT_TYPE m_type;
|
||||
wxColour m_traceColour;
|
||||
wxColour m_traceColour;
|
||||
|
||||
private:
|
||||
///< Name of the signal parameter
|
||||
wxString m_param;
|
||||
wxString m_param;
|
||||
};
|
||||
|
||||
|
||||
|
@ -183,19 +183,12 @@ class SIM_PLOT_PANEL : public SIM_PANEL_BASE
|
|||
friend class SIM_WORKBOOK;
|
||||
|
||||
public:
|
||||
SIM_PLOT_PANEL( const wxString& aCommand, int aOptions, wxWindow* parent,
|
||||
SIM_PLOT_FRAME* aMainFrame, wxWindowID id,
|
||||
SIM_PLOT_PANEL( const wxString& aCommand, int aOptions, wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = 0, const wxString& name = wxPanelNameStr );
|
||||
|
||||
virtual ~SIM_PLOT_PANEL();
|
||||
|
||||
///< set the pointer to the sim plot frame
|
||||
void SetMasterFrame( SIM_PLOT_FRAME* aFrame )
|
||||
{
|
||||
m_masterFrame = aFrame;
|
||||
}
|
||||
|
||||
wxString GetLabelX() const
|
||||
{
|
||||
return m_axis_x ? m_axis_x->GetName() : "";
|
||||
|
@ -256,19 +249,20 @@ public:
|
|||
return m_legend->IsVisible();
|
||||
}
|
||||
|
||||
void SetDottedCurrentPhase( bool aEnable )
|
||||
/**
|
||||
* Draw secondary signal traces (current or phase) with dotted lines
|
||||
*/
|
||||
void SetDottedSecondary( bool aEnable )
|
||||
{
|
||||
m_dotted_cp = aEnable;
|
||||
|
||||
for( const auto& tr : m_traces )
|
||||
{
|
||||
UpdateTraceStyle( tr.second );
|
||||
}
|
||||
|
||||
m_plotWin->UpdateAll();
|
||||
}
|
||||
|
||||
bool GetDottedCurrentPhase() const
|
||||
bool GetDottedSecondary() const
|
||||
{
|
||||
return m_dotted_cp;
|
||||
}
|
||||
|
@ -304,25 +298,24 @@ private:
|
|||
///> Create/Ensure axes are available for plotting
|
||||
void updateAxes();
|
||||
|
||||
SIM_PLOT_COLORS m_colors;
|
||||
private:
|
||||
SIM_PLOT_COLORS m_colors;
|
||||
|
||||
// Top-level plot window
|
||||
mpWindow* m_plotWin;
|
||||
wxBoxSizer* m_sizer;
|
||||
mpWindow* m_plotWin;
|
||||
wxBoxSizer* m_sizer;
|
||||
|
||||
// Traces to be plotted
|
||||
std::map<wxString, TRACE*> m_traces;
|
||||
|
||||
mpScaleXBase* m_axis_x;
|
||||
mpScaleY* m_axis_y1;
|
||||
mpScaleY* m_axis_y2;
|
||||
mpInfoLegend* m_legend;
|
||||
mpScaleXBase* m_axis_x;
|
||||
mpScaleY* m_axis_y1;
|
||||
mpScaleY* m_axis_y2;
|
||||
mpInfoLegend* m_legend;
|
||||
|
||||
bool m_dotted_cp;
|
||||
bool m_dotted_cp;
|
||||
|
||||
std::vector<mpLayer*> m_topLevel;
|
||||
|
||||
SIM_PLOT_FRAME* m_masterFrame;
|
||||
std::vector<mpLayer*> m_topLevel;
|
||||
};
|
||||
|
||||
wxDECLARE_EVENT( EVT_SIM_CURSOR_UPDATE, wxCommandEvent );
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 CERN
|
||||
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 3 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 <sim/sim_plot_frame.h>
|
||||
#include <tool/action_menu.h>
|
||||
#include <tool/action_toolbar.h>
|
||||
#include <tool/common_control.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/ee_actions.h>
|
||||
#include <widgets/wx_menubar.h>
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::ReCreateHToolbar()
|
||||
{
|
||||
if( m_toolBar )
|
||||
{
|
||||
m_toolBar->ClearToolbar();
|
||||
m_toolBar->SetToolManager( GetToolManager() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_toolBar = new ACTION_TOOLBAR( dynamic_cast<EDA_BASE_FRAME*>( this ), wxID_ANY,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
||||
}
|
||||
|
||||
m_toolBar->Add( EE_ACTIONS::openWorkbook );
|
||||
m_toolBar->Add( EE_ACTIONS::saveWorkbook );
|
||||
|
||||
m_toolBar->AddScaledSeparator( this );
|
||||
m_toolBar->Add( EE_ACTIONS::simCommand );
|
||||
|
||||
m_toolBar->AddScaledSeparator( this );
|
||||
m_toolBar->Add( EE_ACTIONS::runSimulation );
|
||||
m_toolBar->Add( EE_ACTIONS::stopSimulation );
|
||||
|
||||
m_toolBar->AddScaledSeparator( this );
|
||||
m_toolBar->Add( ACTIONS::zoomInCenter );
|
||||
m_toolBar->Add( ACTIONS::zoomOutCenter );
|
||||
m_toolBar->Add( ACTIONS::zoomFitScreen );
|
||||
|
||||
m_toolBar->AddScaledSeparator( this );
|
||||
m_toolBar->Add( EE_ACTIONS::addSignals );
|
||||
m_toolBar->Add( EE_ACTIONS::simProbe );
|
||||
m_toolBar->Add( EE_ACTIONS::simTune );
|
||||
|
||||
m_toolBar->AddScaledSeparator( this );
|
||||
m_toolBar->Add( EE_ACTIONS::showNetlist );
|
||||
|
||||
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
|
||||
m_toolBar->KiRealize();
|
||||
|
||||
m_toolBar->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::doReCreateMenuBar()
|
||||
{
|
||||
COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>();
|
||||
// wxWidgets handles the OSX Application menu behind the scenes, but that means
|
||||
// we always have to start from scratch with a new wxMenuBar.
|
||||
wxMenuBar* oldMenuBar = dynamic_cast<EDA_BASE_FRAME*>( this )->GetMenuBar();
|
||||
WX_MENUBAR* menuBar = new WX_MENUBAR();
|
||||
|
||||
//-- File menu -----------------------------------------------------------
|
||||
//
|
||||
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
fileMenu->Add( EE_ACTIONS::newPlot );
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Add( EE_ACTIONS::openWorkbook );
|
||||
fileMenu->Add( EE_ACTIONS::saveWorkbook );
|
||||
fileMenu->Add( EE_ACTIONS::saveWorkbookAs );
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Add( EE_ACTIONS::exportPlotAsPNG );
|
||||
fileMenu->Add( EE_ACTIONS::exportPlotAsCSV );
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->AddClose( _( "Simulator" ) );
|
||||
|
||||
//-- View menu -----------------------------------------------------------
|
||||
//
|
||||
ACTION_MENU* viewMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
viewMenu->Add( ACTIONS::zoomInCenter );
|
||||
viewMenu->Add( ACTIONS::zoomOutCenter );
|
||||
viewMenu->Add( ACTIONS::zoomFitScreen );
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->Add( ACTIONS::toggleGrid, ACTION_MENU::CHECK );
|
||||
viewMenu->Add( EE_ACTIONS::toggleLegend, ACTION_MENU::CHECK );
|
||||
viewMenu->Add( EE_ACTIONS::toggleDottedSecondary, ACTION_MENU::CHECK );
|
||||
viewMenu->Add( EE_ACTIONS::toggleDarkModePlots, ACTION_MENU::CHECK );
|
||||
|
||||
//-- Simulation menu -----------------------------------------------------------
|
||||
//
|
||||
ACTION_MENU* simulationMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
simulationMenu->Add( EE_ACTIONS::simCommand );
|
||||
simulationMenu->Add( EE_ACTIONS::runSimulation );
|
||||
|
||||
simulationMenu->AppendSeparator();
|
||||
simulationMenu->Add( EE_ACTIONS::addSignals );
|
||||
simulationMenu->Add( EE_ACTIONS::simProbe );
|
||||
simulationMenu->Add( EE_ACTIONS::simTune );
|
||||
|
||||
simulationMenu->AppendSeparator();
|
||||
simulationMenu->Add( EE_ACTIONS::showNetlist );
|
||||
|
||||
//-- Menubar -------------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
menuBar->Append( viewMenu, _( "&View" ) );
|
||||
menuBar->Append( simulationMenu, _( "&Simulation" ) );
|
||||
dynamic_cast<EDA_BASE_FRAME*>( this )->AddStandardHelpMenu( menuBar );
|
||||
|
||||
dynamic_cast<EDA_BASE_FRAME*>( this )->SetMenuBar( menuBar );
|
||||
delete oldMenuBar;
|
||||
}
|
|
@ -109,7 +109,7 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
|
|||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( EE_ACTIONS::annotate );
|
||||
m_mainToolBar->Add( EE_ACTIONS::runERC );
|
||||
m_mainToolBar->Add( EE_ACTIONS::runSimulation );
|
||||
m_mainToolBar->Add( EE_ACTIONS::showSimulator );
|
||||
m_mainToolBar->Add( EE_ACTIONS::assignFootprints );
|
||||
m_mainToolBar->Add( EE_ACTIONS::editSymbolFields );
|
||||
m_mainToolBar->Add( EE_ACTIONS::generateBOM );
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2023 CERN
|
||||
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -50,7 +50,7 @@ TOOL_ACTION EE_ACTIONS::checkSymbol( "eeschema.InspectionTool.checkSymbol",
|
|||
_( "Symbol Checker" ), _( "Show the symbol checker window" ),
|
||||
BITMAPS::erc );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::runSimulation( "eeschema.EditorControl.runSimulation",
|
||||
TOOL_ACTION EE_ACTIONS::showSimulator( "eeschema.EditorControl.showSimulator",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Simulator..." ), _( "Simulate circuit in SPICE" ),
|
||||
BITMAPS::simulator );
|
||||
|
@ -563,14 +563,6 @@ TOOL_ACTION EE_ACTIONS::slice( "eeschema.InteractiveEdit.slice",
|
|||
TOOL_ACTION EE_ACTIONS::restartMove( "eeschema.EditorControl.restartMove",
|
||||
AS_GLOBAL );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::simProbe( "eeschema.Simulation.probe",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Add a simulator probe" ), "" );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::simTune( "eeschema.Simulation.tune",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Select a value to be tuned" ), "" );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::highlightNet( "eeschema.EditorControl.highlightNet",
|
||||
AS_GLOBAL,
|
||||
'`', "",
|
||||
|
@ -902,3 +894,94 @@ TOOL_ACTION EE_ACTIONS::saveCurrSheetCopyAs( "eeschema.EditorControl.saveCurrShe
|
|||
// Drag and drop
|
||||
TOOL_ACTION EE_ACTIONS::ddAppendFile( "eeschema.EditorControl.ddAppendFile",
|
||||
AS_GLOBAL );
|
||||
|
||||
// SIMULATOR
|
||||
TOOL_ACTION EE_ACTIONS::newPlot( "eeschema.Simulation.newPlot",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'N', LEGACY_HK_NAME( "New" ),
|
||||
_( "New Plot" ), "",
|
||||
BITMAPS::new_generic );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::openWorkbook( "eeschema.Simulation.openWorkbook",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'O', LEGACY_HK_NAME( "Open" ),
|
||||
_( "Open Workbook..." ), "",
|
||||
BITMAPS::directory_open );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::saveWorkbook( "eeschema.Simulation.saveWorkbook",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
|
||||
_( "Save Workbook" ), "",
|
||||
BITMAPS::save );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::saveWorkbookAs( "eeschema.Simulation.saveWorkbookAs",
|
||||
AS_GLOBAL,
|
||||
MD_SHIFT + MD_CTRL + 'S', LEGACY_HK_NAME( "Save As" ),
|
||||
_( "Save Workbook As..." ), "",
|
||||
BITMAPS::sim_add_signal );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::exportPlotAsPNG( "eeschema.Simulator.exportPNG",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Export Current Plot as PNG..." ), "",
|
||||
BITMAPS::export_png );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::exportPlotAsCSV( "eeschema.Simulator.exportCSV",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Export Current Plot as CSV..." ), "",
|
||||
BITMAPS::export_file );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::toggleLegend( "eeschema.Simulator.toggleLegend",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Show Legend" ), "",
|
||||
BITMAPS::text );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::toggleDottedSecondary( "eeschema.Simulator.toggleDottedSecondary",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Dotted Current/Phase" ),
|
||||
_( "Draw secondary signal trace (current or phase) with a dotted line" ) );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::toggleDarkModePlots( "eeschema.Simulator.toggleDarkModePlots",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Dark Mode Plots" ),
|
||||
_( "Draw plots with a black background" ) );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::simCommand( "eeschema.Simulation.simCommand",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Simulation Command..." ),
|
||||
_( "Edit the simulation command for the current plot tab" ),
|
||||
BITMAPS::sim_command );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::runSimulation( "eeschema.Simulation.runSimulation",
|
||||
AS_GLOBAL,
|
||||
'R', "",
|
||||
_( "Run Simulation" ), "",
|
||||
BITMAPS::sim_run );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::stopSimulation( "eeschema.Simulation.stopSimulation",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Stop Simulation" ), "",
|
||||
BITMAPS::sim_stop );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::addSignals( "eeschema.Simulation.addSignals",
|
||||
AS_GLOBAL,
|
||||
'A', "",
|
||||
_( "Add Signals..." ), "",
|
||||
BITMAPS::sim_add_signal );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::simProbe( "eeschema.Simulation.probe",
|
||||
AS_GLOBAL,
|
||||
'P', "",
|
||||
_( "Probe Schematic..." ), _( "Add a simulator probe" ),
|
||||
BITMAPS::sim_probe );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::simTune( "eeschema.Simulation.tune",
|
||||
AS_GLOBAL,
|
||||
'T', "",
|
||||
_( "Add Tuned Value..." ), _( "Select a value to be tuned" ),
|
||||
BITMAPS::sim_tune );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::showNetlist( "eeschema.Simulation.showNetlist",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Show SPICE Netlist" ), "",
|
||||
BITMAPS::netlist );
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2023 CERN
|
||||
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -241,9 +241,23 @@ public:
|
|||
static TOOL_ACTION toggleAnnotateAuto;
|
||||
|
||||
// SPICE
|
||||
static TOOL_ACTION runSimulation;
|
||||
static TOOL_ACTION newPlot;
|
||||
static TOOL_ACTION openWorkbook;
|
||||
static TOOL_ACTION saveWorkbook;
|
||||
static TOOL_ACTION saveWorkbookAs;
|
||||
static TOOL_ACTION exportPlotAsPNG;
|
||||
static TOOL_ACTION exportPlotAsCSV;
|
||||
static TOOL_ACTION showSimulator;
|
||||
static TOOL_ACTION simProbe;
|
||||
static TOOL_ACTION simTune;
|
||||
static TOOL_ACTION toggleLegend;
|
||||
static TOOL_ACTION toggleDottedSecondary;
|
||||
static TOOL_ACTION toggleDarkModePlots;
|
||||
static TOOL_ACTION simCommand;
|
||||
static TOOL_ACTION runSimulation;
|
||||
static TOOL_ACTION stopSimulation;
|
||||
static TOOL_ACTION addSignals;
|
||||
static TOOL_ACTION showNetlist;
|
||||
|
||||
// Net highlighting
|
||||
static TOOL_ACTION highlightNet;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2023 CERN
|
||||
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -350,7 +350,7 @@ void EE_INSPECTION_TOOL::setTransitions()
|
|||
Go( &EE_INSPECTION_TOOL::ExcludeMarker, EE_ACTIONS::excludeMarker.MakeEvent() );
|
||||
|
||||
Go( &EE_INSPECTION_TOOL::CheckSymbol, EE_ACTIONS::checkSymbol.MakeEvent() );
|
||||
Go( &EE_INSPECTION_TOOL::RunSimulation, EE_ACTIONS::runSimulation.MakeEvent() );
|
||||
Go( &EE_INSPECTION_TOOL::RunSimulation, EE_ACTIONS::showSimulator.MakeEvent() );
|
||||
|
||||
Go( &EE_INSPECTION_TOOL::ShowDatasheet, EE_ACTIONS::showDatasheet.MakeEvent() );
|
||||
|
||||
|
|
|
@ -0,0 +1,443 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 <wx/ffile.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx_filename.h>
|
||||
#include <wx/stc/stc.h>
|
||||
|
||||
#include <kiway.h>
|
||||
#include <confirm.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <project/project_file.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <sim/sim_plot_frame.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/ee_actions.h>
|
||||
#include <tools/simulator_control.h>
|
||||
#include <dialogs/dialog_signal_list.h>
|
||||
#include <scintilla_tricks.h>
|
||||
|
||||
|
||||
bool SIMULATOR_CONTROL::Init()
|
||||
{
|
||||
Reset( MODEL_RELOAD );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void SIMULATOR_CONTROL::Reset( RESET_REASON aReason )
|
||||
{
|
||||
m_plotFrame = getEditFrame<SIM_PLOT_FRAME>();
|
||||
|
||||
if( m_plotFrame )
|
||||
{
|
||||
m_schematicFrame = m_plotFrame->GetSchematicFrame();
|
||||
m_circuitModel = m_plotFrame->GetCircuitModel();
|
||||
m_simulator = m_plotFrame->GetSimulator();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::NewPlot( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
SIM_TYPE type = m_circuitModel->GetSimType();
|
||||
|
||||
if( SIM_PANEL_BASE::IsPlottable( type ) )
|
||||
m_plotFrame->NewPlotPanel( m_circuitModel->GetSimCommand(), m_circuitModel->GetSimOptions() );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::OpenWorkbook( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxFileDialog openDlg( m_plotFrame, _( "Open simulation workbook" ), getDefaultPath(), "",
|
||||
WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
if( openDlg.ShowModal() == wxID_CANCEL )
|
||||
return -1;
|
||||
|
||||
m_plotFrame->LoadWorkbook( openDlg.GetPath() );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxString SIMULATOR_CONTROL::getDefaultFilename()
|
||||
{
|
||||
wxFileName filename = m_simulator->Settings()->GetWorkbookFilename();
|
||||
|
||||
if( filename.GetName().IsEmpty() )
|
||||
{
|
||||
if( m_plotFrame->Prj().GetProjectName().IsEmpty() )
|
||||
{
|
||||
filename.SetName( _( "noname" ) );
|
||||
filename.SetExt( WorkbookFileExtension );
|
||||
}
|
||||
else
|
||||
{
|
||||
filename.SetName( m_plotFrame->Prj().GetProjectName() );
|
||||
filename.SetExt( WorkbookFileExtension );
|
||||
}
|
||||
}
|
||||
|
||||
return filename.GetFullName();
|
||||
}
|
||||
|
||||
|
||||
wxString SIMULATOR_CONTROL::getDefaultPath()
|
||||
{
|
||||
wxFileName path = m_simulator->Settings()->GetWorkbookFilename();
|
||||
|
||||
path.Normalize( FN_NORMALIZE_FLAGS|wxPATH_NORM_ENV_VARS, m_plotFrame->Prj().GetProjectPath() );
|
||||
return path.GetPath();
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::SaveWorkbook( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxString filename;
|
||||
|
||||
if( aEvent.IsAction( &EE_ACTIONS::saveWorkbook ) )
|
||||
filename = m_simulator->Settings()->GetWorkbookFilename();
|
||||
|
||||
if( filename.IsEmpty() )
|
||||
{
|
||||
wxFileDialog saveAsDlg( m_plotFrame, _( "Save Simulation Workbook As" ), getDefaultPath(),
|
||||
getDefaultFilename(), WorkbookFileWildcard(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
|
||||
if( saveAsDlg.ShowModal() == wxID_CANCEL )
|
||||
return -1;
|
||||
|
||||
filename = saveAsDlg.GetPath();
|
||||
}
|
||||
|
||||
m_plotFrame->SaveWorkbook( m_plotFrame->Prj().AbsolutePath( filename ) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::ExportPlotAsPNG( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( !m_plotFrame->GetCurrentPlot() )
|
||||
return -1;
|
||||
|
||||
wxFileDialog saveDlg( m_plotFrame, _( "Save Plot as Image" ), "", "", PngFileWildcard(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
|
||||
if( saveDlg.ShowModal() == wxID_CANCEL )
|
||||
return -1;
|
||||
|
||||
m_plotFrame->GetCurrentPlot()->GetPlotWin()->SaveScreenshot( saveDlg.GetPath(),
|
||||
wxBITMAP_TYPE_PNG );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::ExportPlotAsCSV( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( !m_plotFrame->GetCurrentPlot() )
|
||||
return -1;
|
||||
|
||||
const wxChar SEPARATOR = ';';
|
||||
|
||||
wxFileDialog saveDlg( m_plotFrame, _( "Save Plot Data" ), "", "", CsvFileWildcard(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
|
||||
if( saveDlg.ShowModal() == wxID_CANCEL )
|
||||
return -1;
|
||||
|
||||
wxFFile out( saveDlg.GetPath(), "wb" );
|
||||
|
||||
std::map<wxString, TRACE*> traces = m_plotFrame->GetCurrentPlot()->GetTraces();
|
||||
|
||||
if( traces.size() == 0 )
|
||||
return -1;
|
||||
|
||||
SIM_TYPE simType = m_circuitModel->GetSimType();
|
||||
|
||||
std::size_t rowCount = traces.begin()->second->GetDataX().size();
|
||||
|
||||
// write column header names on the first row
|
||||
wxString xAxisName( m_simulator->GetXAxis( simType ) );
|
||||
out.Write( wxString::Format( wxT( "%s%c" ), xAxisName, SEPARATOR ) );
|
||||
|
||||
for( const auto& [name, trace] : traces )
|
||||
out.Write( wxString::Format( wxT( "%s%c" ), name, SEPARATOR ) );
|
||||
|
||||
out.Write( wxS( "\r\n" ) );
|
||||
|
||||
// write each row's numerical value
|
||||
for ( std::size_t curRow=0; curRow < rowCount; curRow++ )
|
||||
{
|
||||
double xAxisValue = traces.begin()->second->GetDataX().at( curRow );
|
||||
out.Write( wxString::Format( wxT( "%g%c" ), xAxisValue, SEPARATOR ) );
|
||||
|
||||
for( const auto& [name, trace] : traces )
|
||||
{
|
||||
double yAxisValue = trace->GetDataY().at( curRow );
|
||||
out.Write( wxString::Format( wxT( "%g%c" ), yAxisValue, SEPARATOR ) );
|
||||
}
|
||||
|
||||
out.Write( wxS( "\r\n" ) );
|
||||
}
|
||||
|
||||
out.Close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::Close( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_plotFrame->Close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::Zoom( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_plotFrame->GetCurrentPlot() )
|
||||
{
|
||||
if( aEvent.IsAction( &ACTIONS::zoomInCenter ) )
|
||||
m_plotFrame->GetCurrentPlot()->GetPlotWin()->ZoomIn();
|
||||
else if( aEvent.IsAction( &ACTIONS::zoomOutCenter ) )
|
||||
m_plotFrame->GetCurrentPlot()->GetPlotWin()->ZoomOut();
|
||||
else if( aEvent.IsAction( &ACTIONS::zoomFitScreen ) )
|
||||
m_plotFrame->GetCurrentPlot()->GetPlotWin()->Fit();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::ToggleGrid( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = m_plotFrame->GetCurrentPlot();
|
||||
|
||||
if( plot )
|
||||
plot->ShowGrid( !plot->IsGridShown() );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::ToggleLegend( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = m_plotFrame->GetCurrentPlot();
|
||||
|
||||
if( plot )
|
||||
plot->ShowLegend( !plot->IsLegendShown() );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::ToggleDottedSecondary( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
SIM_PLOT_PANEL* plot = m_plotFrame->GetCurrentPlot();
|
||||
|
||||
if( plot )
|
||||
plot->SetDottedSecondary( !plot->GetDottedSecondary() );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::ToggleDarkModePlots( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_plotFrame->ToggleDarkModePlots();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::EditSimCommand( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_plotFrame->EditSimCommand();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::RunSimulation( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_simulator->IsRunning() )
|
||||
m_simulator->Stop();
|
||||
else
|
||||
m_plotFrame->StartSimulation();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::AddSignals( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
SIM_PLOT_PANEL* plotPanel = m_plotFrame->GetCurrentPlot();
|
||||
|
||||
if( !plotPanel || !m_circuitModel || plotPanel->GetType() != m_circuitModel->GetSimType() )
|
||||
{
|
||||
DisplayInfoMessage( m_plotFrame, _( "You need to run plot-providing simulation first." ) );
|
||||
return -1;
|
||||
}
|
||||
|
||||
DIALOG_SIGNAL_LIST dialog( m_plotFrame, m_circuitModel.get() );
|
||||
dialog.ShowModal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::Probe( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_schematicFrame == nullptr )
|
||||
return -1;
|
||||
|
||||
wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
|
||||
|
||||
if( blocking_dialog )
|
||||
blocking_dialog->Close( true );
|
||||
|
||||
m_schematicFrame->GetToolManager()->RunAction( EE_ACTIONS::simProbe );
|
||||
m_schematicFrame->Raise();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::Tune( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_schematicFrame == nullptr )
|
||||
return -1;
|
||||
|
||||
wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
|
||||
|
||||
if( blocking_dialog )
|
||||
blocking_dialog->Close( true );
|
||||
|
||||
m_schematicFrame->GetToolManager()->RunAction( EE_ACTIONS::simTune );
|
||||
m_schematicFrame->Raise();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
class NETLIST_VIEW_DIALOG : public DIALOG_SHIM
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
MARGIN_LINE_NUMBERS
|
||||
};
|
||||
|
||||
void onClose( wxCloseEvent& evt )
|
||||
{
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
|
||||
}
|
||||
|
||||
NETLIST_VIEW_DIALOG( wxWindow* parent, const wxString& source) :
|
||||
DIALOG_SHIM( parent, wxID_ANY, _( "SPICE Netlist" ), wxDefaultPosition,
|
||||
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
|
||||
{
|
||||
wxStyledTextCtrl* textCtrl = new wxStyledTextCtrl( this, wxID_ANY );
|
||||
textCtrl->SetMinSize( wxSize( 600, 400 ) );
|
||||
|
||||
textCtrl->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
|
||||
textCtrl->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) );
|
||||
textCtrl->StyleSetBackground( wxSTC_STYLE_LINENUMBER, wxColour( 220, 220, 220 ) );
|
||||
textCtrl->SetMarginType( MARGIN_LINE_NUMBERS, wxSTC_MARGIN_NUMBER );
|
||||
|
||||
wxFont fixedFont = KIUI::GetMonospacedUIFont();
|
||||
|
||||
for( int i = 0; i < wxSTC_STYLE_MAX; ++i )
|
||||
textCtrl->StyleSetFont( i, fixedFont );
|
||||
|
||||
textCtrl->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set
|
||||
|
||||
textCtrl->SetWrapMode( wxSTC_WRAP_WORD );
|
||||
|
||||
textCtrl->SetText( source );
|
||||
|
||||
textCtrl->SetLexer( wxSTC_LEX_SPICE );
|
||||
|
||||
wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
|
||||
sizer->Add( textCtrl, 1, wxEXPAND | wxALL, 5 );
|
||||
SetSizer( sizer );
|
||||
|
||||
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ),
|
||||
nullptr, this );
|
||||
|
||||
m_scintillaTricks = std::make_unique<SCINTILLA_TRICKS>( textCtrl, wxT( "{}" ), false );
|
||||
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
std::unique_ptr<SCINTILLA_TRICKS> m_scintillaTricks;
|
||||
};
|
||||
|
||||
|
||||
int SIMULATOR_CONTROL::ShowNetlist( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_schematicFrame == nullptr || m_simulator == nullptr )
|
||||
return -1;
|
||||
|
||||
wxString errors;
|
||||
WX_STRING_REPORTER reporter( &errors );
|
||||
STRING_FORMATTER formatter;
|
||||
|
||||
m_circuitModel->SetSimOptions( m_plotFrame->GetCurrentOptions() );
|
||||
m_circuitModel->GetNetlist( &formatter, reporter );
|
||||
|
||||
NETLIST_VIEW_DIALOG dlg( m_plotFrame, errors.IsEmpty() ? formatter.GetString() : errors );
|
||||
dlg.ShowModal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void SIMULATOR_CONTROL::setTransitions()
|
||||
{
|
||||
Go( &SIMULATOR_CONTROL::NewPlot, EE_ACTIONS::newPlot.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::OpenWorkbook, EE_ACTIONS::openWorkbook.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::SaveWorkbook, EE_ACTIONS::saveWorkbook.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::SaveWorkbook, EE_ACTIONS::saveWorkbookAs.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::ExportPlotAsPNG, EE_ACTIONS::exportPlotAsPNG.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::ExportPlotAsCSV, EE_ACTIONS::exportPlotAsCSV.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::Close, ACTIONS::quit.MakeEvent() );
|
||||
|
||||
Go( &SIMULATOR_CONTROL::Zoom, ACTIONS::zoomInCenter.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::Zoom, ACTIONS::zoomOutCenter.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::Zoom, ACTIONS::zoomFitScreen.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::ToggleGrid, ACTIONS::toggleGrid.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::ToggleLegend, EE_ACTIONS::toggleLegend.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::ToggleDottedSecondary, EE_ACTIONS::toggleDottedSecondary.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::ToggleDarkModePlots, EE_ACTIONS::toggleDarkModePlots.MakeEvent() );
|
||||
|
||||
Go( &SIMULATOR_CONTROL::EditSimCommand, EE_ACTIONS::simCommand.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::RunSimulation, EE_ACTIONS::runSimulation.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::RunSimulation, EE_ACTIONS::stopSimulation.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::AddSignals, EE_ACTIONS::addSignals.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::Probe, EE_ACTIONS::simProbe.MakeEvent() );
|
||||
Go( &SIMULATOR_CONTROL::Tune, EE_ACTIONS::simTune.MakeEvent() );
|
||||
|
||||
Go( &SIMULATOR_CONTROL::ShowNetlist, EE_ACTIONS::showNetlist.MakeEvent() );
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 SIMULATOR_CONTROL_H
|
||||
#define SIMULATOR_CONTROL_H
|
||||
|
||||
#include <tool/tool_interactive.h>
|
||||
|
||||
class SIM_PLOT_FRAME;
|
||||
class NGSPICE_CIRCUIT_MODEL;
|
||||
class SPICE_SIMULATOR;
|
||||
|
||||
|
||||
/**
|
||||
* Handle actions for the various symbol editor and viewers.
|
||||
*/
|
||||
class SIMULATOR_CONTROL : public wxEvtHandler, public TOOL_INTERACTIVE
|
||||
{
|
||||
public:
|
||||
SIMULATOR_CONTROL() :
|
||||
TOOL_INTERACTIVE( "eeschema.SimulatorControl" ),
|
||||
m_plotFrame( nullptr ),
|
||||
m_schematicFrame( nullptr )
|
||||
{ }
|
||||
|
||||
virtual ~SIMULATOR_CONTROL() { }
|
||||
|
||||
/// @copydoc TOOL_INTERACTIVE::Init()
|
||||
bool Init() override;
|
||||
|
||||
/// @copydoc TOOL_INTERACTIVE::Reset()
|
||||
void Reset( RESET_REASON aReason ) override;
|
||||
|
||||
int NewPlot( const TOOL_EVENT& aEvent );
|
||||
int OpenWorkbook( const TOOL_EVENT& aEvent );
|
||||
int SaveWorkbook( const TOOL_EVENT& aEvent );
|
||||
int ExportPlotAsPNG( const TOOL_EVENT& aEvent );
|
||||
int ExportPlotAsCSV( const TOOL_EVENT& aEvent );
|
||||
int Close( const TOOL_EVENT& aEvent );
|
||||
|
||||
int Zoom( const TOOL_EVENT& aEvent );
|
||||
int ToggleGrid( const TOOL_EVENT& aEvent );
|
||||
int ToggleLegend( const TOOL_EVENT& aEvent );
|
||||
int ToggleDottedSecondary( const TOOL_EVENT& aEvent );
|
||||
int ToggleDarkModePlots( const TOOL_EVENT& aEvent );
|
||||
|
||||
int EditSimCommand( const TOOL_EVENT& aEvent );
|
||||
int RunSimulation( const TOOL_EVENT& aEvent );
|
||||
int AddSignals( const TOOL_EVENT& aEvent );
|
||||
int Probe( const TOOL_EVENT& aEvent );
|
||||
int Tune( const TOOL_EVENT& aEvent );
|
||||
|
||||
int ShowNetlist( const TOOL_EVENT& aEvent );
|
||||
|
||||
private:
|
||||
/**
|
||||
* Return the default filename (with extension) to be used in file browser dialog.
|
||||
*/
|
||||
wxString getDefaultFilename();
|
||||
|
||||
/**
|
||||
* Return the default path to be used in file browser dialog.
|
||||
*/
|
||||
wxString getDefaultPath();
|
||||
|
||||
///< Set up handlers for various events.
|
||||
void setTransitions() override;
|
||||
|
||||
private:
|
||||
SIM_PLOT_FRAME* m_plotFrame;
|
||||
SCH_EDIT_FRAME* m_schematicFrame;
|
||||
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> m_circuitModel;
|
||||
std::shared_ptr<SPICE_SIMULATOR> m_simulator;
|
||||
};
|
||||
|
||||
|
||||
#endif // SIMULATOR_CONTROL_H
|
|
@ -524,6 +524,7 @@ enum class BITMAPS : unsigned int
|
|||
show_zone_triangulation,
|
||||
showtrack,
|
||||
sim_add_signal,
|
||||
sim_command,
|
||||
sim_probe,
|
||||
sim_run,
|
||||
sim_stop,
|
||||
|
|
|
@ -196,6 +196,8 @@ public:
|
|||
*/
|
||||
void SetAuiManager( wxAuiManager* aManager ) { m_auiManager = aManager; }
|
||||
|
||||
void SetToolManager( TOOL_MANAGER* aManager ) { m_toolManager = aManager; }
|
||||
|
||||
/**
|
||||
* Add a TOOL_ACTION-based button to the toolbar.
|
||||
*
|
||||
|
|
|
@ -458,6 +458,7 @@ set( BMAPS_MID
|
|||
shape_3d_back
|
||||
sheetset
|
||||
simulator
|
||||
sim_command
|
||||
sim_run
|
||||
sim_stop
|
||||
sim_tune
|
||||
|
|
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 118 B |
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="Слой_1"
|
||||
data-name="Слой 1"
|
||||
viewBox="0 0 24 24"
|
||||
version="1.1"
|
||||
sodipodi:docname="sim_command.svg"
|
||||
inkscape:version="1.2.1 (9c6d41e, 2022-07-14)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1728"
|
||||
inkscape:window-height="987"
|
||||
id="namedview30"
|
||||
showgrid="true"
|
||||
inkscape:zoom="39.543586"
|
||||
inkscape:cx="13.301778"
|
||||
inkscape:cy="11.923552"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="38"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:current-layer="Слой_1"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid_kicad"
|
||||
spacingx="0.5"
|
||||
spacingy="0.5"
|
||||
color="#9999ff"
|
||||
opacity="0.13"
|
||||
empspacing="2" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata43">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>simulator</dc:title>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs159987">
|
||||
<style
|
||||
id="style159985">.cls-1{fill:#b9b9b9;}.cls-2,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.25px;}.cls-2{stroke:#bf2641;}.cls-3{stroke:#1a81c4;}</style>
|
||||
</defs>
|
||||
<title
|
||||
id="title159989">simulator</title>
|
||||
<circle
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:#545454;stroke-width:1.37198;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path841"
|
||||
cx="11.987356"
|
||||
cy="11.987356"
|
||||
r="10.289825" />
|
||||
<path
|
||||
style="fill:none;stroke:#545454;stroke-width:0.953986;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 2.251549,12.5 H 19.543938"
|
||||
id="path843"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#545454;stroke-width:0.898072;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 5.5,16.008526 V 4.7248423"
|
||||
id="path845"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#1a81c4;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 3.5,14.5 c 0,0 1.3518787,-7 2.8518787,-7 1.5,0 1.6002744,8.070806 3.0698938,8.060622 C 11.421725,15.546763 10.617219,4.5 12.617219,4.5 c 2,0 1.314653,14.512198 2.814653,14.512198 1.201824,0 1.002258,-3.266618 1.988097,-4.624305 C 17.831854,13.820649 18.5,13 19,13"
|
||||
id="path865"
|
||||
sodipodi:nodetypes="cssssac" />
|
||||
<ellipse
|
||||
style="fill:none;fill-opacity:1;stroke:#545454;stroke-width:1.37119;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="circle851"
|
||||
cx="12"
|
||||
cy="12.012644"
|
||||
rx="10.277575"
|
||||
ry="10.290219" />
|
||||
<path
|
||||
class="cls-9"
|
||||
d="m 24.229709,19.089216 -1.2674,-0.907 -0.015,0.027 c 0.03833,-0.2274 0.06148,-0.4572 0.0693,-0.6877 -0.0073,-0.2452 -0.03199,-0.4896 -0.0738,-0.7314 l 0.0074,0.013 1.2576,-0.92 c 0.275446,-0.2018 0.355047,-0.5785 0.1848,-0.8745 l -1.1327,-1.9683 c -0.170254,-0.296 -0.535927,-0.4167 -0.8489,-0.28 l -1.4277,0.6248 0.0124,0.022 c -0.387558,-0.3119 -0.817708,-0.5668 -1.2774,-0.757 l -0.1694,-1.5386 c -0.0375,-0.3393 -0.324184,-0.5962 -0.6656,-0.5964 h -2.271 c -0.341492,10e-5 -0.628287,0.257 -0.6658,0.5964 l -0.17,1.5453 c -0.477874,0.201 -0.923129,0.4721 -1.3211,0.8044 l 0.018,-0.032 -1.4342,-0.61 c -0.31434,-0.1335 -0.678759,-0.01 -0.846,0.2886 l -1.1118,1.98 c -0.167055,0.2979 -0.08336,0.6737 0.1943,0.8725 l 1.2674,0.907 0.0276,-0.049 c -0.03953,0.2327 -0.06322,0.4678 -0.0709,0.7037 0.0069,0.2554 0.03249,0.51 0.0767,0.7616 l -0.021,-0.037 -1.2576,0.9205 c -0.275495,0.2017 -0.355223,0.5783 -0.1851,0.8744 l 1.1327,1.9684 c 0.170418,0.2959 0.536051,0.4162 0.8489,0.2795 l 1.4279,-0.6249 -0.0293,-0.051 c 0.391248,0.32 0.826895,0.5814 1.2933,0.7762 l 0.17,1.5487 c 0.03751,0.3393 0.324184,0.5962 0.6656,0.5964 h 2.271 c 0.341416,-2e-4 0.628095,-0.2571 0.6656,-0.5964 l 0.1705,-1.5484 c 0.47629,-0.1988 0.920456,-0.4672 1.318,-0.7963 l -0.0154,0.027 1.4344,0.61 c 0.314288,0.1334 0.678633,0.01 0.8459,-0.2885 l 1.1117,-1.98 c 0.167077,-0.2977 0.08356,-0.6735 -0.1939,-0.8724 z m -6.4714,0.4685 c -1.656272,0 -2.371671,-2.145 -1.410892,-3.2684 1.001032,-1.1704 3.291346,-0.4321 3.327109,1.1884 0.107235,0.9522 -0.534865,2.0799 -1.916217,2.08 z"
|
||||
id="path158639"
|
||||
style="fill:#bf2641;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2.3;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccscc" />
|
||||
</svg>
|
After Width: | Height: | Size: 6.1 KiB |
|
@ -1,18 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
id="Слой_1"
|
||||
data-name="Слой 1"
|
||||
viewBox="0 0 24 24"
|
||||
version="1.1"
|
||||
sodipodi:docname="sim_run.svg"
|
||||
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
|
||||
inkscape:version="1.2.1 (9c6d41e, 2022-07-14)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
|
@ -23,17 +23,20 @@
|
|||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1609"
|
||||
inkscape:window-height="1286"
|
||||
inkscape:window-height="987"
|
||||
id="namedview30"
|
||||
showgrid="true"
|
||||
inkscape:zoom="27.961538"
|
||||
inkscape:cx="3.3259971"
|
||||
inkscape:cx="2.3067401"
|
||||
inkscape:cy="13"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="37"
|
||||
inkscape:window-y="38"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:current-layer="Слой_1">
|
||||
inkscape:current-layer="Слой_1"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid_kicad"
|
||||
|
@ -81,7 +84,7 @@
|
|||
id="title159965">sim_run</title>
|
||||
<polygon
|
||||
class="cls-1"
|
||||
points="2.004,25 23.996,12.995 2.004,1 "
|
||||
points="23.996,12.995 2.004,1 2.004,25 "
|
||||
id="polygon159967"
|
||||
transform="translate(-1,-1)" />
|
||||
transform="matrix(0.8194917,0,0,0.83459422,1.3287263,1.1323935)" />
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.8 KiB |
|
@ -1,35 +1,92 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
<svg
|
||||
id="Слой_1"
|
||||
data-name="Слой 1"
|
||||
viewBox="0 0 24 24"
|
||||
version="1.1"
|
||||
sodipodi:docname="sim_stop.svg"
|
||||
inkscape:version="1.2.1 (9c6d41e, 2022-07-14)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" id="Слой_1" data-name="Слой 1" viewBox="0 0 24 24" version="1.1" sodipodi:docname="sim_stop.svg" inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
|
||||
<sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1609" inkscape:window-height="1286" id="namedview30" showgrid="true" inkscape:zoom="27.961538" inkscape:cx="3.3259971" inkscape:cy="13" inkscape:window-x="0" inkscape:window-y="37" inkscape:window-maximized="0" inkscape:document-rotation="0" inkscape:current-layer="Слой_1">
|
||||
<inkscape:grid type="xygrid" id="grid_kicad" spacingx="0.5" spacingy="0.5" color="#9999ff" opacity="0.13" empspacing="2" />
|
||||
</sodipodi:namedview>
|
||||
<metadata id="metadata43">
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<cc:license rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>add_arc</dc:title>
|
||||
</cc:Work>
|
||||
<cc:License rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs id="defs159975">
|
||||
<style id="style159973">.cls-1{fill:#bf2641;}</style>
|
||||
</defs>
|
||||
<title id="title159977">sim_stop</title>
|
||||
<path class="cls-1" d="M 20,0 H 4 A 4,4 0 0 0 0,4 v 16 a 4,4 0 0 0 4,4 h 16 a 4,4 0 0 0 4,-4 V 4 A 4,4 0 0 0 20,0 Z" id="path159979" />
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1609"
|
||||
inkscape:window-height="987"
|
||||
id="namedview30"
|
||||
showgrid="true"
|
||||
inkscape:zoom="27.961538"
|
||||
inkscape:cx="2.3067401"
|
||||
inkscape:cy="13"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="38"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:current-layer="Слой_1"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid_kicad"
|
||||
spacingx="0.5"
|
||||
spacingy="0.5"
|
||||
color="#9999ff"
|
||||
opacity="0.13"
|
||||
empspacing="2" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata43">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>add_arc</dc:title>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs159975">
|
||||
<style
|
||||
id="style159973">.cls-1{fill:#bf2641;}</style>
|
||||
</defs>
|
||||
<title
|
||||
id="title159977">sim_stop</title>
|
||||
<rect
|
||||
style="fill:#1a81c4;fill-opacity:1;stroke-width:0.63381;stroke-dasharray:none"
|
||||
id="rect1852"
|
||||
width="17.953234"
|
||||
height="17.953234"
|
||||
x="3.0041265"
|
||||
y="3.0041268" />
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.8 KiB |