Advertisement
ciusss89

fileserver.h

Sep 27th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.72 KB | None | 0 0
  1. #ifndef FILESAVER_H_INCLUDED
  2. #define FILESAVER_H_INCLUDED
  3. #include <stdio.h>
  4. #include <iostream>
  5. #include <fcntl.h>
  6. #include <fstream>
  7. #include <fstream>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10.  
  11.  
  12. #define bmANT_SHORT 0x8000
  13. #define bmANT_NC    0x4000
  14. #define bmANT_OK    0x0000
  15.  
  16. //#define BUFFER_LEN  104
  17. #define BUFFER_LEN  100*16384
  18. #define bm4BIT_MODE     0x2000
  19. #define bmIF_MODE   0x1000
  20. #define bmAGC       0x8000
  21. #define bmANT_DET   0x4000
  22.  
  23. using namespace std;
  24. class FileSaver
  25. {
  26. private:
  27.     char *data;
  28.     char *iq_data;
  29.     unsigned int ui_dec;
  30.     char *name;
  31.     int fid;
  32.     int i_overflow;
  33.     unsigned int ui_pack;
  34.     char*  cp_buffer;
  35.     unsigned int ui_buffer_len;
  36.     unsigned int ui_buffer_pos;
  37.     char LUT_2bit[4] ;
  38.     char LUT_I_1bit[16];
  39.     char LUT_Q_1bit[16];
  40.     FILE *pfile;
  41.  
  42.  
  43. public:
  44.     FileSaver(void);
  45.     FileSaver(char *fname);
  46.     int open_file(char *name);
  47.     int open_file_r(char *name);
  48.     int close_file(void);
  49.     void set_decimate(unsigned int dec);
  50.     void set_fid(int i);
  51.     void init_buffer(void);
  52.     //int save_data(char *str, int nbytes, int mode);
  53.     //int save_data(short *shp, int nbytes, int mode);
  54.     int save_data(char *str, unsigned int nbytes, int  i_mode);
  55.     int save_data(short *stri, unsigned int nbytes);
  56.     int read_data(char *cp_str, int i_nbytes);
  57.     int unpack_data(char *cp_instr, char *cp_outstr, int i_bytes);
  58.     bool if_parse(char *buf, unsigned int N, char e_bits,int mode );
  59.     bool if_parse(short *shp, unsigned int N, char e_bits);
  60.     bool agc_parse(char *buf, short *agc, unsigned int agc_size, unsigned int *count, bool *RFI);
  61.     void FS_rewind(void);
  62.     void set_pack(unsigned int i);
  63.  
  64. };
  65.  
  66.  
  67. #endif // FILESAVER_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement