You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

426 lines
15 KiB
C++

#include "stdafx.h"
#include "LaiPuLaser.h"
#include "afxdialogex.h"
#include "DlgChildWaferHistory.h"
#include "GlobalFunction.h"
#include "LogMgr.h"
#include "FileMgr.h"
#include "CStringFuc.h"
#include "MsgBox.h"
IMPLEMENT_DYNAMIC(CDlgChildWaferHistory, CMyDlgView)
BEGIN_MESSAGE_MAP(CDlgChildWaferHistory, CMyDlgView)
ON_BN_CLICKED(IDC_SEARCH_BTN, &CDlgChildWaferHistory::OnBnClickedSearchBtn)
ON_NOTIFY(TVN_ITEMEXPANDED, IDC_DATA_FOLDE_TREE, &CDlgChildWaferHistory::OnTvnItemexpandedDataFoldeTree)
ON_NOTIFY(TVN_SELCHANGED, IDC_DATA_FOLDE_TREE, &CDlgChildWaferHistory::OnTvnSelchangedDataFoldeTree)
ON_BN_CLICKED(IDC_SEARCH_BTN2, &CDlgChildWaferHistory::OnBnClickedExport)
ON_BN_CLICKED(IDC_SEARCH_BTN3, &CDlgChildWaferHistory::OnBnClickedSearchByDate)
ON_BN_CLICKED(IDC_SEARCH_BY_RANGE_BTN, &CDlgChildWaferHistory::OnBnClickedSearchByRangeBtn)
END_MESSAGE_MAP()
#define DATA_PATH "\\MonitoringData\\WaferProcessData\\"
#define Data_List_Item_Cnt 60
CDlgChildWaferHistory::CDlgChildWaferHistory(CWnd* pParent /*=NULL*/)
: CMyDlgView(CDlgChildWaferHistory::IDD, pParent)
, m_SelDate(COleDateTime::GetCurrentTime()), m_SelDateStart(COleDateTime::GetCurrentTime()), m_SelDateEnd(COleDateTime::GetCurrentTime())
{
}
CDlgChildWaferHistory::~CDlgChildWaferHistory()
{
}
void CDlgChildWaferHistory::DoDataExchange(CDataExchange* pDX)
{
CMyDlgView::DoDataExchange(pDX);
DDX_Control(pDX, IDC_DATA_FOLDE_TREE, m_MonitorDataTree);
DDX_Control(pDX, IDC_ANNEAL_DATA_LIST, m_DataList);
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_SelDate);
DDX_DateTimeCtrl(pDX, IDC_DATETIME_START_PICKER, m_SelDateStart);
DDX_DateTimeCtrl(pDX, IDC_DATETIME_END_PICKER, m_SelDateEnd);
DDX_Text(pDX, IDC_SEARCH_LOTID, m_SearchLotID);
}
BOOL CDlgChildWaferHistory::OnInitDialog()
{
CMyDlgView::OnInitDialog();
CTreeCtrl &m_tree = m_MonitorDataTree;
m_tree.ModifyStyle(NULL,TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT|TVS_EDITLABELS);
InitDataList();
UpdateData(FALSE);
return TRUE;
}
//<2F><>Ӧview <20>򿪵<EFBFBD>ʱ<EFBFBD><CAB1>
void CDlgChildWaferHistory::OnViewOpen()
{
if(m_bFirstOpen)
{
OnBnClickedSearchBtn();
m_bFirstOpen = false;
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><><C2B7><EFBFBD><EFBFBD>
void CDlgChildWaferHistory::GetLogicalDrives(HTREEITEM hParent)
{
CTreeCtrl &m_tree = m_MonitorDataTree;
CString path = gProgramLaserTuiHuo->GetLaipuLaserDataDir(DATA_PATH);
m_tree.InsertItem(path,hParent); //<2F>ڸ<EFBFBD><DAB8>ڵ<EFBFBD>hParent<6E><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD>
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD><CCB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
void CDlgChildWaferHistory::GetDriveDir(HTREEITEM hParent)
{
CTreeCtrl &m_tree = m_MonitorDataTree;
HTREEITEM hChild = m_tree.GetChildItem(hParent); //<2F><>ȡָ<C8A1><D6B8>λ<EFBFBD><CEBB><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
while(hChild)
{
CString strText = m_tree.GetItemText(hChild); //<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
if(strText.Right(1) != "\\") //<2F><><EFBFBD>ұ<EFBFBD>1<EFBFBD><31>ʼ<EFBFBD><CABC>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>nCount<6E><74><EFBFBD>ַ<EFBFBD>
strText += _T("\\");
strText += "*.*";
//<2F><><EFBFBD><EFBFBD>ǰĿ¼<C4BF><C2BC><EFBFBD>ļ<EFBFBD>ö<EFBFBD>ٲ<EFBFBD>InsertItem<65><6D>״<EFBFBD><D7B4>ʾ
CFileFind file; //<2F><><EFBFBD><EFBFBD><E5B1BE><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
BOOL bContinue = file.FindFile(strText); //<2F><><EFBFBD>Ұ<EFBFBD><D2B0><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
while(bContinue)
{
bContinue = file.FindNextFile(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ļ<EFBFBD>
if(file.IsDirectory() && !file.IsDots()) //<2F>ҵ<EFBFBD><D2B5>ļ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD>Ϊ<EFBFBD><CEAA>"."
{
m_tree.InsertItem(file.GetFileName(),hChild); //<2F><><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
}
}
GetDriveDir(hChild); //<2F>ݹ<EFBFBD><DDB9><EFBFBD><EFBFBD><EFBFBD>
hChild = m_tree.GetNextItem(hChild,TVGN_NEXT); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD>οؼ<CEBF>TVGN_NEXT<58><54><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>Ŀȫ<C4BF><C8AB>·<EFBFBD><C2B7>
CString CDlgChildWaferHistory::GetFullPath(HTREEITEM hCurrent)
{
CTreeCtrl &m_tree = m_MonitorDataTree;
CString strTemp;
CString strReturn = "";
while(hCurrent != m_hRoot)
{
strTemp = m_tree.GetItemText(hCurrent); //<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
if(strTemp.Right(1) != "\\")
strTemp += "\\";
strReturn = strTemp + strReturn;
hCurrent = m_tree.GetParentItem(hCurrent); //<2F><><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
}
return strReturn;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼
void CDlgChildWaferHistory::AddSubDir(HTREEITEM hParent)
{
CTreeCtrl &m_tree = m_MonitorDataTree;
CString strPath = GetFullPath(hParent); //<2F><>ȡȫ·<C8AB><C2B7>
if(strPath.Find("xlsx")!=-1)
{
int len = strPath.GetLength();
strPath.Delete(len-1,1);//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>'\'
return;
}
if(strPath.Right(1) != "\\")
strPath += "\\";
strPath += "*.*";
CFileFind file;
BOOL bContinue = file.FindFile(strPath); //<2F><><EFBFBD>Ұ<EFBFBD><D2B0><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
while(bContinue)
{
bContinue = file.FindNextFile(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ļ<EFBFBD>
//if(file.IsDirectory() && !file.IsDots())
if(!file.IsDots())
{
m_tree.InsertItem(file.GetFileName(),hParent);
}
}
}
//ɾ<><C9BE>hItem <20><><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>
void CDlgChildWaferHistory::DelAllChildOfItem(HTREEITEM hItem)
{
CTreeCtrl &m_Tree = m_MonitorDataTree;
{
HTREEITEM hNextItem=NULL;
HTREEITEM hChildItem=m_Tree.GetChildItem(hItem);
while (hChildItem!=NULL)
{
hNextItem=m_Tree.GetNextItem(hChildItem,TVGN_NEXT);
m_Tree.DeleteItem(hChildItem);
hChildItem=hNextItem;
}
}
}
//<2F><>Ӧ<EFBFBD>ڵ<EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
void CDlgChildWaferHistory::OnTvnItemexpandedDataFoldeTree(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
CTreeCtrl &m_tree = m_MonitorDataTree;
TVITEM item = pNMTreeView->itemNew; //<2F><><EFBFBD><EFBFBD>\<5C><><EFBFBD>ܹ<EFBFBD><DCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>Ŀ<EFBFBD><C4BF>Ϣ
if(item.hItem == m_hRoot)
return;
//<2F><>ȡitem.hItem <20>ĵ<EFBFBD>һ<EFBFBD><D2BB>ChildItem
HTREEITEM hChild = m_tree.GetChildItem(item.hItem);
//ɾ<><C9BE><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ӽڵ<D3BD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1>ֵ㿪<D6B5><E3BFAA>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬)
if(m_tree.ItemHasChildren(hChild))
return;
//<2F><><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>
while(hChild)
{
AddSubDir(hChild); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼
hChild = m_tree.GetNextItem(hChild,TVGN_NEXT); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD>οؼ<CEBF>TVGN_NEXT<58><54><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>
}
*pResult = 0;
}
void CDlgChildWaferHistory::OnBnClickedSearchBtn()
{
CTreeCtrl &m_tree = m_MonitorDataTree;
m_tree.DeleteItem(m_hRoot);//ȫ<><C8AB>ɾ<EFBFBD><C9BE>
m_hRoot = m_tree.InsertItem("root"); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
GetLogicalDrives(m_hRoot); //<2F>Զ<EFBFBD><D4B6><EFBFBD><E5BAAF> <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
GetDriveDir(m_hRoot); //<2F>Զ<EFBFBD><D4B6><EFBFBD><E5BAAF> <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_tree.Expand(m_hRoot,TVE_EXPAND); //չ<><D5B9><EFBFBD><EFBFBD><EFBFBD>۵<EFBFBD><DBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> TVE_EXPANDչ<44><D5B9><EFBFBD>б<EFBFBD>
}
void CDlgChildWaferHistory::InitDataList()
{
//<2F><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>
m_DataList.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//m_DataList.InsertColumn(0,"Idx",LVCFMT_LEFT,50,-1);
CString s;
for(int k=0;k<Data_List_Item_Cnt;k++)
{
s.Format("Col%d",k+1);
m_DataList.InsertColumn(k,s,LVCFMT_CENTER,150,-1);
}
}
void CDlgChildWaferHistory::UpdateDataList(CString FilePath)
{
}
//<2F><><EFBFBD><EFBFBD>tree<65>б<EFBFBD>
void CDlgChildWaferHistory::OnTvnSelchangedDataFoldeTree(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
// NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
TVITEM item = pNMTreeView->itemNew;
if(item.hItem == m_hRoot)
return;
CString strPath = GetFullPath(item.hItem);
int len = strPath.GetLength();
strPath.Delete(len-1,1);//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>'\'
gLogMgr->WriteDebugLog(strPath);
m_CurSelPath = strPath;
if(strPath.Find("xlsx")!=-1)
{
CFileMgr FileMgr;
m_DataList.DeleteAllItems();
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>
while (m_DataList.DeleteColumn(0));
//<2F>鿴ScanTraceCoordData <20><>Ҫ<EFBFBD><D2AA>ProcessStateData
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>anneal <20><><EFBFBD><EFBFBD><EFBFBD>в鿴ScanTraceCoordData
if(strPath.Find("ProcessMonitoringData")!=-1 ||strPath.Find("ScanTraceCoordData")!=-1)//<2F>ѵ<EFBFBD>һ<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
CString Path = strPath;
Path.Replace("ScanTraceCoordData","ProcessStateData");
if(!FileMgr.IsFileExist(Path))
{
CMsgBox MsgBox;
MsgBox.Show("Can not Open ScanTraceCoordData Now");
*pResult = 0;
return;
}
}
vector<vector<CString>> StrVec;
FileMgr.ReadFileToStrVec(strPath,StrVec,true);
int size = StrVec.size();
for(int k=0;k<size;k++)
{
int size1 = StrVec[k].size();
if(k==0)
{
if(strPath.Find("ProcessMonitoringData")!=-1)//<2F>ѵ<EFBFBD>һ<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
for(int i=0;(i<Data_List_Item_Cnt)&&(i<size1);i++)
{
m_DataList.InsertColumn(i,StrVec[k][i],LVCFMT_CENTER,150,-1);
}
}
else
{
CString s;
for(int k=0;k<Data_List_Item_Cnt;k++)
{
s.Format("Col%d",k+1);
m_DataList.InsertColumn(k,s,LVCFMT_CENTER,150,-1);
}
}
}
m_DataList.InsertItem(k," ");//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
for(int i=0;i<size1;i++)
{
if(i>=Data_List_Item_Cnt)
break;
m_DataList.SetItemText(k,i,StrVec[k][i]);//<2F><><EFBFBD><EFBFBD>
}
}
}
*pResult = 0;
}
void CDlgChildWaferHistory::OnBnClickedExport()
{
CFileMgr FileMgr;
bool bFile = m_CurSelPath.Find(".xlsx") > 0;
CString destDir;
if (bFile)
{
CFileDialog dlg( FALSE, _T(".xlsx"), NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>(*.xlsx)|*.xlsx"));
if (dlg.DoModal() == IDOK)
{
destDir = dlg.GetPathName();
FileMgr.CopyDirOrFile(m_CurSelPath, destDir);
}
}
else
{
CFolderPickerDialog dlg(NULL, 0, this, 0);
if (dlg.DoModal() == IDOK)
{
destDir = dlg.GetPathName();
FileMgr.CopyDirOrFile(m_CurSelPath, destDir);
}
}
}
#if 1
void CDlgChildWaferHistory::GetLogicalDrives_ByDay(HTREEITEM hParent, COleDateTime SelDate)
{
CTreeCtrl &m_tree = m_MonitorDataTree;
CString path = gProgramLaserTuiHuo->GetLaipuLaserDataDir(DATA_PATH);
CString DateStr = SelDate.Format("%Y\\%m\\%d\\");
path += DateStr;
m_tree.InsertItem(path, hParent); //<2F>ڸ<EFBFBD><DAB8>ڵ<EFBFBD>hParent<6E><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD>
}
//<2F><><EFBFBD>ղ<EFBFBD>ѯ
void CDlgChildWaferHistory::OnBnClickedSearchByDate()
{
UpdateData(TRUE);
CTreeCtrl &m_tree = m_MonitorDataTree;
m_tree.DeleteItem(m_hRoot);//ȫ<><C8AB>ɾ<EFBFBD><C9BE>
m_hRoot = m_tree.InsertItem("root");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
GetLogicalDrives_ByDay(m_hRoot,m_SelDate); //<2F>Զ<EFBFBD><D4B6><EFBFBD><E5BAAF> <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
GetDriveDir(m_hRoot);//<2F>Զ<EFBFBD><D4B6><EFBFBD><E5BAAF> <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_tree.Expand(m_hRoot, TVE_EXPAND); // չ<><D5B9><EFBFBD>б<EFBFBD>
}
void CDlgChildWaferHistory::GetDriveDir_ByDayRange(HTREEITEM hParent,COleDateTime SelDateStart,COleDateTime SelDateEnd)
{
CTime tt1( SelDateEnd.GetYear() , SelDateEnd.GetMonth() , SelDateEnd.GetDay() , SelDateEnd.GetHour() , SelDateEnd.GetMinute() , SelDateEnd.GetSecond() ) ;
CTime tt2( SelDateStart.GetYear() , SelDateStart.GetMonth() , SelDateStart.GetDay() , SelDateStart.GetHour() , SelDateStart.GetMinute() , SelDateStart.GetSecond() ) ;
CTimeSpan span = tt1 - tt2 ;
int iDay = span.GetDays()+1;
if(iDay>100)
{
CMsgBox MsgBox;
MsgBox.Show("<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>100");
return;
}
GetDlgItem(IDC_SEARCH_RET_DAYS)->SetWindowText(Int2CString(iDay));//<2F><><EFBFBD><EFBFBD>
int WaferHistoryCnt = 0;//<2F><>ѯ<EFBFBD><D1AF>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CTreeCtrl &m_tree = m_MonitorDataTree;
HTREEITEM hChild = m_tree.GetChildItem(hParent); //<2F><>ȡָ<C8A1><D6B8>λ<EFBFBD><CEBB><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
HTREEITEM hChild2;
bool bFirst = true;
CFileMgr FileMgr;
CString ProcessDataPath = gProgramLaserTuiHuo->GetLaipuLaserDataDir(DATA_PATH);
while(SelDateStart<=SelDateEnd)
{
//<2F>ռ<EFBFBD><D5BC><EFBFBD>ǰCurDate <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int StartY = SelDateStart.GetYear();
int StartM = SelDateStart.GetMonth();
int StartD = SelDateStart.GetDay();
CString DayPath;
DayPath += Int2Str_LeftZero(StartY)+"\\";
DayPath += Int2Str_LeftZero(StartM)+"\\";
DayPath += Int2Str_LeftZero(StartD)+"\\";
CString DatePath = ProcessDataPath+DayPath;
if(FileMgr.IsDirectoryExists(DatePath))
{
//<2F>ռ<EFBFBD>DatePath <20><>ChildDir
vector<CString> NameVec;
vector<CString> FilePathVec;
FileMgr.GetChildFileOrDirName(true,DatePath,FilePathVec,"");
int size = FilePathVec.size();
for(int k=0;k<size;k++)
{
CString DirName = FileMgr.GetFileNameFromPath(FilePathVec[k],true);
//<2F><>LotIDɸѡ
if(m_SearchLotID!="" && DirName.Find(m_SearchLotID)==-1)
{
continue;
}
NameVec.push_back(DirName);
}
if(!NameVec.empty())
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
m_tree.InsertItem(DayPath, hChild);
if(bFirst)
{
hChild2 = m_tree.GetChildItem(hChild);
bFirst = false;
}
else
{
hChild2 = m_tree.GetNextItem(hChild2,TVGN_NEXT);
}
int size = NameVec.size();
for(int k=0;k<size;k++)
{
m_tree.InsertItem(NameVec[k],hChild2);
}
WaferHistoryCnt += size;
}
}
//<2F><>һ<EFBFBD><D2BB>
COleDateTimeSpan ds;
ds.SetDateTimeSpan(1,0,0,0);
SelDateStart = SelDateStart + ds ;
}
GetDlgItem(IDC_SEARCH_RET_CNT)->SetWindowText(Int2CString(WaferHistoryCnt));//<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
//<2F><><EFBFBD>ղ<EFBFBD>ѯ
void CDlgChildWaferHistory::OnBnClickedSearchByRangeBtn()
{
gLogMgr->WriteDebugLog("Func-->OnBnClickedSearchByRangeBtn");
UpdateData(TRUE);
if(m_SelDateStart>m_SelDateEnd)
{
CMsgBox MsgBox;
MsgBox.Show("ʱ<EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
return;
}
CTreeCtrl &m_tree = m_MonitorDataTree;
m_tree.DeleteItem(m_hRoot);//ȫ<><C8AB>ɾ<EFBFBD><C9BE>
m_hRoot = m_tree.InsertItem("root");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
CString path = gProgramLaserTuiHuo->GetLaipuLaserDataDir(DATA_PATH);
m_tree.InsertItem(path, m_hRoot);//<2F>ڸ<EFBFBD><DAB8>ڵ<EFBFBD>hParent<6E><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD>
GetDriveDir_ByDayRange(m_hRoot,m_SelDateStart,m_SelDateEnd);//<2F>Զ<EFBFBD><D4B6><EFBFBD><E5BAAF> <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_tree.Expand(m_hRoot, TVE_EXPAND); //չ<><D5B9><EFBFBD><EFBFBD><EFBFBD>۵<EFBFBD><DBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> TVE_EXPANDչ<44><D5B9><EFBFBD>б<EFBFBD>
}
#endif