From c5227b72799854e83e4ff95c14a0fb1106512ae5 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 11 Aug 2016 14:41:31 +0200 Subject: [PATCH] Fix: use correct node numbers in noise simulation directive --- eeschema/dialogs/dialog_sim_settings.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/eeschema/dialogs/dialog_sim_settings.cpp b/eeschema/dialogs/dialog_sim_settings.cpp index ca8c3c67f4..79294c6f32 100644 --- a/eeschema/dialogs/dialog_sim_settings.cpp +++ b/eeschema/dialogs/dialog_sim_settings.cpp @@ -114,15 +114,19 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow() // Noise analysis else if( page == m_pgNoise ) { + const NETLIST_EXPORTER_PSPICE::NET_INDEX_MAP& netMap = m_exporter->GetNetIndexMap(); + if( m_noiseMeas->GetValue().IsEmpty() || m_noiseSrc->GetValue().IsEmpty() || m_noisePointsNumber->IsEmpty() || m_noiseFreqStart->IsEmpty() || m_noiseFreqStop->IsEmpty() ) return false; - // TODO missing node number - wxString ref = m_noiseRef->GetValue().IsEmpty() ? wxString() : wxString::Format( ", %d", 42 ); + wxString ref = m_noiseRef->GetValue().IsEmpty() ? wxString() + : wxString::Format( ", %d", netMap.at( m_noiseRef->GetValue() ) ); + m_simCommand = wxString::Format( ".noise v(%d%s) %s %s %s %s %s", - 42, ref, m_noiseSrc->GetValue(), scaleToString( m_noiseScale->GetSelection() ), + netMap.at( m_noiseMeas->GetValue() ), ref, + m_noiseSrc->GetValue(), scaleToString( m_noiseScale->GetSelection() ), m_noisePointsNumber->GetValue(), m_noiseFreqStart->GetValue(), m_noiseFreqStop->GetValue() ); }