ADDED simulation measurements.
This commit is contained in:
parent
e5176ff4d6
commit
9d3a3d705d
|
@ -425,6 +425,9 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
|||
m_params.emplace_back( new PARAM<int>( "simulator.cursors_panel_height",
|
||||
&m_Simulator.cursors_panel_height, 0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "simulator.measurements_panel_height",
|
||||
&m_Simulator.measurements_panel_height, 0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "simulator.white_background",
|
||||
&m_Simulator.white_background, false ) );
|
||||
|
||||
|
|
|
@ -242,6 +242,7 @@ public:
|
|||
int plot_panel_height;
|
||||
int signal_panel_height;
|
||||
int cursors_panel_height;
|
||||
int measurements_panel_height;
|
||||
bool white_background;
|
||||
WINDOW_SETTINGS window;
|
||||
};
|
||||
|
|
|
@ -639,7 +639,7 @@ wxString SCHEMATIC::GetOperatingPoint( const wxString& aNetName, int aPrecision,
|
|||
auto it = m_operatingPoints.find( spiceNetName );
|
||||
|
||||
if( it != m_operatingPoints.end() )
|
||||
return SPICE_VALUE( it->second ).ToString( aPrecision, aRange );
|
||||
return SPICE_VALUE( it->second ).ToString( { aPrecision, aRange } );
|
||||
else if( m_operatingPoints.empty() )
|
||||
return wxS( "--" );
|
||||
else
|
||||
|
|
|
@ -129,12 +129,91 @@ enum CURSORS_GRID_COLUMNS
|
|||
};
|
||||
|
||||
|
||||
enum MEASUREMENTS_GIRD_COLUMNS
|
||||
{
|
||||
COL_MEASUREMENT = 0,
|
||||
COL_MEASUREMENT_VALUE
|
||||
};
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
MYID_FORMAT_VALUE = GRIDTRICKS_FIRST_CLIENT_ID
|
||||
MYID_MEASURE_MIN = GRIDTRICKS_FIRST_CLIENT_ID,
|
||||
MYID_MEASURE_MAX,
|
||||
MYID_MEASURE_AVE,
|
||||
MYID_MEASURE_RMS,
|
||||
MYID_MEASURE_PP,
|
||||
MYID_MEASURE_MIN_AT,
|
||||
MYID_MEASURE_MAX_AT,
|
||||
|
||||
MYID_FORMAT_VALUE,
|
||||
MYID_DELETE_MEASUREMENT
|
||||
};
|
||||
|
||||
|
||||
class SIGNALS_GRID_TRICKS : public GRID_TRICKS
|
||||
{
|
||||
public:
|
||||
SIGNALS_GRID_TRICKS( SIM_PLOT_FRAME* aParent, WX_GRID* aGrid ) :
|
||||
GRID_TRICKS( aGrid ),
|
||||
m_parent( aParent )
|
||||
{}
|
||||
|
||||
protected:
|
||||
void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
|
||||
void doPopupSelection( wxCommandEvent& event ) override;
|
||||
|
||||
protected:
|
||||
SIM_PLOT_FRAME* m_parent;
|
||||
int m_menuRow;
|
||||
int m_menuCol;
|
||||
};
|
||||
|
||||
|
||||
void SIGNALS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
|
||||
{
|
||||
m_menuRow = aEvent.GetRow();
|
||||
m_menuCol = aEvent.GetCol();
|
||||
|
||||
if( m_menuCol == COL_SIGNAL_NAME )
|
||||
{
|
||||
wxString msg = m_grid->GetCellValue( m_menuRow, m_menuCol );
|
||||
|
||||
menu.Append( MYID_MEASURE_MIN, _( "Measure Min" ) );
|
||||
menu.Append( MYID_MEASURE_MAX, _( "Measure Max" ) );
|
||||
menu.Append( MYID_MEASURE_AVE, _( "Measure Average" ) );
|
||||
menu.Append( MYID_MEASURE_RMS, _( "Measure RMS" ) );
|
||||
menu.Append( MYID_MEASURE_PP, _( "Measure Peak-to-peak" ) );
|
||||
menu.Append( MYID_MEASURE_MIN_AT, _( "Measure Time of Min" ) );
|
||||
menu.Append( MYID_MEASURE_MAX_AT, _( "Measure Time of Max" ) );
|
||||
menu.AppendSeparator();
|
||||
}
|
||||
|
||||
GRID_TRICKS::showPopupMenu( menu, aEvent );
|
||||
}
|
||||
|
||||
|
||||
void SIGNALS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
|
||||
{
|
||||
if( event.GetId() == MYID_MEASURE_MIN )
|
||||
m_parent->AddMeasurement( wxS( "MIN" ), m_grid->GetCellValue( m_menuRow, m_menuCol ) );
|
||||
else if( event.GetId() == MYID_MEASURE_MAX )
|
||||
m_parent->AddMeasurement( wxS( "MAX" ), m_grid->GetCellValue( m_menuRow, m_menuCol ) );
|
||||
else if( event.GetId() == MYID_MEASURE_AVE )
|
||||
m_parent->AddMeasurement( wxS( "AVE" ), m_grid->GetCellValue( m_menuRow, m_menuCol ) );
|
||||
else if( event.GetId() == MYID_MEASURE_RMS )
|
||||
m_parent->AddMeasurement( wxS( "RMS" ), m_grid->GetCellValue( m_menuRow, m_menuCol ) );
|
||||
else if( event.GetId() == MYID_MEASURE_PP )
|
||||
m_parent->AddMeasurement( wxS( "PP" ), m_grid->GetCellValue( m_menuRow, m_menuCol ) );
|
||||
else if( event.GetId() == MYID_MEASURE_MIN_AT )
|
||||
m_parent->AddMeasurement( wxS( "MIN_AT" ), m_grid->GetCellValue( m_menuRow, m_menuCol ) );
|
||||
else if( event.GetId() == MYID_MEASURE_MAX_AT )
|
||||
m_parent->AddMeasurement( wxS( "MAX_AT" ), m_grid->GetCellValue( m_menuRow, m_menuCol ) );
|
||||
else
|
||||
GRID_TRICKS::doPopupSelection( event );
|
||||
}
|
||||
|
||||
|
||||
class CURSORS_GRID_TRICKS : public GRID_TRICKS
|
||||
{
|
||||
public:
|
||||
|
@ -163,8 +242,7 @@ void CURSORS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
|
|||
{
|
||||
wxString msg = m_grid->GetColLabelValue( m_menuCol );
|
||||
|
||||
menu.Append( MYID_FORMAT_VALUE, wxString::Format( _( "Format..." ), msg ),
|
||||
wxString::Format( _( "Specify %s precision and range" ), msg.Lower() ) );
|
||||
menu.Append( MYID_FORMAT_VALUE, wxString::Format( _( "Format %s..." ), msg ) );
|
||||
menu.AppendSeparator();
|
||||
}
|
||||
|
||||
|
@ -176,18 +254,68 @@ void CURSORS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
|
|||
{
|
||||
if( event.GetId() == MYID_FORMAT_VALUE )
|
||||
{
|
||||
int cursorId = m_menuRow;
|
||||
int cursorAxis = m_menuCol - COL_CURSOR_X;
|
||||
int precision = m_parent->GetCursorPrecision( cursorId, cursorAxis );
|
||||
wxString range = m_parent->GetCursorRange( cursorId, cursorAxis );
|
||||
|
||||
DIALOG_SIM_FORMAT_VALUE formatDialog( m_parent, &precision, &range );
|
||||
int cursorId = m_menuRow;
|
||||
int cursorAxis = m_menuCol - COL_CURSOR_X;
|
||||
SPICE_VALUE_FORMAT format = m_parent->GetCursorFormat( cursorId, cursorAxis );
|
||||
DIALOG_SIM_FORMAT_VALUE formatDialog( m_parent, &format.Precision, &format.Range );
|
||||
|
||||
if( formatDialog.ShowModal() == wxID_OK )
|
||||
{
|
||||
m_parent->SetCursorPrecision( cursorId, cursorAxis, precision );
|
||||
m_parent->SetCursorRange( cursorId, cursorAxis, range );
|
||||
}
|
||||
m_parent->SetCursorFormat( cursorId, cursorAxis, format );
|
||||
}
|
||||
else
|
||||
{
|
||||
GRID_TRICKS::doPopupSelection( event );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MEASUREMENTS_GRID_TRICKS : public GRID_TRICKS
|
||||
{
|
||||
public:
|
||||
MEASUREMENTS_GRID_TRICKS( SIM_PLOT_FRAME* aParent, WX_GRID* aGrid ) :
|
||||
GRID_TRICKS( aGrid ),
|
||||
m_parent( aParent )
|
||||
{}
|
||||
|
||||
protected:
|
||||
void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
|
||||
void doPopupSelection( wxCommandEvent& event ) override;
|
||||
|
||||
protected:
|
||||
SIM_PLOT_FRAME* m_parent;
|
||||
int m_menuRow;
|
||||
int m_menuCol;
|
||||
};
|
||||
|
||||
|
||||
void MEASUREMENTS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
|
||||
{
|
||||
m_menuRow = aEvent.GetRow();
|
||||
m_menuCol = aEvent.GetCol();
|
||||
|
||||
if( m_menuCol == COL_MEASUREMENT_VALUE )
|
||||
menu.Append( MYID_FORMAT_VALUE, _( "Format Value..." ) );
|
||||
|
||||
menu.Append( MYID_DELETE_MEASUREMENT, _( "Delete Measurement" ) );
|
||||
menu.AppendSeparator();
|
||||
|
||||
GRID_TRICKS::showPopupMenu( menu, aEvent );
|
||||
}
|
||||
|
||||
|
||||
void MEASUREMENTS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
|
||||
{
|
||||
if( event.GetId() == MYID_FORMAT_VALUE )
|
||||
{
|
||||
SPICE_VALUE_FORMAT format = m_parent->GetMeasureFormat( m_menuRow );
|
||||
DIALOG_SIM_FORMAT_VALUE formatDialog( m_parent, &format.Precision, &format.Range );
|
||||
|
||||
if( formatDialog.ShowModal() == wxID_OK )
|
||||
m_parent->SetMeasureFormat( m_menuRow, format );
|
||||
}
|
||||
else if( event.GetId() == MYID_DELETE_MEASUREMENT )
|
||||
{
|
||||
m_parent->DeleteMeasurement( m_menuRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -201,7 +329,8 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
m_lastSimPlot( nullptr ),
|
||||
m_darkMode( true ),
|
||||
m_plotNumber( 0 ),
|
||||
m_simFinished( false )
|
||||
m_simFinished( false ),
|
||||
m_outputCounter( 1 )
|
||||
{
|
||||
SetKiway( this, aKiway );
|
||||
|
||||
|
@ -219,7 +348,15 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
// Get the previous size and position of windows:
|
||||
LoadSettings( config() );
|
||||
|
||||
m_filter->SetHint( _( "Filter" ) );
|
||||
|
||||
m_signalsGrid->wxGrid::SetLabelFont( KIUI::GetStatusFont( this ) );
|
||||
m_cursorsGrid->wxGrid::SetLabelFont( KIUI::GetStatusFont( this ) );
|
||||
m_measurementsGrid->wxGrid::SetLabelFont( KIUI::GetStatusFont( this ) );
|
||||
|
||||
m_signalsGrid->PushEventHandler( new SIGNALS_GRID_TRICKS( this, m_signalsGrid ) );
|
||||
m_cursorsGrid->PushEventHandler( new CURSORS_GRID_TRICKS( this, m_cursorsGrid ) );
|
||||
m_measurementsGrid->PushEventHandler( new MEASUREMENTS_GRID_TRICKS( this, m_measurementsGrid ) );
|
||||
|
||||
wxGridCellAttr* attr = new wxGridCellAttr;
|
||||
attr->SetReadOnly();
|
||||
|
@ -231,10 +368,6 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
m_signalsGrid->SetColAttr( COL_SIGNAL_SHOW, attr );
|
||||
|
||||
m_signalsGrid->PushEventHandler( new GRID_TRICKS( m_signalsGrid ) );
|
||||
|
||||
m_cursorsGrid->wxGrid::SetLabelFont( KIUI::GetStatusFont( this ) );
|
||||
|
||||
attr = new wxGridCellAttr;
|
||||
attr->SetReadOnly();
|
||||
m_cursorsGrid->SetColAttr( COL_CURSOR_NAME, attr );
|
||||
|
@ -247,16 +380,16 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
attr->SetReadOnly();
|
||||
m_cursorsGrid->SetColAttr( COL_CURSOR_Y, attr );
|
||||
|
||||
m_cursorsGrid->PushEventHandler( new CURSORS_GRID_TRICKS( this, m_cursorsGrid ) );
|
||||
|
||||
for( int cursorId = 0; cursorId < 3; ++cursorId )
|
||||
{
|
||||
m_cursorPrecision[ cursorId ][ 0 ] = 3;
|
||||
m_cursorRange[ cursorId ][ 0 ] = wxS( "~s" );
|
||||
m_cursorPrecision[ cursorId ][ 1 ] = 3;
|
||||
m_cursorRange[ cursorId ][ 1 ] = wxS( "~V" );
|
||||
m_cursorFormats[ cursorId ][ 0 ] = { 3, wxS( "~s" ) };
|
||||
m_cursorFormats[ cursorId ][ 1 ] = { 3, wxS( "~V" ) };
|
||||
}
|
||||
|
||||
attr = new wxGridCellAttr;
|
||||
attr->SetReadOnly();
|
||||
m_measurementsGrid->SetColAttr( COL_MEASUREMENT_VALUE, attr );
|
||||
|
||||
// Prepare the color list to plot traces
|
||||
SIM_PLOT_COLORS::FillDefaultColorList( m_darkMode );
|
||||
|
||||
|
@ -314,6 +447,7 @@ SIM_PLOT_FRAME::~SIM_PLOT_FRAME()
|
|||
// Delete the GRID_TRICKS.
|
||||
m_signalsGrid->PopEventHandler( true );
|
||||
m_cursorsGrid->PopEventHandler( true );
|
||||
m_measurementsGrid->PopEventHandler( true );
|
||||
|
||||
NULL_REPORTER devnull;
|
||||
|
||||
|
@ -360,6 +494,8 @@ void SIM_PLOT_FRAME::ShowChangedLanguage()
|
|||
m_workbook->SetPageText( ii, pageTitle );
|
||||
}
|
||||
|
||||
m_filter->SetHint( _( "Filter" ) );
|
||||
|
||||
m_signalsGrid->SetColLabelValue( COL_SIGNAL_NAME, _( "Signal" ) );
|
||||
m_signalsGrid->SetColLabelValue( COL_SIGNAL_SHOW, _( "Plot" ) );
|
||||
m_signalsGrid->SetColLabelValue( COL_SIGNAL_COLOR, _( "Color" ) );
|
||||
|
@ -373,7 +509,8 @@ void SIM_PLOT_FRAME::ShowChangedLanguage()
|
|||
wxCommandEvent dummy;
|
||||
onCursorUpdate( dummy );
|
||||
|
||||
m_staticTextTune->SetLabel( _( "Tune" ) );
|
||||
for( TUNER_SLIDER* tuner : m_tuners )
|
||||
tuner->ShowChangedLanguage();
|
||||
}
|
||||
|
||||
|
||||
|
@ -390,7 +527,8 @@ void SIM_PLOT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
|||
m_splitterLeftRightSashPosition = cfg->m_Simulator.plot_panel_width;
|
||||
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_splitterCursorsSashPosition = cfg->m_Simulator.cursors_panel_height;
|
||||
m_splitterTuneValuesSashPosition = cfg->m_Simulator.measurements_panel_height;
|
||||
m_darkMode = !cfg->m_Simulator.white_background;
|
||||
}
|
||||
|
||||
|
@ -412,11 +550,12 @@ void SIM_PLOT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
|||
{
|
||||
EDA_BASE_FRAME::SaveSettings( cfg );
|
||||
|
||||
cfg->m_Simulator.plot_panel_width = m_splitterLeftRight->GetSashPosition();
|
||||
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_darkMode;
|
||||
cfg->m_Simulator.plot_panel_width = m_splitterLeftRight->GetSashPosition();
|
||||
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_splitterCursors->GetSashPosition();
|
||||
cfg->m_Simulator.measurements_panel_height = m_splitterMeasurements->GetSashPosition();
|
||||
cfg->m_Simulator.white_background = !m_darkMode;
|
||||
}
|
||||
|
||||
if( !m_isNonUserClose ) // If we're exiting the project has already been released.
|
||||
|
@ -504,8 +643,11 @@ void SIM_PLOT_FRAME::setSubWindowsSashSize()
|
|||
if( m_splitterSignalsSashPosition > 0 )
|
||||
m_splitterSignals->SetSashPosition( m_splitterSignalsSashPosition );
|
||||
|
||||
if( m_splitterCursorsSashPosition > 0 )
|
||||
m_splitterCursors->SetSashPosition( m_splitterCursorsSashPosition );
|
||||
|
||||
if( m_splitterTuneValuesSashPosition > 0 )
|
||||
m_splitterTuneValues->SetSashPosition( m_splitterTuneValuesSashPosition );
|
||||
m_splitterMeasurements->SetSashPosition( m_splitterTuneValuesSashPosition );
|
||||
}
|
||||
|
||||
|
||||
|
@ -767,6 +909,17 @@ void SIM_PLOT_FRAME::OnFilterMouseMoved( wxMouseEvent& aEvent )
|
|||
}
|
||||
|
||||
|
||||
void updateRangeUnits( wxString* aRange, const wxString& aUnits )
|
||||
{
|
||||
if( aRange->GetChar( 0 ) == '~' )
|
||||
*aRange = aRange->Left( 1 ) + aUnits;
|
||||
else if( SPICE_VALUE::ParseSIPrefix( aRange->GetChar( 0 ) ) != SPICE_VALUE::PFX_NONE )
|
||||
*aRange = aRange->Left( 1 ) + aUnits;
|
||||
else
|
||||
*aRange = aUnits;
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onSignalsGridCellChanged( wxGridEvent& aEvent )
|
||||
{
|
||||
int row = aEvent.GetRow();
|
||||
|
@ -785,14 +938,14 @@ void SIM_PLOT_FRAME::onSignalsGridCellChanged( wxGridEvent& aEvent )
|
|||
{
|
||||
wxString gainSuffix = _( " (gain)" );
|
||||
wxString phaseSuffix = _( " (phase)" );
|
||||
wxUniChar firstChar = signalName[0];
|
||||
wxUniChar firstChar = signalName.Upper()[0];
|
||||
int traceType = SPT_UNKNOWN;
|
||||
|
||||
if( firstChar == 'V' || firstChar == 'v' )
|
||||
if( firstChar == 'V' )
|
||||
traceType = SPT_VOLTAGE;
|
||||
else if( firstChar == 'I' || firstChar == 'i' )
|
||||
else if( firstChar == 'I' )
|
||||
traceType = SPT_CURRENT;
|
||||
else if( firstChar == 'P' || firstChar == 'p' )
|
||||
else if( firstChar == 'P' )
|
||||
traceType = SPT_POWER;
|
||||
|
||||
if( signalName.EndsWith( gainSuffix ) )
|
||||
|
@ -898,6 +1051,97 @@ void SIM_PLOT_FRAME::onCursorsGridCellChanged( wxGridEvent& aEvent )
|
|||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::DeleteMeasurement( int aRow )
|
||||
{
|
||||
m_measurementsGrid->DeleteRows( aRow, 1 );
|
||||
|
||||
for( int ii = aRow; ii < (int) m_measurementFormats.size() - 1; ++ii )
|
||||
m_measurementFormats[ aRow ] = m_measurementFormats[ aRow + 1 ];
|
||||
|
||||
m_measurementFormats.pop_back();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::onMeasurementsGridCellChanged( wxGridEvent& aEvent )
|
||||
{
|
||||
SIM_PLOT_PANEL* plotPanel = GetCurrentPlot();
|
||||
|
||||
if( !plotPanel )
|
||||
return;
|
||||
|
||||
int row = aEvent.GetRow();
|
||||
int col = aEvent.GetCol();
|
||||
wxString text = m_measurementsGrid->GetCellValue( row, col );
|
||||
|
||||
if( col == COL_MEASUREMENT )
|
||||
{
|
||||
if( text.IsEmpty() )
|
||||
DeleteMeasurement( row );
|
||||
else
|
||||
updateMeasurement( row );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxFAIL_MSG( wxT( "All other columns are supposed to be read-only!" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::updateMeasurement( int aRow )
|
||||
{
|
||||
static wxRegEx measureParamsRegEx( wxT( "^"
|
||||
" *"
|
||||
"([a-zA-Z]+)"
|
||||
" +"
|
||||
"([a-zA-Z])\\([a-zA-Z0-9_]+\\)" ) );
|
||||
|
||||
SIM_PLOT_PANEL* plotPanel = GetCurrentPlot();
|
||||
|
||||
if( !plotPanel )
|
||||
return;
|
||||
|
||||
wxString text = m_measurementsGrid->GetCellValue( aRow, COL_MEASUREMENT );
|
||||
wxString simType = m_simulator->TypeToName( plotPanel->GetType(), true );
|
||||
wxString resultName = wxString::Format( wxS( "meas_result_%u" ), m_outputCounter++ );
|
||||
wxString result = wxS( "?" );
|
||||
|
||||
m_simulator->Command( (const char*) wxString::Format( wxS( "meas %s %s %s" ),
|
||||
simType,
|
||||
resultName,
|
||||
text ).c_str() );
|
||||
|
||||
std::vector<double> resultVec = m_simulator->GetMagPlot( (const char*) resultName.c_str() );
|
||||
|
||||
if( resultVec.size() > 0 )
|
||||
{
|
||||
if( measureParamsRegEx.Matches( text ) )
|
||||
{
|
||||
wxString func = measureParamsRegEx.GetMatch( text, 1 ).Upper();
|
||||
wxUniChar signalType = measureParamsRegEx.GetMatch( text, 2 ).Upper()[0];
|
||||
wxString units;
|
||||
|
||||
if( signalType == 'I' )
|
||||
units = wxS( "A" );
|
||||
else if( signalType == 'P' )
|
||||
units = wxS( "W" );
|
||||
else
|
||||
units = wxS( "V" );
|
||||
|
||||
if( func.EndsWith( wxS( "_AT" ) ) )
|
||||
units = wxS( "s" );
|
||||
else if( func.StartsWith( wxS( "INTEG" ) ) )
|
||||
units += wxS( "·s" );
|
||||
|
||||
updateRangeUnits( &m_measurementFormats[ aRow ].Range, units );
|
||||
}
|
||||
|
||||
result = SPICE_VALUE( resultVec[0] ).ToString( m_measurementFormats[ aRow ] );
|
||||
}
|
||||
|
||||
m_measurementsGrid->SetCellValue( aRow, COL_MEASUREMENT_VALUE, result );
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::AddVoltagePlot( const wxString& aNetName )
|
||||
{
|
||||
addTrace( aNetName, SPT_VOLTAGE );
|
||||
|
@ -934,10 +1178,10 @@ void SIM_PLOT_FRAME::AddTuner( const SCH_SHEET_PATH& aSheetPath, SCH_SYMBOL* aSy
|
|||
|
||||
try
|
||||
{
|
||||
TUNER_SLIDER* tuner = new TUNER_SLIDER( this, m_tunePanel, aSheetPath, aSymbol );
|
||||
m_tuneSizer->Add( tuner );
|
||||
TUNER_SLIDER* tuner = new TUNER_SLIDER( this, m_panelTuners, aSheetPath, aSymbol );
|
||||
m_sizerTuners->Add( tuner );
|
||||
m_tuners.push_back( tuner );
|
||||
m_tunePanel->Layout();
|
||||
m_panelTuners->Layout();
|
||||
}
|
||||
catch( const KI_PARAM_ERROR& e )
|
||||
{
|
||||
|
@ -985,7 +1229,26 @@ void SIM_PLOT_FRAME::RemoveTuner( TUNER_SLIDER* aTuner, bool aErase )
|
|||
m_tuners.remove( aTuner );
|
||||
|
||||
aTuner->Destroy();
|
||||
m_tunePanel->Layout();
|
||||
m_panelTuners->Layout();
|
||||
}
|
||||
|
||||
|
||||
void SIM_PLOT_FRAME::AddMeasurement( const wxString& aCmd, const wxString& aSignal )
|
||||
{
|
||||
SIM_PLOT_PANEL* plotPanel = GetCurrentPlot();
|
||||
|
||||
if( !plotPanel )
|
||||
return;
|
||||
|
||||
wxString simType = m_simulator->TypeToName( plotPanel->GetType(), true );
|
||||
int row = m_measurementsGrid->GetNumberRows();
|
||||
|
||||
m_measurementFormats.push_back( { 3, wxS( "~V" ) } );
|
||||
|
||||
m_measurementsGrid->AppendRows();
|
||||
m_measurementsGrid->SetCellValue( row, COL_MEASUREMENT, aCmd + wxS( " " ) + aSignal );
|
||||
|
||||
updateMeasurement( row );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1797,22 +2060,10 @@ void SIM_PLOT_FRAME::onCursorUpdate( wxCommandEvent& event )
|
|||
return plotPanel->GetLabelY1();
|
||||
};
|
||||
|
||||
auto updateRangeUnits =
|
||||
[]( wxString* aRange, const wxString& aUnits )
|
||||
{
|
||||
if( aRange->GetChar( 0 ) == '~' )
|
||||
*aRange = aRange->Left( 1 ) + aUnits;
|
||||
else if( SPICE_VALUE::ParseSIPrefix( aRange->GetChar( 0 ) ) != SPICE_VALUE::PFX_NONE )
|
||||
*aRange = aRange->Left( 1 ) + aUnits;
|
||||
else
|
||||
*aRange = aUnits;
|
||||
};
|
||||
|
||||
auto formatValue =
|
||||
[this]( double aValue, int aCursorId, int aCol ) -> wxString
|
||||
{
|
||||
return SPICE_VALUE( aValue ).ToString( m_cursorPrecision[ aCursorId ][ aCol ],
|
||||
m_cursorRange[ aCursorId ][ aCol ] );
|
||||
return SPICE_VALUE( aValue ).ToString( m_cursorFormats[ aCursorId ][ aCol ] );
|
||||
};
|
||||
|
||||
for( const auto& [name, trace] : plotPanel->GetTraces() )
|
||||
|
@ -1826,8 +2077,8 @@ void SIM_PLOT_FRAME::onCursorUpdate( wxCommandEvent& event )
|
|||
wxRealPoint coords = cursor->GetCoords();
|
||||
int row = m_cursorsGrid->GetNumberRows();
|
||||
|
||||
updateRangeUnits( &m_cursorRange[0][0], plotPanel->GetUnitsX() );
|
||||
updateRangeUnits( &m_cursorRange[0][1], cursor1Units );
|
||||
updateRangeUnits( &m_cursorFormats[0][0].Range, plotPanel->GetUnitsX() );
|
||||
updateRangeUnits( &m_cursorFormats[0][1].Range, cursor1Units );
|
||||
|
||||
m_cursorsGrid->AppendRows( 1 );
|
||||
m_cursorsGrid->SetCellValue( row, COL_CURSOR_NAME, wxS( "1" ) );
|
||||
|
@ -1849,8 +2100,8 @@ void SIM_PLOT_FRAME::onCursorUpdate( wxCommandEvent& event )
|
|||
wxRealPoint coords = cursor->GetCoords();
|
||||
int row = m_cursorsGrid->GetNumberRows();
|
||||
|
||||
updateRangeUnits( &m_cursorRange[1][0], plotPanel->GetUnitsX() );
|
||||
updateRangeUnits( &m_cursorRange[1][1], cursor2Units );
|
||||
updateRangeUnits( &m_cursorFormats[1][0].Range, plotPanel->GetUnitsX() );
|
||||
updateRangeUnits( &m_cursorFormats[1][1].Range, cursor2Units );
|
||||
|
||||
m_cursorsGrid->AppendRows( 1 );
|
||||
m_cursorsGrid->SetCellValue( row, COL_CURSOR_NAME, wxS( "2" ) );
|
||||
|
@ -1866,8 +2117,8 @@ void SIM_PLOT_FRAME::onCursorUpdate( wxCommandEvent& event )
|
|||
wxRealPoint coords = cursor2->GetCoords() - cursor1->GetCoords();
|
||||
wxString signal;
|
||||
|
||||
updateRangeUnits( &m_cursorRange[2][0], plotPanel->GetUnitsX() );
|
||||
updateRangeUnits( &m_cursorRange[2][1], cursor1Units );
|
||||
updateRangeUnits( &m_cursorFormats[2][0].Range, plotPanel->GetUnitsX() );
|
||||
updateRangeUnits( &m_cursorFormats[2][1].Range, cursor1Units );
|
||||
|
||||
if( cursor1->GetName() == cursor2->GetName() )
|
||||
signal = wxString::Format( wxS( "%s[2 - 1]" ), cursor2->GetName() );
|
||||
|
|
|
@ -95,38 +95,31 @@ public:
|
|||
void AddCurrentPlot( const wxString& aDeviceName );
|
||||
|
||||
/**
|
||||
* Get/Set the number of decimal places to show in a cursor value.
|
||||
* Get/Set the number of significant digits and the range for formatting a cursor value.
|
||||
* @param aValueCol 0 indicates the X value column; 1 the Y value.
|
||||
*/
|
||||
int GetCursorPrecision( int aCursorId, int aValueCol ) const
|
||||
SPICE_VALUE_FORMAT GetCursorFormat( int aCursorId, int aValueCol ) const
|
||||
{
|
||||
return m_cursorPrecision[ aCursorId ][ aValueCol ];
|
||||
return m_cursorFormats[ aCursorId ][ aValueCol ];
|
||||
}
|
||||
|
||||
void SetCursorPrecision( int aCursorId, int aValueCol, int aPrecision )
|
||||
void SetCursorFormat( int aCursorId, int aValueCol, const SPICE_VALUE_FORMAT& aFormat )
|
||||
{
|
||||
m_cursorPrecision[ aCursorId ][ aValueCol ] = aPrecision;
|
||||
m_cursorFormats[ aCursorId ][ aValueCol ] = aFormat;
|
||||
|
||||
wxCommandEvent dummy;
|
||||
onCursorUpdate( dummy );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get/Set the range of a cursor value.
|
||||
* @param aValueCol 0 indicates the X value column; 1 the Y value.
|
||||
* @param aScale "~" + unit indicates automatic; the rest are SI prefix + unit.
|
||||
*/
|
||||
wxString GetCursorRange( int aCursorId, int aValueCol ) const
|
||||
SPICE_VALUE_FORMAT GetMeasureFormat( int aRow ) const
|
||||
{
|
||||
return m_cursorRange[ aCursorId ][ aValueCol ];
|
||||
return m_measurementFormats[ aRow ];
|
||||
}
|
||||
|
||||
void SetCursorRange( int aCursorId, int aValueCol, const wxString& aRange )
|
||||
void SetMeasureFormat( int aRow, const SPICE_VALUE_FORMAT& aFormat )
|
||||
{
|
||||
m_cursorRange[ aCursorId ][ aValueCol ] = aRange;
|
||||
|
||||
wxCommandEvent dummy;
|
||||
onCursorUpdate( dummy );
|
||||
m_measurementFormats[ aRow ] = aFormat;
|
||||
updateMeasurement( aRow );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,6 +147,18 @@ public:
|
|||
void UpdateTunerValue( const SCH_SHEET_PATH& aSheetPath, const KIID& aSymbol,
|
||||
const wxString& aRef, const wxString& aValue );
|
||||
|
||||
/**
|
||||
* Add a measurement to the measurements grid.
|
||||
* @param aCmd AVG, MIN, MAX, PP, RMS, MIN_AT, or MAX_AT
|
||||
* @param aSignal
|
||||
*/
|
||||
void AddMeasurement( const wxString& aCmd, const wxString& aSignal );
|
||||
|
||||
/**
|
||||
* Delete a row from the measurements grid.
|
||||
*/
|
||||
void DeleteMeasurement( int aRow );
|
||||
|
||||
/**
|
||||
* Return the currently opened plot panel (or NULL if there is none).
|
||||
*/
|
||||
|
@ -275,6 +280,11 @@ private:
|
|||
*/
|
||||
void updateSignalsGrid();
|
||||
|
||||
/**
|
||||
* Update a measurement in the measurements grid.
|
||||
*/
|
||||
void updateMeasurement( int aRow );
|
||||
|
||||
/**
|
||||
* Apply component values specified using tuner sliders to the current netlist.
|
||||
*/
|
||||
|
@ -307,6 +317,7 @@ private:
|
|||
|
||||
void onSignalsGridCellChanged( wxGridEvent& aEvent ) override;
|
||||
void onCursorsGridCellChanged( wxGridEvent& aEvent ) override;
|
||||
void onMeasurementsGridCellChanged( wxGridEvent& aEvent ) override;
|
||||
|
||||
void onWorkbookModified( wxCommandEvent& event );
|
||||
void onWorkbookClrModified( wxCommandEvent& event );
|
||||
|
@ -340,17 +351,19 @@ private:
|
|||
///< Panel that was used as the most recent one for simulations
|
||||
SIM_PANEL_BASE* m_lastSimPlot;
|
||||
|
||||
// Variables for temporary storage:
|
||||
int m_splitterLeftRightSashPosition;
|
||||
int m_splitterPlotAndConsoleSashPosition;
|
||||
int m_splitterSignalsSashPosition;
|
||||
int m_splitterTuneValuesSashPosition;
|
||||
bool m_darkMode;
|
||||
unsigned int m_plotNumber;
|
||||
bool m_simFinished;
|
||||
SPICE_VALUE_FORMAT m_cursorFormats[3][2];
|
||||
std::vector<SPICE_VALUE_FORMAT> m_measurementFormats;
|
||||
|
||||
int m_cursorPrecision[3][2];
|
||||
wxString m_cursorRange[3][2];
|
||||
// Variables for temporary storage:
|
||||
int m_splitterLeftRightSashPosition;
|
||||
int m_splitterPlotAndConsoleSashPosition;
|
||||
int m_splitterSignalsSashPosition;
|
||||
int m_splitterCursorsSashPosition;
|
||||
int m_splitterTuneValuesSashPosition;
|
||||
bool m_darkMode;
|
||||
unsigned int m_plotNumber;
|
||||
bool m_simFinished;
|
||||
unsigned int m_outputCounter;
|
||||
};
|
||||
|
||||
// Commands
|
||||
|
|
|
@ -81,28 +81,22 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
m_sideSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_splitterSignals = new wxSplitterWindow( m_sidePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE );
|
||||
m_splitterSignals->SetSashGravity( 0.33 );
|
||||
m_splitterSignals->SetSashGravity( 0.5 );
|
||||
m_splitterSignals->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this );
|
||||
m_splitterSignals->SetMinimumPaneSize( 20 );
|
||||
|
||||
m_panelSignals = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelSignals->SetMinSize( wxSize( -1,100 ) );
|
||||
|
||||
wxBoxSizer* bSignalsSizer;
|
||||
bSignalsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bFiltersSizer;
|
||||
bFiltersSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
wxBoxSizer* bSizerSignals;
|
||||
bSizerSignals = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_filter = new wxSearchCtrl( m_panelSignals, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
#ifndef __WXMAC__
|
||||
m_filter->ShowSearchButton( true );
|
||||
#endif
|
||||
m_filter->ShowCancelButton( true );
|
||||
bFiltersSizer->Add( m_filter, 1, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
bSignalsSizer->Add( bFiltersSizer, 0, wxEXPAND, 5 );
|
||||
bSizerSignals->Add( m_filter, 0, wxEXPAND, 5 );
|
||||
|
||||
m_signalsGrid = new WX_GRID( m_panelSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
|
@ -114,9 +108,9 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
m_signalsGrid->SetMargins( 0, 0 );
|
||||
|
||||
// Columns
|
||||
m_signalsGrid->SetColSize( 0, 212 );
|
||||
m_signalsGrid->SetColSize( 1, 40 );
|
||||
m_signalsGrid->SetColSize( 2, 45 );
|
||||
m_signalsGrid->SetColSize( 0, 200 );
|
||||
m_signalsGrid->SetColSize( 1, 36 );
|
||||
m_signalsGrid->SetColSize( 2, 42 );
|
||||
m_signalsGrid->SetColSize( 3, 55 );
|
||||
m_signalsGrid->SetColSize( 4, 55 );
|
||||
m_signalsGrid->EnableDragColMove( false );
|
||||
|
@ -138,28 +132,28 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
|
||||
// Cell Defaults
|
||||
m_signalsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
bSignalsSizer->Add( m_signalsGrid, 1, wxEXPAND, 5 );
|
||||
bSizerSignals->Add( m_signalsGrid, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_panelSignals->SetSizer( bSignalsSizer );
|
||||
m_panelSignals->SetSizer( bSizerSignals );
|
||||
m_panelSignals->Layout();
|
||||
bSignalsSizer->Fit( m_panelSignals );
|
||||
m_panelCursorsAndTune = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelCursorsAndTune->SetMinSize( wxSize( -1,300 ) );
|
||||
bSizerSignals->Fit( m_panelSignals );
|
||||
m_panelCMT = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelCMT->SetMinSize( wxSize( -1,300 ) );
|
||||
|
||||
wxBoxSizer* bCursorsSizer;
|
||||
bCursorsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
wxBoxSizer* bSizerCMT;
|
||||
bSizerCMT = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_splitterTuneValues = new wxSplitterWindow( m_panelCursorsAndTune, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE|wxBORDER_NONE );
|
||||
m_splitterTuneValues->SetSashGravity( 0.5 );
|
||||
m_splitterTuneValues->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this );
|
||||
m_splitterTuneValues->SetMinimumPaneSize( 20 );
|
||||
m_splitterCursors = new wxSplitterWindow( m_panelCMT, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE|wxBORDER_NONE );
|
||||
m_splitterCursors->SetSashGravity( 0.2 );
|
||||
m_splitterCursors->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterCursorsOnIdle ), NULL, this );
|
||||
m_splitterCursors->SetMinimumPaneSize( 20 );
|
||||
|
||||
m_panelCursors = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelCursors->SetMinSize( wxSize( -1,100 ) );
|
||||
m_panelCursors = new wxPanel( m_splitterCursors, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelCursors->SetMinSize( wxSize( -1,60 ) );
|
||||
|
||||
wxBoxSizer* bSizer12;
|
||||
bSizer12 = new wxBoxSizer( wxVERTICAL );
|
||||
wxBoxSizer* bSizerCursors;
|
||||
bSizerCursors = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_cursorsGrid = new WX_GRID( m_panelCursors, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
|
@ -173,8 +167,8 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
// Columns
|
||||
m_cursorsGrid->SetColSize( 0, 45 );
|
||||
m_cursorsGrid->SetColSize( 1, 162 );
|
||||
m_cursorsGrid->SetColSize( 2, 100 );
|
||||
m_cursorsGrid->SetColSize( 3, 100 );
|
||||
m_cursorsGrid->SetColSize( 2, 90 );
|
||||
m_cursorsGrid->SetColSize( 3, 90 );
|
||||
m_cursorsGrid->EnableDragColMove( false );
|
||||
m_cursorsGrid->EnableDragColSize( true );
|
||||
m_cursorsGrid->SetColLabelValue( 0, _("Cursor") );
|
||||
|
@ -193,39 +187,87 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
|
||||
// Cell Defaults
|
||||
m_cursorsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
bSizer12->Add( m_cursorsGrid, 1, wxEXPAND, 5 );
|
||||
bSizerCursors->Add( m_cursorsGrid, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_panelCursors->SetSizer( bSizer12 );
|
||||
m_panelCursors->SetSizer( bSizerCursors );
|
||||
m_panelCursors->Layout();
|
||||
bSizer12->Fit( m_panelCursors );
|
||||
m_tunePanel = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_tunePanel->SetMinSize( wxSize( -1,100 ) );
|
||||
bSizerCursors->Fit( m_panelCursors );
|
||||
m_panelMT = new wxPanel( m_splitterCursors, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelMT->SetMinSize( wxSize( -1,100 ) );
|
||||
|
||||
wxBoxSizer* bSizer13;
|
||||
bSizer13 = new wxBoxSizer( wxVERTICAL );
|
||||
wxBoxSizer* bSizerMT;
|
||||
bSizerMT = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticTextTune = new wxStaticText( m_tunePanel, wxID_ANY, _("Tune"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextTune->Wrap( -1 );
|
||||
bSizer13->Add( m_staticTextTune, 0, wxTOP|wxRIGHT, 5 );
|
||||
m_splitterMeasurements = new wxSplitterWindow( m_panelMT, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE|wxBORDER_NONE );
|
||||
m_splitterMeasurements->SetSashGravity( 0.2 );
|
||||
m_splitterMeasurements->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterMeasurementsOnIdle ), NULL, this );
|
||||
m_splitterMeasurements->SetMinimumPaneSize( 20 );
|
||||
|
||||
m_tuneSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
m_panelMeasurements = new wxPanel( m_splitterMeasurements, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelMeasurements->SetMinSize( wxSize( -1,20 ) );
|
||||
|
||||
wxBoxSizer* bSizerMeasurements;
|
||||
bSizerMeasurements = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_measurementsGrid = new WX_GRID( m_panelMeasurements, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
// Grid
|
||||
m_measurementsGrid->CreateGrid( 0, 2 );
|
||||
m_measurementsGrid->EnableEditing( true );
|
||||
m_measurementsGrid->EnableGridLines( true );
|
||||
m_measurementsGrid->EnableDragGridSize( false );
|
||||
m_measurementsGrid->SetMargins( 0, 0 );
|
||||
|
||||
// Columns
|
||||
m_measurementsGrid->SetColSize( 0, 297 );
|
||||
m_measurementsGrid->SetColSize( 1, 90 );
|
||||
m_measurementsGrid->EnableDragColMove( false );
|
||||
m_measurementsGrid->EnableDragColSize( true );
|
||||
m_measurementsGrid->SetColLabelValue( 0, _("Measurement") );
|
||||
m_measurementsGrid->SetColLabelValue( 1, _("Value") );
|
||||
m_measurementsGrid->SetColLabelSize( -1 );
|
||||
m_measurementsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Rows
|
||||
m_measurementsGrid->EnableDragRowSize( true );
|
||||
m_measurementsGrid->SetRowLabelSize( 0 );
|
||||
m_measurementsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Label Appearance
|
||||
|
||||
// Cell Defaults
|
||||
m_measurementsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
bSizerMeasurements->Add( m_measurementsGrid, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizer13->Add( m_tuneSizer, 1, wxEXPAND, 5 );
|
||||
m_panelMeasurements->SetSizer( bSizerMeasurements );
|
||||
m_panelMeasurements->Layout();
|
||||
bSizerMeasurements->Fit( m_panelMeasurements );
|
||||
m_panelTuners = new wxPanel( m_splitterMeasurements, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelTuners->SetMinSize( wxSize( -1,100 ) );
|
||||
|
||||
m_sizerTuners = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
m_tunePanel->SetSizer( bSizer13 );
|
||||
m_tunePanel->Layout();
|
||||
bSizer13->Fit( m_tunePanel );
|
||||
m_splitterTuneValues->SplitHorizontally( m_panelCursors, m_tunePanel, 0 );
|
||||
bCursorsSizer->Add( m_splitterTuneValues, 1, wxEXPAND, 5 );
|
||||
m_panelTuners->SetSizer( m_sizerTuners );
|
||||
m_panelTuners->Layout();
|
||||
m_sizerTuners->Fit( m_panelTuners );
|
||||
m_splitterMeasurements->SplitHorizontally( m_panelMeasurements, m_panelTuners, 0 );
|
||||
bSizerMT->Add( m_splitterMeasurements, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_panelCursorsAndTune->SetSizer( bCursorsSizer );
|
||||
m_panelCursorsAndTune->Layout();
|
||||
bCursorsSizer->Fit( m_panelCursorsAndTune );
|
||||
m_splitterSignals->SplitHorizontally( m_panelSignals, m_panelCursorsAndTune, 0 );
|
||||
m_panelMT->SetSizer( bSizerMT );
|
||||
m_panelMT->Layout();
|
||||
bSizerMT->Fit( m_panelMT );
|
||||
m_splitterCursors->SplitHorizontally( m_panelCursors, m_panelMT, 0 );
|
||||
bSizerCMT->Add( m_splitterCursors, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_panelCMT->SetSizer( bSizerCMT );
|
||||
m_panelCMT->Layout();
|
||||
bSizerCMT->Fit( m_panelCMT );
|
||||
m_splitterSignals->SplitHorizontally( m_panelSignals, m_panelCMT, 0 );
|
||||
m_sideSizer->Add( m_splitterSignals, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
@ -250,6 +292,7 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
|
|||
m_filter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::OnFilterText ), NULL, this );
|
||||
m_signalsGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( SIM_PLOT_FRAME_BASE::onSignalsGridCellChanged ), NULL, this );
|
||||
m_cursorsGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( SIM_PLOT_FRAME_BASE::onCursorsGridCellChanged ), NULL, this );
|
||||
m_measurementsGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( SIM_PLOT_FRAME_BASE::onMeasurementsGridCellChanged ), NULL, this );
|
||||
}
|
||||
|
||||
SIM_PLOT_FRAME_BASE::~SIM_PLOT_FRAME_BASE()
|
||||
|
@ -263,5 +306,6 @@ SIM_PLOT_FRAME_BASE::~SIM_PLOT_FRAME_BASE()
|
|||
m_filter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::OnFilterText ), NULL, this );
|
||||
m_signalsGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( SIM_PLOT_FRAME_BASE::onSignalsGridCellChanged ), NULL, this );
|
||||
m_cursorsGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( SIM_PLOT_FRAME_BASE::onCursorsGridCellChanged ), NULL, this );
|
||||
m_measurementsGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( SIM_PLOT_FRAME_BASE::onMeasurementsGridCellChanged ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
|
@ -664,7 +664,7 @@
|
|||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="sashgravity">0.33</property>
|
||||
<property name="sashgravity">0.5</property>
|
||||
<property name="sashpos">0</property>
|
||||
<property name="sashsize">-1</property>
|
||||
<property name="show">1</property>
|
||||
|
@ -731,85 +731,74 @@
|
|||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSignalsSizer</property>
|
||||
<property name="name">bSizerSignals</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bFiltersSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxSearchCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="cancel_button">1</property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_filter</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="search_button">1</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnMotion">OnFilterMouseMoved</event>
|
||||
<event name="OnText">OnFilterText</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxSearchCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="cancel_button">1</property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_filter</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="search_button">1</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnMotion">OnFilterMouseMoved</event>
|
||||
<event name="OnText">OnFilterText</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
@ -843,7 +832,7 @@
|
|||
<property name="col_label_values">"Signal" "Plot" "Color" "Cursor 1" "Cursor 2"</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">5</property>
|
||||
<property name="column_sizes">212,40,45,55,55</property>
|
||||
<property name="column_sizes">200,36,42,55,55</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
|
@ -940,7 +929,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,300</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_panelCursorsAndTune</property>
|
||||
<property name="name">m_panelCMT</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -958,7 +947,7 @@
|
|||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bCursorsSizer</property>
|
||||
<property name="name">bSizerCMT</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
@ -1001,7 +990,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_splitterTuneValues</property>
|
||||
<property name="name">m_splitterCursors</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1009,7 +998,7 @@
|
|||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="sashgravity">0.5</property>
|
||||
<property name="sashgravity">0.2</property>
|
||||
<property name="sashpos">0</property>
|
||||
<property name="sashsize">-1</property>
|
||||
<property name="show">1</property>
|
||||
|
@ -1056,7 +1045,7 @@
|
|||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,100</property>
|
||||
<property name="minimum_size">-1,60</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_panelCursors</property>
|
||||
<property name="pane_border">1</property>
|
||||
|
@ -1076,7 +1065,7 @@
|
|||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer12</property>
|
||||
<property name="name">bSizerCursors</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
@ -1110,7 +1099,7 @@
|
|||
<property name="col_label_values">"Cursor" "Signal" "Time" "Value"</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">4</property>
|
||||
<property name="column_sizes">45,162,100,100</property>
|
||||
<property name="column_sizes">45,162,90,90</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
|
@ -1207,7 +1196,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,100</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_tunePanel</property>
|
||||
<property name="name">m_panelMT</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1225,14 +1214,14 @@
|
|||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer13</property>
|
||||
<property name="name">bSizerMT</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxSplitterWindow" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -1260,16 +1249,15 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Tune</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_pane_size">20</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextTune</property>
|
||||
<property name="name">m_splitterMeasurements</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1277,27 +1265,228 @@
|
|||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="sashgravity">0.2</property>
|
||||
<property name="sashpos">0</property>
|
||||
<property name="sashsize">-1</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="splitmode">wxSPLIT_HORIZONTAL</property>
|
||||
<property name="style">wxSP_3DSASH|wxSP_LIVE_UPDATE</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_tuneSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="window_style">wxBORDER_NONE</property>
|
||||
<object class="splitteritem" expanded="1">
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,20</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_panelMeasurements</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMeasurements</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGrid" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="cell_bg"></property>
|
||||
<property name="cell_font"></property>
|
||||
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
|
||||
<property name="cell_text"></property>
|
||||
<property name="cell_vert_alignment">wxALIGN_TOP</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="col_label_size">-1</property>
|
||||
<property name="col_label_values">"Measurement" "Value"</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">2</property>
|
||||
<property name="column_sizes">297,90</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_col_move">0</property>
|
||||
<property name="drag_col_size">1</property>
|
||||
<property name="drag_grid_size">0</property>
|
||||
<property name="drag_row_size">1</property>
|
||||
<property name="editing">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="grid_line_color"></property>
|
||||
<property name="grid_lines">1</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label_bg"></property>
|
||||
<property name="label_font"></property>
|
||||
<property name="label_text"></property>
|
||||
<property name="margin_height">0</property>
|
||||
<property name="margin_width">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_measurementsGrid</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="row_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_label_size">0</property>
|
||||
<property name="row_label_values"></property>
|
||||
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_sizes"></property>
|
||||
<property name="rows">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnGridCellChange">onMeasurementsGridCellChanged</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="splitteritem" expanded="1">
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,100</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_panelTuners</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sizerTuners</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">protected</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -29,7 +29,6 @@ class WX_GRID;
|
|||
#include <wx/splitter.h>
|
||||
#include <wx/srchctrl.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/frame.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -61,13 +60,16 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER
|
|||
wxPanel* m_panelSignals;
|
||||
wxSearchCtrl* m_filter;
|
||||
WX_GRID* m_signalsGrid;
|
||||
wxPanel* m_panelCursorsAndTune;
|
||||
wxSplitterWindow* m_splitterTuneValues;
|
||||
wxPanel* m_panelCMT;
|
||||
wxSplitterWindow* m_splitterCursors;
|
||||
wxPanel* m_panelCursors;
|
||||
WX_GRID* m_cursorsGrid;
|
||||
wxPanel* m_tunePanel;
|
||||
wxStaticText* m_staticTextTune;
|
||||
wxBoxSizer* m_tuneSizer;
|
||||
wxPanel* m_panelMT;
|
||||
wxSplitterWindow* m_splitterMeasurements;
|
||||
wxPanel* m_panelMeasurements;
|
||||
WX_GRID* m_measurementsGrid;
|
||||
wxPanel* m_panelTuners;
|
||||
wxBoxSizer* m_sizerTuners;
|
||||
|
||||
// Virtual event handlers, override them in your derived class
|
||||
virtual void onPlotDragged( wxAuiNotebookEvent& event ) { event.Skip(); }
|
||||
|
@ -78,6 +80,7 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER
|
|||
virtual void OnFilterText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onSignalsGridCellChanged( wxGridEvent& event ) { event.Skip(); }
|
||||
virtual void onCursorsGridCellChanged( wxGridEvent& event ) { event.Skip(); }
|
||||
virtual void onMeasurementsGridCellChanged( wxGridEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
@ -104,10 +107,16 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER
|
|||
m_splitterSignals->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this );
|
||||
}
|
||||
|
||||
void m_splitterTuneValuesOnIdle( wxIdleEvent& )
|
||||
void m_splitterCursorsOnIdle( wxIdleEvent& )
|
||||
{
|
||||
m_splitterTuneValues->SetSashPosition( 0 );
|
||||
m_splitterTuneValues->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this );
|
||||
m_splitterCursors->SetSashPosition( 0 );
|
||||
m_splitterCursors->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterCursorsOnIdle ), NULL, this );
|
||||
}
|
||||
|
||||
void m_splitterMeasurementsOnIdle( wxIdleEvent& )
|
||||
{
|
||||
m_splitterMeasurements->SetSashPosition( 0 );
|
||||
m_splitterMeasurements->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterMeasurementsOnIdle ), NULL, this );
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -191,9 +191,9 @@ wxString SPICE_VALUE::ToString() const
|
|||
}
|
||||
|
||||
|
||||
wxString SPICE_VALUE::ToString( int aPrecision, const wxString& aRange )
|
||||
wxString SPICE_VALUE::ToString( const SPICE_VALUE_FORMAT& aFormat )
|
||||
{
|
||||
wxString range( aRange );
|
||||
wxString range( aFormat.Range );
|
||||
|
||||
if( range.StartsWith( wxS( "~" ) ) )
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ wxString SPICE_VALUE::ToString( int aPrecision, const wxString& aRange )
|
|||
}
|
||||
else
|
||||
{
|
||||
SPICE_VALUE::UNIT_PREFIX rangePrefix = ParseSIPrefix( aRange[0] );
|
||||
SPICE_VALUE::UNIT_PREFIX rangePrefix = ParseSIPrefix( range[0] );
|
||||
m_base = m_base * std::pow( 10, m_prefix - rangePrefix );
|
||||
m_prefix = rangePrefix;
|
||||
}
|
||||
|
@ -222,8 +222,8 @@ wxString SPICE_VALUE::ToString( int aPrecision, const wxString& aRange )
|
|||
scale -= 1;
|
||||
}
|
||||
|
||||
mantissa = KiROUND( mantissa * std::pow( 10, aPrecision - 1 ) );
|
||||
mantissa *= std::pow( 10, scale - aPrecision + 1 );
|
||||
mantissa = KiROUND( mantissa * std::pow( 10, aFormat.Precision - 1 ) );
|
||||
mantissa *= std::pow( 10, scale - aFormat.Precision + 1 );
|
||||
|
||||
wxString res = wxString::FromCDouble( mantissa );
|
||||
StripZeros( res );
|
||||
|
|
|
@ -30,6 +30,13 @@
|
|||
#include <wx/string.h>
|
||||
#include <wx/valtext.h>
|
||||
|
||||
struct SPICE_VALUE_FORMAT
|
||||
{
|
||||
int Precision;
|
||||
wxString Range;
|
||||
};
|
||||
|
||||
|
||||
///< Helper class to handle Spice way of expressing values (e.g. 10.5 Meg)
|
||||
class SPICE_VALUE
|
||||
{
|
||||
|
@ -87,7 +94,7 @@ public:
|
|||
* @param aPrecision number of significant digits
|
||||
* @param aRange "~" + unit for autorage; otherwise SI prefix + unit
|
||||
*/
|
||||
wxString ToString( int aPrecision, const wxString& aRange );
|
||||
wxString ToString( const SPICE_VALUE_FORMAT& aFormat );
|
||||
|
||||
/**
|
||||
* Return string value in Spice format (e.g. 123.3456789k).
|
||||
|
|
|
@ -40,20 +40,21 @@
|
|||
|
||||
TUNER_SLIDER::TUNER_SLIDER( SIM_PLOT_FRAME* aFrame, wxWindow* aParent,
|
||||
const SCH_SHEET_PATH& aSheetPath, SCH_SYMBOL* aSymbol ) :
|
||||
TUNER_SLIDER_BASE( aParent ),
|
||||
m_symbol( aSymbol->m_Uuid ), m_sheetPath( aSheetPath ),
|
||||
m_min( 0.0 ),
|
||||
m_max( 0.0 ),
|
||||
m_value( 0.0 ),
|
||||
m_frame ( aFrame )
|
||||
TUNER_SLIDER_BASE( aParent ),
|
||||
m_symbol( aSymbol->m_Uuid ),
|
||||
m_sheetPath( aSheetPath ),
|
||||
m_ref( aSymbol->GetRef( &aSheetPath ) ),
|
||||
m_min( 0.0 ),
|
||||
m_max( 0.0 ),
|
||||
m_value( 0.0 ),
|
||||
m_frame ( aFrame )
|
||||
{
|
||||
wxString ref = aSymbol->GetRef( &m_sheetPath );
|
||||
const SPICE_ITEM* item = aFrame->GetExporter()->FindItem( std::string( ref.ToUTF8() ) );
|
||||
const SPICE_ITEM* item = aFrame->GetExporter()->FindItem( std::string( m_ref.ToUTF8() ) );
|
||||
|
||||
if( !item )
|
||||
throw KI_PARAM_ERROR( wxString::Format( _( "%s not found" ), ref ) );
|
||||
throw KI_PARAM_ERROR( wxString::Format( _( "%s not found" ), m_ref ) );
|
||||
|
||||
m_name->SetLabel( ref );
|
||||
m_name->SetLabel( wxString::Format( _( "Tune %s" ), m_ref ) );
|
||||
m_closeBtn->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
|
||||
|
||||
m_e24->SetBitmap( KiBitmap( BITMAPS::e_24 ) );
|
||||
|
@ -72,7 +73,7 @@ TUNER_SLIDER::TUNER_SLIDER( SIM_PLOT_FRAME* aFrame, wxWindow* aParent,
|
|||
{
|
||||
throw KI_PARAM_ERROR( wxString::Format( _( "%s has simulation model of type '%s %s'; "
|
||||
"only RLC passives be tuned" ),
|
||||
ref,
|
||||
m_ref,
|
||||
item->model->GetDeviceInfo().fieldValue,
|
||||
item->model->GetTypeInfo().fieldValue ) );
|
||||
}
|
||||
|
@ -107,6 +108,12 @@ TUNER_SLIDER::TUNER_SLIDER( SIM_PLOT_FRAME* aFrame, wxWindow* aParent,
|
|||
}
|
||||
|
||||
|
||||
void TUNER_SLIDER::ShowChangedLanguage()
|
||||
{
|
||||
m_name->SetLabel( wxString::Format( _( "Tune %s" ), m_ref ) );
|
||||
}
|
||||
|
||||
|
||||
void TUNER_SLIDER::onESeries( wxCommandEvent& event )
|
||||
{
|
||||
if( event.GetEventObject() != m_e24 )
|
||||
|
|
|
@ -76,6 +76,8 @@ public:
|
|||
bool SetMin( const SPICE_VALUE& aVal );
|
||||
bool SetMax( const SPICE_VALUE& aVal );
|
||||
|
||||
void ShowChangedLanguage();
|
||||
|
||||
private:
|
||||
void updateComponentValue();
|
||||
void updateSlider();
|
||||
|
@ -99,8 +101,10 @@ private:
|
|||
void onValueTextEnter( wxCommandEvent& event ) override;
|
||||
void onMinTextEnter( wxCommandEvent& event ) override;
|
||||
|
||||
private:
|
||||
KIID m_symbol;
|
||||
SCH_SHEET_PATH m_sheetPath;
|
||||
wxString m_ref;
|
||||
|
||||
SPICE_VALUE m_min;
|
||||
SPICE_VALUE m_max;
|
||||
|
|
Loading…
Reference in New Issue