Commit a416a9a9be914fcd3d48c0f399ee045837bf77e5

Authored by xiemeng
1 parent 20d2c36f

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

@@ -153,9 +153,9 @@ BOOL CChoosedbdlg::OnInitDialog() @@ -153,9 +153,9 @@ BOOL CChoosedbdlg::OnInitDialog()
153 153
154 my_str_ap_path = CString(g_sMetaComm.sDBFileOption.strAPDbpath); 154 my_str_ap_path = CString(g_sMetaComm.sDBFileOption.strAPDbpath);
155 my_str_bp_path = CString(g_sMetaComm.sDBFileOption.strMD1Dbpath); 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 myversion = CString(g_sMetaComm.check_sw_ver); 160 myversion = CString(g_sMetaComm.check_sw_ver);
161 GetDlgItem(IDC_EDT_VERSION)->SetWindowText(myversion); 161 GetDlgItem(IDC_EDT_VERSION)->SetWindowText(myversion);
@@ -206,8 +206,6 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() @@ -206,8 +206,6 @@ META_RESULT SmartPhoneSN::WriteNvramLoop()
206 } 206 }
207 a_imei_ary[15] = 0; 207 a_imei_ary[15] = 0;
208 a_imei_ary2[15] = 0; 208 a_imei_ary2[15] = 0;
209 - if (iRet == META_SUCCESS || iRet2 == META_SUCCESS)  
210 - {  
211 g_pMainDlg->GetDlgItem(IDC_STATIC_IMEI1)->SetWindowText(a_imei_ary); 209 g_pMainDlg->GetDlgItem(IDC_STATIC_IMEI1)->SetWindowText(a_imei_ary);
212 g_pMainDlg->GetDlgItem(IDC_STATIC_IMEI2)->SetWindowText(a_imei_ary2); 210 g_pMainDlg->GetDlgItem(IDC_STATIC_IMEI2)->SetWindowText(a_imei_ary2);
213 if (g_pMainDlg->myscanimei1 == CString(a_imei_ary) && 211 if (g_pMainDlg->myscanimei1 == CString(a_imei_ary) &&
@@ -219,12 +217,7 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() @@ -219,12 +217,7 @@ META_RESULT SmartPhoneSN::WriteNvramLoop()
219 { 217 {
220 UpdateUIMsg("IMEI wrong!!!"); 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 else 222 else
230 { 223 {
@@ -3801,7 +3794,8 @@ void SmartPhoneSN::ThreadMainEntryPoint() @@ -3801,7 +3794,8 @@ void SmartPhoneSN::ThreadMainEntryPoint()
3801 UpdateUIMsg("Wait for usb insert..."); 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 MetaResult = (META_RESULT)EnterAPMetaMode(); 3800 MetaResult = (META_RESULT)EnterAPMetaMode();
3807 if (MetaResult != META_SUCCESS) 3801 if (MetaResult != META_SUCCESS)
@@ -4025,6 +4019,8 @@ End: @@ -4025,6 +4019,8 @@ End:
4025 { 4019 {
4026 // m_Process->SendMessage(PBM_SETBARCOLOR, 0, RGB(255, 0, 0)); 4020 // m_Process->SendMessage(PBM_SETBARCOLOR, 0, RGB(255, 0, 0));
4027 UpdateUICountResult(FAIL); 4021 UpdateUICountResult(FAIL);
  4022 + g_pMainDlg->mytime_count= 0;
  4023 + g_pMainDlg->KillTimer(1);
4028 } 4024 }
4029 else 4025 else
4030 { 4026 {
@@ -4032,10 +4028,14 @@ End: @@ -4032,10 +4028,14 @@ End:
4032 MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::All Operate successfully!!"); 4028 MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::All Operate successfully!!");
4033 4029
4034 #ifdef _AUTO_GEN_FEATURE_ 4030 #ifdef _AUTO_GEN_FEATURE_
4035 - if (g_AutoGenData.bEnableAutoGen)  
4036 - UpdateAutoGenParaToSetupFile(); 4031 + if (g_AutoGenData.bEnableAutoGen)
  4032 + {
  4033 + UpdateAutoGenParaToSetupFile();
  4034 + }
4037 #endif 4035 #endif
4038 UpdateUICountResult(PASS); 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,7 +6,13 @@
6 --------------------Configuration: SN Writer - Win32 Debug-------------------- 6 --------------------Configuration: SN Writer - Win32 Debug--------------------
7 </h3> 7 </h3>
8 <h3>Command Lines</h3> 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 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 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 .\Debug\Common.obj 18 .\Debug\Common.obj
@@ -26,15 +32,46 @@ shlwapi.lib "./mtklib/meta/lib/*.lib" "./mtklib/Eboot/lib/*.lib" "./mtklib/Secur @@ -26,15 +32,46 @@ shlwapi.lib "./mtklib/meta/lib/*.lib" "./mtklib/Eboot/lib/*.lib" "./mtklib/Secur
26 .\Debug\SystemConfig.obj 32 .\Debug\SystemConfig.obj
27 .\Debug\AboutSNDlg.obj 33 .\Debug\AboutSNDlg.obj
28 .\Debug\autogendlg.obj 34 .\Debug\autogendlg.obj
  35 +.\Debug\Choosedbdlg.obj
29 .\Debug\Encryption.obj 36 .\Debug\Encryption.obj
30 ".\Debug\SN Writer.obj" 37 ".\Debug\SN Writer.obj"
31 ".\Debug\SN WriterDlg.obj" 38 ".\Debug\SN WriterDlg.obj"
32 .\Debug\StdAfx.obj 39 .\Debug\StdAfx.obj
33 ".\Debug\SN Writer.res" 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 <h3>Output Window</h3> 43 <h3>Output Window</h3>
  44 +Compiling...
  45 +Choosedbdlg.cpp
37 Linking... 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,7 +213,7 @@ FONT 9, "΢ÈíÑźÚ"
213 BEGIN 213 BEGIN
214 EDITTEXT IDC_IMEI1_FROM_SCAN,44,15,109,12,ES_AUTOHSCROLL 214 EDITTEXT IDC_IMEI1_FROM_SCAN,44,15,109,12,ES_AUTOHSCROLL
215 EDITTEXT IDC_IMEI2_FROM_SCAN,44,33,109,12,ES_AUTOHSCROLL 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 BS_VCENTER | NOT WS_TABSTOP 217 BS_VCENTER | NOT WS_TABSTOP
218 LISTBOX IDC_LOG_LIST,0,118,293,133,LBS_NOINTEGRALHEIGHT | 218 LISTBOX IDC_LOG_LIST,0,118,293,133,LBS_NOINTEGRALHEIGHT |
219 WS_VSCROLL | WS_HSCROLL 219 WS_VSCROLL | WS_HSCROLL
@@ -96,6 +96,7 @@ CSNWriterDlg::CSNWriterDlg(CWnd* pParent /*=NULL*/) @@ -96,6 +96,7 @@ CSNWriterDlg::CSNWriterDlg(CWnd* pParent /*=NULL*/)
96 myrslt_imei = _T(""); 96 myrslt_imei = _T("");
97 myscanimei1 = _T(""); 97 myscanimei1 = _T("");
98 myscanimei2 = _T(""); 98 myscanimei2 = _T("");
  99 + mytime_count = 0;
99 //}}AFX_DATA_INIT 100 //}}AFX_DATA_INIT
100 // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 101 // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
101 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); 102 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
@@ -161,8 +162,9 @@ BEGIN_MESSAGE_MAP(CSNWriterDlg, CDialog) @@ -161,8 +162,9 @@ BEGIN_MESSAGE_MAP(CSNWriterDlg, CDialog)
161 ON_COMMAND(IDR_OPTION_COMPOSITE_DEVICE, OnOptionCompositeDevice) 162 ON_COMMAND(IDR_OPTION_COMPOSITE_DEVICE, OnOptionCompositeDevice)
162 ON_COMMAND(IDR_BACKNV_TOPC, OnBacknvTopc) 163 ON_COMMAND(IDR_BACKNV_TOPC, OnBacknvTopc)
163 ON_COMMAND(IDR_OEM_LOCK, OnFastbootOemLock) 164 ON_COMMAND(IDR_OEM_LOCK, OnFastbootOemLock)
164 - ON_WM_SYSCOMMAND()  
165 ON_WM_KEYDOWN() 165 ON_WM_KEYDOWN()
  166 + ON_WM_SYSCOMMAND()
  167 + ON_WM_TIMER()
166 //}}AFX_MSG_MAP 168 //}}AFX_MSG_MAP
167 END_MESSAGE_MAP() 169 END_MESSAGE_MAP()
168 170
@@ -417,6 +419,7 @@ void CSNWriterDlg::EnableUIItem() @@ -417,6 +419,7 @@ void CSNWriterDlg::EnableUIItem()
417 // GetDlgItem(IDC_MAINUI_TEMP2)->ShowWindow(FALSE); 419 // GetDlgItem(IDC_MAINUI_TEMP2)->ShowWindow(FALSE);
418 420
419 SetDlgItemText(IDC_BTN_START, "Start"); 421 SetDlgItemText(IDC_BTN_START, "Start");
  422 + GetDlgItem(IDC_BTN_START)->EnableWindow(FALSE);
420 423
421 424
422 //UpdateData(FALSE); 425 //UpdateData(FALSE);
@@ -1083,6 +1086,16 @@ void CSNWriterDlg::OnOK() @@ -1083,6 +1086,16 @@ void CSNWriterDlg::OnOK()
1083 1086
1084 if (GetFocus() == GetDlgItem(IDC_IMEI2_FROM_SCAN)) 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 if (myscanimei2.GetLength() == 15) 1099 if (myscanimei2.GetLength() == 15)
1087 { 1100 {
1088 OnBtnStart(); 1101 OnBtnStart();
@@ -1104,3 +1117,15 @@ void CSNWriterDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) @@ -1104,3 +1117,15 @@ void CSNWriterDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
1104 1117
1105 CDialog::OnKeyDown(nChar, nRepCnt, nFlags); 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,6 +93,7 @@ protected:
93 virtual void OnOK(); 93 virtual void OnOK();
94 afx_msg void OnSelchangeComboComport(); 94 afx_msg void OnSelchangeComboComport();
95 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 95 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  96 + afx_msg void OnTimer(UINT nIDEvent);
96 //}}AFX_MSG 97 //}}AFX_MSG
97 DECLARE_MESSAGE_MAP() 98 DECLARE_MESSAGE_MAP()
98 99
@@ -127,6 +128,7 @@ public: @@ -127,6 +128,7 @@ public:
127 HBITMAP m_hBitmapPass; 128 HBITMAP m_hBitmapPass;
128 HBITMAP m_hBitmapFail; 129 HBITMAP m_hBitmapFail;
129 CFont m_font; 130 CFont m_font;
  131 + int mytime_count;
130 }; 132 };
131 133
132 //{{AFX_INSERT_LOCATION}} 134 //{{AFX_INSERT_LOCATION}}
Please register or login to post a comment