diff --git a/mainwindow.cpp b/mainwindow.cpp index 4dd7e9a..5c001c6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -150,7 +150,7 @@ void MainWindow::constructUI() { *******************************************************************************/ connect(ui->storageConfigKey, &QPushButton::clicked, this, [=](bool check) { // DO(m_clstc->storageConfigs()); - ui->informationBrowser->setText("保存配置成功"); + ui->informationBrowser->setText("保存配置"); }); /******************************************************************************* @@ -158,7 +158,7 @@ void MainWindow::constructUI() { *******************************************************************************/ connect(ui->rebootDeviceKey, &QPushButton::clicked, this, [=](bool check) { // DO(m_clstc->reboot()); - ui->informationBrowser->setText("重启设备成功"); + ui->informationBrowser->setText("重启设备"); }); /******************************************************************************* @@ -166,7 +166,28 @@ void MainWindow::constructUI() { *******************************************************************************/ connect(ui->factoryResetKey, &QPushButton::clicked, this, [=](bool check) { // DO(m_clstc->factoryReset()); - ui->informationBrowser->setText("恢复出厂设置成功"); + ui->informationBrowser->setText("恢复出厂设置"); + }); + + /******************************************************************************* + * 寄存器操作 * + *******************************************************************************/ + + connect(ui->regReadKey, &QPushButton::clicked, this, [=](bool check) { // + uint32_t addr = str2int(ui->RegAdd->text()); + uint32_t value = 0; + DO(m_clstc->reg_read(addr, value, 100)); + ui->regReadbakVal->setText(fmt("0x%08X", value)); + ui->informationBrowser->setText(fmt("读0x%04x成功", addr)); + }); + + connect(ui->regWriteKey, &QPushButton::clicked, this, [=](bool check) { // + uint32_t addr = str2int(ui->RegAdd->text()); + uint32_t value = str2int(ui->regWriteVal->text()); + uint32_t readkbak = 0; + DO(m_clstc->reg_write(addr, value, readkbak, 100)); + ui->regReadbakVal->setText(fmt("0x%04x", readkbak)); + ui->informationBrowser->setText(fmt("写0x%04x成功", addr)); }); } diff --git a/mainwindow.ui b/mainwindow.ui index bd5d175..3a9b67d 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 1004 - 723 + 1055 + 768 @@ -378,53 +378,23 @@ - - - - 0 - 0 - - + 0 25 - - - 16777215 - 25 - - - - 2 - - - - - 0 - 0 - - + 0 25 - - - 16777215 - 25 - - - - 2 - @@ -503,7 +473,7 @@ 0 0 - 1004 + 1055 23