mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:50:04 +00:00
Refactoring generic message components to awips namespace
This commit is contained in:
parent
a76103650e
commit
7a9582a689
14 changed files with 64 additions and 65 deletions
|
|
@ -1,13 +1,13 @@
|
|||
#include <scwx/wsr88d/message.hpp>
|
||||
#include <scwx/awips/message.hpp>
|
||||
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace wsr88d
|
||||
namespace awips
|
||||
{
|
||||
|
||||
static const std::string logPrefix_ = "[scwx::wsr88d::message] ";
|
||||
static const std::string logPrefix_ = "[scwx::awips::message] ";
|
||||
|
||||
class MessageImpl
|
||||
{
|
||||
|
|
@ -63,5 +63,5 @@ bool Message::ValidateMessage(std::istream& is, size_t bytesRead) const
|
|||
return messageValid;
|
||||
}
|
||||
|
||||
} // namespace wsr88d
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#include <scwx/wsr88d/rpg/wmo_header.hpp>
|
||||
#include <scwx/awips/wmo_header.hpp>
|
||||
#include <scwx/util/streams.hpp>
|
||||
|
||||
#include <istream>
|
||||
|
|
@ -15,12 +15,10 @@
|
|||
|
||||
namespace scwx
|
||||
{
|
||||
namespace wsr88d
|
||||
{
|
||||
namespace rpg
|
||||
namespace awips
|
||||
{
|
||||
|
||||
static const std::string logPrefix_ = "[scwx::wsr88d::rpg::wmo_header] ";
|
||||
static const std::string logPrefix_ = "[scwx::awips::wmo_header] ";
|
||||
|
||||
class WmoHeaderImpl
|
||||
{
|
||||
|
|
@ -249,6 +247,5 @@ bool WmoHeader::Parse(std::istream& is)
|
|||
return headerValid;
|
||||
}
|
||||
|
||||
} // namespace rpg
|
||||
} // namespace wsr88d
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#include <scwx/wsr88d/level3_file.hpp>
|
||||
#include <scwx/awips/wmo_header.hpp>
|
||||
#include <scwx/wsr88d/rpg/ccb_header.hpp>
|
||||
#include <scwx/wsr88d/rpg/level3_message_factory.hpp>
|
||||
#include <scwx/wsr88d/rpg/wmo_header.hpp>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
|
|
@ -27,9 +27,9 @@ public:
|
|||
bool DecompressFile(std::istream& is, std::stringstream& ss);
|
||||
bool LoadFileData(std::istream& is);
|
||||
|
||||
std::shared_ptr<rpg::WmoHeader> wmoHeader_;
|
||||
std::shared_ptr<awips::WmoHeader> wmoHeader_;
|
||||
std::shared_ptr<rpg::CcbHeader> ccbHeader_;
|
||||
std::shared_ptr<rpg::WmoHeader> innerHeader_;
|
||||
std::shared_ptr<awips::WmoHeader> innerHeader_;
|
||||
std::shared_ptr<rpg::Level3Message> message_;
|
||||
};
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ bool Level3File::LoadData(std::istream& is)
|
|||
{
|
||||
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "Loading Data";
|
||||
|
||||
p->wmoHeader_ = std::make_shared<rpg::WmoHeader>();
|
||||
p->wmoHeader_ = std::make_shared<awips::WmoHeader>();
|
||||
|
||||
bool dataValid = p->wmoHeader_->Parse(is);
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ bool Level3FileImpl::DecompressFile(std::istream& is, std::stringstream& ss)
|
|||
|
||||
if (dataValid)
|
||||
{
|
||||
innerHeader_ = std::make_shared<rpg::WmoHeader>();
|
||||
innerHeader_ = std::make_shared<awips::WmoHeader>();
|
||||
dataValid = innerHeader_->Parse(ss);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -190,8 +190,8 @@ bool MomentDataBlock::Parse(std::istream& is)
|
|||
p->dataMomentRangeSampleInterval_ = ntohs(p->dataMomentRangeSampleInterval_);
|
||||
p->tover_ = ntohs(p->tover_);
|
||||
p->snrThreshold_ = ntohs(p->snrThreshold_);
|
||||
p->scale_ = Message::SwapFloat(p->scale_);
|
||||
p->offset_ = Message::SwapFloat(p->offset_);
|
||||
p->scale_ = awips::Message::SwapFloat(p->scale_);
|
||||
p->offset_ = awips::Message::SwapFloat(p->offset_);
|
||||
|
||||
if (p->numberOfDataMomentGates_ >= 0 && p->numberOfDataMomentGates_ <= 1840)
|
||||
{
|
||||
|
|
@ -206,7 +206,7 @@ bool MomentDataBlock::Parse(std::istream& is)
|
|||
p->momentGates16_.resize(p->numberOfDataMomentGates_);
|
||||
is.read(reinterpret_cast<char*>(p->momentGates16_.data()),
|
||||
p->numberOfDataMomentGates_ * 2);
|
||||
Message::SwapVector(p->momentGates16_);
|
||||
awips::Message::SwapVector(p->momentGates16_);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -329,17 +329,17 @@ bool VolumeDataBlock::Parse(std::istream& is)
|
|||
is.read(reinterpret_cast<char*>(&p->processingStatus_), 2); // 42-43
|
||||
|
||||
p->lrtup_ = ntohs(p->lrtup_);
|
||||
p->latitude_ = Message::SwapFloat(p->latitude_);
|
||||
p->longitude_ = Message::SwapFloat(p->longitude_);
|
||||
p->latitude_ = awips::Message::SwapFloat(p->latitude_);
|
||||
p->longitude_ = awips::Message::SwapFloat(p->longitude_);
|
||||
p->siteHeight_ = ntohs(p->siteHeight_);
|
||||
p->feedhornHeight_ = ntohs(p->feedhornHeight_);
|
||||
p->calibrationConstant_ = Message::SwapFloat(p->calibrationConstant_);
|
||||
p->horizontaShvTxPower_ = Message::SwapFloat(p->horizontaShvTxPower_);
|
||||
p->verticalShvTxPower_ = Message::SwapFloat(p->verticalShvTxPower_);
|
||||
p->calibrationConstant_ = awips::Message::SwapFloat(p->calibrationConstant_);
|
||||
p->horizontaShvTxPower_ = awips::Message::SwapFloat(p->horizontaShvTxPower_);
|
||||
p->verticalShvTxPower_ = awips::Message::SwapFloat(p->verticalShvTxPower_);
|
||||
p->systemDifferentialReflectivity_ =
|
||||
Message::SwapFloat(p->systemDifferentialReflectivity_);
|
||||
awips::Message::SwapFloat(p->systemDifferentialReflectivity_);
|
||||
p->initialSystemDifferentialPhase_ =
|
||||
Message::SwapFloat(p->initialSystemDifferentialPhase_);
|
||||
awips::Message::SwapFloat(p->initialSystemDifferentialPhase_);
|
||||
p->volumeCoveragePatternNumber_ = ntohs(p->volumeCoveragePatternNumber_);
|
||||
p->processingStatus_ = ntohs(p->processingStatus_);
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ bool ElevationDataBlock::Parse(std::istream& is)
|
|||
|
||||
p->lrtup_ = ntohs(p->lrtup_);
|
||||
p->atmos_ = ntohs(p->atmos_);
|
||||
p->calibrationConstant_ = Message::SwapFloat(p->calibrationConstant_);
|
||||
p->calibrationConstant_ = awips::Message::SwapFloat(p->calibrationConstant_);
|
||||
|
||||
return dataBlockValid;
|
||||
}
|
||||
|
|
@ -475,16 +475,17 @@ bool RadialDataBlock::Parse(std::istream& is)
|
|||
is.read(reinterpret_cast<char*>(&p->calibrationConstantVertical_),
|
||||
4); // 24-27
|
||||
|
||||
p->lrtup_ = ntohs(p->lrtup_);
|
||||
p->unambigiousRange_ = ntohs(p->unambigiousRange_);
|
||||
p->noiseLevelHorizontal_ = Message::SwapFloat(p->noiseLevelHorizontal_);
|
||||
p->noiseLevelVertical_ = Message::SwapFloat(p->noiseLevelVertical_);
|
||||
p->nyquistVelocity_ = ntohs(p->nyquistVelocity_);
|
||||
p->radialFlags_ = ntohs(p->radialFlags_);
|
||||
p->lrtup_ = ntohs(p->lrtup_);
|
||||
p->unambigiousRange_ = ntohs(p->unambigiousRange_);
|
||||
p->noiseLevelHorizontal_ =
|
||||
awips::Message::SwapFloat(p->noiseLevelHorizontal_);
|
||||
p->noiseLevelVertical_ = awips::Message::SwapFloat(p->noiseLevelVertical_);
|
||||
p->nyquistVelocity_ = ntohs(p->nyquistVelocity_);
|
||||
p->radialFlags_ = ntohs(p->radialFlags_);
|
||||
p->calibrationConstantHorizontal_ =
|
||||
Message::SwapFloat(p->calibrationConstantHorizontal_);
|
||||
awips::Message::SwapFloat(p->calibrationConstantHorizontal_);
|
||||
p->calibrationConstantVertical_ =
|
||||
Message::SwapFloat(p->calibrationConstantVertical_);
|
||||
awips::Message::SwapFloat(p->calibrationConstantVertical_);
|
||||
|
||||
return dataBlockValid;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue