Exemple #1
0
void CSyntaxDlg::OnGenerate() 
{
  	CStdioFile rfile( m_strTagPath,  CFile::modeRead | CFile::typeText );
	CArchive rar( & rfile, CArchive::load );
	if( m_bTitles )
		ProcessTitles( rar ); 
	else
		ProcessText( rar );
	rar.Close();	
	rfile.Close();
	WriteReportFile();
	m_strTagPath = "";
	EnableControls( FALSE );
	GetDlgItem( IDC_SYN_FILENAME )->SetWindowText( "Keine Datei ausgewählt" );
}
int main( int argc, char* argv[] )
{
/* ------------------ */
/* Parse command line */
/* ------------------ */

	gArgs.SetCmdLine( argc, argv );

	TS.SetLogFile( flog );

/* ---------------- */
/* Read source file */
/* ---------------- */

	int		isrickfile = !FileIsExt( gArgs.infile, ".xml" );

	if( isrickfile )
		TS.FillFromRickFile( gArgs.infile, gArgs.zmin, gArgs.zmax );
	else
		TS.FillFromTrakEM2( gArgs.infile, gArgs.zmin, gArgs.zmax );

	fprintf( flog, "Got %d images.\n", (int)TS.vtil.size() );

	if( !TS.vtil.size() )
		goto exit;

	if( isrickfile )
		TS.SetTileDimsFromImageFile();

	TS.SortAll_z_id();

	ismrc = FileIsExt( TS.vtil[0].name.c_str(), ".mrc" );

	if( ismrc )
		Make_nmrc_paths();

/* ----------- */
/* Diagnostics */
/* ----------- */

	if( isrickfile || ismrc ) {

		TS.WriteTrakEM2_EZ( "PreClicks.xml",
			gArgs.xml_type, gArgs.xml_min, gArgs.xml_max );
	}

	if( gArgs.clk ) {

		TS.ApplyClix( tsClixAffine, gArgs.clk );

		TS.WriteTrakEM2_EZ( "PostClicks.xml",
			gArgs.xml_type, gArgs.xml_min, gArgs.xml_max );
	}

/* ----------------------- */
/* Just make generator xml */
/* ----------------------- */

	if( !gArgs.outdir[0] || !strcmp( gArgs.outdir, "NoSuch" ) )
		goto exit;

/* --------------- */
/* Create dir tree */
/* --------------- */

	CreateTopDir();

	WriteImageparamsFile();
	CopyCropFile();
	CopyLensFile();

	if( !gArgs.NoFolds || ismrc ) {
		WriteSubfmFile();
		WriteReportFile();
	}

	ForEachLayer();

/* ---- */
/* Done */
/* ---- */

exit:
	fprintf( flog, "\n" );
	fclose( flog );

	return 0;
}