Commit a416a9a9be914fcd3d48c0f399ee045837bf77e5

Authored by xiemeng
1 parent 20d2c36f

重复扫码问题以及其他代码优化

... ... @@ -153,9 +153,9 @@ BOOL CChoosedbdlg::OnInitDialog()
153 153
154 154 my_str_ap_path = CString(g_sMetaComm.sDBFileOption.strAPDbpath);
155 155 my_str_bp_path = CString(g_sMetaComm.sDBFileOption.strMD1Dbpath);
156   - SetDlgItemText(IDC_STR_AP_PATH,my_str_ap_path);
157   - SetDlgItemText(IDC_STR_BP_PATH,my_str_bp_path);
158   - //
  156 +
  157 + GetDlgItem(IDC_EDIT1)->SetWindowText(my_str_ap_path);
  158 + GetDlgItem(IDC_EDIT2)->SetWindowText(my_str_bp_path);
159 159
160 160 myversion = CString(g_sMetaComm.check_sw_ver);
161 161 GetDlgItem(IDC_EDT_VERSION)->SetWindowText(myversion);
... ...
... ... @@ -206,8 +206,6 @@ META_RESULT SmartPhoneSN::WriteNvramLoop()
206 206 }
207 207 a_imei_ary[15] = 0;
208 208 a_imei_ary2[15] = 0;
209   - if (iRet == META_SUCCESS || iRet2 == META_SUCCESS)
210   - {
211 209 g_pMainDlg->GetDlgItem(IDC_STATIC_IMEI1)->SetWindowText(a_imei_ary);
212 210 g_pMainDlg->GetDlgItem(IDC_STATIC_IMEI2)->SetWindowText(a_imei_ary2);
213 211 if (g_pMainDlg->myscanimei1 == CString(a_imei_ary) &&
... ... @@ -219,12 +217,7 @@ META_RESULT SmartPhoneSN::WriteNvramLoop()
219 217 {
220 218 UpdateUIMsg("IMEI wrong!!!");
221 219 }
222   - }
223   - else
224   - {
225   - UpdateUIMsg("IMEI failed to read");
226   - }
227   - spNextStage = SP_END_STAGE;
  220 +
228 221 }
229 222 else
230 223 {
... ... @@ -3801,7 +3794,8 @@ void SmartPhoneSN::ThreadMainEntryPoint()
3801 3794 UpdateUIMsg("Wait for usb insert...");
3802 3795 }
3803 3796
3804   - EnableStartBTN(true);
  3797 + EnableStartBTN(true);
  3798 + g_pMainDlg->SetTimer(1,1000,NULL);
3805 3799
3806 3800 MetaResult = (META_RESULT)EnterAPMetaMode();
3807 3801 if (MetaResult != META_SUCCESS)
... ... @@ -4025,6 +4019,8 @@ End:
4025 4019 {
4026 4020 // m_Process->SendMessage(PBM_SETBARCOLOR, 0, RGB(255, 0, 0));
4027 4021 UpdateUICountResult(FAIL);
  4022 + g_pMainDlg->mytime_count= 0;
  4023 + g_pMainDlg->KillTimer(1);
4028 4024 }
4029 4025 else
4030 4026 {
... ... @@ -4032,10 +4028,14 @@ End:
4032 4028 MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::All Operate successfully!!");
4033 4029
4034 4030 #ifdef _AUTO_GEN_FEATURE_
4035   - if (g_AutoGenData.bEnableAutoGen)
4036   - UpdateAutoGenParaToSetupFile();
  4031 + if (g_AutoGenData.bEnableAutoGen)
  4032 + {
  4033 + UpdateAutoGenParaToSetupFile();
  4034 + }
4037 4035 #endif
4038 4036 UpdateUICountResult(PASS);
  4037 + g_pMainDlg->mytime_count = 0;
  4038 + g_pMainDlg->KillTimer(1);
4039 4039 }
4040 4040
4041 4041 }
... ...
No preview for this file type
No preview for this file type
... ... @@ -6,7 +6,13 @@
6 6 --------------------Configuration: SN Writer - Win32 Debug--------------------
7 7 </h3>
8 8 <h3>Command Lines</h3>
9   -Creating temporary file "C:\Users\echo\AppData\Local\Temp\RSP8602.tmp" with contents
  9 +Creating temporary file "D:\temp\RSP345.tmp" with contents
  10 +[
  11 +/nologo /MTd /W3 /Gi /GX /ZI /Od /I ".\\" /I ".\SNbase\inc" /I ".\Execute" /I ".\Extra\CBtnST" /I ".\Form\About" /I ".\Form\AutoGen" /I ".\Form\ScanData" /I ".\Form\Identify" /I ".\Form\FileSel" /I ".\Form\SystemConfig" /I ".\MtkLib\AT_cmd\inc" /I ".\CBtnST" /I ".\MtkLib\Brom\inc" /I ".\MtkLib\DebugTrace\inc" /I ".\MtkLib\SNFstream\inc" /I ".\Common" /I ".\MtkLib\Eboot\inc" /I ".\MtkLib\Meta\inc" /I ".\MtkLib\Security\inc" /I ".\MtkLib\USBSwitchTool\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR"Debug/" /Fp"Debug/SN_Station.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
  12 +"D:\workspace\intex_tool\intex_check_src_git\InterlockingTool\Choosedbdlg.cpp"
  13 +]
  14 +Creating command line "cl.exe @D:\temp\RSP345.tmp"
  15 +Creating temporary file "D:\temp\RSP346.tmp" with contents
10 16 [
11 17 shlwapi.lib "./mtklib/meta/lib/*.lib" "./mtklib/Eboot/lib/*.lib" "./mtklib/Security/lib/*.lib" "./mtklib/SNFstream/lib/*.lib" "./mtklib/DebugTrace/lib/*.lib" "./mtklib/usbswitchtool/lib/*.lib" /nologo /subsystem:windows /incremental:yes /pdb:"Output/SN Writer.pdb" /debug /machine:I386 /out:"Output/SN Writer.exe" /pdbtype:sept
12 18 .\Debug\Common.obj
... ... @@ -26,15 +32,46 @@ shlwapi.lib "./mtklib/meta/lib/*.lib" "./mtklib/Eboot/lib/*.lib" "./mtklib/Secur
26 32 .\Debug\SystemConfig.obj
27 33 .\Debug\AboutSNDlg.obj
28 34 .\Debug\autogendlg.obj
  35 +.\Debug\Choosedbdlg.obj
29 36 .\Debug\Encryption.obj
30 37 ".\Debug\SN Writer.obj"
31 38 ".\Debug\SN WriterDlg.obj"
32 39 .\Debug\StdAfx.obj
33 40 ".\Debug\SN Writer.res"
34 41 ]
35   -Creating command line "link.exe @C:\Users\echo\AppData\Local\Temp\RSP8602.tmp"
  42 +Creating command line "link.exe @D:\temp\RSP346.tmp"
36 43 <h3>Output Window</h3>
  44 +Compiling...
  45 +Choosedbdlg.cpp
37 46 Linking...
  47 +Creating temporary file "D:\temp\RSP402.tmp" with contents
  48 +[
  49 +/nologo /o"Output/SN Writer.bsc"
  50 +.\Debug\StdAfx.sbr
  51 +.\Debug\Common.sbr
  52 +.\Debug\FPexc.sbr
  53 +.\Debug\SNbase.sbr
  54 +.\Debug\SPexc.sbr
  55 +.\Debug\AtProcess.sbr
  56 +.\Debug\rs232Module.sbr
  57 +.\Debug\xboot_debug.sbr
  58 +.\Debug\AUTH.sbr
  59 +.\Debug\SCERT.sbr
  60 +.\Debug\SLA.sbr
  61 +.\Debug\fileseldlg.sbr
  62 +.\Debug\ChgPasswdDlg.sbr
  63 +.\Debug\VerifyPasswdDlg.sbr
  64 +.\Debug\ScanData.sbr
  65 +.\Debug\SystemConfig.sbr
  66 +.\Debug\AboutSNDlg.sbr
  67 +.\Debug\autogendlg.sbr
  68 +.\Debug\Choosedbdlg.sbr
  69 +.\Debug\Encryption.sbr
  70 +".\Debug\SN Writer.sbr"
  71 +".\Debug\SN WriterDlg.sbr"]
  72 +Creating command line "bscmake.exe @D:\temp\RSP402.tmp"
  73 +Creating browse info file...
  74 +<h3>Output Window</h3>
38 75
39 76
40 77
... ...
... ... @@ -213,7 +213,7 @@ FONT 9, "΢ÈíÑźÚ"
213 213 BEGIN
214 214 EDITTEXT IDC_IMEI1_FROM_SCAN,44,15,109,12,ES_AUTOHSCROLL
215 215 EDITTEXT IDC_IMEI2_FROM_SCAN,44,33,109,12,ES_AUTOHSCROLL
216   - DEFPUSHBUTTON "Start",IDC_BTN_START,169,16,103,25,BS_CENTER |
  216 + DEFPUSHBUTTON "Start",IDC_BTN_START,173,16,99,25,BS_CENTER |
217 217 BS_VCENTER | NOT WS_TABSTOP
218 218 LISTBOX IDC_LOG_LIST,0,118,293,133,LBS_NOINTEGRALHEIGHT |
219 219 WS_VSCROLL | WS_HSCROLL
... ...
... ... @@ -96,6 +96,7 @@ CSNWriterDlg::CSNWriterDlg(CWnd* pParent /*=NULL*/)
96 96 myrslt_imei = _T("");
97 97 myscanimei1 = _T("");
98 98 myscanimei2 = _T("");
  99 + mytime_count = 0;
99 100 //}}AFX_DATA_INIT
100 101 // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
101 102 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
... ... @@ -161,8 +162,9 @@ BEGIN_MESSAGE_MAP(CSNWriterDlg, CDialog)
161 162 ON_COMMAND(IDR_OPTION_COMPOSITE_DEVICE, OnOptionCompositeDevice)
162 163 ON_COMMAND(IDR_BACKNV_TOPC, OnBacknvTopc)
163 164 ON_COMMAND(IDR_OEM_LOCK, OnFastbootOemLock)
164   - ON_WM_SYSCOMMAND()
165 165 ON_WM_KEYDOWN()
  166 + ON_WM_SYSCOMMAND()
  167 + ON_WM_TIMER()
166 168 //}}AFX_MSG_MAP
167 169 END_MESSAGE_MAP()
168 170
... ... @@ -417,6 +419,7 @@ void CSNWriterDlg::EnableUIItem()
417 419 // GetDlgItem(IDC_MAINUI_TEMP2)->ShowWindow(FALSE);
418 420
419 421 SetDlgItemText(IDC_BTN_START, "Start");
  422 + GetDlgItem(IDC_BTN_START)->EnableWindow(FALSE);
420 423
421 424
422 425 //UpdateData(FALSE);
... ... @@ -1083,6 +1086,16 @@ void CSNWriterDlg::OnOK()
1083 1086
1084 1087 if (GetFocus() == GetDlgItem(IDC_IMEI2_FROM_SCAN))
1085 1088 {
  1089 + if (myscanimei2 == myscanimei1)
  1090 + {
  1091 + myloglist.SetCurSel(myloglist.AddString("IMEI same, please re scan!!!"));
  1092 + myscanimei2 = "";
  1093 + myctrlscan2.SetWindowText("");
  1094 + myscanimei1 = "";
  1095 + myctrlscan1.SetWindowText("");
  1096 + myctrlscan1.SetFocus();
  1097 + return;
  1098 + }
1086 1099 if (myscanimei2.GetLength() == 15)
1087 1100 {
1088 1101 OnBtnStart();
... ... @@ -1104,3 +1117,15 @@ void CSNWriterDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
1104 1117
1105 1118 CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
1106 1119 }
  1120 +
  1121 +void CSNWriterDlg::OnTimer(UINT nIDEvent)
  1122 +{
  1123 + CString astr_time;
  1124 + if (nIDEvent == 1)
  1125 + {
  1126 + mytime_count++;
  1127 + astr_time.Format("%d S",mytime_count);
  1128 + GetDlgItem(IDC_STATIC_TIMECOUNT)->SetWindowText(astr_time);
  1129 + }
  1130 + CDialog::OnTimer(nIDEvent);
  1131 +}
... ...
... ... @@ -93,6 +93,7 @@ protected:
93 93 virtual void OnOK();
94 94 afx_msg void OnSelchangeComboComport();
95 95 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  96 + afx_msg void OnTimer(UINT nIDEvent);
96 97 //}}AFX_MSG
97 98 DECLARE_MESSAGE_MAP()
98 99
... ... @@ -127,6 +128,7 @@ public:
127 128 HBITMAP m_hBitmapPass;
128 129 HBITMAP m_hBitmapFail;
129 130 CFont m_font;
  131 + int mytime_count;
130 132 };
131 133
132 134 //{{AFX_INSERT_LOCATION}}
... ...
Please register or login to post a comment