Commit e7e88e17 authored by Akarsh Simha's avatar Akarsh Simha
Browse files

Cosmetics

parent b91a0c37
......@@ -47,7 +47,7 @@ DeepStarComponent::DeepStarComponent( SkyComposite *parent, QString fileName, fl
ListComponent(parent),
m_reindexNum( J2000 ),
triggerMag( trigMag ),
m_FaintMagnitude(-5.0),
m_FaintMagnitude(-5.0),
staticStars( staticstars ),
dataFileName( fileName )
{
......@@ -108,7 +108,7 @@ bool DeepStarComponent::loadStaticStars() {
if( !SB )
qDebug() << "ERROR: Could not allocate new StarBlock to hold shallow unnamed stars for trixel " << trixel << endl;
m_starBlockList.at( trixel )->setStaticBlock( SB );
for(unsigned long j = 0; j < (unsigned long) starReader.getRecordCount(i); ++j) {
bool fread_success = false;
if( starReader.guessRecordSize() == 32 )
......@@ -120,7 +120,7 @@ bool DeepStarComponent::loadStaticStars() {
qDebug() << "ERROR: Could not read starData structure for star #" << j << " under trixel #" << trixel << endl;
}
/* Swap Bytes when required */
/* Swap Bytes when required */
if( starReader.getByteSwap() ) {
if( starReader.guessRecordSize() == 32 )
byteSwap( &stardata );
......@@ -175,7 +175,7 @@ bool openIndexFile( ) {
return 0;
}
//This function is empty for a reason; we override the normal
//This function is empty for a reason; we override the normal
//update function in favor of JiT updates for stars.
void DeepStarComponent::update( KSNumbers * )
{}
......@@ -253,15 +253,15 @@ void DeepStarComponent::draw( SkyPainter *skyp ) {
for( int i = 0; i < m_starBlockList.at( currentRegion )->getBlockCount(); ++i ) {
StarBlock *prevBlock = ( ( i >= 1 ) ? m_starBlockList.at( currentRegion )->block( i - 1 ) : NULL );
StarBlock *block = m_starBlockList.at( currentRegion )->block( i );
if( i == 0 && !m_StarBlockFactory->markFirst( block ) )
qDebug() << "markFirst failed in trixel" << currentRegion;
if( i > 0 && !m_StarBlockFactory->markNext( prevBlock, block ) )
qDebug() << "markNext failed in trixel" << currentRegion << "while marking block" << i;
if( i < m_starBlockList.at( currentRegion )->getBlockCount()
if( i < m_starBlockList.at( currentRegion )->getBlockCount()
&& m_starBlockList.at( currentRegion )->block( i )->getFaintMag() < maglim )
break;
}
}
t_updateCache = t.restart();
......@@ -278,24 +278,24 @@ void DeepStarComponent::draw( SkyPainter *skyp ) {
// Static stars need not execute fillToMag
if( !staticStars && !m_starBlockList.at( currentRegion )->fillToMag( maglim ) && maglim <= m_FaintMagnitude * ( 1 - 1.5/16 ) ) {
qDebug() << "SBL::fillToMag( " << maglim << " ) failed for trixel "
qDebug() << "SBL::fillToMag( " << maglim << " ) failed for trixel "
<< currentRegion << " !"<< endl;
}
t_dynamicLoad += t.restart();
// qDebug() << "Drawing SBL for trixel " << currentRegion << ", SBL has "
// qDebug() << "Drawing SBL for trixel " << currentRegion << ", SBL has "
// << m_starBlockList[ currentRegion ]->getBlockCount() << " blocks" << endl;
for( int i = 0; i < m_starBlockList.at( currentRegion )->getBlockCount(); ++i ) {
StarBlock *block = m_starBlockList.at( currentRegion )->block( i );
// qDebug() << "---> Drawing stars from block " << i << " of trixel " <<
// qDebug() << "---> Drawing stars from block " << i << " of trixel " <<
// currentRegion << ". SB has " << block->getStarCount() << " stars" << endl;
for( int j = 0; j < block->getStarCount(); j++ ) {
StarObject *curStar = block->star( j );
// qDebug() << "We claim that he's from trixel " << currentRegion
// qDebug() << "We claim that he's from trixel " << currentRegion
//<< ", and indexStar says he's from " << m_skyMesh->indexStar( curStar );
if ( curStar->updateID != updateID )
......@@ -312,7 +312,7 @@ void DeepStarComponent::draw( SkyPainter *skyp ) {
}
// DEBUG: Uncomment to identify problems with Star Block Factory / preservation of Magnitude Order in the LRU Cache
// verifySBLIntegrity();
// verifySBLIntegrity();
t_drawUnnamed += t.restart();
}
......@@ -414,7 +414,7 @@ SkyObject* DeepStarComponent::objectNearest( SkyPoint *p, double &maxrad )
#endif
if( !star ) continue;
if ( star->mag() > m_zoomMagLimit ) continue;
double r = star->angularDistanceTo( p ).Degrees();
if ( r < maxrad ) {
oBest = star;
......@@ -431,7 +431,7 @@ SkyObject* DeepStarComponent::objectNearest( SkyPoint *p, double &maxrad )
// different method and should be called after all other
// candidates (eg: DeepSkyObject::objectNearest()) have been
// called.
return oBest;
}
......@@ -512,13 +512,13 @@ bool DeepStarComponent::verifySBLIntegrity() {
faintMag = block->getBrightMag();
// NOTE: Assumes 2 decimal places in magnitude field. TODO: Change if it ever does change
if( block->getBrightMag() != faintMag && ( block->getBrightMag() - faintMag ) > 0.5) {
qDebug() << "Trixel " << trixel << ": ERROR: faintMag of prev block = " << faintMag
qDebug() << "Trixel " << trixel << ": ERROR: faintMag of prev block = " << faintMag
<< ", brightMag of block #" << i << " = " << block->getBrightMag();
integrity = false;
}
if( i > 1 && ( !block->prev ) )
qDebug() << "Trixel " << trixel << ": ERROR: Block" << i << "is unlinked in LRU Cache";
if( block->prev && block->prev->parent == m_starBlockList[ trixel ]
if( block->prev && block->prev->parent == m_starBlockList[ trixel ]
&& block->prev != m_starBlockList[ trixel ]->block( i - 1 ) ) {
qDebug() << "Trixel " << trixel << ": ERROR: SBF LRU Cache linked list seems to be broken at before block " << i << endl;
integrity = false;
......
......@@ -245,7 +245,7 @@ void KSPlanetBase::findPA( const KSNumbers *num ) {
SkyPoint test;
dms newELat( ecLat().Degrees() + 1.0 );
test.setFromEcliptic( num->obliquity(), ecLong(), newELat );
double dx = ra().Degrees() - test.ra().Degrees();
double dx = ra().Degrees() - test.ra().Degrees();
double dy = test.dec().Degrees() - dec().Degrees();
double pa;
if ( dy ) {
......
......@@ -433,7 +433,7 @@ void AltVsTime::processObject( SkyObject *o, bool forceAdd ) {
//restore original position
if ( o->isSolarSystem() ) {
o->updateCoords( oldNum, true, data->geo()->lat(), data->lst(), true );
o->updateCoords( oldNum, true, data->geo()->lat(), data->lst(), true );
delete oldNum;
}
o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
......@@ -1231,7 +1231,7 @@ void AltVsTime::drawGradient(){
p.setClipping(false);
//Add vertical line indicating "now"
//Add vertical line indicating "now"
if( geoLoc )
{
QTime t = geoLoc->UTtoLT( KStarsDateTime::currentDateTimeUtc() ).time(); // convert the current system clock time to the TZ corresponding to geo
......
......@@ -51,7 +51,7 @@ QMap<long double, dms> KSConjunct::findClosestApproach(SkyObject& Object1, KSPla
// qDebug() << Object1.name() << ": RA = " << Object1.ra() -> toHMSString() << "; Dec = " << Object1.dec() -> toDMSString() << "\n";
// qDebug() << Object2.name() << ": RA = " << Object2.ra() -> toHMSString() << "; Dec = " << Object2.dec() -> toDMSString() << "\n";
prevSign = 0;
step0 = (stopJD - startJD) / 4.0; // I'm an idiot for having done this without having the lines that follow -- asimha
// TODO: Work out a solid footing on which one can decide step0. -- asimha
......@@ -68,7 +68,7 @@ QMap<long double, dms> KSConjunct::findClosestApproach(SkyObject& Object1, KSPla
if(Object1.name() == i18n( "Mars" ) || Object2.name() == i18n( "Mars" ))
if (step0 > 10.0)
step0 = 10.0;
if(Object1.name() == i18n( "Venus" ) || Object1.name() == i18n( "Mercury" ) || Object2.name() == i18n( "Mercury" ) || Object2.name() == i18n( "Venus" ))
if(Object1.name() == i18n( "Venus" ) || Object1.name() == i18n( "Mercury" ) || Object2.name() == i18n( "Mercury" ) || Object2.name() == i18n( "Venus" ))
if (step0 > 5.0)
step0 = 5.0;
if(Object1.name() == "Moon" || Object2.name() == "Moon")
......@@ -76,7 +76,7 @@ QMap<long double, dms> KSConjunct::findClosestApproach(SkyObject& Object1, KSPla
step0 = 0.25;
step = step0;
// qDebug() << "Initial Separation between " << Object1.name() << " and " << Object2.name() << " = " << (prevDist.toDMSString());
long double jd = startJD;
......@@ -85,9 +85,9 @@ QMap<long double, dms> KSConjunct::findClosestApproach(SkyObject& Object1, KSPla
while ( jd <= stopJD ) {
int progress = int( 100.0*(jd - startJD)/(stopJD - startJD) );
emit madeProgress( progress );
Dist = findDistance(jd, &Object1, &Object2);
Sign = sgn(Dist - prevDist);
Sign = sgn(Dist - prevDist);
// qDebug() << "Dist = " << Dist.toDMSString() << "; prevDist = " << prevDist.toDMSString() << "; Difference = " << (Dist.Degrees() - prevDist.Degrees()) << "; Step = " << step;
//How close are we to a conjunction, and how fast are we approaching one?
......@@ -97,7 +97,7 @@ QMap<long double, dms> KSConjunct::findClosestApproach(SkyObject& Object1, KSPla
} else { //slow down, we're getting close!
step = step0;
}
if( Sign != prevSign && prevSign == -1) { //all right, we may have just passed a conjunction
if ( step > step0 ) { //mini-loop to back up and make sure we're close enough
// qDebug() << "Entering slow loop: " << endl;
......@@ -106,16 +106,16 @@ QMap<long double, dms> KSConjunct::findClosestApproach(SkyObject& Object1, KSPla
Sign = prevSign;
while ( jd <= stopJD ) {
Dist = findDistance(jd, &Object1, &Object2);
Sign = sgn(Dist - prevDist);
Sign = sgn(Dist - prevDist);
// qDebug() << "Dist=" << Dist.toDMSString() << "; prevDist=" << prevDist.toDMSString() << "; Diff=" << (Dist.Degrees() - prevDist.Degrees()) << "djd=" << (int)(jd - startJD);
if ( Sign != prevSign ) break;
prevDist = Dist;
prevSign = Sign;
jd += step;
}
}
// qDebug() << "Sign = " << Sign << " and " << "prevSign = " << prevSign << ": Entering findPrecise()\n";
if(findPrecise(&extremum, &Object1, &Object2, jd, step, Sign))
if(extremum.second.radians() < maxSeparation.radians())
......@@ -195,7 +195,7 @@ bool KSConjunct::findPrecise(QPair<long double, dms> *out, SkyObject *Object1, K
int KSConjunct::sgn(dms a) {
// Auxiliary function used by the KSConjunct::findClosestApproach(...)
// Auxiliary function used by the KSConjunct::findClosestApproach(...)
// method and the KSConjunct::findPrecise(...) method
return ((a.radians() > 0)?1:((a.radians() < 0)?-1:0));
......
......@@ -99,10 +99,10 @@ void modCalcPlanets::slotComputePosition (void)
// Pointer to hold planet data. Pointer is used since it has to
// hold objects of different type. It's safe to use new/delete
// because exceptions are disallowed.
KSPlanetBase* p = 0;
KSPlanetBase* p = 0;
switch( PlanetComboBox->currentIndex() ) {
case 0 :
case 0 :
p = new KSPlanet(KSPlanetBase::MERCURY); break;
case 1:
p = new KSPlanet(KSPlanetBase::VENUS); break;
......@@ -127,10 +127,10 @@ void modCalcPlanets::slotComputePosition (void)
}
// Show data.
p->findPosition( &num, geoPlace->lat(), &LST, &Earth);
p->EquatorialToHorizontal( &LST, geoPlace->lat());
p->findPosition( &num, geoPlace->lat(), &LST, &Earth);
p->EquatorialToHorizontal( &LST, geoPlace->lat());
showCoordinates( *p );
// Cleanup.
// Cleanup.
delete p;
}
......@@ -356,7 +356,7 @@ void modCalcPlanets::processLines( QTextStream &istream )
} else {
latB = LatBoxBatch->createDms(true);
}
if ( AllRadioBatch->isChecked() || LatCheckBatch->isChecked() )
if ( AllRadioBatch->isChecked() || LatCheckBatch->isChecked() )
lineToWrite += latB.toDMSString() + space;
......@@ -411,7 +411,7 @@ void modCalcPlanets::processLines( QTextStream &istream )
// Delete object
delete kspb;
nline++;
}
......
......@@ -87,7 +87,7 @@ WUTDialog::WUTDialog( QWidget *parent, bool _session, GeoLocation *_geo, KStarsD
QString sGeo = geo->translatedName();
if ( ! geo->translatedProvince().isEmpty() ) sGeo += ", " + geo->translatedProvince();
sGeo += ", " + geo->translatedCountry();
WUT->LocationLabel->setText( i18n( "at %1", sGeo ) );
WUT->LocationLabel->setText( i18n( "at %1", sGeo ) );
WUT->DateLabel->setText( i18n( "The night of %1", QLocale().toString( Evening.date(), QLocale::LongFormat ) ) );
m_Mag = 10.0;
WUT->MagnitudeEdit->setValue( m_Mag );
......@@ -120,7 +120,7 @@ void WUTDialog::makeConnections() {
void WUTDialog::initCategories() {
m_Categories << i18n( "Planets" ) << i18n( "Stars" )
<< i18n( "Nebulae" ) << i18n( "Galaxies" )
<< i18n( "Star Clusters" ) << i18n( "Constellations" )
<< i18n( "Star Clusters" ) << i18n( "Constellations" )
<< i18n( "Asteroids" ) << i18n( "Comets" );
foreach ( const QString &c, m_Categories )
......@@ -484,7 +484,7 @@ void WUTDialog::slotObslist()
void WUTDialog::slotChangeDate() {
// Set the time T0 to the evening of today. This will make life easier for the user, who most probably
// Set the time T0 to the evening of today. This will make life easier for the user, who most probably
// wants to see what's up on the night of some date, rather than the night of the previous day
T0.setTime( QTime( 18, 0, 0 ) ); // 6 PM
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment