|
51 | 51 | #include "script/server_devicescripteditor.h" |
52 | 52 |
|
53 | 53 | #include "device/server_deviceui.h" |
54 | | - |
55 | 54 | #include "dataview/server_dataviewmanager.h" |
56 | | - |
57 | 55 | #include "simactions/server_simactionsui.h" |
| 56 | +#include "server_outputview.h" |
58 | 57 |
|
59 | 58 | mbServerUi::Strings::Strings() : |
60 | 59 | cacheFormat(QStringLiteral("Ui.format")) |
@@ -91,6 +90,7 @@ mbServerUi::mbServerUi(mbServer *core, QWidget *parent) : |
91 | 90 | m_dockActions = nullptr; |
92 | 91 | m_deviceManager = nullptr; |
93 | 92 | m_helpFile = QStringLiteral("/help/ModbusServer.qhc"); |
| 93 | + m_outputView = new mbServerOutputView(this); |
94 | 94 |
|
95 | 95 | m_ui.menuFile = ui->menuFile ; |
96 | 96 | m_ui.menuEdit = ui->menuEdit ; |
@@ -164,8 +164,21 @@ mbServerUi::~mbServerUi() |
164 | 164 | delete ui; |
165 | 165 | } |
166 | 166 |
|
| 167 | +QWidget *mbServerUi::outputView() const |
| 168 | +{ |
| 169 | + return m_outputView; |
| 170 | +} |
| 171 | + |
167 | 172 | void mbServerUi::initialize() |
168 | 173 | { |
| 174 | + // Output |
| 175 | + m_dockOutput = new QDockWidget("Output", this); |
| 176 | + m_dockOutput->setObjectName(QStringLiteral("dockOutput")); |
| 177 | + //m_outputView = new mbCoreOutputView(m_dockOutput); |
| 178 | + m_dockOutput->setWidget(m_outputView); |
| 179 | + this->addDockWidget(Qt::BottomDockWidgetArea, m_dockOutput); |
| 180 | + this->tabifyDockWidget(m_dockOutput, ui->dockLogView); |
| 181 | + |
169 | 182 | // Dialogs |
170 | 183 | m_dialogs = new mbServerDialogs(this); |
171 | 184 |
|
@@ -193,7 +206,7 @@ void mbServerUi::initialize() |
193 | 206 | this->tabifyDockWidget(m_dockActions, ui->dockLogView); |
194 | 207 |
|
195 | 208 | // Menu View |
196 | | - connect(ui->actionViewActions, &QAction::triggered, this, &mbServerUi::menuSlotViewActions); |
| 209 | + connect(ui->actionViewActions, &QAction::triggered, this, &mbServerUi::menuSlotViewSimActions); |
197 | 210 |
|
198 | 211 | // Menu Port |
199 | 212 | connect(ui->actionPortDeviceNew , &QAction::triggered, this, &mbServerUi::menuSlotPortDeviceNew ); |
@@ -274,7 +287,12 @@ void mbServerUi::setCachedSettings(const MBSETTINGS &settings) |
274 | 287 | m_scriptManager->setCachedSettings(settings); |
275 | 288 | } |
276 | 289 |
|
277 | | -void mbServerUi::menuSlotViewActions() |
| 290 | +void mbServerUi::outputMessage(const QString &message) |
| 291 | +{ |
| 292 | + m_outputView->showOutput(message); |
| 293 | +} |
| 294 | + |
| 295 | +void mbServerUi::menuSlotViewSimActions() |
278 | 296 | { |
279 | 297 | m_dockActions->show(); |
280 | 298 | m_dockActions->setFocus(); |
@@ -390,6 +408,11 @@ void mbServerUi::menuSlotEditSelectAll() |
390 | 408 | mbCoreUi::menuSlotEditSelectAll(); |
391 | 409 | } |
392 | 410 |
|
| 411 | +void mbServerUi::menuSlotViewOutput() |
| 412 | +{ |
| 413 | + m_dockOutput->show(); |
| 414 | +} |
| 415 | + |
393 | 416 | void mbServerUi::menuSlotPortNew() |
394 | 417 | { |
395 | 418 | if (core()->isRunning()) |
|
0 commit comments