Changeset 649 in Sophya for trunk/Poubelle


Ignore:
Timestamp:
Nov 25, 1999, 2:56:34 PM (26 years ago)
Author:
ansari
Message:

archediab 28 vol

Location:
trunk/Poubelle/archediab.old
Files:
19 added
1 deleted
39 edited

Legend:

Unmodified
Added
Removed
  • trunk/Poubelle/archediab.old/archediab.sources/c/acqui_util.c

    r643 r649  
    189189void    reset_epld(void)
    190190{
     191char mot_tc[10];       
    191192printf("reset epld");
    192 /*
    193 if(gg->flag_tc_reduite)
    194         {
    195         int i;
    196         for(i=0;i<15;i++)       emission_tc_reduite(tc2_reset_epld,i,0);
    197         }
    198 else
    199 */
    200         {
    201         char mot_tc[10];       
    202         emission_telecommande(tc_dir_reset_epld,mot_tc);
    203         }
     193emission_tc_reduite(tc2_reset,tc3_reset,tc4_reset);
     194emission_telecommande(tc_dir_reset_epld,mot_tc);
     195
     196}
     197
     198void    reset_trp(void)
     199{
     200char mot_tc[10];       
     201printf("reset trp");
     202emission_tc_reduite(tc2_reset,tc3_reset,tc4_reset);
     203emission_telecommande(tc_dir_reset_trp,mot_tc);
    204204}
    205205
  • trunk/Poubelle/archediab.old/archediab.sources/c/acquisition_archeops.c

    r643 r649  
    4242                                        // de la lecture du block bolo
    4343
     44block_type_gyro blk_gyro2;      // block memoire pour les gyros qui seront traitées lors
     45                                                        // de la lecture du block bolo
     46
    4447
    4548
     
    4851void lit_block_archeops(int err)
    4952{
    50 if(verifie_block_printf(blk_tm))        return;
    51 
    52         {
    53         def_nom_block
    54         static int mon_num_block;
     53static char ss[1000];
     54def_nom_block
     55static int mon_num_block;
     56
     57if(!fenetre(fenetre_lecture_blocks)) nouveauT(fenetre_lecture_blocks,0,"lecture blocs");
     58
     59if(verifie_block_printf(blk_tm))       
     60                {
     61                if((mon_num_block+1)==numero_block(blk_tm))
     62                        {
     63                        mon_num_block=numero_block(blk_tm);
     64                        if(!fenetre(fenetre_lecture_blocks)) nouveauT(fenetre_lecture_blocks,0,"lecture blocs");
     65                        ecritT(fenetre_lecture_blocks,fin_f,"%s\n",ss);
     66                        sprintf(ss,"%d ->",mon_num_block);
     67                        }
     68                if(strlen(ss)<500) sprintf(ss+strlen(ss)," **%s ",nom_block[type_block(blk_tm)]);       
     69                ecrit_fichier_ARCH(blk_tm);     // ecrit les fichiers en erreur sur le disque     
     70                return;
     71                }
     72
     73        {
    5574        if(mon_num_block!=numero_block(blk_tm))
    5675                {
    5776                mon_num_block=numero_block(blk_tm);
    58                 printf("\n%d ->",mon_num_block);
    59                 }
    60         printf(" %s  ",nom_block[type_block(blk_tm)]); 
     77                if(!fenetre(fenetre_lecture_blocks)) nouveauT(fenetre_lecture_blocks,0,"lecture blocs");
     78                ecritT(fenetre_lecture_blocks,fin_f,"%s\n",ss);
     79                sprintf(ss,"%d ->",mon_num_block);
     80                }
     81        if(strlen(ss)<500) sprintf(ss+strlen(ss)," %s  ",nom_block[type_block(blk_tm)]);       
    6182        }                               
    6283
     
    7899        case block_bolo_comprime :      traite_block_bolo_comprime((block_type_bolo_comprime*)blk_tm);  break; 
    79100       
    80         case block_sst :                traite_block_sst((block_type_sst*)blk_tm);                      break;
    81         case block_sst_comprime  :      traite_block_sst_comprime((block_type_sst_comprime*)blk_tm);    break;
     101        case block_sst :                traite_block_sst((block_type_sst*)blk_tm);                     
     102                                        traite_block_sst_brut((block_type_sst*)blk_tm);                 break;
     103        case block_sst_comprime  :      traite_block_sst_comprime((block_type_sst_comprime*)blk_tm);
     104                                        traite_block_sst_comprime_brut((block_type_sst_comprime*)blk_tm);break;
    82105
    83106        case block_gyro :               traite_block_gyro((block_type_gyro*)blk_tm);                    break;
     
    86109        case block_synchro_sol :        traite_block_synchro_sol((block_type_synchro_sol*)blk_tm);      break;
    87110       
    88         case block_status_flash :       printf("******************status flash recut  ********************* \n");son(133);                      break;
     111        case block_status_flash :       printf("****  status flash recut  ****   nblock=%x  - %d *** \n",((block_type_status_flash*)blk_tm)->status.nb_total_blocks,((block_type_status_flash*)blk_tm)->status.nb_total_blocks/256);break;
    89112       
    90113#ifdef  transmet_data_brute
     
    115138void    traite_block_journal(block_type_journal*        blk)
    116139{
     140long mothexa[5];        /* les 5 mots hexa de la telecommande  */
     141
    117142int i,code,blocknum;
    118143if(!fenetre(fenetre_journal)) nouveauT(fenetre_journal,0,"journal");
     
    124149        blocknum=numero_block(&blk->jj[i]);
    125150        if(code) break; // code vaut 1 pour vider une page de journal incomplete
    126         ecritT(fenetre_journal,fin_f,"block_num= %d   code %d   ==>  %d %d %d %d %d %d %d %d \n",
    127                 blocknum,code,
    128                 blk->jj[i].mot[0],blk->jj[i].mot[1],blk->jj[i].mot[2],blk->jj[i].mot[3],
    129                 blk->jj[i].mot[0],blk->jj[4].mot[5],blk->jj[i].mot[6],blk->jj[i].mot[7]);
    130         }
    131 }
     151        mothexa[0]=blk->jj[i].mot[5];   /* 4 bit choix de commande   */
     152        mothexa[1]=blk->jj[i].mot[6]>>2;        /* les 4 bits poid fort du code direction */
     153        mothexa[2]=((blk->jj[i].mot[6]<<2)&0xc)  + ((blk->jj[i].mot[7]>>6)&0x3);
     154        mothexa[3]=(blk->jj[i].mot[7]>>2)&0xf; 
     155        mothexa[4]=(blk->jj[i].mot[7]&0x3);
     156
     157        if(blk->jj[i].mot[0])   
     158                {
     159                ecritT(fenetre_journal,fin_f,"block_num= %d   code %d   ==>  telecommande_OK : %d %d %d  ->  %x %x %x %x %x \n",
     160                blocknum,code,blk->jj[4].mot[5],blk->jj[i].mot[6],blk->jj[i].mot[7]
     161                        ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]);
     162                }
     163        else
     164                {
     165                ecritT(fenetre_journal,fin_f,"block_num= %d   code %d   ==>  erreur telecommande : %d %d %d  ->  %x %x %x %x %x \n",
     166                blocknum,code,blk->jj[4].mot[5],blk->jj[i].mot[6],blk->jj[i].mot[7]
     167                        ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]);
     168                }
     169        }
     170}
     171
     172
     173
    132174
    133175//-----------------------------------------------------------------------------------------     
     
    176218                if(c1==13) i=80;
    177219                }
     220        }
     221}
     222
     223
     224
     225
     226
     227void    traite_block_gyro_comprime(block_type_gyro_comprime* blk)
     228{
     229int i;
     230block_type_gyro  bk_gyro;
     231block_type_gyro* blk2=& bk_gyro;
     232if(!fenetre(fenetre_gyroscope)) return;
     233//printf("***************   decompress data gyro \n");
     234for(i=0;i<3;i++)        decompress_7_2((long *)blk->gyro[i],blk2->gyro[i],nb_per_block*2);
     235blk2->code1=blk->code1;
     236blk2->code2=blk->code2;
     237traite_block_gyro(blk2);
     238}
     239
     240
     241void    traite_block_gyro(block_type_gyro* blk)
     242{
     243int k;
     244double  y[15];
     245
     246int temps_cntl;
     247double secondes;
     248blk_gyro2 = *blk;
     249
     250if(!fenetre(fenetre_gyroscope)) return;
     251
     252for(k=0;k<72;k++)
     253        {
     254        y[0]=20.*(blk->gyro[0][k]-32768)/32768.;
     255        y[1]=20.*(blk->gyro[1][k]-32768)/32768.;
     256        y[2]=20.*(blk->gyro[2][k]-32768)/32768.;
     257               
     258//      printf(" y = %g %g %g %g %g \n",y[0],y[1],y[2],y[3],y[4]);
     259        temps_cntl =numero_block(blk)*nb_per_block*2+k;
     260        secondes=gg->periode_echantillonage*(double)temps_cntl-gg->temps_origine;
     261        tracen(fenetre_gyroscope,3,secondes,y);
     262//      printf("secondes=%g\n",secondes);
    178263        }
    179264}
     
    306391                gg->don.don_bolo[j]=0.5*(ancien_don_bolo[j]+s*(((val_DS(j,i)-aa)<<1)/nb_coups));                // copy bolos
    307392                ancien_don_bolo[j]=s*(((val_DS(j,i)-aa)<<1)/nb_coups);
     393//              if( (i==1) && (j==14) )
     394//                      {
     395//                      def_gains
     396//                      printf(" brut=%d  ofset=%d  nbcoups=%d gg->don.don_bolo[j]=%d  parametr.bolo[j].bolo_gain=%d  gainampli=%g  micro-volts=%g \n"
     397//                              , val_DS(j,i)   ,aa     ,nb_coups    ,(int)gg->don.don_bolo[j]  ,parametr.bolo[j].bolo_gain   ,gain_ampli(gg->reglage.bolo[j])  ,(double)xbolbrut(j));
     398//                      }
     399//
    308400                }
    309401
     
    313405                }
    314406       
     407        gg->don.gyro[0]=20.*(blk_gyro2.gyro[0][i]-32768)/32768.;
     408        gg->don.gyro[1]=20.*(blk_gyro2.gyro[1][i]-32768)/32768.;
     409        gg->don.gyro[2]=20.*(blk_gyro2.gyro[2][i]-32768)/32768.;
     410               
     411
    315412       
    316413//      gg->don.sync[j]=synchro_DS(j,i);       
  • trunk/Poubelle/archediab.old/archediab.sources/c/acquisition_general.c

    r643 r649  
    1414#include "compress.h"
    1515#include "controle.h"
     16#include "simulmission.h"
    1617
    1718
     
    4142static int count_moy_err=0;
    4243int err;
     44static bilan_err=0;             
    4345
    4446if      (item!=tache_de_fond)           return;
     
    5658*/
    5759
    58 if( count-- < 0 )
     60//if( count-- < 0 )
    5961                {
    6062                count=3;
    61                 ecritD(fenetre_controle,con_retard1,"%d",tt->nb_lec_fofo_ext);
    62                 tt->nb_lec_fofo_ext=0;
     63                ecritD(fenetre_controle,con_fifo,tt->val_con_fifo/2);
     64                tt->val_con_fifo=0;
    6365                }
    6466
    6567
    6668err=test_erreur();  //______________   test des erreurs   _______________________________
     69
     70if(err) bilan_err+=10*err;
     71
     72// Pour la simulation, rempli les buffers avec les donnees simulees
     73
     74if (tt->PCI_actif==3) SimulMissionReadLoop();
    6775
    6876
    6977//_____________________   lit la table télémesure  ______________________________________
    7078                                       
    71 
     79if(bilan_err>100)       bilan_err=100;
     80if(bilan_err>50)        bilan_err-=20;
     81if(bilan_err>10)        bilan_err-=5;
     82if(bilan_err>0)         bilan_err--;
     83if(bilan_err)   ecritD(fenetre_controle,con_erreur,20+bilan_err*10);
     84else            ecritD(fenetre_controle,con_erreur,0);
    7285
    7386q=(longueur_table_tm+tt->tm.pos_ecrit-tt->tm.pos_lit)%longueur_table_tm;
     87
     88ecritD(fenetre_controle,con_pile,(1000*((longueur_table_tm+tt->tm.pos_ecrit-tt->tm.pos_lit)%longueur_table_tm))/longueur_table_tm);
     89ecritD(fenetre_controle,con_donnee,tt->val_con_donnee);
    7490
    7591while(q)
    7692        {
    77         ecritD(fenetre_controle,con_retard2,"%d",(longueur_table_tm+tt->tm.pos_ecrit-tt->tm.pos_lit)%longueur_table_tm);
    78 
     93        ecritD(fenetre_controle,con_pile,(1000*((longueur_table_tm+tt->tm.pos_ecrit-tt->tm.pos_lit)%longueur_table_tm))/longueur_table_tm);
     94//      printf(" pile = %d  \n",(1000*((longueur_table_tm+tt->tm.pos_ecrit-tt->tm.pos_lit)%longueur_table_tm))/longueur_table_tm);
    7995//*****************************************************************************************
    8096//                                                                                      ***
     
    109125        {
    110126        case ouverture  :       gg->flag_tc_reduite=litD(fen,e_tc_reduite,0);
    111                                 if(tt->PCI_actif==1) reset_carte;
     127                                if(acquisition_PCI) reset_carte;
    112128                                ecritD(fen,e_tache_inter,0);    // arreter les interruptions
    113129                                reset_epld();
     
    161177                                break;
    162178
    163         case e_vanne    :       {
    164                                 long ll=(long)(&(gg->reglage.dilu.vanne))-(long)(&(gg->reglage.dilu));
     179        case e_vanne    :       
     180                                        {
     181                                        long ll=(long)(&(gg->reglage.dilu.vanne))-(long)(&(gg->reglage.dilu));
    165182                                int a=(int) valeur;     
     183                                if(a==vanne_ouvre)     
     184                                        if(alerte(2,"voulez-vous vraiment ouvrir la vanne ??")!=1) break;
    166185                                emission_tc_reduite(tc2_auto_dilu,ll,a);
    167186                                }
     
    189208        case e_tache_inter :    calfreq(0);     //  command ou arrete le flag epld sortie data
    190209                                if(TTm)         stoptimer(TTm);
    191                                 if(tt->PCI_actif==1) reset_carte;
     210                                if(acquisition_PCI) reset_carte;
    192211                                tt->vi.a=0;
    193212                                if(valeur)
  • trunk/Poubelle/archediab.old/archediab.sources/c/bit_block.c

    r645 r649  
    1818 
    1919
    20 #define cadence_taux    16
     20#define cadence_taux    16      // cadence de filtrage du taux d'occupation de telemetrie
    2121#define mode_acquisition        0x00    //0xff en mode inverse, 0x00 en mode normal
    2222unsigned long   buffer;
     
    137137                                                        //Calcul du taux de remplissage
    138138                                                        taux=taux+(((0xffff-taux)*Nplein)>>cadence_taux);
    139                                                         tt->nb_lec_fofo_ext=((taux*1000)>>cadence_taux);
     139                                                        tt->val_con_donnee=((taux*1000)>>cadence_taux);
    140140                                                        return(lit_bit_un_block);
    141141                                                                               
     
    169169                                compteur=0;
    170170                                taux=taux-((taux*Nvide)>>cadence_taux);
    171                                 tt->nb_lec_fofo_ext=((taux*1000)>>cadence_taux);
     171                                tt->val_con_donnee=((taux*1000)>>cadence_taux);
    172172                        }       
    173173                        if(buffer==debut_block_mesure)
  • trunk/Poubelle/archediab.old/archediab.sources/c/bolo.c

    r643 r649  
    2222int a,c,i;
    2323int n=gg->reglage.horloge.nb_mesures;
    24 //if(fen > 5 ) return;
    2524if(item>1000) item-=1000;               // pour appeler le case pour tous les cara d'un edit texte
    26 //controlemanip(0);
    2725//printf("execbolo avec fen=%d , item=%d \n",fen,item);
    2826switch(item)
     
    7876
    7977                                break;
    80 
     78//  avec fenetre de dialogue pour envoyer une valeur directe
     79        case b_carre    :       ouvreD(fen_change_bolo,change_bolo_id,"chgbolo",0);
     80                                if(1==modal(fen_change_bolo))
     81                                                {
     82                                                valeur=litD(fen_change_bolo,chb_val,0);
     83                                                printf("  val=%d  %n",(int)valeur);
     84                                                ecritD(fen,b_carre,(int)valeur);
     85                                                ecritgain(fen);
     86                                                }       
     87                                ferme(fen_change_bolo);
     88                                break;
     89
     90        case b_tri      :       ouvreD(fen_change_bolo,change_bolo_id,"chgbolo",0);
     91                                if(1==modal(fen_change_bolo))
     92                                                {
     93                                                valeur=litD(fen_change_bolo,chb_val,0);
     94                                                printf("  val=%d  %n",(int)valeur);
     95                                                ecritD(fen,b_tri,(int)valeur);
     96                                                ecritgain(fen);
     97                                                }       
     98                                ferme(fen_change_bolo);
     99                                break;
     100
     101        case b_trans    :       ouvreD(fen_change_bolo,change_bolo_id,"chgbolo",0);
     102                                if(1==modal(fen_change_bolo))
     103                                                {
     104                                                valeur=litD(fen_change_bolo,chb_val,0);
     105                                                printf("  val=%d  %n",(int)valeur);
     106                                                ecritD(fen,b_trans,(int)valeur);
     107                                                ecritgain(fen);
     108                                                }       
     109                                ferme(fen_change_bolo);
     110                                break;
     111
     112        case b_lin      :       ouvreD(fen_change_bolo,change_bolo_id,"chgbolo",0);
     113                                if(1==modal(fen_change_bolo))
     114                                                {
     115                                                valeur=litD(fen_change_bolo,chb_val,0);
     116                                                printf("  val=%d  %n",(int)valeur);
     117                                                ecritD(fen,b_lin,(int)valeur);
     118                                                ecritgain(fen);
     119                                                }       
     120                                ferme(fen_change_bolo);
     121                                break;
     122       
     123
     124
     125/*
    81126//  reecrit les valeurs dans la fenetre pour appel par un autre programme                                               
    82127        case b_carre    :       ecritD(fen,b_carre,(int)valeur);                ecritgain(fen);         break;
     
    84129        case b_trans    :       ecritD(fen,b_trans,(int)valeur);                ecritgain(fen);         break; 
    85130        case b_lin      :       ecritD(fen,b_lin,(int)valeur);                  ecritgain(fen);         break; 
     131
     132*/
    86133        case b_gain     :       vg[fen-1]=0;  ecritD(fen,b_gain,(int)valeur);   ecritgain(fen);         break;                                                                                         
    87134        case b_phase    :       ecritD(fen,b_phase,(int)valeur);                ecritgain(fen);         break;
  • trunk/Poubelle/archediab.old/archediab.sources/c/corel.c

    r637 r649  
    22#include "corel.h"
    33
    4 
     4/*
    55double coef_corel[nb_max_bolo][nb_max_bolo];
    66int flag_corel[nb_max_bolo];
    7 
     7*/
    88
    99
     
    3030        {
    3131        for(j=0;j<nb_max_bolo;j++)      gg->corel[j]=xbolbrut(j);
     32        for(j=0;j<3;j++)                gg->corel[nb_max_bolo+j]=gg->don.gyro[j];
     33        for(j=0;j<46;j++)               gg->corel[nb_max_bolo+3+j]=xbolbrut(j);
    3234        }
    3335       
  • trunk/Poubelle/archediab.old/archediab.sources/c/diabolo.c

    r643 r649  
    1919#include "config_transputer.h"
    2020#include "dilution.h"
     21#include "recons_sst.h"
     22#include "tm.h"
    2123
     24void InitSimulMission(void);
    2225
    2326stglob* gg;                     // pointeur global  sur la structure
     
    4447//flag=2;       // en mode simulation
    4548if(clavier(touche_alt) ) flag=2; else flag=1;           // en mode acquisition
     49if(clavier(touche_controle) ) flag=4;                           // avec emission des telecommandes au demarrage
     50if(clavier(touche_alt) && clavier(touche_controle) ) {
     51  flag=3;               // en mode simulateur de donnees mission
     52  InitSimulMission();
     53  }
    4654#endif
    4755
    48 //return(1);
     56
    4957
    5058init_struct(flag);
     59
     60init_recons_sst();
    5161
    5262//printf(" long_entete          = %ld \n",      sizeof(F_entete));
     
    6575
    6676nouveauM(0,diabolo_id,exec_menu_diabolo);
     77nouveauSM(0,menu_trace_tout_id,exec_menu_trace_tout);
    6778
    6879ouvreD(fenetre_acquisition,acquisition_id,"acquisition",exec_acquisition);
     
    8596#endif
    8697
     98initRS(port_A,baud1200+data8+stop10+noParity,0);       
    8799
    88100#ifdef lire_les_donnees_POM2
     
    117129
    118130
    119 if(flag==1)                                     //  mets en route les interruptions
     131if( (flag==1) ou        (flag==4) )                             //  mets en route les interruptions
    120132        {
    121133        ecritD(fenetre_acquisition,e_tache_inter,1);
     
    125137select(fenetre_controle);
    126138select(fenetre_acquisition);
     139
     140// $CHECK$ on est toujours en mode 4 avec la derniere modif AB ???
     141tt->PCI_actif=4;
     142if (flag==3) tt->PCI_actif=3;
    127143
    128144return(option_texte+option_unclick);
     
    154170void exec_controle(int fen,int item,double valeur,...)
    155171{
    156 if(item==caseferme)  {stop_exec(fen);}
     172switch(item)
     173    {
     174    case caseferme      :  stop_exec(fen);break;
     175    case con_reset_epld :       reset_epld();   break;
     176    case con_reset_trp  :       reset_trp();    break;
     177    default     :       break;
     178    }   
    157179}
    158180
  • trunk/Poubelle/archediab.old/archediab.sources/c/dilution.c

    r645 r649  
    5555// la telecommande passe a travers le transputer sans etre traitee par lui
    5656//  elle arrive directement sur l'EPLD
    57 
     57/*
    5858void  ecrit_bit_dilution(int valeur,int bit);
    5959
     
    8282emission_telecommande(tc_dir_transputer,mot_tc);
    8383}
    84 
     84*/
    8585//   fonction ecrit un  des dac dilution
    8686//  c'est une telecommande normale 64 bit  a supprimer
     
    120120
    121121switch(item)
    122     {
     122         {
     123         case dil_switch_helium :       emission_tc_reduite(tc2_dilution,(valeur==1),nbit_switch_helium);       break;
     124         case dil_EVB :         emission_tc_reduite(tc2_dilution,(valeur==1),nbit_vanne_EVB);   break;
     125         case dil_EVO :         emission_tc_reduite(tc2_dilution,(valeur==1),nbit_vanne_EVO);   break;
     126        case dil_EVF :          emission_tc_reduite(tc2_dilution,(valeur==1),nbit_vanne_EVF);   break;
     127        case dil_EVV :          emission_tc_reduite(tc2_dilution,(valeur==1),nbit_vanne_EVV);   break;
     128        case dil_sw_pp5 :               emission_tc_reduite(tc2_dilution,(valeur==1),nbit_switch_pile_par_5);   break;
     129        case dil_sw_pp15 :              emission_tc_reduite(tc2_dilution,(valeur==1),nbit_switch_pile_par_15);  break;
     130
     131  /* 
     132   
    123133    case dil_switch_helium :    ecrit_bit_dilution((int)valeur,switch_helium);  break;
    124134    case dil_EVB :              ecrit_bit_dilution((int)valeur,vanne_EVB);      break;
     
    128138    case dil_sw_pp5 :           ecrit_bit_dilution((int)valeur,switch_pile_par_5);      break;
    129139    case dil_sw_pp15 :          ecrit_bit_dilution((int)valeur,switch_pile_par_15);     break;
    130 
     140*/
    131141//  ----   commande directe d'un mot avec les 3 case de codage hexadecimales
    132142
     
    137147//  ----   telecommande du raz periodique des fets
    138148    case dil_raz_modul :
    139     case dil_fet_raz :
     149    case dil_fet_raz : 
     150                 i =0;
     151                if(litD(fen,dil_fet_raz,0)==2)  i+=1;
     152                if(litD(fen,dil_fet_raz,0)==3)  i+=7;
     153                emission_tc_reduite(tc2_raz_fet,0,i);
     154/*
    140155                {
    141156                char mot_tc[10];
     
    150165                emission_telecommande(tc_dir_transputer,mot_tc);
    151166                }
    152 
     167*/
    153168                 break;
    154169                 
    155     case dil_ch1 :              ecrit_bit_dilution((int)valeur,chauffage1);     break;
    156     case dil_ch2 :              ecrit_bit_dilution((int)valeur,chauffage2);     break;
    157     case dil_ch3 :              ecrit_bit_dilution((int)valeur,chauffage3);     break;
    158     case dil_ch4 :              ecrit_bit_dilution((int)valeur,chauffage4);     break;
    159     case dil_ch5 :              ecrit_bit_dilution((int)valeur,chauffage5);     break;
    160     case dil_ch6 :              ecrit_bit_dilution((int)valeur,chauffage6);     break;
    161     case dil_ch7 :              ecrit_bit_dilution((int)valeur,chauffage7);     break;
     170    case dil_ch1 :              emission_tc_reduite(tc2_dilution,(valeur==1),nbit_chauffage1);  break;
     171    case dil_ch2 :              emission_tc_reduite(tc2_dilution,(valeur==1),nbit_chauffage2);  break;
     172    case dil_ch3 :              emission_tc_reduite(tc2_dilution,(valeur==1),nbit_chauffage3);  break;
     173    case dil_ch4 :              emission_tc_reduite(tc2_dilution,(valeur==1),nbit_chauffage4);  break;
     174    case dil_ch5 :              emission_tc_reduite(tc2_dilution,(valeur==1),nbit_chauffage5);  break;
     175    case dil_ch6 :              emission_tc_reduite(tc2_dilution,(valeur==1),nbit_chauffage6);  break;
     176    case dil_ch7 :              emission_tc_reduite(tc2_dilution,(valeur==1),nbit_chauffage7);  break;
    162177   
    163178//    case dil_dac_1 :
     
    227242 // j=numero de bebo    T[k] = R[k+4] en Kelvin
    228243                if ((R[k]-c(j,6))>1.)
    229                         {if((log(R[k]-c(j,6))-c(j,0))>0.001) llR= log(log(R[k]-c(j,6))-c(j,0)) ; else llR=0;}
     244                        {if((log(R[k]-c(j,6))-c(j,0))>0.001) llR= log(log(R[k]-c(j,6))-c(j,0)) ; else llR=0;
     245//                      printf("\nk=%d j=%d R=%g c2=%g c3=%g llR=%g",k,j,R[k],c(j,2),c(j,3),llR);
     246                        }
    230247                else llR=0;
    231248                R[k+4]  = exp(  c(j,1) + c(j,2)* llR + c(j,3)* llR* llR + c(j,4)* llR* llR* llR + c(j,5)* llR* llR* llR* llR) ;
     
    235252        }
    236253
     254gg->temperature_cryo=R[4];     // Charge la temperature_cryo (0.1K) pour les calculs futurs avec les bolos
     255/* La germanium doit toujours etre en premier par rapport aux autres thermos absolus */
    237256
    238257if(R[0]<90.)    ecritD(fenetre_dilution,dil_temp
     
    298317
    299318
    300 ecritD(fenetre_dilution,dil_temperatures,"temp-Haut =   %4.1f°   %4.1f°   %4.1f°   %4.1f° \rtemp-Bas  =   %4.1f°   %4.1f°   %4.1f°   %4.1f°  "
    301         ,val_temperature(blk->ADC_dil[ t_h1]),val_temperature(blk->ADC_dil[ t_h2]),val_temperature(blk->ADC_dil[ t_h3]),val_temperature(blk->ADC_dil[ t_h4])
    302         ,val_temperature(blk->ADC_dil[ t_b1]),val_temperature(blk->ADC_dil[ t_b2]),val_temperature(blk->ADC_dil[ t_b3]),val_temperature(blk->ADC_dil[ t_b4])   
     319ecritD(fenetre_dilution,dil_temperatures,"temp-Haut =  %4.1f°  %4.1f° Base  =  %4.1f°  %4.1f° \r tube He: %4.1f° piles %4.1f° driver %4.1f°"
     320        ,val_temperature(blk->ADC_dil[ t_h2]),val_temperature(blk->ADC_dil[ t_h4])
     321        ,val_temperature(blk->ADC_dil[ t_b1]),val_temperature(blk->ADC_dil[ t_b2]),val_temperature(blk->ADC_dil[ t_b3])
     322        ,val_temperature(blk->ADC_dil[ t_pile]),val_temperature(blk->ADC_dil[ t_a1])
    303323        );
    304324
    305 ecritD(fenetre_dilution,dil_t_h1,cnt_temperature(t_h1));
    306 ecritD(fenetre_dilution,dil_t_h2,cnt_temperature(t_h2));
    307 ecritD(fenetre_dilution,dil_t_h3,cnt_temperature(t_h3));
    308 ecritD(fenetre_dilution,dil_t_h4,cnt_temperature(t_h4));
    309 ecritD(fenetre_dilution,dil_t_a1,cnt_temperature(t_a1));
    310 ecritD(fenetre_dilution,dil_t_a2,cnt_temperature(t_a2));
    311 ecritD(fenetre_dilution,dil_t_a3,cnt_temperature(t_a3));
    312 ecritD(fenetre_dilution,dil_t_a4,cnt_temperature(t_a4));
    313 ecritD(fenetre_dilution,dil_t_b1,cnt_temperature(t_b1));
    314 ecritD(fenetre_dilution,dil_t_b2,cnt_temperature(t_b2));
    315 ecritD(fenetre_dilution,dil_t_b3,cnt_temperature(t_b3));
    316 ecritD(fenetre_dilution,dil_t_b4,cnt_temperature(t_b4));
     325ecritD(fenetre_dilution,dil_t_h1,cnt_temperature(t_h2));
     326ecritD(fenetre_dilution,dil_t_h2,cnt_temperature(t_h4));
     327ecritD(fenetre_dilution,dil_t_h3,cnt_temperature(t_b1));
     328ecritD(fenetre_dilution,dil_t_h4,cnt_temperature(t_b2));
     329ecritD(fenetre_dilution,dil_t_a1,cnt_temperature(t_b3));
     330ecritD(fenetre_dilution,dil_t_a2,cnt_temperature(t_pile));
     331ecritD(fenetre_dilution,dil_t_a3,cnt_temperature(t_a1));
    317332
    318333
  • trunk/Poubelle/archediab.old/archediab.sources/c/gyroscope.c

    r643 r649  
    2424
    2525
    26 
    27 
    28 
    29 void    traite_block_gyro_comprime(block_type_gyro_comprime* blk)
    30 {
    31 int i;
    32 block_type_gyro  bk_gyro;
    33 block_type_gyro* blk2=& bk_gyro;
    34 if(!fenetre(fenetre_gyroscope)) return;
    35 //printf("***************   decompress data gyro \n");
    36 for(i=0;i<3;i++)        decompress_7_2((long *)blk->gyro[i],blk2->gyro[i],nb_per_block*2);
    37 blk2->code1=blk->code1;
    38 blk2->code2=blk->code2;
    39 traite_block_gyro(blk2);
    40 }
    41 
    42 
    43 void    traite_block_gyro(block_type_gyro* blk)
    44 {
    45 int k;
    46 double  y[15];
    47 
    48 int temps_cntl;
    49 double secondes;
    50 
    51 if(!fenetre(fenetre_gyroscope)) return;
    52 
    53 for(k=0;k<72;k++)
    54         {
    55         y[0]=blk->gyro[0][k];
    56         y[1]=blk->gyro[1][k];
    57         y[2]=blk->gyro[2][k];
    58                
    59 //      printf(" y = %g %g %g %g %g \n",y[0],y[1],y[2],y[3],y[4]);
    60         temps_cntl =numero_block(blk)*nb_per_block*2+k;
    61         secondes=gg->periode_echantillonage*(double)temps_cntl-gg->temps_origine;
    62         tracen(fenetre_gyroscope,3,secondes,y);
    63 //      printf("secondes=%g\n",secondes);
    64         }
    65 }
    66 
    67 
  • trunk/Poubelle/archediab.old/archediab.sources/c/menu.c

    r643 r649  
    1818#include "dilution.h"
    1919#include "senseur_stellaire.h"
     20#include "sstbrut.h"
     21#include "FindPeri.h"
     22#include "phaseSST.h"
    2023#include "gyroscope.h"
    2124
     
    2427
    2528int j,ann;
     29
     30
    2631
    2732void exec_menu_diabolo(int fen,int item,double valeur,...)
     
    7075                                                                break;
    7176
    72         case    d_senseur_stellaire             :       if(fenetre(fenetre_senseur_stellaire)) select(fenetre_senseur_stellaire);
     77        case    d_sst_brut              :       if(fenetre(fenetre_sstbrut)) select(fenetre_sstbrut);
     78                                                                else    ouvreD(fenetre_sstbrut,sstbrut_id,"senseur_stellaire",exec_sstbrut);
     79                                                                break;
     80
     81        case    d_senseur_stellaire     :       if(fenetre(fenetre_senseur_stellaire)) select(fenetre_senseur_stellaire);
    7382                                                                else    ouvreD(fenetre_senseur_stellaire,senseur_stellaire_id,"senseur_stellaire",exec_senseur_stellaire);
    74                                                                 if(fenetre(fenetre_gyroscope)) select(fenetre_gyroscope);
     83                                                                break;
     84
     85        case    d_recons_sst    :       if(fenetre(fenetre_Find_Period)) select(fenetre_Find_Period);
     86                                                                else    ouvreD(fenetre_Find_Period,FindPeri_id,"FindPeriod",exec_FindPeri);
     87                                                                if(fenetre(fenetre_Phase_SST)) select(fenetre_Phase_SST);
     88                                                                else    ouvreD(fenetre_Phase_SST,phase_id,"phase",exec_phase);
     89                                                                break;
     90
     91        case    d_gyros         :               if(fenetre(fenetre_gyroscope)) select(fenetre_gyroscope);
    7592                                                                else    ouvreD(fenetre_gyroscope,0,"fenetre_gyroscope",exec_gyroscope);
    7693                                                                break;
     94        default                                 :       break;
     95        }
     96}
    7797
    7898/*
     
    82102*/
    83103
    84 
    85 
    86 
    87 
    88 
    89 
    90         case    d_trace_carte   :       ferme_annexe();
    91                                                                 ann=1;
    92                                                                 ouvreD(fenetre_annexe   ,carte_id   ,"carte",exec_carte);               
     104void exec_menu_trace_tout  (int fen,int item,double valeur,...)
     105{
     106switch(item)
     107        {
     108case    d_trace_temperature     :       if(fenetre(fenetre_trace_tout_temperature)) select(fenetre_trace_tout_temperature);
     109                                                                else    ouvreD(fenetre_trace_tout_temperature ,trace_tout_id ,"trace temperature"       ,exec_trace_tout );
    93110                                                                break;
    94 
    95         case    d_pointage              :       ferme_annexe();
    96                                                                 ann=2;
    97                                                                 ouvreD(fenetre_annexe   ,pointage_id   ,"pointage",exec_pointage);             
     111case    d_trace_bolos   :       if(fenetre(fenetre_trace_tout_bolos)) select(fenetre_trace_tout_bolos);
     112                                                                else    ouvreD(fenetre_trace_tout_bolos ,trace_tout_id ,"trace bolos"       ,exec_trace_tout );
    98113                                                                break;
    99 
    100         case    d_foyer                 :       ferme_annexe();
    101                                                                 ann=3;
    102                                                                 ouvreD(fenetre_annexe   ,foyer_id   ,"foyer",exec_foyer);               
     114case    d_trace_gyros   :       if(fenetre(fenetre_trace_tout_gyros)) select(fenetre_trace_tout_gyros);
     115                                                                else    ouvreD(fenetre_trace_tout_gyros ,trace_tout_id ,"trace gyros"       ,exec_trace_tout );
    103116                                                                break;
    104 
    105117        default                                 :       break;
    106118        }
  • trunk/Poubelle/archediab.old/archediab.sources/c/mesures_bolo.c

    r643 r649  
    7070//                                                                                                      //
    7171//      Ptot =  coef3  *  ( (10*Tb) ** coef4    -    (10*Tcryo)  **  coef4 )                            //
    72 Tcryo=0.1;
    73 
     72/* Desormais 30/06/1999, Tcryo est calculee avec la germanium */
     73//Tcryo=0.1;
     74Tcryo= gg->temperature_cryo ;
    7475Ptot=0; if( (c(4)>0.01) && (T>0.01) )   Ptot = c(3) * ( pow(10.*T,c(4)) - pow(10.*Tcryo,c(4)) );
    7576
     
    7980//              tau     =       - ln ( 1 +  Pciel / coef6 )     coef6= I * Bi (tables xavier)           //
    8081
    81 Pciel = 0;  if( c(5)>Pelec)     Pciel = c(5) - Pelec;
    82 a=1;    if( c(6) >0.1 )         a =  1 - Pciel / c(6) ;
    83 tau=0;  if( a>0 )               tau =  - log ( a );
    84 
     82//Pciel = 0;  if( c(5)>Pelec)   Pciel = c(5) - Pelec;
     83Pciel = 0;  if( Ptot>Pelec)     Pciel = Ptot - Pelec;  /* Pour avoir la puissance de rayonnement absorbé */
     84//a=1;  if( c(6) >0.1 )         a =  1 - Pciel / c(6) ;
     85//tau=0;        if( a>0 )               tau =  - log ( a );
     86tau=Tcryo ;  /* FXD pour avoir Tcryo 16/07/99 */
    8587
    8688
     
    9294
    9395
    94 ecritT(fenetre_mesures_bolo,fin_f," R=%7.3fM‡  I=%6.3fnA  V=%7.3fmV   Pelec=%5.1fpW",R*1e-6,I*1e3,V*1e-3,Pelec);
     96ecritT(fenetre_mesures_bolo,fin_f," R=%7.3fM‡  I=%6.3fnA  V=%7.3fmV   Pelec=%6.2fpW",R*1e-6,I*1e3,V*1e-3,Pelec);
    9597
    9698if(T>0.01) ecritT(fenetre_mesures_bolo,fin_f,"  T=%6.1fmK  ", T*1e3);
    9799
    98 if( Ptot>0.1) ecritT(fenetre_mesures_bolo,fin_f," Ptot=%5.1fpW   Pciel=%5.1fpW   tau=%5.3f  ",Ptot,Pciel,tau);
     100if( Ptot>0.01) ecritT(fenetre_mesures_bolo,fin_f," Ptot=%6.2fpW   Pciel=%6.2fpW   Tcryo=%6.1f  ",Ptot,Pciel,tau*1e3);
    99101
    100102
  • trunk/Poubelle/archediab.old/archediab.sources/c/rafraichis_fenetre.c

    r643 r649  
    2222        ecritD(fenetre_acquisition,e_telemesure,1+(0x0f & (int)gg->reglage.dilu.transmission));
    2323        ecritD(fenetre_acquisition,e_flash,1+((0x30 & (int)gg->reglage.dilu.transmission)>>4));
     24        ecritD(fenetre_acquisition,e_vanne,(int)gg->reglage.dilu.vanne);
     25        ecritD(fenetre_acquisition,e_helium,(int)gg->reglage.dilu.helium);
    2426
    2527        // affichage de toutes les fréquences 
     
    6870                ecritD(fenetre_regulation,regu_int+i,gg->reglage.regul[i].integ+1);
    6971                ecritD(fenetre_regulation,regu_deriv+i,gg->reglage.regul[i].deriv+1);
    70                 ecritD(fenetre_regulation,regu_chauffage+i,gg->reglage.regul[i].chauffage);
     72                if(gg->reglage.regul[i].chauffage>0)    ecritD(fenetre_regulation,regu_chauffage+i,gg->reglage.regul[i].chauffage);
     73                        else                            ecritD(fenetre_regulation,regu_chauffage+i,-gg->reglage.regul[i].chauffage);
    7174                }
    7275
  • trunk/Poubelle/archediab.old/archediab.sources/c/senseur_stellaire.c

    r643 r649  
    11#include "diabolo.h"
    22#include "senseur_stellaire.h"
    3 
    4 
     3#include "compress.h"
     4#include "recons_sst.h"
     5#include <math.h>
     6
     7#define M_PI 3.1415926535
    58
    69//--------------------  fonction  exec  de  la  fenetre : senseur_stellaire  -------------------------------
    710
     11static int diodes[48];
     12
     13#define DIODE_UNUSED_1 3
     14#define DIODE_UNUSED_2 7
     15
     16
     17int diodesbuffer[dbufsz][48];int off[48];
     18float zfoundstars[20];
     19float mfoundstars[20];
     20double tfoundstars[20];
     21int nfoundstars;
     22int seuilSST=5;
     23
     24static void init_sst_buffers(void);
     25static void remove_diode_offset(void);
     26static void find_stars(double secondes);
     27
     28static void trace_lin(int fen, double secondes);
     29static void trace_radar(int fen, double secondes);
     30static void init_radar(void);
     31static void setup_gra(int fen);
     32static void clean_radar(float phase,int fen);
     33
     34static double radarPer = 30.; // periode du radar, en secondes.
     35static double radarTUp = 0; // le temps de reference pour pointage "NORD"
     36static int    radarSens = 1;
     37static int  sstHas2Bars = false;
     38
     39//static double tm = 0;
    840
    941void exec_senseur_stellaire(int fen,int item,double valeur,...)
    1042{
    1143if(item>1000) item-=1000;               // pour appeler le case pour tous les cara d'un edit texte
    12 
    1344switch(item)
    1445    {
    1546    case ouverture               :
    16                        
     47                                selectgra(fen);
     48                                setup_gra(fen);
     49                                init_sst_buffers();
     50                            radarPer = litD(fenetre_senseur_stellaire,sst_periode,0);
     51                            radarTUp = litD(fenetre_senseur_stellaire,sst_phase,0);
     52
    1753                 break;
    1854    case fermeture               :
    1955                 break;
    20     case sst_azer :
    21                  break;
    22     case sst_sortie_brute :
     56    case sst_txt :
     57                 break;
     58    case sst_twobars :
     59                 sstHas2Bars = litD(fenetre_senseur_stellaire,sst_twobars,0);
     60                 break;
     61    case sst_radar :
     62                 setup_gra(fen);
     63                 break;
     64    case sst_seuil : {
     65            seuilSST = litD(fenetre_senseur_stellaire,sst_seuil,0);
     66            if (seuilSST <=0) {
     67              seuilSST = 1;
     68            }
     69            }
     70            break;
     71    case sst_periode :
     72    case sst_sens_horaire:
     73    case sst_phase : {
     74            double sns = litD(fenetre_senseur_stellaire,sst_sens_horaire,0);
     75            double phs = litD(fenetre_senseur_stellaire,sst_phase,0);
     76            radarPer = litD(fenetre_senseur_stellaire,sst_periode,0);
     77            radarTUp = phs/360. * radarPer;
     78                selectgra(fen);
     79                if (radarSens != (sns ? -1 : 1)) efface(fen);
     80            radarSens = sns ? -1 : 1;
     81            break;
     82            }
     83    case sst_efface :
     84                 setup_gra(fen);
     85                 efface(fen);
     86                 break;
     87    case tache_de_fond:
     88            selectgra(fen);
     89            if(litD(fenetre_senseur_stellaire,sst_radar,0)) {
     90               trace_radar(fen, valeur);
     91            } else {
     92               trace_lin(fen, valeur);
     93            }
    2394                 break;
    2495    default  :   break;
    2596    }
    2697}
     98
     99void setup_gra(fen) {
     100 selectgra(fen);
     101  if(litD(fenetre_senseur_stellaire,sst_radar,0)) {
     102    graph->ymin=-60;
     103    graph->ymax=60;
     104    graph->ypas=0;
     105    graph->xmin=-60;
     106    graph->xmax=60;
     107    graph->xpas=0;
     108    graph->grille=0;
     109    graph->graduations=0;
     110    graph->taille_graduations=0;
     111    graph->sans_image=1;       
     112    graph->avec_icones=0;       
     113    strcpy(graph->xtitre, "");         
     114    graph->ytitre[0]=0;   
     115    init_radar();
     116  } else {
     117    graph->ymin=0;
     118    graph->ymax=48;
     119    graph->ypas=5;
     120    graph->xmin=0;
     121    graph->xmax=240;
     122    graph->xpas=30;
     123    graph->grille=0;
     124    graph->graduations=1;
     125    graph->taille_graduations=10;
     126    graph->sans_image=0;       
     127    graph->avec_icones=0;       
     128    strcpy(graph->xtitre, "T");         
     129    graph->ytitre[0]=0;   
     130  }
     131  efface(fen);
     132}
     133
     134#define seuil1 500
     135#define seuil2 250
     136#define seuil3 120
     137#define seuil4 60
     138#define seuil5 30
     139#define seuil6 10
     140
     141#define frc(x) ((x) - (int)(x))
     142
     143void trace_lin(int fen, double secondes) {
     144  int i;
     145  //tm += gg->periode_echantillonage;
     146  //if (tm>graph->xmax) tm = 0;
     147  double tm = secondes - (int)(secondes/graph->xmax)*graph->xmax;
     148  if(!litD(fenetre_senseur_stellaire,sst_etoiles,0)) {
     149   for (i=0; i<48; i++) {
     150   if(fabs(off[i])>1000.) continue;
     151     if (-diodes[i] +off[i]> seuil1)
     152       symbole(fen, tm, i,  5, rondplein, 0, rouge);
     153     else if (-diodes[i]+off[i] > seuil2)
     154       symbole(fen, tm, i,  4, rondplein, 0, rouge);
     155     else if (-diodes[i]+off[i] > seuil3)
     156       symbole(fen, tm, i, 3, rondplein, 0, rouge);
     157     else if (-diodes[i]+off[i] > seuil4)
     158       symbole(fen, tm, i, 2, rondplein, 0, rouge);
     159     else if (-diodes[i]+off[i] > seuil5)
     160       symbole(fen, tm, i, 2, point, 0, rouge);
     161     else if (-diodes[i]+off[i] > seuil6)
     162       symbole(fen, tm, i, 2, point, 0, noir);
     163    }
     164  } else {
     165   for (i=0; i<nfoundstars; i++) {
     166     float z = zfoundstars[i];
     167     if (mfoundstars[i] > seuil1) {
     168       symbole(fen, tm, z,  5, rondplein, 0, rouge);
     169     } else if (mfoundstars[i] > seuil2) {
     170       symbole(fen, tm, z,  4, rondplein, 0, rouge);
     171     } else if (mfoundstars[i] > seuil3) {
     172       symbole(fen, tm, z,  3, rondplein, 0, rouge);
     173     } else if (mfoundstars[i] > seuil4) {
     174       symbole(fen, tm, z,  2, rondplein, 0, rouge);
     175     } else if (mfoundstars[i] > seuil5) {
     176       symbole(fen, tm, z,  2, point, 0, rouge);
     177     } else
     178       symbole(fen, tm, z,  2, point, 0, noir);
     179   }
     180  }
     181}
     182
     183#define NMAXRADARSTAR 1000
     184
     185struct radarStar {
     186  float phase;
     187  float rayon;
     188  float flux;
     189};
     190
     191static struct radarStar* radarstars = 0;
     192static double lastPhase = 0;
     193
     194void init_radar() {
     195  int i;
     196  if (!radarstars) {
     197    radarstars = (struct radarStar*) malloc(NMAXRADARSTAR*sizeof(struct radarStar));
     198  }
     199  for (i=0; i<NMAXRADARSTAR; i++) {
     200    radarstars[i].phase = -1;
     201    radarstars[i].rayon = -1;
     202  }
     203 
     204}
     205
     206
     207// Nettoyage radar pour trace jusqu'a phase
     208
     209static void clean_radar(float phase, int fen) {
     210  int i;
     211  double x,y,r,th;
     212  for (i=0; i<NMAXRADARSTAR; i++) {
     213  //  if (radarstars[i].phase >= 0 && radarstars[i].phase < 10 &&
     214  //      ((phase > lastPhase && radarstars[i].phase > lastPhase &&
     215  //        radarstars[i].phase <= phase) ||
     216  //      ((phase < lastPhase && (radarstars[i].phase > lastPhase ||
     217  //        radarstars[i].phase <= phase))))) {
     218    if (radarstars[i].phase >= 0 && radarstars[i].phase < phase-1) {
     219      r = (60-48) + radarstars[i].rayon;
     220      th = (frc(radarstars[i].phase)*radarSens+.25) * 2 * M_PI ; 
     221      x = r * cos(th);
     222      y = r * sin(th);
     223      if (radarstars[i].flux > seuil1) {
     224        symbole(fen, x, y,  5, rondplein, 0, blanc);
     225      } else if (radarstars[i].flux > seuil2) {
     226        symbole(fen, x, y,  4, rondplein, 0, blanc);
     227      } else if (radarstars[i].flux > seuil3) {
     228        symbole(fen, x, y,  3, rondplein, 0, blanc);
     229      } else if (radarstars[i].flux > seuil4) {
     230        symbole(fen, x, y,  2, rondplein, 0, blanc);
     231      } else  {
     232        symbole(fen, x, y,  2, point, 0, blanc);
     233      }
     234      radarstars[i].phase = -1;
     235    }
     236    //if (radarstars[i].phase >= 10) {
     237    //  radarstars[i].phase -= 10;
     238    //}
     239  }
     240}
     241
     242static long lastRadarTrace = 0;
     243
     244void trace_radar(int fen, double secondes) {
     245  // On a des nouvelles etoiles...
     246  double phase;
     247  int i,j;
     248  long tk;
     249   
     250  phase = (secondes - radarTUp)/radarPer;
     251  //phase = phase - (int)(phase);
     252 
     253  for (i=0; i<nfoundstars; i++) {
     254    for (j=0; j<NMAXRADARSTAR; j++) {
     255      if (radarstars[j].phase < 0) {
     256        radarstars[j].phase = phase;//  +10; // >=10 : nouvelle...
     257        radarstars[j].rayon = zfoundstars[i];
     258        radarstars[j].flux  = mfoundstars[i];
     259        break;
     260      }
     261    }
     262  }
     263 
     264  // Le trace...
     265  // mais on ne trace pas tout le temps...
     266  tk = TickCount();
     267  if (tk - lastRadarTrace < 10) return;
     268  lastRadarTrace = tk;
     269 
     270  if (litD(fenetre_senseur_stellaire,sst_autolock,0)) {
     271    float per,phs,sns;
     272    per = DonnePeriod();
     273    phs = DonnePhase();
     274    sns = DonneSens();
     275    if (per>0) {
     276      ecritD(fenetre_senseur_stellaire, sst_periode, "%8.3f",per);
     277      radarPer = per;
     278    }
     279    if (phs>-9000) {
     280      ecritD(fenetre_senseur_stellaire, sst_phase, "%8.1f",phs);
     281      radarTUp = phs/360. * radarPer;
     282    }
     283    if (sns > -9000) {
     284      radarSens = -sns;
     285      ecritC(fenetre_senseur_stellaire, sst_sens_horaire, sns > 0);
     286    }
     287  }
     288 
     289  //cercle(fen,-(60-48),-(60-48),(60-48),(60-48),jaune);        // trace le cercle x1,y1 - x2,y2               
     290
     291 modtrace(fen,1,blanc);
     292  segment(fen, (60-48)*cos((lastPhase*radarSens+.25)*M_PI*2), 
     293               (60-48)*sin((lastPhase*radarSens+.25)*M_PI*2),
     294                60*cos((lastPhase*radarSens+.25)*M_PI*2),       
     295                60*sin((lastPhase*radarSens+.25)*M_PI*2));
     296               
     297  clean_radar(phase, fen);
     298 
     299  modtrace(fen,1,jaune);
     300  segment(fen, (60-48)*cos((frc(phase)*radarSens+.25)*M_PI*2), 
     301               (60-48)*sin((frc(phase)*radarSens+.25)*M_PI*2),
     302                60*cos((frc(phase)*radarSens+.25)*M_PI*2),
     303                60*sin((frc(phase)*radarSens+.25)*M_PI*2));
     304             
     305  for (i=0; i<NMAXRADARSTAR; i++) {
     306    if (radarstars[i].phase >= 0) {
     307      float x,y,r,th;
     308      r = (60-48) + radarstars[i].rayon;
     309      th = (frc(radarstars[i].phase)*radarSens+.25) * 2 * M_PI ; 
     310      x = r * cos(th);
     311      y = r * sin(th);
     312      if (radarstars[i].flux > seuil1) {
     313        symbole(fen, x, y,  5, rondplein, 0, rouge);
     314      } else if (radarstars[i].flux > seuil2) {
     315        symbole(fen, x, y,  4, rondplein, 0, rouge);
     316      } else if (radarstars[i].flux > seuil3) {
     317        symbole(fen, x, y,  3, rondplein, 0, rouge);
     318      } else if (radarstars[i].flux > seuil4) {
     319        symbole(fen, x, y,  2, rondplein, 0, rouge);
     320      } else if (radarstars[i].flux > seuil5) {
     321        symbole(fen, x, y,  2, point, 0, rouge);
     322      } else
     323        symbole(fen, x, y,  2, point, 0, noir);
     324    }
     325  }
     326  lastPhase = frc(phase);
     327
     328}
     329
     330
    27331
    28332//#define       bit_sst(i,j,k)  (((blk->sst[i][i*3+k/4])>>(j+8*k%4))&1)   
     
    50354#define place_paquet(i,j)        (i/8) * 24  + j*8 + (i%8)
    51355
    52 void    traite_block_sst_comprime       (block_type_sst_comprime*       blk){}
     356
     357void decode_sst(block_type_sst* blk, int i, int* diodes); // diodes = tableau a 48 entrees
     358
     359void decode_sst(block_type_sst* blk, int i, int* diodes) {
     360  int j; // 0-5 : numero du bloc de 8 diodes
     361  int k; // 0-2 : indice du bloc de 4 bits (une diode = 12 bits = 3 blocs de 4 bits)
     362  int l; // 0-7 : indice de la diode dans son bloc (8 diodes * 4 bits = 1 mot de 32 bits)
     363 
     364  // numero de la diode (0-47) = j*8+l;
     365  // indice dans le bloc sst du mot de 32 bits (0-17) = j*3+k;
     366  // indice dans mot de 32 bits du premier bit utile = 4*l;
     367 
     368  for (j=0; j<48; j++) diodes[j] = 0;
     369 
     370  for (j=0; j<6; j++)
     371    for (k=0; k<3; k++)
     372      for (l=0; l<8; l++) {
     373        long word = blk->sst[i][j*3+k];
     374        word = (word >> (4*l)) & 0xF;
     375        //printf("diode %d mot %d valeur %d\n", j*8+l, k, word);
     376        diodes[j*8+l] = (diodes[j*8+l] << 4) + word;
     377      }
     378     
     379  //for (j=0; j<48; j++) if (diodes[j]>2047) diodes[j] -= 4096;
     380  for (j=0; j<48; j++)  diodes[j] -= 2048;
     381}
     382
     383
     384
     385//#define place_paquet(i,j)      ((i/8) * 24  + j*8 + (i%8) )
     386
     387void    traite_block_sst_comprime       (block_type_sst_comprime*       blk){
     388  block_type_sst blk2;
     389  unsigned long sst_vrai[nb_per_block*2];
     390  int j,jc,i,k;
     391  unsigned long a,b0,b1,b2;
     392
     393 
     394  for (j=0; j<18; j++)
     395    for (i=0; i<nb_per_block*2; i++)
     396      blk2.sst[i][j] = 0;
     397
     398  jc=0;
     399  for(j=0;j<48;j++) {
     400    if ((j!=0) && (j!=4))
     401    {
     402      decompress_4_1((long*)blk->sst[jc],(long*)sst_vrai,nb_per_block*2);
     403      for(k=0;k<nb_per_block*2;k++) {
     404         b2 = sst_vrai[k] & 0xf;
     405         b1 = (sst_vrai[k] >> 4) & 0xf;
     406         b0 = (sst_vrai[k] >> 8) & 0xf;
     407         a=place_paquet(j,0);
     408         blk2.sst[k][a/8] |= (b0 << (a%8)*4);
     409         a=place_paquet(j,1);
     410         blk2.sst[k][a/8] |= (b1 << (a%8)*4);
     411         a=place_paquet(j,2);
     412         blk2.sst[k][a/8] |= (b2 << (a%8)*4);
     413      }
     414      jc++;
     415    }
     416  }
     417  valide_block((block_type_modele*)&blk2,block_sst,numero_block(blk)); 
     418  traite_block_sst(&blk2);
     419}
    53420
    54421
    55422void    traite_block_sst(block_type_sst*        blk)
    56423{
    57 int i,j,k;
    58 double  y[15];
    59 double  x;
     424int i,k;
     425//double        y[15];
     426//double        x;
    60427
    61428int temps_cntl;
    62429double secondes;
    63 int a,b,b0,b1,b2;
    64 int prem_d;
    65 
    66 if(!fenetre(fenetre_senseur_stellaire)) return;
    67 //  ecriture des valeurs brutes du senseur stellaire
    68 //  les numero 0 et 4  sont dediés aux thermometres
    69 //  pour l'instant machent bien 1 2 3   8 9 10 11   
    70 if(litD(fenetre_senseur_stellaire,sst_sortie_brute,0))
    71         {
    72         if(!fenetre(fenetre_senseur_stellaire_lecture_brute)) nouveauT(fenetre_senseur_stellaire_lecture_brute,0,"lecture senseur stellaire");
    73 
    74         ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"\nsenseur stellaire  \n");
    75 
    76 
    77 //      k=0;
    78         for(k=0;k<4;k++)
    79                 {
    80                 for(i=0;i<16;i++)               //  16 senseurs
    81                         {
    82                         for(j=0;j<3;j++)                //  3 paquets
    83                                 {
    84                                 a=place_paquet(i,j);
    85                                 b= ( blk->sst[k][a/8] >>( (a%8)*4) ) & 0xf;
    86                                 ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"%x",b);
    87                                 }
    88                         ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"  ");
    89                         }
    90                 ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"\n");
    91                 }
    92 
    93          ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"\n");
    94 
    95          }
    96 
    97 //k=0;
    98 prem_d=litD(fenetre_senseur_stellaire,sst_prem_diode,0L);
    99 for(k=0;k<72;k++)
    100         {
    101          for(i=0;i<12;i++)              //  seulement 12 diodes
    102                 {
    103                 int q;
    104                 q=i+prem_d-1;
    105                                
    106                 a=place_paquet(q,0);
    107                 b0= ( blk->sst[k][a/8] >>( (a%8)*4) ) & 0xf;
    108                 a=place_paquet(q,1);
    109                 b1= ( blk->sst[k][a/8] >>( (a%8)*4) ) & 0xf;
    110                 a=place_paquet(q,2);
    111                 b2= ( blk->sst[k][a/8] >>( (a%8)*4) ) & 0xf;
    112                
    113 
    114                 x=(double)( (b0<<8) | (b1<<4) |  b2 ) ;
    115                 if(x>2047) x-=4096;
    116                 y[i]=x;
    117                 }
    118 //      printf(" y = %g %g %g %g %g \n",y[0],y[1],y[2],y[3],y[4]);
    119         temps_cntl =numero_block(blk)*nb_per_block*2+k;
    120         secondes=gg->periode_echantillonage*(double)temps_cntl-gg->temps_origine;
    121         tracen(fenetre_senseur_stellaire,12,secondes,y);
    122         }
    123 }
    124 
    125 
    126                
    127 //      les 46 valeurs en hexa
    128 //      i=0;                    //  juste le premier point du block
    129 //      for(i=0;i<72;i++)
     430//int a,b,b0,b1,b2;
     431//char tab[5000];
     432
     433for (i=0; i<nb_per_block*2; i++) {
     434  k=0;
     435  decode_sst(blk, i, diodes);
     436  temps_cntl=numero_block(blk)*nb_per_block*2+i;
     437  secondes = temps_cntl*gg->periode_echantillonage;
     438 
     439  // 1. Suppression d'offset sur la rangee de diodes, et remise en ordre
     440  remove_diode_offset();
     441  // 2. Suppression des doubles impulsions et detection des etoiles
     442  find_stars(secondes);
     443  exec_recons_sst();
     444 
     445  if(fenetre(fenetre_senseur_stellaire))
     446    exec_senseur_stellaire(fenetre_senseur_stellaire,tache_de_fond,secondes);
     447}
     448}
     449
     450void init_sst_buffers(void) {
     451  int i,j;
     452  for (i=0; i<dbufsz; i++)
     453    for (j=0; j<48; j++)
     454      diodesbuffer[i][j] = 0;
     455  nfoundstars = 0;
     456}
     457
     458// sans objet a cause des filtres de l'electronique ?
     459// se contente de permuter les diodes
     460
     461// diodpermut[i] = channel de la diode i
     462static int diodpermut[46]=
     463 { 8,24,40, 9,25,41,10,26,42,11,
     464  27,43,16,32, 1,17,33, 2,18,34,
     465   3,19,35,12,28,44,13,29,45,14,
     466  30,46,15,31,47,20,36, 5,21,37,
     467   6,22,38, 7,23,39};
     468 // voies 0 et 4 non connectees, voie 1 en panne.
     469
     470void remove_diode_offset(void) {
     471  int dd[46];
     472  int i;
     473  for (i=0; i<46; i++) {
     474    dd[i] = diodes[i];
     475  }
     476  diodes[46] = diodes[47] = 0;
     477  for (i=0; i<46; i++) {
     478    diodes[i] = dd[diodpermut[i]];
     479  }
     480  return;
    130481/*
    131 for(i=0;i<72;i++)
    132         {
    133 
    134          for(j=0;j<12;j++)              //  seulement les 12 premieres diodes
    135                 {
    136                 x=0;
    137                 for(k=0;k<12;k++)       x=(x<<1)  | bit_sst(i,j,k);
    138                 y[j]=(double)x;
    139                 }
    140         temps_cntl =numero_block(blk)*nb_per_block*2+i;
    141         secondes=gg->periode_echantillonage*(double)temps_cntl-gg->temps_origine;
    142         tracen(fenetre_senseur_stellaire,12,secondes,y);
    143         }
    144                        
    145 */
    146 /*      i=1;                    //  juste le premier point du block
    147 //      for(i=0;i<72;i++)
    148                 {
    149                 for(k=0;k<12;k++)               //  12 bits
    150                         {
    151                         for(j=0;j<35;j++)               //  46 senseurs
    152                                 {
    153                                 ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"%d   ",bit_sst(i,j,k));
    154                                 }
    155                         ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"\n");
    156                         }
    157                 ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"\n");
    158                 }
    159                
    160 //      les 46 valeurs en hexa
    161 //      i=0;                    //  juste le premier point du block
    162 //      for(i=0;i<72;i++)
    163         for(i=0;i<10;i++)
    164                 {
    165                 for(j=0;j<35;j++)               //  46 senseurs
    166                         {
    167                         x=0;
    168                         for(k=0;k<12;k++)       x=(x<<1)  | bit_sst(i,j,k);
    169                         ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"%3x ",x);
    170                         }
    171                 ecritT(fenetre_senseur_stellaire_lecture_brute,fin_f,"\n");
    172                 }
    173                        
    174        
    175         }
    176 
    177                        
    178 */     
     482  int i,j;
     483  float m,sig;
     484  // suppression des positions non utilisees. 3 et 7 ?
     485  for (i=DIODE_UNUSED_1; i<46; i++)
     486    diodes[i] = diodes[ i<DIODE_UNUSED_2-1 ? i+1 : i+2 ];
     487 
     488  // calcul d'un fond sur la rangee. Moyenne clippee.
     489  m = 0; sig = 1.e10;
     490  for (i=0; i<2; i++) {
     491    float s=0; float s2=0; int n=0;
     492    for (j=0; j<46; j++) {
     493      if (fabs(diodes[j]-m)<3*sig+1) {
     494        s += diodes[j]; s2 += diodes[j]*diodes[j]; n++;
     495      }
     496    }
     497    if (n>0) {
     498      m = s/n; sig = sqrt(s2/n - m*m);
     499    } else {
     500      m = 0; break;
     501    }
     502  }
     503  for (j=0; j<46; j++)
     504    diodes[j] -= m;
     505   
     506  diodes[46] = diodes[47] = 0;
     507  */
     508}
     509
     510
     511void find_stars(double secondes) {
     512  int i,j,feelasleep,sousoff;
     513  float corrtemps,aufsete;
     514  // Une etoile est validee seulement si impulsion dans meme canal
     515  // ou dans canal juste au dessus dans les 4 echantillons qui precedent
     516  // (en excluant le precedent).
     517  // On demande aussi que le signal soit en train de remonter...
     518  // en pratique on pourrait restreindre la contrainte avec une estimation
     519  // de la vitesse de rotation. echantillon -2 ou -3...
     520  nfoundstars = 0;
     521  for (i=0; i<46; i++) {
     522  // la diode 14 est morte (canal 1)...
     523  if (i==14) continue;
     524  aufsete=0.;feelasleep=0;
     525  for (sousoff=0;sousoff<5;sousoff++)
     526  {aufsete+=diodesbuffer[sousoff][i];feelasleep++;}
     527  aufsete/=feelasleep;
     528  off[i]=aufsete;
     529    if ((diodes[i] -aufsete< -seuilSST ||
     530    diodesbuffer[dbufsz-1][i]-aufsete< -seuilSST ||
     531    diodesbuffer[dbufsz-2][i]-aufsete< -seuilSST)
     532    && fabs(off[i])<1000.) {
     533     if (sstHas2Bars) {
     534      for (j=dbufsz-2; j>=0; j--) {
     535        if (diodesbuffer[j][i] < -seuilSST) {
     536          //printf("Found star same %d\n",dbufsz-j);
     537          zfoundstars[nfoundstars] = i;
     538          mfoundstars[nfoundstars] = diodes[i]-aufsete;
     539          tfoundstars[nfoundstars] = secondes;
     540          nfoundstars++;
     541          if (nfoundstars >= MAXFOUNDSTARS) return;
     542          break;
     543        }
     544        if (i < 45 && diodesbuffer[j][i+1] < -seuilSST) {
     545          //printf("Found star decal %d\n",dbufsz-j);
     546          zfoundstars[nfoundstars] = i+.5;
     547          mfoundstars[nfoundstars] = diodes[i]-aufsete;
     548          tfoundstars[nfoundstars] = secondes;
     549          nfoundstars++;
     550          if (nfoundstars >= MAXFOUNDSTARS) return;
     551          break;
     552        }
     553      }
     554     } else {
     555       if ((diodes[i] > diodesbuffer[dbufsz-1][i])
     556          && (diodesbuffer[dbufsz-1][i] <
     557          .5*(diodesbuffer[dbufsz-2][i]+diodesbuffer[dbufsz-3][i]))) {
     558          zfoundstars[nfoundstars] = i;
     559          mfoundstars[nfoundstars] = -(diodesbuffer[dbufsz-1][i]+diodesbuffer[dbufsz-2][i])/2.+aufsete;
     560          corrtemps=(diodesbuffer[dbufsz-2][i]-diodes[i])*gg->periode_echantillonage;
     561          corrtemps=-corrtemps/
     562          ((diodesbuffer[dbufsz-2][i]+diodesbuffer[dbufsz-1][i]+diodes[i])-3.*aufsete);
     563//        corrtemps=0;
     564          tfoundstars[nfoundstars] = secondes+corrtemps;
     565          nfoundstars++;
     566          if (nfoundstars >= MAXFOUNDSTARS) return;
     567       }
     568     }
     569    }
     570  }
     571 
     572  // remplissage buffer echantillons precedents
     573  for (j=0; j<dbufsz-1; j++)
     574    for (i=0; i<46; i++)
     575      diodesbuffer[j][i] = diodesbuffer[j+1][i];
     576  for (i=0; i<46; i++)
     577    diodesbuffer[dbufsz-1][i] = diodes[i];
     578}
     579
     580
     581// Comparaison avec le GSC.
     582// Preparer une carte pour une position et une heure.
  • trunk/Poubelle/archediab.old/archediab.sources/c/tache_PCI.c

    r637 r649  
    6464                        //                      for(i=0;i<1000;i++);
    6565//                      ecrit_carte(tt->tc.btc[tt->tc.pos_lit].mot[j]);
    66                         if(tt->PCI_actif==1)    ecrit_carte(mot[j]);
     66                        if(acquisition_PCI)     ecrit_carte(mot[j]);
    6767                        }
    6868                tt->vi.flag_ecriture_data=0;
  • trunk/Poubelle/archediab.old/archediab.sources/c/tache_archeops.c

    r639 r649  
    1010#include "carte_pci.h"
    1111
     12#include "simulmission.h"
    1213
    1314//*****************************************************************************************
     
    8788                }
    8889        }
    89 
    90 else    while(1)
     90else if (tt->PCI_actif==3)      // simulation donnees mission
     91        {
     92                // EA + JD
     93                // Lecture d'un block depuis le simulateur
     94               
     95                if (SimulMissionBloc(tt)) {
     96               
     97                  // Sauvegarde du bloc dans la file d'attente
     98                  sauve_un_block(tt);
     99                }
     100        }
     101else    while(1)                //  case 1 et 4 
    91102        {
    92103        lit_carte;      if(rien_a_lire)         break;                          //  fifo vide  ->  retour  ->  sort du while
     
    146157        }
    147158if(lec_fifo > tt->nb_lec_fofo_int)      tt->nb_lec_fofo_int=lec_fifo;
    148 if(!tt->nb_lec_fofo_ext)                {tt->nb_lec_fofo_ext=tt->nb_lec_fofo_int;tt->nb_lec_fofo_int=0;}
     159if(!tt->val_con_fifo)           {tt->val_con_fifo=tt->nb_lec_fofo_int;tt->nb_lec_fofo_int=0;}
    149160
    150161}
  • trunk/Poubelle/archediab.old/archediab.sources/c/tache_archeops_bit2.c

    r645 r649  
    1212
    1313
     14#include "simulmission.h"
    1415
    1516
     
    4243tt->vi.b=0;
    4344tt->vi.c=0;
    44 //init_lit_bit();
    4545}
    4646
     
    4848#define max_fifo  4000
    4949
    50 
    51 //              un bit pour 8 bit en parallele dans la fifo             
    52 /*
    53 char    un_bit(void)
    54 {
    55 static int i;
    56 static unsigned long RR;
    57 i++;
    58 if( (i<0) ou (i>7) )
    59         {
    60         lit_carte;      if(rien_a_lire)         return(bit_vide);       //  fifo vide  ->  retour  ->  sort du while
    61         i=0;
    62         }
    63 if( (RR>>i) & 1 )       return(bit_un);
    64         else            return(bit_zero);
    65 }
    66 
    67 */
    6850
    6951//              un bit pour  fifo avec un seul bit (bit0) et la valeur de la periode en bit 1..6  (37 ou 38)           
     
    10183//tt->nb_lec_fofo_ext=M;
    10284
    103 
    104        
    105 //if( RR & 1 )          return(bit_un);
    106 //else          return(bit_zero);
    107 if( RR & 1 )    return(bit_zero);
     85#ifdef signe_inverse
     86
     87if( RR & 1 )  return(bit_zero);
    10888else            return(bit_un);
    10989
     90#else
     91       
     92if( RR & 1 )    return(bit_un);
     93else            return(bit_zero);
     94
     95#endif
    11096}
    11197
     
    154140                }
    155141        }
    156 
    157 else    while(1)
     142else if (tt->PCI_actif==3)      // simulation donnees mission
     143        {
     144                // EA + JD
     145                // Lecture d'un block depuis le simulateur
     146               
     147                if (SimulMissionBloc(tt)) {
     148               
     149                  // Sauvegarde du bloc dans la file d'attente
     150                  sauve_un_block(tt);
     151                }
     152        }
     153else    while(1)                //  case 1 et 4
    158154        {
    159155        i=lit_bit(&tt->vi.btt);
     
    165161        }
    166162if(lec_fifo > tt->nb_lec_fofo_int)      tt->nb_lec_fofo_int=lec_fifo;
    167 //if(!tt->nb_lec_fofo_ext)              {tt->nb_lec_fofo_ext=tt->nb_lec_fofo_int;tt->nb_lec_fofo_int=0;}
     163if(!tt->val_con_fifo)           {tt->val_con_fifo=tt->nb_lec_fofo_int;tt->nb_lec_fofo_int=0;}
    168164
    169165}
  • trunk/Poubelle/archediab.old/archediab.sources/c/tache_diabolo.c

    r637 r649  
    8484int max_fifo;
    8585
    86 if(tt->PCI_actif==1)    max_fifo=3000;  //  3000  points maxi par interruption (10ms)  soit (3.3µs)
     86if(acquisition_PCI)     max_fifo=3000;  //  3000  points maxi par interruption (10ms)  soit (3.3µs)
    8787         else           max_fifo=200;   //  ((1000)faux )  points maxi par interruption (10ms)  soit  (20µs)
    8888
     
    9090while(1)
    9191        {
    92         if(tt->PCI_actif==1)    {lit_carte;     if(rien_a_lire) break;}//  fifo vide  ->  retour  ->  sort du while
     92        if(acquisition_PCI)     {lit_carte;     if(rien_a_lire) break;}//  fifo vide  ->  retour  ->  sort du while
    9393        lec_fifo++;
    9494        if (EPLD_occupe) tt->vi.flag_ecriture_data=0;
     
    141141                if( RR&FLAG_FIFO_FULL )         {ecrit_erreur(err_fifo_pleine);read_flags();reset_fifo();}      // la fifo a débordée                   
    142142                if(lec_fifo > tt->nb_lec_fofo_int)  tt->nb_lec_fofo_int=lec_fifo;
    143                 if(!tt->nb_lec_fofo_ext)        {tt->nb_lec_fofo_ext=tt->nb_lec_fofo_int;tt->nb_lec_fofo_int=0;}
     143                if(!tt->val_con_fifo)   {tt->val_con_fifo=tt->nb_lec_fofo_int;tt->nb_lec_fofo_int=0;}
    144144                if(lec_fifo>max_fifo)
    145145                        {
  • trunk/Poubelle/archediab.old/archediab.sources/c/tache_regul.c

    r637 r649  
    7979tt->vi.reg.cc=cc;
    8080cc=( 0x0fff - cc ) & 0x0fff;            //  12 bits  avec inverser la polarité
    81 if( (tt->PCI_actif==1) && ( tt->vi.flag_ecriture_data>2 ) )             //    rien en attente d'ecriture: j'ecris direct en interruption               
     81if( (acquisition_PCI) && ( tt->vi.flag_ecriture_data>2 ) )              //    rien en attente d'ecriture: j'ecris direct en interruption               
    8282        {
    8383        ecrit_carte(tc_regul );                 // ecrit bolo 251  -->  ecrit regulation
  • trunk/Poubelle/archediab.old/archediab.sources/c/tache_transputer.c

    r637 r649  
    7070int max_fifo;
    7171
    72 if(tt->PCI_actif==1)    max_fifo=4000;  //  3000  points maxi par interruption (10ms)  soit (3.3µs)
     72if(acquisition_PCI)     max_fifo=4000;  //  3000  points maxi par interruption (10ms)  soit (3.3µs)
    7373         else           max_fifo=200;   //  ((1000)faux )  points maxi par interruption (10ms)  soit  (20µs)
    7474
     
    7878while(1)
    7979        {
    80         if(tt->PCI_actif==1)    {lit_carte;     if(rien_a_lire) break;}//  fifo vide  ->  retour  ->  sort du while
     80        if(acquisition_PCI)     {lit_carte;     if(rien_a_lire) break;}//  fifo vide  ->  retour  ->  sort du while
    8181        lec_fifo++;
    8282//      tt->vi.bkb[tt->vi.a^3]=octet_a_lire;    // dans l'ordre: 3 2 1 0 7 6 5 4 11 10 9 8 ...
     
    9696        }
    9797if(lec_fifo > tt->nb_lec_fofo_int)      tt->nb_lec_fofo_int=lec_fifo;
    98 if(!tt->nb_lec_fofo_ext)                {tt->nb_lec_fofo_ext=tt->nb_lec_fofo_int;tt->nb_lec_fofo_int=0;}
     98if(!tt->val_con_fifo)           {tt->val_con_fifo=tt->nb_lec_fofo_int;tt->nb_lec_fofo_int=0;}
    9999}
    100100
  • trunk/Poubelle/archediab.old/archediab.sources/c/telecommande.c

    r645 r649  
    55#include "acqui.h"
    66#include "tm.h"
     7#include "simulmission.h"
     8#include "controle.h"
    79
    810
     
    135137{
    136138unsigned char mot_tc[10];
    137 mot_tc[0]       =       tc_reduite;
    138 mot_tc[1]       =       mot1;
    139 mot_tc[2]       =       mot2;
    140 mot_tc[3]       =       mot3;
    141 emission_telecommande(tc_dir_transputer,mot_tc);
     139        {
     140        mot_tc[0]       =       tc_reduite;
     141        mot_tc[1]       =       mot1;
     142        mot_tc[2]       =       mot2;
     143        mot_tc[3]       =       mot3;
     144        emission_telecommande(tc_dir_transputer,mot_tc);
     145        }
    142146}
    143147
     
    148152int j;
    149153
     154if(!acquisition_avec_telecommande)  return;
     155
     156
    150157//*****************************************************************************************
    151158//                                                                                      ***
     
    157164
    158165#define  delai(xx)      {long uu;for(uu=0;uu<(10000L*(long)xx);uu++){};}
    159 #define  tc_char(x)     {delai(20);if(tt->PCI_actif==1) ecrit_carte((x)&0xff);} 
     166#define  tc_char(x)     {delai(40);if(acquisition_PCI) ecrit_carte((x)&0xff);} 
    160167#define  tc_int(x)      {tc_char(x);tc_char(x>>8);tc_char(x>>16);tc_char(x>>24);}
    161168//printf("telecommande: ");
     
    200207                        if( ((mot[0]&0xff)!=tc_reduite) && gg->flag_tc_reduite)
    201208                                {
    202                                 printf("attention: une telecommande normale !!\n\n");
     209                                printf("attention: une telecommande normale non envoyée !!\n\n");
    203210                                son(130);
    204211                                select(printf_ref);
     212                                break;
    205213                                }
    206214//                      pour test en mode simulation sans le retour des blocks reglage du transputer
    207                         if(tt->PCI_actif==2)    relit_telecommandes_reduites(tc);
    208                         else    {
     215                        if(tt->PCI_actif==2)   
     216                                {
     217                                relit_telecommandes_reduites(tc);
     218                                break;
     219                                }
     220                    else if(tt->PCI_actif==3)
     221                        {
     222                        simul_telecommandes_reduites(tc);
     223                        }
     224                        else    {char ss[200];
     225                                                static long t;
     226                       
     227#define tcl(iii)        ((long)mot[iii])
     228                       
     229                                        long mothexa[5];        /* les 5 cara hexa envoyée  */
     230                                        /*  on range les bit: bit 1 en poid fort de tout   */
     231                                        mothexa[0]=tcl(1);      /* 4 bit choix de commande   */
     232                                        mothexa[1]=tcl(2)>>2;   /* les 4 bits poid fort du code direction */
     233                                        mothexa[2]=((tcl(2)<<2)&0xc)  + ((tcl(3)>>6)&0x3);
     234                                        mothexa[3]=(tcl(3)>>2)&0xf; 
     235                                        mothexa[4]=(tcl(3)&0x3) + 0x0C;
     236                                        printf("commande 18bit:   %d %d %d -> %lx%lx%lx%lx%lx ",tcl(1),tcl(2),tcl(3)
     237                                                ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]);
     238                                        ecritD(fenetre_controle,con_subscan,"tc: %x %x %x %x %x ",mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]);
     239
     240                                tc_char(0x11);  //  synchro
     241                                tc_int(debut_telecommande);
     242                                for(j=0;j<4;j++)        tc_char(mot[j]);
     243                                tc_char(0x00);          //  synchro
     244                                sprintf(ss,"S%X%X%X%X%X07WS%X%X%X%X%X07WS%X%X%X%X%X07W\r\n"
     245                                                ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]
     246                                                ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]
     247                                                ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]);
     248/*                              sprintf(ss,"S%x%x%x%x%x07WS%x%x%x%x%x07WS%x%x%x%x%x07W\r\l"
     249                                                ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]
     250                                                ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]
     251                                                ,mothexa[0],mothexa[1],mothexa[2],mothexa[3],mothexa[4]);*/
     252                                if(ss[7]!='7') erreur("adresse not equal to 7");
     253                                if(ss[16]!='7') erreur("adresse not equal to 7");
     254                                if(ss[25]!='7') erreur("adresse not equal to 7");
     255                                while( (TickCount()>t) et (TickCount()<(t+60*15)) )     // 15sec
     256                                        {
     257                                        static int q;
     258                                        q++;
     259                                        son(130);
     260                                        if(q%10==0) printf("attente pour envoi de telecommande\n");
     261                                        controlemanip(0);
     262                                        }
     263                                son(133);
     264
     265                                printf(" envoi de la telecommande : %s \n",ss);
     266                                ecritRS(0,ss,0);
     267                                t=TickCount();                  //  10 secondes  (tick = 1/60 sec)
     268                                }
     269/*                      else    {
    209270                                tc_char(0x11);  //  synchro
    210271                                tc_int(debut_telecommande);
     
    213274                                tc_char(0x00);tc_char(0x00);    //  synchro
    214275                                }
     276*/
    215277                        break;
    216278
    217279        case    tc_dir_reset_epld       :       //printf("tc_reset_epld:\n");
    218280               
    219 //                      for(j=0;j<14;j++) tc_char(j);
     281                        for(j=0;j<8;j++) tc_char(j);
     282                        tc_char(1);tc_char(1);
     283                        tc_char(0x00);tc_char(0x00);    //  synchro
     284
     285                        break;
     286
     287        case    tc_dir_reset_trp        :       //printf("tc_reset_epld:\n");
     288               
    220289                        for(j=0;j<15;j++) tc_char(j);   // reset epld+transputer
    221290                        tc_char(1);tc_char(1);
     
    233302
    234303//  delai pour separer les télécommandes (archeops, transputer ou non)
    235 if(tt->PCI_actif==1) delai(1000);
     304if(acquisition_PCI) delai(1000);
    236305
    237306#endif          //--------------------------------------------------------------------  ***
  • trunk/Poubelle/archediab.old/archediab.sources/c/trace-DS.c

    r639 r649  
    142142                if(u==npt_DS-1)
    143143                        {
    144                         for(j=0;j<nb_max_bolo;j++)
    145                                 {
    146                                 phase_mesure[j]=atan2(y1[j],y2[j]);
    147                                 confiance[j]=bb[j]*bb[j];
    148                                 if(confiance[j])        confiance[j]=log((y1[j]*y1[j]+y2[j]*y2[j])/(bb[j]*bb[j]));
    149                                 }
    150                         j=5;    // bolo pur mesurer la phase
    151                         phase_memoire=0.95*phase_memoire+0.05*phase_mesure[j];
    152                         ecritD(fenetre_trace_DS,ds_phase,"%d°",degre(phase_memoire));
    153                         printf(" phase=%d°(%2.1f)  \n",degre(phase_mesure[j]),confiance[j]);
     144//                      for(j=0;j<nb_max_bolo;j++)
     145//                              {
     146//                              phase_mesure[j]=atan2(y1[j],y2[j]);
     147//                              confiance[j]=bb[j]*bb[j];
     148//                              if(confiance[j])        confiance[j]=log((y1[j]*y1[j]+y2[j]*y2[j])/(bb[j]*bb[j]));
     149//                              }
     150//                      j=5;    // bolo pur mesurer la phase
     151//                      phase_memoire=0.95*phase_memoire+0.05*phase_mesure[j];
     152//                      ecritD(fenetre_trace_DS,ds_phase,"%d°",degre(phase_memoire));
     153//                      printf(" phase=%d°(%2.1f)  \n",degre(phase_mesure[j]),confiance[j]);
    154154//                      printf(": phase memoire=%g  \n",phase_memoire);
    155155//                      printf(" trace y1= %g , %g , %g , %g , %g \n",y1[0],y1[1],y1[2],y1[3],y1[4]);
  • trunk/Poubelle/archediab.old/archediab.sources/c/trace_tout.c

    r639 r649  
    55#include "trace_tout.h"
    66#include "synchro.h"
    7 
    8 
    97
    108
     
    3836                                                graph->xpas=50;
    3937                                                graph->taille_graduations=8;
    40                                                         for(j=0;j<nb_max_bolo;j++)  SS->f1[j]=0;
    41                                                         for(j=0;j<nb_max_bolo;j++)  SS->f2[j]=0;
    42                                                         for(j=0;j<nb_max_bolo;j++)  SS->y[j]=0;
     38                                                        for(j=0;j<nb_max_trace;j++)  SS->f1[j]=0;
     39                                                        for(j=0;j<nb_max_trace;j++)  SS->f2[j]=0;
     40                                                        for(j=0;j<nb_max_trace;j++)  SS->y[j]=0;
    4341                                                       
    4442                                       
     
    5250                                        SS->fmini=litD(fen,t_fmini,0L);
    5351                                                SS->fmaxi=litD(fen,t_fmaxi,0L);
    54                                                 for(j=0;j<nb_max_bolo;j++)  SS->f1[j]=0;
     52                                                for(j=0;j<nb_max_trace;j++)  SS->f1[j]=0;
    5553
    5654                                                        c1=2*3.14*SS->fmini*gg->periode_echantillonage;         c1=c1/(1+c1);   
     
    7674                                        {
    7775                                        SS->bolo_couleur[i]=litD(fen,t_bolo_couleur+i,0L)-1;
    78                                         if( (SS->bolo_couleur[i]<1) ou (SS->bolo_couleur[i]>nb_max_bolo) )   SS->bolo_couleur[i]=0;
     76                                        if( (SS->bolo_couleur[i]<1) ou (SS->bolo_couleur[i]>nb_max_trace) )   SS->bolo_couleur[i]=0;
    7977                                        printf(" i=%d bolo=%d    ",i,SS->bolo_couleur[i]);
    8078                                        }
     
    9593                                                        c2=2*3.14*SS->fmaxi*gg->periode_echantillonage; if(c2>0)        c2=c2/(1+c2);   
    9694                                                       
    97                                                 for(j=0;j<nb_max_bolo;j++)             
     95                                                for(j=0;j<nb_max_trace;j++)             
    9896                                                        {
    9997                                                        SS->f1[j]= (1-c1) * SS->f1[j]   + c1 * xbol(j);
     
    105103                                                                {
    106104                                                                SS->ipas=SS->moyenne;
    107                                                                 if(SS->moyenne) for(j=0;j<nb_max_bolo;j++) SS->y[j]=SS->y[j]/(double)SS->moyenne;
     105                                                                if(SS->moyenne) for(j=0;j<nb_max_trace;j++) SS->y[j]=SS->y[j]/(double)SS->moyenne;
    108106//                                                              printf("trace_tout  un  point \n");
    109107
     
    118116        }
    119117
    120                                                                 montracen_tout(fen,nb_max_bolo,x,SS);
     118                                                                montracen_tout(fen,nb_max_trace,x,SS);
    121119
    122120
     
    129127                                                                                        }
    130128
    131                                                                 for(j=0;j<nb_max_bolo;j++) SS->y[j]=0;
     129                                                                for(j=0;j<nb_max_trace;j++) SS->y[j]=0;
    132130                                                                }
    133131                               
     
    144142for(i=0;i<max_couleur;i++)
    145143        {
    146         if( (SS->bolo_couleur[i]>=1) && (SS->bolo_couleur[i]<nb_max_bolo+1) )   yy[i]=SS->y[SS->bolo_couleur[i]-1];
     144        if( (SS->bolo_couleur[i]>=1) && (SS->bolo_couleur[i]<nb_max_trace+1) )  yy[i]=SS->y[SS->bolo_couleur[i]-1];
    147145                else            yy[i]=0;
    148146        }
  • trunk/Poubelle/archediab.old/archediab.sources/choix_acquisition.h

    r643 r649  
    2727
    2828#ifdef _archeops        //---------   pour  Archeops    ---------------------------------
    29 #define Adresse_base_PCI        0x83000000      // G3 Archeops optique
     29//#define Adresse_base_PCI      0x81000000      // G3 Spatial-Archeops3 optique
     30//#define Adresse_base_PCI      0x83000000      // G3 Spatial-Archeops optique
    3031//#define Adresse_base_PCI      0x84000000      // G3 Archeops optique avec carte video
    31 //#define Adresse_base_PCI      0x82000000      // G3 Archeops_2 optique avec carte video
     32#define Adresse_base_PCI        0x82000000      // G3 Archeops_2 optique avec carte video
    3233#endif
    3334
     
    4546//#define Adresse_base_PCI      0x84000000      // diabolo dans G3 Archeops avec optique
    4647#endif         
     48
     49//#define signe_inverse
  • trunk/Poubelle/archediab.old/archediab.sources/h/acqui.h

    r643 r649  
    66
    77void    reset_epld(void);
     8void    reset_trp(void);
    89
    910void    deglitch(void);
  • trunk/Poubelle/archediab.old/archediab.sources/h/bolo.h

    r637 r649  
    4646
    4747
     48
     49//debut_id=1660
     50//----------------------------------  fenetre : change_bolo  -----------------------------------
     51
     52#define change_bolo_id  1660  //  le id de la fenetre dans la ressource
     53
     54void exec_change_bolo(int fen,int item,double valeur,...);   //  prototype de la fonction
     55
     56// liste des items de la fenetre (3) items
     57
     58#define  chb_val                   1     //   edit texte
     59
     60//fin_id
     61
  • trunk/Poubelle/archediab.old/archediab.sources/h/controle.h

    r637 r649  
    1010void exec_controle(int fen,int item,double valeur,...);   //  prototype de la fonction
    1111
    12 // liste des items de la fenetre (14) items
     12// liste des items de la fenetre (23) items
    1313
    14 #define  con_retard1               1     //   static texte
    15 #define  con_chauf                 2     //   controle
    16 #define  con_retard2               3     //   static texte
    17 #define  con_voyant                4     //   controle
    18 #define  con_fichier               10     //   edit texte
    19 #define  con_phase                 11     //   controle
    20 #define  con_periode               12     //   static texte
    21 #define  con_time                  13     //   static texte
    22 #define  con_subscan               14     //   static texte
     14#define  con_chauf                 1     //   controle
     15#define  con_voyant                2     //   controle
     16#define  con_fichier               8     //   edit texte
     17#define  con_phase                 9     //   controle
     18#define  con_periode               10     //   static texte
     19#define  con_time                  11     //   static texte
     20#define  con_subscan               12     //   static texte
     21#define  con_donnee                16     //   controle
     22#define  con_erreur                17     //   controle
     23#define  con_fifo                  18     //   controle
     24#define  con_pile                  20     //   controle
     25#define  con_reset_epld            22     //   controle
     26#define  con_reset_trp             23     //   controle
    2327
    2428//fin_id
  • trunk/Poubelle/archediab.old/archediab.sources/h/diabolo.h

    r643 r649  
    66#include "fenetres_diabolo.h"
    77
    8 
     8#define   acquisition_PCI  ( (tt->PCI_actif==1) ou  (tt->PCI_actif==4) )
     9#define   acquisition_avec_telecommande  (tt->PCI_actif==4)
    910
    1011/*
     
    117118        reglage_bolo    reglage;                                // etat bolo dans le programme principal
    118119       
     120        double          temperature_cryo;       // temperature du cryo (0.1K) en K
     121        /* La germanium doit toujours etre en premier par rapport aux autres thermos absolus */
     122
    119123        short           bol_per[nb_max_bolo][nb_max_mes_per];   // table une periode
    120124
     
    128132        F_donne         don;
    129133       
    130         double          corel[nb_max_bolo];             // données apres corellation eventuelle
     134        double          corel[nb_max_bolo+3+nb_photo_diodes];           // données apres corellation eventuelle
    131135       
    132136
     
    195199void    traite_block_bolo_comprime      (block_type_bolo_comprime*      blk);
    196200void    traite_block_bolo               (block_type_bolo*               blk);
     201void    traite_block_sst_brut           (block_type_sst*                blk);
     202void    traite_block_sst_comprime_brut  (block_type_sst_comprime*       blk);
    197203void    traite_block_sst                (block_type_sst*                blk);
    198204void    traite_block_sst_comprime       (block_type_sst_comprime*       blk);
  • trunk/Poubelle/archediab.old/archediab.sources/h/fenetres_diabolo.h

    r643 r649  
    77#define fenetre_fichier                 103
    88#define fenetre_trace_DS                105
    9 #define fenetre_trace_tout              106
     9//#define fenetre_trace_tout            106
    1010#define fenetre_trace_1_per             107
    1111#define fenetre_annexe  108
     
    5858#define fenetre_gyroscope_lecture_brute                 146
    5959
     60#define fenetre_lecture_blocks                          147
     61#define fenetre_Find_Period                             148
     62#define fenetre_Phase_SST                               149
     63#define fenetre_sstbrut                                 150
     64
     65#define fen_change_bolo                                 965
     66
     67#define fenetre_trace_tout_temperature                  151
     68#define fenetre_trace_tout_bolos                        152
     69#define fenetre_trace_tout_gyros                        153
    6070
    6171//  de préférence, utiliser les indices suivants :              i= position dans la periode     
  • trunk/Poubelle/archediab.old/archediab.sources/h/menu.h

    r637 r649  
    1919#define  d_regulation           12
    2020#define  d_dilution             13
    21 #define  d_senseur_stellaire    14
     21#define  d_sst_brut             14
     22#define  d_senseur_stellaire    15
     23#define  d_recons_sst           16
     24#define  d_gyros                17
    2225
    23 #define  d_trace_carte          16
    24 #define  d_pointage             17
    25 #define  d_foyer                18
     26#define  d_trace_carte          19
     27#define  d_pointage             20
     28#define  d_foyer                21
     29
     30
     31
     32
     33//----------------------------------  menu  trace_tout  -----------------------------------
     34#define menu_trace_tout_id  65                  //  le id du menu dans la ressource
     35
     36
     37void exec_menu_trace_tout(int fen,int item,double valeur,...);   //  prototype de la fonction
     38
     39#define  d_trace_temperature    1
     40#define  d_trace_bolos          2
     41#define  d_trace_gyros          3
    2642
    2743
  • trunk/Poubelle/archediab.old/archediab.sources/h/senseur_stellaire.h

    r639 r649  
     1
     2#define dbufsz 15
     3#define MAXFOUNDSTARS 20
     4
     5extern int diodesbuffer[dbufsz][48];
     6extern float zfoundstars[MAXFOUNDSTARS];
     7extern float mfoundstars[MAXFOUNDSTARS];
     8extern double tfoundstars[MAXFOUNDSTARS];
     9extern int nfoundstars;
    110
    211
     
    918void exec_senseur_stellaire(int fen,int item,double valeur,...);   //  prototype de la fonction
    1019
    11 // liste des items de la fenetre (4) items
     20// liste des items de la fenetre (14) items
    1221
    13 #define  sst_azer                  1     //   edit texte
    14 #define  sst_sortie_brute          3     //   controle
    15 #define  sst_prem_diode            4     //   controle
     22#define  sst_txt                   1     //   edit texte
     23#define  sst_autolock              3     //   controle
     24#define  sst_etoiles               4     //   controle
     25#define  sst_radar                 5     //   controle
     26#define  sst_efface                6     //   controle
     27#define  sst_periode               7     //   edit texte
     28#define  sst_labper                8     //   static texte
     29#define  sst_twobars               9     //   controle
     30#define  sst_labphase              10     //   static texte
     31#define  sst_phase                 11     //   edit texte
     32#define  sst_sens_horaire          12     //   controle
     33#define  sst_labseuil              13     //   static texte
     34#define  sst_seuil                 14     //   edit texte
    1635
    1736//fin_id
     37
     38
     39
  • trunk/Poubelle/archediab.old/archediab.sources/h/structure.h

    r637 r649  
    3434                                short   don_bolo[nb_max_bolo];                   
    3535                                char    sync[nb_sync];                                  // les synchro en cara (6 signaux)
     36                                double  gyro[3];
    3637                                } F_donne;       
    3738
  • trunk/Poubelle/archediab.old/archediab.sources/h/tm.h

    r637 r649  
    164164
    165165        int                     nb_lec_fofo_int;        //  nombre maxi de lectures dans la fifo en un coups d'interrupt
    166         int                     nb_lec_fofo_ext;        //  communication avec le prog principal: remis a zero apres lecture
    167                
     166        int                     val_con_fifo;           
     167        int                     val_con_donnee;         
     168        int                     val_con_pile;           
     169        int                     val_con_erreur;         
    168170        int                     signal_scan_immediat;   //  signal scan immediat pour savoir avant
    169171
  • trunk/Poubelle/archediab.old/archediab.sources/h/trace_tout.h

    r637 r649  
    11#define max_couleur 10
     2#define nb_max_trace    nb_max_bolo+3
     3
    24typedef struct
    35        {
    4         double y[nb_max_bolo+1];
    5         double f1[nb_max_bolo+1];
    6         double f2[nb_max_bolo+1];
     6        double y[nb_max_trace];
     7        double f1[nb_max_trace];
     8        double f2[nb_max_trace];
    79        int moyenne,ipas;
    810        double fmini,fmaxi;
  • trunk/Poubelle/archediab.old/archeops.c

    r645 r649  
    1 #include "manip.h"
     1
     2
     3#include "manip.h"     
     4
    25#include "archeops.h"
    36
    47
    58
    6 /**********  coefficients  pour  les  mesures  bolo    ********************************/
    7 /*                         toutes les puissances en pW                                */
    8 /*      -1-     loi de reponse thermique des bolos  avec R en ohms et T en Kelvin     */
     9/* sauve vol trapani 2eme config de vol   */
     10
     11
     12
     13/**********  coefficients  pour  les  mesures  bolo    **********************************/
     14
     15/*                         toutes les puissances en pW                                  */
     16
     17/*      -1-     loi de reponse thermique des bolos  avec R en ohms et T en Kelvin               */
     18
     19/*                                                                                      */
     20
     21/*      T =  coef2  *   (   ln (  R / coef1) **  ( -1 / coef0 )                             */
     22
     23/*                                                                                      */
     24
     25/*      -2-     fuite thermique du bolo   coef 3,4                                              */
     26
     27/*                                                                                      */
     28
     29/*      Ptot =  coef3  *  ( (10*Tb) ** coef4    -    (10*Tcryo)  **  coef4 )                */
     30
     31/*                                                                                      */
     32
     33/*      -3-     calcul empirique de Pciel et de  tau      coef  5,6                             */
     34
     35/*                                                                                      */
     36
     37/*      Pciel   =       coef5   - Pelec         coef5= I * Ai (tables xavier)                       */
     38
     39/*      tau     =       - ln ( 1 +  Pciel / coef6 )     coef6= I * Bi (tables xavier)                   */
     40
     41/*                                                                                                                          */
     42
     43/* Pour les thermometres 1 à 4 (germanium et carbone Allan-Bradley)                         */
     44
     45/* les coefficients sont utilisés differemment, ils permettent de convertir                 */
     46
     47/* R vers T             ( c(6) est un offset sur la mesure de R par rapport  aux mesures 4 fils)*/
     48
     49/*   llR= log(log(R - c(6))-c(0))                                                                               */
     50
     51/*    T = exp(c(1) + c(2)* llR + c(3)* llR* llR + c(4)* llR* llR* llR +                 */
     52
     53/*            c(5)* llR* llR* llR* llR)                                                 */
     54
     55/*                                                                                                                              */
     56
     57/*      version vol Trapani                                                                                                     */
     58
     59/*      on corrige le biais de temperature coef2=1.1 old,  coef3=old/1.1^coef4              */
     60
     61/*                                                                                                                              */
     62
     63/*                                                                                                                              */
     64
     65/*                                                                                                                              */
     66
     67/*                                                                                                                              */
     68
     69/*                                                                                                                              */
     70
     71/****************************************************************************************/
     72
     73
     74
     75
     76
     77/**************************************************************************************/
     78
    979/*                                                                                    */
    10 /*      T =  coef2  *   (   ln (  R / coef1) **  ( -1 / coef0 )                       */
     80
     81/*   pour les MLPA      :  gain = 100   diviseur = 101  ou  330                       */
     82
     83/*   pour les bebodiff  :  gain = diviseur = 100Kohm / R preampli                     */
     84
     85/*   pour les bebodiff  :  la capa est corrigee d'un facteur 0.868                    */
     86
     87/*   pour les cartes modifiees : mettre diviseur=0                                    */
     88
     89/*                         et capa = la resistance de chage en Megohm                 */
     90
    1191/*                                                                                    */
    12 /*      -2-     fuite thermique du bolo   coef 3,4                                    */
    13 /*                                                                                    */
    14 /*      Ptot =  coef3  *  ( (10*Tb) ** coef4    -    (10*Tcryo)  **  coef4 )          */
    15 /*                                                                                    */
    16 /*      -3-     calcul empirique de Pciel et de  tau      coef  5,6                   */
    17 /*                                                                                    */
    18 /*      Pciel   =       coef5   - Pelec         coef5= I * Ai (tables xavier)         */
    19 /*      tau     =       - ln ( 1 +  Pciel / coef6 )     coef6= I * Bi (tables xavier) */
    20 /*                                                                                    */
    21 /* Pour les thermometres 1 à 4 (germanium et carbone Allan-Bradley)                   */
    22 /* les coefficients sont utilisés differemment, ills permettent de convertir          */
    23 /* R vers T                                                                           */
    24 /*   llR= log(log(R)-c(0))                                                            */
    25 /*    T = exp(c(1) + c(2)* llR + c(3)* llR* llR + c(4)* llR* llR* llR +               */
    26 /*            c(5)* llR* llR* llR* llR)                                               */
    27 /*                                                                                    */
     92
    2893/**************************************************************************************/
    2994
    3095
    31 /**************************************************************************************/
    32 /*                                                                                    */
    33 /*   pour les MLPA      :  gain = 100   diviseur = 101  ou  330                       */
    34 /*   pour les bebodiff  :  gain = diviseur = 100Kohm / R preampli                     */
    35 /*   pour les bebodiff  :  la capa est corrigee d'un facteur 0.868                    */
    36 /*   pour les cartes modifiees : mettre diviseur=0                                    */
    37 /*                         et capa = la resistance de chage en Megohm                 */
    38 /*                                                                                    */
    39 /**************************************************************************************/
     96
    4097
    4198
    4299/*  numero_nom,  on/off  ,  0 = MLPA       , N° bolo , gain_pa  , capa*1000 , diviseur , coef*10000 */
     100
    43101/*       ,  0 ou 1  ,  2..8 = BEBO    ,  hard   ,           ,  4700     ,  333     ,            */
     102
    44103/*                     10 = Bediff    ,         ,           ,                                   */
    45104
     105
     106
    46107/* pour les bediff (code 10)  le n° de bolo est  N° de bebo*8  +  numero dans la bebo           */
     108
    47109/*  soit :  1 2 3 4 5 6  ..  9 10 11 12 13 14 .. 17 18 19 20 21 22 .. etc                       */
    48110
    49111
     112
     113
     114
    50115/*debut_param*/
     116
    51117/*----------------------------------  fenetre :  -----------------------------------*/
    52118
    53 param_bolo  parametr={27,24,36,88,18,
     119
     120
     121/* ------------------------ configuration de vol 5 juillet 99-----------------------------*/
     122
     123param_bolo  parametr={28,24,36,88,18,
     124
     125
    54126
    55127{
    56 {  0    , 2,10,1 ,  200, 22000  ,  200 },       
    57 { 10    , 1,10,2 ,  200, 22000  ,  200 },
    58 {  8    , 1,10,3 ,  200, 22000  ,  200 },
    59 {  0    , 2,10,4 ,  200, 22000  ,  200 },
    60 
    61 {  2    , 1,10,5 , 1000, 4700   , 1000 },
    62 {  0    , 2,10,6 , 1000, 4700   , 1000 },
    63 {  4    , 1,10,9 , 1000, 4700   , 1000 },
    64 {  0    , 2,10,10, 1000, 4700   , 1000 },
    65 
    66 { 10    , 1,10,11, 1000, 4700   , 1000 },
    67 {  7    , 1,10,12, 1000, 4700   , 1000 },
    68 {  0    , 1,10,13, 1000, 4700   , 1000 },
    69 { 17    , 1,10,14, 1000, 4700   , 1000 },
    70 
    71 {  3    , 1,10,17, 1000, 4700   , 1000 },
    72 {  1    , 1,10,18, 1000, 4700   , 1000 },
    73 {  5    , 1,10,19, 1000, 4700   , 1000 },
    74 {  0    , 1,10,20, 1000, 4700   , 1000 },
    75 
    76 { 13    , 1,10,21,  500, 22000  ,  500 },
    77 { 14    , 1,10,22,  500, 22000  ,  500 },
    78 { 15    , 1,10,25,  500, 22000  ,  500 },
    79 { 16    , 1,10,26,  500, 22000  ,  500 },
    80 
    81 { 21    , 3,10,27, 1000, 22000  ,    0 },
    82 { 22    , 3,10,28, 1000, 1000   ,    0 },
    83 { 23    , 3,10,29, 1000, 1000   ,    0 },
    84 { 19    , 3,10,30, 1000, 1000   ,    0 },
     128
     129{ 11    , 2,10, 1 , 200, 22000  ,  200 },       /*      1       */
     130
     131{  9    , 1,10, 2 , 200, 22000  ,  200 },
     132
     133{  8    , 1,10, 3 , 200, 22000  ,  200 },
     134
     135{ 14    , 2,10, 4 , 200, 22000  ,  200 },
     136
     137
     138
     139{  5    , 1,10, 5 ,1000,  4700  , 1000 },       /*      5       */
     140
     141{  0    , 2,10, 6 ,1000,  4700  , 1000 },
     142
     143{ 10    , 1,10, 9 ,1000,  4700  , 1000 },
     144
     145{  0    , 2,10,10, 1000,  4700  , 1000 },
     146
     147
     148
     149{  2    , 1,10,11, 1000,  4700  , 1000 },       /*      9       */
     150
     151{  4    , 1,10,12, 1000,  4700  , 1000 },
     152
     153{  7    , 2,10,13, 1000,  4700  , 1000 },
     154
     155{  1    , 1,10,14, 1000,  4700  , 1000 },
     156
     157
     158
     159{ 13    , 1,10,17, 1000,  4700  , 1000 },       /*      13      */
     160
     161{  3    , 1,10,18, 1000,  4700  , 1000 },
     162
     163{ 12            , 1,10,19, 1000,  4700  , 1000 },
     164
     165{  6    , 1,10,20, 1000,  4700  , 1000 },
     166
     167
     168
     169{ 15    , 1,10,21,  200, 22000  ,  200 },       /*      17      */
     170
     171{ 16    , 1,10,22,  200, 22000  ,  200 },
     172
     173{ 17    , 1,10,25,  500, 22000  ,  500 },
     174
     175{ 18    , 2,10,26,  500, 22000  ,  500 },
     176
     177
     178
     179{ 20    , 3,10,27, 1000, 22000  ,    0 },       /*      21      */
     180
     181{ 21    , 3,10,28, 1000,  1000  ,    0 },
     182
     183{ 22    , 3,10,29, 1000,  1000  ,    0 },
     184
     185{ 23    , 3,10,30, 1000,  1000  ,    0 },
     186
     187
    85188
    86189},
     190
    87191{
    88 { "Niente"    , { 5000  ,  0 , 0,   0,0,0,0} },                 
    89 { "ch1-bolo1"  , { 5000  ,  600000 , 140000,  80000, 25000, 0, 0}  },           
    90 { "ch1-bolo2"  , { 5000  ,  600000 , 140000,  60000, 25000, 0, 0}  },
    91 { "ch1-bolo3"  , { 5000  ,  600000 , 140000,  65000, 25000, 0, 0}  },
    92 { "ch2-bolo4"  , { 5000  ,  600000 , 140000,  90000, 25000, 0, 0}  },
    93 
    94 { "ch2-bolo5"  , { 5000  ,  600000 , 140000, 100000, 25000, 0, 0}  },   
    95 { "ch2-bolo6"  , { 5000  ,  600000 , 140000, 110000, 25000, 0, 0}  },
    96 { "Dum100mK1"  , { 5000  ,  588000 , 125000,  0,0,0,0} },
     192
     193{ "Niente   "    , { 5000  ,  0 , 0,   0,0,0,0} },                      /*      0       */
     194
     195{ "ch1-bolo1"  , { 5000  ,  600000 , 154000,  63039, 25000, 0, 0}  },           /*      1       */     
     196
     197{ "ch1-bolo2"  , { 5000  ,  600000 , 154000,  47279, 25000, 0, 0}  },
     198
     199{ "ch1-bolo3"  , { 5000  ,  600000 , 154000,  51219, 25000, 0, 0}  },
     200
     201{ "ch2-bolo4"  , { 5000  ,  600000 , 154000,  70919, 25000, 0, 0}  },
     202
     203{ "ch2-bolo5"  , { 5000  ,  600000 , 154000,  78799, 25000, 0, 0}  },   
     204
     205{ "ch3-bolo6"  , { 5000  ,  600000 , 154000,  86678, 25000, 0, 0}  },
     206
     207
     208
     209{ "Dum100mK1"  , { 5000  ,  588000 , 125000,  0,0,0,0} },                               /*      7       */
     210
    97211{ "Dum100mK2"  , { 5000  ,  588000 , 125000,  0,0,0,0} },
    98212
    99 { "Dum100mK3"  , { 5000  , 1361800 , 125000,  0,0,0,0} },               
    100 { "Dum100mK4"  , { 5000  , 1361800 , 125000,  0,0,0,0} },               
    101 { "Lou100mK1"  , { 5000  , 5680000 , 560000,  0,0,0,0} },
     213/*{ "Dum100mK3"  , { 5000  , 1361800 , 125000,  0,0,0,0} },             */
     214
     215{ "Dum100mK4"  , { 5000  , 1361800 , 125000,  0,0,0,0} },                           /* 9 */
     216
     217/*{ "Dum100mK5"  , { 5000  , 1361800 , 125000,  0,0,0,0} },             */
     218
     219{ "Dum100mK6"  , { 5000  , 1361800 , 125000,  0,0,0,0} },               
     220
     221
     222
     223{ "Lou100mK1"  , { 5000  , 5680000 , 560000,  0,0,0,0} },                   /* 11 */
     224
    102225{ "Lou100mK2"  , { 5000  , 5680000 , 560000,  0,0,0,0} },
    103226
    104 { "Lou1.6K5"   , { 5000  ,  0 , 0,   0,0,0,0} }, 
    105 { "Lou1.6K6"   , { 5000  ,  0 , 0,   0,0,0,0} }, 
    106 { "Lou10K7"    , { 5000  ,  0 , 0,   0,0,0,0} }, 
    107 { "Lou10K8"    , { 5000  ,  0 , 0,   0,0,0,0} },
    108 
    109 { "R10MOhm"    , { 5000  ,  0 , 0,   0,0,0,0} }, 
    110 { "bedif18"     , { 5000  , 123100 , 334200,  0,0,0,0} },
    111 { "v1-bedif19"  , { 5000  , 123100 , 334200,  0,0,0,0} },
    112 { "therm_10k"   , { 45000 ,  28907 , 16028 , -1327 , 1472 , 872, 0} },         
    113 
    114 { "germanium"   , {     0 ,  30719 ,  -910 ,-16389 , 2927 ,   0, 0} },   
    115 { "therm_4k"    , { 45000 ,  28907 , 16028 , -1327 , 1472 , 872, 0} },
    116 { "therm_1.6k"  , { 45000 ,  28907 , 16028 , -1327 , 1472 , 872, 0} },
     227{ "Lou100mK3"  , { 5000  , 5680000 , 560000,  0,0,0,0} },
     228
     229{ "Lou100mK4"  , { 5000  , 5680000 , 560000,  0,0,0,0} },
     230
     231
     232
     233{ "Lou1.6K5 "  , { 5000  ,  0 , 0,   0,0,0,0} },                                                /*      15      */
     234
     235{ "Lou1.6K6 "  , { 5000  ,  0 , 0,   0,0,0,0} }, 
     236
     237{ "Lou10K7  "  , { 5000  ,  0 , 0,   0,0,0,0} }, 
     238
     239{ "Lou10K8  "  , { 5000  ,  0 , 0,   0,0,0,0} },
     240
     241
     242
     243{ "R10MOhm  "  , { 5000  ,  0 , 0,   0,0,0,0} },                                                        /*      19      */
     244
     245
     246
     247/* La germanium doit toujours etre en premier par rapport aux autres thermos absolus */
     248
     249{ "germanium"  , {     0 ,  30719 ,   -910 , -16389 , 2927 ,   0,      0} }, /* 20      */
     250
     251{ "therm_4k"   , { 45000 ,  28907 , -16028 ,  -1327 , 1472 , 872,  52500} },
     252
     253{ "therm_1.6k" , { 45000 ,  28907 , -16028 ,  -1327 , 1472 , 872, 566700} },
     254
     255{ "therm_10k"  , { 45000 ,  28907 , -16028 ,  -1327 , 1472 , 872, 138100} },
     256
     257
    117258
    118259}
    119260
     261
     262
    120263};
     264
    121265/*fin_param*/
    122266
     267
     268
    123269/* Definition Mai-Juin 1999
     270
    124271{
     272
    125273{ "v1-bedif1"  , 1,10,1 ,  200, 22000   ,  200,  { 5000  , 123100 , 334200,0,0,0,0} },         
     274
    126275{ "v1-bedif2"  , 1,10,2 ,  200, 22000   ,  200,  {  500  , 136180 ,   9010,0,0,0,0} },
     276
    127277{ "v1-bedif3"  , 1,10,3 ,  200, 22000   ,  200,  {  500  , 136180 ,   9010,0,0,0,0} },
     278
    128279{ "v1-bedif4"  , 1,10,4 ,  200, 22000   ,  200,  { 5000  , 123100 , 334200,0,0,0,0} },
     280
    129281{ "v1-bedif5"  , 1,10,5 , 1000, 4700    , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     282
    130283{ "v1-bedif6"  , 1,10,6 , 1000, 4700    , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
    131284
     285
     286
    132287{ "v1-bedif7"  , 1,10,9 , 1000, 4700    , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     288
    133289{ "v1-bedif8"  , 1,10,10, 1000, 4700    , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     290
    134291{ "v1-bedif9"  , 1,10,11, 1000, 4700    , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     292
    135293{ "v1-bedif10" , 1,10,12, 1000, 4700    , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     294
    136295{ "v1-bedif11" , 1,10,13, 1000, 4700    , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     296
    137297{ "v1-bedif12" , 1,10,14, 1000, 4700    , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
    138298
     299
     300
    139301{ "v1-bedif13"  , 1,10,17, 1000, 100000 , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     302
    140303{ "v1-bedif14"  , 1,10,18, 1000, 470000 , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     304
    141305{ "bedif15"     , 1,10,19, 1000, 470000 , 1000,  {  500  ,  58800 ,  12500,0,0,0,0} },
     306
    142307{ "bedif16"     , 1,10,20, 1000,2200000 , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     308
    143309{ "bedif17"     , 1,10,21, 1000, 4700   , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     310
    144311{ "bedif18"     , 1,10,22, 1000, 4700   , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
    145312
     313
     314
    146315{ "v1-bedif19"  , 2,10,25, 1000, 4700   , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     316
    147317{ "v1-bedif20"  , 2,10,26, 1000, 4700   , 1000,  { 5000  , 123100 , 334200,0,0,0,0} },
     318
    148319{ "germanium"   , 3,10,27, 1000, 22000  ,    0,  { 3500  ,  17100 , 646500,0,0,0,0} },
     320
    149321{ "therm_4k"    , 3,10,28, 1000, 1000   ,    0,  {12000  ,1804000 ,  72800,0,0,0,0} },
     322
    150323{ "therm_1.6k"  , 3,10,29, 1000, 1000   ,    0,  {12000  ,1804000 ,  72800,0,0,0,0} },
     324
    151325{ "therm_10k"   , 3,10,30, 1000, 1000   ,    0,  {12000  ,1804000 ,  72800,0,0,0,0} },
    152326
     327
     328
    153329}*/
    154330
     331
     332
    155333/* bolos campagne 1998-1999     */
     334
    156335/*
     336
    157337reg_NbSi.J, 1, 0, 1, 100, 4.7, 333,     .5                      ,519.6  , 8.286
     338
    158339v1-231...L, 1, 0, 2, 100, 4.7, 333, .5   , 1.7   , 32.41 , 0.333 , 10  , 20.30  ,  11.41               
     340
    159341v1-232...N, 1, 0, 3, 100, 4.7, 333,             
     342
    160343v1-237...E, 1, 0, 4, 100, 4.7, 333,
    161344
     345
     346
    162347reg_JamieO, 1, 0, 5, 100, 4.7, 101,
    163348
     349
     350
    164351V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5   ,433.8  , 9.25
     352
    165353V2-230...B, 1, 0, 7, 100, 4.7, 333, .5   , 8.26  , 26.61 , 5.10  ,  7  , 9.354   ,  1.026
     354
    166355V2-205...Q, 1, 0, 8, 100, 4.7, 333,     .518 , 81    , 25.2
     356
    167357V2-208...P, 1, 0, 9, 100, 4.7, 333, .5   , 12.31 , 33.42 , 0.627 , 6.5 , 8.113   ,  2.958
    168358
     359
     360
    169361*/
     362
    170363/*bolos campagne 1997-1998      */
     364
    171365/*
    172366
     367
     368
    173369v1-208...J, 1, 0, 1, 100, 4.7, 333, .5   , 12.31 , 33.42               
     370
    174371v1-232...L, 1, 0, 2, 100, 4.7, 333,             
     372
    175373v1-205...N, 1, 0, 3, 100, 4.7, 333,     .518 , 81    , 25.2     
     374
    176375v1-NbSi..E, 1, 0, 4, 100, 4.7, 333,     .5                      ,519.6  , 8.286
     376
    177377Jamie....O, 1, 0, 5, 100, 4.7, 101,
     378
    178379V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5   ,433.8  , 9.25
     380
    179381V2-224...B, 1, 0, 7, 100, 4.7, 333, .5   ,3.43   , 26.6
     382
    180383V2-230...Q, 1, 0, 8, 100, 4.7, 333, .5   , 8.26  , 26.61
     384
    181385V2-231...P, 1, 0, 9, 100, 4.7, 333, .5   , 1.7   , 32.41
    182386
     387
     388
    183389*/
    184390
    185391
     392
     393
     394
    186395int mode_transmission_telemesure[nb_modes_telemesure][nb_type_blocks]= {
    187396
     397
     398
    188399/* enregisteur de bord flash :  plafond standard nominal        */
    189 /* 0*/  { 0,10,15,50, 10,50, 0, 0, 0, 0, 0, 0, 1, 1, 1,2500, 0, 0, 0, 0},
    190 
    191 /* 1*/  { 0,10,10, 1, 10, 3, 0, 0, 0, 0, 0, 0, 1, 1, 4,2500, 0, 0, 0, 0},
    192 
    193 /* 2*/  { 0,10,05,01, 10,06, 0, 0, 0, 0, 0, 0, 1, 1, 2,2500, 0, 0, 0, 0},
     400
     401/* 0*/  { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0},
     402
     403
     404
     405/* 1*/  { 0,10,10, 1, 10, 3, 0, 0, 0, 1, 0, 0, 1, 0, 4,2500, 0, 0, 0, 0},
     406
     407
     408
     409/* 2*/  { 0,10,05,01, 10,06, 0, 0, 0, 1, 0, 0, 1, 0, 2,2500, 0, 0, 0, 0},
     410
     411
    194412
    195413/* 3*/  { 0,10, 1,25, 10, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0},
    196414
     415
     416
    197417/* 4*/  { 0,10,15,50, 10,25, 0, 0, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
    198418
     419
     420
    199421/* 5*/  { 0,10,15,50, 10,25, 0, 0, 0, 0, 1, 0, 0, 0, 0,2500, 0, 0, 0, 0},
    200422
     423
     424
    201425/* 6*/  { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 2,2500, 0, 0, 0, 0},
    202426
    203 /* 7*/  { 0,10,15,50,100,50,1, 1, 0, 0, 0, 0, 1, 1, 1,2500, 0, 0, 0, 0},
    204 
    205 /* 8*/  { 0,10,15,50,100,50,1, 1, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
    206 
    207 /* 9*/  { 0,10, 1, 1,100, 1,0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0}
     427
     428
     429/* 7*/  { 0,10,15,50,100,50, 1, 1, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0},
     430
     431
     432
     433/* 8*/  { 0,10,15,50,100,50, 1, 1, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
     434
     435
     436
     437/* 9*/  { 0,10, 1, 1,100, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0}
     438
     439
    208440
    209441 };
     
    211443
    212444
     445
     446
     447
     448
    213449int mode_transmission_flash[nb_modes_flash][nb_type_blocks]= {
    214450
    215451
     452
     453
     454
    216455/* enregisteur de bord flash : nominal  */
     456
    217457/* 0*/  { 0,50,15,25, 10,25, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0} ,
    218458
     459
     460
    219461/* enregisteur de bord flash : minimum  */
     462
    220463/* 1*/  { 0,50,50,50,50,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0} ,
    221464
     465
     466
    222467/* enregisteur de bord flash :  rien    */
     468
    223469/* 2*/  { 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   0, 0, 0, 0, 0} };
    224470
     
    231477
    232478
    233 
    234 
    235 
    236 
    237 
    238 
    239 
    240 
    241 
    242 
    243479/*debut_nom_reglage*/
    244 /* 0->a chaud complet*/
    245 /* 1->a froid pour V(I)*/
    246 /* 2->cc*/
    247 /* 3->a chaud complet*/
    248 /* 4->chaud avec synchro*/
    249 /* 5->reglage 5  */
    250 /* 6->reglage 6  */
    251 /* 7->reglage 7  */
     480
     481/* 0->1 - demarrage par defaut - Nominal*/
     482
     483/* 1->2 - idem*/
     484
     485/* 2->3 - faible courant*/
     486
     487/* 3->4 - fort courant*/
     488
     489/* 4->5 - non fffdéfini*/
     490
     491/* 5->6 - non défini*/
     492
     493/* 6->7 - non défini*/
     494
     495/* 7->8 - non défini*/
     496
    252497/*fin_nom_reglage*/
    253498
     
    303548
    304549
     550
     551
     552
     553
     554
     555
     556
     557
     558
     559
     560
     561
     562
    305563reglage_bolo  reglage_standard[8]={{
    306564
    307565
     566
     567
     568
    308569/*debut reglage 0 */
     570
    309571#ifdef programme
    310 {30,76,9,1},{
     572
     573{32,76,8,1},{
     574
    311575{20,0}
    312 ,{-1148225771,229380}
    313 ,{-1148367339,294916}
    314 ,{20,0}
    315 ,{21,221185}
    316 ,{21,0}
    317 ,{21,245761}
    318 ,{20,0}
    319 ,{21,245761}
    320 ,{277,253953}
    321 ,{20,0}
    322 ,{21,204801}
    323 ,{21,19457}
    324 ,{21,1}
    325 ,{11501589,8708}
    326 ,{20,0}
    327 ,{-100647916,0}
    328 ,{1015828,0}
    329 ,{20,0}
    330 ,{20,0}
     576
     577,{1311522837,256000}
     578
     579,{1048576021,256004}
     580
     581,{20,0}
     582
     583,{1048576021,256001}
     584
     585,{20,0}
     586
     587,{262144021,128003}
     588
     589,{20,0}
     590
     591,{262144021,128001}
     592
     593,{262144021,128001}
     594
     595,{20,0}
     596
     597,{1048576021,256257}
     598
     599,{1048576021,256003}
     600
     601,{262144021,128001}
     602
     603,{262144789,128001}
     604
     605,{262144021,128001}
     606
     607,{100663317,256002}
     608
     609,{100716053,155650}
     610
     611,{1048576277,256003}
     612
     613,{20,0}
     614
     615,{1024021,0}
     616
     617,{262165,0}
     618
     619,{65557,0}
     620
     621,{1024020,0}
     622
     623},{
     624
     625{1,21,16,4}
     626
     627,{1,21,13,4}
     628
     629,{1,21,20,4}
     630
     631,{1,21,20,4}
     632
     633,{0,21,0,4}
     634
     635,{0,21,0,4}
     636
     637},{
     638
     639{3,1,21,24,21,24,0}
     640
     641,{0,1,9,1,0,0,0}
     642
     643,{0,1,9,1,0,0,0}
     644
     645,{6,1,9,34,30,0,65326}
     646
     647},{5,3,129,108,0,126,104,88}
     648
     649#else
     650
     651{1,8,76,32},{
     652
     653{20,0}
     654
     655,{1311522837,256000}
     656
     657,{1048576021,256004}
     658
     659,{20,0}
     660
     661,{1048576021,256001}
     662
     663,{20,0}
     664
     665,{262144021,128003}
     666
     667,{20,0}
     668
     669,{262144021,128001}
     670
     671,{262144021,128001}
     672
     673,{20,0}
     674
     675,{1048576021,256257}
     676
     677,{1048576021,256003}
     678
     679,{262144021,128001}
     680
     681,{262144789,128001}
     682
     683,{262144021,128001}
     684
     685,{100663317,256002}
     686
     687,{100716053,155650}
     688
     689,{1048576277,256003}
     690
     691,{20,0}
     692
     693,{1024021,0}
     694
     695,{262165,0}
     696
     697,{65557,0}
     698
     699,{1024020,0}
     700
     701},{
     702
     703{4,16,21,1}
     704
     705,{4,13,21,1}
     706
     707,{4,20,21,1}
     708
     709,{4,20,21,1}
     710
     711,{4,0,21,0}
     712
     713,{4,0,21,0}
     714
     715},{
     716
     717{24,21,1,3,0,24,21}
     718
     719,{1,9,1,0,0,0,0}
     720
     721,{1,9,1,0,0,0,0}
     722
     723,{34,9,1,6,65326,0,30}
     724
     725},{108,129,3,5,88,104,126,0}
     726
     727#endif
     728
     729/*fin_reglage*/
     730
     731
     732
     733
     734
     735},{
     736
     737
     738
     739/*debut reglage 1 */
     740
     741#ifdef programme
     742
     743{32,76,8,1},{
     744
     745{20,0}
     746
     747,{1311522837,256000}
     748
     749,{1048576021,256004}
     750
     751,{20,0}
     752
     753,{1048576021,256001}
     754
     755,{20,0}
     756
     757,{262144021,128003}
     758
     759,{20,0}
     760
     761,{262144021,128001}
     762
     763,{262144021,128001}
     764
     765,{20,0}
     766
     767,{1048576021,256257}
     768
     769,{1048576021,256003}
     770
     771,{262144021,128001}
     772
     773,{262144789,128001}
     774
     775,{262144021,128001}
     776
     777,{100663317,256002}
     778
     779,{100716053,155650}
     780
     781,{1048576277,256003}
     782
     783,{20,0}
     784
     785,{1024021,0}
     786
     787,{262165,0}
     788
     789,{65557,0}
     790
     791,{1024020,0}
     792
     793},{
     794
     795{1,21,16,4}
     796
     797,{1,21,13,4}
     798
     799,{1,21,20,4}
     800
     801,{1,21,20,4}
     802
     803,{0,21,0,4}
     804
     805,{0,21,0,4}
     806
     807},{
     808
     809{3,1,21,24,21,24,0}
     810
     811,{0,1,9,1,0,0,0}
     812
     813,{0,1,9,1,0,0,0}
     814
     815,{6,1,9,34,30,0,65326}
     816
     817},{5,3,129,108,0,126,104,88}
     818
     819#else
     820
     821{1,8,76,32},{
     822
     823{20,0}
     824
     825,{1311522837,256000}
     826
     827,{1048576021,256004}
     828
     829,{20,0}
     830
     831,{1048576021,256001}
     832
     833,{20,0}
     834
     835,{262144021,128003}
     836
     837,{20,0}
     838
     839,{262144021,128001}
     840
     841,{262144021,128001}
     842
     843,{20,0}
     844
     845,{1048576021,256257}
     846
     847,{1048576021,256003}
     848
     849,{262144021,128001}
     850
     851,{262144789,128001}
     852
     853,{262144021,128001}
     854
     855,{100663317,256002}
     856
     857,{100716053,155650}
     858
     859,{1048576277,256003}
     860
     861,{20,0}
     862
     863,{1024021,0}
     864
     865,{262165,0}
     866
     867,{65557,0}
     868
     869,{1024020,0}
     870
     871},{
     872
     873{4,16,21,1}
     874
     875,{4,13,21,1}
     876
     877,{4,20,21,1}
     878
     879,{4,20,21,1}
     880
     881,{4,0,21,0}
     882
     883,{4,0,21,0}
     884
     885},{
     886
     887{24,21,1,3,0,24,21}
     888
     889,{1,9,1,0,0,0,0}
     890
     891,{1,9,1,0,0,0,0}
     892
     893,{34,9,1,6,65326,0,30}
     894
     895},{108,129,3,5,88,104,126,0}
     896
     897#endif
     898
     899/*fin_reglage*/
     900
     901
     902
     903},{
     904
     905
     906
     907/*debut reglage 2 */
     908
     909#ifdef programme
     910
     911{32,76,8,1},{
     912
     913{20,0}
     914
     915,{100721941,256000}
     916
     917,{1048607509,256004}
     918
     919,{20,0}
     920
     921,{1048586773,256003}
     922
     923,{20,0}
     924
     925,{50335509,128001}
     926
     927,{20,0}
     928
     929,{50331669,128001}
     930
     931,{50336789,128001}
     932
     933,{20,0}
     934
     935,{1048622101,256259}
     936
     937,{1048635413,256003}
     938
     939,{50331669,128001}
     940
     941,{50352661,128001}
     942
     943,{50337813,128001}
     944
     945,{100665109,256002}
     946
     947,{100664597,155650}
     948
     949,{1048600341,256003}
     950
     951,{20,0}
     952
     953,{1024021,0}
     954
     955,{65557,0}
     956
     957,{65557,0}
     958
     959,{262165,0}
     960
     961},{
     962
     963{1,21,11,4}
     964
     965,{1,21,13,4}
     966
     967,{1,21,20,4}
     968
     969,{1,21,20,4}
     970
     971,{0,20,0,1}
     972
     973,{0,20,0,1}
     974
     975},{
     976
     977{3,1,21,24,21,24,0}
     978
     979,{0,1,9,1,0,0,0}
     980
     981,{0,1,9,1,0,0,0}
     982
     983,{6,17,0,34,30,0,65386}
     984
     985},{5,3,129,108,0,126,104,88}
     986
     987#else
     988
     989{1,8,76,32},{
     990
     991{20,0}
     992
     993,{100721941,256000}
     994
     995,{1048607509,256004}
     996
     997,{20,0}
     998
     999,{1048586773,256003}
     1000
     1001,{20,0}
     1002
     1003,{50335509,128001}
     1004
     1005,{20,0}
     1006
     1007,{50331669,128001}
     1008
     1009,{50336789,128001}
     1010
     1011,{20,0}
     1012
     1013,{1048622101,256259}
     1014
     1015,{1048635413,256003}
     1016
     1017,{50331669,128001}
     1018
     1019,{50352661,128001}
     1020
     1021,{50337813,128001}
     1022
     1023,{100665109,256002}
     1024
     1025,{100664597,155650}
     1026
     1027,{1048600341,256003}
     1028
     1029,{20,0}
     1030
     1031,{1024021,0}
     1032
     1033,{65557,0}
     1034
     1035,{65557,0}
     1036
     1037,{262165,0}
     1038
     1039},{
     1040
     1041{4,11,21,1}
     1042
     1043,{4,13,21,1}
     1044
     1045,{4,20,21,1}
     1046
     1047,{4,20,21,1}
     1048
     1049,{1,0,20,0}
     1050
     1051,{1,0,20,0}
     1052
     1053},{
     1054
     1055{24,21,1,3,0,24,21}
     1056
     1057,{1,9,1,0,0,0,0}
     1058
     1059,{1,9,1,0,0,0,0}
     1060
     1061,{34,0,17,6,65386,0,30}
     1062
     1063},{108,129,3,5,88,104,126,0}
     1064
     1065#endif
     1066
     1067/*fin_reglage*/
     1068
     1069
     1070
     1071},{
     1072
     1073
     1074
     1075/*debut reglage 3 */
     1076
     1077#ifdef programme
     1078
     1079{32,76,8,1},{
     1080
     1081{20,0}
     1082
     1083,{100721941,256000}
     1084
     1085,{1048607509,256004}
     1086
     1087,{20,0}
     1088
     1089,{1048586773,256003}
     1090
     1091,{20,0}
     1092
     1093,{524291861,128001}
     1094
     1095,{20,0}
     1096
     1097,{524288021,128001}
     1098
     1099,{524293141,128001}
     1100
     1101,{20,0}
     1102
     1103,{1048622101,256259}
     1104
     1105,{1048635413,256003}
     1106
     1107,{524288021,128001}
     1108
     1109,{524309013,128001}
     1110
     1111,{524294165,128001}
     1112
     1113,{100665109,256002}
     1114
     1115,{100664597,155650}
     1116
     1117,{1048600341,256003}
     1118
     1119,{20,0}
     1120
     1121,{1024021,0}
     1122
     1123,{65557,0}
     1124
     1125,{65557,0}
     1126
     1127,{65557,0}
     1128
     1129},{
     1130
     1131{1,21,18,4}
     1132
     1133,{1,21,13,4}
     1134
     1135,{1,21,20,4}
     1136
     1137,{1,21,20,4}
     1138
     1139,{0,20,0,1}
     1140
     1141,{0,20,0,1}
     1142
     1143},{
     1144
     1145{3,1,21,24,21,24,0}
     1146
     1147,{0,1,9,1,0,0,0}
     1148
     1149,{0,1,9,1,0,0,0}
     1150
     1151,{6,17,0,34,30,0,65386}
     1152
     1153},{5,3,129,108,0,126,104,88}
     1154
     1155#else
     1156
     1157{1,8,76,32},{
     1158
     1159{20,0}
     1160
     1161,{100721941,256000}
     1162
     1163,{1048607509,256004}
     1164
     1165,{20,0}
     1166
     1167,{1048586773,256003}
     1168
     1169,{20,0}
     1170
     1171,{524291861,128001}
     1172
     1173,{20,0}
     1174
     1175,{524288021,128001}
     1176
     1177,{524293141,128001}
     1178
     1179,{20,0}
     1180
     1181,{1048622101,256259}
     1182
     1183,{1048635413,256003}
     1184
     1185,{524288021,128001}
     1186
     1187,{524309013,128001}
     1188
     1189,{524294165,128001}
     1190
     1191,{100665109,256002}
     1192
     1193,{100664597,155650}
     1194
     1195,{1048600341,256003}
     1196
     1197,{20,0}
     1198
     1199,{1024021,0}
     1200
     1201,{65557,0}
     1202
     1203,{65557,0}
     1204
     1205,{65557,0}
     1206
     1207},{
     1208
     1209{4,18,21,1}
     1210
     1211,{4,13,21,1}
     1212
     1213,{4,20,21,1}
     1214
     1215,{4,20,21,1}
     1216
     1217,{1,0,20,0}
     1218
     1219,{1,0,20,0}
     1220
     1221},{
     1222
     1223{24,21,1,3,0,24,21}
     1224
     1225,{1,9,1,0,0,0,0}
     1226
     1227,{1,9,1,0,0,0,0}
     1228
     1229,{34,0,17,6,65386,0,30}
     1230
     1231},{108,129,3,5,88,104,126,0}
     1232
     1233#endif
     1234
     1235/*fin_reglage*/
     1236
     1237
     1238
     1239},{
     1240
     1241
     1242
     1243/*debut reglage 4 */
     1244
     1245#ifdef programme
     1246
     1247{39,62,9,1},{
     1248
     1249{20,0}
     1250
     1251,{-100659180,229382}
     1252
     1253,{-100659436,294918}
     1254
     1255,{20,0}
     1256
     1257,{-100663276,221189}
     1258
     1259,{-100663276,5}
     1260
     1261,{-100659436,245762}
     1262
     1263,{-100663276,5}
     1264
     1265,{-100658154,245761}
     1266
     1267,{-100658156,253954}
     1268
     1269,{20,0}
     1270
     1271,{-100663276,204805}
     1272
     1273,{-100663276,16389}
     1274
     1275,{-100656874,1}
     1276
     1277,{-100656874,16385}
     1278
     1279,{-100663276,3}
     1280
     1281,{-100506347,6}
     1282
     1283,{-100509675,6}
     1284
     1285,{-100372972,6}
     1286
     1287,{2097174,0}
     1288
    3311289,{1024022,0}
    332 ,{25622,0}
    333 ,{-100395499,0}
    334 ,{25622,0}
    335 },{
    336 {0,0,128,1}
    337 ,{0,0,128,4}
    338 ,{0,0,128,4}
    339 ,{0,0,128,3}
    340 ,{0,0,128,4}
    341 ,{0,0,128,4}
    342 },{
     1290
     1291,{16406,0}
     1292
     1293,{4117,0}
     1294
     1295,{262164,0}
     1296
     1297},{
     1298
     1299{2,22,24,1}
     1300
     1301,{1,20,24,4}
     1302
     1303,{0,20,24,4}
     1304
     1305,{0,20,24,3}
     1306
     1307,{0,20,24,4}
     1308
     1309,{0,20,24,4}
     1310
     1311},{
     1312
    3431313{0,1,9,1,0,0,0}
     1314
    3441315,{0,1,9,1,0,0,0}
     1316
    3451317,{0,1,9,1,0,0,0}
     1318
    3461319,{0,1,9,1,0,0,0}
    347 },{1,3,129,108,3,126,104,88}
     1320
     1321},{2,3,129,108,2,126,104,88}
     1322
    3481323#else
    349 {1,9,76,30},{
     1324
     1325{1,9,62,39},{
     1326
    3501327{20,0}
    351 ,{-1148225771,229380}
    352 ,{-1148367339,294916}
    353 ,{20,0}
    354 ,{21,221185}
    355 ,{21,0}
    356 ,{21,245761}
    357 ,{20,0}
    358 ,{21,245761}
    359 ,{277,253953}
    360 ,{20,0}
    361 ,{21,204801}
    362 ,{21,19457}
    363 ,{21,1}
    364 ,{11501589,8708}
    365 ,{20,0}
    366 ,{-100647916,0}
    367 ,{1015828,0}
    368 ,{20,0}
    369 ,{20,0}
     1328
     1329,{-100659180,229382}
     1330
     1331,{-100659436,294918}
     1332
     1333,{20,0}
     1334
     1335,{-100663276,221189}
     1336
     1337,{-100663276,5}
     1338
     1339,{-100659436,245762}
     1340
     1341,{-100663276,5}
     1342
     1343,{-100658154,245761}
     1344
     1345,{-100658156,253954}
     1346
     1347,{20,0}
     1348
     1349,{-100663276,204805}
     1350
     1351,{-100663276,16389}
     1352
     1353,{-100656874,1}
     1354
     1355,{-100656874,16385}
     1356
     1357,{-100663276,3}
     1358
     1359,{-100506347,6}
     1360
     1361,{-100509675,6}
     1362
     1363,{-100372972,6}
     1364
     1365,{2097174,0}
     1366
    3701367,{1024022,0}
    371 ,{25622,0}
    372 ,{-100395499,0}
    373 ,{25622,0}
    374 },{
    375 {1,128,0,0}
    376 ,{4,128,0,0}
    377 ,{4,128,0,0}
    378 ,{3,128,0,0}
    379 ,{4,128,0,0}
    380 ,{4,128,0,0}
    381 },{
     1368
     1369,{16406,0}
     1370
     1371,{4117,0}
     1372
     1373,{262164,0}
     1374
     1375},{
     1376
     1377{1,24,22,2}
     1378
     1379,{4,24,20,1}
     1380
     1381,{4,24,20,0}
     1382
     1383,{3,24,20,0}
     1384
     1385,{4,24,20,0}
     1386
     1387,{4,24,20,0}
     1388
     1389},{
     1390
    3821391{1,9,1,0,0,0,0}
     1392
    3831393,{1,9,1,0,0,0,0}
     1394
    3841395,{1,9,1,0,0,0,0}
     1396
    3851397,{1,9,1,0,0,0,0}
    386 },{108,129,3,1,88,104,126,3}
     1398
     1399},{108,129,3,2,88,104,126,2}
     1400
    3871401#endif
     1402
    3881403/*fin_reglage*/
    3891404
    390 },{
    391 
    392 /*debut reglage 1 */
     1405
     1406
     1407},{
     1408
     1409
     1410
     1411/*debut reglage 5 */
     1412
    3931413#ifdef programme
    394 {31,76,9,1},{
     1414
     1415{39,68,9,1},{
     1416
    3951417{20,0}
    396 ,{-1148225771,229380}
    397 ,{-1148367339,294916}
    398 ,{20,0}
    399 ,{2127959573,221185}
    400 ,{21,0}
    401 ,{2127892757,245761}
    402 ,{20,0}
    403 ,{2127991317,245761}
    404 ,{2127996181,253953}
    405 ,{20,0}
    406 ,{2128584725,204801}
    407 ,{2127780885,19457}
    408 ,{2127795221,1}
    409 ,{11501589,8708}
    410 ,{20,0}
    411 ,{-100647916,0}
    412 ,{1015828,0}
    413 ,{20,0}
    414 ,{20,0}
    415 ,{12822,0}
    416 ,{25622,0}
    417 ,{-100660714,0}
    418 ,{25622,0}
    419 },{
    420 {2,21,25,1}
    421 ,{0,20,0,4}
    422 ,{0,20,0,4}
    423 ,{0,21,23,3}
    424 ,{0,20,0,4}
    425 ,{0,20,0,4}
    426 },{
     1418
     1419,{1048982293,229382}
     1420
     1421,{1049128469,253958}
     1422
     1423,{20,0}
     1424
     1425,{1048966677,245765}
     1426
     1427,{20,0}
     1428
     1429,{262157846,245762}
     1430
     1431,{1048919829,5}
     1432
     1433,{262156054,245761}
     1434
     1435,{262154006,253954}
     1436
     1437,{20,0}
     1438
     1439,{1049123349,229381}
     1440
     1441,{1049157141,237573}
     1442
     1443,{262154262,1}
     1444
     1445,{262158614,16385}
     1446
     1447,{262149654,3}
     1448
     1449,{262750740,237572}
     1450
     1451,{262606612,122884}
     1452
     1453,{-1174095083,139270}
     1454
     1455,{20,0}
     1456
     1457,{16406,0}
     1458
     1459,{16406,0}
     1460
     1461,{4117,0}
     1462
     1463,{262164,0}
     1464
     1465},{
     1466
     1467{1,22,16,1}
     1468
     1469,{1,22,16,4}
     1470
     1471,{1,22,16,4}
     1472
     1473,{1,20,16,3}
     1474
     1475,{1,21,20,4}
     1476
     1477,{1,21,20,4}
     1478
     1479},{
     1480
    4271481{0,1,9,1,0,0,0}
     1482
    4281483,{0,1,9,1,0,0,0}
     1484
    4291485,{0,1,9,1,0,0,0}
     1486
    4301487,{0,1,9,1,0,0,0}
    431 },{129,3,129,108,3,126,104,88}
     1488
     1489},{2,3,129,108,3,126,104,88}
     1490
    4321491#else
    433 {1,9,76,31},{
     1492
     1493{1,9,68,39},{
     1494
    4341495{20,0}
    435 ,{-1148225771,229380}
    436 ,{-1148367339,294916}
    437 ,{20,0}
    438 ,{2127959573,221185}
    439 ,{21,0}
    440 ,{2127892757,245761}
    441 ,{20,0}
    442 ,{2127991317,245761}
    443 ,{2127996181,253953}
    444 ,{20,0}
    445 ,{2128584725,204801}
    446 ,{2127780885,19457}
    447 ,{2127795221,1}
    448 ,{11501589,8708}
    449 ,{20,0}
    450 ,{-100647916,0}
    451 ,{1015828,0}
    452 ,{20,0}
    453 ,{20,0}
    454 ,{12822,0}
    455 ,{25622,0}
    456 ,{-100660714,0}
    457 ,{25622,0}
    458 },{
    459 {1,25,21,2}
    460 ,{4,0,20,0}
    461 ,{4,0,20,0}
    462 ,{3,23,21,0}
    463 ,{4,0,20,0}
    464 ,{4,0,20,0}
    465 },{
     1496
     1497,{1048982293,229382}
     1498
     1499,{1049128469,253958}
     1500
     1501,{20,0}
     1502
     1503,{1048966677,245765}
     1504
     1505,{20,0}
     1506
     1507,{262157846,245762}
     1508
     1509,{1048919829,5}
     1510
     1511,{262156054,245761}
     1512
     1513,{262154006,253954}
     1514
     1515,{20,0}
     1516
     1517,{1049123349,229381}
     1518
     1519,{1049157141,237573}
     1520
     1521,{262154262,1}
     1522
     1523,{262158614,16385}
     1524
     1525,{262149654,3}
     1526
     1527,{262750740,237572}
     1528
     1529,{262606612,122884}
     1530
     1531,{-1174095083,139270}
     1532
     1533,{20,0}
     1534
     1535,{16406,0}
     1536
     1537,{16406,0}
     1538
     1539,{4117,0}
     1540
     1541,{262164,0}
     1542
     1543},{
     1544
     1545{1,16,22,1}
     1546
     1547,{4,16,22,1}
     1548
     1549,{4,16,22,1}
     1550
     1551,{3,16,20,1}
     1552
     1553,{4,20,21,1}
     1554
     1555,{4,20,21,1}
     1556
     1557},{
     1558
    4661559{1,9,1,0,0,0,0}
     1560
    4671561,{1,9,1,0,0,0,0}
     1562
    4681563,{1,9,1,0,0,0,0}
     1564
    4691565,{1,9,1,0,0,0,0}
    470 },{108,129,3,129,88,104,126,3}
     1566
     1567},{108,129,3,2,88,104,126,3}
     1568
    4711569#endif
     1570
    4721571/*fin_reglage*/
    4731572
    474 },{
    475 
    476 /*debut reglage 2 */
     1573
     1574
     1575},{
     1576
     1577
     1578
     1579/*debut reglage 6 */
     1580
    4771581#ifdef programme
     1582
    4781583{197,191,175,185},{
     1584
    4791585{0,0}
    480 ,{0,0}
    481 ,{0,0}
    482 ,{0,0}
    483 ,{0,0}
    484 ,{0,0}
    485 ,{0,0}
    486 ,{0,0}
    487 ,{0,0}
    488 ,{0,0}
    489 ,{0,0}
    490 ,{0,0}
    491 ,{0,0}
    492 ,{0,0}
    493 ,{0,0}
    494 ,{0,0}
    495 ,{0,0}
    496 ,{0,0}
    497 ,{0,0}
    498 ,{0,0}
    499 ,{0,0}
    500 ,{0,0}
    501 ,{0,0}
    502 ,{0,0}
    503 },{
     1586
     1587,{0,0}
     1588
     1589,{0,0}
     1590
     1591,{0,0}
     1592
     1593,{0,0}
     1594
     1595,{0,0}
     1596
     1597,{0,0}
     1598
     1599,{0,0}
     1600
     1601,{0,0}
     1602
     1603,{0,0}
     1604
     1605,{0,0}
     1606
     1607,{0,0}
     1608
     1609,{0,0}
     1610
     1611,{0,0}
     1612
     1613,{0,0}
     1614
     1615,{0,0}
     1616
     1617,{0,0}
     1618
     1619,{0,0}
     1620
     1621,{0,0}
     1622
     1623,{0,0}
     1624
     1625,{0,0}
     1626
     1627,{0,0}
     1628
     1629,{0,0}
     1630
     1631,{0,0}
     1632
     1633},{
     1634
    5041635{106,98,93,71}
     1636
    5051637,{66,74,87,66}
     1638
    5061639,{48,46,38,33}
     1640
    5071641,{40,41,33,26}
     1642
    5081643,{25,29,40,57}
     1644
    5091645,{63,62,71,80}
    510 },{
     1646
     1647},{
     1648
    5111649{83,79,75,75,92,112,31100}
     1650
    5121651,{125,126,117,113,107,94,20315}
     1652
    5131653,{108,116,122,124,117,120,32117}
     1654
    5141655,{110,99,94,98,107,93,17217}
     1656
    5151657},{88,82,94,108,111,126,104,88}
     1658
    5161659#else
     1660
    5171661{185,175,191,197},{
     1662
    5181663{0,0}
    519 ,{0,0}
    520 ,{0,0}
    521 ,{0,0}
    522 ,{0,0}
    523 ,{0,0}
    524 ,{0,0}
    525 ,{0,0}
    526 ,{0,0}
    527 ,{0,0}
    528 ,{0,0}
    529 ,{0,0}
    530 ,{0,0}
    531 ,{0,0}
    532 ,{0,0}
    533 ,{0,0}
    534 ,{0,0}
    535 ,{0,0}
    536 ,{0,0}
    537 ,{0,0}
    538 ,{0,0}
    539 ,{0,0}
    540 ,{0,0}
    541 ,{0,0}
    542 },{
     1664
     1665,{0,0}
     1666
     1667,{0,0}
     1668
     1669,{0,0}
     1670
     1671,{0,0}
     1672
     1673,{0,0}
     1674
     1675,{0,0}
     1676
     1677,{0,0}
     1678
     1679,{0,0}
     1680
     1681,{0,0}
     1682
     1683,{0,0}
     1684
     1685,{0,0}
     1686
     1687,{0,0}
     1688
     1689,{0,0}
     1690
     1691,{0,0}
     1692
     1693,{0,0}
     1694
     1695,{0,0}
     1696
     1697,{0,0}
     1698
     1699,{0,0}
     1700
     1701,{0,0}
     1702
     1703,{0,0}
     1704
     1705,{0,0}
     1706
     1707,{0,0}
     1708
     1709,{0,0}
     1710
     1711},{
     1712
    5431713{71,93,98,106}
     1714
    5441715,{66,87,74,66}
     1716
    5451717,{33,38,46,48}
     1718
    5461719,{26,33,41,40}
     1720
    5471721,{57,40,29,25}
     1722
    5481723,{80,71,62,63}
    549 },{
     1724
     1725},{
     1726
    5501727{75,75,79,83,31100,112,92}
     1728
    5511729,{113,117,126,125,20315,94,107}
     1730
    5521731,{124,122,116,108,32117,120,117}
     1732
    5531733,{98,94,99,110,17217,93,107}
     1734
    5541735},{108,94,82,88,88,104,126,111}
     1736
    5551737#endif
     1738
    5561739/*fin_reglage*/
    5571740
    558 },{
    559 
    560 /*debut reglage 3 */
     1741
     1742
     1743},{
     1744
     1745
     1746
     1747/*debut reglage 7 */
     1748
    5611749#ifdef programme
    562 {30,76,9,1},{
    563 {20,0}
    564 ,{-1149239274,229380}
    565 ,{-1149239275,294916}
    566 ,{20,0}
    567 ,{20,221185}
    568 ,{21,0}
    569 ,{20,245761}
    570 ,{20,0}
    571 ,{20,245761}
    572 ,{276,253953}
    573 ,{20,0}
    574 ,{20,204801}
    575 ,{20,19457}
    576 ,{20,1}
    577 ,{10486037,8708}
    578 ,{20,0}
    579 ,{-100647916,0}
    580 ,{1015828,0}
    581 ,{20,0}
    582 ,{20,0}
    583 ,{1024022,0}
    584 ,{25622,0}
    585 ,{-100660714,0}
    586 ,{25622,0}
    587 },{
    588 {0,20,0,1}
    589 ,{0,20,0,4}
    590 ,{0,20,0,4}
    591 ,{2,20,0,3}
    592 ,{0,20,0,4}
    593 ,{0,20,0,4}
    594 },{
    595 {0,1,9,1,0,0,0}
    596 ,{0,1,9,1,0,0,0}
    597 ,{0,1,9,1,0,0,0}
    598 ,{0,1,9,1,0,0,0}
    599 },{1,3,129,108,3,126,104,88}
     1750
     1751{197,191,175,185},{
     1752
     1753{0,0}
     1754
     1755,{0,0}
     1756
     1757,{0,0}
     1758
     1759,{0,0}
     1760
     1761,{0,0}
     1762
     1763,{0,0}
     1764
     1765,{0,0}
     1766
     1767,{0,0}
     1768
     1769,{0,0}
     1770
     1771,{0,0}
     1772
     1773,{0,0}
     1774
     1775,{0,0}
     1776
     1777,{0,0}
     1778
     1779,{0,0}
     1780
     1781,{0,0}
     1782
     1783,{0,0}
     1784
     1785,{0,0}
     1786
     1787,{0,0}
     1788
     1789,{0,0}
     1790
     1791,{0,0}
     1792
     1793,{0,0}
     1794
     1795,{0,0}
     1796
     1797,{0,0}
     1798
     1799,{0,0}
     1800
     1801},{
     1802
     1803{106,98,93,71}
     1804
     1805,{66,74,87,66}
     1806
     1807,{48,46,38,33}
     1808
     1809,{40,41,33,26}
     1810
     1811,{25,29,40,57}
     1812
     1813,{63,62,71,80}
     1814
     1815},{
     1816
     1817{83,79,75,75,92,112,31100}
     1818
     1819,{125,126,117,113,107,94,20315}
     1820
     1821,{108,116,122,124,117,120,32117}
     1822
     1823,{110,99,94,98,107,93,17217}
     1824
     1825},{88,82,94,108,111,126,104,88}
     1826
    6001827#else
    601 {1,9,76,30},{
    602 {20,0}
    603 ,{-1149239274,229380}
    604 ,{-1149239275,294916}
    605 ,{20,0}
    606 ,{20,221185}
    607 ,{21,0}
    608 ,{20,245761}
    609 ,{20,0}
    610 ,{20,245761}
    611 ,{276,253953}
    612 ,{20,0}
    613 ,{20,204801}
    614 ,{20,19457}
    615 ,{20,1}
    616 ,{10486037,8708}
    617 ,{20,0}
    618 ,{-100647916,0}
    619 ,{1015828,0}
    620 ,{20,0}
    621 ,{20,0}
    622 ,{1024022,0}
    623 ,{25622,0}
    624 ,{-100660714,0}
    625 ,{25622,0}
    626 },{
    627 {1,0,20,0}
    628 ,{4,0,20,0}
    629 ,{4,0,20,0}
    630 ,{3,0,20,2}
    631 ,{4,0,20,0}
    632 ,{4,0,20,0}
    633 },{
    634 {1,9,1,0,0,0,0}
    635 ,{1,9,1,0,0,0,0}
    636 ,{1,9,1,0,0,0,0}
    637 ,{1,9,1,0,0,0,0}
    638 },{108,129,3,1,88,104,126,3}
     1828
     1829{185,175,191,197},{
     1830
     1831{0,0}
     1832
     1833,{0,0}
     1834
     1835,{0,0}
     1836
     1837,{0,0}
     1838
     1839,{0,0}
     1840
     1841,{0,0}
     1842
     1843,{0,0}
     1844
     1845,{0,0}
     1846
     1847,{0,0}
     1848
     1849,{0,0}
     1850
     1851,{0,0}
     1852
     1853,{0,0}
     1854
     1855,{0,0}
     1856
     1857,{0,0}
     1858
     1859,{0,0}
     1860
     1861,{0,0}
     1862
     1863,{0,0}
     1864
     1865,{0,0}
     1866
     1867,{0,0}
     1868
     1869,{0,0}
     1870
     1871,{0,0}
     1872
     1873,{0,0}
     1874
     1875,{0,0}
     1876
     1877,{0,0}
     1878
     1879},{
     1880
     1881{71,93,98,106}
     1882
     1883,{66,87,74,66}
     1884
     1885,{33,38,46,48}
     1886
     1887,{26,33,41,40}
     1888
     1889,{57,40,29,25}
     1890
     1891,{80,71,62,63}
     1892
     1893},{
     1894
     1895{75,75,79,83,31100,112,92}
     1896
     1897,{113,117,126,125,20315,94,107}
     1898
     1899,{124,122,116,108,32117,120,117}
     1900
     1901,{98,94,99,110,17217,93,107}
     1902
     1903},{108,94,82,88,88,104,126,111}
     1904
    6391905#endif
     1906
    6401907/*fin_reglage*/
    6411908
    642 },{
    643 
    644 /*debut reglage 4 */
    645 #ifdef programme
    646 {30,76,9,1},{
    647 {20,0}
    648 ,{-1148225771,229380}
    649 ,{-1148367339,294916}
    650 ,{20,0}
    651 ,{21,221185}
    652 ,{21,0}
    653 ,{21,245761}
    654 ,{20,0}
    655 ,{21,245761}
    656 ,{277,253953}
    657 ,{20,0}
    658 ,{21,204801}
    659 ,{21,19457}
    660 ,{21,1}
    661 ,{11501589,8708}
    662 ,{20,0}
    663 ,{-100647916,0}
    664 ,{1015828,0}
    665 ,{20,0}
    666 ,{20,0}
    667 ,{1024022,0}
    668 ,{25622,0}
    669 ,{-100395499,0}
    670 ,{25622,0}
    671 },{
    672 {0,0,128,1}
    673 ,{0,0,128,4}
    674 ,{0,0,128,4}
    675 ,{0,0,128,3}
    676 ,{0,0,128,4}
    677 ,{0,0,128,4}
    678 },{
    679 {0,1,9,1,0,0,0}
    680 ,{0,1,9,1,0,0,0}
    681 ,{0,1,9,1,0,0,0}
    682 ,{0,1,9,1,0,0,0}
    683 },{1,3,129,108,3,126,104,88}
    684 #else
    685 {1,9,76,30},{
    686 {20,0}
    687 ,{-1148225771,229380}
    688 ,{-1148367339,294916}
    689 ,{20,0}
    690 ,{21,221185}
    691 ,{21,0}
    692 ,{21,245761}
    693 ,{20,0}
    694 ,{21,245761}
    695 ,{277,253953}
    696 ,{20,0}
    697 ,{21,204801}
    698 ,{21,19457}
    699 ,{21,1}
    700 ,{11501589,8708}
    701 ,{20,0}
    702 ,{-100647916,0}
    703 ,{1015828,0}
    704 ,{20,0}
    705 ,{20,0}
    706 ,{1024022,0}
    707 ,{25622,0}
    708 ,{-100395499,0}
    709 ,{25622,0}
    710 },{
    711 {1,128,0,0}
    712 ,{4,128,0,0}
    713 ,{4,128,0,0}
    714 ,{3,128,0,0}
    715 ,{4,128,0,0}
    716 ,{4,128,0,0}
    717 },{
    718 {1,9,1,0,0,0,0}
    719 ,{1,9,1,0,0,0,0}
    720 ,{1,9,1,0,0,0,0}
    721 ,{1,9,1,0,0,0,0}
    722 },{108,129,3,1,88,104,126,3}
     1909
     1910
     1911} };
     1912
     1913
     1914
     1915/* ------------------------------------   corps  des fonctions   ------------------------------ */
     1916
     1917/* -------------------------------------------------------------------------------------------- */
     1918
     1919
     1920
     1921
     1922
     1923
     1924
     1925unsigned int4   val_long(char x)
     1926
     1927{
     1928
     1929unsigned long a,xl;
     1930
     1931char aa;
     1932
     1933aa=x-2;
     1934
     1935a=aa;
     1936
     1937if(x<3)  xl=x;  else    xl=((a&1) + 2)<<(a>>1);
     1938
     1939return(xl);
     1940
     1941}
     1942
     1943
     1944
     1945
     1946
     1947double  val_double(char x)
     1948
     1949{
     1950
     1951unsigned long a,xl;
     1952
     1953if(x<0) x=-x;   a=x;    if(!a)  xl=0;   else    xl=((a&1) + 2)<<(a>>1);
     1954
     1955if(x>0) return(1e-4*(double)xl);        else    return(-1e-4*(double)xl);
     1956
     1957}
     1958
     1959
     1960
     1961int     new_val_dac(int a,char  code)
     1962
     1963{
     1964
     1965if(code&0x80)   a=(code&0x7f) <<5 ;
     1966
     1967else    {
     1968
     1969        if(code&0x40)   a+=code&0x3f;   
     1970
     1971        else            a-=code&0x3f;   
     1972
     1973        }
     1974
     1975return(a);
     1976
     1977}
     1978
     1979
     1980
     1981
     1982
     1983
     1984
     1985
     1986
     1987int     calcul_somme_block(block_type_modele* blk,int longueur)
     1988
     1989{
     1990
     1991int i,so=0;;
     1992
     1993for(i=0;i<(longueur/4-4);i++)  so^=(int)blk->mot[i];
     1994
     1995/* somme sur tous les mots internes     : on exclus le dbut, les codes et la fin        */
     1996
     1997return((so^(so>>16))&0xffff);
     1998
     1999}
     2000
     2001
     2002
     2003
     2004
     2005
     2006
     2007
     2008
     2009void  valide_block(block_type_modele* blk,int type,int block_num)
     2010
     2011{
     2012
     2013int somme,longueur;
     2014
     2015def_long_block
     2016
     2017longueur=long_block[type];
     2018
     2019/*printf("valide block adresse %x  type %d  numblock %d  longueur=%d \n" */
     2020
     2021/*              ,(unsigned)blk,type,block_num,longueur);*/
     2022
     2023blk->debut              =       debut_block_mesure;
     2024
     2025somme=0;blk->code1              =       (((long)longueur)<<16)  |       somme;
     2026
     2027blk->code2              =       (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
     2028
     2029
     2030
     2031blk->mot[longueur/4-4]  =       fin_block_mesure;
     2032
     2033
     2034
     2035#if defined(_ECC_LIB_H_)
     2036
     2037{
     2038
     2039int place_ecc;
     2040
     2041place_ecc=(longueur-4-ECC_SIZE-SIZE_HEAD-((longueur-4-SIZE_HEAD)/ECC_TOTAL)*ECC_SIZE)/4;
     2042
     2043SetEcc( blk, (unsigned char *) &(blk->mot[place_ecc] ) ) ;
     2044
     2045}
     2046
    7232047#endif
    724 /*fin_reglage*/
    725 
    726 },{
    727 
    728 /*debut reglage 5 */
    729 #ifdef programme
    730 {197,191,175,185},{
    731 {0,0}
    732 ,{0,0}
    733 ,{0,0}
    734 ,{0,0}
    735 ,{0,0}
    736 ,{0,0}
    737 ,{0,0}
    738 ,{0,0}
    739 ,{0,0}
    740 ,{0,0}
    741 ,{0,0}
    742 ,{0,0}
    743 ,{0,0}
    744 ,{0,0}
    745 ,{0,0}
    746 ,{0,0}
    747 ,{0,0}
    748 ,{0,0}
    749 ,{0,0}
    750 ,{0,0}
    751 ,{0,0}
    752 ,{0,0}
    753 ,{0,0}
    754 ,{0,0}
    755 },{
    756 {106,98,93,71}
    757 ,{66,74,87,66}
    758 ,{48,46,38,33}
    759 ,{40,41,33,26}
    760 ,{25,29,40,57}
    761 ,{63,62,71,80}
    762 },{
    763 {83,79,75,75,92,112,31100}
    764 ,{125,126,117,113,107,94,20315}
    765 ,{108,116,122,124,117,120,32117}
    766 ,{110,99,94,98,107,93,17217}
    767 },{88,82,94,108,111,126,104,88}
    768 #else
    769 {185,175,191,197},{
    770 {0,0}
    771 ,{0,0}
    772 ,{0,0}
    773 ,{0,0}
    774 ,{0,0}
    775 ,{0,0}
    776 ,{0,0}
    777 ,{0,0}
    778 ,{0,0}
    779 ,{0,0}
    780 ,{0,0}
    781 ,{0,0}
    782 ,{0,0}
    783 ,{0,0}
    784 ,{0,0}
    785 ,{0,0}
    786 ,{0,0}
    787 ,{0,0}
    788 ,{0,0}
    789 ,{0,0}
    790 ,{0,0}
    791 ,{0,0}
    792 ,{0,0}
    793 ,{0,0}
    794 },{
    795 {71,93,98,106}
    796 ,{66,87,74,66}
    797 ,{33,38,46,48}
    798 ,{26,33,41,40}
    799 ,{57,40,29,25}
    800 ,{80,71,62,63}
    801 },{
    802 {75,75,79,83,31100,112,92}
    803 ,{113,117,126,125,20315,94,107}
    804 ,{124,122,116,108,32117,120,117}
    805 ,{98,94,99,110,17217,93,107}
    806 },{108,94,82,88,88,104,126,111}
     2048
     2049
     2050
     2051somme=calcul_somme_block(blk,longueur);
     2052
     2053blk->code1              =       (((long)longueur)<<16)  |       somme;
     2054
     2055/* l'ecc est faux car on a change la somme: mettre la somme a zero avant de tester ecc  */
     2056
     2057}
     2058
     2059
     2060
     2061/* Quand on est sur une machine swappee, on ne cherche pas a verifier */
     2062
     2063/* le checksum, puisqu'on a modifie les blocs, sans swapper par exemple */
     2064
     2065/* les chars des noms de bolometres et des chaines GPS... */
     2066
     2067#ifdef __alpha
     2068
     2069#define SWAP
     2070
    8072071#endif
    808 /*fin_reglage*/
    809 
    810 },{
    811 
    812 /*debut reglage 6 */
    813 #ifdef programme
    814 {197,191,175,185},{
    815 {0,0}
    816 ,{0,0}
    817 ,{0,0}
    818 ,{0,0}
    819 ,{0,0}
    820 ,{0,0}
    821 ,{0,0}
    822 ,{0,0}
    823 ,{0,0}
    824 ,{0,0}
    825 ,{0,0}
    826 ,{0,0}
    827 ,{0,0}
    828 ,{0,0}
    829 ,{0,0}
    830 ,{0,0}
    831 ,{0,0}
    832 ,{0,0}
    833 ,{0,0}
    834 ,{0,0}
    835 ,{0,0}
    836 ,{0,0}
    837 ,{0,0}
    838 ,{0,0}
    839 },{
    840 {106,98,93,71}
    841 ,{66,74,87,66}
    842 ,{48,46,38,33}
    843 ,{40,41,33,26}
    844 ,{25,29,40,57}
    845 ,{63,62,71,80}
    846 },{
    847 {83,79,75,75,92,112,31100}
    848 ,{125,126,117,113,107,94,20315}
    849 ,{108,116,122,124,117,120,32117}
    850 ,{110,99,94,98,107,93,17217}
    851 },{88,82,94,108,111,126,104,88}
    852 #else
    853 {185,175,191,197},{
    854 {0,0}
    855 ,{0,0}
    856 ,{0,0}
    857 ,{0,0}
    858 ,{0,0}
    859 ,{0,0}
    860 ,{0,0}
    861 ,{0,0}
    862 ,{0,0}
    863 ,{0,0}
    864 ,{0,0}
    865 ,{0,0}
    866 ,{0,0}
    867 ,{0,0}
    868 ,{0,0}
    869 ,{0,0}
    870 ,{0,0}
    871 ,{0,0}
    872 ,{0,0}
    873 ,{0,0}
    874 ,{0,0}
    875 ,{0,0}
    876 ,{0,0}
    877 ,{0,0}
    878 },{
    879 {71,93,98,106}
    880 ,{66,87,74,66}
    881 ,{33,38,46,48}
    882 ,{26,33,41,40}
    883 ,{57,40,29,25}
    884 ,{80,71,62,63}
    885 },{
    886 {75,75,79,83,31100,112,92}
    887 ,{113,117,126,125,20315,94,107}
    888 ,{124,122,116,108,32117,120,117}
    889 ,{98,94,99,110,17217,93,107}
    890 },{108,94,82,88,88,104,126,111}
     2072
     2073#if defined(Linux)  || defined(linux)
     2074
     2075#define SWAP
     2076
    8912077#endif
    892 /*fin_reglage*/
    893 
    894 },{
    895 
    896 /*debut reglage 7 */
    897 #ifdef programme
    898 {197,191,175,185},{
    899 {0,0}
    900 ,{0,0}
    901 ,{0,0}
    902 ,{0,0}
    903 ,{0,0}
    904 ,{0,0}
    905 ,{0,0}
    906 ,{0,0}
    907 ,{0,0}
    908 ,{0,0}
    909 ,{0,0}
    910 ,{0,0}
    911 ,{0,0}
    912 ,{0,0}
    913 ,{0,0}
    914 ,{0,0}
    915 ,{0,0}
    916 ,{0,0}
    917 ,{0,0}
    918 ,{0,0}
    919 ,{0,0}
    920 ,{0,0}
    921 ,{0,0}
    922 ,{0,0}
    923 },{
    924 {106,98,93,71}
    925 ,{66,74,87,66}
    926 ,{48,46,38,33}
    927 ,{40,41,33,26}
    928 ,{25,29,40,57}
    929 ,{63,62,71,80}
    930 },{
    931 {83,79,75,75,92,112,31100}
    932 ,{125,126,117,113,107,94,20315}
    933 ,{108,116,122,124,117,120,32117}
    934 ,{110,99,94,98,107,93,17217}
    935 },{88,82,94,108,111,126,104,88}
    936 #else
    937 {185,175,191,197},{
    938 {0,0}
    939 ,{0,0}
    940 ,{0,0}
    941 ,{0,0}
    942 ,{0,0}
    943 ,{0,0}
    944 ,{0,0}
    945 ,{0,0}
    946 ,{0,0}
    947 ,{0,0}
    948 ,{0,0}
    949 ,{0,0}
    950 ,{0,0}
    951 ,{0,0}
    952 ,{0,0}
    953 ,{0,0}
    954 ,{0,0}
    955 ,{0,0}
    956 ,{0,0}
    957 ,{0,0}
    958 ,{0,0}
    959 ,{0,0}
    960 ,{0,0}
    961 ,{0,0}
    962 },{
    963 {71,93,98,106}
    964 ,{66,87,74,66}
    965 ,{33,38,46,48}
    966 ,{26,33,41,40}
    967 ,{57,40,29,25}
    968 ,{80,71,62,63}
    969 },{
    970 {75,75,79,83,31100,112,92}
    971 ,{113,117,126,125,20315,94,107}
    972 ,{124,122,116,108,32117,120,117}
    973 ,{98,94,99,110,17217,93,107}
    974 },{108,94,82,88,88,104,126,111}
     2078
     2079
     2080
     2081
     2082
     2083
     2084
     2085int  verifie_block(block_type_modele* blk)
     2086
     2087{
     2088
     2089int type,lg,som;
     2090
     2091def_long_block
     2092
     2093if(blk->debut != debut_block_mesure)                                    return(block_debut_erreur);
     2094
     2095type=type_block(blk);           if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);     
     2096
     2097lg=longueur_block(blk);         if( lg != long_block[type] )            return(block_longueur_erreur); 
     2098
     2099if( blk->mot[(lg/4)-4]  !=      fin_block_mesure)                       return(block_fin_erreur);       
     2100
     2101#ifndef SWAP
     2102
     2103som=calcul_somme_block(blk,lg); if( som!= somme_block(blk))             return(block_somme_erreur);
     2104
    9752105#endif
    976 /*fin_reglage*/
    977 
    978 } };
    979 
    980 /* ------------------------------------   corps  des fonctions   ------------------------------ */
    981 /* -------------------------------------------------------------------------------------------- */
    982 
    983 
    984 
    985 unsigned long   val_long(char x)
     2106
     2107return(block_correct);
     2108
     2109}
     2110
     2111
     2112
     2113
     2114
     2115int  verifie_block_printf(block_type_modele* blk)
     2116
    9862117{
    987 unsigned long a,xl;
    988 char aa;
    989 aa=x-2;
    990 a=aa;
    991 if(x<3)  xl=x;  else    xl=((a&1) + 2)<<(a>>1);
    992 return(xl);
     2118
     2119int type,lg,som;
     2120
     2121def_long_block
     2122
     2123def_nom_block
     2124
     2125if(blk->debut != debut_block_mesure)
     2126
     2127        {
     2128
     2129        printf(" erreur dans le code debut de block      \n");
     2130
     2131        return(block_debut_erreur);
     2132
     2133        }       
     2134
     2135
     2136
     2137type=type_block(blk);
     2138
     2139if( (type<0) || (type>nb_type_blocks) )
     2140
     2141        {
     2142
     2143        printf(" block de type %d  inconnu\n",type);
     2144
     2145        return(block_type_inconnu);
     2146
     2147        }
     2148
     2149
     2150
     2151lg=longueur_block(blk);
     2152
     2153if( lg!=long_block[type] )     
     2154
     2155        {
     2156
     2157        printf(" block type %s  erreur de longueur (nominal=%d , dans le block=%d \n"
     2158
     2159                        ,nom_block[type],long_block[type],lg);
     2160
     2161        return(block_longueur_erreur);
     2162
     2163        }
     2164
     2165
     2166
     2167som=calcul_somme_block(blk,lg);
     2168
     2169if( som!=somme_block(blk) )     
     2170
     2171        {
     2172
     2173        printf(" block type %s   :  erreur de somme (calculee=%d , dans le block=%d \n"
     2174
     2175                        ,nom_block[type],som,somme_block(blk) );
     2176
     2177        return(block_somme_erreur);
     2178
     2179        }
     2180
     2181       
     2182
     2183if(blk->mot[(lg/4)-4]   != fin_block_mesure)   
     2184
     2185        {
     2186
     2187        printf(" block type %s  erreur de code fin de block : trouve %x au lieu de %x \n"
     2188
     2189                        ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
     2190
     2191        return(block_fin_erreur);
     2192
     2193        }
     2194
     2195
     2196
     2197return(block_correct);
     2198
    9932199}
    9942200
    9952201
    996 double  val_double(char x)
    997 {
    998 unsigned long a,xl;
    999 if(x<0) x=-x;   a=x;    if(!a)  xl=0;   else    xl=((a&1) + 2)<<(a>>1);
    1000 if(x>0) return(1e-4*(double)xl);        else    return(-1e-4*(double)xl);
    1001 }
    1002 
    1003 int     new_val_dac(int a,char  code)
    1004 {
    1005 if(code&0x80)   a=(code&0x7f) <<5 ;
    1006 else    {
    1007         if(code&0x40)   a+=code&0x3f;   
    1008         else            a-=code&0x3f;   
    1009         }
    1010 return(a);
    1011 }
    1012 
    1013 
    1014 
    1015 
    1016 int     calcul_somme_block(block_type_modele* blk,int longueur)
    1017 {
    1018 int i,so=0;;
    1019 for(i=0;i<(longueur/4-4);i++)  so^=(int)blk->mot[i];
    1020 /* somme sur tous les mots internes     : on exclus le dbut, les codes et la fin        */
    1021 return((so^(so>>16))&0xffff);
    1022 }
    1023 
    1024 
    1025 
    1026 
    1027 void  valide_block(block_type_modele* blk,int type,int block_num)
    1028 {
    1029 int somme,longueur;
    1030 def_long_block
    1031 longueur=long_block[type];
    1032 /*printf("valide block adresse %x  type %d  numblock %d  longueur=%d \n" */
    1033 /*              ,(unsigned)blk,type,block_num,longueur);*/
    1034 blk->debut              =       debut_block_mesure;
    1035 blk->code2              =       (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
    1036 
    1037 blk->mot[longueur/4-4]  =       fin_block_mesure;
    1038 somme=calcul_somme_block(blk,longueur);
    1039 blk->code1              =       (((long)longueur)<<16)  |       somme;
    1040 }
    1041 
    1042 
    1043 
    1044 
    1045 int  verifie_block(block_type_modele* blk)
    1046 {
    1047 int type,lg,som;
    1048 def_long_block
    1049 if(blk->debut != debut_block_mesure)                                    return(block_debut_erreur);
    1050 type=type_block(blk);           if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);     
    1051 lg=longueur_block(blk);         if( lg != long_block[type] )            return(block_longueur_erreur); 
    1052 if( blk->mot[(lg/4)-4]  !=      fin_block_mesure)                       return(block_fin_erreur);       
    1053 som=calcul_somme_block(blk,lg); if( som!= somme_block(blk))             return(block_somme_erreur);
    1054 return(block_correct);
    1055 }
    1056 
    1057 
    1058 int  verifie_block_printf(block_type_modele* blk)
    1059 {
    1060 int type,lg,som;
    1061 def_long_block
    1062 def_nom_block
    1063 if(blk->debut != debut_block_mesure)
    1064         {
    1065         printf(" erreur dans le code debut de block      \n");
    1066         return(block_debut_erreur);
    1067         }       
    1068 
    1069 type=type_block(blk);
    1070 if( (type<0) || (type>nb_type_blocks) )
    1071         {
    1072         printf(" block de type %d  inconnu\n",type);
    1073         return(block_type_inconnu);
    1074         }
    1075 
    1076 lg=longueur_block(blk);
    1077 if( lg!=long_block[type] )     
    1078         {
    1079         printf(" block type %s  erreur de longueur (nominal=%d , dans le block=%d \n"
    1080                         ,nom_block[type],long_block[type],lg);
    1081         return(block_longueur_erreur);
    1082         }
    1083 
    1084 som=calcul_somme_block(blk,lg);
    1085 if( som!=somme_block(blk) )     
    1086         {
    1087         printf(" block type %s   :  erreur de somme (calculee=%d , dans le block=%d \n"
    1088                         ,nom_block[type],som,somme_block(blk) );
    1089         return(block_somme_erreur);
    1090         }
    1091        
    1092 if(blk->mot[(lg/4)-4]   != fin_block_mesure)   
    1093         {
    1094         printf(" block type %s  erreur de code fin de block : trouve %x au lieu de %x \n"
    1095                         ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
    1096         return(block_fin_erreur);
    1097         }
    1098 
    1099 return(block_correct);
    1100 }
    1101 
    1102 
    1103 
    1104 
    1105 
     2202
     2203
     2204
     2205
     2206
     2207
     2208
     2209
     2210
  • trunk/Poubelle/archediab.old/archeops.h

    r645 r649  
    77
    88#define         _archeops
    9 #define         version_num             27
    10 
    11 #if version_num>=27
     9#define         version_num             28
     10
     11/*  defini ici que si l'on n'a pas inclu ecclib.h qui contient les memes definitions */
     12#ifndef _ECC_LIB_H_
    1213#define ECC_TOTAL 255
    1314#define ECC_DATA 239       /* Nb de bytes de data encodes */
     
    1516#define SIZE_HEAD sizeof(int4)*3  /* 3 mots d'entete de blocs */
    1617#endif
     18
    1719/*======================================================================*/
    1820/*                                                                      */
     
    4850/*      erronnes.                                                       */
    4951/*                                                                      */
     52/*  VERSION 28:                                                         */
     53/*      - corrigée la taille du block gyroscope avec ecc                */
     54/*      - compatible avec la generation de l'ecc dans le transputer     */
     55/*      - mais sans ecc: trops long a calculer                          */
     56
    5057/*======================================================================*/
    5158
     
    180187#define         tc_dir_transputer               1
    181188#define         tc_dir_reset_epld               3
     189#define         tc_dir_reset_trp                4
    182190
    183191/*  -------------  codes  des  prefix des  telecommandes traités le transputer  --------------   */
     
    202210enum{tc2_reset_epld,tc2_bolo_dacV,tc2_bolo_dacI,tc2_bolo_dacT
    203211        ,tc2_bolo_dacL,tc2_bolo_gain,tc2_bolo_voie,tc2_horloge
    204         ,tc2_regul,tc2_auto_bolo,tc2_auto_dilu,tc2_dilution};   /* 12 codes: reste 4 disponibles*/
     212        ,tc2_regul,tc2_auto_bolo,tc2_auto_dilu,tc2_dilution
     213        ,tc2_raz_fet,tc2_reset};        /* 13 codes: reste 3 disponibles*/
    205214
    206215
     
    212221/*      code2=tc2_horloge       :                                                               */
    213222/*              soit un code defini                                                             */
    214 /*              soit le code tc3_vitesse+i avec i=0.. nb_type_block                             */
    215 enum{tc3_commande,tc3_periode,tc3_nb_mesures,tc3_temp_mort,tc3_flag,tc3_vitesse};
    216 /*#define       tc3_suite       tc3_vitesse+nb_type_block                                       */
     223enum{tc3_commande,tc3_periode,tc3_nb_mesures,tc3_temp_mort,tc3_flag};
    217224
    218225
     
    227234
    228235
    229 /*      code2=tc2_dilution      :                                               */
    230 
     236/*      code2=tc2_dilution      :       commandes setbit,clrbit                                                 */
     237enum{tc3_clr_bit_dil,tc3_set_bit_dil,tc3_fet_raz};
     238
     239/*      code2=tc2_reset :       commandes setbit,clrbit                                                 */
     240#define tc3_reset       13
     241#define tc4_reset       73
    231242
    232243/*______________________________________________________________________________*/
     
    337348
    338349        param_bolo      param;          /*      les parametres de mesure des bolometres         */
     350#ifdef _ECC_LIB_H_
    339351        unsigned char ecc[((((sizeof( param_bolo)+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     352#endif
    340353        int4            fin;            /*      code de reconnaissance de fin de block          */
    341354        }
     
    366379
    367380        ligne_journal   jj[long_page];  /*      block de 10 lignes de journal                   */
     381#ifdef _ECC_LIB_H_
    368382        unsigned char ecc[((((sizeof(ligne_journal)*long_page+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     383#endif
    369384
    370385        int4            fin;            /*      code de reconnaissance de fin de block          */
     
    513528#endif          /***********   fin des structures swappées       ****************/
    514529
    515 enum{regul_stop,regul_chauffage_null,regul_sans_deglitch,regul_avec_deglitch};
     530enum{regul_stop,regul_chauffage_null,regul_sans_deglitch,regul_avec_deglitch,stop_moteur,moteur_direct_p,moteur_regul_p,moteur_direct_m,moteur_regul_m};
    516531
    517532#define bit_piles_5V    1
     
    541556        int4            code2;          /*      code2 du block                                  */
    542557        reglage_bolo    reglage;                                                                                       
     558#ifdef _ECC_LIB_H_
    543559        unsigned char ecc[((((sizeof(reglage_bolo)+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     560#endif
    544561        int4            fin;            /*      code de reconnaissance de fin de block          */
    545562        }
     
    560577/*      int4            gyro_dil[3][nb_per_block*2];    les gyros  (block gyros)                */
    561578/*      int4            data_dil[50];    data brutes de la dilution                             */
     579#ifdef _ECC_LIB_H_
    562580        unsigned char ecc[((((sizeof(int4)*64+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     581#endif
    563582        int4            fin;            /*      code de reconnaissance de fin de block          */
    564583        }
     
    579598#define vanne_EVF               0x00040000      /*  10: commande vanne EVF      */
    580599#define chauffage1              0x00004000      /*  6: chauffage 1      */
    581 #define chauffage2              0x00002000      /*  6: chauffage 1      */
    582 #define chauffage3              0x00001000      /*  6: chauffage 1      */
    583 #define chauffage4              0x00000800      /*  6: chauffage 1      */
    584 #define chauffage5              0x00000400      /*  6: chauffage 1      */
    585 #define chauffage6              0x00000200      /*  6: chauffage 1      */
     600#define chauffage2              0x00002000      /*  5: chauffage 1      */
     601#define chauffage3              0x00001000      /*  4: chauffage 1      */
     602#define chauffage4              0x00000800      /*  3: chauffage 1      */
     603#define chauffage5              0x00000400      /*  2: chauffage 1      */
     604#define chauffage6              0x00000200      /*  1: chauffage 1      */
    586605#define chauffage7              0x00000100      /*  0: chauffage 7      */
     606
     607enum{nbit_chauffage7,nbit_chauffage6,nbit_chauffage5,nbit_chauffage4,nbit_chauffage3
     608        ,nbit_chauffage2,nbit_chauffage1,nbit_vanne_EVB,nbit_vanne_EVO
     609        ,nbit_vanne_EVV,nbit_vanne_EVF,nbit_switch_pile_par_15,nbit_switch_pile_par_5,nbit_switch_helium};
    587610
    588611/*  position des mesures sur les multiplexeurs          */
     
    595618/* multiplex21..28:*/,  mul21_  ,mul22  ,p_charb,p_R4   ,mul25_ ,p_C3   ,p_R3   ,t_a4   
    596619/* multiplex31..38:*/,  mul31_  ,p_C4   ,p_air  ,t_a3   ,t_b4   ,t_b1   ,t_b2   ,t_a1   
    597 /* multiplex41..48:*/,  t_b3    ,d_4He  ,RP_He  ,mul44  ,d_3He  ,j_he3  ,j_he7  ,j_he4 
     620/* multiplex41..48:*/,  t_b3    ,d_4He  ,RP_He  ,t_pile ,d_3He  ,j_he3  ,j_he7  ,j_he4 
    598621/* multiplex51..58:*/,  j_he5   ,j_he1  ,j_he8  ,j_he2  ,j_he6  ,pirani ,mul57  ,mul58 
    599622/* multiplex61..68:*/,  p_m18B  ,p_10B  ,p_m18D ,mul64  ,p_p18B ,p_10T  ,p_Ch   ,p_p18D         
    600623        };
    601624/* reste libres :  mul   12 - 21 - 22 - 25 -  31 - 44 - 57 - 58 - 64    */
     625/* T_A1 EST AUSSI LE DRIVER DU MOTEUR DE PIVOT   */
    602626
    603627#define  val_multiplex(qq)      (0.0003052*(double)((qq)-0x8000))       
     
    616640
    617641        char            gps[GPS_DATA];  /*      les données GPS (une chaine maxi 80 cara)       */
     642#ifdef _ECC_LIB_H_
    618643        unsigned char ecc[((((GPS_DATA+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     644#endif
    619645
    620646        int4            fin;            /*      code de reconnaissance de fin de block          */
     
    633659       
    634660        short           bol_per[nb_max_bolo][nb_max_mes_per];           
     661#ifdef _ECC_LIB_H_
    635662        unsigned char ecc[((((sizeof(short)*nb_max_bolo*nb_max_mes_per+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     663#endif
    636664
    637665        int4            fin;            /*      code de reconnaissance de fin de block          */
     
    647675        int4            code2;          /*      code2 du block                                  */
    648676        char            synchro[nb_per_block*2][nb_sync];       
     677#ifdef _ECC_LIB_H_
    649678        unsigned char ecc[((((nb_per_block*nb_sync*2+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     679#endif
    650680
    651681        int4            fin;            /*      code de reconnaissance de fin de block          */
     
    661691        int4            code2;          /*      code2 du block                                  */
    662692        char            comment[1024];
     693#ifdef _ECC_LIB_H_
    663694        unsigned char ecc[((((1024+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     695#endif
    664696        int4            fin;            /*      code de reconnaissance de fin de block          */
    665697        }
     
    678710        int4            data_bolo[nb_max_bolo][nb_per_block*2];
    679711                                        /*      data D.S.       (en mots de 32 bits)            */
     712#ifdef _ECC_LIB_H_
    680713        unsigned char ecc[((((sizeof(int4)*nb_max_bolo*nb_per_block*2+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     714#endif
    681715        int4            fin;            /*      code de reconnaissance de fin de block          */
    682716        }
    683717        block_type_bolo;                       
    684718
    685 /*  ---------------------   structures N° 9 :   données des gyroscopes et du magnétometre       */
     719/*  ---------------------   structures N° 9 :   données des gyroscopes */
    686720/*  -----------------------------------------------------------------------------------------   */
    687721typedef struct                           
     
    692726                                        /* chaque gyro: un vecteur tde 72 valeurs               */
    693727        int4            gyro[3][nb_per_block*2];
    694         int4            magneto[3];     /*      1 bit par echantillonage soit 3*32bit>72        */
    695         unsigned char ecc[((((sizeof(int4)*3*nb_per_block*2*3+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     728#ifdef _ECC_LIB_H_
     729        unsigned char ecc[((((sizeof(int4)*3*nb_per_block*2+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     730#endif
    696731        int4            fin;            /*      code de reconnaissance de fin de block          */
    697732        }
     
    707742        int4            sst[nb_per_block*2][18];
    708743                                        /* chaque mesure: un paquet de 18 mots de 32 bits       */
     744#ifdef _ECC_LIB_H_
    709745        unsigned char ecc[((((sizeof(int4)*nb_per_block*2*18+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     746#endif
    710747        int4            fin;            /*      code de reconnaissance de fin de block          */
    711748        }
     
    719756        int4            code1;          /*      code1 du block                                  */
    720757        int4            code2;          /*      code2 du block                                  */
     758#ifdef _ECC_LIB_H_
    721759        unsigned char ecc[((((SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     760#endif
    722761        int4            fin;            /*      code de reconnaissance de fin de block          */
    723762        }
     
    734773                                        /*      pour chaque bolo, un vecteur  19 mots           */
    735774        unsigned int4   data_bolo[nb_bolo_util][ (nb_per_block/2) +1 ];
     775#ifdef _ECC_LIB_H_
    736776        unsigned char ecc[((((sizeof(int4)*nb_bolo_util*((nb_per_block/2) +1)+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     777#endif
    737778
    738779        int4            fin;            /*      code de reconnaissance de fin de block          */
     
    749790                                        /*      nombre de mots = nb valeurs/4 +1                */
    750791        unsigned int4   gyro[3][ (nb_per_block/2) +1 ];
     792#ifdef _ECC_LIB_H_
    751793        unsigned char ecc[((((sizeof(int4)*3*((nb_per_block/2) +1)+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     794#endif
    752795        int4            fin;            /*      code de reconnaissance de fin de block          */
    753796        }
     
    763806                                        /*      pour chaque diode, un vecteur  11 mots          */
    764807        unsigned int4   sst[nb_photo_diodes] [(nb_per_block*2/7) +1 ];
     808#ifdef _ECC_LIB_H_
    765809        unsigned char ecc[((((sizeof(int4)*nb_photo_diodes*((nb_per_block*2/7) +1)+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     810#endif
    766811        int4            fin;            /*      code de reconnaissance de fin de block          */
    767812        }
     
    801846  int4 erreur ;   /* Si la commande a induit une erreur */
    802847  status_flash status ; /* etat de l'enregistreur */
     848#ifdef _ECC_LIB_H_
    803849  unsigned char ecc[((((sizeof(int4)*2 + sizeof(status_flash)+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     850#endif
    804851 
    805852  unsigned int4 fin ; /* code de reconnaissance de fin de block */
     
    814861
    815862  int4  commande; /* type de commande a l'enregistreur flash */
     863#ifdef _ECC_LIB_H_
    816864  unsigned char ecc[((((sizeof(int4)+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     865#endif
    817866
    818867  int4  fin;      /* code de reconnaissance de fin de block */
     
    848897#ifdef  transmet_data_brute
    849898        char            data[nb_per_block*nb_max_mes_per*nb_byte_mot];
     899#ifdef _ECC_LIB_H_
    850900        unsigned char ecc[((((nb_per_block*nb_max_mes_per*nb_byte_mot+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     901#endif
    851902#else
     903#ifdef _ECC_LIB_H_
    852904        unsigned char ecc[((((SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     905#endif
    853906#endif
    854907        int4            fin;            /*      code de reconnaissance de fin de block          */
     
    863916        int4            code1;          /*      code1 du block                                  */
    864917        int4            code2;          /*      code2 du block                                  */
     918#ifdef _ECC_LIB_H_
    865919        unsigned char ecc[((((SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     920#endif
    866921        int4            fin;            /*      code de reconnaissance de fin de block          */
    867922        }
     
    875930        int4            code1;          /*      code1 du block                                  */
    876931        int4            code2;          /*      code2 du block                                  */
     932#ifdef _ECC_LIB_H_
    877933        unsigned char ecc[((((SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     934#endif
    878935        int4            fin;            /*      code de reconnaissance de fin de block          */
    879936        }
     
    891948        int4            code2;          /*      code2 du block                                  */
    892949        int4            mot[(taille_maxi_block_archeops)/4];
     950#ifdef _ECC_LIB_H_
    893951        unsigned char ecc[((((sizeof(int4)*(taille_maxi_block_archeops/4)+SIZE_HEAD)/ECC_DATA)+1)*ECC_SIZE)] ;
     952#endif
    894953        int4            fin;            /* code de reconnaissance de fin de block               */
    895954        }
  • trunk/Poubelle/archediab.old/prog_compression_unsigned/compress.c

    r641 r649  
    99/*******************************************************************************************/
    1010
    11 int filtre[16]={0xfffffff,0xffffffe,0xffffffc,0xffffff8,
     11static int filtre[16]={0xfffffff,0xffffffe,0xffffffc,0xffffff8,
    1212                0xffffff0,0xfffffe0,0xfffffc0,0xfffff80,
    1313                0xfffff00,0xffffe00,0xffffc00,0xffff800,
  • trunk/Poubelle/archediab.old/prog_compression_unsigned/test_compress.c

    r641 r649  
    4444        if(i>40)        entree[i]+=500000.*exp(- 0.05*(i-40));
    4545//      if(i>40)        entree[i]+=200000.*exp(- 0.05*(i-40));
    46 //      entree[i]/=16;  //  entre 0 et 50 000  soit 16 bits
    47         entree[i]*=2;   // de 0 a 15 e6  soit 21 bits
     46        entree[i]/=16;  //  entre 0 et 50 000  soit 16 bits
     47//      entree[i]*=2;   // de 0 a 15 e6  soit 21 bits
    4848        }
    4949
     
    5252graph->couleur_trace=bleu;
    5353style(1);
     54retrace(1);
    5455
     56alerte(1,"");
    5557
    56 /*
    57 printf("comprime : ");
     58printf("comprime 4.1 avec lg=%d : ",lg);
    5859t=TickCount();
    5960for(i=0;i<1000;i++)       compress_4_1((unsigned long*)entree,(unsigned long*)comp,lg,1);
     
    6162y=0;for(i=0;i<lg;i++) {x=entree[i]-rec[i];y+=x*x;} y=sqrt(y/(double)lg);
    6263printf("fin de comprime 4_1  : t=%d   ecart total = %g  \n\n",TickCount()-t,y);
    63 */
    6464
    6565
     66/*
    6667printf("comprime : ");
    6768t=TickCount();
     
    7172printf("fin de comprime 4_2  : t=%d   ecart total = %g  \n\n",TickCount()-t,y);
    7273
    73 
     74*/
    7475/*
    7576printf("comprime : ");
Note: See TracChangeset for help on using the changeset viewer.