mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 18:30:06 +00:00
Handle null level 2 metadata records
This commit is contained in:
parent
505b424de4
commit
e237e086f0
3 changed files with 27 additions and 13 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit 45539a5b0ecfc6baaaf7355b6b9542cc31ed9ecd
|
Subproject commit 29c40b6024935ac9e2c76bd092e2a1dd05c3f307
|
||||||
|
|
@ -19,5 +19,15 @@ TEST(ar2v_file, klsx)
|
||||||
EXPECT_EQ(fileValid, true);
|
EXPECT_EQ(fileValid, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(ar2v_file, tstl)
|
||||||
|
{
|
||||||
|
Ar2vFile file;
|
||||||
|
bool fileValid =
|
||||||
|
file.LoadFile(std::string(SCWX_TEST_DATA_DIR) +
|
||||||
|
"/nexrad/level2/Level2_TSTL_20220213_2357.ar2v");
|
||||||
|
|
||||||
|
EXPECT_EQ(fileValid, true);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace wsr88d
|
} // namespace wsr88d
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
|
|
@ -329,18 +329,6 @@ void Ar2vFileImpl::ParseLDMRecord(std::istream& is)
|
||||||
|
|
||||||
while (!is.eof())
|
while (!is.eof())
|
||||||
{
|
{
|
||||||
rda::Level2MessageInfo msgInfo = rda::Level2MessageFactory::Create(is);
|
|
||||||
if (!msgInfo.headerValid)
|
|
||||||
{
|
|
||||||
// Invalid message
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msgInfo.messageValid)
|
|
||||||
{
|
|
||||||
HandleMessage(msgInfo.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
off_t offset = 0;
|
off_t offset = 0;
|
||||||
uint16_t nextSize = 0u;
|
uint16_t nextSize = 0u;
|
||||||
do
|
do
|
||||||
|
|
@ -361,6 +349,22 @@ void Ar2vFileImpl::ParseLDMRecord(std::istream& is)
|
||||||
BOOST_LOG_TRIVIAL(trace)
|
BOOST_LOG_TRIVIAL(trace)
|
||||||
<< logPrefix_ << "Next record offset by " << offset << " bytes";
|
<< logPrefix_ << "Next record offset by " << offset << " bytes";
|
||||||
}
|
}
|
||||||
|
else if (is.eof())
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
rda::Level2MessageInfo msgInfo = rda::Level2MessageFactory::Create(is);
|
||||||
|
if (!msgInfo.headerValid)
|
||||||
|
{
|
||||||
|
// Invalid message
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgInfo.messageValid)
|
||||||
|
{
|
||||||
|
HandleMessage(msgInfo.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue