Fix incorrectly renamed strings

pull/1/head
Slávek Banko 10 years ago
parent 533b9587fd
commit e8c90f7ea7

@ -83,7 +83,7 @@
<tip category="KStars|Navigation">
<html>
<p>The status bar displays the current sky coordinates of the mouse cursor,
in both Equatorial andQt::Horizontal coordinate systems.
in both Equatorial and Horizontal coordinate systems.
</p>
</html>
</tip>
@ -109,7 +109,7 @@
</tip>
<tip category="KStars|Navigation">
<html>
<p>To switch between Equatorial andQt::Horizontal coordinate
<p>To switch between Equatorial and Horizontal coordinate
systems, use the "View->Coordinates" menu item, or press the spacebar.
</p>
</html>

@ -57,7 +57,7 @@
#include "devicemanager.h"
#include "indistd.h"
LogEdit::LogEdit( TQWidget *parent, const char *name ) : KTextEdit( parent, name )
LogEdit::LogEdit( TQWidget *parent, const char *name ) : KTextEdit( parent, name )
{
setFrameStyle( TQFrame::StyledPanel );
setFrameShadow( TQFrame::Plain );
@ -69,11 +69,11 @@ void LogEdit::focusOutEvent( TQFocusEvent *e ) {
TQWidget::focusOutEvent(e);
}
ClickLabel::ClickLabel( TQWidget *parent, const char *name ) : TQLabel( parent, name )
ClickLabel::ClickLabel( TQWidget *parent, const char *name ) : TQLabel( parent, name )
{}
DetailDialog::DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation *geo,
TQWidget *parent, const char *name ) :
DetailDialog::DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation *geo,
TQWidget *parent, const char *name ) :
KDialogBase( KDialogBase::Tabbed, i18n( "Object Details" ), Close, Close, parent, name ) ,
selectedObject(o), ksw((KStars*)parent), Data(0), Pos(0), Links(0), Adv(0), Log(0)
{
@ -101,7 +101,7 @@ void DetailDialog::createGeneralTab()
{
TQFrame *DataTab = addPage(i18n("General"));
Data = new DetailsDataUI( DataTab, "general_data_tab" );
//Modify colors
Data->Names->setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Highlight ) );
Data->Names->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::HighlightedText ) );
@ -139,7 +139,7 @@ void DetailDialog::createGeneralTab()
TDEGlobal::locale()->formatNumber( s->mag(), 1 ) ) ); //show to tenths place
//distance
if ( s->distance() > 2000. || s->distance() < 0. ) // parallax < 0.5 mas
if ( s->distance() > 2000. || s->distance() < 0. ) // parallax < 0.5 mas
Data->Distance->setText( TQString(i18n("larger than 2000 parsecs", "> 2000 pc") ) );
else if ( s->distance() > 50.0 ) //show to nearest integer
Data->Distance->setText( i18n( "number in parsecs", "%1 pc" ).arg(
@ -158,18 +158,18 @@ void DetailDialog::createGeneralTab()
if ( s->isMultiple() && s->isVariable() ) {
Data->AngSizeLabel->setText( i18n( "the star is a multiple star", "multiple" ) + "," );
Data->AngSize->setText( i18n( "the star is a variable star", "variable" ) );
} else if ( s->isMultiple() )
} else if ( s->isMultiple() )
Data->AngSizeLabel->setText( i18n( "the star is a multiple star", "multiple" ) );
else if ( s->isVariable() )
else if ( s->isVariable() )
Data->AngSizeLabel->setText( i18n( "the star is a variable star", "variable" ) );
break; //end of stars case
case 9: //asteroids [fall through to planets]
case 10: //comets [fall through to planets]
case 2: //planets (including comets and asteroids)
ps = (KSPlanetBase *)selectedObject;
Data->Names->setText( ps->longname() );
//Type is "G5 star" for Sun
if ( ps->name() == "Sun" )
@ -177,7 +177,7 @@ void DetailDialog::createGeneralTab()
else
Data->Type->setText( ps->typeName() );
Data->Constellation->setText( ps->constellation( ksw->data()->csegmentList,
Data->Constellation->setText( ps->constellation( ksw->data()->csegmentList,
ksw->data()->cnameList ) );
//Magnitude: The moon displays illumination fraction instead
@ -191,20 +191,20 @@ void DetailDialog::createGeneralTab()
//Distance from Earth. The moon requires a unit conversion
if ( ps->name() == "Moon" ) {
Data->Distance->setText( i18n("distance in kilometers", "%1 km").arg(
Data->Distance->setText( i18n("distance in kilometers", "%1 km").arg(
TDEGlobal::locale()->formatNumber( ps->rearth()*AU_KM ) ) );
} else {
Data->Distance->setText( i18n("distance in Astronomical Units", "%1 AU").arg(
Data->Distance->setText( i18n("distance in Astronomical Units", "%1 AU").arg(
TDEGlobal::locale()->formatNumber( ps->rearth() ) ) );
}
//Angular size; moon and sun in arcmin, others in arcsec
if ( ps->angSize() ) {
if ( ps->name() == "Sun" || ps->name() == "Moon" )
Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg(
if ( ps->name() == "Sun" || ps->name() == "Moon" )
Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg(
TDEGlobal::locale()->formatNumber( ps->angSize() ) ) );
else
Data->AngSize->setText( i18n("angular size in arcseconds", "%1 arcsec").arg(
Data->AngSize->setText( i18n("angular size in arcseconds", "%1 arcsec").arg(
TDEGlobal::locale()->formatNumber( ps->angSize()*60.0 ) ) );
} else {
Data->AngSize->setText( "--" );
@ -236,7 +236,7 @@ void DetailDialog::createGeneralTab()
if ( ! oname.isEmpty() ) oname += ", ";
oname += "PGC " + TQString("%1").arg( dso->pgc() );
}
if ( ! oname.isEmpty() ) pname += ", " + oname;
Data->Names->setText( pname );
@ -252,20 +252,20 @@ void DetailDialog::createGeneralTab()
Data->Distance->setText( "--" );
//Only show decimal place for small angular sizes
if ( dso->a() > 10.0 )
Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg(
if ( dso->a() > 10.0 )
Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg(
int( dso->a() ) ) );
else if ( dso->a() )
Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg(
else if ( dso->a() )
Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg(
TDEGlobal::locale()->formatNumber( dso->a(), 1 ) ) );
else
else
Data->AngSize->setText( "--" );
break;
}
//Common to all types:
Data->Constellation->setText( selectedObject->constellation( ksw->data()->csegmentList,
Data->Constellation->setText( selectedObject->constellation( ksw->data()->csegmentList,
ksw->data()->cnameList ) );
}
@ -307,7 +307,7 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo
TQVBoxLayout *vlay = new TQVBoxLayout( PosTab, 0, 0 );
vlay->addWidget( Pos );
//Coordinates Section:
//Don't use TDELocale::formatNumber() for the epoch string,
//because we don't want a thousands-place separator!
@ -335,10 +335,10 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo
//Airmass is approximated as the secant of the zenith distance,
//equivalent to 1./sin(Alt). Beware of Inf at Alt=0!
if ( selectedObject->alt()->Degrees() > 0.0 )
Pos->Airmass->setText( TDEGlobal::locale()->formatNumber(
if ( selectedObject->alt()->Degrees() > 0.0 )
Pos->Airmass->setText( TDEGlobal::locale()->formatNumber(
1./sin( selectedObject->alt()->radians() ), 2 ) );
else
else
Pos->Airmass->setText( "--" );
//Rise/Set/Transit Section:
@ -447,10 +447,10 @@ void DetailDialog::createAdvancedTab()
{
// Don't create an adv tab for an unnamed star or if advinterface file failed loading
// We also don't need adv dialog for solar system objects.
if (selectedObject->name() == TQString("star") ||
ksw->data()->ADVtreeList.isEmpty() ||
selectedObject->type() == SkyObject::PLANET ||
selectedObject->type() == SkyObject::COMET ||
if (selectedObject->name() == TQString("star") ||
ksw->data()->ADVtreeList.isEmpty() ||
selectedObject->type() == SkyObject::PLANET ||
selectedObject->type() == SkyObject::COMET ||
selectedObject->type() == SkyObject::ASTEROID )
return;
@ -507,7 +507,7 @@ void DetailDialog::viewLink()
{
TQString URL;
if ( Links->InfoList->currentItem() != -1 &&
if ( Links->InfoList->currentItem() != -1 &&
Links->InfoList->isSelected( Links->InfoList->currentItem() ) )
URL = TQString( *selectedObject->InfoList.at( Links->InfoList->currentItem() ) );
else if ( Links->ImagesList->currentItem() != -1 )
@ -521,11 +521,11 @@ void DetailDialog::updateLists()
{
Links->InfoList->clear();
Links->ImagesList->clear();
TQStringList::Iterator itList = selectedObject->InfoList.begin();
TQStringList::Iterator itTitle = selectedObject->InfoTitle.begin();
TQStringList::Iterator itListEnd = selectedObject->InfoList.end();
for ( ; itList != itListEnd; ++itList ) {
Links->InfoList->insertItem(TQString(*itTitle));
itTitle++;
@ -548,10 +548,10 @@ void DetailDialog::editLinkDialog()
uint i;
TQString defaultURL , entry;
TQFile newFile;
KDialogBase editDialog(KDialogBase::Plain, i18n("Edit Link"), Ok|Cancel, Ok , this, "editlink", false);
TQFrame *editFrame = editDialog.plainPage();
editLinkURL = new TQLabel(i18n("URL:"), editFrame);
editLinkField = new TQLineEdit(editFrame, "lineedit");
editLinkField->setMinimumWidth(300);
@ -559,9 +559,9 @@ void DetailDialog::editLinkDialog()
editLinkLayout = new TQHBoxLayout(editFrame, 6, 6, "editlinklayout");
editLinkLayout->addWidget(editLinkURL);
editLinkLayout->addWidget(editLinkField);
currentItemIndex = Links->InfoList->currentItem();
if (currentItemIndex != -1 && Links->InfoList->isSelected(currentItemIndex))
{
defaultURL = *selectedObject->InfoList.at(currentItemIndex);
@ -590,8 +590,8 @@ void DetailDialog::editLinkDialog()
entry = selectedObject->name() + ":" + currentItemTitle + ":" + currentItemURL;
//FIXME: usage of verifyUserData() is pretty unclear
//verifyUserData() returns false if currentItemTitle/currentItemURL
//are not found in the user's list already. If they are, then that
//verifyUserData() returns false if currentItemTitle/currentItemURL
//are not found in the user's list already. If they are, then that
//item is removed.
switch (type)
{
@ -641,9 +641,9 @@ void DetailDialog::removeLinkDialog()
uint i;
TQString defaultURL, entry;
TQFile newFile;
currentItemIndex = Links->InfoList->currentItem();
if (currentItemIndex != -1 && Links->InfoList->isSelected(currentItemIndex))
{
defaultURL = *selectedObject->InfoList.at(currentItemIndex);
@ -697,7 +697,7 @@ bool DetailDialog::verifyUserData(int type)
TQString line, name, sub, title;
bool ObjectFound = false;
uint i;
switch (type)
{
case 0:
@ -766,7 +766,7 @@ bool DetailDialog::readUserFile(int type)//, int sourceFileType)
TQTextStream stream(&file);
dataList.clear();
// read all data into memory
while (!stream.eof())
dataList.append(stream.readLine());
@ -844,7 +844,7 @@ TQString DetailDialog::parseADVData(TQString link)
{
TQString subLink;
int index;
if ( (index = link.find("KSOBJ")) != -1)
{
link.remove(index, 5);
@ -904,13 +904,13 @@ void DetailDialog::centerTelescope()
bool useJ2000( false);
int selectedCoord(0);
SkyPoint sp;
// Find the first device with EQUATORIAL_EOD_COORD or EQUATORIAL_COORD and with SLEW element
// i.e. the first telescope we find!
INDIMenu *imenu = ksw->getINDIMenu();
for (unsigned int i=0; i < imenu->mgr.count() ; i++)
{
for (unsigned int j=0; j < imenu->mgr.at(i)->indi_dev.count(); j++)
@ -935,7 +935,7 @@ void DetailDialog::centerTelescope()
ConnectEle = indidev->findElem("CONNECT");
if (!ConnectEle) continue;
if (ConnectEle->state == PS_OFF)
{
KMessageBox::error(0, i18n("Telescope %1 is offline. Please connect and retry again.").arg(indidev->label));
@ -953,7 +953,7 @@ void DetailDialog::centerTelescope()
if (!DecEle) continue;
break;
//Qt::Horizontal
// Horizontal
case 1:
if (prop->perm == PP_RO) continue;
AzEle = prop->findElement("AZ");
@ -962,10 +962,10 @@ void DetailDialog::centerTelescope()
if (!AltEle) continue;
break;
}
onset = indidev->findProp("ON_COORD_SET");
if (!onset) continue;
onset->activateSwitch("SLEW");
indidev->stdDev->currentObject = selectedObject;
@ -1016,19 +1016,19 @@ void DetailDialog::centerTelescope()
}
prop->newText();
return;
}
}
// We didn't find any telescopes
KMessageBox::sorry(0, i18n("KStars did not find any active telescopes."));
}
void DetailDialog::showThumbnail() {
//No image if object is a star
if ( selectedObject->type() == SkyObject::STAR ||
if ( selectedObject->type() == SkyObject::STAR ||
selectedObject->type() == SkyObject::CATALOG_STAR ) {
Thumbnail->resize( Data->Image->width(), Data->Image->height() );
Thumbnail->fill( Data->paletteBackgroundColor() );
@ -1057,9 +1057,9 @@ void DetailDialog::showThumbnail() {
void DetailDialog::updateThumbnail() {
ThumbnailPicker tp( selectedObject, *Thumbnail, this, "thumbnaileditor" );
if ( tp.exec() == TQDialog::Accepted ) {
TQString fname = locateLocal( "appdata", "thumb-"
TQString fname = locateLocal( "appdata", "thumb-"
+ selectedObject->name().lower().replace( TQRegExp(" "), "" ) + ".png" );
Data->Image->setPixmap( *(tp.image()) );

@ -33,7 +33,7 @@ bool CApnCamera::Expose( double Duration, bool Light )
ULONG ExpTime;
unsigned short BitsPerPixel(0);
unsigned short UnbinnedRoiX;
unsigned short UnbinnedRoiY;
unsigned short UnbinnedRoiY;
unsigned short PreRoiSkip, PostRoiSkip;
unsigned short PreRoiRows, PostRoiRows;
unsigned short PreRoiVBinning, PostRoiVBinning;
@ -61,7 +61,7 @@ bool CApnCamera::Expose( double Duration, bool Light )
PostRoiSkip = m_ApnSensorInfo->m_TotalColumns -
m_ApnSensorInfo->m_ClampColumns -
PreRoiSkip -
PreRoiSkip -
UnbinnedRoiX;
TotalHPixels = UnbinnedRoiX + PreRoiSkip + PostRoiSkip + m_ApnSensorInfo->m_ClampColumns;
@ -71,9 +71,9 @@ bool CApnCamera::Expose( double Duration, bool Light )
UnbinnedRoiY = m_RoiPixelsV * m_RoiBinningV;
PreRoiRows = m_ApnSensorInfo->m_UnderscanRows +
PreRoiRows = m_ApnSensorInfo->m_UnderscanRows +
m_RoiStartY;
PostRoiRows = m_ApnSensorInfo->m_TotalRows -
PreRoiRows -
UnbinnedRoiY;
@ -133,14 +133,14 @@ bool CApnCamera::Expose( double Duration, bool Light )
{
PreRoiVBinning += PreRoiRows;
PostRoiVBinning = PostRoiRows;
PreRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP;
PostRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP;
PreRoiRows = 1;
PostRoiRows = 1;
}
// Issue the reset
RoiRegBuffer[0] = FPGA_REG_COMMAND_B;
@ -151,7 +151,7 @@ bool CApnCamera::Expose( double Duration, bool Light )
RoiRegData[1] = PreRoiSkip;
RoiRegBuffer[2] = FPGA_REG_ROI_COUNT;
// Number of ROI pixels. Adjust the 12bit operation here to account for an extra
// Number of ROI pixels. Adjust the 12bit operation here to account for an extra
// 10 pixel shift as a result of the A/D conversion.
if ( m_DataBits == Apn_Resolution_SixteenBit )
{
@ -282,7 +282,7 @@ bool CApnCamera::StopExposure( bool DigitizeData )
return true;
}
unsigned short CApnCamera::GetExposurePixelsH()
{
@ -365,10 +365,10 @@ void CApnCamera::write_ForceShutterOpen( bool ForceShutterOpen )
{
unsigned short RegVal;
Read( FPGA_REG_OP_A, RegVal );
if ( ForceShutterOpen )
RegVal |= FPGA_BIT_FORCE_SHUTTER;
else
else
RegVal &= ~FPGA_BIT_FORCE_SHUTTER;
Write( FPGA_REG_OP_A, RegVal );
@ -492,7 +492,7 @@ void CApnCamera::write_CameraMode( Apn_CameraMode CameraMode )
Write( FPGA_REG_OP_A, RegVal );
break;
}
switch ( CameraMode )
{
case Apn_CameraMode_Normal:
@ -525,7 +525,7 @@ void CApnCamera::write_DataBits( Apn_Resolution BitResolution )
if ( m_CameraInterface == Apn_Interface_NET )
{
// The network interface is 16bpp only. Changing the resolution
// The network interface is 16bpp only. Changing the resolution
// for network cameras has no effect.
return;
}
@ -537,7 +537,7 @@ void CApnCamera::write_DataBits( Apn_Resolution BitResolution )
// Change bit setting after the reset
Read( FPGA_REG_OP_A, RegVal );
if ( BitResolution == Apn_Resolution_TwelveBit )
RegVal |= FPGA_BIT_DIGITIZATION_RES;
@ -547,7 +547,7 @@ void CApnCamera::write_DataBits( Apn_Resolution BitResolution )
Write( FPGA_REG_OP_A, RegVal );
m_DataBits = BitResolution;
LoadClampPattern();
LoadSkipPattern();
LoadRoiPattern( m_RoiBinningH );
@ -578,16 +578,16 @@ Apn_Status CApnCamera::read_ImagingStatus()
if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGING_ACTIVE) != 0 )
Active = true;
if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGE_EXPOSING) != 0 )
Exposing = true;
if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGE_DONE) != 0 )
Done = true;
if ( (m_pvtStatusReg & FPGA_BIT_STATUS_FLUSHING) != 0 )
Flushing = true;
if ( (m_pvtStatusReg & FPGA_BIT_STATUS_WAITING_TRIGGER) != 0 )
WaitOnTrigger = true;
@ -714,7 +714,7 @@ Apn_LedState CApnCamera::read_LedState( unsigned short LedId )
if ( LedId == 0 ) // LED A
RetVal = m_pvtLedStateA;
if ( LedId == 1 ) // LED B
RetVal = m_pvtLedStateB;
@ -779,7 +779,7 @@ Apn_CoolerStatus CApnCamera::read_CoolerStatus()
if ( (m_pvtStatusReg & FPGA_BIT_STATUS_TEMP_AT_TEMP) != 0 )
CoolerAtTemp = true;
if ( (m_pvtStatusReg & FPGA_BIT_STATUS_TEMP_ACTIVE) != 0 )
CoolerActive = true;
@ -816,7 +816,7 @@ double CApnCamera::read_CoolerSetPoint()
double TempVal;
Read( FPGA_REG_TEMP_DESIRED, RegVal );
RegVal &= 0x0FFF;
TempVal = ( RegVal - APN_TEMP_SETPOINT_ZERO_POINT ) * APN_TEMP_DEGREES_PER_BIT;
@ -828,7 +828,7 @@ void CApnCamera::write_CoolerSetPoint( double SetPoint )
{
unsigned short RegVal;
double TempVal;
TempVal = SetPoint;
@ -839,7 +839,7 @@ void CApnCamera::write_CoolerSetPoint( double SetPoint )
TempVal = APN_TEMP_SETPOINT_MAX;
RegVal = (unsigned short)( (TempVal / APN_TEMP_DEGREES_PER_BIT) + APN_TEMP_SETPOINT_ZERO_POINT );
Write( FPGA_REG_TEMP_DESIRED, RegVal );
}
@ -852,7 +852,7 @@ void CApnCamera::write_CoolerBackoffPoint( double BackoffPoint )
{
unsigned short RegVal;
double TempVal;
TempVal = BackoffPoint;
// BackoffPoint must be a positive number!
@ -868,7 +868,7 @@ void CApnCamera::write_CoolerBackoffPoint( double BackoffPoint )
m_pvtCoolerBackoffPoint = TempVal;
RegVal = (unsigned short)( TempVal / APN_TEMP_DEGREES_PER_BIT );
Write( FPGA_REG_TEMP_BACKOFF, RegVal );
}
@ -902,7 +902,7 @@ double CApnCamera::read_TempCCD()
TempAvg = (unsigned short)(TempTotal / don);
m_pvtCurrentCcdTemp = ( (TempAvg - APN_TEMP_SETPOINT_ZERO_POINT)
m_pvtCurrentCcdTemp = ( (TempAvg - APN_TEMP_SETPOINT_ZERO_POINT)
* APN_TEMP_DEGREES_PER_BIT );
return m_pvtCurrentCcdTemp;
@ -931,7 +931,7 @@ double CApnCamera::read_TempHeatsink()
TempAvg = (unsigned short)(TempTotal / don);
m_pvtCurrentHeatsinkTemp = ( (TempAvg - APN_TEMP_HEATSINK_ZERO_POINT)
m_pvtCurrentHeatsinkTemp = ( (TempAvg - APN_TEMP_HEATSINK_ZERO_POINT)
* APN_TEMP_DEGREES_PER_BIT );
return m_pvtCurrentHeatsinkTemp;
@ -957,11 +957,11 @@ void CApnCamera::write_FanMode( Apn_FanMode FanMode )
OpRegA |= FPGA_BIT_TEMP_SUSPEND;
Write( FPGA_REG_OP_A, OpRegA );
do
{
do
{
Read( FPGA_REG_GENERAL_STATUS, RegVal );
} while ( (RegVal & FPGA_BIT_STATUS_TEMP_SUSPEND_ACK) == 0 );
}
switch ( FanMode )
@ -1006,7 +1006,7 @@ double CApnCamera::read_ShutterStrobePosition()
void CApnCamera::write_ShutterStrobePosition( double Position )
{
unsigned short RegVal;
if ( Position < APN_STROBE_POSITION_MIN )
Position = APN_STROBE_POSITION_MIN;
@ -1032,7 +1032,7 @@ void CApnCamera::write_ShutterStrobePeriod( double Period )
RegVal = (unsigned short)((Period - APN_STROBE_PERIOD_MIN) / APN_PERIOD_TIMER_RESOLUTION);
Write( FPGA_REG_SHUTTER_STROBE_PERIOD, RegVal );
m_pvtShutterStrobePeriod = Period;
}
@ -1060,7 +1060,7 @@ bool CApnCamera::read_VariableSequenceDelay()
unsigned short RegVal;
Read( FPGA_REG_OP_A, RegVal );
// variable delay occurs when the bit is 0
return ( (RegVal & FPGA_BIT_DELAY_MODE) == 0 );
return ( (RegVal & FPGA_BIT_DELAY_MODE) == 0 );
}
void CApnCamera::write_VariableSequenceDelay( bool VariableSequenceDelay )
@ -1088,7 +1088,7 @@ void CApnCamera::write_ImageCount( unsigned short Count )
Count = 1;
Write( FPGA_REG_IMAGE_COUNT, Count );
m_pvtImageCount = Count;
}
@ -1182,7 +1182,7 @@ void CApnCamera::write_TDIRate( double TdiRate )
if ( TdiRate < APN_TDI_RATE_MIN )
TdiRate = APN_TDI_RATE_MIN;
if ( TdiRate > APN_TDI_RATE_MAX )
TdiRate = APN_TDI_RATE_MAX;
@ -1289,15 +1289,15 @@ void CApnCamera::write_TestLedBrightness( double TestLedBrightness )
OpRegA |= FPGA_BIT_TEMP_SUSPEND;
Write( FPGA_REG_OP_A, OpRegA );
do
{
do
{
Read( FPGA_REG_GENERAL_STATUS, RegVal );
} while ( (RegVal & FPGA_BIT_STATUS_TEMP_SUSPEND_ACK) == 0 );
}
RegVal = (unsigned short)( (double)FPGA_MASK_LED_ILLUMINATION * (TestLedBrightness/100.0) );
Write( FPGA_REG_LED_DRIVE, RegVal );
Read( FPGA_REG_OP_B, RegVal );
@ -1332,7 +1332,7 @@ long CApnCamera::LoadVerticalPattern()
RegData |= FPGA_BIT_VRAM_ENABLE;
Write( FPGA_REG_OP_B, RegData );
WriteMultiSRMD( FPGA_REG_VRAM_INPUT,
WriteMultiSRMD( FPGA_REG_VRAM_INPUT,
m_ApnSensorInfo->m_VerticalPattern.PatternData,
m_ApnSensorInfo->m_VerticalPattern.NumElements );
@ -1356,14 +1356,14 @@ long CApnCamera::LoadClampPattern()
if ( m_DataBits == Apn_Resolution_SixteenBit )
{
WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternSixteen,
FPGA_REG_HCLAMP_INPUT,
WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternSixteen,
FPGA_REG_HCLAMP_INPUT,
1 );
}
else if ( m_DataBits == Apn_Resolution_TwelveBit )
{
WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternTwelve,
FPGA_REG_HCLAMP_INPUT,
WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternTwelve,
FPGA_REG_HCLAMP_INPUT,
1 );
}
@ -1387,14 +1387,14 @@ long CApnCamera::LoadSkipPattern()
if ( m_DataBits == Apn_Resolution_SixteenBit )
{
WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternSixteen,
FPGA_REG_HSKIP_INPUT,
WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternSixteen,
FPGA_REG_HSKIP_INPUT,
1 );
}
else if ( m_DataBits == Apn_Resolution_TwelveBit )
{
WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternTwelve,
FPGA_REG_HSKIP_INPUT,
WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternTwelve,
FPGA_REG_HSKIP_INPUT,
1 );
}
@ -1418,14 +1418,14 @@ long CApnCamera::LoadRoiPattern( unsigned short binning )
if ( m_DataBits == Apn_Resolution_SixteenBit )
{
WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternSixteen,
FPGA_REG_HRAM_INPUT,
WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternSixteen,
FPGA_REG_HRAM_INPUT,
binning );
}
else if ( m_DataBits == Apn_Resolution_TwelveBit )
{
WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternTwelve,
FPGA_REG_HRAM_INPUT,
WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternTwelve,
FPGA_REG_HRAM_INPUT,
binning );
}
@ -1438,8 +1438,8 @@ long CApnCamera::LoadRoiPattern( unsigned short binning )
}
long CApnCamera::WriteHorizontalPattern( APN_HPATTERN_FILE *Pattern,
unsigned short RamReg,
long CApnCamera::WriteHorizontalPattern( APN_HPATTERN_FILE *Pattern,
unsigned short RamReg,
unsigned short Binning )
{
unsigned short i;
@ -1463,7 +1463,7 @@ long CApnCamera::WriteHorizontalPattern( APN_HPATTERN_FILE *Pattern,
DataArray[Index] = Pattern->RefPatternData[i];
Index++;
}
for ( i=0; i<Pattern->BinNumElements[BinNumber]; i++ )
{
DataArray[Index] = Pattern->BinPatternData[BinNumber][i];
@ -1493,8 +1493,8 @@ long CApnCamera::InitDefaults()
unsigned short PreRoiRows, PostRoiRows;
unsigned short PreRoiVBinning, PostRoiVBinning;
unsigned short UnbinnedRoiY; //Qt::Vertical ROI pixels
unsigned short UnbinnedRoiY; // Vertical ROI pixels
// Read the Camera ID register
Read( FPGA_REG_CAMERA_ID, CameraID );
@ -1640,7 +1640,7 @@ long CApnCamera::InitDefaults()
// printf("ReportedGainTwelveBit = %lf\n",m_ApnSensorInfo->m_ReportedGainTwelveBit);
printf("ReportedGainSixteenBit = %lf\n",m_ApnSensorInfo->m_ReportedGainSixteenBit);
printf("MinSuggestedExpTime = %lf\n",m_ApnSensorInfo->m_MinSuggestedExpTime);
printf("CoolingSupported = %u\n",m_ApnSensorInfo->m_CoolingSupported);
printf("CoolingSupported = %u\n",m_ApnSensorInfo->m_CoolingSupported);
printf("RegulatedCoolingSupported = %u\n",m_ApnSensorInfo->m_RegulatedCoolingSupported);
printf("TempSetPoint = %lf\n",m_ApnSensorInfo->m_TempSetPoint);
// printf("TempRegRate = %u\n",m_ApnSensorInfo->m_TempRegRate);
@ -1675,21 +1675,21 @@ long CApnCamera::InitDefaults()
LoadRoiPattern( m_RoiBinningH );
// Program default camera settings
Write( FPGA_REG_CLAMP_COUNT, m_ApnSensorInfo->m_ClampColumns );
Write( FPGA_REG_PREROI_SKIP_COUNT, m_ApnSensorInfo->m_PreRoiSkipColumns );
Write( FPGA_REG_ROI_COUNT, m_ApnSensorInfo->m_ImagingColumns );
Write( FPGA_REG_CLAMP_COUNT, m_ApnSensorInfo->m_ClampColumns );
Write( FPGA_REG_PREROI_SKIP_COUNT, m_ApnSensorInfo->m_PreRoiSkipColumns );
Write( FPGA_REG_ROI_COUNT, m_ApnSensorInfo->m_ImagingColumns );
Write( FPGA_REG_POSTROI_SKIP_COUNT, m_ApnSensorInfo->m_PostRoiSkipColumns +
m_ApnSensorInfo->m_OverscanColumns );
m_ApnSensorInfo->m_OverscanColumns );
// Since the default state of m_DigitizeOverscan is false, set the count to zero.
Write( FPGA_REG_OVERSCAN_COUNT, 0x0 );
Write( FPGA_REG_OVERSCAN_COUNT, 0x0 );
// Now calculate the vertical settings
UnbinnedRoiY = m_RoiPixelsV * m_RoiBinningV;
PreRoiRows = m_ApnSensorInfo->m_UnderscanRows +
PreRoiRows = m_ApnSensorInfo->m_UnderscanRows +
m_RoiStartY;
PostRoiRows = m_ApnSensorInfo->m_TotalRows -
PreRoiRows -
UnbinnedRoiY;
@ -1714,14 +1714,14 @@ long CApnCamera::InitDefaults()
}
// Program the vertical settings
Write( FPGA_REG_A1_ROW_COUNT, PreRoiRows );
Write( FPGA_REG_A1_ROW_COUNT, PreRoiRows );
Write( FPGA_REG_A1_VBINNING, PreRoiVBinning );
Write( FPGA_REG_A2_ROW_COUNT, m_RoiPixelsV );
Write( FPGA_REG_A2_VBINNING, (m_RoiBinningV | FPGA_BIT_ARRAY_DIGITIZE) );
Write( FPGA_REG_A3_ROW_COUNT, PostRoiRows );
Write( FPGA_REG_A3_VBINNING, PostRoiVBinning );
Write( FPGA_REG_A2_ROW_COUNT, m_RoiPixelsV );
Write( FPGA_REG_A2_VBINNING, (m_RoiBinningV | FPGA_BIT_ARRAY_DIGITIZE) );
Write( FPGA_REG_A3_ROW_COUNT, PostRoiRows );
Write( FPGA_REG_A3_VBINNING, PostRoiVBinning );
Write( FPGA_REG_VFLUSH_BINNING, m_ApnSensorInfo->m_VFlushBinning );
@ -1738,8 +1738,8 @@ long CApnCamera::InitDefaults()
{
Read( FPGA_REG_OP_A, RegVal );
RegVal |= FPGA_BIT_DISABLE_H_CLK;
RegVal |= FPGA_BIT_DISABLE_H_CLK;
Write( FPGA_REG_OP_A, RegVal );
}
@ -1765,7 +1765,7 @@ long CApnCamera::InitDefaults()
write_FanMode( Apn_FanMode_Medium );
// Initialize the LED states and the LED mode. There is nothing to output
// to the device since we issued our CLEAR early in the init() process, and
// to the device since we issued our CLEAR early in the init() process, and
// we are now in a known state.
m_pvtLedStateA = Apn_LedState_Expose;
m_pvtLedStateB = Apn_LedState_Expose;
@ -1790,7 +1790,7 @@ long CApnCamera::InitDefaults()
m_pvtImageInProgress = false;
m_pvtImageReady = false;
return 0;
}
@ -1840,9 +1840,9 @@ void CApnCamera::UpdateGeneralStatus()
// Read the general status register of the device
QueryStatusRegs( StatusReg,
HeatsinkTempReg,
CcdTempReg,
QueryStatusRegs( StatusReg,
HeatsinkTempReg,
CcdTempReg,
CoolerDriveReg,
VoltageReg,
TdiCounterReg,
@ -1859,13 +1859,13 @@ void CApnCamera::UpdateGeneralStatus()
m_pvtCoolerDrive = 100.0;
else
m_pvtCoolerDrive = ( (double)(CoolerDriveReg - 600) / 2600.0 ) * 100.0;
m_pvtCurrentCcdTemp = ( (CcdTempReg - APN_TEMP_SETPOINT_ZERO_POINT)
m_pvtCurrentCcdTemp = ( (CcdTempReg - APN_TEMP_SETPOINT_ZERO_POINT)
* APN_TEMP_DEGREES_PER_BIT );
m_pvtCurrentHeatsinkTemp = ( (HeatsinkTempReg - APN_TEMP_HEATSINK_ZERO_POINT)
m_pvtCurrentHeatsinkTemp = ( (HeatsinkTempReg - APN_TEMP_HEATSINK_ZERO_POINT)
* APN_TEMP_DEGREES_PER_BIT );
m_pvtInputVoltage = VoltageReg * APN_VOLTAGE_RESOLUTION;
// Update ShutterState

@ -157,7 +157,7 @@ public:
long ReadLine( long SkipPixels, long Pixels, unsigned short* pLineBuffer );
long Write( unsigned short reg, unsigned short val );
long Read( unsigned short reg, unsigned short& val );
////////////////////////////////////////////////////////////
// Camera Settings
@ -173,27 +173,27 @@ public:
// 7: image ready
bool read_Present(); // True if camera is present, false otherwise.
bool read_Shutter(); // Current shutter state, true = open, false = closed.
void write_Shutter( bool val );
bool read_ForceShutterOpen(); // True: Forces shutter permanently open. False: allows
void write_ForceShutterOpen( bool val ); // normal shutter operation.
bool read_LongCable(); // Long cable mode.
void write_LongCable( bool val );
void write_LongCable( bool val );
short read_Mode(); // First four bits map to Mode bits used for
void write_Mode( short val ); // special functions or camera configurations.
short read_TestBits(); // First four bits to Test bits used for
void write_TestBits( short val ); // troubleshooting.
short read_Test2Bits(); // First four bits map to Test2 bits used for
void write_Test2Bits( short val ); // special functions or camera configurations.
bool read_FastReadout(); // Fast readout mode (used for focusing).
void write_FastReadout( bool val ); // True means fast focus is on
void write_FastReadout( bool val ); // True means fast focus is on
bool read_UseTrigger(); // Triggered exposure mode.
void write_UseTrigger( bool val ); // True means triggered exposure is on.
@ -201,15 +201,15 @@ public:
bool m_HighPriority; // Bost thread priority level during download
short m_PPRepeat; // Delay used on parallel port systems.
short m_DataBits; // Digitization resolution, 8 - 18.
bool m_FastShutter; // Capable of 0.001 sec exposure resolution
bool m_GuiderRelays; // Capable of outputing autoguider signals
short m_MaxBinX, m_MaxBinY; // Maximum binning factors
short m_MaxBinX, m_MaxBinY; // Maximum binning factors
double m_MaxExposure; // Maximum exposure length
double m_MinExposure; // Minimum exposure length
@ -219,7 +219,7 @@ public:
// Cooler Settings
// N.B. DAC units = ( m_TempScale * CoolerSetPoint (deg. C ) ) + m_TempCalibration;
// N.B. Temperature (deg. C) = (DAC units - m_TempCalibration) / m_TempScale
double read_CoolerSetPoint(); // Returns/sets setpoint temperature in degrees
void write_CoolerSetPoint( double val ); // Celcius.
@ -229,7 +229,7 @@ public:
void write_CoolerMode( Camera_CoolerMode val );
double read_Temperature(); // Current temperature in degrees Celcius.
bool m_TempControl; // Temperature can be externally controlled
short m_TempCalibration; // Temperature calibration factor.
double m_TempScale; // Temperature scaling factor.
@ -238,20 +238,20 @@ public:
// Exposure Settings
// The following variables are latched in Expose method, until next Reset or GetImage
short m_BinX, m_BinY; //Qt::Horizontal and vertical binning.
short m_BinX, m_BinY; // Horizontal and vertical binning.
short m_StartX, m_StartY; // Zero based subframe start position in unbinned pixels.
short m_NumX, m_NumY; // Subframe size in binned pixels.
////////////////////////////////////////////////////////////
// Geometry Settings
// The following variables are latched in Expose method, until next Reset or GetImage
short m_Columns, m_Rows; // Total columns/rows on CCD (physical).
short m_ImgColumns, m_ImgRows; // Unbinned columns/rows in imaging area
short m_SkipC, m_SkipR; // Deleted data columns/rows not to be displayed or saved
short m_HFlush, m_VFlush; //Qt::Horizontal/Vertical flush binning.
short m_HFlush, m_VFlush; // Horizontal/Vertical flush binning.
short m_BIC, m_BIR; // Before Image Column/Row count (dark non-imaging pixels).
////////////////////////////////////////////////////////////
// CCD Settings
@ -291,7 +291,7 @@ public:
// Move the filterwheel to the home position - failure indicates no filterwheel
//attached or broken filterwheel
bool FilterHome();
// Move filterwheel to the given slot
void FilterSet( short Slot );
@ -341,7 +341,7 @@ public:
bool m_WaitingforLine; // camera is clocking and digitizing a row of data
short m_RegisterOffset; // Offset from base address used in parallel port systems.
short m_FilterPosition; // Current filter position
short m_FilterStepPos; // Current filter position in our internal array
@ -350,9 +350,9 @@ public:
Camera_Interface m_Interface; // String acronyms may be used in INI file.
// 0 or ISA: Industry Standard Architecture bus
// 1 or PPI: Parallel Port Interface
// 1 or PPI: Parallel Port Interface
// 2 or PCI: Peripheral Component Interface
Camera_SensorType m_SensorType; // 0 or CCD: Charge Coupled Device
// 1 or CMOS: Complementary Metal-Oxide-Silicon
@ -367,12 +367,12 @@ public:
// 7: At set point
// Latched public variables used during Exposure..GetImage sequence
short m_ExposureBinX, m_ExposureBinY; //Qt::Horizontal and vertical binning.
short m_ExposureBinX, m_ExposureBinY; // Horizontal and vertical binning.
short m_ExposureStartX, m_ExposureStartY; // Subframe start position in unbinned pixels.
short m_ExposureNumX, m_ExposureNumY; // Subframe size in binned pixels.
short m_ExposureColumns, m_ExposureRows; // Total columns/rows on CCD (physical).
short m_ExposureSkipC, m_ExposureSkipR; // Deleted data columns/rows not to be displayed or saved to disk.
short m_ExposureHFlush, m_ExposureVFlush; //Qt::Horizontal/Vertical flush binning.
short m_ExposureHFlush, m_ExposureVFlush; // Horizontal/Vertical flush binning.
short m_ExposureBIC, m_ExposureBIR; // Before Image Column/Row count (dark non-imaging pixels).
unsigned short m_ExposureAIC; // Calculated After Image Column count (dark non-imaging pixels).
unsigned short m_ExposureRemainingLines; // Number of lines to be clocked out by GetImage
@ -381,17 +381,17 @@ public:
////////////////////////////////////////////////////////////
// Write register shadow variables
unsigned short m_RegShadow[ NumWriteRegisters ];
unsigned short m_FastShutterBits_Mode; // Mask to enable fast shutter mode
unsigned short m_FastShutterBits_Test; // Mask to enable fast shutter mode
////////////////////////////////////////////////////////////
// Internal helper routines
void LoadLineCounter( unsigned short rows );
void LoadColumnLayout( unsigned short aic, unsigned short bic, unsigned short pixels );
void LoadTimerAndBinning( double Duration, unsigned short HBin, unsigned short VBin );
void StartFlushing();
void StopFlushing();
@ -408,7 +408,7 @@ private:
#ifdef WITHPPI
inline void RegisterSelect( unsigned short reg );
inline unsigned short INPW();
inline void OUTPW( unsigned short val );
inline void OUTPW( unsigned short val );
#endif
};

@ -554,7 +554,7 @@ LIBFLIAPI FLISetImageArea(flidev_t dev, long ul_x, long ul_y,
@param dev Camera to set horizontal bin factor of.
@param hbinQt::Horizontal bin factor.
@param hbin Horizontal bin factor.
@return Zero on success.
@return Non-zero on failure.
@ -577,7 +577,7 @@ LIBFLIAPI FLISetHBin(flidev_t dev, long hbin)
@param dev Camera to set vertical bin factor of.
@param vbinQt::Vertical bin factor.
@param vbin Vertical bin factor.
@return Zero on success.
@return Non-zero on failure.

File diff suppressed because it is too large Load Diff

@ -17,7 +17,7 @@
2003-08-09 Initial support for non-sidereal tracking
2004-01-15 redesigning the GUI to support INDI v1.2 and fix previous GUI bugs
and problems. The new GUI can easily incoperate extensions to the INDI
protocol as required.
protocol as required.
*/
@ -80,31 +80,31 @@
#define NINDI_STD 26
/* INDI standard property used across all clients to enable interoperability. */
const char * indi_std[NINDI_STD] =
const char * indi_std[NINDI_STD] =
{"CONNECTION", "DEVICE_PORT", "TIME", "SDTIME", "GEOGRAPHIC_COORD", "EQUATORIAL_COORD", "EQUATORIAL_EOD_COORD", "HORIZONTAL_COORD", "ABORT_MOTION", "ON_COORD_SET", "SOLAR_SYSTEM", "MOVEMENT", "PARK", "CCD_EXPOSE_DURATION", "CCD_TEMPERATURE", "CCD_FRAME", "CCD_FRAME_TYPE", "CCD_BINNING", "CCD_INFO", "CCDPREVIEW_STREAM", "CCDPREVIEW_CTRL", "VIDEO_STREAM", "FOCUS_SPEED", "FOCUS_MOTION", "FOCUS_TIMER", "FILTER_SLOT" };
/*******************************************************************
** INDI Device: The work-horse. Responsible for handling its
** child properties and managing signal and changes.
*******************************************************************/
INDI_D::INDI_D(INDIMenu *menuParent, DeviceManager *parentManager, TQString inName, TQString inLabel)
INDI_D::INDI_D(INDIMenu *menuParent, DeviceManager *parentManager, TQString inName, TQString inLabel)
{
name = inName;
label = inLabel;
parent = menuParent;
parentMgr = parentManager;
gl.setAutoDelete(true);
deviceVBox = menuParent->addVBoxPage(inLabel);
groupContainer = new TQTabWidget(deviceVBox);
msgST_w = new TQTextEdit(deviceVBox);
msgST_w->setReadOnly(true);
msgST_w->setMaximumHeight(100);
dataBuffer = (unsigned char *) malloc (1);
stdDev = new INDIStdDevice(this, parent->ksw);
curGroup = NULL;
@ -126,12 +126,12 @@ INDI_D::~INDI_D()
void INDI_D::registerProperty(INDI_P *pp)
{
if (isINDIStd(pp))
pp->pg->dp->INDIStdSupport = true;
stdDev->registerProperty(pp);
}
bool INDI_D::isINDIStd(INDI_P *pp)
@ -142,11 +142,11 @@ bool INDI_D::isINDIStd(INDI_P *pp)
pp->stdID = i;
return true;
}
return false;
}
/* Remove a property from a group, if there are no more properties
/* Remove a property from a group, if there are no more properties
* left in the group, then delete the group as well */
int INDI_D::removeProperty(INDI_P *pp)
{
@ -170,7 +170,7 @@ int INDI_D::setAnyCmd (XMLEle *root, char errmsg[])
{
XMLAtt *ap;
INDI_P *pp;
ap = findAtt (root, "name", errmsg);
if (!ap)
return (-1);
@ -208,7 +208,7 @@ int INDI_D::setValue (INDI_P *pp, XMLEle *root, char errmsg[])
return (-1);
}
}
/* allow changing the timeout */
ap = findXMLAtt (root, "timeout");
if (ap)
@ -225,13 +225,13 @@ int INDI_D::setValue (INDI_P *pp, XMLEle *root, char errmsg[])
return (setTextValue (pp, root, errmsg));
break;
case PG_BUTTONS:
case PG_BUTTONS:
case PG_LIGHTS:
case PG_RADIO:
case PG_RADIO:
case PG_MENU:
return (setLabelState (pp, root, errmsg));
break;
case PG_BLOB:
return (setBLOB(pp, root, errmsg));
break;
@ -256,7 +256,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[])
TQString elementName;
char iNumber[32];
double min, max;
for (ep = nextXMLEle (root, 1); ep != NULL; ep = nextXMLEle (root, 0))
{
if (strcmp (tagXMLEle(ep), "oneText") && strcmp(tagXMLEle(ep), "oneNumber"))
@ -270,15 +270,15 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[])
}
elementName = valuXMLAtt(ap);
lp = pp->findElement(elementName);
if (!lp)
{
snprintf(errmsg, ERRMSG_SIZE, "Error: unable to find element '%.64s' in property '%.64s'", elementName.ascii(), pp->name.ascii());
return (-1);
}
//fprintf(stderr, "tag okay, getting perm\n");
switch (pp->perm)
{
@ -295,18 +295,18 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[])
numberFormat(iNumber, lp->format.ascii(), lp->value);
lp->text = iNumber;
lp->read_w->setText(lp->text);
ap = findXMLAtt (ep, "min");
if (ap) { min = atof(valuXMLAtt(ap)); lp->setMin(min); }
ap = findXMLAtt (ep, "max");
if (ap) { max = atof(valuXMLAtt(ap)); lp->setMax(max); }
/*if (lp->spin_w)
{
lp->spin_w->setValue(lp->value);
lp->spinChanged(lp->value);
}*/
}
break;
@ -323,7 +323,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[])
lp->spin_w->setValue(lp->value);
else
lp->write_w->setText(lp->text);
ap = findXMLAtt (ep, "min");
if (ap) { min = (int) atof(valuXMLAtt(ap)); lp->setMin(min); }
ap = findXMLAtt (ep, "max");
@ -336,7 +336,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[])
/* handle standard cases if needed */
stdDev->setTextValue(pp);
// suppress warning
errmsg = errmsg;
@ -360,7 +360,7 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[])
/* for each child element */
for (ep = nextXMLEle (root, 1), i=0; ep != NULL; ep = nextXMLEle (root, 0), i++)
{
/* only using light and switch */
islight = !strcmp (tagXMLEle(ep), "oneLight");
if (!islight && strcmp (tagXMLEle(ep), "oneSwitch"))
@ -426,7 +426,7 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[])
pp->om_w->setCurrentItem(i);
}
break;
case PG_LIGHTS:
lp->drawLt();
break;
@ -436,29 +436,29 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[])
}
}
stdDev->setLabelState(pp);
return (0);
}
/* Set BLOB vector. Process incoming data stream
* Return 0 if okay, -1 if error
* Return 0 if okay, -1 if error
*/
int INDI_D::setBLOB(INDI_P *pp, XMLEle * root, char errmsg[])
{
XMLEle *ep;
INDI_E *blobEL;
for (ep = nextXMLEle(root,1); ep; ep = nextXMLEle(root,0))
{
if (strcmp(tagXMLEle(ep), "oneBLOB") == 0)
{
blobEL = pp->findElement(TQString(findXMLAttValu (ep, "name")));
if (blobEL)
return processBlob(blobEL, ep, errmsg);
else
@ -468,13 +468,13 @@ int INDI_D::setBLOB(INDI_P *pp, XMLEle * root, char errmsg[])
}
}
}
return (0);
}
/* Process incoming data stream
* Return 0 if okay, -1 if error
* Return 0 if okay, -1 if error
*/
int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[])
{
@ -485,29 +485,29 @@ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[])
char *baseBuffer;
unsigned char *blobBuffer(NULL);
bool iscomp(false);
ap = findXMLAtt(ep, "size");
if (!ap)
{
sprintf (errmsg, "INDI: set %64s size not found", blobEL->name.ascii());
return (-1);
}
dataSize = atoi(valuXMLAtt(ap));
ap = findXMLAtt(ep, "format");
if (!ap)
{
sprintf (errmsg, "INDI: set %64s format not found", blobEL->name.ascii());
return (-1);
}
dataFormat = TQString(valuXMLAtt(ap));
baseBuffer = (char *) malloc ( (3*pcdatalenXMLEle(ep)/4) * sizeof (char));
blobSize = from64tobits (baseBuffer, pcdataXMLEle(ep));
blobBuffer = (unsigned char *) baseBuffer;
/* Blob size = 0 when only state changes */
if (dataSize == 0)
{
@ -520,27 +520,27 @@ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[])
sprintf (errmsg, "INDI: %64s.%64s.%64s bad base64", name.ascii(), blobEL->pp->name.ascii(), blobEL->name.ascii());
return (-1);
}
iscomp = (dataFormat.find(".z") != -1);
dataFormat.remove(".z");
if (dataFormat == ".fits") dataType = DATA_FITS;
else if (dataFormat == ".stream") dataType = DATA_STREAM;
else if (dataFormat == ".ccdpreview") dataType = DATA_CCDPREVIEW;
else if (dataFormat == ".ccdpreview") dataType = DATA_CCDPREVIEW;
else dataType = DATA_OTHER;
//kdDebug() << "We're getting data with size " << dataSize << endl;
//kdDebug() << "data format " << dataFormat << endl;
if (iscomp)
{
dataBuffer = (unsigned char *) realloc (dataBuffer, (dataSize * sizeof(unsigned char)));
r = uncompress(dataBuffer, &dataSize, blobBuffer, (uLong) blobSize);
if (r != Z_OK)
{
sprintf(errmsg, "INDI: %64s.%64s.%64s compression error: %d", name.ascii(), blobEL->pp->name.ascii(), blobEL->name.ascii(), r);
sprintf(errmsg, "INDI: %64s.%64s.%64s compression error: %d", name.ascii(), blobEL->pp->name.ascii(), blobEL->name.ascii(), r);
free (blobBuffer);
return -1;
}
@ -553,13 +553,13 @@ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[])
dataBuffer = (unsigned char *) realloc (dataBuffer, (dataSize * sizeof(unsigned char)));
memcpy(dataBuffer, blobBuffer, dataSize);
}
stdDev->handleBLOB(dataBuffer, dataSize, dataFormat);
free (blobBuffer);
return (0);
}
bool INDI_D::isOn()
@ -605,11 +605,11 @@ INDI_P * INDI_D::addProperty (XMLEle *root, char errmsg[])
return NULL;
}
/* RemoveQt::Vertical spacer from group layout, this is done everytime
* a new property arrives. The spacer is then appended to the end of the
/* Remove Vertical spacer from group layout, this is done everytime
* a new property arrives. The spacer is then appended to the end of the
* properties */
pg->propertyLayout->removeItem(pg->VerticalSpacer);
pp = new INDI_P(pg, TQString(valuXMLAtt(ap)));
/* init state */
@ -655,7 +655,7 @@ INDI_P * INDI_D::findProp (TQString name)
INDI_G * INDI_D::findGroup (TQString grouptag, int create, char errmsg[])
{
INDI_G *ig;
for (ig = gl.first(); ig != NULL; ig = gl.next() )
if (ig->name == grouptag)
{
@ -668,7 +668,7 @@ INDI_G * INDI_D::findGroup (TQString grouptag, int create, char errmsg[])
{
if (grouptag.isEmpty())
grouptag = "Group_1";
curGroup = new INDI_G(this, grouptag);
gl.append(curGroup);
return curGroup;
@ -785,15 +785,15 @@ int INDI_D::buildTextGUI(XMLEle *root, char errmsg[])
/* we know it will be a general text GUI */
pp->guitype = PG_TEXT;
pp->perm = p;
if (pp->buildTextGUI(root, errmsg) < 0)
{
delete (pp);
return (-1);
}
pp->pg->addProperty(pp);
return (0);
}
@ -817,22 +817,22 @@ int INDI_D::buildNumberGUI (XMLEle *root, char *errmsg)
delete(pp);
return (-1);
}
/* we know it will be a number GUI */
pp->guitype = PG_NUMERIC;
pp->perm = p;
if (pp->buildNumberGUI(root, errmsg) < 0)
{
delete (pp);
return (-1);
}
pp->pg->addProperty(pp);
return (0);
}
/* build GUI for switches property.
* rule and number of will determine exactly how the GUI is built.
* return 0 if ok, else -1 with reason in errmsg[]
@ -863,7 +863,7 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
for ( ep = nextXMLEle(root, 1) , n = 0 ; ep != NULL; ep = nextXMLEle(root, 0))
if (!strcmp (tagXMLEle(ep), "defSwitch"))
n++;
if (n > MAXRADIO)
{
pp->guitype = PG_MENU;
@ -874,14 +874,14 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
pp=0;
return err;
}
pp->pg->addProperty(pp);
return (err);
}
/* otherwise, build 1-4 button layout */
pp->guitype = PG_BUTTONS;
err = pp->buildSwitchesGUI(root, errmsg);
if (err < 0)
{
@ -889,7 +889,7 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
pp=0;
return err;
}
pp->pg->addProperty(pp);
return (err);
@ -898,7 +898,7 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
{
/* 1-4 checkboxes layout */
pp->guitype = PG_RADIO;
err = pp->buildSwitchesGUI(root, errmsg);
if (err < 0)
{
@ -906,18 +906,18 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
pp=0;
return err;
}
pp->pg->addProperty(pp);
return (err);
}
snprintf (errmsg, ERRMSG_SIZE, "INDI: <%.64s> unknown rule %.64s for %.64s %.64s",
tagXMLEle(root), valuXMLAtt(ap), name.ascii(), pp->name.ascii());
delete(pp);
return (-1);
}
/* build GUI for a lights GUI.
@ -932,13 +932,13 @@ int INDI_D::buildLightsGUI (XMLEle *root, char errmsg[])
return (-1);
pp->guitype = PG_LIGHTS;
if (pp->buildLightsGUI(root, errmsg) < 0)
{
delete (pp);
return (-1);
}
pp->pg->addProperty(pp);
return (0);
}
@ -961,17 +961,17 @@ int INDI_D::buildBLOBGUI (XMLEle *root, char errmsg[])
delete(pp);
return (-1);
}
/* we know it will be a number GUI */
pp->perm = p;
pp->guitype = PG_BLOB;
if (pp->buildBLOBGUI(root, errmsg) < 0)
{
delete (pp);
return (-1);
}
pp->pg->addProperty(pp);
return (0);
}
@ -981,7 +981,7 @@ INDI_E * INDI_D::findElem(TQString name)
INDI_G *grp;
INDI_P *prop;
INDI_E *el;
for (grp = gl.first(); grp != NULL; grp = gl.next())
{
for (prop = grp->pl.first(); prop != NULL; prop = grp->pl.next())
@ -990,7 +990,7 @@ INDI_E * INDI_D::findElem(TQString name)
if (el != NULL) return el;
}
}
return NULL;
}

@ -5,7 +5,7 @@
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
2004-01-15 INDI element is the most basic unit of the INDI KStars client.
*/
@ -47,7 +47,7 @@ typedef enum {PG_NONE = 0, PG_TEXT, PG_NUMERIC, PG_BUTTONS,
PG_RADIO, PG_MENU, PG_LIGHTS, PG_BLOB} PGui;
/* INDI std properties */
/* N.B. Need to modify corresponding entry in indidevice.cpp when changed */
/* N.B. Need to modify corresponding entry in indidevice.cpp when changed */
enum stdProperties { CONNECTION, DEVICE_PORT, TIME, SDTIME, GEOGRAPHIC_COORD, /* General */
EQUATORIAL_COORD, EQUATORIAL_EOD_COORD, HORIZONTAL_COORD, /* Telescope */
ABORT_MOTION, ON_COORD_SET, SOLAR_SYSTEM, MOVEMENT, PARK, /* Telescope */
@ -57,7 +57,7 @@ enum stdProperties { CONNECTION, DEVICE_PORT, TIME, SDTIME, GEOGRAPHIC_COORD,
VIDEO_STREAM, /* Video */
FOCUS_SPEED, FOCUS_MOTION, FOCUS_TIMER, /* Focuser */
FILTER_SLOT}; /* Filter */
/* Devices families that we explicity support (i.e. with std properties) */
enum deviceFamily { KSTARS_TELESCOPE, KSTARS_CCD, KSTARS_FILTER, KSTARS_VIDEO, KSTARS_FOCUSER, KSTARS_DOME, KSTARS_GPS };
@ -89,7 +89,7 @@ XMLEle * findEle (XMLEle *ep , INDI_P *pp, const char *child, char errmsg
class INDI_E : public TQObject
{
Q_OBJECT
public:
INDI_E(INDI_P *parentProperty, TQString inName, TQString inLabel);
~INDI_E();
@ -99,7 +99,7 @@ class INDI_E : public TQObject
INDI_P *pp; /* parent property */
TQHBoxLayout *EHBox; /*Qt::Horizontal layout */
/* GUI widgets, only malloced when needed */
KSqueezedTextLabel *label_w; // label
KLineEdit *read_w; // read field
@ -110,31 +110,31 @@ class INDI_E : public TQObject
KPushButton *push_w; // push button
KPushButton *browse_w; // browse button
TQCheckBox *check_w; // check box
TQSpacerItem *hSpacer; //Qt::Horizontal spacer
TQSpacerItem *hSpacer; // Horizontal spacer
double min, max, step; // params for scale
double value; // current value
double targetValue; // target value
TQString text; // current text
TQString format; // number format, if applicable
int buildTextGUI (TQString initText);
int buildNumberGUI (double initValue);
int buildLightGUI();
int buildBLOBGUI();
void drawLt();
void initNumberValues(double newMin, double newMax, double newStep, char * newFormat);
void updateValue(double newValue);
void setMin (double inMin);
void setMax (double inMax);
void setupElementLabel();
void setupElementRead(int length);
void setupElementWrite(int length);
void setupElementScale(int length);
void setupBrowseButton();
public slots:
void spinChanged(double value);
void sliderChanged(int value);

@ -5,10 +5,10 @@
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#include "indiproperty.h"
#include "indigroup.h"
#include "indidevice.h"
@ -23,18 +23,18 @@
#include "indi/base64.h"
#include "indi/indicom.h"
#include <tdepopupmenu.h>
#include <klineedit.h>
#include <kled.h>
#include <tdelocale.h>
#include <kcombobox.h>
#include <kpushbutton.h>
#include <knuminput.h>
#include <knuminput.h>
#include <kdebug.h>
#include <tdemessagebox.h>
#include <tqbuttongroup.h>
#include <tqbuttongroup.h>
#include <tqcheckbox.h>
#include <tqlabel.h>
#include <tqlayout.h>
@ -45,7 +45,7 @@
#include <unistd.h>
#include <stdlib.h>
/*******************************************************************
** INDI Property: contains widgets, labels, and their status
*******************************************************************/
@ -54,13 +54,13 @@ INDI_P::INDI_P(INDI_G *parentGroup, TQString inName)
name = inName;
pg = parentGroup;
el.setAutoDelete(true);
stdID = -1;
indistd = new INDIStdProperty(this, pg->dp->parent->ksw, pg->dp->stdDev);
PHBox = new TQHBoxLayout(0, 0, KDialogBase::spacingHint());
PVBox = new TQVBoxLayout(0, 0, KDialogBase::spacingHint());
light = NULL;
@ -104,7 +104,7 @@ bool INDI_P::isOn(TQString component)
INDI_E * INDI_P::findElement(TQString elementName)
{
INDI_E *element = NULL;
for (element = el.first(); element != NULL; element = el.next())
if (element->name == elementName || element->label == elementName)
break;
@ -115,7 +115,7 @@ INDI_E * INDI_P::findElement(TQString elementName)
void INDI_P::drawLt(PState lstate)
{
/* set state light */
switch (lstate)
{
@ -141,13 +141,13 @@ void INDI_P::drawLt(PState lstate)
break;
}
}
void INDI_P::newText()
{
INDI_E * lp;
for (lp = el.first(); lp != NULL; lp = el.next())
{
/* If PG_SCALE */
@ -164,15 +164,15 @@ void INDI_P::newText()
else
lp->text = lp->write_w->text();
break;
case PP_RO:
break;
case PP_WO:
lp->text = lp->write_w->text();
break;
}
if (guitype == PG_NUMERIC)
{
f_scansexa(lp->text.ascii(), &(lp->targetValue));
@ -188,7 +188,7 @@ void INDI_P::newText()
state = PS_BUSY;
drawLt(state);
/* perform any std functions */
indistd->newText();
@ -201,11 +201,11 @@ void INDI_P::newText()
void INDI_P::convertSwitch(int id)
{
INDI_E *lp;
TQString mLabel;
int switchIndex=0;
if (assosiatedPopup == NULL)
return;
@ -229,12 +229,12 @@ void INDI_P::convertSwitch(int id)
indistd->ksw->map()->slotCenter();
return;
}
lp = findElement(mLabel);
if (!lp)
return;
for (uint i=0; i < el.count(); i++)
{
if (el.at(i)->label == mLabel)
@ -247,7 +247,7 @@ void INDI_P::convertSwitch(int id)
if (indistd->convertSwitch(switchIndex, lp))
return;
else if (lp->state == PS_OFF)
newSwitch(switchIndex);
newSwitch(switchIndex);
}
@ -267,15 +267,15 @@ void INDI_P::newSwitch(int id)
for (unsigned int i=0; i < el.count(); i++)
el.at(i)->state = PS_OFF;
lp->state = PS_ON;
break;
case PG_BUTTONS:
for (unsigned int i=0; i < el.count(); i++)
{
if (i == (unsigned int) id) continue;
el.at(i)->push_w->setDown(false);
buttonFont = el.at(i)->push_w->font();
buttonFont.setBold(FALSE);
@ -290,12 +290,12 @@ void INDI_P::newSwitch(int id)
lp->state = PS_ON;
break;
case PG_RADIO:
lp->state = lp->state == PS_ON ? PS_OFF : PS_ON;
lp->check_w->setChecked(lp->state == PS_ON);
break;
default:
break;
@ -304,7 +304,7 @@ void INDI_P::newSwitch(int id)
state = PS_BUSY;
drawLt(state);
if (indistd->newSwitch(id, lp))
return;
@ -327,16 +327,16 @@ void INDI_P::newBlob()
unsigned char *data, *data64;
bool sending (false);
bool valid (true);
for (unsigned int i=0; i < el.count(); i++)
{
filename = el.at(i)->write_w->text();
if (filename.isEmpty())
{
valid = false;
continue;
continue;
}
fp.setName(filename);
if ( (pos = filename.findRev(".")) != -1)
@ -348,7 +348,7 @@ void INDI_P::newBlob()
valid = false;
continue;
}
binaryStream.setDevice(&fp);
data_file = new char[fp.size()];
@ -395,7 +395,7 @@ void INDI_P::newBlob()
else if (sending)
pg->dp->parentMgr->finishBlob();
if (valid)
if (valid)
state = PS_BUSY;
else
state = PS_ALERT;
@ -417,18 +417,18 @@ void INDI_P::addGUI (XMLEle *root)
light->setLook(KLed::Sunken);
//light->setShape(KLed::Rectangular);
drawLt(state);
/* #1 First widegt is the LED status indicator */
PHBox->addWidget(light);
/* #2 add label for prompt */
prompt = findAtt(root, "label", errmsg);
if (!prompt)
label = name;
else
label = valuXMLAtt(prompt);
// use property name if label is empty
if (label.isEmpty())
{
@ -437,20 +437,20 @@ void INDI_P::addGUI (XMLEle *root)
}
else
label_w = new TQLabel(label, pg->propertyContainer);
label_w->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, label_w->sizePolicy().hasHeightForWidth() ) );
label_w->setFrameShape( TQLabel::GroupBoxPanel );
label_w->setMinimumWidth(PROPERTY_LABEL_WIDTH);
label_w->setMaximumWidth(PROPERTY_LABEL_WIDTH);
label_w->setTextFormat( TQLabel::RichText );
label_w->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter | TQLabel::AlignHCenter) );
PHBox->addWidget(label_w);
light->show();
label_w->show();
/* #3 Add theQt::Vertical layout thay may contain several elements */
/* #3 Add the Vertical layout thay may contain several elements */
PHBox->addLayout(PVBox);
}
@ -461,7 +461,7 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[])
XMLAtt *ap;
TQString textName, textLabel;
errmsg=errmsg;
for (text = nextXMLEle (root, 1); text != NULL; text = nextXMLEle (root, 0))
{
if (strcmp (tagXMLEle(text), "defText"))
@ -486,24 +486,24 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[])
}
textLabel = valuXMLAtt(ap);
if (textLabel.isEmpty())
textLabel = textName;
textLabel.truncate(MAXINDINAME);
lp = new INDI_E(this, textName, textLabel);
lp->buildTextGUI(TQString(pcdataXMLEle(text)));
el.append(lp);
}
if (perm == PP_RO)
return 0;
// INDI STD, but we use our own controls
if (name == "TIME")
{
@ -515,9 +515,9 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[])
setupSetButton("Set");
TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newText()));
}
return 0;
}
int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[])
@ -529,7 +529,7 @@ int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[])
INDI_E *lp;
TQString numberName, numberLabel;
errmsg=errmsg;
for (number = nextXMLEle (root, 1); number != NULL; number = nextXMLEle (root, 0))
{
if (strcmp (tagXMLEle(number), "defNumber"))
@ -554,12 +554,12 @@ int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[])
}
numberLabel = valuXMLAtt(ap);
if (numberLabel.isEmpty())
numberLabel = numberName;
numberLabel.truncate(MAXINDINAME);
lp = new INDI_E(this, numberName, numberLabel);
ap = findXMLAtt (number, "min");
@ -582,17 +582,17 @@ int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[])
el.append(lp);
}
if (perm == PP_RO)
return 0;
if (name == "CCD_EXPOSE_DURATION")
setupSetButton("Start");
else
setupSetButton("Set");
TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newText()));
return (0);
}
@ -634,7 +634,7 @@ int INDI_P::buildMenuGUI(XMLEle *root, char errmsg[])
switchName = valuXMLAtt(ap);
switchName.truncate(MAXINDINAME);
/* find label */
ap = findAtt (sep, "label", errmsg);
if (!ap)
@ -657,7 +657,7 @@ int INDI_P::buildMenuGUI(XMLEle *root, char errmsg[])
}
menuOptions.append(switchLabel);
if (lp->state == PS_ON)
{
if (onItem != -1)
@ -666,19 +666,19 @@ int INDI_P::buildMenuGUI(XMLEle *root, char errmsg[])
tagXMLEle(root), name.ascii(), lp->name.ascii());
return (-1);
}
onItem = i;
}
el.append(lp);
}
om_w = new KComboBox(pg->propertyContainer);
om_w->insertStringList(menuOptions);
om_w->setCurrentItem(onItem);
HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
PHBox->addWidget(om_w);
PHBox->addItem(HorSpacer);
@ -702,7 +702,7 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[])
groupB->setFrameShape(TQFrame::NoFrame);
if (guitype == PG_BUTTONS)
groupB->setExclusive(true);
TQObject::connect(groupB, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(newSwitch(int)));
for (sep = nextXMLEle (root, 1), j=-1; sep != NULL; sep = nextXMLEle (root, 0))
@ -710,7 +710,7 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[])
/* look for switch tage */
if (strcmp (tagXMLEle(sep), "defSwitch"))
continue;
/* find name */
ap = findAtt (sep, "name", errmsg);
if (!ap)
@ -725,12 +725,12 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[])
return (-1);
switchLabel = valuXMLAtt(ap);
if (switchLabel.isEmpty())
switchLabel = switchName;
switchLabel.truncate(MAXINDINAME);
lp = new INDI_E(this, switchName, switchLabel);
if (pg->dp->crackSwitchState (pcdataXMLEle(sep), &(lp->state)) < 0)
@ -761,7 +761,7 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[])
lp->push_w = button;
PHBox->addWidget(button);
button->show();
break;
@ -774,9 +774,9 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[])
checkbox->setChecked(true);
lp->check_w = checkbox;
PHBox->addWidget(checkbox);
checkbox->show();
break;
@ -791,9 +791,9 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[])
if (j < 0)
return (-1);
HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
PHBox->addItem(HorSpacer);
return (0);
@ -805,7 +805,7 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[])
XMLAtt *ap;
INDI_E *lp;
TQString sname, slabel;
for (lep = nextXMLEle (root, 1); lep != NULL; lep = nextXMLEle (root, 0))
{
if (strcmp (tagXMLEle(lep), "defLight"))
@ -814,7 +814,7 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[])
/* find name */
ap = findAtt (lep, "name", errmsg);
if (!ap) return (-1);
sname = valuXMLAtt(ap);
sname.truncate(MAXINDINAME);
@ -827,7 +827,7 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[])
slabel = sname;
slabel.truncate(MAXINDINAME);
lp = new INDI_E(this, sname, slabel);
if (pg->dp->crackLightState (pcdataXMLEle(lep), &lp->state) < 0)
@ -836,13 +836,13 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[])
tagXMLEle(root), valuXMLAtt(ap), pg->dp->name.ascii(), name.ascii(), sname.ascii());
return (-1);
}
lp->buildLightGUI();
el.append(lp);
}
HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
PHBox->addItem(HorSpacer);
return (0);
@ -857,7 +857,7 @@ int INDI_P::buildBLOBGUI(XMLEle *root, char errmsg[])
XMLAtt *ap;
TQString blobName, blobLabel ;
errmsg=errmsg;
for (blob = nextXMLEle (root, 1); blob != NULL; blob = nextXMLEle (root, 0))
{
if (strcmp (tagXMLEle(blob), "defBLOB"))
@ -891,34 +891,34 @@ int INDI_P::buildBLOBGUI(XMLEle *root, char errmsg[])
lp = new INDI_E(this, blobName, blobLabel);
lp->buildBLOBGUI();
el.append(lp);
}
if (perm == PP_RO)
return 0;
setupSetButton(i18n("Upload"));
TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newBlob()));
return 0;
}
void INDI_P::activateSwitch(TQString name)
{
int iCounter = 0;
INDI_E *element;
for (element = el.first(); element != NULL; element = el.next())
{
if (element->name == name && element->push_w)
newSwitch(iCounter);
iCounter++;
}
}

@ -5,10 +5,10 @@
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
2004-01-18: This class handles INDI Standard properties.
*/
#include "indistd.h"
#include "Options.h"
#include "indielement.h"
@ -26,7 +26,7 @@
#include "streamwg.h"
#include "ccdpreviewwg.h"
#include "fitsviewer.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@ -34,13 +34,13 @@
#include <ctype.h>
#include <zlib.h>
#include <stdlib.h>
#include <tqtimer.h>
#include <tqlabel.h>
#include <tqfont.h>
#include <tqeventloop.h>
#include <tqsocketnotifier.h>
#include <tdelocale.h>
#include <kdebug.h>
#include <kpushbutton.h>
@ -52,40 +52,40 @@
#include <kurl.h>
#include <kdirlister.h>
#include <tdeaction.h>
#define STD_BUFFER_SIZ 1024000
#define FRAME_ILEN 1024
INDIStdDevice::INDIStdDevice(INDI_D *associatedDevice, KStars * kswPtr)
{
dp = associatedDevice;
ksw = kswPtr;
initDevCounter = 0;
setCount = 0;
batchMode = false;
ISOMode = false;
currentObject = NULL;
currentObject = NULL;
streamWindow = new StreamWG(this, ksw);
CCDPreviewWindow = new CCDPreviewWG(this, ksw);
devTimer = new TQTimer(this);
seqLister = new KDirLister();
telescopeSkyObject = new SkyObject(0, 0, 0, 0, i18n("Telescope"));
ksw->data()->appendTelescopeObject(telescopeSkyObject);
connect( devTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) );
connect( seqLister, TQT_SIGNAL(newItems (const KFileItemList & )), this, TQT_SLOT(checkSeqBoundary(const KFileItemList &)));
downloadDialog = new KProgressDialog(NULL, 0, i18n("INDI"), i18n("Downloading Data..."));
downloadDialog->cancel();
parser = newLilXML();
}
INDIStdDevice::~INDIStdDevice()
{
streamWindow->enableStream(false);
@ -95,29 +95,29 @@
streamDisabled();
delete (seqLister);
}
void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString dataFormat)
{
if (dataFormat == ".fits") dataType = DATA_FITS;
else if (dataFormat == ".stream") dataType = DATA_STREAM;
else if (dataFormat == ".ccdpreview") dataType = DATA_CCDPREVIEW;
else if (dataFormat == ".ccdpreview") dataType = DATA_CCDPREVIEW;
else dataType = DATA_OTHER;
if (dataType == DATA_STREAM)
{
if (!streamWindow->processStream)
return;
streamWindow->show();
streamWindow->streamFrame->newFrame( buffer, bufferSize, streamWindow->streamWidth, streamWindow->streamHeight);
streamWindow->show();
streamWindow->streamFrame->newFrame( buffer, bufferSize, streamWindow->streamWidth, streamWindow->streamHeight);
}
else if (dataType == DATA_CCDPREVIEW)
{
if (!CCDPreviewWindow->processStream)
return;
CCDPreviewWindow->show();
CCDPreviewWindow->streamFrame->newFrame( buffer, bufferSize, CCDPreviewWindow->streamWidth, CCDPreviewWindow->streamHeight);
CCDPreviewWindow->show();
CCDPreviewWindow->streamFrame->newFrame( buffer, bufferSize, CCDPreviewWindow->streamWidth, CCDPreviewWindow->streamHeight);
}
else if (dataType == DATA_FITS || dataType == DATA_OTHER)
{
@ -125,14 +125,14 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
FILE *fitsTempFile;
int fd, nr, n=0;
TQString currentDir = Options::fitsSaveDirectory();
streamWindow->close();
if (dataType == DATA_FITS && !batchMode && Options::indiFITSDisplay())
{
strcpy(filename, "/tmp/fitsXXXXXX");
if ((fd = mkstemp(filename)) < 0)
{
{
KMessageBox::error(NULL, "Error making temporary filename.");
return;
}
@ -145,18 +145,18 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
time_t t;
time (&t);
tp = gmtime (&t);
if (currentDir[currentDir.length() -1] == '/')
currentDir.truncate(currentDir.length() - 1);
strncpy(filename, currentDir.ascii(), currentDir.length());
filename[currentDir.length()] = '\0';
if (dataType == DATA_FITS)
{
char tempFileStr[256];
strncpy(tempFileStr, filename, 256);
if ( batchMode && !ISOMode)
snprintf(filename, sizeof(filename), "%s/%s_%02d.fits", tempFileStr, seqPrefix.ascii(), setCount);
else if (!batchMode && !Options::indiFITSDisplay())
@ -169,7 +169,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
strftime (ts, sizeof(ts), "%Y-%m-%dT%H:%M:%S", tp);
snprintf(filename, sizeof(filename), "%s/%s_%02d_%s.fits", tempFileStr, seqPrefix.ascii(), setCount, ts);
}
setCount++;
}
else
@ -179,16 +179,16 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
strncat(filename, dataFormat.ascii(), 10);
}
}
fitsTempFile = fopen(filename, "w");
if (fitsTempFile == NULL) return;
for (nr=0; nr < (int) bufferSize; nr += n)
n = fwrite( ((unsigned char *) buffer) + nr, 1, bufferSize - nr, fitsTempFile);
fclose(fitsTempFile);
// We're done if we have DATA_OTHER
if (dataType == DATA_OTHER)
{
@ -200,15 +200,15 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
ksw->statusBar()->changeItem( i18n("FITS file saved to %1").arg(filename), 0);
emit FITSReceived(dp->label);
return;
}
}
KURL fileURL(filename);
FITSViewer * fv = new FITSViewer(&fileURL, ksw);
fv->fitsChange();
fv->show();
}
}
/* Process standard Text and Number properties arrives from the driver */
@ -222,44 +222,44 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
ExtDate indiDate;
TQTime indiTime;
KStarsDateTime indiDateTime;
switch (pp->stdID)
{
case TIME:
if ( Options::indiAutoTime() )
handleDevCounter();
// Update KStars time once we receive update from INDI
el = pp->findElement("UTC");
if (!el) return;
sscanf(el->text.ascii(), "%d%*[^0-9]%d%*[^0-9]%dT%d%*[^0-9]%d%*[^0-9]%d", &y, &m, &d, &hour, &min, &sec);
indiDate.setYMD(y, m, d);
indiTime.setHMS(hour, min, sec);
indiDateTime.setDate(indiDate);
indiDateTime.setTime(indiTime);
ksw->data()->changeDateTime(indiDateTime);
ksw->data()->syncLST();
break;
case SDTIME:
if ( Options::indiAutoTime())
handleDevCounter();
break;
case GEOGRAPHIC_COORD:
if ( Options::indiAutoGeo() )
handleDevCounter();
break;
case CCD_EXPOSE_DURATION:
if (pp->state == PS_IDLE || pp->state == PS_OK)
pp->set_w->setText(i18n("Start"));
break;
case CCD_FRAME:
el = pp->findElement("WIDTH");
if (!el) return;
@ -267,11 +267,11 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
el = pp->findElement("HEIGHT");
if (!el) return;
ht = (int) el->value;
streamWindow->setSize(wd, ht);
//streamWindow->allocateStreamBuffer();
break;
case CCDPREVIEW_CTRL:
case CCDPREVIEW_CTRL:
el = pp->findElement("WIDTH");
if (!el) return;
wd = (int) el->value;
@ -283,12 +283,12 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
bo = (int) el->value;
el = pp->findElement("BYTESPERPIXEL");
if (!el) return;
bpp = (int) el->value;
bpp = (int) el->value;
el = pp->findElement("MAXGOODDATA");
if (!el) return;
mgd = (long) el->value;
CCDPreviewWindow->setCtrl(wd, ht, bo ,bpp,mgd);
break;
case CCD_INFO:
@ -311,10 +311,10 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
if (!el) return;
telescopeSkyObject->setDec(el->value);
telescopeSkyObject->EquatorialToHorizontal(ksw->LST(), ksw->geo()->lat());
// Force immediate update of skymap if the focus object is our telescope.
// Force immediate update of skymap if the focus object is our telescope.
if (ksw->map()->focusObject() == telescopeSkyObject)
ksw->map()->updateFocus();
else
else
ksw->map()->update();
break;
@ -327,7 +327,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
if (!el) return;
telescopeSkyObject->setAz(el->value);
telescopeSkyObject->HorizontalToEquatorial(ksw->LST(), ksw->geo()->lat());
// Force immediate update of skymap if the focus object is our telescope.
// Force immediate update of skymap if the focus object is our telescope.
if (ksw->map()->focusObject() == telescopeSkyObject)
ksw->map()->updateFocus();
else
@ -336,9 +336,9 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
default:
break;
}
}
void INDIStdDevice::setLabelState(INDI_P *pp)
@ -348,13 +348,13 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
TDEAction *tmpAction;
INDIDriver *drivers = ksw->getINDIDriver();
TQFont buttonFont;
switch (pp->stdID)
{
case CONNECTION:
lp = pp->findElement("CONNECT");
if (!lp) return;
if (lp->state == PS_ON)
{
initDeviceOptions();
@ -378,10 +378,10 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
//dp->parentMgr->sNotifier->disconnect();
streamWindow->enableStream(false);
streamWindow->close();
//close(streamFD);
}
if (ksw->map()->focusObject() == telescopeSkyObject)
{
ksw->map()->stopTracking();
@ -393,7 +393,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
emit linkRejected();
}
break;
case VIDEO_STREAM:
lp = pp->findElement("ON");
if (!lp) return;
@ -402,7 +402,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
else
streamWindow->enableStream(false);
break;
case CCDPREVIEW_STREAM:
lp = pp->findElement("ON");
if (!lp) return;
@ -411,101 +411,101 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
else
CCDPreviewWindow->enableStream(false);
break;
default:
break;
}
}
void INDIStdDevice::streamDisabled()
{
INDI_P *pp;
INDI_E *el;
//pp = dp->findProp("CONNECTION");
//if (!pp) return;
//if (pp->state == PS_OFF) return;
pp = dp->findProp("VIDEO_STREAM");
if (!pp) return;
el = pp->findElement("OFF");
if (!el) return;
if (el->state == PS_ON)
return;
// Turn stream off
pp->newSwitch(1);
pp->newSwitch(1);
}
void INDIStdDevice::updateSequencePrefix(TQString newPrefix)
{
seqPrefix = newPrefix;
seqLister->setNameFilter(TQString("%1_*.fits").arg(seqPrefix));
setCount = 0;
if (ISOMode) return;
seqLister->openURL(Options::fitsSaveDirectory());
checkSeqBoundary(seqLister->items());
}
void INDIStdDevice::checkSeqBoundary(const KFileItemList & items)
{
int newFileIndex;
TQString tempName;
char *tempPrefix = new char[64];
// No need to check when in ISO mode
if (ISOMode)
return;
for ( KFileItemListIterator it( items ) ; it.current() ; ++it )
{
tempName = it.current()->name();
// find the prefix first
if (tempName.find(seqPrefix) == -1)
continue;
strncpy(tempPrefix, tempName.ascii(), 64);
tempPrefix[63] = '\0';
char * t = tempPrefix;
// skip chars
while (*t) { if (isdigit(*t)) break; t++; }
//tempPrefix = t;
newFileIndex = strtol(t, NULL, 10);
if (newFileIndex >= setCount)
setCount = newFileIndex + 1;
}
delete [] (tempPrefix);
}
void INDIStdDevice::updateTime()
{
INDI_P *pp;
INDI_E *lp;
pp = dp->findProp("TIME");
if (!pp) return;
lp = pp->findElement("UTC");
if (!lp) return;
TQTime newTime( ksw->data()->ut().time());
ExtDate newDate( ksw->data()->ut().date());
@ -513,12 +513,12 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d
.arg(newDate.day()).arg(newTime.hour())
.arg(newTime.minute()).arg(newTime.second()));
pp->newText();
pp = dp->findProp("SDTIME");
if (!pp) return;
lp = pp->findElement("LST");
if (!lp) return;
lp->write_w->setText(ksw->LST()->toHMSString());
pp->newText();
}
@ -531,7 +531,7 @@ void INDIStdDevice::updateLocation()
pp = dp->findProp("GEOGRAPHIC_COORD");
if (!pp) return;
dms tempLong (geo->lng()->degree(), geo->lng()->arcmin(), geo->lng()->arcsec());
dms fullCir(360,0,0);
@ -542,26 +542,26 @@ void INDIStdDevice::updateLocation()
if (!latEle) return;
longEle = pp->findElement("LONG");
if (!longEle) return;
longEle->write_w->setText(TQString("%1:%2:%3").arg(tempLong.degree()).arg(tempLong.arcmin()).arg(tempLong.arcsec()));
latEle->write_w->setText(TQString("%1:%2:%3").arg(geo->lat()->degree()).arg(geo->lat()->arcmin()).arg(geo->lat()->arcsec()));
pp->newText();
}
void INDIStdDevice::registerProperty(INDI_P *pp)
{
INDI_E * portEle;
INDIDriver *drivers = ksw->getINDIDriver();
TQString str;
switch (pp->stdID)
{
case DEVICE_PORT:
portEle = pp->findElement("PORT");
if (!portEle) return;
if (drivers)
{
for (unsigned int i=0; i < drivers->devices.size(); i++)
@ -583,14 +583,14 @@ void INDIStdDevice::updateLocation()
break;
}
}
}
}
}
break;
}
}
void INDIStdDevice::initDeviceOptions()
{
@ -678,7 +678,7 @@ bool INDIStdDevice::handleNonSidereal()
{
prop->newSwitch(i);
setMode->newSwitch(trackIndex);
/* Send object name if available */
nameEle = dp->findElem("OBJECT_NAME");
if (nameEle && nameEle->pp->perm != PP_RO)
@ -693,7 +693,7 @@ bool INDIStdDevice::handleNonSidereal()
kdDebug() << "Device doesn't support SOLAR_SYSTEM property, issuing a timer" << endl;
kdDebug() << "Starting timer for object of type " << currentObject->typeName() << endl;
switch (currentObject->type())
{
@ -735,21 +735,21 @@ void INDIStdDevice::timerDone()
el = prop->findElement("TRACK");
if (!el) return;
if (el->state != PS_ON)
{
devTimer->stop();
return;
}
prop = dp->findProp("EQUATORIAL_EOD_COORD");
if (prop == NULL)
{
prop = dp->findProp("EQUATORIAL_COORD");
if (prop) useJ2000 = true;
}
if (prop == NULL || !currentObject)
return;
@ -760,7 +760,7 @@ void INDIStdDevice::timerDone()
kdDebug() << "Timer called, starting processing" << endl;
SkyPoint sp(currentObject->ra(), currentObject->dec());
kdDebug() << "RA: " << currentObject->ra()->toHMSString() << " - DEC: " << currentObject->dec()->toDMSString() << endl;
kdDebug() << "Az: " << currentObject->az()->toHMSString() << " - Alt " << currentObject->alt()->toDMSString() << endl;
@ -778,7 +778,7 @@ void INDIStdDevice::timerDone()
if (!RAEle) return;
DecEle = prop->findElement("DEC");
if (!DecEle) return;
RAEle->write_w->setText(TQString("%1:%2:%3").arg(sp.ra()->hour())
.arg(sp.ra()->minute())
.arg(sp.ra()->second()));
@ -795,29 +795,29 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN
ksw = kswPtr;
stdDev = stdDevPtr;
}
INDIStdProperty::~INDIStdProperty()
INDIStdProperty::~INDIStdProperty()
{
}
void INDIStdProperty::newText()
{
INDI_E *lp;
INDIDriver *drivers = ksw->getINDIDriver();
switch (pp->stdID)
{
/* Set expose duration button to 'cancel' when busy */
case CCD_EXPOSE_DURATION:
pp->set_w->setText(i18n("Cancel"));
break;
/* Save Port name in KStars options */
case DEVICE_PORT:
lp = pp->findElement("PORT");
if (lp && drivers)
if (lp && drivers)
{
for (unsigned int i=0; i < drivers->devices.size(); i++)
{
@ -837,21 +837,21 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN
}
}
}
break;
}
}
bool INDIStdProperty::convertSwitch(int switchIndex, INDI_E *lp)
{
INDI_E *RAEle(NULL), *DecEle(NULL), *AzEle(NULL), *AltEle(NULL), *nameEle(NULL);
INDI_P * prop;
SkyPoint sp;
int selectedCoord=0; /* 0 for Equatorial, 1 forQt::Horizontal */
int selectedCoord=0; /* 0 for Equatorial, 1 for Horizontal */
bool useJ2000 (false);
switch (pp->stdID)
{
/* Handle Slew/Track/Sync */
@ -889,7 +889,7 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN
if (!DecEle) return false;
break;
//Qt::Horizontal
// Horizontal
case 1:
if (prop->perm == PP_RO) return false;
AzEle = prop->findElement("AZ");
@ -898,7 +898,7 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN
if (!AltEle) return false;
break;
}
stdDev->currentObject = ksw->map()->clickedObject();
// Track is similar to slew, except that for non-sidereal objects
// it tracks the objects automatically via a timer.
@ -953,10 +953,10 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN
pp->newSwitch(switchIndex);
prop->newText();
return true;
break;
/* Handle Abort */
case ABORT_MOTION:
kdDebug() << "Stopping timer." << endl;
@ -964,33 +964,33 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN
pp->newSwitch(switchIndex);
return true;
break;
case MOVEMENT:
pp->newSwitch(switchIndex);
break;
default:
return false;
break;
}
return false;
}
// Return true if the complete operation is done here, or false if the operation is to be completed in the properties newSwitch()
bool INDIStdProperty::newSwitch(int id, INDI_E* el)
{
INDI_P *prop;
el=el;
el=el;
switch (pp->stdID)
{
case CONNECTION:
case CONNECTION:
if (id == 1)
stdDev->streamDisabled();
else
{
{
prop = pp->pg->dp->findProp("DEVICE_PORT");
if (prop)
prop->newText();
@ -1005,7 +1005,7 @@ bool INDIStdProperty::newSwitch(int id, INDI_E* el)
default:
break;
}
return false;
}
@ -1014,10 +1014,10 @@ void INDIStdProperty::newTime()
{
INDI_E * timeEle;
INDI_P *SDProp;
timeEle = pp->findElement("UTC");
if (!timeEle) return;
TimeDialog timedialog ( ksw->data()->ut(), ksw );
if ( timedialog.exec() == TQDialog::Accepted )
@ -1032,12 +1032,12 @@ void INDIStdProperty::newTime()
pp->newText();
}
else return;
SDProp = pp->pg->dp->findProp("SDTIME");
if (!SDProp) return;
timeEle = SDProp->findElement("LST");
if (!timeEle) return;
timeEle->write_w->setText(ksw->LST()->toHMSString());
SDProp->newText();
}

@ -117,7 +117,7 @@ public:
*@param elat Ecliptic Latitude
*/
void setEcLat( double elat ) { ep.latitude.setD( elat ); }
/**@return pointer to Ecliptic Heliocentric Longitude coordinate
*/
const dms* helEcLong( void ) const { return &helEcPos.longitude; }
@ -263,7 +263,7 @@ public:
*/
void clearTrail() { Trail.clear(); }
/**@short updateQt::Horizontal coords of the trail
/**@short update Horizontal coords of the trail
*/
void updateTrail( dms *LST, const dms *lat );
@ -278,7 +278,7 @@ public:
*/
void scaleRotateImage( int scale, double imageAngle );
/**Show Solar System object popup menu. Overloaded from virtual
/**Show Solar System object popup menu. Overloaded from virtual
*SkyObject::showPopupMenu()
*@param pmenu pointer to the KSPopupMenu object
*@param pos TQPojnt holding the x,y coordinates for the menu
@ -308,7 +308,7 @@ protected:
// Geocentric ecliptic position, but distance to the Sun
EclipticPosition ep;
// Heliocentric ecliptic position referred to the equinox of the epoch
// Heliocentric ecliptic position referred to the equinox of the epoch
// as obtained from VSOP.
EclipticPosition helEcPos;
TQPtrList<SkyPoint> Trail;
@ -325,8 +325,8 @@ private:
*/
void localizeCoords( const KSNumbers *num, const dms *lat, const dms *LST );
/* Computes the visual magnitude for the major planets.
* @param num pointer to a ksnumbers object. Needed for the saturn rings contribution to
/* Computes the visual magnitude for the major planets.
* @param num pointer to a ksnumbers object. Needed for the saturn rings contribution to
* saturn magnitude.
* @param Earth pointer to an Earth object. Needed to know the distance between the Earth and the
* Sun.

@ -154,7 +154,7 @@ void KStars::slotWizard() {
// Make sure Numbers, Moon, planets, and sky objects are updated immediately
data()->setFullTimeUpdate();
// If the sky is inQt::Horizontal mode and not tracking, reset focus such that
// If the sky is in Horizontal mode and not tracking, reset focus such that
// Alt/Az remain constant.
if ( data()->useDefaultOptions ) {
SkyPoint newPoint;
@ -263,8 +263,8 @@ void KStars::slotINDIConf() {
indioptions.loadOptions();
/*TQStringList filterList;
indiconf.timeCheck->setChecked( Options::indiAutoTime() );
indiconf.GeoCheck->setChecked( Options::indiAutoGeo() );
indiconf.crosshairCheck->setChecked( Options::indiCrosshairs() );
@ -331,7 +331,7 @@ void KStars::slotGeoLocator() {
// Make sure Numbers, Moon, planets, and sky objects are updated immediately
data()->setFullTimeUpdate();
// If the sky is inQt::Horizontal mode and not tracking, reset focus such that
// If the sky is in Horizontal mode and not tracking, reset focus such that
// Alt/Az remain constant.
if ( ! Options::isTracking() && Options::useAltAz() ) {
map()->focus()->HorizontalToEquatorial( LST(), geo()->lat() );
@ -455,10 +455,10 @@ void KStars::slotExportImage() {
"Overwrite it?" ).arg(fileURL.fileName()),
i18n( "Overwrite File?" ),
i18n( "&Overwrite" ) );
if(r==KMessageBox::Cancel) return;
}
exportImage( fileURL.url(), map()->width(), map()->height() );
}
@ -793,7 +793,7 @@ void KStars::slotCoordSys() {
if ( map()->focusObject() ) //simply update focus to focusObject's position
map()->setFocus( map()->focusObject() );
else { //need to recompute focus for unrefracted position
map()->setFocusAltAz( map()->refract( map()->focus()->alt(), false ).Degrees(),
map()->setFocusAltAz( map()->refract( map()->focus()->alt(), false ).Degrees(),
map()->focus()->az()->Degrees() );
map()->focus()->HorizontalToEquatorial( data()->lst(), geo()->lat() );
}
@ -802,7 +802,7 @@ void KStars::slotCoordSys() {
} else {
Options::setUseAltAz( true );
if ( Options::useRefraction() ) {
map()->setFocusAltAz( map()->refract( map()->focus()->alt(), true ).Degrees(),
map()->setFocusAltAz( map()->refract( map()->focus()->alt(), true ).Degrees(),
map()->focus()->az()->Degrees() );
}
actCoordSys->turnOff();
@ -928,7 +928,7 @@ void KStars::slotClearAllTrails() {
if ( map()->focusObject() && map()->focusObject()->isSolarSystem() && data()->temporaryTrail ) {
exOb = map()->focusObject();
}
//Major bodies
if ( !( exOb && exOb->name() == "Moon" ) ) data()->Moon->clearTrail();
if ( !( exOb && exOb->name() == "Sun" ) ) data()->PCat->findByName("Sun")->clearTrail();
@ -940,13 +940,13 @@ void KStars::slotClearAllTrails() {
if ( !( exOb && exOb->name() == "Uranus" ) ) data()->PCat->findByName("Uranus")->clearTrail();
if ( !( exOb && exOb->name() == "Neptune" ) ) data()->PCat->findByName("Neptune")->clearTrail();
if ( !( exOb && exOb->name() == "Pluto" ) ) data()->PCat->findByName("Pluto")->clearTrail();
//Asteroids
for ( KSAsteroid *ast = data()->asteroidList.first(); ast; ast = data()->asteroidList.next() )
for ( KSAsteroid *ast = data()->asteroidList.first(); ast; ast = data()->asteroidList.next() )
if ( !( exOb && exOb->name() == ast->name() ) ) ast->clearTrail();
//Comets
for ( KSComet *com = data()->cometList.first(); com; com = data()->cometList.next() )
for ( KSComet *com = data()->cometList.first(); com; com = data()->cometList.next() )
if ( !( exOb && exOb->name() == com->name() ) ) com->clearTrail();
map()->forceUpdate();

@ -30,7 +30,7 @@
#include <tdelistview.h>
#include <kpushbutton.h>
#include <klineedit.h>
#include <knuminput.h>
#include <knuminput.h>
#include "kstars.h"
#include "kstarsdata.h"
@ -157,7 +157,7 @@ void KStars::setGeoLocation( TQString city, TQString province, TQString country
//make sure planets, etc. are updated immediately
data()->setFullTimeUpdate();
// If the sky is inQt::Horizontal mode and not tracking, reset focus such that
// If the sky is in Horizontal mode and not tracking, reset focus such that
// Alt/Az remain constant.
if ( ! Options::isTracking() && Options::useAltAz() ) {
map()->focus()->HorizontalToEquatorial( LST(), geo()->lat() );
@ -205,7 +205,7 @@ void KStars::writeConfig() {
}
TQString KStars::getOption( const TQString &name ) {
//Some config items are not stored in the Options object while
//Some config items are not stored in the Options object while
//the program is running; catch these here and returntheir current value.
if ( name == "FocusRA" ) { return TQString::number( map()->focus()->ra()->Hours(), 'f', 6 ); }
if ( name == "FocusDec" ) { return TQString::number( map()->focus()->dec()->Degrees(), 'f', 6 ); }
@ -344,12 +344,12 @@ void KStars::loadColorScheme( const TQString _name ) {
TQString name( _name );
TQString filename = name.lower().stripWhiteSpace();
bool ok( false );
//Parse default names which don't follow the regular file-naming scheme
if ( name == i18n("use default color scheme", "Default Colors") ) filename = "default.colors";
if ( name == i18n("use 'star chart' color scheme", "Star Chart") ) filename = "chart.colors";
if ( name == i18n("use 'night vision' color scheme", "Night Vision") ) filename = "night.colors";
if ( name == i18n("use 'star chart' color scheme", "Star Chart") ) filename = "chart.colors";
if ( name == i18n("use 'night vision' color scheme", "Night Vision") ) filename = "night.colors";
//Try the filename if it ends with ".colors"
if ( filename.endsWith( ".colors" ) )
ok = data()->colorScheme()->load( filename );
@ -360,36 +360,36 @@ void KStars::loadColorScheme( const TQString _name ) {
if ( !filename.isEmpty() ) {
for( unsigned int i=0; i<filename.length(); ++i)
if ( filename.at(i)==' ' ) filename.replace( i, 1, "-" );
filename = filename.append( ".colors" );
ok = data()->colorScheme()->load( filename );
}
if ( ! ok ) kdDebug() << i18n( "Unable to load color scheme named %1. Also tried %2." ).arg( name ).arg( filename );
if ( ! ok ) kdDebug() << i18n( "Unable to load color scheme named %1. Also tried %2." ).arg( name ).arg( filename );
}
if ( ok ) {
map()->setStarColorMode( data()->colorScheme()->starColorMode() );
map()->setStarColorIntensity( data()->colorScheme()->starColorIntensity() );
//set the application colors for the Night Vision scheme
if ( Options::darkAppColors() == false && filename == "night.colors" ) {
Options::setDarkAppColors( true );
OriginalPalette = TQApplication::palette();
TQApplication::setPalette( DarkPalette, true );
}
if ( Options::darkAppColors() && filename != "night.colors" ) {
Options::setDarkAppColors( false );
TQApplication::setPalette( OriginalPalette, true );
}
map()->forceUpdate();
}
}
void KStars::exportImage( const TQString url, int w, int h ) {
//If the filename string contains no "/" separators, assume the
//If the filename string contains no "/" separators, assume the
//user wanted to place a file in their home directory.
KURL fileURL;
if ( ! url.contains( "/" ) ) fileURL = TQDir::homeDirPath() + "/" + url;
@ -398,11 +398,11 @@ void KStars::exportImage( const TQString url, int w, int h ) {
KTempFile tmpfile;
TQString fname;
tmpfile.setAutoDelete(true);
TQPixmap skyimage( map()->width(), map()->height() );
TQPixmap outimage( w, h );
outimage.fill();
if ( fileURL.isValid() ) {
if ( fileURL.isLocalFile() ) {
fname = fileURL.path();
@ -424,7 +424,7 @@ void KStars::exportImage( const TQString url, int w, int h ) {
kapp->processEvents(10000);
//skyImage is the size of the sky map. The requested image size is w x h.
//If w x h is smaller than the skymap, then we simply crop the image.
//If w x h is smaller than the skymap, then we simply crop the image.
//If w x h is larger than the skymap, pad the skymap image with a white border.
if ( w == map()->width() && h == map()->height() ) {
outimage = skyimage;
@ -433,20 +433,20 @@ void KStars::exportImage( const TQString url, int w, int h ) {
int sw(map()->width()), sh(map()->height());
if ( w > map()->width() ) {
dx = (w - map()->width())/2;
} else {
sx = (map()->width() - w)/2;
sw = w;
} else {
sx = (map()->width() - w)/2;
sw = w;
}
if ( h > map()->height() ) {
dy = (h - map()->height())/2;
} else {
sy = (map()->height() - h)/2;
sh = h;
} else {
sy = (map()->height() - h)/2;
sh = h;
}
bitBlt( &outimage, dx, dy, &skyimage, sx, sy, sw, sh );
}
if ( ! outimage.save( fname, format ) ) kdDebug() << i18n( "Error: Unable to save image: %1 " ).arg( fname ) << endl;
else kdDebug() << i18n( "Image saved to file: %1" ).arg( fname ) << endl;
@ -462,15 +462,15 @@ void KStars::exportImage( const TQString url, int w, int h ) {
void KStars::printImage( bool usePrintDialog, bool useChartColors ) {
KPrinter printer( true, TQPrinter::HighResolution );
printer.setFullPage( false );
//Set up the printer (either with the Print Dialog,
//Set up the printer (either with the Print Dialog,
//or using the default settings)
bool ok( false );
if ( usePrintDialog )
ok = printer.setup( this, i18n("Print Sky") );
else
else
ok = printer.autoConfigure();
if( ok ) {
kapp->setOverrideCursor( waitCursor );
@ -489,13 +489,13 @@ void KStars::printImage( bool usePrintDialog, bool useChartColors ) {
//(if printing was aborted, the colorscheme is still restored)
if ( useChartColors ) {
data()->colorScheme()->copy( cs );
// restore colormode and colorintensity in skymap
map()->setStarColorMode( cs.starColorMode() );
map()->setStarColorIntensity( cs.starColorIntensity() );
map()->forceUpdate();
}
kapp->restoreOverrideCursor();
}
}
@ -504,13 +504,13 @@ void KStars::startINDI (TQString deviceName, bool useLocal)
{
establishINDI();
if (!indidriver || !indimenu)
{
kdDebug() << "establishINDI() failed." << endl;
return;
}
TQListViewItem *driverItem = NULL;
driverItem = indidriver->localListView->findItem(deviceName, 0);
if (driverItem == NULL)
@ -525,18 +525,18 @@ void KStars::startINDI (TQString deviceName, bool useLocal)
indidriver->localListView->setSelected(driverItem, true);
indidriver->processDeviceStatus(1);
}
// Set custome label for device
indimenu->setCustomLabel(deviceName);
// Select it
indidriver->localListView->setSelected(driverItem, true);
// Start it either locally or as series
if (useLocal)
indidriver->localR->setChecked(true);
else
indidriver->serverR->setChecked(true);
// Run it
indidriver->processDeviceStatus(0);
@ -549,7 +549,7 @@ void KStars::shutdownINDI (TQString deviceName)
kdDebug() << "establishINDI() failed." << endl;
return;
}
TQListViewItem *driverItem = NULL;
driverItem = indidriver->localListView->findItem(deviceName, 0);
if (driverItem == NULL)
@ -567,13 +567,13 @@ void KStars::switchINDI(TQString deviceName, bool turnOn)
{
INDI_D *dev;
INDI_P *prop;
if (!indidriver || !indimenu)
{
kdDebug() << "switchINDI: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -582,33 +582,33 @@ void KStars::switchINDI(TQString deviceName, bool turnOn)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
if (turnOn && dev->isOn() || (!turnOn && !dev->isOn()))
return;
prop = dev->findProp("CONNECTION");
if (!prop) return;
if (turnOn)
prop->newSwitch(0);
else
prop->newSwitch(1);
}
void KStars::setINDIPort(TQString deviceName, TQString port)
{
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "setINDIPort: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -617,34 +617,34 @@ void KStars::setINDIPort(TQString deviceName, TQString port)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("DEVICE_PORT");
if (!prop) return;
el = prop->findElement("PORT");
if (!el->write_w)
return;
el->write_w->setText(port);
prop->newText();
}
void KStars::setINDITargetCoord(TQString deviceName, double RA, double DEC)
{
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "setINDITarget: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -653,33 +653,33 @@ void KStars::setINDITargetCoord(TQString deviceName, double RA, double DEC)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("EQUATORIAL_EOD_COORD");
if (!prop) return;
el = prop->findElement("RA");
if (!el) return;
if (!el->write_w) return;
el->write_w->setText(TQString("%1").arg(RA));
el = prop->findElement("DEC");
if (!el) return;
if (!el->write_w) return;
el->write_w->setText(TQString("%1").arg(DEC));
prop->newText();
}
void KStars::setINDITargetName(TQString deviceName, TQString objectName)
{
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "setINDITarget: establishINDI() failed." << endl;
@ -688,7 +688,7 @@ void KStars::setINDITargetName(TQString deviceName, TQString objectName)
SkyObject *target = data()->objectNamed( objectName );
if (!target) return;
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -697,38 +697,38 @@ void KStars::setINDITargetName(TQString deviceName, TQString objectName)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("EQUATORIAL_EOD_COORD");
if (!prop) return;
el = prop->findElement("RA");
if (!el) return;
if (!el->write_w) return;
el->write_w->setText(TQString("%1").arg(target->ra()->Hours()));
el = prop->findElement("DEC");
if (!el) return;
if (!el->write_w) return;
el->write_w->setText(TQString("%1").arg(target->dec()->Degrees()));
prop->newText();
}
void KStars::setINDIAction(TQString deviceName, TQString action)
{
INDI_D *dev;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "setINDIAction: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -737,28 +737,28 @@ void KStars::setINDIAction(TQString deviceName, TQString action)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
el = dev->findElem(action);
if (!el) return;
el->pp->activateSwitch(action);
}
void KStars::waitForINDIAction(TQString deviceName, TQString action)
{
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "waitForINDIAction: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -767,24 +767,24 @@ void KStars::waitForINDIAction(TQString deviceName, TQString action)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp(action);
if (prop == NULL)
{
el = dev->findElem(action);
if (!el) return;
TQObject::connect(el->pp, TQT_SIGNAL(okState()), this, TQT_SLOT(resumeDCOP(void )));
}
else
TQObject::connect(prop, TQT_SIGNAL(okState()), this, TQT_SLOT(resumeDCOP(void )));
kapp->dcopClient()->suspend();
}
void KStars::setINDIFocusSpeed(TQString deviceName, unsigned int speed)
{
INDI_D *dev;
@ -805,21 +805,21 @@ void KStars::setINDIFocusSpeed(TQString deviceName, unsigned int speed)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("FOCUS_SPEED");
if (!prop) return;
el = prop->findElement("SPEED");
if (!el) return;
if (!el->write_w) return;
el->write_w->setText(TQString("%1").arg(speed));
prop->newText();
}
void KStars::startINDIFocus(TQString deviceName, int focusDir)
{
if (!indidriver || !indimenu)
@ -835,20 +835,20 @@ void KStars::startINDIFocus(TQString deviceName, int focusDir)
}
void KStars::setINDIGeoLocation(TQString deviceName, double longitude, double latitude)
{
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "setINDIGeoLocation: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -857,33 +857,33 @@ void KStars::setINDIGeoLocation(TQString deviceName, double longitude, double la
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("GEOGRAPHICAL_COORD");
if (!prop) return;
el = prop->findElement("LONG");
if (!el) return;
if (!el->write_w) return;
el->write_w->setText(TQString("%1").arg(longitude));
el = prop->findElement("LAT");
if (!el) return;
if (!el->write_w) return;
el->write_w->setText(TQString("%1").arg(latitude));
prop->newText();
}
void KStars::setINDIFocusTimeout(TQString deviceName, int timeout)
{
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "startINDIFocus: establishINDI() failed." << endl;
@ -898,36 +898,36 @@ void KStars::setINDIFocusTimeout(TQString deviceName, int timeout)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("FOCUS_TIMEOUT");
if (!prop)
return;
el = prop->findElement("TIMEOUT");
if (!el) return;
if (el->write_w)
el->write_w->setText(TQString("%1").arg(timeout));
else if (el->spin_w)
el->spin_w->setValue(timeout);
prop->newText();
}
void KStars::startINDIExposure(TQString deviceName, int timeout)
{
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "startINDIExposure: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -936,21 +936,21 @@ void KStars::startINDIExposure(TQString deviceName, int timeout)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("CCD_EXPOSE_DURATION");
if (!prop) return;
el = prop->findElement("EXPOSE_DURATION");
if (!el) return;
if (el->write_w)
el->write_w->setText(TQString("%1").arg(timeout));
else if (el->spin_w)
el->spin_w->setValue(timeout);
prop->newText();
}
void KStars::setINDIFilterNum(TQString deviceName, int filter_num)
@ -958,13 +958,13 @@ void KStars::setINDIFilterNum(TQString deviceName, int filter_num)
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "setINDIFilterNum: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -973,34 +973,34 @@ void KStars::setINDIFilterNum(TQString deviceName, int filter_num)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("FILTER_SLOT");
if (!prop) return;
el = prop->findElement("SLOT");
if (!el) return;
if (el->write_w)
el->write_w->setText(TQString("%1").arg(filter_num));
else if (el->spin_w)
el->spin_w->setValue(filter_num);
prop->newText();
}
void KStars::setINDIUTC(TQString deviceName, TQString UTCDateTime)
{
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "startINDIUTC: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -1009,16 +1009,16 @@ void KStars::setINDIUTC(TQString deviceName, TQString UTCDateTime)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("TIME");
if (!prop) return;
el = prop->findElement("UTC");
if (!el) return;
if (!el->write_w) return;
el->write_w->setText(UTCDateTime);
prop->newText();
}
@ -1027,7 +1027,7 @@ void KStars::setINDIScopeAction(TQString deviceName, TQString action)
{
setINDIAction(deviceName, action);
}
void KStars::setINDIFrameType(TQString deviceName, TQString type)
{
setINDIAction(deviceName, type);
@ -1038,13 +1038,13 @@ void KStars::setINDICCDTemp(TQString deviceName, int temp)
INDI_D *dev;
INDI_P *prop;
INDI_E *el;
if (!indidriver || !indimenu)
{
kdDebug() << "setINDICCDTemp: establishINDI() failed." << endl;
return;
}
dev = indimenu->findDevice(deviceName);
if (!dev)
dev = indimenu->findDeviceByLabel(deviceName);
@ -1053,19 +1053,19 @@ void KStars::setINDICCDTemp(TQString deviceName, int temp)
kdDebug() << "Device " << deviceName << " not found!" << endl;
return;
}
prop = dev->findProp("CCD_TEMPERATURE");
if (!prop) return;
el = prop->findElement("TEMPERATURE");
if (!el) return;
if (el->write_w)
el->write_w->setText(TQString("%1").arg(temp));
else if (el->spin_w)
el->spin_w->setValue(temp);
prop->newText();
}

@ -30,7 +30,7 @@
<string>Correct coordinates of objects for the effects of the atmosphere</string>
</property>
<property name="whatsThis" stdset="0">
<string>The atmosphere bends light passing through it, like a lens. If this item is checked, this "atmospheric refraction" will be simulated in the sky map. Note that this correction is only applied when using theQt::Horizontal coordinate system.</string>
<string>The atmosphere bends light passing through it, like a lens. If this item is checked, this "atmospheric refraction" will be simulated in the sky map. Note that this correction is only applied when using the Horizontal coordinate system.</string>
</property>
</widget>
<widget class="TQCheckBox">

@ -48,7 +48,7 @@ class dms;
class PlanetCatalog : public TQObject {
Q_OBJECT
public:
/**Constructor. */
@ -60,7 +60,7 @@ class PlanetCatalog : public TQObject {
/**Loads all planetary data from files on disk into the appropriate objects. */
bool initialize();
/**Add pointers to the planetary objects to the ObjNames list.
/**Add pointers to the planetary objects to the ObjNames list.
*@p ObjNames the list of all named objects to which we will add the planets.
*/
void addObject( ObjectNameList &ObjNames ) const;
@ -78,13 +78,13 @@ class PlanetCatalog : public TQObject {
/**@return pointer to the Earth. (must not be const because we call findPosition on it in KSPlanetBase::updateCoords() )*/
KSPlanet *earth() { return Earth; }
/**Compute the presentQt::Horizontal coordinates of all planets.
/**Compute the present Horizontal coordinates of all planets.
*@p LST pointer to the current local sidereal time
*@p lat pointer to the current geographic latitude
*/
void EquatorialToHorizontal( dms *LST, const dms *lat );
/**@return true if the SkyObject argument is a planet.
/**@return true if the SkyObject argument is a planet.
*@p so pointer to the SkyObject to be tested
*/
bool isPlanet(SkyObject *so) const;
@ -95,8 +95,8 @@ class PlanetCatalog : public TQObject {
*/
KSPlanetBase *findByName( const TQString n) const;
/**@return a pointer to the planet closest to the given SkyPoint
*(within a maximum angular search radius)
/**@return a pointer to the planet closest to the given SkyPoint
*(within a maximum angular search radius)
*@p p the Sky point to find a planet near
*@p r the maximum angular search radius
*/

@ -53,13 +53,13 @@
SkyMap::SkyMap(KStarsData *d, TQWidget *parent, const char *name )
: TQWidget (parent,name), computeSkymap(true), angularDistanceMode(false),
ksw(0), data(d), pmenu(0), sky(0), sky2(0), IBoxes(0),
ksw(0), data(d), pmenu(0), sky(0), sky2(0), IBoxes(0),
ClickedObject(0), FocusObject(0), TransientObject(0),
starpix(0), pts(0), sp(0)
{
if ( parent ) ksw = (KStars*) parent->parent();
else ksw = 0;
pts = new TQPointArray( 2000 ); // points for milkyway and horizon
sp = new SkyPoint(); // needed by coordinate grid
@ -88,12 +88,12 @@ SkyMap::SkyMap(KStarsData *d, TQWidget *parent, const char *name )
sky = new TQPixmap();
sky2 = new TQPixmap();
pmenu = new KSPopupMenu( ksw );
//Initialize Transient label stuff
TransientTimeout = 100; //fade label color every 0.2 sec
connect( &HoverTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransientLabel() ) );
connect( &TransientTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransientTimeout() ) );
IBoxes = new InfoBoxes( Options::windowWidth(), Options::windowHeight(),
Options::positionTimeBox(), Options::shadeTimeBox(),
Options::positionGeoBox(), Options::shadeGeoBox(),
@ -173,9 +173,9 @@ void SkyMap::showFocusCoords( bool coordsOnly ) {
//display object info in infoBoxes
TQString oname;
oname = i18n( "nothing" );
if ( focusObject() != NULL && Options::isTracking() )
if ( focusObject() != NULL && Options::isTracking() )
oname = focusObject()->translatedLongName();
infoBoxes()->focusObjChanged(oname);
}
@ -421,24 +421,24 @@ SkyObject* SkyMap::objectNearest( SkyPoint *p ) {
void SkyMap::slotTransientLabel( void ) {
//This function is only called if the HoverTimer manages to timeout.
//(HoverTimer is restarted with every mouseMoveEvent; so if it times
//(HoverTimer is restarted with every mouseMoveEvent; so if it times
//out, that means there was no mouse movement for HOVER_INTERVAL msec.)
//Identify the object nearest to the mouse cursor as the
//TransientObject. The TransientObject is automatically labeled
//TransientObject. The TransientObject is automatically labeled
//in SkyMap::paintEvent().
//Note that when the TransientObject pointer is not NULL, the next
//mouseMoveEvent calls fadeTransientLabel(), which will fade out the
//Note that when the TransientObject pointer is not NULL, the next
//mouseMoveEvent calls fadeTransientLabel(), which will fade out the
//TransientLabel and then set TransientObject to NULL.
//
//Do not show a transient label if the map is in motion, or if the mouse
//Do not show a transient label if the map is in motion, or if the mouse
//pointer is below the opaque horizon, or if the object has a permanent label
if ( ! slewing && ! ( Options::useAltAz() && Options::showGround() &&
if ( ! slewing && ! ( Options::useAltAz() && Options::showGround() &&
mousePoint()->alt()->Degrees() < 0.0 ) ) {
SkyObject *so = objectNearest( mousePoint() );
if ( so && ! isObjectLabeled( so ) ) {
setTransientObject( so );
TransientColor = data->colorScheme()->colorNamed( "UserLabelColor" );
if ( TransientTimer.isActive() ) TransientTimer.stop();
update();
@ -460,38 +460,38 @@ void SkyMap::slotTransientTimeout( void ) {
//to fade the labels, we will need to smoothly transition from UserLabelColor to SkyColor.
TQColor c1 = data->colorScheme()->colorNamed( "UserLabelColor" );
TQColor c2 = data->colorScheme()->colorNamed( "SkyColor" );
int dRed = ( c2.red() - c1.red() )/20;
int dGreen = ( c2.green() - c1.green() )/20;
int dBlue = ( c2.blue() - c1.blue() )/20;
int newRed = TransientColor.red() + dRed;
int newGreen = TransientColor.green() + dGreen;
int newBlue = TransientColor.blue() + dBlue;
//Check to see if we have arrived at the target color (SkyColor).
//If so, point TransientObject to NULL.
if ( abs(newRed-c2.red()) < abs(dRed) || abs(newGreen-c2.green()) < abs(dGreen) || abs(newBlue-c2.blue()) < abs(dBlue) ) {
setTransientObject( NULL );
TransientTimer.stop();
} else {
} else {
TransientColor.setRgb( newRed, newGreen, newBlue );
}
update();
}
void SkyMap::setFocusObject( SkyObject *o ) {
FocusObject = o;
if ( FocusObject )
void SkyMap::setFocusObject( SkyObject *o ) {
FocusObject = o;
if ( FocusObject )
Options::setFocusObject( FocusObject->name() );
else
else
Options::setFocusObject( i18n( "nothing" ) );
}
void SkyMap::slotCenter( void ) {
setFocusPoint( clickedPoint() );
if ( Options::useAltAz() )
if ( Options::useAltAz() )
focusPoint()->EquatorialToHorizontal( data->LST, data->geo()->lat() );
//clear the planet trail of old focusObject, if it was temporary
@ -536,7 +536,7 @@ void SkyMap::slotCenter( void ) {
}
//update the destination to the selected coordinates
if ( Options::useAltAz() ) {
if ( Options::useAltAz() ) {
if ( Options::useRefraction() )
setDestinationAltAz( refract( focusPoint()->alt(), true ).Degrees(), focusPoint()->az()->Degrees() );
else
@ -558,7 +558,7 @@ void SkyMap::slotCenter( void ) {
s = focusPoint()->ra()->toHMSString() + ", " + focusPoint()->dec()->toDMSString(true);
ksw->statusBar()->changeItem( s, 2 );
}
showFocusCoords(); //update FocusBox
}
@ -598,7 +598,7 @@ void SkyMap::slotDSS( void ) {
//concat all the segments into the kview command line:
KURL url (URLprefix + RAString + DecString + URLsuffix);
TQString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." );
new ImageViewer (&url, message, this);
}
@ -640,7 +640,7 @@ void SkyMap::slotDSS2( void ) {
//concat all the segments into the kview command line:
KURL url (URLprefix + RAString + DecString + URLsuffix);
TQString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." );
new ImageViewer (&url, message, this);
}
@ -665,7 +665,7 @@ void SkyMap::slotEndAngularDistance(void) {
if(angularDistanceMode) {
if ( SkyObject *so = objectNearest( mousePoint() ) ) {
angularDistance = so->angularDistanceTo( previousClickedPoint() );
ksw->statusBar()->changeItem( so->translatedLongName() +
ksw->statusBar()->changeItem( so->translatedLongName() +
" " +
i18n("Angular distance: " ) +
angularDistance.toDMSString(), 0 );
@ -837,7 +837,7 @@ void SkyMap::updateFocus() {
if ( Options::useAltAz() ) {
//Tracking any object in Alt/Az mode requires focus updates
double dAlt = focusObject()->alt()->Degrees();
if ( Options::useRefraction() )
if ( Options::useRefraction() )
dAlt = refract( focusObject()->alt(), true ).Degrees();
setFocusAltAz( dAlt, focusObject()->az()->Degrees() );
focus()->HorizontalToEquatorial( data->LST, data->geo()->lat() );
@ -921,9 +921,9 @@ void SkyMap::slewFocus( void ) {
slewing = true;
//since we are slewing, fade out the transient label
if ( transientObject() && ! TransientTimer.isActive() )
if ( transientObject() && ! TransientTimer.isActive() )
fadeTransientLabel();
forceUpdate();
kapp->processEvents(10); //keep up with other stuff
@ -952,7 +952,7 @@ void SkyMap::slewFocus( void ) {
setFocus( destination() );
focus()->EquatorialToHorizontal( data->LST, data->geo()->lat() );
}
data->HourAngle->setH( data->LST->Hours() - focus()->ra()->Hours() );
slewing = false;
@ -965,7 +965,7 @@ void SkyMap::slewFocus( void ) {
//we want to attach a label to the nearest object.
if ( Options::useHoverLabel() )
HoverTimer.start( HOVER_INTERVAL, true );
forceUpdate();
}
}
@ -985,7 +985,7 @@ double SkyMap::findPA( SkyObject *o, int x, int y, double scale ) {
SkyPoint test( o->ra()->Hours(), newDec );
if ( Options::useAltAz() ) test.EquatorialToHorizontal( data->LST, data->geo()->lat() );
TQPoint t = getXY( &test, Options::useAltAz(), Options::useRefraction(), scale );
double dx = double( t.x() - x );
double dx = double( t.x() - x );
double dy = double( y - t.y() ); //backwards because TQWidget Y-axis increases to the bottom
double north;
if ( dy ) {
@ -1184,7 +1184,7 @@ void SkyMap::forceUpdate( bool now )
}
float SkyMap::fov() {
if ( width() >= height() )
if ( width() >= height() )
return 28.65*width()/Options::zoomFactor();
else
return 28.65*height()/Options::zoomFactor();
@ -1195,12 +1195,12 @@ bool SkyMap::checkVisibility( SkyPoint *p, float FOV, double XMax ) {
bool useAltAz = Options::useAltAz();
//Skip objects below the horizon if:
// + usingQt::Horizontal coords,
// + using Horizontal coords,
// + the ground is drawn,
// + and either of the following is true:
// - focus is above the horizon
// - field of view is larger than 50 degrees
if ( useAltAz && Options::showGround() && p->alt()->Degrees() < -2.0
if ( useAltAz && Options::showGround() && p->alt()->Degrees() < -2.0
&& ( focus()->alt()->Degrees() > 0. || FOV > 50. ) ) return false;
if ( useAltAz ) {
@ -1237,7 +1237,7 @@ bool SkyMap::unusablePoint (double dx, double dy)
void SkyMap::setZoomMouseCursor()
{
mouseMoveCursor = false; // no mousemove cursor
TQPainter p;
TQPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems)
// the center of the pixmap
@ -1262,7 +1262,7 @@ void SkyMap::setZoomMouseCursor()
p.drawEllipse( mx - 7, my - 7, 14, 14 );
p.drawLine( mx + 5, my + 5, mx + 12, my + 12 );
p.end();
cursorPix.setMask (mask); // set the mask
TQCursor cursor (cursorPix);
setCursor (cursor);
@ -1271,7 +1271,7 @@ void SkyMap::setZoomMouseCursor()
void SkyMap::setDefaultMouseCursor()
{
mouseMoveCursor = false; // no mousemove cursor
TQPainter p;
TQPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems)
// the center of the pixmap

@ -24,7 +24,7 @@
#include "skypoint.h"
#include "starpixmap.h"
#define HOVER_INTERVAL 500
#define HOVER_INTERVAL 500
class TQPainter;
class TQPaintDevice;
@ -58,7 +58,7 @@ class DeepSkyObject;
class SkyMap : public TQWidget {
Q_OBJECT
public:
/**
*Constructor. Read stored settings from TDEConfig object (focus position,
@ -84,7 +84,7 @@ public:
*/
void updateFocus();
/**@short Retrieve the Focus point; the position on the sky at the
/**@short Retrieve the Focus point; the position on the sky at the
*center of the skymap.
*@return a pointer to the central focus point of the sky map
*/
@ -93,7 +93,7 @@ public:
/**@short retrieve the Destination position.
*
*The Destination is the point on the sky to which the focus will
*be moved.
*be moved.
*
*@return a pointer to the destination point of the sky map
*/
@ -101,9 +101,9 @@ public:
/**@short retrieve the FocusPoint position.
*
*The FocusPoint stores the position on the sky that is to be
*focused next. This is not exactly the same as the Destination
*point, because when the Destination is set, it will begin slewing
*The FocusPoint stores the position on the sky that is to be
*focused next. This is not exactly the same as the Destination
*point, because when the Destination is set, it will begin slewing
*immediately.
*
*@return a pointer to the sky point which is to be focused next.
@ -112,8 +112,8 @@ public:
/**@short retrieve the last focus posiiton.
*
*We store the previous focus point to determine how much the focus
*position has changed.
*We store the previous focus point to determine how much the focus
*position has changed.
*
*@return a pointer to the previous central focus point of the sky map
*/
@ -126,7 +126,7 @@ public:
/**@short sets the focus point of the skymap, using ra/dec coordinates
*
*@note This function behaves essentially like the above function.
*@note This function behaves essentially like the above function.
*It differs only in the data types of its arguments.
*
*@param ra the new right ascension
@ -136,7 +136,7 @@ public:
/**@short sets the focus point of the sky map, using ra/dec coordinates
*
*@note This function behaves essentially like the above function.
*@note This function behaves essentially like the above function.
*It differs only in the data types of its arguments.
*
*@param ra the new right ascension
@ -152,7 +152,7 @@ public:
/**@short sets the central focus point of the sky map, using alt/az coordinates
*
*@note This function behaves essentially like the above function.
*@note This function behaves essentially like the above function.
*It differs only in the data types of its arguments.
*
*@param alt the new altitude
@ -163,7 +163,7 @@ public:
/**@short sets the destination point of the sky map.
*@note setDestination() emits the destinationChanged() SIGNAL,
*which triggers the TQT_SLOT function SkyMap::slewFocus(). This
*function iteratively steps the Focus point toward Destination,
*function iteratively steps the Focus point toward Destination,
*repainting the sky at each step (if Options::useAnimatedSlewing()==true).
*@param f a pointer to the SkyPoint the map should slew to
*/
@ -171,7 +171,7 @@ public:
/**@short sets the destination point of the skymap, using ra/dec coordinates.
*
*@note This function behaves essentially like the above function.
*@note This function behaves essentially like the above function.
*It differs only in the data types of its arguments.
*
*@param ra the new right ascension
@ -181,7 +181,7 @@ public:
/**@short sets the destination point of the sky map, using ra/dec coordinates
*
*@note This function behaves essentially like the above function.
*@note This function behaves essentially like the above function.
*It differs only in the data types of its arguments.
*
*@param ra the new right ascension
@ -197,7 +197,7 @@ public:
/**@short sets the destination point of the sky map, using its alt/az coordinates.
*
*@note This function behaves essentially like the above function.
*@note This function behaves essentially like the above function.
*It differs only in the data types of its arguments.
*
*@param alt the new altitude
@ -230,7 +230,7 @@ public:
void setClickedPoint( SkyPoint *f ) { ClickedPoint.set( f->ra(), f->dec() ); }
/**@short Retrieve the PreviousClickedPoint position.
*@return a pointer to PreviousClickedPoint, the sky coordinates of the
*@return a pointer to PreviousClickedPoint, the sky coordinates of the
*penultimate mouse click.
*/
SkyPoint* previousClickedPoint() { return &PreviousClickedPoint; }
@ -243,32 +243,32 @@ public:
/**@short Retrieve a pointer to MousePoint, the sky coordinates of the mouse cursor.
*
*When the user moves the mouse in the sky map, the sky coordinates of the mouse
*cursor are continually stored in MousePoint by the function mouseMoveEvent().
*cursor are continually stored in MousePoint by the function mouseMoveEvent().
*@return a pointer to MousePoint, the current sky coordinates of the mouse cursor.
*/
SkyPoint* mousePoint() { return &MousePoint; }
/**@short Set the MousePoint to the skypoint given as an argument.
*@note In this function, the argument is a SkyPoint, not a pointer to a SkyPoint.
*This is because setMousePoint always uses the function dXdYToRaDec() for the
*This is because setMousePoint always uses the function dXdYToRaDec() for the
*argument, and this function returns by value.
*@param f the new MousePoint (typically the output of dXdYToRaDec()).
*/
void setMousePoint( SkyPoint f ) { MousePoint.set( f.ra(), f.dec() ); }
/**@short Attempt to find a named object near the SkyPoint argument.
/**@short Attempt to find a named object near the SkyPoint argument.
*
*There is a object-type preference order for selecting among nearby objects:
*objects of a less-preferred type will be selected only if they are twice as close
*to the SkyPoint as the nearest object of a more-preferred type. The order (from
*most to least preferred) is: Solar System, custom object, Messier,
*NGC, IC, stars. If no named object was found within the zoom-dependent maximum
*There is a object-type preference order for selecting among nearby objects:
*objects of a less-preferred type will be selected only if they are twice as close
*to the SkyPoint as the nearest object of a more-preferred type. The order (from
*most to least preferred) is: Solar System, custom object, Messier,
*NGC, IC, stars. If no named object was found within the zoom-dependent maximum
*search radius of about 4 pixels, then the function returns a NULL pointer.
*
*@note This code used to be in mousePressEvent(), but now we need it in
*@note This code used to be in mousePressEvent(), but now we need it in
*slotTransientLabel() and other parts of the code as well.
*@param p pointer to the skypoint around which to search for an object.
*@return a pointer to the nearest named object to point p, or NULL if
*@return a pointer to the nearest named object to point p, or NULL if
*no object was found.
*/
SkyObject* objectNearest( SkyPoint *p );
@ -291,7 +291,7 @@ public:
*
*If the user centers the sky map on an object (by double-clicking or using the
*Find Object dialog), a pointer to the "focused" object is stored in
*the private member FocusObject. This function returns a pointer to the
*the private member FocusObject. This function returns a pointer to the
*FocusObject, or NULL if there is not FocusObject.
*@return a pointer to the object at the center of the sky map.
*/
@ -305,19 +305,19 @@ public:
/**@short Retrieve the object nearest to the point at which the mouse has hovered.
*
*When the mouse hovers near an object, it is set as the TransientObject (so named
*because a transient name label will be attached to it). This function returns
*because a transient name label will be attached to it). This function returns
*a pointer to the current TransientObject, or NULL if no TransientObject is set.
*@return pointer to the SkyObject nearest to the mouse hover position.
*@see SkyMap::slotTransientLabel()
*/
SkyObject* transientObject( void ) const { return TransientObject; }
/**@short Set the TransientObject pointer to the argument.
*@param o pointer to the SkyObject to be assigned as the TransientObject.
*/
void setTransientObject( SkyObject *o ) { TransientObject = o; }
/**@return the current setting of the color mode for stars (0=real colors,
/**@return the current setting of the color mode for stars (0=real colors,
*1=solid red, 2=solid white or 3=solid black).
*/
int starColorMode( void ) const { return starpix->mode(); }
@ -329,7 +329,7 @@ public:
/**@short Retrieve the color-intensity value for stars.
*
*When using the "realistic colors" mode for stars, stars are rendered as
*When using the "realistic colors" mode for stars, stars are rendered as
*white circles with a colored border. The "color intensity" setting modulates
*the relative thickness of this colored border, so it effectively adjusts
*the color-saturation level for star images.
@ -339,7 +339,7 @@ public:
/**@short Sets the color-intensity value for stars.
*
*When using the "realistic colors" mode for stars, stars are rendered as
*When using the "realistic colors" mode for stars, stars are rendered as
*white circles with a colored border. The "color intensity" setting modulates
*the relative thickness of this colored border, so it effectively adjusts
*the color-saturation level for star images.
@ -348,7 +348,7 @@ public:
/**@short set up variables for the checkVisibility function.
*
*checkVisibility() uses some variables to assist it in determining whether points are
*checkVisibility() uses some variables to assist it in determining whether points are
*on-screen or not. The values of these variables do not depend on which object is being tested,
*so we save a lot of time by bringing the code which sets their values outside of checkVisibility()
*(which must be run for each and every SkyPoint). setMapGeometry() is called once in paintEvent().
@ -365,7 +365,7 @@ public:
/**@short Call keyPressEvent, as if the key given as an argument had been pressed. */
void invokeKey( int key );
/**@return true if the angular distance measuring mode is on
/**@return true if the angular distance measuring mode is on
*/
bool isAngleMode() const {return angularDistanceMode;}
@ -388,9 +388,9 @@ public:
/**@short Draw the current Sky map to a pixmap which is to be printed or exported to a file.
*
*Each of the draw functions is called, with a value for the Scale parameter computed to fit the
*Each of the draw functions is called, with a value for the Scale parameter computed to fit the
*geometry of the TQPaintDevice.
*@param pd pointer to the TQPaintDevice on which to draw.
*@param pd pointer to the TQPaintDevice on which to draw.
*@see KStars::slotExportImage()
*@see KStars::slotPrint()
*/
@ -400,7 +400,7 @@ public slots:
/**@short This overloaded function is used internally to resize the Sky pixmap to match the window size.
*/
virtual void setGeometry( int x, int y, int w, int h );
/**@short This overloaded function is used internally to resize the Sky pixmap to match the window size.
*
*This function behaves essentially like the above function. It differs only in the data types *of its arguments.
@ -419,13 +419,13 @@ public slots:
*/
void forceUpdateNow() { forceUpdate( true ); }
/**Estimate the effect of atmospheric refraction on object positions. Refraction
*affects only the Altitude angle of objects. Also, the correction should not be applied
/**Estimate the effect of atmospheric refraction on object positions. Refraction
*affects only the Altitude angle of objects. Also, the correction should not be applied
*to the horizon, which is not beyond the atmosphere.
*
*To estimate refraction, we use a simple analytic equation. To save time, we store
*values of the correction for 0.5-degree Altitude intervals. Individual objects are then
*simply assigned the nearest stored value. The precaclulated values are stored in the
*values of the correction for 0.5-degree Altitude intervals. Individual objects are then
*simply assigned the nearest stored value. The precaclulated values are stored in the
*RefractCorr1 and RefractCorr2 arrays, and these are initialized in the SkyMap constructor.
*
*There are two cases: the true altitude is known, and the apparent altitude is needed;
@ -436,17 +436,17 @@ public slots:
*/
dms refract( const dms *alt, bool findApparent );
/**Step the Focus point toward the Destination point. Do this iteratively, redrawing the Sky
/**Step the Focus point toward the Destination point. Do this iteratively, redrawing the Sky
*Map after each step, until the Focus point is within 1 step of the Destination point.
*For the final step, snap directly to Destination, and redraw the map.
*/
void slewFocus( void );
/**@short Center the display at the point ClickedPoint.
/**@short Center the display at the point ClickedPoint.
*
*The essential part of the function is to simply set the Destination point, which will emit
*The essential part of the function is to simply set the Destination point, which will emit
*the destinationChanged() SIGNAL, which triggers the slewFocus() SLOT. Additionally, this
*function performs some bookkeeping tasks, such updating whether we are tracking the new
*function performs some bookkeeping tasks, such updating whether we are tracking the new
*object/position, adding a Planet Trail if required, etc.
*
*@see destinationChanged()
@ -454,38 +454,38 @@ public slots:
*/
void slotCenter( void );
/**@short Popup menu function: Display 1st-Generation DSS image with the Image Viewer.
/**@short Popup menu function: Display 1st-Generation DSS image with the Image Viewer.
*@note the URL is generated using the coordinates of ClickedPoint.
*/
void slotDSS( void );
/**@short Popup menu function: Display 2nd-Generation DSS image with the Image Viewer.
/**@short Popup menu function: Display 2nd-Generation DSS image with the Image Viewer.
*@note the URL is generated using the coordinates of ClickedPoint.
*/
void slotDSS2( void );
/**@short Popup menu function: Show webpage about ClickedObject
*(only available for some objects).
/**@short Popup menu function: Show webpage about ClickedObject
*(only available for some objects).
*@param id the popup-menu ID entry of the selected information page
*/
void slotInfo( int id );
/**@short Popup menu function: Show image of ClickedObject
*(only available for some objects).
/**@short Popup menu function: Show image of ClickedObject
*(only available for some objects).
*@param id the popup-menu ID entry of the selected image
*/
void slotImage( int id );
/**@short Popup menu function: Show the Detailed Information window for ClickedObject.
/**@short Popup menu function: Show the Detailed Information window for ClickedObject.
*/
void slotDetail( void );
/**Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which
/**Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which
*have User Labels attached.
*/
void slotAddObjectLabel( void );
/**Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which
/**Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which
*have User Labels attached.
*/
void slotRemoveObjectLabel( void );
@ -497,7 +497,7 @@ public slots:
*@see KSPlanetBase::addToTrail()
*/
void slotAddPlanetTrail( void );
/**@short Remove the PlanetTrail from ClickedObject.
*@note The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as
*the trail is empty, no new points will be automatically appended.
@ -505,26 +505,26 @@ public slots:
*/
void slotRemovePlanetTrail( void );
/**Popup menu function: Add a custom Image or Information URL.
/**Popup menu function: Add a custom Image or Information URL.
*Opens the AddLinkDialog window.
*/
void addLink( void );
/**Checks whether the timestep exceeds a threshold value. If so, sets
*ClockSlewing=true and sets the SimClock to ManualMode.
*ClockSlewing=true and sets the SimClock to ManualMode.
*/
void slotClockSlewing();
/**Enables the angular distance measuring mode. It saves the first
/**Enables the angular distance measuring mode. It saves the first
*position of the ruler in a SkyPoint. It makes difference between
*having clicked on the skymap and not having done so */
void slotBeginAngularDistance(void);
/**Computes the angular distance, prints the result in the status
/**Computes the angular distance, prints the result in the status
*bar and disables the angular distance measuring mode
*If the user has clicked on the map the status bar shows the
*name of the clicked object plus the angular distance. If
*the user did not clicked on the map, just pressed ], only
*If the user has clicked on the map the status bar shows the
*name of the clicked object plus the angular distance. If
*the user did not clicked on the map, just pressed ], only
*the angular distance is printed */
void slotEndAngularDistance(void);
@ -533,15 +533,15 @@ public slots:
void slotCancelAngularDistance(void);
signals:
/**Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination
*point is changed, slewFocus() will iteratively step the Focus toward Destination
/**Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination
*point is changed, slewFocus() will iteratively step the Focus toward Destination
*until it is reached.
*@see SkyMap::setDestination()
*@see SkyMap::slewFocus()
*/
void destinationChanged();
/**Emitted by SkyMap::addLink(). This Signal is used to inform the Details Dialog
/**Emitted by SkyMap::addLink(). This Signal is used to inform the Details Dialog
*that it needs to update its lists of URL links.
*/
void linkAdded();
@ -550,12 +550,12 @@ protected:
/**Draw the Sky, and all objects in it. */
virtual void paintEvent( TQPaintEvent *e );
/**Process keystrokes:
/**Process keystrokes:
*@li arrow keys Slew the map
*@li +/- keys Zoom in and out
*@li +/- keys Zoom in and out
*@li N/E/S/W keys Go to the cardinal points on the Horizon
*@li Z Go to the Zenith
*@li <i>Space</i> Toggle betweenQt::Horizontal and Equatorial coordinate systems
*@li <i>Space</i> Toggle between Horizontal and Equatorial coordinate systems
*@li 0-9 Go to a major Solar System body (0=Sun; 1-9 are the major planets, except 3=Moon)
*@li [ Place starting point for measuring an angular distance
*@li ] End point for Angular Distance; display measurement.
@ -572,7 +572,7 @@ protected:
/**Determine RA, Dec coordinates of clicked location. Find the SkyObject
*which is nearest to the clicked location.
*
*If left-clicked: Set set mouseButtonDown==true, slewing==true; display
*If left-clicked: Set set mouseButtonDown==true, slewing==true; display
*nearest object name in status bar.
*If right-clicked: display popup menu appropriate for nearest object.
*/
@ -588,10 +588,10 @@ protected:
*@li If Angle-measurement mode is active, update the end-ruler point to the mouse cursor,
*and continue this function.
*@li If we are dragging an InfoBox, simply redraw the screen and return.
*@li If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen,
*@li If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen,
*and return.
*@li If dragging the mouse in the map, update focus such that RA, Dec under the mouse
*cursor remains constant.
*@li If dragging the mouse in the map, update focus such that RA, Dec under the mouse
*cursor remains constant.
*@li If just moving the mouse, simply update the curso coordinates in the status bar.
*/
virtual void mouseMoveEvent( TQMouseEvent *e );
@ -599,25 +599,25 @@ protected:
/**Zoom in and out with the mouse wheel. */
virtual void wheelEvent( TQWheelEvent *e );
/**If the skymap will be resized, the sky must be new computed. So this
/**If the skymap will be resized, the sky must be new computed. So this
*function calls explicitly new computing of the skymap.
*It also repositions the InfoBoxes, if they are anchored to a window edge.
*It also repositions the InfoBoxes, if they are anchored to a window edge.
*/
virtual void resizeEvent( TQResizeEvent * );
private slots:
/**Gradually fade the Transient Hover Label into the background sky color, and
*redraw the screen after each color change. Once it has faded fully, set the
*redraw the screen after each color change. Once it has faded fully, set the
*TransientObject pointer to NULL to remove the label.
*/
void slotTransientTimeout();
/**@short attach transient label to object nearest the mouse cursor.
*This slot is connected to the timeout() signal of the HoverTimer, which is restarted
*in every mouseMoveEvent(). So this slot is executed only if the mouse does not move for
*HOVER_INTERVAL msec. It points TransientObject at the SkyObject nearest the
*in every mouseMoveEvent(). So this slot is executed only if the mouse does not move for
*HOVER_INTERVAL msec. It points TransientObject at the SkyObject nearest the
*mouse cursor, and the TransientObject is subsequently labeled in paintEvent().
*Note that when TransientObject is not NULL, the next mouseMoveEvent() calls
*Note that when TransientObject is not NULL, the next mouseMoveEvent() calls
*fadeTransientLabel(), which fades the label color and then sets TransientLabel to NULL.
*@sa mouseMoveEvent(), paintEvent(), slotTransientTimeout(), fadeTransientLabel()
*/
@ -628,7 +628,7 @@ private slots:
private:
// Drawing functions. Each takes a TQPainter reference and a scaling factor as arguments.
// The TQPainter is usually the Sky pixmap, but it can also be the Export-to-Image pixmap, or the
// The TQPainter is usually the Sky pixmap, but it can also be the Export-to-Image pixmap, or the
// Printer device. The scaling factors are 1.0 by default (for screen images). The scale factor
// is used to resize the image to fit the page when printing or exporting to a file.
@ -637,56 +637,56 @@ private:
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawMilkyWay( TQPainter& psky, double scale = 1.0 );
/**@short Draw the coordinate system grid lines.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawCoordinateGrid( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Celestial Equator line.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawEquator( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Ecliptic line.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawEcliptic( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Horizon Line, the compass point labels, and the opaque ground.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawHorizon( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Constellation Lines.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawConstellationLines( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Constellation Boundaries.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawConstellationBoundaries( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Constellation Names.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawConstellationNames( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Stars.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawStars( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Deep-Sky Objects.
/**@short Draw the Deep-Sky Objects.
*
*Calls drawDeepSkyCatalog() for each catalog (Messier/NGC/IC/Custom)
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
@ -694,7 +694,7 @@ private:
*@see SkyMap::drawDeepSkyCatalog()
*/
void drawDeepSkyObjects( TQPainter& psky, double scale = 1.0 );
/**@short Draw a Deep-Sky Catalog.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param catalog List of pointers to the objects in a particular deep-sky catalog.
@ -704,7 +704,7 @@ private:
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawDeepSkyCatalog( TQPainter& psky, TQPtrList<DeepSkyObject>& catalog, TQColor& color, bool drawObject, bool drawImage, double scale = 1.0 );
/**@short Draw the Planet Trails.
*
*"Planet Trails" can be attached to any solar system body; they are lists of SkyPoints
@ -714,23 +714,23 @@ private:
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawPlanetTrail( TQPainter& psky, KSPlanetBase *ksp, double scale = 1.0 );
/**@short Draw all solar system bodies: Sun, Moon, 8 planets, comets, asteroids.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param drawPlanets if FALSE, do nothing
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawSolarSystem( TQPainter& psky, bool drawPlanets, double scale = 1.0 );
/**@short Draw "User Labels". User labels are name labels attached to objects manually with
/**@short Draw "User Labels". User labels are name labels attached to objects manually with
*the right-click popup menu. Also adds a label to the FocusObject if the Option UseAutoLabel
*is TRUE.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/
void drawAttachedLabels( TQPainter &psky, double scale = 1.0 );
/**@short Attach a name label to a SkyObject. This Function is called by the object-specific
/**@short Attach a name label to a SkyObject. This Function is called by the object-specific
*draw functions and also by drawAttachedLabels().
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param obj pointer to the SkyObject which is to be labeled.
@ -745,19 +745,19 @@ private:
/**Draw a planet. This is an image if the planet image is loaded, the zoomlevel
*is high enough (but not so high that the image fills the screen), and the
*user has selected that planet images be shown. If one of these conditions
*is false, then a simple colored circle is drawn instead.
*is false, then a simple colored circle is drawn instead.
*@param psky reference to the TQPainter on which to draw
*@param p pointer to the KSPlanetBase to be drawn
*@param c the color of the circle to be used if not plotting an image of the planet
*@param zoommin the minimum zoomlevel for drawing the planet image
*@param resize_mult scale factor for angular size of planet. This is used only for Saturn,
*because its image includes the Rings, which are not included in its angular size measurement.
*@param resize_mult scale factor for angular size of planet. This is used only for Saturn,
*because its image includes the Rings, which are not included in its angular size measurement.
*(there's probably a better way to handle this)
*@param scale the scale factor used for printing the sky image.
*/
void drawPlanet(TQPainter &psky, KSPlanetBase *p, TQColor c,
double zoommin, int resize_mult = 1, double scale = 1.0 );
/**Draw the overlays on top of the sky map. These include the infoboxes,
*field-of-view indicator, telescope symbols, zoom box and any other
*user-interaction graphics.
@ -768,21 +768,21 @@ private:
*@param pm pointer to the Sky pixmap
*/
void drawOverlays( TQPixmap *pm );
/**Draw the Focus, Geo and Time InfoBoxes. This is called by drawOverlays().
*@param p reference to the TQPainter on which to draw (this should be the Sky pixmap).
*@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*@see SkyMap::drawOverlays()
*/
void drawBoxes( TQPainter &p );
/**Draw symbols at the position of each Telescope currently being controlled by KStars.
*@note The shape of the Telescope symbol is currently a hard-coded bullseye.
*@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap).
*@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap).
*/
void drawTelescopeSymbols(TQPainter &psky);
/**@short Draw symbols for objects in the observing list.
*@param psky reference to the TQPainter on which to draw (this should be the sky pixmap)
*@note there is no scale factor because this is only used for drawing onto the screen, not printing.
@ -790,14 +790,14 @@ private:
void drawObservingList( TQPainter &psky, double scale = 1.0 );
/**Draw a dotted-line rectangle which traces the potential new field-of-view in ZoomBox mode.
*@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap).
*@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap).
*@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*/
void drawZoomBox( TQPainter &psky);
/**Draw the current TransientLabel. TransientLabels are triggered when the mouse
/**Draw the current TransientLabel. TransientLabels are triggered when the mouse
*hovers on an object.
*@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap).
*@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap).
*@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout()
*/
@ -805,7 +805,7 @@ private:
/**Draw a dashed line from the Angular-Ruler start point to the current mouse cursor,
*when in Angular-Ruler mode.
*@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap).
*@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap).
*@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*/
void drawAngleRuler( TQPainter &psky );
@ -825,7 +825,7 @@ private:
*screen pixel coordinate offsets from the center of the Sky pixmap.
*@param dx horizontal pixel offset from center of SkyMap.
*@param dy vertical pixel offset from center of SkyMap.
*@param Horiz if TRUE, the SkyMap is displayed using theQt::Horizontal coordinate system
*@param Horiz if TRUE, the SkyMap is displayed using the Horizontal coordinate system
*@param LSTh pointer to the local sidereal time, as a dms object.
*@param lat pointer to the current geographic laitude, as a dms object
*@param doRefraction if TRUE, correct for atmospheric refraction
@ -833,43 +833,43 @@ private:
SkyPoint dXdYToRaDec( double dx, double dy, bool Horiz, dms *LST, const dms *lat, bool doRefraction=true );
/**@return the angular field of view of the sky map, in degrees.
*@note it must use either the height or the width of the window to calculate the
*@note it must use either the height or the width of the window to calculate the
*FOV angle. It chooses whichever is larger.
*/
float fov();
/**@short Determine if the skypoint p is likely to be visible in the display
/**@short Determine if the skypoint p is likely to be visible in the display
*window.
*
*checkVisibility() is an optimization function. It determines whether an object
*appears within the bounds of the skymap window, and therefore should be drawn.
*The idea is to save time by skipping objects which are off-screen, so it is
*The idea is to save time by skipping objects which are off-screen, so it is
*absolutely essential that checkVisibility() is significantly faster than
*the computations required to draw the object to the screen.
*
*The function first checks the difference between the Declination/Altitude
*coordinate of the Focus position, and that of the point p. If the absolute
*coordinate of the Focus position, and that of the point p. If the absolute
*value of this difference is larger than fov, then the function returns FALSE.
*For most configurations of the sky map window, this simple check is enough to
*For most configurations of the sky map window, this simple check is enough to
*exclude a large number of objects.
*
*Next, it determines if one of the poles of the current Coordinate System
*(Equatorial orQt::Horizontal) is currently inside the sky map window. This is
*stored in the member variable 'bool SkyMap::isPoleVisible, and is set by the
*Next, it determines if one of the poles of the current Coordinate System
*(Equatorial or Horizontal) is currently inside the sky map window. This is
*stored in the member variable 'bool SkyMap::isPoleVisible, and is set by the
*function SkyMap::setMapGeometry(), which is called by SkyMap::paintEvent().
*If a Pole is visible, then it will return TRUE immediately. The idea is that
*when a pole is on-screen it is computationally expensive to determine whether
*a particular position is on-screen or not: for many valid Dec/Alt values, *all*
*values of RA/Az will indeed be onscreen, but for other valid Dec/Alt values,
*only *most* RA/Az values are onscreen. It is cheaper to simply accept all
*"horizontal" RA/Az values, since we have already determined that they are
*when a pole is on-screen it is computationally expensive to determine whether
*a particular position is on-screen or not: for many valid Dec/Alt values, *all*
*values of RA/Az will indeed be onscreen, but for other valid Dec/Alt values,
*only *most* RA/Az values are onscreen. It is cheaper to simply accept all
*"horizontal" RA/Az values, since we have already determined that they are
*on-screen in the "vertical" Dec/Alt coordinate.
*
*Finally, if no Pole is onscreen, it checks the difference between the Focus
*position's RA/Az coordinate and that of the point p. If the absolute value of
*Finally, if no Pole is onscreen, it checks the difference between the Focus
*position's RA/Az coordinate and that of the point p. If the absolute value of
*this difference is larger than XMax, the function returns FALSE. Otherwise,
*it returns TRUE.
*@param p pointer to the skypoint to be checked.
*@param fov the vertical center-to-edge angle of the window, in degrees
*@param XMax the horizontal center-to-edge angle of the window, in degrees
@ -881,12 +881,12 @@ private:
/**@short Begin fading out the name label attached to TransientObject.
*
*mouseMoveEvent() will call fadeTransientLabel() when TransientObject is not a
*NULL pointer, and the TransientTimer is not already active. These conditions
*are met when the mouse did not move for HOVER_INTERVAL msec (triggering a
*TransientLabel), but the mouse has since been moved, thus ending the Hover event.
*This function merely starts the TransientTimer, whose timeout TQT_SIGNAL is
*connected to the slotTransientTimeout() SLOT, which handles the actual fading
*mouseMoveEvent() will call fadeTransientLabel() when TransientObject is not a
*NULL pointer, and the TransientTimer is not already active. These conditions
*are met when the mouse did not move for HOVER_INTERVAL msec (triggering a
*TransientLabel), but the mouse has since been moved, thus ending the Hover event.
*This function merely starts the TransientTimer, whose timeout TQT_SIGNAL is
*connected to the slotTransientTimeout() SLOT, which handles the actual fading
*of the transient label, and eventually resets TransientObject to NULL.
*@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout()
*/
@ -894,24 +894,24 @@ private:
/**Determine the on-screen position angle of a SkyObject. This is the sum
*of the object's sky position angle (w.r.t. North), and the position angle
*of "North" at the position of the object (w.r.t. the screen Y-axis).
*The latter is determined by constructing a test point with the same RA but
*a slightly increased Dec as the object, and calculating the angle w.r.t. the
*Y-axis of the line connecing the object to its test point.
*of "North" at the position of the object (w.r.t. the screen Y-axis).
*The latter is determined by constructing a test point with the same RA but
*a slightly increased Dec as the object, and calculating the angle w.r.t. the
*Y-axis of the line connecing the object to its test point.
*/
double findPA( SkyObject *o, int x, int y, double scale=1.0 );
/**@short Sets the shape of the default mouse cursor to a cross.
/**@short Sets the shape of the default mouse cursor to a cross.
*/
void setDefaultMouseCursor();
/**@short Sets the shape of the mouse cursor to a magnifying glass.
/**@short Sets the shape of the mouse cursor to a magnifying glass.
*/
void setZoomMouseCursor();
/**Check if the current point on screen is a valid point on the sky. This is needed
*to avoid a crash of the program if the user clicks on a point outside the sky (the
*corners of the sky map at the lowest zoom level are the invalid points).
*corners of the sky map at the lowest zoom level are the invalid points).
*@param dx the screen pixel X-coordinate, relative to the screen center
*@param dy the screen pixel Y-coordinate, relative to the screen center
*/
@ -936,7 +936,7 @@ private:
double guideXRange;
TQString sURL;
KStars *ksw;
KStarsData *data;
KSPopupMenu *pmenu;

@ -29,7 +29,7 @@
*
*The sky coordinates of a point in the sky. The
*coordinates are stored in both Equatorial (Right Ascension,
*Declination) andQt::Horizontal (Azimuth, Altitude) coordinate systems.
*Declination) and Horizontal (Azimuth, Altitude) coordinate systems.
*Provides set/get functions for each coordinate angle, and functions
*to convert between the Equatorial and Horizon coordinate systems.
*
@ -321,7 +321,7 @@ public:
*/
void precessFromAnyEpoch(long double jd0, long double jdf);
/** Determine the E-terms of aberration
/** Determine the E-terms of aberration
*In the past, the mean places of stars published in catalogs included
*the contribution to the aberration due to the ellipticity of the orbit
*of the Earth. These terms, known as E-terms were almost constant, and
@ -330,8 +330,8 @@ public:
*/
SkyPoint Eterms(void);
/** Exact precession from Besselian epoch 1950 to epoch J2000. The
*coordinates referred to the first epoch are in the
/** Exact precession from Besselian epoch 1950 to epoch J2000. The
*coordinates referred to the first epoch are in the
FK4 catalog, while the latter are in the Fk5 one.
*Reference: Smith, C. A.; Kaplan, G. H.; Hughes, J. A.; Seidelmann,
*P. K.; Yallop, B. D.; Hohenkerk, C. Y.
@ -345,7 +345,7 @@ public:
void B1950ToJ2000(void);
/** Exact precession from epoch J2000 Besselian epoch 1950. The coordinates
*referred to the first epoch are in the FK4 catalog, while the
*referred to the first epoch are in the FK4 catalog, while the
*latter are in the Fk5 one.
*Reference: Smith, C. A.; Kaplan, G. H.; Hughes, J. A.; Seidelmann,
*P. K.; Yallop, B. D.; Hohenkerk, C. Y.
@ -366,9 +366,9 @@ public:
void addEterms(void);
/** Coordinates in the FK4 catalog include the effect of aberration due
*to the ellipticity of the orbit of the Earth. Coordinates in the FK5
*catalog do not include these terms. In order to convert from
* FK5 coordinates to B1950 (FK4) one has to use this function.
*to the ellipticity of the orbit of the Earth. Coordinates in the FK5
*catalog do not include these terms. In order to convert from
* FK5 coordinates to B1950 (FK4) one has to use this function.
*/
void subtractEterms(void);
@ -379,7 +379,7 @@ public:
* the coordinates of the second object.
* However this algorithm is not accurate when the angular separation
* is small.
* Meeus provides a different algorithm in page 111 which we
* Meeus provides a different algorithm in page 111 which we
* implement here.
* @param sp SkyPoint to which distance is to be calculated
* @return dms angle representing angular separation.
@ -388,7 +388,7 @@ public:
dms angularDistanceTo( SkyPoint *sp);
bool operator == ( SkyPoint &p ) { return ( ra()->Degrees() == p.ra()->Degrees() && dec()->Degrees() == p.dec()->Degrees() ); }
/** Computes the velocity of the Sun projected on the direction of the source.
*
* @param jd Epoch expressed as julian day to which the source coordinates refer to.
@ -396,7 +396,7 @@ public:
**/
double vRSun(long double jd);
/** Computes the radial velocity of a source referred to the solar system barycenter
/** Computes the radial velocity of a source referred to the solar system barycenter
* from the radial velocity referred to the
* Local Standard of Rest, aka known as VLSR. To compute it we need the coordinates of the
* source the VLSR and the epoch for the source coordinates.
@ -408,7 +408,7 @@ public:
double vHeliocentric(double vlsr, long double jd);
/** Computes the radial velocity of a source referred to the Local Standard of Rest, also known as VLSR
* from the radial velocity referred to the solar system barycenter
* from the radial velocity referred to the solar system barycenter
*
* @param vhelio radial velocity of the source referred to the LSR in km/s
* @param jd Epoch expressed as julian day to which the source coordinates refer to.
@ -421,19 +421,19 @@ public:
* @return velocity of the Earth projected on the direction of the source kms-1
*/
double vREarth(long double jd0);
/** Computes the radial velocity of a source referred to the center of the earth
/** Computes the radial velocity of a source referred to the center of the earth
* from the radial velocity referred to the solar system barycenter
*
* @param vhelio radial velocity of the source referred to the barycenter of the
* @param vhelio radial velocity of the source referred to the barycenter of the
* solar system in km/s
* @param jd Epoch expressed as julian day to which the source coordinates refer to.
* @return Radial velocity of the source referred to the center of the Earth in km/s
**/
double vGeocentric(double vhelio, long double jd);
/** Computes the radial velocity of a source referred to the solar system barycenter
* from the velocity referred to the center of the earth
/** Computes the radial velocity of a source referred to the solar system barycenter
* from the velocity referred to the center of the earth
*
* @param vgeo radial velocity of the source referred to the center of the Earth
* [km/s]
@ -442,7 +442,7 @@ public:
**/
double vGeoToVHelio(double vgeo, long double jd);
/** Computes the velocity of any object (oberver's site) projected on the
/** Computes the velocity of any object (oberver's site) projected on the
* direction of the source.
* @param vsite velocity of that object in cartesian coordinates
* @return velocity of the object projected on the direction of the source kms-1
@ -459,9 +459,9 @@ public:
**/
double vTopocentric(double vgeo, double vsite[3]);
/** Computes the radial velocity of a source referred to the center of the Earth from
* the radial velocity referred to an observer site on the surface of the earth
*
/** Computes the radial velocity of a source referred to the center of the Earth from
* the radial velocity referred to an observer site on the surface of the earth
*
* @param vtopo radial velocity of the source referred to the observer's site in km/s
* @param vsite Velocity at which the observer moves referred to the center of the earth.
* @return Radial velocity of the source referred the center of the earth in km/s

@ -45,7 +45,7 @@
<property name="whatsThis" stdset="0">
<string>Set the Altitude coordinate to be focused on in the sky map, in degrees. You can express the angle as a simple integer ("45") or floating-point ("45.333") value, or as space- or colon-delimited values specifying degrees, arcminutes and arcseconds ("45:20", "45:20:00", "45:20", "45 20.0", etc.).
The Altitude is one of the coordinates in theQt::Horizontal coordinate system. It is defined as the angle of an object above or below the horizon. For example, the Zenith has an Altitude of 90 degrees. Altitude is also known as Elevation.</string>
The Altitude is one of the coordinates in the Horizontal coordinate system. It is defined as the angle of an object above or below the horizon. For example, the Zenith has an Altitude of 90 degrees. Altitude is also known as Elevation.</string>
</property>
</widget>
<widget class="TQLabel" row="0" column="0">

@ -54,8 +54,8 @@
#include "indistd.h"
ObservingList::ObservingList( KStars *_ks, TQWidget* parent )
: KDialogBase( KDialogBase::Plain, i18n( "Observing List" ),
Close, Close, parent, "observinglist", false ), ks( _ks ), LogObject(0), oCurrent(0),
: KDialogBase( KDialogBase::Plain, i18n( "Observing List" ),
Close, Close, parent, "observinglist", false ), ks( _ks ), LogObject(0), oCurrent(0),
noNameStars(0), isModified(false), bIsLarge(true)
{
TQFrame *page = plainPage();
@ -68,28 +68,28 @@ ObservingList::ObservingList( KStars *_ks, TQWidget* parent )
//Connections
connect( this, TQT_SIGNAL( closeClicked() ), this, TQT_SLOT( slotClose() ) );
connect( ui->TableStack, TQT_SIGNAL( aboutToShow( TQWidget* ) ),
connect( ui->TableStack, TQT_SIGNAL( aboutToShow( TQWidget* ) ),
this, TQT_SLOT( slotPrepTable( TQWidget* ) ) );
connect( ui->FullTable, TQT_SIGNAL( selectionChanged() ),
connect( ui->FullTable, TQT_SIGNAL( selectionChanged() ),
this, TQT_SLOT( slotNewSelection() ) );
connect( ui->TinyTable, TQT_SIGNAL( selectionChanged() ),
connect( ui->TinyTable, TQT_SIGNAL( selectionChanged() ),
this, TQT_SLOT( slotNewSelection() ) );
connect( ui->FullTable, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int) ),
connect( ui->FullTable, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int) ),
this, TQT_SLOT( slotCenterObject() ) );
connect( ui->TinyTable, TQT_SIGNAL( doubleClicked( TQListBoxItem* ) ),
connect( ui->TinyTable, TQT_SIGNAL( doubleClicked( TQListBoxItem* ) ),
this, TQT_SLOT( slotCenterObject() ) );
connect( ui->RemoveButton, TQT_SIGNAL( clicked() ),
connect( ui->RemoveButton, TQT_SIGNAL( clicked() ),
this, TQT_SLOT( slotRemoveObjects() ) );
connect( ui->CenterButton, TQT_SIGNAL( clicked() ),
connect( ui->CenterButton, TQT_SIGNAL( clicked() ),
this, TQT_SLOT( slotCenterObject() ) );
connect( ui->ScopeButton, TQT_SIGNAL( clicked() ),
connect( ui->ScopeButton, TQT_SIGNAL( clicked() ),
this, TQT_SLOT( slotSlewToObject() ) );
connect( ui->DetailsButton, TQT_SIGNAL( clicked() ),
connect( ui->DetailsButton, TQT_SIGNAL( clicked() ),
this, TQT_SLOT( slotDetails() ) );
connect( ui->AVTButton, TQT_SIGNAL( clicked() ),
connect( ui->AVTButton, TQT_SIGNAL( clicked() ),
this, TQT_SLOT( slotAVT() ) );
connect( ui->OpenButton, TQT_SIGNAL( clicked() ),
connect( ui->OpenButton, TQT_SIGNAL( clicked() ),
this, TQT_SLOT( slotOpenList() ) );
connect( ui->SaveButton, TQT_SIGNAL( clicked() ),
this, TQT_SLOT( slotSaveList() ) );
@ -103,7 +103,7 @@ ObservingList::ObservingList( KStars *_ks, TQWidget* parent )
// this, TQT_SLOT( slotToggleSize() ) );
obsList.setAutoDelete( false ); //do NOT delete removed pointers!
//Add icons to Push Buttons
TDEIconLoader *icons = TDEGlobal::iconLoader();
ui->OpenButton->setPixmap( icons->loadIcon( "document-open", TDEIcon::Toolbar ) );
@ -151,12 +151,12 @@ void ObservingList::slotAddObject( SkyObject *obj ) {
//Insert object in obsList
obsList.append( obj );
if ( ! isModified ) isModified = true;
if ( ! isModified ) isModified = true;
//Insert object entry in FullTable and TinyTable
TQString smag("--");
if ( obj->mag() < 90.0 ) smag = TQString::number( obj->mag(), 'g', 2 );
new TDEListViewItem( ui->FullTable, obj->translatedName(),
new TDEListViewItem( ui->FullTable, obj->translatedName(),
obj->ra()->toHMSString(),
obj->dec()->toDMSString(),
smag,
@ -168,15 +168,15 @@ void ObservingList::slotAddObject( SkyObject *obj ) {
}
void ObservingList::slotRemoveObject( SkyObject *o ) {
if ( !o )
if ( !o )
o = ks->map()->clickedObject();
obsList.remove(o);
if ( ! isModified ) isModified = true;
if ( o == LogObject )
if ( o == LogObject )
saveCurrentUserLog();
//Remove entry from FullTable
bool objectFound = false;
TQListViewItemIterator it( ui->FullTable );
@ -185,7 +185,7 @@ void ObservingList::slotRemoveObject( SkyObject *o ) {
//If the object is named "star" then match coordinates instead of name
if ( o->translatedName() == i18n( "star" ) ) {
if ( item->text(1) == o->ra()->toHMSString()
if ( item->text(1) == o->ra()->toHMSString()
&& item->text(2) == o->dec()->toDMSString() ) {
delete item;
objectFound = true;
@ -214,8 +214,8 @@ void ObservingList::slotRemoveObject( SkyObject *o ) {
void ObservingList::slotRemoveObjects() {
if ( SelectedObjects.count() == 0) return;
for ( SkyObject *o = SelectedObjects.first(); o; o = SelectedObjects.next() )
for ( SkyObject *o = SelectedObjects.first(); o; o = SelectedObjects.next() )
slotRemoveObject( o );
slotNewSelection();
@ -231,7 +231,7 @@ void ObservingList::slotNewSelection() {
while ( it.current() ) {
for ( SkyObject *o = obsList.first(); o; o = obsList.next() ) {
if ( it.current()->text(0) == i18n("star") ) {
if ( it.current()->text(1) == o->ra()->toHMSString()
if ( it.current()->text(1) == o->ra()->toHMSString()
&& it.current()->text(2) == o->dec()->toDMSString() ) {
SelectedObjects.append(o);
break;
@ -243,19 +243,19 @@ void ObservingList::slotNewSelection() {
}
it++;
}
//Enable widgets when one object selected
if ( SelectedObjects.count() == 1 ) {
TQString newName( SelectedObjects.first()->translatedName() );
TQString oldName( obsList.current()->translatedName() );
//Enable buttons
ui->CenterButton->setEnabled( true );
ui->ScopeButton->setEnabled( true );
ui->DetailsButton->setEnabled( true );
ui->AVTButton->setEnabled( true );
ui->RemoveButton->setEnabled( true );
//Find the selected object in the obsList,
//then break the loop. Now obsList.current()
//points to the new selected object (until now it was the previous object)
@ -267,19 +267,19 @@ void ObservingList::slotNewSelection() {
}
}
if ( ! found ) {
if ( ! found ) {
kdDebug() << i18n( "Object %1 not found in obsList." ).arg( newName ) << endl;
} else if ( newName != i18n( "star" ) ) {
//Display the object's current user notes in the NotesEdit
//First, save the last object's user log to disk, if necessary
saveCurrentUserLog();
//set LogObject to the new selected object
LogObject = obsList.current();
ui->NotesLabel->setEnabled( true );
ui->NotesEdit->setEnabled( true );
ui->NotesLabel->setText( i18n( "observing notes for %1:" ).arg( LogObject->translatedName() ) );
if ( LogObject->userLog.isEmpty() ) {
ui->NotesEdit->setText( i18n("Record here observation logs and/or data on %1.").arg( LogObject->translatedName() ) );
@ -293,8 +293,8 @@ void ObservingList::slotNewSelection() {
ui->NotesEdit->setEnabled( false );
}
//This shouldn't be necessary. For some reason, obsList.current()
//is valid here, but in subsequent functions (such as slotCenterObject)
//This shouldn't be necessary. For some reason, obsList.current()
//is valid here, but in subsequent functions (such as slotCenterObject)
//called *right after* this one, obsList.current()==NULL. No idea why.
oCurrent = obsList.current();
@ -308,7 +308,7 @@ void ObservingList::slotNewSelection() {
ui->NotesLabel->setEnabled( false );
ui->NotesEdit->setEnabled( false );
oCurrent = 0;
//Clear the user log text box.
saveCurrentUserLog();
} else { //more than one object selected.
@ -344,13 +344,13 @@ void ObservingList::slotSlewToObject()
bool useJ2000( false);
int selectedCoord(0);
SkyPoint sp;
// Find the first device with EQUATORIAL_EOD_COORD or EQUATORIAL_COORD and with SLEW element
// i.e. the first telescope we find!
INDIMenu *imenu = ks->getINDIMenu();
for (unsigned int i=0; i < imenu->mgr.count() ; i++)
{
for (unsigned int j=0; j < imenu->mgr.at(i)->indi_dev.count(); j++)
@ -375,7 +375,7 @@ void ObservingList::slotSlewToObject()
ConnectEle = indidev->findElem("CONNECT");
if (!ConnectEle) continue;
if (ConnectEle->state == PS_OFF)
{
KMessageBox::error(0, i18n("Telescope %1 is offline. Please connect and retry again.").arg(indidev->label));
@ -393,7 +393,7 @@ void ObservingList::slotSlewToObject()
if (!DecEle) continue;
break;
//Qt::Horizontal
// Horizontal
case 1:
if (prop->perm == PP_RO) continue;
AzEle = prop->findElement("AZ");
@ -402,10 +402,10 @@ void ObservingList::slotSlewToObject()
if (!AltEle) continue;
break;
}
onset = indidev->findProp("ON_COORD_SET");
if (!onset) continue;
onset->activateSwitch("SLEW");
indidev->stdDev->currentObject = oCurrent;
@ -456,14 +456,14 @@ void ObservingList::slotSlewToObject()
}
prop->newText();
return;
}
}
// We didn't find any telescopes
KMessageBox::sorry(0, i18n("KStars did not find any active telescopes."));
}
//FIXME: This will open multiple Detail windows for each object;
@ -481,7 +481,7 @@ void ObservingList::slotAVT() {
for ( SkyObject *o = SelectedObjects.first(); o; o = SelectedObjects.next() ) {
avt.processObject( o );
}
avt.exec();
}
}
@ -489,20 +489,20 @@ void ObservingList::slotAVT() {
//FIXME: On close, we will need to close any open Details/AVT windows
void ObservingList::slotClose() {
//Save the current User log text
if ( oCurrent && ! ui->NotesEdit->text().isEmpty() && ui->NotesEdit->text()
if ( oCurrent && ! ui->NotesEdit->text().isEmpty() && ui->NotesEdit->text()
!= i18n("Record here observation logs and/or data on %1.").arg( oCurrent->name()) ) {
oCurrent->saveUserLog( ui->NotesEdit->text() );
}
hide();
}
void ObservingList::saveCurrentUserLog() {
if ( ! ui->NotesEdit->text().isEmpty() &&
ui->NotesEdit->text() !=
if ( ! ui->NotesEdit->text().isEmpty() &&
ui->NotesEdit->text() !=
i18n("Record here observation logs and/or data on %1.").arg( LogObject->translatedName() ) ) {
LogObject->saveUserLog( ui->NotesEdit->text() );
ui->NotesEdit->clear();
ui->NotesLabel->setText( i18n( "Observing notes for object:" ) );
LogObject = NULL;
@ -519,7 +519,7 @@ void ObservingList::slotOpenList() {
KTempFile tmpfile;
tmpfile.setAutoDelete(true);
FileName = tmpfile.name();
if( TDEIO::NetAccess::download( fileURL, FileName, this ) )
if( TDEIO::NetAccess::download( fileURL, FileName, this ) )
f.setName( FileName );
} else {
@ -534,7 +534,7 @@ void ObservingList::slotOpenList() {
}
saveCurrentList();
//First line is the name of the list. The rest of the file should
//First line is the name of the list. The rest of the file should
//be object names, one per line.
TQTextStream istream(&f);
TQString line;
@ -556,7 +556,7 @@ void ObservingList::slotOpenList() {
double dc = dms::fromString( fields[2], true ).Degrees(); //true = degrees
//Identify the star with these coordinates
double rmax = 1.;
double rmax = 1.;
for ( uint i=0; i < ks->data()->starList.count(); ++i ) {
SkyObject *s = (SkyObject*)(ks->data()->starList.at(i));
double dra = fabs( ra - s->ra()->Degrees() );
@ -592,12 +592,12 @@ void ObservingList::saveCurrentList() {
if ( obsList.count() ) {
if ( isModified ) {
TQString message = i18n( "Do you want to save the current list before opening a new list?" );
if ( KMessageBox::questionYesNo( this, message,
if ( KMessageBox::questionYesNo( this, message,
i18n( "Save Current List?" ), KStdGuiItem::save(), KStdGuiItem::discard() ) == KMessageBox::Yes )
slotSaveList();
}
//If we ever allow merging the loaded list with
//If we ever allow merging the loaded list with
//the existing one, that code would go here
obsList.clear();
ui->FullTable->clear();
@ -606,13 +606,13 @@ void ObservingList::saveCurrentList() {
void ObservingList::slotSaveListAs() {
bool ok(false);
ListName = KInputDialog::getText( i18n( "Enter List Name" ),
ListName = KInputDialog::getText( i18n( "Enter List Name" ),
i18n( "List name:" ), "", &ok );
if ( ok ) {
KURL fileURL = KFileDialog::getSaveURL( TQDir::homeDirPath(), "*.obslist|KStars Observing List (*.obslist)" );
if ( fileURL.isValid() )
if ( fileURL.isValid() )
FileName = fileURL.path();
slotSaveList();
@ -628,18 +628,18 @@ void ObservingList::slotSaveList() {
TQFile f( FileName );
if ( !f.open( IO_WriteOnly) ) {
TQString message = i18n( "Could not open file %1. Try a different filename?" ).arg( f.name() );
if ( KMessageBox::warningYesNo( 0, message, i18n( "Could Not Open File" ), i18n("Try Different"), i18n("Do Not Try") ) == KMessageBox::Yes ) {
FileName == "";
slotSaveList();
}
return;
}
TQTextStream ostream(&f);
ostream << ListName << endl;
//Save objects to the list using their name. If it's a star with a genetive name
//Save objects to the list using their name. If it's a star with a genetive name
//(i.e., "sigma orionis"), save the name with ascii characters, not greek letters.
//If it's an unnamed star, save "star" and the star's coordinates.
for ( SkyObject* o = obsList.first(); o; o = obsList.next() ) {
@ -652,7 +652,7 @@ void ObservingList::slotSaveList() {
ostream << s->gname( false ) << endl;
} else {
ostream << o->name() << endl;
}
}
} else {
ostream << o->name() << endl;
}
@ -734,7 +734,7 @@ void ObservingList::syncTableSelection( bool syncFullTable ) {
ui->TinyTable->setSelected( i++, it->isSelected() );
it->nextSibling();
}
}
}
}
#include "observinglist.moc"

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save