예제 #1
0
mainwindow::mainwindow(QWidget *parent)
  : QWidget(parent)
{

  main_layout = new QHBoxLayout;
  left_layout = new QVBoxLayout;
  renderer_layout = new QVBoxLayout;
  buttons_layout = new QHBoxLayout;
  renderer = new Renderer;
  play_button = new QPushButton("Pause");
  toggle_button = new QPushButton("Toggle Averaging");
  connect_button = new QPushButton("Connect Emotiv");
  connect_Kat = new QPushButton("Connect Kat's Headset");
  connect_Will = new QPushButton("Connect Will's Headset");
  connect_server = new QPushButton("Connect to Server");
  server_options = new QPushButton("Server Options");
  print_on_off = new QPushButton("Print values");
  start_thread = new QPushButton("Start Thread");

  gyro = new gyro_widget;

  tabs = new QTabWidget;
  page1 = new QWidget;
  page2 = new QWidget;
  dialog = 0;
  setup_page1();
  setup_page2();
  tabs->addTab(page1, "Waveforms");
  tabs->addTab(page2, "Gyro");
  setup_mainwindow();
  this->setLayout(main_layout);
  thread = 0;
  renderer->renderer_timer_id = &timer;

  gyro->gyro_timer_id = &timer;

  gyro->gyro_x = &(renderer->gyro_x);
  
  gyro->gyro_y = &(renderer->gyro_y);

  timer = startTimer(WAIT_TIME);
}
예제 #2
0
파일: gipsec.c 프로젝트: smirko/gipsec
static GObject *
constructor (GType type,
		guint n_props,
		GObjectConstructParam *construct_props)
{
	GIPSec *gipsec = NULL;

	g_debug ("constructor...");

	gipsec = GIPSEC (G_OBJECT_CLASS (gipsec_parent_class)->constructor (type, n_props, construct_props));

	g_set_application_name (_("GIPSec monitor window"));

	gipsec->glade_file = g_build_filename (GLADEDIR, "gipsec.glade", NULL);
	if (!gipsec->glade_file ||
		   	!g_file_test (gipsec->glade_file, G_FILE_TEST_IS_REGULAR)) {
		g_warning (_("The GIPSec could not find the glade file."));
		goto error;
	}

	if (is_dialog_window()) {
		gipsec->config_window_xml =
			glade_xml_new (gipsec->glade_file, "gipsec_config_window", NULL);
	} else {
		gipsec->main_window_xml =
			glade_xml_new (gipsec->glade_file, "gipsec_main_window", NULL);

		setup_mainwindow (gipsec);
	}

	return G_OBJECT (gipsec);

error:
	g_object_unref (gipsec);

	return NULL;
}