Map Matching
filtering.cpp
Go to the documentation of this file.
1 #include "filtering.h"
2 
4 {
5  nbPtTrack();
6  temporal();
7  spatial();
8 
9  // CrĂ©ation d'un widget qui servira de fenĂȘtre
10  setFixedSize(500, 400);
11 
12  QVBoxLayout* mainLayout = new QVBoxLayout;
13  mainLayout->addWidget(m_nbPtTrack);
14  mainLayout->addWidget(m_temp);
15  mainLayout->addWidget(m_spat);
16  setLayout(mainLayout);
17 
18  nextOk = 0;
19  m_filtreSpat = 0.00;
20  m_filtreTemp = 0;
21 }
22 
24 {
25 }
26 
28 {
29  m_temp = new QGroupBox("Filtrage temporel (en sec)");
30 
31  m_valueTemp = new QLCDNumber();
32  m_valueTemp->setSegmentStyle(QLCDNumber::Flat);
33 
34  m_slidTemp = new QSlider(Qt::Horizontal);
35  m_slidTemp->setRange(0, 90);
36 
37  m_boutonTemp = new QPushButton("Ok");
38  m_boutonTemp->setCheckable(true);
39 
40  QObject::connect(m_slidTemp, SIGNAL(valueChanged(int)), m_valueTemp, SLOT(display(int)));
41  //QObject::connect(m_slidTemp, SIGNAL(valueChanged(int)), this, SLOT(launchFiltreTemp(int)));
42  QObject::connect(m_boutonTemp, SIGNAL(clicked()), this, SLOT(launchFiltre()));
43 
44  QHBoxLayout* vbox = new QHBoxLayout;
45  vbox->addWidget(m_valueTemp);
46  vbox->addWidget(m_slidTemp);
47  vbox->addWidget(m_boutonTemp);
48  m_temp->setLayout(vbox);
49 }
50 
52 {
53  m_spat = new QGroupBox("Filtrage spatial (en centimetre)");
54 
55  m_valueSpat = new QLCDNumber();
56  m_valueSpat->setSegmentStyle(QLCDNumber::Flat);
57 
58  m_slidSpat = new QSlider(Qt::Horizontal);
59  m_slidSpat->setRange(0, 1000);
60 
61  m_boutonSpat = new QPushButton("Ok");
62  m_boutonSpat->setCheckable(true);
63 
64  QObject::connect(m_slidSpat, SIGNAL(valueChanged(int)), m_valueSpat, SLOT(display(int)));
65  //QObject::connect(m_slidSpat, SIGNAL(valueChanged(int)), this, SLOT(launchFiltreSpat(int)));
66  QObject::connect(m_boutonSpat, SIGNAL(clicked()), this, SLOT(launchFiltre()));
67 
68  QHBoxLayout* vbox = new QHBoxLayout;
69  vbox->addWidget(m_valueSpat);
70  vbox->addWidget(m_slidSpat);
71  vbox->addWidget(m_boutonSpat);
72  m_spat->setLayout(vbox);
73 }
74 
76 {
77  m_nbPtTrack = new QLabel();
78 }
79 
81 {
82  QString file = fileT.filePath.at(0) + fileT.fileName.at(0) + "." + fileT.fileExtension.at(0);
83  Track trace;
84  trace.readFromCSV(file);
85  m_ptTrack = trace.getPoints().size();
86 
87  m_nbPtTrack->setText((QString("Your track had ") + QString::number(m_ptTrack)) + " GPS points.");
88 }
89 
91 {
92  nextOk += 1;
93  if (m_boutonSpat->isChecked()) {
94  m_filtreSpat = double(m_slidSpat->value()) / 100;
95  m_slidSpat->setEnabled(false);
96  }
97  if (m_boutonTemp->isChecked()) {
98  m_filtreTemp = m_slidTemp->value();
99  m_slidTemp->setEnabled(false);
100  }
101  if (nextOk >= 2) {
103  }
104 }
QLCDNumber * m_valueSpat
Definition: filtering.h:65
void spatial()
spatial
Definition: filtering.cpp:51
QStringList fileName
Definition: file.h:54
The File class.
Definition: file.h:13
int nextOk
Definition: filtering.h:73
void ready(double m_filtreSpat, int m_filtreTemp)
ready
void temporal()
temporal
Definition: filtering.cpp:27
void readFromCSV(QString filename)
Reads a csv file and inserts each point in m_points vector.
Definition: track.cpp:36
QLabel * m_nbPtTrack
Definition: filtering.h:66
std::vector< PointGPS * > getPoints()
getPoints Get the m_points vector
Definition: track.cpp:226
QStringList filePath
Definition: file.h:53
void getInfo(File fileT)
getInfo
Definition: filtering.cpp:80
QSlider * m_slidTemp
Definition: filtering.h:62
QStringList fileExtension
Definition: file.h:55
QGroupBox * m_temp
Definition: filtering.h:57
double m_filtreSpat
Definition: filtering.h:70
void launchFiltre()
launchFiltre
Definition: filtering.cpp:90
The Track class.
Definition: track.h:26
QPushButton * m_boutonTemp
Definition: filtering.h:59
QSlider * m_slidSpat
Definition: filtering.h:64
int m_ptTrack
Definition: filtering.h:68
int m_filtreTemp
Definition: filtering.h:71
void nbPtTrack()
nbPtTrack
Definition: filtering.cpp:75
QLCDNumber * m_valueTemp
Definition: filtering.h:63
QPushButton * m_boutonSpat
Definition: filtering.h:60
QGroupBox * m_spat
Definition: filtering.h:56