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