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.

127 lines
4.5 KiB
C++

#pragma once
#include "Module.h"
#include "WorkTime.h"
#include "Subject.h"
#include "PenParMgr.h"
//扫描状态的类型
enum EScanStateType
{
_ScanStateType_Null = 0,//未知状态
_ScanStateType_NotScanned,//没有扫描过
_ScanStateType_PartiallyScanned,//扫描了一部分
_ScanStateType_AllScanned,//全部扫描过
};
//扫描状态参数
class CScanState
{
public:
CScanState()
{
m_EndScanLineIdx = 0;//结束扫描时扫描线的索引值(用来恢复中断的情况)
m_TotalScanLineCnt = 0;//扫描线的总数
m_StartScanLineIdx = 0;//开始扫描时扫描线的索引值
m_ScanedLineCnt = 0;//当前扫描过的线段数量
};
public:
int m_StartScanLineIdx;//开始扫描时扫描线的索引值
int m_EndScanLineIdx;//结束扫描时扫描线的索引值
int m_TotalScanLineCnt;//扫描线的总数
int m_ScanedLineCnt;//当前扫描过的线段数量
};
//record 参数的类型
enum ERecordParType
{
_RecordParType_Null = 0,
_RecordParType_BaseInfo,//基本信息
_RecordParType_ScanData,//扫描数据
_RecordParType_Recipe,//recipe 参数信息
_RecordParType_DetectionInfo,//检测信息
};
//加工记录参数
class CRecordPar
{
public:
CRecordPar()
{
m_RecordParType = _RecordParType_Null;
m_ListItemWidht = 100;//列表宽度
};
public:
CString m_ParName;//参数的名称
CString m_ParVal;//参数的值
int m_ListItemWidht;//列表宽度
ERecordParType m_RecordParType;//record 参数的类型
};
//一条加工记录
class CWorkRecord
{
public:
CWorkRecord(){};
void Reset(){m_RecordParVec.clear();};
void AddRecordPar(CRecordPar par){m_RecordParVec.push_back(par);};
public:
vector<CRecordPar> m_RecordParVec;//参数容器
};
//工作记录
class CWorkRecordMgr :public CModule,public CSubject
{
public:
CWorkRecordMgr(void);
~CWorkRecordMgr(void);
virtual MODULE GetModuleType(){return _WORK_RECORD_PROP;};
virtual void OnAppInitialize();
void StartRecord();
void EndRecord();
void EndRecordTime();
CString GetCurRecordTime(){return m_CurProcessingTime;};
CString GetTotalWorkTime(){return m_CurTotalWorkTime;};
void UpdateCurRecordTime();
void InsertRecordList(CListCtrl &List,CString StartDate,CString EndDate);
void SaveCurWorkRecord();
void ReadWorkRecord(CString RecordFilePath);
void GetAllRecordNameVec(vector<CString> &DateVec,CString StartDate,CString EndDate);
void InitWorkRecordList(CListCtrl &List);
void ResetScanState();
CScanState &GetCurScanState(){return m_CurScanState;};
EScanStateType GetCurScanStateType();
void InitWorkRecordInfoList(CListCtrl &List);
void InsertRecordInfoList(CListCtrl &List,int Idx);
void IncScanedLineCnt(){m_CurScanState.m_ScanedLineCnt++;};//增加已经扫描线的数量
void RecoverRecipeByRecord();
void SetbSelWorkInfoRecord(bool b){m_bSelWorkInfoRecord = b;};
void SelWrokRecordToFile();
private:
CString GetCurRecordFileName();
CString GetRecordFilePath(CString FileName);
void InsertRecordListExt(CListCtrl &List,vector<CWorkRecord> &WorkRecordVec);
void CreatCurWorkRecord(CWorkRecord &WorkRecord);
void WriteWorkRecordToFile(CWorkRecord &WorkRecord);
void CreatBaseInfoRecord(CWorkRecord &WorkRecord);
void CreatScanDataRecord(CWorkRecord &WorkRecord);
void CreatRecipeRecord(CWorkRecord &WorkRecord);
void CreatListShowWorkRecord(CWorkRecord &WorkRecord);
void CreatListWorkInfoRecord(CWorkRecord &WorkRecord);
void SynchWorkRecord(CWorkRecord &WorkRecord,CWorkRecord &ReadWorkRecord);
void SetRecipeRecordReport(CString ParName,CString ParVal);
private:
CWorkTime m_WorkTime;//加工时间记录
CString m_WorkStartTime;//加工开始时间
CString m_CurProcessingTime;//当前晶圆的工艺时间
CString m_CurTotalWorkTime;//当前总的加工时间
CString m_CurRecordTimeSecond;//当前加工时间(秒)
CScanState m_CurScanState;//当前的扫描状态
vector<CWorkRecord> m_ShowRecordVec;//当前显示的记录容器
vector<CWorkRecord> m_WorkRecordVec;//当前显示的记录容器
bool m_bSelWorkInfoRecord;//是否有选中的记录
CWorkRecord m_WorkInfoRecord;//详细信息record
};
extern CWorkRecordMgr *gWorkRecordMgr;