Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update develop-ref after #1923. #1925

Merged
merged 222 commits into from
Sep 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
03dbbc9
Update install_met_env.kiowa
jprestop Jun 14, 2021
9573488
#1817 Added to_north argument at two_to_one()
Jun 17, 2021
fad14e0
#1817 Calls two_to_one() with false for the third argument, to_north,…
Jun 17, 2021
ae2c0a2
Feature 1819 automation doc warnings (#1836)
jprestop Jun 17, 2021
f5b0555
Merge pull request #1835 from dtcenter/bugfix_1817_point2grid_latlon_…
hsoh-u Jun 21, 2021
80a91f6
Removing "/lib" that should not be there.
jprestop Jun 22, 2021
1cb3cb1
#1508 checking stat() methoid returns no error before looking at FILE…
Jun 23, 2021
d2bad01
Merge pull request #1841 from dtcenter/bugfix_1508_tc_gen_file_list_p…
hsoh-u Jun 24, 2021
aeb600a
Enable PDF creation
ksearight Jun 25, 2021
04d887b
Modify inputenc, fontenc latex_elements
ksearight Jun 25, 2021
492cd2e
Fix typo in conf.py
ksearight Jun 25, 2021
33cabf4
Replace unicode with ascii
ksearight Jun 25, 2021
a1105ee
Replace unicode exponent with math mode
ksearight Jun 25, 2021
87befb3
Change eqnarray to align
ksearight Jun 25, 2021
e0f8223
Replace gif images with png for PDF
ksearight Jun 25, 2021
ea51e96
Fix png file names
ksearight Jun 25, 2021
2063d0d
Escape underscore in variable name in math mode
ksearight Jun 25, 2021
7a5b842
Escape underscore in variable name in math mode
ksearight Jun 25, 2021
0abeda0
Remove underscores from variables in math mode
ksearight Jun 25, 2021
1c72343
Replace bar with overline in some equations
ksearight Jun 25, 2021
31f10c0
Test derefencing underscores in tables
ksearight Jun 25, 2021
b06e622
Test math changes in grid stat
ksearight Jun 25, 2021
7138029
Test math formatting
ksearight Jun 25, 2021
d84f3e0
Test math formatting
ksearight Jun 25, 2021
8294247
#1838 Added log message for lat/lon values
Jul 7, 2021
c51f80e
#1838 Give warning if the first and lat lat/lon is same
Jul 7, 2021
55a8ae8
#1838 Support the double data type variable on reading float type values
Jul 7, 2021
73e9438
Merge pull request #1848 from dtcenter/bugfix_1838_point2grid_support…
hsoh-u Jul 8, 2021
8ba6df2
Feature 1833 develop discussions (#1849)
jprestop Jul 8, 2021
66bd0ec
#1852 Removed unused nc_buf_size. Make cur and dim to the same size (…
Jul 13, 2021
6bbf900
#1852 Check the start and count before calling NetCDF API
Jul 13, 2021
599181a
Feature 1746 wavelet stat (#1851)
sethlinden Jul 15, 2021
f060e5e
Merge branch 'develop-ref' into develop
JohnHalleyGotway Jul 15, 2021
31acbe8
Add sphinx.ext.pngmath to conf.py
ksearight Jul 15, 2021
9f5fd59
Fix typo in conf.py
ksearight Jul 15, 2021
5dbbc30
Add sphinx.ext.mathjax to conf.py
ksearight Jul 15, 2021
028b354
Add sphinx.ext.imgmath to conf.py
ksearight Jul 15, 2021
e5eeeb3
Fix typo in conf.py
ksearight Jul 15, 2021
12be58d
Change math formatting in Appendix C
ksearight Jul 15, 2021
43bbf74
Temporarily disable equations with errors in Appendix C
ksearight Jul 15, 2021
131564f
Remove sphinx.ext.imgmath in conf.py
ksearight Jul 15, 2021
6291a90
Modify math formatting in Appendix C
ksearight Jul 15, 2021
5889356
Modify math formatting in Appendix C
ksearight Jul 15, 2021
12e7c92
Modify math formatting in Appendix C
ksearight Jul 15, 2021
8d0ea33
Add sphinx.ext.imgmath to conf.py
ksearight Jul 15, 2021
eb177c4
Modify math formatting in Appendix C
ksearight Jul 15, 2021
bc513d8
Temporarily disable equations with errors in Appendix C
ksearight Jul 15, 2021
29d5b0c
Remove sphinx.ext.imgmath in conf.py
ksearight Jul 15, 2021
42320f9
Modify math formatting in Appendix C
ksearight Jul 15, 2021
e725857
Modify math formatting in Appendix C
ksearight Jul 15, 2021
62a0bc0
Temporarily disable equations with errors
ksearight Jul 15, 2021
4860a62
Merge pull request #1854 from dtcenter/feature_1852_netcdf_api
hsoh-u Jul 16, 2021
ef6ad4c
Update README.md
JohnHalleyGotway Jul 16, 2021
c853259
Modify math formatting in Appendix C
ksearight Jul 19, 2021
b0b3869
Add usepackage{amssymb} to conf.py
ksearight Jul 19, 2021
e08d1d3
Modify math formatting in Appendix C
ksearight Jul 19, 2021
0a5762f
Modify math formatting in Appendix C
ksearight Jul 19, 2021
18ecff5
Modify math formatting in Appendix C
ksearight Jul 19, 2021
5d46cdb
Modify math formatting in Appendix C
ksearight Jul 19, 2021
5c4bde2
Modify math formatting in Appendix C
ksearight Jul 19, 2021
98d874b
Modify math formatting in Appendix C
ksearight Jul 19, 2021
6c9ad33
Modify math formatting in Appendix C
ksearight Jul 19, 2021
7bf9ca8
Modify math formatting in Appendix C
ksearight Jul 19, 2021
2d63c97
Modify math formatting in Appendix C
ksearight Jul 19, 2021
fc37443
Modify math formatting in Appendix C
ksearight Jul 19, 2021
0a67133
Modify math formatting in Appendix C
ksearight Jul 19, 2021
43fdddc
Modify math formatting in Appendix C
ksearight Jul 19, 2021
f6677b1
Modify math formatting in Appendix C
ksearight Jul 19, 2021
4d6b960
Modify math formatting in Appendix C
ksearight Jul 19, 2021
d5a876f
Modify math formatting in Appendix C
ksearight Jul 19, 2021
bb2c471
Modify math formatting in Appendix C
ksearight Jul 20, 2021
6f483c2
Modify math formatting in Appendix C
ksearight Jul 20, 2021
ff85a53
Fix warnings in wavelet-stat.rst
ksearight Jul 20, 2021
b44b743
Omit Indices and tables in PDF version of User Guide
ksearight Jul 20, 2021
44acf15
Modify math formatting in Appendix G
ksearight Jul 20, 2021
fbf538a
Modify math formatting in Appendix E
ksearight Jul 20, 2021
3a48e02
Modify math formatting in Appendix G
ksearight Jul 20, 2021
17f92d1
Modify math formatting in Appendix G
ksearight Jul 20, 2021
5a6b32f
Modify math formatting in Appendix G
ksearight Jul 20, 2021
be07160
Modify math formatting in Appendix G
ksearight Jul 20, 2021
a05d221
Modify math formatting in Appendix G
ksearight Jul 20, 2021
7c912c5
Modify math formatting in Appendix G
ksearight Jul 20, 2021
c39558f
Modify math formatting in Appendix G
ksearight Jul 20, 2021
d7923a5
Modify math formatting in Appendix G
ksearight Jul 20, 2021
ecf75bc
Modify math formatting in Appendix G
ksearight Jul 20, 2021
0aaeecc
Change release date in conf.py
ksearight Jul 20, 2021
3952496
#1852 get_string_val: check if 2D variable. Also checking if the vari…
hsoh-u Jul 21, 2021
5092bc9
Merge branch 'develop' into feature_1453_create_pdf_user_guide
JohnHalleyGotway Jul 21, 2021
0c0c427
Feature 1453 create pdf user guide (#1859)
ksearight Jul 21, 2021
3e33a4e
Feature 1853 rps doc (#1861)
JohnHalleyGotway Jul 23, 2021
0a66ca1
#1855 Removed break after return (SobarQube)
Jul 23, 2021
f1a2d3f
#1855 Removed break after exit
Jul 23, 2021
f60c052
1855 Added return at MetNcPointObsOut::write_to_netcdf
Jul 23, 2021
c5b1610
#1855 Avoid releasing memory twice
Jul 23, 2021
52e697e
#1855 Removed unused code
Jul 23, 2021
471467c
#1855 Corrected syntax error
Jul 23, 2021
69b5530
#1855 Changed the second call of close() to release _ncFile
Jul 27, 2021
1b977e4
#1855 Deleted break after exit
Jul 27, 2021
658e45e
#1855 Chamnged while to if
Jul 27, 2021
ddbb270
Merge branch 'develop' of github.com:dtcenter/MET into feature_1855_s…
Jul 28, 2021
e6b343b
#1855 Added constructor TCLineCounts and initialized the members
Jul 28, 2021
72ac1a8
#1855 Added break statement back for case '-'
Jul 28, 2021
8d4bf01
#1855 Check the new size before extending to avoid thereference of th…
Jul 28, 2021
24a1cc6
#1855 Changed count to processed_count for log messages. Initialized …
Jul 28, 2021
1004531
#1855 Corected the number of memory copy
Jul 28, 2021
16faedb
#1855 Exit with an error message if both fgi & bgi are null
Jul 28, 2021
0d118ca
#1855 Clear Lead_Times before extening. Formatting for error messages
Jul 28, 2021
543a736
Add definition for the compilation environment on seneca.
Jul 29, 2021
0d89f7a
#1855 Extend Lead_Times for new times
Jul 30, 2021
5555965
#1855 Removed break after exit
Jul 30, 2021
33d0ceb
#1855 define "c" dynamically
Jul 30, 2021
c0f678d
#1855 Move the log message within if statement to avoid dereferencing…
Jul 30, 2021
f254c54
Feature 1843 scatter index (#1863)
sethlinden Jul 30, 2021
6b3d713
#1855 Corected typo - compare the numnber of U and V
Jul 30, 2021
6846f62
#1855 Check if var_info is hull
Jul 30, 2021
f7a0aea
#1855 Avoid un-initialized variables: dt at open(), v at lat() & lon(…
Jul 30, 2021
72cc21e
#1855 Check if ldf is null pointer
Jul 30, 2021
4935a50
#1855 Removed break after exit
Jul 30, 2021
07b700f
#1855 Removed break after exit
Jul 30, 2021
4d27e05
Merge branch 'develop-ref' into develop
JohnHalleyGotway Aug 2, 2021
ce3fcee
Update pcp_combine.cc
JohnHalleyGotway Aug 2, 2021
87de938
Feature 1864 config urls (#1868)
JohnHalleyGotway Aug 2, 2021
1b403ec
Merge branch 'develop' into feature_1855_sobarqube_fix
JohnHalleyGotway Aug 2, 2021
980ae26
Merge pull request #1865 from dtcenter/feature_1855_sobarqube_fix
hsoh-u Aug 2, 2021
6681a35
Fix merge conflict & remove non-ASCII characters
ksearight Aug 5, 2021
401af08
Move ROC curve in Appendix C
ksearight Aug 5, 2021
99475ae
Crop ROC image for better PDF formatting
ksearight Aug 5, 2021
53c210d
Shrink ROC image for better PDF formatting
ksearight Aug 5, 2021
71335ca
Modify figure alignment in conf.py
ksearight Aug 5, 2021
b1cced1
Change text placement for ROC curve figure
ksearight Aug 5, 2021
4e1c3ad
Merge pull request #1871 from dtcenter/feature_1453_create_pdf_user_g…
ksearight Aug 6, 2021
6847395
Feature 1834 faq (#1867)
lisagoodrich Aug 12, 2021
09f3cf1
bugfix 1872 plot_tcmpr.R -lookin directory (develop) (#1874)
georgemccabe Aug 16, 2021
f903075
Bugfix 1875 develop memory (#1877)
JohnHalleyGotway Aug 17, 2021
7fdb052
Per #1879, porting the same changes over to the develop branch. (#1881)
JohnHalleyGotway Aug 18, 2021
10e7f5e
Feature 1673 gbeta (#1857)
JohnHalleyGotway Aug 18, 2021
4de429a
Merge branch 'develop-ref' into develop
JohnHalleyGotway Aug 18, 2021
730eccd
Feature 1764 point stat (#1885)
sethlinden Aug 23, 2021
9e35280
Adding Seth to the NB notification list.
Aug 23, 2021
678044f
Bugfix 1886 develop grid_diag (#1888)
JohnHalleyGotway Aug 23, 2021
4b2e18c
Added additional default labels
Aug 26, 2021
4b32d53
Feature 1870 realtime (#1893)
JohnHalleyGotway Aug 30, 2021
aeb6c27
Feature 1788 ssidx (#1892)
JohnHalleyGotway Aug 30, 2021
3d511a9
Merge branch 'develop-ref' into develop
JohnHalleyGotway Aug 31, 2021
d7ca364
#1855 Initialize AllocInc
Aug 31, 2021
0d322f2
855 call snprintf instead of sprintf
Aug 31, 2021
c099f60
Avoid the same for loops (SobarQube warns this)
Aug 31, 2021
868ab7d
#1855 Checking the minimum rows (3) for formatting. Initialize left &…
Aug 31, 2021
30ce2e5
#1855 Removed the unreachable return statement
Aug 31, 2021
eafb807
#1855 Avoide out of index for v_miss
Aug 31, 2021
ae6a6c2
#1855 Keep buf_size for for-loop (avoid changing it in for loop). The…
Aug 31, 2021
e94048b
#1855 Make sure the variuble c has enough data to avoid out of index …
Aug 31, 2021
fb843da
#1855 nake sure the index is in range (avoid out of index error)
Aug 31, 2021
56ec1bf
#1855 Make sure no negative offset for s array
Aug 31, 2021
ee6e4c6
#1855 Allocated line before calling getline'. Simplify the code to ch…
Aug 31, 2021
955a8ca
#1855 Added m_strlen, m_strcpy, m_strcpy2, and m_strncpy
Aug 31, 2021
116c4e2
#1855 Added m_strlen, m_strcpy, m_strcpy2, and m_strncpy> Check if nu…
Aug 31, 2021
489923f
#1855 Calls m_strcpy intead of strcpy
Aug 31, 2021
8b0a8cf
#1855 Calls m_strcpy2 intead of strcpy
Aug 31, 2021
f691aa5
#1855 Calls m_strcpy intead of strcpy
Aug 31, 2021
3de9c3d
Merge branch 'develop' of github.com:dtcenter/MET into feature_1855_s…
Aug 31, 2021
7fb2ecd
#1855 Removed spaces at the empty line
Aug 31, 2021
3a2405d
Bugfix 1891 gen_vx_mask (#1895)
JohnHalleyGotway Aug 31, 2021
d80307c
#1855 sonarqube: replaced strlen to m_strlen
Aug 31, 2021
183f53f
#1855 sonarqube: replaced strcpy to m_strcpy
Aug 31, 2021
7b1a64b
#1855 sonarqube: replaced strlen to m_strlen
Aug 31, 2021
cf8ef98
#1855 sonarqube: replaced strlen to m_strlen
Aug 31, 2021
5acda75
#1855 sonarqube: replaced strlen to m_strlen
Aug 31, 2021
4b975a6
Merge branch 'develop' into feature_1855_sobarqube_fix
JohnHalleyGotway Aug 31, 2021
3486de8
Merge pull request #1898 from dtcenter/feature_1855_sobarqube_fix
hsoh-u Aug 31, 2021
d054d81
#1855 Replaced strncpy to m_strncpy and enhance m_strcpy & m_strncpy …
hsoh-u Sep 1, 2021
cf190b3
#1855 Turn off new strcpy functions
hsoh-u Sep 1, 2021
afe023e
#1855 Corretced typo (arguments were swapped at MetPythonDataFile::open)
hsoh-u Sep 1, 2021
f4d647a
#1855 Make sure the to_str is null terminated after strncpy
hsoh-u Sep 1, 2021
253ad50
Feature 1827 v10.1.0 beta2 (#1902)
jprestop Sep 1, 2021
2b80271
#1903 Added str_wrappers.cc & str_wrappers.h. They are moved from str…
Sep 8, 2021
003a5fc
#1903 Added enum_to_string.h. They are moved from enum_to_string.cc
Sep 8, 2021
1590718
#1903 Moved include statements to the top. Included enum_to_string.h …
Sep 8, 2021
b745aea
#1903 Moved m_strXXX to str_wrappers. Includes str_wrappers.h instead…
Sep 8, 2021
4e241fc
#1903 Changed strXXX to m_strXXX
Sep 8, 2021
b59eeaf
#1903 Chaged dst_info to const
Sep 8, 2021
7ff85de
#1903 Separated two || conditions to avoid potential side effect
Sep 8, 2021
cb10a13
#1903 Avoid the negative offset if the string length is 0
Sep 8, 2021
33c53c9
#1903 make sure the pointer is not NULL before releasing
Sep 8, 2021
cf8bea6
#1903 Replaced strXXX to m_strXXX. Separated two || conditions to avo…
Sep 8, 2021
30f71ae
#1903 Allow to truncate the string on calling m_strncpy
Sep 8, 2021
a598da8
#1903 Replaced strXXX calls to m_strXXX
Sep 8, 2021
77e5489
#1903 Avoid the negative offset if the string length is 0
Sep 8, 2021
8e14372
Separated third AND condition to avoid a possible side effect (assign…
Sep 9, 2021
a95e8a8
#1903 Renamed import (which is a keyword) to import_image)
Sep 9, 2021
9f93ed8
Initialize data at get_filtered_nc_data_2d
Sep 9, 2021
096be24
#1903 Initialize r, g, b at dhsv_to_drgb
Sep 9, 2021
ca814c9
Modified to avoid unreachable return statement
Sep 9, 2021
3163c59
#1903 Separated the second AND condition to avoid a potential side ef…
Sep 9, 2021
3885448
#1903 Removed unreachable break (after exit)
Sep 9, 2021
cb759e8
#1903 Removed a unused offset variable
Sep 9, 2021
66389e0
#1903 Initialize fcst variable
Sep 9, 2021
42c834e
Renamed module (keyword) to py_module
Sep 9, 2021
28d0f2f
Removed the second argument at m_strlen
Sep 9, 2021
d12143b
#1903 Deleted extra two empty lines
Sep 9, 2021
7a07773
#1903 Formatting (tab to spaces)
Sep 9, 2021
8b528dd
#1903 mstcpy is changed to m_strcpy2
Sep 10, 2021
7ea619c
Deleted the commented out code
Sep 10, 2021
17c068c
#1903 Calls sizeof instead of m_strlen at m_strcpy
Sep 10, 2021
8bbe01a
#1903 Calls m_strncpy instead of m_strcpy
Sep 10, 2021
447a7cd
#1903 Replaced m_strcpy to m_strncpy
Sep 10, 2021
09c5290
#1903 Do not use sizeof
Sep 14, 2021
eee1ee7
Merge pull request #1911 from dtcenter/feature_1903_sonarqube
hsoh-u Sep 14, 2021
ab4c731
Feature 1912 missing (#1915)
JohnHalleyGotway Sep 15, 2021
bfc8a63
Testing RTD updates
Sep 15, 2021
f9c8a9c
Added sphinx-panels
Sep 15, 2021
a62caaa
Testing double hyphen change to code-block
Sep 15, 2021
f3393fd
Testing double hyphen change to code-block
Sep 15, 2021
73ed446
Changed bolding of options to code-blocks
Sep 15, 2021
9998f49
Feature 1858 obs quality (#1919)
sethlinden Sep 16, 2021
054fe2c
Feature 1894 pb2nc var all (#1917)
hsoh-u Sep 16, 2021
c104425
Feature 1913 MAX_PBL (#1916)
hsoh-u Sep 16, 2021
0ca4850
Add bolding the MET version 10.1.0 beta2 release notes to indicate em…
JohnHalleyGotway Sep 16, 2021
c6a51c3
Merge branch 'develop' of github.com:dtcenter/MET into develop
Sep 16, 2021
a96c9df
Merge branch 'develop-ref' into develop
Sep 17, 2021
9811d5e
feature 1922 iodas2nc - Removed trailing spaces based on the string l…
hsoh-u Sep 18, 2021
941f1d7
Merge branch 'develop-ref' into develop
Sep 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions met/src/basic/vx_log/str_wrappers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ void m_strncpy(char *to_str, const char *from_str, const int buf_len,
if (str_len > buf_len) str_len = buf_len;

memset(to_str, 0, str_len);
// Kludge: there were cases that sizeof returns 8 instead of the real size.
// Use sizeof only if it's not 8.
int to_buf_size = sizeof(to_str);
if (to_buf_size != 8) {
if (str_len < to_buf_size) memset(to_str, str_len, to_buf_size);
if (str_len > to_buf_size) str_len = to_buf_size; // truncate
}

string temp_str = from_str;
temp_str.copy(to_str, str_len);
to_str[str_len] = 0;
Expand All @@ -99,4 +107,25 @@ void m_strncpy(char *to_str, const char *from_str, const int buf_len,

}

////////////////////////////////////////////////////////////////////////

void m_rstrip(char *str_buf, int buf_len) {
// Make sure it's NULL terminated
if (buf_len >= 0) str_buf[buf_len] = '\0';
// Change the trailing blank space to a null
int str_len = m_strlen(str_buf);
for(int idx=str_len-1; idx>=0; idx--) {
if(is_whitespaces(str_buf[idx])) {
str_buf[idx] = '\0';
if((idx > 0) && !is_whitespaces(str_buf[idx-1])) break;
}
}
}

////////////////////////////////////////////////////////////////////////

bool is_whitespaces(char cur_char) {
return (' ' == cur_char || '\t' == cur_char || '\n' == cur_char || '\r' == cur_char);
}

////////////////////////////////////////////////////////////////////////
4 changes: 4 additions & 0 deletions met/src/basic/vx_log/str_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ extern void m_strncpy(char *to_str, const char *from_str, const int buf_len,
const char *method_name, const char *extra_msg=(char *)0,
bool truncate=false);

extern void m_rstrip(char *str_buf, const int buf_len=-1);

extern bool is_whitespaces(char cur_char);

////////////////////////////////////////////////////////////////////////


Expand Down
47 changes: 22 additions & 25 deletions met/src/tools/other/ioda2nc/ioda2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ static const char * DEF_CONFIG_NAME = "MET_BASE/config/IODA2NCConfig_default";

static const char *program_name = "ioda2nc";

static const int REJECT_DEBUG_LEVEL = 9;

////////////////////////////////////////////////////////////////////////

//
Expand Down Expand Up @@ -150,7 +152,6 @@ static void set_valid_beg_time(const StringArray &);
static void set_valid_end_time(const StringArray &);
static void set_verbosity(const StringArray &);

static void cleanup_hdr_buf(char *hdr_buf, int buf_len);
static bool check_core_data(const bool, const bool, StringArray &, StringArray &);
static bool check_missing_thresh(float value);
static ConcatString find_meta_name(StringArray, StringArray);
Expand Down Expand Up @@ -662,9 +663,7 @@ void process_ioda_file(int i_pb) {
if(has_msg_type) {
int buf_len = sizeof(modified_hdr_typ);
m_strncpy(hdr_typ, hdr_msg_types+(i_read*nstring), nstring, method_name, "hdr_typ");
hdr_typ[nstring] = 0;
// Null terminate the message type string
cleanup_hdr_buf(hdr_typ, nstring);
m_rstrip(hdr_typ, nstring);

// If the message type is not listed in the configuration
// file and it is not the case that all message types should be
Expand Down Expand Up @@ -692,8 +691,7 @@ void process_ioda_file(int i_pb) {
if(has_station_id) {
char tmp_sid[nstring+1];
m_strncpy(tmp_sid, hdr_station_ids+(i_read*nstring), nstring, method_name, "tmp_sid");
tmp_sid[nstring] = 0;
cleanup_hdr_buf(tmp_sid, nstring);
m_rstrip(tmp_sid, nstring);
hdr_sid = tmp_sid;
}
else hdr_sid.clear();
Expand Down Expand Up @@ -986,25 +984,13 @@ void clean_up() {

////////////////////////////////////////////////////////////////////////

static void cleanup_hdr_buf(char *hdr_buf, int buf_len) {
int i;
hdr_buf[buf_len] = '\0';
// Change the trailing blank space to a null
for(i=buf_len-1; i>=0; i--) {
if(' ' == hdr_buf[i]) {
hdr_buf[i] = '\0';
if(i > 0 && ' ' != hdr_buf[i-1]) break;
}
}
}

////////////////////////////////////////////////////////////////////////

bool keep_message_type(const char *mt_str) {
bool keep = false;
bool keep = conf_info.message_type.n_elements() == 0 ||
conf_info.message_type.has(mt_str, false);

keep = conf_info.message_type.n_elements() == 0 ||
conf_info.message_type.has(mt_str, false);
if(!keep && mlog.verbosity_level() >= REJECT_DEBUG_LEVEL) {
mlog << Debug(REJECT_DEBUG_LEVEL) << "The message type [" << mt_str << "] is rejected\n";
}

return(keep);
}
Expand All @@ -1013,8 +999,14 @@ bool keep_message_type(const char *mt_str) {

bool keep_station_id(const char *sid_str) {

return(conf_info.station_id.n_elements() == 0 ||
conf_info.station_id.has(sid_str, false));
bool keep = (conf_info.station_id.n_elements() == 0 ||
conf_info.station_id.has(sid_str, false));

if(!keep && mlog.verbosity_level() >= REJECT_DEBUG_LEVEL) {
mlog << Debug(REJECT_DEBUG_LEVEL) << "The station ID [" << sid_str << "] is rejected\n";
}

return(keep);
}

////////////////////////////////////////////////////////////////////////
Expand All @@ -1036,6 +1028,11 @@ bool keep_valid_time(const unixtime ut,
if(ut > max_ut) keep = false;
}

if(!keep && mlog.verbosity_level() >= REJECT_DEBUG_LEVEL) {
mlog << Debug(REJECT_DEBUG_LEVEL) << "The valid_time [" << ut << ", "
<< unix_to_yyyymmdd_hhmmss(ut) << "] is rejected\n";
}

return(keep);
}

Expand Down