1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
#include <string>
#include <fstream>
#include <qwt_plot_curve.h>
#include <QColorDialog>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
using namespace std;
//CONSTRUCTEUR
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
//DESTRUCTEUR
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
execl("/home/jopc/Acquisition","Acquisition",temps_integration,NULL);
//lecture du tube :
double tmp2=0;
cout << "essai3" <<endl;
int fd2;
FILE *fp2;
cout << "essai4" <<endl;
char *nomfich2="/home/jo-pc/Bureau/test2.txt", chaine2[50];
cout << "essai5" <<endl;
fd2 = open(nomfich2, O_RDONLY); /* ouverture du tube */
cout << "essai6" <<endl;
fp2=fdopen(fd2, "r"); /* ouverture du flot */
cout << "essai7" <<endl;
fscanf(fp2, "%s", chaine2); /* lecture dans le flot */
cout << "essai8" <<endl;
//tmp2 = strtod (chaine2,NULL);
cout << "essai9" <<endl;
cout << chaine2 << endl;
cout << "essai10" <<endl;
//printf("%lf\n",tmp2); /* affichage */
unlink(nomfich2); /* fermeture du flot */
cout << "essai11" <<endl;
} |
Partager