void
Switcher::ReadyToRun()
{
	CaptureWindow* window = new CaptureWindow();
	window->Run();

	fCaptureMessenger = window;
}
int	main(int argc, char *argv[]) {
	const char	*modulename = "uvc";
	int	cameraid = 0;
	int	ccdid = 0;
	int	c;
	debugtimeprecision = 3;
	debugthreads = true;
	
	while (EOF != (c = getopt(argc, argv, "dC:c:m:")))
		switch (c) {
		case 'd':
			debuglevel = LOG_DEBUG;
			break;
		case 'C':
			cameraid = atoi(optarg);
			break;
		case 'c':
			ccdid = atoi(optarg);
			break;
		case 'm':
			modulename = strdup(optarg);
			break;
		}
std::cout << "main" << std::endl;

	// open repository
	Repository	repository;
	ModulePtr	module = repository.getModule(modulename);
	module->open();

	// Device locator for the module
	DeviceLocatorPtr	locator = module->getDeviceLocator();

	// get cameras
	std::vector<std::string>	cameras = locator->getDevicelist();
	debug(LOG_DEBUG, DEBUG_LOG, 0, "found %d devices", cameras.size());
	if (cameraid >= cameras.size()) {
		debug(LOG_ERR, DEBUG_LOG, 0, "not enough devices");
		throw std::runtime_error("camera id too large");
	}
	CameraPtr	camera = locator->getCamera(cameras[cameraid]);
	CcdPtr	ccd = camera->getCcd(ccdid);
	
	// now initialize the GUI stuff
        QApplication    app(argc, argv);
	CaptureWindow	capturewindow;
	capturewindow.setCamera(camera);
	capturewindow.setCcd(ccd);
	capturewindow.show();
	app.installEventFilter(&capturewindow);
        return app.exec();
}
Beispiel #3
0
int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("GB2312"));

	CaptureWindow w;
	//ÉèÖÃÖö¥
	//w.setWindowFlags(Qt::WindowStaysOnTopHint);
	//È«ÆÁ
	//w.showFullScreen();
	//ÏÔʾ
	w.show();

	return a.exec();
}