SimpleStreamTubeHandler::SimpleStreamTubeHandler(
        const QStringList &p2pServices,
        const QStringList &roomServices,
        bool requested,
        bool monitorConnections,
        bool bypassApproval)
    : AbstractClient(),
    AbstractClientHandler(buildFilter(p2pServices, roomServices, requested)),
    mMonitorConnections(monitorConnections),
    mBypassApproval(bypassApproval)
{
}
Пример #2
0
int main (int argc, char* argv[]) 
{
    int ix, curxapp, leftShift;
   
/* Initialize RSF */
    sf_init (argc,argv);
/* Input files */
    inDags_   = sf_input("in");
    inDagsSq_ = sf_input("dataSq");

/* check that the input is float */
    if ( SF_FLOAT != sf_gettype (inDags_) )   sf_error ("Need float input: dip-angle gathers");
    /* dip-angle gathers - stacks in the scattering-angle direction */
    if ( SF_FLOAT != sf_gettype (inDagsSq_) ) sf_error ("Need float input: dip-angle gathers in squares");
    /* stacks of amplitude squares in the scattering-angle direction */

/* Output file */
    sembFile_ = sf_output("out");

/* Depth/time axis */
    if ( !sf_histint   (inDags_, "n1", &zNum_) )   sf_error ("Need n1= in input");
    if ( !sf_histfloat (inDags_, "d1", &zStep_) )  sf_error ("Need d1= in input");
    if ( !sf_histfloat (inDags_, "o1", &zStart_) ) sf_error ("Need o1= in input");
/* Dip angle axis */
    if ( !sf_histint   (inDags_, "n2", &dipNum_) )   sf_error ("Need n2= in input");
    if ( !sf_histfloat (inDags_, "d2", &dipStep_) )  sf_error ("Need d2= in input");
    if ( !sf_histfloat (inDags_, "o2", &dipStart_) ) sf_error ("Need o2= in input");
/* x axis */
    if ( !sf_histint   (inDags_, "n3", &xNum_) )     sf_error ("Need n3= in input");
    if ( !sf_histfloat (inDags_, "d3", &xStep_) )    sf_error ("Need d3= in input");
    if ( !sf_histfloat (inDags_, "o3", &xStart_) )   sf_error ("Need o3= in input");
	
    if ( !sf_getint ("xapp",    &xapp_) )    xapp_ = 1;
    /* number of CIGs in the inline-direction processed simultaneously */
    if (!xapp_) {sf_warning ("xapp value is changed to 1"); xapp_ = 1;}

    if ( !sf_getint ("dipapp",    &xdipapp_) ) xdipapp_ = 11;
    /* number of traces in the x-dip direction processed simultaneously */
    if (!xdipapp_) {sf_warning ("dipapp value is changed to 11"); xdipapp_ = 11;}

    if ( !sf_getint ("coher",   &coher_) )   coher_ = 11;
    /* height of a vertical window for semblance calculation */
    if (!coher_) {sf_warning ("coher value is changed to 1"); coher_ = 1;}

    if ( !sf_getint ("scatnum", &scatnum_) ) scatnum_ = 1;
    /* shows how many traces were stacked in the scattering angle direction; 
       if the stack was normalized use the default value 
    */ 

	makeWeight_ = true;
    if ( !sf_getfloat ("s1", &s1_) ) {s1_ = -1.f; makeWeight_ = false; }
    /* minimum semblance value */ 
    if ( !sf_getfloat ("s2", &s2_) ) {s2_ = -1.f; makeWeight_ = false; }
    /* maximum semblance value */ 
	ds_ = s2_ - s1_;

    dagSize_ = zNum_ * dipNum_;
    halfCoher_ = coher_ / 2;    /* yes - this is the integer division */	
    halfXapp_  = xapp_ / 2;     /* this is the integer division too	*/

    for (ix = 0; ix < xNum_; ++ix) {
		
		sf_warning ("CIG %d of %d;", ix + 1, xNum_);
		
		/* xapp for the currect core CIG; it can be changed by the checkBoundary () */
		curxapp = xapp_; 
		/* distance between the core gather and the left side of the aperture */
		leftShift = 0;	

		ptrToSembPanel_ = sf_floatalloc (dagSize_);
		memset (ptrToSembPanel_, 0, dagSize_ * sizeof (float));

		readBlockAroundPoint (ix, halfXapp_, &curxapp, &leftShift);
		buildFilter (curxapp, leftShift, ptrToSembPanel_);

		free (ptrToDags_);
		free (ptrToDagsSq_);

		free (ptrToData_);
		free (ptrToDataSq_);

		sf_floatwrite (ptrToSembPanel_, dagSize_, sembFile_);
		free (ptrToSembPanel_);
    }

    sf_warning (".");

    exit(0);
}