From 9d357eff70433c22019f3dc435b38fa570880bf0 Mon Sep 17 00:00:00 2001 From: ea4k Date: Thu, 10 Feb 2022 20:17:18 +0100 Subject: [PATCH] Merge --- Changelog | 991 ++++++++++++ TODO | 419 +++++ main.cpp | 423 +++++ src/dataproxy_sqlite.cpp | 153 ++ src/dataproxy_sqlite.h | 4 + src/klog.qrc | 1 + src/klogdefinitions.h | 6 + src/locator.cpp | 256 +-- src/locator.h | 32 +- src/mainwindow.cpp | 27 +- src/mainwindow.h | 9 +- src/qml/mapqmlfile.qml | 104 ++ src/src.pro | 20 +- src/translations/klog_de.ts | 1372 ++++++++--------- src/utilities.h | 2 +- src/widgets/map/mapwidget.cpp | 145 ++ src/widgets/map/mapwidget.h | 68 + src/widgets/map/mapwindowwidget.cpp | 295 ++++ .../map/mapwindowwidget.h} | 88 +- src/worldmapwidget.cpp | 351 ----- tests/tests.pro | 1 + tests/tst_locator/tst_locator.cpp | 271 ++++ tests/tst_locator/tst_locator.pro | 27 + tests/world/tst_world.cpp | 2 +- 24 files changed, 3847 insertions(+), 1220 deletions(-) create mode 100644 Changelog create mode 100644 TODO create mode 100644 main.cpp create mode 100644 src/qml/mapqmlfile.qml create mode 100644 src/widgets/map/mapwidget.cpp create mode 100644 src/widgets/map/mapwidget.h create mode 100644 src/widgets/map/mapwindowwidget.cpp rename src/{worldmapwidget.h => widgets/map/mapwindowwidget.h} (52%) delete mode 100644 src/worldmapwidget.cpp create mode 100644 tests/tst_locator/tst_locator.cpp create mode 100644 tests/tst_locator/tst_locator.pro diff --git a/Changelog b/Changelog new file mode 100644 index 00000000..5c0cbf50 --- /dev/null +++ b/Changelog @@ -0,0 +1,991 @@ +Jan 2022 - 1.8.7 +- Bugfix: Removed the hamlib test from the KLog start that was causing big delays. +- Bugfix: Serial speed was not saved to config file. +- Bugfix: eQSL Uploads problem solved (Closes #406). +- Bugfix: Connection to the radios were not being done properly (Closes #407) (Closes #379). +- Bugfix: SplitCheckBox was checked when coming from Setup (Closes #377). +- Bugfix: Entering a QRZ cleared the DX Gridsquare if it was previously entered (Closes #357). +- Bugfix: Imported QSOs add the default electronic QSL send info if configured. +- Bugfix: DXCC widget shows last Entity status after modifying a QSO (Closes #412). +- Bugfix: Hamlib is now stopped while editing a QSO (Closes #414). +- Bugfix: Hamlib on serial devices works ok. (Closes #355). +- Bugfix: RST is not changed on mode change when editing. (Closes #423). +- New feature: Added a Manual Mode checkbox to disable quickly hamlib & wsjtx integration. +- New feature: Added "Save" and "Cancel" button when editing a recorded QSO. +- Update: Developers mailing list address changed to klog@groups.io (Closes #421). + +Jan 2022 - 1.8.6 +- Bugfix: Net rig & FLRig hamlib connections were not working propertly. (Closes #339) (TNX W5PNY) +- Bugfix: Some prefixes were not properly detected. (Closes #371) (Closes #367). +- Bugfix: Serial Hamlib rigs were not properly working. (TNX W5PNY) +- Bugfix: QRZ.com was disabled if user was not subscribed. (TNX EA5WA) +- Bugfix: QRZ.com data was not updated if the boxes were already filled. (TNX EA5WA) +- Bugfix: Callsigns formet were not always properly checked. +- Improvement: Hamlib 4.4 in binary packages (macOS & Windows) tested also in Linux. +- Improvement: RTS & DTR are defined to OFF by default in hamlib. +- Improvement:KLog differenciates QRZ.com subcribed users from non subscribed. (TNX EA5WA) + +Oct 2021 - 1.8.5 +- Bugfix: Station callsign was not shown on window title. (Closes #347) +- Bugfix: Received QSOs from LoTW were shown as to be sent. (Closes #358) +- Bugfix: Log was not properly ordered. (Closes #346) (TNX EA5WA) +- Improvement: Message of the mainwindow has been updated. (Closes #361) +- Improvement: Logs to be uploaded to LoTW are only shown from the current log. (Closes #362) +- Improvement: Logs to be uploaded to ClubLog are only shown from the current log. (Closes #363) +- New feature: It is now possible to enable/disable the callsign check. (Closes #186) +- Removed dead & commented code. +- Improved how mainCallsign & Station callsigns are used. +- QRZ.com queries are disabled if QRZ.com returns a non-subscribed user answer. + +Aug 2021 - 1.8.4 +- Bugfix: In some situations callsigns were always shown as to be worked. (Closes #345) +- Bugfix: Double click on DXCC widget was not sending the DXCC QSOs to the search widget. +- Bugfix: Queued LoTW were not properly selected for upload. (Closes #354) (TNX EA5WA) +- Improvement: KLog start is optimized. + +Aug 2021 - 1.8.3 +- Added some backport code so systems without Qt 5.15.2 can compile and use KLog. +- Bugfix: Selecting File->Export to ADIF was not showing all the possible QSOs to be exported. + +Aug 2021 - 1.8.2 +- Bugfix: Updated the openSSL libraries for Windows users that was causing TLS errors on some connections. (Closes #342) +- Bugfix: Spanish typo (TNX EA5WA) (Closes #341) +- Bugfix: Statistics were showing wrong numbers on DXCC/Grid per band (Closes #344) + +Aug 2021 - 1.8.1 +- Bugfix: QSOs comming from WSJTX and other sources where not shown, depending on logview configuration. (Closes #338) + +Aug 2021 - 1.8 +- Bugfix: Some recently added ADIF fields where not properly imported from ADIF. +- Improvement: Code updated to Qt 5.15.2. (Closes #323) +- Improvement: VUCC_GRIDS & MY_VUCC_GRIDS are also managed in the UI. (Closes #319) +- Improvement: LogView fields to be shown can be selected in the prerefences. (Closes #23) +- Translations: Catalan (TNX Txema), Italian (TNX IU5HIU) & Spanish (EA4K). + +July 2021 - 1.7 +- Bugfix: RealTime remained checked when editing. +- Bugfix: Some Hamlib parameters were not properly stored. +- Bugfix: Coredump when no entity (Closes #302) +- Bugfix: Colors are now properly defined. (Closes #275) (Closes #40) +- Bugfix: Station callsign is read from the settings. (Closes #307) +- Bugfix: The right setup dialog tab is open on first start. (Closes #311) +- Improvement: DarkMode added. (TNX EA5WA) (Closes #56) +- Improvement: DXCC & WAZ management optimization. +- Improvement: Current UI data is saved before going to edit a QSO and restore after editing. +- Improvement: Order of widgets when tab is pressed has been improved. (Working on #265) +- Statistics: Added the Grids & DXCC per band statistic. (Closes #312), (Closes #313), (Closes #314) +- UI: The Setup menu has been moved to Settings into the File menu. +- Translations: Catalan (TNX Txema), Italian (TNX IU5HIU) & Spanish (EA4K). + +June 2021 - 1.6 +- Optimization: Isolated the QSO tab to an independent widget. +- Bugfix: When starting KLog for the first time, it crashed. +- Bugfix: Hamlib was not properly started on KLog start (closes #126) (TNX G4MKT) +- Bugfix: SAT_MODE was being added to non SAT QSOs. +- Bugfix: DXCC status was not being properly updated. +- Improvement: Added user selectable ADIF fields in the Other and My Data tabs. (Closes #4) +- Improvement: Enhanced how the UDP server is started on KLog start. +- Improvement: Added some basic SQL Injection protection to the UI. (Closes #95) +- Improvement: UI data is saved before entering the Setup and restored after setup is done. (Closes #188) +- Improvement: Only one instance of KLog is allowed to run simultaneously. (Closes #250) (TNX foldynl) +- Commented some Flawfinder false positives. +- Translations: Catalan (TNX Txema), Czech (TNX OK1MLG), Italian (TNX IU5HIU) & Spanish (EA4K). + +May 2021 - 1.5.3 +- Bugfix: Fixes the DataBase update process to add the Q65 mode. +- Bugfix: Unexpected Setup dialog behavior. (Closes issue #178) (TNX foldynl) +- Bugfix: Time is not in UTC when "Log in real time" is uncheck. (Closes issue #179) (TNX foldynl) +- Bugfix: Missing translation in SoftwareUpdateDialog. (Closes issue #180) (TNX foldynl) +- Bugfix: Inconsistency text in Tip#2. (Closes issue #182) (TNX foldynl) +- Bugfix: Missing Translation string in SetupPageMisc::createUI. (Closes issue #185) (TNX foldynl) +- Bugfix: When LoTW service was no enabled, KLog insisted to show the QSOs to be exported. +- Bugfix: Setup->Satellites did not show a correct Short name. (Closes issue #192) (TNX foldynl) +- Bugfix: Removal DX Cluster unexpected disconnection. (TNX foldynl) +- Bugfix: Tip #21 was not shown. (Closes issue #184) (TNX foldynl) +- Bugfix: TQSL was not properly found on macOS. (Closes issue #195) (TNX K0JM) +- Enhancement: Improved the readability of the DX Cluster window. (TNX foldynl) +- Updated the KLog tips. +- Translation: Czech (TNX OK1MLG), Spanish. + +May 2021 - 1.5.2 +- Bugfix: Complex calls like K/EA4K/P were identified as wrong calls. (Closes issue #177) (TNX PA3FNT) + +April 2021 - 1.5.1 +- Added the GitHub repository to find new releases due to the issue with savannah.nongnu.org +- New feature: F4 toggles the real time status (on/off). +- Improvements on call identification management on user input. +- Bugfix: Editing removes QTH and name (Closes issue #113) +- Bugfix: Some complex calls (i.e. F/EA4K) were causing a crash unders some conditions. +- Bugfix: DX Entity of some complex calls where not properly identified. (Closes issue #8). + +March 2021 - 1.5 +- Added the 8M & 5M bands. +- New feature: Added "Adif file deletion" checkbox. User can choose to show or not the message boxes after uploading QSOs. +- New feature: New function added to fill automatically the satMode field in satellites Tab depending on upload/download frequencies. +- UI: Added EA5WA as Author. :-) +- New feature: LoTW confirmation is also counted for DXCC & WAZ. +- New feature: DUPES are now identified when coming from WSJTX, ADIF logs, LoTW logs or simply adding a QSO. +- New feature: Added a time period to consider a QSO as DUPE if call, band & mode are also the same. (Closes issue #41) +- Improvement: Hamlib now supports network communication (TNX DG1VS) +- Improvement: Optimized the way DXCC & WAZ are managed. +- Improvement: KLog receives the clear messages from WSJTX and is able to clear the KLog UI. +- Statistics: Added the Grids on Satellites statistics. +- Statistics: Added the DXCC on Satellites statistics. +- UI: Removed the QComboBox of the Setup Log tab to select the log. (TNX G4MKT) +- UI: Added the QSO per log in the logs setup. +- UI: Added a checkbox to keep the Propagation mode, if needed. Propagation mode is also linked to the Satellite tab. (TNX EA5WA) +- UI: Added a Help->Online Manual menu or push F1 to go to the Online Manual (Closes issue #52) +- Bugfix: Improved the way the QSOs come from WSJT-X. (EA5WA) +- Bugfix: Double clicking on a call, while searching made the search to be redefined to that call and the previous search was lost. +- Bugfix: Satellite stats where not properly calculated. (TNX EA5WA) +- Bugfix: Identifying some bands was not properly done due to the names being in lower case. +- Bugfix: When importing an ADIF and asking for a default station callsign, it was only used for the first QSO, leaving the rest without a station callsign. +- Bugfix: Stats widget where not being properly created. +- Bugfix: The Log combobox on the Statistics was not working. (TNX EA5WA) +- Bugfix: End date tooltip updated on the export widget.(TNX G4MKT) +- Bugfix: DX Locator tooltip was not OK. (TNX G4MKT) +- Translations: Catalan (TNX Txema) & Spanish (EA4K). + +January 2021 - 1.4.7 +- Added the Q65 mode. +- eQSL sent is added as Q when received from WSJT-X (github issue #45) + +January 2021 - 1.4.6 +- Bugfix: Improved the way the QSOs come from WSJT-X. (EA5WA) + +January 2021 - 1.4.5 +- Added the FST4 and FST4W modes. +- Added the RS-44 satellite. +- UI: Changed "Config Dialog" to "Settings". (TNX G4MKT) +- UI: Changed QRZ to Callsign. + +December 2020 - 1.4.4 +- Bugfix: QSOs received from WSJT-X may not be saved properly. +- Bugfix: ClubLog, eQSL.cc and QRZ.com were losing one setting. (TNX EA5WA) + +December 2020 - 1.4.3 +- Bugfix: PJ7 flag was not being shown in the DXCC widget. +- Bugfix: Disabling LoTW made impossible to enable it again via the setup. (TNX G6YRK) + +December 2020 - 1.4.2 +- Bugfix: ADIF export was failing in some circunstances. + +December 2020 - 1.4.1 +- Bugfix: Stat 01-QSO per year was not properly shown when returning from other stat. (TNX EA5WA) +- Bugfix: UpLink sat freq was not properly defined when exiting the setup. +- Translation: Spanish translation fix. + +December 2020 - 1.4 +- Improvement: Prepared the WSJTX-2.4 UDP interface. +- Improvement: User data stored in the setup is know used in the QSOs (default power, station callsign). +- Improved the KG4xx (Guantanamo bay) DXCC detection from KG4 calls. +- Updated how KLog counts the confirmed DXCC entities to include LoTW confirmations. +- New feature: QSO upload to the QRZ.com Logbook (including qso selection and qso mark that has been uploaded) +- New feature: QSO upload to the eQSL.cc Logbook (including qso selection and qso mark that has been uploaded) +- New feature: ClubLog full log upload (adding or overwriting). +- New feature: It is possible to keep the comment field from one QSO to the following one. (TNX EA5WA) +- New feature: It is possible to select multiple QSOs in the log and execute several actions with the selected QSOs.(TNX EA5WA) +- New feature: It is possible to check for the data of calls in QRZ.com (you need a subscription in QRZ.com) +- UI: Removed the Keep my data option from the Setup UI. +- UI: The RX frequency follows the TX unless the split is checked. +- UI: Consolidation of all the electronic logs configurations in one single setup page into the eLog tab. +- Bugfix: Save all QSOs to ADIF process continued even if the user clicked in cancel.(TNX G4MKT) +- Bugfix: Backup file was not being created in the right path.(TNX G4MKT) +- Bugfix: Some paths were converted to upper case causing some issues in some case sensitive situations. (TNX G4MKT) +- Bugfix: In some cases, the RST format was not properly defined.(TNX G4MKT) +- Bugfix: Default ADIF file was not being saved on exit. (TNX G4MKT) +- Bugfix: It was not possible to select empty logs from the preferences. (TNX G4MKT) +- Bugfix: QSOs comming from WSJTx were not being uploaded to ClubLog. (TNX PD9Q) +- Bugfix: Too many mesages when uploading in realtime to Clublog. It should be done silently.(TNX EA5WA) +- Bugfix: Typo in the INSTALL-linux. (TNX DL4TO) +- Bugfix: Hamlib polling rate was not being saved from the setup. Default value is defined to 300ms. (TNX G4MKT) +- Bugfix: Complete with previous QSO (name, locator, ...) was not working properly. +- Bugfix: PROGRAMID ADIF data was not properly tagged. +- Bugfix: When selecting the QSOs to upload to LoTW, if the selected call was the first one on the combobox, selection didn't worked properly. +- Bugfix: When importing ADIF files with fields without RST_SENT or RST_RCVD the proposed default value was not adapted to the mode of that QSO. +- Bugfix: Extension .adi was always added, even if the file had it already. +- Bugfix: When doing a database backup, the name of the file was not being properly defined. +- Bugfix: ClubLog realtime syncronization was not working properly. + +October 2020 - 1.3.2 +- Bugfix: Data comming from WSJT-X, when several WSJT-X instances were running was not properly parsed. (TNX 2E0WJW) + +October 2020 - 1.3.1 +- Translations: Croatian (TNX M0NKC). + +October 2020 - 1.3 +- Improved the search widget to make searching much quicker. +- Improved the Edit of QSO related to the default QSL sent status. +- Improved the QRZ.com & DXHeat.com queries from the log & search window. +- Improved the UDP datagram receiver to ensure it is working multicast. +- UI: KLog remembers the size of the window from last execution. (TNX EA5WA) +- UI: The Station Callsign and number of QSOs in the current log is shown in the windows title.(TNX G4MKT) +- New feature: KLog now search for the call as the user enters for previously QSOs with that call. (TNX EA5WA) +- Adds an ".adi" file extension to the log ADIF files if not added by the user. (TNX G4MKT) +- When reading a log from LoTW, if there are new QSOs not present on the current logfile, KLog offers the option to import them. +- Bugfix: It was not possible to add a log if the date and Station Callsign were the same. + Now operators and comments are also taken into consideration.(TNX G4MKT) +- Bugfix: The export of QSOs without an station callsign defined was failing.(TNX G4MKT) +- Bugfix: When reading a log from LoTW, the list of QSOs were not shown at the end. (TNX EA5WA) +- Bugfix: Comment in the new log widget was converted to uppercase. (TNX G4MKT) +- Translations: Catalan (TNX Txema), Italian (TNX IU5HIU), Spanish (EA4K). + +Sept 2020 - 1.2.2 +- Bugfix: LoTW export was failing due to a wrong SQL sentence. (TNX PD9Q). + +Aug 2020 - 1.2.1 +- Bugfix: ADIF export was not exporting dates with the right format in some eQSL fields. +- Bugfix: QSOs were not properly imported when received from WSJT-X. +- Bugfix: Pool/Poll typo fixed. (TNX Barry!). +- Bugfix: QSO editing - Locator was being cleared from sat tab. +- Bugfix: QSO editing - User Inferface was not properly clearedn after editing. +- Bugfix: QSOs tag in the Award tab was not properly formatted in Windows OS. +- Improvement: ADIF creation has been optimized. +- Improvement: All fields received from WSJTX are now added to the log. +- Improvement: GRIDSQUARE & MY_GRIDSQUARE ADIF fields are now also exported to LoTW upload. + +Aug 2020 - 1.2 +- New feature: KLog proposes to do a database backup before it is upgraded so data can be recovered if there is any problem. +- Improvement: When receiving the status from WSJT-X,the RX frequency is also updated with the same TX freq +- Improvement: Dates and Times are now together and it is possible to sort the log based on date & time. Date format has been overall updated. +- Improvement: Search is now more confortable as the search does not start inmediately after a key is pressed but some time after so it's possible + to enter more letters and reduce the search time. +- Bugfix: Fixed the DB update processes. +- Translations: Catalan (TNX Txema), Italian (TNX IU5HIU), Spanish (EA4K). + +May 2020 - 1.1 +- Improvement: Search widget has been improved. +- Improvement: Callsigns are always checked to be a good callsign before they are saved to the log, imported and exported to ADIF. +- Improvement: Removed some death code. +- Improvement: If TX Freq & RX Freq are the same, only TX Freq is exported. +- Improvement: New functions to check calls when importing ADIF logs. +- Improvement: Improved how CTY.CSV (country files) is working. +- UI: Widget to show the QSOs to be exported to ADIF & LoTW. +- UI: Widget to show the QSOs updated from ADIF & LoTW. +- UI: Clear the UI also clears the status of a DXCC in the Band status widget. +- UI: Added a checkbox to easily enable/disable the real time in the QSO entry box. +- UI: Passwords are now hidden in the UI when entered. +- BugFix: Only QSOs are now updated when data is uploaded from LoTW. +- BugFix: DXCC & WAZ information was updated twice when removing a QSO. +- BugFix: DXCC & WAZ count. +- BugFix: Fixed one SQL query on satellite. +- Bugfix: Fixed the print function. (JL3OXR). +- Translations: Catalan (TNX Txema), Spanish (EA4K). + +April 2020 - 1.0.1 +- BugFix: UTC time was not properly managed, specially in the date. + +March 2020 - 1.0 +- UI: Removed the first column inthe DXCC widget to make it more user friendly. +- UI: Created a widget to manage the Main QSO entry to make KLog more modular. +- UI: eQSL & LoTW are marked as queued to be sent by default if the user activates it in the setup. +- UI: Added the title to some QMessage boxes that were missing. +- UI: Improved the usability of creating new logs or editing existing logs in the setup. +- New feature: Integrate TQSL to upload QSOs to LoTW directly from KLog. +- New feature: You can check a call in QRZ.com by right-clicking in the call from the log. +- New feature: You can check a call in DXHeat.com by right-clicking in the call from the log. +- New feature: It is now possible to save in a file all the DX-Cluster activity. +- Improvement: Added https to the cty.dat download. +- Improvement: Added the https to download.klog.xyz +- Improvement: Propagation modes are now sorted in the Propagation mode combobox. +- Improvement: Four new tips added. +- Improvement: eQSL & LoTW dates are updated always that are modified to any status. +- Improvement: If a QSO does not have a freq, a default freq based on the band is assigned if edited. +- Improvement: Removed some deprecated functions. +- Improvement: Improved the way KLog checks for a wrong call (IARU rules applied). +- Improvement: Improved the way KLog checks for a wrong IOTA reference. +- Removed the functionality to sort the log based on Date & Time columns. +- Removed one console message about a duplicated database connection. +- Bugfix: It was not possible to include new dxcluster servers in the setup. +- Bugfix: The default value of RST in some digital modes using SNR were not properly shown. +- Bugfix: In translated instances of KLog, Propagation mode was sometimes not properly saved when no propagation mode eas selected. +- BugFix: Locator in SAT widget was not always not correctly evaluated as correct. +- Updated translations: Catalan (TNX Txema), Croatian (TNX M0NKC), Finnish (TNX Kristjan), Spanish (EA4K). + +February 2020 - 0.9.9.1 +- BugFix: Bands & modes where sometimes duplicated in the combobox (TNX G4MKT). + +January 2020 - 0.9.9 +- UI: Created a widget to manage the Awards to make KLog more modular. +- UI: When starting a new version for the first time, the splashscreen is not hidding other messages anymore. +- UI: Removed some not used File menus (New, Open, Save & Save As). +- UI: Sorting by date the log is also sorting taking into account the time. +- New versions are now found depending on the OS, not just for the sources. +- New feature: Added some tips in the Help menu to help the users to get the most of KLog. +- Hamlib has now a read-only mode that will read freq & mode from the radio but will never modify/update anything in the radio. +- Added some debug log option. +- Some code cleaning with cppcheck and compilation warnings removed. +- UI: Added a WSJT-X like color schema. +- Bugfix: KLog was crashing if the call was completely removed in the Setup. +- BugFix: KLog was always logging 59 instead of the real RST. (TNX DB4BIN) +- BugFix: KLog was changing the mode in the radio from CW-R to CW if hamlib was active. (TNX G4MKT) +- BugFix: KLog was changing freq in the radio in the starting process if hamlib was active. (TNX G4MKT) +- Improvement: KLog reads the radio freq/mode when starting. (TNX G4MKT) +- BugFix: ADIF export function was not exporting the DARC_DOK properly. +- Bugfix: Closes Debian bug: #948911: FTBFS on mipsel. (TNX Lisandro) +- BugFix: Editing the log metadata in the setup was not possible. +- KLog exit process improved. +- KLog start process improved. +- DataProxy_SQLite class removed to optimize the code. +- Other minor improvements. +- Updated translations: Catalan (TNX Txema), French (F4HWL), Spanish (EA4K). + +August 2019 - 0.9.8.1 +- Added the Es'hail / QO-100 satellite. +- UI: Satellite list, propagation modes and others are now shown sorted. (TNX Isabel) +- UI: Added default values to the infoWidget (Continent, Prefix, CQ, ITU...). (TNX Isabel) +- UI: RX/TX Freq in Satellite tab are also in red/black depending on the frequency being out/in of ham bands. +- UI: Mode selected is now changing the RST format and default values for some modes. +- Bugfix: Editing a QSO to remove a comment was not properly working. (TNX Isabel) +- Bugfix: Worked & Confirmed QSO numbers are now aligned in the Awards tab. (TNX Isabel) +- Bugfix: KLog.pro is now fixed to compile in Linux. (TNX KB2YSI) +- Bugfix: Improved how the DXMarathon was managed when disabled. +- Bugfix: Improved how DXCC Award was updated after one QSO was added. (TNX Isabel) +- Fixed a bug in the SQL update database. + +August 2019 - 0.9.8 +- New feature: Basic Hamlib support. +- Fixed a bug in the SQL update database. +- Fixed a bug in the DXCCWidget. +- Fixed a bug in the QSO per hour stats. +- Added the FT4 mode. +- Updated translations: Catalan (TNX Txema), Danish (TNX Joe), Finnish (TNX Kristjan), French (F4HWL), German (TNX Burkhard), Spanish (EA4TV). + +March 2019 - 0.9.7.3 +- TODO: Remove the band 0 / Light from the DB. +- UI: KLog warns the user if the frequency used is out of the hamradio bands. +- Reworked how freqs and bands are managed. + +March 2019 - 0.9.7.2 +- Bugfix: Frequency boxes did not accepted frequencies higher than 99.999 MHz. (TNX KB2YSI) + +March 2019 - 0.9.7.1 +- Bugfix: The frequency was not properly saved in the DB. (TNX KB2YSI) +- Bugfix: The QSO_DATE was not exported into ADIF. (TNX KB2YSI) + +March 2019 - 0.9.7 +- Bugfix: When clicking on Check updates, the dialog froze. +- Bugfix: Printing log is not longer showing band in the mode column. +- Updated the default date on date boxes to the current date. +- Improved the Frequency syncronization between Satellite tab and the main tab. +- Improved how default mode is calculated. +- Added Satellites widget in Setup. +- Updated translations: Catalan (TNX Txema), Danish (TNX Joe), Finnish (TNX Kristjan), French (F4HWL), German (TNX Burkhard), Spanish (EA4TV). + +December 2018 - 0.9.6 +- Optimizing the Statistics widget. +- Added some new Statistics widgets. +- Fixed some messages with typos. +- Bugfix: Fixed a bug preventing to modify a QSO. (TNX KB2YSI). + +October 2018 - 0.9.5 +- Added a dot at the end of all the tooltips. +- Updated the Satellite database (TNX KB2YSI). +- Some queries optimized. +- Bugfix: You can nor close the About KLog window from any tag (TNX F4HWL). +- New feature: KLog shows some statistics of your log: Tools->Stats +- New feature: It is now possible to update the satellite data reading a sats.dat file: Tools->Update Satellite Data. +- Satellites file (sats.dat) updated to september 2018 (TNX KB2YSI). +- New translations: French (TNX F4HWL) and German (TNX Burkhard). +- Updated translations: Catalan (TNX Txema), Croatian (TNX M0NKC), Finnish (TNX Kristjan), Spanish (EA4TV). + +August 2018 - 0.9.4 +- WSJT-X support to receive logged QSO and realtime data. +- Check bool DataBase::updateTo012() / it was always returning true without any action. +- Syncronize RX Freq with the satellite downlink combobox. +- Focus is back to search line edit when right click on the list of found QSOs. +- Update process has been improved. +- Some warnings removed from compilation time. +- Bugfix: Date was not properly calculated and UTC settings was not applied. That may create wrong date QSO when date changes due to UTC (TNX AC1DW). +- Bugfix: When adding a QSO, if the QSL is marked as received, KLog showed a SQL error. +- Bugfix: Table qsl_via needed to be renamed (TNX EA6ZS). +- Bugfix: Some DXCC status were nor properly calculated. +- Updated translations: Catalan (TNX Josep), Croatian (TNX M0NKC), Danish (TNX Joe), Spanish (EA4TV). + +April 2018 - 0.9.3 +- Double clicking on DXCC Widget name of the Entity will show the QSO is providing that status on the Search widget. +- Added DXCC support for Kosovo. +- Bugfix: Default band & mode are now defined as the most used band and mode. +- Bugfix: TX frequency was not saved. +- Bugfix: In the dxcc status widget, some countries were showing the UN flag unappropriately. +- Bugfix: When updating the CTY file, query errors were shown on world.readCTYCSV function. +- Bugfix: When editing the QRZ, the cursor position was not properly maintained. +- Bugfix: Fixed the flags of several DXCC entities that were not correctly shown. +- Bugfix: DXCC Status widget was not listing all the DX entities. +- Bugfix: Modes & Bands where not always properly updated from the Setup. +- Bugfix: Adding new QSO that implies a DXCC or WAZ status already worked failed. +- Bugfix: Updating the WAZ status was not always possible due to a incorrect DB query. +- Updated translations: Danish (TNX Joe), Spanish (EA4TV). + +January 2018 - 0.9.2.9 +- Bugfix: Adding new QSO that implies a DXCC or WAZ status already worked failed. +- Bugfix: Modes where not properly added from the setup (TNX KB2YSI). +- UI Change: Freq in the Satellite tab is now not deleted when a new QSO is added. +- New translation: Catalan by Josep (Thank you!) +- New translation: Finnish by Kristjan (Thank you!) + +January 2018 - 0.9.2.8 +- Important Optimization on KLog speed on start and general use. +- New satellites (AO-91 & AO-92) added. +- Added ALL the ADIF 3.0.7 fields (except the _INTL ones). +- New feature: New menus to export ADIF files for LoTW and manage LoTW status. +- GUI: Implemented an error reporting for the users for main errors +- GUI: When a satellite is selected the main bands are automatically proposed. +- GUI: QSO band is now linked to the uplink & downlink bands in the satellite tab. +- Bugfix: Some ADIF fields were not properly imported/exported. +- Bugfix: When searching calls like 1A0XX, 2E0XX, ... no results were found but there are with 3D0XXX +- Bugfix: If an empty log was selected on config file, on next KLog start KLog crashed. +- Bugfix: Doubleclicking on the log to edit was sometimes causing the band/mode data to be shown as a number instead of the human readable name. +- Bugfix: Windows version did not detected the DB movement correctly. +- New translation: Polish by LA7RRA (Thank you!). +- New translation: Danish by Joe (Thank you!). +- Updated translations: Croatian (TNX M0NKC), Italian (TNX IU5HIU), Spanish (EA4TV) +- Several internal updates. + +September 2017 - 0.9.2.7 +- KLog offers the possibility to move the DB to another path (maybe a DropBox folder!) +- New Operating systems recognized in runtime. +- Updated the references to macOS from OSX. +- Updated the list of valid modes up to ADIF 3.0.6. +- Updated the list of valid propagation modes up to ADIF 3.0.6. +- Update the 136KHz band limits to the new US licenses. +- Optimized the speed of printing the log. +- GUI: Added the QSO information done in a year on the DX-Marathon area. +- GUI: Simplified the way active bands/modes are selected. +- GUI: Satellite tab is redesigned. +- GUI: Created a widget to manage all "eQSL" simplifying implementation of the main widget. +- GUI: Created a widget to manage the Log, simplifying implementation of the main widget. +- GUI: Created a widget to manage the Search, simplifying implementation of the main widget. +- GUI: Added a SplashScreen on KLog start to show the user the starting process. +- GUI: If the user adds a frequency in the TX Freq box that is not a currently used band, it is automatically added to the band seletion widget. +- BugFix: Fixed how new logs were added to the DB. +- BugFix: Identification is a band was HF or VHF was not always properly done. +- BugFix: Higher bands where not shown to be selected in the preferences. +- BugFix: DB updating function (009) blocked the execution of KLog the first time it was executed. +- BugFix: Language message if English is the System language is no shown anymore. +- New translation: Italian by IU5HIU (Thank you!). +- Translations updated: Original English (TNX JustinBRye, from Debian-10n-english), Spanish (EA4TV), Japanese (TNX JL3OXR). + +May 2017 - 0.9.2.6 +- Check updates feature added. On start or when user desires KLog checks if there is one updated version available. +- Simplified the way new logs are added, importing the general StationCallsign & Operators as default for new logs. +- Improved the way first start was managed when no entity information was loaded. +- GUI: Application icon is now shown in the application windows. +- GUI: Updated some messages & tips. +- GUI: DXCluster offers the Station Callsign as default value to connect. +- GUI: Some menu minor reorganization. +- Console: Added a few commands to the console command. +- Changed the World class to be able to import files from any folder. +- Changed how some non ARRL valid entities are managed to show the common name (Sicily / Italy) +- BugFix: When manually importing a new CTY.CSV, although data was updated, it was not shown until next KLog start. +- BugFix: In the others tab, the DXCC was sometime not correctly identified. +- BugFix: Update on the DXCC widget caused no data to be shown if some columns were selected. +- BugFix: Identification is a band was HF or VHF was not always properly done. +- BugFix: Some improvements in data quality when exporting an ADIF file. +- BugFix: When importing an ADIF file, if the file was not correct it was not possible to cancel the whole importing process. +- Some minor changes on source code to optimize and improve. +- Translations updated: Croatian (TNX M0NKC), Japanese (TNX JL3OXR) & Spanish (EA4TV). + +Nov 2016 - 0.9.2.5 +- BugFix: ADIF export function was not exporting the correct BAND & MODE data. + +Sep 2016 - 0.9.2.4 +- GUI: Created a DXCC status where all the DXCC entities are listed showing the working/confirmed status. +- GUI: Created a Satellite list including (up to now) only LOTW compatible satellites. +- GUI: Created a widget to manage all "My Data" simplifying implementation of the main widget. +- GUI: Bands in the combobox are always shown correctly ordered (botton-up). +- GUI: Improved the LOTW date management (TNX JL3OXR). +- BugFix: Preferences->Misc: It was not possible to edit the default filename. (TNX K6XT). +- BugFix: Added the Power unit (W) to the power box. Debian bug #654332. +- BugFix: When editing a QSO in some text boxes text was reused from previous QSO and data could be corrupted. +- BugFix: Minor bug in WAZ management. +- BugFix: When managing logs in the setup is was not possible to edit the log data as a new log was always created. +- When starting KLog for the first time, the setup guidance has been improved. +- When selecting an entity, different from the proposed on country file, KLog asks the user which one to use. +- Operator from the selected log is used as default when entering QSO (as station callsign). +- Japanese translation updated. (TNX JL3OXR). +- Spanish translation updated. +- Some cleaning in the code. + +Jan 2016 - 0.9.2.3 +- Improved the way translations are managed (Specially in Linux). +- Icon application is now shown in OSX & Windows. +- New translation: Japanese by JL3OXR (Thank you!). +- Bugfix: Some strings where not defined to be translated (TNX JL3OXR). +- Bugfix: Some tips in the UI where not correctly placed (TNX JL3OXR). +- Bugfix: QSOs in JT9 were not properly imported from ADIF (TNX EA3XQ). +- Bugfix: Logfiles with the in the first line, following some test were not properly imported. + +Nov 2015 - 0.9.2.2 +- Translations are now working properly in Windows & OSX. +- New translation: Catalan by EA3NM (Thank you!). +- Ported from Qt4 to Qt5. +- BugFix: Aether ADIF files could not be properly imported. (TNX AA5VU). +- BugFix: QSOs where not properly shown in the search box. +- BugFix: When started for the first time, no modes were shown as default. +- BugFix: CTY.CSV was not properly updated. +- BugFix: When upgrading the mode information in database some modes where not properly updated. +- GUI: Changed the year to show the full number to avoid problems with old QSO. +- Import ADIF functionality is improved to support importing of logs with some missing data. +- Removed the Spot button until its functionality is implemented. + +Sep 2015 - 0.9.2.1 +-BugFix: Band & Mode information was not properly stored. + +Aug 2015 - 0.9.2 +- Bugfix: An ADIF file with one blank line and one QSO used to froze KLog. +- Bugfix: Minor bugfix in the definition of propagation modes. +- BugFix: When editing a QSO the name was not shown. +- BugFix: STX_String field was not always imported properly. +- BugFix: Fixed a minor bug in log table regarding the prop_mode foreign key. +- BugFix: Improved the color & status shown of a QSO on the DXCC. +- BugFix: DXCluster: Fixed a bug that caused the colors to appear always as new one. +- BugFix: DXCluster: The option to show only not confirmed was not working correcty. +- BugFix: IOTA reference was not saved when entering a QSO. +- BugFix: BIGCTY.DAT was not properly download in KLog first start. +- GUI: Added some shortcuts in the preference widget. +- GUI: DXCluster: Add a suggestion to hit enter if no password is expected for the cluster. (tnx AA5VI) +- GUI: DXCluster: Warns you if the spot is needed for the current year DX-Marathon +- GUI: Added a Propagation Mode Combobox. +- GUI: Prop_Mode combobox automatically goes to SAT if sat name or sat mode are defined. +- GUI: Added a Find DX-QSL requested option. +- Added the 630M & 13CM bands. +- Updated Mode & submode definition up to ADIF 3.0.4. +- Special CQ & ITU zones in some calls are now identified. +- KLog is able to import QSOs with no BAND field if FREQ field is present. +- KLog offers the user a default value if RST_TX or RST_RX field is not present when importing. +- Support of realtime upload, modification & removal of a single QSO to/from ClubLog.org. +- Updated the DB with the PROP_MODE options. +- Improved the way KLog manages & shows the bands & modes. +- Removed the option to choose to run in memory or file in the start wizard. KLog will run always using a file for the DB. +- Added an auto complete option to auto-complete info (QTH, Locator, Name, QSL Manager & IOTA) from previously worked QSO. +- Cleared the world.cpp file. +- Some minor performance improvements. + +Apr 2015 - 0.9.1.1 +- Bugfix: Editing a QSO with satellite data was not properly done and caused some errors. + +Apr 2015 - 0.9.1 +- Bugfix: Fixed DataBase::getBandIdFromFreq it was not ansswering properly. +- Now checks if band & frequency are coherent before adding a QSO. Band wins. +- All Satellite QSO include the PROP_MODE ADIF tag to make it compatible with LOTW. +- Improved the DXMarathon code. +- GUI: Added basic Satellite support. +- GUI: It is possible to mark a QSL sent via bureau/direct & DX QSL as requested with one action from Search box. +- GUI: KLog request a valid QRZ and at least one first logtype to start using it. +- KLog supports the management of several logs, being possible to edit, remove and select the one to use. + +Jan 2015 - 0.9.0.3 +- Bugfix: ADIF was not properly imported when Fields where using the Type of data optional field preventing logs from Logger32 being imported. (TNX EB1TR) +- Bugfix: QSL Sent/Received status in the search box were switched. +- Bugfix: CTY.CSV was not updated if the file was already existing. +- Bugfix: Entity DB was not updated when CTY.CSV was updated. +- Bugfix: Search results showed the default Station Callsign if non was in the QSO. This lead to errors if QRZ was not the default. +- KLog recognizes now .ADIF files (instead of only .ADI). +- KLog shows now the WAZ status. +- Added a very basic support of DX Marathon (http://www.dxmarathon.com/). +- DXCluster filters are now working. +- The user can manually assign the DXCC entity for a DX. +- Improved the function to update the DB from one release to the following. +- DB file is compressed everytime KLog finishes. +- It is possible to find QSL pending to receive. +- It is possible to modify entities data in the World Editor in preferences. +- It is possible to choose in preferences whether to keep my Data Tab from one QSO to the next or not. +- GUI: A tooltip is shown in the search results showing the DXCC name / CQ zone. +- GUI: Added a button to rescore awards. +- GUI: Added a button to update the search Box without modifying the text. +- GUI: Updates Bearing/distance/... when changing Locator. +- GUI: When the QRZ lineedit is blank or the clear button is clicked, entity info is deleted (beam, distance, ...). +- GUI: The IOTA continent is updated when the QRZ is modified. +- GUI: DXCluster input is disabled when not connected. +- GUI: Corrected the behaviour of the status bar. +- GUI: Added primary & secondary subdivisions in the Others Tab. +- Some other minor fixes. + + +Nov 2014 - 0.9.0.2 +- Bugfix: Right-click on search result sometimes caused KLog to crash. + +Nov 2014 - 0.9.0.1 +- Bugfix: Selected DX-Cluster servers were not used to connect. (TNX DL6FBS) + +Nov 2014 - 0.9.0 +- Ensures the ASCII requirement of ADIF. +- Updated the Preferences dialog. +- Added the About Qt help menu. +- Bugfix: Selected DX-Cluster servers were not used to connect. +- Bugfix: When selecting QSL received/sent with right click, date was not updated. +- Bugfix: Fixed the FileManager::adifReadLog to be able to read logs with several lines per QSO. +- Some other minor bugfixes. +- New feature: It is possible to show Imperial System (Miles instead of Km) data. (TNX - KF5JNU) +- New feature: It is possible to mark/look for & export requested QSL. +- New feature: It is possible to automatically mark(or not) a QSL as requested by the DX when the DX's card is received. +- New feature: It is possible to show (or not) the callsign used in the search box. +- New feature: KLog uses bigcty.csv for normal DX & will use cty.csv for contesting. + +Apr 2014 - 0.7.1 +- Backport to Qt 4.8. +- Download the http://www.country-files.com/cty/cty.csv instead of cty.dat (with no ARRL id). +- Capable to read cty.csv to get the info of the ARRL id. + +Apr 2014 - 0.7.0 +- Full rewritten software based only in Qt. NO KDE dependency. +- KLog can now run on Linux, OSX and Windows. + +Nov 2013 - 0.6.2 +- Bug fixed: Under some conditions, KLog crashes when entering a new QRZ. (TNX LW1EQI). +- Bug fixed: IOTA data was not properly cleared when clicking the Cancel button. +- Bug fixed: QSL combobox content was not properly managed. (TNX DF4FH). +- Bug (gui) fixed: IOTA continent is now "automagically" detected... again (a bug prevented this functionality). +- GUI updated: You can click on RX or TX Frequency buttons to copy the frequency to the other one. +- GUI updated: You can select eQSL in the QSL combobox as an option to mark the QSL information of a QSO. +- GUI updated: Two new shortcuts: CTRL+W: deletes the current QSO. CTRL+Q: to (quick)edit the last QSO added. +- GUI updated: Minor tab reorder. + +Jun 2013 - 0.6.1 +- Bug fixed: Locator was not properly calculated due to a sign difference management from KLog and CTY.DAT. +- GUI updated: The cursor position management of the QRZ box has been improved to ease the operation. + +Jan 2013 - 0.6.0 +- Bug fixed: Typo "Frecuency" changed to "Frequency" in a tooltip. (Debian bug: #654328) (TNX Jonas Stein) +- Bug fixed: Typo/wishlist "Numb" changed to "Number" in main table. (Debian bug: #654331) (TNX Jonas Stein) +- Bug fixed: Typo/wishlist "UTC" changed to "Time" in main table. (Debian bug: #654331) (TNX Jonas Stein) +- Removal of several not needed #includes. +- Removed some warnings on compilation. +- GUI improved: The information boxes are now independant from the top right tab widget to improve usability. +- GUI updated: Disabled the Setup tab of Hamlib until hamlib is properly working. + +Jan 2012 - 0.5.9 +- Bug fixed: When starting for the first time, the CTY.DAT file downloaded had a loop that was not properly managed. (Debian bug: #653697) (TNX Jonas Stein) +- Fixed some typo: "Km" changed to "km". (Debian bug: #6536978) (TNX Jonas Stein) + +Dec 2011 - 0.5.8 +- Bug fixed: Right button in the search result did not "sent" the QSL card. +- Bug fixed: Closing the window did not ask to save data before exit. (TNX EA7HEG). +- Bug fixed: Beam was not properly calculated. (TNX DL6FBS). +- Bug fixed: Minor problem of APP_KLOG_NUMBER ADIF header fixed. +- Bug fixed: When modifying, some fields did not accepted empty fields (deleting). (TNX VK4JAZ). +- GUI updated: Remove the map tab in the main GUI as it is still not implemented. +- GUI updated: Ordered the tab-switching to make it more usable. (TNX Cedric). +- Added the support for QRP. Power has two decimals. (TNX VK4JAZ). + +Nov 2010 - 0.5.7 +- New feature: Added the Export needed QSL that allows to create an ADIF file with all the QSO with new ones and new bands still not confirmed that has not been QSLed. + The objective is to export it to a QSL or label printing software (until KLog implements that feature). +- Updated translations: SV by SM4ABE. +- GUI improved: Added sliders to be able to move panels. +- GUI improved: Changing the band combobox changes the TX Freq box and viceversa. +- Minor fix: The PROGRAMVERSION tag in log was not properly formated. + +Jul 2010 - 0.5.6 +- Fixed the hamlib compilation scripts (CMakeLists.txt, FindHamlib.cmake). (TNX AB4BD). +- Fixed one bug that causes some architectures not to compile. +- Fixed some permisions and other warnings for Fedora packaging. (TNX N3LRX). +- BUG fixed: Setting QSL from the log with right button was not working. + +May 2010 - 0.5.5 +- New feature: If cty.dat file is not found, KLog offers to download from the web. +- New feature: New tool to update the update the cty.dat file from the web. +- New feature: QRZ font color changes to red if has been worked previously. (Proposed by KE7TDY) + +Mar 2010 - 0.5.4 +- Small fix to initialize a variable before using it.(realTimeLog in klog.cpp) +- Fixed a bug that caused KLog to crash of no cty.dat file was found (bug #016917)(TNX KA6MAL) + +Feb 2010 - 0.5.3 +- Fixed a bug that caused modified QSO not being updated. +- Fixed a bug in the way the band & mode combobox managed the data. + +Feb 2010 - 0.5.2 +- Fixed a bug that causes a crash when connectiong to DXCluster. (bug #016653) +- Added a very basic Satellite support. +- Removed the Freq LCD and added two new editable widgets: Freq TX and Freq RX. (bug #016609) +- Added again the entity count of /M stations. + +Jan 2010 - 0.5.1 +- Fixed a bug with the display of the Date. + +Dec 2009 - 0.5.0 +- Migrated to Qt4. +- Updated translations: SV by SM4ABE, DE by DL5PD, ES by EA4TV. +- ZL2ACG joined the KLog team. Welcome and thank you Andrew! + +Apr 2009 0.4.7 +- New feature: Import cabrillo logs. +- Improved the ADIF compatibility up to ADIF 2.2.2. +- BUG fixed: Improved the confirmed QSO accounting. +- BUG fixed: RST format were not changed when another mode was selected if the CALL was empty. (TNX Alvaro, EA4RCT). +- BUG fixed: Calls like F0XXX/TU8 were not recognised if written as TU8/F0XXX. +- BUG fixed: TX_PWR is only saved when bigger than 0w :-) +- BUG fixed: Prefixes were not properly managed and some information, as the STATE from ADIF files were not always well imported. +- BUG fixed: Related with the ADIF saving CQ & ITU zones for QSO. It was not properly saved but can be recovered from the CALL. + +Dec 2008 - 0.4.6 +- BUG fixed: Printing was not properly working due to library actualization. +- BUG fixed: Fields STX/SRX/STATION_CALLSIGN/CONTEST_ID were copied from one QSO to the following one. + +Nov 2008 - 0.4.5 +- GUI fixed: Changed the order of the input fields tab switching. +- GUI fixed: Corrected the layout to fix the screen as ITU was not properly shown. +- GUI improved: Added a new one color to differ a completely new one spot in the DX-cluster from a needed in a band. + This last improvement is specially usefull in the search QSO to QSL. Test it! +- GUI improved: Added a tab in the botton box with the DXCC status (only main HF bands). +- New feature: Added the possibility to choose to show or not DX Spots based on CW/SSB activity. (TNX EA7BJ) +- New feature: Added the support of the 0.136KHz and GHz bands (not to the GUI but KLog can process them). +- BUG fixed: Minor check on QSL sent date was not properly done (no data lost). +- BUG fixed: Some Entities & zones where not properly recognized. +- BUG fixed: The state (needed/worked/confirmed) was not always properly shown. +- Improved the way is readed the cty.dat file and added support for its new format. +- Improved the ADIF compatibility supported fields, band frecuencies, modes... +- Improved the QSO merging with previous data. +- Updated translations: English, Spanish, TNX: Swedish (SM4ABE), German (DL5PD). + +May 2008 - 0.4.4 +- BUG fixed: KLog now recognises a "/LH" LightHouse stations (TNX G3OAG) +- BUG fixed: TLF import did not show the imported QSO in the log. QSO were not lost, just not shown. They were added to the logfile and saved when saving. No data was lost. This bug was introduced in release 0.4.2 after an optimization in the logfile reading. +BUG: Frequency was not compliance with ADIF as was saved in KHz instead of MHz. +- BUG fixed: If a logfile does not provide a MY_GRIDSQUARE, KLog does not add the predefined MY_GRIDSQUARE. +- BUG fixed: Some GRIDSQUARES were not detected as wrong althought they were. +- Minor fix: Corrected the URL to CTY.DAT file in the start message. +- GUI improved: Added a progress dialog when saving. +- GUI changes: Some widgets have been changed to prepare for the Qt4 migration. Specially the Led near the QRZ box that will reapear as usual when KLog is migrated to Qt4. +- Added the 70Mhz band. +- New feature: New tool added "Merge QSO data" that looks in all the log for the QSO that has been worked more than once and merges the data like Name, QSL info, QTH, Locator, ... +The information comming from all the appearances of a call in the log is grouped in the first appearance of that call in the log. + +Jan 2008 - 0.4.3.1 +- Package fix: Distributed with the language (po) files. + +Jan 2008 - 0.4.3 +- BUG fixed: KLog copied the QSL sent date into the QSL rec date. Only QSL rec date was lost but not the QSL status. +- BUG fixed: KLog now recognises a "/J" (Jamboree On The Air) Scout Station. +- GUI improved: Added the cty.dat URL. + + +Sep 2007 - 0.4.2 + +- New feature: The user can now configure to require or not the mandatory data for each QSO (QRZ, date, time, band, mode, RST tx & RST rx. (if not all the mandatory fields are entered, KLog's behaviour may be unexpected). +- New feature: Klog creates a temp file (~.klog/tempklog.adi) where it saves automatically all the QSOs entered until the log is manually saved. It prevents the log to be lost in case of unprevented KLog/computer failure. (TNX SM5OUU) +- BUG fixed: If the field (maybe any other field too) COMMENT is more than one line long, the log is broken and cannot be read. (TNX SM5OUU) +- BUG fixed: KLog does not ask for the file name if you have previously opened one file and the name has not changed. +- BUG fixed: In the GUI, the "Preferences" is correctly shown and not as "&Preferences". +- BUG fixed: When modifying a QSO, the number of QSOs was incremented when the user click over OK. +- BUG fixed: If a QSO was deleted the awards/number of QSO where not decresed. +- BUG fixed: When the date +- GUI improved: Deleted the WAE box (the WAE calculations was not implemented). +- New translation: KLog is now also in Swedish.(TNX SM4BE) +- New translation: KLog is now also in Galician.(TNX Fuco Mera) +- Updated German translation.(TNX DL5PD) +- Updated Spanish translation. + +Dic 2006 - 0.4.1 +- Bug fixed: The distance and beam is also resetted when the call box is deleted. +- Bug fixed: Calls /M and /MM do not count for DXCC.(TNX SM5CNQ) +- Bug fixed: It is possible to filter only for needed entities spots. +- Change: The hamlib signal meter has been removed from the GUI. +- New feature: There is a new tool available to find QSO from which the QSL is needed that you have still not sent the QSL. Very useful to find which QSL you need to send first! +- New feature: The MY_GRIDSQUARE is managed by default by all QSO (saves the default if none is entered) + + +Sep 2006 - 0.4.0 +- New feature: It is possible to manage user-created local awards (TPEA, DOK, WAS, ...) KLog reads user defined awards in a special format. +- New feature: KLog reads ".adif" files also.(TNX DL5PD) +- New feature: It is possible to add/delete new DXServer clusters in the setup box.(TNX DL5PD) +- GUI Improved: IOTA continent is now "automagically" detected. +- Bug fixed: Not really a bug but now, the log is cleaner as it does not save the "STATE" for ALL the QSO, only does it if needed. +- Bug fixed: After modifying a QSO the band and mode did not return to the last used (TNX DL5PD). +- Bug fixed: If the band changed, without any call in the Call box, KLog showed "new one, work it" +- Bug fixed: If the band changed, when modifying KLog fooled the entity color band boxes. +- Bug fixed: KLog recognises /MM as maritime mobile station +- Bug fixed: When opening a new log, the number of QSO did not start from zero. +- New translation: KLog is now also in German.(TNX DL5PD) + + +Jan 2006 - 0.3.3 +- New feature: It is now possible to sort the log by numbers from the main log. +- New feature: The frequency box is now also used when no hamlib support is active (double clicking over a + dx-cluster spot. +- New feature: If file name does not end in .adi, add the .adi. +- Bug fixed: Reporting a bug does not crash KLog although the widget has been temporally/drastically simplified. +- Bug fixed: It is possible to select the radio from the setup. +- Bug fixed: (introduced in 0.3.2) It was not possible to activate the progress dialog. +- Bug fixed: When clicking over "New File", confirmed entities was not set to "zero". +- Bug fixed: When reading from cty.dat file, the prefix was reading with some spaces at the begining. +- GUI Improved: After pressing OK/clear button, the QRZ box is selected. (TNX P.H. Rankin Hansen) +- GUI Improved: You can now reach to Name&QTH using the tab key (TNX P.H. Rankin Hansen) +- GUI Improved: QTH/Locator is now on the main QSO tab (TNX P.H. Rankin Hansen) + +Apr 2005 - 0.3.2 +- New feature-(unstable): Hamlib support to control/read the rig from KLog. +- New feature-(unstable): It is possible to click over a DX-Spot and set the radio to that frecuency & mode to work the spot (hamlib). +- New feature-(unstable): KLog reads the frecuency, band, mode and signal from the radio in real time (hamlib). +- New feature: After QSLing using the Right Button option from the search box, the search box is updated so the QSL status is shown updated. +- New feature: Local operator callsign can now be also logged. +- Bug fixed: A call ending in /B is now correctly recognised as a beacon. +- Bug fixed: Now it recognise all the "special suffix" like /r Rotuma, /a Mount Athos,... +- Bug fixed: WARC Bands were not correctly detected. +- GUI improved: The QRZ box always shows the QRZ as uppercase. (TNX ea4eej) +- Bug fixed: KLog can now read ADIF files where the QSO can be in several lines. +- Bug fixed: Importing from tlf, the QSO count was not properly done because of the comment lines. + +Jan 2005 - 0.3.1 +- KLog has been optimized and now runs faster. +- New feature: KLog saves the date/time of the last log file save. +- New feature: KLog ask the user for a comment when Importing a TLF log (for example + to note that those QSO are from an specific contest or whatever). +- Bug fixed: When selecting a DX-Spot from the DX-Cluster it did not overwrote the name. +- Bug fixed: When writting the log, there was an space missing before the . + It is just a "cosmetic" fix, not a real bug. +- Bug fixed: The same with the QSL card status. +- Bug fixed: KLog now recognises all the prefix that appears in cty.dat file with + special CQ/ITU zones. +- Bug fixed: KLog recognises the special call "3XDQC/P" as "3X" although it does not + follow the "prefix+number+suffix" pattern +- Bug fixed: When starting it now looks the cty.dat file in: ~/.klog and in the current + directory before starting without Entities' data. (TNX oh7jjt) +- Bug fixed: If we are modifying a QSO, the search box is not updated. Avoids some + crashes. + +Nov 2004 - 0.3.0 +- Fixed source code to allow compiling in more architectures. +- New feature: It is possible to show a progress dialog when opening the log file. + This is configurable. +- New feature: It is now possible to hide/show WARC spots or announces from cluster. +- New feature: Printing the is now possible. +- New feature: Sorting the log file is now possible. +- New feature: New option in right button to send&rec QSL at once. +- New feature: If a CALL has been previously worked it shows data to the actual QSO. +- Fixed bug: When modifying, the QTH was not modified. +- Fixed bug: It did not make you save if you just modify a QSO. +- Improved the gui: The "T" (from RST) does not disappears but is disabled when is + not needed. (TNX Ferm�n H.). +- Improved the gui: The QSL info text box is always active. +- Improved the gui: When connecting to the DX-Cluster server, automatically sets + the DXCluster window as active. + +May 2004 - 0.2.9 +- New feature: Selection of a DX-Spot shows the Entity data and state. +- New feature: KLog checks and captures the output of a sh/dx command in cluster. +- Fixed bug(caused in 0.2.8): QRZs as KA3AA, when the prefix is just one letter but the call uses two are now well recognised. +- Fixed bug: Better recognision from /number calls from DX-Cluster. + +Mar 2004 - 0.2.8 +- Fixed bug: Now ignores comments in TLF's files. +- Fixed bug: QRZs as VP2MCV, with complex prefixes are now well recognised. +- Improved the gui: RST, Power size adjusted. (TNX ea1ddn) +- Improved the gui: Name and QTH moved to QSO tab. +- Improved the gui: QSL via bureau is now the default option. (TNX ea1ddn) +- New feature: Calculate distance and beam if locator is entered. (TNX ea1ddn) +- New feature: Auto-open logfile when starting is now possible. (TNX ke6sls & ea1ddn) +- New feature: Now it is possible to double-click over a DXCluster spot to copy it to the QSO input box. (TNX ea1ddn) +- New feature: In the search box, QSOs are colored indicating if worked, needed, ... + +Jan 2004 - 0.2.7 +- Fixed bug: When editing a QSO, the QSL date was not properly displayed. +- Fixed bug: When entering a QSO, if the band is changed, KLog checks the state in this new band. +- Fixed bug: RST (tx&rx) in ADIF was always length 3, now is calculated for every QSO (at writing). +- Fixed bug: When modifying if QSL rec, the date was shown as 00/00/0000 +- New feature: It is posible to select a default mode & band in the setup. +- First Icon draft created. + +Dec 2003 - 0.2.6 +- Fixed bug: When Non real time logging was setting the time was "real time" when modifying. (TNX rz3dfs) +- Fixed bug: When reading the log file if an entity was not recognised Klog used to crash. +- Fixed bug: Now we recognise calls like 3XY1L when reading from a log file. +- Fixed bug: Improved the way of checking the confirmed/worked entities. +- Fixed bug: /P, /M and /QRZ are now better recognised when reading from logfile or clicked. +- Fixed bug: Stats were not shown after importing a tlf log file. +- Fixed bug: The zone & entity numbering fixed. +- New feature: It is posible to setup a default power level. +- New feature: When receiving a qsl with the mouse's right button the numbers are updated. +- New feature: Also a default color is selectionable as non-info color. +- Improved the gui: Band info leds removed to gain space in the info widget. + +Aug 2003 - 0.2.5 +- Fixed bug: RST was changed so when entering SSB RST. Entering 590 -> showed 509. (TNX ke6sls) +- Fixed bug: In cluster some frecs (432MHz and 2190m) were not properly recognized. +- New feature: It is now possible to hide HF/VHF/ANN spots or announces from cluster. +- New feature: It ask for the file name when saving first time instead of using "klog.adi" as default. (TNX ke6sls) +- New feature: It is now possible to add QSO in non real time (to add previous QSOs). (TNX yu1is) +- New feature: Power value is remembered from previous QSO. (TNX ke6sls) +- New feature: Basic bug report system. (TNX ke6sls) +- New feature: Mode selection affects to the RST configuration (TNX yu1is & ke6sls) +- New feature: Colors for confirmed/worked/needed are configurable by the user. +- New feature: Added tips to many widgets to explain their functions. + +Jul 2003 - 0.2.4 +- Fixed bug: Some calls were not recognized when checked (as 3da0sv). +- Fixed bug: When opening a second log having a previous one KLog did not ask for saving if needed. +- New feature: Basic Setup dialog and functions. +- New feature: Now the band combo change checks automatically the entity state. +- New feature: Smart cluster tells you if a dx spot is needed, worked and/or confirmed using colors. +- New feature: Clock is now in UTC by default but can be changed in preferences. + +Jul 2003 - 0.2.3 +- Improved the gui: The "entity state" LED has been moved to a always seen zone. +- Improved the gui: The way to edit QSO. +- Fixed bug: When searching it showed a wrong name and a qth. +- New feature: Basic DX-Cluster support. +- New feature: It is possible to add a log file to the current log. +- New feature: QSO deletion. +- New feature: QSO selection's data is shown in the show box. +- New feature: You can delete qso & manage qsl from the list with righ button quickly & easily. + +Jun 2003 - 0.2.2 +- Changed the behavior of the search box to look not only for complete calls but characters. +- Fixed bug: Improved the GUI layout. +- Fixed bug: When editing a previous QSO the date was not always properly saved. +- New feature: Added real time clock. + +Mar 2003 - 0.2.0 +- New feature: Added search for QSO tab. +- New feature: Added Name field. +- New feature: Added QTH field. +- New feature: Added operator (self call) field. +- Fixed bug: When saving log to file comment is not saved if there is no comment. +- Fixed bug: When selecting a "portable" (/P) (or /number) qso in the list it didn't recognize the entity. +- Translation updated: pt_BR. + +Mar 2003 - 0.1-beta02 +- Added many modes and some more bands. +- New feature: Asking for saving when finishing without save. +- New feature: Asking if overwrite when saving as to an existing file. +- New feature: The main led only shows info about the current band. +- New feature: Band/Mode sticky between contacts. +- New feature: Added the long path beam and distance. +- New feature: You can track each entity state per band with leds. +- New feature: Basic WAZ award support. +- Fixed bug: If you had a log and started a new one, the DXCC kept the data. +- Fixed bug: The IOTA number was limited to 99 (now 999). + +Feb 2003 - 0.1-beta +- New feature: Led is green (new one), yellow (worked but not confirmed), red (confirmed). +- New feature: Support calls as EA4TV/EA8, EA8/EA4TV. +- New feature: Import TLF logs. +- New feature: Added beam and distance calculations. +- New feature: Added Locator & IOTA fields. +- New feature: Basic DXCC award support. +- Improved the search the Entity algorithm (much quick). +- Clear button shows "Cancel" when modifying. +- Changed many classes from Qt classes to KDE classes. +- Fixed bug: Some times the QSL was checked automaticaly. +- Fixed bug: The Mode combobox showed SBB and it is SSB. +- Fixed bug: some calls showed as worked before and they were not. + +Jan 2003 - 0.1-alpha +- Fixed bug: When modifying a QSO it was not shown in the log box. +- Fixed bug: If you clicked over the log box but not over a qso, the program crashed +- Fixed bug: When modifying a QSO the date was always set to "now". +- Now you can select what log file you want to open. +- Now you can select the file's name when saving the log. +- Now you can create a new log always you want. +- Logs are now stored in ~/.klog directory by default. +- Logs are saved as klog.adi by default. +- Some prefix were not found in previous version. +- QSL date is activated when a QSO is selected +- QSL via is working, manager field, and QSL info field + +22-Jan-2003 - 0.1-pre-alpha +- First "release" of the software. +- You can add/edit QSOs and save/read your log to/from the disk with a fixed name in ADIF format. +- Can manage QSL sent/rec. diff --git a/TODO b/TODO new file mode 100644 index 00000000..9e238d29 --- /dev/null +++ b/TODO @@ -0,0 +1,419 @@ +BUG: KLog needs to update the Entity DB is shown on every start + +KLog should update ALWAYS when receiving from LoTW the QSL_LOTW_rcvd or add the QSO if not in local log. + +Review the process after Setup + + +TODO: Integrate HAMQTH https://www.hamqth.com/developers.php +TODO:- New feature: Regional Award support: #include "setuppages/setuppagesubdivisions.h" + +TODO: Stat More frequently worked calls: "select log.call, count(log.call) from log group by log.call ORDER BY count(log.call) DESC" +TODO: Stat Number of different callsigns +TODO: Find "duplicated" QSOs QUERY=> SELECT call, bandid, modeid, substr(qso_date, 1, 15), COUNT(*) c FROM log GROUP BY call, bandid, modeid, substr(qso_date, 1, 15) HAVING c>1 +TODO: Find duplicate queries: +select call, qso_date from log where datetime('2007-07-22 09:45:00', '-5 minutes')< datetime(qso_date) AND datetime('2007-07-22 09:49:00', '+5 minutes') > datetime(qso_date) +select call, qso_date, bandid, modeid, COUNT(*) c from log where datetime('2010-10-31 19:20:00', '-5 minutes')< datetime(qso_date) AND datetime('2010-10-31 19:20:00', '+5 minutes') > datetime(qso_date) group by call having c>1 + + +RC-BUGS: + + +TODO: Check if dxccStatusWidget in logwindow is useful and remove it if not. +NONE + +TODO: New feature: KLog can now control a rotator through PSTRotator. +TODO: UI: Added a DXCC summary obtained from the Tools menu. + +TBD - 0.9.8 +Hamlib: COMports in Windows must follow the format: \\.\com14 for ports highet than 9 but it works also for lower so ALL should be managed that way. + +For next release: +TODO: - Some warnings removed from compilation time. +TODO: - The log can be now updated with a LoTW ADIF file import. +TODO: - Isolate the Awards tab and create a widget with it. +TODO: - ADD A TIP ON the DXCC tab stating Prefix, CQ, ITU & Bearing. +TODO: Rework the band & mode hash tables to optimize queries (not sql queries) +TODO: Rework the DXCC & WAZ hash table sto optimize queries (not SQL queries) + +TODO: Import LOTW (MainWindow::slotADIFImport) +TODO: Remove the Querys from void SetupPageLogs:: + +TODO: Create a Widget with the WAZ status (copying the DXCC Status widget) + +Working: +TODO: ADD A TIP ON the DXCC tab stating Prefix, CQ, ITU & Bearing + + +TODO: Check how to implement qInstallMessageHandler +SAT DB: https://db.satnogs.org/api/ + +This is a kind of roadmap for KLog development. +It is not fixed... new features may be prioritized or not added without any notice ;-) +Feel free to request any roadmap change if you have any suggestion. + +TODO: To add the support to import/export the following ADIF fields that are already existing in DB + AWARD_SUBMITTED + AWARD_GRANTED + DARC_DOK + FISTS + FISTS_CC + GUEST_OP + "hrdlog_qso_upload_date VARCHAR(10)," + "hrdlog_qso_upload_status VARCHAR(1)," + "my_antenna VARCHAR," + "my_dxcc INTEGER, " + "my_fists INTEGER, " + "my_itu_zone INTEGER ," + "my_postal_code VARCHAR ," + "my_sota_ref VARCHAR, " + "my_usaca_counties VARCHAR, " + "my_vucc_grids VARCHAR, " + "silent_key VARCHAR(1), " + "region VARCHAR, " + "qrzcom_qso_upload_date VARCHAR(10), " + "qrzcom_qso_upload_status VARCHAR(1), " + "skcc VARCHAR, " + "sota_ref VARCHAR, " + "uksmg INTEGER, " + "usaca_counties VARCHAR, " + "ve_prov VARCHAR, " + "vucc_grids VARCHAR, " + + +TODO: Add a warning or periodically ADIF export so data is backup +TODO: Create a function to look for QSO without a DXCC and ask the user to confirm the DXCC. +TODO: Isolate the QSO input tab and create a widget with it. +TODO: Isolate the Main QRZ box and create a widget with it. +TODO: Isolate the Awards tab and create a widget with it. +TODO: Add an option to save the DXCluster data to a file (file based on name or so) + +TODO: Think if it is possible to create a function in the Widgets(i.e. MainWindowInputQSL) to read the data and + enter it in the DB automatically when the user clicks on "enter" + It would help to "isolate" it and make it more "independant" + +TODO: Review the color management in MainWindowInputOthers::setIOTA (and maybe others) (completewithPrevious of MainWindow) +TODO: Check if in mainwindow (read formUI and modify the eQSL/LOTW REC/SENT values are correct + +TODO: If no QSL sent via or rec via are defined, KLog shows as direct? It should be bureau + + +TODO: Add a cheking to the list of bureaus and propose the bureau for QSL via when there is an existing one and propose direct when no bureau is existing. + (http://www.iaru.org/qsl-bureaus.html) + +TODO: Define band limits for CW/SSB/RTTY... so when a click on the cluster is done, the right mode is proposed. +TODO: Add in the setup/Band/mode a combobox showing all the active band/modes so the user can select the default band/mode from that list. + +BUG: Potential bug +Double click on a QSO in the log on the Mode/Band... you can modifify the value. As it is a double click, the QSO goes to edit and ... +Check if: + - Only selected modes can be shown there. + - If double click on the log we only "quick modify" directly in the log, without editing. + +BUG: (TNX JL3OXR) +The DB is not storing if the time is stored in UTC or local so that info is lost. +If a user changes the configuration from time to time, the user will loose the real time when the QSO was made. +Solution: + - Consider the DB is only storing UTC QSO. + - Read config from user (or simply ask) and convert all the DB to UTC if needed (only one time when new version is installed to upgrade the DB) + Always: + - When entering data from the UI, check the user config and store only UTC time. + - TODO: Think how to show the data in the log or search box as data is stored in UTC and showed directly (specially log widget) + - Solution: Maybe changing the header to UTC may solve this and provide the info to the user that UTC is being used for storage + It may be weird for the user to see the log in UTC when working in local time... in the rest of the functions... + + +TODO: void DXCCStatusWidget::slotRefreshButtonClicked()//TODO: Define a way to show the status of the selected log or all the logs in the DB + +BUG: Optimize the KLog start +BUG: If logbook.dat is not existing but klogrc it is, KLog does not start. + +TODO: Add a tip on the DXCC Status showing some info: bearing, DXCC status (worked or not...) +TODO: Add a link or action on DXCCStatus items to doubleclick and search the QSOs that provide such status. + +TODO: Show the flag of the worked QRZ on the top right,close to the Entity Name + +TODO: Add the flags to the DXCluster +TODO: Click on an Entity name will select all the QSO of that Entity on the search box + +Debian: + +Time in UTC: (not to be fixed) +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654325 + + +BUG: Check the options that are marked in QSL when rightbutton. +i.e.: Is myQSL sent marked as requested when it should be the DX-QSL? + +TODO GUI: To add the CQ/ITU box or make them editable +TODO: checkIfNewBandOrMode() is not being used. Code should be removed... + +BUG: +Clublog: +void MainWindow::slotQRZReturnPressed() +_x = elogClublog->deleteQSO(clublogPrevQSO); +_x = elogClublog->sendQSO(dataProxy->getClubLogRealTimeFromId(modifyingQSO)) +It runs so fast and not serialized that at the end sometimes the QSO is deleted but not created afterwards + + + +TODO: Add the possibility to the user to select from the setup a call to be used in clublog or use the one comming from the station callsign lineedit +TODO: In slotQsoUploadFinished, if QSO is not uploaded. mark it as not uploaded in the log + +If qsoToEdit, nothing is modified and OK. (Clublog returns QSO DUPE) +Again qsoToEdit, nothing is modified and OK (Clublogs returns QSO DROPPED, and QSO is dropped!) + +TODO: Check the values that clublog is returning to manage errors and show messages to the user +TODO: To add the possibility to upload a modified QSO to clublog. +TODO: If there is an error in password/username or whatever, disable clublog in KLog + +TODO: Upload a logfile to clublog +// Ideas: https://code.google.com/p/datacod-qt-tools/source/browse/upcoder/uploader.h +// https://code.google.com/p/datacod-qt-tools/source/browse/upcoder/uploader.cpp + +TODO: Define a maximum QSO upload rate to clublog to avoid excesive API usage. + + + +KLog 0.9.4 +TODO: Some Entities are not recognized by ARRL (I, IG9, IT9 are the same ARRL id entities but different ones). Maybe I should not be working + with ARRLid or maybe I should detect special ones and "id+10000" so >10000 ids are special ones. + + +KLog 0.9.3 +TODO: Support CQ WW SSB (Including Cabrillo Import/Export) +TODO: Support CQ WW CW (Including Cabrillo Import/Export) + +KLog 0.9.4 +TODO: Hamlib support (Linux). + +KLog 0.9.5 +TODO: Support CQ WPX SSB (Including Cabrillo Import/Export) +TODO: Support CQ WPX CW (Including Cabrillo Import/Export) + +KLog 0.9.6 +WORLDEDITOR Dialog +TODO: WorldEditor is not updated when the CTY.CSV file is updated +TODO: World Editor: Create a way to add an entity. +TODO: World Editor: Create a way to remove an entity. +TODO: World Editor: Create a way to edit an entity. + +KLog 0.9.7 +TODO: Integrate with www.clublog.org (http://www.clublog.org/docs/pages/viewpage.action?pageId=1638482) + +KLog 0.9.8 +TODO: Integrate with eqsl.cc +https://www.eqsl.cc/qslcard/ADIFContentSpecs.cfm + +KLog 0.9.9 +TODO: Server to log all the QSO in real time (through the network) from N1MM + http://n1mm.hamdocs.com/tiki-index.php?page=UDP+Broadcasts&structure=N1MM+Logger+Documentation + +KLog 0.9.10 +TODO: Integrate with FLIGI real time logging (req by AA5VI) + +KLog 0.9.11 - Cluster release +TODO: DXCluster: Add flags to the DXCluster widget +TODO: DXCluster: UI: Modify the DX-Cluster tab to show the data in a table?: DX de/Freq/DX/Comment/Time/Loc +TODO: DXCluster: Add the DXMarathon information to the spots +TODO: DXCLuster: Create a band map (including a "to-be-worked") +TODO: Working on the dxCluster: Tool to save the DXCluster in a file (for further analysis). + +KLog 0.9.12 +TODO: Add the awards functionality (to manage awa files, TPEA, WAS, ...) + +KLog 0.9.13 +TODO: Mobile interface. Create a mobile UI. + + +TODO: Check if the data has been modified (only memory) and save the data! +TODO BUG: When modifying allow deleting data (as in KLog 0.5.8) +DONE BUG: Worked DXCC and WAZ are not updated until confirmed :-? + + +TODO: When importing an ADIF file with several logs, create automatically the logs as detected. +TODO: HelpHelpDialog +TODO: HelpAboutDialog + +TODO: setuppagelogs.cpp +TODO: Remove references to DataBase from all classes except DataProxySQLite + +TODO: DXCluster: Lines that are not a DX should not be in another color than default. +TODO: Add a default DX Cluster server + +TODO: Make a tool to mark and export QSO from the right button. (i.e. To mark several QSO to print and export the ADIF file with just those QSO) + +TODO: Add all the Entity Info to the slotClear to clear everything. +TODO: Add a list of previous QSO with the same station, if any. (Done in the search box) + +TODO: Create something like a void Awards::setAwardsOfAllQSO to read ALL QSO and set the Awards at once instead of adding one QSO per QSO + + +KLOG TODO: +TODO: To create a function tha runs the log and marks "N" if QSL has not been sent or received. +TODO: Create a setup page to configure a default prop_mode per band (ie 6m = ES) + +TODO: CTY.DAT update +TODO: Award tabs: center/bold tabs +TODO: Add export to cabrillo to the logfile + + + +SETUP: +TODO: Show progress when doing actions +TODO: Open this file when opening +TODO: DXCLuster: Show HF activity +TODO: DXCLuster: Show WARC +TODO: DXCLuster: Show VHUF +TODO: DXCLuster: Show confirmed +TODO: DXCLuster: Show SSB +TODO: DXCLuster: Show CW +TODO: DXCLuster: Show Ann/full +TODO: DXCLuster: Show WCY +TODO: DXCLuster: Show WWV +TODO: DXCLuster: Double click on a spot, add it to log +TODO: DXCLuster: Add Cluster servers +DONE: TODO: Colors: Confirmed, Worked, Needed band, New, Default + +TODO: Require mandatory fields in all QSO + +TODO: Awards: Add Award +TODO: Awards: Remove Award + +===================== + +TODO: Sats: Create a way to update the list of supported satellites. Maybe another tab in the setup dialog as the World Editor +TODO: Sats: https://www.eqsl.cc/qslcard/ADIFContentSpecs.cfm +TODO: Sats: https://lotw.arrl.org/lotw/faq#sats + +TODO: Sat Modes: +http://www.amsat.org/amsat/intro/sats_faq.html#RTFToC5 +http://www.sckans.edu/~sireland/radio/amsat.html + +A - This mode requires a 2 meter SSB/CW transmitter and a 10 meter SSB/CW receiver and supports CW and voice. +B - This mode requires a 70 cm SSB/CW transmitter and a 2 meter SSB/CW receiver and supports CW and voice. Some satellites also support RTTY and SSTV in this mode. +J -> V Uplink and U downlink +JA - This mode stands for J Analog and requires a 2 meter SSB/CW transmitter and a 70 cm SSB/CW receiver and supports CW, voice. +JD - This mode stands for J Digital and requires a 2 meter FM transmitter and a 70 cm SSB/CW receiver and supports packet. + +K - This mode requires a 15 meter SSB/CW transmitter and a 10 meter SSB/CW receiver and supports CW and voice. This mode is unique in that it can be done with a simple HF rig. +S - This mode requires a 70 cm SSB/CW transmitter and a 2.4 GHz SSB/CW receiver and supports CW and voice. Many people use a 2.4 GHz to 2 meter converter with a 2 meter SSB/CW receiver instead of buying a 2.4 GHz SSB/CW receiver. +T - This mode requires a 15 meter SSB/CW transmitter and a 2 meter SSB/CW receiver and supports CW and voice. +KT, KA, BS, Some satellites have dual modes that operate simultaneously. For example, AO-13 can operate in mode BS which means that it can do both mode B and mode S simultaneously. Other common dual modes are KT and KA. + +Mode V +Mode U +Mode U/V -> B + + +TODO: Code a way to sort the bands/modes in the "setuppagebandsmodes.cpp + +TODO: Create an "updateKLog" class to manage all the release updates +so there is a way to detect the version of KLog and upgrade the DB to the latest. + + +TODO: +The following fields may add information, even if the qsl has not been rcvd/sent +B B + +TODO: showStatusOfDXCC should be executed when band change. + +TODO: Add color support: messages for slotQRZTextChanged + +TODO: SetupPageColors: Check the style in the buttons as the rounds are lost when I change the color!! + +TODO: MainWindow::processConfigLine: add support for the cluster data. +TODO: Check when to connect the DXCluster and when no, it tries twice or more... + +TODO: Awards: make a function to calculate the total. + +TODO: Color support: Add needed, worked, confirmed, neutral colors to the configuration dialog. +TODO: Color support: Support the bar when a QRZ is entered. +TODO: Color support: Calculate a color for the log. + +TODO: World::getDXStatus: Calculate the algorithm to know the different status for a DXCC (confirmed, worked, confirmed in another band, ,...) +TODO: World:: Maybe the color should be returned from the World class + +TODO: Check the readDataFromUI. QSO are not added when in contest. +TODO: Check that New Log, Open, ... somewhere the log table is removed from the DB! + +TODO: The confirmed WAZ number is not properly calculated. + +TODO: GUI: Add in the input box a combobox to change the CQZ +TODO: GUI: Add in the input box a combobox to change the ITUZ + + +TODO: In CQWWSSB, when editing QSO the SRX, Points, multiplier, ... are not sent to the edit so after "OK", those data are lost. + +TODO: MainWindow::slotQsoDeleteFromLog: Add the CALL to the message before detele a QSO. + +TODO: Search GUI: add multi-selection QSO to do the same actions inmultiple QSO. + +TODO: When importing ADIF, update the logview sometimes... just to show the progress. +TODO: When importing ADIF: Only shows the ProgresDialog when the number is low >1000 <14000 investigate +TODO: Import Cabrillo + + +TODO: To check how can I order the columns in the log or in the search QTableView. Now the order depends only on the order of the SQL table. + +TODO: When modifying a cell directly in the log, it is possible to select a mode/band that is not actually active in the configuration. + +TODO: Slot: If (only)eqsl/lotw is sent/rec, the QSL_RCVD_VIA should be E + +TODO: Code a Tool to get statistcs for the contests, some kind of post contest tool. + http://www.qsl.net/3v4-002/Contests/2011%20CQ-WW-SSB%203V8SS/index.htm + +TODO: Be able to send scores to: http://www.cqcontest.ru/help/developers.jsp + +TODO: Create an update CTY.DAT without overwriting the current data. Just Adding and correcting (asking) if data is already there but different. +TODO: Create an export CTY.DAT file to create a CTY.DAT file with ALL the data in the current "world". + + + +FILEMANAGER +TODO: adifLogExportToFile: Count the marked QSO and adjust the numberOfQsos +TODO: FileManager::adifReadLog: Optimize the dialog (maybe updating only each 100 or as in KLog) +TODO: FileManager::adifReadLog: Add a semaphore/lock or similar to avoid running the same method twice or more at the same time... or at least the same file. + It seems that now it "serializes" the import... +TODO: Check that FileManager::adifLogExportToFile is exporting ALL the DB fields. +TODO: FileManager::adifLogExportToFile code a progress dialog for exporting. +TODO: When importing ADIF: Check if all the QSO have all the mandatory fields and warn the user if not. + +Optimization: The ADIF import is very slow. Optimization is recommended. + + +IMPROVEMENT: Improve the result of the log printing. + +DONE: TODO: Working on the DB version update functions +DONE: MainWindow::showAwards Remove "empty CQZ" when counting to avoid having 41 CQ zones +DONE: Code the color configuration for status of an entity (needed/worked/confirmed). +DONE: Color support: Calculate a color for the search results. +DONE: Color support: Calculate a color for the DXCluster. +DONE: TODO: Colors: Reconfigure the colors needs KLog to be restarted. +DONE: Working on the dxCluster: Color support, identify the different kind of lines... DX de, normal spots, comments, ... +DONE: Working on setAwardDXCC: When adding if a pair is already entered but we are going to add a confirmed status, modify it. +DONE: Right click on log to show a to edit QSO. +DONE: Right click on log to show a QSL received. +DONE: Right click on log to remove a QSO. +DONE: Right click on log to show a QSL sent. +TODO: Right click on search to remove a QSO. +DONE: Right click on search to show a QSL reception. +DONE: Right click on search to show a QSL sent. +DONE: Right click on search to show to edit QSO. +DONE: Added a select/unselect all button to the search QSO tab. +DONE: Search QSO to send +DONE: Add a button to export to ADIF the content of searchResultsTreeWidget + +DONE: When importing ADIF, if the CQZ/ITUZ/DXCC is empty, calculate and add it. +DONE: Not export ADIF fields if "N": +DONE: Print the log. +DONE: TODO: Time in UTC +DONE: TODO: Log in real time +DONE: Double click on cluster to select +DONE: TODO: When double clicking on a DX-Spot, frequency should be also copied to inputbox +DONE: TODO: When a DX-Spot is selected, the DX-Entity and status should be shown. +DONE: TODO: DXCluster: Connect, disconnect and connect again does not work +DONE: TODO: Add a field in Mainwindow to manage RX_PWR +DONE: TODO: slotclearbuttons->Colors to default +DONE: GUI: Add in the input box a combobox to change the DXCC + diff --git a/main.cpp b/main.cpp new file mode 100644 index 00000000..ee58719a --- /dev/null +++ b/main.cpp @@ -0,0 +1,423 @@ +/*************************************************************************** + main.cpp - description + ------------------- + begin : sept 2011 + copyright : (C) 2011 by Jaime Robles + email : jaime@robles.es + ***************************************************************************/ + +/***************************************************************************** + * This file is part of KLog. * + * * + * KLog is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * KLog is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with KLog. If not, see . * + * * + *****************************************************************************/ +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "klogdefinitions.h" +#include "startwizard.h" +#include "mainwindow.h" +#include "utilities.h" + + + +int main(int argc, char *argv[]) +{ + //qDebug() << "KLog Main: Start! " << QT_ENDL; + //qDebug() << "KLog Main: " << QSslSocket::supportsSsl() << QSslSocket::sslLibraryBuildVersionString() << QSslSocket::sslLibraryVersionString() << QT_ENDL; + QT_REQUIRE_VERSION(argc, argv, "5.9") + + QDir d1 = QDir(); + //QCoreApplication::setApplicationVersion(QString(APP_VERSION)); + //qDebug() << "KLog Main STARTED: " << version << QT_ENDL; + Utilities util = Utilities(); + QStringList arguments; + QTextStream cout(stdout); + //QCoreApplication::setOrganizationName("EA4K"); + //QCoreApplication::setOrganizationDomain("klog.xyz"); + //QCoreApplication::setApplicationName("KLog"); + QApplication app(argc, argv); + + QString iconSt; + iconSt = ":/img/klog.ico"; + QIcon KLogIcon(iconSt); + QApplication::setWindowIcon(KLogIcon); + app.setApplicationName(QString("KLog")); + app.setOrganizationName("EA4K"); + app.setOrganizationDomain("klog.xyz"); + app.setApplicationVersion(QString(APP_VERSION)); + QString version = QCoreApplication::applicationVersion(); + //qDebug() << "KLog Main: -10 " << QT_ENDL; + // Now we check if the user is executing from the command line + arguments.clear(); + arguments << app.arguments(); + if (arguments.length()>1) + { + if (arguments.contains("-h")) + { + //cout << "Usage: klog [OPTION]... [FILE]..." << QT_ENDL; + + cout << "Usage: klog [OPTION]..." << QT_ENDL; + cout << "Options:" << QT_ENDL; + cout << " -? Display this help" << QT_ENDL; + cout << " -h Display this help" << QT_ENDL; + cout << " -v Display program version" << QT_ENDL; + + //cout << " -e Export Adif file " << QT_ENDL; + } + else if (arguments.contains("-?")) + { + cout << "Usage: klog [OPTION]..." << QT_ENDL; + cout << "Options:" << QT_ENDL; + cout << " -? Display this help" << QT_ENDL; + cout << " -h Display this help" << QT_ENDL; + cout << " -v Display program version" << QT_ENDL; + } + else if (arguments.contains("-v")) + { + cout << "Version: KLog-" << app.applicationVersion() << QT_ENDL; + + } + else + { + cout << "Usage: klog [OPTION]..." << QT_ENDL; + cout << "Options:" << QT_ENDL; + cout << " -? Display this help" << QT_ENDL; + cout << " -h Display this help" << QT_ENDL; + cout << " -v Display program version" << QT_ENDL; + } + app.quit(); + return 0; + } + //qDebug() << "KLog Main: Start of translation activities: "<< (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + //qDebug() << "KLog Main: Detected language: " << (QLocale::system().name()).left(2) << ".qm" << QT_ENDL; + // Translations begin + QTranslator qtTranslator; + qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); /* Flawfinder: ignore */ + app.installTranslator(&qtTranslator); + QTranslator myappTranslator; + + bool missingTranslation = false; + //QString msgOSFilePath = QString(); // The OS depending part of the message to be printed if no translation is found. + + #if defined(Q_OS_WIN) + //qDebug() << "KLog WIN " << QT_ENDL; + //qDebug() << "KLog Main: -20 - WIN" << QT_ENDL; + if (QFile::exists(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm") ) /* Flawfinder: ignore */ + { + myappTranslator.load(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm"); /* Flawfinder: ignore */ + } + else if (QFile::exists(QDir::homePath()+"/klog/klog_" + (QLocale::system().name()).left(2)+ ".qm") ) /* Flawfinder: ignore */ + { + myappTranslator.load(QDir::homePath()+"/klog/klog_" + (QLocale::system().name())); /* Flawfinder: ignore */ + } + else if (((QLocale::system().name()).left(2)) == "en") /* Flawfinder: ignore */ + { // If language is English, it will execute without showing message + } + else + { + missingTranslation = true; + //msgOSFilePath = QCoreApplication::applicationDirPath() + "/translations/" ; + } + //qDebug() << "KLog Main: -20 - end WIN " << QT_ENDL; + #elif defined(Q_OS_OSX) + //qDebug() << "KLog OSX " << QT_ENDL; + + if (QFile::exists(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm") ) /* Flawfinder: ignore */ + { + myappTranslator.load(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm"); /* Flawfinder: ignore */ + } + else if (((QLocale::system().name()).left(2)) == "en") /* Flawfinder: ignore */ + { // If language is English, it will execute without showing message + + } + else + { + missingTranslation = true; + } + #else + //qDebug() << "KLog OTHER OS: " << (QLocale::system()).name() << QT_ENDL; + if (QFile::exists("klog_" + (QLocale::system().name()).left(2) + ".qm") ) /* Flawfinder: ignore */ + { + myappTranslator.load("klog_" + (QLocale::system().name()).left(2)); /* Flawfinder: ignore */ + } + else if (QFile::exists("/usr/share/klog/translations/klog_" + (QLocale::system().name()).left(2) + ".qm") ) /* Flawfinder: ignore */ + { + //qDebug() << "KLog OTHER -2: " << "/usr/share/klog/klog_" + (QLocale::system().name()).left(2) << QT_ENDL; /* Flawfinder: ignore */ + myappTranslator.load("/usr/share/klog/translations/klog_" + (QLocale::system().name())); /* Flawfinder: ignore */ + } + else if (QFile::exists(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm")) /* Flawfinder: ignore */ + { + //qDebug() << "KLog OTHER -3: " << QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) << QT_ENDL; + myappTranslator.load(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name())); /* Flawfinder: ignore */ + } + + else if (((QLocale::system().name()).left(2)) == "en") /* Flawfinder: ignore */ + { // If language is English, it will execute without showing message + + } + else + { + missingTranslation = true; + //sgOSFilePath = QCoreApplication::applicationDirPath() + "/translations/" ; + } + + #endif + //qDebug() << "KLog Main: -40 " << QT_ENDL; + if (missingTranslation) + { + //qDebug() << "KLog Main: Translation missing! " << QT_ENDL; + QMessageBox msgBox; + QString urlTranslate = QString(); + urlTranslate = "

TRANSLATE

"; + + QString msg = QString(); + + msgBox.setWindowTitle("KLog"); + msgBox.setIcon(QMessageBox::Warning); + msgBox.setTextFormat(Qt::RichText); + QString language = (QLocale::system().name()).left(2); /* Flawfinder: ignore */ + + msg = QString("No translation files for your language have been found so KLog will be shown in English.") + "

" + + QString("If you have the klog_%1.qm file for your language, you can copy it into the %2/translations/ folder and restart KLog.

If you want to help to translate KLog into your language, please contact the author.").arg(language).arg(QCoreApplication::applicationDirPath()) + + "

" + urlTranslate; + + msgBox.setText(msg); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setDefaultButton(QMessageBox::Ok); + msgBox.exec(); + + } + + //qDebug() << "KLog Main-1" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + + app.installTranslator(&myappTranslator); + //qDebug() << "KLog Main: End of translation activities: "<< (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + // Traslations end + + /* Application Singleton + * + * We want to run only one instance of KLog application + */ + QSystemSemaphore semaphore("klogapp", 1); // create semaphore with unique ID klogapp + semaphore.acquire(); // Raise the semaphore, barring other instances to work with shared memory + +#ifndef Q_OS_WIN + // in linux / unix shared memory is not freed when the application terminates abnormally, + // so you need to get rid of the garbage + QSharedMemory nix_fix_shared_memory("klogshm"); + + if (nix_fix_shared_memory.attach()) + { + nix_fix_shared_memory.detach(); // if there is no running instance then it remove the orphaned shared memory + } +#endif + + QSharedMemory sharedMemory("klogshm"); // Create a copy of the shared memory - Unique ID klogshm + bool is_running; + + /* + * trying to attach a copy of the shared memory to an existing segment + * + * if successful, it determines that there is already a running instance + * otherwise allocate 1 byte of memory and no instance is running + */ + if (sharedMemory.attach()) + { + is_running = true; + } + else + { + sharedMemory.create(1); + is_running = false; + } + + semaphore.release(); + + // If you already run one instance of the application, then we inform the user about it + // and complete the current instance of the application + if (is_running) + { + QMessageBox msgBox; + msgBox.setIcon(QMessageBox::Warning); + msgBox.setText(QObject::tr("KLog is already running.") + "\n" + QObject::tr("It is allowed to run only one instance.")); + msgBox.exec(); + return 1; + } + + // END OF Application Singleton + + QString configFileName, klogDir; + + klogDir = util.getHomeDir(); + configFileName = util.getCfgFile(); + + //qDebug() << "KLog Main-10" << QT_ENDL; + + //qDebug() << "KLog Main: Setting klog dir: " << (QTime::currentTime()).toString("HH:mm:ss")<< QT_ENDL;; + if (!QDir::setCurrent (klogDir) ) + { + //qDebug() << "MAIN: KLogDir does not exist.... creating " << QT_ENDL; + if (d1.mkdir(klogDir)) + { + if (QDir::setCurrent (klogDir) ) + { + //qDebug() << "MAIN: KLogDir has just been created and pointed " << QT_ENDL; + } + else + { + //qDebug() << "MAIN: KLogDir has just been created and pointed FAILED! " << QT_ENDL; + } + } + else + { + //qDebug() << "MAIN: KLogDir can not be created?? " << QT_ENDL; + } + } + else + { + //qDebug() << "MAIN: KLogDir already existed!! " << QT_ENDL; + } + //qDebug() << "KLog Main: Setting klog dir - finished: " << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + + //qDebug() << "KLog Main: Setting config file: " << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + QPixmap pixmap(":img/klog_512x512.png"); + //qDebug() << "KLog Main-51" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + QSplashScreen splash(pixmap); + + if(!QFile::exists(configFileName)) + { + //qDebug() << "MAIN: Starting wizard... " << QT_ENDL; + + StartWizard *wizard = new StartWizard(klogDir, version); + wizard->setModal(true); + int inMemory = wizard->exec(); + //qDebug() << "MAIN: Wizard inMemory: " << QString::number(inMemory) << QT_ENDL; + inMemory = 1; + + if (inMemory == 1) + { + //qDebug() << "MAIN: Wizard accepted " << QString::number(inMemory) << " ... Will run in Memory " << QT_ENDL; + MainWindow mw(klogDir, version); + mw.init(); + splash.finish(&mw); + //mw.checkIfNewVersion(); + //mw.recommendBackupIfNeeded(); + mw.show(); + return app.exec(); + } + + else + { + //qDebug() << "MAIN: Wizard cancelled " << QString::number(inMemory) << " ... should close " << QT_ENDL; + + QMessageBox msgBox; + msgBox.setText(QObject::tr("Install wizard was canceled before completing...")); + msgBox.setInformativeText(QObject::tr("Do you want to remove the KLog dir from your disk?")); + msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No ); + msgBox.setDefaultButton(QMessageBox::Yes); + int ret = msgBox.exec(); + + switch (ret) + { + case QMessageBox::Yes: + if (QDir::setCurrent (QDir::homePath()) ) + { + if (d1.remove(klogDir)) + { + QMessageBox msgBox; + msgBox.setText(QObject::tr("Your KLog dir has been removed") +"\n\n" + QObject::tr("Thank you for running KLog!")); + msgBox.exec(); + } + else + { + QMessageBox msgBox; + msgBox.setText(QObject::tr("I could not remove your KLog dir. You should do it manually if you want it removed from your hard disk.") +"\n\n" + QObject::tr("Thank you for running KLog!")); + msgBox.exec(); + } + } + else + { + QMessageBox msgBox; + msgBox.setText(QObject::tr("Your KLog dir could not be removed. You should do it manually if you want it removed from your hard disk.") +"\n\n" + QObject::tr("Thank you for running KLog!")); + msgBox.exec(); + } + break; + case QMessageBox::No: + QMessageBox msgBox; + msgBox.setText(QObject::tr("Remember that your KLog dir is on your system...") + "\n\n" + QObject::tr("Thank you for running KLog!")); + msgBox.exec(); + break; + } + return 0; + } + } + + else + { + //qDebug() << "Main: Start of DB Activities" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + DataBase *db = new DataBase(Q_FUNC_INFO, version, util.getKLogDBFile()); + //qDebug() << "Main: After Start of DB Activities" << QT_ENDL; + if (!db->createConnection(Q_FUNC_INFO)) + { + //qDebug() << "Main: Conection not created" << QT_ENDL; + return -1; // Exits with an error; no DB has been created + } + else + { + //qDebug() << "Main: DB to be updated" << QT_ENDL; + db->updateIfNeeded(); // Check if we need to update the DB + //qDebug() << "Main: DB Updated" << QT_ENDL; + } + //qDebug() << "Main: DB Updated" << QT_ENDL; + //qDebug() << "KLog Main-98" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + db->~DataBase(); + //qDebug() << "KLog Main-99" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + splash.show(); + //qDebug() << "KLog Main-100" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + splash.showMessage ("Creating window..."); + MainWindow mw(klogDir, version); + //qDebug() << "KLog Main-101" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + splash.showMessage ("Initializing window..."); + mw.init(); + //qDebug() << "KLog Main-102" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + splash.showMessage ("Cheching for new versions..."); + mw.checkIfNewVersion(); + splash.showMessage ("Checking if backup is needed..."); + //qDebug() << "KLog Main-103" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + mw.recommendBackupIfNeeded(); + splash.showMessage ("Showing window..."); + //qDebug() << "KLog Main-104" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + mw.show(); + //qDebug() << "KLog Main-105" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + splash.finish(&mw); + //qDebug() << "KLog Main-106" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + return app.exec(); + //qDebug() << "KLog Main-107" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + } + //qDebug() << "KLog Main-END: " << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL; + + //return app.exec(); +} + + diff --git a/src/dataproxy_sqlite.cpp b/src/dataproxy_sqlite.cpp index 54f01649..d0981b7b 100644 --- a/src/dataproxy_sqlite.cpp +++ b/src/dataproxy_sqlite.cpp @@ -2139,6 +2139,42 @@ QString DataProxy_SQLite::getLocatorFromQRZ(const QString &_call) } } +QString DataProxy_SQLite::getLocatorFromId (const int _id) +{ + if (_id <= 0) + { + return QString(); + } + QSqlQuery query; + QString queryString = QString("SELECT gridsquare FROM log WHERE id='%0'").arg(_id); + + bool sqlOk = query.exec(queryString); + + if (sqlOk) + { + while (query.next()) + { + if (query.isValid()) + { + if (((query.value(0)).toString()).length()>0) + { + QString v = (query.value(0)).toString(); + query.finish(); + return v; + } + } + } + query.finish(); + return QString(); + } + else + { + emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().nativeErrorCode(), query.lastQuery()); + query.finish(); + return QString(); + } +} + QString DataProxy_SQLite::getIOTAFromQRZ(const QString &_call) { @@ -2213,6 +2249,106 @@ QString DataProxy_SQLite::getQSLViaFromQRZ(const QString &_call) } } +QStringList DataProxy_SQLite::getFilteredLocators(const QString &_band, const QString &_mode, const QString &_prop, const QString &_sat, bool _confirmed) +{ + qDebug() << Q_FUNC_INFO << ": " << _band; + qDebug() << Q_FUNC_INFO << ": " << _mode; + qDebug() << Q_FUNC_INFO << ": " << _prop; + qDebug() << Q_FUNC_INFO << ": " << _sat; + + QStringList grids = QStringList(); + QSqlQuery query; + QString queryString; + + QString bandString = QString(); + int bandId = getIdFromBandName(_band); + + if (util->isValidBandId(bandId)) + { + bandString = QString("bandid = '%1'").arg(bandId); + } + else + { + bandString = QString("bandid <> ''"); + } + + + QString modeString = QString(); + int modeId = getIdFromModeName(_mode); + if (util->isValidModeId(modeId)) + { + modeString = QString("AND modeid = '%1'").arg(modeId); + } + else + { + modeString = QString("AND modeid <> '' "); + } + + QString propString = QString(); + if (isValidPropMode(_prop)) + { + propString = QString("AND prop_mode = '%1'").arg(_prop); + } + else + { + propString = QString("AND prop_mode <> 'x' "); + } + + QString confirmedString = QString(); + if (_confirmed) + { + confirmedString = QString("AND ((qsl_rcvd = 'Y') OR (lotw_qsl_rcvd = 'Y'))"); + } + else + { + confirmedString = QString("AND qsl_rcvd <> 'x' "); + } + + + QString satsString = QString(); + if (getDBSatId(_sat)>0) + { + satsString = QString("AND sat_name = '%1'").arg(_sat); + } + else + { + satsString = QString("AND sat_name <> 'x' "); + } + + queryString = QString("SELECT DISTINCT gridsquare from log WHERE %1 %2 %3 %4 %5 ORDER BY id ASC").arg(bandString).arg(modeString).arg(propString).arg(satsString).arg(confirmedString); + + + bool sqlOK = query.exec(queryString); + + if (sqlOK) + { + qDebug() << Q_FUNC_INFO << queryString << QT_ENDL; + while(query.next()) + { + if (query.isValid()) + { + queryString = (query.value(0)).toString(); + //qDebug() << Q_FUNC_INFO << queryString << QT_ENDL; + grids.append(queryString); + } + else + { + query.finish(); + return QStringList(); + } + } + query.finish(); + grids.sort(); + return grids; + } + else + { + emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().nativeErrorCode(), query.lastQuery()); + query.finish(); + return QStringList(); + } +} + bool DataProxy_SQLite::updateAwardDXCC() { //qDebug() << "DataProxy_SQLite::updateAwardDXCC" << QT_ENDL; @@ -4514,6 +4650,23 @@ QStringList DataProxy_SQLite::getContestOverlays() } } +bool DataProxy_SQLite::isValidPropMode(const QString &_prop) +{ + QSqlQuery query; + QString queryString = QString("SELECT shortname FROM prop_mode_enumeration WHERE shortname='%1'").arg(_prop); + bool sqlOK = query.exec(queryString); + if (sqlOK) + { + query.next(); + if (query.isValid()) + { + query.finish(); + return true; + } + } + return false; +} + QStringList DataProxy_SQLite::getPropModeList() { //qDebug() << "DataProxy_SQLite::getPropModeLists" << QT_ENDL; diff --git a/src/dataproxy_sqlite.h b/src/dataproxy_sqlite.h index 804a7972..06009025 100644 --- a/src/dataproxy_sqlite.h +++ b/src/dataproxy_sqlite.h @@ -149,10 +149,13 @@ public: QString getNameFromQRZ(const QString &_call); QString getQTHFromQRZ(const QString &_call); QString getLocatorFromQRZ(const QString &_call); + QString getLocatorFromId (const int _id); QString getIOTAFromQRZ(const QString &_call); QString getQSLViaFromQRZ(const QString &_call); // /Complete with previous + QStringList getFilteredLocators(const QString &_band, const QString &_mode, const QString &_prop, const QString &_sat, bool _confirmed = false); + bool updateAwardDXCC(); bool updateAwardWAZ(); // QRZ.com @@ -258,6 +261,7 @@ public: QStringList getBandNames(); QStringList getPropModeList(); + bool isValidPropMode(const QString &_prop); bool clearSatList(); bool addSatellite(const QString &_arrlId, const QString &_name, const QString &_downLink, const QString &_upLink, const QString &_mode, int id = -1); diff --git a/src/klog.qrc b/src/klog.qrc index 6c4455db..3efdb170 100644 --- a/src/klog.qrc +++ b/src/klog.qrc @@ -1,5 +1,6 @@ + qml/mapqmlfile.qml img/klog_512x512.png img/klog_256x256.png img/klog_logo.png diff --git a/src/klogdefinitions.h b/src/klogdefinitions.h index d797bf8c..891c37c5 100644 --- a/src/klogdefinitions.h +++ b/src/klogdefinitions.h @@ -51,6 +51,12 @@ struct EntityBandStatus { // Used to pass a list of data from Awards to dxccstat bool confirmed; }; + +struct Coordinate { + double lat; + double lon; +}; + #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)) #define QT_SKIP Qt::SkipEmptyParts #define QT_ENDL Qt::endl diff --git a/src/locator.cpp b/src/locator.cpp index 43a7b006..677eb5c4 100644 --- a/src/locator.cpp +++ b/src/locator.cpp @@ -102,50 +102,126 @@ Wikipedia: } } +Coordinate Locator::getLocatorCoordinate(const QString _tlocator) +{ + Coordinate _position; + _position.lat = 0.0; + _position.lon = 0.0; + if (!isValidLocator(_tlocator)) + { + //qDebug() << Q_FUNC_INFO << ": Not valid: " << tlocator; + return _position; + } + _position.lat = getLat (_tlocator); + _position.lon = getLon (_tlocator); + return _position; + +} + +Coordinate Locator::getLocatorCorner (const QString& tlocator, bool northWest) +{ + //qDebug() << Q_FUNC_INFO << ": " << tlocator; + Coordinate _position, _north, _south; + _position.lat = 0.0; + _position.lon = 0.0; + + Coordinate _positionC = _position; + _north = _position; + _south = _position; + + if (!isValidLocator(tlocator)) + { + //qDebug() << Q_FUNC_INFO << ": Not valid: " << tlocator; + return _position; + } + + + _positionC.lat = getLat (tlocator); + _positionC.lon = getLon (tlocator); + + if (tlocator.length() == 2) + { + _north.lat = _positionC.lat + 5; + _north.lon = _positionC.lon - 10; + + _south.lat = _positionC.lat - 5; + _south.lon = _positionC.lon + 10; + } + else if (tlocator.length() == 4) + { + _north.lat = _positionC.lat + 0.5; + _north.lon = _positionC.lon -1; + + _south.lat = _positionC.lat - 0.5; + _south.lon = _positionC.lon + 1; + } + else if (tlocator.length() == 6) + { + _north.lat = _positionC.lat ;//+ 0.020833333333333; //(2.5/60/2); + _north.lon = _positionC.lon - 0.0416666666666667;//(5/60/2); + + _south.lat = _positionC.lat - (2*0.020833333333333); //(2.5/60/2); + _south.lon = _positionC.lon + 0.0416666666666667;//(5/60/2); + } + else if (tlocator.length() == 8) + { + + } + + //qDebug() << Q_FUNC_INFO; + //qDebug() << "Center: lat/lon" << QString::number(_positionC.lat) << "/" << QString::number(_positionC.lon); + //qDebug() << QString ("North : %1, %2").arg(_north.lat).arg(_north.lon); + //qDebug() << QString ("South : %1, %2").arg(_south.lat).arg(_south.lon); + if (northWest) + { + return _north; + //qDebug() << QString ("North : %1, %2").arg(_position.lat).arg(_position.lon); + } + else + { + return _south; + //qDebug() << QString ("South : %1, %2").arg(_position.lat).arg(_position.lon); + } +} double Locator::getLat(const QString& tlocator){ - //qDebug() << "Locator::getLat: " << tlocator; -// Read formula from: https://unclassified.software/files/source/MaidenheadLocator.cs -//Revisar las formulas porque salen distancias erroneas + //qDebug() << "Locator::getLat: " << tlocator; + // Read formula from: https://unclassified.software/files/source/MaidenheadLocator.cs + //Revisar las formulas porque salen distancias erroneas if (!isValidLocator(tlocator)) { return 0.0; } + QString aux = tlocator.toUpper(); - if (tlocator.length() == 2) + if (aux.length() == 2) { - //qDebug() << "Locator::getLat - num: " << QString::number((tlocator.at(1)).toLatin1() ); - //qDebug() << "Locator::getLat: " << QString::number((((tlocator.at(1)).toLatin1() - 65) * 10) - 90) << QT_ENDL; - return (((tlocator.at(1)).toLatin1() - 65) * 10) - 90; + return (((aux.at(1)).toLatin1() - 'A') * 10) - 85; } - if (tlocator.length() == 4) + if (aux.length() == 4) { - return ((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0' + 0.5) - 90; - //return (((tlocator.at(1)).toLatin1() - 65) * 10) + ((tlocator.at(3)).toLatin1() - 48) - 90; + //return (((aux.at(1)).toLatin1() - 'A') * 10) + ((aux.at(3)).toLatin1() - '0' * 1) - 85; + return (((aux.at(1)).toLatin1() - 'A') * 10) + ((aux.at(3)).digitValue() + 0.5) - 90; } - else if (tlocator.length()== 6) + if (aux.length() == 6) { - //qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.5) / 24 - 90) << QT_ENDL; - return ((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.5) / 24 - 90; - //return (((tlocator.at(1)).toLatin1() - 65) * 10) + ((tlocator.at(3)).toLatin1() - 48) + (((tlocator.at(5)).toLatin1() - 65 + 0.5) / 24) - 90; + double result = (((aux.at(1)).toLatin1() - 'A') * 10 ) + (aux.at(3).digitValue()) + (((aux.at(5)).toLatin1() - 'A') * (2.5/60)) + (static_cast(2.5/60)) - 90; + + //qDebug() << QString("%1: Locator/Latitude: %2/%3").arg(Q_FUNC_INFO).arg(aux).arg(result); + return result; } - else if (tlocator.length()== 8) + if (aux.length()== 8) { - //qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.5) / 240 - 90) << QT_ENDL; - return ((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.5) / 240 - 90; - //return (((tlocator.at(1)).toLatin1() - 65) * 10) + ((tlocator.at(3)).toLatin1() - 48) + (((tlocator.at(5)).toLatin1() - 65 + 0.5) / 24) - 90; + return ((aux.at(1)).toLatin1() - 'A') * 10 + ((aux.at(3)).digitValue() * 1) + (((aux.at(5)).toLatin1() - 'A') * (2.5/60)) + ((aux.at(7)).toLatin1() - '0' * 0.5) / 240 - 90; } - else if (tlocator.length()== 10) + if (aux.length()== 10) { - //qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.0) / 240 + ((tlocator.at(9)).toLatin1() - 'A' + 0.5) / 240 / 24 - 90) << QT_ENDL; - return ((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.0) / 240 + ((tlocator.at(9)).toLatin1() - 'A' + 0.5) / 240 / 24 - 90; - //return (((tlocator.at(1)).toLatin1() - 65) * 10) + ((tlocator.at(3)).toLatin1() - 48) + (((tlocator.at(5)).toLatin1() - 65 + 0.5) / 24) - 90; + return ((aux.at(1)).toLatin1() - 'A') * 10 + ((aux.at(3)).toLatin1() - '0') + ((aux.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((aux.at(7)).toLatin1() - '0' + 0.0) / 240 + static_cast((aux.at(9)).toLatin1() - 'A' + 0.5) / 240 / 24 - 90; } else { return 0.0; } - } double Locator::getLon(const QString& tlocator) @@ -156,32 +232,43 @@ double Locator::getLon(const QString& tlocator) { return 0.0; } + QString aux = tlocator.toUpper (); - - if (tlocator.length() == 2) + if (aux.length() == 2) { - return (((tlocator.at(0)).toLatin1() - 65) * 20) - 180; + return (((aux.at(0)).toLatin1() - 'A') * 20) + 10 - 180; } - if (tlocator.length() == 4) + if (aux.length() == 4) { - return ((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0' + 0.5) * 2 - 180; - //return (((tlocator.at(0)).toLatin1() - 65) * 20) + (((tlocator.at(2)).toLatin1() - 48) * 2) - 180; + //qDebug() << QString("%1 + %2 + %3 - 180 = %4") + // .arg((((aux.at(0)).toLatin1() - 'A') * 20)) + // .arg((((aux.at(2)).digitValue () ) * 2)) + // .arg(1) + // .arg((((aux.at(0)).toLatin1() - 'A') * 20) + (((aux.at(2)).digitValue () ) * 2) +1 - 180); + + // return ((aux.at(0)).toLatin1() - 'A') * 20 + 10 + (((aux.at(2)).digitValue () ) * 2) + 0.0416666666666667 - 180; + + return (((aux.at(0)).toLatin1() - 'A') * 20) + + (((aux.at(2)).digitValue () ) * 2) + 1 - 180; } - else if (tlocator.length()== 6) + if (aux.length() == 6) { - //qDebug() << "Locator::getLon: " << QString::number(((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.5) / 12 - 180) << QT_ENDL; - return ((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.5) / 12 - 180; - //return (((tlocator.at(0)).toLatin1() - 65) * 20) + (((tlocator.at(2)).toLatin1() - 48) * 2) + (((tlocator.at(4)).toLatin1() - 65 + 0.5) / 12) - 180; + //qDebug() << QString("%1 + %2 + %3 + %4 - 180 = %5").arg((((aux.at(0)).toLatin1() - 'A') * 20)).arg((((aux.at(2)).digitValue () ) * 2)).arg((((aux.at(4)).toLatin1() - 'A')/12 )).arg(0.0416666666666667).arg((((aux.at(0)).toLatin1() - 'A') * 20) + (((aux.at(2)).digitValue () ) * 2) + (static_cast((aux.at(4)).toLatin1() - 'A')/12.0 ) + 0.0416666666666667 - 180); + + + return (((aux.at(0)).toLatin1() - 'A') * 20) + + (((aux.at(2)).digitValue () ) * 2) + + (static_cast(((aux.at(4)).toLatin1()) - 'A')/12.0 ) + + 0.0416666666666667 - 180; } - else if (tlocator.length()== 8) + if (aux.length()== 8) { - //qDebug() << "Locator::getLon: " << QString::number(((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.0) / 12 + ((tlocator.at(6)).toLatin1() - '0' + 0.5) / 120 - 180) << QT_ENDL; - return ((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.0) / 12 + ((tlocator.at(6)).toLatin1() - '0' + 0.5) / 120 - 180; + return ((aux.at(0)).toLatin1() - 'A') * 20 + ((aux.at(2)).digitValue()) * 2 + static_cast((aux.at(4)).toLatin1() - 'A' + 0.0) / 12 + static_cast((aux.at(6)).toLatin1() - '0' + 0.5) / 120 - 180; } - //else if (tlocator.length()== 10) + //else if (aux.length()== 10) //{ - // return ((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.0) / 12 + ((tlocator.at(6)).toLatin1() - '0' + 0.0) / 120 + ((tlocator.at(8)).toLatin1() - 'A' + 0.5) / 120 / 24 - 180; + // return ((aux.at(0)).toLatin1() - 'A') * 20 + ((aux.at(2)).toLatin1() - '0') * 2 + ((aux.at(4)).toLatin1() - 'A' + 0.0) / 12 + ((aux.at(6)).toLatin1() - '0' + 0.0) / 120 + ((aux.at(8)).toLatin1() - 'A' + 0.5) / 120 / 24 - 180; // } else { @@ -237,7 +324,6 @@ int Locator::getBeam(const double lon1, const double lat1, const double lon2, co /* Convert to degrees */ return int(bearing); - } int Locator::getDistance(const double lon1, const double lat1, const double lon2, const double lat2, const bool _imperialSystem){ @@ -274,75 +360,59 @@ bool Locator::checkCoords(const double lon1, const double lat1){ } } -QString Locator::getLocator(const double lon1, const double lat1) const{ +QString Locator::getLocator(const double lon1, const double lat1, int length) const{ /* -------------- Subroutine ----------------------- Calculate locator from longitude and latitude Input : lon = Longitude in decimal degrees (+ = West; - = East). lat = Latitude in decimal degrees (+ = North; - = South). Output: locator = 6 characters world wide locator. ------------------------------------------------- */ - //qDebug() << "Locator::getLocator: (" << QString::number(lon1) << "/" << QString::number(lat1) << ")" << QT_ENDL; - QString locat = ""; //NO locator + //qDebug() << "Locator::getLocator: (" << QString::number(lon1) << "/" << QString::number(lat1) << ")" << QT_ENDL; + QString locat = ""; //NO locator - double lo, la; - int alo,bla,clo,dla,elo,fla; + double lo, la; + int alo,bla,clo,dla,elo,fla; - lo=(-lon1+180)/20; - la = (lat1+90)/10; + lo = (lon1+180)/20; + la = (lat1+90)/10; - alo=int(floor(lo)); - bla=int(floor(la)); - lo=(lo-(double(alo)))*10; - la=(la-(double(bla)))*10; + alo=int(floor(lo)); + bla=int(floor(la)); - clo = int(floor(lo)); - dla = int(floor(la)); + locat = locat + QChar(alo+'A'); + locat = locat + QChar(bla+'A'); + //qDebug() << Q_FUNC_INFO << ": " << locat; + if (length == 2) + { + return locat; + } - elo = int(floor((lo-double(clo) ) * 24 )) ; - fla = int(floor((la-double(dla) ) * 24 )); + lo=(lo-(double(alo)))*10; + la=(la-(double(bla)))*10; -//TODO: Test if locators are calculated correctly. -// generation function has been changed because of the QT4 migration - locat = locat + QChar(alo+'A'); - locat = locat + QChar(bla+'A'); - locat = locat + QChar(clo+'0'); - locat = locat + QChar(dla+'0'); - locat = locat + QChar(elo+'A'); - locat = locat + QChar(fla+'A'); + clo = int(floor(lo)); + dla = int(floor(la)); + locat = locat + QChar(clo+'0'); + locat = locat + QChar(dla+'0'); -// locat.at(0)=QChar(alo+'A'); + qDebug() << Q_FUNC_INFO << ": " << locat; + if (length == 4) + { + return locat; + } -// locat.at(1)=QChar(bla+'A'); -// locat.at(2)=QChar(clo+'0'); -// locat.at(3)=QChar(dla+'0'); -// locat.at(4)=QChar(elo+'A'); -// locat.at(5)=QChar(fla+'A'); + elo = int(floor((lo-double(clo) ) * 24 )) ; + fla = int(floor((la-double(dla) ) * 24 )); - - -return locat; + locat = locat + QChar(elo+'A'); + locat = locat + QChar(elo+'A'); + qDebug() << Q_FUNC_INFO << ": " << locat; + //locat = locat + QChar(elo+'A'); + //locat = locat + QChar(fla+'A'); + //qDebug() << Q_FUNC_INFO << ": " << locat; + return locat; } -/* -void Locator::degTodms(const double deg){ - double temp; - double ddeg; - ddeg = 0; - ddeg += 1.0/7200.0; // Round-up to 0.5 sec - int ideg = (int)ddeg; - temp = ( deg - (double)ideg ) * 60.0; - int imin = (int)temp; - temp = ( temp - (double)imin ) * 60.0; - int isec = (int)(temp); -} - - -double Locator::dmsTodeg (int deg, int min, int sec) -{ - return (double)deg + (double)min/60.0 + (double)sec/3600.0; -} -*/ - int Locator::getBeamBetweenLocators (const QString& tlocator1, const QString& tlocator2) { //qDebug() << "Locator::getBeamBetweenLocators: " << tlocator1 << "/" << tlocator2 << QT_ENDL; @@ -358,9 +428,7 @@ int Locator::getBeamBetweenLocators (const QString& tlocator1, const QString& tl double lat2 = getLat(tlocator2); return getBeam(lon1, lat1, lon2, lat2); - } - } int Locator::getDistanceBetweenLocators (const QString& tlocator1, const QString& tlocator2, const bool _imperialSystem) @@ -377,7 +445,5 @@ int Locator::getDistanceBetweenLocators (const QString& tlocator1, const QString double lat2 = getLat(tlocator2); return getDistance(lon1, lat1, lon2, lat2, _imperialSystem); - //return getBeam(lon1, lat1, lon2, lat2); - } } diff --git a/src/locator.h b/src/locator.h index 9f2cc01e..39b19297 100644 --- a/src/locator.h +++ b/src/locator.h @@ -29,6 +29,7 @@ #include #include #include +#include "klogdefinitions.h" @@ -46,22 +47,23 @@ class Locator{ public: - Locator(); - ~Locator(); + Locator(); + ~Locator(); - bool isValidLocator(const QString& tlocator); - double getLat(const QString& tlocator); - double getLon(const QString& tlocator); - QString getLocator(const double lon1, const double lat1) const; - int getBeam(const double lon1, const double lat1, const double lon2, const double lat2); - int getBeamBetweenLocators (const QString& tlocator1, const QString& tlocator2); - int getDistance(const double lon1, const double lat1, const double lon2, const double lat2, const bool _imperialSystem); - int getDistanceBetweenLocators (const QString& tlocator1, const QString& tlocator2, const bool _imperialSystem); - //int getDistanceMilles(const double lon1, const double lat1, const double lon2, const double lat2); - //void degTodms(const double deg); - //double dmsTodeg (int deg, int min, int sec); - - bool checkCoords(const double lon1, const double lat1); + bool isValidLocator(const QString& tlocator); + double getLat(const QString& tlocator); + double getLon(const QString& tlocator); + QString getLocator(const double lon1, const double lat1, int length=6) const; //IN80aa is the default length + int getBeam(const double lon1, const double lat1, const double lon2, const double lat2); + int getBeamBetweenLocators (const QString& tlocator1, const QString& tlocator2); + int getDistance(const double lon1, const double lat1, const double lon2, const double lat2, const bool _imperialSystem); + int getDistanceBetweenLocators (const QString& tlocator1, const QString& tlocator2, const bool _imperialSystem); + //int getDistanceMilles(const double lon1, const double lat1, const double lon2, const double lat2); + //void degTodms(const double deg); + //double dmsTodeg (int deg, int min, int sec); + Coordinate getLocatorCoordinate(const QString _tlocator); + Coordinate getLocatorCorner (const QString& tlocator, bool northWest = true); //northWest = returns the Noth West corner, false implies South East + bool checkCoords(const double lon1, const double lat1); private: diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9ba17b6a..97b8f826 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -64,6 +64,7 @@ MainWindow::MainWindow(const QString &_klogDir, const QString &tversion) dataProxy = new DataProxy_SQLite(Q_FUNC_INFO, softwareVersion); lotwUtilities = new LoTWUtilities(klogDir, softwareVersion, Q_FUNC_INFO, dataProxy); eqslUtilities = new eQSLUtilities(Q_FUNC_INFO); + mapWindow = new MapWindowWidget(dataProxy, this); //qDebug() << Q_FUNC_INFO << ": Before DXCCStatusWidget " << QTime::currentTime().toString("hh:mm:ss") << QT_ENDL; dxccStatusWidget = new DXCCStatusWidget(dataProxy, Q_FUNC_INFO); @@ -477,6 +478,7 @@ void MainWindow::init() infoWidget->showInfo(-1); //qDebug() << Q_FUNC_INFO << " - 120"; //lotwTQSLpath = util->getTQSLsPath() + util->getTQSLsFileName(); + mapWindow->init(); upAndRunning = true; mainQSOEntryWidget->setUpAndRunning(upAndRunning); //qDebug() << Q_FUNC_INFO << " - 130"; @@ -736,14 +738,13 @@ void MainWindow::createStatusBar() logEvent(Q_FUNC_INFO, "END", logSeverity); } -/* -void MainWindow::slotWorldMapShow() +void MainWindow::slotShowMap() { - //worldMapWidget->resize(500,300); - //worldMapWidget->loadMap(); - worldMapWidget->show(); + Coordinate center = locator->getLocatorCoordinate(world->getQRZLocator(stationCallsign)); + mapWindow->setCenter(center); + mapWindow->show(); } -*/ + void MainWindow::setMainWindowTitle() { QString aux = dataProxy->getCommentsFromLog(currentLog); @@ -983,6 +984,10 @@ void MainWindow::slotQRZReturnPressed() yearChangedDuringModification = false; readingTheUI = false; + QString lastLocator = dataProxy->getLocatorFromId(dataProxy->getLastQSOid()); + //qDebug() << Q_FUNC_INFO << ": Locator: " << lastLocator; + mapWindow->addLocator(lastLocator, workedColor); + //qDebug() << Q_FUNC_INFO << "Just before cleaning"; slotClearButtonClicked(Q_FUNC_INFO); @@ -3952,6 +3957,11 @@ void MainWindow::createMenusCommon() connect(showStatsAct, SIGNAL(triggered()), this, SLOT(slotShowStats())); showStatsAct->setToolTip(tr("Show the statistics of your radio activity.")); + showMapAct = new QAction (tr("Show Map"), this); + toolMenu->addAction(showMapAct); + connect(showMapAct, SIGNAL(triggered()), this, SLOT(slotShowMap())); + showMapAct->setToolTip(tr("Show the statistics of your radio activity.")); + //qDebug() << "MainWindow::createMenusCommon before" << QT_ENDL; //toolMenu->addSeparator(); //showRotatorAct = new QAction (tr("Rotator"), this); @@ -5512,9 +5522,11 @@ void MainWindow::checkIfNewBandOrMode() //qDebug() << "MainWindow::checkIfNewBandOrMode - bands -" << QString::number(bands.length()) << " - " << QTime::currentTime().toString("hh:mm:ss") << QT_ENDL; mainQSOEntryWidget->setBands(bands); satTabWidget->addBands(bands); + mapWindow->setBands(bands); //qDebug() << "MainWindow::checkIfNewBandOrMode - modes -" << QString::number(modes.length()) << " - " << QTime::currentTime().toString("hh:mm:ss") << QT_ENDL; mainQSOEntryWidget->setModes(modes); + mapWindow->setModes(modes); //qDebug() << "MainWindow::checkIfNewBandOrMode - setting bands" << QTime::currentTime().toString("hh:mm:ss") << QT_ENDL; @@ -7757,6 +7769,7 @@ void MainWindow::slotValidBandsReceived(const QStringList &_b) //qDebug() << Q_FUNC_INFO << QT_ENDL; dxccStatusWidget->setBands(Q_FUNC_INFO, _b, true); satTabWidget->addBands(_b); + mapWindow->setBands(_b); //qDebug() << Q_FUNC_INFO << " - END" << QT_ENDL; logEvent(Q_FUNC_INFO, "END", logSeverity); } @@ -8168,6 +8181,7 @@ void MainWindow::addNewValidMode(const QString &_mode) readActiveModes (_newM); mainQSOEntryWidget->setModes(modes); + mapWindow->setModes(modes); logEvent(Q_FUNC_INFO, "END", logSeverity); //qDebug() << "MainWindow::addNewValidMode: END" << QT_ENDL; @@ -8257,6 +8271,7 @@ void MainWindow::slotDefineNewBands (const QStringList _bands) bands.clear(); bands = qsTemp; mainQSOEntryWidget->setBands(bands); + mapWindow->setBands(bands); satTabWidget->addBands(bands); //qDebug() << "MainWindow::defineNewBands - END" << QT_ENDL; diff --git a/src/mainwindow.h b/src/mainwindow.h index 470eb9fb..e2438044 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -83,7 +83,7 @@ #include "widgets/adiflotwexportwidget.h" #include "widgets/showadifimportwidget.h" //#include "widgets/advancedsearch/advancedsearchwidget.h" -//#include "worldmapwidget.h" +#include "widgets/map/mapwindowwidget.h" #include "widgets/showkloglogwidget.h" #include "qso.h" #include "klogdefinitions.h" @@ -304,7 +304,7 @@ private slots: // PST Rotator //void slotRotatorShow(); // WORLD MAP - //void slotWorldMapShow(); + void slotShowMap(); //DXCCWIDGET //void slotShowQSOFromDXCCWidget(const int _q); @@ -361,12 +361,13 @@ private: bool sendQSLByDefault; bool deleteAlwaysAdiFile; + MapWindowWidget *mapWindow; + // PST Rotator //PSTRotatorSupport *pstRotator; //bool usePSTRotator; //RotatorWidget *rotatorWidget; // - //WorldMapWidget *worldMapWidget; void createStatusBar(); void createUI(); void createUIDX(); @@ -574,7 +575,7 @@ private: */ QAction *qslSentRequestedAct; QAction *qslRecRequestedAct; - //QAction *showWorldMapAct; + QAction *showMapAct; QStringList bands; QStringList modes; diff --git a/src/qml/mapqmlfile.qml b/src/qml/mapqmlfile.qml new file mode 100644 index 00000000..d592c820 --- /dev/null +++ b/src/qml/mapqmlfile.qml @@ -0,0 +1,104 @@ +/*************************************************************************** + mapqmlfile.qml - description + ------------------- + begin : May 2021 + copyright : (C) 2021 by Jaime Robles + email : jaime@robles.es + ***************************************************************************/ + +/***************************************************************************** + * This file is part of KLog. * + * * + * KLog is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * KLog is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with KLog. If not, see . * + * * + *****************************************************************************/ +import QtQuick 2.0 +import QtQuick.Window 2.12 +import QtLocation 5.6 +import QtPositioning 5.6 + +Rectangle { + width: 640 + height: 480 + visible: true + property alias zoom: map.zoomLevel + property alias lat: map.center.latitude + property alias lon: map.center.longitude + + Location { + // Define location that will be "center" of map + id: mapCenter + //coordinate { + // latitude: 43.2 + // longitude: -4.816669 + //} + } + + FocusScope + { + anchors.fill: parent + } + Plugin { + id: mapPlugin + name: "osm" // "osm", "mapboxgl", "esri", "googleMap... + } + + Map { + id: map + anchors.fill: parent + plugin: mapPlugin + center: mapCenter.coordinate + + //onCenterChanged: + //{ + // console.log("Map Center X: ", lat, " - Map Center Y: ", lon); + //} + zoomLevel: 14 + MouseArea + { + hoverEnabled: true + anchors.fill: parent + + //onPositionChanged: + //{ + // Qt.point(mouseX, mouseY) + // var coordinate = map.toCoordinate(Qt.point(mouse.x,mouse.y)) + // console.log("Mouse Position (", mouseX, ", ", mouseY, ")"); + // console.log("Mouse GeoPosition (", coordinate.latitude, ", ", coordinate.longitude, ")"); + //} + } + + MapItemView + { + model: rectangle_model + delegate: MapRectangle + { + border.width: 2 + topLeft : model.north + bottomRight : model.south + color : model.color + } + } + MapItemView + { + model: circle_model + delegate: MapCircle{ + center: model.coordinate + radius: 5000.0 + color: 'green' + border.width: 10 + } + } + } +} diff --git a/src/src.pro b/src/src.pro index 988a411a..ca79e974 100644 --- a/src/src.pro +++ b/src/src.pro @@ -29,7 +29,9 @@ CONFIG += static CONFIG -=depend_includepath #CONFIG += release TEMPLATE = app -VERSION = 1.8.7 + +VERSION = 1.8.8 + DEFINES += APP_VERSION=\\\"$$VERSION\\\" APP_NAME = KLog @@ -54,6 +56,8 @@ QT += core \ serialport \ printsupport \ charts \ + quickwidgets \ + positioning \ widgets greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) @@ -71,6 +75,8 @@ HEADERS += setupdialog.h \ setuppages/hamlibnetworkconfigwidget.h \ setuppages/hamlibserialconfigwidget.h \ setuppages/setuppagelogview.h \ + widgets/map/mapwidget.h \ + widgets/map/mapwindowwidget.h \ widgets/showkloglogwidget.h \ charts/statsgeneralchartwidget.h \ charts/statsdxccsonsatswidget.h \ @@ -151,8 +157,7 @@ HEADERS += setupdialog.h \ widgets/showkloglogwidget.h \ widgets/onlinemessagewidget.h \ widgets/showadifimportwidget.h \ - world.h \ - worldmapwidget.h + world.h message(Sources) @@ -186,10 +191,11 @@ SOURCES += main.cpp \ #widgets/advancedsearch/advancedsearchmodel.cpp \ #widgets/advancedsearch/advancedsearchwidget.cpp \ #widgets/advancedsearch/advancedsearchwindow.cpp \ + widgets/map/mapwidget.cpp \ + widgets/map/mapwindowwidget.cpp \ widgets/onlinemessagewidget.cpp \ widgets/showadifimportwidget.cpp \ widgets/showkloglogwidget.cpp \ - world.cpp \ logwindow.cpp \ filemanager.cpp \ fileawardmanager.cpp \ @@ -244,7 +250,7 @@ SOURCES += main.cpp \ charts/statsgridsonsatswidget.cpp \ hamlibclass.cpp \ tipsdialog.cpp \ - worldmapwidget.cpp + world.cpp message (Other files) @@ -309,9 +315,9 @@ updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$DESTDIR/translations updateqm.CONFIG += no_link target_predeps QMAKE_EXTRA_COMPILERS += updateqm - # deploy -DISTFILES += Changelog COPYING +DISTFILES += Changelog COPYING \ + qml/mapqmlfile.qml unix:!mac { message(unix:!mac) diff --git a/src/translations/klog_de.ts b/src/translations/klog_de.ts index 24954eda..564c6f18 100644 --- a/src/translations/klog_de.ts +++ b/src/translations/klog_de.ts @@ -891,403 +891,403 @@ Oder drücken Sie die Eingabetaste für ein leeres Passwort FileManager - - - + + + Writing ADIF file... ADIF-Datei wird geschrieben ... - - - + + + Abort writing Schreiben abbrechen - - + + QSO: QSO: - - + + Writing ADIF file... QSO: ADIF-Datei wird geschrieben ... QSO: - - - + + + You have canceled the file export. The file will be removed and no data will be exported. Sie haben der Export der Datei abgebrochen. Die Datei wird entfernt und es werden keine Daten exportiert. - + KLog - Error - + The selected log does not exist, please check it again. - + The file %1 can't be opened. - + KLog - Don't ask again - + Do you want to reuse your answer? - + KLog will use automatically your previous answer for any other similar ocurrence, if any, without asking you again. - + <ul><li>Date/Time:</i> %1</li><li>Callsign: %2</li><li>Band: %3</li><li>Mode: %4</li></ul> - + KLog - QSO not found - + Do you want to add this QSO to the log?: - + We have found a QSO coming from LoTW that is not in your local log. Do you want KLog to add this QSO to the log? - + KLog - Invalid call detected - + An empty callsign has been detected. Do you want to export this QSO anyway (click on Yes) or remove the field from the exported log file? - + An invalid callsign has been detected %1. Do you want to export this callsign anyway (click on Yes) or remove the call from the exported log file? - + Exporting wrong calls may create problems in the applications you are potentially importing this logfile to. It may, however, be a good callsign that is wrongly identified by KLog as not valid. You can, however, edit the ADIF file once the export process is finished. - - - - - - + + + + + + KLog - User cancelled - - - - - - + + + + + + Do you still want to cancel? Möchten Sie immer noch abbrechen? - + The selected callsign (%1) is not valid, please check it again to export the log. - - + + KLog - File not opened - - + + It was not possible to open the file %1 for reading. - - + + KLog was not able to read the LoTW file - + Processing LoTW ADIF file... - + Abort processing - + LoTW reading - - + + KLog - Add new QSOs? - + Do you want to add non existing QSOs to your local log? - + There are some QSOs in the LoTW log that are not in your local log. - + Processing LoTW ADIF file...... QSO: %1 / %2 - + You have canceled the LoTW processing. The process will be stopped and your log may not be completely updated. - + Reading LoTW file... LoTW-Datei wird gelesen ... - - + + Abort reading Lesen abbrechen - + Importing LoTW ADIF file... - + KLog - Log selection - + There is more than one log in this logfile. Es gibt mehrere Protokolle in dieser Protokolldatei. - + All logs will be imported into the current log. Alle Protokolle werden in die aktuelle Protokolldatei importiert. - + Do you want to continue? Möchten Sie fortfahren? - + Reading ADIF file... ADIF-Datei wird gelesen ... - + Do you want to add dupe QSOs to your local log? - + There are some QSOs in this logfile that may be dupes as they have same call, band & mode and a very close date. - + Importing ADIF file... ADIF-Datei wird importiert ... - + KLog - Duplicated QSOs - + It seems that there are some duplicated QSOs in the ADIF file you are importing. Do you want to continue? (Duped QSOs will not be imported) Offensichtlich gibt es einige doppelte QSOs in der ADIF-Datei, die Sie importieren möchten. Möchten Sie fortfahren? (Duplikate von QSOs werden nicht importiert) - - + + Click on Yes to add a default %1 for mode %2 to all QSOs with a similar problem. - + KLog has found one QSO without the Station Callsign defined. Enter the Station Callsign that was used to do this QSO with %1 on %2: - + KLog has found one QSO without the Station Callsign defined. Enter the Station Callsign that was used to do this QSO on %1: - - + + You have canceled the file import. The file will be removed and no data will be imported. - + There are no QSOs pending to be exported with that station callsign. - + Export - + Exporting ADIF file... QSO: %1 / %2 - - + + Export progress - + Some QSOs of this log, (i.e.: %1) seems to lack RST-TX information. - - + + If you select NO, maybe the QSO will not be imported. - + Some QSOs of this log, (i.e.: %1) seems to lack RST-RX information. - + KLog - Apply to all QSOs in this log? - + Please edit the ADIF file and make sure that it include at least: Bearbeiten Sie die ADIF-Datei und überprüfen Sie, ob sie mindesten Folgendes enthält: - + and und - + This QSO had: In diesem QSO-Eintrag: - + This QSO is not including the minimum data to consider a QSO as valid! - + - The band missing and the following call: - Das Band fehlt bei dem folgenden Rufzeichen: - + - The mode missing and the following call: - Der Modus fehlt bei dem folgenden Rufzeichen: - + - The date missing and the following call: - Das Datum fehlt bei dem folgenden Rufzeichen: - + - The time missing and the following call: - Die Zeit fehlt bei dem folgenden Rufzeichen: - + Do you want to continue with the current file? Möchten Sie mit der aktuellen Datei fortfahren? - + KLog: Not all required data found! KLog: Es wurden nicht alle benötigten Daten gefunden - - + + KLog - No Station callsign entered. - - + + KLog - QSO without Station Callsign - + KLog: No RST TX found! KLog: Es wurden keine RST-TX-Daten gefunden - + KLog: No RST RX found! KLog: Es wurden keine RST-RX-Daten gefunden @@ -1443,6 +1443,11 @@ Enter the Station Callsign that was used to do this QSO on %1: Select the serial parity. + + + Default + Standard + 1 bit @@ -1453,11 +1458,6 @@ Enter the Station Callsign that was used to do this QSO on %1: 2 bits - - - 1.5 bits - - Stop bits @@ -2059,117 +2059,111 @@ Error returned: %2 MainQSOEntryWidget - - - + + + &Add &Hinzufügen - - + &Clear &Löschen - + Callsign of the QSO. - + Band of the QSO. Band des QSO-Eintrags. - + Mode of the QSO. Modus des QSO-Eintrags. - + Date of the QSO. Datum des QSO-Eintrags. - + Time of the QSO. Zeit des QSO-Eintrags. - + Add the QSO to the log. QSO zum Protokoll hinzufügen - + Clears the QSO entry. Löscht den QSO-Eintrag. - + KLog will show real time if enabled. - + Real time - + Stop wsjt-x and hamlib from automatically updating QSO information. - + Manual Mode - - + + Callsign Rufzeichen - - &Save - - - - - &Cancel - &Abbrechen - - - + DUPE Translator: DUPE is a common world for hams. Do not translate of not sure Duplikat + + + &Modify + &Bearbeiten + MainWindow - + Starting KLog KLog wird gestartet - - + + DX Entity DX-Eintrag - + &Log Window &Protokollfenster - - + + KLog KLog @@ -2179,27 +2173,27 @@ Error returned: %2 - + Status bar ... - + It seems that you have never done a backup or exported your log to ADIF. - + It seems that the latest backup you did is older than one month. - + Log backup recommended! - + It is a good practice to backup your full log regularly to avoid loosing data in case of a problem. Once you export your log to an ADIF file, you should copy that file to a safe place, like an USB drive, cloud drive, another computer, ... @@ -2209,161 +2203,161 @@ KLog will remind you to backup on a monthly basis. - + It seems that you are running this version of KLog for the first time. - + The setup will be open to allow you to do any new setup you may need. - + Ready Bereit - + KLog - Unexpected error - + An unexpected error ocurred when trying to add the QSO to your log. If the problem persists, please contact the developer for analysis: Es ist ein unerwarteter Fehler beim Hinzufügen der QSO-Daten zu Ihrer Protokolldatei aufgetreten. Bitte senden Sie einen Fehlerbericht an die Entwickler zur Analyse, falls das Problem weiterhin besteht. - - + + KLog - Select correct entity - - + + You have selected an entity: Sie haben folgenden Eintrag ausgewählt: - - + + that is different from the KLog proposed entity: Dieser Eintrag unterscheidet sich von dem durch KLog vorgeschlagenen Eintrag: - + Click on the prefix of the correct entity or Cancel to edit the QSO again. Klicken Sie auf das Präfix, um den Eintrag zu korrigieren oder drücken Sie Abbrechen, um den QSO-Eintrag erneut zu bearbeiten. - + Click on the prefix of the right entity or Cancel to correct. Klicken Sie auf das Präfix rechts vom Eintrag oder drücken Sie „Abbrechen“ zur Korrektur. - + RSTrx - + RSTtx - - + + KLog - Select the Station Callsign. - + Do you really want to exit KLog? - + &File &Datei - + Import an ADIF file into the current log. Importiert eine ADIF-Datei in das aktuelle Protokoll. - + Export the current log to an ADIF logfile. Exportiert das aktuelle Protokoll in eine ADIF-Protokolldatei. - + Export ALL the QSOs into one ADIF file, merging QSOs from all the logs. Exportiert alle QSOs in eine ADIF-Datei, dabei werden QSOs aus allen Protokollen zusammengeführt. - + Print your log. Druckt ein Protokoll. - + KLog folder KLog-Ordner - + Opens the data folder of KLog. Öffnen den Datenordner von KLog. - + E&xit &Beenden - + &Tools E&xtras - + Fill in QSO data QSO-Daten ausfüllen - + Go through the log reusing previous QSOs to fill missing information in other QSOs. Im Protokoll Daten früherer QSO-Einträge zum Ausfüllen fehlender Informationen in anderen QSO-Einträgen verwenden. - + Shows QSOs for which you should send your QSL and request the DX QSL. Anzeige von QSO-Einträgen, für die Sie Ihre QSLs versenden und die DX-QSL anfordern sollten. - + Find My-QSLs pending to send Ausstehende DX-QSLs zum Senden suchen - + Shows the QSOs with pending requests to send QSLs. You should keep this queue empty! Zeigt die QSL-Einträge mit ausstehenden Anforderungen zum Senden von QSLs. Diese Warteschlange sollten Sie bearbeiten. - + Mark all queued QSOs in this log as sent to LoTW. Alle eingereihten QSO-Einträge in diesem Protokoll als versendet zu LoTW markieren. - + Mark all queued QSOs as sent to LoTW. Alle eingereihten QSO-Einträge als versendet zu LoTW markieren. - + Sends the log to LoTW calling TQSL. @@ -2373,931 +2367,931 @@ KLog will remind you to backup on a monthly basis. - + KLog - Not valid call - - + + Adding non-valid calls to the log may create problems when applying for awards, exporting ADIF files to other systems or applications. - - + + No DXCC - - + + None - + You have requested to delete the QSO with: %1 Sie haben das Löschen dieser QSO mit %1angefordert - - + + Are you sure? Sind Sie sicher? - + KLog needs to update the Entities database. - + The backup was done successfully - + KLog will remind you to backup your data again in aprox one month. - + The backup was not properly done. - + It is recommended to backup your data periodically to prevent lose or corruption of your log. - + You have requested to delete several QSOs - + The ClubLog upload process has finished with an error and the log was possibly not uploaded. - + Please check your credentials, your Internet connection and your Clublog account. The received error code was: %1 - + Do you want to mark as Uploaded all the QSOs uploaded to ClubLog? - - - - - - - - + + + + + + + + KLog - ClubLog KLog - Club Log - + There was an error while updating to Yes the ClubLog QSO upload information. - + The ClubLog upload process has finished and KLog created a file (%1) in your KLog folder. Do you want KLog to remove that file? - - + + The file has not been removed. - - + + It seems that there was something that prevented KLog from removing the file You can remove it manually. - + The eQSL upload process has finished with an error and the log was possibly not uploaded. - - + + Please check your credentials, your Internet connection and your eQSL account. The received error code was: %1 - + Do you want to mark as Uploaded all the QSOs uploaded to eQSL? - + There was an error while updating to Yes the eQSL QSO upload information. - + The eQSL upload process has finished and KLog created a file (%1) in your KLog folder. Do you want KLog to remove that file? - + The QRZ.com upload process has finished with an error and the log was possibly not uploaded. - + Do you want to mark as Uploaded all the QSOs uploaded to QRZ.com? - - - - + + + + KLog - QRZ.com - + KLog-%1 - Logbook of %2 - QSOs: %3 - + KLog-%1 - Logbook of %2 - Station Callsign: %3 - QSOs: %4 - + KLog - QRZ.com warning - + QRZ.com has returned a non-subcribed error and queries to QRZ.com will be disabled. - + Please check your QRZ.com subcription or credentials. - + There was an error while updating to Yes the QRZ.com QSO upload information. - + The QRZ.com upload process has finished successfully - + Call not found in QRZ.com - + You need to activate the %1 service in the eLog preferences. - + It is important to export to ADIF and save a copy as a backup. - + Saving the log was done successfully. - + The ADIF export was not properly done. - + &Import from ADIF ... - + Export to ADIF ... - + Export all logs to ADIF ... - + &Print Log ... - + Settings ... - + QSL tools ... - + Find QSO to QSL - + Find DX-QSLs pending to receive - + Shows DX-QSLs for which requests or QSLs have been sent with no answer. - + Find requested pending to receive - + Shows the DX-QSLs that have been requested. - + LoTW tools ... - + Queue all QSLs from this log to be sent - + Mark all non-sent QSOs in this log as queued to be uploaded. - + Queue all QSLs to be sent - + Put all the non-sent QSOs in the queue to be uploaded. - + Mark all queued QSOs from this log as sent - + Mark all queued QSOs as sent - + Check the current callsign in QRZ.com - - + + For updated DX-Entity data, update cty.csv. Zur Aktualisierung der DX-Einträge laden Sie bitte die Datei „cty.csv“ erneut herunter. - + Stats Statistik - + Show the statistics of your radio activity. Zeigt eine Statistik Ihrer Funkaktivitäten. - + &Help &Hilfe - + &Debug ... - + Do you really want to mark ALL the QSOs of this log to be UPLOADED? Must be done ONLY IF THIS IS YOUR FIRST TIME uploading these QSOs to LoTW. - + Do you really want to mark ALL pending QSOs to be UPLOADED? Must be done ONLY IF THIS IS YOUR FIRST TIME uploading these QSOs to LoTW. - + KLog - TQSL - + TQSL is not installed or KLog can't find it. Please check the configuration. - + Error #1: The process was cancelled by the user or TQSL was not configured. No QSOs were uploaded. - + Error #2: Upload was rejected by LoTW, please check your data. - + Error #3: The TQSL server returned an unexpected response. - + Error #4: There was a TQSL error. - + Error #5: There was a TQSLLib error. - + Error #6: It was not possible to open the input file. - + Error #7: It was not possible to open the ouput file. - + Error #8: No QSOs were processed since some QSOs were duplicates or out of date range. - + Error #9: Some QSOs were processed, and some QSOs were ignored because they were duplicates or out of date range. - + Error #10: Command syntax error. KLog sent a bad syntax command. - + Error #11: LoTW Connection error (no network or LoTW is unreachable). - + Error #00: Unexpected error. Please contact the development team. - + The log that you have selected contains more than just one station callsign. Das ausgewählte Protokoll enthält mehrere Stations-Rufzeichen. - + Please select the station callsign you want to mark as sent to LoTW: Bitte wählen Sie das Stations-Rufzeichen, dass Sie als versendet zu LoTW markieren möchten: - + Station Callsign: Stations-Rufzeichen: - + Define Station Callsign Stations-Rufzeichen eingeben - + Enter the station callsign to use for this log or leave it empty for QSO without station callsign defined: Geben Sie das Stations-Rufzeichen für dieses Protokoll ein oder lassen das Rufzeichen weg für QSOs ohne Stations-Rufzeichen: - + You have selected no callsign. KLog will complete the QSOs without a station callsign defined and those with the callsign you are entering here. - + KLog - No station selected - + No station callsign has been selected and therefore no log will be marked Es wurde kein Stations-Rufzeichen ausgewählt, daher wird kein Protokoll markiert - + Congratulations! Glückwunsch - + You already have the latest version. Sie haben bereits die neueste Version. - + This function is disabled. Go to the Setup->LoTW tab to enable it. - + TQSL finished with no error. Do you want to mark as Sent all the QSOs uploaded to LoTW? - + There was an error while updating to Yes the LoTW QSL sent information. - + You can find the KLog data folder here: Hier finden Sie den KLog-Datenordner: - + start Starten - + stop Anhalten - + If you are sure that the database contains QSOs and KLog is not able to find them, please contact the developers (see About KLog) for help. Enthält die Datenbank tatsächlich QSOs, sie werden aber nicht gefunden, nehmen Sie mit den KLog.Entwicklern Kontakt auf, siehe Über KLog. - - + + Select the Station Callsign to use when quering LoTW: - - + + Please check the LoTW setup - - + + You have not defined a LoTW user or a proper Station Callsign. Open the LoTW tab in the Setup and configure your LoTW connection. - + KLog - Exit - - + + Check always the current callsign in QRZ.com - + KLog - CTY.dat update - + You can update the entities database in Tools->Update cty.csv - + Do you want to do it now? - + KLog - Backup - + KLog - New version detected! - + The callsign %1 is not a valid call. Do you really want to add this callsign to the log? - + KLog - Not valid callsign - + The callsign %1 is not a valid callsign. Do you really want to add this callsign to the log? - + KLog - ClubLog error - + KLog - eQSL error - + KLog - %1 - - + + KLog - ADIF export - + Download from LoTW ... - + Download the full log from LoTW ... - + ClubLog tools ... - + Upload the queued QSOs to ClubLog ... - + eQSL tools ... - + Upload the queued QSOs to eQSL.cc ... - + QRZ.com tools ... - + Upload the queued QSOs to QRZ.com ... - + Update cty.csv - + Update Satellite Data - + Online manual (F1) ... - + &Tips ... - + &About ... - + About Qt ... - + Check updates ... - + All pending QSOs of this log has been marked as queued for LoTW! - - + + Now you can upload them to LoTW. - + There was a problem to mark all pending QSOs of this log as queued for LoTW! - + Your log has not been updated. - + No QSO was updated with the data coming from LoTW. This may be because of errors in the logfile or simply because your log was already updated. - + All pending QSOs has been marked as queued for LoTW! - + All queued QSOs has been marked as sent to LoTW! - + There was a problem to mark all queued QSOs of this log as sent to LoTW! - + About ... - + KLog - Update checking result - + It seems that there are no QSOs in the database. - + You need to select one station callsign to be able to send your log to ClubLog. - + Do you want to add this QSOs to your ClubLog existing log? - + If you don't agree, this upload will overwrite your current ClubLog existing log. - - - - - - - + + + + + + + KLog - eQSL - + Upload the queued QSOs to LoTW - + This operation shall remove definitely all the selected QSO and associated data and you will not be able to recover it again. - - + + KLog - QRZ.com error - + KLog has received an error from QRZ.com. - - + + Queue all the QSOs to be uploaded - + Queue all the QSO to be uploaded - + You need to select one station callsign to be able to send your log to eQSL.cc. - + The log is ready to be uploaded to ClubLog. - + All the QSOs in this log has been marked as Modified in the ClubLog status field - + KLog could not mark the full log to be sent to ClubLog - - - + + + Something prevented KLog from marking the QSOs as modified. Restart KLog and try again before contacting the KLog developers. - + The log is ready to be uploaded to eQSL.cc. - + All the QSOs in this log has been marked as Modified in the eQSL.cc status field - + KLog could not mark the full log to be sent to eQSL - + The log is ready to be uploaded to QRZ.com. - + All the QSOs in this log has been marked as Modified in the QRZ.com status field - + KLog could not mark the full log to be sent to QRZ.com - + You need to define a proper API Key for your QRZ.com logbook in the eLog preferences. - + Filling QSOs ... - + Date/Time Datum/Zeit - - + + Callsign Rufzeichen - + Printing the log ... - + KLog - QSO received - + Station Callsign Stations-Rufzeichen - + Operator Callsign - + KLog - WSJTX Dupe QSO - + This QSO seems to be duplicated. Do you want to save or discard it? - + QSO logged from WSJT-X: Protokollierte QSO von WSJT-X: - + The logfile has been modified. Die Protokolldatei wurde verändert. - + Do you want to save your changes? Möchten Sie Ihre Änderungen speichern? - + Your log has been updated with the LoTW downloaded QSOs. - + KLog has updated %1 QSOs from LoTW. - - + + UDP Server error The UDP server failed to %1. start or stop @@ -3305,367 +3299,367 @@ The UDP server failed to %1. Der UDP-Server kann %1 nicht ausführen. - + Status of the DX entity. Status des DX-Eintrags. - + Name of the DX entity. Name des DX-Eintrags. - + QSO QSO - + QSL QSL - - + + eQSL eQSL - - - + + + Comment Kommentar - + Others Sonstige - + My Data Meine Daten - + Satellite Satellit - + DXCC DXCC - + Info Information - + Awards Diplome - + Search Suchen - + Log Protokoll - + DX-Cluster DX-Cluster - + No QSOs have been exported to ADIF. - + KLog has exported %1 QSOs to the ADIF file: %2 - - - - + + + + Save ADIF File ADIF-Datei speichern - + You need to select one station callsign to be able to send your log to LoTW. - + The LoTW upload process has finished and KLog created a file (%1) in your KLog folder. Do you want KLog to remove that file? - - - + + + The file has been removed. - - - - - - - - - - + + + + + + + + + + + - - - + + KLog - LoTW - + There was a problem to mark all pending QSOs as queued for LoTW! - + All queued QSOs of this log has been marked as sent to LoTW! - + There was a problem to mark all queued QSOs as sent to LoTW! - - - + + + Do you really want to mark ALL your QSOs to be UPLOADED? Must be done ONLY IF THIS IS YOUR FIRST TIME uploading QSOs to %1 - + ClubLog Club Log - + KLog - QRZ.COM - + QRZ.COM - + Open File Datei öffnen - + - Needed for DXMarathon - Erforderlich für den DX-Marathon - + Abort filling Ausfüllen abbrechen - + Filling DXCC, CQz, ITUz, Continent in QSOs... QSO: - + Number Anzahl - + Band Band - - + + Mode Modus - + Print Log Protokoll drucken - + Abort printing Drucken abbrechen - - + + Printing the log... QSO: Das Protokoll wird gedruckt ... QSO: - + The following QSO data has been received from WSJT-X to be logged: Die folgenden QSO-Daten wurden von WSJT-X zum protokollieren empfangen: - + Freq Frequenz - + Time On - + Time Off - + RST TX - + RST RX - + DX-Grid - + Local-Grid - + Duplicated QSOs have to match another existing QSO with the same call, band, mode, date and time, taking into account the period that can be defined in the settings. - + KLog - Non-supported mode - + A new mode not supported by KLog has been received from an external program or radio: - + Do you want to keep receiving these alerts? (disabling these alerts will prevent non-valid modes being detected) - + Native Error - + Recommendation: - + Periodically export your data to ADIF to prevent a potential data loss. - + If the received mode is correct, please contact KLog development team and request support for that mode Wenn der Empfangsmodus korrekt ist, nehmen Sie bitte Kontakt mit den KLog-Entwicklern auf und bitten Sie um Unterstützung für diesen Modus. - + KLog - Duplicated satellite - + A duplicated satellite has been detected in the file and will not be imported. In der Datei wurde ein doppelter Satellit gefunden, er wird nicht importiert. - + Please check the satellite information file and ensure it is properly populated. Bitte überprüfen Sie die Datei mit den Informationen über Satelliten. - + Now you will see a more detailed error that can be used for debugging... Jetzt wird eine ausführlichere Fehlermeldung angezeigt, die für die Fehlersuche verwendet werden kann .. - + An unexpected error ocurred!! Es ist ein unerwarteter Fehler aufgetreten. - + If the problem persists, please contact the developers Bitte senden Sie einen Fehlerbericht, falls das Problem weiterhin besteht - + for analysis: für die Analyse: - + Error in function Fehler in Funktion - + Error text Fehlertext - + Failed query Abfrage fehlgeschlagen - + KLog - Show errors - + Do you want to keep showing errors? Möchten Sie Fehler weiter anzeigen? @@ -3973,13 +3967,13 @@ Do you want KLog to remove that file? - + TX Frequency in MHz. TX-Frequenz in MHz. - + RX Frequency in MHz. RX-Frequenz in MHz. @@ -4061,23 +4055,23 @@ Do you want KLog to remove that file? RX-Frequenz - + DX QTH locator. - + DX QTH locator. Format should be Maidenhead like IN70AA up to 10 characters. - + TX Frequency in MHz. Frequency is not in a hamradio band! - + RX Frequency in MHz. Frequency is not in a hamradio band! @@ -4155,7 +4149,7 @@ Frequency is not in a hamradio band! - + Other - Sat not in the list Sonstige - Satellit nicht in der Liste @@ -4238,44 +4232,44 @@ Frequency is not in a hamradio band! - + Not Sat QSO Kein Satellit zum QSO-Eintrag - + KLog has detected a satellite name that it does not recognise. If it should use one of the names of known satellites instead, please select it from the list. Alternatively, please contact the development team to add the new satellite name. KLog hat einen unbekannten Satellitennamen gefunden. Wenn stattdessen ein bekannter Satellitenname verwendet werden soll, wählen Sie ihn aus der Liste. Nehmen Sie alternativ Kontakt mit den Entwicklern auf, damit der neue Satellitenname in KLog aufgenommen werden kann. - + The satellite you have in your QSO is: Der Satellit in Ihren QSO-Daten: - + Please be aware that the satellite name will not be saved if it is not in the list, so that information may be lost! - + RX Frequency in MHz. Frequency is not in a hamradio band! - + RX Frequency in MHz. RX-Frequenz in MHz. - + TX Frequency in MHz. Frequency is not in a hamradio band! - + TX Frequency in MHz. TX-Frequenz in MHz. @@ -4417,7 +4411,7 @@ Frequency is not in a hamradio band! - + Station Callsign Stations-Rufzeichen @@ -4574,696 +4568,696 @@ KLog will finish when you click on OK. Ihr KLog-Ordner ist immer noch auf Ihren System vorhanden ... - + A wrong callsign has been found: %1. Please enter a new callsign or confirm that the current one is a good callsign. - + An empty callsign has been detected. If it is possible, please enter the right call. - + KLog - Not valid callsign found - + Date Datum - + Call Ruf - + RSTtx - + RSTrx - + Band Band - + Comment Kommentar - + Mode Modus - + CQz - + ITUz - + DXCC DXCC - + Address - + Age - + County - + A_Index - + Ant_Az - + Ant_El - + Ant_Path - + ARRL_SECT - + Award_Submitted - + Award_granted - + Band_RX - + CheckContest - + Class - + ClubLog SDate - + ClubLog status - + Continent Kontinent - + Contacted Op - + Contest Id - + Country - + Credit Submitted - + Credit granted - + Dark Dok Do not translate if unsure, common hamradio term. - + Fists Do not translate if unsure, common hamradio term. - + Fists CC Do not translate if unsure, common hamradio term. - + My Fists Do not translate if unsure, common hamradio term. - + Nr bursts Do not translate if unsure, common hamradio term. - + Nr pings Do not translate if unsure, common hamradio term. - + Sat mode - + SWL Do not translate if unsure, common hamradio term. - + Ten-Ten Do not translate, it is a hamradio group name. - + Distance - + Email - + EQ_Call - + eQSL RDate - + eQSL SDate - + eQSL Rcvd - + eQSL Sent eQSL gesendet - + Force Init - + Freq Frequenz - + Freq RX RX-Frequenz - + Gridsquare - + Guest OP - + HRDLog SDate - + HRDLog status - + IOTA IOTA - + IOTA Island id - + K Index - + Lat - + Lon - + LoTW RDate - + LoTW SDate - + LoTW Rcvd - + LoTW Sent LoTW versendet - + Max Bursts - + Multiplier - + MS Shower - + My Antenna - + My City - + My Cnty - + My Country - + My CQz - + My DXCC - + My Gridsquare - + My IOTA - + My IOTA island id - + My ITUz - + My Lat - + My Lon - + My Name - + My Postal code - + My Rig - + My Sig - + My Sig Info - + My SOTA ref - + My State - + My Street - + My USACA counties - + My VUCC grids - + Name Name - + Notes - + Operator - + Owner Callsign - + Pfx - + Points - + Precedence - + Prop Mode - + Public Key - + QRZcom SDate - + QRZcom status - + QSL msg - + QSL RDate - + QSL SDate - + QSL Rcvd QSL empfangen - + QSL Sent QSL gesendet - + QSL rcvd via - + QSL sent via - + QSL via - + QSO complete - + QSO random - + QTH QTH - + Region - + Rig - + RX Pwr - + Sat name Satellitenname - + SFI - + Sig - + Sig Info - + Silent key Do not translate if unsure, common hamradio term. - + SKCC - + SOTA Ref - + SRX String - + SRX - + STX String - + State - + Submode - + UKSMG - + USACA counties - + VE prov - + VUCC grids - + TX Pwr - + Web - + QSO Date off - + Transmitter id - + Log number @@ -5592,135 +5586,135 @@ KLog will finish when you click on OK. SetupDialog - - + + Bands/Modes Bänder/Modi - + DX-Cluster DX-Cluster - - + + Colors Farben - + Log widget - - + + Misc Verschiedenes - + World Editor World-Editor - - + + Logs Protokolle - + Satellites Satelliten - + HamLib - + Cancel Abbrechen - + OK OK - + You need to enter at least a valid callsign. - + Go to the User tab and enter valid callsign. - - + + User data Benutzerdaten - + D&X-Cluster D&X-Cluster - + WSJT-X WSJT-X - + Settings - + You need to enter at least one log in the Logs tab. Sie müssen mindestens ein Protokoll auf der Karteikarte Protokolle eingeben. - + Do you want to add one log in the Logs tab or exit KLog? (Click Yes to add a log or No to exit KLog) - + World Welt - + Go to the Misc tab and click on Move DB or the DB will not be moved to the new location. Wählen Sie auf der Karteikarte Verschiedenes „Datenbank verschieben„ oder die Datenbank wird nicht an den neuen Ort verschoben. - + eLog - + DB has not been moved to new path. - + You have not selected the kind of log you want. Sie haben die Art des Protokolls nicht ausgewählt. - + You will be redirected to the Log tab. Please add and select the kind of log you want to use. Sie werden zur Karteikarte Protokolle weitergeleitet. @@ -6241,72 +6235,72 @@ Ist kein Port angegeben, wird der Vorgabewert 41112 benutzt: SetupPageHamLib - + Activate HamLib - + Activates the hamlib support that will enable the connection to a radio. - + Read-Only mode - + If enabled, the KLog will read Freq/Mode from the radio but will never send any command to the radio. - + Radio - + Select your rig. - + Serial - + Network - + Defines the interval to poll the radio in msecs. - + Poll interval - + Test: OK - + Test: NOK - + Test - + Click to test the connection to the radio @@ -8704,39 +8698,39 @@ The log will not be opened. - + You are not subscribed to QRZ.com. - + Not valid KEY found - + Please configure your QRZ.com API key. You will find it in your QRZ.com Logbook settings webpage. You need a QRZ.com subscription to use this feature. - + KLog - QRZ.com password needed - + Please enter your QRZ.com password: - + KLog - QRZ.com - + Callsign missing Rufzeichen fehlt diff --git a/src/utilities.h b/src/utilities.h index 4a265b92..1950a8c1 100644 --- a/src/utilities.h +++ b/src/utilities.h @@ -154,7 +154,7 @@ private: bool isValidSubCall(const QString &_c); //QPair getCallParts(const QString &_c); - bool darkMode;//, callValidation; + bool darkMode, callValidation; QString dbPath; QString softwareVersion; //QPalette palRed, palBlack; diff --git a/src/widgets/map/mapwidget.cpp b/src/widgets/map/mapwidget.cpp new file mode 100644 index 00000000..4296856c --- /dev/null +++ b/src/widgets/map/mapwidget.cpp @@ -0,0 +1,145 @@ +/*************************************************************************** + mapwidget.cpp - description + ------------------- + begin : May 2021 + copyright : (C) 2021 by Jaime Robles + email : jaime@robles.es + ***************************************************************************/ + +/***************************************************************************** + * This file is part of KLog. * + * * + * KLog is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * KLog is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with KLog. If not, see . * + * * + *****************************************************************************/ +#include "mapwidget.h" +#include +#include +#include +#include +#include + +MapWidget::MapWidget() +{ + + //qDebug() << Q_FUNC_INFO; + + //qDebug() << Q_FUNC_INFO << " - END"; +} + +void MapWidget::init() +{ + createUI(); +} + +void MapWidget::createUI() +{ + lat = 0.0; + lon = 0.0; + + QWidget *container = QWidget::createWindowContainer(&qmlView, this); + + circleRoles[CoordinateRole] = QByteArray("coordinate"); + rectangleRoles[NorthRole] = QByteArray("north"); + rectangleRoles[SouthRole] = QByteArray("south"); + rectangleRoles[ColorRole] = QByteArray("color"); + + modelCircle.setItemRoleNames(circleRoles); + modelRectangle.setItemRoleNames(rectangleRoles); + + + qmlView.rootContext()->setContextProperty("rectangle_model", &modelRectangle); + qmlView.rootContext()->setContextProperty("circle_model", &modelCircle); + qmlView.setSource(QUrl(QStringLiteral("qrc:qml/mapqmlfile.qml"))); + qmlView.setResizeMode(QQuickView::SizeRootObjectToView); + + QVBoxLayout *layout = new QVBoxLayout(this); + + layout->addWidget(container); + setLayout (layout); + + setMinimumSize (200, 200); //This minimum size may be relative to another widget... (maybe the mainwindow?) + //connect(okButton, SIGNAL(clicked()), this, SLOT(slotButtonClicked() ) ); +} + +void MapWidget::clearMap() +{ + modelRectangle.clear(); +} + +void MapWidget::setCenter(const Coordinate &_c) +{ + QObject *object = qmlView.rootObject (); + object->setProperty ("zoom", 8.0); + object->setProperty ("lat", _c.lat); + object->setProperty ("lon", _c.lon); + //qDebug() << Q_FUNC_INFO << " - END"; +} + +void MapWidget::addLocator(const double lat1, const double lon1, const double lat2, const double lon2) +{ + QObject *object = qmlView.rootObject (); + //MapRectangle + object->setProperty ("locLat1", lat1); + object->setProperty ("locLon1", lon1); + object->setProperty ("locLat2", lat2); + object->setProperty ("locLon2", lon2); + //qDebug() << Q_FUNC_INFO << " - END"; +} + +void MapWidget::addQSO(const QString &_loc) +{ + //qDebug() << Q_FUNC_INFO << ": " << _loc; + if (!locator.isValidLocator(_loc)) + { + return; + } + qmlView.rootContext()->setContextProperty("circle_model", &modelCircle); + //qmlView.setSource(QUrl(QStringLiteral("qrc:qml/mapqmlfile.qml"))); + QStandardItem *item = new QStandardItem; + item->setData(QVariant::fromValue(QGeoCoordinate(locator.getLat(_loc), locator.getLon(_loc))), CoordinateRole); + modelCircle.appendRow(item); +} + +void MapWidget::addLocator(const QString &_loc, const QColor &_color) +{ + //qDebug() << Q_FUNC_INFO << ": " << _loc; + if (!locator.isValidLocator(_loc)) + { + return; + } + qmlView.rootContext()->setContextProperty("rectangle_model", &modelRectangle); + + Coordinate _north, _south; + _north = locator.getLocatorCorner(_loc, true); + _south = locator.getLocatorCorner(_loc, false); + + QGeoRectangle rect; + rect.setTopLeft (QGeoCoordinate(_north.lat, _north.lon)); + rect.setBottomRight (QGeoCoordinate(_south.lat, _south.lon) ); + + if (rect.isValid ()) + { + QStandardItem *item = new QStandardItem; + item->setData(QVariant::fromValue(QGeoCoordinate(_north.lat, _north.lon)), NorthRole); + item->setData(QVariant::fromValue(QGeoCoordinate(_south.lat, _south.lon)), SouthRole); + item->setData(QVariant::fromValue(_color), ColorRole); + modelRectangle.appendRow(item); + //qDebug() << Q_FUNC_INFO << " Rectangle OK"; + } + else + { + //qDebug() << Q_FUNC_INFO << " Rectangle NOK"; + } +} diff --git a/src/widgets/map/mapwidget.h b/src/widgets/map/mapwidget.h new file mode 100644 index 00000000..12d17698 --- /dev/null +++ b/src/widgets/map/mapwidget.h @@ -0,0 +1,68 @@ +#ifndef MAPWIDGET_H +#define MAPWIDGET_H +/*************************************************************************** + mapwidget.h - description + ------------------- + begin : May 2021 + copyright : (C) 2021 by Jaime Robles + email : jaime@robles.es + ***************************************************************************/ + +/***************************************************************************** + * This file is part of KLog. * + * * + * KLog is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * KLog is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with KLog. If not, see . * + * * + *****************************************************************************/ +#include +#include +#include +#include +#include "locator.h" + +class MapWidget : public QWidget +{ + Q_OBJECT + +public: + MapWidget(); + void init(); + + void setCenter(const Coordinate &_c); + void addLocator(const double lat1, const double lon1, const double lat2, const double lon2); + void addQSO(const QString &_loc); + void addLocator(const QString &_loc, const QColor &_color); + void clearMap(); + +private slots: + +private: + void createUI(); + QQuickView qmlView; + + QStandardItemModel modelCircle, modelRectangle; + QHash circleRoles; + QHash rectangleRoles; + + + int CoordinateRole = Qt::UserRole + 1000; + int NorthRole = Qt::UserRole + 1000; + int SouthRole = Qt::UserRole + 1001; + int ColorRole = Qt::UserRole + 1002; + Locator locator; + double lat, lon; + +}; + +#endif // MAPWIDGET_H diff --git a/src/widgets/map/mapwindowwidget.cpp b/src/widgets/map/mapwindowwidget.cpp new file mode 100644 index 00000000..a55cf4cc --- /dev/null +++ b/src/widgets/map/mapwindowwidget.cpp @@ -0,0 +1,295 @@ +/*************************************************************************** + mapwidget.cpp - description + ------------------- + begin : May 2021 + copyright : (C) 2021 by Jaime Robles + email : jaime@robles.es + ***************************************************************************/ + +/***************************************************************************** + * This file is part of KLog. * + * * + * KLog is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * KLog is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with KLog. If not, see . * + * * + *****************************************************************************/ +#include "mapwindowwidget.h" + +MapWindowWidget::MapWindowWidget(DataProxy_SQLite *dp, QWidget *parent) +{ + + qDebug() << Q_FUNC_INFO; + dataProxy = dp; + mapWidget = new MapWidget; + + propComboBox = new QComboBox; + bandComboBox = new QComboBox; + modeComboBox = new QComboBox; + satNameComboBox = new QComboBox; + confirmedCheckBox = new QCheckBox; + //locatorsCheckBox = new QCheckBox; + + qDebug() << Q_FUNC_INFO << " - END"; +} + +MapWindowWidget::~MapWindowWidget() +{ + delete(dataProxy); + delete(mapWidget); +} + +void MapWindowWidget::init() +{ + createUI(); +} + +void MapWindowWidget::createUI() +{ + + bandComboBox->setToolTip(tr("Select QSOs in this band.")); + modeComboBox->setToolTip(tr("Select QSOs in this mode.")); + propComboBox->setToolTip(tr("Select QSOs in this propagation mode.")); + satNameComboBox->setToolTip(tr("Select QSOs using this Satellite.")); + confirmedCheckBox->setText(tr("Only confirmed")); + + confirmedCheckBox->setToolTip(tr("Select only confirmed QSOs.")); + //locatorsCheckBox->setText(tr("Show Locators")); + //locatorsCheckBox->setToolTip(tr("Show Locators or QSO positons.")); + + QGridLayout *buttonsLayout = new QGridLayout; + buttonsLayout->addWidget(bandComboBox, 0, 0); + buttonsLayout->addWidget(modeComboBox, 0, 1); + buttonsLayout->addWidget(propComboBox, 1, 0); + buttonsLayout->addWidget(satNameComboBox, 1, 1); + //buttonsLayout->addWidget(okButton, 1, 2); + buttonsLayout->addWidget(confirmedCheckBox, 0, 2); + //buttonsLayout->addWidget(locatorsCheckBox, 1, 2); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->addLayout(buttonsLayout); + layout->addWidget(mapWidget); + setLayout (layout); + + setPropModes(); + setSatNames(); + + mapWidget->init(); + + connect(bandComboBox, SIGNAL(currentIndexChanged (QString)), this, SLOT(slotBandsComboBoxChanged(QString))); + connect(modeComboBox, SIGNAL(currentIndexChanged (QString)), this, SLOT(slotModesComboBoxChanged(QString))); + connect(propComboBox, SIGNAL(currentIndexChanged (QString)), this, SLOT(slotPropComboBoxChanged(QString))); + connect(satNameComboBox, SIGNAL(currentIndexChanged (QString)), this, SLOT(slotSatsComboBoxChanged(QString))); + + connect(confirmedCheckBox, SIGNAL(clicked()), this, SLOT(slotConfirmedCheckBoxChanged())); + //connect(locatorsCheckBox, SIGNAL(clicked()), this, SLOT(slotLocatorsCheckBoxChanged())); +} + +void MapWindowWidget::setCenter(const Coordinate &_c) +{ + mapWidget->setCenter(_c); +} + +void MapWindowWidget::setBands(const QStringList _bands) +{ + QStringList bands; + bands.clear(); + bands = _bands; + bands.removeDuplicates(); + //bands = dataProxy->sortBandNamesBottonUp(bands); + bandComboBox->clear(); + bands.prepend("All - " + tr("All bands")); + bandComboBox->addItems(bands); +} + +void MapWindowWidget::setModes(const QStringList _modes) +{ + QStringList modes; + modes.clear(); + modes = _modes; + modes.removeDuplicates(); + modes.sort(); + modes.prepend("All - " + tr("All modes")); + modeComboBox->clear(); + modeComboBox->addItems(modes); +} + +void MapWindowWidget::setPropModes() +{ + QStringList propModeList; + propModeList.clear(); + propModeList = dataProxy->getPropModeList(); + if (propModeList.size()>1) + { + propModeList.prepend("All - " + tr("All propagation modes")); + //propModeList.prepend("01 - " + tr("Not - Not Identified")); + propComboBox->addItems(propModeList); + } +} + +void MapWindowWidget::setSatNames() +{ + qDebug() << Q_FUNC_INFO << QT_ENDL; + + QString nosat = tr("All satellites"); + //QString othersat = tr("Other - Sat not in the list"); + QStringList satellitesList; + satellitesList.clear(); + satellitesList = dataProxy->getSatellitesList(); + //satellitesList.prepend(othersat); + satellitesList.prepend("All - " + nosat); + + if (satellitesList.size()>1) + { + satNameComboBox->clear(); + satNameComboBox->addItems(satellitesList); + } + else + { + //TODO: Check how to do it better... now I could simply remove the if + satNameComboBox->addItems(satellitesList); + } +} + +void MapWindowWidget::showFiltered() +{ + QStringList locators; + locators.clear(); + + QStringList shortLocators; + shortLocators.clear(); + + QColor color; + if (confirmedCheckBox->isChecked()) + { + color = QColor(Qt::red); + } + else + { + color = QColor(Qt::green); + } + color.setAlpha(127); // Little Transparent + + locators << dataProxy->getFilteredLocators(bandComboBox->currentText(), modeComboBox->currentText(), getPropModeFromComboBox(), satNameComboBox->currentText(), confirmedCheckBox->isChecked()); + foreach(QString i, locators) + { + if (i.length() == 4) + { + shortLocators << i; + } + else if (i.length()>4) + { + QString a = i; + a.truncate(4); + shortLocators << a; + } + } + shortLocators << locators; + shortLocators.removeDuplicates(); + shortLocators.sort(); + + addLocators(shortLocators, color); +} + +void MapWindowWidget::slotBandsComboBoxChanged(const QString &_c) +{ + qDebug() << Q_FUNC_INFO; + showFiltered(); + qDebug() << Q_FUNC_INFO << " - END"; +} + +void MapWindowWidget::slotModesComboBoxChanged(const QString &_c) +{ + qDebug() << Q_FUNC_INFO; + showFiltered(); + qDebug() << Q_FUNC_INFO << " - END"; +} + +void MapWindowWidget::slotPropComboBoxChanged(const QString &_c) +{ + qDebug() << Q_FUNC_INFO; + + if (getPropModeFromComboBox() == "SAT") + { + qDebug() << Q_FUNC_INFO << ": SAT"; + satNameComboBox->setCurrentIndex(0); + satNameComboBox->setEnabled(true); + } + else + { + qDebug() << Q_FUNC_INFO << ": NO SAT"; + satNameComboBox->setCurrentIndex(0); + satNameComboBox->setEnabled(false); + } + showFiltered(); + qDebug() << Q_FUNC_INFO << " - END"; +} + +void MapWindowWidget::slotSatsComboBoxChanged(const QString &_c) +{ + qDebug() << Q_FUNC_INFO; + showFiltered(); + qDebug() << Q_FUNC_INFO << " - END"; +} + +void MapWindowWidget::slotConfirmedCheckBoxChanged() +{ + qDebug() << Q_FUNC_INFO; + showFiltered(); + qDebug() << Q_FUNC_INFO << " - END"; +} + + +void MapWindowWidget::addQSO(const QString &_loc) +{ + qDebug() << Q_FUNC_INFO << ": " << _loc; + //if (!locator.isValidLocator(_loc)) + //{ + // return; + //} +} + +void MapWindowWidget::addLocator(const QString &_loc, const QColor &_color) +{ + qDebug() << Q_FUNC_INFO << ": " << _loc; + //if (!locator.isValidLocator(_loc)) + //{ + // return; + //} + mapWidget->addLocator(_loc, QColor(255, 0, 0, 127)); + +} + +void MapWindowWidget::addLocators(const QStringList &_locators, const QColor &_color) +{ + mapWidget->clearMap(); + foreach(QString i, _locators) + { + //mapWidget->addLocator(i, confirmedColor); + mapWidget->addLocator(i, _color); + } +} + +QString MapWindowWidget::getPropModeFromComboBox() +{ + QString _pm = QString(); + qDebug() << Q_FUNC_INFO << ": " << propComboBox->currentText() << QT_ENDL; + _pm = (((propComboBox->currentText()).split('-')).at(1)).simplified(); + QString _n = (((propComboBox->currentText()).split('-')).at(0)).simplified(); + qDebug() << Q_FUNC_INFO << ": " << _pm << QT_ENDL; + + if (_n == "00") + { + return QString(); + } + return _pm; +} diff --git a/src/worldmapwidget.h b/src/widgets/map/mapwindowwidget.h similarity index 52% rename from src/worldmapwidget.h rename to src/widgets/map/mapwindowwidget.h index 66730c30..76185e4d 100644 --- a/src/worldmapwidget.h +++ b/src/widgets/map/mapwindowwidget.h @@ -1,11 +1,10 @@ -#ifndef WORLDMAPWIDGET_H -#define WORLDMAPWIDGET_H - +#ifndef MAPWINDOWWIDGET_H +#define MAPWINDOWWIDGET_H /*************************************************************************** - worldmapwidget.h - description + mapwindowwidget.h - description ------------------- - begin : oct 2019 - copyright : (C) 2019 by Jaime Robles + begin : Feb 2022 + copyright : (C) 2022 by Jaime Robles email : jaime@robles.es ***************************************************************************/ @@ -26,63 +25,50 @@ * along with KLog. If not, see . * * * *****************************************************************************/ +#include #include -#include -//#include +//#include #include "klogdefinitions.h" +#include "mapwidget.h" +#include "dataproxy_sqlite.h" -class QMenu; -class QScrollArea; -class QScrollBar; -class QAction; -class QLabel; - -class WorldMapWidget: public QMainWindow +class MapWindowWidget : public QWidget { Q_OBJECT public: - WorldMapWidget(); - ~WorldMapWidget(); - void loadMap(); - //void setText(const QString txt); + explicit MapWindowWidget(DataProxy_SQLite *dp, QWidget *parent = nullptr); + ~MapWindowWidget(); + void init(); + void setBands(QStringList _bands); + void setModes(QStringList _modes); + void setCenter(const Coordinate &_c); + void addQSO(const QString &_loc); + void addLocator(const QString &_loc, const QColor &_color); + void addLocators(const QStringList &_locators, const QColor &_color); + private slots: - //void slotAcceptButtonClicked(); - void slotZoomIn(); - void slotZoomOut(); - void slotNormalSize(); - void slotFitToWindow(); + void slotBandsComboBoxChanged(const QString &_c); + void slotModesComboBoxChanged(const QString &_c); + void slotPropComboBoxChanged(const QString &_c); + void slotSatsComboBoxChanged(const QString &_c); + void slotConfirmedCheckBoxChanged(); + //void slotLocatorsCheckBoxChanged(); private: - //void loadMap(); - void drawLocators(); - void drawLocator(const int _x, const int _y, const int _width,const int _height, const bool _confirmed); - void drawLocatorText (const int _x, const int _y, const QString &loc, const bool _confirmed); - void drawLines(const int _x, const int _y); - void setImage (const QImage &newImage); - void updateActions(); - void createActions(); - void scaleImage(double factor); - void adjustScrollBar(QScrollBar *scrollbar, double factor); - QRect getScreenResolution(); - void mapNormalizeSize(); - //void keyPressEvent(QKeyEvent *event); - //QTextBrowser *textBrowser; - //QString text; - QScrollArea *scrollArea; - QLabel *mapLabel; - QImage *mapQImage; - int width, height; - double scaleFactor; - - QAction *zoomInAct; - QAction *zoomOutAct; - QAction *fitToWindowAct; - QAction *normalSizeAct; + void createUI(); + void setPropModes(); + void setSatNames(); + void showFiltered(); + QString getPropModeFromComboBox(); + DataProxy_SQLite *dataProxy; + MapWidget *mapWidget; + QComboBox *propComboBox, *bandComboBox, *modeComboBox, *satNameComboBox; + QCheckBox *confirmedCheckBox;//, *locatorsCheckBox; + //QPushButton *okButton; }; - -#endif // WorldMapWidget_H +#endif // MAPWINDOWWIDGET_H diff --git a/src/worldmapwidget.cpp b/src/worldmapwidget.cpp deleted file mode 100644 index a251d12f..00000000 --- a/src/worldmapwidget.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/*************************************************************************** - worldmapwidget.cpp - description - ------------------- - begin : oct 2019 - copyright : (C) 2019 by Jaime Robles - email : jaime@robles.es - ***************************************************************************/ - -/***************************************************************************** - * This file is part of KLog. * - * * - * KLog is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * KLog is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with KLog. If not, see . * - * * - *****************************************************************************/ - -#include "worldmapwidget.h" - -WorldMapWidget::WorldMapWidget() // : mapLabel (new QLabel), scrollArea (new QScrollArea), scaleFactor(1) -{ - //qDebug() << "WorldMapWidget::WorldMapWidget" << QT_ENDL; - scrollArea = new QScrollArea; - mapQImage = new QImage; - - setWindowTitle(tr("World map")); - //setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - width = 0; - height = 0; - createActions(); - - mapLabel = new QLabel(); - mapLabel->setBackgroundRole(QPalette::Base); - mapLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); - mapLabel->setScaledContents(true); - - //mapLabel->setPixmap(QPixmap::fromImage(*mapQImage)); - mapLabel->setWordWrap(true); - scrollArea->setBackgroundRole(QPalette::Dark); - scrollArea->setWidget(mapLabel); - scrollArea->setVisible(false); - - setCentralWidget(scrollArea); - loadMap(); - //drawLocators(); - - //QVBoxLayout *layout = new QVBoxLayout(this); - //layout->setSizeConstraint(QLayout::SetFixedSize); - //layout->addWidget(mapLabel); - //setLayout(layout); - - //qDebug() << "WorldMapWidget::WorldMapWidget - END" << QT_ENDL; -} - -WorldMapWidget::~WorldMapWidget() -{ - //qDebug() << "WorldMapWidget::~WorldMapWidget" << QT_ENDL; -} - -void WorldMapWidget::loadMap() -{ - //qDebug() << "WorldMapWidget::loadMap" << QT_ENDL; - - mapQImage->load(":/img/worldmap.j"); - *mapQImage = mapQImage->convertToFormat(QImage::Format_RGB32); - //qDebug() << "WorldMapWidget::loadMap-10" << QT_ENDL; - - //mapLabel->setPixmap(QPixmap::fromImage(*mapQImage)); - //mapLabel->setWordWrap(true); - //qDebug() << "WorldMapWidget::loadMap-11" << QT_ENDL; - scaleFactor = 1.0; - //qDebug() << "WorldMapWidget::loadMap-12" << QT_ENDL; - - fitToWindowAct->setEnabled(true); - //qDebug() << "WorldMapWidget::loadMap-13" << QT_ENDL; - updateActions(); - //qDebug() << "WorldMapWidget::loadMap-14" << QT_ENDL; - // mapNormalizeSize(); - - if (!fitToWindowAct->isChecked()) - { - mapLabel->adjustSize(); - } - //qDebug() << "WorldMapWidget::loadMap-15" << QT_ENDL; - - width = mapQImage->width(); - height = mapQImage->height(); - - setImage(*mapQImage); - //qDebug() << "WorldMapWidget::loadMap-Size: " << QString::number(mapQImage->width()) <<"/" << QString::number(mapQImage->height()) << QT_ENDL; - - - - - //*mapQImage = mapQImage->scaledToWidth(1260); - - //qDebug() << "WorldMapWidget::loadMap-reSize: " << QString::number(mapQImage->width()) <<"/" << QString::number(mapQImage->height()) << QT_ENDL; - -} - -void WorldMapWidget::drawLocator(const int _x, const int _y, const int _width, const int _height, const bool _confirmed) -{ - //qDebug() << "WorldMapWidget::drawLocator: " << QString::number(_x) << QString::number(_y) << QString::number(_width) << QString::number(_height) << QT_ENDL; - QPainter qPainter(mapQImage); - //qPainter.setBrush(Qt::Dense4Pattern); - - qPainter.setBrush(Qt::NoBrush); - if (_confirmed) - { - qPainter.setPen(Qt::green); - } - else - { - qPainter.setPen(Qt::red); - } - QPen pen(Qt::green); - pen.setWidth(1); - qPainter.setPen(pen); - - qPainter.drawRect(_x,_y,_width,_height); - - qPainter.end(); - setImage(*mapQImage); - //qDebug() << "WorldMapWidget::drawLocator-END" << QT_ENDL; -} - -void WorldMapWidget::drawLocatorText (const int _x, const int _y, const QString &loc, const bool _confirmed) -{ - //qDebug() << "WorldMapWidget::Text" << QT_ENDL; - QPainter qPainter(mapQImage); - qPainter.setFont(QFont("Arial", 12, QFont::Bold)); - if (_confirmed) - { - qPainter.setPen(Qt::green); - } - else - { - qPainter.setPen(Qt::red); - } - - qPainter.drawText(_x+2,_y-2, loc); - qPainter.end(); - setImage(*mapQImage); - //qDebug() << "WorldMapWidget::Text-END" << QT_ENDL; - -} - -void WorldMapWidget::drawLocators() -{ - //qDebug() << "WorldMapWidget::drawLocators" << QT_ENDL; - if (width < 18 || height < 18) - { - return; - } - - int x1, y1; - - for (int i = 0; i < 180; i++) - { - for (int j = 0; j < 180; j++) - { - x1 = (i * (width / 180)); - y1 = height - ((1+j) * (height / 180)); - //qDebug() << "WorldMapWidget::drawLocators: " << QString::number(x1) << "/" << QString::number(y1) << "/" <isChecked(); - scrollArea->setWidgetResizable(fitToWindow); - if(fitToWindow) - slotNormalSize(); - updateActions(); -} - -void WorldMapWidget::slotNormalSize() -{ - mapLabel->adjustSize(); - scaleFactor = 1.0; -} - -void WorldMapWidget::createActions() -{ - QMenu *viewMenu = menuBar()->addMenu(tr("View")); - zoomInAct = viewMenu->addAction(tr("Zoom In(25%)"), this, &WorldMapWidget::slotZoomIn); - zoomInAct->setShortcut(QKeySequence::ZoomIn); - zoomInAct->setEnabled(false); - - zoomOutAct = viewMenu->addAction(tr("Zoom Out(25%)"), this, &WorldMapWidget::slotZoomOut); - zoomOutAct->setShortcut(QKeySequence::ZoomOut); - zoomOutAct->setEnabled(false); - - normalSizeAct = viewMenu->addAction(tr("Normal Size"), this, &WorldMapWidget::slotNormalSize); - normalSizeAct->setEnabled(false); - - fitToWindowAct = viewMenu->addAction(tr("Fit to window"), this, &WorldMapWidget::slotFitToWindow); - fitToWindowAct->setEnabled(false); - -} - -void WorldMapWidget::setImage (const QImage &newImage) -{ - *mapQImage = newImage; - mapLabel->setPixmap(QPixmap::fromImage(*mapQImage)); - scaleFactor = 1.0; - - scrollArea->setVisible(true); - fitToWindowAct->setEnabled(true); - updateActions(); - if (!fitToWindowAct->isChecked()) - mapLabel->adjustSize(); -} - -void WorldMapWidget::updateActions() -{ - zoomInAct->setEnabled(!fitToWindowAct->isChecked()); - zoomOutAct->setEnabled(!fitToWindowAct->isChecked()); - normalSizeAct->setEnabled(!fitToWindowAct->isChecked()); -} - - -void WorldMapWidget::scaleImage(double factor) -{ - //Q_ASSERT(mapLabel->pixmap(Qt::ReturnByValue)); - scaleFactor *= factor; - - #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)) - mapLabel->resize(scaleFactor * mapLabel->pixmap(Qt::ReturnByValue).size()); - #else - mapLabel->resize(scaleFactor * mapLabel->pixmap()->size()); - #endif - - //mapLabel->resize(scaleFactor * mapLabel->pixmap(QT_RETURNBYVALUE)->size()); - - adjustScrollBar(scrollArea->horizontalScrollBar(), factor); - adjustScrollBar(scrollArea->verticalScrollBar(), factor); - zoomInAct->setEnabled(scaleFactor < 15.0); - zoomOutAct->setEnabled(scaleFactor > 0.333); -} - -void WorldMapWidget::adjustScrollBar(QScrollBar *scrollbar, double factor) -{ - scrollbar->setValue(int(factor * scrollbar->value() + ((factor -1) * scrollbar->pageStep()/2))); -} - -QRect WorldMapWidget::getScreenResolution() -{ - QScreen *screen = QGuiApplication::primaryScreen(); - return screen->geometry(); -} - -void WorldMapWidget::mapNormalizeSize() -{ - int _xMax = (getScreenResolution()).height(); - - int mapWidth; - /* - if (_xMax < 640) - { - mapWidth = 360; - } - else if ((_xMax >= 640) && (_xMax < 1024)) - { - mapWidth = 450; - } - else if ((_xMax >= 1024) && (_xMax < 1440)) - { - mapWidth = 810; - } - else if ((_xMax >= 1440) && (_xMax < 2048)) - { - mapWidth = 1080; - } - else - { - mapWidth = 1350; - } - */ - - if (_xMax < 600) - { - mapWidth = 360; - } - else if ((_xMax >= 600) && (_xMax < 960)) - { - mapWidth = 450; - } - else if ((_xMax >= 960) && (_xMax < 1080)) - { - mapWidth = 810; - } - else if ((_xMax >= 1080) && (_xMax < 1536)) - { - mapWidth = 1080; - } - else - { - mapWidth = 1350; - } - - *mapQImage = mapQImage->scaledToHeight(mapWidth); - - //qDebug() << "WorldMapWidget::mapNormalizeSize: Screen: " << QString::number(_xMax) << QT_ENDL; - //qDebug() << "WorldMapWidget::mapNormalizeSize: Map: " << QString::number(mapWidth) << QT_ENDL; -} diff --git a/tests/tests.pro b/tests/tests.pro index 4af944d0..78ca7aa8 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -4,6 +4,7 @@ SUBDIRS=\ mainqsoentrywidget \ mainwindowsattab \ tst_dataproxy \ + tst_locator \ tst_mainwindowinputqso \ tst_setuphamlibnetworkwidget \ tst_setuphamlibserialwidget \ diff --git a/tests/tst_locator/tst_locator.cpp b/tests/tst_locator/tst_locator.cpp new file mode 100644 index 00000000..68b4c48c --- /dev/null +++ b/tests/tst_locator/tst_locator.cpp @@ -0,0 +1,271 @@ +/*************************************************************************** + tst_world.h - description + ------------------- + begin : Jan 2021 + copyright : (C) 2021 by Jaime Robles + email : jaime@robles.es + ***************************************************************************/ + +/***************************************************************************** + * This file is part of Testing suite of KLog. * + * * + * KLog is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * The testing suite of KLog is distributed in the hope that it will * + * be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with Testing suite of KLog. * + * If not, see . * + * * + *****************************************************************************/ + +#include +#include "../../src/klogdefinitions.h" +#include "../../src/locator.h" + +class tst_Locator : public QObject +{ + Q_OBJECT + +public: + tst_Locator(); + ~tst_Locator(); + +private slots: + void initTestCase(); + void cleanupTestCase(); + void test_Constructor(); + void test_isValid(); + void test_Coordinates(); + void test_LocatorCorners(); + void test_Coordinates2Locator(); + +private: + Locator *locator; +}; + +tst_Locator::tst_Locator() +{ + locator = new Locator; +} + +tst_Locator::~tst_Locator() +{ + +} + +void tst_Locator::initTestCase() +{ + +} + +void tst_Locator::cleanupTestCase() +{ + +} + +void tst_Locator::test_Constructor() +{ + //QVERIFY(util->getVersion() == "0.0"); + //qDebug() << "Testing the constructor" << endl; +} + +void tst_Locator::test_isValid() +{ + //isValidLocator(const QString& tlocator){ + QVERIFY2(locator->isValidLocator ("IN"), "IN tested false"); + QVERIFY2(locator->isValidLocator ("IN80"), "IN80 tested false"); + QVERIFY2(locator->isValidLocator ("IN80aa"), "IN80aa tested false"); + QVERIFY2(locator->isValidLocator ("IN80aa"), "IN80aa tested false"); + QVERIFY2(locator->isValidLocator ("IN80aa16"), "IN80aa16 tested false"); + QVERIFY2(locator->isValidLocator ("IN80xx"), "IN80xx tested false"); + QVERIFY2(locator->isValidLocator ("IN99xx"), "IN80xx tested false"); + QVERIFY2(locator->isValidLocator ("IN80xx99"), "IN80aa16 tested false"); + + QVERIFY2(!locator->isValidLocator ("I"), "I tested true"); + QVERIFY2(!locator->isValidLocator ("I8"), "I8 tested true"); + QVERIFY2(!locator->isValidLocator ("IN8"), "IN8 tested true"); + QVERIFY2(!locator->isValidLocator ("IN80a"), "IN80a tested true"); + QVERIFY2(!locator->isValidLocator ("IN80aa1"), "IN80aa16 tested true"); + + QVERIFY2(!locator->isValidLocator ("IS"), "IS tested true"); + QVERIFY2(!locator->isValidLocator ("SN"), "SN tested true"); + QVERIFY2(!locator->isValidLocator ("IN80ay"), "IN80as tested true"); + QVERIFY2(!locator->isValidLocator ("IN80ya"), "IN80sa tested true"); +} + +void tst_Locator::test_Coordinates() +{ + double delta = 0.005; + //QString loc = "IN80AA"; + //qDebug() << Q_FUNC_INFO << QString(": %1=> Lat/long = %2/%3").arg(loc).arg(locator->getLat(loc)).arg(locator->getLon(loc)); + + //qDebug() << Q_FUNC_INFO << ": Lat: " << QString("%1").arg(locator->getLat ("IN80aa")); + //qDebug() << Q_FUNC_INFO << ": Lon: " << QString("%1").arg(locator->getLon ("IN80aa")); + //qDebug() << Q_FUNC_INFO << ": Lat: " << QString("%1").arg(locator->getLat ("IO")); + //qDebug() << Q_FUNC_INFO << ": Lon: " << QString("%1").arg(locator->getLon ("IO")); + //qDebug() << Q_FUNC_INFO << ": Lat: " << QString("%1").arg(locator->getLat ("IO93")); + //qDebug() << Q_FUNC_INFO << ": Lon: " << QString("%1").arg(locator->getLon ("IO93")); + //qDebug() << Q_FUNC_INFO << ": Lat: " << QString("%1").arg(locator->getLat ("IO93ob")); + //qDebug() << Q_FUNC_INFO << ": Lon: " << QString("%1").arg(locator->getLon ("IO93ob")); + Coordinate testCord; + testCord.lat = 0.0; + testCord.lon = 0.0; + testCord = locator->getLocatorCoordinate("IN80"); + QVERIFY2(testCord.lat == 40.5, "Lat failed for Coordinate"); + QVERIFY2(testCord.lon == -3.0, "Lon failed for Coordinate"); + + QVERIFY2(locator->getLat ("IN") == 45, "Lat failed for IN"); + QVERIFY2(locator->getLon ("IN") == -10, "Lon failed for IN"); + QVERIFY2(locator->getLat ("IN80") == 40.5, "Lat failed for IN80"); + QVERIFY2(locator->getLon ("IN80") == -3.0, "Lon failed for IN80"); + //qDebug() << QString::number(static_cast(locator->getLat("IN80AA")) - 40.0208); + QVERIFY2(abs(abs(static_cast(locator->getLat("IN80AA"))) - 40.0416667) <= delta, "Lat failed for IN80AA"); + QVERIFY2(abs(abs(static_cast(locator->getLon("IN80AA"))) - abs(-3.95833)) <= delta, "Lon failed for IN80AA"); +} + +void tst_Locator::test_LocatorCorners() +{ + double delta = 0.005; + // Test the + //Coordinate Locator::getLocatorCorner (const QString& tlocator, bool northWest) + Coordinate cornerManual, cornerTest; + //North + QString _loc = "IN"; + cornerManual.lat = 50.0; + cornerManual.lon = -20.0; + + cornerTest = locator->getLocatorCorner (_loc); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(cornerManual.lat == cornerTest.lat, "getLocator Corner North Lat failed for IN-1"); + QVERIFY2(cornerManual.lon == cornerTest.lon, "getLocator Corner North Lon failed for IN-1"); + + cornerTest = locator->getLocatorCorner (_loc, true); + QVERIFY2(cornerManual.lat == cornerTest.lat, "getLocator Corner North Lat failed for IN-2"); + QVERIFY2(cornerManual.lon == cornerTest.lon, "getLocator Corner North Lon failed for IN-2"); + //South + cornerManual.lat = 40.0; + cornerManual.lon = 0.0; + cornerTest = locator->getLocatorCorner (_loc, false); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(cornerManual.lat == cornerTest.lat, "getLocator Corner South Lat failed for IN"); + + _loc = "IN80"; + //North + cornerManual.lat = 41.0; + cornerManual.lon = -4.0; + + cornerTest = locator->getLocatorCorner (_loc); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(cornerManual.lat == cornerTest.lat, "getLocator Corner North Lat failed for IN80-1"); + QVERIFY2(cornerManual.lon == cornerTest.lon, "getLocator Corner North Lon failed for IN80-1"); + + cornerTest = locator->getLocatorCorner (_loc, true); + QVERIFY2(cornerManual.lat == cornerTest.lat, "getLocator Corner North Lat failed for IN80-2"); + QVERIFY2(cornerManual.lon == cornerTest.lon, "getLocator Corner North Lon failed for IN80-2"); + //South + cornerManual.lat = 40.0; + cornerManual.lon = -2.0; + cornerTest = locator->getLocatorCorner (_loc, false); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(cornerManual.lat == cornerTest.lat, "getLocator Corner South Lat failed for IN80"); + + _loc = "IN80AA"; + //North + cornerManual.lat = 40.0416667; + cornerManual.lon = -4.000; + + cornerTest = locator->getLocatorCorner (_loc); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner North: Lat failed for IN80AA-1"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner North: Lon failed for IN80AA-1"); + + cornerTest = locator->getLocatorCorner (_loc, true); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner North: Lat failed for IN80AA-2"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner North: Lon failed for IN80AA-2"); + //South + cornerManual.lat = 40.0; + cornerManual.lon = -3.9166667; + cornerTest = locator->getLocatorCorner (_loc, false); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner South: Lat failed for IN80AA"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner South: Lon failed for IN80AA"); + + //OO36vg + //North: 56.2916667, 107.750 + //South: 56.250, 107.8333333 + _loc = "OO36vg"; + //North + cornerManual.lat = 56.2916667; + cornerManual.lon = 107.750; + + cornerTest = locator->getLocatorCorner (_loc); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner North: Lat failed for OO36vg-1"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner North: Lon failed for OO36vg-1"); + + cornerTest = locator->getLocatorCorner (_loc, true); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner North: Lat failed for OO36vg-2"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner North: Lon failed for OO36vg-2"); + //South + cornerManual.lat = 56.250; + cornerManual.lon = 107.8333333; + cornerTest = locator->getLocatorCorner (_loc, false); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner South: Lat failed for OO36vg"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner South: Lon failed for OO36vg"); + + //PG73wu + //North: -26.125, 135.8333333 + //South: -26.1666667, 135.9166667 + _loc = "PG73wu"; + //North + cornerManual.lat = -26.125; + cornerManual.lon = 135.8333333; + + cornerTest = locator->getLocatorCorner (_loc); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner North: Lat failed for PG73wu-1"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner North: Lon failed for PG73wu-1"); + + cornerTest = locator->getLocatorCorner (_loc, true); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner North: Lat failed for PG73wu-2"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner North: Lon failed for PG73wu-2"); + //South + cornerManual.lat = -26.1666667; + cornerManual.lon = 135.9166667; + cornerTest = locator->getLocatorCorner (_loc, false); + //qDebug() << QString("CornerManual (lat/lon)=(%1/%2) - CornetTest (lat/lon)=(%3/%4)").arg(cornerManual.lat).arg(cornerManual.lon).arg(cornerTest.lat).arg(cornerTest.lon); + QVERIFY2(abs(abs(static_cast(cornerManual.lat)) - abs(cornerTest.lat)) <= delta, "Corner South: Lat failed for PG73wu"); + QVERIFY2(abs(abs(static_cast(cornerManual.lon)) - abs(cornerTest.lon)) <= delta, "Corner South: Lon failed for PG73wu"); +} + +void tst_Locator::test_Coordinates2Locator() +{ + //qDebug() << locator->getLocator(-0.0426667,40.0); + //QVERIFY2(locator->getLocator(-0.0426667,40.0) == "JN00AA", "JN00AA tested false"); + //qDebug() << locator->getLocator(-3.9266667,41.0416667); + //QVERIFY2(locator->getLocator(-3.9266667,41.0416667) == "JN11XB", "JN11XB tested false"); + //qDebug() << locator->getLocator(36.612377, -92.788664); + //QVERIFY2(locator->getLocator(-3.9266667,41.0416667) == "EM36OO", "JN11XB tested false"); +} + +/* + + QString getLocator(const double lon1, const double lat1) const; + int getBeam(const double lon1, const double lat1, const double lon2, const double lat2); + int getBeamBetweenLocators (const QString& tlocator1, const QString& tlocator2); + int getDistance(const double lon1, const double lat1, const double lon2, const double lat2, const bool _imperialSystem); + int getDistanceBetweenLocators (const QString& tlocator1, const QString& tlocator2, const bool _imperialSystem); + Coordinate getLocatorCorner (const QString& tlocator, bool northWest = true); //northWest = returns the Noth West corner, false implies South East + bool checkCoords(const double lon1, const double lat1); +*/ +QTEST_APPLESS_MAIN(tst_Locator) + +#include "tst_locator.moc" diff --git a/tests/tst_locator/tst_locator.pro b/tests/tst_locator/tst_locator.pro new file mode 100644 index 00000000..8112e1bd --- /dev/null +++ b/tests/tst_locator/tst_locator.pro @@ -0,0 +1,27 @@ +QT += testlib \ + +widgets + +CONFIG += qt console warn_on depend_includepath testcase +CONFIG -= app_bundle + +TEMPLATE = app + +HEADERS += \ + ../../src/locator.h \ + ../../src/klogdefinitions.h + +SOURCES += tst_locator.cpp \ + ../../src/locator.cpp + + + +isEmpty(QMAKE_LRELEASE) { + win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe + else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease + unix { + !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt5 } + } else { + !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease } + } +} diff --git a/tests/world/tst_world.cpp b/tests/world/tst_world.cpp index c243cb6d..263258a7 100644 --- a/tests/world/tst_world.cpp +++ b/tests/world/tst_world.cpp @@ -49,7 +49,7 @@ private slots: private: DataProxy_SQLite *dataProxy; Utilities *util; - World *world; + //World *world; QString version; };