|
@@ -47,6 +47,8 @@ namespace MOKA_Factory_Tools
|
|
Thread SNTextFocus;
|
|
Thread SNTextFocus;
|
|
bool FocusMark = false;
|
|
bool FocusMark = false;
|
|
Thread WritekeyThread;
|
|
Thread WritekeyThread;
|
|
|
|
+ // 线程锁:当前窗口抄写线程只能开一个;
|
|
|
|
+ private readonly object WriteKeyThreadLock;
|
|
string availableCount = "unknow";
|
|
string availableCount = "unknow";
|
|
// 只有NTF才用该变量, 0试产, 1=量产;
|
|
// 只有NTF才用该变量, 0试产, 1=量产;
|
|
int nOrderType = -1;
|
|
int nOrderType = -1;
|
|
@@ -104,6 +106,7 @@ namespace MOKA_Factory_Tools
|
|
ProductMsg_Text.Text = "Roku:";
|
|
ProductMsg_Text.Text = "Roku:";
|
|
if (functionSetting.NTF)
|
|
if (functionSetting.NTF)
|
|
ntfBLL = new NTFBLL(functionSetting.Mexican_NTF);
|
|
ntfBLL = new NTFBLL(functionSetting.Mexican_NTF);
|
|
|
|
+ WriteKeyThreadLock = new object();
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1741,6 +1744,7 @@ namespace MOKA_Factory_Tools
|
|
/// </summary>
|
|
/// </summary>
|
|
public void Writekey()
|
|
public void Writekey()
|
|
{
|
|
{
|
|
|
|
+ Monitor.Enter(WriteKeyThreadLock);
|
|
DateTime startTime = DateTime.Now;
|
|
DateTime startTime = DateTime.Now;
|
|
ArrayList keypath = new ArrayList();
|
|
ArrayList keypath = new ArrayList();
|
|
ArrayList keyStream = new ArrayList();
|
|
ArrayList keyStream = new ArrayList();
|
|
@@ -1748,7 +1752,7 @@ namespace MOKA_Factory_Tools
|
|
//int SerailDelay = FunctionSettingNow.SerailDelay;
|
|
//int SerailDelay = FunctionSettingNow.SerailDelay;
|
|
int SerailDelay = FunctionSettingNow.NextCommandWaitTime;
|
|
int SerailDelay = FunctionSettingNow.NextCommandWaitTime;
|
|
|
|
|
|
- Log.WriteInfoLog(SN + " start testing");
|
|
|
|
|
|
+ Log.WriteInfoLog(string.Format("threadid={0} SN={1} start testing",SN, Thread.CurrentThread.ManagedThreadId.ToString()));
|
|
// 0表示抄写失败,特殊:上报IDM失败\获取key失败\抄写失败;
|
|
// 0表示抄写失败,特殊:上报IDM失败\获取key失败\抄写失败;
|
|
// 1表示抄写成功,特殊:无;
|
|
// 1表示抄写成功,特殊:无;
|
|
// 2表示抄写成功,特殊:但试产NTF要求连续2次PASS才能上传MES,需要再测试一次;
|
|
// 2表示抄写成功,特殊:但试产NTF要求连续2次PASS才能上传MES,需要再测试一次;
|
|
@@ -5182,6 +5186,7 @@ namespace MOKA_Factory_Tools
|
|
EnableText(SNText);
|
|
EnableText(SNText);
|
|
#endif
|
|
#endif
|
|
EnableButton(BtnClickstart);
|
|
EnableButton(BtnClickstart);
|
|
|
|
+ Monitor.Exit(WriteKeyThreadLock);
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|