@@ -91,7 +91,7 @@ MainWindow::MainWindow(QWidget *parent) :
9191 qlbLinkRYMCU->setOpenExternalLinks (true );// 状态栏显示官网、源码链接
9292 qlbLinkRYMCU->setText (" <style> a {text-decoration: none} </style> <a href=\" https://rymcu.com\" >--RYMCU官网--" );// 无下划线
9393 qlbLinkSource->setOpenExternalLinks (true );
94- qlbLinkSource->setText (" <style> a {text-decoration: none} </style> <a href=\" https://github.com/rymcu/RYCOM\" >--助手源代码V2.6.0 --" );// 无下划线
94+ qlbLinkSource->setText (" <style> a {text-decoration: none} </style> <a href=\" https://github.com/rymcu/RYCOM\" >--助手源代码V2.6.1 --" );// 无下划线
9595 // 隐藏进度条
9696 ui->progressBar ->setVisible (false );
9797 // 串口指示灯设置为只读控件,屏蔽鼠标点击事件
@@ -172,8 +172,8 @@ void MainWindow::MyComRevSlot()
172172 curDateTime = QDateTime::currentDateTime ();
173173 StrTimeDate = curDateTime.toString (" [yyyy-MM-dd hh:mm:ss.zzz] " );
174174
175- // ISP期间不显示接收时间
176- // if(ISisping) return;
175+ // stm32 ISP期间不显示接收数据
176+ if (ISisping == 1 ) return ;
177177
178178 // 开始显示数据,显示模式包括:是否16进制,是否显示接收时间
179179 if (ui->checkBoxRevHex ->checkState () == false )// 正常文本显示
@@ -1192,7 +1192,8 @@ void MainWindow::ResumeFormISP(void)
11921192{
11931193 ui->groupBoxRev ->setTitle (" 接收区" );
11941194 ISisping = 0 ;
1195- ui->progressBar ->setVisible (false );// 隐藏进度条
1195+ // ui->progressBar->setVisible(false);//隐藏进度条
1196+ on_pushButton_RYISP_clicked ();// 推出了隐藏下载框
11961197 on_pushButtonOpen_clicked ();// 重启串口,复位CH343P状态,保证能正常下载
11971198 on_pushButtonOpen_clicked ();
11981199}
@@ -1206,6 +1207,24 @@ void MainWindow::ResumeFormESP32ISP(void)
12061207 on_pushButtonOpen_clicked ();// 重启串口,复位CH343P状态,保证能正常下载
12071208 on_pushButtonOpen_clicked ();
12081209}
1210+ void MainWindow::on_pushButton_RYISP_clicked ()
1211+ {
1212+ static uint8_t flag_stm32 = 0 ;
1213+ ui->progressBar ->setVisible (false );// 隐藏进度条
1214+ flag_stm32++;
1215+ if (flag_stm32%2 )
1216+ {
1217+ ui->groupBox_stm32 ->move (190 *myobjectRate,395 *myobjectRate);
1218+ ui->groupBoxSend ->hide ();
1219+ }
1220+ else
1221+ {
1222+ ui->groupBox_stm32 ->move (190 *myobjectRate,720 *myobjectRate);
1223+ ui->groupBoxSend ->show ();
1224+ }
1225+ ui->groupBox_esp32 ->move (190 *myobjectRate,596 *myobjectRate);// 显示STM32下载框时,确保ESP32框不可见
1226+ }
1227+
12091228/* **********************************************************
12101229* 启动串口ISP
12111230* step1 串口设置为Even校验,并打开后,启动串口ISP按钮有效
@@ -1222,7 +1241,7 @@ void MainWindow::ResumeFormESP32ISP(void)
12221241* step10 下载完完成,隐藏进度条,并跳转至程序开始处执行。
12231242* step11 结束。
12241243***********************************************************/
1225- void MainWindow::on_pushButton_RYISP_clicked ()
1244+ void MainWindow::on_pushButton_STM32_START_clicked ()
12261245{
12271246 char error;
12281247
@@ -1363,6 +1382,9 @@ ui->TextRev->insertPlainText(CharToHex((char *)dataflash,4));//显示数据
13631382
13641383 // 开始下载程序
13651384 ui->progressBar ->setVisible (true );// 显示进度条
1385+ // ui->progressBar->setMinimumSize(200, 20); // 宽度足够显示文本
1386+ ui->progressBar ->setTextVisible (true );
1387+ ui->progressBar ->setFormat (" %p%" );
13661388 on_pushButton_WriteBin_clicked ();
13671389 // 状态恢复
13681390 ResumeFormISP ();
@@ -1692,6 +1714,10 @@ void MainWindow::on_pushButton_ESP32ISP_clicked()
16921714 ui->progressBar_BOOT_Combine ->setVisible (false );// 隐藏进度条
16931715 ui->progressBar_PART ->setVisible (false );
16941716 ui->progressBar_APP ->setVisible (false );
1717+ // 隐藏文件输入框
1718+ ui->lineEdit_BOOT_Combine ->setVisible (true );
1719+ ui->lineEdit_APP ->setVisible (true );
1720+ ui->lineEdit_PART ->setVisible (true );
16951721 flag++;
16961722 if (flag%2 )
16971723 {
@@ -1703,6 +1729,7 @@ void MainWindow::on_pushButton_ESP32ISP_clicked()
17031729 ui->groupBox_esp32 ->move (190 *myobjectRate,596 *myobjectRate);
17041730 ui->groupBoxSend ->show ();
17051731 }
1732+ ui->groupBox_stm32 ->move (190 *myobjectRate,720 *myobjectRate);// 显示ESP32下载框时,确保STM32框不可见
17061733}
17071734
17081735void MainWindow::on_radioButton_combine_clicked ()
@@ -1712,7 +1739,7 @@ void MainWindow::on_radioButton_combine_clicked()
17121739 {
17131740 temp = ui->label_BOOT_Combine ->text ();
17141741
1715- ui->pushButton_Open_BOOT_Combine ->setText (" Combine " );
1742+ ui->pushButton_Open_BOOT_Combine ->setText (" 合并的.bin " );
17161743 ui->lineEdit_BOOT_Combine ->setPlaceholderText (" 选择合并后的.bin" ); // 设置占位符文本
17171744 ui->label_BOOT_Combine ->setText (" @ 0x0" );
17181745
@@ -1834,8 +1861,8 @@ void MainWindow::on_pushButton_ESP32_START_clicked()
18341861 delay_msec (300 );
18351862 if (StartTimes==1 )
18361863 {
1837- QMessageBox::critical (this , " 提示" , " 进入ESP32 bootloader失败. \r\n 请确认已进入下载模式! \r\n " );
1838- ui->TextRev ->insertPlainText (" \r\n 进入bootloader:失败! " );
1864+ QMessageBox::critical (this , " 提示" , " 进入bootloader模式失败,请确认已进入下载模式! \r\n 操作方法如下: \r\n\r\n 1)按住boot,按一下RST按键,松开boot \r\n 2)RYCOM上重新打开串口 \r\n 3)选择文件,进入下载流程 " );
1865+ ui->TextRev ->insertPlainText (" \r\n 进入bootloader:失败,请确认已进入下载模式! \r\n 操作方法如下: \r\n\r\n 1)按住boot,按一下RST按键,松开boot \r\n 2)RYCOM上重新打开串口 \r\n 3)选择文件,进入下载流程 \r\n\r\n " );
18391866 ResumeFormESP32ISP ();
18401867 return ;
18411868 }
@@ -1974,18 +2001,30 @@ esp_loader_error_t MainWindow::esp32_flash_binary(const uint8_t *bin, size_t siz
19742001 switch (location) {
19752002 case BOOT_COMBIN:
19762003 ui->progressBar_BOOT_Combine ->setVisible (true );
2004+ ui->progressBar_BOOT_Combine ->setTextVisible (true );
2005+ ui->progressBar_BOOT_Combine ->setFormat (" %p%" );
19772006 ui->progressBar_BOOT_Combine ->setMaximum (binary_size);
19782007 ui->progressBar_BOOT_Combine ->setValue (written);
2008+ // 隐藏文件输入框
2009+ ui->lineEdit_BOOT_Combine ->setVisible (false );
19792010 break ;
19802011 case PART:
19812012 ui->progressBar_PART ->setVisible (true );
2013+ ui->progressBar_PART ->setTextVisible (true );
2014+ ui->progressBar_PART ->setFormat (" %p%" );
19822015 ui->progressBar_PART ->setMaximum (binary_size);
1983- ui->progressBar_PART ->setValue (written);
2016+ ui->progressBar_PART ->setValue (written);
2017+ // 隐藏文件输入框
2018+ ui->lineEdit_PART ->setVisible (false );
19842019 break ;
19852020 case APP:
19862021 ui->progressBar_APP ->setVisible (true );
2022+ ui->progressBar_APP ->setTextVisible (true );
2023+ ui->progressBar_APP ->setFormat (" %p%" );
19872024 ui->progressBar_APP ->setMaximum (binary_size);
19882025 ui->progressBar_APP ->setValue (written);
2026+ // 隐藏文件输入框
2027+ ui->lineEdit_APP ->setVisible (false );
19892028 break ;
19902029 default :
19912030 break ;
0 commit comments