Exemplo 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;
}
Exemplo n.º 2
0
/*****************************************************
**
**   PrintoutHelper   ---   writeHouse
**
******************************************************/
void PrintoutHelper::writeHouse( Table *table, const int &row, const int &line, const int& house, const bool &vedic )
{
	double len;
	wxString s;
	Lang lang;
	Formatter *formatter = Formatter::get();

	if ( config->useVedicPlanetNames ) s = lang.getBhavaName( house - 1 );
	else s.Printf( wxT( "%02d" ), house );
	table->setEntry( row, line, s );

	len = h->getHouse( house - 1, vedic );
	if ( config->useVedicPositions )
		table->setEntry( row + 2, line, writer->getPosFormatted( len, false, DEG_PRECISION_SECOND ), false );
	else
	{
		table->setEntry( row + 2, line, formatter->getLenFormatted( getRasiLen( len ), DEG_PRECISION_MINUTE ));
		table->setEntry( row + 3, line, writer->getSignName( getRasi( len )), config->useSignSymbols );
	}
	if ( vedic )
	{
		KpData kp = h->getHouseKPLords( house - 1 );
		table->setEntry( row + 5, line, writer->getObjectName( kp.lord, TSHORT, true ), config->usePlanetSymbols );
		table->setEntry( row + 6, line, writer->getObjectName( kp.sublord, TSHORT, true ), config->usePlanetSymbols );
		table->setEntry( row + 7, line, writer->getObjectName( kp.subsublord, TSHORT, true ), config->usePlanetSymbols );
	}
}
Exemplo n.º 3
0
/*****************************************************
**
**   PrintoutHelper   ---   writeWesternAspectarium
**
******************************************************/
void PrintoutHelper::writeWesternAspectarium( ChartProperties *props, const int &type )
{
	Formatter *formatter = Formatter::get();
	wxString s;

  AspectExpert expert( h );
	list<AspectEvent> al = expert.update( h, props );

	int numrows = (int)al.size() / 3;
	if ( al.size() % 3 ) numrows++;

	Table table( 12, numrows + 1 );
	table.show_grid = false;

	table.setHeader( 0, _( "Aspect" ), false, 2 );
	table.setHeader( 3, _( "Orbis" ) );
	table.col_line[2] = true;
	table.col_line[3] = true;

	table.setHeader( 4, _( "Aspect" ), false, 2 );
	table.setHeader( 7, _( "Orbis" ) );
	table.col_line[6] = true;
	table.col_line[7] = true;

	table.setHeader( 8, _( "Aspect" ), false, 2 );
	table.setHeader( 11, _( "Orbis" ) );
	table.col_line[10] = true;

	int col = 0;
	int row = 0;
	for ( list<AspectEvent>::iterator iter = al.begin(); iter != al.end(); iter++ )
	{
		table.setEntry( 4 * col, row + 1, writer->getObjectName( (*iter).planet1, TMEDIUM ), config->usePlanetSymbols );

		s = AspectExpert::getAspectSymbol( (*iter).aspectType );
    if ( s.IsEmpty())
    {
      s = AspectExpert::getAspectShortDescription( (*iter).aspectType );
			table.setEntry( 4 * col + 1, row + 1, s, false );
    }
		else
		{
			table.setEntry( 4 * col + 1, row + 1, s, true );
		}
		table.setEntry( 4 * col + 2, row + 1, writer->getObjectName( (*iter).planet2, TMEDIUM ), config->usePlanetSymbols );
		table.setEntry( 4 * col + 3, row + 1,  formatter->getLenFormatted( (*iter).orbis, DEG_PRECISION_MINUTE ), false );

		row++;
		if ( row >= numrows )
		{
			col++;
			row = 0;
		}
	}
	writer->writeTable( table, true );
}
Exemplo n.º 4
0
/*****************************************************
**
**   GenericTableWriter   ---   write45DegreeLongitude
**
******************************************************/
void GenericTableWriter::write45DegreeLongitude( const uint &colid, const TcColumnSet &set )
{
	assert( table->getNbCols() >= colid + 1 );
	assert( table->getNbRows() > obs.size());
	Formatter *formatter = Formatter::get();

	table->setHeader( colid,  _( "45 Degree" ));
	for ( uint p = 0; p < obs.size(); p++ )
	{
		table->setEntry( colid, p + 1, formatter->getLenFormatted( a_red( getObjectPosition( obs[p], set ).longitude, 45.0 )));
		if ( IS_EPHEM_OBJECT( obs[p] ) && h->getTropicalLongitude( obs[p] ) == 0 ) table->errorcount++;
	}
}
Exemplo n.º 5
0
/*****************************************************
**
**   PrintoutHelper   ---   writePlanetaryObject
**
******************************************************/
void PrintoutHelper::writePlanetaryObject( Table *table, const int& row, const int &line, const int& i, const bool& withHouse, const bool &vedic, const bool cutname )
{
	wxString s;
	Formatter *formatter = Formatter::get();
	ObjectPosition pos = h->getObjectPosition( i, vedic );

	table->setEntry( row, line, writer->getObjectName( i, TMEDIUM, true ), config->usePlanetSymbols );
	if ( pos.retro ) table->setEntry( row + 1, line, ( config->usePlanetSymbols ? wxT( "_" ) : wxT( "R" )), config->usePlanetSymbols );

	if ( config->useVedicPositions )
		table->setEntry( row + 2, line, writer->getPosFormatted( pos.length, pos.retro, DEG_PRECISION_SECOND ), false );
	else
	{
		table->setEntry( row + 2, line, formatter->getLenFormatted( getRasiLen( pos.length )), false );
		table->setEntry( row + 3, line, writer->getSignName( getRasi( pos.length ), cutname ? TSHORT : TMEDIUM ), config->useSignSymbols );
	}
	if ( withHouse )
	{
		s.Printf( wxT( "%02d" ), h->getHousePos( i, vedic ) + 1 );
		table->setEntry( row + 4, line, s );
	}
}