Skip to content

Commit 07f9efb

Browse files
author
Ананьев Александр
committed
Refactoring
1 parent af0e656 commit 07f9efb

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

omodsim/formmodsim.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ FormModSim::FormModSim(int id, ModbusMultiServer& server, QSharedPointer<DataSim
4444
onDefinitionChanged();
4545
ui->outputWidget->setFocus();
4646

47-
connect(_dataSimulator.get(), &DataSimulator::dataSimulated, this, &FormModSim::on_dataSimulated);
4847
connect(&_mbMultiServer, &ModbusMultiServer::request, this, &FormModSim::on_mbRequest);
4948
connect(&_mbMultiServer, &ModbusMultiServer::response, this, &FormModSim::on_mbResponse);
5049
connect(&_mbMultiServer, &ModbusMultiServer::connected, this, &FormModSim::on_mbConnected);
@@ -71,8 +70,7 @@ void FormModSim::changeEvent(QEvent* event)
7170
if (event->type() == QEvent::LanguageChange)
7271
{
7372
ui->retranslateUi(this);
74-
if(!_mbMultiServer.isConnected())
75-
ui->outputWidget->setStatus(tr("NOT CONNECTED!"));
73+
updateStatus();
7674
}
7775

7876
QWidget::changeEvent(event);
@@ -571,15 +569,3 @@ void FormModSim::on_mbDataChanged(const QModbusDataUnit&)
571569
const auto dd = displayDefinition();
572570
ui->outputWidget->updateData(_mbMultiServer.data(dd.PointType, dd.PointAddress - 1, dd.Length));
573571
}
574-
575-
///
576-
/// \brief FormModSim::on_dataSimulated
577-
/// \param mode
578-
/// \param type
579-
/// \param addr
580-
/// \param value
581-
///
582-
void FormModSim::on_dataSimulated(DataDisplayMode mode, QModbusDataUnit::RegisterType type, quint16 addr, QVariant value)
583-
{
584-
_mbMultiServer.writeRegister(type, { addr, value, mode, byteOrder() });
585-
}

omodsim/formmodsim.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ private slots:
9494
void on_mbRequest(const QModbusRequest& req);
9595
void on_mbResponse(const QModbusResponse& resp);
9696
void on_mbDataChanged(const QModbusDataUnit& data);
97-
void on_dataSimulated(DataDisplayMode mode, QModbusDataUnit::RegisterType type, quint16 addr, QVariant value);
9897

9998
private:
10099
void updateStatus();

0 commit comments

Comments
 (0)