更新遥控器画面
This commit is contained in:
@@ -51,7 +51,6 @@ void P13_InsPage::Write32Bit(uint8_t Key, uint8_t Index, bool Bit)
|
||||
NewValue = OldValue | (1u << Index); // 置 1
|
||||
else
|
||||
NewValue = OldValue & ~(1u << Index); // 清 0
|
||||
|
||||
/* 5. 值没变就提前退出 */
|
||||
if (OldValue == NewValue) return;
|
||||
|
||||
@@ -61,7 +60,15 @@ void P13_InsPage::Write32Bit(uint8_t Key, uint8_t Index, bool Bit)
|
||||
while (!m_OpcUaManager->writeNodeValue(NodeId, NewValue) && Count < 10) {
|
||||
++Count;
|
||||
}
|
||||
qDebug()<<"成功发送节点:"<<NodeId<<"值"<<NewValue;
|
||||
Sleep_ms(100);
|
||||
if(Bit){
|
||||
NewValue = OldValue & ~(1u << Index); // 清 0
|
||||
/* 6. 带重试的写操作 */
|
||||
uint8_t Count = 0;
|
||||
while (!m_OpcUaManager->writeNodeValue(NodeId, NewValue) && Count < 10) {
|
||||
++Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
void P13_InsPage::on_XZK_OperMode_activated(int index) {Write32Bit( 1, 0, static_cast<int8_t>(index));} //
|
||||
void P13_InsPage::on_XZK_SpeedMode_activated(int index) {Write32Bit( 4, 5, static_cast< bool >(index));} //
|
||||
|
||||
Reference in New Issue
Block a user