Kstars
observinglist.cpp
68 : QDialog((QWidget *)KStars::Instance()), LogObject(nullptr), m_CurrentObject(nullptr), isModified(false), m_dl(nullptr),
92 QStringList() << i18n("Name") << i18n("Alternate Name") << i18nc("Right Ascension", "RA (J2000)")
96 QStringList() << i18n("Name") << i18n("Alternate Name") << i18nc("Right Ascension", "RA (J2000)")
136 connect(ui->SessionView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
177 .scaled(ui->ImagePreview->width(), ui->ImagePreview->height(), Qt::KeepAspectRatio, Qt::FastTransformation);
210 // qCDebug(KSTARS) << "Updating altitude for " << p.ra().toHMSString() << " " << p.dec().toDMSString() << " alt = " << p.alt().toDMSString() << " info to " << itemText;
262 KSNotification::sorry(i18n("Stars and objects whose names KStars does not know are not supported in the observing lists"));
284 _obj->clone()); // Use a clone in case the original SkyObject is deleted due to change in catalog configuration.
289 KStars::Instance()->statusBar()->showMessage(i18n("%1 is already in the session plan.", finalObjectName), 0);
293 // JM: If we are loading observing list from disk, solar system objects magnitudes are not calculated until later
295 if ((obj->type() == SkyObject::COMET || obj->type() == SkyObject::ASTEROID || obj->type() == SkyObject::MOON ||
306 smag = QString::number(obj->mag(), 'f', 2); // The lower limit to avoid display of unrealistic comet magnitudes
319 // Fill itemlist with items that are common to both wishlist additions and session plan additions
324 keyItem->setData(QVariant::fromValue<void *>(static_cast<void *>(obj.data())), Qt::UserRole + 1);
326 << keyItem // NOTE: The rest of the methods assume that the SkyObject pointer is available in the first column!
345 // - Weight by declination - latitude (in the northern hemisphere, southern objects get higher precedence)
347 SkyPoint p = obj->recomputeHorizontalCoords(KStarsDateTime::currentDateTimeUtc(), geo); // Current => now
352 KStars::Instance()->statusBar()->showMessage(i18n("Added %1 to observing list.", finalObjectName), 0);
382 KStarsData::Instance()->skyComposite()->constellationBoundary()->constellationName(obj.data())))
390 KStars::Instance()->statusBar()->showMessage(i18n("Added %1 to session list.", finalObjectName), 0);
402 else if (sessionView) //else if is needed as clickedObject should not be removed from the session list.
511 getActiveSortModel()->mapSelectionToSource(getActiveView()->selectionModel()->selection()).indexes();
582 QString ImagePath = KSPaths::locate(QStandardPaths::AppLocalDataLocation, m_currentImageFileName);
590 ImagePreviewHash[o.data()] = QPixmap(ksdi.getFileName()).scaledToHeight(ui->ImagePreview->width());
592 //ui->ImagePreview->setPixmap(QPixmap(ksdi.getFileName()).scaledToHeight(ui->ImagePreview->width()));
621 labelText += ":</b> " + i18nc("%1 magnitude of object, %2 type of sky object (planet, asteroid "
698 KSNotification::error(i18n("Mount %1 is offline. Please connect and retry again.", oneDevice->getDeviceName()));
702 auto mount = dynamic_cast<ISD::Mount *>(oneDevice->getConcreteDevice(INDI::BaseDevice::TELESCOPE_INTERFACE));
776 i18n("Specify a list of objects with one object on each line to add. The names must be understood to KStars, or if the internet resolver is enabled in settings, to the CDS Sesame resolver. Objects that are internet resolved will be added to the database."),
808 i18np("Batch add: %1 object not found", "Batch add: %1 objects not found", failedObjects.size()),
809 i18np("%1 object could not be found in the database or resolved, and hence could not be added. See the details for more.",
810 "%1 objects could not be found in the database or resolved, and hence could not be added. See the details for more.",
830 // TODO: Think and see if there's a more efficient way to do this. I can't seem to think of any, but this code looks like it could be improved. - Akarsh
833 m_SessionSortModel->mapSelectionToSource(ui->SessionView->selectionModel()->selection()).indexes() :
834 m_WishListSortModel->mapSelectionToSource(ui->WishListView->selectionModel()->selection()).indexes());
883 QUrl fileURL = QFileDialog::getOpenFileUrl(KStars::Instance(), i18nc("@title:window", "Open Observing List"), QUrl(),
938 KSNotification::sorry(i18n("The specified file is invalid. We expect an XML file based on the OpenAstronomyLog schema."));
999 if (KMessageBox::questionYesNo(this, message, i18n("Save Current session?"), KStandardGuiItem::save(),
1011 QUrl fileURL = QFileDialog::getSaveFileUrl(KStars::Instance(), i18nc("@title:window", "Save Observing List"), QUrl(),
1028 &fileContents); // We first write to a QString to prevent truncating the file in case there is a crash.
1055 f.setFileName(QDir(KSPaths::writableLocation(QStandardPaths::AppLocalDataLocation)).filePath("wishlist.obslist"));
1058 qWarning() << "Cannot save wish list to file!"; // TODO: This should be presented as a message box to the user
1060 i18n("Could not open the observing wishlist file %1 for writing. Your wishlist changes will not be saved. Check if the location is writable and not full.",
1072 f.setFileName(QDir(KSPaths::writableLocation(QStandardPaths::AppLocalDataLocation)).filePath("wishlist.obslist"));
1107 i18n("If you cancel this operation, your wishlist will be truncated and the following objects will be removed from the wishlist when you exit KStars. Are you sure this is okay?"),
1149 i18np("Observing wishlist truncated: %1 object not found", "Observing wishlist truncated: %1 objects not found", failedObjects.size()),
1150 i18np("%1 object could not be found in the database, and will be removed from the observing wish list. We recommend that you copy its name as a backup so you can add it later.", "%1 objects could not be found in the database, and will be removed from the observing wish list. We recommend that you copy the detailed list as a backup, whereby you can later use the Batch Add feature in the Observation Planner to add them back using internet search.", failedObjects.size()),
1176 if (KMessageBox::warningYesNo(nullptr, message, i18n("Could Not Open File"), KGuiItem(i18n("Try Different")),
1237 ui->avt->setDawnDuskTimes(ksal->getDawnAstronomicalTwilight(), ksal->getDuskAstronomicalTwilight());
1301 //Creating a copy of the lists, we can't use the original lists as they'll keep getting modified as the loop iterates
1340 int width = QInputDialog::getInt(this, i18n("Customized DSS Download"), i18n("Specify image width (arcminutes): "),
1352 QInputDialog::getItem(this, i18n("Customized DSS Download"), i18n("Specify version: "), strList, 0, false, &ok);
1354 QUrl srcUrl(KSDssDownloader::getDSSURL(currentObject()->ra0(), currentObject()->dec0(), width, height, "gif",
1368 o == currentObject()); // FIXME: Meaningless to operate on m_currentImageFileName unless o == currentObject()!
1380 qWarning() << "FIXME: Removed support for SDSS. Until reintroduction, we will supply a DSS image";
1381 std::function<void(bool)> slot = std::bind(&ObservingList::downloadReady, this, std::placeholders::_1);
1400 if( QFile( QDir(KSPaths::writableLocation(QStandardPaths::AppLocalDataLocation)).filePath(m_currentImageFileName) ).size() > 13000)
1404 ui->ImagePreview->setPixmap(QPixmap(getCurrentImagePath()).scaledToHeight(ui->ImagePreview->width()));
1427 QString currentImagePath = KSPaths::locate(QStandardPaths::AppLocalDataLocation, m_currentImageFileName);
1432 currentImagePath = KSPaths::locate(QStandardPaths::AppLocalDataLocation, m_currentThumbImageFileName);
1445 m_currentImageFileName = "Image_J" + RAString.remove(' ').remove( ':' ) + DecString.remove(' ').remove( ':' ); // Note: Changed naming convention to standard 2016-08-25 asimha; old images shall have to be re-downloaded.
1455 if ( QFile::exists( imagePath)) // New convention -- append filename extension so file is usable on Windows etc.
1465 QString currentImagePath = KSPaths::locate(QStandardPaths::AppLocalDataLocation, m_currentImageFileName);
1471 return QDir(KSPaths::writableLocation(QStandardPaths::AppLocalDataLocation)).filePath(m_currentImageFileName);
1489 // QUrl url( ( Options::obsListPreferDSS() ) ? DSSUrl : SDSSUrl ); // FIXME: We have removed SDSS support!
1524 if (KMessageBox::warningYesNo(nullptr, i18n("This will delete all saved images. Are you sure you want to do this?"),
1539 // TODO: Probably, there should be a different directory for cached images in the observing list.
1622 QPointer<ThumbnailPicker> tp = new ThumbnailPicker(currentObject(), *pm, this, 200, 200, i18n("Image Chooser"));
1653 QFileInfo const f(QDir(KSPaths::writableLocation(QStandardPaths::AppLocalDataLocation)).filePath(
1691 m_WishListSortModel->mapSelectionToSource(ui->WishListView->selectionModel()->selection()).indexes();
1700 true); // FIXME: Better if there is a QSharedPointer override for this, although the check will ensure that we don't duplicate.
1758 // qCDebug(KSTARS) << "Updating altitudes in observation planner @ JD - J2000 = " << double( now.djd() - J2000 );
int getInt(QWidget *parent, const QString &title, const QString &label, int value, int min, int max, int step, bool *ok, Qt::WindowFlags flags)
bool removeRow(int row, const QModelIndex &parent)
QString filePath() const const
void append(const T &value)
static KStarsDateTime currentDateTime()
Definition: kstarsdatetime.cpp:73
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
Definition: kstarsdatetime.h:35
QUrl getOpenFileUrl(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes)
QString readAll()
QString version
Used for DSS – Indicates which version of scans to pull.
Definition: ksdssimage.h:65
void slotClearList()
slotClearList Remove all objects from current list
Definition: observinglist.cpp:958
void setDefaultButton(QPushButton *button)
void slotSaveAllImages()
Downloads the images of all the objects in the session list Note: This downloads the SDSS image,...
Definition: observinglist.cpp:1474
void selectObject(const SkyObject *o)
make a selection in the session view
Definition: observinglist.cpp:1716
SkyPoint recomputeHorizontalCoords(const KStarsDateTime &dt, const GeoLocation *geo) const
Like recomputeCoords, but also calls EquatorialToHorizontal before returning.
Definition: skyobject.cpp:329
UserRole
Definition: detaildialog.h:70
MouseButtonRelease
QString number(int n, int base)
void slotGetImage(bool _dss=false, const SkyObject *o=nullptr)
Downloads the corresponding DSS or SDSS image from the web and displays it.
Definition: observinglist.cpp:1363
ReadOnly
bool remove()
QString text() const const
QString getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &items, int current, bool editable, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
Qt::MouseButton button() const const
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
a dms subclass that caches its sine and cosine values every time the angle is changed.
Definition: cachingdms.h:18
QStringList split(const QString &sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
int column() const const
T value() const const
void slotRemoveObject(const SkyObject *o=nullptr, bool session=false, bool update=false)
Remove skyobject from the observing list.
Definition: observinglist.cpp:396
bool hasNext() const const
void setClickedPoint(const SkyPoint *f)
Set the ClickedPoint to the skypoint given as an argument.
Definition: skymap.cpp:996
QIcon fromTheme(const QString &name)
SkyObject * clickedObject() const
Retrieve the object nearest to a mouse click event.
Definition: skymap.h:243
QString getObjectName(const SkyObject *o, bool translated=true)
get object name.
Definition: observinglist.cpp:1737
QImage scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const const
static KStarsDateTime currentDateTimeUtc()
Definition: kstarsdatetime.cpp:82
static CatalogObject * resolveAndAdd(CatalogsDB::DBManager &db_manager, const QString &query)
Resolves an object using the internet and adds it to the database.
Definition: finddialog.cpp:460
QString next()
const SkyObjectUserdata::Data & getUserData(const QString &name)
Get a reference to the user data of an object with the name name.
Definition: kstarsdata.cpp:1755
RightButton
bool exists() const const
double findAltitude(SkyPoint *p, double hour=0)
Return the altitude of the given SkyObject for the given hour.
Definition: observinglist.cpp:1251
void EquatorialToHorizontal(const CachingDms *LST, const CachingDms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates,...
Definition: skypoint.cpp:77
KGuiItem save()
void setDetailedText(const QString &text)
ButtonCode warningYesNo(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Options(Notify|Dangerous))
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
TopAxis
Lines
void showMessage(const QString &message, int timeout)
void setTime(const QTime &t)
Assign the Time according to a QTime object.
Definition: kstarsdatetime.cpp:161
bool isValid() const const
Tool
QVariant data(int role) const const
int size() const const
void slotSaveSessionAs(bool nativeSave=true)
save the current observing session plan to disk, specify filename.
Definition: observinglist.cpp:1006
KeepAspectRatio
Interactive
QString i18n(const char *text, const TYPE &arg...)
Definition: indimount.h:26
bool atEnd() const const
void slotCustomDSS()
Present the user with options to get the right DSS image for the job.
Definition: observinglist.cpp:1331
void slotSaveSession(bool nativeSave=true)
save the current session
Definition: observinglist.cpp:1159
void slotRemoveSelectedObjects()
Remove skyobjects which are highlighted in the observing list tool from the observing list.
Definition: observinglist.cpp:460
void slotAddObject(const SkyObject *o=nullptr, bool session=false, bool update=false)
add a new object to list o pointer to the object to add to the list session flag toggle adding the ob...
Definition: observinglist.cpp:242
bool eventFilter(QObject *obj, QEvent *event) override
This is the declaration of the event filter function which is installed on the KImageFilePreview and ...
Definition: observinglist.cpp:1561
BottomAxis
bool isEmpty() const const
QUrl getSaveFileUrl(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes)
QUrl fromLocalFile(const QString &localFile)
ArrowCursor
QString readLine(qint64 maxlen)
void saveThumbImage()
saves a thumbnail image for the details dialog from the downloaded image
Definition: observinglist.cpp:1651
void saveImage(QUrl url, QString filename, const SkyObject *o=nullptr)
saves the image synchronously from a given URL into a given file url the url from which the image has...
Definition: observinglist.cpp:1496
void setClickedObject(SkyObject *o)
Set the ClickedObject pointer to the argument.
Definition: skymap.cpp:331
bool isEmpty() const const
QString toLocalFile() const const
int globalX() const const
int globalY() const const
QString getCurrentImagePath()
Returns a path to the current image, or a writable image.
Definition: observinglist.cpp:1463
std::pair< bool, QString > updateUserLog(const QString &name, const QString &newLog)
Update the user log of the object with the name to contain newLog (find and replace).
Definition: kstarsdata.cpp:1691
void slotDeleteAllImages()
Removes all the save DSS/SDSS images from the disk.
Definition: observinglist.cpp:1522
QString getMultiLineText(QWidget *parent, const QString &title, const QString &label, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
GeoCoordinates geo(const QVariant &location)
Accepted
QString join(const QString &separator) const const
This is the main window for KStars. In addition to the GUI elements, the class contains the program c...
Definition: kstars.h:92
Key_Delete
void setupUi(QWidget *widget)
int indexOf(QStringView str, int from) const const
void setCurrentImage(const SkyObject *o)
Sets the image parameters for the current object o The passed object for setting the parameters.
Definition: observinglist.cpp:1417
void plot(SkyObject *o)
Plot the SkyObject's Altitude vs Time in the AVTPlotWidget.
Definition: observinglist.cpp:1218
QPixmap scaledToHeight(int height, Qt::TransformationMode mode) const const
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
QString & remove(int position, int n)
QStatusBar * statusBar() const const
int row() const const
QString i18np(const char *singular, const char *plural, const TYPE &arg...)
QString fileName() const const
QString toLower() const const
void addPoint(const QPointF &p, const QString &label=QString(), double barWidth=0.0)
virtual int exec() override
QPixmap scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const const
SkyObject * findObjectByName(QString name)
return the object with the name as the passed QString from the Session List, return null otherwise
Definition: observinglist.cpp:1706
AppLocalDataLocation
void slotSetTime()
Takes the time from the QTimeEdit box and sets it as the time parameter in the tableview of the Sessi...
Definition: observinglist.cpp:1323
KIOCORE_EXPORT CopyJob * move(const QList< QUrl > &src, const QUrl &dest, JobFlags flags=DefaultFlags)
void slotUpdateAltitudes()
Recalculate and update the values of the altitude in the wishlist for the current time.
Definition: observinglist.cpp:1754
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString filePath(const QString &fileName) const const
virtual QVariant data(int role) const const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
Definition: obslistpopupmenu.h:18
void saveCurrentList()
If the current list has unsaved changes, ask the user about saving it.
Definition: observinglist.cpp:990
void slotOALExport()
Export a target list to the oal compliant format.
Definition: observinglist.cpp:1678
QTime transitTime(const KStarsDateTime &dt, const GeoLocation *geo) const
The same iteration technique described in riseSetTime() is used here.
Definition: skyobject.cpp:239
QChar * data()
virtual int rowCount(const QModelIndex &parent) const const override
void forceUpdate(bool now=false)
Recalculates the positions of objects in the sky, and then repaints the sky map.
Definition: skymap.cpp:1186
void slotLocation()
Opens the Location dialog to set the GeoLocation for the sessionlist.
Definition: observinglist.cpp:1286
virtual void setData(const QVariant &value, int role)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
void slotAddToEkosScheduler()
slotAddToEkosScheduler Add object to Ekos scheduler
Definition: observinglist.cpp:714
StrongFocus
QStandardItem * item(int row, int column) const const
FastTransformation
ButtonCode questionYesNo(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Notify)
void slotChangeTab(int index)
toggle the setEnabled flags according to current view set the m_currentItem to nullptr and clear sele...
Definition: observinglist.cpp:1263
static QString getDSSURL(const SkyPoint *const p, const QString &version="all", struct KSDssImage::Metadata *md=nullptr)
High-level method to create a URL to obtain a DSS image for a given SkyPoint.
Definition: ksdssdownloader.cpp:49
bool save(const QString &fileName, const char *format, int quality) const const
QString message
void slotEyepieceView(SkyPoint *sp, const QString &imagePath=QString())
Show the eyepiece view tool.
Definition: kstarsactions.cpp:1815
void slotNewSelection()
Tasks needed when changing the selected object Save the user log of the previous selected object,...
Definition: observinglist.cpp:495
WA_LayoutUsesWidgetRect
KGuiItem discard()
white
Sort best observation times by reimplementing lessThan() to work on the transit times of objects.
Definition: sessionsortfilterproxymodel.h:27
void setSaveImagesButton()
decides on whether to enable the SaveImages button or not
Definition: observinglist.cpp:1550
void slotUpdate()
Updates the tableviews for the new geolocation and date.
Definition: observinglist.cpp:1297
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:56 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:56 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.