From e8c90f7ea7d7751f24bb7d12e8fb5cfe562509ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 5 Mar 2015 05:07:34 +0100 Subject: Fix incorrectly renamed strings --- kstars/kstars/data/tips | 4 +- kstars/kstars/detaildialog.cpp | 118 +++--- kstars/kstars/indi/apogee/ApnCamera.cpp | 170 ++++---- kstars/kstars/indi/apogee/CameraIO_Linux.h | 50 +-- kstars/kstars/indi/fli/libfli.c | 4 +- kstars/kstars/indi/fli_ccd.c | 464 +++++++++++----------- kstars/kstars/indidevice.cpp | 164 ++++---- kstars/kstars/indielement.h | 22 +- kstars/kstars/indiproperty.cpp | 184 ++++----- kstars/kstars/indistd.cpp | 296 +++++++------- kstars/kstars/ksplanetbase.h | 12 +- kstars/kstars/kstarsactions.cpp | 24 +- kstars/kstars/kstarsdcop.cpp | 276 ++++++------- kstars/kstars/opsadvancedui.ui | 2 +- kstars/kstars/planetcatalog.h | 12 +- kstars/kstars/skymap.cpp | 80 ++-- kstars/kstars/skymap.h | 284 +++++++------- kstars/kstars/skypoint.h | 42 +- kstars/kstars/tools/argsetaltaz.ui | 2 +- kstars/kstars/tools/observinglist.cpp | 124 +++--- kstars/kstars/tools/scriptbuilder.cpp | 596 ++++++++++++++--------------- 21 files changed, 1465 insertions(+), 1465 deletions(-) diff --git a/kstars/kstars/data/tips b/kstars/kstars/data/tips index 8e97baa7..91f82248 100644 --- a/kstars/kstars/data/tips +++ b/kstars/kstars/data/tips @@ -83,7 +83,7 @@

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.

@@ -109,7 +109,7 @@ -

To switch between Equatorial andQt::Horizontal coordinate +

To switch between Equatorial and Horizontal coordinate systems, use the "View->Coordinates" menu item, or press the spacebar.

diff --git a/kstars/kstars/detaildialog.cpp b/kstars/kstars/detaildialog.cpp index fe105d5b..d90131a3 100644 --- a/kstars/kstars/detaildialog.cpp +++ b/kstars/kstars/detaildialog.cpp @@ -57,7 +57,7 @@ #include "devicemanager.h" #include "indistd.h" -LogEdit::LogEdit( TQWidget *parent, const char *name ) : KTextEdit( parent, name ) +LogEdit::LogEdit( TQWidget *parent, const char *name ) : KTextEdit( parent, name ) { setFrameStyle( TQFrame::StyledPanel ); setFrameShadow( TQFrame::Plain ); @@ -69,11 +69,11 @@ void LogEdit::focusOutEvent( TQFocusEvent *e ) { TQWidget::focusOutEvent(e); } -ClickLabel::ClickLabel( TQWidget *parent, const char *name ) : TQLabel( parent, name ) +ClickLabel::ClickLabel( TQWidget *parent, const char *name ) : TQLabel( parent, name ) {} -DetailDialog::DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation *geo, - TQWidget *parent, const char *name ) : +DetailDialog::DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation *geo, + TQWidget *parent, const char *name ) : KDialogBase( KDialogBase::Tabbed, i18n( "Object Details" ), Close, Close, parent, name ) , selectedObject(o), ksw((KStars*)parent), Data(0), Pos(0), Links(0), Adv(0), Log(0) { @@ -101,7 +101,7 @@ void DetailDialog::createGeneralTab() { TQFrame *DataTab = addPage(i18n("General")); Data = new DetailsDataUI( DataTab, "general_data_tab" ); - + //Modify colors Data->Names->setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); Data->Names->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::HighlightedText ) ); @@ -139,7 +139,7 @@ void DetailDialog::createGeneralTab() TDEGlobal::locale()->formatNumber( s->mag(), 1 ) ) ); //show to tenths place //distance - if ( s->distance() > 2000. || s->distance() < 0. ) // parallax < 0.5 mas + if ( s->distance() > 2000. || s->distance() < 0. ) // parallax < 0.5 mas Data->Distance->setText( TQString(i18n("larger than 2000 parsecs", "> 2000 pc") ) ); else if ( s->distance() > 50.0 ) //show to nearest integer Data->Distance->setText( i18n( "number in parsecs", "%1 pc" ).arg( @@ -158,18 +158,18 @@ void DetailDialog::createGeneralTab() if ( s->isMultiple() && s->isVariable() ) { Data->AngSizeLabel->setText( i18n( "the star is a multiple star", "multiple" ) + "," ); Data->AngSize->setText( i18n( "the star is a variable star", "variable" ) ); - } else if ( s->isMultiple() ) + } else if ( s->isMultiple() ) Data->AngSizeLabel->setText( i18n( "the star is a multiple star", "multiple" ) ); - else if ( s->isVariable() ) + else if ( s->isVariable() ) Data->AngSizeLabel->setText( i18n( "the star is a variable star", "variable" ) ); - + break; //end of stars case case 9: //asteroids [fall through to planets] case 10: //comets [fall through to planets] case 2: //planets (including comets and asteroids) ps = (KSPlanetBase *)selectedObject; - + Data->Names->setText( ps->longname() ); //Type is "G5 star" for Sun if ( ps->name() == "Sun" ) @@ -177,7 +177,7 @@ void DetailDialog::createGeneralTab() else Data->Type->setText( ps->typeName() ); - Data->Constellation->setText( ps->constellation( ksw->data()->csegmentList, + Data->Constellation->setText( ps->constellation( ksw->data()->csegmentList, ksw->data()->cnameList ) ); //Magnitude: The moon displays illumination fraction instead @@ -191,20 +191,20 @@ void DetailDialog::createGeneralTab() //Distance from Earth. The moon requires a unit conversion if ( ps->name() == "Moon" ) { - Data->Distance->setText( i18n("distance in kilometers", "%1 km").arg( + Data->Distance->setText( i18n("distance in kilometers", "%1 km").arg( TDEGlobal::locale()->formatNumber( ps->rearth()*AU_KM ) ) ); } else { - Data->Distance->setText( i18n("distance in Astronomical Units", "%1 AU").arg( + Data->Distance->setText( i18n("distance in Astronomical Units", "%1 AU").arg( TDEGlobal::locale()->formatNumber( ps->rearth() ) ) ); } //Angular size; moon and sun in arcmin, others in arcsec if ( ps->angSize() ) { - if ( ps->name() == "Sun" || ps->name() == "Moon" ) - Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg( + if ( ps->name() == "Sun" || ps->name() == "Moon" ) + Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg( TDEGlobal::locale()->formatNumber( ps->angSize() ) ) ); else - Data->AngSize->setText( i18n("angular size in arcseconds", "%1 arcsec").arg( + Data->AngSize->setText( i18n("angular size in arcseconds", "%1 arcsec").arg( TDEGlobal::locale()->formatNumber( ps->angSize()*60.0 ) ) ); } else { Data->AngSize->setText( "--" ); @@ -236,7 +236,7 @@ void DetailDialog::createGeneralTab() if ( ! oname.isEmpty() ) oname += ", "; oname += "PGC " + TQString("%1").arg( dso->pgc() ); } - + if ( ! oname.isEmpty() ) pname += ", " + oname; Data->Names->setText( pname ); @@ -252,20 +252,20 @@ void DetailDialog::createGeneralTab() Data->Distance->setText( "--" ); //Only show decimal place for small angular sizes - if ( dso->a() > 10.0 ) - Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg( + if ( dso->a() > 10.0 ) + Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg( int( dso->a() ) ) ); - else if ( dso->a() ) - Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg( + else if ( dso->a() ) + Data->AngSize->setText( i18n("angular size in arcminutes", "%1 arcmin").arg( TDEGlobal::locale()->formatNumber( dso->a(), 1 ) ) ); - else + else Data->AngSize->setText( "--" ); - + break; } //Common to all types: - Data->Constellation->setText( selectedObject->constellation( ksw->data()->csegmentList, + Data->Constellation->setText( selectedObject->constellation( ksw->data()->csegmentList, ksw->data()->cnameList ) ); } @@ -307,7 +307,7 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo TQVBoxLayout *vlay = new TQVBoxLayout( PosTab, 0, 0 ); vlay->addWidget( Pos ); - + //Coordinates Section: //Don't use TDELocale::formatNumber() for the epoch string, //because we don't want a thousands-place separator! @@ -335,10 +335,10 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo //Airmass is approximated as the secant of the zenith distance, //equivalent to 1./sin(Alt). Beware of Inf at Alt=0! - if ( selectedObject->alt()->Degrees() > 0.0 ) - Pos->Airmass->setText( TDEGlobal::locale()->formatNumber( + if ( selectedObject->alt()->Degrees() > 0.0 ) + Pos->Airmass->setText( TDEGlobal::locale()->formatNumber( 1./sin( selectedObject->alt()->radians() ), 2 ) ); - else + else Pos->Airmass->setText( "--" ); //Rise/Set/Transit Section: @@ -447,10 +447,10 @@ void DetailDialog::createAdvancedTab() { // Don't create an adv tab for an unnamed star or if advinterface file failed loading // We also don't need adv dialog for solar system objects. - if (selectedObject->name() == TQString("star") || - ksw->data()->ADVtreeList.isEmpty() || - selectedObject->type() == SkyObject::PLANET || - selectedObject->type() == SkyObject::COMET || + if (selectedObject->name() == TQString("star") || + ksw->data()->ADVtreeList.isEmpty() || + selectedObject->type() == SkyObject::PLANET || + selectedObject->type() == SkyObject::COMET || selectedObject->type() == SkyObject::ASTEROID ) return; @@ -507,7 +507,7 @@ void DetailDialog::viewLink() { TQString URL; - if ( Links->InfoList->currentItem() != -1 && + if ( Links->InfoList->currentItem() != -1 && Links->InfoList->isSelected( Links->InfoList->currentItem() ) ) URL = TQString( *selectedObject->InfoList.at( Links->InfoList->currentItem() ) ); else if ( Links->ImagesList->currentItem() != -1 ) @@ -521,11 +521,11 @@ void DetailDialog::updateLists() { Links->InfoList->clear(); Links->ImagesList->clear(); - + TQStringList::Iterator itList = selectedObject->InfoList.begin(); TQStringList::Iterator itTitle = selectedObject->InfoTitle.begin(); TQStringList::Iterator itListEnd = selectedObject->InfoList.end(); - + for ( ; itList != itListEnd; ++itList ) { Links->InfoList->insertItem(TQString(*itTitle)); itTitle++; @@ -548,10 +548,10 @@ void DetailDialog::editLinkDialog() uint i; TQString defaultURL , entry; TQFile newFile; - + KDialogBase editDialog(KDialogBase::Plain, i18n("Edit Link"), Ok|Cancel, Ok , this, "editlink", false); TQFrame *editFrame = editDialog.plainPage(); - + editLinkURL = new TQLabel(i18n("URL:"), editFrame); editLinkField = new TQLineEdit(editFrame, "lineedit"); editLinkField->setMinimumWidth(300); @@ -559,9 +559,9 @@ void DetailDialog::editLinkDialog() editLinkLayout = new TQHBoxLayout(editFrame, 6, 6, "editlinklayout"); editLinkLayout->addWidget(editLinkURL); editLinkLayout->addWidget(editLinkField); - + currentItemIndex = Links->InfoList->currentItem(); - + if (currentItemIndex != -1 && Links->InfoList->isSelected(currentItemIndex)) { defaultURL = *selectedObject->InfoList.at(currentItemIndex); @@ -590,8 +590,8 @@ void DetailDialog::editLinkDialog() entry = selectedObject->name() + ":" + currentItemTitle + ":" + currentItemURL; //FIXME: usage of verifyUserData() is pretty unclear - //verifyUserData() returns false if currentItemTitle/currentItemURL - //are not found in the user's list already. If they are, then that + //verifyUserData() returns false if currentItemTitle/currentItemURL + //are not found in the user's list already. If they are, then that //item is removed. switch (type) { @@ -641,9 +641,9 @@ void DetailDialog::removeLinkDialog() uint i; TQString defaultURL, entry; TQFile newFile; - + currentItemIndex = Links->InfoList->currentItem(); - + if (currentItemIndex != -1 && Links->InfoList->isSelected(currentItemIndex)) { defaultURL = *selectedObject->InfoList.at(currentItemIndex); @@ -697,7 +697,7 @@ bool DetailDialog::verifyUserData(int type) TQString line, name, sub, title; bool ObjectFound = false; uint i; - + switch (type) { case 0: @@ -766,7 +766,7 @@ bool DetailDialog::readUserFile(int type)//, int sourceFileType) TQTextStream stream(&file); dataList.clear(); - + // read all data into memory while (!stream.eof()) dataList.append(stream.readLine()); @@ -844,7 +844,7 @@ TQString DetailDialog::parseADVData(TQString link) { TQString subLink; int index; - + if ( (index = link.find("KSOBJ")) != -1) { link.remove(index, 5); @@ -904,13 +904,13 @@ void DetailDialog::centerTelescope() bool useJ2000( false); int selectedCoord(0); SkyPoint sp; - + // Find the first device with EQUATORIAL_EOD_COORD or EQUATORIAL_COORD and with SLEW element // i.e. the first telescope we find! - + INDIMenu *imenu = ksw->getINDIMenu(); - + for (unsigned int i=0; i < imenu->mgr.count() ; i++) { for (unsigned int j=0; j < imenu->mgr.at(i)->indi_dev.count(); j++) @@ -935,7 +935,7 @@ void DetailDialog::centerTelescope() ConnectEle = indidev->findElem("CONNECT"); if (!ConnectEle) continue; - + if (ConnectEle->state == PS_OFF) { KMessageBox::error(0, i18n("Telescope %1 is offline. Please connect and retry again.").arg(indidev->label)); @@ -953,7 +953,7 @@ void DetailDialog::centerTelescope() if (!DecEle) continue; break; - //Qt::Horizontal + // Horizontal case 1: if (prop->perm == PP_RO) continue; AzEle = prop->findElement("AZ"); @@ -962,10 +962,10 @@ void DetailDialog::centerTelescope() if (!AltEle) continue; break; } - + onset = indidev->findProp("ON_COORD_SET"); if (!onset) continue; - + onset->activateSwitch("SLEW"); indidev->stdDev->currentObject = selectedObject; @@ -1016,19 +1016,19 @@ void DetailDialog::centerTelescope() } prop->newText(); - + return; } } - + // We didn't find any telescopes KMessageBox::sorry(0, i18n("KStars did not find any active telescopes.")); - + } void DetailDialog::showThumbnail() { //No image if object is a star - if ( selectedObject->type() == SkyObject::STAR || + if ( selectedObject->type() == SkyObject::STAR || selectedObject->type() == SkyObject::CATALOG_STAR ) { Thumbnail->resize( Data->Image->width(), Data->Image->height() ); Thumbnail->fill( Data->paletteBackgroundColor() ); @@ -1057,9 +1057,9 @@ void DetailDialog::showThumbnail() { void DetailDialog::updateThumbnail() { ThumbnailPicker tp( selectedObject, *Thumbnail, this, "thumbnaileditor" ); - + if ( tp.exec() == TQDialog::Accepted ) { - TQString fname = locateLocal( "appdata", "thumb-" + TQString fname = locateLocal( "appdata", "thumb-" + selectedObject->name().lower().replace( TQRegExp(" "), "" ) + ".png" ); Data->Image->setPixmap( *(tp.image()) ); diff --git a/kstars/kstars/indi/apogee/ApnCamera.cpp b/kstars/kstars/indi/apogee/ApnCamera.cpp index 457722b5..0cba7f39 100644 --- a/kstars/kstars/indi/apogee/ApnCamera.cpp +++ b/kstars/kstars/indi/apogee/ApnCamera.cpp @@ -33,7 +33,7 @@ bool CApnCamera::Expose( double Duration, bool Light ) ULONG ExpTime; unsigned short BitsPerPixel(0); unsigned short UnbinnedRoiX; - unsigned short UnbinnedRoiY; + unsigned short UnbinnedRoiY; unsigned short PreRoiSkip, PostRoiSkip; unsigned short PreRoiRows, PostRoiRows; unsigned short PreRoiVBinning, PostRoiVBinning; @@ -61,7 +61,7 @@ bool CApnCamera::Expose( double Duration, bool Light ) PostRoiSkip = m_ApnSensorInfo->m_TotalColumns - m_ApnSensorInfo->m_ClampColumns - - PreRoiSkip - + PreRoiSkip - UnbinnedRoiX; TotalHPixels = UnbinnedRoiX + PreRoiSkip + PostRoiSkip + m_ApnSensorInfo->m_ClampColumns; @@ -71,9 +71,9 @@ bool CApnCamera::Expose( double Duration, bool Light ) UnbinnedRoiY = m_RoiPixelsV * m_RoiBinningV; - PreRoiRows = m_ApnSensorInfo->m_UnderscanRows + + PreRoiRows = m_ApnSensorInfo->m_UnderscanRows + m_RoiStartY; - + PostRoiRows = m_ApnSensorInfo->m_TotalRows - PreRoiRows - UnbinnedRoiY; @@ -133,14 +133,14 @@ bool CApnCamera::Expose( double Duration, bool Light ) { PreRoiVBinning += PreRoiRows; PostRoiVBinning = PostRoiRows; - + PreRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP; PostRoiVBinning |= FPGA_BIT_ARRAY_FASTDUMP; - + PreRoiRows = 1; PostRoiRows = 1; } - + // Issue the reset RoiRegBuffer[0] = FPGA_REG_COMMAND_B; @@ -151,7 +151,7 @@ bool CApnCamera::Expose( double Duration, bool Light ) RoiRegData[1] = PreRoiSkip; RoiRegBuffer[2] = FPGA_REG_ROI_COUNT; - // Number of ROI pixels. Adjust the 12bit operation here to account for an extra + // Number of ROI pixels. Adjust the 12bit operation here to account for an extra // 10 pixel shift as a result of the A/D conversion. if ( m_DataBits == Apn_Resolution_SixteenBit ) { @@ -282,7 +282,7 @@ bool CApnCamera::StopExposure( bool DigitizeData ) return true; } - + unsigned short CApnCamera::GetExposurePixelsH() { @@ -365,10 +365,10 @@ void CApnCamera::write_ForceShutterOpen( bool ForceShutterOpen ) { unsigned short RegVal; Read( FPGA_REG_OP_A, RegVal ); - + if ( ForceShutterOpen ) RegVal |= FPGA_BIT_FORCE_SHUTTER; - else + else RegVal &= ~FPGA_BIT_FORCE_SHUTTER; Write( FPGA_REG_OP_A, RegVal ); @@ -492,7 +492,7 @@ void CApnCamera::write_CameraMode( Apn_CameraMode CameraMode ) Write( FPGA_REG_OP_A, RegVal ); break; } - + switch ( CameraMode ) { case Apn_CameraMode_Normal: @@ -525,7 +525,7 @@ void CApnCamera::write_DataBits( Apn_Resolution BitResolution ) if ( m_CameraInterface == Apn_Interface_NET ) { - // The network interface is 16bpp only. Changing the resolution + // The network interface is 16bpp only. Changing the resolution // for network cameras has no effect. return; } @@ -537,7 +537,7 @@ void CApnCamera::write_DataBits( Apn_Resolution BitResolution ) // Change bit setting after the reset Read( FPGA_REG_OP_A, RegVal ); - + if ( BitResolution == Apn_Resolution_TwelveBit ) RegVal |= FPGA_BIT_DIGITIZATION_RES; @@ -547,7 +547,7 @@ void CApnCamera::write_DataBits( Apn_Resolution BitResolution ) Write( FPGA_REG_OP_A, RegVal ); m_DataBits = BitResolution; - + LoadClampPattern(); LoadSkipPattern(); LoadRoiPattern( m_RoiBinningH ); @@ -578,16 +578,16 @@ Apn_Status CApnCamera::read_ImagingStatus() if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGING_ACTIVE) != 0 ) Active = true; - + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGE_EXPOSING) != 0 ) Exposing = true; - + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_IMAGE_DONE) != 0 ) Done = true; - + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_FLUSHING) != 0 ) Flushing = true; - + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_WAITING_TRIGGER) != 0 ) WaitOnTrigger = true; @@ -714,7 +714,7 @@ Apn_LedState CApnCamera::read_LedState( unsigned short LedId ) if ( LedId == 0 ) // LED A RetVal = m_pvtLedStateA; - + if ( LedId == 1 ) // LED B RetVal = m_pvtLedStateB; @@ -779,7 +779,7 @@ Apn_CoolerStatus CApnCamera::read_CoolerStatus() if ( (m_pvtStatusReg & FPGA_BIT_STATUS_TEMP_AT_TEMP) != 0 ) CoolerAtTemp = true; - + if ( (m_pvtStatusReg & FPGA_BIT_STATUS_TEMP_ACTIVE) != 0 ) CoolerActive = true; @@ -816,7 +816,7 @@ double CApnCamera::read_CoolerSetPoint() double TempVal; Read( FPGA_REG_TEMP_DESIRED, RegVal ); - + RegVal &= 0x0FFF; TempVal = ( RegVal - APN_TEMP_SETPOINT_ZERO_POINT ) * APN_TEMP_DEGREES_PER_BIT; @@ -828,7 +828,7 @@ void CApnCamera::write_CoolerSetPoint( double SetPoint ) { unsigned short RegVal; double TempVal; - + TempVal = SetPoint; @@ -839,7 +839,7 @@ void CApnCamera::write_CoolerSetPoint( double SetPoint ) TempVal = APN_TEMP_SETPOINT_MAX; RegVal = (unsigned short)( (TempVal / APN_TEMP_DEGREES_PER_BIT) + APN_TEMP_SETPOINT_ZERO_POINT ); - + Write( FPGA_REG_TEMP_DESIRED, RegVal ); } @@ -852,7 +852,7 @@ void CApnCamera::write_CoolerBackoffPoint( double BackoffPoint ) { unsigned short RegVal; double TempVal; - + TempVal = BackoffPoint; // BackoffPoint must be a positive number! @@ -868,7 +868,7 @@ void CApnCamera::write_CoolerBackoffPoint( double BackoffPoint ) m_pvtCoolerBackoffPoint = TempVal; RegVal = (unsigned short)( TempVal / APN_TEMP_DEGREES_PER_BIT ); - + Write( FPGA_REG_TEMP_BACKOFF, RegVal ); } @@ -902,7 +902,7 @@ double CApnCamera::read_TempCCD() TempAvg = (unsigned short)(TempTotal / don); - m_pvtCurrentCcdTemp = ( (TempAvg - APN_TEMP_SETPOINT_ZERO_POINT) + m_pvtCurrentCcdTemp = ( (TempAvg - APN_TEMP_SETPOINT_ZERO_POINT) * APN_TEMP_DEGREES_PER_BIT ); return m_pvtCurrentCcdTemp; @@ -931,7 +931,7 @@ double CApnCamera::read_TempHeatsink() TempAvg = (unsigned short)(TempTotal / don); - m_pvtCurrentHeatsinkTemp = ( (TempAvg - APN_TEMP_HEATSINK_ZERO_POINT) + m_pvtCurrentHeatsinkTemp = ( (TempAvg - APN_TEMP_HEATSINK_ZERO_POINT) * APN_TEMP_DEGREES_PER_BIT ); return m_pvtCurrentHeatsinkTemp; @@ -957,11 +957,11 @@ void CApnCamera::write_FanMode( Apn_FanMode FanMode ) OpRegA |= FPGA_BIT_TEMP_SUSPEND; Write( FPGA_REG_OP_A, OpRegA ); - do - { + do + { Read( FPGA_REG_GENERAL_STATUS, RegVal ); } while ( (RegVal & FPGA_BIT_STATUS_TEMP_SUSPEND_ACK) == 0 ); - + } switch ( FanMode ) @@ -1006,7 +1006,7 @@ double CApnCamera::read_ShutterStrobePosition() void CApnCamera::write_ShutterStrobePosition( double Position ) { unsigned short RegVal; - + if ( Position < APN_STROBE_POSITION_MIN ) Position = APN_STROBE_POSITION_MIN; @@ -1032,7 +1032,7 @@ void CApnCamera::write_ShutterStrobePeriod( double Period ) RegVal = (unsigned short)((Period - APN_STROBE_PERIOD_MIN) / APN_PERIOD_TIMER_RESOLUTION); Write( FPGA_REG_SHUTTER_STROBE_PERIOD, RegVal ); - + m_pvtShutterStrobePeriod = Period; } @@ -1060,7 +1060,7 @@ bool CApnCamera::read_VariableSequenceDelay() unsigned short RegVal; Read( FPGA_REG_OP_A, RegVal ); // variable delay occurs when the bit is 0 - return ( (RegVal & FPGA_BIT_DELAY_MODE) == 0 ); + return ( (RegVal & FPGA_BIT_DELAY_MODE) == 0 ); } void CApnCamera::write_VariableSequenceDelay( bool VariableSequenceDelay ) @@ -1088,7 +1088,7 @@ void CApnCamera::write_ImageCount( unsigned short Count ) Count = 1; Write( FPGA_REG_IMAGE_COUNT, Count ); - + m_pvtImageCount = Count; } @@ -1182,7 +1182,7 @@ void CApnCamera::write_TDIRate( double TdiRate ) if ( TdiRate < APN_TDI_RATE_MIN ) TdiRate = APN_TDI_RATE_MIN; - + if ( TdiRate > APN_TDI_RATE_MAX ) TdiRate = APN_TDI_RATE_MAX; @@ -1289,15 +1289,15 @@ void CApnCamera::write_TestLedBrightness( double TestLedBrightness ) OpRegA |= FPGA_BIT_TEMP_SUSPEND; Write( FPGA_REG_OP_A, OpRegA ); - do - { + do + { Read( FPGA_REG_GENERAL_STATUS, RegVal ); } while ( (RegVal & FPGA_BIT_STATUS_TEMP_SUSPEND_ACK) == 0 ); - + } RegVal = (unsigned short)( (double)FPGA_MASK_LED_ILLUMINATION * (TestLedBrightness/100.0) ); - + Write( FPGA_REG_LED_DRIVE, RegVal ); Read( FPGA_REG_OP_B, RegVal ); @@ -1332,7 +1332,7 @@ long CApnCamera::LoadVerticalPattern() RegData |= FPGA_BIT_VRAM_ENABLE; Write( FPGA_REG_OP_B, RegData ); - WriteMultiSRMD( FPGA_REG_VRAM_INPUT, + WriteMultiSRMD( FPGA_REG_VRAM_INPUT, m_ApnSensorInfo->m_VerticalPattern.PatternData, m_ApnSensorInfo->m_VerticalPattern.NumElements ); @@ -1356,14 +1356,14 @@ long CApnCamera::LoadClampPattern() if ( m_DataBits == Apn_Resolution_SixteenBit ) { - WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternSixteen, - FPGA_REG_HCLAMP_INPUT, + WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternSixteen, + FPGA_REG_HCLAMP_INPUT, 1 ); } else if ( m_DataBits == Apn_Resolution_TwelveBit ) { - WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternTwelve, - FPGA_REG_HCLAMP_INPUT, + WriteHorizontalPattern( &m_ApnSensorInfo->m_ClampPatternTwelve, + FPGA_REG_HCLAMP_INPUT, 1 ); } @@ -1387,14 +1387,14 @@ long CApnCamera::LoadSkipPattern() if ( m_DataBits == Apn_Resolution_SixteenBit ) { - WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternSixteen, - FPGA_REG_HSKIP_INPUT, + WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternSixteen, + FPGA_REG_HSKIP_INPUT, 1 ); } else if ( m_DataBits == Apn_Resolution_TwelveBit ) { - WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternTwelve, - FPGA_REG_HSKIP_INPUT, + WriteHorizontalPattern( &m_ApnSensorInfo->m_SkipPatternTwelve, + FPGA_REG_HSKIP_INPUT, 1 ); } @@ -1418,14 +1418,14 @@ long CApnCamera::LoadRoiPattern( unsigned short binning ) if ( m_DataBits == Apn_Resolution_SixteenBit ) { - WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternSixteen, - FPGA_REG_HRAM_INPUT, + WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternSixteen, + FPGA_REG_HRAM_INPUT, binning ); } else if ( m_DataBits == Apn_Resolution_TwelveBit ) { - WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternTwelve, - FPGA_REG_HRAM_INPUT, + WriteHorizontalPattern( &m_ApnSensorInfo->m_RoiPatternTwelve, + FPGA_REG_HRAM_INPUT, binning ); } @@ -1438,8 +1438,8 @@ long CApnCamera::LoadRoiPattern( unsigned short binning ) } -long CApnCamera::WriteHorizontalPattern( APN_HPATTERN_FILE *Pattern, - unsigned short RamReg, +long CApnCamera::WriteHorizontalPattern( APN_HPATTERN_FILE *Pattern, + unsigned short RamReg, unsigned short Binning ) { unsigned short i; @@ -1463,7 +1463,7 @@ long CApnCamera::WriteHorizontalPattern( APN_HPATTERN_FILE *Pattern, DataArray[Index] = Pattern->RefPatternData[i]; Index++; } - + for ( i=0; iBinNumElements[BinNumber]; i++ ) { DataArray[Index] = Pattern->BinPatternData[BinNumber][i]; @@ -1493,8 +1493,8 @@ long CApnCamera::InitDefaults() unsigned short PreRoiRows, PostRoiRows; unsigned short PreRoiVBinning, PostRoiVBinning; - unsigned short UnbinnedRoiY; //Qt::Vertical ROI pixels - + unsigned short UnbinnedRoiY; // Vertical ROI pixels + // Read the Camera ID register Read( FPGA_REG_CAMERA_ID, CameraID ); @@ -1640,7 +1640,7 @@ long CApnCamera::InitDefaults() // printf("ReportedGainTwelveBit = %lf\n",m_ApnSensorInfo->m_ReportedGainTwelveBit); printf("ReportedGainSixteenBit = %lf\n",m_ApnSensorInfo->m_ReportedGainSixteenBit); printf("MinSuggestedExpTime = %lf\n",m_ApnSensorInfo->m_MinSuggestedExpTime); - printf("CoolingSupported = %u\n",m_ApnSensorInfo->m_CoolingSupported); + printf("CoolingSupported = %u\n",m_ApnSensorInfo->m_CoolingSupported); printf("RegulatedCoolingSupported = %u\n",m_ApnSensorInfo->m_RegulatedCoolingSupported); printf("TempSetPoint = %lf\n",m_ApnSensorInfo->m_TempSetPoint); // printf("TempRegRate = %u\n",m_ApnSensorInfo->m_TempRegRate); @@ -1675,21 +1675,21 @@ long CApnCamera::InitDefaults() LoadRoiPattern( m_RoiBinningH ); // Program default camera settings - Write( FPGA_REG_CLAMP_COUNT, m_ApnSensorInfo->m_ClampColumns ); - Write( FPGA_REG_PREROI_SKIP_COUNT, m_ApnSensorInfo->m_PreRoiSkipColumns ); - Write( FPGA_REG_ROI_COUNT, m_ApnSensorInfo->m_ImagingColumns ); + Write( FPGA_REG_CLAMP_COUNT, m_ApnSensorInfo->m_ClampColumns ); + Write( FPGA_REG_PREROI_SKIP_COUNT, m_ApnSensorInfo->m_PreRoiSkipColumns ); + Write( FPGA_REG_ROI_COUNT, m_ApnSensorInfo->m_ImagingColumns ); Write( FPGA_REG_POSTROI_SKIP_COUNT, m_ApnSensorInfo->m_PostRoiSkipColumns + - m_ApnSensorInfo->m_OverscanColumns ); - + m_ApnSensorInfo->m_OverscanColumns ); + // Since the default state of m_DigitizeOverscan is false, set the count to zero. - Write( FPGA_REG_OVERSCAN_COUNT, 0x0 ); + Write( FPGA_REG_OVERSCAN_COUNT, 0x0 ); // Now calculate the vertical settings UnbinnedRoiY = m_RoiPixelsV * m_RoiBinningV; - PreRoiRows = m_ApnSensorInfo->m_UnderscanRows + + PreRoiRows = m_ApnSensorInfo->m_UnderscanRows + m_RoiStartY; - + PostRoiRows = m_ApnSensorInfo->m_TotalRows - PreRoiRows - UnbinnedRoiY; @@ -1714,14 +1714,14 @@ long CApnCamera::InitDefaults() } // Program the vertical settings - Write( FPGA_REG_A1_ROW_COUNT, PreRoiRows ); + Write( FPGA_REG_A1_ROW_COUNT, PreRoiRows ); Write( FPGA_REG_A1_VBINNING, PreRoiVBinning ); - - Write( FPGA_REG_A2_ROW_COUNT, m_RoiPixelsV ); - Write( FPGA_REG_A2_VBINNING, (m_RoiBinningV | FPGA_BIT_ARRAY_DIGITIZE) ); - - Write( FPGA_REG_A3_ROW_COUNT, PostRoiRows ); - Write( FPGA_REG_A3_VBINNING, PostRoiVBinning ); + + Write( FPGA_REG_A2_ROW_COUNT, m_RoiPixelsV ); + Write( FPGA_REG_A2_VBINNING, (m_RoiBinningV | FPGA_BIT_ARRAY_DIGITIZE) ); + + Write( FPGA_REG_A3_ROW_COUNT, PostRoiRows ); + Write( FPGA_REG_A3_VBINNING, PostRoiVBinning ); Write( FPGA_REG_VFLUSH_BINNING, m_ApnSensorInfo->m_VFlushBinning ); @@ -1738,8 +1738,8 @@ long CApnCamera::InitDefaults() { Read( FPGA_REG_OP_A, RegVal ); - RegVal |= FPGA_BIT_DISABLE_H_CLK; - + RegVal |= FPGA_BIT_DISABLE_H_CLK; + Write( FPGA_REG_OP_A, RegVal ); } @@ -1765,7 +1765,7 @@ long CApnCamera::InitDefaults() write_FanMode( Apn_FanMode_Medium ); // Initialize the LED states and the LED mode. There is nothing to output - // to the device since we issued our CLEAR early in the init() process, and + // to the device since we issued our CLEAR early in the init() process, and // we are now in a known state. m_pvtLedStateA = Apn_LedState_Expose; m_pvtLedStateB = Apn_LedState_Expose; @@ -1790,7 +1790,7 @@ long CApnCamera::InitDefaults() m_pvtImageInProgress = false; m_pvtImageReady = false; - + return 0; } @@ -1840,9 +1840,9 @@ void CApnCamera::UpdateGeneralStatus() // Read the general status register of the device - QueryStatusRegs( StatusReg, - HeatsinkTempReg, - CcdTempReg, + QueryStatusRegs( StatusReg, + HeatsinkTempReg, + CcdTempReg, CoolerDriveReg, VoltageReg, TdiCounterReg, @@ -1859,13 +1859,13 @@ void CApnCamera::UpdateGeneralStatus() m_pvtCoolerDrive = 100.0; else m_pvtCoolerDrive = ( (double)(CoolerDriveReg - 600) / 2600.0 ) * 100.0; - - m_pvtCurrentCcdTemp = ( (CcdTempReg - APN_TEMP_SETPOINT_ZERO_POINT) + + m_pvtCurrentCcdTemp = ( (CcdTempReg - APN_TEMP_SETPOINT_ZERO_POINT) * APN_TEMP_DEGREES_PER_BIT ); - m_pvtCurrentHeatsinkTemp = ( (HeatsinkTempReg - APN_TEMP_HEATSINK_ZERO_POINT) + m_pvtCurrentHeatsinkTemp = ( (HeatsinkTempReg - APN_TEMP_HEATSINK_ZERO_POINT) * APN_TEMP_DEGREES_PER_BIT ); - + m_pvtInputVoltage = VoltageReg * APN_VOLTAGE_RESOLUTION; // Update ShutterState diff --git a/kstars/kstars/indi/apogee/CameraIO_Linux.h b/kstars/kstars/indi/apogee/CameraIO_Linux.h index e61ad838..47b08f43 100644 --- a/kstars/kstars/indi/apogee/CameraIO_Linux.h +++ b/kstars/kstars/indi/apogee/CameraIO_Linux.h @@ -157,7 +157,7 @@ public: long ReadLine( long SkipPixels, long Pixels, unsigned short* pLineBuffer ); long Write( unsigned short reg, unsigned short val ); long Read( unsigned short reg, unsigned short& val ); - + //////////////////////////////////////////////////////////// // Camera Settings @@ -173,27 +173,27 @@ public: // 7: image ready bool read_Present(); // True if camera is present, false otherwise. - + bool read_Shutter(); // Current shutter state, true = open, false = closed. void write_Shutter( bool val ); - + bool read_ForceShutterOpen(); // True: Forces shutter permanently open. False: allows void write_ForceShutterOpen( bool val ); // normal shutter operation. bool read_LongCable(); // Long cable mode. - void write_LongCable( bool val ); + void write_LongCable( bool val ); short read_Mode(); // First four bits map to Mode bits used for void write_Mode( short val ); // special functions or camera configurations. short read_TestBits(); // First four bits to Test bits used for void write_TestBits( short val ); // troubleshooting. - + short read_Test2Bits(); // First four bits map to Test2 bits used for void write_Test2Bits( short val ); // special functions or camera configurations. bool read_FastReadout(); // Fast readout mode (used for focusing). - void write_FastReadout( bool val ); // True means fast focus is on + void write_FastReadout( bool val ); // True means fast focus is on bool read_UseTrigger(); // Triggered exposure mode. void write_UseTrigger( bool val ); // True means triggered exposure is on. @@ -201,15 +201,15 @@ public: bool m_HighPriority; // Bost thread priority level during download short m_PPRepeat; // Delay used on parallel port systems. - + short m_DataBits; // Digitization resolution, 8 - 18. bool m_FastShutter; // Capable of 0.001 sec exposure resolution bool m_GuiderRelays; // Capable of outputing autoguider signals - short m_MaxBinX, m_MaxBinY; // Maximum binning factors - + short m_MaxBinX, m_MaxBinY; // Maximum binning factors + double m_MaxExposure; // Maximum exposure length double m_MinExposure; // Minimum exposure length @@ -219,7 +219,7 @@ public: // Cooler Settings // N.B. DAC units = ( m_TempScale * CoolerSetPoint (deg. C ) ) + m_TempCalibration; // N.B. Temperature (deg. C) = (DAC units - m_TempCalibration) / m_TempScale - + double read_CoolerSetPoint(); // Returns/sets setpoint temperature in degrees void write_CoolerSetPoint( double val ); // Celcius. @@ -229,7 +229,7 @@ public: void write_CoolerMode( Camera_CoolerMode val ); double read_Temperature(); // Current temperature in degrees Celcius. - + bool m_TempControl; // Temperature can be externally controlled short m_TempCalibration; // Temperature calibration factor. double m_TempScale; // Temperature scaling factor. @@ -238,20 +238,20 @@ public: // Exposure Settings // The following variables are latched in Expose method, until next Reset or GetImage - short m_BinX, m_BinY; //Qt::Horizontal and vertical binning. + short m_BinX, m_BinY; // Horizontal and vertical binning. short m_StartX, m_StartY; // Zero based subframe start position in unbinned pixels. short m_NumX, m_NumY; // Subframe size in binned pixels. //////////////////////////////////////////////////////////// // Geometry Settings // The following variables are latched in Expose method, until next Reset or GetImage - + short m_Columns, m_Rows; // Total columns/rows on CCD (physical). short m_ImgColumns, m_ImgRows; // Unbinned columns/rows in imaging area short m_SkipC, m_SkipR; // Deleted data columns/rows not to be displayed or saved - short m_HFlush, m_VFlush; //Qt::Horizontal/Vertical flush binning. + short m_HFlush, m_VFlush; // Horizontal/Vertical flush binning. short m_BIC, m_BIR; // Before Image Column/Row count (dark non-imaging pixels). - + //////////////////////////////////////////////////////////// // CCD Settings @@ -291,7 +291,7 @@ public: // Move the filterwheel to the home position - failure indicates no filterwheel //attached or broken filterwheel bool FilterHome(); - + // Move filterwheel to the given slot void FilterSet( short Slot ); @@ -341,7 +341,7 @@ public: bool m_WaitingforLine; // camera is clocking and digitizing a row of data short m_RegisterOffset; // Offset from base address used in parallel port systems. - + short m_FilterPosition; // Current filter position short m_FilterStepPos; // Current filter position in our internal array @@ -350,9 +350,9 @@ public: Camera_Interface m_Interface; // String acronyms may be used in INI file. // 0 or ISA: Industry Standard Architecture bus - // 1 or PPI: Parallel Port Interface + // 1 or PPI: Parallel Port Interface // 2 or PCI: Peripheral Component Interface - + Camera_SensorType m_SensorType; // 0 or CCD: Charge Coupled Device // 1 or CMOS: Complementary Metal-Oxide-Silicon @@ -367,12 +367,12 @@ public: // 7: At set point // Latched public variables used during Exposure..GetImage sequence - short m_ExposureBinX, m_ExposureBinY; //Qt::Horizontal and vertical binning. + short m_ExposureBinX, m_ExposureBinY; // Horizontal and vertical binning. short m_ExposureStartX, m_ExposureStartY; // Subframe start position in unbinned pixels. short m_ExposureNumX, m_ExposureNumY; // Subframe size in binned pixels. short m_ExposureColumns, m_ExposureRows; // Total columns/rows on CCD (physical). short m_ExposureSkipC, m_ExposureSkipR; // Deleted data columns/rows not to be displayed or saved to disk. - short m_ExposureHFlush, m_ExposureVFlush; //Qt::Horizontal/Vertical flush binning. + short m_ExposureHFlush, m_ExposureVFlush; // Horizontal/Vertical flush binning. short m_ExposureBIC, m_ExposureBIR; // Before Image Column/Row count (dark non-imaging pixels). unsigned short m_ExposureAIC; // Calculated After Image Column count (dark non-imaging pixels). unsigned short m_ExposureRemainingLines; // Number of lines to be clocked out by GetImage @@ -381,17 +381,17 @@ public: //////////////////////////////////////////////////////////// // Write register shadow variables unsigned short m_RegShadow[ NumWriteRegisters ]; - + unsigned short m_FastShutterBits_Mode; // Mask to enable fast shutter mode unsigned short m_FastShutterBits_Test; // Mask to enable fast shutter mode - + //////////////////////////////////////////////////////////// // Internal helper routines void LoadLineCounter( unsigned short rows ); void LoadColumnLayout( unsigned short aic, unsigned short bic, unsigned short pixels ); void LoadTimerAndBinning( double Duration, unsigned short HBin, unsigned short VBin ); - + void StartFlushing(); void StopFlushing(); @@ -408,7 +408,7 @@ private: #ifdef WITHPPI inline void RegisterSelect( unsigned short reg ); inline unsigned short INPW(); - inline void OUTPW( unsigned short val ); + inline void OUTPW( unsigned short val ); #endif }; diff --git a/kstars/kstars/indi/fli/libfli.c b/kstars/kstars/indi/fli/libfli.c index 701115b2..68df7945 100644 --- a/kstars/kstars/indi/fli/libfli.c +++ b/kstars/kstars/indi/fli/libfli.c @@ -554,7 +554,7 @@ LIBFLIAPI FLISetImageArea(flidev_t dev, long ul_x, long ul_y, @param dev Camera to set horizontal bin factor of. - @param hbinQt::Horizontal bin factor. + @param hbin Horizontal bin factor. @return Zero on success. @return Non-zero on failure. @@ -577,7 +577,7 @@ LIBFLIAPI FLISetHBin(flidev_t dev, long hbin) @param dev Camera to set vertical bin factor of. - @param vbinQt::Vertical bin factor. + @param vbin Vertical bin factor. @return Zero on success. @return Non-zero on failure. diff --git a/kstars/kstars/indi/fli_ccd.c b/kstars/kstars/indi/fli_ccd.c index 70a1aceb..ac5eac45 100644 --- a/kstars/kstars/indi/fli_ccd.c +++ b/kstars/kstars/indi/fli_ccd.c @@ -76,8 +76,8 @@ extern int errno; #define MAX_CCD_TEMP 45 /* Max CCD temperature */ #define MIN_CCD_TEMP -55 /* Min CCD temperature */ -#define MAX_X_BIN 16. /* MaxQt::Horizontal binning */ -#define MAX_Y_BIN 16. /* MaxQt::Vertical binning */ +#define MAX_X_BIN 16. /* Max Horizontal binning */ +#define MAX_Y_BIN 16. /* Max Vertical binning */ #define MAX_PIXELS 4096 /* Max number of pixels in one dimension */ #define POLLMS 1000 /* Polling time (ms) */ #define TEMP_THRESHOLD .25 /* Differential temperature threshold (C)*/ @@ -147,21 +147,21 @@ static INumber FrameN[] = { { "WIDTH", "Width", "%.0f", 0., MAX_PIXELS, 1., 0., 0, 0, 0}, { "HEIGHT", "Height", "%.0f",0., MAX_PIXELS, 1., 0., 0, 0, 0}}; static INumberVectorProperty FrameNP = { mydev, "CCD_FRAME", "Frame", IMAGE_GROUP, IP_RW, 60, IPS_IDLE, FrameN, NARRAY(FrameN), "", 0}; - - /* Binning */ + + /* Binning */ static INumber BinningN[] = { { "HOR_BIN", "X", "%0.f", 1., MAX_X_BIN, 1., 1., 0, 0, 0}, { "VER_BIN", "Y", "%0.f", 1., MAX_Y_BIN, 1., 1., 0, 0, 0}}; static INumberVectorProperty BinningNP = { mydev, "CCD_BINNING", "Binning", IMAGE_GROUP, IP_RW, 60, IPS_IDLE, BinningN, NARRAY(BinningN), "", 0}; - + /* Exposure time */ static INumber ExposeTimeN[] = {{ "EXPOSE_DURATION", "Duration (s)", "%5.2f", 0., 36000., .5, 1., 0, 0, 0}}; static INumberVectorProperty ExposeTimeNP = { mydev, "CCD_EXPOSE_DURATION", "Expose", EXPOSE_GROUP, IP_RW, 60, IPS_IDLE, ExposeTimeN, NARRAY(ExposeTimeN), "", 0}; - + /* Temperature control */ static INumber TemperatureN[] = { {"TEMPERATURE", "Temperature", "%+06.2f", MIN_CCD_TEMP, MAX_CCD_TEMP, .2, 0., 0, 0, 0}}; static INumberVectorProperty TemperatureNP = { mydev, "CCD_TEMPERATURE", "Temperature (C)", EXPOSE_GROUP, IP_RW, 60, IPS_IDLE, TemperatureN, NARRAY(TemperatureN), "", 0}; - + /* Pixel size (µm) */ static INumber PixelSizeN[] = { { "Width", "", "%.0f", 0. , 0., 0., 0., 0, 0, 0}, @@ -180,30 +180,30 @@ void ISInit() if (isInit) return; - + /* USB by default {USB, SERIAL, PARALLEL, INET} */ portSwitchIndex = 0; - + FLIImg = malloc (sizeof(img_t)); - + if (FLIImg == NULL) { IDMessage(mydev, "Error: unable to initialize driver. Low memory."); IDLog("Error: unable to initialize driver. Low memory."); return; } - + IEAddTimer (POLLMS, ISPoll, NULL); isInit = 1; - + } void ISGetProperties (const char *dev) -{ +{ ISInit(); - + if (dev && strcmp (mydev, dev)) return; @@ -211,48 +211,48 @@ void ISGetProperties (const char *dev) IDDefSwitch(&PowerSP, NULL); IDDefSwitch(&PortSP, NULL); IDDefBLOB(&imageBP, NULL); - + /* Expose */ - IDDefSwitch(&FrameTypeSP, NULL); + IDDefSwitch(&FrameTypeSP, NULL); IDDefNumber(&ExposeTimeNP, NULL); IDDefNumber(&TemperatureNP, NULL); - + /* Image Group */ IDDefNumber(&FrameNP, NULL); IDDefNumber(&BinningNP, NULL); - + } void ISNewBLOB (const char *dev, const char *name, int sizes[], char *blobs[], char *formats[], char *names[], int n) { dev=dev;name=name;sizes=sizes;blobs=blobs;formats=formats;names=names;n=n; } - + void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) { long err; int i; ISwitch *sp; - + /* ignore if not ours */ if (dev && strcmp (dev, mydev)) return; - + ISInit(); - + /* Port type */ if (!strcmp (name, PortSP.name)) { - PortSP.s = IPS_IDLE; + PortSP.s = IPS_IDLE; IUResetSwitches(&PortSP); IUUpdateSwitches(&PortSP, states, names, n); portSwitchIndex = getOnSwitch(&PortSP); - - PortSP.s = IPS_OK; + + PortSP.s = IPS_OK; IDSetSwitch(&PortSP, NULL); return; } - + /* Connection */ if (!strcmp (name, PowerSP.name)) { @@ -261,25 +261,25 @@ void ISNewSwitch (const char *dev, const char *name, ISState *states, char *name connectCCD(); return; } - + /* Frame Type */ if (!strcmp(FrameTypeSP.name, name)) { if (checkPowerS(&FrameTypeSP)) return; - + FrameTypeSP.s = IPS_IDLE; - + for (i = 0; i < n ; i++) { sp = IUFindSwitch(&FrameTypeSP, names[i]); - + if (!sp) { IDSetSwitch(&FrameTypeSP, "Unknown error. %s is not a member of %s property.", names[0], name); return; } - + /* NORMAL, BIAS, or FLAT */ if ( (sp == &FrameTypeS[LIGHT_FRAME] || sp == &FrameTypeS[FLAT_FRAME]) && states[i] == ISS_ON) { @@ -287,7 +287,7 @@ void ISNewSwitch (const char *dev, const char *name, ISState *states, char *name FLIImg->frameType = LIGHT_FRAME; else FLIImg->frameType = FLAT_FRAME; - + if ((err = FLISetFrameType(fli_dev, FLI_FRAME_TYPE_NORMAL) )) { IUResetSwitches(&FrameTypeSP); @@ -296,9 +296,9 @@ void ISNewSwitch (const char *dev, const char *name, ISState *states, char *name IDLog("FLISetFrameType() failed. %s.\n", strerror((int)-err)); return; } - + IUResetSwitches(&FrameTypeSP); - sp->s = ISS_ON; + sp->s = ISS_ON; FrameTypeSP.s = IPS_OK; IDSetSwitch(&FrameTypeSP, NULL); break; @@ -306,12 +306,12 @@ void ISNewSwitch (const char *dev, const char *name, ISState *states, char *name /* DARK AND BIAS */ else if ( (sp == &FrameTypeS[DARK_FRAME] || sp == &FrameTypeS[BIAS_FRAME]) && states[i] == ISS_ON) { - + if (sp == &FrameTypeS[DARK_FRAME]) FLIImg->frameType = DARK_FRAME; else FLIImg->frameType = BIAS_FRAME; - + if ((err = FLISetFrameType(fli_dev, FLI_FRAME_TYPE_DARK) )) { IUResetSwitches(&FrameTypeSP); @@ -320,32 +320,32 @@ void ISNewSwitch (const char *dev, const char *name, ISState *states, char *name IDLog("FLISetFrameType() failed. %s.\n", strerror((int)-err)); return; } - + IUResetSwitches(&FrameTypeSP); sp->s = ISS_ON; FrameTypeSP.s = IPS_OK; IDSetSwitch(&FrameTypeSP, NULL); break; } - + } /* For loop */ - + return; } - + } void ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { ISInit(); - - /* ignore if not ours */ + + /* ignore if not ours */ if (dev && strcmp (mydev, dev)) return; /* suppress warning */ n=n; dev=dev; name=name; names=names; texts=texts; - + } @@ -359,9 +359,9 @@ void ISNewNumber (const char *dev, const char *name, double values[], char *name /* ignore if not ours */ if (dev && strcmp (dev, mydev)) return; - + ISInit(); - + /* Exposure time */ if (!strcmp (ExposeTimeNP.name, name)) { @@ -377,7 +377,7 @@ void ISNewNumber (const char *dev, const char *name, double values[], char *name IDLog("FLICancelExposure() failed. %s.\n", strerror((int)-err)); return; } - + ExposeTimeNP.s = IPS_IDLE; ExposeTimeN[0].value = 0; @@ -385,96 +385,96 @@ void ISNewNumber (const char *dev, const char *name, double values[], char *name IDLog("Exposure Cancelled.\n"); return; } - + ExposeTimeNP.s = IPS_IDLE; - + np = IUFindNumber(&ExposeTimeNP, names[0]); - + if (!np) { IDSetNumber(&ExposeTimeNP, "Error: %s is not a member of %s property.", names[0], name); return; } - + np->value = values[0]; FLIImg->expose = (int) (values[0] * 1000.); - - /* Set duration */ + + /* Set duration */ if ( (err = FLISetExposureTime(fli_dev, np->value * 1000.) )) { IDSetNumber(&ExposeTimeNP, "FLISetExposureTime() failed. %s.\n", strerror((int)-err)); IDLog("FLISetExposureTime() failed. %s.\n", strerror((int)-err)); return; } - + IDLog("Exposure Time (ms) is: %g\n", np->value * 1000.); - + handleExposure(NULL); return; - } - - + } + + if (!strcmp(TemperatureNP.name, name)) { if (checkPowerN(&TemperatureNP)) return; - + TemperatureNP.s = IPS_IDLE; - + np = IUFindNumber(&TemperatureNP, names[0]); - + if (!np) { IDSetNumber(&TemperatureNP, "Unknown error. %s is not a member of %s property.", names[0], name); return; } - + if (values[0] < MIN_CCD_TEMP || values[0] > MAX_CCD_TEMP) { IDSetNumber(&TemperatureNP, "Error: valid range of temperature is from %d to %d", MIN_CCD_TEMP, MAX_CCD_TEMP); return; } - + if ( (err = FLISetTemperature(fli_dev, values[0]))) { IDSetNumber(&TemperatureNP, "FLISetTemperature() failed. %s.", strerror((int)-err)); IDLog("FLISetTemperature() failed. %s.", strerror((int)-err)); return; } - + FLICam->temperature = values[0]; TemperatureNP.s = IPS_BUSY; - + IDSetNumber(&TemperatureNP, "Setting CCD temperature to %+06.2f C", values[0]); IDLog("Setting CCD temperature to %+06.2f C\n", values[0]); return; } - + if (!strcmp(FrameNP.name, name)) { int nset=0; - + if (checkPowerN(&FrameNP)) return; - + FrameNP.s = IPS_IDLE; - + for (i=0; i < n ; i++) { np = IUFindNumber(&FrameNP, names[i]); - + if (!np) { IDSetNumber(&FrameNP, "Unknown error. %s is not a member of %s property.", names[0], name); return; } - + /* X or Width */ if (np == &FrameN[0] || np==&FrameN[2]) { if (values[i] < 0 || values[i] > FLICam->width) break; - + nset++; np->value = values[i]; } @@ -483,53 +483,53 @@ void ISNewNumber (const char *dev, const char *name, double values[], char *name { if (values[i] < 0 || values[i] > FLICam->height) break; - + nset++; np->value = values[i]; } } - + if (nset < 4) { IDSetNumber(&FrameNP, "Invalid range. Valid range is (0,0) - (%0d,%0d)", FLICam->width, FLICam->height); IDLog("Invalid range. Valid range is (0,0) - (%0d,%0d)", FLICam->width, FLICam->height); - return; + return; } - + if (setImageArea(errmsg)) { IDSetNumber(&FrameNP, "%s", errmsg); return; } - + FrameNP.s = IPS_OK; - - /* Adjusting image width and height */ + + /* Adjusting image width and height */ FLIImg->width = FrameN[2].value; FLIImg->height = FrameN[3].value; - + IDSetNumber(&FrameNP, NULL); - + } /* end FrameNP */ - - + + if (!strcmp(BinningNP.name, name)) { if (checkPowerN(&BinningNP)) return; - + BinningNP.s = IPS_IDLE; - + for (i=0 ; i < n ; i++) { np = IUFindNumber(&BinningNP, names[i]); - + if (!np) { IDSetNumber(&BinningNP, "Unknown error. %s is not a member of %s property.", names[0], name); return; } - + /* X binning */ if (np == &BinningN[0]) { @@ -539,14 +539,14 @@ void ISNewNumber (const char *dev, const char *name, double values[], char *name IDLog("Error: Valid X bin values are from 1 to %g", MAX_X_BIN); return; } - + if ( (err = FLISetHBin(fli_dev, values[i]))) { IDSetNumber(&BinningNP, "FLISetHBin() failed. %s.", strerror((int)-err)); IDLog("FLISetHBin() failed. %s.", strerror((int)-err)); return; } - + np->value = values[i]; } else if (np == &BinningN[1]) @@ -557,33 +557,33 @@ void ISNewNumber (const char *dev, const char *name, double values[], char *name IDLog("Error: Valid X bin values are from 1 to %g", MAX_Y_BIN); return; } - + if ( (err = FLISetVBin(fli_dev, values[i]))) { IDSetNumber(&BinningNP, "FLISetVBin() failed. %s.", strerror((int)-err)); IDLog("FLISetVBin() failed. %s.", strerror((int)-err)); return; } - + np->value = values[i]; } } /* end for */ - + if (setImageArea(errmsg)) { IDSetNumber(&BinningNP, errmsg, NULL); IDLog("%s", errmsg); return; } - + BinningNP.s = IPS_OK; - + IDLog("Binning is: %.0f x %.0f\n", BinningN[0].value, BinningN[1].value); - + IDSetNumber(&BinningNP, NULL); return; } - + } @@ -592,72 +592,72 @@ void ISPoll(void *p) long err; long timeleft; double ccdTemp; - + if (!isCCDConnected()) { IEAddTimer (POLLMS, ISPoll, NULL); return; } - + /*IDLog("In Poll.\n");*/ - + switch (ExposeTimeNP.s) { case IPS_IDLE: break; - + case IPS_OK: break; - + case IPS_BUSY: if ( (err = FLIGetExposureStatus(fli_dev, &timeleft))) - { - ExposeTimeNP.s = IPS_IDLE; + { + ExposeTimeNP.s = IPS_IDLE; ExposeTimeN[0].value = 0; - + IDSetNumber(&ExposeTimeNP, "FLIGetExposureStatus() failed. %s.", strerror((int)-err)); IDLog("FLIGetExposureStatus() failed. %s.\n", strerror((int)-err)); break; } - + /*ExposeProgressN[0].value = (timeleft / 1000.);*/ - + if (timeleft > 0) { ExposeTimeN[0].value = timeleft / 1000.; - IDSetNumber(&ExposeTimeNP, NULL); + IDSetNumber(&ExposeTimeNP, NULL); break; } /*{ IDSetNumber(&ExposeProgressNP, NULL); break; }*/ - + /* We're done exposing */ - ExposeTimeNP.s = IPS_IDLE; + ExposeTimeNP.s = IPS_IDLE; ExposeTimeN[0].value = 0; /*ExposeProgressNP.s = IPS_IDLE;*/ IDSetNumber(&ExposeTimeNP, "Exposure done, downloading image..."); IDLog("Exposure done, downloading image...\n"); /*IDSetNumber(&ExposeProgressNP, NULL);*/ - + /* grab and save image */ if (grabImage()) break; - - /* Multiple image exposure + + /* Multiple image exposure if ( imagesLeft > 0) - { + { IDMessage(mydev, "Image #%d will be taken in %0.f seconds.", imageCount+1, DelayN[0].value); IDLog("Image #%d will be taken in %0.f seconds.", imageCount+1, DelayN[0].value); IEAddTimer (DelayN[0].value * 1000., handleExposure, NULL); }*/ break; - + case IPS_ALERT: break; } - + switch (TemperatureNP.s) { case IPS_IDLE: @@ -669,14 +669,14 @@ void ISPoll(void *p) IDLog("FLIGetTemperature() failed. %s.", strerror((int)-err)); return; } - + if (fabs(TemperatureN[0].value - ccdTemp) >= TEMP_THRESHOLD) { TemperatureN[0].value = ccdTemp; IDSetNumber(&TemperatureNP, NULL); } break; - + case IPS_BUSY: if ((err = FLIGetTemperature(fli_dev, &ccdTemp))) { @@ -685,20 +685,20 @@ void ISPoll(void *p) IDLog("FLIGetTemperature() failed. %s.", strerror((int)-err)); return; } - + if (fabs(FLICam->temperature - ccdTemp) <= TEMP_THRESHOLD) TemperatureNP.s = IPS_OK; - + TemperatureN[0].value = ccdTemp; IDSetNumber(&TemperatureNP, NULL); break; - + case IPS_ALERT: break; } - - p=p; - + + p=p; + IEAddTimer (POLLMS, ISPoll, NULL); } @@ -706,35 +706,35 @@ void ISPoll(void *p) We compensate for binning. */ int setImageArea(char errmsg[]) { - + long x_1, y_1, x_2, y_2; long err; - + /* Add the X and Y offsets */ x_1 = FrameN[0].value + FLICam->Visible_Area[0]; y_1 = FrameN[1].value + FLICam->Visible_Area[1]; - + x_2 = x_1 + (FrameN[2].value / BinningN[0].value); y_2 = y_1 + (FrameN[3].value / BinningN[1].value); - + if (x_2 > FLICam->Visible_Area[2]) x_2 = FLICam->Visible_Area[2]; - + if (y_2 > FLICam->Visible_Area[3]) y_2 = FLICam->Visible_Area[3]; - + IDLog("The Final image area is (%ld, %ld), (%ld, %ld)\n", x_1, y_1, x_2, y_2); - + FLIImg->width = x_2 - x_1; FLIImg->height = y_2 - y_1; - + if ( (err = FLISetImageArea(fli_dev, x_1, y_1, x_2, y_2) )) { snprintf(errmsg, ERRMSG_SIZE, "FLISetImageArea() failed. %s.\n", strerror((int)-err)); IDLog("%s", errmsg); return -1; } - + return 0; } @@ -747,26 +747,26 @@ int grabImage() int img_size,i, fd; char errmsg[ERRMSG_SIZE]; char filename[] = "/tmp/fitsXXXXXX"; - + if ((fd = mkstemp(filename)) < 0) - { + { IDMessage(mydev, "Error making temporary filename."); IDLog("Error making temporary filename.\n"); return -1; } close(fd); - + img_size = FLIImg->width * FLIImg->height * sizeof(unsigned short); - + FLIImg->img = malloc (img_size); - + if (FLIImg->img == NULL) { IDMessage(mydev, "Not enough memory to store image."); IDLog("Not enough memory to store image.\n"); return -1; } - + for (i=0; i < FLIImg->height ; i++) { if ( (err = FLIGrabRow(fli_dev, &FLIImg->img[i * FLIImg->width], FLIImg->width))) @@ -777,12 +777,12 @@ int grabImage() return -1; } } - + IDMessage(mydev, "Download complete.\n"); - + /*err = (ImageFormatS[0].s == ISS_ON) ? writeFITS(FileNameT[0].text, errmsg) : writeRAW(FileNameT[0].text, errmsg);*/ err = writeFITS(filename, errmsg); - + if (err) { free(FLIImg->img); @@ -792,7 +792,7 @@ int grabImage() free(FLIImg->img); return 0; - + } int writeFITS(const char* filename, char errmsg[]) @@ -801,20 +801,20 @@ int writeFITS(const char* filename, char errmsg[]) int i, j, bpp, bpsl, width, height; long nbytes; FITS_HDU_LIST *hdu; - + ofp = fits_open (filename, "w"); if (!ofp) { snprintf(errmsg, ERRMSG_SIZE, "Error: cannot open file for writing."); return (-1); } - + width = FLIImg->width; height = FLIImg->height; bpp = sizeof(unsigned short); /* Bytes per Pixel */ bpsl = bpp * FLIImg->width; /* Bytes per Line */ nbytes = 0; - + hdu = create_fits_header (ofp, width, height, bpp); if (hdu == NULL) { @@ -826,42 +826,42 @@ int writeFITS(const char* filename, char errmsg[]) snprintf(errmsg, ERRMSG_SIZE, "Error: writing to FITS header failed."); return (-1); } - + /* Convert buffer to BIG endian */ for (i=0; i < FLIImg->height; i++) for (j=0 ; j < FLIImg->width; j++) FLIImg->img[FLIImg->width * i + j] = getBigEndian( (FLIImg->img[FLIImg->width * i + j]) ); - + for (i= 0; i < FLIImg->height ; i++) { fwrite(FLIImg->img + (i * FLIImg->width), 2, FLIImg->width, ofp->fp); nbytes += bpsl; } - + nbytes = nbytes % FITS_RECORD_SIZE; if (nbytes) { while (nbytes++ < FITS_RECORD_SIZE) putc (0, ofp->fp); } - + if (ferror (ofp->fp)) { snprintf(errmsg, ERRMSG_SIZE, "Error: write error occured"); return (-1); } - - fits_close (ofp); - + + fits_close (ofp); + /* Success */ ExposeTimeNP.s = IPS_OK; /*IDSetNumber(&ExposeTimeNP, "FITS image written to %s", filename); IDLog("FITS image written to '%s'\n", filename);*/ IDSetNumber(&ExposeTimeNP, NULL); IDLog("Loading FITS image...\n"); - + uploadFile(filename); - + return 0; } @@ -874,44 +874,44 @@ void uploadFile(const char* filename) unsigned int i =0, nr = 0; uLongf compressedBytes=0; uLong totalBytes; - struct stat stat_p; - + struct stat stat_p; + if ( -1 == stat (filename, &stat_p)) - { - IDLog(" Error occoured attempting to stat file.\n"); - return; + { + IDLog(" Error occoured attempting to stat file.\n"); + return; } - + totalBytes = stat_p.st_size; fitsData = (unsigned char *) malloc (sizeof(unsigned char) * totalBytes); compressedData = (unsigned char *) malloc (sizeof(unsigned char) * totalBytes + totalBytes / 64 + 16 + 3); - + if (fitsData == NULL || compressedData == NULL) { IDLog("Error! low memory. Unable to initialize fits buffers.\n"); return; } - + fitsFile = fopen(filename, "r"); - + if (fitsFile == NULL) return; - - /* #1 Read file from disk */ + + /* #1 Read file from disk */ for (i=0; i < totalBytes; i+= nr) { nr = fread(fitsData + i, 1, totalBytes - i, fitsFile); - + if (nr <= 0) { IDLog("Error reading temporary FITS file.\n"); return; } } - + compressedBytes = sizeof(char) * totalBytes + totalBytes / 64 + 16 + 3; - - /* #2 Compress it */ + + /* #2 Compress it */ r = compress2(compressedData, &compressedBytes, fitsData, totalBytes, 9); if (r != Z_OK) { @@ -919,7 +919,7 @@ void uploadFile(const char* filename) IDLog("internal error - compression failed: %d\n", r); return; } - + /* #3 Send it */ imageB.blob = compressedData; imageB.bloblen = compressedBytes; @@ -927,20 +927,20 @@ void uploadFile(const char* filename) strcpy(imageB.format, ".fits.z"); imageBP.s = IPS_OK; IDSetBLOB (&imageBP, NULL); - - free (fitsData); + + free (fitsData); free (compressedData); - + } /* Initiates the exposure procedure */ void handleExposure(void *p) { long err; - + /* no warning */ p=p; - + /* BIAS frame is the same as DARK but with minimum period. i.e. readout from camera electronics. */ if (FLIImg->frameType == BIAS_FRAME) @@ -953,7 +953,7 @@ void handleExposure(void *p) return; } } - + if ((err = FLIExposeFrame(fli_dev))) { ExposeTimeNP.s = IPS_IDLE; @@ -961,11 +961,11 @@ void handleExposure(void *p) IDLog("FLIExposeFrame() failed. %s.\n", strerror((int)-err)); return; } - + ExposeTimeNP.s = IPS_BUSY; - + IDSetNumber(&ExposeTimeNP, "Taking a %g seconds frame...", FLIImg->expose / 1000.); - + IDLog("Taking a frame...\n"); } @@ -977,7 +977,7 @@ void getBasicData() long err; IDLog("In getBasicData()\n"); - + if ((err = FLIGetModel (fli_dev, buff, 2048))) { IDMessage(mydev, "FLIGetModel() failed. %s.", strerror((int)-err)); @@ -992,18 +992,18 @@ void getBasicData() IDLog("malloc() failed."); return; } - + strcpy(FLICam->model, buff); } - + if (( err = FLIGetHWRevision(fli_dev, &FLICam->HWRevision))) { IDMessage(mydev, "FLIGetHWRevision() failed. %s.", strerror((int)-err)); IDLog("FLIGetHWRevision() failed. %s.\n", strerror((int)-err)); - + return; } - + if (( err = FLIGetFWRevision(fli_dev, &FLICam->FWRevision))) { IDMessage(mydev, "FLIGetFWRevision() failed. %s.", strerror((int)-err)); @@ -1017,32 +1017,32 @@ void getBasicData() IDLog("FLIGetPixelSize() failed. %s.\n", strerror((int)-err)); return; } - + FLICam->x_pixel_size *= 1e6; - FLICam->y_pixel_size *= 1e6; - + FLICam->y_pixel_size *= 1e6; + if (( err = FLIGetArrayArea(fli_dev, &FLICam->Array_Area[0], &FLICam->Array_Area[1], &FLICam->Array_Area[2], &FLICam->Array_Area[3]))) { IDMessage(mydev, "FLIGetArrayArea() failed. %s.", strerror((int)-err)); IDLog("FLIGetArrayArea() failed. %s.\n", strerror((int)-err)); return; } - + if (( err = FLIGetVisibleArea( fli_dev, &FLICam->Visible_Area[0], &FLICam->Visible_Area[1], &FLICam->Visible_Area[2], &FLICam->Visible_Area[3]))) { IDMessage(mydev, "FLIGetVisibleArea() failed. %s.", strerror((int)-err)); IDLog("FLIGetVisibleArea() failed. %s.\n", strerror((int)-err)); } - + if (( err = FLIGetTemperature(fli_dev, &FLICam->temperature))) { IDMessage(mydev, "FLIGetTemperature() failed. %s.", strerror((int)-err)); IDLog("FLIGetTemperature() failed. %s.\n", strerror((int)-err)); return; } - + IDLog("The CCD Temperature is %f.\n", FLICam->temperature); - + PixelSizeN[0].value = FLICam->x_pixel_size; /* Pixel width (um) */ PixelSizeN[1].value = FLICam->y_pixel_size; /* Pixel height (um) */ TemperatureN[0].value = FLICam->temperature; /* CCD chip temperatre (degrees C) */ @@ -1050,31 +1050,31 @@ void getBasicData() FrameN[1].value = 0; /* Y */ FrameN[2].value = FLICam->Visible_Area[2] - FLICam->Visible_Area[0]; /* Frame Width */ FrameN[3].value = FLICam->Visible_Area[3] - FLICam->Visible_Area[1]; /* Frame Height */ - + FLICam->width = FLIImg->width = FrameN[2].value; FLICam->height = FLIImg->width = FrameN[3].value; - + BinningN[0].value = BinningN[1].value = 1; - + IDLog("The Camera Width is %d ---- %d\n", (int) FLICam->width, (int) FrameN[2].value); IDLog("The Camera Height is %d ---- %d\n", (int) FLICam->height, (int) FrameN[3].value); - + IDSetNumber(&PixelSizeNP, NULL); IDSetNumber(&TemperatureNP, NULL); IDSetNumber(&FrameNP, NULL); IDSetNumber(&BinningNP, NULL); - + IDLog("Exiting getBasicData()\n"); - + } int manageDefaults(char errmsg[]) { long err; int exposeTimeMS; - + exposeTimeMS = (int) (ExposeTimeN[0].value * 1000.); - + IDLog("Setting default exposure time of %d ms.\n", exposeTimeMS); if ( (err = FLISetExposureTime(fli_dev, exposeTimeMS) )) { @@ -1082,7 +1082,7 @@ int manageDefaults(char errmsg[]) IDLog(errmsg, NULL); return -1; } - + /* Default frame type is NORMAL */ if ( (err = FLISetFrameType(fli_dev, FLI_FRAME_TYPE_NORMAL) )) { @@ -1090,7 +1090,7 @@ int manageDefaults(char errmsg[]) IDLog(errmsg, NULL); return -1; } - + /* X horizontal binning */ if ( (err = FLISetHBin(fli_dev, BinningN[0].value) )) { @@ -1098,7 +1098,7 @@ int manageDefaults(char errmsg[]) IDLog(errmsg, NULL); return -1; } - + /* Y vertical binning */ if ( (err = FLISetVBin(fli_dev, BinningN[1].value) )) { @@ -1106,18 +1106,18 @@ int manageDefaults(char errmsg[]) IDLog(errmsg, NULL); return -1; } - + IDLog("Setting default binning %f x %f.\n", BinningN[0].value, BinningN[1].value); - + FLISetNFlushes(fli_dev, NFLUSHES); - + /* Set image area */ if (setImageArea(errmsg)) return -1; - + /* Success */ return 0; - + } int getOnSwitch(ISwitchVectorProperty *sp) @@ -1141,7 +1141,7 @@ int checkPowerS(ISwitchVectorProperty *sp) IDMessage (mydev, "Cannot change property %s while the CCD is offline.", sp->name); else IDMessage (mydev, "Cannot change property %s while the CCD is offline.", sp->label); - + sp->s = IPS_IDLE; IDSetSwitch(sp, NULL); return -1; @@ -1158,7 +1158,7 @@ int checkPowerN(INumberVectorProperty *np) IDMessage (mydev, "Cannot change property %s while the CCD is offline.", np->name); else IDMessage (mydev, "Cannot change property %s while the CCD is offline.", np->label); - + np->s = IPS_IDLE; IDSetNumber(np, NULL); return -1; @@ -1176,7 +1176,7 @@ int checkPowerT(ITextVectorProperty *tp) IDMessage (mydev, "Cannot change property %s while the CCD is offline.", tp->name); else IDMessage (mydev, "Cannot change property %s while the CCD is offline.", tp->label); - + tp->s = IPS_IDLE; IDSetText(tp, NULL); return -1; @@ -1190,9 +1190,9 @@ void connectCCD() { long err; char errmsg[ERRMSG_SIZE]; - + IDLog ("In ConnectCCD\n"); - + /* USB by default {USB, SERIAL, PARALLEL, INET} */ switch (PowerS[0].s) { @@ -1217,7 +1217,7 @@ void connectCCD() IDLog("Error: FLIOpen() failed. %s.\n", strerror( (int) -err)); return; } - + /* Sucess! */ PowerS[0].s = ISS_ON; PowerS[1].s = ISS_OFF; @@ -1233,7 +1233,7 @@ void connectCCD() } break; - + case ISS_OFF: PowerS[0].s = ISS_OFF; PowerS[1].s = ISS_ON; @@ -1261,7 +1261,7 @@ int findcam(flidomain_t domain) { char **tmplist; long err; - + IDLog("In find Camera, the domain is %ld\n", domain); if (( err = FLIList(domain | FLIDEVICE_CAMERA, &tmplist))) @@ -1269,7 +1269,7 @@ int findcam(flidomain_t domain) IDLog("FLIList() failed. %s\n", strerror((int)-err)); return -1; } - + if (tmplist != NULL && tmplist[0] != NULL) { int i; @@ -1292,9 +1292,9 @@ int findcam(flidomain_t domain) break; } } - + FLICam->domain = domain; - + switch (domain) { case FLIDOMAIN_PARALLEL_PORT: @@ -1316,15 +1316,15 @@ int findcam(flidomain_t domain) default: FLICam->dname = strdup("Unknown domain"); } - + FLICam->name = strdup(tmplist[0]); - + if ((err = FLIFreeList(tmplist))) { IDLog("FLIFreeList() failed. %s.\n", strerror((int)-err)); return -1; } - + } /* end if */ else { @@ -1333,7 +1333,7 @@ int findcam(flidomain_t domain) IDLog("FLIFreeList() failed. %s.\n", strerror((int)-err)); return -1; } - + return -1; } @@ -1349,13 +1349,13 @@ FITS_HDU_LIST * create_fits_header (FITS_FILE *ofp, uint width, uint height, uin char ts[32]; struct tm *tp; time_t t; - + time (&t); tp = gmtime (&t); strftime (ts, sizeof(ts), "%Y-%m-%dT%H:%M:%S", tp); - + snprintf(obsDate, 80, "DATE-OBS= '%s' /Observation Date UTC", ts); - + hdulist = fits_add_hdu (ofp); if (hdulist == NULL) return (NULL); @@ -1373,7 +1373,7 @@ FITS_HDU_LIST * create_fits_header (FITS_FILE *ofp, uint width, uint height, uin hdulist->bzero = 0.0; hdulist->used.bscale = 1; hdulist->bscale = 1.0; - + sprintf(temp_s, "CCD-TEMP= %g / degrees celcius", TemperatureN[0].value); sprintf(expose_s, "EXPOSURE= %d / milliseconds", FLIImg->expose); sprintf(binning_s, "BINNING = '(%g x %g)'", BinningN[0].value, BinningN[1].value); @@ -1393,14 +1393,14 @@ FITS_HDU_LIST * create_fits_header (FITS_FILE *ofp, uint width, uint height, uin strcpy(frame_s, "FRAME = 'Dark'"); break; } - - fits_add_card (hdulist, frame_s); + + fits_add_card (hdulist, frame_s); fits_add_card (hdulist, temp_s); fits_add_card (hdulist, expose_s); fits_add_card (hdulist, pixel_s); fits_add_card (hdulist, ( char* ) "INSTRUME= 'Finger Lakes Instruments'"); fits_add_card (hdulist, obsDate); - + return (hdulist); } @@ -1408,14 +1408,14 @@ double min() { double lmin = FLIImg->img[0]; int ind=0, i, j; - + for (i= 0; i < FLIImg->height ; i++) for (j= 0; j < FLIImg->width; j++) { ind = (i * FLIImg->width) + j; if (FLIImg->img[ind] < lmin) lmin = FLIImg->img[ind]; } - + return lmin; } @@ -1423,13 +1423,13 @@ double max() { double lmax = FLIImg->img[0]; int ind=0, i, j; - + for (i= 0; i < FLIImg->height ; i++) for (j= 0; j < FLIImg->width; j++) { ind = (i * FLIImg->width) + j; if (FLIImg->img[ind] > lmax) lmax = FLIImg->img[ind]; } - + return lmax; } diff --git a/kstars/kstars/indidevice.cpp b/kstars/kstars/indidevice.cpp index 3d570c69..23914204 100644 --- a/kstars/kstars/indidevice.cpp +++ b/kstars/kstars/indidevice.cpp @@ -17,7 +17,7 @@ 2003-08-09 Initial support for non-sidereal tracking 2004-01-15 redesigning the GUI to support INDI v1.2 and fix previous GUI bugs and problems. The new GUI can easily incoperate extensions to the INDI - protocol as required. + protocol as required. */ @@ -80,31 +80,31 @@ #define NINDI_STD 26 /* INDI standard property used across all clients to enable interoperability. */ -const char * indi_std[NINDI_STD] = +const char * indi_std[NINDI_STD] = {"CONNECTION", "DEVICE_PORT", "TIME", "SDTIME", "GEOGRAPHIC_COORD", "EQUATORIAL_COORD", "EQUATORIAL_EOD_COORD", "HORIZONTAL_COORD", "ABORT_MOTION", "ON_COORD_SET", "SOLAR_SYSTEM", "MOVEMENT", "PARK", "CCD_EXPOSE_DURATION", "CCD_TEMPERATURE", "CCD_FRAME", "CCD_FRAME_TYPE", "CCD_BINNING", "CCD_INFO", "CCDPREVIEW_STREAM", "CCDPREVIEW_CTRL", "VIDEO_STREAM", "FOCUS_SPEED", "FOCUS_MOTION", "FOCUS_TIMER", "FILTER_SLOT" }; /******************************************************************* ** INDI Device: The work-horse. Responsible for handling its ** child properties and managing signal and changes. *******************************************************************/ -INDI_D::INDI_D(INDIMenu *menuParent, DeviceManager *parentManager, TQString inName, TQString inLabel) +INDI_D::INDI_D(INDIMenu *menuParent, DeviceManager *parentManager, TQString inName, TQString inLabel) { name = inName; label = inLabel; parent = menuParent; parentMgr = parentManager; - + gl.setAutoDelete(true); deviceVBox = menuParent->addVBoxPage(inLabel); groupContainer = new TQTabWidget(deviceVBox); - + msgST_w = new TQTextEdit(deviceVBox); msgST_w->setReadOnly(true); msgST_w->setMaximumHeight(100); dataBuffer = (unsigned char *) malloc (1); - + stdDev = new INDIStdDevice(this, parent->ksw); curGroup = NULL; @@ -126,12 +126,12 @@ INDI_D::~INDI_D() void INDI_D::registerProperty(INDI_P *pp) { - + if (isINDIStd(pp)) pp->pg->dp->INDIStdSupport = true; - + stdDev->registerProperty(pp); - + } bool INDI_D::isINDIStd(INDI_P *pp) @@ -142,11 +142,11 @@ bool INDI_D::isINDIStd(INDI_P *pp) pp->stdID = i; return true; } - + return false; } -/* Remove a property from a group, if there are no more properties +/* Remove a property from a group, if there are no more properties * left in the group, then delete the group as well */ int INDI_D::removeProperty(INDI_P *pp) { @@ -170,7 +170,7 @@ int INDI_D::setAnyCmd (XMLEle *root, char errmsg[]) { XMLAtt *ap; INDI_P *pp; - + ap = findAtt (root, "name", errmsg); if (!ap) return (-1); @@ -208,7 +208,7 @@ int INDI_D::setValue (INDI_P *pp, XMLEle *root, char errmsg[]) return (-1); } } - + /* allow changing the timeout */ ap = findXMLAtt (root, "timeout"); if (ap) @@ -225,13 +225,13 @@ int INDI_D::setValue (INDI_P *pp, XMLEle *root, char errmsg[]) return (setTextValue (pp, root, errmsg)); break; - case PG_BUTTONS: + case PG_BUTTONS: case PG_LIGHTS: - case PG_RADIO: + case PG_RADIO: case PG_MENU: return (setLabelState (pp, root, errmsg)); break; - + case PG_BLOB: return (setBLOB(pp, root, errmsg)); break; @@ -256,7 +256,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[]) TQString elementName; char iNumber[32]; double min, max; - + for (ep = nextXMLEle (root, 1); ep != NULL; ep = nextXMLEle (root, 0)) { if (strcmp (tagXMLEle(ep), "oneText") && strcmp(tagXMLEle(ep), "oneNumber")) @@ -270,15 +270,15 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[]) } elementName = valuXMLAtt(ap); - + lp = pp->findElement(elementName); - + if (!lp) { snprintf(errmsg, ERRMSG_SIZE, "Error: unable to find element '%.64s' in property '%.64s'", elementName.ascii(), pp->name.ascii()); return (-1); } - + //fprintf(stderr, "tag okay, getting perm\n"); switch (pp->perm) { @@ -295,18 +295,18 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[]) numberFormat(iNumber, lp->format.ascii(), lp->value); lp->text = iNumber; lp->read_w->setText(lp->text); - + ap = findXMLAtt (ep, "min"); if (ap) { min = atof(valuXMLAtt(ap)); lp->setMin(min); } ap = findXMLAtt (ep, "max"); if (ap) { max = atof(valuXMLAtt(ap)); lp->setMax(max); } - + /*if (lp->spin_w) { lp->spin_w->setValue(lp->value); lp->spinChanged(lp->value); }*/ - + } break; @@ -323,7 +323,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[]) lp->spin_w->setValue(lp->value); else lp->write_w->setText(lp->text); - + ap = findXMLAtt (ep, "min"); if (ap) { min = (int) atof(valuXMLAtt(ap)); lp->setMin(min); } ap = findXMLAtt (ep, "max"); @@ -336,7 +336,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[]) /* handle standard cases if needed */ stdDev->setTextValue(pp); - + // suppress warning errmsg = errmsg; @@ -360,7 +360,7 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[]) /* for each child element */ for (ep = nextXMLEle (root, 1), i=0; ep != NULL; ep = nextXMLEle (root, 0), i++) { - + /* only using light and switch */ islight = !strcmp (tagXMLEle(ep), "oneLight"); if (!islight && strcmp (tagXMLEle(ep), "oneSwitch")) @@ -426,7 +426,7 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[]) pp->om_w->setCurrentItem(i); } break; - + case PG_LIGHTS: lp->drawLt(); break; @@ -436,29 +436,29 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[]) } } - + stdDev->setLabelState(pp); return (0); } /* Set BLOB vector. Process incoming data stream - * Return 0 if okay, -1 if error + * Return 0 if okay, -1 if error */ int INDI_D::setBLOB(INDI_P *pp, XMLEle * root, char errmsg[]) { - + XMLEle *ep; INDI_E *blobEL; - + for (ep = nextXMLEle(root,1); ep; ep = nextXMLEle(root,0)) { - + if (strcmp(tagXMLEle(ep), "oneBLOB") == 0) { - + blobEL = pp->findElement(TQString(findXMLAttValu (ep, "name"))); - + if (blobEL) return processBlob(blobEL, ep, errmsg); else @@ -468,13 +468,13 @@ int INDI_D::setBLOB(INDI_P *pp, XMLEle * root, char errmsg[]) } } } - + return (0); - + } /* Process incoming data stream - * Return 0 if okay, -1 if error + * Return 0 if okay, -1 if error */ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[]) { @@ -485,29 +485,29 @@ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[]) char *baseBuffer; unsigned char *blobBuffer(NULL); bool iscomp(false); - + ap = findXMLAtt(ep, "size"); if (!ap) { sprintf (errmsg, "INDI: set %64s size not found", blobEL->name.ascii()); return (-1); } - + dataSize = atoi(valuXMLAtt(ap)); - + ap = findXMLAtt(ep, "format"); if (!ap) { sprintf (errmsg, "INDI: set %64s format not found", blobEL->name.ascii()); return (-1); } - + dataFormat = TQString(valuXMLAtt(ap)); - + baseBuffer = (char *) malloc ( (3*pcdatalenXMLEle(ep)/4) * sizeof (char)); blobSize = from64tobits (baseBuffer, pcdataXMLEle(ep)); blobBuffer = (unsigned char *) baseBuffer; - + /* Blob size = 0 when only state changes */ if (dataSize == 0) { @@ -520,27 +520,27 @@ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[]) sprintf (errmsg, "INDI: %64s.%64s.%64s bad base64", name.ascii(), blobEL->pp->name.ascii(), blobEL->name.ascii()); return (-1); } - + iscomp = (dataFormat.find(".z") != -1); - + dataFormat.remove(".z"); - + if (dataFormat == ".fits") dataType = DATA_FITS; else if (dataFormat == ".stream") dataType = DATA_STREAM; - else if (dataFormat == ".ccdpreview") dataType = DATA_CCDPREVIEW; + else if (dataFormat == ".ccdpreview") dataType = DATA_CCDPREVIEW; else dataType = DATA_OTHER; - + //kdDebug() << "We're getting data with size " << dataSize << endl; //kdDebug() << "data format " << dataFormat << endl; if (iscomp) { - + dataBuffer = (unsigned char *) realloc (dataBuffer, (dataSize * sizeof(unsigned char))); r = uncompress(dataBuffer, &dataSize, blobBuffer, (uLong) blobSize); if (r != Z_OK) { - sprintf(errmsg, "INDI: %64s.%64s.%64s compression error: %d", name.ascii(), blobEL->pp->name.ascii(), blobEL->name.ascii(), r); + sprintf(errmsg, "INDI: %64s.%64s.%64s compression error: %d", name.ascii(), blobEL->pp->name.ascii(), blobEL->name.ascii(), r); free (blobBuffer); return -1; } @@ -553,13 +553,13 @@ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[]) dataBuffer = (unsigned char *) realloc (dataBuffer, (dataSize * sizeof(unsigned char))); memcpy(dataBuffer, blobBuffer, dataSize); } - + stdDev->handleBLOB(dataBuffer, dataSize, dataFormat); free (blobBuffer); - + return (0); - + } bool INDI_D::isOn() @@ -605,11 +605,11 @@ INDI_P * INDI_D::addProperty (XMLEle *root, char errmsg[]) return NULL; } - /* RemoveQt::Vertical spacer from group layout, this is done everytime - * a new property arrives. The spacer is then appended to the end of the + /* Remove Vertical spacer from group layout, this is done everytime + * a new property arrives. The spacer is then appended to the end of the * properties */ pg->propertyLayout->removeItem(pg->VerticalSpacer); - + pp = new INDI_P(pg, TQString(valuXMLAtt(ap))); /* init state */ @@ -655,7 +655,7 @@ INDI_P * INDI_D::findProp (TQString name) INDI_G * INDI_D::findGroup (TQString grouptag, int create, char errmsg[]) { INDI_G *ig; - + for (ig = gl.first(); ig != NULL; ig = gl.next() ) if (ig->name == grouptag) { @@ -668,7 +668,7 @@ INDI_G * INDI_D::findGroup (TQString grouptag, int create, char errmsg[]) { if (grouptag.isEmpty()) grouptag = "Group_1"; - + curGroup = new INDI_G(this, grouptag); gl.append(curGroup); return curGroup; @@ -785,15 +785,15 @@ int INDI_D::buildTextGUI(XMLEle *root, char errmsg[]) /* we know it will be a general text GUI */ pp->guitype = PG_TEXT; pp->perm = p; - + if (pp->buildTextGUI(root, errmsg) < 0) { delete (pp); return (-1); } - + pp->pg->addProperty(pp); - + return (0); } @@ -817,22 +817,22 @@ int INDI_D::buildNumberGUI (XMLEle *root, char *errmsg) delete(pp); return (-1); } - + /* we know it will be a number GUI */ pp->guitype = PG_NUMERIC; pp->perm = p; - + if (pp->buildNumberGUI(root, errmsg) < 0) { delete (pp); return (-1); } - + pp->pg->addProperty(pp); - + return (0); } - + /* build GUI for switches property. * rule and number of will determine exactly how the GUI is built. * return 0 if ok, else -1 with reason in errmsg[] @@ -863,7 +863,7 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[]) for ( ep = nextXMLEle(root, 1) , n = 0 ; ep != NULL; ep = nextXMLEle(root, 0)) if (!strcmp (tagXMLEle(ep), "defSwitch")) n++; - + if (n > MAXRADIO) { pp->guitype = PG_MENU; @@ -874,14 +874,14 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[]) pp=0; return err; } - + pp->pg->addProperty(pp); return (err); } /* otherwise, build 1-4 button layout */ pp->guitype = PG_BUTTONS; - + err = pp->buildSwitchesGUI(root, errmsg); if (err < 0) { @@ -889,7 +889,7 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[]) pp=0; return err; } - + pp->pg->addProperty(pp); return (err); @@ -898,7 +898,7 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[]) { /* 1-4 checkboxes layout */ pp->guitype = PG_RADIO; - + err = pp->buildSwitchesGUI(root, errmsg); if (err < 0) { @@ -906,18 +906,18 @@ int INDI_D::buildSwitchesGUI (XMLEle *root, char errmsg[]) pp=0; return err; } - + pp->pg->addProperty(pp); return (err); } - + snprintf (errmsg, ERRMSG_SIZE, "INDI: <%.64s> unknown rule %.64s for %.64s %.64s", tagXMLEle(root), valuXMLAtt(ap), name.ascii(), pp->name.ascii()); - + delete(pp); return (-1); } - + /* build GUI for a lights GUI. @@ -932,13 +932,13 @@ int INDI_D::buildLightsGUI (XMLEle *root, char errmsg[]) return (-1); pp->guitype = PG_LIGHTS; - + if (pp->buildLightsGUI(root, errmsg) < 0) { delete (pp); return (-1); } - + pp->pg->addProperty(pp); return (0); } @@ -961,17 +961,17 @@ int INDI_D::buildBLOBGUI (XMLEle *root, char errmsg[]) delete(pp); return (-1); } - + /* we know it will be a number GUI */ pp->perm = p; pp->guitype = PG_BLOB; - + if (pp->buildBLOBGUI(root, errmsg) < 0) { delete (pp); return (-1); } - + pp->pg->addProperty(pp); return (0); } @@ -981,7 +981,7 @@ INDI_E * INDI_D::findElem(TQString name) INDI_G *grp; INDI_P *prop; INDI_E *el; - + for (grp = gl.first(); grp != NULL; grp = gl.next()) { for (prop = grp->pl.first(); prop != NULL; prop = grp->pl.next()) @@ -990,7 +990,7 @@ INDI_E * INDI_D::findElem(TQString name) if (el != NULL) return el; } } - + return NULL; } diff --git a/kstars/kstars/indielement.h b/kstars/kstars/indielement.h index eb1826ee..c7ae6dd4 100644 --- a/kstars/kstars/indielement.h +++ b/kstars/kstars/indielement.h @@ -5,7 +5,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + 2004-01-15 INDI element is the most basic unit of the INDI KStars client. */ @@ -47,7 +47,7 @@ typedef enum {PG_NONE = 0, PG_TEXT, PG_NUMERIC, PG_BUTTONS, PG_RADIO, PG_MENU, PG_LIGHTS, PG_BLOB} PGui; /* INDI std properties */ -/* N.B. Need to modify corresponding entry in indidevice.cpp when changed */ +/* N.B. Need to modify corresponding entry in indidevice.cpp when changed */ enum stdProperties { CONNECTION, DEVICE_PORT, TIME, SDTIME, GEOGRAPHIC_COORD, /* General */ EQUATORIAL_COORD, EQUATORIAL_EOD_COORD, HORIZONTAL_COORD, /* Telescope */ ABORT_MOTION, ON_COORD_SET, SOLAR_SYSTEM, MOVEMENT, PARK, /* Telescope */ @@ -57,7 +57,7 @@ enum stdProperties { CONNECTION, DEVICE_PORT, TIME, SDTIME, GEOGRAPHIC_COORD, VIDEO_STREAM, /* Video */ FOCUS_SPEED, FOCUS_MOTION, FOCUS_TIMER, /* Focuser */ FILTER_SLOT}; /* Filter */ - + /* Devices families that we explicity support (i.e. with std properties) */ enum deviceFamily { KSTARS_TELESCOPE, KSTARS_CCD, KSTARS_FILTER, KSTARS_VIDEO, KSTARS_FOCUSER, KSTARS_DOME, KSTARS_GPS }; @@ -89,7 +89,7 @@ XMLEle * findEle (XMLEle *ep , INDI_P *pp, const char *child, char errmsg class INDI_E : public TQObject { Q_OBJECT - + public: INDI_E(INDI_P *parentProperty, TQString inName, TQString inLabel); ~INDI_E(); @@ -99,7 +99,7 @@ class INDI_E : public TQObject INDI_P *pp; /* parent property */ TQHBoxLayout *EHBox; /*Qt::Horizontal layout */ - + /* GUI widgets, only malloced when needed */ KSqueezedTextLabel *label_w; // label KLineEdit *read_w; // read field @@ -110,31 +110,31 @@ class INDI_E : public TQObject KPushButton *push_w; // push button KPushButton *browse_w; // browse button TQCheckBox *check_w; // check box - TQSpacerItem *hSpacer; //Qt::Horizontal spacer - + TQSpacerItem *hSpacer; // Horizontal spacer + double min, max, step; // params for scale double value; // current value double targetValue; // target value TQString text; // current text TQString format; // number format, if applicable - + int buildTextGUI (TQString initText); int buildNumberGUI (double initValue); int buildLightGUI(); int buildBLOBGUI(); void drawLt(); - + void initNumberValues(double newMin, double newMax, double newStep, char * newFormat); void updateValue(double newValue); void setMin (double inMin); void setMax (double inMax); - + void setupElementLabel(); void setupElementRead(int length); void setupElementWrite(int length); void setupElementScale(int length); void setupBrowseButton(); - + public slots: void spinChanged(double value); void sliderChanged(int value); diff --git a/kstars/kstars/indiproperty.cpp b/kstars/kstars/indiproperty.cpp index 9eecf874..85899ce3 100644 --- a/kstars/kstars/indiproperty.cpp +++ b/kstars/kstars/indiproperty.cpp @@ -5,10 +5,10 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - - + + */ - + #include "indiproperty.h" #include "indigroup.h" #include "indidevice.h" @@ -23,18 +23,18 @@ #include "indi/base64.h" #include "indi/indicom.h" - + #include #include #include #include #include #include - #include + #include #include #include - - #include + + #include #include #include #include @@ -45,7 +45,7 @@ #include #include - + /******************************************************************* ** INDI Property: contains widgets, labels, and their status *******************************************************************/ @@ -54,13 +54,13 @@ INDI_P::INDI_P(INDI_G *parentGroup, TQString inName) name = inName; pg = parentGroup; - + el.setAutoDelete(true); - + stdID = -1; - + indistd = new INDIStdProperty(this, pg->dp->parent->ksw, pg->dp->stdDev); - + PHBox = new TQHBoxLayout(0, 0, KDialogBase::spacingHint()); PVBox = new TQVBoxLayout(0, 0, KDialogBase::spacingHint()); light = NULL; @@ -104,7 +104,7 @@ bool INDI_P::isOn(TQString component) INDI_E * INDI_P::findElement(TQString elementName) { INDI_E *element = NULL; - + for (element = el.first(); element != NULL; element = el.next()) if (element->name == elementName || element->label == elementName) break; @@ -115,7 +115,7 @@ INDI_E * INDI_P::findElement(TQString elementName) void INDI_P::drawLt(PState lstate) { - + /* set state light */ switch (lstate) { @@ -141,13 +141,13 @@ void INDI_P::drawLt(PState lstate) break; } - + } void INDI_P::newText() { INDI_E * lp; - + for (lp = el.first(); lp != NULL; lp = el.next()) { /* If PG_SCALE */ @@ -164,15 +164,15 @@ void INDI_P::newText() else lp->text = lp->write_w->text(); break; - + case PP_RO: break; - + case PP_WO: lp->text = lp->write_w->text(); break; } - + if (guitype == PG_NUMERIC) { f_scansexa(lp->text.ascii(), &(lp->targetValue)); @@ -188,7 +188,7 @@ void INDI_P::newText() state = PS_BUSY; drawLt(state); - + /* perform any std functions */ indistd->newText(); @@ -201,11 +201,11 @@ void INDI_P::newText() void INDI_P::convertSwitch(int id) { - + INDI_E *lp; TQString mLabel; int switchIndex=0; - + if (assosiatedPopup == NULL) return; @@ -229,12 +229,12 @@ void INDI_P::convertSwitch(int id) indistd->ksw->map()->slotCenter(); return; } - + lp = findElement(mLabel); - + if (!lp) return; - + for (uint i=0; i < el.count(); i++) { if (el.at(i)->label == mLabel) @@ -247,7 +247,7 @@ void INDI_P::convertSwitch(int id) if (indistd->convertSwitch(switchIndex, lp)) return; else if (lp->state == PS_OFF) - newSwitch(switchIndex); + newSwitch(switchIndex); } @@ -267,15 +267,15 @@ void INDI_P::newSwitch(int id) for (unsigned int i=0; i < el.count(); i++) el.at(i)->state = PS_OFF; - + lp->state = PS_ON; break; - + case PG_BUTTONS: for (unsigned int i=0; i < el.count(); i++) { if (i == (unsigned int) id) continue; - + el.at(i)->push_w->setDown(false); buttonFont = el.at(i)->push_w->font(); buttonFont.setBold(FALSE); @@ -290,12 +290,12 @@ void INDI_P::newSwitch(int id) lp->state = PS_ON; break; - + case PG_RADIO: lp->state = lp->state == PS_ON ? PS_OFF : PS_ON; lp->check_w->setChecked(lp->state == PS_ON); break; - + default: break; @@ -304,7 +304,7 @@ void INDI_P::newSwitch(int id) state = PS_BUSY; drawLt(state); - + if (indistd->newSwitch(id, lp)) return; @@ -327,16 +327,16 @@ void INDI_P::newBlob() unsigned char *data, *data64; bool sending (false); bool valid (true); - + for (unsigned int i=0; i < el.count(); i++) { filename = el.at(i)->write_w->text(); if (filename.isEmpty()) { valid = false; - continue; + continue; } - + fp.setName(filename); if ( (pos = filename.findRev(".")) != -1) @@ -348,7 +348,7 @@ void INDI_P::newBlob() valid = false; continue; } - + binaryStream.setDevice(&fp); data_file = new char[fp.size()]; @@ -395,7 +395,7 @@ void INDI_P::newBlob() else if (sending) pg->dp->parentMgr->finishBlob(); - if (valid) + if (valid) state = PS_BUSY; else state = PS_ALERT; @@ -417,18 +417,18 @@ void INDI_P::addGUI (XMLEle *root) light->setLook(KLed::Sunken); //light->setShape(KLed::Rectangular); drawLt(state); - + /* #1 First widegt is the LED status indicator */ PHBox->addWidget(light); - + /* #2 add label for prompt */ prompt = findAtt(root, "label", errmsg); - + if (!prompt) label = name; else label = valuXMLAtt(prompt); - + // use property name if label is empty if (label.isEmpty()) { @@ -437,20 +437,20 @@ void INDI_P::addGUI (XMLEle *root) } else label_w = new TQLabel(label, pg->propertyContainer); - + label_w->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, label_w->sizePolicy().hasHeightForWidth() ) ); label_w->setFrameShape( TQLabel::GroupBoxPanel ); label_w->setMinimumWidth(PROPERTY_LABEL_WIDTH); label_w->setMaximumWidth(PROPERTY_LABEL_WIDTH); label_w->setTextFormat( TQLabel::RichText ); label_w->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter | TQLabel::AlignHCenter) ); - + PHBox->addWidget(label_w); - + light->show(); label_w->show(); - - /* #3 Add theQt::Vertical layout thay may contain several elements */ + + /* #3 Add the Vertical layout thay may contain several elements */ PHBox->addLayout(PVBox); } @@ -461,7 +461,7 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[]) XMLAtt *ap; TQString textName, textLabel; errmsg=errmsg; - + for (text = nextXMLEle (root, 1); text != NULL; text = nextXMLEle (root, 0)) { if (strcmp (tagXMLEle(text), "defText")) @@ -486,24 +486,24 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[]) } textLabel = valuXMLAtt(ap); - + if (textLabel.isEmpty()) textLabel = textName; textLabel.truncate(MAXINDINAME); - + lp = new INDI_E(this, textName, textLabel); lp->buildTextGUI(TQString(pcdataXMLEle(text))); - + el.append(lp); - + } - + if (perm == PP_RO) return 0; - + // INDI STD, but we use our own controls if (name == "TIME") { @@ -515,9 +515,9 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[]) setupSetButton("Set"); TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newText())); } - + return 0; - + } int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[]) @@ -529,7 +529,7 @@ int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[]) INDI_E *lp; TQString numberName, numberLabel; errmsg=errmsg; - + for (number = nextXMLEle (root, 1); number != NULL; number = nextXMLEle (root, 0)) { if (strcmp (tagXMLEle(number), "defNumber")) @@ -554,12 +554,12 @@ int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[]) } numberLabel = valuXMLAtt(ap); - + if (numberLabel.isEmpty()) numberLabel = numberName; numberLabel.truncate(MAXINDINAME); - + lp = new INDI_E(this, numberName, numberLabel); ap = findXMLAtt (number, "min"); @@ -582,17 +582,17 @@ int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[]) el.append(lp); } - + if (perm == PP_RO) return 0; - + if (name == "CCD_EXPOSE_DURATION") setupSetButton("Start"); else setupSetButton("Set"); - + TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newText())); - + return (0); } @@ -634,7 +634,7 @@ int INDI_P::buildMenuGUI(XMLEle *root, char errmsg[]) switchName = valuXMLAtt(ap); switchName.truncate(MAXINDINAME); - + /* find label */ ap = findAtt (sep, "label", errmsg); if (!ap) @@ -657,7 +657,7 @@ int INDI_P::buildMenuGUI(XMLEle *root, char errmsg[]) } menuOptions.append(switchLabel); - + if (lp->state == PS_ON) { if (onItem != -1) @@ -666,19 +666,19 @@ int INDI_P::buildMenuGUI(XMLEle *root, char errmsg[]) tagXMLEle(root), name.ascii(), lp->name.ascii()); return (-1); } - + onItem = i; } - + el.append(lp); } om_w = new KComboBox(pg->propertyContainer); om_w->insertStringList(menuOptions); om_w->setCurrentItem(onItem); - + HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); - + PHBox->addWidget(om_w); PHBox->addItem(HorSpacer); @@ -702,7 +702,7 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) groupB->setFrameShape(TQFrame::NoFrame); if (guitype == PG_BUTTONS) groupB->setExclusive(true); - + TQObject::connect(groupB, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(newSwitch(int))); for (sep = nextXMLEle (root, 1), j=-1; sep != NULL; sep = nextXMLEle (root, 0)) @@ -710,7 +710,7 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) /* look for switch tage */ if (strcmp (tagXMLEle(sep), "defSwitch")) continue; - + /* find name */ ap = findAtt (sep, "name", errmsg); if (!ap) @@ -725,12 +725,12 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) return (-1); switchLabel = valuXMLAtt(ap); - + if (switchLabel.isEmpty()) switchLabel = switchName; switchLabel.truncate(MAXINDINAME); - + lp = new INDI_E(this, switchName, switchLabel); if (pg->dp->crackSwitchState (pcdataXMLEle(sep), &(lp->state)) < 0) @@ -761,7 +761,7 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) lp->push_w = button; PHBox->addWidget(button); - + button->show(); break; @@ -774,9 +774,9 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) checkbox->setChecked(true); lp->check_w = checkbox; - + PHBox->addWidget(checkbox); - + checkbox->show(); break; @@ -791,9 +791,9 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) if (j < 0) return (-1); - + HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); - + PHBox->addItem(HorSpacer); return (0); @@ -805,7 +805,7 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[]) XMLAtt *ap; INDI_E *lp; TQString sname, slabel; - + for (lep = nextXMLEle (root, 1); lep != NULL; lep = nextXMLEle (root, 0)) { if (strcmp (tagXMLEle(lep), "defLight")) @@ -814,7 +814,7 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[]) /* find name */ ap = findAtt (lep, "name", errmsg); if (!ap) return (-1); - + sname = valuXMLAtt(ap); sname.truncate(MAXINDINAME); @@ -827,7 +827,7 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[]) slabel = sname; slabel.truncate(MAXINDINAME); - + lp = new INDI_E(this, sname, slabel); if (pg->dp->crackLightState (pcdataXMLEle(lep), &lp->state) < 0) @@ -836,13 +836,13 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[]) tagXMLEle(root), valuXMLAtt(ap), pg->dp->name.ascii(), name.ascii(), sname.ascii()); return (-1); } - + lp->buildLightGUI(); el.append(lp); } - + HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); - + PHBox->addItem(HorSpacer); return (0); @@ -857,7 +857,7 @@ int INDI_P::buildBLOBGUI(XMLEle *root, char errmsg[]) XMLAtt *ap; TQString blobName, blobLabel ; errmsg=errmsg; - + for (blob = nextXMLEle (root, 1); blob != NULL; blob = nextXMLEle (root, 0)) { if (strcmp (tagXMLEle(blob), "defBLOB")) @@ -891,34 +891,34 @@ int INDI_P::buildBLOBGUI(XMLEle *root, char errmsg[]) lp = new INDI_E(this, blobName, blobLabel); lp->buildBLOBGUI(); - + el.append(lp); - + } - + if (perm == PP_RO) return 0; - + setupSetButton(i18n("Upload")); TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newBlob())); return 0; - + } void INDI_P::activateSwitch(TQString name) { int iCounter = 0; INDI_E *element; - + for (element = el.first(); element != NULL; element = el.next()) { if (element->name == name && element->push_w) newSwitch(iCounter); - + iCounter++; } - + } diff --git a/kstars/kstars/indistd.cpp b/kstars/kstars/indistd.cpp index b2c9b2c6..6bfe8ef9 100644 --- a/kstars/kstars/indistd.cpp +++ b/kstars/kstars/indistd.cpp @@ -5,10 +5,10 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + 2004-01-18: This class handles INDI Standard properties. */ - + #include "indistd.h" #include "Options.h" #include "indielement.h" @@ -26,7 +26,7 @@ #include "streamwg.h" #include "ccdpreviewwg.h" #include "fitsviewer.h" - + #include #include #include @@ -34,13 +34,13 @@ #include #include #include - + #include #include #include #include #include - + #include #include #include @@ -52,40 +52,40 @@ #include #include #include - - + + #define STD_BUFFER_SIZ 1024000 #define FRAME_ILEN 1024 - + INDIStdDevice::INDIStdDevice(INDI_D *associatedDevice, KStars * kswPtr) { - + dp = associatedDevice; ksw = kswPtr; initDevCounter = 0; setCount = 0; batchMode = false; ISOMode = false; - - currentObject = NULL; + + currentObject = NULL; streamWindow = new StreamWG(this, ksw); CCDPreviewWindow = new CCDPreviewWG(this, ksw); - + devTimer = new TQTimer(this); seqLister = new KDirLister(); - + telescopeSkyObject = new SkyObject(0, 0, 0, 0, i18n("Telescope")); ksw->data()->appendTelescopeObject(telescopeSkyObject); - + connect( devTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) ); connect( seqLister, TQT_SIGNAL(newItems (const KFileItemList & )), this, TQT_SLOT(checkSeqBoundary(const KFileItemList &))); - + downloadDialog = new KProgressDialog(NULL, 0, i18n("INDI"), i18n("Downloading Data...")); downloadDialog->cancel(); - + parser = newLilXML(); } - + INDIStdDevice::~INDIStdDevice() { streamWindow->enableStream(false); @@ -95,29 +95,29 @@ streamDisabled(); delete (seqLister); } - + void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString dataFormat) { if (dataFormat == ".fits") dataType = DATA_FITS; else if (dataFormat == ".stream") dataType = DATA_STREAM; - else if (dataFormat == ".ccdpreview") dataType = DATA_CCDPREVIEW; + else if (dataFormat == ".ccdpreview") dataType = DATA_CCDPREVIEW; else dataType = DATA_OTHER; if (dataType == DATA_STREAM) { if (!streamWindow->processStream) return; - - streamWindow->show(); - streamWindow->streamFrame->newFrame( buffer, bufferSize, streamWindow->streamWidth, streamWindow->streamHeight); + + streamWindow->show(); + streamWindow->streamFrame->newFrame( buffer, bufferSize, streamWindow->streamWidth, streamWindow->streamHeight); } else if (dataType == DATA_CCDPREVIEW) { if (!CCDPreviewWindow->processStream) return; - CCDPreviewWindow->show(); - CCDPreviewWindow->streamFrame->newFrame( buffer, bufferSize, CCDPreviewWindow->streamWidth, CCDPreviewWindow->streamHeight); + CCDPreviewWindow->show(); + CCDPreviewWindow->streamFrame->newFrame( buffer, bufferSize, CCDPreviewWindow->streamWidth, CCDPreviewWindow->streamHeight); } else if (dataType == DATA_FITS || dataType == DATA_OTHER) { @@ -125,14 +125,14 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d FILE *fitsTempFile; int fd, nr, n=0; TQString currentDir = Options::fitsSaveDirectory(); - + streamWindow->close(); - + if (dataType == DATA_FITS && !batchMode && Options::indiFITSDisplay()) { strcpy(filename, "/tmp/fitsXXXXXX"); if ((fd = mkstemp(filename)) < 0) - { + { KMessageBox::error(NULL, "Error making temporary filename."); return; } @@ -145,18 +145,18 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d time_t t; time (&t); tp = gmtime (&t); - + if (currentDir[currentDir.length() -1] == '/') currentDir.truncate(currentDir.length() - 1); - + strncpy(filename, currentDir.ascii(), currentDir.length()); filename[currentDir.length()] = '\0'; - + if (dataType == DATA_FITS) { char tempFileStr[256]; strncpy(tempFileStr, filename, 256); - + if ( batchMode && !ISOMode) snprintf(filename, sizeof(filename), "%s/%s_%02d.fits", tempFileStr, seqPrefix.ascii(), setCount); else if (!batchMode && !Options::indiFITSDisplay()) @@ -169,7 +169,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d strftime (ts, sizeof(ts), "%Y-%m-%dT%H:%M:%S", tp); snprintf(filename, sizeof(filename), "%s/%s_%02d_%s.fits", tempFileStr, seqPrefix.ascii(), setCount, ts); } - + setCount++; } else @@ -179,16 +179,16 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d strncat(filename, dataFormat.ascii(), 10); } } - + fitsTempFile = fopen(filename, "w"); - + if (fitsTempFile == NULL) return; - + for (nr=0; nr < (int) bufferSize; nr += n) n = fwrite( ((unsigned char *) buffer) + nr, 1, bufferSize - nr, fitsTempFile); - + fclose(fitsTempFile); - + // We're done if we have DATA_OTHER if (dataType == DATA_OTHER) { @@ -200,15 +200,15 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d ksw->statusBar()->changeItem( i18n("FITS file saved to %1").arg(filename), 0); emit FITSReceived(dp->label); return; - } - + } + KURL fileURL(filename); - + FITSViewer * fv = new FITSViewer(&fileURL, ksw); fv->fitsChange(); fv->show(); } - + } /* Process standard Text and Number properties arrives from the driver */ @@ -222,44 +222,44 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d ExtDate indiDate; TQTime indiTime; KStarsDateTime indiDateTime; - + switch (pp->stdID) { case TIME: if ( Options::indiAutoTime() ) handleDevCounter(); - + // Update KStars time once we receive update from INDI el = pp->findElement("UTC"); if (!el) return; - + sscanf(el->text.ascii(), "%d%*[^0-9]%d%*[^0-9]%dT%d%*[^0-9]%d%*[^0-9]%d", &y, &m, &d, &hour, &min, &sec); indiDate.setYMD(y, m, d); indiTime.setHMS(hour, min, sec); indiDateTime.setDate(indiDate); indiDateTime.setTime(indiTime); - + ksw->data()->changeDateTime(indiDateTime); ksw->data()->syncLST(); - + break; - + case SDTIME: if ( Options::indiAutoTime()) handleDevCounter(); break; - + case GEOGRAPHIC_COORD: if ( Options::indiAutoGeo() ) handleDevCounter(); break; - + case CCD_EXPOSE_DURATION: if (pp->state == PS_IDLE || pp->state == PS_OK) pp->set_w->setText(i18n("Start")); break; - + case CCD_FRAME: el = pp->findElement("WIDTH"); if (!el) return; @@ -267,11 +267,11 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d el = pp->findElement("HEIGHT"); if (!el) return; ht = (int) el->value; - + streamWindow->setSize(wd, ht); //streamWindow->allocateStreamBuffer(); break; - case CCDPREVIEW_CTRL: + case CCDPREVIEW_CTRL: el = pp->findElement("WIDTH"); if (!el) return; wd = (int) el->value; @@ -283,12 +283,12 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d bo = (int) el->value; el = pp->findElement("BYTESPERPIXEL"); if (!el) return; - bpp = (int) el->value; + bpp = (int) el->value; el = pp->findElement("MAXGOODDATA"); if (!el) return; mgd = (long) el->value; CCDPreviewWindow->setCtrl(wd, ht, bo ,bpp,mgd); - + break; case CCD_INFO: @@ -311,10 +311,10 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d if (!el) return; telescopeSkyObject->setDec(el->value); telescopeSkyObject->EquatorialToHorizontal(ksw->LST(), ksw->geo()->lat()); - // Force immediate update of skymap if the focus object is our telescope. + // Force immediate update of skymap if the focus object is our telescope. if (ksw->map()->focusObject() == telescopeSkyObject) ksw->map()->updateFocus(); - else + else ksw->map()->update(); break; @@ -327,7 +327,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d if (!el) return; telescopeSkyObject->setAz(el->value); telescopeSkyObject->HorizontalToEquatorial(ksw->LST(), ksw->geo()->lat()); - // Force immediate update of skymap if the focus object is our telescope. + // Force immediate update of skymap if the focus object is our telescope. if (ksw->map()->focusObject() == telescopeSkyObject) ksw->map()->updateFocus(); else @@ -336,9 +336,9 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d default: break; - + } - + } void INDIStdDevice::setLabelState(INDI_P *pp) @@ -348,13 +348,13 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d TDEAction *tmpAction; INDIDriver *drivers = ksw->getINDIDriver(); TQFont buttonFont; - + switch (pp->stdID) { case CONNECTION: lp = pp->findElement("CONNECT"); if (!lp) return; - + if (lp->state == PS_ON) { initDeviceOptions(); @@ -378,10 +378,10 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d //dp->parentMgr->sNotifier->disconnect(); streamWindow->enableStream(false); streamWindow->close(); - + //close(streamFD); } - + if (ksw->map()->focusObject() == telescopeSkyObject) { ksw->map()->stopTracking(); @@ -393,7 +393,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d emit linkRejected(); } break; - + case VIDEO_STREAM: lp = pp->findElement("ON"); if (!lp) return; @@ -402,7 +402,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d else streamWindow->enableStream(false); break; - + case CCDPREVIEW_STREAM: lp = pp->findElement("ON"); if (!lp) return; @@ -411,101 +411,101 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d else CCDPreviewWindow->enableStream(false); break; - + default: break; } - + } void INDIStdDevice::streamDisabled() { INDI_P *pp; INDI_E *el; - + //pp = dp->findProp("CONNECTION"); //if (!pp) return; //if (pp->state == PS_OFF) return; - + pp = dp->findProp("VIDEO_STREAM"); if (!pp) return; - + el = pp->findElement("OFF"); if (!el) return; - + if (el->state == PS_ON) return; - + // Turn stream off - pp->newSwitch(1); - + pp->newSwitch(1); + } - + void INDIStdDevice::updateSequencePrefix(TQString newPrefix) { seqPrefix = newPrefix; - + seqLister->setNameFilter(TQString("%1_*.fits").arg(seqPrefix)); - + setCount = 0; - + if (ISOMode) return; - + seqLister->openURL(Options::fitsSaveDirectory()); - + checkSeqBoundary(seqLister->items()); - + } - + void INDIStdDevice::checkSeqBoundary(const KFileItemList & items) { int newFileIndex; TQString tempName; char *tempPrefix = new char[64]; - + // No need to check when in ISO mode if (ISOMode) return; - + for ( KFileItemListIterator it( items ) ; it.current() ; ++it ) { tempName = it.current()->name(); - + // find the prefix first if (tempName.find(seqPrefix) == -1) continue; - + strncpy(tempPrefix, tempName.ascii(), 64); tempPrefix[63] = '\0'; - + char * t = tempPrefix; - + // skip chars while (*t) { if (isdigit(*t)) break; t++; } //tempPrefix = t; - + newFileIndex = strtol(t, NULL, 10); - + if (newFileIndex >= setCount) setCount = newFileIndex + 1; } - + delete [] (tempPrefix); - + } - + void INDIStdDevice::updateTime() { INDI_P *pp; INDI_E *lp; - + pp = dp->findProp("TIME"); if (!pp) return; - + lp = pp->findElement("UTC"); - + if (!lp) return; - + TQTime newTime( ksw->data()->ut().time()); ExtDate newDate( ksw->data()->ut().date()); @@ -513,12 +513,12 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString d .arg(newDate.day()).arg(newTime.hour()) .arg(newTime.minute()).arg(newTime.second())); pp->newText(); - + pp = dp->findProp("SDTIME"); if (!pp) return; lp = pp->findElement("LST"); if (!lp) return; - + lp->write_w->setText(ksw->LST()->toHMSString()); pp->newText(); } @@ -531,7 +531,7 @@ void INDIStdDevice::updateLocation() pp = dp->findProp("GEOGRAPHIC_COORD"); if (!pp) return; - + dms tempLong (geo->lng()->degree(), geo->lng()->arcmin(), geo->lng()->arcsec()); dms fullCir(360,0,0); @@ -542,26 +542,26 @@ void INDIStdDevice::updateLocation() if (!latEle) return; longEle = pp->findElement("LONG"); if (!longEle) return; - + longEle->write_w->setText(TQString("%1:%2:%3").arg(tempLong.degree()).arg(tempLong.arcmin()).arg(tempLong.arcsec())); latEle->write_w->setText(TQString("%1:%2:%3").arg(geo->lat()->degree()).arg(geo->lat()->arcmin()).arg(geo->lat()->arcsec())); - + pp->newText(); } - + void INDIStdDevice::registerProperty(INDI_P *pp) { INDI_E * portEle; INDIDriver *drivers = ksw->getINDIDriver(); TQString str; - + switch (pp->stdID) { case DEVICE_PORT: portEle = pp->findElement("PORT"); if (!portEle) return; - + if (drivers) { for (unsigned int i=0; i < drivers->devices.size(); i++) @@ -583,14 +583,14 @@ void INDIStdDevice::updateLocation() break; } } - } + } } break; - + } - + } - + void INDIStdDevice::initDeviceOptions() { @@ -678,7 +678,7 @@ bool INDIStdDevice::handleNonSidereal() { prop->newSwitch(i); setMode->newSwitch(trackIndex); - + /* Send object name if available */ nameEle = dp->findElem("OBJECT_NAME"); if (nameEle && nameEle->pp->perm != PP_RO) @@ -693,7 +693,7 @@ bool INDIStdDevice::handleNonSidereal() kdDebug() << "Device doesn't support SOLAR_SYSTEM property, issuing a timer" << endl; kdDebug() << "Starting timer for object of type " << currentObject->typeName() << endl; - + switch (currentObject->type()) { @@ -735,21 +735,21 @@ void INDIStdDevice::timerDone() el = prop->findElement("TRACK"); if (!el) return; - + if (el->state != PS_ON) { devTimer->stop(); return; } - + prop = dp->findProp("EQUATORIAL_EOD_COORD"); - + if (prop == NULL) { prop = dp->findProp("EQUATORIAL_COORD"); if (prop) useJ2000 = true; } - + if (prop == NULL || !currentObject) return; @@ -760,7 +760,7 @@ void INDIStdDevice::timerDone() kdDebug() << "Timer called, starting processing" << endl; SkyPoint sp(currentObject->ra(), currentObject->dec()); - + kdDebug() << "RA: " << currentObject->ra()->toHMSString() << " - DEC: " << currentObject->dec()->toDMSString() << endl; kdDebug() << "Az: " << currentObject->az()->toHMSString() << " - Alt " << currentObject->alt()->toDMSString() << endl; @@ -778,7 +778,7 @@ void INDIStdDevice::timerDone() if (!RAEle) return; DecEle = prop->findElement("DEC"); if (!DecEle) return; - + RAEle->write_w->setText(TQString("%1:%2:%3").arg(sp.ra()->hour()) .arg(sp.ra()->minute()) .arg(sp.ra()->second())); @@ -795,29 +795,29 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN ksw = kswPtr; stdDev = stdDevPtr; } - - INDIStdProperty::~INDIStdProperty() + + INDIStdProperty::~INDIStdProperty() { - + } - + void INDIStdProperty::newText() { INDI_E *lp; INDIDriver *drivers = ksw->getINDIDriver(); - + switch (pp->stdID) { /* Set expose duration button to 'cancel' when busy */ case CCD_EXPOSE_DURATION: pp->set_w->setText(i18n("Cancel")); break; - + /* Save Port name in KStars options */ case DEVICE_PORT: lp = pp->findElement("PORT"); - - if (lp && drivers) + + if (lp && drivers) { for (unsigned int i=0; i < drivers->devices.size(); i++) { @@ -837,21 +837,21 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN } } } - + break; } - + } - + bool INDIStdProperty::convertSwitch(int switchIndex, INDI_E *lp) { - + INDI_E *RAEle(NULL), *DecEle(NULL), *AzEle(NULL), *AltEle(NULL), *nameEle(NULL); INDI_P * prop; SkyPoint sp; - int selectedCoord=0; /* 0 for Equatorial, 1 forQt::Horizontal */ + int selectedCoord=0; /* 0 for Equatorial, 1 for Horizontal */ bool useJ2000 (false); - + switch (pp->stdID) { /* Handle Slew/Track/Sync */ @@ -889,7 +889,7 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN if (!DecEle) return false; break; - //Qt::Horizontal + // Horizontal case 1: if (prop->perm == PP_RO) return false; AzEle = prop->findElement("AZ"); @@ -898,7 +898,7 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN if (!AltEle) return false; break; } - + stdDev->currentObject = ksw->map()->clickedObject(); // Track is similar to slew, except that for non-sidereal objects // it tracks the objects automatically via a timer. @@ -953,10 +953,10 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN pp->newSwitch(switchIndex); prop->newText(); - + return true; break; - + /* Handle Abort */ case ABORT_MOTION: kdDebug() << "Stopping timer." << endl; @@ -964,33 +964,33 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN pp->newSwitch(switchIndex); return true; break; - + case MOVEMENT: pp->newSwitch(switchIndex); break; - + default: return false; break; } - + return false; - + } - + // Return true if the complete operation is done here, or false if the operation is to be completed in the properties newSwitch() bool INDIStdProperty::newSwitch(int id, INDI_E* el) { INDI_P *prop; - el=el; + el=el; switch (pp->stdID) { - case CONNECTION: + case CONNECTION: if (id == 1) stdDev->streamDisabled(); else - { + { prop = pp->pg->dp->findProp("DEVICE_PORT"); if (prop) prop->newText(); @@ -1005,7 +1005,7 @@ bool INDIStdProperty::newSwitch(int id, INDI_E* el) default: break; } - + return false; } @@ -1014,10 +1014,10 @@ void INDIStdProperty::newTime() { INDI_E * timeEle; INDI_P *SDProp; - + timeEle = pp->findElement("UTC"); if (!timeEle) return; - + TimeDialog timedialog ( ksw->data()->ut(), ksw ); if ( timedialog.exec() == TQDialog::Accepted ) @@ -1032,12 +1032,12 @@ void INDIStdProperty::newTime() pp->newText(); } else return; - + SDProp = pp->pg->dp->findProp("SDTIME"); if (!SDProp) return; timeEle = SDProp->findElement("LST"); if (!timeEle) return; - + timeEle->write_w->setText(ksw->LST()->toHMSString()); SDProp->newText(); } diff --git a/kstars/kstars/ksplanetbase.h b/kstars/kstars/ksplanetbase.h index 6954ed44..8c5e0e69 100644 --- a/kstars/kstars/ksplanetbase.h +++ b/kstars/kstars/ksplanetbase.h @@ -117,7 +117,7 @@ public: *@param elat Ecliptic Latitude */ void setEcLat( double elat ) { ep.latitude.setD( elat ); } - + /**@return pointer to Ecliptic Heliocentric Longitude coordinate */ const dms* helEcLong( void ) const { return &helEcPos.longitude; } @@ -263,7 +263,7 @@ public: */ void clearTrail() { Trail.clear(); } -/**@short updateQt::Horizontal coords of the trail +/**@short update Horizontal coords of the trail */ void updateTrail( dms *LST, const dms *lat ); @@ -278,7 +278,7 @@ public: */ void scaleRotateImage( int scale, double imageAngle ); -/**Show Solar System object popup menu. Overloaded from virtual +/**Show Solar System object popup menu. Overloaded from virtual *SkyObject::showPopupMenu() *@param pmenu pointer to the KSPopupMenu object *@param pos TQPojnt holding the x,y coordinates for the menu @@ -308,7 +308,7 @@ protected: // Geocentric ecliptic position, but distance to the Sun EclipticPosition ep; - // Heliocentric ecliptic position referred to the equinox of the epoch + // Heliocentric ecliptic position referred to the equinox of the epoch // as obtained from VSOP. EclipticPosition helEcPos; TQPtrList Trail; @@ -325,8 +325,8 @@ private: */ void localizeCoords( const KSNumbers *num, const dms *lat, const dms *LST ); - /* Computes the visual magnitude for the major planets. - * @param num pointer to a ksnumbers object. Needed for the saturn rings contribution to + /* Computes the visual magnitude for the major planets. + * @param num pointer to a ksnumbers object. Needed for the saturn rings contribution to * saturn magnitude. * @param Earth pointer to an Earth object. Needed to know the distance between the Earth and the * Sun. diff --git a/kstars/kstars/kstarsactions.cpp b/kstars/kstars/kstarsactions.cpp index 680f4ede..81ac63ba 100644 --- a/kstars/kstars/kstarsactions.cpp +++ b/kstars/kstars/kstarsactions.cpp @@ -154,7 +154,7 @@ void KStars::slotWizard() { // Make sure Numbers, Moon, planets, and sky objects are updated immediately data()->setFullTimeUpdate(); - // If the sky is inQt::Horizontal mode and not tracking, reset focus such that + // If the sky is in Horizontal mode and not tracking, reset focus such that // Alt/Az remain constant. if ( data()->useDefaultOptions ) { SkyPoint newPoint; @@ -263,8 +263,8 @@ void KStars::slotINDIConf() { indioptions.loadOptions(); /*TQStringList filterList; - - + + indiconf.timeCheck->setChecked( Options::indiAutoTime() ); indiconf.GeoCheck->setChecked( Options::indiAutoGeo() ); indiconf.crosshairCheck->setChecked( Options::indiCrosshairs() ); @@ -331,7 +331,7 @@ void KStars::slotGeoLocator() { // Make sure Numbers, Moon, planets, and sky objects are updated immediately data()->setFullTimeUpdate(); - // If the sky is inQt::Horizontal mode and not tracking, reset focus such that + // If the sky is in Horizontal mode and not tracking, reset focus such that // Alt/Az remain constant. if ( ! Options::isTracking() && Options::useAltAz() ) { map()->focus()->HorizontalToEquatorial( LST(), geo()->lat() ); @@ -455,10 +455,10 @@ void KStars::slotExportImage() { "Overwrite it?" ).arg(fileURL.fileName()), i18n( "Overwrite File?" ), i18n( "&Overwrite" ) ); - + if(r==KMessageBox::Cancel) return; } - + exportImage( fileURL.url(), map()->width(), map()->height() ); } @@ -793,7 +793,7 @@ void KStars::slotCoordSys() { if ( map()->focusObject() ) //simply update focus to focusObject's position map()->setFocus( map()->focusObject() ); else { //need to recompute focus for unrefracted position - map()->setFocusAltAz( map()->refract( map()->focus()->alt(), false ).Degrees(), + map()->setFocusAltAz( map()->refract( map()->focus()->alt(), false ).Degrees(), map()->focus()->az()->Degrees() ); map()->focus()->HorizontalToEquatorial( data()->lst(), geo()->lat() ); } @@ -802,7 +802,7 @@ void KStars::slotCoordSys() { } else { Options::setUseAltAz( true ); if ( Options::useRefraction() ) { - map()->setFocusAltAz( map()->refract( map()->focus()->alt(), true ).Degrees(), + map()->setFocusAltAz( map()->refract( map()->focus()->alt(), true ).Degrees(), map()->focus()->az()->Degrees() ); } actCoordSys->turnOff(); @@ -928,7 +928,7 @@ void KStars::slotClearAllTrails() { if ( map()->focusObject() && map()->focusObject()->isSolarSystem() && data()->temporaryTrail ) { exOb = map()->focusObject(); } - + //Major bodies if ( !( exOb && exOb->name() == "Moon" ) ) data()->Moon->clearTrail(); if ( !( exOb && exOb->name() == "Sun" ) ) data()->PCat->findByName("Sun")->clearTrail(); @@ -940,13 +940,13 @@ void KStars::slotClearAllTrails() { if ( !( exOb && exOb->name() == "Uranus" ) ) data()->PCat->findByName("Uranus")->clearTrail(); if ( !( exOb && exOb->name() == "Neptune" ) ) data()->PCat->findByName("Neptune")->clearTrail(); if ( !( exOb && exOb->name() == "Pluto" ) ) data()->PCat->findByName("Pluto")->clearTrail(); - + //Asteroids - for ( KSAsteroid *ast = data()->asteroidList.first(); ast; ast = data()->asteroidList.next() ) + for ( KSAsteroid *ast = data()->asteroidList.first(); ast; ast = data()->asteroidList.next() ) if ( !( exOb && exOb->name() == ast->name() ) ) ast->clearTrail(); //Comets - for ( KSComet *com = data()->cometList.first(); com; com = data()->cometList.next() ) + for ( KSComet *com = data()->cometList.first(); com; com = data()->cometList.next() ) if ( !( exOb && exOb->name() == com->name() ) ) com->clearTrail(); map()->forceUpdate(); diff --git a/kstars/kstars/kstarsdcop.cpp b/kstars/kstars/kstarsdcop.cpp index 7a4af85e..bc1f4ff4 100644 --- a/kstars/kstars/kstarsdcop.cpp +++ b/kstars/kstars/kstarsdcop.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "kstars.h" #include "kstarsdata.h" @@ -157,7 +157,7 @@ void KStars::setGeoLocation( TQString city, TQString province, TQString country //make sure planets, etc. are updated immediately data()->setFullTimeUpdate(); - // If the sky is inQt::Horizontal mode and not tracking, reset focus such that + // If the sky is in Horizontal mode and not tracking, reset focus such that // Alt/Az remain constant. if ( ! Options::isTracking() && Options::useAltAz() ) { map()->focus()->HorizontalToEquatorial( LST(), geo()->lat() ); @@ -205,7 +205,7 @@ void KStars::writeConfig() { } TQString KStars::getOption( const TQString &name ) { - //Some config items are not stored in the Options object while + //Some config items are not stored in the Options object while //the program is running; catch these here and returntheir current value. if ( name == "FocusRA" ) { return TQString::number( map()->focus()->ra()->Hours(), 'f', 6 ); } if ( name == "FocusDec" ) { return TQString::number( map()->focus()->dec()->Degrees(), 'f', 6 ); } @@ -344,12 +344,12 @@ void KStars::loadColorScheme( const TQString _name ) { TQString name( _name ); TQString filename = name.lower().stripWhiteSpace(); bool ok( false ); - + //Parse default names which don't follow the regular file-naming scheme if ( name == i18n("use default color scheme", "Default Colors") ) filename = "default.colors"; - if ( name == i18n("use 'star chart' color scheme", "Star Chart") ) filename = "chart.colors"; - if ( name == i18n("use 'night vision' color scheme", "Night Vision") ) filename = "night.colors"; - + if ( name == i18n("use 'star chart' color scheme", "Star Chart") ) filename = "chart.colors"; + if ( name == i18n("use 'night vision' color scheme", "Night Vision") ) filename = "night.colors"; + //Try the filename if it ends with ".colors" if ( filename.endsWith( ".colors" ) ) ok = data()->colorScheme()->load( filename ); @@ -360,36 +360,36 @@ void KStars::loadColorScheme( const TQString _name ) { if ( !filename.isEmpty() ) { for( unsigned int i=0; icolorScheme()->load( filename ); } - - if ( ! ok ) kdDebug() << i18n( "Unable to load color scheme named %1. Also tried %2." ).arg( name ).arg( filename ); + + if ( ! ok ) kdDebug() << i18n( "Unable to load color scheme named %1. Also tried %2." ).arg( name ).arg( filename ); } - + if ( ok ) { map()->setStarColorMode( data()->colorScheme()->starColorMode() ); map()->setStarColorIntensity( data()->colorScheme()->starColorIntensity() ); - + //set the application colors for the Night Vision scheme if ( Options::darkAppColors() == false && filename == "night.colors" ) { Options::setDarkAppColors( true ); OriginalPalette = TQApplication::palette(); TQApplication::setPalette( DarkPalette, true ); } - + if ( Options::darkAppColors() && filename != "night.colors" ) { Options::setDarkAppColors( false ); TQApplication::setPalette( OriginalPalette, true ); } - + map()->forceUpdate(); } } void KStars::exportImage( const TQString url, int w, int h ) { - //If the filename string contains no "/" separators, assume the + //If the filename string contains no "/" separators, assume the //user wanted to place a file in their home directory. KURL fileURL; if ( ! url.contains( "/" ) ) fileURL = TQDir::homeDirPath() + "/" + url; @@ -398,11 +398,11 @@ void KStars::exportImage( const TQString url, int w, int h ) { KTempFile tmpfile; TQString fname; tmpfile.setAutoDelete(true); - + TQPixmap skyimage( map()->width(), map()->height() ); TQPixmap outimage( w, h ); outimage.fill(); - + if ( fileURL.isValid() ) { if ( fileURL.isLocalFile() ) { fname = fileURL.path(); @@ -424,7 +424,7 @@ void KStars::exportImage( const TQString url, int w, int h ) { kapp->processEvents(10000); //skyImage is the size of the sky map. The requested image size is w x h. - //If w x h is smaller than the skymap, then we simply crop the image. + //If w x h is smaller than the skymap, then we simply crop the image. //If w x h is larger than the skymap, pad the skymap image with a white border. if ( w == map()->width() && h == map()->height() ) { outimage = skyimage; @@ -433,20 +433,20 @@ void KStars::exportImage( const TQString url, int w, int h ) { int sw(map()->width()), sh(map()->height()); if ( w > map()->width() ) { dx = (w - map()->width())/2; - } else { - sx = (map()->width() - w)/2; - sw = w; + } else { + sx = (map()->width() - w)/2; + sw = w; } if ( h > map()->height() ) { dy = (h - map()->height())/2; - } else { - sy = (map()->height() - h)/2; - sh = h; + } else { + sy = (map()->height() - h)/2; + sh = h; } - + bitBlt( &outimage, dx, dy, &skyimage, sx, sy, sw, sh ); } - + if ( ! outimage.save( fname, format ) ) kdDebug() << i18n( "Error: Unable to save image: %1 " ).arg( fname ) << endl; else kdDebug() << i18n( "Image saved to file: %1" ).arg( fname ) << endl; @@ -462,15 +462,15 @@ void KStars::exportImage( const TQString url, int w, int h ) { void KStars::printImage( bool usePrintDialog, bool useChartColors ) { KPrinter printer( true, TQPrinter::HighResolution ); printer.setFullPage( false ); - - //Set up the printer (either with the Print Dialog, + + //Set up the printer (either with the Print Dialog, //or using the default settings) bool ok( false ); if ( usePrintDialog ) ok = printer.setup( this, i18n("Print Sky") ); - else + else ok = printer.autoConfigure(); - + if( ok ) { kapp->setOverrideCursor( waitCursor ); @@ -489,13 +489,13 @@ void KStars::printImage( bool usePrintDialog, bool useChartColors ) { //(if printing was aborted, the colorscheme is still restored) if ( useChartColors ) { data()->colorScheme()->copy( cs ); - + // restore colormode and colorintensity in skymap map()->setStarColorMode( cs.starColorMode() ); map()->setStarColorIntensity( cs.starColorIntensity() ); map()->forceUpdate(); } - + kapp->restoreOverrideCursor(); } } @@ -504,13 +504,13 @@ void KStars::startINDI (TQString deviceName, bool useLocal) { establishINDI(); - + if (!indidriver || !indimenu) { kdDebug() << "establishINDI() failed." << endl; return; } - + TQListViewItem *driverItem = NULL; driverItem = indidriver->localListView->findItem(deviceName, 0); if (driverItem == NULL) @@ -525,18 +525,18 @@ void KStars::startINDI (TQString deviceName, bool useLocal) indidriver->localListView->setSelected(driverItem, true); indidriver->processDeviceStatus(1); } - + // Set custome label for device indimenu->setCustomLabel(deviceName); // Select it indidriver->localListView->setSelected(driverItem, true); - + // Start it either locally or as series if (useLocal) indidriver->localR->setChecked(true); else indidriver->serverR->setChecked(true); - + // Run it indidriver->processDeviceStatus(0); @@ -549,7 +549,7 @@ void KStars::shutdownINDI (TQString deviceName) kdDebug() << "establishINDI() failed." << endl; return; } - + TQListViewItem *driverItem = NULL; driverItem = indidriver->localListView->findItem(deviceName, 0); if (driverItem == NULL) @@ -567,13 +567,13 @@ void KStars::switchINDI(TQString deviceName, bool turnOn) { INDI_D *dev; INDI_P *prop; - + if (!indidriver || !indimenu) { kdDebug() << "switchINDI: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -582,33 +582,33 @@ void KStars::switchINDI(TQString deviceName, bool turnOn) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + if (turnOn && dev->isOn() || (!turnOn && !dev->isOn())) return; - + prop = dev->findProp("CONNECTION"); if (!prop) return; - + if (turnOn) prop->newSwitch(0); else prop->newSwitch(1); - + } - + void KStars::setINDIPort(TQString deviceName, TQString port) { INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "setINDIPort: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -617,34 +617,34 @@ void KStars::setINDIPort(TQString deviceName, TQString port) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("DEVICE_PORT"); if (!prop) return; - + el = prop->findElement("PORT"); - + if (!el->write_w) return; - + el->write_w->setText(port); - + prop->newText(); } - + void KStars::setINDITargetCoord(TQString deviceName, double RA, double DEC) { INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "setINDITarget: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -653,33 +653,33 @@ void KStars::setINDITargetCoord(TQString deviceName, double RA, double DEC) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("EQUATORIAL_EOD_COORD"); if (!prop) return; - + el = prop->findElement("RA"); if (!el) return; if (!el->write_w) return; - + el->write_w->setText(TQString("%1").arg(RA)); - + el = prop->findElement("DEC"); if (!el) return; if (!el->write_w) return; - + el->write_w->setText(TQString("%1").arg(DEC)); - + prop->newText(); - + } - + void KStars::setINDITargetName(TQString deviceName, TQString objectName) { INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "setINDITarget: establishINDI() failed." << endl; @@ -688,7 +688,7 @@ void KStars::setINDITargetName(TQString deviceName, TQString objectName) SkyObject *target = data()->objectNamed( objectName ); if (!target) return; - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -697,38 +697,38 @@ void KStars::setINDITargetName(TQString deviceName, TQString objectName) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("EQUATORIAL_EOD_COORD"); if (!prop) return; - + el = prop->findElement("RA"); if (!el) return; if (!el->write_w) return; - + el->write_w->setText(TQString("%1").arg(target->ra()->Hours())); - + el = prop->findElement("DEC"); if (!el) return; if (!el->write_w) return; - + el->write_w->setText(TQString("%1").arg(target->dec()->Degrees())); - + prop->newText(); } - + void KStars::setINDIAction(TQString deviceName, TQString action) { INDI_D *dev; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "setINDIAction: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -737,28 +737,28 @@ void KStars::setINDIAction(TQString deviceName, TQString action) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + el = dev->findElem(action); if (!el) return; - + el->pp->activateSwitch(action); - + } - + void KStars::waitForINDIAction(TQString deviceName, TQString action) { INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "waitForINDIAction: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -767,24 +767,24 @@ void KStars::waitForINDIAction(TQString deviceName, TQString action) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp(action); - + if (prop == NULL) { el = dev->findElem(action); if (!el) return; - + TQObject::connect(el->pp, TQT_SIGNAL(okState()), this, TQT_SLOT(resumeDCOP(void ))); } else TQObject::connect(prop, TQT_SIGNAL(okState()), this, TQT_SLOT(resumeDCOP(void ))); - + kapp->dcopClient()->suspend(); - + } - + void KStars::setINDIFocusSpeed(TQString deviceName, unsigned int speed) { INDI_D *dev; @@ -805,21 +805,21 @@ void KStars::setINDIFocusSpeed(TQString deviceName, unsigned int speed) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("FOCUS_SPEED"); if (!prop) return; - + el = prop->findElement("SPEED"); if (!el) return; if (!el->write_w) return; - + el->write_w->setText(TQString("%1").arg(speed)); prop->newText(); } - + void KStars::startINDIFocus(TQString deviceName, int focusDir) { if (!indidriver || !indimenu) @@ -835,20 +835,20 @@ void KStars::startINDIFocus(TQString deviceName, int focusDir) } - + void KStars::setINDIGeoLocation(TQString deviceName, double longitude, double latitude) { - + INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "setINDIGeoLocation: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -857,33 +857,33 @@ void KStars::setINDIGeoLocation(TQString deviceName, double longitude, double la kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("GEOGRAPHICAL_COORD"); if (!prop) return; - + el = prop->findElement("LONG"); if (!el) return; if (!el->write_w) return; - + el->write_w->setText(TQString("%1").arg(longitude)); - + el = prop->findElement("LAT"); if (!el) return; if (!el->write_w) return; - + el->write_w->setText(TQString("%1").arg(latitude)); - + prop->newText(); } - + void KStars::setINDIFocusTimeout(TQString deviceName, int timeout) { INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "startINDIFocus: establishINDI() failed." << endl; @@ -898,36 +898,36 @@ void KStars::setINDIFocusTimeout(TQString deviceName, int timeout) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("FOCUS_TIMEOUT"); if (!prop) return; - + el = prop->findElement("TIMEOUT"); if (!el) return; - + if (el->write_w) el->write_w->setText(TQString("%1").arg(timeout)); else if (el->spin_w) el->spin_w->setValue(timeout); - + prop->newText(); } - + void KStars::startINDIExposure(TQString deviceName, int timeout) { INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "startINDIExposure: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -936,21 +936,21 @@ void KStars::startINDIExposure(TQString deviceName, int timeout) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("CCD_EXPOSE_DURATION"); if (!prop) return; - + el = prop->findElement("EXPOSE_DURATION"); if (!el) return; - + if (el->write_w) el->write_w->setText(TQString("%1").arg(timeout)); else if (el->spin_w) el->spin_w->setValue(timeout); - - + + prop->newText(); - + } void KStars::setINDIFilterNum(TQString deviceName, int filter_num) @@ -958,13 +958,13 @@ void KStars::setINDIFilterNum(TQString deviceName, int filter_num) INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "setINDIFilterNum: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -973,34 +973,34 @@ void KStars::setINDIFilterNum(TQString deviceName, int filter_num) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("FILTER_SLOT"); if (!prop) return; - + el = prop->findElement("SLOT"); if (!el) return; - + if (el->write_w) el->write_w->setText(TQString("%1").arg(filter_num)); else if (el->spin_w) el->spin_w->setValue(filter_num); - + prop->newText(); - + } - + void KStars::setINDIUTC(TQString deviceName, TQString UTCDateTime) { INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "startINDIUTC: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -1009,16 +1009,16 @@ void KStars::setINDIUTC(TQString deviceName, TQString UTCDateTime) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("TIME"); if (!prop) return; - + el = prop->findElement("UTC"); if (!el) return; if (!el->write_w) return; - + el->write_w->setText(UTCDateTime); - + prop->newText(); } @@ -1027,7 +1027,7 @@ void KStars::setINDIScopeAction(TQString deviceName, TQString action) { setINDIAction(deviceName, action); } - + void KStars::setINDIFrameType(TQString deviceName, TQString type) { setINDIAction(deviceName, type); @@ -1038,13 +1038,13 @@ void KStars::setINDICCDTemp(TQString deviceName, int temp) INDI_D *dev; INDI_P *prop; INDI_E *el; - + if (!indidriver || !indimenu) { kdDebug() << "setINDICCDTemp: establishINDI() failed." << endl; return; } - + dev = indimenu->findDevice(deviceName); if (!dev) dev = indimenu->findDeviceByLabel(deviceName); @@ -1053,19 +1053,19 @@ void KStars::setINDICCDTemp(TQString deviceName, int temp) kdDebug() << "Device " << deviceName << " not found!" << endl; return; } - + prop = dev->findProp("CCD_TEMPERATURE"); if (!prop) return; - + el = prop->findElement("TEMPERATURE"); if (!el) return; - + if (el->write_w) el->write_w->setText(TQString("%1").arg(temp)); else if (el->spin_w) el->spin_w->setValue(temp); - - + + prop->newText(); - + } diff --git a/kstars/kstars/opsadvancedui.ui b/kstars/kstars/opsadvancedui.ui index 54b01920..f46f4767 100644 --- a/kstars/kstars/opsadvancedui.ui +++ b/kstars/kstars/opsadvancedui.ui @@ -30,7 +30,7 @@ Correct coordinates of objects for the effects of the atmosphere - 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. + 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. diff --git a/kstars/kstars/planetcatalog.h b/kstars/kstars/planetcatalog.h index 996f4b24..0a7f4556 100644 --- a/kstars/kstars/planetcatalog.h +++ b/kstars/kstars/planetcatalog.h @@ -48,7 +48,7 @@ class dms; class PlanetCatalog : public TQObject { Q_OBJECT - + public: /**Constructor. */ @@ -60,7 +60,7 @@ class PlanetCatalog : public TQObject { /**Loads all planetary data from files on disk into the appropriate objects. */ bool initialize(); - /**Add pointers to the planetary objects to the ObjNames list. + /**Add pointers to the planetary objects to the ObjNames list. *@p ObjNames the list of all named objects to which we will add the planets. */ void addObject( ObjectNameList &ObjNames ) const; @@ -78,13 +78,13 @@ class PlanetCatalog : public TQObject { /**@return pointer to the Earth. (must not be const because we call findPosition on it in KSPlanetBase::updateCoords() )*/ KSPlanet *earth() { return Earth; } - /**Compute the presentQt::Horizontal coordinates of all planets. + /**Compute the present Horizontal coordinates of all planets. *@p LST pointer to the current local sidereal time *@p lat pointer to the current geographic latitude */ void EquatorialToHorizontal( dms *LST, const dms *lat ); - /**@return true if the SkyObject argument is a planet. + /**@return true if the SkyObject argument is a planet. *@p so pointer to the SkyObject to be tested */ bool isPlanet(SkyObject *so) const; @@ -95,8 +95,8 @@ class PlanetCatalog : public TQObject { */ KSPlanetBase *findByName( const TQString n) const; - /**@return a pointer to the planet closest to the given SkyPoint - *(within a maximum angular search radius) + /**@return a pointer to the planet closest to the given SkyPoint + *(within a maximum angular search radius) *@p p the Sky point to find a planet near *@p r the maximum angular search radius */ diff --git a/kstars/kstars/skymap.cpp b/kstars/kstars/skymap.cpp index 19c27001..4117ef61 100644 --- a/kstars/kstars/skymap.cpp +++ b/kstars/kstars/skymap.cpp @@ -53,13 +53,13 @@ SkyMap::SkyMap(KStarsData *d, TQWidget *parent, const char *name ) : TQWidget (parent,name), computeSkymap(true), angularDistanceMode(false), - ksw(0), data(d), pmenu(0), sky(0), sky2(0), IBoxes(0), + ksw(0), data(d), pmenu(0), sky(0), sky2(0), IBoxes(0), ClickedObject(0), FocusObject(0), TransientObject(0), starpix(0), pts(0), sp(0) { if ( parent ) ksw = (KStars*) parent->parent(); else ksw = 0; - + pts = new TQPointArray( 2000 ); // points for milkyway and horizon sp = new SkyPoint(); // needed by coordinate grid @@ -88,12 +88,12 @@ SkyMap::SkyMap(KStarsData *d, TQWidget *parent, const char *name ) sky = new TQPixmap(); sky2 = new TQPixmap(); pmenu = new KSPopupMenu( ksw ); - + //Initialize Transient label stuff TransientTimeout = 100; //fade label color every 0.2 sec connect( &HoverTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransientLabel() ) ); connect( &TransientTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransientTimeout() ) ); - + IBoxes = new InfoBoxes( Options::windowWidth(), Options::windowHeight(), Options::positionTimeBox(), Options::shadeTimeBox(), Options::positionGeoBox(), Options::shadeGeoBox(), @@ -173,9 +173,9 @@ void SkyMap::showFocusCoords( bool coordsOnly ) { //display object info in infoBoxes TQString oname; oname = i18n( "nothing" ); - if ( focusObject() != NULL && Options::isTracking() ) + if ( focusObject() != NULL && Options::isTracking() ) oname = focusObject()->translatedLongName(); - + infoBoxes()->focusObjChanged(oname); } @@ -421,24 +421,24 @@ SkyObject* SkyMap::objectNearest( SkyPoint *p ) { void SkyMap::slotTransientLabel( void ) { //This function is only called if the HoverTimer manages to timeout. - //(HoverTimer is restarted with every mouseMoveEvent; so if it times + //(HoverTimer is restarted with every mouseMoveEvent; so if it times //out, that means there was no mouse movement for HOVER_INTERVAL msec.) //Identify the object nearest to the mouse cursor as the - //TransientObject. The TransientObject is automatically labeled + //TransientObject. The TransientObject is automatically labeled //in SkyMap::paintEvent(). - //Note that when the TransientObject pointer is not NULL, the next - //mouseMoveEvent calls fadeTransientLabel(), which will fade out the + //Note that when the TransientObject pointer is not NULL, the next + //mouseMoveEvent calls fadeTransientLabel(), which will fade out the //TransientLabel and then set TransientObject to NULL. // - //Do not show a transient label if the map is in motion, or if the mouse + //Do not show a transient label if the map is in motion, or if the mouse //pointer is below the opaque horizon, or if the object has a permanent label - if ( ! slewing && ! ( Options::useAltAz() && Options::showGround() && + if ( ! slewing && ! ( Options::useAltAz() && Options::showGround() && mousePoint()->alt()->Degrees() < 0.0 ) ) { SkyObject *so = objectNearest( mousePoint() ); - + if ( so && ! isObjectLabeled( so ) ) { setTransientObject( so ); - + TransientColor = data->colorScheme()->colorNamed( "UserLabelColor" ); if ( TransientTimer.isActive() ) TransientTimer.stop(); update(); @@ -460,38 +460,38 @@ void SkyMap::slotTransientTimeout( void ) { //to fade the labels, we will need to smoothly transition from UserLabelColor to SkyColor. TQColor c1 = data->colorScheme()->colorNamed( "UserLabelColor" ); TQColor c2 = data->colorScheme()->colorNamed( "SkyColor" ); - + int dRed = ( c2.red() - c1.red() )/20; int dGreen = ( c2.green() - c1.green() )/20; int dBlue = ( c2.blue() - c1.blue() )/20; int newRed = TransientColor.red() + dRed; int newGreen = TransientColor.green() + dGreen; int newBlue = TransientColor.blue() + dBlue; - + //Check to see if we have arrived at the target color (SkyColor). //If so, point TransientObject to NULL. if ( abs(newRed-c2.red()) < abs(dRed) || abs(newGreen-c2.green()) < abs(dGreen) || abs(newBlue-c2.blue()) < abs(dBlue) ) { setTransientObject( NULL ); TransientTimer.stop(); - } else { + } else { TransientColor.setRgb( newRed, newGreen, newBlue ); } update(); } -void SkyMap::setFocusObject( SkyObject *o ) { - FocusObject = o; - - if ( FocusObject ) +void SkyMap::setFocusObject( SkyObject *o ) { + FocusObject = o; + + if ( FocusObject ) Options::setFocusObject( FocusObject->name() ); - else + else Options::setFocusObject( i18n( "nothing" ) ); } void SkyMap::slotCenter( void ) { setFocusPoint( clickedPoint() ); - if ( Options::useAltAz() ) + if ( Options::useAltAz() ) focusPoint()->EquatorialToHorizontal( data->LST, data->geo()->lat() ); //clear the planet trail of old focusObject, if it was temporary @@ -536,7 +536,7 @@ void SkyMap::slotCenter( void ) { } //update the destination to the selected coordinates - if ( Options::useAltAz() ) { + if ( Options::useAltAz() ) { if ( Options::useRefraction() ) setDestinationAltAz( refract( focusPoint()->alt(), true ).Degrees(), focusPoint()->az()->Degrees() ); else @@ -558,7 +558,7 @@ void SkyMap::slotCenter( void ) { s = focusPoint()->ra()->toHMSString() + ", " + focusPoint()->dec()->toDMSString(true); ksw->statusBar()->changeItem( s, 2 ); } - + showFocusCoords(); //update FocusBox } @@ -598,7 +598,7 @@ void SkyMap::slotDSS( void ) { //concat all the segments into the kview command line: KURL url (URLprefix + RAString + DecString + URLsuffix); - + TQString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." ); new ImageViewer (&url, message, this); } @@ -640,7 +640,7 @@ void SkyMap::slotDSS2( void ) { //concat all the segments into the kview command line: KURL url (URLprefix + RAString + DecString + URLsuffix); - + TQString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." ); new ImageViewer (&url, message, this); } @@ -665,7 +665,7 @@ void SkyMap::slotEndAngularDistance(void) { if(angularDistanceMode) { if ( SkyObject *so = objectNearest( mousePoint() ) ) { angularDistance = so->angularDistanceTo( previousClickedPoint() ); - ksw->statusBar()->changeItem( so->translatedLongName() + + ksw->statusBar()->changeItem( so->translatedLongName() + " " + i18n("Angular distance: " ) + angularDistance.toDMSString(), 0 ); @@ -837,7 +837,7 @@ void SkyMap::updateFocus() { if ( Options::useAltAz() ) { //Tracking any object in Alt/Az mode requires focus updates double dAlt = focusObject()->alt()->Degrees(); - if ( Options::useRefraction() ) + if ( Options::useRefraction() ) dAlt = refract( focusObject()->alt(), true ).Degrees(); setFocusAltAz( dAlt, focusObject()->az()->Degrees() ); focus()->HorizontalToEquatorial( data->LST, data->geo()->lat() ); @@ -921,9 +921,9 @@ void SkyMap::slewFocus( void ) { slewing = true; //since we are slewing, fade out the transient label - if ( transientObject() && ! TransientTimer.isActive() ) + if ( transientObject() && ! TransientTimer.isActive() ) fadeTransientLabel(); - + forceUpdate(); kapp->processEvents(10); //keep up with other stuff @@ -952,7 +952,7 @@ void SkyMap::slewFocus( void ) { setFocus( destination() ); focus()->EquatorialToHorizontal( data->LST, data->geo()->lat() ); } - + data->HourAngle->setH( data->LST->Hours() - focus()->ra()->Hours() ); slewing = false; @@ -965,7 +965,7 @@ void SkyMap::slewFocus( void ) { //we want to attach a label to the nearest object. if ( Options::useHoverLabel() ) HoverTimer.start( HOVER_INTERVAL, true ); - + forceUpdate(); } } @@ -985,7 +985,7 @@ double SkyMap::findPA( SkyObject *o, int x, int y, double scale ) { SkyPoint test( o->ra()->Hours(), newDec ); if ( Options::useAltAz() ) test.EquatorialToHorizontal( data->LST, data->geo()->lat() ); TQPoint t = getXY( &test, Options::useAltAz(), Options::useRefraction(), scale ); - double dx = double( t.x() - x ); + double dx = double( t.x() - x ); double dy = double( y - t.y() ); //backwards because TQWidget Y-axis increases to the bottom double north; if ( dy ) { @@ -1184,7 +1184,7 @@ void SkyMap::forceUpdate( bool now ) } float SkyMap::fov() { - if ( width() >= height() ) + if ( width() >= height() ) return 28.65*width()/Options::zoomFactor(); else return 28.65*height()/Options::zoomFactor(); @@ -1195,12 +1195,12 @@ bool SkyMap::checkVisibility( SkyPoint *p, float FOV, double XMax ) { bool useAltAz = Options::useAltAz(); //Skip objects below the horizon if: - // + usingQt::Horizontal coords, + // + using Horizontal coords, // + the ground is drawn, // + and either of the following is true: // - focus is above the horizon // - field of view is larger than 50 degrees - if ( useAltAz && Options::showGround() && p->alt()->Degrees() < -2.0 + if ( useAltAz && Options::showGround() && p->alt()->Degrees() < -2.0 && ( focus()->alt()->Degrees() > 0. || FOV > 50. ) ) return false; if ( useAltAz ) { @@ -1237,7 +1237,7 @@ bool SkyMap::unusablePoint (double dx, double dy) void SkyMap::setZoomMouseCursor() { mouseMoveCursor = false; // no mousemove cursor - + TQPainter p; TQPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems) // the center of the pixmap @@ -1262,7 +1262,7 @@ void SkyMap::setZoomMouseCursor() p.drawEllipse( mx - 7, my - 7, 14, 14 ); p.drawLine( mx + 5, my + 5, mx + 12, my + 12 ); p.end(); - + cursorPix.setMask (mask); // set the mask TQCursor cursor (cursorPix); setCursor (cursor); @@ -1271,7 +1271,7 @@ void SkyMap::setZoomMouseCursor() void SkyMap::setDefaultMouseCursor() { mouseMoveCursor = false; // no mousemove cursor - + TQPainter p; TQPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems) // the center of the pixmap diff --git a/kstars/kstars/skymap.h b/kstars/kstars/skymap.h index 5938afe1..3f199d7a 100644 --- a/kstars/kstars/skymap.h +++ b/kstars/kstars/skymap.h @@ -24,7 +24,7 @@ #include "skypoint.h" #include "starpixmap.h" -#define HOVER_INTERVAL 500 +#define HOVER_INTERVAL 500 class TQPainter; class TQPaintDevice; @@ -58,7 +58,7 @@ class DeepSkyObject; class SkyMap : public TQWidget { Q_OBJECT - + public: /** *Constructor. Read stored settings from TDEConfig object (focus position, @@ -84,7 +84,7 @@ public: */ void updateFocus(); -/**@short Retrieve the Focus point; the position on the sky at the +/**@short Retrieve the Focus point; the position on the sky at the *center of the skymap. *@return a pointer to the central focus point of the sky map */ @@ -93,7 +93,7 @@ public: /**@short retrieve the Destination position. * *The Destination is the point on the sky to which the focus will - *be moved. + *be moved. * *@return a pointer to the destination point of the sky map */ @@ -101,9 +101,9 @@ public: /**@short retrieve the FocusPoint position. * - *The FocusPoint stores the position on the sky that is to be - *focused next. This is not exactly the same as the Destination - *point, because when the Destination is set, it will begin slewing + *The FocusPoint stores the position on the sky that is to be + *focused next. This is not exactly the same as the Destination + *point, because when the Destination is set, it will begin slewing *immediately. * *@return a pointer to the sky point which is to be focused next. @@ -112,8 +112,8 @@ public: /**@short retrieve the last focus posiiton. * - *We store the previous focus point to determine how much the focus - *position has changed. + *We store the previous focus point to determine how much the focus + *position has changed. * *@return a pointer to the previous central focus point of the sky map */ @@ -126,7 +126,7 @@ public: /**@short sets the focus point of the skymap, using ra/dec coordinates * - *@note This function behaves essentially like the above function. + *@note This function behaves essentially like the above function. *It differs only in the data types of its arguments. * *@param ra the new right ascension @@ -136,7 +136,7 @@ public: /**@short sets the focus point of the sky map, using ra/dec coordinates * - *@note This function behaves essentially like the above function. + *@note This function behaves essentially like the above function. *It differs only in the data types of its arguments. * *@param ra the new right ascension @@ -152,7 +152,7 @@ public: /**@short sets the central focus point of the sky map, using alt/az coordinates * - *@note This function behaves essentially like the above function. + *@note This function behaves essentially like the above function. *It differs only in the data types of its arguments. * *@param alt the new altitude @@ -163,7 +163,7 @@ public: /**@short sets the destination point of the sky map. *@note setDestination() emits the destinationChanged() SIGNAL, *which triggers the TQT_SLOT function SkyMap::slewFocus(). This - *function iteratively steps the Focus point toward Destination, + *function iteratively steps the Focus point toward Destination, *repainting the sky at each step (if Options::useAnimatedSlewing()==true). *@param f a pointer to the SkyPoint the map should slew to */ @@ -171,7 +171,7 @@ public: /**@short sets the destination point of the skymap, using ra/dec coordinates. * - *@note This function behaves essentially like the above function. + *@note This function behaves essentially like the above function. *It differs only in the data types of its arguments. * *@param ra the new right ascension @@ -181,7 +181,7 @@ public: /**@short sets the destination point of the sky map, using ra/dec coordinates * - *@note This function behaves essentially like the above function. + *@note This function behaves essentially like the above function. *It differs only in the data types of its arguments. * *@param ra the new right ascension @@ -197,7 +197,7 @@ public: /**@short sets the destination point of the sky map, using its alt/az coordinates. * - *@note This function behaves essentially like the above function. + *@note This function behaves essentially like the above function. *It differs only in the data types of its arguments. * *@param alt the new altitude @@ -230,7 +230,7 @@ public: void setClickedPoint( SkyPoint *f ) { ClickedPoint.set( f->ra(), f->dec() ); } /**@short Retrieve the PreviousClickedPoint position. - *@return a pointer to PreviousClickedPoint, the sky coordinates of the + *@return a pointer to PreviousClickedPoint, the sky coordinates of the *penultimate mouse click. */ SkyPoint* previousClickedPoint() { return &PreviousClickedPoint; } @@ -243,32 +243,32 @@ public: /**@short Retrieve a pointer to MousePoint, the sky coordinates of the mouse cursor. * *When the user moves the mouse in the sky map, the sky coordinates of the mouse - *cursor are continually stored in MousePoint by the function mouseMoveEvent(). + *cursor are continually stored in MousePoint by the function mouseMoveEvent(). *@return a pointer to MousePoint, the current sky coordinates of the mouse cursor. */ SkyPoint* mousePoint() { return &MousePoint; } /**@short Set the MousePoint to the skypoint given as an argument. *@note In this function, the argument is a SkyPoint, not a pointer to a SkyPoint. - *This is because setMousePoint always uses the function dXdYToRaDec() for the + *This is because setMousePoint always uses the function dXdYToRaDec() for the *argument, and this function returns by value. *@param f the new MousePoint (typically the output of dXdYToRaDec()). */ void setMousePoint( SkyPoint f ) { MousePoint.set( f.ra(), f.dec() ); } - /**@short Attempt to find a named object near the SkyPoint argument. + /**@short Attempt to find a named object near the SkyPoint argument. * - *There is a object-type preference order for selecting among nearby objects: - *objects of a less-preferred type will be selected only if they are twice as close - *to the SkyPoint as the nearest object of a more-preferred type. The order (from - *most to least preferred) is: Solar System, custom object, Messier, - *NGC, IC, stars. If no named object was found within the zoom-dependent maximum + *There is a object-type preference order for selecting among nearby objects: + *objects of a less-preferred type will be selected only if they are twice as close + *to the SkyPoint as the nearest object of a more-preferred type. The order (from + *most to least preferred) is: Solar System, custom object, Messier, + *NGC, IC, stars. If no named object was found within the zoom-dependent maximum *search radius of about 4 pixels, then the function returns a NULL pointer. * - *@note This code used to be in mousePressEvent(), but now we need it in + *@note This code used to be in mousePressEvent(), but now we need it in *slotTransientLabel() and other parts of the code as well. *@param p pointer to the skypoint around which to search for an object. - *@return a pointer to the nearest named object to point p, or NULL if + *@return a pointer to the nearest named object to point p, or NULL if *no object was found. */ SkyObject* objectNearest( SkyPoint *p ); @@ -291,7 +291,7 @@ public: * *If the user centers the sky map on an object (by double-clicking or using the *Find Object dialog), a pointer to the "focused" object is stored in - *the private member FocusObject. This function returns a pointer to the + *the private member FocusObject. This function returns a pointer to the *FocusObject, or NULL if there is not FocusObject. *@return a pointer to the object at the center of the sky map. */ @@ -305,19 +305,19 @@ public: /**@short Retrieve the object nearest to the point at which the mouse has hovered. * *When the mouse hovers near an object, it is set as the TransientObject (so named - *because a transient name label will be attached to it). This function returns + *because a transient name label will be attached to it). This function returns *a pointer to the current TransientObject, or NULL if no TransientObject is set. *@return pointer to the SkyObject nearest to the mouse hover position. *@see SkyMap::slotTransientLabel() */ SkyObject* transientObject( void ) const { return TransientObject; } - + /**@short Set the TransientObject pointer to the argument. *@param o pointer to the SkyObject to be assigned as the TransientObject. */ void setTransientObject( SkyObject *o ) { TransientObject = o; } -/**@return the current setting of the color mode for stars (0=real colors, +/**@return the current setting of the color mode for stars (0=real colors, *1=solid red, 2=solid white or 3=solid black). */ int starColorMode( void ) const { return starpix->mode(); } @@ -329,7 +329,7 @@ public: /**@short Retrieve the color-intensity value for stars. * - *When using the "realistic colors" mode for stars, stars are rendered as + *When using the "realistic colors" mode for stars, stars are rendered as *white circles with a colored border. The "color intensity" setting modulates *the relative thickness of this colored border, so it effectively adjusts *the color-saturation level for star images. @@ -339,7 +339,7 @@ public: /**@short Sets the color-intensity value for stars. * - *When using the "realistic colors" mode for stars, stars are rendered as + *When using the "realistic colors" mode for stars, stars are rendered as *white circles with a colored border. The "color intensity" setting modulates *the relative thickness of this colored border, so it effectively adjusts *the color-saturation level for star images. @@ -348,7 +348,7 @@ public: /**@short set up variables for the checkVisibility function. * - *checkVisibility() uses some variables to assist it in determining whether points are + *checkVisibility() uses some variables to assist it in determining whether points are *on-screen or not. The values of these variables do not depend on which object is being tested, *so we save a lot of time by bringing the code which sets their values outside of checkVisibility() *(which must be run for each and every SkyPoint). setMapGeometry() is called once in paintEvent(). @@ -365,7 +365,7 @@ public: /**@short Call keyPressEvent, as if the key given as an argument had been pressed. */ void invokeKey( int key ); -/**@return true if the angular distance measuring mode is on +/**@return true if the angular distance measuring mode is on */ bool isAngleMode() const {return angularDistanceMode;} @@ -388,9 +388,9 @@ public: /**@short Draw the current Sky map to a pixmap which is to be printed or exported to a file. * - *Each of the draw functions is called, with a value for the Scale parameter computed to fit the + *Each of the draw functions is called, with a value for the Scale parameter computed to fit the *geometry of the TQPaintDevice. - *@param pd pointer to the TQPaintDevice on which to draw. + *@param pd pointer to the TQPaintDevice on which to draw. *@see KStars::slotExportImage() *@see KStars::slotPrint() */ @@ -400,7 +400,7 @@ public slots: /**@short This overloaded function is used internally to resize the Sky pixmap to match the window size. */ virtual void setGeometry( int x, int y, int w, int h ); - + /**@short This overloaded function is used internally to resize the Sky pixmap to match the window size. * *This function behaves essentially like the above function. It differs only in the data types *of its arguments. @@ -419,13 +419,13 @@ public slots: */ void forceUpdateNow() { forceUpdate( true ); } -/**Estimate the effect of atmospheric refraction on object positions. Refraction - *affects only the Altitude angle of objects. Also, the correction should not be applied +/**Estimate the effect of atmospheric refraction on object positions. Refraction + *affects only the Altitude angle of objects. Also, the correction should not be applied *to the horizon, which is not beyond the atmosphere. * *To estimate refraction, we use a simple analytic equation. To save time, we store - *values of the correction for 0.5-degree Altitude intervals. Individual objects are then - *simply assigned the nearest stored value. The precaclulated values are stored in the + *values of the correction for 0.5-degree Altitude intervals. Individual objects are then + *simply assigned the nearest stored value. The precaclulated values are stored in the *RefractCorr1 and RefractCorr2 arrays, and these are initialized in the SkyMap constructor. * *There are two cases: the true altitude is known, and the apparent altitude is needed; @@ -436,17 +436,17 @@ public slots: */ dms refract( const dms *alt, bool findApparent ); -/**Step the Focus point toward the Destination point. Do this iteratively, redrawing the Sky +/**Step the Focus point toward the Destination point. Do this iteratively, redrawing the Sky *Map after each step, until the Focus point is within 1 step of the Destination point. *For the final step, snap directly to Destination, and redraw the map. */ void slewFocus( void ); -/**@short Center the display at the point ClickedPoint. +/**@short Center the display at the point ClickedPoint. * - *The essential part of the function is to simply set the Destination point, which will emit + *The essential part of the function is to simply set the Destination point, which will emit *the destinationChanged() SIGNAL, which triggers the slewFocus() SLOT. Additionally, this - *function performs some bookkeeping tasks, such updating whether we are tracking the new + *function performs some bookkeeping tasks, such updating whether we are tracking the new *object/position, adding a Planet Trail if required, etc. * *@see destinationChanged() @@ -454,38 +454,38 @@ public slots: */ void slotCenter( void ); -/**@short Popup menu function: Display 1st-Generation DSS image with the Image Viewer. +/**@short Popup menu function: Display 1st-Generation DSS image with the Image Viewer. *@note the URL is generated using the coordinates of ClickedPoint. */ void slotDSS( void ); -/**@short Popup menu function: Display 2nd-Generation DSS image with the Image Viewer. +/**@short Popup menu function: Display 2nd-Generation DSS image with the Image Viewer. *@note the URL is generated using the coordinates of ClickedPoint. */ void slotDSS2( void ); -/**@short Popup menu function: Show webpage about ClickedObject - *(only available for some objects). +/**@short Popup menu function: Show webpage about ClickedObject + *(only available for some objects). *@param id the popup-menu ID entry of the selected information page */ void slotInfo( int id ); -/**@short Popup menu function: Show image of ClickedObject - *(only available for some objects). +/**@short Popup menu function: Show image of ClickedObject + *(only available for some objects). *@param id the popup-menu ID entry of the selected image */ void slotImage( int id ); -/**@short Popup menu function: Show the Detailed Information window for ClickedObject. +/**@short Popup menu function: Show the Detailed Information window for ClickedObject. */ void slotDetail( void ); -/**Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which +/**Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which *have User Labels attached. */ void slotAddObjectLabel( void ); -/**Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which +/**Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which *have User Labels attached. */ void slotRemoveObjectLabel( void ); @@ -497,7 +497,7 @@ public slots: *@see KSPlanetBase::addToTrail() */ void slotAddPlanetTrail( void ); - + /**@short Remove the PlanetTrail from ClickedObject. *@note The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as *the trail is empty, no new points will be automatically appended. @@ -505,26 +505,26 @@ public slots: */ void slotRemovePlanetTrail( void ); -/**Popup menu function: Add a custom Image or Information URL. +/**Popup menu function: Add a custom Image or Information URL. *Opens the AddLinkDialog window. */ void addLink( void ); /**Checks whether the timestep exceeds a threshold value. If so, sets - *ClockSlewing=true and sets the SimClock to ManualMode. + *ClockSlewing=true and sets the SimClock to ManualMode. */ void slotClockSlewing(); -/**Enables the angular distance measuring mode. It saves the first +/**Enables the angular distance measuring mode. It saves the first *position of the ruler in a SkyPoint. It makes difference between *having clicked on the skymap and not having done so */ void slotBeginAngularDistance(void); -/**Computes the angular distance, prints the result in the status +/**Computes the angular distance, prints the result in the status *bar and disables the angular distance measuring mode - *If the user has clicked on the map the status bar shows the - *name of the clicked object plus the angular distance. If - *the user did not clicked on the map, just pressed ], only + *If the user has clicked on the map the status bar shows the + *name of the clicked object plus the angular distance. If + *the user did not clicked on the map, just pressed ], only *the angular distance is printed */ void slotEndAngularDistance(void); @@ -533,15 +533,15 @@ public slots: void slotCancelAngularDistance(void); signals: -/**Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination - *point is changed, slewFocus() will iteratively step the Focus toward Destination +/**Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination + *point is changed, slewFocus() will iteratively step the Focus toward Destination *until it is reached. *@see SkyMap::setDestination() *@see SkyMap::slewFocus() */ void destinationChanged(); - -/**Emitted by SkyMap::addLink(). This Signal is used to inform the Details Dialog + +/**Emitted by SkyMap::addLink(). This Signal is used to inform the Details Dialog *that it needs to update its lists of URL links. */ void linkAdded(); @@ -550,12 +550,12 @@ protected: /**Draw the Sky, and all objects in it. */ virtual void paintEvent( TQPaintEvent *e ); -/**Process keystrokes: +/**Process keystrokes: *@li arrow keys Slew the map - *@li +/- keys Zoom in and out + *@li +/- keys Zoom in and out *@li N/E/S/W keys Go to the cardinal points on the Horizon *@li Z Go to the Zenith - *@li Space Toggle betweenQt::Horizontal and Equatorial coordinate systems + *@li Space Toggle between Horizontal and Equatorial coordinate systems *@li 0-9 Go to a major Solar System body (0=Sun; 1-9 are the major planets, except 3=Moon) *@li [ Place starting point for measuring an angular distance *@li ] End point for Angular Distance; display measurement. @@ -572,7 +572,7 @@ protected: /**Determine RA, Dec coordinates of clicked location. Find the SkyObject *which is nearest to the clicked location. * - *If left-clicked: Set set mouseButtonDown==true, slewing==true; display + *If left-clicked: Set set mouseButtonDown==true, slewing==true; display *nearest object name in status bar. *If right-clicked: display popup menu appropriate for nearest object. */ @@ -588,10 +588,10 @@ protected: *@li If Angle-measurement mode is active, update the end-ruler point to the mouse cursor, *and continue this function. *@li If we are dragging an InfoBox, simply redraw the screen and return. - *@li If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen, + *@li If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen, *and return. - *@li If dragging the mouse in the map, update focus such that RA, Dec under the mouse - *cursor remains constant. + *@li If dragging the mouse in the map, update focus such that RA, Dec under the mouse + *cursor remains constant. *@li If just moving the mouse, simply update the curso coordinates in the status bar. */ virtual void mouseMoveEvent( TQMouseEvent *e ); @@ -599,25 +599,25 @@ protected: /**Zoom in and out with the mouse wheel. */ virtual void wheelEvent( TQWheelEvent *e ); -/**If the skymap will be resized, the sky must be new computed. So this +/**If the skymap will be resized, the sky must be new computed. So this *function calls explicitly new computing of the skymap. - *It also repositions the InfoBoxes, if they are anchored to a window edge. + *It also repositions the InfoBoxes, if they are anchored to a window edge. */ virtual void resizeEvent( TQResizeEvent * ); private slots: /**Gradually fade the Transient Hover Label into the background sky color, and - *redraw the screen after each color change. Once it has faded fully, set the + *redraw the screen after each color change. Once it has faded fully, set the *TransientObject pointer to NULL to remove the label. */ void slotTransientTimeout(); /**@short attach transient label to object nearest the mouse cursor. *This slot is connected to the timeout() signal of the HoverTimer, which is restarted - *in every mouseMoveEvent(). So this slot is executed only if the mouse does not move for - *HOVER_INTERVAL msec. It points TransientObject at the SkyObject nearest the + *in every mouseMoveEvent(). So this slot is executed only if the mouse does not move for + *HOVER_INTERVAL msec. It points TransientObject at the SkyObject nearest the *mouse cursor, and the TransientObject is subsequently labeled in paintEvent(). - *Note that when TransientObject is not NULL, the next mouseMoveEvent() calls + *Note that when TransientObject is not NULL, the next mouseMoveEvent() calls *fadeTransientLabel(), which fades the label color and then sets TransientLabel to NULL. *@sa mouseMoveEvent(), paintEvent(), slotTransientTimeout(), fadeTransientLabel() */ @@ -628,7 +628,7 @@ private slots: private: // Drawing functions. Each takes a TQPainter reference and a scaling factor as arguments. -// The TQPainter is usually the Sky pixmap, but it can also be the Export-to-Image pixmap, or the +// The TQPainter is usually the Sky pixmap, but it can also be the Export-to-Image pixmap, or the // Printer device. The scaling factors are 1.0 by default (for screen images). The scale factor // is used to resize the image to fit the page when printing or exporting to a file. @@ -637,56 +637,56 @@ private: *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawMilkyWay( TQPainter& psky, double scale = 1.0 ); - + /**@short Draw the coordinate system grid lines. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawCoordinateGrid( TQPainter& psky, double scale = 1.0 ); - + /**@short Draw the Celestial Equator line. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawEquator( TQPainter& psky, double scale = 1.0 ); - + /**@short Draw the Ecliptic line. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawEcliptic( TQPainter& psky, double scale = 1.0 ); - + /**@short Draw the Horizon Line, the compass point labels, and the opaque ground. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - + void drawHorizon( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Constellation Lines. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawConstellationLines( TQPainter& psky, double scale = 1.0 ); - + /**@short Draw the Constellation Boundaries. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawConstellationBoundaries( TQPainter& psky, double scale = 1.0 ); - + /**@short Draw the Constellation Names. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawConstellationNames( TQPainter& psky, double scale = 1.0 ); - + /**@short Draw the Stars. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawStars( TQPainter& psky, double scale = 1.0 ); - -/**@short Draw the Deep-Sky Objects. + +/**@short Draw the Deep-Sky Objects. * *Calls drawDeepSkyCatalog() for each catalog (Messier/NGC/IC/Custom) *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) @@ -694,7 +694,7 @@ private: *@see SkyMap::drawDeepSkyCatalog() */ void drawDeepSkyObjects( TQPainter& psky, double scale = 1.0 ); - + /**@short Draw a Deep-Sky Catalog. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param catalog List of pointers to the objects in a particular deep-sky catalog. @@ -704,7 +704,7 @@ private: *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawDeepSkyCatalog( TQPainter& psky, TQPtrList& catalog, TQColor& color, bool drawObject, bool drawImage, double scale = 1.0 ); - + /**@short Draw the Planet Trails. * *"Planet Trails" can be attached to any solar system body; they are lists of SkyPoints @@ -714,23 +714,23 @@ private: *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawPlanetTrail( TQPainter& psky, KSPlanetBase *ksp, double scale = 1.0 ); - + /**@short Draw all solar system bodies: Sun, Moon, 8 planets, comets, asteroids. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param drawPlanets if FALSE, do nothing *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawSolarSystem( TQPainter& psky, bool drawPlanets, double scale = 1.0 ); - -/**@short Draw "User Labels". User labels are name labels attached to objects manually with + +/**@short Draw "User Labels". User labels are name labels attached to objects manually with *the right-click popup menu. Also adds a label to the FocusObject if the Option UseAutoLabel *is TRUE. *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ void drawAttachedLabels( TQPainter &psky, double scale = 1.0 ); - -/**@short Attach a name label to a SkyObject. This Function is called by the object-specific + +/**@short Attach a name label to a SkyObject. This Function is called by the object-specific *draw functions and also by drawAttachedLabels(). *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param obj pointer to the SkyObject which is to be labeled. @@ -745,19 +745,19 @@ private: /**Draw a planet. This is an image if the planet image is loaded, the zoomlevel *is high enough (but not so high that the image fills the screen), and the *user has selected that planet images be shown. If one of these conditions - *is false, then a simple colored circle is drawn instead. + *is false, then a simple colored circle is drawn instead. *@param psky reference to the TQPainter on which to draw *@param p pointer to the KSPlanetBase to be drawn *@param c the color of the circle to be used if not plotting an image of the planet *@param zoommin the minimum zoomlevel for drawing the planet image - *@param resize_mult scale factor for angular size of planet. This is used only for Saturn, - *because its image includes the Rings, which are not included in its angular size measurement. + *@param resize_mult scale factor for angular size of planet. This is used only for Saturn, + *because its image includes the Rings, which are not included in its angular size measurement. *(there's probably a better way to handle this) *@param scale the scale factor used for printing the sky image. */ void drawPlanet(TQPainter &psky, KSPlanetBase *p, TQColor c, double zoommin, int resize_mult = 1, double scale = 1.0 ); - + /**Draw the overlays on top of the sky map. These include the infoboxes, *field-of-view indicator, telescope symbols, zoom box and any other *user-interaction graphics. @@ -768,21 +768,21 @@ private: *@param pm pointer to the Sky pixmap */ void drawOverlays( TQPixmap *pm ); - + /**Draw the Focus, Geo and Time InfoBoxes. This is called by drawOverlays(). *@param p reference to the TQPainter on which to draw (this should be the Sky pixmap). *@note there is no scale factor because this is only used for drawing onto the screen, not printing. *@see SkyMap::drawOverlays() */ void drawBoxes( TQPainter &p ); - + /**Draw symbols at the position of each Telescope currently being controlled by KStars. *@note The shape of the Telescope symbol is currently a hard-coded bullseye. *@note there is no scale factor because this is only used for drawing onto the screen, not printing. - *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). + *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). */ void drawTelescopeSymbols(TQPainter &psky); - + /**@short Draw symbols for objects in the observing list. *@param psky reference to the TQPainter on which to draw (this should be the sky pixmap) *@note there is no scale factor because this is only used for drawing onto the screen, not printing. @@ -790,14 +790,14 @@ private: void drawObservingList( TQPainter &psky, double scale = 1.0 ); /**Draw a dotted-line rectangle which traces the potential new field-of-view in ZoomBox mode. - *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). + *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). *@note there is no scale factor because this is only used for drawing onto the screen, not printing. */ void drawZoomBox( TQPainter &psky); - -/**Draw the current TransientLabel. TransientLabels are triggered when the mouse + +/**Draw the current TransientLabel. TransientLabels are triggered when the mouse *hovers on an object. - *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). + *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). *@note there is no scale factor because this is only used for drawing onto the screen, not printing. *@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout() */ @@ -805,7 +805,7 @@ private: /**Draw a dashed line from the Angular-Ruler start point to the current mouse cursor, *when in Angular-Ruler mode. - *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). + *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). *@note there is no scale factor because this is only used for drawing onto the screen, not printing. */ void drawAngleRuler( TQPainter &psky ); @@ -825,7 +825,7 @@ private: *screen pixel coordinate offsets from the center of the Sky pixmap. *@param dx horizontal pixel offset from center of SkyMap. *@param dy vertical pixel offset from center of SkyMap. - *@param Horiz if TRUE, the SkyMap is displayed using theQt::Horizontal coordinate system + *@param Horiz if TRUE, the SkyMap is displayed using the Horizontal coordinate system *@param LSTh pointer to the local sidereal time, as a dms object. *@param lat pointer to the current geographic laitude, as a dms object *@param doRefraction if TRUE, correct for atmospheric refraction @@ -833,43 +833,43 @@ private: SkyPoint dXdYToRaDec( double dx, double dy, bool Horiz, dms *LST, const dms *lat, bool doRefraction=true ); /**@return the angular field of view of the sky map, in degrees. - *@note it must use either the height or the width of the window to calculate the + *@note it must use either the height or the width of the window to calculate the *FOV angle. It chooses whichever is larger. */ float fov(); -/**@short Determine if the skypoint p is likely to be visible in the display +/**@short Determine if the skypoint p is likely to be visible in the display *window. * *checkVisibility() is an optimization function. It determines whether an object *appears within the bounds of the skymap window, and therefore should be drawn. - *The idea is to save time by skipping objects which are off-screen, so it is + *The idea is to save time by skipping objects which are off-screen, so it is *absolutely essential that checkVisibility() is significantly faster than *the computations required to draw the object to the screen. * *The function first checks the difference between the Declination/Altitude - *coordinate of the Focus position, and that of the point p. If the absolute + *coordinate of the Focus position, and that of the point p. If the absolute *value of this difference is larger than fov, then the function returns FALSE. - *For most configurations of the sky map window, this simple check is enough to + *For most configurations of the sky map window, this simple check is enough to *exclude a large number of objects. * - *Next, it determines if one of the poles of the current Coordinate System - *(Equatorial orQt::Horizontal) is currently inside the sky map window. This is - *stored in the member variable 'bool SkyMap::isPoleVisible, and is set by the + *Next, it determines if one of the poles of the current Coordinate System + *(Equatorial or Horizontal) is currently inside the sky map window. This is + *stored in the member variable 'bool SkyMap::isPoleVisible, and is set by the *function SkyMap::setMapGeometry(), which is called by SkyMap::paintEvent(). *If a Pole is visible, then it will return TRUE immediately. The idea is that - *when a pole is on-screen it is computationally expensive to determine whether - *a particular position is on-screen or not: for many valid Dec/Alt values, *all* - *values of RA/Az will indeed be onscreen, but for other valid Dec/Alt values, - *only *most* RA/Az values are onscreen. It is cheaper to simply accept all - *"horizontal" RA/Az values, since we have already determined that they are + *when a pole is on-screen it is computationally expensive to determine whether + *a particular position is on-screen or not: for many valid Dec/Alt values, *all* + *values of RA/Az will indeed be onscreen, but for other valid Dec/Alt values, + *only *most* RA/Az values are onscreen. It is cheaper to simply accept all + *"horizontal" RA/Az values, since we have already determined that they are *on-screen in the "vertical" Dec/Alt coordinate. * - *Finally, if no Pole is onscreen, it checks the difference between the Focus - *position's RA/Az coordinate and that of the point p. If the absolute value of + *Finally, if no Pole is onscreen, it checks the difference between the Focus + *position's RA/Az coordinate and that of the point p. If the absolute value of *this difference is larger than XMax, the function returns FALSE. Otherwise, *it returns TRUE. - + *@param p pointer to the skypoint to be checked. *@param fov the vertical center-to-edge angle of the window, in degrees *@param XMax the horizontal center-to-edge angle of the window, in degrees @@ -881,12 +881,12 @@ private: /**@short Begin fading out the name label attached to TransientObject. * - *mouseMoveEvent() will call fadeTransientLabel() when TransientObject is not a - *NULL pointer, and the TransientTimer is not already active. These conditions - *are met when the mouse did not move for HOVER_INTERVAL msec (triggering a - *TransientLabel), but the mouse has since been moved, thus ending the Hover event. - *This function merely starts the TransientTimer, whose timeout TQT_SIGNAL is - *connected to the slotTransientTimeout() SLOT, which handles the actual fading + *mouseMoveEvent() will call fadeTransientLabel() when TransientObject is not a + *NULL pointer, and the TransientTimer is not already active. These conditions + *are met when the mouse did not move for HOVER_INTERVAL msec (triggering a + *TransientLabel), but the mouse has since been moved, thus ending the Hover event. + *This function merely starts the TransientTimer, whose timeout TQT_SIGNAL is + *connected to the slotTransientTimeout() SLOT, which handles the actual fading *of the transient label, and eventually resets TransientObject to NULL. *@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout() */ @@ -894,24 +894,24 @@ private: /**Determine the on-screen position angle of a SkyObject. This is the sum *of the object's sky position angle (w.r.t. North), and the position angle - *of "North" at the position of the object (w.r.t. the screen Y-axis). - *The latter is determined by constructing a test point with the same RA but - *a slightly increased Dec as the object, and calculating the angle w.r.t. the - *Y-axis of the line connecing the object to its test point. + *of "North" at the position of the object (w.r.t. the screen Y-axis). + *The latter is determined by constructing a test point with the same RA but + *a slightly increased Dec as the object, and calculating the angle w.r.t. the + *Y-axis of the line connecing the object to its test point. */ double findPA( SkyObject *o, int x, int y, double scale=1.0 ); -/**@short Sets the shape of the default mouse cursor to a cross. +/**@short Sets the shape of the default mouse cursor to a cross. */ void setDefaultMouseCursor(); -/**@short Sets the shape of the mouse cursor to a magnifying glass. +/**@short Sets the shape of the mouse cursor to a magnifying glass. */ void setZoomMouseCursor(); /**Check if the current point on screen is a valid point on the sky. This is needed *to avoid a crash of the program if the user clicks on a point outside the sky (the - *corners of the sky map at the lowest zoom level are the invalid points). + *corners of the sky map at the lowest zoom level are the invalid points). *@param dx the screen pixel X-coordinate, relative to the screen center *@param dy the screen pixel Y-coordinate, relative to the screen center */ @@ -936,7 +936,7 @@ private: double guideXRange; TQString sURL; - + KStars *ksw; KStarsData *data; KSPopupMenu *pmenu; diff --git a/kstars/kstars/skypoint.h b/kstars/kstars/skypoint.h index 5c4c24e6..7b91c295 100644 --- a/kstars/kstars/skypoint.h +++ b/kstars/kstars/skypoint.h @@ -29,7 +29,7 @@ * *The sky coordinates of a point in the sky. The *coordinates are stored in both Equatorial (Right Ascension, - *Declination) andQt::Horizontal (Azimuth, Altitude) coordinate systems. + *Declination) and Horizontal (Azimuth, Altitude) coordinate systems. *Provides set/get functions for each coordinate angle, and functions *to convert between the Equatorial and Horizon coordinate systems. * @@ -321,7 +321,7 @@ public: */ void precessFromAnyEpoch(long double jd0, long double jdf); - /** Determine the E-terms of aberration + /** Determine the E-terms of aberration *In the past, the mean places of stars published in catalogs included *the contribution to the aberration due to the ellipticity of the orbit *of the Earth. These terms, known as E-terms were almost constant, and @@ -330,8 +330,8 @@ public: */ SkyPoint Eterms(void); - /** Exact precession from Besselian epoch 1950 to epoch J2000. The - *coordinates referred to the first epoch are in the + /** Exact precession from Besselian epoch 1950 to epoch J2000. The + *coordinates referred to the first epoch are in the FK4 catalog, while the latter are in the Fk5 one. *Reference: Smith, C. A.; Kaplan, G. H.; Hughes, J. A.; Seidelmann, *P. K.; Yallop, B. D.; Hohenkerk, C. Y. @@ -345,7 +345,7 @@ public: void B1950ToJ2000(void); /** Exact precession from epoch J2000 Besselian epoch 1950. The coordinates - *referred to the first epoch are in the FK4 catalog, while the + *referred to the first epoch are in the FK4 catalog, while the *latter are in the Fk5 one. *Reference: Smith, C. A.; Kaplan, G. H.; Hughes, J. A.; Seidelmann, *P. K.; Yallop, B. D.; Hohenkerk, C. Y. @@ -366,9 +366,9 @@ public: void addEterms(void); /** Coordinates in the FK4 catalog include the effect of aberration due - *to the ellipticity of the orbit of the Earth. Coordinates in the FK5 - *catalog do not include these terms. In order to convert from - * FK5 coordinates to B1950 (FK4) one has to use this function. + *to the ellipticity of the orbit of the Earth. Coordinates in the FK5 + *catalog do not include these terms. In order to convert from + * FK5 coordinates to B1950 (FK4) one has to use this function. */ void subtractEterms(void); @@ -379,7 +379,7 @@ public: * the coordinates of the second object. * However this algorithm is not accurate when the angular separation * is small. - * Meeus provides a different algorithm in page 111 which we + * Meeus provides a different algorithm in page 111 which we * implement here. * @param sp SkyPoint to which distance is to be calculated * @return dms angle representing angular separation. @@ -388,7 +388,7 @@ public: dms angularDistanceTo( SkyPoint *sp); bool operator == ( SkyPoint &p ) { return ( ra()->Degrees() == p.ra()->Degrees() && dec()->Degrees() == p.dec()->Degrees() ); } - + /** Computes the velocity of the Sun projected on the direction of the source. * * @param jd Epoch expressed as julian day to which the source coordinates refer to. @@ -396,7 +396,7 @@ public: **/ double vRSun(long double jd); - /** Computes the radial velocity of a source referred to the solar system barycenter + /** Computes the radial velocity of a source referred to the solar system barycenter * from the radial velocity referred to the * Local Standard of Rest, aka known as VLSR. To compute it we need the coordinates of the * source the VLSR and the epoch for the source coordinates. @@ -408,7 +408,7 @@ public: double vHeliocentric(double vlsr, long double jd); /** Computes the radial velocity of a source referred to the Local Standard of Rest, also known as VLSR - * from the radial velocity referred to the solar system barycenter + * from the radial velocity referred to the solar system barycenter * * @param vhelio radial velocity of the source referred to the LSR in km/s * @param jd Epoch expressed as julian day to which the source coordinates refer to. @@ -421,19 +421,19 @@ public: * @return velocity of the Earth projected on the direction of the source kms-1 */ double vREarth(long double jd0); - - /** Computes the radial velocity of a source referred to the center of the earth + + /** Computes the radial velocity of a source referred to the center of the earth * from the radial velocity referred to the solar system barycenter * - * @param vhelio radial velocity of the source referred to the barycenter of the + * @param vhelio radial velocity of the source referred to the barycenter of the * solar system in km/s * @param jd Epoch expressed as julian day to which the source coordinates refer to. * @return Radial velocity of the source referred to the center of the Earth in km/s **/ double vGeocentric(double vhelio, long double jd); - /** Computes the radial velocity of a source referred to the solar system barycenter - * from the velocity referred to the center of the earth + /** Computes the radial velocity of a source referred to the solar system barycenter + * from the velocity referred to the center of the earth * * @param vgeo radial velocity of the source referred to the center of the Earth * [km/s] @@ -442,7 +442,7 @@ public: **/ double vGeoToVHelio(double vgeo, long double jd); - /** Computes the velocity of any object (oberver's site) projected on the + /** Computes the velocity of any object (oberver's site) projected on the * direction of the source. * @param vsite velocity of that object in cartesian coordinates * @return velocity of the object projected on the direction of the source kms-1 @@ -459,9 +459,9 @@ public: **/ double vTopocentric(double vgeo, double vsite[3]); - /** Computes the radial velocity of a source referred to the center of the Earth from - * the radial velocity referred to an observer site on the surface of the earth - * + /** Computes the radial velocity of a source referred to the center of the Earth from + * the radial velocity referred to an observer site on the surface of the earth + * * @param vtopo radial velocity of the source referred to the observer's site in km/s * @param vsite Velocity at which the observer moves referred to the center of the earth. * @return Radial velocity of the source referred the center of the earth in km/s diff --git a/kstars/kstars/tools/argsetaltaz.ui b/kstars/kstars/tools/argsetaltaz.ui index 7c22bea4..dc0db4a9 100644 --- a/kstars/kstars/tools/argsetaltaz.ui +++ b/kstars/kstars/tools/argsetaltaz.ui @@ -45,7 +45,7 @@ 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. +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. diff --git a/kstars/kstars/tools/observinglist.cpp b/kstars/kstars/tools/observinglist.cpp index 025fb574..e67f933c 100644 --- a/kstars/kstars/tools/observinglist.cpp +++ b/kstars/kstars/tools/observinglist.cpp @@ -54,8 +54,8 @@ #include "indistd.h" ObservingList::ObservingList( KStars *_ks, TQWidget* parent ) - : KDialogBase( KDialogBase::Plain, i18n( "Observing List" ), - Close, Close, parent, "observinglist", false ), ks( _ks ), LogObject(0), oCurrent(0), + : KDialogBase( KDialogBase::Plain, i18n( "Observing List" ), + Close, Close, parent, "observinglist", false ), ks( _ks ), LogObject(0), oCurrent(0), noNameStars(0), isModified(false), bIsLarge(true) { TQFrame *page = plainPage(); @@ -68,28 +68,28 @@ ObservingList::ObservingList( KStars *_ks, TQWidget* parent ) //Connections connect( this, TQT_SIGNAL( closeClicked() ), this, TQT_SLOT( slotClose() ) ); - connect( ui->TableStack, TQT_SIGNAL( aboutToShow( TQWidget* ) ), + connect( ui->TableStack, TQT_SIGNAL( aboutToShow( TQWidget* ) ), this, TQT_SLOT( slotPrepTable( TQWidget* ) ) ); - connect( ui->FullTable, TQT_SIGNAL( selectionChanged() ), + connect( ui->FullTable, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotNewSelection() ) ); - connect( ui->TinyTable, TQT_SIGNAL( selectionChanged() ), + connect( ui->TinyTable, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotNewSelection() ) ); - connect( ui->FullTable, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int) ), + connect( ui->FullTable, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int) ), this, TQT_SLOT( slotCenterObject() ) ); - connect( ui->TinyTable, TQT_SIGNAL( doubleClicked( TQListBoxItem* ) ), + connect( ui->TinyTable, TQT_SIGNAL( doubleClicked( TQListBoxItem* ) ), this, TQT_SLOT( slotCenterObject() ) ); - connect( ui->RemoveButton, TQT_SIGNAL( clicked() ), + connect( ui->RemoveButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveObjects() ) ); - connect( ui->CenterButton, TQT_SIGNAL( clicked() ), + connect( ui->CenterButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotCenterObject() ) ); - connect( ui->ScopeButton, TQT_SIGNAL( clicked() ), + connect( ui->ScopeButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSlewToObject() ) ); - connect( ui->DetailsButton, TQT_SIGNAL( clicked() ), + connect( ui->DetailsButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotDetails() ) ); - connect( ui->AVTButton, TQT_SIGNAL( clicked() ), + connect( ui->AVTButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAVT() ) ); - connect( ui->OpenButton, TQT_SIGNAL( clicked() ), + connect( ui->OpenButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotOpenList() ) ); connect( ui->SaveButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSaveList() ) ); @@ -103,7 +103,7 @@ ObservingList::ObservingList( KStars *_ks, TQWidget* parent ) // this, TQT_SLOT( slotToggleSize() ) ); obsList.setAutoDelete( false ); //do NOT delete removed pointers! - + //Add icons to Push Buttons TDEIconLoader *icons = TDEGlobal::iconLoader(); ui->OpenButton->setPixmap( icons->loadIcon( "document-open", TDEIcon::Toolbar ) ); @@ -151,12 +151,12 @@ void ObservingList::slotAddObject( SkyObject *obj ) { //Insert object in obsList obsList.append( obj ); - if ( ! isModified ) isModified = true; + if ( ! isModified ) isModified = true; //Insert object entry in FullTable and TinyTable TQString smag("--"); if ( obj->mag() < 90.0 ) smag = TQString::number( obj->mag(), 'g', 2 ); - new TDEListViewItem( ui->FullTable, obj->translatedName(), + new TDEListViewItem( ui->FullTable, obj->translatedName(), obj->ra()->toHMSString(), obj->dec()->toDMSString(), smag, @@ -168,15 +168,15 @@ void ObservingList::slotAddObject( SkyObject *obj ) { } void ObservingList::slotRemoveObject( SkyObject *o ) { - if ( !o ) + if ( !o ) o = ks->map()->clickedObject(); - + obsList.remove(o); if ( ! isModified ) isModified = true; - if ( o == LogObject ) + if ( o == LogObject ) saveCurrentUserLog(); - + //Remove entry from FullTable bool objectFound = false; TQListViewItemIterator it( ui->FullTable ); @@ -185,7 +185,7 @@ void ObservingList::slotRemoveObject( SkyObject *o ) { //If the object is named "star" then match coordinates instead of name if ( o->translatedName() == i18n( "star" ) ) { - if ( item->text(1) == o->ra()->toHMSString() + if ( item->text(1) == o->ra()->toHMSString() && item->text(2) == o->dec()->toDMSString() ) { delete item; objectFound = true; @@ -214,8 +214,8 @@ void ObservingList::slotRemoveObject( SkyObject *o ) { void ObservingList::slotRemoveObjects() { if ( SelectedObjects.count() == 0) return; - - for ( SkyObject *o = SelectedObjects.first(); o; o = SelectedObjects.next() ) + + for ( SkyObject *o = SelectedObjects.first(); o; o = SelectedObjects.next() ) slotRemoveObject( o ); slotNewSelection(); @@ -231,7 +231,7 @@ void ObservingList::slotNewSelection() { while ( it.current() ) { for ( SkyObject *o = obsList.first(); o; o = obsList.next() ) { if ( it.current()->text(0) == i18n("star") ) { - if ( it.current()->text(1) == o->ra()->toHMSString() + if ( it.current()->text(1) == o->ra()->toHMSString() && it.current()->text(2) == o->dec()->toDMSString() ) { SelectedObjects.append(o); break; @@ -243,19 +243,19 @@ void ObservingList::slotNewSelection() { } it++; } - + //Enable widgets when one object selected if ( SelectedObjects.count() == 1 ) { TQString newName( SelectedObjects.first()->translatedName() ); TQString oldName( obsList.current()->translatedName() ); - + //Enable buttons ui->CenterButton->setEnabled( true ); ui->ScopeButton->setEnabled( true ); ui->DetailsButton->setEnabled( true ); ui->AVTButton->setEnabled( true ); ui->RemoveButton->setEnabled( true ); - + //Find the selected object in the obsList, //then break the loop. Now obsList.current() //points to the new selected object (until now it was the previous object) @@ -267,19 +267,19 @@ void ObservingList::slotNewSelection() { } } - if ( ! found ) { + if ( ! found ) { kdDebug() << i18n( "Object %1 not found in obsList." ).arg( newName ) << endl; } else if ( newName != i18n( "star" ) ) { //Display the object's current user notes in the NotesEdit //First, save the last object's user log to disk, if necessary saveCurrentUserLog(); - + //set LogObject to the new selected object LogObject = obsList.current(); - + ui->NotesLabel->setEnabled( true ); ui->NotesEdit->setEnabled( true ); - + ui->NotesLabel->setText( i18n( "observing notes for %1:" ).arg( LogObject->translatedName() ) ); if ( LogObject->userLog.isEmpty() ) { ui->NotesEdit->setText( i18n("Record here observation logs and/or data on %1.").arg( LogObject->translatedName() ) ); @@ -293,8 +293,8 @@ void ObservingList::slotNewSelection() { ui->NotesEdit->setEnabled( false ); } - //This shouldn't be necessary. For some reason, obsList.current() - //is valid here, but in subsequent functions (such as slotCenterObject) + //This shouldn't be necessary. For some reason, obsList.current() + //is valid here, but in subsequent functions (such as slotCenterObject) //called *right after* this one, obsList.current()==NULL. No idea why. oCurrent = obsList.current(); @@ -308,7 +308,7 @@ void ObservingList::slotNewSelection() { ui->NotesLabel->setEnabled( false ); ui->NotesEdit->setEnabled( false ); oCurrent = 0; - + //Clear the user log text box. saveCurrentUserLog(); } else { //more than one object selected. @@ -344,13 +344,13 @@ void ObservingList::slotSlewToObject() bool useJ2000( false); int selectedCoord(0); SkyPoint sp; - + // Find the first device with EQUATORIAL_EOD_COORD or EQUATORIAL_COORD and with SLEW element // i.e. the first telescope we find! - + INDIMenu *imenu = ks->getINDIMenu(); - + for (unsigned int i=0; i < imenu->mgr.count() ; i++) { for (unsigned int j=0; j < imenu->mgr.at(i)->indi_dev.count(); j++) @@ -375,7 +375,7 @@ void ObservingList::slotSlewToObject() ConnectEle = indidev->findElem("CONNECT"); if (!ConnectEle) continue; - + if (ConnectEle->state == PS_OFF) { KMessageBox::error(0, i18n("Telescope %1 is offline. Please connect and retry again.").arg(indidev->label)); @@ -393,7 +393,7 @@ void ObservingList::slotSlewToObject() if (!DecEle) continue; break; - //Qt::Horizontal + // Horizontal case 1: if (prop->perm == PP_RO) continue; AzEle = prop->findElement("AZ"); @@ -402,10 +402,10 @@ void ObservingList::slotSlewToObject() if (!AltEle) continue; break; } - + onset = indidev->findProp("ON_COORD_SET"); if (!onset) continue; - + onset->activateSwitch("SLEW"); indidev->stdDev->currentObject = oCurrent; @@ -456,14 +456,14 @@ void ObservingList::slotSlewToObject() } prop->newText(); - + return; } } - + // We didn't find any telescopes KMessageBox::sorry(0, i18n("KStars did not find any active telescopes.")); - + } //FIXME: This will open multiple Detail windows for each object; @@ -481,7 +481,7 @@ void ObservingList::slotAVT() { for ( SkyObject *o = SelectedObjects.first(); o; o = SelectedObjects.next() ) { avt.processObject( o ); } - + avt.exec(); } } @@ -489,20 +489,20 @@ void ObservingList::slotAVT() { //FIXME: On close, we will need to close any open Details/AVT windows void ObservingList::slotClose() { //Save the current User log text - if ( oCurrent && ! ui->NotesEdit->text().isEmpty() && ui->NotesEdit->text() + if ( oCurrent && ! ui->NotesEdit->text().isEmpty() && ui->NotesEdit->text() != i18n("Record here observation logs and/or data on %1.").arg( oCurrent->name()) ) { oCurrent->saveUserLog( ui->NotesEdit->text() ); } - + hide(); } void ObservingList::saveCurrentUserLog() { - if ( ! ui->NotesEdit->text().isEmpty() && - ui->NotesEdit->text() != + if ( ! ui->NotesEdit->text().isEmpty() && + ui->NotesEdit->text() != i18n("Record here observation logs and/or data on %1.").arg( LogObject->translatedName() ) ) { LogObject->saveUserLog( ui->NotesEdit->text() ); - + ui->NotesEdit->clear(); ui->NotesLabel->setText( i18n( "Observing notes for object:" ) ); LogObject = NULL; @@ -519,7 +519,7 @@ void ObservingList::slotOpenList() { KTempFile tmpfile; tmpfile.setAutoDelete(true); FileName = tmpfile.name(); - if( TDEIO::NetAccess::download( fileURL, FileName, this ) ) + if( TDEIO::NetAccess::download( fileURL, FileName, this ) ) f.setName( FileName ); } else { @@ -534,7 +534,7 @@ void ObservingList::slotOpenList() { } saveCurrentList(); - //First line is the name of the list. The rest of the file should + //First line is the name of the list. The rest of the file should //be object names, one per line. TQTextStream istream(&f); TQString line; @@ -556,7 +556,7 @@ void ObservingList::slotOpenList() { double dc = dms::fromString( fields[2], true ).Degrees(); //true = degrees //Identify the star with these coordinates - double rmax = 1.; + double rmax = 1.; for ( uint i=0; i < ks->data()->starList.count(); ++i ) { SkyObject *s = (SkyObject*)(ks->data()->starList.at(i)); double dra = fabs( ra - s->ra()->Degrees() ); @@ -592,12 +592,12 @@ void ObservingList::saveCurrentList() { if ( obsList.count() ) { if ( isModified ) { TQString message = i18n( "Do you want to save the current list before opening a new list?" ); - if ( KMessageBox::questionYesNo( this, message, + if ( KMessageBox::questionYesNo( this, message, i18n( "Save Current List?" ), KStdGuiItem::save(), KStdGuiItem::discard() ) == KMessageBox::Yes ) slotSaveList(); } - //If we ever allow merging the loaded list with + //If we ever allow merging the loaded list with //the existing one, that code would go here obsList.clear(); ui->FullTable->clear(); @@ -606,13 +606,13 @@ void ObservingList::saveCurrentList() { void ObservingList::slotSaveListAs() { bool ok(false); - ListName = KInputDialog::getText( i18n( "Enter List Name" ), + ListName = KInputDialog::getText( i18n( "Enter List Name" ), i18n( "List name:" ), "", &ok ); if ( ok ) { KURL fileURL = KFileDialog::getSaveURL( TQDir::homeDirPath(), "*.obslist|KStars Observing List (*.obslist)" ); - if ( fileURL.isValid() ) + if ( fileURL.isValid() ) FileName = fileURL.path(); slotSaveList(); @@ -628,18 +628,18 @@ void ObservingList::slotSaveList() { TQFile f( FileName ); if ( !f.open( IO_WriteOnly) ) { TQString message = i18n( "Could not open file %1. Try a different filename?" ).arg( f.name() ); - + if ( KMessageBox::warningYesNo( 0, message, i18n( "Could Not Open File" ), i18n("Try Different"), i18n("Do Not Try") ) == KMessageBox::Yes ) { FileName == ""; slotSaveList(); } return; } - + TQTextStream ostream(&f); ostream << ListName << endl; - //Save objects to the list using their name. If it's a star with a genetive name + //Save objects to the list using their name. If it's a star with a genetive name //(i.e., "sigma orionis"), save the name with ascii characters, not greek letters. //If it's an unnamed star, save "star" and the star's coordinates. for ( SkyObject* o = obsList.first(); o; o = obsList.next() ) { @@ -652,7 +652,7 @@ void ObservingList::slotSaveList() { ostream << s->gname( false ) << endl; } else { ostream << o->name() << endl; - } + } } else { ostream << o->name() << endl; } @@ -734,7 +734,7 @@ void ObservingList::syncTableSelection( bool syncFullTable ) { ui->TinyTable->setSelected( i++, it->isSelected() ); it->nextSibling(); } - } + } } #include "observinglist.moc" diff --git a/kstars/kstars/tools/scriptbuilder.cpp b/kstars/kstars/tools/scriptbuilder.cpp index 3d1ddbaa..b9f480f7 100644 --- a/kstars/kstars/tools/scriptbuilder.cpp +++ b/kstars/kstars/tools/scriptbuilder.cpp @@ -101,8 +101,8 @@ #include "libtdeedu/extdate/extdatewidget.h" ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) - : KDialogBase( KDialogBase::Plain, i18n( "Script Builder" ), Close, Close, parent, name ), - UnsavedChanges(false), currentFileURL(), currentDir( TQDir::homeDirPath() ), + : KDialogBase( KDialogBase::Plain, i18n( "Script Builder" ), Close, Close, parent, name ), + UnsavedChanges(false), currentFileURL(), currentDir( TQDir::homeDirPath() ), currentScriptName(), currentAuthor() { TQFrame *page = plainPage(); @@ -143,62 +143,62 @@ ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) KStarsFunctionList.append( new ScriptFunction( "stop", i18n( "Halt the simulation clock." ), true ) ); KStarsFunctionList.append( new ScriptFunction( "start", i18n( "Start the simulation clock." ), true ) ); KStarsFunctionList.append( new ScriptFunction( "setClockScale", i18n( "Set the timescale of the simulation clock to %1. 1.0 means real-time; 2.0 means twice real-time; etc." ), true, "double", "scale" ) ); - + // INDI fuctions - ScriptFunction *startINDIFunc(NULL), *shutdownINDIFunc(NULL), *switchINDIFunc(NULL), *setINDIPortFunc(NULL), *setINDIScopeActionFunc(NULL), *setINDITargetCoordFunc(NULL), *setINDITargetNameFunc(NULL), *setINDIGeoLocationFunc(NULL), *setINDIUTCFunc(NULL), *setINDIActionFunc(NULL), *waitForINDIActionFunc(NULL), *setINDIFocusSpeedFunc(NULL), *startINDIFocusFunc(NULL), *setINDIFocusTimeoutFunc(NULL), *setINDICCDTempFunc(NULL), *setINDIFilterNumFunc(NULL), *setINDIFrameTypeFunc(NULL), *startINDIExposureFunc(NULL); - + ScriptFunction *startINDIFunc(NULL), *shutdownINDIFunc(NULL), *switchINDIFunc(NULL), *setINDIPortFunc(NULL), *setINDIScopeActionFunc(NULL), *setINDITargetCoordFunc(NULL), *setINDITargetNameFunc(NULL), *setINDIGeoLocationFunc(NULL), *setINDIUTCFunc(NULL), *setINDIActionFunc(NULL), *waitForINDIActionFunc(NULL), *setINDIFocusSpeedFunc(NULL), *startINDIFocusFunc(NULL), *setINDIFocusTimeoutFunc(NULL), *setINDICCDTempFunc(NULL), *setINDIFilterNumFunc(NULL), *setINDIFrameTypeFunc(NULL), *startINDIExposureFunc(NULL); + startINDIFunc = new ScriptFunction( "startINDI", i18n("Establish an INDI device either in local mode or server mode."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "bool", "useLocal"); INDIFunctionList.append ( startINDIFunc ); - + shutdownINDIFunc = new ScriptFunction( "shutdownINDI", i18n("Shutdown an INDI device."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName"); INDIFunctionList.append ( shutdownINDIFunc); - + switchINDIFunc = new ScriptFunction( "switchINDI", i18n("Connect or Disconnect an INDI device."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "bool", "turnOn"); switchINDIFunc->setINDIProperty("CONNECTION"); INDIFunctionList.append ( switchINDIFunc); - + setINDIPortFunc = new ScriptFunction( "setINDIPort", i18n("Set INDI's device connection port."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", TQSTRING_OBJECT_NAME_STRING, "port"); setINDIPortFunc->setINDIProperty("DEVICE_PORT"); INDIFunctionList.append ( setINDIPortFunc); - + setINDIScopeActionFunc = new ScriptFunction( "setINDIScopeAction", i18n("Set the telescope action. Available actions are SLEW, TRACK, SYNC, PARK, and ABORT."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", TQSTRING_OBJECT_NAME_STRING, "action"); setINDIScopeActionFunc->setINDIProperty("CHECK"); INDIFunctionList.append( setINDIScopeActionFunc); - + setINDITargetCoordFunc = new ScriptFunction ( "setINDITargetCoord", i18n( "Set the telescope target coordinates to the RA/Dec coordinates. RA is expressed in Hours; DEC is expressed in Degrees." ), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "double", "RA", "double", "DEC" ); setINDITargetCoordFunc->setINDIProperty("EQUATORIAL_EOD_COORD"); INDIFunctionList.append ( setINDITargetCoordFunc ); - + setINDITargetNameFunc = new ScriptFunction( "setINDITargetName", i18n("Set the telescope target coorinates to the RA/Dec coordinates of the selected object."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", TQSTRING_OBJECT_NAME_STRING, "objectName"); setINDITargetNameFunc->setINDIProperty("EQUATORIAL_EOD_COORD"); INDIFunctionList.append( setINDITargetNameFunc); - + setINDIGeoLocationFunc = new ScriptFunction ( "setINDIGeoLocation", i18n("Set the telescope longitude and latitude. The longitude is E of N."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "double", "long", "double", "lat"); setINDIGeoLocationFunc->setINDIProperty("GEOGRAPHIC_COORD"); INDIFunctionList.append( setINDIGeoLocationFunc); - + setINDIUTCFunc = new ScriptFunction ( "setINDIUTC", i18n("Set the device UTC time in ISO 8601 format YYYY/MM/DDTHH:MM:SS."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", TQSTRING_OBJECT_NAME_STRING, "UTCDateTime"); setINDIUTCFunc->setINDIProperty("TIME"); INDIFunctionList.append( setINDIUTCFunc); - + setINDIActionFunc = new ScriptFunction( "setINDIAction", i18n("Activate an INDI action. The action is the name of any INDI switch property element supported by the device."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", TQSTRING_OBJECT_NAME_STRING, "actionName"); INDIFunctionList.append( setINDIActionFunc); - + waitForINDIActionFunc = new ScriptFunction ("waitForINDIAction", i18n("Pause script execution until action returns with OK status. The action can be the name of any INDI property supported by the device."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", TQSTRING_OBJECT_NAME_STRING, "actionName"); INDIFunctionList.append( waitForINDIActionFunc ); - + setINDIFocusSpeedFunc = new ScriptFunction ("setINDIFocusSpeed", i18n("Set the telescope focuser speed. Set speed to 0 to halt the focuser. 1-3 correspond to slow, medium, and fast speeds respectively."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "unsigned int", "speed"); setINDIFocusSpeedFunc->setINDIProperty("FOCUS_SPEED"); INDIFunctionList.append( setINDIFocusSpeedFunc ); - + startINDIFocusFunc = new ScriptFunction ("startINDIFocus", i18n("Start moving the focuser in the direction Dir, and for the duration specified by setINDIFocusTimeout."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", TQSTRING_OBJECT_NAME_STRING, "Dir"); startINDIFocusFunc->setINDIProperty("FOCUS_MOTION"); INDIFunctionList.append( startINDIFocusFunc); - + setINDIFocusTimeoutFunc = new ScriptFunction ( "setINDIFocusTimeout", i18n("Set the telescope focuser timer in seconds. This is the duration of any focusing procedure performed by calling startINDIFocus."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "int", "timeout"); setINDIFocusTimeoutFunc->setINDIProperty("FOCUS_TIMER"); INDIFunctionList.append( setINDIFocusTimeoutFunc); - + setINDICCDTempFunc = new ScriptFunction( "setINDICCDTemp", i18n("Set the target CCD chip temperature."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "int", "temp"); setINDICCDTempFunc->setINDIProperty("CCD_TEMPERATURE"); INDIFunctionList.append( setINDICCDTempFunc); @@ -206,36 +206,36 @@ ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) setINDIFilterNumFunc = new ScriptFunction( "setINDIFilterNum", i18n("Set the target filter position."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "int", "filter_num"); setINDIFilterNumFunc->setINDIProperty("FILTER_SLOT"); INDIFunctionList.append ( setINDIFilterNumFunc); - + setINDIFrameTypeFunc = new ScriptFunction( "setINDIFrameType", i18n("Set the CCD camera frame type. Available options are FRAME_LIGHT, FRAME_BIAS, FRAME_DARK, and FRAME_FLAT."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", TQSTRING_OBJECT_NAME_STRING, "type"); setINDIFrameTypeFunc->setINDIProperty("FRAME_TYPE"); INDIFunctionList.append( setINDIFrameTypeFunc); - + startINDIExposureFunc = new ScriptFunction ( "startINDIExposure", i18n("Start Camera/CCD exposure. The duration is in seconds."), false, TQSTRING_OBJECT_NAME_STRING, "deviceName", "int", "timeout"); startINDIExposureFunc->setINDIProperty("CCD_EXPOSE_DURATION"); INDIFunctionList.append( startINDIExposureFunc); - - + + // Modified by JM // We're using TDEListView instead of listbox to arrange the functions in two // main categories: KStars and INDI. INDI is further subdivided. - + sb->FunctionListView->addColumn(i18n("Functions")); sb->FunctionListView->setSorting(-1); - + TQListViewItem *INDI_tree = new TQListViewItem( sb->FunctionListView, "INDI"); TQListViewItem *INDI_filter = new TQListViewItem( INDI_tree, "Filter"); TQListViewItem *INDI_focuser = new TQListViewItem( INDI_tree, "Focuser"); TQListViewItem *INDI_ccd = new TQListViewItem( INDI_tree, "Camera/CCD"); TQListViewItem *INDI_telescope = new TQListViewItem( INDI_tree, "Telescope"); TQListViewItem *INDI_general = new TQListViewItem( INDI_tree, "General"); - + TQListViewItem *kstars_tree = new TQListViewItem( sb->FunctionListView, "KStars"); - - + + for ( ScriptFunction *sf = KStarsFunctionList.last(); sf; sf = KStarsFunctionList.prev() ) new TQListViewItem (kstars_tree, sf->prototype()); - + // General new TQListViewItem(INDI_general, waitForINDIActionFunc->prototype()); new TQListViewItem(INDI_general, setINDIActionFunc->prototype()); @@ -312,21 +312,21 @@ ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) argSetFrameTypeINDI = new ArgSetFrameTypeINDI (sb->ArgStack); argSetCCDTempINDI = new ArgSetCCDTempINDI(sb->ArgStack); argSetFilterNumINDI = new ArgSetFilterNumINDI(sb->ArgStack); - + argStartFocusINDI->directionCombo->insertItem("IN"); argStartFocusINDI->directionCombo->insertItem("OUT"); - + argSetScopeActionINDI->actionCombo->insertItem("SLEW"); argSetScopeActionINDI->actionCombo->insertItem("TRACK"); argSetScopeActionINDI->actionCombo->insertItem("SYNC"); argSetScopeActionINDI->actionCombo->insertItem("PARK"); argSetScopeActionINDI->actionCombo->insertItem("ABORT"); - + argSetFrameTypeINDI->typeCombo->insertItem("FRAME_LIGHT"); argSetFrameTypeINDI->typeCombo->insertItem("FRAME_BIAS"); argSetFrameTypeINDI->typeCombo->insertItem("FRAME_DARK"); argSetFrameTypeINDI->typeCombo->insertItem("FRAME_FLAT"); - + sb->ArgStack->addWidget( argBlank ); sb->ArgStack->addWidget( argLookToward ); sb->ArgStack->addWidget( argSetRaDec ); @@ -343,7 +343,7 @@ ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) sb->ArgStack->addWidget( argPrintImage ); sb->ArgStack->addWidget( argSetColor ); sb->ArgStack->addWidget( argLoadColorScheme ); - + sb->ArgStack->addWidget( argStartINDI); sb->ArgStack->addWidget( argShutdownINDI); sb->ArgStack->addWidget( argSwitchINDI); @@ -362,7 +362,7 @@ ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) sb->ArgStack->addWidget( argSetFrameTypeINDI); sb->ArgStack->addWidget( argSetCCDTempINDI); sb->ArgStack->addWidget( argSetFilterNumINDI); - + sb->ArgStack->raiseWidget( 0 ); snd = new ScriptNameDialog( ks ); @@ -416,77 +416,77 @@ ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) connect( argSetColor->ColorValue, TQT_SIGNAL( changed(const TQColor &) ), this, TQT_SLOT( slotChangeColor() ) ); connect( argLoadColorScheme->SchemeList, TQT_SIGNAL( clicked( TQListBoxItem* ) ), this, TQT_SLOT( slotLoadColorScheme( TQListBoxItem* ) ) ); connect( snd->ScriptName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotEnableScriptNameOK() ) ); - + connect( sb->AppendINDIWait, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT(slotINDIWaitCheck(bool))); - + // Connections for INDI's Arg widgets - + // INDI Start Device connect (argStartINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIStartDeviceName())); - connect (argStartINDI->INDIMode, TQT_SIGNAL ( clicked( int)), this, TQT_SLOT (slotINDIStartDeviceMode())); - + connect (argStartINDI->INDIMode, TQT_SIGNAL ( clicked( int)), this, TQT_SLOT (slotINDIStartDeviceMode())); + // INDI Shutdown Device connect (argShutdownINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIShutdown())); - + // INDI Swtich Device connect (argSwitchINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISwitchDeviceName())); - connect (argSwitchINDI->INDIConnection, TQT_SIGNAL ( clicked( int)), this, TQT_SLOT (slotINDISwitchDeviceConnection())); - + connect (argSwitchINDI->INDIConnection, TQT_SIGNAL ( clicked( int)), this, TQT_SLOT (slotINDISwitchDeviceConnection())); + // INDI Set Device Port connect (argSetPortINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetPortDeviceName())); connect (argSetPortINDI->devicePort, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetPortDevicePort())); - - // INDI Set Target Coord + + // INDI Set Target Coord connect (argSetTargetCoordINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetTargetCoordDeviceName())); connect( argSetTargetCoordINDI->RaBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotINDISetTargetCoordDeviceRA() ) ); connect( argSetTargetCoordINDI->DecBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotINDISetTargetCoordDeviceDEC() ) ); - + // INDI Set Target Name connect( argSetTargetNameINDI->FindButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotINDIFindObject() ) ); connect (argSetTargetNameINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetTargetNameDeviceName())); connect (argSetTargetNameINDI->objectName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetTargetNameObjectName())); - + // INDI Set Action connect (argSetActionINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetActionDeviceName())); connect (argSetActionINDI->actionName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetActionName())); - + // INDI Wait For Action connect (argWaitForActionINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIWaitForActionDeviceName())); connect (argWaitForActionINDI->actionName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIWaitForActionName())); - + // INDI Set Focus Speed connect (argSetFocusSpeedINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetFocusSpeedDeviceName())); connect (argSetFocusSpeedINDI->speedIN, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDISetFocusSpeed())); - + // INDI Start Focus connect (argStartFocusINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIStartFocusDeviceName())); connect (argStartFocusINDI->directionCombo, TQT_SIGNAL( activated(const TQString &) ), this, TQT_SLOT(slotINDIStartFocusDirection())); - + // INDI Set Focus Timeout connect (argSetFocusTimeoutINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetFocusTimeoutDeviceName())); connect (argSetFocusTimeoutINDI->timeOut, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDISetFocusTimeout())); - + // INDI Set Geo Location connect (argSetGeoLocationINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetGeoLocationDeviceName())); connect( argSetGeoLocationINDI->longBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotINDISetGeoLocationDeviceLong() ) ); connect( argSetGeoLocationINDI->latBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotINDISetGeoLocationDeviceLat() ) ); - + // INDI Start Exposure connect (argStartExposureINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIStartExposureDeviceName())); connect (argStartExposureINDI->timeOut, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDIStartExposureTimeout())); - + // INDI Set UTC connect (argSetUTCINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetUTCDeviceName())); connect (argSetUTCINDI->UTC, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetUTC())); - + // INDI Set Scope Action connect (argSetScopeActionINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetScopeActionDeviceName())); connect (argSetScopeActionINDI->actionCombo, TQT_SIGNAL( activated(const TQString &) ), this, TQT_SLOT(slotINDISetScopeAction())); - + // INDI Set Frame type connect (argSetFrameTypeINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetFrameTypeDeviceName())); connect (argSetFrameTypeINDI->typeCombo, TQT_SIGNAL( activated(const TQString &) ), this, TQT_SLOT(slotINDISetFrameType())); - + // INDI Set CCD Temp connect (argSetCCDTempINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetCCDTempDeviceName())); connect (argSetCCDTempINDI->temp, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDISetCCDTemp())); @@ -495,7 +495,7 @@ ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) connect (argSetFilterNumINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetFilterNumDeviceName())); connect (argSetFilterNumINDI->filter_num, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDISetFilterNum())); - + //disbale some buttons sb->CopyButton->setEnabled( false ); sb->AddButton->setEnabled( false ); @@ -646,7 +646,7 @@ void ScriptBuilder::initViewOptions() { argChangeViewOption->OptionName->insertItem( "HideGrid" ); opsSkymap = new TQListViewItem( otv->OptionsList, i18n( "Skymap Options" ) ); - new TQListViewItem( opsSkymap, "UseAltAz", i18n( "UseQt::Horizontal coordinates? (otherwise, use Equatorial)" ), i18n( "bool" ) ); + new TQListViewItem( opsSkymap, "UseAltAz", i18n( "Use Horizontal coordinates? (otherwise, use Equatorial)" ), i18n( "bool" ) ); new TQListViewItem( opsSkymap, "ZoomFactor", i18n( "Set the Zoom Factor" ), i18n( "double" ) ); new TQListViewItem( opsSkymap, "FOV Size", i18n( "Select angular size for the FOV symbol (in arcmin)" ), i18n( "double" ) ); new TQListViewItem( opsSkymap, "FOV Shape", i18n( "Select shape for the FOV symbol (0=Square, 1=Circle, 2=Crosshairs, 4=Bullseye)" ), i18n( "int" ) ); @@ -694,13 +694,13 @@ void ScriptBuilder::initViewOptions() { for ( unsigned int i=0; i < ks->data()->colorScheme()->numberOfColors(); ++i ) { argSetColor->ColorName->insertItem( ks->data()->colorScheme()->nameAt(i) ); } - + //init list of color scheme names argLoadColorScheme->SchemeList->insertItem( i18n( "use default color scheme", "Default Colors" ) ); argLoadColorScheme->SchemeList->insertItem( i18n( "use 'star chart' color scheme", "Star Chart" ) ); argLoadColorScheme->SchemeList->insertItem( i18n( "use 'night vision' color scheme", "Night Vision" ) ); argLoadColorScheme->SchemeList->insertItem( i18n( "use 'moonless night' color scheme", "Moonless Night" ) ); - + TQFile file; TQString line; file.setName( locate( "appdata", "colors.dat" ) ); //determine filename in local user KDE directory tree. @@ -800,7 +800,7 @@ void ScriptBuilder::slotSave() { if ( currentFileURL.isLocalFile() ) { fname = currentFileURL.path(); - + //Warn user if file exists if (TQFile::exists(currentFileURL.path())) { int r=KMessageBox::warningContinueCancel(TQT_TQWIDGET(parent()), @@ -808,13 +808,13 @@ void ScriptBuilder::slotSave() { "Overwrite it?" ).arg(currentFileURL.fileName()), i18n( "Overwrite File?" ), i18n( "&Overwrite" ) ); - + if(r==KMessageBox::Cancel) return; } } else { fname = tmpfile.name(); } - + if ( fname.right( 7 ).lower() != ".kstars" ) fname += ".kstars"; TQFile f( fname ); @@ -945,8 +945,8 @@ void ScriptBuilder::writeScript( TQTextStream &ostream ) { else sf->setINDIProperty("PARK"); } - - if ( sf->argVal(0).contains(" ")) + + if ( sf->argVal(0).contains(" ")) ostream << mainpre << "waitForINDIAction " << "\"" << sf->argVal(0) << "\" " << sf->INDIProperty() << endl; else ostream << mainpre << "waitForINDIAction " << sf->argVal(0) << " " << sf->INDIProperty() << endl; @@ -1010,11 +1010,11 @@ bool ScriptBuilder::parseFunction( TQStringList &fn ) bool foundQuote(false), quoteProcessed(false); TQString cur, arg; TQStringList::iterator it; - + for (it = fn.begin(); it != fn.end(); ++it) { cur = (*it); - + if ( cur.startsWith("\"")) { arg += cur.right(cur.length() - 1); @@ -1039,10 +1039,10 @@ bool ScriptBuilder::parseFunction( TQStringList &fn ) arg += "'"; } } - + if (quoteProcessed) fn = TQStringList::split( "'", arg ); - + //loop over known functions to find a name match for ( ScriptFunction *sf = KStarsFunctionList.first(); sf; sf = KStarsFunctionList.next() ) { @@ -1067,7 +1067,7 @@ bool ScriptBuilder::parseFunction( TQStringList &fn ) return true; } - + for ( ScriptFunction *sf = INDIFunctionList.first(); sf; sf = INDIFunctionList.next() ) { if ( fn[0] == sf->name() ) @@ -1128,27 +1128,27 @@ void ScriptBuilder::slotRemoveFunction() { } void ScriptBuilder::slotAddFunction() { - + ScriptFunction *sc = NULL; TQListViewItem *currentItem = sb->FunctionListView->currentItem(); - + if ( currentItem == NULL || currentItem->depth() == 0) return; - + for (sc = KStarsFunctionList.first(); sc; sc = KStarsFunctionList.next()) if (sc->prototype() == currentItem->text(0)) break; - + if (sc == NULL) { for (sc = INDIFunctionList.first(); sc; sc = INDIFunctionList.next()) if (sc->prototype() == currentItem->text(0)) break; - + } - + if (sc == NULL) return; - + setUnsavedChanges( true ); int Pos = sb->ScriptListBox->currentItem() + 1; @@ -1299,11 +1299,11 @@ void ScriptBuilder::slotArgWidget() { int w, h; w = sf->argVal(1).toInt( &ok ); if (ok) h = sf->argVal(2).toInt( &ok ); - if (ok) { - argExportImage->ExportWidth->setValue( w ); + if (ok) { + argExportImage->ExportWidth->setValue( w ); argExportImage->ExportHeight->setValue( h ); - } else { - argExportImage->ExportWidth->setValue( ks->map()->width() ); + } else { + argExportImage->ExportWidth->setValue( ks->map()->width() ); argExportImage->ExportHeight->setValue( ks->map()->height() ); } @@ -1389,7 +1389,7 @@ void ScriptBuilder::slotArgWidget() { } else if (sf->name() == "startINDI") { sb->ArgStack->raiseWidget( argStartINDI); - + argStartINDI->deviceName->setText(sf->argVal(0)); if (sf->argVal(1) == "true") argStartINDI->LocalButton->setChecked(true); @@ -1398,7 +1398,7 @@ void ScriptBuilder::slotArgWidget() { } else if (sf->name() == "shutdownINDI") { sb->ArgStack->raiseWidget( argShutdownINDI); - + //if (sf->valid()) kdDebug() << "begin: shutdown is valid" << endl; if (sb->ReuseINDIDeviceName->isChecked()) { @@ -1410,53 +1410,53 @@ void ScriptBuilder::slotArgWidget() { slotINDIShutdown(); } else argShutdownINDI->deviceName->setText(sf->argVal(0)); - + //if (sf->valid()) kdDebug() << "end: shutdown is valid" << endl; } else if (sf->name() == "switchINDI") { sb->ArgStack->raiseWidget( argSwitchINDI); - + if (sf->argVal(1) == "true" || sf->argVal(1).isEmpty()) argSwitchINDI->OnButton->setChecked(true); else argSwitchINDI->OffButton->setChecked(true); - + argSwitchINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) argSwitchINDI->deviceName->setText(sf->argVal(0)); - else + else argSwitchINDI->deviceName->setText(lastINDIDeviceName); } else argSwitchINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIPort") { sb->ArgStack->raiseWidget( argSetPortINDI); - + argSetPortINDI->devicePort->setText(sf->argVal(1)); - + argSetPortINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) argSetPortINDI->deviceName->setText(sf->argVal(0)); - else + else argSetPortINDI->deviceName->setText(lastINDIDeviceName); } else argSetPortINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDITargetCoord") { bool ok(false); double r(0.0),d(0.0); dms ra(0.0); - + sb->ArgStack->raiseWidget( argSetTargetCoordINDI); - + ok = !sf->argVal(1).isEmpty(); if (ok) r = sf->argVal(1).toDouble(&ok); else argSetTargetCoordINDI->RaBox->clear(); @@ -1466,26 +1466,26 @@ void ScriptBuilder::slotArgWidget() { if (ok) d = sf->argVal(2).toDouble(&ok); else argSetTargetCoordINDI->DecBox->clear(); if (ok) argSetTargetCoordINDI->DecBox->showInDegrees( dms(d) ); - + argSetTargetCoordINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) argSetTargetCoordINDI->deviceName->setText(sf->argVal(0)); - else + else argSetTargetCoordINDI->deviceName->setText(lastINDIDeviceName); } else argSetTargetCoordINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDITargetName") { sb->ArgStack->raiseWidget( argSetTargetNameINDI); - + argSetTargetNameINDI->objectName->setText(sf->argVal(1)); - + argSetTargetNameINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1494,15 +1494,15 @@ void ScriptBuilder::slotArgWidget() { argSetTargetNameINDI->deviceName->setText(lastINDIDeviceName); } else argSetTargetNameINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIAction") { sb->ArgStack->raiseWidget( argSetActionINDI); - + argSetActionINDI->actionName->setText(sf->argVal(1)); - + argSetActionINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1511,15 +1511,15 @@ void ScriptBuilder::slotArgWidget() { argSetActionINDI->deviceName->setText(lastINDIDeviceName); } else argSetActionINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "waitForINDIAction") { sb->ArgStack->raiseWidget( argWaitForActionINDI); - + argWaitForActionINDI->actionName->setText(sf->argVal(1)); - + argWaitForActionINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1528,20 +1528,20 @@ void ScriptBuilder::slotArgWidget() { argWaitForActionINDI->deviceName->setText(lastINDIDeviceName); } else argWaitForActionINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIFocusSpeed") { int t(0); bool ok(false); - + sb->ArgStack->raiseWidget( argSetFocusSpeedINDI); t = sf->argVal(1).toInt(&ok); if (ok) argSetFocusSpeedINDI->speedIN->setValue(t); else argSetFocusSpeedINDI->speedIN->setValue(0); - + argSetFocusSpeedINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1550,12 +1550,12 @@ void ScriptBuilder::slotArgWidget() { argSetFocusSpeedINDI->deviceName->setText(lastINDIDeviceName); } else argSetFocusSpeedINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "startINDIFocus") { sb->ArgStack->raiseWidget( argStartFocusINDI); bool itemSet(false); - + for (int i=0; i < argStartFocusINDI->directionCombo->count(); i++) { if (argStartFocusINDI->directionCombo->text(i) == sf->argVal(1)) @@ -1565,11 +1565,11 @@ void ScriptBuilder::slotArgWidget() { break; } } - + if (!itemSet) argStartFocusINDI->directionCombo->setCurrentItem(0); - + argStartFocusINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1578,20 +1578,20 @@ void ScriptBuilder::slotArgWidget() { argStartFocusINDI->deviceName->setText(lastINDIDeviceName); } else argStartFocusINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIFocusTimeout") { int t(0); bool ok(false); - + sb->ArgStack->raiseWidget( argSetFocusTimeoutINDI); - + t = sf->argVal(1).toInt(&ok); if (ok) argSetFocusTimeoutINDI->timeOut->setValue(t); else argSetFocusTimeoutINDI->timeOut->setValue(0); - + argSetFocusTimeoutINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1600,14 +1600,14 @@ void ScriptBuilder::slotArgWidget() { argSetFocusTimeoutINDI->deviceName->setText(lastINDIDeviceName); } else argSetFocusTimeoutINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIGeoLocation") { bool ok(false); double lo(0.0),la(0.0); - + sb->ArgStack->raiseWidget( argSetGeoLocationINDI); - + ok = !sf->argVal(1).isEmpty(); if (ok) lo = sf->argVal(1).toDouble(&ok); else argSetGeoLocationINDI->longBox->clear(); @@ -1617,9 +1617,9 @@ void ScriptBuilder::slotArgWidget() { if (ok) la = sf->argVal(2).toDouble(&ok); else argSetGeoLocationINDI->latBox->clear(); if (ok) argSetGeoLocationINDI->latBox->showInDegrees( dms(la) ); - + argSetGeoLocationINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1628,20 +1628,20 @@ void ScriptBuilder::slotArgWidget() { argSetGeoLocationINDI->deviceName->setText(lastINDIDeviceName); } else argSetGeoLocationINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "startINDIExposure") { int t(0); bool ok(false); - + sb->ArgStack->raiseWidget( argStartExposureINDI); - + t = sf->argVal(1).toInt(&ok); if (ok) argStartExposureINDI->timeOut->setValue(t); else argStartExposureINDI->timeOut->setValue(0); - + argStartExposureINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1650,29 +1650,29 @@ void ScriptBuilder::slotArgWidget() { argStartExposureINDI->deviceName->setText(lastINDIDeviceName); } else argStartExposureINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIUTC") { sb->ArgStack->raiseWidget( argSetUTCINDI); - + argSetUTCINDI->UTC->setText(sf->argVal(1)); - + argSetUTCINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) argSetUTCINDI->deviceName->setText(sf->argVal(0)); - else + else argSetUTCINDI->deviceName->setText(lastINDIDeviceName); } else argSetUTCINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIScopeAction") { sb->ArgStack->raiseWidget( argSetScopeActionINDI); bool itemSet(false); - + for (int i=0; i < argSetScopeActionINDI->actionCombo->count(); i++) { if (argSetScopeActionINDI->actionCombo->text(i) == sf->argVal(1)) @@ -1682,25 +1682,25 @@ void ScriptBuilder::slotArgWidget() { break; } } - + if (!itemSet) argSetScopeActionINDI->actionCombo->setCurrentItem(0); - + argSetScopeActionINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) argSetScopeActionINDI->deviceName->setText(sf->argVal(0)); - else + else argSetScopeActionINDI->deviceName->setText(lastINDIDeviceName); } else argSetScopeActionINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIFrameType") { sb->ArgStack->raiseWidget( argSetFrameTypeINDI); bool itemSet(false); - + for (int i=0; i < argSetFrameTypeINDI->typeCombo->count(); i++) { if (argSetFrameTypeINDI->typeCombo->text(i) == sf->argVal(1)) @@ -1710,11 +1710,11 @@ void ScriptBuilder::slotArgWidget() { break; } } - + if (!itemSet) argSetFrameTypeINDI->typeCombo->setCurrentItem(0); - + argSetFrameTypeINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1723,20 +1723,20 @@ void ScriptBuilder::slotArgWidget() { argSetFrameTypeINDI->deviceName->setText(lastINDIDeviceName); } else argSetFrameTypeINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDICCDTemp") { int t(0); bool ok(false); - + sb->ArgStack->raiseWidget( argSetCCDTempINDI); - + t = sf->argVal(1).toInt(&ok); if (ok) argSetCCDTempINDI->temp->setValue(t); else argSetCCDTempINDI->temp->setValue(0); - + argSetCCDTempINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1745,20 +1745,20 @@ void ScriptBuilder::slotArgWidget() { argSetCCDTempINDI->deviceName->setText(lastINDIDeviceName); } else argSetCCDTempINDI->deviceName->setText(sf->argVal(0)); - + } else if (sf->name() == "setINDIFilterNum") { int t(0); bool ok(false); - + sb->ArgStack->raiseWidget( argSetFilterNumINDI); - + t = sf->argVal(1).toInt(&ok); if (ok) argSetFilterNumINDI->filter_num->setValue(t); else argSetFilterNumINDI->filter_num->setValue(0); - + argSetFilterNumINDI->deviceName->clear(); - + if (sb->ReuseINDIDeviceName->isChecked()) { if (!sf->argVal(0).isEmpty()) @@ -1767,7 +1767,7 @@ void ScriptBuilder::slotArgWidget() { argSetFilterNumINDI->deviceName->setText(lastINDIDeviceName); } else argSetFilterNumINDI->deviceName->setText(sf->argVal(0)); - + } } } @@ -1775,28 +1775,28 @@ void ScriptBuilder::slotArgWidget() { void ScriptBuilder::slotShowDoc() { ScriptFunction *sc = NULL; TQListViewItem *currentItem = sb->FunctionListView->currentItem(); - + if ( currentItem == NULL || currentItem->depth() == 0) return; - + for (sc = KStarsFunctionList.first(); sc; sc = KStarsFunctionList.next()) if (sc->prototype() == currentItem->text(0)) break; - + if (sc == NULL) { for (sc = INDIFunctionList.first(); sc; sc = INDIFunctionList.next()) if (sc->prototype() == currentItem->text(0)) break; } - + if (sc == NULL) { sb->AddButton->setEnabled( false ); kdWarning() << i18n( "Function index out of bounds." ) << endl; return; } - + sb->AddButton->setEnabled( true ); sb->FuncDoc->setText( sc->description() ); } @@ -1848,9 +1848,9 @@ void ScriptBuilder::slotINDIFindObject() { void ScriptBuilder::slotINDIWaitCheck(bool /*toggleState*/) { - - setUnsavedChanges(true); - + + setUnsavedChanges(true); + } void ScriptBuilder::slotShowOptions() { @@ -2168,7 +2168,7 @@ void ScriptBuilder::slotExportImage() { if ( sf->name() == "exportImage" ) { setUnsavedChanges( true ); - + sf->setArg( 0, argExportImage->ExportFileName->url() ); sf->setArg( 1, TQString("%1").arg( argExportImage->ExportWidth->value() ) ); sf->setArg( 2, TQString("%1").arg( argExportImage->ExportHeight->value() ) ); @@ -2183,7 +2183,7 @@ void ScriptBuilder::slotPrintImage() { if ( sf->name() == "printImage" ) { setUnsavedChanges( true ); - + sf->setArg( 0, ( argPrintImage->UsePrintDialog->isChecked() ? i18n( "true" ) : i18n( "false" ) ) ); sf->setArg( 1, ( argPrintImage->UseChartColors->isChecked() ? i18n( "true" ) : i18n( "false" ) ) ); sf->setValid( true ); @@ -2197,7 +2197,7 @@ void ScriptBuilder::slotChangeColorName() { if ( sf->name() == "setColor" ) { setUnsavedChanges( true ); - + argSetColor->ColorValue->setColor( ks->data()->colorScheme()->colorAt( argSetColor->ColorName->currentItem() ) ); sf->setArg( 0, ks->data()->colorScheme()->keyAt( argSetColor->ColorName->currentItem() ) ); TQString cname( argSetColor->ColorValue->color().name() ); @@ -2214,7 +2214,7 @@ void ScriptBuilder::slotChangeColor() { if ( sf->name() == "setColor" ) { setUnsavedChanges( true ); - + sf->setArg( 0, ks->data()->colorScheme()->keyAt( argSetColor->ColorName->currentItem() ) ); TQString cname( argSetColor->ColorValue->color().name() ); if ( cname.at(0) == '#' ) cname = "\\" + cname; //prepend a "\" so bash doesn't think we have a comment @@ -2230,7 +2230,7 @@ void ScriptBuilder::slotLoadColorScheme(TQListBoxItem */*i*/) { if ( sf->name() == "loadColorScheme" ) { setUnsavedChanges( true ); - + sf->setArg( 0, "\"" + argLoadColorScheme->SchemeList->currentText() + "\"" ); sf->setValid( true ); } else { @@ -2254,9 +2254,9 @@ void ScriptBuilder::slotINDIStartDeviceName() if ( sf->name() == "startINDI" ) { setUnsavedChanges( true ); - + lastINDIDeviceName = argStartINDI->deviceName->text(); - + sf->setArg(0, lastINDIDeviceName); sf->setArg(1, argStartINDI->LocalButton->isChecked() ? "true" : "false"); sf->setValid(true); @@ -2265,18 +2265,18 @@ void ScriptBuilder::slotINDIStartDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "startINDI" ) << endl; } - + } void ScriptBuilder::slotINDIStartDeviceMode() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "startINDI" ) { setUnsavedChanges( true ); - + sf->setArg(1, argStartINDI->LocalButton->isChecked() ? "true" : "false"); if (! sf->argVal(0).isEmpty()) sf->setValid(true); } @@ -2284,12 +2284,12 @@ void ScriptBuilder::slotINDIStartDeviceMode() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "startINDI" ) << endl; } - + } void ScriptBuilder::slotINDIShutdown() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "shutdownINDI" ) @@ -2299,10 +2299,10 @@ void ScriptBuilder::slotINDIShutdown() sf->setValid(false); return; } - + if (sf->argVal(0) != argShutdownINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argShutdownINDI->deviceName->text()); sf->setValid(true); } @@ -2310,7 +2310,7 @@ void ScriptBuilder::slotINDIShutdown() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "shutdownINDI" ) << endl; } - + } void ScriptBuilder::slotINDISwitchDeviceName() @@ -2324,10 +2324,10 @@ void ScriptBuilder::slotINDISwitchDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSwitchINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSwitchINDI->deviceName->text()); sf->setArg(1, argSwitchINDI->OnButton->isChecked() ? "true" : "false"); sf->setValid(true); @@ -2336,20 +2336,20 @@ void ScriptBuilder::slotINDISwitchDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "switchdownINDI" ) << endl; } - + } void ScriptBuilder::slotINDISwitchDeviceConnection() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "switchINDI" ) { - + if (sf->argVal(1) != (argSwitchINDI->OnButton->isChecked() ? "true" : "false")) setUnsavedChanges( true ); - + sf->setArg(1, argSwitchINDI->OnButton->isChecked() ? "true" : "false"); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); @@ -2358,12 +2358,12 @@ void ScriptBuilder::slotINDISwitchDeviceConnection() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "switchINDI" ) << endl; } - + } void ScriptBuilder::slotINDISetPortDeviceName() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setINDIPort" ) @@ -2373,21 +2373,21 @@ void ScriptBuilder::slotINDISetPortDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetPortINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetPortINDI->deviceName->text()); if (! sf->argVal(1).isEmpty()) sf->setValid(true); else sf->setValid(false); - + } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIPort" ) << endl; } - - + + } void ScriptBuilder::slotINDISetPortDevicePort() @@ -2396,16 +2396,16 @@ void ScriptBuilder::slotINDISetPortDevicePort() if ( sf->name() == "setINDIPort" ) { - + if (argSetPortINDI->devicePort->text().isEmpty()) { sf->setValid(false); return; } - + if (sf->argVal(1) != argSetPortINDI->devicePort->text()) setUnsavedChanges( true ); - + sf->setArg(1, argSetPortINDI->devicePort->text()); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); @@ -2414,7 +2414,7 @@ void ScriptBuilder::slotINDISetPortDevicePort() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIPort" ) << endl; } - + } void ScriptBuilder::slotINDISetTargetCoordDeviceName() @@ -2428,10 +2428,10 @@ void ScriptBuilder::slotINDISetTargetCoordDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetTargetCoordINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetTargetCoordINDI->deviceName->text()); if ((! sf->argVal(1).isEmpty()) && (! sf->argVal(2).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2440,7 +2440,7 @@ void ScriptBuilder::slotINDISetTargetCoordDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDITargetCoord" ) << endl; } - + } void ScriptBuilder::slotINDISetTargetCoordDeviceRA() @@ -2458,7 +2458,7 @@ void ScriptBuilder::slotINDISetTargetCoordDeviceRA() bool ok(false); dms ra = argSetTargetCoordINDI->RaBox->createDms(false, &ok); if ( ok ) { - + if (sf->argVal(1) != TQString( "%1" ).arg( ra.Hours() )) setUnsavedChanges( true ); @@ -2473,7 +2473,7 @@ void ScriptBuilder::slotINDISetTargetCoordDeviceRA() } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDITargetCoord" ) << endl; } - + } void ScriptBuilder::slotINDISetTargetCoordDeviceDEC() @@ -2491,14 +2491,14 @@ void ScriptBuilder::slotINDISetTargetCoordDeviceDEC() bool ok(false); dms dec = argSetTargetCoordINDI->DecBox->createDms(true, &ok); if ( ok ) { - + if (sf->argVal(2) != TQString( "%1" ).arg( dec.Degrees() )) setUnsavedChanges( true ); sf->setArg( 2, TQString( "%1" ).arg( dec.Degrees() ) ); if ( ( ! sf->argVal(0).isEmpty() ) && ( ! sf->argVal(1).isEmpty() )) sf->setValid( true ); else sf->setValid(false); - + } else { sf->setArg( 2, "" ); sf->setValid( false ); @@ -2506,12 +2506,12 @@ void ScriptBuilder::slotINDISetTargetCoordDeviceDEC() } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDITargetCoord" ) << endl; } - + } void ScriptBuilder::slotINDISetTargetNameDeviceName() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setINDITargetName" ) @@ -2521,10 +2521,10 @@ void ScriptBuilder::slotINDISetTargetNameDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetTargetNameINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetTargetNameINDI->deviceName->text()); if ((! sf->argVal(1).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2533,12 +2533,12 @@ void ScriptBuilder::slotINDISetTargetNameDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDITargetName" ) << endl; } - + } void ScriptBuilder::slotINDISetTargetNameObjectName() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setINDITargetName" ) @@ -2548,10 +2548,10 @@ void ScriptBuilder::slotINDISetTargetNameObjectName() sf->setValid(false); return; } - + if (sf->argVal(1) != argSetTargetNameINDI->objectName->text()) setUnsavedChanges( true ); - + sf->setArg(1, argSetTargetNameINDI->objectName->text()); if ((! sf->argVal(0).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2560,12 +2560,12 @@ void ScriptBuilder::slotINDISetTargetNameObjectName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDITargetName" ) << endl; } - + } void ScriptBuilder::slotINDISetActionDeviceName() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setINDIAction" ) @@ -2575,10 +2575,10 @@ void ScriptBuilder::slotINDISetActionDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetActionINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetActionINDI->deviceName->text()); if ((! sf->argVal(1).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2587,9 +2587,9 @@ void ScriptBuilder::slotINDISetActionDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIAction") << endl; } - + } - + void ScriptBuilder::slotINDISetActionName() { ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); @@ -2601,10 +2601,10 @@ void ScriptBuilder::slotINDISetActionName() sf->setValid(false); return; } - + if (sf->argVal(1) != argSetActionINDI->actionName->text()) setUnsavedChanges( true ); - + sf->setArg(1, argSetActionINDI->actionName->text()); if ((! sf->argVal(0).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2618,7 +2618,7 @@ void ScriptBuilder::slotINDISetActionName() void ScriptBuilder::slotINDIWaitForActionDeviceName() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "waitForINDIAction" ) @@ -2628,10 +2628,10 @@ void ScriptBuilder::slotINDIWaitForActionDeviceName() return; sf->setValid(false); } - + if (sf->argVal(0) != argWaitForActionINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argWaitForActionINDI->deviceName->text()); if ((! sf->argVal(1).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2640,9 +2640,9 @@ void ScriptBuilder::slotINDIWaitForActionDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "waitForINDIAction") << endl; } - + } - + void ScriptBuilder::slotINDIWaitForActionName() { ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); @@ -2654,10 +2654,10 @@ void ScriptBuilder::slotINDIWaitForActionName() sf->setValid(false); return; } - + if (sf->argVal(1) != argWaitForActionINDI->actionName->text()) setUnsavedChanges( true ); - + sf->setArg(1, argWaitForActionINDI->actionName->text()); if ((! sf->argVal(0).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2666,7 +2666,7 @@ void ScriptBuilder::slotINDIWaitForActionName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "waitForINDIAction") << endl; } - + } void ScriptBuilder::slotINDISetFocusSpeedDeviceName() @@ -2680,10 +2680,10 @@ void ScriptBuilder::slotINDISetFocusSpeedDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetFocusSpeedINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetFocusSpeedINDI->deviceName->text()); sf->setArg(1, TQString("%1").arg(argSetFocusSpeedINDI->speedIN->value())); sf->setValid(true); @@ -2692,7 +2692,7 @@ void ScriptBuilder::slotINDISetFocusSpeedDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIFocusSpeed") << endl; } - + } void ScriptBuilder::slotINDISetFocusSpeed() @@ -2701,10 +2701,10 @@ void ScriptBuilder::slotINDISetFocusSpeed() if ( sf->name() == "setINDIFocusSpeed" ) { - + if (sf->argVal(1).toInt() != argSetFocusSpeedINDI->speedIN->value()) setUnsavedChanges( true ); - + sf->setArg(1, TQString("%1").arg(argSetFocusSpeedINDI->speedIN->value())); if ((! sf->argVal(0).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2713,7 +2713,7 @@ void ScriptBuilder::slotINDISetFocusSpeed() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIFocusSpeed") << endl; } - + } void ScriptBuilder::slotINDIStartFocusDeviceName() @@ -2727,10 +2727,10 @@ void ScriptBuilder::slotINDIStartFocusDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argStartFocusINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argStartFocusINDI->deviceName->text()); sf->setArg(1, argStartFocusINDI->directionCombo->currentText()); sf->setValid(true); @@ -2739,7 +2739,7 @@ void ScriptBuilder::slotINDIStartFocusDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "StartINDIFocus") << endl; } - + } @@ -2751,7 +2751,7 @@ void ScriptBuilder::slotINDIStartFocusDirection() { if (sf->argVal(1) != argStartFocusINDI->directionCombo->currentText()) setUnsavedChanges( true ); - + sf->setArg(1, argStartFocusINDI->directionCombo->currentText()); if ((! sf->argVal(0).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2760,7 +2760,7 @@ void ScriptBuilder::slotINDIStartFocusDirection() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "startINDIFocus") << endl; } - + } void ScriptBuilder::slotINDISetFocusTimeoutDeviceName() @@ -2774,10 +2774,10 @@ void ScriptBuilder::slotINDISetFocusTimeoutDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetFocusTimeoutINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetFocusTimeoutINDI->deviceName->text()); sf->setArg(1, TQString("%1").arg(argSetFocusTimeoutINDI->timeOut->value())); sf->setValid(true); @@ -2786,7 +2786,7 @@ void ScriptBuilder::slotINDISetFocusTimeoutDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIFocusTimeout") << endl; } - + } void ScriptBuilder::slotINDISetFocusTimeout() @@ -2797,7 +2797,7 @@ void ScriptBuilder::slotINDISetFocusTimeout() { if (sf->argVal(1).toInt() != argSetFocusTimeoutINDI->timeOut->value()) setUnsavedChanges( true ); - + sf->setArg(1, TQString("%1").arg(argSetFocusTimeoutINDI->timeOut->value())); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); @@ -2806,7 +2806,7 @@ void ScriptBuilder::slotINDISetFocusTimeout() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIFocusTimeout") << endl; } - + } void ScriptBuilder::slotINDISetGeoLocationDeviceName() @@ -2820,10 +2820,10 @@ void ScriptBuilder::slotINDISetGeoLocationDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetGeoLocationINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetGeoLocationINDI->deviceName->text()); if ((! sf->argVal(1).isEmpty()) && (! sf->argVal(2).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -2832,7 +2832,7 @@ void ScriptBuilder::slotINDISetGeoLocationDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIGeoLocation" ) << endl; } - + } void ScriptBuilder::slotINDISetGeoLocationDeviceLong() @@ -2850,7 +2850,7 @@ void ScriptBuilder::slotINDISetGeoLocationDeviceLong() bool ok(false); dms longitude = argSetGeoLocationINDI->longBox->createDms(true, &ok); if ( ok ) { - + if (sf->argVal(1) != TQString( "%1" ).arg( longitude.Degrees())) setUnsavedChanges( true ); @@ -2865,7 +2865,7 @@ void ScriptBuilder::slotINDISetGeoLocationDeviceLong() } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIGeoLocation" ) << endl; } - + } void ScriptBuilder::slotINDISetGeoLocationDeviceLat() @@ -2883,14 +2883,14 @@ void ScriptBuilder::slotINDISetGeoLocationDeviceLat() bool ok(false); dms latitude = argSetGeoLocationINDI->latBox->createDms(true, &ok); if ( ok ) { - + if (sf->argVal(2) != TQString( "%1" ).arg( latitude.Degrees())) setUnsavedChanges( true ); sf->setArg( 2, TQString( "%1" ).arg( latitude.Degrees() ) ); if ( ( ! sf->argVal(0).isEmpty() ) && ( ! sf->argVal(1).isEmpty() )) sf->setValid( true ); else sf->setValid(false); - + } else { sf->setArg( 2, "" ); sf->setValid( false ); @@ -2898,7 +2898,7 @@ void ScriptBuilder::slotINDISetGeoLocationDeviceLat() } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIGeoLocation" ) << endl; } - + } void ScriptBuilder::slotINDIStartExposureDeviceName() @@ -2912,10 +2912,10 @@ void ScriptBuilder::slotINDIStartExposureDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argStartExposureINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argStartExposureINDI->deviceName->text()); sf->setArg(1, TQString("%1").arg(argStartExposureINDI->timeOut->value())); sf->setValid(true); @@ -2924,7 +2924,7 @@ void ScriptBuilder::slotINDIStartExposureDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "startINDIExposure") << endl; } - + } void ScriptBuilder::slotINDIStartExposureTimeout() @@ -2933,10 +2933,10 @@ void ScriptBuilder::slotINDIStartExposureTimeout() if ( sf->name() == "startINDIExposure" ) { - + if (sf->argVal(1).toInt() != argStartExposureINDI->timeOut->value()) setUnsavedChanges( true ); - + sf->setArg(1, TQString("%1").arg(argStartExposureINDI->timeOut->value())); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); @@ -2945,12 +2945,12 @@ void ScriptBuilder::slotINDIStartExposureTimeout() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "startINDIExposure") << endl; } - + } void ScriptBuilder::slotINDISetUTCDeviceName() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setINDIUTC" ) @@ -2960,10 +2960,10 @@ void ScriptBuilder::slotINDISetUTCDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetUTCINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetUTCINDI->deviceName->text()); if (! sf->argVal(1).isEmpty()) sf->setValid(true); else sf->setValid(false); @@ -2972,8 +2972,8 @@ void ScriptBuilder::slotINDISetUTCDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIUTC" ) << endl; } - - + + } void ScriptBuilder::slotINDISetUTC() @@ -2982,16 +2982,16 @@ void ScriptBuilder::slotINDISetUTC() if ( sf->name() == "setINDIUTC" ) { - + if (argSetUTCINDI->UTC->text().isEmpty()) { sf->setValid(false); return; } - + if (sf->argVal(1) != argSetUTCINDI->UTC->text()) setUnsavedChanges( true ); - + sf->setArg(1, argSetUTCINDI->UTC->text()); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); @@ -3000,12 +3000,12 @@ void ScriptBuilder::slotINDISetUTC() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIUTC" ) << endl; } - + } void ScriptBuilder::slotINDISetScopeActionDeviceName() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setINDIScopeAction" ) @@ -3015,10 +3015,10 @@ void ScriptBuilder::slotINDISetScopeActionDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetScopeActionINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetScopeActionINDI->deviceName->text()); sf->setArg(1, argSetScopeActionINDI->actionCombo->currentText()); sf->setINDIProperty("CHECK"); @@ -3028,7 +3028,7 @@ void ScriptBuilder::slotINDISetScopeActionDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIScopeAction" ) << endl; } - + } void ScriptBuilder::slotINDISetScopeAction() @@ -3037,10 +3037,10 @@ void ScriptBuilder::slotINDISetScopeAction() if ( sf->name() == "setINDIScopeAction" ) { - + if (sf->argVal(1) != argSetScopeActionINDI->actionCombo->currentText()) setUnsavedChanges( true ); - + sf->setArg(1, argSetScopeActionINDI->actionCombo->currentText()); sf->setINDIProperty("CHECK"); if ((! sf->argVal(0).isEmpty())) sf->setValid(true); @@ -3050,12 +3050,12 @@ void ScriptBuilder::slotINDISetScopeAction() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIScopeAction") << endl; } - + } void ScriptBuilder::slotINDISetFrameTypeDeviceName() { - + ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setINDIFrameType" ) @@ -3065,10 +3065,10 @@ void ScriptBuilder::slotINDISetFrameTypeDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetFrameTypeINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetFrameTypeINDI->deviceName->text()); sf->setArg(1, argSetFrameTypeINDI->typeCombo->currentText()); sf->setValid(true); @@ -3077,7 +3077,7 @@ void ScriptBuilder::slotINDISetFrameTypeDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIFrameType" ) << endl; } - + } void ScriptBuilder::slotINDISetFrameType() @@ -3086,10 +3086,10 @@ void ScriptBuilder::slotINDISetFrameType() if ( sf->name() == "setINDIFrameType" ) { - + if (sf->argVal(1) != argSetFrameTypeINDI->typeCombo->currentText()) setUnsavedChanges( true ); - + sf->setArg(1, argSetFrameTypeINDI->typeCombo->currentText()); if ((! sf->argVal(0).isEmpty())) sf->setValid(true); else sf->setValid(false); @@ -3098,7 +3098,7 @@ void ScriptBuilder::slotINDISetFrameType() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDIFrameType") << endl; } - + } void ScriptBuilder::slotINDISetCCDTempDeviceName() @@ -3112,10 +3112,10 @@ void ScriptBuilder::slotINDISetCCDTempDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetCCDTempINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetCCDTempINDI->deviceName->text()); sf->setArg(1, TQString("%1").arg(argSetCCDTempINDI->temp->value())); sf->setValid(true); @@ -3124,7 +3124,7 @@ void ScriptBuilder::slotINDISetCCDTempDeviceName() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDICCDTemp") << endl; } - + } void ScriptBuilder::slotINDISetCCDTemp() @@ -3133,10 +3133,10 @@ void ScriptBuilder::slotINDISetCCDTemp() if ( sf->name() == "setINDICCDTemp" ) { - + if (sf->argVal(1).toInt() != argSetCCDTempINDI->temp->value()) setUnsavedChanges( true ); - + sf->setArg(1, TQString("%1").arg(argSetCCDTempINDI->temp->value())); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); @@ -3145,7 +3145,7 @@ void ScriptBuilder::slotINDISetCCDTemp() { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setINDICCDTemp") << endl; } - + } void ScriptBuilder::slotINDISetFilterNumDeviceName() @@ -3160,10 +3160,10 @@ void ScriptBuilder::slotINDISetFilterNumDeviceName() sf->setValid(false); return; } - + if (sf->argVal(0) != argSetFilterNumINDI->deviceName->text()) setUnsavedChanges( true ); - + sf->setArg(0, argSetFilterNumINDI->deviceName->text()); sf->setArg(1, TQString("%1").arg(argSetFilterNumINDI->filter_num->value())); sf->setValid(true); @@ -3181,10 +3181,10 @@ void ScriptBuilder::slotINDISetFilterNum() if ( sf->name() == "setINDIFilterNum" ) { - + if (sf->argVal(1).toInt() != argSetFilterNumINDI->filter_num->value()) setUnsavedChanges( true ); - + sf->setArg(1, TQString("%1").arg(argSetFilterNumINDI->filter_num->value())); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); @@ -3196,5 +3196,5 @@ void ScriptBuilder::slotINDISetFilterNum() } - + #include "scriptbuilder.moc" -- cgit v1.2.1