Changeset 407 in Sophya for trunk/Poubelle/archTOI.old/archeopsfile.cc
- Timestamp:
- Sep 18, 1999, 2:08:23 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Poubelle/archTOI.old/archeopsfile.cc
r405 r407 5 5 #define utilitaires_de_block_archeops 6 6 #include "archeopsfile.h" 7 #include "gyrohandler.h" 8 7 9 extern "C" { 8 10 #include "compress.h" … … 41 43 block_type_modele peekBlock; 42 44 43 SSTHandler sstHandler; 44 GPSParser gpsParser; 45 SSTHandler sstHandler; 46 GyroHandler gyroHandler; 47 GPSParser gpsParser; 45 48 }; 46 49 … … 85 88 86 89 BlockSet::BlockSet(BlockSet const& x) 87 : sstHandler(x.sstHandler) 90 : sstHandler(x.sstHandler), gyroHandler(x.gyroHandler) 88 91 { 89 92 lastParam = NULL; … … 567 570 blockSet->sstHandler.ProcessBlock((block_type_sst*)&blockSet->curBlock); 568 571 } 572 case block_gyro : { 573 blockSet->gyroHandler.ProcessBlock((block_type_gyro*)&blockSet->curBlock); 574 } 569 575 case block_gps : { 570 576 blockSet->gpsParser.ProcessBlock((block_type_gps*)&blockSet->curBlock); … … 673 679 static char* buffer = 0; 674 680 static int4 debswp = debut_block_mesure; 675 static int4 longmax = taille_maxi_block_archeops*20; 681 static int4 longmax = taille_maxi_block_archeops*20; 676 682 if (!buffer) { 677 683 buffer = new char[longmax]; … … 680 686 #endif 681 687 } 682 fseek(f,pos,SEEK_SET); 683 size_t read = fread(buffer,1,taille_maxi_block_archeops*2,f); 684 //if (read<taille_maxi_block_archeops*2) return -1; 685 for (int i=4; i<read; i+=4) { 686 if (*(int4*)(buffer+i) == debswp) { 687 cout << "trying to skip " << i << " bytes to pos="<<pos+i << endl; 688 return pos+i; 688 size_t read = longmax; 689 while (read == longmax) { 690 fseek(f,pos,SEEK_SET); 691 read = fread(buffer,1,longmax,f); 692 //if (read<taille_maxi_block_archeops*2) return -1; 693 // EA 150999 changed i+=4 to i++ -> unaligned, but can lose bytes in flight recorder 694 for (size_t i=4; i<read; i++) { 695 if (*(int4*)(buffer+i) == debswp) { 696 cout << "trying to skip " << i << " bytes to pos="<<pos+i << endl; 697 return pos+i; 698 } 689 699 } 700 pos += read; 690 701 } 691 702 cout << "cannot find block start" << endl; … … 758 769 } 759 770 771 int ArcheopsFile::getReglageBlockNum() { 772 if (!lastReglage()) return -1; 773 return numero_block(lastReglage()); 774 } 775 776 760 777 int ArcheopsFile::getSSTBlockNum() { 761 778 if (!lastSST()) return -1; … … 864 881 } 865 882 883 double ArcheopsFile::getGainAmpli(int ibolo) { 884 return gain_ampli(lastReglage()->reglage.bolo[ibolo]); 885 } 866 886 867 887 // SST, gyros... … … 895 915 } 896 916 897 long ArcheopsFile::getGyro(int igyro, int imesure) { 898 if (igyro<0 || igyro>2) return 0; 899 if (imesure<0 || imesure>= nb_per_block*2) return 0; 900 block_type_gyro* blk = lastGyro() ; 901 if (!blk) return 0; 902 #if version_num<=25 903 return blk->gyros[igyro][imesure]-32768.; 904 #else 905 return blk->gyro[igyro][imesure]-32768.; 906 #endif 907 } 917 long ArcheopsFile::getGyroRaw(int igyro, int imesure) { 918 return blockSet->gyroHandler.getRawSignal(imesure, igyro); 919 } 920 921 double ArcheopsFile::getGyroTens(int igyro, int imesure) { 922 return blockSet->gyroHandler.getSignal(imesure, igyro); 923 } 924 925 double ArcheopsFile::getGyroSpeed(int igyro, int imesure) { 926 return blockSet->gyroHandler.getSpeed(imesure, igyro); 927 } 928 929 908 930 909 931
Note:
See TracChangeset
for help on using the changeset viewer.