Beispiel #1
0
/*****************************************************
**
**   EphemExpert   ---   writeHeaderInfo
**
******************************************************/
void EphemExpert::writeHeaderInfo( Writer *writer )
{
	if ( ! show_header ) return;

	Lang lang;
	wxString s;
	s.Printf( wxT ( "%s %d" ), (const wxChar*)lang.getMonthName( month-1 ), year );
	writer->writeHeader1( s );
}
Beispiel #2
0
/*****************************************************
**
**   EphemExpert   ---   writeDetails
**
******************************************************/
void EphemExpert::writeDetails( Writer *writer )
{
	int i;
	wxString s, tz_str, thetime;
	Lang lang;
	Formatter *formatter = Formatter::get();
	TzUtil tzu;

	if ( ! cdetails ) calcDetails();

	s.Printf( wxT ( "%s %d" ), (const wxChar*)lang.getMonthName( month-1 ), year );
	writer->writeHeader1( s );

	int line = 1;
	int nb_leaps = 0;
	for ( i = 0; i < nb_days; i++ )
	{
		if ( i > 0 && weekday[i] == 0 ) nb_leaps++;
	}
	Table table( 5, nb_days+1+nb_leaps );
	table.setHeader( 0, _( "Day" ));
	table.setHeader( 1, _( "Sidereal Time" ));
	table.setHeader( 2, _( "Sunrise" ));
	table.setHeader( 3, _( "Sunset" ));
	table.setHeader( 4, _( "Tithi (Sunrise)" ));

	line = 1;
	for ( i = 0; i < nb_days; i++ )
	{
		// blank line on weekend
		if ( i > 0 && weekday[i] == 0 )
		{
			for ( int j = 0; j < 5; j++ ) table.setHeaderEntry( j, line, wxEmptyString );
			line++;
		}

		s.Printf( wxT( "%02d %s" ), i+1, (const wxChar*)lang.getWeekdayName( weekday[i] ).Left(2) );
		if ( testDayIndexForCurrent( i+1 )) table.setHeaderEntry( 0, line, s );
		else	table.setEntry( 0, line, s );

		table.setEntry( 1, line, formatter->getTimeFormatted( st[i] ) );

		TzFormattedDate fd = tzu.getDateFormatted( sunrise[i], isLocaltime );
		thetime = fd.timeFormatted;
		//if ( dstchange ) thetime << wxT( " " ) << fd.timezoneFormatted;
		table.setEntry( 2, line, thetime );

		fd = tzu.getDateFormatted( sunset[i], isLocaltime );
		table.setEntry( 3, line, fd.timeFormatted );

		table.setEntry( 4, line, lang.getTithiName( tithi[i] ));
		line++;
	}
	writer->writeTable( table );
}