Beispiel #1
0
LONG CuDlgQueryExecutionPlanBoxStarLeaf::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	CaQepNodeInformationStar* pData = (CaQepNodeInformationStar*)lParam;
	SetupData (pData);
	UpdateData (FALSE);
	return 0L;
}
Beispiel #2
0
//---------------------------------------------------------------------------
void __fastcall TMainForm::StructTreeChange(TObject *Sender, TTreeNode *Node)
{
	int oLevel = _path.GetSize() - 1;

    	// if it was a single column display, treat it as one level less
    if (_colNum >= 0)
    	--oLevel;

    int nLevel = Node->Level;
    _path.SetSize(nLevel + 1);

    c4_IntProp pItem ("item");
    c4_StringProp pName ("name");

    for (TTreeNode* p = Node; p; p = p->Parent)
    {
    	int k = p->Level;
    	c4_RowRef row = _path[k];

        c4_String old (pName (row));
        pName (row) = p->Text.c_str();

        if (pName (row) != old)
			nLevel = k;
    }

    for (int i = nLevel; i < _path.GetSize(); ++i)
    	pItem (_path[i]) = 0;

    if (nLevel > oLevel && DataGrid->Row > 0)
    	pItem (_path[oLevel+1]) = DataGrid->Row - 1;

    SetupData();
}
Beispiel #3
0
void TFixedFilterDBFrame::UpdateData()
{
	if(m_ListDataSrc)
	{
		if(m_ListDataSrc.actualize_state())
		{
            SetupData();
		}
    }
}
Beispiel #4
0
EnemyKingPumpkin::EnemyKingPumpkin(vector<Enemy*>* enemyList) :Enemy(enemyList, imageAsset_Enemy_BigPumpkin){
	Vec2 pos = Vec2::Setup(640, 300);

	CharacterInformation prm = CharacterInformation::Setup(300, 0, 2, 150, 1, 128);
	moveVelocity = Vec2::One()*-5;
	cntInvisible = 400;
	countForDeadEffect = 0;
	SetupData(pos, prm, false);
	Initialize();
	cntChange = maxCntChange = 300;
}
Beispiel #5
0
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormActivate(TObject *Sender)
{
    c4_View root = _storage;
    TTreeNode* top = StructTree->TopItem;

    _path.SetSize(0);

    const char* desc = _storage.Description();
    SetupTree(top, desc);

    StructTree->FullExpand();
    StructTree->Selected = StructTree->Items->Item[0];

    SetupData();
}
Beispiel #6
0
//---------------------------------------------------------------------------
void TFixedFilterDBFrame::LoadConfig(DCMapConfigWrapper cfg)
{
	//cfg.section("FixedFilter");
	String sv;
	String sw;
	float  iv;
	String No = IntToStr(m_iFilterNo);
	cfg["Table"+No] >> Table;
	cfg["Field"+No] >> Field;
	
	if(cfg["ParamName"+No] >> sv)
		ResourceSelBtn->Caption = sv;

	cfg["DBOperator"+No] >> m_iRefOp;
	cfg["StrOperator"+No] >> m_iStrOp;
	cfg["NumOperator"+No] >> m_iNumOp;
	cfg["FilterMode"+No] >> m_iMode;

	if(cfg["Enabled"+No] >> iv) UseCheck->Checked = iv;

	if(cfg["NumParam"+No] >> iv) NumEdit->Value = iv;
	if(cfg["StrParam"+No] >> sv) StringEdit->Text = sv;

	if(cfg["DBParam"+No] >> sw) LastItem = sw;

	if(cfg["CustomParam"+No] >> sv) ComboEdit->Text = sv;


	if(No==0)
	{
		m_iMode = FMODE_AND;
		ModeButton->Visible = false;
	}
	else
	{
	    ModeButton->Visible = true;
		if(m_iMode == FMODE_AND) ModeButton->ImageIndex = InterfaceModule->GetMenuImage(L"fmode-and");
		else if(m_iMode == FMODE_OR) ModeButton->ImageIndex = InterfaceModule->GetMenuImage(L"fmode-or");
	}


	SetupData();
}
Beispiel #7
0
void __fastcall TFixedFilterDBFrame::FieldMenuClick(TObject *Sender)
{
	TMenuItem* Item = dynamic_cast<TMenuItem*>(Sender);
    String Cap = Item->Hint;
    if(Cap.IsEmpty())
    	Cap = " "+Item->Caption;

    ResourceSelBtn->Caption = Cap;

    // Decode name
    int delim = Item->Name.Pos("_");
    Table = Item->Name.SubString(1,delim-1);
    Field = Item->Name.SubString(delim+1,Item->Name.Length());
    
    SetupData();

    if(DBValueComboBox->Visible)DBValueComboBox->SetFocus();
	else if(StringEdit->Visible)StringEdit->SetFocus();
	else if(NumEdit->Visible)NumEdit->SetFocus();
}
Beispiel #8
0
int main( int argc, char **argv )
{
    MPI_Comm comm;
    MPI_Request r[MAX_REQ];
    MPI_Status  s[MAX_REQ];
    int msgsize, maxmsg, root, i, j, size, rank, err = 0, msgcnt, toterr;
    int *sbuf, *rbuf;

    MPI_Init( &argc, &argv );
    
    comm = MPI_COMM_WORLD;

    MPI_Comm_size( comm, &size );
    MPI_Comm_rank( comm, &rank );

    if (size < 2) {
	printf( "This test requires at least 2 processors\n" );
	MPI_Abort( comm, 1 );
    }

    /* First, try large blocking sends to root */
    root = 0;
    
    maxmsg =  MAX_MSG;
    msgsize = 128;
    msgcnt  = MAX_MSG_CNT;
    if (rank == root && verbose) printf( "Blocking sends: " );
    while (msgsize <= maxmsg) {
	if (rank == root) {
	    if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
	    rbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!rbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    for (i=0; i<size; i++) {
		if (i == rank) continue;
		for (j=0; j<msgcnt; j++) {
		    SetupRdata( rbuf, msgsize );
		    MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
		    err += CheckData( rbuf, msgsize, 2*i, s );
		}
	    }
	    free( rbuf );
	}
	else {
	    sbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!sbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    SetupData( sbuf, msgsize, 2*rank );
	    for (j=0; j<msgcnt; j++) 
		MPI_Send( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
	    free( sbuf );
	}
	msgsize *= 4;
    }
    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }

    /* Next, try unexpected messages with Isends */
    msgsize = 128;
    maxmsg  = MAX_MSG;
    msgcnt  = MAX_REQ;
    if (rank == root && verbose) printf( "Unexpected recvs: " );
    while (msgsize <= maxmsg) {
	if (rank == root) {
	    if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
	    rbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!rbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    MPI_Barrier( comm );
	    for (i=0; i<size; i++) {
		if (i == rank) continue;
		for (j=0; j<msgcnt; j++) {
		    SetupRdata( rbuf, msgsize );
		    MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
		    err += CheckData( rbuf, msgsize, 2*i, s );
		}
	    }
	    free( rbuf );
	}
	else {
	    sbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!sbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    SetupData( sbuf, msgsize, 2*rank );
	    for (j=0; j<msgcnt; j++) {
		MPI_Isend( sbuf, msgsize, MPI_INT, root, 2*rank, comm, &r[j] );
	    }
	    MPI_Barrier( comm );
	    MPI_Waitall( msgcnt, r, s );
	    free( sbuf );
	}
	msgsize *= 4;
    }
    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }

    /* Try large synchronous blocking sends to root */
    root = 0;
    
    msgsize = 128;
    maxmsg  = MAX_MSG;
    if (rank == root && verbose) printf( "Synchronous sends: " );
    while (msgsize <= maxmsg) {
	if (rank == root) {
	    if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
	    rbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!rbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    for (i=0; i<size; i++) {
		if (i == rank) continue;
		for (j=0; j<msgcnt; j++) {
		    SetupRdata( rbuf, msgsize );
		    MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
		    err += CheckData( rbuf, msgsize, 2*i, s );
		}
	    }
	    free( rbuf );
	}
	else {
	    sbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!sbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    SetupData( sbuf, msgsize, 2*rank );
	    for (j=0; j<msgcnt; j++) 
		MPI_Ssend( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
	    free( sbuf );
	}
	msgsize *= 4;
    }
    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }

    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
    
    if (rank == 0) {
	if (toterr == 0) printf( "No errors\n" );
	else printf( "!! found %d errors\n", toterr );
    }
    if (toterr) {
	printf( "!! found %d errors on processor %d\n", err, rank );
    }

    MPI_Finalize( );
    return 0;
}
Beispiel #9
0
void MathPrintout::OnPreparePrinting()
{
  SetupData();
}
Beispiel #10
0
Enemy_Test::Enemy_Test(vector<Enemy*>* enemyList) :Enemy(enemyList, imageAsset_Enemy_Test){
	Vec2 pos					= Vec2::Setup((float)GetRand(Window::WIDTH), (float)GetRand(Window::HEIGHT));
	CharacterInformation prm	= CharacterInformation::Setup(2, 0, 1, 30, 2, 32);
	SetupData(pos, prm);
	Initialize();
}
Beispiel #11
0
int main( int argc, char **argv )
{
    MPI_Comm comm;
    MPI_Request r[MAX_REQ];
    MPI_Status  s[MAX_REQ];
    int msgsize, maxmsg, root, i, size, rank, err = 0, toterr;
    int max_msg_size = DEF_MAX_MSG;
    int *sbuf, *rbuf;

    MPI_Init( &argc, &argv );

    comm = MPI_COMM_WORLD;

    MPI_Comm_size( comm, &size );
    MPI_Comm_rank( comm, &rank );

    if (size < 2) {
	printf( "This test requires at least 2 processors\n" );
	MPI_Abort( comm, 1 );
    }

    /* Check for a max message argument */
    if (rank == 0) {
	if (argc > 1) {
	    max_msg_size = atoi( argv[1] );
	    /* Correct if unrecognized argument */
	    if (max_msg_size <= 0) max_msg_size = DEF_MAX_MSG;
	}
    }
    MPI_Bcast( &max_msg_size, 1, MPI_INT, 0, MPI_COMM_WORLD );

    /* First, try large blocking sends to root */
    root = 0;
    
    msgsize = 128;
    maxmsg  = max_msg_size;
    if (rank == root && verbose) printf( "Blocking sends: " );
    while (msgsize < maxmsg) {
	if (rank == root) {
	    if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
	    rbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!rbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    for (i=0; i<size; i++) {
		if (i == rank) continue;
		SetupRdata( rbuf, msgsize );
		MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
		err += CheckData( rbuf, msgsize, 2*i, s );
	    }
	    free( rbuf );
	}
	else {
	    sbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!sbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    SetupData( sbuf, msgsize, 2*rank );
	    MPI_Ssend( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
	    free( sbuf );
	}
	msgsize *= 4;
    }
    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }

    /* Next, try unexpected messages with Isends */
    msgsize = 128;
    maxmsg  = max_msg_size;
    if (rank == root && verbose) printf( "Unexpected recvs: " );
    while (msgsize < maxmsg) {
	if (rank == root) {
	    if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
	    rbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!rbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    MPI_Barrier( comm );
	    for (i=0; i<size; i++) {
		if (i == rank) continue;
		SetupRdata( rbuf, msgsize );
		MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
		err += CheckData( rbuf, msgsize, 2*i, s );
	    }
	    free( rbuf );
	}
	else {
	    sbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!sbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    SetupData( sbuf, msgsize, 2*rank );
	    MPI_Isend( sbuf, msgsize, MPI_INT, root, 2*rank, comm, r );
	    MPI_Barrier( comm );
	    MPI_Wait( r, s );
	    free( sbuf );
	}
	msgsize *= 4;
    }
    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }

    /* Try large synchronous blocking sends to root */
    root = 0;
    
    msgsize = 128;
    maxmsg  = max_msg_size;
    if (rank == root && verbose) printf( "Synchronous sends: " );
    while (msgsize < maxmsg) {
	if (rank == root) {
	    if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
	    rbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!rbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    for (i=0; i<size; i++) {
		if (i == rank) continue;
		SetupRdata( rbuf, msgsize );
		MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
		err += CheckData( rbuf, msgsize, 2*i, s );
	    }
	    free( rbuf );
	}
	else {
	    sbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!sbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    SetupData( sbuf, msgsize, 2*rank );
	    MPI_Send( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
	    free( sbuf );
	}
	msgsize *= 4;
    }
    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }

    /* Next, try expected messages with Rsend */
    msgsize = 128;
    maxmsg  = max_msg_size;
    if (rank == root && verbose) printf( "Expected recvs and Rsend: " );
    while (msgsize < maxmsg) {
	if (rank == root) {
	    if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
	    rbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!rbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    for (i=0; i<size; i++) {
		if (i == rank) continue;
		SetupRdata( rbuf, msgsize );
		MPI_Irecv( rbuf, msgsize, MPI_INT, i, 2*i, comm, r );
		MPI_Send( MPI_BOTTOM, 0, MPI_INT, i, 2*i+1, comm );
		MPI_Wait( r, s );
		err += CheckData( rbuf, msgsize, 2*i, s );
	    }
	    free( rbuf );
	}
	else {
	    sbuf = (int *)malloc( msgsize * sizeof(int) );
	    if (!sbuf) {
		printf( "Could not allocate %d words\n", msgsize );
		MPI_Abort( comm, 1 );
	    }
	    SetupData( sbuf, msgsize, 2*rank );
	    MPI_Recv( MPI_BOTTOM, 0, MPI_INT, root, 2*rank+1, comm, s );
	    MPI_Send( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
	    free( sbuf );
	}
	msgsize *= 4;
    }
    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }


    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
    
    if (rank == 0) {
	if (toterr == 0) printf( " No Errors\n" );
	else printf( "!! found %d errors\n", toterr );
    }
    if (toterr) {
	printf( "!! found %d errors on processor %d\n", err, rank );
    }

    MPI_Finalize( );
    return 0;
}