Exemplo n.º 1
0
	void SencamDriver::getSettings(){
		char table[300];
		int _mode;
		int _trig;
		int _roix1;
		int _roix2;
		int _roiy1;
		int _roiy2;
		int _hbin;
		int _vbin;
		GET_SETTINGS( &_mode, &_trig, &_roix1, &_roix2, &_roiy1, &_roiy2, &_hbin, &_vbin, (char**) table);
		mode = _mode;
		trig = _trig;
		roix1 = _roix1;
		roix2 = _roix2;
		roiy1 = _roiy1;
		roiy2 = _roiy2;
		hbin = _hbin;
		vbin = _vbin;
	}
Exemplo n.º 2
0
	void CameraSettings::getSettings()
	{
		GET_SETTINGS( &mode, &trig, &roix1, &roix2, &roiy1, &roiy2, &hbin, &vbin, (char**)table);
	}
Exemplo n.º 3
0
int
main( int argc, char** argv )
{
	//std::ofstream logFile( "Log.txt" );
        //SET_LOUT( logFile );

        //D_COMMAND( std::ofstream debugFile( "Debug.txt" ); );
        //SET_DOUT( debugFile );

	//XInitThreads();
	ApplicationManager appManager;

	boost::filesystem::path executablePath(argv[0]);
	boost::filesystem::path dataDirName = GET_SETTINGS( "application.data_directory", std::string, (boost::filesystem::path(argv[0]).parent_path() / "data").string() );
	//If we cannot locate data directory - try other posiible locations
	if (!boost::filesystem::exists(dataDirName) || !boost::filesystem::is_directory(dataDirName)) {
		std::vector<boost::filesystem::path> possibleDataDirs;
		possibleDataDirs.push_back(boost::filesystem::current_path() / "data");
		possibleDataDirs.push_back(executablePath.parent_path() / "data");
		possibleDataDirs.push_back(executablePath.parent_path().parent_path() / "data");

		std::vector<boost::filesystem::path>::const_iterator it = possibleDataDirs.begin();
		bool found = false;
		LOG( "Trying to locate 'data' directory:" );
		while (!found && it != possibleDataDirs.end()) {
			LOG_CONT( "\tChecking: " << it->string() << " ... ");
			if (boost::filesystem::exists(*it) && boost::filesystem::is_directory(*it)) {
				dataDirName = *it;
				SET_SETTINGS( "application.data_directory", std::string, dataDirName.string() );
				found = true;
				LOG( "SUCCESS" );
			} else {
				LOG( "FAILED" );
			}
			++it;
		}
		if (!found) {
			BOOST_THROW_EXCEPTION( M4D::ErrorHandling::EDirNotFound() );
		}
	}
	boost::filesystem::path dirName = GET_SETTINGS( "gui.icons_directory", std::string, ( dataDirName / "icons" ).string() );
	appManager.setIconsDirectory(dirName);
	appManager.initialize( argc, argv );

	try {
		//processCommandLine( argc, argv );
		ViewerWindow viewer;
		appManager.setMainWindow( viewer );

		createModules();

		appManager.loadModules();
		viewer.showMaximized();
		return appManager.exec();
	} catch ( std::exception &e )
	{
		QMessageBox::critical ( NULL, "Exception", QString( e.what() ) );
	} 
	catch (...) {
		QMessageBox::critical ( NULL, "Exception", "Unknown error" );
	}
	
	return 1;
}