Update to Call Activity to pull grid from log if the station has not transmitted their grid yet
This commit is contained in:
		
							parent
							
								
									d91f96da42
								
							
						
					
					
						commit
						d1bd82af26
					
				| @ -258,6 +258,7 @@ void ADIF::load() | |||||||
|                , extractField (record, "BAND") |                , extractField (record, "BAND") | ||||||
|                , extractField (record, "MODE") |                , extractField (record, "MODE") | ||||||
|                , extractField (record, "SUBMODE") |                , extractField (record, "SUBMODE") | ||||||
|  |                , extractField (record, "GRIDSQUARE") | ||||||
|                , extractField (record, "QSO_DATE") |                , extractField (record, "QSO_DATE") | ||||||
|                , extractField (record, "NAME") |                , extractField (record, "NAME") | ||||||
|                , extractField (record, "COMMENT") |                , extractField (record, "COMMENT") | ||||||
| @ -268,13 +269,14 @@ void ADIF::load() | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void ADIF::add(QString const& call, QString const& band, QString const& mode, QString const& submode, QString const& date, QString const& name, QString const& comment) | void ADIF::add(QString const& call, QString const& band, QString const& mode, QString const& submode, QString const &grid, QString const& date, QString const& name, QString const& comment) | ||||||
| { | { | ||||||
|     QSO q; |     QSO q; | ||||||
|     q.call = call; |     q.call = call; | ||||||
|     q.band = band; |     q.band = band; | ||||||
|     q.mode = mode; |     q.mode = mode; | ||||||
|     q.submode = submode; |     q.submode = submode; | ||||||
|  |     q.grid = grid; | ||||||
|     q.date = date; |     q.date = date; | ||||||
|     q.name = name; |     q.name = name; | ||||||
|     q.comment = comment; |     q.comment = comment; | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ class ADIF | |||||||
| 
 | 
 | ||||||
| 	void init(QString const& filename); | 	void init(QString const& filename); | ||||||
| 	void load(); | 	void load(); | ||||||
|     void add(QString const& call, QString const& band, QString const& mode, const QString &submode, QString const& date, const QString &name, const QString &comment); |     void add(QString const& call, QString const& band, QString const& mode, const QString &submode, QString const& grid, QString const& date, const QString &name, const QString &comment); | ||||||
|     bool match(QString const& call, QString const& band) const; |     bool match(QString const& call, QString const& band) const; | ||||||
|     QList<ADIF::QSO> find(QString const& call) const; |     QList<ADIF::QSO> find(QString const& call) const; | ||||||
| 	QList<QString> getCallList() const; | 	QList<QString> getCallList() const; | ||||||
| @ -48,7 +48,7 @@ class ADIF | |||||||
| 
 | 
 | ||||||
|     struct QSO |     struct QSO | ||||||
|     { |     { | ||||||
|       QString call,band,mode,submode,date,name,comment; |       QString call,band,mode,submode,grid,date,name,comment; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     private: |     private: | ||||||
|  | |||||||
| @ -79,6 +79,7 @@ bool LogBook::findCallDetails( | |||||||
|                     /*in*/ |                     /*in*/ | ||||||
|                     const QString call, |                     const QString call, | ||||||
|                     /*out*/ |                     /*out*/ | ||||||
|  |                     QString &grid, | ||||||
|                     QString &date, |                     QString &date, | ||||||
|                     QString &name, |                     QString &name, | ||||||
|                     QString &comment) const |                     QString &comment) const | ||||||
| @ -93,6 +94,7 @@ bool LogBook::findCallDetails( | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     foreach(auto qso, qsos){ |     foreach(auto qso, qsos){ | ||||||
|  |         if(grid.isEmpty() && !qso.grid.isEmpty()) grid = qso.grid; | ||||||
|         if(date.isEmpty() && !qso.date.isEmpty()) date = qso.date; |         if(date.isEmpty() && !qso.date.isEmpty()) date = qso.date; | ||||||
|         if(name.isEmpty() && !qso.name.isEmpty()) name = qso.name; |         if(name.isEmpty() && !qso.name.isEmpty()) name = qso.name; | ||||||
|         if(comment.isEmpty() && !qso.comment.isEmpty()) comment = qso.comment; |         if(comment.isEmpty() && !qso.comment.isEmpty()) comment = qso.comment; | ||||||
| @ -101,9 +103,9 @@ bool LogBook::findCallDetails( | |||||||
|     return true; |     return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LogBook::addAsWorked(const QString call, const QString band, const QString mode, const QString submode, const QString date, const QString name, const QString comment) | void LogBook::addAsWorked(const QString call, const QString band, const QString mode, const QString submode, const QString grid, const QString date, const QString name, const QString comment) | ||||||
| { | { | ||||||
|   _log.add(call,band,mode,submode,date,name,comment); |   _log.add(call,band,mode,submode,grid,date,name,comment); | ||||||
|   QString countryName = _countries.find(call); |   QString countryName = _countries.find(call); | ||||||
|   if (countryName.length() > 0) |   if (countryName.length() > 0) | ||||||
|     _worked.setAsWorked(countryName); |     _worked.setAsWorked(countryName); | ||||||
|  | |||||||
| @ -26,14 +26,14 @@ public: | |||||||
|               /*out*/ QString &countryName, |               /*out*/ QString &countryName, | ||||||
|                       bool &callWorkedBefore, |                       bool &callWorkedBefore, | ||||||
|                       bool &countryWorkedBefore) const; |                       bool &countryWorkedBefore) const; | ||||||
|     bool findCallDetails( |     bool findCallDetails(/*in*/ | ||||||
|                         /*in*/ |  | ||||||
|                         const QString call, |                         const QString call, | ||||||
|                         /*out*/ |                         /*out*/ | ||||||
|  |                         QString &grid, | ||||||
|                         QString &date, |                         QString &date, | ||||||
|                         QString &name, |                         QString &name, | ||||||
|                         QString &comment) const; |                         QString &comment) const; | ||||||
|     void addAsWorked(const QString call, const QString band, const QString mode, const QString submode, const QString date, const QString name, const QString comment); |     void addAsWorked(const QString call, const QString band, const QString mode, const QString submode, const QString grid, const QString date, const QString name, const QString comment); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|    CountryDat _countries; |    CountryDat _countries; | ||||||
|  | |||||||
| @ -6715,7 +6715,7 @@ void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call, | |||||||
|                             , QString const& my_call, QString const& my_grid, QByteArray const& ADIF, QMap<QString, QVariant> const &additionalFields) |                             , QString const& my_call, QString const& my_grid, QByteArray const& ADIF, QMap<QString, QVariant> const &additionalFields) | ||||||
| { | { | ||||||
|   QString date = QSO_date_on.toString("yyyyMMdd"); |   QString date = QSO_date_on.toString("yyyyMMdd"); | ||||||
|   m_logBook.addAsWorked (m_hisCall, m_config.bands ()->find (m_freqNominal), mode, submode, date, name, comments); |   m_logBook.addAsWorked (m_hisCall, m_config.bands ()->find (m_freqNominal), mode, submode, grid, date, name, comments); | ||||||
| 
 | 
 | ||||||
|   // Log to JS8Call API
 |   // Log to JS8Call API
 | ||||||
|   if(m_config.udpEnabled()){ |   if(m_config.udpEnabled()){ | ||||||
| @ -11811,12 +11811,19 @@ void MainWindow::displayCallActivity() { | |||||||
|                 workedBeforeItem->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); |                 workedBeforeItem->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); | ||||||
|                 ui->tableWidgetCalls->setItem(row, col++, workedBeforeItem); |                 ui->tableWidgetCalls->setItem(row, col++, workedBeforeItem); | ||||||
| 
 | 
 | ||||||
|  |                 QString logDetailGrid; | ||||||
|                 QString logDetailDate; |                 QString logDetailDate; | ||||||
|                 QString logDetailName; |                 QString logDetailName; | ||||||
|                 QString logDetailComment; |                 QString logDetailComment; | ||||||
| 
 | 
 | ||||||
|                 if(showColumn("call", "log") || showColumn("call", "logName") || showColumn("call", "logComment")){ |                 if(showColumn("call", "grid") || showColumn("call", "log") || showColumn("call", "logName") || showColumn("call", "logComment")){ | ||||||
|                     m_logBook.findCallDetails(d.call, logDetailDate, logDetailName, logDetailComment); |                     m_logBook.findCallDetails(d.call, logDetailGrid, logDetailDate, logDetailName, logDetailComment); | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |                 if(gridItem->text().isEmpty() || !logDetailGrid.isEmpty()){ | ||||||
|  |                     gridItem->setText(logDetailGrid.trimmed().left(4)); | ||||||
|  |                     gridItem->setToolTip(logDetailGrid.trimmed()); | ||||||
|  |                     distanceItem->setText(calculateDistance(logDetailGrid.trimmed())); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 if(!logDetailDate.isEmpty()){ |                 if(!logDetailDate.isEmpty()){ | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jordan Sherer
						Jordan Sherer