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(); }
int main(int argc, char *argv[]) { int dummy = errno; ClientFactory *pFactory = NULL; QApplication a(argc, argv); a.setStyle(new VStyle); astring strVSCDefaultPath = VSC_DEFAULT_SYSPATH; #ifdef WIN32 #ifndef _WIN64 astring strLoggerPath = strVSCDefaultPath + "\\vidstor\\logs\\"; #else astring strLoggerPath = strVSCDefaultPath + "\\vidstor64\\logs\\"; #endif #else astring strLoggerPath = strVSCDefaultPath + "/vidstor/logs/"; #endif Poco::File file1(strLoggerPath); file1.createDirectories(); astring strLoggerFile = strLoggerPath + "opencvrclient"; Debug::init(9200, strLoggerFile); Debug::logger().info("opencvrclient started"); //Debug::logger().info("opencvrclient started {} {}", __LINE__, __FUNCTION__); //Debug::logger().info("opencvrclient started {} {}", __LINE__, __FUNCTION__); #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(); pFactory = new ClientFactory; if (pFactory->Init() == FALSE) { astring strPath = VSC_DEFAULT_SYSPATH; pFactory->SetSystemPath(strPath); pFactory->Init(); } VidLanguage m_lang; pFactory->GetLang(m_lang); if (m_lang == VID_LANG_AUTO) { if (QLocale::system().name() == "zh_CN") { LoadLangZH(a); } } else if (m_lang == VID_ZH_CN) { LoadLangZH(a); }//else if add more language to here splash->showMessage(QObject::tr("Starting ...")); VTaskMgr *pVTaskMgr = new VTaskMgr(); VSCMainWindows w(*pFactory); //w.showMaximized(); w.hide(); //w.showFullScreen(); splash->finish(&w); /* Auto */ if (pFactory->GetAutoLogin() == false) { w.ShowLogin(); }else { w.showMaximized(); } delete splash; return a.exec(); }