Fix incorrectly renamed strings

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

@ -83,7 +83,7 @@
<tip category="KStars|Navigation"> <tip category="KStars|Navigation">
<html> <html>
<p>The status bar displays the current sky coordinates of the mouse cursor, <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> </p>
</html> </html>
</tip> </tip>
@ -109,7 +109,7 @@
</tip> </tip>
<tip category="KStars|Navigation"> <tip category="KStars|Navigation">
<html> <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. systems, use the "View->Coordinates" menu item, or press the spacebar.
</p> </p>
</html> </html>

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

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

@ -157,7 +157,7 @@ public:
long ReadLine( long SkipPixels, long Pixels, unsigned short* pLineBuffer ); long ReadLine( long SkipPixels, long Pixels, unsigned short* pLineBuffer );
long Write( unsigned short reg, unsigned short val ); long Write( unsigned short reg, unsigned short val );
long Read( unsigned short reg, unsigned short& val ); long Read( unsigned short reg, unsigned short& val );
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Camera Settings // Camera Settings
@ -173,27 +173,27 @@ public:
// 7: image ready // 7: image ready
bool read_Present(); // True if camera is present, false otherwise. bool read_Present(); // True if camera is present, false otherwise.
bool read_Shutter(); // Current shutter state, true = open, false = closed. bool read_Shutter(); // Current shutter state, true = open, false = closed.
void write_Shutter( bool val ); void write_Shutter( bool val );
bool read_ForceShutterOpen(); // True: Forces shutter permanently open. False: allows bool read_ForceShutterOpen(); // True: Forces shutter permanently open. False: allows
void write_ForceShutterOpen( bool val ); // normal shutter operation. void write_ForceShutterOpen( bool val ); // normal shutter operation.
bool read_LongCable(); // Long cable mode. 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 short read_Mode(); // First four bits map to Mode bits used for
void write_Mode( short val ); // special functions or camera configurations. void write_Mode( short val ); // special functions or camera configurations.
short read_TestBits(); // First four bits to Test bits used for short read_TestBits(); // First four bits to Test bits used for
void write_TestBits( short val ); // troubleshooting. void write_TestBits( short val ); // troubleshooting.
short read_Test2Bits(); // First four bits map to Test2 bits used for short read_Test2Bits(); // First four bits map to Test2 bits used for
void write_Test2Bits( short val ); // special functions or camera configurations. void write_Test2Bits( short val ); // special functions or camera configurations.
bool read_FastReadout(); // Fast readout mode (used for focusing). 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. bool read_UseTrigger(); // Triggered exposure mode.
void write_UseTrigger( bool val ); // True means triggered exposure is on. 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 bool m_HighPriority; // Bost thread priority level during download
short m_PPRepeat; // Delay used on parallel port systems. short m_PPRepeat; // Delay used on parallel port systems.
short m_DataBits; // Digitization resolution, 8 - 18. short m_DataBits; // Digitization resolution, 8 - 18.
bool m_FastShutter; // Capable of 0.001 sec exposure resolution bool m_FastShutter; // Capable of 0.001 sec exposure resolution
bool m_GuiderRelays; // Capable of outputing autoguider signals 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_MaxExposure; // Maximum exposure length
double m_MinExposure; // Minimum exposure length double m_MinExposure; // Minimum exposure length
@ -219,7 +219,7 @@ public:
// Cooler Settings // Cooler Settings
// N.B. DAC units = ( m_TempScale * CoolerSetPoint (deg. C ) ) + m_TempCalibration; // N.B. DAC units = ( m_TempScale * CoolerSetPoint (deg. C ) ) + m_TempCalibration;
// N.B. Temperature (deg. C) = (DAC units - m_TempCalibration) / m_TempScale // N.B. Temperature (deg. C) = (DAC units - m_TempCalibration) / m_TempScale
double read_CoolerSetPoint(); // Returns/sets setpoint temperature in degrees double read_CoolerSetPoint(); // Returns/sets setpoint temperature in degrees
void write_CoolerSetPoint( double val ); // Celcius. void write_CoolerSetPoint( double val ); // Celcius.
@ -229,7 +229,7 @@ public:
void write_CoolerMode( Camera_CoolerMode val ); void write_CoolerMode( Camera_CoolerMode val );
double read_Temperature(); // Current temperature in degrees Celcius. double read_Temperature(); // Current temperature in degrees Celcius.
bool m_TempControl; // Temperature can be externally controlled bool m_TempControl; // Temperature can be externally controlled
short m_TempCalibration; // Temperature calibration factor. short m_TempCalibration; // Temperature calibration factor.
double m_TempScale; // Temperature scaling factor. double m_TempScale; // Temperature scaling factor.
@ -238,20 +238,20 @@ public:
// Exposure Settings // Exposure Settings
// The following variables are latched in Expose method, until next Reset or GetImage // 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_StartX, m_StartY; // Zero based subframe start position in unbinned pixels.
short m_NumX, m_NumY; // Subframe size in binned pixels. short m_NumX, m_NumY; // Subframe size in binned pixels.
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Geometry Settings // Geometry Settings
// The following variables are latched in Expose method, until next Reset or GetImage // 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_Columns, m_Rows; // Total columns/rows on CCD (physical).
short m_ImgColumns, m_ImgRows; // Unbinned columns/rows in imaging area 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_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). short m_BIC, m_BIR; // Before Image Column/Row count (dark non-imaging pixels).
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// CCD Settings // CCD Settings
@ -291,7 +291,7 @@ public:
// Move the filterwheel to the home position - failure indicates no filterwheel // Move the filterwheel to the home position - failure indicates no filterwheel
//attached or broken filterwheel //attached or broken filterwheel
bool FilterHome(); bool FilterHome();
// Move filterwheel to the given slot // Move filterwheel to the given slot
void FilterSet( short Slot ); void FilterSet( short Slot );
@ -341,7 +341,7 @@ public:
bool m_WaitingforLine; // camera is clocking and digitizing a row of data 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_RegisterOffset; // Offset from base address used in parallel port systems.
short m_FilterPosition; // Current filter position short m_FilterPosition; // Current filter position
short m_FilterStepPos; // Current filter position in our internal array 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. Camera_Interface m_Interface; // String acronyms may be used in INI file.
// 0 or ISA: Industry Standard Architecture bus // 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 // 2 or PCI: Peripheral Component Interface
Camera_SensorType m_SensorType; // 0 or CCD: Charge Coupled Device Camera_SensorType m_SensorType; // 0 or CCD: Charge Coupled Device
// 1 or CMOS: Complementary Metal-Oxide-Silicon // 1 or CMOS: Complementary Metal-Oxide-Silicon
@ -367,12 +367,12 @@ public:
// 7: At set point // 7: At set point
// Latched public variables used during Exposure..GetImage sequence // 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_ExposureStartX, m_ExposureStartY; // Subframe start position in unbinned pixels.
short m_ExposureNumX, m_ExposureNumY; // Subframe size in binned pixels. short m_ExposureNumX, m_ExposureNumY; // Subframe size in binned pixels.
short m_ExposureColumns, m_ExposureRows; // Total columns/rows on CCD (physical). 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_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). 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_ExposureAIC; // Calculated After Image Column count (dark non-imaging pixels).
unsigned short m_ExposureRemainingLines; // Number of lines to be clocked out by GetImage unsigned short m_ExposureRemainingLines; // Number of lines to be clocked out by GetImage
@ -381,17 +381,17 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Write register shadow variables // Write register shadow variables
unsigned short m_RegShadow[ NumWriteRegisters ]; unsigned short m_RegShadow[ NumWriteRegisters ];
unsigned short m_FastShutterBits_Mode; // Mask to enable fast shutter mode unsigned short m_FastShutterBits_Mode; // Mask to enable fast shutter mode
unsigned short m_FastShutterBits_Test; // Mask to enable fast shutter mode unsigned short m_FastShutterBits_Test; // Mask to enable fast shutter mode
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Internal helper routines // Internal helper routines
void LoadLineCounter( unsigned short rows ); void LoadLineCounter( unsigned short rows );
void LoadColumnLayout( unsigned short aic, unsigned short bic, unsigned short pixels ); void LoadColumnLayout( unsigned short aic, unsigned short bic, unsigned short pixels );
void LoadTimerAndBinning( double Duration, unsigned short HBin, unsigned short VBin ); void LoadTimerAndBinning( double Duration, unsigned short HBin, unsigned short VBin );
void StartFlushing(); void StartFlushing();
void StopFlushing(); void StopFlushing();
@ -408,7 +408,7 @@ private:
#ifdef WITHPPI #ifdef WITHPPI
inline void RegisterSelect( unsigned short reg ); inline void RegisterSelect( unsigned short reg );
inline unsigned short INPW(); inline unsigned short INPW();
inline void OUTPW( unsigned short val ); inline void OUTPW( unsigned short val );
#endif #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 dev Camera to set horizontal bin factor of.
@param hbinQt::Horizontal bin factor. @param hbin Horizontal bin factor.
@return Zero on success. @return Zero on success.
@return Non-zero on failure. @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 dev Camera to set vertical bin factor of.
@param vbinQt::Vertical bin factor. @param vbin Vertical bin factor.
@return Zero on success. @return Zero on success.
@return Non-zero on failure. @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 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 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 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 #define NINDI_STD 26
/* INDI standard property used across all clients to enable interoperability. */ /* 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" }; {"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 ** INDI Device: The work-horse. Responsible for handling its
** child properties and managing signal and changes. ** 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; name = inName;
label = inLabel; label = inLabel;
parent = menuParent; parent = menuParent;
parentMgr = parentManager; parentMgr = parentManager;
gl.setAutoDelete(true); gl.setAutoDelete(true);
deviceVBox = menuParent->addVBoxPage(inLabel); deviceVBox = menuParent->addVBoxPage(inLabel);
groupContainer = new TQTabWidget(deviceVBox); groupContainer = new TQTabWidget(deviceVBox);
msgST_w = new TQTextEdit(deviceVBox); msgST_w = new TQTextEdit(deviceVBox);
msgST_w->setReadOnly(true); msgST_w->setReadOnly(true);
msgST_w->setMaximumHeight(100); msgST_w->setMaximumHeight(100);
dataBuffer = (unsigned char *) malloc (1); dataBuffer = (unsigned char *) malloc (1);
stdDev = new INDIStdDevice(this, parent->ksw); stdDev = new INDIStdDevice(this, parent->ksw);
curGroup = NULL; curGroup = NULL;
@ -126,12 +126,12 @@ INDI_D::~INDI_D()
void INDI_D::registerProperty(INDI_P *pp) void INDI_D::registerProperty(INDI_P *pp)
{ {
if (isINDIStd(pp)) if (isINDIStd(pp))
pp->pg->dp->INDIStdSupport = true; pp->pg->dp->INDIStdSupport = true;
stdDev->registerProperty(pp); stdDev->registerProperty(pp);
} }
bool INDI_D::isINDIStd(INDI_P *pp) bool INDI_D::isINDIStd(INDI_P *pp)
@ -142,11 +142,11 @@ bool INDI_D::isINDIStd(INDI_P *pp)
pp->stdID = i; pp->stdID = i;
return true; return true;
} }
return false; 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 */ * left in the group, then delete the group as well */
int INDI_D::removeProperty(INDI_P *pp) int INDI_D::removeProperty(INDI_P *pp)
{ {
@ -170,7 +170,7 @@ int INDI_D::setAnyCmd (XMLEle *root, char errmsg[])
{ {
XMLAtt *ap; XMLAtt *ap;
INDI_P *pp; INDI_P *pp;
ap = findAtt (root, "name", errmsg); ap = findAtt (root, "name", errmsg);
if (!ap) if (!ap)
return (-1); return (-1);
@ -208,7 +208,7 @@ int INDI_D::setValue (INDI_P *pp, XMLEle *root, char errmsg[])
return (-1); return (-1);
} }
} }
/* allow changing the timeout */ /* allow changing the timeout */
ap = findXMLAtt (root, "timeout"); ap = findXMLAtt (root, "timeout");
if (ap) if (ap)
@ -225,13 +225,13 @@ int INDI_D::setValue (INDI_P *pp, XMLEle *root, char errmsg[])
return (setTextValue (pp, root, errmsg)); return (setTextValue (pp, root, errmsg));
break; break;
case PG_BUTTONS: case PG_BUTTONS:
case PG_LIGHTS: case PG_LIGHTS:
case PG_RADIO: case PG_RADIO:
case PG_MENU: case PG_MENU:
return (setLabelState (pp, root, errmsg)); return (setLabelState (pp, root, errmsg));
break; break;
case PG_BLOB: case PG_BLOB:
return (setBLOB(pp, root, errmsg)); return (setBLOB(pp, root, errmsg));
break; break;
@ -256,7 +256,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[])
TQString elementName; TQString elementName;
char iNumber[32]; char iNumber[32];
double min, max; double min, max;
for (ep = nextXMLEle (root, 1); ep != NULL; ep = nextXMLEle (root, 0)) for (ep = nextXMLEle (root, 1); ep != NULL; ep = nextXMLEle (root, 0))
{ {
if (strcmp (tagXMLEle(ep), "oneText") && strcmp(tagXMLEle(ep), "oneNumber")) 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); elementName = valuXMLAtt(ap);
lp = pp->findElement(elementName); lp = pp->findElement(elementName);
if (!lp) if (!lp)
{ {
snprintf(errmsg, ERRMSG_SIZE, "Error: unable to find element '%.64s' in property '%.64s'", elementName.ascii(), pp->name.ascii()); snprintf(errmsg, ERRMSG_SIZE, "Error: unable to find element '%.64s' in property '%.64s'", elementName.ascii(), pp->name.ascii());
return (-1); return (-1);
} }
//fprintf(stderr, "tag okay, getting perm\n"); //fprintf(stderr, "tag okay, getting perm\n");
switch (pp->perm) 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); numberFormat(iNumber, lp->format.ascii(), lp->value);
lp->text = iNumber; lp->text = iNumber;
lp->read_w->setText(lp->text); lp->read_w->setText(lp->text);
ap = findXMLAtt (ep, "min"); ap = findXMLAtt (ep, "min");
if (ap) { min = atof(valuXMLAtt(ap)); lp->setMin(min); } if (ap) { min = atof(valuXMLAtt(ap)); lp->setMin(min); }
ap = findXMLAtt (ep, "max"); ap = findXMLAtt (ep, "max");
if (ap) { max = atof(valuXMLAtt(ap)); lp->setMax(max); } if (ap) { max = atof(valuXMLAtt(ap)); lp->setMax(max); }
/*if (lp->spin_w) /*if (lp->spin_w)
{ {
lp->spin_w->setValue(lp->value); lp->spin_w->setValue(lp->value);
lp->spinChanged(lp->value); lp->spinChanged(lp->value);
}*/ }*/
} }
break; break;
@ -323,7 +323,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[])
lp->spin_w->setValue(lp->value); lp->spin_w->setValue(lp->value);
else else
lp->write_w->setText(lp->text); lp->write_w->setText(lp->text);
ap = findXMLAtt (ep, "min"); ap = findXMLAtt (ep, "min");
if (ap) { min = (int) atof(valuXMLAtt(ap)); lp->setMin(min); } if (ap) { min = (int) atof(valuXMLAtt(ap)); lp->setMin(min); }
ap = findXMLAtt (ep, "max"); ap = findXMLAtt (ep, "max");
@ -336,7 +336,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[])
/* handle standard cases if needed */ /* handle standard cases if needed */
stdDev->setTextValue(pp); stdDev->setTextValue(pp);
// suppress warning // suppress warning
errmsg = errmsg; errmsg = errmsg;
@ -360,7 +360,7 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[])
/* for each child element */ /* for each child element */
for (ep = nextXMLEle (root, 1), i=0; ep != NULL; ep = nextXMLEle (root, 0), i++) for (ep = nextXMLEle (root, 1), i=0; ep != NULL; ep = nextXMLEle (root, 0), i++)
{ {
/* only using light and switch */ /* only using light and switch */
islight = !strcmp (tagXMLEle(ep), "oneLight"); islight = !strcmp (tagXMLEle(ep), "oneLight");
if (!islight && strcmp (tagXMLEle(ep), "oneSwitch")) 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); pp->om_w->setCurrentItem(i);
} }
break; break;
case PG_LIGHTS: case PG_LIGHTS:
lp->drawLt(); lp->drawLt();
break; break;
@ -436,29 +436,29 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[])
} }
} }
stdDev->setLabelState(pp); stdDev->setLabelState(pp);
return (0); return (0);
} }
/* Set BLOB vector. Process incoming data stream /* 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[]) int INDI_D::setBLOB(INDI_P *pp, XMLEle * root, char errmsg[])
{ {
XMLEle *ep; XMLEle *ep;
INDI_E *blobEL; INDI_E *blobEL;
for (ep = nextXMLEle(root,1); ep; ep = nextXMLEle(root,0)) for (ep = nextXMLEle(root,1); ep; ep = nextXMLEle(root,0))
{ {
if (strcmp(tagXMLEle(ep), "oneBLOB") == 0) if (strcmp(tagXMLEle(ep), "oneBLOB") == 0)
{ {
blobEL = pp->findElement(TQString(findXMLAttValu (ep, "name"))); blobEL = pp->findElement(TQString(findXMLAttValu (ep, "name")));
if (blobEL) if (blobEL)
return processBlob(blobEL, ep, errmsg); return processBlob(blobEL, ep, errmsg);
else else
@ -468,13 +468,13 @@ int INDI_D::setBLOB(INDI_P *pp, XMLEle * root, char errmsg[])
} }
} }
} }
return (0); return (0);
} }
/* Process incoming data stream /* 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[]) 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; char *baseBuffer;
unsigned char *blobBuffer(NULL); unsigned char *blobBuffer(NULL);
bool iscomp(false); bool iscomp(false);
ap = findXMLAtt(ep, "size"); ap = findXMLAtt(ep, "size");
if (!ap) if (!ap)
{ {
sprintf (errmsg, "INDI: set %64s size not found", blobEL->name.ascii()); sprintf (errmsg, "INDI: set %64s size not found", blobEL->name.ascii());
return (-1); return (-1);
} }
dataSize = atoi(valuXMLAtt(ap)); dataSize = atoi(valuXMLAtt(ap));
ap = findXMLAtt(ep, "format"); ap = findXMLAtt(ep, "format");
if (!ap) if (!ap)
{ {
sprintf (errmsg, "INDI: set %64s format not found", blobEL->name.ascii()); sprintf (errmsg, "INDI: set %64s format not found", blobEL->name.ascii());
return (-1); return (-1);
} }
dataFormat = TQString(valuXMLAtt(ap)); dataFormat = TQString(valuXMLAtt(ap));
baseBuffer = (char *) malloc ( (3*pcdatalenXMLEle(ep)/4) * sizeof (char)); baseBuffer = (char *) malloc ( (3*pcdatalenXMLEle(ep)/4) * sizeof (char));
blobSize = from64tobits (baseBuffer, pcdataXMLEle(ep)); blobSize = from64tobits (baseBuffer, pcdataXMLEle(ep));
blobBuffer = (unsigned char *) baseBuffer; blobBuffer = (unsigned char *) baseBuffer;
/* Blob size = 0 when only state changes */ /* Blob size = 0 when only state changes */
if (dataSize == 0) 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()); sprintf (errmsg, "INDI: %64s.%64s.%64s bad base64", name.ascii(), blobEL->pp->name.ascii(), blobEL->name.ascii());
return (-1); return (-1);
} }
iscomp = (dataFormat.find(".z") != -1); iscomp = (dataFormat.find(".z") != -1);
dataFormat.remove(".z"); dataFormat.remove(".z");
if (dataFormat == ".fits") dataType = DATA_FITS; if (dataFormat == ".fits") dataType = DATA_FITS;
else if (dataFormat == ".stream") dataType = DATA_STREAM; 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; else dataType = DATA_OTHER;
//kdDebug() << "We're getting data with size " << dataSize << endl; //kdDebug() << "We're getting data with size " << dataSize << endl;
//kdDebug() << "data format " << dataFormat << endl; //kdDebug() << "data format " << dataFormat << endl;
if (iscomp) if (iscomp)
{ {
dataBuffer = (unsigned char *) realloc (dataBuffer, (dataSize * sizeof(unsigned char))); dataBuffer = (unsigned char *) realloc (dataBuffer, (dataSize * sizeof(unsigned char)));
r = uncompress(dataBuffer, &dataSize, blobBuffer, (uLong) blobSize); r = uncompress(dataBuffer, &dataSize, blobBuffer, (uLong) blobSize);
if (r != Z_OK) 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); free (blobBuffer);
return -1; 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))); dataBuffer = (unsigned char *) realloc (dataBuffer, (dataSize * sizeof(unsigned char)));
memcpy(dataBuffer, blobBuffer, dataSize); memcpy(dataBuffer, blobBuffer, dataSize);
} }
stdDev->handleBLOB(dataBuffer, dataSize, dataFormat); stdDev->handleBLOB(dataBuffer, dataSize, dataFormat);
free (blobBuffer); free (blobBuffer);
return (0); return (0);
} }
bool INDI_D::isOn() bool INDI_D::isOn()
@ -605,11 +605,11 @@ INDI_P * INDI_D::addProperty (XMLEle *root, char errmsg[])
return NULL; return NULL;
} }
/* RemoveQt::Vertical spacer from group layout, this is done everytime /* Remove Vertical spacer from group layout, this is done everytime
* a new property arrives. The spacer is then appended to the end of the * a new property arrives. The spacer is then appended to the end of the
* properties */ * properties */
pg->propertyLayout->removeItem(pg->VerticalSpacer); pg->propertyLayout->removeItem(pg->VerticalSpacer);
pp = new INDI_P(pg, TQString(valuXMLAtt(ap))); pp = new INDI_P(pg, TQString(valuXMLAtt(ap)));
/* init state */ /* 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 * INDI_D::findGroup (TQString grouptag, int create, char errmsg[])
{ {
INDI_G *ig; INDI_G *ig;
for (ig = gl.first(); ig != NULL; ig = gl.next() ) for (ig = gl.first(); ig != NULL; ig = gl.next() )
if (ig->name == grouptag) if (ig->name == grouptag)
{ {
@ -668,7 +668,7 @@ INDI_G * INDI_D::findGroup (TQString grouptag, int create, char errmsg[])
{ {
if (grouptag.isEmpty()) if (grouptag.isEmpty())
grouptag = "Group_1"; grouptag = "Group_1";
curGroup = new INDI_G(this, grouptag); curGroup = new INDI_G(this, grouptag);
gl.append(curGroup); gl.append(curGroup);
return curGroup; return curGroup;
@ -785,15 +785,15 @@ int INDI_D::buildTextGUI(XMLEle *root, char errmsg[])
/* we know it will be a general text GUI */ /* we know it will be a general text GUI */
pp->guitype = PG_TEXT; pp->guitype = PG_TEXT;
pp->perm = p; pp->perm = p;
if (pp->buildTextGUI(root, errmsg) < 0) if (pp->buildTextGUI(root, errmsg) < 0)
{ {
delete (pp); delete (pp);
return (-1); return (-1);
} }
pp->pg->addProperty(pp); pp->pg->addProperty(pp);
return (0); return (0);
} }
@ -817,22 +817,22 @@ int INDI_D::buildNumberGUI (XMLEle *root, char *errmsg)
delete(pp); delete(pp);
return (-1); return (-1);
} }
/* we know it will be a number GUI */ /* we know it will be a number GUI */
pp->guitype = PG_NUMERIC; pp->guitype = PG_NUMERIC;
pp->perm = p; pp->perm = p;
if (pp->buildNumberGUI(root, errmsg) < 0) if (pp->buildNumberGUI(root, errmsg) < 0)
{ {
delete (pp); delete (pp);
return (-1); return (-1);
} }
pp->pg->addProperty(pp); pp->pg->addProperty(pp);
return (0); return (0);
} }
/* build GUI for switches property. /* build GUI for switches property.
* rule and number of will determine exactly how the GUI is built. * rule and number of will determine exactly how the GUI is built.
* return 0 if ok, else -1 with reason in errmsg[] * 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)) for ( ep = nextXMLEle(root, 1) , n = 0 ; ep != NULL; ep = nextXMLEle(root, 0))
if (!strcmp (tagXMLEle(ep), "defSwitch")) if (!strcmp (tagXMLEle(ep), "defSwitch"))
n++; n++;
if (n > MAXRADIO) if (n > MAXRADIO)
{ {
pp->guitype = PG_MENU; pp->guitype = PG_MENU;
@ -874,14 +874,14 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
pp=0; pp=0;
return err; return err;
} }
pp->pg->addProperty(pp); pp->pg->addProperty(pp);
return (err); return (err);
} }
/* otherwise, build 1-4 button layout */ /* otherwise, build 1-4 button layout */
pp->guitype = PG_BUTTONS; pp->guitype = PG_BUTTONS;
err = pp->buildSwitchesGUI(root, errmsg); err = pp->buildSwitchesGUI(root, errmsg);
if (err < 0) if (err < 0)
{ {
@ -889,7 +889,7 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
pp=0; pp=0;
return err; return err;
} }
pp->pg->addProperty(pp); pp->pg->addProperty(pp);
return (err); return (err);
@ -898,7 +898,7 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
{ {
/* 1-4 checkboxes layout */ /* 1-4 checkboxes layout */
pp->guitype = PG_RADIO; pp->guitype = PG_RADIO;
err = pp->buildSwitchesGUI(root, errmsg); err = pp->buildSwitchesGUI(root, errmsg);
if (err < 0) if (err < 0)
{ {
@ -906,18 +906,18 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[])
pp=0; pp=0;
return err; return err;
} }
pp->pg->addProperty(pp); pp->pg->addProperty(pp);
return (err); return (err);
} }
snprintf (errmsg, ERRMSG_SIZE, "INDI: <%.64s> unknown rule %.64s for %.64s %.64s", snprintf (errmsg, ERRMSG_SIZE, "INDI: <%.64s> unknown rule %.64s for %.64s %.64s",
tagXMLEle(root), valuXMLAtt(ap), name.ascii(), pp->name.ascii()); tagXMLEle(root), valuXMLAtt(ap), name.ascii(), pp->name.ascii());
delete(pp); delete(pp);
return (-1); return (-1);
} }
/* build GUI for a lights GUI. /* build GUI for a lights GUI.
@ -932,13 +932,13 @@ int INDI_D::buildLightsGUI (XMLEle *root, char errmsg[])
return (-1); return (-1);
pp->guitype = PG_LIGHTS; pp->guitype = PG_LIGHTS;
if (pp->buildLightsGUI(root, errmsg) < 0) if (pp->buildLightsGUI(root, errmsg) < 0)
{ {
delete (pp); delete (pp);
return (-1); return (-1);
} }
pp->pg->addProperty(pp); pp->pg->addProperty(pp);
return (0); return (0);
} }
@ -961,17 +961,17 @@ int INDI_D::buildBLOBGUI (XMLEle *root, char errmsg[])
delete(pp); delete(pp);
return (-1); return (-1);
} }
/* we know it will be a number GUI */ /* we know it will be a number GUI */
pp->perm = p; pp->perm = p;
pp->guitype = PG_BLOB; pp->guitype = PG_BLOB;
if (pp->buildBLOBGUI(root, errmsg) < 0) if (pp->buildBLOBGUI(root, errmsg) < 0)
{ {
delete (pp); delete (pp);
return (-1); return (-1);
} }
pp->pg->addProperty(pp); pp->pg->addProperty(pp);
return (0); return (0);
} }
@ -981,7 +981,7 @@ INDI_E * INDI_D::findElem(TQString name)
INDI_G *grp; INDI_G *grp;
INDI_P *prop; INDI_P *prop;
INDI_E *el; INDI_E *el;
for (grp = gl.first(); grp != NULL; grp = gl.next()) for (grp = gl.first(); grp != NULL; grp = gl.next())
{ {
for (prop = grp->pl.first(); prop != NULL; prop = grp->pl.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; if (el != NULL) return el;
} }
} }
return NULL; return NULL;
} }

@ -5,7 +5,7 @@
modify it under the terms of the GNU General Public modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. 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. 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; PG_RADIO, PG_MENU, PG_LIGHTS, PG_BLOB} PGui;
/* INDI std properties */ /* 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 */ enum stdProperties { CONNECTION, DEVICE_PORT, TIME, SDTIME, GEOGRAPHIC_COORD, /* General */
EQUATORIAL_COORD, EQUATORIAL_EOD_COORD, HORIZONTAL_COORD, /* Telescope */ EQUATORIAL_COORD, EQUATORIAL_EOD_COORD, HORIZONTAL_COORD, /* Telescope */
ABORT_MOTION, ON_COORD_SET, SOLAR_SYSTEM, MOVEMENT, PARK, /* 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 */ VIDEO_STREAM, /* Video */
FOCUS_SPEED, FOCUS_MOTION, FOCUS_TIMER, /* Focuser */ FOCUS_SPEED, FOCUS_MOTION, FOCUS_TIMER, /* Focuser */
FILTER_SLOT}; /* Filter */ FILTER_SLOT}; /* Filter */
/* Devices families that we explicity support (i.e. with std properties) */ /* 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 }; 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 class INDI_E : public TQObject
{ {
Q_OBJECT Q_OBJECT
public: public:
INDI_E(INDI_P *parentProperty, TQString inName, TQString inLabel); INDI_E(INDI_P *parentProperty, TQString inName, TQString inLabel);
~INDI_E(); ~INDI_E();
@ -99,7 +99,7 @@ class INDI_E : public TQObject
INDI_P *pp; /* parent property */ INDI_P *pp; /* parent property */
TQHBoxLayout *EHBox; /*Qt::Horizontal layout */ TQHBoxLayout *EHBox; /*Qt::Horizontal layout */
/* GUI widgets, only malloced when needed */ /* GUI widgets, only malloced when needed */
KSqueezedTextLabel *label_w; // label KSqueezedTextLabel *label_w; // label
KLineEdit *read_w; // read field KLineEdit *read_w; // read field
@ -110,31 +110,31 @@ class INDI_E : public TQObject
KPushButton *push_w; // push button KPushButton *push_w; // push button
KPushButton *browse_w; // browse button KPushButton *browse_w; // browse button
TQCheckBox *check_w; // check box TQCheckBox *check_w; // check box
TQSpacerItem *hSpacer; //Qt::Horizontal spacer TQSpacerItem *hSpacer; // Horizontal spacer
double min, max, step; // params for scale double min, max, step; // params for scale
double value; // current value double value; // current value
double targetValue; // target value double targetValue; // target value
TQString text; // current text TQString text; // current text
TQString format; // number format, if applicable TQString format; // number format, if applicable
int buildTextGUI (TQString initText); int buildTextGUI (TQString initText);
int buildNumberGUI (double initValue); int buildNumberGUI (double initValue);
int buildLightGUI(); int buildLightGUI();
int buildBLOBGUI(); int buildBLOBGUI();
void drawLt(); void drawLt();
void initNumberValues(double newMin, double newMax, double newStep, char * newFormat); void initNumberValues(double newMin, double newMax, double newStep, char * newFormat);
void updateValue(double newValue); void updateValue(double newValue);
void setMin (double inMin); void setMin (double inMin);
void setMax (double inMax); void setMax (double inMax);
void setupElementLabel(); void setupElementLabel();
void setupElementRead(int length); void setupElementRead(int length);
void setupElementWrite(int length); void setupElementWrite(int length);
void setupElementScale(int length); void setupElementScale(int length);
void setupBrowseButton(); void setupBrowseButton();
public slots: public slots:
void spinChanged(double value); void spinChanged(double value);
void sliderChanged(int value); void sliderChanged(int value);

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

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

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

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

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

@ -30,7 +30,7 @@
<string>Correct coordinates of objects for the effects of the atmosphere</string> <string>Correct coordinates of objects for the effects of the atmosphere</string>
</property> </property>
<property name="whatsThis" stdset="0"> <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> </property>
</widget> </widget>
<widget class="TQCheckBox"> <widget class="TQCheckBox">

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

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

@ -24,7 +24,7 @@
#include "skypoint.h" #include "skypoint.h"
#include "starpixmap.h" #include "starpixmap.h"
#define HOVER_INTERVAL 500 #define HOVER_INTERVAL 500
class TQPainter; class TQPainter;
class TQPaintDevice; class TQPaintDevice;
@ -58,7 +58,7 @@ class DeepSkyObject;
class SkyMap : public TQWidget { class SkyMap : public TQWidget {
Q_OBJECT Q_OBJECT
public: public:
/** /**
*Constructor. Read stored settings from TDEConfig object (focus position, *Constructor. Read stored settings from TDEConfig object (focus position,
@ -84,7 +84,7 @@ public:
*/ */
void updateFocus(); 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. *center of the skymap.
*@return a pointer to the central focus point of the sky map *@return a pointer to the central focus point of the sky map
*/ */
@ -93,7 +93,7 @@ public:
/**@short retrieve the Destination position. /**@short retrieve the Destination position.
* *
*The Destination is the point on the sky to which the focus will *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 *@return a pointer to the destination point of the sky map
*/ */
@ -101,9 +101,9 @@ public:
/**@short retrieve the FocusPoint position. /**@short retrieve the FocusPoint position.
* *
*The FocusPoint stores the position on the sky that is to be *The FocusPoint stores the position on the sky that is to be
*focused next. This is not exactly the same as the Destination *focused next. This is not exactly the same as the Destination
*point, because when the Destination is set, it will begin slewing *point, because when the Destination is set, it will begin slewing
*immediately. *immediately.
* *
*@return a pointer to the sky point which is to be focused next. *@return a pointer to the sky point which is to be focused next.
@ -112,8 +112,8 @@ public:
/**@short retrieve the last focus posiiton. /**@short retrieve the last focus posiiton.
* *
*We store the previous focus point to determine how much the focus *We store the previous focus point to determine how much the focus
*position has changed. *position has changed.
* *
*@return a pointer to the previous central focus point of the sky map *@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 /**@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. *It differs only in the data types of its arguments.
* *
*@param ra the new right ascension *@param ra the new right ascension
@ -136,7 +136,7 @@ public:
/**@short sets the focus point of the sky map, using ra/dec coordinates /**@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. *It differs only in the data types of its arguments.
* *
*@param ra the new right ascension *@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 /**@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. *It differs only in the data types of its arguments.
* *
*@param alt the new altitude *@param alt the new altitude
@ -163,7 +163,7 @@ public:
/**@short sets the destination point of the sky map. /**@short sets the destination point of the sky map.
*@note setDestination() emits the destinationChanged() SIGNAL, *@note setDestination() emits the destinationChanged() SIGNAL,
*which triggers the TQT_SLOT function SkyMap::slewFocus(). This *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). *repainting the sky at each step (if Options::useAnimatedSlewing()==true).
*@param f a pointer to the SkyPoint the map should slew to *@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. /**@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. *It differs only in the data types of its arguments.
* *
*@param ra the new right ascension *@param ra the new right ascension
@ -181,7 +181,7 @@ public:
/**@short sets the destination point of the sky map, using ra/dec coordinates /**@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. *It differs only in the data types of its arguments.
* *
*@param ra the new right ascension *@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. /**@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. *It differs only in the data types of its arguments.
* *
*@param alt the new altitude *@param alt the new altitude
@ -230,7 +230,7 @@ public:
void setClickedPoint( SkyPoint *f ) { ClickedPoint.set( f->ra(), f->dec() ); } void setClickedPoint( SkyPoint *f ) { ClickedPoint.set( f->ra(), f->dec() ); }
/**@short Retrieve the PreviousClickedPoint position. /**@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. *penultimate mouse click.
*/ */
SkyPoint* previousClickedPoint() { return &PreviousClickedPoint; } SkyPoint* previousClickedPoint() { return &PreviousClickedPoint; }
@ -243,32 +243,32 @@ public:
/**@short Retrieve a pointer to MousePoint, the sky coordinates of the mouse cursor. /**@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 *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. *@return a pointer to MousePoint, the current sky coordinates of the mouse cursor.
*/ */
SkyPoint* mousePoint() { return &MousePoint; } SkyPoint* mousePoint() { return &MousePoint; }
/**@short Set the MousePoint to the skypoint given as an argument. /**@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. *@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. *argument, and this function returns by value.
*@param f the new MousePoint (typically the output of dXdYToRaDec()). *@param f the new MousePoint (typically the output of dXdYToRaDec()).
*/ */
void setMousePoint( SkyPoint f ) { MousePoint.set( f.ra(), f.dec() ); } 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: *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 *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 *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, *most to least preferred) is: Solar System, custom object, Messier,
*NGC, IC, stars. If no named object was found within the zoom-dependent maximum *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. *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. *slotTransientLabel() and other parts of the code as well.
*@param p pointer to the skypoint around which to search for an object. *@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. *no object was found.
*/ */
SkyObject* objectNearest( SkyPoint *p ); 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 *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 *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. *FocusObject, or NULL if there is not FocusObject.
*@return a pointer to the object at the center of the sky map. *@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. /**@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 *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. *a pointer to the current TransientObject, or NULL if no TransientObject is set.
*@return pointer to the SkyObject nearest to the mouse hover position. *@return pointer to the SkyObject nearest to the mouse hover position.
*@see SkyMap::slotTransientLabel() *@see SkyMap::slotTransientLabel()
*/ */
SkyObject* transientObject( void ) const { return TransientObject; } SkyObject* transientObject( void ) const { return TransientObject; }
/**@short Set the TransientObject pointer to the argument. /**@short Set the TransientObject pointer to the argument.
*@param o pointer to the SkyObject to be assigned as the TransientObject. *@param o pointer to the SkyObject to be assigned as the TransientObject.
*/ */
void setTransientObject( SkyObject *o ) { TransientObject = o; } 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). *1=solid red, 2=solid white or 3=solid black).
*/ */
int starColorMode( void ) const { return starpix->mode(); } int starColorMode( void ) const { return starpix->mode(); }
@ -329,7 +329,7 @@ public:
/**@short Retrieve the color-intensity value for stars. /**@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 *white circles with a colored border. The "color intensity" setting modulates
*the relative thickness of this colored border, so it effectively adjusts *the relative thickness of this colored border, so it effectively adjusts
*the color-saturation level for star images. *the color-saturation level for star images.
@ -339,7 +339,7 @@ public:
/**@short Sets the color-intensity value for stars. /**@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 *white circles with a colored border. The "color intensity" setting modulates
*the relative thickness of this colored border, so it effectively adjusts *the relative thickness of this colored border, so it effectively adjusts
*the color-saturation level for star images. *the color-saturation level for star images.
@ -348,7 +348,7 @@ public:
/**@short set up variables for the checkVisibility function. /**@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, *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() *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(). *(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. */ /**@short Call keyPressEvent, as if the key given as an argument had been pressed. */
void invokeKey( int key ); 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;} 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. /**@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. *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::slotExportImage()
*@see KStars::slotPrint() *@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. /**@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 ); 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. /**@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. *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 ); } void forceUpdateNow() { forceUpdate( true ); }
/**Estimate the effect of atmospheric refraction on object positions. Refraction /**Estimate the effect of atmospheric refraction on object positions. Refraction
*affects only the Altitude angle of objects. Also, the correction should not be applied *affects only the Altitude angle of objects. Also, the correction should not be applied
*to the horizon, which is not beyond the atmosphere. *to the horizon, which is not beyond the atmosphere.
* *
*To estimate refraction, we use a simple analytic equation. To save time, we store *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 *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 *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. *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; *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 ); 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. *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. *For the final step, snap directly to Destination, and redraw the map.
*/ */
void slewFocus( void ); 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 *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. *object/position, adding a Planet Trail if required, etc.
* *
*@see destinationChanged() *@see destinationChanged()
@ -454,38 +454,38 @@ public slots:
*/ */
void slotCenter( void ); 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. *@note the URL is generated using the coordinates of ClickedPoint.
*/ */
void slotDSS( void ); 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. *@note the URL is generated using the coordinates of ClickedPoint.
*/ */
void slotDSS2( void ); void slotDSS2( void );
/**@short Popup menu function: Show webpage about ClickedObject /**@short Popup menu function: Show webpage about ClickedObject
*(only available for some objects). *(only available for some objects).
*@param id the popup-menu ID entry of the selected information page *@param id the popup-menu ID entry of the selected information page
*/ */
void slotInfo( int id ); void slotInfo( int id );
/**@short Popup menu function: Show image of ClickedObject /**@short Popup menu function: Show image of ClickedObject
*(only available for some objects). *(only available for some objects).
*@param id the popup-menu ID entry of the selected image *@param id the popup-menu ID entry of the selected image
*/ */
void slotImage( int id ); 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 ); 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. *have User Labels attached.
*/ */
void slotAddObjectLabel( void ); 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. *have User Labels attached.
*/ */
void slotRemoveObjectLabel( void ); void slotRemoveObjectLabel( void );
@ -497,7 +497,7 @@ public slots:
*@see KSPlanetBase::addToTrail() *@see KSPlanetBase::addToTrail()
*/ */
void slotAddPlanetTrail( void ); void slotAddPlanetTrail( void );
/**@short Remove the PlanetTrail from ClickedObject. /**@short Remove the PlanetTrail from ClickedObject.
*@note The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as *@note The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as
*the trail is empty, no new points will be automatically appended. *the trail is empty, no new points will be automatically appended.
@ -505,26 +505,26 @@ public slots:
*/ */
void slotRemovePlanetTrail( void ); 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. *Opens the AddLinkDialog window.
*/ */
void addLink( void ); void addLink( void );
/**Checks whether the timestep exceeds a threshold value. If so, sets /**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(); 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 *position of the ruler in a SkyPoint. It makes difference between
*having clicked on the skymap and not having done so */ *having clicked on the skymap and not having done so */
void slotBeginAngularDistance(void); 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 *bar and disables the angular distance measuring mode
*If the user has clicked on the map the status bar shows the *If the user has clicked on the map the status bar shows the
*name of the clicked object plus the angular distance. If *name of the clicked object plus the angular distance. If
*the user did not clicked on the map, just pressed ], only *the user did not clicked on the map, just pressed ], only
*the angular distance is printed */ *the angular distance is printed */
void slotEndAngularDistance(void); void slotEndAngularDistance(void);
@ -533,15 +533,15 @@ public slots:
void slotCancelAngularDistance(void); void slotCancelAngularDistance(void);
signals: signals:
/**Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination /**Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination
*point is changed, slewFocus() will iteratively step the Focus toward Destination *point is changed, slewFocus() will iteratively step the Focus toward Destination
*until it is reached. *until it is reached.
*@see SkyMap::setDestination() *@see SkyMap::setDestination()
*@see SkyMap::slewFocus() *@see SkyMap::slewFocus()
*/ */
void destinationChanged(); 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. *that it needs to update its lists of URL links.
*/ */
void linkAdded(); void linkAdded();
@ -550,12 +550,12 @@ protected:
/**Draw the Sky, and all objects in it. */ /**Draw the Sky, and all objects in it. */
virtual void paintEvent( TQPaintEvent *e ); virtual void paintEvent( TQPaintEvent *e );
/**Process keystrokes: /**Process keystrokes:
*@li arrow keys Slew the map *@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 N/E/S/W keys Go to the cardinal points on the Horizon
*@li Z Go to the Zenith *@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 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 [ Place starting point for measuring an angular distance
*@li ] End point for Angular Distance; display measurement. *@li ] End point for Angular Distance; display measurement.
@ -572,7 +572,7 @@ protected:
/**Determine RA, Dec coordinates of clicked location. Find the SkyObject /**Determine RA, Dec coordinates of clicked location. Find the SkyObject
*which is nearest to the clicked location. *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. *nearest object name in status bar.
*If right-clicked: display popup menu appropriate for nearest object. *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, *@li If Angle-measurement mode is active, update the end-ruler point to the mouse cursor,
*and continue this function. *and continue this function.
*@li If we are dragging an InfoBox, simply redraw the screen and return. *@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. *and return.
*@li If dragging the mouse in the map, update focus such that RA, Dec under the mouse *@li If dragging the mouse in the map, update focus such that RA, Dec under the mouse
*cursor remains constant. *cursor remains constant.
*@li If just moving the mouse, simply update the curso coordinates in the status bar. *@li If just moving the mouse, simply update the curso coordinates in the status bar.
*/ */
virtual void mouseMoveEvent( TQMouseEvent *e ); virtual void mouseMoveEvent( TQMouseEvent *e );
@ -599,25 +599,25 @@ protected:
/**Zoom in and out with the mouse wheel. */ /**Zoom in and out with the mouse wheel. */
virtual void wheelEvent( TQWheelEvent *e ); 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. *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 * ); virtual void resizeEvent( TQResizeEvent * );
private slots: private slots:
/**Gradually fade the Transient Hover Label into the background sky color, and /**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. *TransientObject pointer to NULL to remove the label.
*/ */
void slotTransientTimeout(); void slotTransientTimeout();
/**@short attach transient label to object nearest the mouse cursor. /**@short attach transient label to object nearest the mouse cursor.
*This slot is connected to the timeout() signal of the HoverTimer, which is restarted *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 *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 *HOVER_INTERVAL msec. It points TransientObject at the SkyObject nearest the
*mouse cursor, and the TransientObject is subsequently labeled in paintEvent(). *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. *fadeTransientLabel(), which fades the label color and then sets TransientLabel to NULL.
*@sa mouseMoveEvent(), paintEvent(), slotTransientTimeout(), fadeTransientLabel() *@sa mouseMoveEvent(), paintEvent(), slotTransientTimeout(), fadeTransientLabel()
*/ */
@ -628,7 +628,7 @@ private slots:
private: private:
// Drawing functions. Each takes a TQPainter reference and a scaling factor as arguments. // 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 // 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. // 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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawMilkyWay( TQPainter& psky, double scale = 1.0 ); void drawMilkyWay( TQPainter& psky, double scale = 1.0 );
/**@short Draw the coordinate system grid lines. /**@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 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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawCoordinateGrid( TQPainter& psky, double scale = 1.0 ); void drawCoordinateGrid( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Celestial Equator line. /**@short Draw the Celestial Equator line.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawEquator( TQPainter& psky, double scale = 1.0 ); void drawEquator( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Ecliptic line. /**@short Draw the Ecliptic line.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawEcliptic( TQPainter& psky, double scale = 1.0 ); void drawEcliptic( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Horizon Line, the compass point labels, and the opaque ground. /**@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 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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawHorizon( TQPainter& psky, double scale = 1.0 ); void drawHorizon( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Constellation Lines. /**@short Draw the Constellation Lines.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawConstellationLines( TQPainter& psky, double scale = 1.0 ); void drawConstellationLines( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Constellation Boundaries. /**@short Draw the Constellation Boundaries.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawConstellationBoundaries( TQPainter& psky, double scale = 1.0 ); void drawConstellationBoundaries( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Constellation Names. /**@short Draw the Constellation Names.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawConstellationNames( TQPainter& psky, double scale = 1.0 ); void drawConstellationNames( TQPainter& psky, double scale = 1.0 );
/**@short Draw the Stars. /**@short Draw the Stars.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawStars( TQPainter& psky, double scale = 1.0 ); 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) *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) *@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() *@see SkyMap::drawDeepSkyCatalog()
*/ */
void drawDeepSkyObjects( TQPainter& psky, double scale = 1.0 ); void drawDeepSkyObjects( TQPainter& psky, double scale = 1.0 );
/**@short Draw a Deep-Sky Catalog. /**@short Draw a Deep-Sky Catalog.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@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. *@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 ); void drawDeepSkyCatalog( TQPainter& psky, TQPtrList<DeepSkyObject>& catalog, TQColor& color, bool drawObject, bool drawImage, double scale = 1.0 );
/**@short Draw the Planet Trails. /**@short Draw the Planet Trails.
* *
*"Planet Trails" can be attached to any solar system body; they are lists of SkyPoints *"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. *@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 ); void drawPlanetTrail( TQPainter& psky, KSPlanetBase *ksp, double scale = 1.0 );
/**@short Draw all solar system bodies: Sun, Moon, 8 planets, comets, asteroids. /**@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 psky reference to the TQPainter on which to draw (either the sky pixmap or printer device)
*@param drawPlanets if FALSE, do nothing *@param drawPlanets if FALSE, do nothing
*@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. *@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 ); 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 *the right-click popup menu. Also adds a label to the FocusObject if the Option UseAutoLabel
*is TRUE. *is TRUE.
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing.
*/ */
void drawAttachedLabels( TQPainter &psky, double scale = 1.0 ); 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(). *draw functions and also by drawAttachedLabels().
*@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@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. *@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 /**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 *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 *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 psky reference to the TQPainter on which to draw
*@param p pointer to the KSPlanetBase to be drawn *@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 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 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, *@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. *because its image includes the Rings, which are not included in its angular size measurement.
*(there's probably a better way to handle this) *(there's probably a better way to handle this)
*@param scale the scale factor used for printing the sky image. *@param scale the scale factor used for printing the sky image.
*/ */
void drawPlanet(TQPainter &psky, KSPlanetBase *p, TQColor c, void drawPlanet(TQPainter &psky, KSPlanetBase *p, TQColor c,
double zoommin, int resize_mult = 1, double scale = 1.0 ); double zoommin, int resize_mult = 1, double scale = 1.0 );
/**Draw the overlays on top of the sky map. These include the infoboxes, /**Draw the overlays on top of the sky map. These include the infoboxes,
*field-of-view indicator, telescope symbols, zoom box and any other *field-of-view indicator, telescope symbols, zoom box and any other
*user-interaction graphics. *user-interaction graphics.
@ -768,21 +768,21 @@ private:
*@param pm pointer to the Sky pixmap *@param pm pointer to the Sky pixmap
*/ */
void drawOverlays( TQPixmap *pm ); void drawOverlays( TQPixmap *pm );
/**Draw the Focus, Geo and Time InfoBoxes. This is called by drawOverlays(). /**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). *@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. *@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*@see SkyMap::drawOverlays() *@see SkyMap::drawOverlays()
*/ */
void drawBoxes( TQPainter &p ); void drawBoxes( TQPainter &p );
/**Draw symbols at the position of each Telescope currently being controlled by KStars. /**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 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. *@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); void drawTelescopeSymbols(TQPainter &psky);
/**@short Draw symbols for objects in the observing list. /**@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) *@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. *@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 ); void drawObservingList( TQPainter &psky, double scale = 1.0 );
/**Draw a dotted-line rectangle which traces the potential new field-of-view in ZoomBox mode. /**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. *@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*/ */
void drawZoomBox( TQPainter &psky); 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. *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. *@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout() *@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, /**Draw a dashed line from the Angular-Ruler start point to the current mouse cursor,
*when in Angular-Ruler mode. *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. *@note there is no scale factor because this is only used for drawing onto the screen, not printing.
*/ */
void drawAngleRuler( TQPainter &psky ); void drawAngleRuler( TQPainter &psky );
@ -825,7 +825,7 @@ private:
*screen pixel coordinate offsets from the center of the Sky pixmap. *screen pixel coordinate offsets from the center of the Sky pixmap.
*@param dx horizontal pixel offset from center of SkyMap. *@param dx horizontal pixel offset from center of SkyMap.
*@param dy vertical 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 LSTh pointer to the local sidereal time, as a dms object.
*@param lat pointer to the current geographic laitude, as a dms object *@param lat pointer to the current geographic laitude, as a dms object
*@param doRefraction if TRUE, correct for atmospheric refraction *@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 ); 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. /**@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. *FOV angle. It chooses whichever is larger.
*/ */
float fov(); 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. *window.
* *
*checkVisibility() is an optimization function. It determines whether an object *checkVisibility() is an optimization function. It determines whether an object
*appears within the bounds of the skymap window, and therefore should be drawn. *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 *absolutely essential that checkVisibility() is significantly faster than
*the computations required to draw the object to the screen. *the computations required to draw the object to the screen.
* *
*The function first checks the difference between the Declination/Altitude *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. *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. *exclude a large number of objects.
* *
*Next, it determines if one of the poles of the current Coordinate System *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 *(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 *stored in the member variable 'bool SkyMap::isPoleVisible, and is set by the
*function SkyMap::setMapGeometry(), which is called by SkyMap::paintEvent(). *function SkyMap::setMapGeometry(), which is called by SkyMap::paintEvent().
*If a Pole is visible, then it will return TRUE immediately. The idea is that *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 *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* *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, *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 *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 *"horizontal" RA/Az values, since we have already determined that they are
*on-screen in the "vertical" Dec/Alt coordinate. *on-screen in the "vertical" Dec/Alt coordinate.
* *
*Finally, if no Pole is onscreen, it checks the difference between the Focus *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 *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, *this difference is larger than XMax, the function returns FALSE. Otherwise,
*it returns TRUE. *it returns TRUE.
*@param p pointer to the skypoint to be checked. *@param p pointer to the skypoint to be checked.
*@param fov the vertical center-to-edge angle of the window, in degrees *@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 *@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. /**@short Begin fading out the name label attached to TransientObject.
* *
*mouseMoveEvent() will call fadeTransientLabel() when TransientObject is not a *mouseMoveEvent() will call fadeTransientLabel() when TransientObject is not a
*NULL pointer, and the TransientTimer is not already active. These conditions *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 *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. *TransientLabel), but the mouse has since been moved, thus ending the Hover event.
*This function merely starts the TransientTimer, whose timeout TQT_SIGNAL is *This function merely starts the TransientTimer, whose timeout TQT_SIGNAL is
*connected to the slotTransientTimeout() SLOT, which handles the actual fading *connected to the slotTransientTimeout() SLOT, which handles the actual fading
*of the transient label, and eventually resets TransientObject to NULL. *of the transient label, and eventually resets TransientObject to NULL.
*@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout() *@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout()
*/ */
@ -894,24 +894,24 @@ private:
/**Determine the on-screen position angle of a SkyObject. This is the sum /**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 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). *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 *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 *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. *Y-axis of the line connecing the object to its test point.
*/ */
double findPA( SkyObject *o, int x, int y, double scale=1.0 ); 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(); 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(); void setZoomMouseCursor();
/**Check if the current point on screen is a valid point on the sky. This is needed /**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 *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 dx the screen pixel X-coordinate, relative to the screen center
*@param dy the screen pixel Y-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; double guideXRange;
TQString sURL; TQString sURL;
KStars *ksw; KStars *ksw;
KStarsData *data; KStarsData *data;
KSPopupMenu *pmenu; KSPopupMenu *pmenu;

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

@ -45,7 +45,7 @@
<property name="whatsThis" stdset="0"> <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.). <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> </property>
</widget> </widget>
<widget class="TQLabel" row="0" column="0"> <widget class="TQLabel" row="0" column="0">

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

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