diff options
author | Georg Zotti <Georg.Zotti@univie.ac.at> | 2023-01-03 01:55:50 +0100 |
---|---|---|
committer | Georg Zotti <Georg.Zotti@univie.ac.at> | 2023-01-03 01:55:50 +0100 |
commit | 382a79db8dac1ee6d8c464a08d10056eedc18631 (patch) | |
tree | 62288b2c88990c3160ae0b915b74f846c6e1ef25 | |
parent | da83137bd6f04196da1bdbacd7f391292656c0e4 (diff) |
Added more documentationfix/Unified_ObsList
- Also describe the current problem...
-rw-r--r-- | src/gui/ObsListDialog.cpp | 14 | ||||
-rw-r--r-- | src/gui/ObsListDialog.hpp | 63 |
2 files changed, 73 insertions, 4 deletions
diff --git a/src/gui/ObsListDialog.cpp b/src/gui/ObsListDialog.cpp index 9688d9a935..22618ef68f 100644 --- a/src/gui/ObsListDialog.cpp +++ b/src/gui/ObsListDialog.cpp @@ -451,15 +451,19 @@ void ObsListDialog::loadSelectedList() // Caveat - Please make the code more readable! // We assign KEY_TYPE to item.objtype and KEY_OBJECTS_TYPE to item.type. + // Compare this to the same passage when importing bookmarks. item.objtype = objectMap.value(KEY_TYPE).toString(); //item.type = objectMap.value(KEY_OBJECTS_TYPE).toString(); item.ra = objectMap.value(KEY_RA).toString(); item.dec = objectMap.value(KEY_DEC).toString(); - // CAVEAT! It seems searching for objtype is too strong. "Star"s are not found! + // CAVEAT! The implementation in the 1.* series has a bug here, maybe caused by just too much confusion about type, objtype and trying to be smart. + // It seems searching for objtype is too strong. Compare this to the same passage when importing bookmarks. + // "Star"s are not found! Likewise, "cubewanos" cannot be found like that! They are "Planet"s, according to SolarSystem::getStelObjectType() called by findAndSelect(.,.) if (objectMgr->findAndSelect(item.designation, item.objtype) && !objectMgr->getSelectedObject().isEmpty()) { + qDebug() << "Horray, we have found objType" << item.objtype << "for" << item.designation; const QList<StelObjectP> &selectedObject = objectMgr->getSelectedObject(); double ra, dec; StelUtils::rectToSphe(&ra, &dec, selectedObject[0]->getJ2000EquatorialPos(core)); @@ -470,7 +474,7 @@ void ObsListDialog::loadSelectedList() item.dec = StelUtils::radToDmsStr(dec, false).trimmed(); item.type = selectedObject[0]->getObjectTypeI18n(); } - else // repeat the same with findAndSelect with any type. + else // THEREFORE: repeat the same code with findAndSelect with any type. if (objectMgr->findAndSelect(item.designation) && !objectMgr->getSelectedObject().isEmpty()) { const QList<StelObjectP> &selectedObject = objectMgr->getSelectedObject(); @@ -482,6 +486,8 @@ void ObsListDialog::loadSelectedList() if (item.dec.isEmpty()) item.dec = StelUtils::radToDmsStr(dec, false).trimmed(); item.type = selectedObject[0]->getObjectTypeI18n(); + qDebug() << "item.objType " << item.objtype << "changed to " << selectedObject[0]->getObjectType(); + item.objtype = selectedObject[0]->getObjectType(); } else { @@ -597,8 +603,8 @@ QHash<QString, ObsListDialog::observingListItem> ObsListDialog::loadBookmarksFil if (objectMgr->findAndSelect(item.designation) && !objectMgr->getSelectedObject().isEmpty()) { const QList<StelObjectP> &selectedObject = objectMgr->getSelectedObject(); - item.type = selectedObject[0]->getType(); - item.objtype = selectedObject[0]->getObjectType(); + item.type = selectedObject[0]->getType(); // Assign class name + item.objtype = selectedObject[0]->getObjectType(); // Assign a detailed object type description item.jd = bookmarkMap.value(KEY_JD).toDouble(); if (item.jd!=0.) { diff --git a/src/gui/ObsListDialog.hpp b/src/gui/ObsListDialog.hpp index 6f171f3736..4095e644c9 100644 --- a/src/gui/ObsListDialog.hpp +++ b/src/gui/ObsListDialog.hpp @@ -42,11 +42,74 @@ //! On retrieval, the same optional elements can again be selected, so you can retrieve an object without stored time or location, if that is meaningful. //! If location or landscape IDs cannot be found, they are not changed. //! +//! An observingList.json looks like this: +//! { +//! "defaultListOlud": "{6d297068-a644-4d1b-9d2d-9c2dd64eef53}", +//! "observingLists": { +//! "{84744f7b-c353-45b0-8394-69af2a1e0917}": { +//! "creation date": "2022-09-29 20:05:07", +//! "description": "Bookmarks of previous Stellarium version.", +//! "name": "bookmarks list", +//! "objects": [ +//! { +//! "constellation": "Leo", +//! "dec": "+14°34'15\"", +//! "designation": "HIP 57632", +//! "fov": 0, +//! "isVisibleMarker": false, +//! "jd": 0, +//! "landscapeID": "", +//! "location": "", +//! "magnitude": "2.10", +//! "nameI18n": "Denebola", +//! "ra": "11h49m05.0s", +//! "type": "Star" +//! }, +//! ... <other objects> +//! ], +//! "sorting": "" +//! }, +//! "{bd40274c-a321-40c1-a6f3-bc8f11026326}": { +//! "creation date": "2022-12-21 11:12:39", +//! "description": "test of unification", +//! "name": "mine_edited", +//! "objects": [ +//! { +//! "constellation": "Cyg", +//! "dec": "+45°16'59\"", +//! "designation": "HIP 102098", +//! "fov": 0, +//! "isVisibleMarker": true, +//! "jd": 0, +//! "landscapeID": "", +//! "location": "", +//! "magnitude": "1.25", +//! "nameI18n": "Deneb", +//! "ra": "20h41m24.4s", +//! "type": "double star, pulsating variable star" +//! }, +//! ... <other objects> +//! ], +//! "sorting": "" +//! }, +//! ... <other observingLists> +//! }, +//! "shortName": "Observing list for Stellarium", +//! "version": "2.0" +//! } +//! +//! //! Updated for 23.1: Integrated functions of extra edit dialog, deep refactoring. //! You cannot delete the default list. Choose another list as default before deleting the displayed one. //! You cannot delete the last list. //! Importing a JSON file with observingLists will import all lists and unconditionally overwrite existing lists with the same OLUD. //! Exporting writes an observingList file with only the currently displayed list. +//! +//! Attempt to fix a confusion introduced in the 1.* series: +//! The ObsList has entries +//! - "designation": The catalog number (DSO), HIP number (star), or canonical name (planet) +//! - "nameI18n": translated name for display. Actually this is bad in case of exchange. +//! - "type": As given by ObjectP-> class Ui_obsListDialogForm; |