Changeset 3344 in ntrip
- Timestamp:
- Aug 20, 2011, 12:07:41 PM (13 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncrinex.cpp
r3343 r3344 773 773 } 774 774 775 string obsToStr(double val) { 775 // 776 //////////////////////////////////////////////////////////////////////////// 777 string bncRinex::obsToStr(double val, int width, int precision) { 776 778 if (val != 0.0) { 777 779 ostringstream str; 778 780 str.setf(ios::showpoint | ios::fixed); 779 str << setw( 14) << setprecision(3) << val;781 str << setw(width) << setprecision(precision) << val; 780 782 return str.str(); 781 783 } … … 794 796 str << obs.satSys << setw(2) << setfill('0') << obs.satNum << setfill(' '); 795 797 798 if (obs.satSys == 'R') { // Glonass 799 str << ' ' << setw(2) << obs.slotNum; 800 } 801 else { 802 str << " "; 803 } 804 796 805 if (obs.satSys == 'G') { // GPS 797 806 if (obs.has1C()) { 798 str << " 1C "807 str << " 1C " 799 808 << obsToStr(obs.C1) << ' ' 800 809 << obsToStr(obs.L1C) << ' ' 801 810 << obsToStr(obs.D1C) << ' ' 802 << obsToStr(obs.S1C ) << ' '811 << obsToStr(obs.S1C, 8, 3) << ' ' 803 812 << setw(2) << obs.slip_cnt_L1; 804 813 } 805 814 if (obs.has1P()) { 806 str << " 1W "815 str << " 1W " 807 816 << obsToStr(obs.P1) << ' ' 808 817 << obsToStr(obs.L1P) << ' ' 809 818 << obsToStr(obs.D1P) << ' ' 810 << obsToStr(obs.S1P ) << ' '819 << obsToStr(obs.S1P, 8, 3) << ' ' 811 820 << setw(2) << obs.slip_cnt_L1; 812 821 } 813 822 if (obs.has2P()) { 814 str << " 2P "823 str << " 2P " 815 824 << obsToStr(obs.P2) << ' ' 816 825 << obsToStr(obs.L2P) << ' ' 817 826 << obsToStr(obs.D2P) << ' ' 818 << obsToStr(obs.S2P ) << ' '827 << obsToStr(obs.S2P, 8, 3) << ' ' 819 828 << setw(2) << obs.slip_cnt_L2; 820 829 } 821 830 if (obs.has2C()) { 822 str << " 2X "831 str << " 2X " 823 832 << obsToStr(obs.C2) << ' ' 824 833 << obsToStr(obs.L2C) << ' ' 825 834 << obsToStr(obs.D2C) << ' ' 826 << obsToStr(obs.S2C ) << ' '835 << obsToStr(obs.S2C, 8, 3) << ' ' 827 836 << setw(2) << obs.slip_cnt_L2; 828 837 } 829 838 if (obs.has5C()) { 830 str << " 5C "839 str << " 5C " 831 840 << obsToStr(obs.C5) << ' ' 832 841 << obsToStr(obs.L5) << ' ' 833 842 << obsToStr(obs.D5) << ' ' 834 << obsToStr(obs.S5 ) << ' '843 << obsToStr(obs.S5, 8, 3) << ' ' 835 844 << setw(2) << obs.slip_cnt_L5; 836 845 } 837 846 } 838 847 else if (obs.satSys == 'R') { // Glonass 839 str << ' ' << setw(2) << obs.slotNum;840 848 if (obs.has1C()) { 841 str << " 1C "849 str << " 1C " 842 850 << obsToStr(obs.C1) << ' ' 843 851 << obsToStr(obs.L1C) << ' ' 844 852 << obsToStr(obs.D1C) << ' ' 845 << obsToStr(obs.S1C ) << ' '853 << obsToStr(obs.S1C, 8, 3) << ' ' 846 854 << setw(2) << obs.slip_cnt_L1; 847 855 } 848 856 if (obs.has1P()) { 849 str << " 1P "857 str << " 1P " 850 858 << obsToStr(obs.P1) << ' ' 851 859 << obsToStr(obs.L1P) << ' ' 852 860 << obsToStr(obs.D1P) << ' ' 853 << obsToStr(obs.S1P ) << ' '861 << obsToStr(obs.S1P, 8, 3) << ' ' 854 862 << setw(2) << obs.slip_cnt_L1; 855 863 } 856 864 if (obs.has2P()) { 857 str << " 2P "865 str << " 2P " 858 866 << obsToStr(obs.P2) << ' ' 859 867 << obsToStr(obs.L2P) << ' ' 860 868 << obsToStr(obs.D2P) << ' ' 861 << obsToStr(obs.S2P ) << ' '869 << obsToStr(obs.S2P, 8, 3) << ' ' 862 870 << setw(2) << obs.slip_cnt_L2; 863 871 } 864 872 if (obs.has2C()) { 865 str << " 2C "873 str << " 2C " 866 874 << obsToStr(obs.C2) << ' ' 867 875 << obsToStr(obs.L2C) << ' ' 868 876 << obsToStr(obs.D2C) << ' ' 869 << obsToStr(obs.S2C ) << ' '877 << obsToStr(obs.S2C, 8, 3) << ' ' 870 878 << setw(2) << obs.slip_cnt_L2; 871 879 } … … 873 881 else if (obs.satSys == 'S') { // SBAS 874 882 if (obs.has1C()) { 875 str << " 1C "883 str << " 1C " 876 884 << obsToStr(obs.C1) << ' ' 877 885 << obsToStr(obs.L1C) << ' ' 878 886 << obsToStr(obs.D1C) << ' ' 879 << obsToStr(obs.S1C ) << ' '887 << obsToStr(obs.S1C, 8, 3) << ' ' 880 888 << setw(2) << obs.slip_cnt_L1; 881 889 } 882 890 if (obs.has1P()) { 883 str << " 1W "891 str << " 1W " 884 892 << obsToStr(obs.P1) << ' ' 885 893 << obsToStr(obs.L1P) << ' ' 886 894 << obsToStr(obs.D1P) << ' ' 887 << obsToStr(obs.S1P ) << ' '895 << obsToStr(obs.S1P, 8, 3) << ' ' 888 896 << setw(2) << obs.slip_cnt_L1; 889 897 } … … 895 903 << obsToStr(obs.L1C) << ' ' 896 904 << obsToStr(obs.D1C) << ' ' 897 << obsToStr(obs.S1C ) << ' '905 << obsToStr(obs.S1C, 8, 3) << ' ' 898 906 << setw(2) << obs.slip_cnt_L1; 899 907 } 900 908 if (obs.has5C()) { 901 str << " 5C "909 str << " 5C " 902 910 << obsToStr(obs.C5) << ' ' 903 911 << obsToStr(obs.L5) << ' ' 904 912 << obsToStr(obs.D5) << ' ' 905 << obsToStr(obs.S5 ) << ' '913 << obsToStr(obs.S5, 8, 3) << ' ' 906 914 << setw(2) << obs.slip_cnt_L5; 907 915 } -
trunk/BNC/bncrinex.h
r3341 r3344 59 59 60 60 static std::string asciiSatLine(const t_obs& obs); 61 static std::string obsToStr(double val, int width = 14, int precision = 3); 61 62 62 63 private:
Note:
See TracChangeset
for help on using the changeset viewer.