示例#1
0
static void *
kumppa_init (Display *d, Window w)
{
  struct state *st = (struct state *) calloc (1, sizeof(*st));
  st->dpy=d;
  st->win[0]=w;
  if (!InitializeAll(st)) abort();

#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
  if (st->usedouble)
    {
      st->xdswp.swap_action=XdbeUndefined;
      st->xdswp.swap_window=st->win[0];
    }
  else
#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
    st->win[1]=st->win[0];

  return st;
}
INT WINAPI WinMain(HINSTANCE hInstance,			// Instancia a nuestra aplicación
				   HINSTANCE hPrevInstance,		// Existen instancias previas de nuestra aplicación?
				   LPSTR lpCmdLine,				// Línea de comandos
				   int nShowCmd)				// Cómo se despliega nuestra ventana?
{

	if(!SUCCEEDED(IniVentana(hInstance)))
		return 0;

	// Mostrar nuestra ventana
	ShowWindow(main_hWnd, nShowCmd);
	UpdateWindow(main_hWnd);

    InitializeAll(main_hWnd);

	EnterMsgLoop( Display );
	Device->Release();

	UnregisterClass("Math tests",hInstance);

	return 0;
}
示例#3
0
 RNG(double dev, int seed) {
     InitializeAll(seed, dev);
 }
示例#4
0
 RNG(double dev) {
     InitializeAll(std::chrono::system_clock::now().time_since_epoch().count(), dev);
 }
示例#5
0
 RNG() {
     InitializeAll(std::chrono::system_clock::now().time_since_epoch().count(), 1.0);
 }
示例#6
0
void ForEachMSAction::Perform(ArtifactSet &artifacts, ProgressListener &progress)
{
	unsigned taskIndex = 0;
	
	FinishAll();

	for(std::vector<std::string>::const_iterator i=_filenames.begin();i!=_filenames.end();++i)
	{
		std::string filename = *i;
		
		progress.OnStartTask(*this, taskIndex, _filenames.size(), std::string("Processing measurement set ") + filename);
		
		bool skip = false;
		if(_skipIfAlreadyProcessed)
		{
			MeasurementSet set(filename);
			if(set.HasRFIConsoleHistory())
			{
				skip = true;
				AOLogger::Info << "Skipping " << filename << ",\n"
					"because the set contains AOFlagger history and -skip-flagged was given.\n";
			}
		}
		
		if(!skip)
		{
			std::auto_ptr<ImageSet> imageSet(ImageSet::Create(filename, _baselineIOMode, _readUVW));
			bool isMS = dynamic_cast<MSImageSet*>(&*imageSet) != 0;
			if(isMS)
			{ 
				MSImageSet *msImageSet = static_cast<MSImageSet*>(&*imageSet);
				msImageSet->SetDataColumnName(_dataColumnName);
				msImageSet->SetSubtractModel(_subtractModel);
			}
			imageSet->Initialize();
			
			if(_loadOptimizedStrategy)
			{
				rfiStrategy::DefaultStrategy::TelescopeId telescopeId;
				unsigned flags;
				double frequency, timeResolution, frequencyResolution;
				rfiStrategy::DefaultStrategy::DetermineSettings(*imageSet, telescopeId, flags, frequency, timeResolution, frequencyResolution);
				RemoveAll();
				rfiStrategy::DefaultStrategy::LoadFullStrategy(
					*this,
					telescopeId,
					flags,
					frequency,
					timeResolution,
					frequencyResolution
				);
				
				if(_threadCount != 0)
					rfiStrategy::Strategy::SetThreadCount(*this, _threadCount);
			}
			
			std::auto_ptr<ImageSetIndex> index(imageSet->StartIndex());
			artifacts.SetImageSet(&*imageSet);
			artifacts.SetImageSetIndex(&*index);

			InitializeAll();
			
			ActionBlock::Perform(artifacts, progress);
			
			FinishAll();
			
			artifacts.SetNoImageSet();
			index.reset();
			imageSet.reset();

			if(isMS)
				writeHistory(*i);
		}
	
		progress.OnEndTask(*this);

		
		++taskIndex;
	}

	InitializeAll();
}
示例#7
0
int view_orb(GtkWidget* Parent,int argc, char **argv)
{
	GtkWidget* vboxwin;
	GtkWidget* hboxwin;
	GtkWidget* handleBoxColorMapGrid;
	GtkWidget* handleBoxColorMapContours;
	GtkWidget* handleBoxColorMapPlanesMapped;

	static gboolean first = TRUE;


	init_dipole();
	if(!first)
	{
		if(PrincipalWindow)
		{
			gtk_widget_hide(GTK_WIDGET(PrincipalWindow));
			gtk_widget_show(GTK_WIDGET(PrincipalWindow));
			/* if(argc>1) read_any_file(argv[1]);*/
			return 0;
		}
	}
	/* initialisation */
	initialise_global_orbitals_variables();
	read_opengl_file();

	/* Create new top level window. */
	PrincipalWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title(GTK_WINDOW(PrincipalWindow), _("Gabedit : Orbitals/Density/Vibration"));
	 gtk_container_set_reallocate_redraws (GTK_CONTAINER (PrincipalWindow), TRUE);
  	gtk_window_set_default_size (GTK_WINDOW(PrincipalWindow),(gint)(ScreenWidth*0.5),(gint)(ScreenHeight*0.69));
	gtk_container_set_border_width(GTK_CONTAINER(PrincipalWindow), 1);
	init_child(PrincipalWindow,gtk_widget_destroy," Draw Dens. Orb. ");
	/* g_signal_connect(G_OBJECT(PrincipalWindow),"delete_event",(GCallback)close_window_orb,NULL);*/
	g_signal_connect(G_OBJECT(PrincipalWindow), "delete-event",G_CALLBACK(gtk_widget_hide_on_delete), NULL);
	gtk_window_set_transient_for(GTK_WINDOW(PrincipalWindow),GTK_WINDOW(Parent));

	vboxwin = create_vbox(PrincipalWindow);
	gtk_widget_realize(PrincipalWindow);
	hboxwin = gtk_hbox_new (FALSE, 0);
	gtk_box_pack_start (GTK_BOX(vboxwin), hboxwin, TRUE, TRUE, 2);
	gtk_widget_show (hboxwin);

	
	if (!NewGLArea(hboxwin)) return 0;

	create_status_bar_orb(vboxwin);
	create_status_progress_bar_orb(vboxwin);

	handleBoxColorMapGrid = create_color_map_show(vboxwin,NULL," Grid ");
	g_object_set_data(G_OBJECT(PrincipalWindow), "HandleboxColorMapGrid ", handleBoxColorMapGrid);

	handleBoxColorMapContours = create_color_map_show(vboxwin,NULL, "Contours ");
	g_object_set_data(G_OBJECT(PrincipalWindow), "HandleboxColorMapContours", handleBoxColorMapContours);

	handleBoxColorMapPlanesMapped = create_color_map_show(vboxwin,NULL," Planes colorcoded");
	g_object_set_data(G_OBJECT(PrincipalWindow), "HandleboxColorMapPlanesMapped", handleBoxColorMapPlanesMapped);

	set_icone(PrincipalWindow);
	gtk_widget_show(GTK_WIDGET(PrincipalWindow));
	color_map_hide(handleBoxColorMapGrid);
	color_map_hide(handleBoxColorMapContours);
	color_map_hide(handleBoxColorMapPlanesMapped);
	/* if(argc>1) read_any_file(argv[1]);*/

	first = FALSE;

	gtk_window_move(GTK_WINDOW(PrincipalWindow),0,0);
	InitializeAll();
	/*printCoefZlm();*/

	return 0;
}