##// END OF EJS Templates
QLop dataBase started, WIP.
QLop dataBase started, WIP.

File last commit:

r7:6e23aedd1ca8 default
r12:ae7af17c2621 default
Show More
mainwindow.cpp
146 lines | 4.3 KiB | text/x-c | CppLexer
First init
r0 /*------------------------------------------------------------------------------
-- This file is a part of the QLop Software
-- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-------------------------------------------------------------------------------*/
/*-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@member.fsf.org
----------------------------------------------------------------------------*/
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFileDialog>
#include <QDir>
#include "qcustomplot.h"
#include <omp.h>
A lot of cleaning.
r4 #include <QAction>
#include <downloadhistory.h>
#include <QDateTime>
#include <QDate>
#include <filedownloader.h>
Added Python Console and some Wrappers....
r5 #include <cassinitools.h>
#include <qlopplots.h>
A lot of cleaning.
r4
Added Python Console and some Wrappers....
r5 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
<<FileDownloader::self()
<<CassiniTools::self()
<< QLopPlots::self();
First init
r0
MainWindow::MainWindow(int OMP_THREADS, QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
this->OMP_THREADS = OMP_THREADS;
ui->setupUi(this);
A lot of refactoring:...
r6 // QLopPlots::getPlot()->setXaxisTickLabelType(QCPAxis::ltDateTime);
// QLopPlots::getPlot()->setXaxisDateTimeFormat("hh:mm:ss.zzz");
First init
r0 this->progressWidget = new QWidget();
this->progressLayout = new QVBoxLayout(this->progressWidget);
this->progressWidget->setLayout(this->progressLayout);
this->progressWidget->setWindowModality(Qt::WindowModal);
Drag and drop implemented, improved plot interactions.
r1 progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
First init
r0 for(int i=0;i<OMP_THREADS;i++)
{
this->progress.append(new QProgressBar(this->progressWidget));
this->progress.last()->setMinimum(0);
this->progress.last()->setMaximum(100);
Added Python Console and some Wrappers....
r5 // connect(&this->fileReader,SIGNAL(updateProgress(int,int)),this,SLOT(updateProgress(int,int)));
First init
r0 this->progressLayout->addWidget(this->progress.last());
this->progressWidget->hide();
Drag and drop implemented, improved plot interactions.
r1 this->progressThreadIds[i] = -1;
First init
r0 }
this->progressWidget->setWindowTitle("Loading File");
Added Python Console and some Wrappers....
r5 for(int i=0;i<ServicesToLoad.count();i++)
{
qDebug()<<ServicesToLoad.at(i)->serviceName();
QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
}
First init
r0 }
MainWindow::~MainWindow()
{
delete ui;
}
Removed hack from QCustomPlot, moved to QCustomPlotVect class.
r7 //QString MainWindow::getFilePath(const QString &name)
//{
//// for(int i=0;i<this->folderViews.count();i++)
//// {
//// if(folderViews.at(i)->isDraging(name))
//// return folderViews.at(i)->currentFolder();
//// }
// return "";
//}
Drag and drop implemented, improved plot interactions.
r1
First init
r0
Changed QCustomPlot data from QMap to QVector....
r3
First init
r0
void MainWindow::updateProgress(int threadId, int percentProgress)
{
Drag and drop implemented, improved plot interactions.
r1 bool updated=false;
for(int i=0;i<OMP_THREADS;i++)
{
if(progressThreadIds[i]==threadId)
{
added zoom box.
r2 if(threadId<this->progress.count())
{
A lot of cleaning.
r4 this->progress.at(i)->setValue(percentProgress);
added zoom box.
r2 updated=true;
}
Drag and drop implemented, improved plot interactions.
r1 }
}
if(Q_UNLIKELY(updated==false))
{
for(int i=0;i<OMP_THREADS;i++)
{
if(progressThreadIds[i]==-1)
{
progressThreadIds[i] = threadId;
updateProgress(threadId,percentProgress);
A lot of cleaning.
r4 return;
Drag and drop implemented, improved plot interactions.
r1 }
}
}
First init
r0 }
Drag and drop implemented, improved plot interactions.
r1 void MainWindow::askGlobalRescan()
{
Added Python Console and some Wrappers....
r5 // for(int i=0;i<this->folderViews.count();i++)
// {
// this->folderViews.at(i)->refreshFolder();
// }
A lot of cleaning.
r4 }
void MainWindow::showThemisIndexViewer()
{
Added Python Console and some Wrappers....
r5
Drag and drop implemented, improved plot interactions.
r1 }
First init
r0 void MainWindow::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}