Esempio n. 1
0
/*****************************************************
**
**   TextHelper   ---   writeAstronomicalData
**
******************************************************/
int TextHelper::writeAstronomicalData()
{
	wxString pname;
	int p, ret = 0;

	Calculator *calculator = CalculatorFactory().getCalculator();
	Formatter *f = Formatter::get();
	Lang lang;

	vector<int> obs1 = chartprops->getPlanetList();
	vector<int> obs;
	for ( unsigned int i = 0; i < obs1.size(); i++ )
	{
		if ( obs1[i] < MAX_EPHEM_OBJECTS ) obs.push_back( obs1[i] );
	}

	if ( show_header ) writer->writeHeader1( _( "Astronomical Positions" ));
	Table table( 4, obs.size() + 1 );
	table.setHeader( 0,  _( "Planet" ));
	table.setHeader( 1,  _( "Longitude" ));
	table.setHeader( 2,  _( "Latitute" ));
	table.setHeader( 3,  _( "Speed (deg/day)" ));
	table.col_line[0] = true;
	table.col_alignment[0] = Align::Right;
	table.col_alignment[1] = Align::Right;

	int line = 1;
	for ( unsigned int i = 0; i < obs.size(); i++ )
	{
		p = obs[i];
		if ( horoscope->getTropicalLength( p ) == 0 ) ret++;
		pname = writer->getObjectName( p, TLARGE);
		table.setEntry( 0, line, pname );
		table.setEntry( 1, line, writer->getPosFormatted( horoscope->getTropicalLength( p ), horoscope->isRetrograde( p ), DEG_PRECISION_MORE ));

		if ( p != OASCENDANT && p != OMERIDIAN )
		{
			table.setEntry( 2, line, f->getLatitudeFormatted( horoscope->getLatitude( p ), DEG_PRECISION_MORE ));
			table.setEntry( 3, line, f->getLenFormatted( horoscope->getSpeed( p ), DEG_PRECISION_MORE ));
		}
		line++;
	}
	writer->writeTable( table );

	Table t2( 2, 5 );
	t2.setHeader( 0,  _( "Name" ));
	t2.setHeader( 1,  _( "Value" ));
	writer->writeHeader2( _( "Ayanamsa" ));
	line = 1;
	for ( int i = 0; i < NB_AYANAMSAS; i++ )
	{
		t2.setEntry( 0, line, lang.getAyanamsaName( i+1 ));
		t2.setEntry( 1, line, f->getDegreesFormatted( calculator->calcAyanamsa( horoscope->getJD(), i+1 ), DEG_PRECISION_MORE ));
		line++;
	}
	t2.setEntry( 0, 4, _( "Custom" ) );
	t2.setEntry( 1, 4, f->getDegreesFormatted( calculator->calcAyanamsa( horoscope->getJD(), 4 ), DEG_PRECISION_MORE ));
	writer->writeTable( t2 );
	return ret;
}
Esempio n. 2
0
/*****************************************************
**
**   GenericTableWriter   ---   writeObjectLatitude
**
******************************************************/
void GenericTableWriter::writeObjectLatitude( const uint &i0, const TcColumnSet &set )
{
  table->setHeader( i0,  _( "Declination" ));
	Formatter *f = Formatter::get();
	ObjectPosition pos;
	for ( uint p = 0; p < obs.size(); p++ )
	{
		pos = getObjectPosition( obs[p], set );
		table->setEntry( i0, p + 1, f->getLatitudeFormatted( pos.latitude, DEG_PRECISION_SECOND ));
	}
}
/*****************************************************
**
**   PrintoutHelper   ---   writeBaseData
**
******************************************************/
void PrintoutHelper::writeBaseData( Table *table )
{
	wxString s;
	int line = 1;
	double thetime;
	Formatter *f = Formatter::get();

	DataSet *ds = h->getDataSet();
	Location *loc = ds->getLocation();
	JDate *date = ds->getDate();
	table->setHeader( 0,  _( "Base Data" ), false, 1 );

	table->setEntry( 0, line,  _( "Name" ));
	table->setEntry( 1, line++, h->getHName() );

	table->setEntry( 0, line,  _( "Date" ));
	s << f->getDateStringFromJD( h->getJD() + ( loc->getTimeZone() + loc->getDST() )/24 );
	table->setEntry( 1, line++, s );

	table->setEntry( 0, line,  _( "Local Time" ));
	thetime = a_red( getTimeFromJD( date->getJD()) + loc->getTimeZone() + loc->getDST(), 24 );
	table->setEntry( 1, line++, f->getTimeFormatted( thetime ));

	table->setEntry( 0, line,  _( "Location" ));
	table->setEntry( 1, line++, loc->getLocName() );

	table->setEntry( 0, line,  _( "Longitude" ));
	table->setEntry( 1, line++, f->getLongitudeFormatted( loc->getLongitude()));

	table->setEntry( 0, line,  _( "Latitude" ));
	table->setEntry( 1, line++, f->getLatitudeFormatted( loc->getLatitude()));

	table->setEntry( 0, line,  _( "Time Zone" ));
	double tz = loc->getTimeZone();
	s.Printf( wxT( "%s %c%.1f" ), _( "UT" ), ( tz >= 0 ? '+' : '-' ), tz );
	table->setEntry( 1, line++, s );

	table->setEntry( 0, line,  _( "DST" ));
	s.Printf( wxT( "%.1f" ), loc->getDST());
	table->setEntry( 1, line++, s );

	table->setEntry( 0, line,  _( "UT" ));
	table->setEntry( 1, line++, f->getTimeFormatted( getTimeFromJD( h->getJD() )));
}
Esempio n. 4
0
/*****************************************************
**
**   GenericTableWriter   ---   writeCustomDataEntry
**
******************************************************/
void GenericTableWriter::writeCustomDataEntry( const uint &col, const uint &row, const TAB_CELL_TYPE &type )
{
	assert( table->getNbCols() > col );
	assert( table->getNbRows() > row );
	Formatter *f = Formatter::get();
	DateTimeFormatter *df = DateTimeFormatter::get();
	Lang lang;
	wxString s;
	
	switch( type )
	{
		case TAB_CELL_NAME:
			table->setEntry( col, row,  _( "Name" ));
			table->setEntry( col + 1, row, h->getHName() );
		break;
		case TAB_CELL_FULL_DATE:
		{
			table->setEntry( col, row,  _( "Date" ));
			Location *loc = h->getDataSet()->getLocation();
			table->setEntry( col + 1, row, df->formatDateString( h->getJD(), loc->getTimeZone() + loc->getDST()));
		}
		break;
		case TAB_CELL_LOCAL_TIME:
		{
			table->setEntry( col, row,  _( "Local Time" ));
			Location *loc = h->getDataSet()->getLocation();
			table->setEntry( col + 1, row, f->getTimeFormatted( a_red( getTimeFromJD( h->getDataSet()->getDate()->getJD()) + loc->getTimeZone() + loc->getDST(), 24 )));
		}
		break;
		case TAB_CELL_LOCATION_NAME:
			table->setEntry( col, row,  _( "Location" ));
			table->setEntry( col + 1, row, h->getDataSet()->getLocation()->getLocName() );
		break;
		case TAB_CELL_LOCATION_LONGITUDE:
		{
			table->setEntry( col, row,  _( "Longitude" ));
			Location *loc = h->getDataSet()->getLocation();
			table->setEntry( col + 1, row, f->getLongitudeFormatted( loc->getLongitude()));
		}
		break;
		case TAB_CELL_LOCATION_LATITUDE:
		{
			table->setEntry( col, row,  _( "Latitude" ));
			Location *loc = h->getDataSet()->getLocation();
			table->setEntry( col + 1, row, f->getLatitudeFormatted( loc->getLatitude()));
		}
		break;
		case TAB_CELL_TZ_NAME:
		{
			table->setEntry( col, row,  _( "Time Zone" ));
			Location *loc = h->getDataSet()->getLocation();
			const double tz = loc->getTimeZone();
			table->setEntry( col + 1, row, wxString::Format( wxT( "%s %c%.1f" ), _( "UT" ), ( tz >= 0 ? '+' : ' ' ), tz ));
		}
		break;
		case TAB_CELL_DST:
		{
			table->setEntry( col, row,  _( "Daylight Saving" ));
			Location *loc = h->getDataSet()->getLocation();
			table->setEntry( col + 1, row, wxString::Format( wxT( "%.1f" ), loc->getDST()));
		}
		break;
		case TAB_CELL_UNIVERSAL_TIME:
			table->setEntry( col, row,  _( "Universal Time" ));
			table->setEntry( col + 1, row, f->getTimeFormatted( getTimeFromJD( h->getJD() )));
		break;
		case TAB_CELL_SIDEREAL_TIME:
			table->setEntry( col, row,  _( "Sidereal Time" ));
			table->setEntry( col + 1, row, f->getTimeFormatted( h->getSiderealTime()));
		break;
		case TAB_CELL_JULIAN_DATE:
			table->setEntry( col, row,  _( "Julian Date" ));
			table->setEntry( col + 1, row, wxString::Format( wxT( "%8.5f" ), h->getJD()));
		break;
		case TAB_CELL_SUNRISE:
		{
			table->setEntry( col, row,  _( "Sunrise" ));
			Location *loc = h->getLocation();
			if ( h->getSunrise() != 0 )
			{
				s = f->getTimeFormatted( getTimeFromJD( h->getSunrise() + ( loc->getTimeZone() + loc->getDST()) / 24.0 ));
			}
			else s = _( "n.a." );
			table->setEntry( col + 1, row, s );
		}
		break;
		case TAB_CELL_SUNSET:
		{
			table->setEntry( col, row,  _( "Sunset" ));
			Location *loc = h->getLocation();
			if ( h->getSunset() != 0 )
			{
				s = f->getTimeFormatted( getTimeFromJD( h->getSunset() + ( loc->getTimeZone() + loc->getDST()) / 24.0 ));
			}
			else s = _( "n.a." );
			table->setEntry( col + 1, row, s );
		}
		break;
		case TAB_CELL_VEDIC_AYANAMSA:
			table->setEntry( col, row,  _( "Vedic Ayanamsa" ));
			table->setEntry( col + 1, row, f->getAyanamsaNameAndValue( h->getAyanamsaType( true ), h->getAyanamsa( true )));
		break;
		case TAB_CELL_WESTERN_AYANAMSA:
			table->setEntry( col, row,  _( "Western Ayanamsa" ));
			table->setEntry( col + 1, row, f->getAyanamsaNameAndValue( h->getAyanamsaType( false ), h->getAyanamsa( false )));
		break;
		case TAB_CELL_VARNA:
			table->setEntry( col, row,  _( "Varna" ));
			table->setEntry( col + 1, row, lang.getVarnaName( getVarna( h->getVedicLongitude( OMOON ))));
		break;
		case TAB_CELL_GANA:
			table->setEntry( col, row,  _( "Gana" ));
			table->setEntry( col + 1, row, lang.getGanaName( NakshatraExpert().getGana( h->getVedicLongitude( OMOON ))));
		break;
		case TAB_CELL_YONI:
		{
			Yoni yoni = NakshatraExpert().getYoni( h->getVedicLongitude( OMOON ));
			table->setEntry( col, row,  _( "Yoni" ));
			table->setEntry( col + 1, row, yoni.name );
		}
		break;
		case TAB_CELL_NADI:
			table->setEntry( col, row,  _( "Nadi" ));
			table->setEntry( col + 1, row, lang.getNadiName( NakshatraExpert().getNadi( h->getVedicLongitude( OMOON ))));
		break;
		case TAB_CELL_RAJJU:
		{
			Rajju rajju = NakshatraExpert().getRajju( getNakshatra27( h->getVedicLongitude( OMOON )));
			table->setEntry( col, row,  _( "Rajju" ));
			table->setEntry( col + 1, row, lang.getRajjuName( rajju.aroha, rajju.type ));
		}
		break;
		case TAB_CELL_INCFLUENCE_TIME:
		{
			DasaExpert *expert = DasaExpertFactory().getDasaExpert( D_VIMSOTTARI, h );
			table->setEntry( col, row,  _( "Influence" ));
			table->setEntry( col + 1, row, expert->getDasaLordNameF( expert->getBirthMahaDasaLord(), TF_LONG ));
		}
		break;

		case TAB_CELL_LUNAR_TITHI:
		{
			double angle = red_deg( h->getVedicLongitude( OMOON ) - h->getVedicLongitude( OSUN ));
			table->setEntry( col, row,  _( "Lunar Tithi" ));
			table->setEntry( col + 1, row,  lang.getTithiName( angle / 12 ));
		}
		break;
		case TAB_CELL_WEEKDAY:
			table->setEntry( col, row,  _( "Weekday" ));
			table->setEntry( col + 1, row,  lang.getWeekdayName( h->getDataSet()->getWeekDay() ));
		break;

		case TAB_CELL_HORA_LORD:
		case TAB_CELL_DINA_LORD:
		case TAB_CELL_MASA_LORD:
		case TAB_CELL_VARSHA_LORD:
			writeHoraEntry( col, row, type );
		break;
		default:
			table->setEntry( col, row,  wxString::Format( wxT( "Error, wrong custom data entry id %d" ), (int)type ));
		break;
	};
}
Esempio n. 5
0
/*****************************************************
**
**   TextHelper   ---   writeBaseData
**
******************************************************/
void TextHelper::writeBaseData()
{
	wxString s;
	double time;

	Formatter *f = Formatter::get();
	Lang lang;

	DataSet *ds = horoscope->getDataSet();
	Location *loc = ds->getLocation();
	JDate *date = ds->getDate();

	if ( show_header ) writer->writeHeader1( _( "Base Data" ));
	Table table( 2, 17 );

	int line = 0;
	table.setEntry( 0, line,  _( "Name" ));
	table.setEntry( 1, line++, horoscope->getHName() );

	table.setEntry( 0, line,  _( "Date" ));
	s << f->getDateStringFromJD( horoscope->getJD() + ( loc->getTimeZone() + loc->getDST() )/24 )
	<< wxT( " " ) << lang.getWeekdayName( ds->getWeekDay() );
	table.setEntry( 1, line++, s );

	table.setEntry( 0, line,  _( "Local Time" ));
	time = a_red( getTimeFromJD( date->getJD()) + loc->getTimeZone() + loc->getDST(), 24 );
	table.setEntry( 1, line++, f->getTimeFormatted( time ));

	table.setEntry( 0, line,  _( "Location" ));
	table.setEntry( 1, line++, loc->getLocName() );

	table.setEntry( 0, line,  _( "Longitude" ));
	table.setEntry( 1, line++, f->getLongitudeFormatted( loc->getLongitude()));

	table.setEntry( 0, line,  _( "Latitude" ));
	table.setEntry( 1, line++, f->getLatitudeFormatted( loc->getLatitude()));

	table.setEntry( 0, line,  _( "Time Zone" ));
	double tz = loc->getTimeZone();
	s.Printf( wxT( "%s %c%.1f %s" ), _( "UT" ), ( tz >= 0 ? '+' : ' ' ), tz, _( "Hours" ));
	table.setEntry( 1, line++, s );

	table.setEntry( 0, line,  _( "Daylight Saving" ));
	s.Printf( wxT( "%.1f %s" ), loc->getDST(), _( "Hours" ));
	table.setEntry( 1, line++, s );

	table.setEntry( 0, line,  _( "Universal Time" ));
	table.setEntry( 1, line++, f->getTimeFormatted( getTimeFromJD( horoscope->getJD() )));

	table.setEntry( 0, line,  _( "Sidereal Time" ));
	table.setEntry( 1, line++, f->getTimeFormatted( horoscope->getSiderealTime()));

	table.setEntry( 0, line,  _( "Julian Date" ));
	s.Printf( wxT( "%8.5f" ), horoscope->getJD());
	table.setEntry( 1, line++, s );

	table.setEntry( 0, line,  _( "Vedic Ayanamsa" ));
	table.setEntry( 1, line++, lang.getAyanamsaName( horoscope->getAyanamsaType( true ) ));

	table.setEntry( 0, line,  _( "Ayanamsa Value" ));
	table.setEntry( 1, line++, f->getDegreesFormatted( horoscope->getAyanamsa( true )));

	table.setEntry( 0, line,  _( "Western Ayanamsa" ));
	table.setEntry( 1, line++, lang.getAyanamsaName( horoscope->getAyanamsaType( false )));

	table.setEntry( 0, line,  _( "Ayanamsa Value" ));
	table.setEntry( 1, line++, f->getDegreesFormatted( horoscope->getAyanamsa( false )));

	table.setEntry( 0, line,  _( "Sunrise" ));
	if ( horoscope->getSunrise() != 0 )
		s = f->getFullDateStringFromJD( horoscope->getSunrise() + ( loc->getTimeZone() + loc->getDST() ) / 24.0 );
	else s = _( "n.a." );
	table.setEntry( 1, line++, s );

	table.setEntry( 0, line,  _( "Sunset" ));
	if ( horoscope->getSunset() != 0 )
		s = f->getFullDateStringFromJD( horoscope->getSunset() + ( loc->getTimeZone() + loc->getDST() ) / 24.0 );
	else s = _( "n.a." );
	table.setEntry( 1, line++, s );

	writer->writeTable( table );
}
Esempio n. 6
0
/*****************************************************
**
**   TextHelper   ---   writeWesternPlanets
**
******************************************************/
int TextHelper::writeWesternPlanets()
{
	wxString s;
	Formatter *f = Formatter::get();
	int pindex, line, j, ret = 0;
	int numcols, numrows;
	bool opt_housepos = false;
	bool opt_declination = false;
	ObjectPosition pos;
	int actcol = 0;

	numcols = 2;
	int wstyle = chartprops->getWesternMainStyle();
	if ( wstyle & MAIN_CHILD_SHOW_HOUSEPOS ) {
		opt_housepos = true;
		numcols++;
	}
	if ( wstyle & MAIN_CHILD_SHOW_DECLINATION ) {
		opt_declination = true;
		numcols++;
	}

	vector<int> obs = chartprops->getWesternPlanetList();

	numrows = obs.size() + 1;
	if ( wstyle & MAIN_CHILD_SHOW_HOUSES ) numrows += 4;
	Table table( numcols, numrows );
	table.setHeader( actcol++,  _( "Planet" ));
	table.setHeader( actcol++,  _( "Length" ));
	if ( opt_declination ) table.setHeader( actcol++, _( "Declination" ));
	if ( opt_housepos ) table.setHeader( actcol++, _( "House" ));

	line = 1;
	for ( unsigned int i = 0; i < obs.size(); i++ )
	{
		actcol = 0;
		pindex = obs[i];
		assert( (int)table.nb_rows >= line );

		pos = horoscope->getObjectPosition( pindex, false );
		// pos.length is 0 for unclaculated planets because Ayanamsa isn't subtracted in that case
		if ( pos.length == 0 && pindex != OARIES ) ret++;

		table.setEntry( actcol++, line, writer->getObjectName( pindex, TLARGE ));
		table.setEntry( actcol++, line, writer->getPosFormatted( pos.length, pos.retro ));

		// Declination
		if ( opt_declination ) table.setEntry( actcol++, line, f->getLatitudeFormatted( pos.latitude, DEG_PRECISION_SECOND ));

		// Houses 2, 3, 11, 12. AS and MC are separate params
		if ( opt_housepos )
		{
			assert( table.nb_cols > 0 );
			s.Printf( wxT( "%d" ), horoscope->getHousePos( pindex, false ) + 1 );
			table.setEntry( actcol++, line, s );
		}
		line++;
	}
	if ( wstyle & MAIN_CHILD_SHOW_HOUSES )
	{
		for ( j = 0; j < 12; j++ )
		{
			if (( j == HOUSE1 ) || ( j == HOUSE4 ) || ( j == HOUSE5 ) || ( j == HOUSE6 )
			        || ( j == HOUSE7 ) || ( j == HOUSE8 ) || ( j == HOUSE9 ) || ( j == HOUSE10 )
			   ) continue;
			assert( (int)table.nb_rows > line );
			s.Printf( wxT( "%02d" ), j+1 );
			table.setEntry( 0, line, s );
			table.setEntry( 1, line, writer->getPosFormatted( horoscope->getHouse(j, false), false ));
			line++;
		}
	}
	writer->writeTable( table );
	return ret;
}
Esempio n. 7
0
/*****************************************************
**
**   TextHelper   ---   writeVedicPlanets
**
******************************************************/
int TextHelper::writeVedicPlanets()
{
#define HOUSE_QUALIFIER 1000
	wxString s;
	int pindex, rowindex = 1, shast, col = 1, p, ret = 0;
	int numcols;
	unsigned int i;
	ObjectPosition pos;
	Formatter *f = Formatter::get();
	Lang lang;

	int nakshatramode =  ( config->vNakshatraMode28 ? N28 : N27 );
	VargaHoroscope chart( horoscope, VARGA_RASI );
	VargaHoroscope bchart( horoscope, VARGA_BHAVA );
	JaiminiExpert expert( &chart );
	AshtakavargaExpert aexpert( &chart );
	Planet *planet;
	int istyle = chartprops->getVedicMainStyle();

	int extraObjects = 0;
	if ( chartprops->getVedicObjectStyle() & OBJECTS_INCLUDE_D9_LAGNA ) extraObjects |= OBJECTS_INCLUDE_D9_LAGNA;
	vector<int> obs = chartprops->getVedicPlanetList( extraObjects );

	int opt_lord, opt_dig, opt_nav, opt_kara, opt_shast, opt_nak, opt_dasa, opt_bha, opt_kp, opt_ashtaka, opt_pada,
	opt_houses, opt_declinations;

	opt_lord = opt_dig = opt_nav = opt_kara = opt_shast = opt_nak = opt_dasa = opt_bha = opt_kp = opt_ashtaka = opt_pada
	                               = opt_houses = opt_declinations = 0;

	numcols = 2;
	if ( istyle & MAIN_CHILD_SHOW_LORD        ) {
		opt_lord = true;
		numcols++;
	}
	if ( istyle & MAIN_CHILD_SHOW_DIGNITY     ) {
		opt_dig = true;
		numcols++;
	}
	if ( istyle & MAIN_CHILD_SHOW_NAVAMSA     ) {
		opt_nav = true;
		numcols++;
	}
	if ( istyle & MAIN_CHILD_SHOW_KARAKA      ) {
		opt_kara = true;
		expert.calcCharaKarakas();
		numcols++;
	}
	if ( istyle & MAIN_CHILD_SHOW_SHASTIAMSA  ) {
		opt_shast = true;
		numcols++;
	}
	if ( istyle & MAIN_CHILD_SHOW_NAKSHATRA   ) {
		opt_nak = true;
		numcols++;
	}
	if ( istyle & MAIN_CHILD_SHOW_DASAVARGA   ) {
		opt_dasa = true;
		numcols++;
	}
	if ( istyle & MAIN_CHILD_SHOW_HOUSEPOS    ) {
		opt_bha = true;
		numcols++;
	}
	if ( istyle & MAIN_CHILD_SHOW_ASHTAKA     ) {
		opt_ashtaka = true;
		aexpert.update();
		numcols += 1;
	}
	if ( istyle & MAIN_CHILD_SHOW_PADA        ) {
		opt_pada = true;
		numcols += 1;
	}
	if ( istyle & MAIN_CHILD_SHOW_KP          ) {
		opt_kp = true;
		horoscope->updateKP( 0 );
		numcols += 3;
	}
	if ( istyle & MAIN_CHILD_SHOW_DECLINATION ) {
		opt_declinations = true;
		numcols ++;
	}

	if ( istyle & MAIN_CHILD_SHOW_HOUSES )
	{
		opt_houses = true;
		for ( i = HOUSE1; i <= HOUSE12; i++ ) obs.push_back( i + HOUSE_QUALIFIER );
	}

	Table table( numcols, obs.size() + 1 );
	table.setHeader( 0,  _( "Planet" ));
	table.setHeader( 1,  _( "Length" ));
	i = 2;
	if ( opt_declinations ) table.setHeader( i++, _( "Declination" ));
	if ( opt_lord ) table.setHeader( i++, _( "Lord" ));
	if ( opt_dig ) table.setHeader( i++, _( "Dignity" ));
	if ( opt_nav ) table.setHeader( i++, _( "D-9" ));
	if ( opt_nak ) table.setHeader( i++, _( "Nakshatra" ));
	if ( opt_pada ) table.setHeader( i++, _( "Pada" ));
	if ( opt_kp )
	{
		table.setHeader( i++, _( "KP Lord" ));
		table.setHeader( i++, _( "Sublord" ));
		table.setHeader( i++, _( "Subsublord" ));
	}
	if ( opt_shast ) table.setHeader( i++, _( "Shastiamsa" ));
	if ( opt_dasa ) table.setHeader( i++, _( "Dasa Varga" ));
	if ( opt_bha ) table.setHeader( i++, _( "Bhava" ));
	if ( opt_kara ) table.setHeader( i++, _( "Karaka" ));
	if ( opt_ashtaka ) table.setHeader( i++, _( "AV" ));

	for ( i = 0; i < obs.size(); i++ )
	{
		pindex = obs[i];

		if ( pindex >= HOUSE_QUALIFIER )
		{
			pos.length = horoscope->getHouse( pindex - HOUSE_QUALIFIER, true, false );
			pos.latitude = 0;
			pos.retro = false;
		}
		else
		{
			pos = horoscope->getObjectPosition( pindex, true );

			// pos.length is 0 for unclaculated planets because Ayanamsa isn't subtracted in that case
			if ( pos.length == 0 && pindex != OARIES ) ret++;
		}

		planet = 0;
		col = 2;
		assert( (int)table.nb_rows >= rowindex );

		table.setEntry( 0, rowindex,
		                ( pindex <= LAST_ARABIC_OBJECT ? writer->getObjectName( pindex, TLARGE, true ) : lang.getBhavaName( pindex - HOUSE_QUALIFIER )));
		if ( pindex <= OSATURN ) planet = horoscope->getPlanet( pindex );

		table.setEntry( 1, rowindex, writer->getPosFormatted( pos.length, pos.retro ));

		// Declination
		if ( opt_declinations )
			table.setEntry( col++, rowindex, f->getLatitudeFormatted( pos.latitude, DEG_PRECISION_SECOND ));

		// Lord
		if ( opt_lord )
			table.setEntry( col++, rowindex, writer->getObjectName( getLord( getRasi( pos.length )), TLARGE, true ));

		// Dignity
		if ( opt_dig )
		{
			if ( pindex >= OSUN && pindex <= OSATURN && obs[i] < MAX_EPHEM_OBJECTS )
				table.setEntry( col, rowindex, lang.getDignityName( horoscope->getVargaData( pindex, VARGA_RASI )->getDignity(), TLARGE ));
			col++;
		}

		// Navamsa
		if ( opt_nav )
			table.setEntry( col++, rowindex, writer->getSignName( getRasi( pos.length * 9 ), config->signPrecision ));

		// Nakshatra
		if ( opt_nak )
			table.setEntry( col++, rowindex,
			                lang.getNakshatraName( getNakshatra( pos.length, nakshatramode ), nakshatramode, TMEDIUM ));

		// Pada
		if ( opt_pada )
		{
			s.Printf( wxT( "%d" ), (int)(getNakshatraLength( pos.length, nakshatramode ) / 3.3333333333 ) + 1 );
			table.setEntry( col++, rowindex, s );
		}

		// Krishnamurti
		if ( opt_kp )
		{
			KpData kp;
			if ( pindex <= LAST_ARABIC_OBJECT )
			{
				kp = horoscope->getKPLords( obs[i] );
			}
			else
			{
				kp = horoscope->getHouseKPLords( pindex - HOUSE_QUALIFIER );
			}
			table.setEntry( col++, rowindex, writer->getObjectName( kp.lord, TLARGE, true ));
			table.setEntry( col++, rowindex, writer->getObjectName( kp.sublord, TLARGE, true ));
			table.setEntry( col++, rowindex, writer->getObjectName( kp.subsublord, TLARGE, true ));
		}

		// Shastiamsa
		if ( opt_shast )
		{
			shast = (int)( a_red( pos.length, 30 ) * 2 );
			if ( isEvenRasi( pos.length )) shast = 59 - shast;
			assert( shast >= 0 && shast < 60 );
			s.Printf( wxT( "%s (%c)" ), (const wxChar*)lang.getShastiamsaName( shast),
			          ( k_shastiamsa_benefic[(int)shast] ? 'B' : 'M' ));
			table.setEntry( col, rowindex, s );
			col++;
		}

		// Dasavarga Dignity
		if ( opt_dasa )
		{
			if ( pindex <= OSATURN  && obs[i] < MAX_EPHEM_OBJECTS )
			{
				VargaExpert expert;
				table.setEntry( col, rowindex, lang.getVimsopakaDignityName( 2, planet->getVimsopakaBalaGoodVargas( 2 )) );
			}
			col++;
		}

		// Bhava
		if ( opt_bha  && obs[i] <= MAX_EPHEM_OBJECTS )
		{
			s.Printf( wxT( "%d" ), red12( bchart.getRasi( pindex ) - bchart.getRasi( OASCENDANT )) + 1 );
			table.setEntry( col++, rowindex, s );
		}

		// Karaka
		if ( opt_kara )
		{
			if ( pindex <= OSATURN ) p = pindex;
			else if ( pindex == OMEANNODE || pindex == OTRUENODE ) p = 7;
			else p = -1;
			if ( p >= 0 ) table.setEntry( col, rowindex, lang.getKarakaName( expert.getCharaKarakaProperty( p )) );
			col++;
		}


		// Ashtaka Varga
		if ( opt_ashtaka )
		{
			if ((( pindex >= OSUN && pindex <= OSATURN ) || pindex == OASCENDANT )  && obs[i] <= MAX_EPHEM_OBJECTS )
			{
				s.Printf( wxT( "%d" ), aexpert.getItem( REKHA, pindex, getRasi( pos.length )));
				table.setEntry( col++, rowindex, s );
			}
			col++;
		}
		rowindex++;
	}
	writer->writeTable( table );
	return ret;
}