#pragma once
#define C_MACHINE_EXPORTS
#include "Machine.h"
namespace ns_module
{
class __declspec(dllexport) CViewInterface
{
private:
static CViewInterface* m_instance;
bool m_bIsInitSuccess = false;
CManageDB* m_pCManageDB = nullptr;
Machine* m_pMachine = nullptr;
CCameraManage* m_pCameraManage = nullptr;
CResources* m_pResource = nullptr;
LONG Init();
public:
static CViewInterface* GetInstance();
#pragma region 界面方面接口
private:
CXYCalib* GetCalibXY(int iCameraId);
public:
///
/// 设置红光
///
/// 相机Id
/// 灯光值
/// 成功返回0,否则返回错误码
long SetRedLight(int iCameraId, int LightValue);
///
/// 设置绿光
///
/// 灯光值
/// 成功返回0,否则返回错误码
long SetGreenLight(int iCameraId, int LightValue);
///
/// 设置蓝光
///
/// 相机Id
/// 灯光值
/// 成功返回0,否则返回错误码
long SetBlueLight(int iCameraId, int LightValue);
///
/// 设置点光
///
/// 相机Id
/// 灯光值
/// 成功返回0,否则返回错误码
long SetPointLight(int iCameraId, int LightValue);
///
/// 获取灯光值
///
/// 相机Id
/// 红光。值为-1时,表示没有该灯
/// 绿光。值为-1时,表示没有该灯
/// 蓝光。值为-1时,表示没有该灯
/// 点光。值为-1时,表示没有该灯
/// 成功返回0,否则返回错误码
long GetLight(int iCameraId, int& redLightValue, int& greenLightValue, int& blueLightValue, int& pointLightValue);
///
/// 获取相机图像。调用后会阻塞,直到有新的相机图像时才返回
///
/// 相机Id
///
/// 成功返回0,否则返回错误码
long GrabImage(int iCameraId, ImageInfo& image);
///
/// 获取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);
///
/// 获取相机列表
///
/// 相机列表
/// 成功返回0,否则返回错误码
long GetCameraList(vector& vecCamera);
///
/// 相机移动到显示位置
///
///
///
///
///
long CameraMove(int iCameraId, double x, double y);
long SetVideoCallBackFunc(int iCameraId, CallVideoBack func);
//获取所有轴信息
vector GetAxisList();
//移动轴
long ModuleMove(string ModuleType, string AxisType, double pos);
long ModuleMoveTo(string ModuleType, string AxisType, double pos);
//数据更改后发送通知
LONG DataChangNotice(string strDbName,string strTableName);
//接收数据更改后的通知
void RecvDataChangNotice(string strDbName, string strTableName, DataNoticeCallbackFun callBackFun);
#pragma endregion
};
}