Skip to content

Commit

Permalink
fnozdk
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLortex committed Aug 27, 2014
1 parent 11cdaca commit d73a2b8
Show file tree
Hide file tree
Showing 15 changed files with 1,051 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ChronoReader
32 changes: 29 additions & 3 deletions FenPrincipale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ FenPrincipale::FenPrincipale(Serial* _com) {
connect(myDecoder,SIGNAL(newValue(int,int,double)), sensormgr, SLOT(newValue(int,int,double)));
connect(myDecoder,SIGNAL(message(QString)),this,SLOT(log_decoder(QString)));
connect(myDecoder,SIGNAL(trame_erreur(int)),this, SLOT(incrementStatTramesEchouees(int)));
connect(myDecoder,SIGNAL(trame_increment(int)),this,SLOT(incrementStatTramesRecues(int)));
connect(myDecoder,SIGNAL(trame_corrigee(int)),this,SLOT(incrementStatTramesCorrigees(int)));
log_logger("[INFO] All started !");
// -----------------------------
// Prise en charge du port série
Expand Down Expand Up @@ -168,6 +170,7 @@ FenPrincipale::FenPrincipale(Serial* _com) {
nTramesRecues = 0;
nTramesEchouees = 0;
nBytesRecus = 0;
nTramesCorrigees = 0;
QTimer* teemo = new QTimer();
connect(teemo, SIGNAL(timeout()), stmgr, SLOT(render()));
teemo->setSingleShot(true);
Expand Down Expand Up @@ -236,9 +239,8 @@ void FenPrincipale::syncTime() {
* Gestion des données
*/
void FenPrincipale::informationsReceived(QList<QByteArray> trames) {
incrementStatTramesRecues(trames.size());

if(trames.size() > 0) {

for(int i=0;i<trames.size();i++) {
myDecoder->decodeString(trames[i]);
}
Expand Down Expand Up @@ -350,7 +352,10 @@ void FenPrincipale::incrementStatTramesEchouees(int n) {
nTramesEchouees += n;
stats_trames_echouees->setText("Trames échouées: "+QString::number(nTramesEchouees));
}

void FenPrincipale::incrementStatTramesCorrigees(int n) {
nTramesCorrigees += n;
stats_trames_corrigees->setText("Trames corrigées: "+QString::number(nTramesCorrigees));
}

/*
* Gestion des actions du menu supérieur (tout comme le jambon)
Expand Down Expand Up @@ -405,6 +410,26 @@ void FenPrincipale::on_action9600_triggered() {com->setBaudrate(9600);}
void FenPrincipale::on_action137050_triggered() {com->setChannel(21);}
void FenPrincipale::on_action137500_triggered(){ com->setChannel(30);}

void FenPrincipale::on_actionEntrer_le_canal_manuellement_triggered()
{
QStringList canaux;
for(int i=0;i<=30;i++) {
canaux.append(QString::number(136.000 + 0.050*i, 'f', 3) + " MHz");
}
QString item = QInputDialog::getItem(this,"Choisir le canal","", canaux, 21, false);

int index = canaux.indexOf(item);
com->setChannel(index);

action137050->setChecked(false);
action137500->setChecked(false);

if(index == 21)
action137050->setChecked(true);
else if(index == 30)
action137500->setChecked(true);
}

/*
* Gestion des boutons du menu de gauche
*/
Expand Down Expand Up @@ -869,3 +894,4 @@ void FenPrincipale::on_actionPasser_l_tape_pr_c_dente_triggered()
{
stmgr->goToPreviousStage();
}

5 changes: 4 additions & 1 deletion FenPrincipale.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <QPair>
#include <QMdiSubWindow>
#include <QMessageBox>
#include <QInputDialog>

#include "ui_FenPrincipale.h"
#include "InPut/sensormanager.h"
Expand Down Expand Up @@ -106,6 +107,7 @@ class FenPrincipale : public QMainWindow, public Ui::FenPrincipale

int nTramesRecues;
int nTramesEchouees;
int nTramesCorrigees;
int nBytesRecus;
StagesManager* stmgr;

Expand Down Expand Up @@ -134,7 +136,7 @@ class FenPrincipale : public QMainWindow, public Ui::FenPrincipale
void incrementStatBytesRecus(int n);
void incrementStatTramesRecues(int n);
void incrementStatTramesEchouees(int n);

void incrementStatTramesCorrigees(int n);


// Slots de type event sur ui
Expand Down Expand Up @@ -178,6 +180,7 @@ private slots:
void on_actionPasser_l_tape_suivante_triggered();
void on_actionRemettre_z_ro_triggered();
void on_actionPasser_l_tape_pr_c_dente_triggered();
void on_actionEntrer_le_canal_manuellement_triggered();
};

#endif // FENPRINCIPALE_H
Expand Down
13 changes: 13 additions & 0 deletions FenPrincipale.ui
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,13 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="stats_trames_corrigees">
<property name="text">
<string>Trames corrigées: 0</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -624,6 +631,7 @@
</property>
<addaction name="action137050"/>
<addaction name="action137500"/>
<addaction name="actionEntrer_le_canal_manuellement"/>
</widget>
<addaction name="actionOuvrir"/>
<addaction name="menuFrequence"/>
Expand Down Expand Up @@ -746,6 +754,11 @@
<string>Passer à l'étape précédente</string>
</property>
</action>
<action name="actionEntrer_le_canal_manuellement">
<property name="text">
<string>Canal manuel</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down
Loading

0 comments on commit d73a2b8

Please sign in to comment.