|
@@ -911,80 +911,74 @@ void CPageDebug::OnBnClickedLoadData()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if ( bSNReverse )
|
|
|
- {// 通过SN获取订单号;
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
+ // 直接使用订单号;
|
|
|
+ if ( CMESdb::GetInstance() )
|
|
|
{
|
|
|
- // 直接使用订单号;
|
|
|
- if ( CMESdb::GetInstance() )
|
|
|
- {
|
|
|
- if ( bSNReverse )
|
|
|
- {// 通过SN获取订单号;
|
|
|
- TString strBom;
|
|
|
- if ( CMESdb::GetInstance()->GetBomFromSN(strBatchNum.GetString(), strBom) )
|
|
|
- {
|
|
|
- // 设置文本;
|
|
|
- SetDlgItemText(EDIT_BATCH_NUMBER, strBom.c_str());
|
|
|
- _stprintf_s(GLOBAL::g_config.szBatchNumber, _T("%s"), strBom.c_str());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MessageBox(_T("未查找到SN对应的批次号"), _T("提示"), MB_ICONWARNING);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _stprintf_s(GLOBAL::g_config.szBatchNumber, _T("%s"), strBatchNum.GetString());
|
|
|
- }
|
|
|
-
|
|
|
- TString data;
|
|
|
- if ( CMESdb::GetInstance()->GetProcessCode(data) )
|
|
|
+ if ( bSNReverse )
|
|
|
+ {// 通过SN获取订单号;
|
|
|
+ TString strBom;
|
|
|
+ if ( CMESdb::GetInstance()->GetBomFromSN(strBatchNum.GetString(), strBom) )
|
|
|
{
|
|
|
- _stprintf_s(GLOBAL::g_config.szProcessCode, _T("%s"), data.c_str());
|
|
|
+ // 设置文本;
|
|
|
+ SetDlgItemText(EDIT_BATCH_NUMBER, strBom.c_str());
|
|
|
+ _stprintf_s(GLOBAL::g_config.szBatchNumber, _T("%s"), strBom.c_str());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MessageBox(_T("获取白平衡产线代码失败"), _T("提示"), MB_ICONWARNING);
|
|
|
- return;
|
|
|
+ MessageBox(_T("未查找到SN对应的批次号"), _T("提示"), MB_ICONWARNING);
|
|
|
}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _stprintf_s(GLOBAL::g_config.szBatchNumber, _T("%s"), strBatchNum.GetString());
|
|
|
+ }
|
|
|
|
|
|
- if ( CMESdb::GetInstance()->GetCompanyCode(data, GLOBAL::g_config.szLine) )
|
|
|
- {
|
|
|
- _stprintf_s(GLOBAL::g_config.szCompanyCode, _T("%s"), data.c_str());
|
|
|
- }
|
|
|
- else
|
|
|
+ TString data;
|
|
|
+ if ( CMESdb::GetInstance()->GetProcessCode(data) )
|
|
|
+ {
|
|
|
+ _stprintf_s(GLOBAL::g_config.szProcessCode, _T("%s"), data.c_str());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox(_T("获取白平衡产线代码失败"), _T("提示"), MB_ICONWARNING);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( CMESdb::GetInstance()->GetCompanyCode(data, GLOBAL::g_config.szLine) )
|
|
|
+ {
|
|
|
+ _stprintf_s(GLOBAL::g_config.szCompanyCode, _T("%s"), data.c_str());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox(_T("获取工站代码失败"), _T("提示"), MB_ICONWARNING);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ TString strDeltaEType, strDeltaValue;
|
|
|
+ if ( CMESdb::GetInstance()->GetDeltaEInfo(GLOBAL::g_config.szBatchNumber, strDeltaEType, strDeltaValue) )
|
|
|
+ {
|
|
|
+ SetDlgItemText(EDIT_EVALUE, strDeltaValue.c_str());
|
|
|
+
|
|
|
+ if ( strDeltaEType == _T("00") )
|
|
|
{
|
|
|
- MessageBox(_T("获取工站代码失败"), _T("提示"), MB_ICONWARNING);
|
|
|
- return;
|
|
|
+ m_cbDeltaEType.SelectString(0, _T("DeltaE00"));
|
|
|
}
|
|
|
-
|
|
|
- TString strDeltaEType, strDeltaValue;
|
|
|
- if ( CMESdb::GetInstance()->GetDeltaEInfo(GLOBAL::g_config.szBatchNumber, strDeltaEType, strDeltaValue) )
|
|
|
+ else if ( strDeltaEType == _T("76") )
|
|
|
{
|
|
|
- SetDlgItemText(EDIT_EVALUE, strDeltaValue.c_str());
|
|
|
-
|
|
|
- if ( strDeltaEType == _T("00") )
|
|
|
- {
|
|
|
- m_cbDeltaEType.SelectString(0, _T("DeltaE00"));
|
|
|
- }
|
|
|
- else if ( strDeltaEType == _T("76") )
|
|
|
- {
|
|
|
- m_cbDeltaEType.SelectString(0, _T("DeltaE76"));
|
|
|
- }
|
|
|
- else if ( strDeltaEType == _T("94") )
|
|
|
- {
|
|
|
- m_cbDeltaEType.SelectString(0, _T("DeltaE94"));
|
|
|
- }
|
|
|
+ m_cbDeltaEType.SelectString(0, _T("DeltaE76"));
|
|
|
}
|
|
|
- else
|
|
|
+ else if ( strDeltaEType == _T("94") )
|
|
|
{
|
|
|
- MessageBox(_T("获取DeltaE参数失败"), _T("提示"), MB_ICONWARNING);
|
|
|
- return;
|
|
|
+ m_cbDeltaEType.SelectString(0, _T("DeltaE94"));
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox(_T("获取DeltaE参数失败"), _T("提示"), MB_ICONWARNING);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void CPageDebug::OnCbnSelchangeEtype()
|