Correct read and write

This commit is contained in:
2025-07-04 02:22:15 +07:00
parent b03730d3c9
commit 122999e6a7

View File

@@ -199,11 +199,8 @@ void Mainwindows::onReadReady() {
if (address == m_buttonRegisters[i]) { if (address == m_buttonRegisters[i]) {
m_buttonValues[i] = value; m_buttonValues[i] = value;
bool bitState = (value >> m_buttonBits[i]) & 1; bool bitState = (value >> m_buttonBits[i]) & 1;
m_buttons[i]->setText(QString("Reg %1 Bit %2: %3") m_buttons[i]->setText(QString("%1")
.arg(m_buttonRegisters[i]) .arg(bitState ? "Закрыть" : "Открыть"));
.arg(m_buttonBits[i])
.arg(bitState ? "1" : "0"));
break;
} }
} }
} }