MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / ExecutionWindow

Method ExecutionWindow

cp-profiler/src/cpprofiler/execution_window.cpp:60–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60ExecutionWindow::ExecutionWindow(Execution &ex, QWidget* parent)
61 : QMainWindow(parent), execution_(ex)
62{
63 const auto &tree = ex.tree();
64 traditional_view_.reset(new tree::TraditionalView(tree, ex.userData(), ex.solver_data()));
65
66 connect(traditional_view_.get(), &tree::TraditionalView::nodeSelected,
67 this, &ExecutionWindow::nodeSelected);
68
69 connect(traditional_view_.get(), &tree::TraditionalView::nogoodsClicked, this, &ExecutionWindow::nogoodsClicked);
70
71 connect(this, &ExecutionWindow::nodeSelected, traditional_view_.get(), &tree::TraditionalView::setCurrentNode);
72
73 maybe_caller_.reset(new utils::MaybeCaller(30));
74
75 auto layout = new QGridLayout();
76
77 statusBar()->showMessage("Ready");
78
79 auto stats_bar = new NodeStatsBar(this, tree.node_stats());
80 statusBar()->addPermanentWidget(stats_bar);
81
82 resize(500, 700);
83
84 {
85 auto widget = new QWidget();
86 setCentralWidget(widget);
87 widget->setLayout(layout);
88 }
89
90 layout->addWidget(traditional_view_->widget(), 1, 0, 2, 1);
91
92 {
93
94 auto sb = new QSlider(Qt::Vertical);
95
96 sb->setMinimum(1);
97 sb->setMaximum(100);
98
99 constexpr int start_scale = 50;
100 sb->setValue(start_scale);
101 layout->addWidget(sb, 2, 1);
102
103 traditional_view_->setScale(start_scale);
104
105 connect(sb, &QSlider::valueChanged,
106 traditional_view_.get(), &tree::TraditionalView::setScale);
107
108 connect(&execution_.tree(), &tree::NodeTree::structureUpdated,
109 traditional_view_.get(), &tree::TraditionalView::setLayoutOutdated);
110
111 connect(&execution_.tree(), &tree::NodeTree::failedSubtreeClosed, [this](NodeID n) {
112 traditional_view_->hideNode(n);
113 });
114
115 {
116 auto statsUpdateTimer = new QTimer(this);
117 connect(statsUpdateTimer, &QTimer::timeout, stats_bar, &NodeStatsBar::update);

Callers

nothing calls this directly

Calls 9

hideNodeMethod · 0.80
callMethod · 0.80
hideBySizeMethod · 0.80
highlightSubtreesMethod · 0.80
resetMethod · 0.45
getMethod · 0.45
widgetMethod · 0.45
setScaleMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected