diff --git a/src/searchdialog.cpp b/src/searchdialog.cpp index 0befd5a9..afb04580 100644 --- a/src/searchdialog.cpp +++ b/src/searchdialog.cpp @@ -41,9 +41,6 @@ SearchDialog::SearchDialog(QWidget *parent) : match = false; onceClicked = false; startLine = -1; - is_PayloadStartFound = false; - is_PayloadEndFound = false; - is_PayLoadRangeValid = false; lineEdits = new QList(); lineEdits->append(ui->lineEditText); @@ -108,19 +105,6 @@ bool SearchDialog::getOnceClicked(){return onceClicked;} QString SearchDialog::getApIDText(){ return ui->apIdlineEdit->text();} QString SearchDialog::getCtIDText(){ return ui->ctIdlineEdit->text();} - -QString SearchDialog::getPayLoadStampStart() -{ - //qDebug() << "content of payload start" << ui->payloadStartlineEdit->text()<< __LINE__; - return ui->payloadStartlineEdit->text(); -} - -QString SearchDialog::getPayLoadStampEnd() -{ - //qDebug() << "content of payload end" << ui->payloadEndlineEdit->text()<< __LINE__; - return ui->payloadEndlineEdit->text(); -} - QString SearchDialog::getTimeStampStart() { //qDebug() << "content of start time" << ui->timeStartlineEdit->text()<< __LINE__; @@ -324,22 +308,6 @@ int SearchDialog::find() } } - - // check payload search pattern - payloadStart = getPayLoadStampStart(); - payloadEnd = getPayLoadStampEnd(); - - if( (false == payloadStart.isEmpty() ) && ( false == payloadEnd.isEmpty() ) ) - { - //qDebug() << "Payload search enabled" << __LINE__; - is_payLoadSearchSelected = true; - } - else - { - is_payLoadSearchSelected = false; - //qDebug() << "Payload search is disabled" << payloadStart.isEmpty() << payloadEnd.isEmpty() << __LINE__; - } - //check APID and CTID search stApid = getApIDText(); stCtid = getCtIDText(); @@ -401,10 +369,6 @@ void SearchDialog::findMessages(long int searchLine, long int searchBorder, QReg is_Case_Sensitive = Qt::CaseSensitive; } - is_PayloadStartFound = false; - is_PayloadEndFound = false; - is_PayLoadRangeValid = false; - m_searchtablemodel->clear_SearchResults(); QProgressDialog fileprogress("Searching...", "Abort", 0, file->sizeFilter(), this); @@ -479,10 +443,6 @@ void SearchDialog::findMessages(long int searchLine, long int searchBorder, QReg continue; } - // TODO: implement functionality about payload start and end - // Note: This feature has been broken for some time before this refactoring: - // See https://github.com/COVESA/dlt-viewer/issues/502 - if (foundLine(searchLine)) break; else @@ -492,78 +452,6 @@ void SearchDialog::findMessages(long int searchLine, long int searchBorder, QReg stoptime(); } - -bool SearchDialog::payLoadStartpatternCheck(const QString& tempPayload) -{ - // When the start payload patternn is found, consider range as valid - if((tempPayload.contains(payloadStart)) && (false == is_PayloadEndFound) && true == is_payLoadSearchSelected) - { - //qDebug() << "Found start payload pattern" << __LINE__; - is_PayLoadRangeValid = true; - is_PayloadStartFound = true; - } - return is_PayLoadRangeValid; -} - - -bool SearchDialog::payLoadStoppatternCheck(const QString& tempPayload) -{ - // When the stop payload patern is found, consider range as ivalid - if(true == is_PayloadStartFound && true == is_payLoadSearchSelected && true == is_payLoadSearchSelected) - { - if(tempPayload.contains(payloadEnd)) - { - //qDebug() << "Found stop payload pattern" << __LINE__; - is_PayloadEndFound = true; - is_PayLoadRangeValid = false; - } - //else qDebug() << "No stop payload pattern" << __LINE__; - } - return is_PayLoadRangeValid; -} - -bool SearchDialog::timeStampPayloadValidityCheck(long int searchLine) -{ - // qDebug() << "timeStampPayloadValidityCheck" << __LINE__; - if(true == is_TimeStampSearchSelected) - { - if(true == is_payLoadSearchSelected) - { - if(is_PayLoadRangeValid == true) - { - if(foundLine(searchLine)) - { - return true; - } - } - } - else - { - if(foundLine(searchLine) == true) - { - return true; - } - } - } - else if(true == is_payLoadSearchSelected) - { - if(true == is_PayLoadRangeValid) - if(foundLine(searchLine)) - { - return true; - } - } - else // all the other cases - { - if(foundLine(searchLine) == true) - { - return true; - } - } - return false; -} - - bool SearchDialog::foundLine(long int searchLine) { match = true; diff --git a/src/searchdialog.h b/src/searchdialog.h index 7723a0e8..3a8d06c4 100644 --- a/src/searchdialog.h +++ b/src/searchdialog.h @@ -84,10 +84,6 @@ class SearchDialog : public QDialog bool match; bool onceClicked; bool fSilentMode; - bool is_PayloadStartFound; - bool is_PayloadEndFound; - bool is_PayLoadRangeValid; - bool is_payLoadSearchSelected; bool is_TimeStampSearchSelected; bool fIs_APID_CTID_requested; @@ -96,8 +92,6 @@ class SearchDialog : public QDialog double dTimeStampStart; double dTimeStampStop; - QString payloadStart; - QString payloadEnd; QString stApid; QString stCtid; @@ -131,8 +125,6 @@ class SearchDialog : public QDialog bool getOnceClicked(); bool searchtoIndex(); bool foundLine(long int searchLine); - bool payLoadStartpatternCheck(const QString& tempPayload); - bool payLoadStoppatternCheck(const QString& tempPayload); QString getApIDText(); QString getCtIDText(); QString getTimeStampStart(); diff --git a/src/searchdialog.ui b/src/searchdialog.ui index ce9da9df..6fb32d86 100644 --- a/src/searchdialog.ui +++ b/src/searchdialog.ui @@ -7,7 +7,7 @@ 0 0 600 - 431 + 359 @@ -26,7 +26,7 @@ Search - + :/toolbar/png/system-search.png:/toolbar/png/system-search.png @@ -160,67 +160,6 @@ Timestamp end: - - - - 10 - 80 - 111 - 21 - - - - <html><head/><body><p>Set here a payload range to be found. The range is defined by a starting pattern and an end pattern. Every message between these patterns is regarded as a search hit.</p></body></html> - - - PayLoad start: - - - - - - 220 - 80 - 111 - 21 - - - - PayLoad end: - - - - - - 130 - 80 - 71 - 20 - - - - <html><head/><body><p>Pattern which is considererd as starting mark.</p></body></html> - - - <html><head/><body><p>Enter the TimeStamp start after which the text would be searched</p></body></html> - - - - - - 340 - 80 - 71 - 20 - - - - <html><head/><body><p>Pattern which is considererd as stop mark.</p></body></html> - - - <html><head/><body><p>Enter the TimeStamp end before which this text would be searched</p></body></html> - - @@ -522,7 +461,7 @@ radioButtonPosCurrent - +