コード例 #1
0
ファイル: storfactoryimpl.hpp プロジェクト: zzilla/opencvr
inline BOOL StorFactory::Init()
{

	/* Loop add the stor */
	
#if 0 //add camera for test
	{	
		VidCameraList cameraList;
		CameraParam Param;
		Param.m_Conf.set_strip("192.168.1.1");
		Param.m_Conf.set_strport("80");
		Param.m_Conf.set_struser("admin");
		Param.m_Conf.set_strpasswd("admin");
		VidCamera *pAddCam = cameraList.add_cvidcamera();
		*pAddCam = Param.m_Conf;
		m_Conf.UpdateCameraListConf(cameraList);
		
	}
#endif

	VidCameraList cameraList;
	m_Conf.GetCameraListConf(cameraList);
	int cameraSize = cameraList.cvidcamera_size();

	for (s32 i = 0; i < cameraList.cvidcamera_size(); i ++)
	{
		VidCamera cam = cameraList.cvidcamera(i);
		CameraParam pParam(cam);
		InitAddCamera(pParam, cam.strid());
	}
	return TRUE;
}
コード例 #2
0
ファイル: factoryimpl.hpp プロジェクト: doksec/opencvr
inline BOOL Factory::Init()
{
	astring strPath;
	if (m_SysPath.GetSystemPath(strPath) == FALSE)
	{
	    return FALSE;
	}
	printf("Sys path %s\n", strPath.c_str());
#ifdef WIN32
#ifndef _WIN64
	astring strPathConf = strPath + "vidstor\\config";
#else
	astring strPathConf = strPath + "vidstor64\\config";
#endif
#else
	astring strPathConf = strPath + "vidstor/config";
#endif
	m_Conf.Open(strPathConf);

#ifndef _WIN64
	astring strPathDb = strPath + "vidstor";
#else
	astring strPathDb = strPath + "vidstor64";
#endif
	m_pVdb = new VDB(strPathDb);

	VidHDFSConf HdfsConf;
	m_Conf.GetHdfsRecordConf(HdfsConf);
	astring strNameNode = HdfsConf.strnamenode();
	astring strPort = HdfsConf.strport();
	astring strUser = HdfsConf.struser();
	m_pVHdfsdb = new VHdfsDB(strNameNode, strPort, strUser);

#if 1 //add camera for test
	{	
		VidCameraList cameraList;
		CameraParam Param;
		Param.m_Conf.set_strip("192.168.0.123");
		Param.m_Conf.set_strport("80");
		Param.m_Conf.set_struser("admin");
		Param.m_Conf.set_strpasswd("12345");
		VidCamera *pAddCam = cameraList.add_cvidcamera();
		*pAddCam = Param.m_Conf;
		m_Conf.UpdateCameraListConf(cameraList);
		
	}
#endif

	VidCameraList cameraList;
	m_Conf.GetCameraListConf(cameraList);
	int cameraSize = cameraList.cvidcamera_size();

	for (s32 i = 0; i < cameraList.cvidcamera_size(); i ++)
	{
		VidCamera cam = cameraList.cvidcamera(i);
		CameraParam pParam(cam);
		InitAddCamera(pParam, cam.strid());
	}

#if 0
	VSCConfData sysData;
	m_Conf.GetSysData(sysData);
	for (s32 i = 1; i < CONF_MAP_MAX; i ++)
	{
	    if (sysData.data.conf.CameraMap[i] != CONF_MAP_INVALID_MIN 
			&& sysData.data.conf.CameraMap[i] != 0)
	    {
	        VDC_DEBUG( "%s Init Camera %d\n",__FUNCTION__, i);
	        VSCCameraData Data;
	        m_Conf.GetCameraData(i, Data);
	        CameraParam mParam(Data);
	        LockCameraID(Data.data.conf.nId);
	        InitAddCamera(mParam, Data.data.conf.nId);
	        VDC_DEBUG( "%s Id %d\n",__FUNCTION__, Data.data.conf.nId);
	    }
	}
#endif

	InitLicense();
	//m_pThread = new thread(Factory::Run, (void *)this);
	//start();
	m_HddTask = new FactoryHddTask(*this);
	m_HddTask->start();

	//if (sysData.data.conf.OAPIPort == 0)
	{
		//sysData.data.conf.OAPIPort = 9080;
	}
	//m_pHttpServer = new CmnHttpServer(sysData.data.conf.OAPIPort);
	//m_pHttpServer->start();

	/* Init export path */
	astring strExportPath;
	GetExportPath(strExportPath);
	return TRUE;
}