예제 #1
0
/*****************************************************
**
**   MainWindowStatusbar   ---   OnPlanetTimer
**
******************************************************/
void MainWindowStatusbar::OnPlanetTimer( wxTimerEvent& )
{
	wxString t0, t1;
	double mlen, asclen, dummy, nakportion;
	Lang lang;
	Calculator *calculator = CalculatorFactory().getCalculator();
	DataSet d;
	SheetFormatter fmt;

	d.setCurrentDate();
	d.setLocation( *config->defaultLocation );
	asclen = calculator->calcAscendantAya( d.getJD(), d.getLocation()->getLatitude(),
		d.getLocation()->getLongitude(), config->preferVedic );

	calculator->calcPosition( &d, OMOON, mlen, dummy, true, config->preferVedic );

	t0 << fmt.fragment2PlainText( fmt.getObjectName( OASCENDANT, TF_MEDIUM ))
	 << SPACE
	 << fmt.fragment2PlainText( fmt.getPosFormatted( asclen ));
	SetStatusText( t0, 0 );

	t1 << fmt.fragment2PlainText( fmt.getObjectName( OMOON, TF_MEDIUM ))
	 << SPACE
	 << fmt.fragment2PlainText( fmt.getPosFormatted( mlen ));
	if ( config->preferVedic )
	{
		nakportion = (int)(getNakshatraLongitude27( mlen ) * 10000 /NAKSHATRA_LEN );
		nakportion /= 100;

		t1 << SPACE << nakportion << wxT( "%" ) << SPACE
			<< lang.getNakshatra27Name( ::getNakshatra27( mlen ), TF_MEDIUM );
	}
	SetStatusText( t1, 1 );
}
예제 #2
0
/*****************************************************
**
**   GenericTableWriter   ---   writeNakshatras
**
******************************************************/
void GenericTableWriter::writeNakshatras( const uint &i0, const TcColumnSet &set )
{
	Lang lang;
  //table->setHeader( i0, _( "Nakshatra" ));
  wxString header = _( "Nakshatra" );
	if ( format == TF_SHORT ) header = header.Left( 3 );
  table->setHeader( i0, header );
	assert( table->getNbRows() > obs.size() );

	for ( uint p = 0; p < obs.size(); p++ )
	{
		table->setEntry( i0, p + 1,
			lang.getNakshatra27Name( ::getNakshatra27( getObjectPosition( obs[p], set ).longitude ), format ));
	}
}