Esempio n. 1
0
void CDFAlign::RunAlign()
{
	// TODO: Add your control notification handler code here
	//UpdateData(true);
	
	m_tids.clear();
	
	pthread_t tid;
	int terror;
	terror=pthread_create(&tid,NULL,ThreadFunc_cuAlign,(void *)this);
  	if(terror!=0)
  	{
		TextOutput("Error: Failed to create pthread: Align\n");
		return;
   }
   m_tids.push_back(tid);
   
   //wait for finish
   void *TReturn;
   int i;
	for(i=0;i<m_tids.size();i++)
	{
   	terror=pthread_join(m_tids[i],&TReturn);
   	if(terror!=0)
   	{
      	TextOutput("Warnning: Thread doesn't exit. Something may be wrong.\n");
   	}
   	
   }
   m_tids.clear();
}
Esempio n. 2
0
void TextWriter::open() {
  /*IMP_INTERNAL_CHECK(!(file_name_.find("%1%") != std::string::npos
                       && get_frame() == -1),
                       "Cant open file without a frame.");*/
  out_ = TextOutput();
  out_ = TextOutput(get_current_file_name());
  do_open();
}
Esempio n. 3
0
void TextWriter::do_set_frame() {
  if (file_name_.empty() /* || file_name_.find("%1%")== std::string::npos*/) {
    IMP_FAILURE("Cannot set frame on writer without %1% being in the name.");
  }
  if (out_ != TextOutput()) {
    do_close();
    out_ = TextOutput();
  }
  open();
}
Esempio n. 4
0
void CGameMain::draw()
{
    // todo: 画
    if (g_pDevice)
    {
        // 先清空绘制流程
        CDrawFlow::Instance().clear();

		Textinterface_ResetTextoutOneFrame();

		g_pDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xfff3f2ee, 1.0f, 0);

        g_pDevice->BeginScene();

        m_pTest->Draw(); //画 瑞雯

		m_SpriteWhiteCube->Draw();
//         for (int i = 0; i < TEST_SIZE; ++i) //画 绿头
//         {
//             m_sp[i]->Draw();
//         }

        //m_AniAuto.draw(); //动画
        //m_pDlgTest->Draw();

// 		set_current_line_color(0xff00ff00);
// 		draw_line(10, 10, 200, 10);
// 
// 		draw_rect_frame(20, 20, 200, 200);

        _gui.Draw();

        _pTWorld->draw();

		// 测试字体
		//test font;
		const char* pstr = "fly";
		TextOutput(0, 100, pstr);
 		TextOutput(0, 200, "不布");

		static char textArr[100];
		sprintf(textArr, "窗体位置 (%d, %d)", _gui.GetScreenPosX(), _gui.GetScreenPosY());
		TextOutput(0, 120, textArr);



        CDrawFlow::Instance().draw(); //绘制流

        

        g_pDevice->EndScene();
        g_pDevice->Present(0,0,0,0);
    }
    
}
Esempio n. 5
0
TextOutput get_log_target() {
#if IMP_BASE_HAS_LOG4CXX
  return TextOutput(std::cout);
#else
  return internal::stream.get_stream();
#endif
}
Esempio n. 6
0
void ButtonLaunch::TextOutput()
{
    // Prevent this from being called twice.
    disconnect(m_pProcess, SIGNAL(readyRead()), this, SLOT(TextOutput()));

    // Create a subwindow to display stdout text from the app.
    m_pTextWindow = new QTextEdit(this);
    m_pTextWindow->setStyleSheet("QScrollBar{min-width: 30; min-height: 30}");
    m_pTextWindow->setFontPointSize(16);

    // Display the text window the same size as the main menu.

    m_pSubWindow = m_pMdiArea->addSubWindow(m_pTextWindow);
    m_pSubWindow->resize(m_pMdiArea->size());
    m_pSubWindow->setWindowFlags(Qt::FramelessWindowHint);
    m_pSubWindow->show();
    m_pSubWindow->setFocus();

    // Hook signals to handle additional text output and process closing.
    connect(m_pProcess, SIGNAL(readyRead()), this, SLOT(ReadOutput()));
    connect(m_pProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(Finished()));

    //qDebug() << "TextOutput";
    ReadOutput();
}
Esempio n. 7
0
void pieceCreate()
	{
#ifdef DEBUG_STREAM
	printf("pieceCreate - start");
#endif
	int pieceToCreate=prob;
	int rndm=(rand())%(chnc[prob]);
	int add=0;
	for (int j=0; (j<=Ztet)&&(pieceToCreate==prob); j++)
		{
		add+=chnc[j];
		if (add>rndm) pieceToCreate=j*4;
		}
	if (pieceToCreate==prob)
		{
		ClearScreen();
		TextOutput(0,24,add,0);
		TextOutput(0,16,rndm,0);
		TextOutput(0,00,0,0);
		Wait(1000);
		}
	currentPiece=nextPiece[0];
	for (int i=1; i<PREVIEW_PIECES; i++)
		{
		nextPiece[i-1]=nextPiece[i];
		}
	nextPiece[PREVIEW_PIECES-1]=pieceToCreate;

	lockDelay		= 0;
	//prevRht			= 0;
	//prevLft			= 0;
	//prevDrp			= 0;
	//prevRot			= 0;
	currentRotate	= 2;
	prevWaited		= 0;
	drop			= 0;
	lockDelay		= 0;
	floorKickUsed	= 0;
	tetLR			= (AREA_WIDTH/2)-2;
	tetUD			= -2;
	piecemoving		= true;
	alive			= true;

#ifdef DEBUG_STREAM
	printf(" - end\n");
#endif
	}
Esempio n. 8
0
void cOctree<_DataType>::PrintOctree()
{
	char	OutFileName_c[512];
	FILE	*fp;
	
	
	sprintf (OutFileName_c, "%s_octree.txt", OutputFileName_mi);
	fp = fopen(OutFileName_c, "w");
	

	TextOutput(fp, Root_m);
}
Esempio n. 9
0
void CDFAlign::ImageOutput(float *buf)
{
	DIM dispdim=m_dispdim;
	memcpy(m_bufIm,buf,sizeof(float)*(dispdim.width()+2)*dispdim.height());
	
	pthread_t tid;
	int terror;
	terror=pthread_create(&tid,NULL,ImageOutputThread,(void *)this);
  	if(terror!=0)
  	{
		TextOutput("Error: Failed to create pthread: Image Output\n");;
   	return;
   }
   m_tids.push_back(tid);

}
Esempio n. 10
0
void ButtonLaunch::Launch()
{
    // If Description mode is on, Save the application launch, launch a description if one is 
    // available, otherwise run the application as normal
    if(m_pMControl->getDescMode() == "On" && m_pAppDescription != "" && m_showTestMenu )
    {
        SaveLaunch();
        MenuPage * pMenuPage = new MenuPage(m_pMdiArea, m_pAppDescription, false , m_pParentWindow, m_pMControl);
        pMenuPage->Launch();
    }
    else
    {
        m_showTestMenu = true;

       // Create a process to run the app.
       m_pProcess = new QProcess(this);
       m_pProcess->setProcessChannelMode(QProcess::MergedChannels);
       // Disable parent menu while this process is running to prevent false button triggering.
       m_pParentWindow->Disable();

       connect(m_pProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(ErrorHandler()));
       if (m_appTextFlag)
       {
           // Hook signals for apps that generate stdout text.
           connect(m_pProcess, SIGNAL(readyRead()), this, SLOT(TextOutput()));
       }
       else    // For apps that do not need a window to display stdout text.
       {
           connect(m_pProcess, SIGNAL(finished(int, QProcess::ExitStatus)), m_pParentWindow, SLOT(Enable()));
       }
       // Launch the app by its stored name.
       QStringList appParameters;
       appParameters << m_appParameter;

       if (!m_terminateMatrix) {
           m_pProcess->start(m_appName, appParameters, QIODevice::ReadOnly | 
               QIODevice::Text);
       }
       else {
           // If we need to terminate the matrix we must start the application as 
           // a detached process.
           m_pProcess->startDetached(m_appName, appParameters);
       } 
    }
    //qDebug() << "Launched App: " << m_appName << " " << m_appParameter;
}
Esempio n. 11
0
void CDFAlign::FFTOutputRaw(float *buf)
{
	//DIM nsam=m_nsam.MinSquare();
	//if(m_bufFFTRaw==0) m_bufFFTRaw=new float[(nsam.width()/2+1)*nsam.height()];
	//memcpy(m_bufFFTRaw,buf,sizeof(float)*(nsam.width()/2+1)*nsam.height());
	if(m_bufFFTRaw==0) m_bufFFTRaw=new float[(DISPDIM+2)*DISPDIM];
	memcpy(m_bufFFTRaw,buf,sizeof(float)*(DISPDIM+2)*DISPDIM);
	
	pthread_t tid;
	int terror;
	terror=pthread_create(&tid,NULL,FFTOutputRawThread,(void *)this);
  	if(terror!=0)
  	{
		TextOutput("Error: Failed to create pthread: FFT Output Raw\n");;
   	return;
   }
   m_tids.push_back(tid);
}
Esempio n. 12
0
void cOctree<_DataType>::TextOutput(FILE *fp, cOctreeCell *Cell)
{
	int		i;

	if (Cell==NULL) return;
	
	fprintf (fp, "%5d ", Cell->CellID_mi);
	if (Cell->Parent_m!=NULL) fprintf (fp, "%5d ", Cell->Parent_m->CellID_mi);
	else fprintf (fp, "   -1 ");
	for (i=0; i<8; i++) {
		if (Cell->Children_m[i]!=NULL) fprintf (fp, "%5d ", Cell->Children_m[i]->CellID_mi);
		else fprintf (fp, "   -1 ");
	}
	fprintf (fp, "%3d %3d %3d ", Cell->StartCoord_mi[0], Cell->StartCoord_mi[1], Cell->StartCoord_mi[2]);
	fprintf (fp, "%3d %3d %3d ", Cell->EndCoord_mi[0], Cell->EndCoord_mi[1], Cell->EndCoord_mi[2]);
	for (i=0; i<NUM_CLASSES; i++) fprintf (fp, "%8d ", Cell->Class_mi[i]);
	fprintf (fp, "\n"); fflush (fp);
	
	for (i=0; i<8; i++) TextOutput(fp, Cell->Children_m[i]);
}
Esempio n. 13
0
void CDFAlign::CCMapOutput(float *buf, void *pki)
{
	Vector<double> &ki=*(Vector<double> *)pki;
	if(m_bufCCMap!=0) delete [] m_bufCCMap;
	int size=m_para.CCPeakSearchDim*m_para.CCPeakSearchDim*ki.size();
	m_bufCCMap=new float[size];
	memcpy(m_bufCCMap,buf,sizeof(float)*size);
	m_kiCCMap.clear();
	for(int i=0;i<ki.size();i++) m_kiCCMap.push_back(ki[i]);

	pthread_t tid;
	int terror;
	terror=pthread_create(&tid,NULL,CCMapOutputThread,(void *)this);
  	if(terror!=0)
  	{
		TextOutput("Error: Failed to create pthread: CC Map Output\n");;
   	return;
   }
   m_tids.push_back(tid);

}
Esempio n. 14
0
File: file.cpp Progetto: salilab/imp
TextOutput create_temporary_file(std::string prefix, std::string suffix) {
  return TextOutput(create_temporary_file_name(prefix, suffix));
}
Esempio n. 15
0
LogStream::LogStream() : out_(TextOutput(std::cout)) {
  P::push(IndentFilter());
  P::push(LogSink(this));
}