55 #include <QVBoxLayout>
56 #include <QGraphicsView>
57 #include <QSvgGenerator>
59 #include <QGraphicsItem>
61 #if !defined(NO_QOPENGLWIDGET)
62 #include <QOpenGLWidget>
69 using namespace DISPLIB;
70 using namespace FIFFLIB;
80 , m_qMapAverageColor(QSharedPointer<QMap<QString, QColor> >::create())
81 , m_qMapAverageActivation(QSharedPointer<QMap<QString, bool> >::create())
84 this->setWindowTitle(
"Average Layout");
88 #if !defined(NO_QOPENGLWIDGET)
101 QVBoxLayout *neLayout =
new QVBoxLayout(
this);
102 neLayout->setContentsMargins(0,0,0,0);
104 this->setLayout(neLayout);
119 #if !defined(NO_QOPENGLWIDGET)
137 if (pEvokedSetModel){
138 connect(pEvokedSetModel.data(), &EvokedSetModel::dataChanged,
150 qDebug() <<
"AverageLayoutView::setBackgroundColor - m_pAverageScene is NULL. Returning. ";
155 backgroundBrush.setColor(backgroundColor);
164 qDebug() <<
"AverageLayoutView::getBackgroundColor - m_pAverageScene is NULL. Returning. ";
176 qDebug() <<
"AverageLayoutView::takeScreenshot - m_pAverageScene is NULL. Returning. ";
180 if(fileName.contains(
".svg", Qt::CaseInsensitive))
183 QSvgGenerator svgGen;
184 svgGen.setFileName(fileName);
186 svgGen.setSize(QSize(rect.width(), rect.height()));
188 QPainter painter(&svgGen);
192 if(fileName.contains(
".png", Qt::CaseInsensitive))
195 QPixmap pixMap = QWidget::grab(rect);
196 pixMap.save(fileName);
205 qDebug() <<
"AverageLayoutView::setScaleMap - m_pAverageScene is NULL. Returning. ";
235 qDebug() <<
"AverageLayoutView::setAverageColor - m_pAverageScene is NULL. Returning. ";
260 qDebug() <<
"AverageLayoutView::setAverageActivation - m_pAverageScene is NULL. Returning. ";
273 qDebug() <<
"AverageLayoutView::channelSelectionManagerChanged - m_pAverageScene is NULL. Returning. ";
289 qDebug() <<
"AverageLayoutView::channelSelectionManagerChanged - m_pAverageScene is NULL. Returning. ";
308 QList<QGraphicsItem *> currentAverageSceneItems =
m_pAverageScene->items();
311 for(
int i = 0; i < currentAverageSceneItems.size(); i++) {
318 QList<QPair<QString, DISPLIB::RowVectorPair> > averageData =
m_pEvokedSetModel->data(0, 2, EvokedSetModelRoles::GetAverageData).value<QList<QPair<QString, DISPLIB::RowVectorPair> > >();
323 if(channelNumber != -1) {
328 if(!averageData.isEmpty()) {
344 qDebug() <<
"AverageLayoutView::updateData - m_pAverageScene, m_pEvokedSetModel or m_pChannelInfoModel are NULL. Returning. ";
348 QList<QGraphicsItem *> currentAverageSceneItems =
m_pAverageScene->items();
351 for(
int i = 0; i < currentAverageSceneItems.size(); i++) {
357 QList<QPair<QString, DISPLIB::RowVectorPair> > averageData =
m_pEvokedSetModel->data(0, 2, EvokedSetModelRoles::GetAverageData).value<QList<QPair<QString, DISPLIB::RowVectorPair> > >();
362 if(channelNumber != -1) {
369 if(!averageData.isEmpty()) {
391 QSettings settings(
"MNECPP");
402 QSettings settings(
"MNECPP");
410 case GuiMode::Clinical:
422 case ProcessingMode::Offline: