2020-02-21 11:05:07 +02:00
# include "displaytext.h"
# include <QtGlobal>
# include <QApplication>
# include <QMouseEvent>
# include <QTextCharFormat>
# include <QFont>
# include <QTextCursor>
# include "Configuration.hpp"
# include "qt_helpers.hpp"
# include "moc_displaytext.cpp"
DisplayText : : DisplayText ( QWidget * parent ) :
QTextEdit ( parent )
{
setReadOnly ( true ) ;
viewport ( ) - > setCursor ( Qt : : ArrowCursor ) ;
setWordWrapMode ( QTextOption : : NoWrap ) ;
setStyleSheet ( " " ) ;
2021-09-09 10:19:35 +03:00
// max lines to limit heap usage
document ( ) - > setMaximumBlockCount ( 10000 ) ;
2020-02-21 11:05:07 +02:00
}
void DisplayText : : setConfiguration ( Configuration const * config )
{
2021-10-31 22:35:13 +02:00
scroll_ = config - > scroll ( ) ;
2020-11-29 19:10:34 +02:00
useDarkStyle_ = config - > useDarkStyle ( ) ;
displayCountryName_ = config - > countryName ( ) ;
displayCountryPrefix_ = config - > countryPrefix ( ) ;
displayNewCQZ_ = config - > newCQZ ( ) ;
displayNewCQZBand_ = config - > newCQZBand ( ) ;
displayNewCQZBandMode_ = config - > newCQZBandMode ( ) ;
displayNewITUZ_ = config - > newITUZ ( ) ;
displayNewITUZBand_ = config - > newITUZBand ( ) ;
displayNewITUZBandMode_ = config - > newITUZBandMode ( ) ;
displayNewDXCC_ = config - > newDXCC ( ) ;
displayNewDXCCBand_ = config - > newDXCCBand ( ) ;
displayNewDXCCBandMode_ = config - > newDXCCBandMode ( ) ;
displayNewGrid_ = config - > newGrid ( ) ;
displayNewGridBand_ = config - > newGridBand ( ) ;
displayNewGridBandMode_ = config - > newGridBandMode ( ) ;
displayNewPx_ = config - > newPx ( ) ;
displayNewPxBand_ = config - > newPxBand ( ) ;
displayNewPxBandMode_ = config - > newPxBandMode ( ) ;
displayNewCall_ = config - > newCall ( ) ;
displayNewCallBand_ = config - > newCallBand ( ) ;
displayNewCallBandMode_ = config - > newCallBandMode ( ) ;
displayPotential_ = config - > newPotential ( ) ;
displayTxtColor_ = config - > txtColor ( ) ;
displayWorkedColor_ = config - > workedColor ( ) ;
displayWorkedStriked_ = config - > workedStriked ( ) ;
displayWorkedUnderlined_ = config - > workedUnderlined ( ) ;
displayWorkedDontShow_ = config - > workedDontShow ( ) ;
beepOnNewCQZ_ = config - > beepOnNewCQZ ( ) ;
beepOnNewITUZ_ = config - > beepOnNewITUZ ( ) ;
beepOnNewDXCC_ = config - > beepOnNewDXCC ( ) ;
beepOnNewGrid_ = config - > beepOnNewGrid ( ) ;
beepOnNewPx_ = config - > beepOnNewPx ( ) ;
beepOnNewCall_ = config - > beepOnNewCall ( ) ;
beepOnMyCall_ = config - > beepOnMyCall ( ) ;
RR73Marker_ = config - > RR73Marker ( ) ;
otherMessagesMarker_ = config - > otherMessagesMarker ( ) ;
enableCountryFilter_ = config - > enableCountryFilter ( ) ;
enableCallsignFilter_ = config - > enableCallsignFilter ( ) ;
hidefree_ = config - > hidefree ( ) ;
2021-07-27 11:09:40 +03:00
enableMyConinentFilter_ = config - > hideOwnContinent ( ) ;
2020-11-29 19:10:34 +02:00
showcq_ = config - > showcq ( ) ;
showcqrrr73_ = config - > showcqrrr73 ( ) ;
showcq73_ = config - > showcq73 ( ) ;
redMarker_ = config - > redMarker ( ) ;
blueMarker_ = config - > blueMarker ( ) ;
2020-12-11 12:54:56 +02:00
hidehintMarker_ = config - > hidehintMarker ( ) ;
2020-11-29 19:10:34 +02:00
hide_TX_messages_ = config - > hide_TX_messages ( ) ;
color_MyCall_ = config - > color_MyCall ( ) . name ( ) ;
color_CQ_ = config - > color_CQ ( ) . name ( ) ;
color_StandardCall_ = config - > color_StandardCall ( ) . name ( ) ;
color_WorkedCall_ = config - > color_WorkedCall ( ) . name ( ) ;
color_NewCQZ_ = config - > color_NewCQZ ( ) . name ( ) ;
color_NewCQZBand_ = config - > color_NewCQZBand ( ) . name ( ) ;
color_NewITUZ_ = config - > color_NewITUZ ( ) . name ( ) ;
color_NewITUZBand_ = config - > color_NewITUZBand ( ) . name ( ) ;
color_NewDXCC_ = config - > color_NewDXCC ( ) . name ( ) ;
color_NewDXCCBand_ = config - > color_NewDXCCBand ( ) . name ( ) ;
color_NewGrid_ = config - > color_NewGrid ( ) . name ( ) ;
color_NewGridBand_ = config - > color_NewGridBand ( ) . name ( ) ;
color_NewPx_ = config - > color_NewPx ( ) . name ( ) ;
color_NewPxBand_ = config - > color_NewPxBand ( ) . name ( ) ;
color_NewCall_ = config - > color_NewCall ( ) . name ( ) ;
color_NewCallBand_ = config - > color_NewCallBand ( ) . name ( ) ;
hideContinents_ = config - > hideContinents ( ) ;
countries_ = config - > countries ( ) ;
callsigns_ = config - > callsigns ( ) ;
2021-07-27 11:09:40 +03:00
myCall_ = config - > my_callsign ( ) ;
2020-02-21 11:05:07 +02:00
}
2021-07-27 11:09:40 +03:00
void DisplayText : : setMyContinent ( QString const & mycontinet )
{
myContinent_ = mycontinet ;
}
2020-02-21 11:05:07 +02:00
void DisplayText : : setContentFont ( QFont const & font )
{
// setFont (font);
m_charFormat . setFont ( font ) ;
bold_ = font . bold ( ) ;
2021-09-09 10:19:35 +03:00
m_charFormat . setFontItalic ( false ) ;
2020-02-21 11:05:07 +02:00
// selectAll ();
/*
auto cursor = textCursor ( ) ;
cursor . select ( QTextCursor : : Document ) ;
cursor . mergeCharFormat ( m_charFormat ) ;
cursor . clearSelection ( ) ;
cursor . movePosition ( QTextCursor : : End ) ;
// position so viewport scrolled to left
cursor . movePosition ( QTextCursor : : Up ) ;
cursor . movePosition ( QTextCursor : : StartOfLine ) ;
setTextCursor ( cursor ) ;
ensureCursorVisible ( ) ; */
}
void DisplayText : : mouseDoubleClickEvent ( QMouseEvent * e )
{
bool ctrl = ( e - > modifiers ( ) & Qt : : ControlModifier ) ;
bool alt = ( e - > modifiers ( ) & Qt : : AltModifier ) ;
QTextEdit : : mouseDoubleClickEvent ( e ) ;
emit ( selectCallsign ( alt , ctrl ) ) ;
}
void DisplayText : : insertLineSpacer ( QString const & line )
{
2021-06-28 11:52:33 +03:00
appendText ( line , Radio : : convert_dark ( " #d3d3d3 " , useDarkStyle_ ) , Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) , 0 , " " , Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) , " " , true ) ;
2020-02-21 11:05:07 +02:00
}
2021-09-09 10:19:35 +03:00
void DisplayText : : appendText ( QString const & text , QString const & bg , QString const & color , int std_type , QString const & servis , QString const & servis_color , QString const & cntry , bool forceBold , bool strikethrough , bool underlined , bool DXped , bool overwrite , bool wanted )
2020-02-21 11:05:07 +02:00
{
QString servbg , s ;
2021-06-28 11:52:33 +03:00
if ( std_type = = 2 ) servbg = Radio : : convert_dark ( " #ff0000 " , useDarkStyle_ ) ;
else if ( std_type = = 5 ) servbg = Radio : : convert_dark ( " #0000ff " , useDarkStyle_ ) ;
else if ( servis = = " ? " ) servbg = Radio : : convert_dark ( " #ffff00 " , useDarkStyle_ ) ;
2020-07-02 13:44:42 +03:00
else if ( std_type = = 3 & & servis . length ( ) > 1 ) servbg = servis . mid ( 1 ) ;
2021-06-28 11:52:33 +03:00
else servbg = Radio : : convert_dark ( " #ffffff " , useDarkStyle_ ) ;
2020-02-21 11:05:07 +02:00
auto cursor = textCursor ( ) ;
2021-10-31 22:35:13 +02:00
if ( scroll_ ) {
2021-11-01 11:51:56 +02:00
if ( document ( ) - > blockCount ( ) = = 10000 ) {
cursor . movePosition ( QTextCursor : : Down , QTextCursor : : MoveAnchor , 9998 ) ;
cursor . select ( QTextCursor : : LineUnderCursor ) ;
cursor . removeSelectedText ( ) ;
cursor . deleteChar ( ) ;
}
2021-10-31 22:35:13 +02:00
cursor . movePosition ( QTextCursor : : Start ) ;
if ( overwrite ) {
cursor . select ( QTextCursor : : LineUnderCursor ) ;
cursor . removeSelectedText ( ) ;
}
} else {
cursor . movePosition ( QTextCursor : : End ) ;
if ( 0 = = cursor . position ( ) )
cursor . setCharFormat ( m_charFormat ) ;
else if ( overwrite ) {
cursor . select ( QTextCursor : : LineUnderCursor ) ;
cursor . removeSelectedText ( ) ;
} else
cursor . insertText ( " \n " ) ;
}
2020-02-21 11:05:07 +02:00
if ( forceBold ) {
if ( bold_ ) {
m_charFormat . setFontWeight ( QFont : : Black ) ;
} else {
m_charFormat . setFontWeight ( QFont : : Bold ) ;
}
} else {
if ( bold_ ) {
m_charFormat . setFontWeight ( QFont : : Bold ) ;
} else {
m_charFormat . setFontWeight ( QFont : : Normal ) ;
}
}
2021-06-28 11:52:33 +03:00
m_charFormat . setForeground ( QColor ( color ) ) ;
m_charFormat . setBackground ( QColor ( bg ) ) ;
2020-02-21 11:05:07 +02:00
if ( text . length ( ) < 50 ) {
int ft = 23 ;
if ( text . mid ( 4 , 1 ) = = " " ) ft = 21 ;
cursor . insertText ( text . left ( ft ) , m_charFormat ) ;
m_charFormat . setFontStrikeOut ( strikethrough ) ;
if ( DXped ) {
if ( underlined ) m_charFormat . setUnderlineStyle ( QTextCharFormat : : WaveUnderline ) ;
else m_charFormat . setUnderlineStyle ( QTextCharFormat : : DashUnderline ) ;
}
else if ( underlined ) m_charFormat . setUnderlineStyle ( QTextCharFormat : : SingleUnderline ) ;
else m_charFormat . setUnderlineStyle ( QTextCharFormat : : NoUnderline ) ;
2021-09-09 10:19:35 +03:00
if ( wanted ) {
m_charFormat . setFontItalic ( true ) ; m_charFormat . setForeground ( QColor ( color_MyCall_ ) ) ; m_charFormat . setFontOverline ( true ) ;
if ( ! underlined & & ! DXped ) m_charFormat . setFontUnderline ( true ) ;
}
2020-02-21 11:05:07 +02:00
cursor . insertText ( text . mid ( ft , 26 ) , m_charFormat ) ;
2021-09-09 10:19:35 +03:00
if ( wanted ) {
m_charFormat . setFontItalic ( false ) ; m_charFormat . setFontOverline ( false ) ;
if ( ! underlined & & ! DXped ) m_charFormat . setFontUnderline ( false ) ;
}
2020-02-21 11:05:07 +02:00
m_charFormat . setFontStrikeOut ( false ) ;
m_charFormat . setUnderlineStyle ( QTextCharFormat : : NoUnderline ) ;
2021-07-08 08:51:06 +03:00
m_charFormat . setBackground ( QColor ( servbg ) ) ;
m_charFormat . setForeground ( QColor ( servis_color ) ) ;
2020-02-21 11:05:07 +02:00
cursor . insertText ( servis . left ( 1 ) , m_charFormat ) ;
2020-07-02 13:44:42 +03:00
m_charFormat . setBackground ( QColor ( Radio : : convert_dark ( " #ffffff " , useDarkStyle_ ) ) ) ;
2020-11-29 19:10:34 +02:00
m_charFormat . setForeground ( QColor ( Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) ) ) ;
2020-02-21 11:05:07 +02:00
cursor . insertText ( cntry , m_charFormat ) ;
} else {
cursor . insertText ( text . trimmed ( ) , m_charFormat ) ;
}
2021-10-31 22:35:13 +02:00
if ( scroll_ & & ! overwrite ) cursor . insertText ( " \n " ) ;
else cursor . movePosition ( QTextCursor : : StartOfLine ) ;
2020-02-21 11:05:07 +02:00
setTextCursor ( cursor ) ;
ensureCursorVisible ( ) ;
document ( ) - > setMaximumBlockCount ( document ( ) - > maximumBlockCount ( ) ) ;
}
2020-04-08 14:29:40 +03:00
int DisplayText : : displayDecodedText ( DecodedText * decodedText , QString myCall , QString hisCall , QString hisGrid ,
2020-02-21 11:05:07 +02:00
bool once_notified , LogBook logBook , QsoHistory & qsoHistory ,
QsoHistory & qsoHistory2 , double dialFreq , const QString app_mode ,
bool bypassRxfFilters , bool bypassAllFilters , int rx_frq ,
QStringList wantedCallList , QStringList wantedPrefixList , QStringList wantedGridList ,
QStringList wantedCountryList , bool windowPopup , QWidget * window )
{
2021-06-28 11:52:33 +03:00
QString bgColor = Radio : : convert_dark ( " #ffffff " , useDarkStyle_ ) ;
QString txtColor = Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) ;
2020-02-21 11:05:07 +02:00
QString swpColor = " " ;
2021-06-28 11:52:33 +03:00
QString servisColor = Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) ;
2020-02-21 11:05:07 +02:00
QString messageText ;
bool forceBold = false ;
bool strikethrough = false ;
bool underlined = false ;
bool beep = false ;
bool actwind = false ;
bool show_line = true ;
bool jt65bc = false ;
bool notified = false ;
bool new_marker = false ;
int inotified = 0 ;
int std_type = 0 ;
bool bwantedCall = false ;
bool bwantedPrefix = false ;
bool bwantedGrid = false ;
bool bwantedCountry = false ;
2020-04-08 14:29:40 +03:00
if ( app_mode . startsWith ( " FT " ) ) messageText = decodedText - > string ( ) . left ( 49 ) ;
else if ( app_mode = = " WSPR-2 " ) messageText = decodedText - > string ( ) . trimmed ( ) ;
else messageText = decodedText - > string ( ) . left ( 40 ) ;
2020-02-21 11:05:07 +02:00
QString servis = " " ;
QString cntry = " " ;
QString checkCall ;
2021-07-27 11:09:40 +03:00
QString checkCall2 ;
2020-02-21 11:05:07 +02:00
QString grid ;
QString tyyp = " " ;
QString countryName ;
2021-07-27 11:09:40 +03:00
QString countryName2 ;
2020-02-21 11:05:07 +02:00
QString mpx = " " ;
QString lotw = " " ;
QsoHistory : : Status status = QsoHistory : : NONE ;
QsoHistory : : Status dummy = QsoHistory : : NONE ;
int priority = 0 ;
QString param ;
QString report ;
2020-04-08 23:16:24 +03:00
QString checkMode ;
2020-05-06 13:52:10 +03:00
QString rep_type ;
2020-02-21 11:05:07 +02:00
unsigned c_time = 0 ;
2020-04-08 14:29:40 +03:00
if ( ! decodedText - > isDebug ( ) & & app_mode ! = " WSPR-2 " ) {
c_time = decodedText - > timeInSeconds ( ) ;
2020-02-21 11:05:07 +02:00
if ( c_time ! = 0 & & c_time ! = max_r_time ) {
max_r_time = c_time ;
qsoHistory . time ( max_r_time ) ;
if ( ! hisCall . isEmpty ( ) ) {
mystatus_ = qsoHistory2 . status ( hisCall , mygrid_ ) ;
if ( mygrid_ . isEmpty ( ) ) mygrid_ = hisGrid ;
myhisCall_ = hisCall ;
}
}
2021-12-29 21:29:59 +02:00
QStringList parts = decodedText - > message ( ) . split ( ' ' , SkipEmptyParts ) ;
2020-11-30 17:22:27 +02:00
if ( ! hisCall . isEmpty ( ) & & messageText . contains ( Radio : : base_callsign ( hisCall ) ) ) txtColor = color_StandardCall_ ;
2020-04-08 14:29:40 +03:00
checkCall = decodedText - > CQersCall ( grid , tyyp ) ;
2021-07-27 11:09:40 +03:00
checkCall2 = decodedText - > call ( ) ;
2020-02-21 11:05:07 +02:00
if ( ! app_mode . startsWith ( " FT " ) & & ( messageText . contains ( " 2nd-h " ) | | messageText . contains ( " 3rd-h " ) ) ) jt65bc = true ;
if ( ! checkCall . isEmpty ( ) ) {
if ( grid . isEmpty ( ) ) dummy = qsoHistory2 . status ( checkCall , grid ) ;
if ( grid . isEmpty ( ) & & Radio : : base_callsign ( checkCall ) = = hisCall ) grid = hisGrid ;
2020-04-08 14:29:40 +03:00
if ( decodedText - > message ( ) . left ( 3 ) = = " DE " ) {
2020-02-21 11:05:07 +02:00
tyyp = " " ;
2020-04-08 14:29:40 +03:00
if ( qAbs ( rx_frq - decodedText - > frequencyOffset ( ) ) < 10 ) {
2020-02-21 11:05:07 +02:00
std_type = 2 ;
2020-11-29 19:10:34 +02:00
txtColor = color_MyCall_ ;
2020-02-21 11:05:07 +02:00
if ( ! grid . isEmpty ( ) & & grid ! = " RR73 " & & hisCall . isEmpty ( ) ) {
status = QsoHistory : : RCALL ;
param = grid ;
}
2020-04-08 14:29:40 +03:00
else if ( hisCall . isEmpty ( ) & & decodedText - > message ( ) . right ( 4 ) = = checkCall ) {
2020-02-21 11:05:07 +02:00
status = QsoHistory : : RCALL ;
}
else if ( checkCall . contains ( hisCall ) & & mystatus_ > QsoHistory : : SCQ & & mystatus_ ! = QsoHistory : : FIN ) {
2020-05-06 13:52:10 +03:00
if ( decodedText - > report ( myCall , Radio : : base_callsign ( checkCall ) , report , rep_type ) & & ! report . isEmpty ( ) ) {
if ( rep_type = = " R " )
status = QsoHistory : : RRREPORT ;
else
status = QsoHistory : : RREPORT ;
2020-02-21 11:05:07 +02:00
param = report ;
}
2020-04-08 14:29:40 +03:00
else if ( decodedText - > message ( ) . contains ( " RRR " ) & & mystatus_ > QsoHistory : : SREPORT ) {
2020-02-21 11:05:07 +02:00
status = QsoHistory : : RRR ;
}
2020-04-08 14:29:40 +03:00
else if ( decodedText - > message ( ) . contains ( " RR73 " ) & & mystatus_ > QsoHistory : : SREPORT ) {
2020-02-21 11:05:07 +02:00
status = QsoHistory : : RRR73 ;
}
2020-04-08 14:29:40 +03:00
else if ( decodedText - > message ( ) . contains ( " 73 " ) & & mystatus_ > = QsoHistory : : RRR & & mystatus_ ! = QsoHistory : : FIN ) { // DE call 73 case
2020-02-21 11:05:07 +02:00
status = QsoHistory : : R73 ;
}
else {
std_type = 3 ;
2021-06-28 11:52:33 +03:00
txtColor = Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) ;
2020-02-21 11:05:07 +02:00
}
} else {
std_type = 3 ;
2021-06-28 11:52:33 +03:00
txtColor = Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) ;
2020-02-21 11:05:07 +02:00
}
} else {
std_type = 3 ;
}
} else {
std_type = 1 ;
2020-11-29 19:10:34 +02:00
txtColor = color_CQ_ ;
2020-02-21 11:05:07 +02:00
status = QsoHistory : : RCQ ;
param = grid ;
}
}
2021-07-27 11:09:40 +03:00
else if ( ! myCall . isEmpty ( ) & & Radio : : base_callsign ( checkCall2 ) = = myCall ) {
2020-02-21 11:05:07 +02:00
std_type = 2 ;
2020-11-29 19:10:34 +02:00
txtColor = color_MyCall_ ;
2020-02-21 11:05:07 +02:00
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnMyCall_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
2020-04-08 14:29:40 +03:00
decodedText - > deCallAndGrid ( checkCall , grid ) ;
2020-02-21 11:05:07 +02:00
if ( ! grid . isEmpty ( ) | | ( ! checkCall . isEmpty ( ) & & parts . length ( ) = = 2 ) ) {
status = QsoHistory : : RCALL ;
if ( grid . isEmpty ( ) ) dummy = qsoHistory2 . status ( checkCall , grid ) ;
if ( grid . isEmpty ( ) & & Radio : : base_callsign ( checkCall ) = = hisCall ) grid = hisGrid ;
param = grid ;
}
else {
if ( grid . isEmpty ( ) ) dummy = qsoHistory2 . status ( checkCall , grid ) ;
if ( grid . isEmpty ( ) & & Radio : : base_callsign ( checkCall ) = = hisCall ) grid = hisGrid ;
2020-05-06 13:52:10 +03:00
if ( decodedText - > report ( myCall , Radio : : base_callsign ( checkCall ) , report , rep_type ) ) {
2020-02-21 11:05:07 +02:00
if ( ! checkCall . isEmpty ( ) ) {
2020-05-06 13:52:10 +03:00
if ( ! report . isEmpty ( ) ) {
if ( rep_type = = " R " )
status = QsoHistory : : RRREPORT ;
else
status = QsoHistory : : RREPORT ;
2020-02-21 11:05:07 +02:00
param = report ;
}
2020-04-08 14:29:40 +03:00
else if ( decodedText - > message ( ) . contains ( " RRR " ) ) {
2020-02-21 11:05:07 +02:00
status = QsoHistory : : RRR ;
}
2020-04-08 14:29:40 +03:00
else if ( decodedText - > message ( ) . contains ( " RR73 " ) ) {
2020-02-21 11:05:07 +02:00
status = QsoHistory : : RRR73 ;
}
2020-04-08 14:29:40 +03:00
else if ( decodedText - > message ( ) . contains ( " 73 " ) ) {
2020-02-21 11:05:07 +02:00
status = QsoHistory : : R73 ;
}
else {
status = QsoHistory : : RCALL ;
}
}
}
2020-04-08 14:29:40 +03:00
else if ( decodedText - > message ( ) . contains ( " 73 " ) & & ! hisCall . isEmpty ( ) & & mystatus_ > = QsoHistory : : RRR & & mystatus_ ! = QsoHistory : : FIN ) { // nonstandard73 with myCall
2020-02-21 11:05:07 +02:00
status = QsoHistory : : R73 ;
checkCall = hisCall ;
}
if ( ! checkCall . isEmpty ( ) ) {
if ( hisCall . isEmpty ( ) & & ( myhisCall_ . isEmpty ( ) | | ! checkCall . contains ( myhisCall_ ) ) ) {
mystatus_ = qsoHistory2 . status ( Radio : : base_callsign ( checkCall ) , mygrid_ ) ;
myhisCall_ = Radio : : base_callsign ( checkCall ) ;
}
if ( ( ! hisCall . isEmpty ( ) & & checkCall . contains ( hisCall ) ) | | ( ! myhisCall_ . isEmpty ( ) & & checkCall . contains ( myhisCall_ ) ) ) {
mystatus_ = status ;
if ( grid . isEmpty ( ) & & ! mygrid_ . isEmpty ( ) ) {
grid = mygrid_ ;
}
}
}
}
}
else {
2020-04-08 14:29:40 +03:00
decodedText - > deCallAndGrid ( checkCall , grid ) ;
2020-02-21 11:05:07 +02:00
if ( ! checkCall . isEmpty ( ) ) {
if ( grid . isEmpty ( ) ) dummy = qsoHistory2 . status ( checkCall , grid ) ;
if ( grid . isEmpty ( ) & & Radio : : base_callsign ( checkCall ) = = hisCall ) grid = hisGrid ;
2020-04-08 14:29:40 +03:00
if ( ! decodedText - > isNonStd1 ( ) & & ! decodedText - > isNonStd2 ( ) ) {
2020-02-21 11:05:07 +02:00
std_type = 3 ;
if ( ! grid . isEmpty ( ) ) param = grid ;
2020-04-08 14:29:40 +03:00
if ( ! hisCall . isEmpty ( ) & & checkCall . contains ( hisCall ) ) qsoHistory . rx ( checkCall , decodedText - > frequencyOffset ( ) ) ;
} else if ( ! hisCall . isEmpty ( ) & & checkCall . contains ( hisCall ) & & qAbs ( rx_frq - decodedText - > frequencyOffset ( ) ) < 10 & & decodedText - > message ( ) . contains ( " 73 " ) & & mystatus_ > = QsoHistory : : RRR & & mystatus_ ! = QsoHistory : : FIN ) { //nonstandard73 with hisCall
2020-02-21 11:05:07 +02:00
std_type = 2 ;
2020-11-29 19:10:34 +02:00
txtColor = color_MyCall_ ;
2020-02-21 11:05:07 +02:00
status = QsoHistory : : R73 ;
mystatus_ = status ;
} else if ( ! hisCall . isEmpty ( ) & & checkCall . contains ( hisCall ) ) {
2020-04-08 14:29:40 +03:00
qsoHistory . rx ( checkCall , decodedText - > frequencyOffset ( ) ) ;
2020-02-21 11:05:07 +02:00
checkCall = " " ;
2022-01-21 10:48:45 +02:00
} else if ( ! decodedText - > isNonStd2 ( ) ) {
std_type = 3 ;
if ( ! grid . isEmpty ( ) ) param = grid ;
if ( ! hisCall . isEmpty ( ) & & checkCall . contains ( hisCall ) ) qsoHistory . rx ( checkCall , decodedText - > frequencyOffset ( ) ) ;
2020-02-21 11:05:07 +02:00
} else {
checkCall = " " ;
}
2020-11-29 19:10:34 +02:00
if ( ! checkCall . isEmpty ( ) & & RR73Marker_ & & ( decodedText - > message ( ) . contains ( " RR73 " ) | | decodedText - > message ( ) . contains ( " 73 " ) ) ) {
2020-02-21 11:05:07 +02:00
std_type = 4 ;
2020-11-29 19:10:34 +02:00
txtColor = color_CQ_ ;
2020-02-21 11:05:07 +02:00
status = QsoHistory : : RFIN ;
}
2020-04-08 14:29:40 +03:00
} else if ( std_type = = 0 & & ! hisCall . isEmpty ( ) & & qAbs ( rx_frq - decodedText - > frequencyOffset ( ) ) < 10 & & decodedText - > message ( ) . contains ( " 73 " ) & & mystatus_ > = QsoHistory : : RRR & & mystatus_ ! = QsoHistory : : FIN ) { // nonstandard 73 in my rx
2020-02-21 11:05:07 +02:00
std_type = 2 ;
2020-11-29 19:10:34 +02:00
txtColor = color_MyCall_ ;
2020-02-21 11:05:07 +02:00
checkCall = hisCall ;
status = QsoHistory : : R73 ;
mystatus_ = status ;
}
}
} else checkCall = " " ;
if ( ! checkCall . isEmpty ( ) ) {
2020-03-30 13:41:09 +03:00
bool cqzB4 = true ;
bool ituzB4 = true ;
2020-02-21 11:05:07 +02:00
bool countryB4 = true ;
bool pxB4 = true ;
bool callB4 = true ;
2020-03-30 13:41:09 +03:00
bool cqzB4BandMode = true ;
bool ituzB4BandMode = true ;
2020-02-21 11:05:07 +02:00
bool countryB4BandMode = true ;
bool pxB4BandMode = true ;
bool callB4BandMode = true ;
bool gridB4 = true ;
bool gridB4BandMode = true ;
logBook . getLOTW ( /*in*/ checkCall , /*out*/ lotw ) ;
2020-11-29 19:10:34 +02:00
if ( ! lotw . isEmpty ( ) ) {
priority = 1 ;
}
if ( displayPotential_ & & std_type = = 3 ) {
txtColor = color_StandardCall_ ;
2020-02-21 11:05:07 +02:00
}
2020-04-08 23:16:24 +03:00
if ( app_mode = = " JT9+JT65 " ) {
if ( decodedText - > isJT9 ( ) ) {
checkMode = " JT9 " ;
} else if ( decodedText - > isJT65 ( ) ) { // TODO: is this if-condition necessary?
checkMode = " JT65 " ;
}
} else {
checkMode = app_mode ;
}
2020-11-29 19:10:34 +02:00
if ( ! jt65bc & & ( displayCountryName_ | | displayNewCQZ_ | | displayNewITUZ_ | | displayNewDXCC_ | | displayNewCall_ | | displayNewGrid_ | | displayNewPx_ ) ) {
if ( ! displayNewCQZ_ & & ! displayNewITUZ_ & & ! displayNewDXCC_ & & displayCountryName_ & & ! displayNewCall_ & & ! displayNewPx_ ) {
2020-02-21 11:05:07 +02:00
logBook . getDXCC ( /*in*/ checkCall , /*out*/ countryName ) ;
}
2020-11-29 19:10:34 +02:00
if ( displayNewCQZ_ ) {
if ( displayNewCQZBand_ | | displayNewCQZBandMode_ ) {
if ( displayNewCQZBand_ & & displayNewCQZBandMode_ ) {
2020-03-30 13:41:09 +03:00
logBook . matchCQZ ( /*in*/ checkCall , /*out*/ countryName , cqzB4 , cqzB4BandMode , /*in*/ dialFreq , checkMode ) ;
2020-11-29 19:10:34 +02:00
} else if ( displayNewCQZBand_ ) {
2020-03-30 13:41:09 +03:00
logBook . matchCQZ ( /*in*/ checkCall , /*out*/ countryName , cqzB4 , cqzB4BandMode , /*in*/ dialFreq ) ;
} else {
logBook . matchCQZ ( /*in*/ checkCall , /*out*/ countryName , cqzB4 , cqzB4BandMode , /*in*/ 0 , checkMode ) ;
}
} else {
logBook . matchCQZ ( /*in*/ checkCall , /*out*/ countryName , cqzB4 , cqzB4BandMode ) ;
}
}
2020-11-29 19:10:34 +02:00
if ( displayNewITUZ_ ) {
if ( displayNewITUZBand_ | | displayNewITUZBandMode_ ) {
if ( displayNewITUZBand_ & & displayNewITUZBandMode_ ) {
2020-03-30 13:41:09 +03:00
logBook . matchITUZ ( /*in*/ checkCall , /*out*/ countryName , ituzB4 , ituzB4BandMode , /*in*/ dialFreq , checkMode ) ;
2020-11-29 19:10:34 +02:00
} else if ( displayNewITUZBand_ ) {
2020-03-30 13:41:09 +03:00
logBook . matchITUZ ( /*in*/ checkCall , /*out*/ countryName , ituzB4 , ituzB4BandMode , /*in*/ dialFreq ) ;
} else {
logBook . matchITUZ ( /*in*/ checkCall , /*out*/ countryName , ituzB4 , ituzB4BandMode , /*in*/ 0 , checkMode ) ;
}
} else {
logBook . matchITUZ ( /*in*/ checkCall , /*out*/ countryName , ituzB4 , ituzB4BandMode ) ;
}
}
2020-11-29 19:10:34 +02:00
if ( displayNewDXCC_ ) {
if ( displayNewDXCCBand_ | | displayNewDXCCBandMode_ ) {
if ( displayNewDXCCBand_ & & displayNewDXCCBandMode_ ) {
2020-02-21 11:05:07 +02:00
logBook . matchDXCC ( /*in*/ checkCall , /*out*/ countryName , countryB4 , countryB4BandMode , /*in*/ dialFreq , checkMode ) ;
2020-11-29 19:10:34 +02:00
} else if ( displayNewDXCCBand_ ) {
2020-02-21 11:05:07 +02:00
logBook . matchDXCC ( /*in*/ checkCall , /*out*/ countryName , countryB4 , countryB4BandMode , /*in*/ dialFreq ) ;
} else {
logBook . matchDXCC ( /*in*/ checkCall , /*out*/ countryName , countryB4 , countryB4BandMode , /*in*/ 0 , checkMode ) ;
}
} else {
logBook . matchDXCC ( /*in*/ checkCall , /*out*/ countryName , countryB4 , countryB4BandMode ) ;
}
}
2020-11-29 19:10:34 +02:00
if ( displayNewGrid_ ) {
if ( displayNewGridBand_ | | displayNewGridBandMode_ ) {
if ( displayNewGridBand_ & & displayNewGridBandMode_ ) {
2020-02-21 11:05:07 +02:00
logBook . matchGrid ( /*in*/ grid . trimmed ( ) , /*out*/ gridB4 , gridB4BandMode , /*in*/ dialFreq , checkMode ) ;
2020-11-29 19:10:34 +02:00
} else if ( displayNewGridBand_ ) {
2020-02-21 11:05:07 +02:00
logBook . matchGrid ( /*in*/ grid . trimmed ( ) , /*out*/ gridB4 , gridB4BandMode , /*in*/ dialFreq ) ;
} else {
logBook . matchGrid ( /*in*/ grid . trimmed ( ) , /*out*/ gridB4 , gridB4BandMode , /*in*/ 0 , checkMode ) ;
}
} else {
logBook . matchGrid ( /*in*/ grid . trimmed ( ) , /*out*/ gridB4 , gridB4BandMode ) ;
}
}
2020-11-29 19:10:34 +02:00
if ( displayNewPx_ ) {
if ( displayNewPxBand_ | | displayNewPxBandMode_ ) {
if ( displayNewPxBand_ & & displayNewPxBandMode_ ) {
2020-02-21 11:05:07 +02:00
logBook . matchPX ( /*in*/ checkCall , /*out*/ countryName , pxB4 , pxB4BandMode , /*in*/ dialFreq , checkMode ) ;
2020-11-29 19:10:34 +02:00
} else if ( displayNewPxBand_ ) {
2020-02-21 11:05:07 +02:00
logBook . matchPX ( /*in*/ checkCall , /*out*/ countryName , pxB4 , pxB4BandMode , /*in*/ dialFreq ) ;
} else {
logBook . matchPX ( /*in*/ checkCall , /*out*/ countryName , pxB4 , pxB4BandMode , /*in*/ 0 , checkMode ) ;
}
} else {
logBook . matchPX ( /*in*/ checkCall , /*out*/ countryName , pxB4 , pxB4BandMode ) ;
}
}
2020-11-29 19:10:34 +02:00
if ( displayNewCall_ ) {
if ( displayNewCallBand_ | | displayNewCallBandMode_ ) {
if ( displayNewCallBand_ & & displayNewCallBandMode_ ) {
2020-02-21 11:05:07 +02:00
logBook . matchCall ( /*in*/ checkCall , /*out*/ countryName , callB4 , callB4BandMode , /*in*/ dialFreq , checkMode ) ;
2020-11-29 19:10:34 +02:00
} else if ( displayNewCallBand_ ) {
2020-02-21 11:05:07 +02:00
logBook . matchCall ( /*in*/ checkCall , /*out*/ countryName , callB4 , callB4BandMode , /*in*/ dialFreq ) ;
} else {
logBook . matchCall ( /*in*/ checkCall , /*out*/ countryName , callB4 , callB4BandMode , /*in*/ 0 , checkMode ) ;
}
} else {
logBook . matchCall ( /*in*/ checkCall , /*out*/ countryName , callB4 , callB4BandMode ) ;
}
}
2020-11-29 19:10:34 +02:00
if ( displayNewCQZ_ | | displayNewITUZ_ | | displayNewDXCC_ | | displayNewCall_ | | displayNewGrid_ | | displayNewPx_ ) {
2020-02-21 11:05:07 +02:00
//Worked
2020-11-29 19:10:34 +02:00
if ( ( displayPotential_ & & std_type = = 3 ) | | ( std_type ! = 3 ) ) {
if ( displayWorkedColor_ ) {
bgColor = color_WorkedCall_ ;
2020-02-21 11:05:07 +02:00
}
2020-11-29 19:10:34 +02:00
if ( displayWorkedStriked_ ) {
2020-02-21 11:05:07 +02:00
strikethrough = true ;
2020-11-29 19:10:34 +02:00
} else if ( displayWorkedUnderlined_ ) {
2020-02-21 11:05:07 +02:00
underlined = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( displayWorkedColor_ & & otherMessagesMarker_ ) servis + = color_WorkedCall_ ;
2020-02-21 11:05:07 +02:00
2020-11-29 19:10:34 +02:00
if ( displayNewCQZ_ & & ! cqzB4 ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-03-30 13:41:09 +03:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewCQZ_ ;
2020-03-30 13:41:09 +03:00
if ( ! lotw . isEmpty ( ) ) priority = 31 ;
else priority = 30 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewCQZ_ ) {
2020-03-30 13:41:09 +03:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewCQZ_ ;
2020-03-30 13:41:09 +03:00
if ( ! lotw . isEmpty ( ) ) priority = 31 ;
else priority = 30 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( ( displayNewCQZBand_ | | displayNewCQZBandMode_ ) & & ! cqzB4BandMode ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-03-30 13:41:09 +03:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewCQZBand_ ;
2020-03-30 13:41:09 +03:00
if ( ! lotw . isEmpty ( ) ) priority = 29 ;
else priority = 28 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewCQZ_ ) {
2020-03-30 13:41:09 +03:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewCQZBand_ ;
2020-03-30 13:41:09 +03:00
if ( ! lotw . isEmpty ( ) ) priority = 29 ;
else priority = 28 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( displayNewITUZ_ & & ! ituzB4 ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-03-30 13:41:09 +03:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewITUZ_ ;
2020-03-30 13:41:09 +03:00
if ( ! lotw . isEmpty ( ) ) priority = 27 ;
else priority = 26 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewITUZ_ ) {
2020-03-30 13:41:09 +03:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewITUZ_ ;
2020-03-30 13:41:09 +03:00
if ( ! lotw . isEmpty ( ) ) priority = 27 ;
else priority = 26 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( ( displayNewITUZBand_ | | displayNewITUZBandMode_ ) & & ! ituzB4BandMode ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-03-30 13:41:09 +03:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewITUZBand_ ;
2020-03-30 13:41:09 +03:00
if ( ! lotw . isEmpty ( ) ) priority = 25 ;
else priority = 24 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewITUZ_ ) {
2020-03-30 13:41:09 +03:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewITUZBand_ ;
2020-03-30 13:41:09 +03:00
if ( ! lotw . isEmpty ( ) ) priority = 25 ;
else priority = 24 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( displayNewDXCC_ & & ! countryB4 ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-02-21 11:05:07 +02:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewDXCC_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 23 ;
else priority = 22 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewDXCC_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewDXCC_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 23 ;
else priority = 22 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( ( displayNewDXCCBand_ | | displayNewDXCCBandMode_ ) & & ! countryB4BandMode ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-02-21 11:05:07 +02:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewDXCCBand_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 21 ;
else priority = 20 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewDXCC_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewDXCCBand_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 21 ;
else priority = 20 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( displayNewGrid_ & & ! gridB4 ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-02-21 11:05:07 +02:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewGrid_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 16 ;
else priority = 15 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewGrid_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewGrid_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 16 ;
else priority = 15 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( ( displayNewGridBand_ | | displayNewGridBandMode_ ) & & ! gridB4BandMode ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-02-21 11:05:07 +02:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewGridBand_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 14 ;
else priority = 13 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewGrid_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewGridBand_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 14 ;
else priority = 13 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( displayNewPx_ & & ! pxB4 ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-02-21 11:05:07 +02:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewPx_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 12 ;
else priority = 11 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewPx_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewPx_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 12 ;
else priority = 11 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( ( displayNewPxBand_ | | displayNewPxBandMode_ ) & & ! pxB4BandMode ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-02-21 11:05:07 +02:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewPxBand_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 10 ;
else priority = 9 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewPx_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewPxBand_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 10 ;
else priority = 9 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( displayNewCall_ & & ! callB4 ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-02-21 11:05:07 +02:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewCall_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 8 ;
else priority = 7 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewCall_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewCall_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 8 ;
else priority = 7 ;
new_marker = true ;
}
2020-11-29 19:10:34 +02:00
} else if ( ( displayNewCallBand_ | | displayNewCallBandMode_ ) & & ! callB4BandMode ) {
if ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) {
2020-02-21 11:05:07 +02:00
forceBold = true ;
2020-11-29 19:10:34 +02:00
bgColor = color_NewCallBand_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 6 ;
else priority = 5 ;
strikethrough = false ;
underlined = false ;
actwind = true ;
2020-11-29 19:10:34 +02:00
if ( beepOnNewCall_ ) {
2020-02-21 11:05:07 +02:00
beep = true ;
}
}
2020-11-29 19:10:34 +02:00
else if ( otherMessagesMarker_ ) {
servis = servis . left ( 1 ) + color_NewCallBand_ ;
2020-02-21 11:05:07 +02:00
if ( ! lotw . isEmpty ( ) ) priority = 6 ;
else priority = 5 ;
new_marker = true ;
}
}
2020-11-29 19:10:34 +02:00
if ( displayWorkedDontShow_ & & std_type ! = 2 & & ( ( ! forceBold & & ( ( displayPotential_ & & std_type = = 3 ) | | std_type ! = 3 ) ) | | ( ! new_marker & & otherMessagesMarker_ & & std_type = = 3 ) ) ) {
2020-02-21 11:05:07 +02:00
show_line = false ;
}
}
} else {
logBook . getDXCC ( /*in*/ checkCall , /*out*/ countryName ) ;
}
2021-12-29 21:29:59 +02:00
QStringList items = countryName . split ( ' , ' ) ;
2020-02-21 11:05:07 +02:00
mpx = items [ 1 ] ;
if ( ! wantedCallList . isEmpty ( ) & & ( wantedCallList . indexOf ( Radio : : base_callsign ( checkCall ) ) > = 0 | | wantedCallList . indexOf ( checkCall ) > = 0 ) ) {
2021-11-04 13:42:48 +02:00
bwantedCall = true ; show_line = true ;
2020-02-21 11:05:07 +02:00
}
for ( int i = 0 ; i < wantedPrefixList . size ( ) ; i + + ) {
if ( wantedPrefixList . at ( i ) . size ( ) > 1 & & checkCall . startsWith ( wantedPrefixList . at ( i ) ) ) {
bwantedPrefix = true ;
break ;
}
}
for ( int i = 0 ; i < wantedGridList . size ( ) ; i + + ) {
if ( wantedGridList . at ( i ) . size ( ) > 0 & & wantedGridList . at ( i ) . left ( 4 ) = = grid . left ( 4 ) ) {
bwantedGrid = true ;
break ;
}
}
for ( int i = 0 ; i < wantedCountryList . size ( ) ; i + + ) {
2020-04-22 19:20:36 +03:00
if ( wantedCountryList . at ( i ) . size ( ) > 0 & & wantedCountryList . at ( i ) = = mpx . toUpper ( ) ) {
2020-02-21 11:05:07 +02:00
bwantedCountry = true ;
break ;
}
}
if ( bwantedCall & & priority < 5 ) {
priority = 4 ;
beep = true ;
} else if ( ( bwantedPrefix | | bwantedGrid ) & & priority < 5 ) {
priority = 3 ;
// beep = true;
} else if ( bwantedCountry & & priority < 5 ) {
priority = 2 ;
// beep = true;
} else if ( bwantedCall & & priority < 20 ) {
priority = 19 ;
beep = true ;
} else if ( ( bwantedPrefix | | bwantedGrid ) & & priority < 20 ) {
priority = 18 ;
beep = true ;
} else if ( bwantedCountry & & priority < 20 ) {
priority = 17 ;
beep = true ;
}
2020-11-29 19:10:34 +02:00
if ( displayTxtColor_ & & ( displayPotential_ | | std_type ! = 3 ) ) {
2020-02-21 11:05:07 +02:00
swpColor = bgColor ;
bgColor = txtColor ;
txtColor = swpColor ;
}
2020-11-29 19:10:34 +02:00
if ( displayCountryName_ ) {
if ( displayCountryPrefix_ ) {
2020-02-21 11:05:07 +02:00
cntry = items [ 1 ] ;
} else {
// do some obvious abbreviations, don't care if we using just prefixes here, not big deal to run some replace's
cntry = items [ 2 ] ;
}
}
if ( ! bwantedCall & & ! bwantedPrefix & & ! bwantedGrid & & ! bwantedCountry ) {
2020-11-29 19:10:34 +02:00
if ( hideContinents_ . contains ( items [ 0 ] ) & & std_type ! = 2 & & ! jt65bc ) {
2020-02-21 11:05:07 +02:00
show_line = false ;
2020-11-29 19:10:34 +02:00
} else if ( enableCountryFilter_ & & std_type ! = 2 & & ! jt65bc ) {
2021-12-29 21:29:59 +02:00
QStringList countries = countries_ . split ( ' , ' ) ;
2020-04-22 19:20:36 +03:00
if ( countries . contains ( items [ 1 ] . toUpper ( ) ) )
2020-02-21 11:05:07 +02:00
show_line = false ;
}
2020-11-29 19:10:34 +02:00
if ( show_line & & enableCallsignFilter_ & & std_type ! = 2 & & ! jt65bc ) {
2021-12-29 21:29:59 +02:00
QStringList callsigns = callsigns_ . split ( ' , ' ) ;
2020-02-21 11:05:07 +02:00
if ( callsigns . contains ( Radio : : base_callsign ( checkCall ) ) )
show_line = false ;
}
}
2021-01-25 15:07:40 +02:00
else if ( ! bwantedCall & & enableCallsignFilter_ & & std_type ! = 2 & & ! jt65bc ) {
2021-12-29 21:29:59 +02:00
QStringList callsigns = callsigns_ . split ( ' , ' ) ;
2021-01-25 15:07:40 +02:00
if ( callsigns . contains ( Radio : : base_callsign ( checkCall ) ) )
show_line = false ;
}
2022-02-13 16:36:30 +02:00
if ( enableMyConinentFilter_ & & std_type ! = 2 & & ! jt65bc ) {
2021-07-27 11:09:40 +03:00
logBook . getDXCC ( /*in*/ checkCall2 , /*out*/ countryName2 ) ;
2022-02-13 16:36:30 +02:00
QString continent2 = countryName2 . split ( ' , ' ) [ 0 ] ;
if ( continent2 = = " " ) continent2 = myContinent_ ;
if ( ( std_type = = 1 & & myContinent_ = = items [ 0 ] ) | | ( continent2 = = myContinent_ & & ( items [ 0 ] = = myContinent_ | | items [ 0 ] = = " " ) ) | | ( continent2 ! = myContinent_ & & items [ 0 ] ! = myContinent_ ) ) show_line = false ;
2021-07-27 11:09:40 +03:00
}
2022-02-13 16:36:30 +02:00
} else if ( enableMyConinentFilter_ & & ! jt65bc ) {
logBook . getDXCC ( /*in*/ checkCall2 , /*out*/ countryName2 ) ;
QString continent2 = countryName2 . split ( ' , ' ) [ 0 ] ;
if ( continent2 = = " " ) continent2 = myContinent_ ;
if ( continent2 = = myContinent_ ) show_line = false ;
2020-02-21 11:05:07 +02:00
}
2020-11-29 19:10:34 +02:00
if ( show_line & & decodedText - > isNonStd2 ( ) & & hidefree_ & & ! decodedText - > message ( ) . contains ( myCall ) & & std_type ! = 1 & & ! jt65bc ) {
2020-02-21 11:05:07 +02:00
show_line = false ;
2020-11-29 19:10:34 +02:00
} else if ( show_line & & showcq_ & & std_type ! = 1 & & std_type ! = 2 & & qAbs ( rx_frq - decodedText - > frequencyOffset ( ) ) > 10 & & ! jt65bc ) {
2020-02-21 11:05:07 +02:00
show_line = false ;
2020-11-29 19:10:34 +02:00
} else if ( show_line & & showcqrrr73_ & & std_type ! = 1 & & std_type ! = 2 & & ! decodedText - > isEnd ( ) & & qAbs ( rx_frq - decodedText - > frequencyOffset ( ) ) > 10 & & ! jt65bc ) {
2020-02-21 11:05:07 +02:00
show_line = false ;
2020-11-29 19:10:34 +02:00
} else if ( show_line & & showcq73_ & & std_type ! = 1 & & std_type ! = 2 & & ! decodedText - > isFin ( ) & & qAbs ( rx_frq - decodedText - > frequencyOffset ( ) ) > 10 & & ! jt65bc ) {
2020-02-21 11:05:07 +02:00
show_line = false ;
2020-12-11 12:54:56 +02:00
} else if ( ! hidehintMarker_ & & decodedText - > isHint ( ) ) {
2020-02-21 11:05:07 +02:00
if ( lotw . isEmpty ( ) )
servis = " * " + servis . mid ( 1 ) ; // hinted decode
else
servis = " ° " + servis . mid ( 1 ) ; // lotw hinted decode
2020-04-08 14:29:40 +03:00
} else if ( decodedText - > isWrong ( ) ) {
2020-02-21 11:05:07 +02:00
servis = " ? " + servis . mid ( 1 ) ; // error decode
} else if ( ! lotw . isEmpty ( ) ) {
servis = " • " + servis . mid ( 1 ) ; // lotw
}
2021-02-22 08:38:38 +02:00
if ( bypassAllFilters | | bypassRxfFilters ) {
show_line = true ;
}
2020-02-21 11:05:07 +02:00
if ( show_line ) {
if ( actwind ) {
if ( windowPopup & & window ! = NULL ) {
window - > showNormal ( ) ;
window - > raise ( ) ;
QApplication : : setActiveWindow ( window ) ;
}
}
if ( beep & & ! once_notified ) {
QApplication : : beep ( ) ;
notified = true ;
}
}
if ( jt65bc ) {
2021-06-28 11:52:33 +03:00
bgColor = Radio : : convert_dark ( " #ffffff " , useDarkStyle_ ) ;
txtColor = Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) ;
2020-02-21 11:05:07 +02:00
}
if ( show_line ) {
if ( ! checkCall . isEmpty ( ) & & ( std_type = = 1 | | std_type = = 2 | | std_type = = 4 | | ( std_type = = 3 & & ! param . isEmpty ( ) ) ) ) {
2020-04-08 23:16:24 +03:00
qsoHistory . message ( checkCall , status , priority , param , tyyp , countryName . left ( 2 ) , mpx , c_time , decodedText - > report ( ) , decodedText - > frequencyOffset ( ) , checkMode ) ;
2020-02-21 11:05:07 +02:00
}
if ( std_type = = 2 ) {
2020-11-29 19:10:34 +02:00
if ( ! redMarker_ ) std_type = 0 ;
else if ( blueMarker_ & & ! hisCall . isEmpty ( ) & & checkCall . contains ( hisCall ) ) std_type = 5 ;
2020-02-21 11:05:07 +02:00
}
2021-09-09 10:19:35 +03:00
appendText ( messageText , bgColor , txtColor , std_type , servis , servisColor , cntry , forceBold , strikethrough , underlined , decodedText - > isDXped ( ) , false , bwantedCall | | bwantedGrid | | bwantedPrefix | | bwantedCountry ) ;
2020-02-21 11:05:07 +02:00
wastx_ = false ;
}
if ( notified ) inotified | = 1 ;
if ( show_line ) inotified | = 2 ;
if ( bwantedCall ) inotified | = 8 ;
if ( bwantedPrefix ) inotified | = 16 ;
if ( bwantedGrid ) inotified | = 32 ;
if ( bwantedCountry ) inotified | = 64 ;
return inotified ;
}
void DisplayText : : displayTransmittedText ( QString text , QString myCall , QString hisCall , QString skip_tx1 , QString modeTx , qint32 txFreq ,
QColor color_TxMsg , QsoHistory & qsoHistory )
{
QsoHistory : : Status status = QsoHistory : : S73 ;
QString bg = color_TxMsg . name ( ) ;
QString t ;
QString t1 = " @ " ;
QString t2 ;
QString tyyp = " " ;
unsigned ttime = 0 ;
t = text ;
int dxped = t . indexOf ( " ; " ) ;
if ( dxped > 0 ) {
auto next_ws = t . indexOf ( ' ' , dxped + 2 ) ;
t2 = t . mid ( next_ws , t . indexOf ( ' ' , next_ws + 1 ) - next_ws ) ;
next_ws = t . indexOf ( ' ' , 1 ) ;
t = t . left ( next_ws ) + t2 + t . mid ( next_ws , 32 ) ;
}
2020-03-25 21:48:47 +02:00
t2 = QString : : asprintf ( " %4d " , txFreq ) ;
2020-02-21 11:05:07 +02:00
if ( modeTx = = " FT8 " ) t1 = " ~ " ;
else if ( modeTx = = " FT4 " ) t1 = " : " ;
else if ( modeTx = = " JT65 " ) t1 = " # " ;
else if ( modeTx = = " T10 " ) t1 = " + " ;
QStringList txs = t . split ( " ; " ) ;
for ( int i = 0 ; i < txs . size ( ) ; i + + ) {
if ( modeTx . startsWith ( " FT " ) ) {
t = QDateTime : : currentDateTimeUtc ( ) . toString ( " hhmmss " ) + \
" Tx " + t2 + t1 + txs . at ( i ) . left ( 24 ) ;
t = t . leftJustified ( 49 , ' ' ) ;
} else {
t = QDateTime : : currentDateTimeUtc ( ) . toString ( " hhmm " ) + \
" Tx " + t2 + t1 + txs . at ( i ) . left ( 19 ) ;
}
ttime = 3600 * t . mid ( 0 , 2 ) . toUInt ( ) + 60 * t . mid ( 2 , 2 ) . toUInt ( ) ;
if ( t . mid ( 4 , 2 ) ! = " " ) ttime + = t . mid ( 4 , 2 ) . toUInt ( ) ;
2021-12-29 21:29:59 +02:00
QStringList parts = txs . at ( i ) . split ( ' ' , SkipEmptyParts ) ;
2020-02-21 11:05:07 +02:00
if ( parts . size ( ) > 1 )
{
QString param = " " ;
QString call = parts [ 0 ] ;
if ( call = = " DE " ) call = hisCall ;
if ( parts . size ( ) > 2 )
{
if ( parts [ 0 ] = = " CQ " )
{
status = QsoHistory : : SCQ ;
if ( parts . size ( ) > 3 ) {
tyyp = parts [ 1 ] ;
if ( tyyp = = " 908 " ) tyyp = " JA " ;
call = parts [ 2 ] ;
param = parts [ 3 ] ;
} else {
call = parts [ 1 ] ;
param = parts [ 2 ] ;
}
}
else if ( parts [ 2 ] . size ( ) = = 4 )
{
if ( parts [ 2 ] = = " RR73 " )
status = QsoHistory : : SRR73 ;
else if ( parts [ 2 ] . left ( 2 ) = = " R+ " | | parts [ 2 ] . left ( 2 ) = = " R- " ) {
param = parts [ 2 ] . mid ( 1 , 3 ) ;
2020-05-06 13:52:10 +03:00
status = QsoHistory : : SRREPORT ;
2020-02-21 11:05:07 +02:00
tyyp = skip_tx1 ;
}
else
status = QsoHistory : : SCALL ;
}
else if ( parts [ 2 ] . size ( ) = = 3 )
{
if ( parts [ 2 ] = = " RRR " )
status = QsoHistory : : SRR ;
else if ( parts [ 2 ] . left ( 1 ) = = " + " | | parts [ 2 ] . left ( 1 ) = = " - " ) {
param = parts [ 2 ] . left ( 3 ) ;
status = QsoHistory : : SREPORT ;
tyyp = skip_tx1 ;
}
}
else if ( parts [ 2 ] = = " 73 " | | parts [ 1 ] = = " 73 " | | parts [ 0 ] = = " 73 "
| | parts [ 2 ] = = " TNX " | | parts [ 1 ] = = " TNX " | | parts [ 0 ] = = " TNX "
| | parts [ 2 ] = = " TKS " | | parts [ 1 ] = = " TKS " | | parts [ 0 ] = = " TKS "
| | parts [ 2 ] = = " TU " | | parts [ 1 ] = = " TU " | | parts [ 0 ] = = " TU "
| | ( parts . size ( ) = = 4 & & ( parts [ 3 ] = = " 73 " | | parts [ 3 ] = = " TNX " | | parts [ 3 ] = = " TKS " | | parts [ 3 ] = = " TU " ) ) )
{
call = hisCall ;
status = QsoHistory : : S73 ;
}
}
if ( parts . size ( ) = = 2 )
{
if ( parts [ 0 ] = = " CQ " )
{
status = QsoHistory : : SCQ ;
call = parts [ 1 ] ;
}
else if ( ! myCall . isEmpty ( ) & & Radio : : base_callsign ( parts [ 1 ] ) = = myCall & & call ! = " 73 " & & call ! = " TNX " & & call ! = " TKS " & & call ! = " TU " ) //
{
status = QsoHistory : : SCALL ;
}
else if ( call = = " 73 " | | parts [ 1 ] = = " 73 " | | call = = " TNX " | | parts [ 1 ] = = " TNX " | | call = = " TKS " | | parts [ 1 ] = = " TKS " | | call = = " TU " | | parts [ 1 ] = = " TU " )
{
call = hisCall ;
status = QsoHistory : : S73 ;
}
}
mystatus_ = status ;
2020-04-08 23:16:24 +03:00
qsoHistory . message ( call , status , 0 , param , tyyp , " " , " " , ttime , " " , txFreq , modeTx ) ;
2020-02-21 11:05:07 +02:00
}
2020-11-29 19:10:34 +02:00
if ( wastx_ & & ttime - last_tx < 2 & & hide_TX_messages_ )
2021-06-28 11:52:33 +03:00
appendText ( t , bg , Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) , 0 , " " , Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) , " " , false , false , false , false , true ) ;
2020-02-21 11:05:07 +02:00
else
2021-06-28 12:22:38 +03:00
appendText ( t , bg , Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) , 0 , " " , Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) ) ;
2020-02-21 11:05:07 +02:00
}
wastx_ = true ;
last_tx = ttime ;
}
void DisplayText : : displayQSY ( QString text )
{
QString t = QDateTime : : currentDateTimeUtc ( ) . toString ( " hhmmss " ) + " " + text ;
2021-06-28 11:52:33 +03:00
QString bg = Radio : : convert_dark ( " #ff69b4 " , useDarkStyle_ ) ;
2021-06-28 12:22:38 +03:00
appendText ( t , bg , Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) , 0 , " " , Radio : : convert_dark ( " #000000 " , useDarkStyle_ ) ) ;
2020-02-21 11:05:07 +02:00
}