Skip to content

Commit 26b12c7

Browse files
joern274saschatommasone
authored andcommitted
Fixed bug in waveform viewer, make sure that deleting a controller causes closing the tab
1 parent fd009de commit 26b12c7

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55
* added information to GUI setting file so that widgets position and size from previous session gets restored
66
* added option to focus on pin in pin context menu
77
* plugins
8+
* fixed bug in waveform viewer, make sure that deleting a controller causes closing the tab
89
* fixed broken initialization of DANA plugin when starting via CLI
910
* changed behavior of GUI plugin manager to keep only those plugins loaded which are requested by user
1011
* fixed bug in the bitorder propagation algorithm that would assign a wrong propagation order if pingroups with direction none were given as parameters

plugins/simulator/waveform_viewer/include/waveform_viewer/wave_widget.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <QMap>
3333
#include <QSplitter>
3434
#include <QFrame>
35+
#include <QPointer>
3536

3637
#include <hal_core/defines.h>
3738
#include "waveform_viewer/wave_item.h"
@@ -88,7 +89,7 @@ namespace hal {
8889
void resizeEvent(QResizeEvent *event) override;
8990

9091
private:
91-
NetlistSimulatorController* mController;
92+
QPointer<NetlistSimulatorController> mController;
9293
std::unique_ptr<NetlistSimulatorController> mControllerOwner;
9394

9495
u32 mControllerId;

plugins/simulator/waveform_viewer/src/wave_widget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ namespace hal {
175175

176176
void WaveWidget::createEngine(const QString &engineFactoryName)
177177
{
178-
mController->create_simulation_engine(engineFactoryName.toStdString());
178+
if (mController)
179+
mController->create_simulation_engine(engineFactoryName.toStdString());
179180
}
180181

181182
void WaveWidget::setVisualizeNetState(bool state, bool activeTab)

plugins/simulator/waveform_viewer/src/waveform_viewer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ namespace hal
361361
for (int inx=0; inx<mTabWidget->count(); inx++)
362362
{
363363
WaveWidget* ww = static_cast<WaveWidget*>(mTabWidget->widget(inx));
364-
if (ww->controllerId() == controllerId)
364+
if (ww->controllerId() == controllerId || ww->controllerId() == 0)
365365
{
366366
mTabWidget->removeTab(inx);
367367
ww->deleteLater();

0 commit comments

Comments
 (0)