53 #include <QGridLayout>
54 #include <QHeaderView>
57 #include <QSvgGenerator>
60 #include <QMouseEvent>
62 #if !defined(NO_QOPENGLWIDGET)
63 #include <QOpenGLWidget>
70 using namespace DISPLIB;
71 using namespace FIFFLIB;
72 using namespace Eigen;
73 using namespace RTPROCESSINGLIB;
84 , m_fSamplingRate(1024)
86 , m_bHideBadChannels(false)
87 , m_iDistanceTimeSpacer(1)
93 #if !defined(NO_QOPENGLWIDGET)
102 QVBoxLayout *neLayout =
new QVBoxLayout(
this);
104 neLayout->setContentsMargins(0,0,0,0);
105 this->setLayout(neLayout);
121 #if !defined(NO_QOPENGLWIDGET)
149 connect(
this, &RtFiffRawView::addSampleAsEvent,
154 for(
int i = 0; i<
m_pModel->rowCount(); i++) {
170 m_pTableView->setContextMenuPolicy(Qt::CustomContextMenu);
172 connect(
m_pTableView.data(), &QTableView::doubleClicked,
175 connect(
m_pTableView.data(), &QTableView::customContextMenuRequested,
179 m_pTableView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
181 m_pTableView->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
188 m_pTableView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
190 connect(
m_pTableView->verticalScrollBar(), &QScrollBar::valueChanged,
198 if(!data.isEmpty()) {
203 for(
int i = 0; i<
m_pModel->rowCount(); i++) {
219 qWarning() <<
"[RtFiffRawView::addData] Received data list is empty.";
240 return QWidget::eventFilter(
object, event);
332 for(
int i = 0; i<
m_pModel->rowCount(); i++) {
333 QString channel =
m_pModel->data(
m_pModel->index(i, 0), Qt::DisplayRole).toString();
390 if(fileName.contains(
".svg", Qt::CaseInsensitive)) {
392 QSvgGenerator svgGen;
393 svgGen.setFileName(fileName);
400 if(fileName.contains(
".png", Qt::CaseInsensitive)) {
402 pixMap.save(fileName);
424 m_pModel->updateSpharaActivation(state);
431 m_pModel->updateSpharaOptions(sSytemType, nBaseFctsFirst, nBaseFctsSecond);
452 m_pModel->setFilterChannelType(channelType);
459 const QString &triggerCh,
462 m_pModel->triggerInfoChanged(colorMap, active, triggerCh, threshold);
470 m_pModel->distanceTimeSpacerChanged(value);
495 QSettings settings(
"MNECPP");
506 QSettings settings(
"MNECPP");
514 case GuiMode::Clinical:
526 case ProcessingMode::Offline:
537 m_iClickPosX = pos.x();
543 QModelIndexList selected =
m_pTableView->selectionModel()->selectedIndexes();
546 QMenu *menu =
new QMenu(
this);
548 menu->addSection(
"Events");
550 QAction* addEventMarker = menu->addAction(tr(
"Add event"));
551 connect(addEventMarker, &QAction::triggered,
556 menu->addSection(
"Channel Marking");
559 QAction* doMarkChBad = menu->addAction(tr(
"Mark as bad"));
560 connect(doMarkChBad, &QAction::triggered,
563 QAction* doMarkChGood = menu->addAction(tr(
"Mark as good"));
564 connect(doMarkChGood, &QAction::triggered,
570 for(qint32 i = 0; i < selected.size(); ++i)
571 if(selected[i].column() == 1)
574 menu->addSection(
"Selection");
576 QAction* doSelection = menu->addAction(tr(
"Only show selection"));
577 connect(doSelection, &QAction::triggered,
581 QAction*
hideSelection = menu->addAction(tr(
"Hide selection"));
586 QAction* resetAppliedSelection = menu->addAction(tr(
"Reset selection"));
587 connect(resetAppliedSelection, &QAction::triggered,
589 connect(resetAppliedSelection, &QAction::triggered,
593 menu->popup(
m_pTableView->viewport()->mapToGlobal(pos));
601 for(
int i = 0; i<
m_pModel->rowCount(); i++) {
633 for(qint32 i = 0; i <
m_pFiffInfo->chs.size(); ++i) {
684 QModelIndexList selected =
m_pTableView->selectionModel()->selectedIndexes();
686 for(
int i=0; i<selected.size(); i++) {
688 m_pModel->markChBad(selected[i],
false);
692 m_pModel->markChBad(selected[i],
true);
723 double dDx =
static_cast<double>(
m_pTableView->columnWidth(1)) /
static_cast<double>(
m_pModel->getMaxSamples());
724 double dSample =
static_cast<double>(m_iClickPosX) / dDx;
726 int iFirstSampleOffset =
m_pModel->getFirstSampleOffset();
729 if (dSample >
m_pModel->getCurrentSampleIndex() && iFirstSampleOffset == 0){
734 int iAbsoluteSample =
static_cast<int>(dSample) + iFirstSampleOffset;
737 if (dSample >
m_pModel->getCurrentSampleIndex()){
738 iAbsoluteSample -=
m_pModel->getMaxSamples();
741 qDebug() <<
"EVENT SAMPLE:" << iAbsoluteSample;
743 emit addSampleAsEvent(iAbsoluteSample);