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

Method Conductor

cp-profiler/src/cpprofiler/conductor.cpp:44–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42{
43
44Conductor::Conductor(Options opt, QWidget* parent) : QMainWindow(parent), options_(opt)
45{
46
47 setWindowTitle("CP-Profiler");
48
49 // readSettings();
50
51 auto layout = new QGridLayout();
52
53 {
54 auto window = new QWidget();
55 setCentralWidget(window);
56 window->setLayout(layout);
57 }
58
59 execution_list_.reset(new ExecutionList);
60 layout->addWidget(execution_list_->getWidget());
61
62 auto showButton = new QPushButton("Show Tree");
63 layout->addWidget(showButton);
64 connect(showButton, &QPushButton::clicked, [this]() {
65 for (auto execution : execution_list_->getSelected())
66 {
67 showTraditionalView(execution);
68 }
69 });
70
71 auto mergeButton = new QPushButton("Merge Trees");
72 layout->addWidget(mergeButton);
73
74 connect(mergeButton, &QPushButton::clicked, [this]() {
75 const auto selected = execution_list_->getSelected();
76
77 if (selected.size() == 2)
78 {
79 mergeTrees(selected[0], selected[1]);
80 }
81 else
82 {
83 print("select exactly two executions");
84 }
85 });
86
87 auto saveButton = new QPushButton("Save Execution");
88 layout->addWidget(saveButton);
89
90 /// TODO: make it clear that only the first one is saved
91 connect(saveButton, &QPushButton::clicked, [this]() {
92 for (auto e : execution_list_->getSelected())
93 {
94 saveExecution(e);
95 break;
96 }
97 });
98
99 auto loadButton = new QPushButton("Load Execution");
100 layout->addWidget(loadButton);
101

Callers

nothing calls this directly

Calls 8

getWidgetMethod · 0.80
getSelectedMethod · 0.80
listenMethod · 0.80
load_executionFunction · 0.70
printFunction · 0.50
resetMethod · 0.45
sizeMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected