Commit 855165967acf6a184bc8f8627f7f9edf865d4bf6

Authored by xiemeng
1 parent 27c09dc4

和尚夹具判断与文件选择之间的关系

Showing 2 changed files with 11 additions and 7 deletions
... ... @@ -477,8 +477,11 @@ BOOL SettingsDlgInit( HWND hDlg )
477 477 //
478 478 // fill port combo box and make initial selection
479 479 //
480   - for (wCount = 0; wCount < wMaxCOM; wCount++) {
481   - wsprintf( szBuffer, "%s%d", (LPSTR) szTemp, wCount + 1 ) ;
  480 + for (wCount = 0; wCount < 255; wCount++)
  481 + {
  482 + if (TTYInfo.unOpenedPortAry[wCount] == 0)
  483 + continue;;
  484 + wsprintf( szBuffer, "%s%d", (LPSTR) szTemp, TTYInfo.unOpenedPortAry[wCount] ) ;
482 485 SendDlgItemMessage( hDlg, IDC_PORTCOMBO, CB_ADDSTRING, 0,
483 486 (LPARAM) (LPSTR) szBuffer ) ;
484 487 }
... ... @@ -671,11 +674,6 @@ BOOL CALLBACK ToolbarProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
671 674 {
672 675 case IDC_BUTTON2_SEC_BINFILE:
673 676 {
674   - if (TTYInfo.DownloadReday == FALSE)
675   - {
676   - MessageBox(ghwndMain, "请合上夹具", "提示!", MB_OK);
677   - return;
678   - }
679 677 if (strlen(TTYInfo.szFileName) == 0)
680 678 {
681 679 char * szFilter = "Text Files\0*.*\0";
... ... @@ -694,6 +692,11 @@ BOOL CALLBACK ToolbarProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
694 692 SetWindowText(GetDlgItem(hWndDlg, IDC_BUTTON2_SEC_BINFILE), "下载软件");
695 693
696 694 }
  695 + if (TTYInfo.DownloadReday == FALSE)
  696 + {
  697 + MessageBox(ghwndMain, "请合上夹具", "提示!", MB_OK);
  698 + return;
  699 + }
697 700
698 701
699 702 if (TRUE)
... ...
... ... @@ -76,6 +76,7 @@ struct TTYInfoStruct
76 76 int xSize, ySize, xScroll, yScroll, xOffset, yOffset,
77 77 nColumn, nRow, xChar, yChar , nCharPos;
78 78 char szFileName[MAX_PATH];
  79 + BYTE unOpenedPortAry[255];
79 80 BOOL DownloadReday;
80 81
81 82 } TTYInfo;
... ...
Please register or login to post a comment