[658] | 1 | // Utilisation des flots d'entree-sortie C++
|
---|
| 2 | #include <iostream.h>
|
---|
| 3 |
|
---|
| 4 | #include <math.h>
|
---|
| 5 | #include "nbmath.h"
|
---|
| 6 | // Utilisation de la classe Scan
|
---|
| 7 | #include "outilsinit.h"
|
---|
| 8 | #include "scan.h"
|
---|
| 9 | #include "ppersist.h"
|
---|
| 10 | int main()
|
---|
| 11 | {
|
---|
| 12 | // ----- ATTENTION -------
|
---|
| 13 | // Initialisation de Peida
|
---|
| 14 | // A faire au debut de main()
|
---|
| 15 | PeidaInit();
|
---|
| 16 | int nbpix;
|
---|
| 17 | float teta,phi;
|
---|
| 18 | float Ouv,d_tet,Omega[3],fech,T,T0,phi0;
|
---|
| 19 |
|
---|
| 20 | // provisoire : recupere (teta,phi) position du satellite (en degres)
|
---|
| 21 | teta= 0.;
|
---|
| 22 | phi = 0.;
|
---|
| 23 |
|
---|
| 24 | // Ouverture
|
---|
| 25 | Ouv= 90.*(float)Pi/180.;
|
---|
| 26 | // Direction de l'axe de rotation du satellite
|
---|
| 27 | Omega[0]= teta*(float)Pi/180.;
|
---|
| 28 | Omega[1]= phi*(float)Pi/180.;
|
---|
| 29 | // Vitesse de rotation
|
---|
| 30 | Omega[2]= (float)Pi;
|
---|
| 31 | // Frequence
|
---|
| 32 | fech= 30.;
|
---|
| 33 | // Temps max
|
---|
| 34 | T= 2.;
|
---|
| 35 | // Temps initial
|
---|
| 36 | T0= 0.;
|
---|
| 37 | // Offset
|
---|
| 38 | phi0= 0.;
|
---|
| 39 | int npas=15;
|
---|
| 40 | d_tet= (float)Pi*0.5/npas;
|
---|
| 41 | Scan equ(Ouv,Omega,fech,T,T0,phi0);
|
---|
| 42 | nbpix= equ.NbPoints();
|
---|
| 43 | cout << " nb pixels " << nbpix << endl;
|
---|
| 44 | for( int j=0; j<nbpix; j++ ) {
|
---|
| 45 | equ(j)= 100.*(j+1)/npas;
|
---|
| 46 | }
|
---|
| 47 | DVList dvl;
|
---|
| 48 |
|
---|
| 49 | equ.Info()["Temp"]=33.;
|
---|
| 50 | equ.Info()["Texte"]="bla bla bla";
|
---|
| 51 | cout << " scan initial " << endl;
|
---|
| 52 | for( int j=0; j<10; j++ ) {
|
---|
| 53 | cout << " pix no " << j << " val= " << equ(j) << endl;;
|
---|
| 54 | }
|
---|
| 55 | string sfile("scan.out");
|
---|
| 56 | Scan equ2;
|
---|
| 57 | {
|
---|
| 58 | FIO_Scan fsc(equ);
|
---|
| 59 | fsc.Write(sfile);
|
---|
| 60 | FIO_Scan gsc(sfile);
|
---|
| 61 | equ2=(Scan)gsc;
|
---|
| 62 | }
|
---|
| 63 | cout << " scan relu " << endl;
|
---|
| 64 | for( int j=0; j<10; j++ )
|
---|
| 65 | {
|
---|
| 66 | cout << " pix no " << j << " val= " << equ2(j) << endl;
|
---|
| 67 | }
|
---|
| 68 | cout << " fin test persistance scan" << endl;
|
---|
| 69 | }
|
---|