コード例 #1
0
ファイル: main.cpp プロジェクト: FatCat1411/opencvr
int main(int argc, char *argv[])
{
	int dummy = errno;

	QApplication a(argc, argv);
	Debug::init(0);

#ifdef WIN32
	QFont font;
	font.setPointSize(10); 
	font.setFamily(("΢ÈíÑźÚ"));
	font.setBold(false);

	a.setFont(font);
#else
	QFont font;
	font.setPointSize(10); 
	font.setFamily(("WenQuanYi Zen Hei"));
	font.setBold(false);

	a.setFont(font);
#endif

	QPixmap pixmap(":/logo/resources/splash.png");
	QSplashScreen *splash = new QSplashScreen(pixmap);

    	splash->setStyleSheet(QStringLiteral("color : white;"));    
    	splash->show();

    	gFactory = new Factory;

	if (gFactory->Init() == FALSE)
	{
#ifdef WIN32
		astring strPath = "C:\\";//TODO get the hdd from hdd
		VSCHddDevice hdd;
		hdd.show();
		hdd.exec();
		s32 size = hdd.GetDiskSize();
		hdd.GetDiskPath(strPath);
#else

		astring strPath = "ve/";//TODO get the hdd from hdd
		s32 size = 2;
#endif
		gFactory->SetSystemPath(strPath);
		//splash->showMessage(QObject::tr("Create Video Database ..."));
		gFactory->Init();
	}
	VSCLangType m_lang;
	gFactory->GetLang(m_lang);
	if (m_lang == VSC_LANG_AUTO)
	{
		if (QLocale::system().name() == "zh_CN")
		{
			LoadLangZH(a);
		}
	}
	else if (m_lang == VSC_LANG_ZH)
	{
		LoadLangZH(a);
	}//else if add more language to here
	
	splash->showMessage(QObject::tr("Starting ..."));
	VEvent::Init(*gFactory);
	VEMap::Init(*gFactory);
	VServiceMgr *pServiceMgr = VServiceMgr::CreateObject(*gFactory);
	
	VSCMainWindows w;

	//w.showMaximized();
	w.hide();
	//w.showFullScreen();
	splash->finish(&w);
	/* Auto  */
	if (gFactory->GetAutoLogin() == FALSE)
	{
		w.ShowLogin();
	}else
	{
		w.showMaximized();
	}

	delete splash;
	/* Every thread is ready, start the factory thread */
	
	gFactory->start();
	/* Init Mining framework */
	gMFramework = new MFramework(*gFactory);
	gMFramework->Init();

	gMFramework->start();

	/* Start the OpenCVR api server */
	gOAPIServer = new OAPIServer(*gFactory);
	gOAPIServer->start();
	
	return a.exec();
}
コード例 #2
0
ファイル: main.cpp プロジェクト: geolffrey/ve
int main(int argc, char *argv[])
{
    int dummy = errno;
    QApplication a(argc, argv);
    Debug::init(0);
    //mediaPipeline::init(argc, argv);

	// Set the Application Language
#if 0
	//if (QLocale::system().name() == "zh_CN")
	{
		QTranslator *translator = new QTranslator(&a);
		bool ok = translator->load("vscloudnode_zh.qm",
			QCoreApplication::applicationDirPath() + "/translations");
		
		if (ok)
		{
			qDebug("Translation Files loaded.");
			a.installTranslator(translator);
		}
	}
#endif

    QPixmap pixmap(":/logo/resources/splash.png");
    QSplashScreen *splash = new QSplashScreen(pixmap);
    QFont splashFont;
    //splashFont.setFamily("Arial");
    splashFont.setBold(true);

    splash->setStyleSheet(QStringLiteral("color : red;"));
    splash->setFont(splashFont);
    
    splash->show();

    //QApplication::setStyle(QStyleFactory::create("Fusion"));
	//QApplication::setStyle(QStyleFactory::create("Plastique"));
    //QApplication::setStyle("WindowsVista"); 
#if 0
	QFile f(":qdarkstyle/style.qss");
	if (!f.exists())
	{
		printf("Unable to set stylesheet, file not found\n");
	}
	else 
	{
		f.open(QFile::ReadOnly | QFile::Text);
		QTextStream ts(&f);
		a.setStyleSheet(ts.readAll());
	}
#endif


    gFactory = new Factory;
    splash->showMessage("Starting ...");

   if (gFactory->Init() == FALSE)
   {
#ifdef WIN32
       astring strPath = "C:\\";//TODO get the hdd from hdd
       VSCHddDevice hdd;
       hdd.show();
       hdd.exec();
       s32 size = hdd.GetDiskSize();
       hdd.GetDiskPath(strPath);
#else

	astring strPath = "ve/";//TODO get the hdd from hdd
	s32 size = 2;
#endif
       gFactory->SetSystemPath(strPath);
       splash->showMessage("Create Video Database ...");
       gFactory->Init();
#ifndef WIN32
	//gFactory->AddHDD(strPath, size);
#endif
   }

   VEvent::Init(*gFactory);
   VServiceMgr *pServiceMgr = VServiceMgr::CreateObject(*gFactory);

    VSCMainWindows w;
    //w.setWindowIcon(QIcon(":/logo/resources/vscsmall.jpg"));
    //w.show();
    //Sleep(1000);
    //w.setWindowFlags(Qt::FramelessWindowHint );
    //w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::CustomizeWindowHint );
    w.showMaximized();
    //w.showFullScreen();
    splash->finish(&w);

	//stacked s;
	//s.show();

    delete splash;
    /* Every thread is ready, start the factory thread */
    gFactory->start();
    return a.exec();
}