#pragma once
#define C_MACHINE_EXPORTS
#include "Machine.h"
#include "CDieBondFsm.h"
#include "CMessageBox.h"
#include "dt.h"
#include "CRunButton.h"
#include "CViewMotion.h"
#include "CViewMatrix.h"
#include "CCamerAndLamp.h"
#pragma comment(lib,"CLog.lib")
#pragma comment(lib,"Module.lib")
#pragma comment(lib,"Control.lib")
namespace ns_module
{
class __declspec(dllexport) CViewInterface
{
public:
struct THREAD_BUTTON_RUN
{
CViewInterface* pClass;
ST_BUTTON_FUN stButtonInfo;
};
private:
static CViewInterface* m_instance;
static HANDLE m_hEvent;
bool m_bIsInitSuccess = false;
CManageDB* m_pCManageDB = nullptr;
Machine* m_pMachine = nullptr;
CCameraManage* m_pCameraManage = nullptr;
CBondHead* m_pBondHead = nullptr;
CWaferTable* m_pWaferTable = nullptr;
CWaferHead* m_pWaferHead = nullptr;
CTransferTable* m_pWaferTransferTable = nullptr;
CTransferTable* m_pWaffleTransferTable = nullptr;
CResources* m_pResource = nullptr;
CDieBondFsm* m_pDieBondFsm = nullptr;
LONG Init();
public:
static CViewInterface* GetInstance();
#pragma region 界面方面接口
private:
CXYCalib* GetCalibXY(int iCameraId);
public:
//界面退出通知
long ViewExit();
//机台重新加载所有配置
long ResetLoadAllConfig();
//将所有数据保存到数据库
long SaveAllConfigToDateBase();
CViewMotion* GetViewMotion();
CViewMatrix* GetViewMatrix();
CCamerAndLamp* GetCamerAndLamp();
///
/// 获取CPK数据信息
///
/// CPK数据
/// 成功返回0,否则返回错误码
long GetCpkList(std::vector& CpkList);
///
/// 读取表中指定GroupId的配置信息
///
/// 组Id
/// 表名
/// 返回的配置信息
/// 成功返回0,否则返回错误码
long LoadConfigDB(string strTableName, vector iGroupId, vector& vecConfig);
///
/// 保存配置信息
///
/// 表名
/// 要保存的配置信息
/// 成功返回0,否则返回错误码
long SaveConfigDB(string strTableName, vector vecConfig);
//设置弹出框回调
long SetButtonRunDoneFunc(SendButtonRunDone func);
//设置按钮执行完回调
long SetPopMessageBoxFunc(CallMessageBox func);
//数据更改后发送通知
long DataChangNotice(string strDbName,string strTableName);
//接收数据更改后的通知
void RecvDataChangNotice(string strDbName, string strTableName, DataNoticeCallbackFun callBackFun);
//停止
long RunStop();
//自动固晶
long RunAutoBond();
//执行按钮命令
long RunButton(ST_BUTTON_FUN stInfo);
#pragma endregion
};
}