|
@@ -37,7 +37,7 @@ namespace MOKA_Factory_Tools
|
|
KeyInfo keyInfo = new KeyInfo();
|
|
KeyInfo keyInfo = new KeyInfo();
|
|
FireTVKey fireTVKey = new FireTVKey();
|
|
FireTVKey fireTVKey = new FireTVKey();
|
|
bool preloadNow;
|
|
bool preloadNow;
|
|
- string SN = "";
|
|
|
|
|
|
+ string SN;
|
|
string orderNow;
|
|
string orderNow;
|
|
Main mainform;
|
|
Main mainform;
|
|
int usingTime = 0;
|
|
int usingTime = 0;
|
|
@@ -46,7 +46,6 @@ namespace MOKA_Factory_Tools
|
|
Thread WritekeyThread;
|
|
Thread WritekeyThread;
|
|
string availableCount = "unknow";
|
|
string availableCount = "unknow";
|
|
|
|
|
|
- public string PSN = "";
|
|
|
|
|
|
|
|
//删除界面指针委托
|
|
//删除界面指针委托
|
|
public delegate void DisplayUpdateDelegate(IntPtr intPtr);
|
|
public delegate void DisplayUpdateDelegate(IntPtr intPtr);
|
|
@@ -709,88 +708,12 @@ namespace MOKA_Factory_Tools
|
|
{
|
|
{
|
|
if (e.KeyCode == Keys.Enter)
|
|
if (e.KeyCode == Keys.Enter)
|
|
{
|
|
{
|
|
-#if true
|
|
|
|
- #region 波兰工厂临时解决方案
|
|
|
|
- // 获取条码前缀;
|
|
|
|
- string strSN = SNText.Text;
|
|
|
|
- SNText.Text = "";
|
|
|
|
- SNText.Enabled = false;
|
|
|
|
- if (strSN.StartsWith(orderNow))
|
|
|
|
- {
|
|
|
|
- if (SN.Length == 17)
|
|
|
|
- {
|
|
|
|
- MessageBox.Show("FSN already has, please scan PSN", "Error", MessageBoxButtons.OK);
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (strSN.Length != 17)
|
|
|
|
- {
|
|
|
|
- MessageBox.Show("The length of FSN is wrong!", "Error", MessageBoxButtons.OK);
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- SN = strSN;
|
|
|
|
- if (PSN.Length != 17)
|
|
|
|
- {
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- }
|
|
|
|
- else if (strSN.StartsWith("B"))
|
|
|
|
- {
|
|
|
|
- if (PSN.Length == 17)
|
|
|
|
- {
|
|
|
|
- MessageBox.Show("PSN already has, please scan FSN", "Error", MessageBoxButtons.OK);
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (strSN.Length != 17)
|
|
|
|
- {
|
|
|
|
- MessageBox.Show("The length of PSN is wrong", "Error", MessageBoxButtons.OK);
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- PSN = strSN;
|
|
|
|
- if (SN.Length != 17)
|
|
|
|
- {
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- MessageBox.Show("Unknown barcode type=" + strSN, "Error", MessageBoxButtons.OK);
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (PSN.Length == 0 || SN.Length == 0)
|
|
|
|
- {
|
|
|
|
- SNText.Enabled = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- keyInfo = new KeyInfo();
|
|
|
|
- FocusMark = false;
|
|
|
|
- SNKeyDownEven(this.Handle);
|
|
|
|
- SetInitialStatus();
|
|
|
|
- SNText.Enabled = false;
|
|
|
|
- #endregion 波兰工厂临时解决方案
|
|
|
|
-#else
|
|
|
|
keyInfo = new KeyInfo();
|
|
keyInfo = new KeyInfo();
|
|
FocusMark = false;
|
|
FocusMark = false;
|
|
SNKeyDownEven(this.Handle);
|
|
SNKeyDownEven(this.Handle);
|
|
SetInitialStatus();
|
|
SetInitialStatus();
|
|
SN = SNText.Text;
|
|
SN = SNText.Text;
|
|
SNText.Enabled = false;
|
|
SNText.Enabled = false;
|
|
-#endif
|
|
|
|
if (FunctionSettingNow.BarcodeLimit)
|
|
if (FunctionSettingNow.BarcodeLimit)
|
|
{
|
|
{
|
|
if (SN.Length != FunctionSettingNow.BarcodeLength || !SN.StartsWith(FunctionSettingNow.BarcodeKeyword))
|
|
if (SN.Length != FunctionSettingNow.BarcodeLength || !SN.StartsWith(FunctionSettingNow.BarcodeKeyword))
|
|
@@ -1646,18 +1569,11 @@ namespace MOKA_Factory_Tools
|
|
byte[] result_psn;
|
|
byte[] result_psn;
|
|
byte[] data_psn;
|
|
byte[] data_psn;
|
|
string error_psn;
|
|
string error_psn;
|
|
-#if true // 波兰工厂临时解决方案;
|
|
|
|
- if (PSN.Length == 17)
|
|
|
|
- {
|
|
|
|
- if (CommonMethod.GetFireTVDsn(midListNow.host, orderNow, Encoding.ASCII.GetString(data), SN, PSN, out string dsn, out error_psn, errorDBNow))
|
|
|
|
- {
|
|
|
|
-#else
|
|
|
|
if (SerialCMD.ReadFireTVPSN(TVPort, out result_psn, out data_psn, out error_psn, SerailDelay))
|
|
if (SerialCMD.ReadFireTVPSN(TVPort, out result_psn, out data_psn, out error_psn, SerailDelay))
|
|
{
|
|
{
|
|
string psn = Encoding.ASCII.GetString(data_psn);
|
|
string psn = Encoding.ASCII.GetString(data_psn);
|
|
if (CommonMethod.GetFireTVDsn(midListNow.host, orderNow, Encoding.ASCII.GetString(data), SN, psn, out string dsn, out error_psn, errorDBNow))
|
|
if (CommonMethod.GetFireTVDsn(midListNow.host, orderNow, Encoding.ASCII.GetString(data), SN, psn, out string dsn, out error_psn, errorDBNow))
|
|
{
|
|
{
|
|
-#endif
|
|
|
|
keyInfo.DSN = dsn;
|
|
keyInfo.DSN = dsn;
|
|
if (!CommonMethod.IsNumberAndWord(keyInfo.DSN))
|
|
if (!CommonMethod.IsNumberAndWord(keyInfo.DSN))
|
|
{
|
|
{
|
|
@@ -4541,25 +4457,6 @@ namespace MOKA_Factory_Tools
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-#region 波兰工厂临时功能-抄写所有Key后执行Trigger和Check指令;
|
|
|
|
- Log.WriteInfoLog("Start to Trigger DHA...");
|
|
|
|
- if ( SerialCMD.TriggerDHA(TVPort, out result, out data, out error, SerailDelay) )
|
|
|
|
- {
|
|
|
|
- Thread.Sleep(FunctionSettingNow.CheckDHAWaitTime);
|
|
|
|
- Log.WriteInfoLog("Start to Check DHA...");
|
|
|
|
- if ( !SerialCMD.CheckDHA(TVPort, out result, out data, out error, SerailDelay) )
|
|
|
|
- {
|
|
|
|
- MessageBox.Show("Check DHA Fail!");
|
|
|
|
- goto end;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- MessageBox.Show("Trigger DHA Fail!");
|
|
|
|
- goto end;
|
|
|
|
- }
|
|
|
|
-#endregion
|
|
|
|
-
|
|
|
|
//数据上传
|
|
//数据上传
|
|
if (midListNow.host == "LocalPC" && !preloadNow)
|
|
if (midListNow.host == "LocalPC" && !preloadNow)
|
|
{
|
|
{
|