예제 #1
0
SwfToHtml5::SwfToHtml5(QWidget *parent) : QDialog(parent), m_settings("Decay", "SwfToHtml5 parser")
{
    this->setWindowIcon(QIcon(":/images/images/icon.png"));
    QApplication::setStyle(new newStyle);
    setWindowFlags(windowFlags()|Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint);
    resize(400, 300);
    m_pStatusLbl = new QLabel(tr("Select the adobe flash files (*.swf)"), this);
    m_pStatusLbl->setAlignment(Qt::AlignCenter);
    m_pPathToFileLbl = new QLabel(tr(""), this);

    m_pLoadFileBtn = new QPushButton(tr("Load files"), this);
    m_pCloseBtn = new QPushButton(tr("Close"), this);
    m_pBeginConvertBtn = new QPushButton(tr("Start convert"), this);
    m_pBeginConvertBtn->setEnabled(false);

    m_filesLstWgt = new QListWidget(this);

    m_pMainLayout = new QVBoxLayout(this);
    m_pMainLayout->addWidget(m_pStatusLbl);
    m_pMainLayout->addWidget(m_filesLstWgt);
    m_pMainLayout->addWidget(m_pPathToFileLbl);
    m_pMainLayout->addWidget(m_pLoadFileBtn);
    m_pMainLayout->addWidget(m_pBeginConvertBtn);
    m_pMainLayout->addWidget(m_pCloseBtn);

    this->setLayout(m_pMainLayout);
    connect(m_pLoadFileBtn, &QPushButton::clicked, this, &SwfToHtml5::loadFile);
    connect(m_pCloseBtn, &QPushButton::clicked, this, &SwfToHtml5::close);
    connect(m_pBeginConvertBtn, &QPushButton::clicked, this, &SwfToHtml5::process);
    readsettings();
}
예제 #2
0
settingseditor::settingseditor(QWidget *parent) :
    QWidget(parent)
{
    settings = browserapplication::settings();
    settingstabs = new QTabWidget(this);
    searchtab = new QWidget();
    settingstabs->addTab(searchtab , "search");
    searchformlayout = new QFormLayout(searchtab);
    searchonkeyup = new QLabel("search when text editing is finished");
    choosekeyup = new QCheckBox();
    savebutton = new QPushButton("save");
    searchformlayout->addRow(searchonkeyup , choosekeyup);
    searchformlayout->addRow("" , savebutton);
    readsettings();
    QObject::connect(savebutton , SIGNAL(clicked()) , this , SLOT(savesettings()));
}
예제 #3
0
// Inicializa los elementos necesarios para la aplicación
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
	setupUi(this);
	setupActions();
	
	// Configura la barra de herramienta
	QMenu *toolBarMenu = menuSettings->addMenu(tr("&Toolbars"));
	toolBar->toggleViewAction()->setShortcut(tr("CTRL+T"));
	toolBar->toggleViewAction()->setStatusTip(tr("Show/Hide Main Toolbar"));
	toolBar->toggleViewAction()->setText(tr("&Main Toolbar"));
	toolBarMenu->addAction(toolBar->toggleViewAction());
	
	actionUndo->setEnabled(false);
	actionRepeat->setEnabled(false);
	
	mStatLabel = new QLabel();
	statusBar()->addPermanentWidget(mStatLabel);
	
	connect(textEdit, SIGNAL(textChanged()),
			this, SLOT(updateStats()));
	
	updateStats();
	
	QDockWidget *templateDocker = new QDockWidget;
	templateDocker->setAllowedAreas(Qt::LeftDockWidgetArea|
									Qt::RightDockWidgetArea);
	templateDocker->setObjectName("TemplateDocker");
	templateDocker->setWindowTitle("Templates");
	addDockWidget(Qt::LeftDockWidgetArea,templateDocker);
	
	QListView *view = new QListView();
	templateDocker->setWidget(view);
	
	TemplateHandler *mTemplate = new TemplateHandler(view, textEdit, this);
	
	templateDocker->toggleViewAction()->setShortcut(tr("CTRL+M"));
	templateDocker->toggleViewAction()->setStatusTip(tr("Show/Hide Template Docker"));
	templateDocker->toggleViewAction()->setText(tr("&Template Docker"));
	toolBarMenu->addAction(templateDocker->toggleViewAction());
	
	// Recuoera la configuración del editor
	readsettings();
}
예제 #4
0
int main(int argc, char **argv)
{
	fd_set rdfs;
	int s;
	canid_t mask = 0;
	canid_t value = 0;
	long currcms = 0;
	long lastcms = 0;
	unsigned char quiet = 0;
	int opt, ret;
	struct timeval timeo, start_tv, tv;
	struct sockaddr_can addr;
	struct ifreq ifr;
	int i;


	signal(SIGTERM, sigterm);
	signal(SIGHUP, sigterm);
	signal(SIGINT, sigterm);

	for (i=0; i < 2048 ;i++) /* default: check all CAN-IDs */
		do_set(i, ENABLE);

	while ((opt = getopt(argc, argv, "m:v:r:t:h:l:qbBcf?")) != -1) {
		switch (opt) {
		case 'm':
			sscanf(optarg, "%x", &mask);
			break;

		case 'v':
			sscanf(optarg, "%x", &value);
			break;

		case 'r':
			readsettings(optarg, 0); /* no BCM-setting here */
			break;

		case 't':
			sscanf(optarg, "%ld", &timeout);
			break;

		case 'h':
			sscanf(optarg, "%ld", &hold);
			break;

		case 'l':
			sscanf(optarg, "%ld", &loop);
			break;

		case 'q':
			quiet = 1;
			break;

		case 'b':
			binary = 1;
			binary_gap = 0;
			break;

		case 'B':
			binary = 1;
			binary_gap = 1;
			break;

		case 'c':
			color = 1;
			break;

		case 'f':
			filter_id_only = 1;
			break;

		case '?':
			break;

		default:
			fprintf(stderr, "Unknown option %c\n", opt);
			break;
		}
	}

	if (optind == argc) {
		print_usage(basename(argv[0]));
		exit(0);
	}
	
	if (mask || value) {
		for (i=0; i < 2048 ;i++) {
			if ((i & mask) ==  (value & mask))
				do_set(i, ENABLE);
			else
				do_clr(i, ENABLE);
		}
	}

	if (quiet)
		for (i=0; i < 2048 ;i++)
			do_clr(i, ENABLE);

	if (strlen(argv[optind]) >= IFNAMSIZ) {
		printf("name of CAN device '%s' is too long!\n", argv[optind]);
		return 1;
	}

	interface = argv[optind];

	if ((s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM)) < 0) {
		perror("socket");
		return 1;
	}

	addr.can_family = AF_CAN;

	if (strcmp(ANYDEV, argv[optind])) {
		strcpy(ifr.ifr_name, argv[optind]);
		if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
			perror("SIOCGIFINDEX");
			exit(1);
		}
		addr.can_ifindex = ifr.ifr_ifindex;
	}
	else
		addr.can_ifindex = 0; /* any can interface */

	if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
		perror("connect");
		return 1;
	}

	for (i=0; i < 2048 ;i++) /* initial BCM setup */
		if (is_set(i, ENABLE))
			rx_setup(s, i);

	gettimeofday(&start_tv, NULL);
	tv.tv_sec = tv.tv_usec = 0;

	printf("%s", CSR_HIDE); /* hide cursor */

	while (running) {

		FD_ZERO(&rdfs);
		FD_SET(0, &rdfs);
		FD_SET(s, &rdfs);

		timeo.tv_sec  = 0;
		timeo.tv_usec = 100000 * loop;

		if ((ret = select(s+1, &rdfs, NULL, NULL, &timeo)) < 0) {
			//perror("select");
			running = 0;
			continue;
		}

		gettimeofday(&tv, NULL);
		currcms = (tv.tv_sec - start_tv.tv_sec) * 10 + (tv.tv_usec / 100000);

		if (FD_ISSET(0, &rdfs))
			running &= handle_keyb(s);

		if (FD_ISSET(s, &rdfs))
			running &= handle_bcm(s, currcms);

		if (currcms - lastcms >= loop) {
			running &= handle_timeo(s, currcms);
			lastcms = currcms;
		}
	}

	printf("%s", CSR_SHOW); /* show cursor */

	close(s);
	return 0;
}
예제 #5
0
int main (int argc, char **argv) {
	// cycle we want to open
		sscanf(argv[1],"%d",&InitT);
	sscanf(argv[2],"%d",&MaxLevel);
	sscanf(argv[3],"%d",&DeltaT);
	nlevels = MaxLevel/DeltaT;
	initlevel = InitT/DeltaT;

    int out;
	out = readsettings();
	if(out<0)
		return -1;

	nxn = nxc/XLEN;
	nyn = nyc/YLEN;
	nzn = nzc/ZLEN;




	temp_storageX = new double[(nxn+1)*(nyn+1)*(nzn+1)];
	temp_storageY = new double[(nxn+1)*(nyn+1)*(nzn+1)];
    temp_storageZ = new double[(nxn+1)*(nyn+1)*(nzn+1)];

	double*** EX = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** EY = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** EZ = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** BX = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** BY = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** BZ = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** VX = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** VY = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** VZ = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** OHMX = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** OHMY = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** OHMZ = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** NE = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** NI = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	double*** NT = newArr3(double,nxn*XLEN,nyn*YLEN,nzn*ZLEN);
	
	//Electric field
	for (int it = initlevel; it < nlevels+1; it++){
    readvect(it, "/fields/","E", EX, EY, EZ);
    writeVTKvect(it, "E", "", EX, EY, EZ);

	//Magnetic field
    readvect(it,"/fields/","B", BX, BY, BZ);
    writeVTKvect(it,"B", "", BX, BY, BZ);

	//Compute ExB
    //cross(BX, BY, BZ, EX, EY, EZ, VXBX, VXBY, VXBZ)

	//Rho by species
    readscalar(it,"/moments/species_0/","rho",  NE);
    readscalar(it,"/moments/species_1/","rho",  NI);
    readscalar(it,"/moments/species_1/","rho",  NT);
    writeVTKscalar_species(it,"rho", NE, NI, NT);
   // writeVTKscalar("rho", "e", VX);

	//Currents species0
    readvect(it,"/moments/species_0/","J",  VX, VY, VZ);
    writeVTKvect(it,"J", "e", VX, VY, VZ);
 

    //Currents species1
    readvect(it,"/moments/species_1/","J",  VX, VY, VZ);
    writeVTKvect(it,"J", "i", VX, VY, VZ);

   //Currents species2
    readvect(it,"/moments/species_2/","J",  VX, VY, VZ);
    writeVTKvect(it,"J", "t", VX, VY, VZ);
}
	delArr3(BX,nxn*XLEN,nyn*YLEN);
	delArr3(BY,nxn*XLEN,nyn*YLEN);
	delArr3(BZ,nxn*XLEN,nyn*YLEN);
	delArr3(EX,nxn*XLEN,nyn*YLEN);
	delArr3(EY,nxn*XLEN,nyn*YLEN);
	delArr3(EZ,nxn*XLEN,nyn*YLEN);
	delArr3(VX,nxn*XLEN,nyn*YLEN);
	delArr3(VY,nxn*XLEN,nyn*YLEN);
	delArr3(VZ,nxn*XLEN,nyn*YLEN);
	delete[] temp_storageX;
	delete[] temp_storageY;
	delete[] temp_storageZ;
	
	
	return(0);
}