Skip to content

Commit

Permalink
Correct set device id when new FormModSim created
Browse files Browse the repository at this point in the history
  • Loading branch information
sanny32 committed Nov 2, 2023
1 parent 5bfe054 commit c2d4137
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions omodsim/formmodsim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ FormModSim::FormModSim(int id, ModbusMultiServer& server, QSharedPointer<DataSim
ui->setupUi(this);
setWindowTitle(QString("ModSim%1").arg(_formId));

ui->lineEditDeviceId->setInputRange(ModbusLimits::slaveRange());
ui->lineEditDeviceId->setValue(server.deviceId());

ui->stackedWidget->setCurrentIndex(0);
ui->scriptControl->setModbusMultiServer(&_mbMultiServer);
ui->scriptControl->setByteOrder(ui->outputWidget->byteOrder());
Expand All @@ -43,9 +46,6 @@ FormModSim::FormModSim(int id, ModbusMultiServer& server, QSharedPointer<DataSim
ui->lineEditLength->setInputRange(ModbusLimits::lengthRange());
ui->lineEditLength->setValue(100);

ui->lineEditDeviceId->setInputRange(ModbusLimits::slaveRange());
ui->lineEditDeviceId->setValue(1);

ui->comboBoxModbusPointType->setCurrentPointType(QModbusDataUnit::HoldingRegisters);

onDefinitionChanged();
Expand Down

0 comments on commit c2d4137

Please sign in to comment.