Skip to content

Commit

Permalink
Issue 754: Added explicit message stating no MS2 scans.
Browse files Browse the repository at this point in the history
  • Loading branch information
PMSeitzer committed Nov 1, 2024
1 parent b1d2fc1 commit dd8fa75
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/maven/spectrawidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ void SpectraWidget::drawGraph() {
bool isDrawCompound = _showOverlay && !_spectralHit.compoundId.isEmpty();
bool isDrawGraph = (scan || isDrawCompound);
bool isDrawCompoundOnly = !scan && isDrawCompound;
bool isMissingMs2s = !_currentFragment && scan && !scan->sample && scan->scannum == 0 && scan->mz.empty() && this->_msLevel == 2;

if (!isDrawGraph) return;

Expand Down Expand Up @@ -915,6 +916,29 @@ void SpectraWidget::drawGraph() {
}

addAxes();

if (isMissingMs2s) {

QFont font = QApplication::font();

int pxSize = scene()->height()*0.03;
if ( pxSize < 14 ) pxSize = 14;
if ( pxSize > 20 ) pxSize = 20;

//Issue 730: user override font size
int savedFontSize = mainwindow->getSettings()->value("spnEICTitleTextSize", -1).toInt();
if (savedFontSize > 0) {
pxSize = savedFontSize;
}

font.setPixelSize(pxSize);

QGraphicsTextItem* text = scene()->addText("NO MS2 SCANS", font);
int textWith = text->boundingRect().width();
text->setPos(scene()->width()/2-textWith/2, 0.1*scene()->height());

_items.push_back(text);
}
}

void SpectraWidget::findBounds(bool checkX, bool checkY) {
Expand Down

0 comments on commit dd8fa75

Please sign in to comment.