Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cpp/CWFGM_WeatherGridFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ HRESULT CCWFGM_WeatherGridFilter::GetArea(double *area) {
HRESULT CCWFGM_WeatherGridFilter::PutGridEngine(Layer *layerThread, ICWFGM_GridEngine *newVal) {
HRESULT hr = ICWFGM_GridEngine::PutGridEngine(layerThread, newVal);
if (SUCCEEDED(hr) && m_gridEngine(nullptr)) {
HRESULT hr = fixResolution();
hr = fixResolution();
weak_assert(SUCCEEDED(hr));
}
return hr;
Expand Down
5 changes: 5 additions & 0 deletions cpp/CWFGM_WeatherStream.Serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ CCWFGM_WeatherStream* CCWFGM_WeatherStream::deserialize(const google::protobuf::
{
m_weatherCondition.deserialize(stream->condition(), v, "condition");
}
catch (const ISerializeProto::DeserializeError& de)
{
m_loadWarning = de.what();
throw de;
}
catch (std::exception & e)
{
m_loadWarning = e.what();
Expand Down
1 change: 0 additions & 1 deletion cpp/CWFGM_WindDirectionGrid.Serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ CCWFGM_WindDirectionGrid* CCWFGM_WindDirectionGrid::deserialize(const google::pr
auto xsize = defaults.xsize();
auto ysize = defaults.ysize();


USHORT gridXDim, gridYDim;
HRESULT hr;
if (FAILED(hr = gridEngine->GetDimensions(0, &gridXDim, &gridYDim)))
Expand Down
2 changes: 1 addition & 1 deletion cpp/CWFGM_WindDirectionGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ HRESULT CCWFGM_WindDirectionGrid::getWeatherData(ICWFGM_GridEngine *gridEngine,
HRESULT CCWFGM_WindDirectionGrid::PutGridEngine(Layer *layerThread, ICWFGM_GridEngine *newVal) {
HRESULT hr = ICWFGM_GridEngine::PutGridEngine(layerThread, newVal);
if (SUCCEEDED(hr) && m_gridEngine(nullptr)) {
HRESULT hr = fixResolution();
hr = fixResolution();
weak_assert(SUCCEEDED(hr));
}
return hr;
Expand Down
4 changes: 2 additions & 2 deletions cpp/CWFGM_WindSpeedGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ bool CCWFGM_WindSpeedGrid::calculateSpeed(const std::uint16_t x, const std::uint
HRESULT CCWFGM_WindSpeedGrid::PutGridEngine(Layer *layerThread, ICWFGM_GridEngine *newVal) {
HRESULT hr = ICWFGM_GridEngine::PutGridEngine(layerThread, newVal);
if (SUCCEEDED(hr) && m_gridEngine(nullptr)) {
HRESULT hr = fixResolution();
hr = fixResolution();
weak_assert(SUCCEEDED(hr));
}
return hr;
Expand All @@ -917,7 +917,7 @@ HRESULT CCWFGM_WindSpeedGrid::PutCommonData(/* [in] */ Layer* layerThread, /* [i

HRESULT CCWFGM_WindSpeedGrid::fixResolution() {
HRESULT hr;
double gridResolution, gridXLL, gridYLL, temp;
double gridResolution, gridXLL, gridYLL;
PolymorphicAttribute var;

boost::intrusive_ptr<ICWFGM_GridEngine> gridEngine;
Expand Down
2 changes: 1 addition & 1 deletion cpp/DayCondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void DailyCondition::calculateHourlyFFMC() {
}

#ifdef _DEBUG
di = (std::uint16_t)loop.GetHour(WTIME_FORMAT_AS_LOCAL | WTIME_FORMAT_WITHDST);
std::int32_t di = (std::uint16_t)loop.GetHour(WTIME_FORMAT_AS_LOCAL | WTIME_FORMAT_WITHDST);
#endif

if (end > streamend)
Expand Down
22 changes: 17 additions & 5 deletions cpp/WeatherStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,14 +1140,29 @@ HSS_PRAGMA_WARNING_POP
std::string fn = fileName;
wc = wStream.importHourly(fn, &hr, &size);
std::vector<WeatherCollection> weather(wc, wc + size);
if (weather.size() == 0)

auto tempValid = validation::conditional_make_object(valid, "WISE.WeatherProto.HourlyWeather", "hourly");
auto weatherValid = tempValid.lock();

if (weather.size() == 0) {
if ((hr == (ERROR_SEVERITY_WARNING | ERROR_START_AFTER_NOON)) && (weatherValid))
{
weatherValid->add_child_validation("WISE.WeatherProto.HourlyWeather", "hourlyWeather",
validation::error_level::SEVERE, validation::id::invalid_weather_start, "Weather cannot start after noon.");
}
goto DONE;
}
if ((hr != S_OK) &&
(hr != (ERROR_INVALID_DATA | ERROR_SEVERITY_WARNING)) &&
(hr != ERROR_INVALID_DATA) &&
(hr != WARNING_WEATHER_STREAM_INTERPOLATE) &&
(hr != WARNING_WEATHER_STREAM_INTERPOLATE_BEFORE_INVALID_DATA))
{
if ((hr == (ERROR_SEVERITY_WARNING | ERROR_START_AFTER_NOON)) && (weatherValid))
{
weatherValid->add_child_validation("WISE.WeatherProto.HourlyWeather", "hourlyWeather",
validation::error_level::SEVERE, validation::id::invalid_weather_start, "Weather cannot start after noon.");
}
goto DONE;
}

Expand All @@ -1167,9 +1182,6 @@ HSS_PRAGMA_WARNING_POP
noonhour = dayNoon.GetHour(WTIME_FORMAT_AS_LOCAL | WTIME_FORMAT_WITHDST);
}

auto tempValid = validation::conditional_make_object(valid, "WISE.WeatherProto.HourlyWeather", "hourly");
auto weatherValid = tempValid.lock();

//finally, add all of the weather to the stream.
for (auto w : weather)
{
Expand Down Expand Up @@ -1734,7 +1746,7 @@ WeatherCondition* WeatherCondition::deserialize(const google::protobuf::Message&
HRESULT hr = Import(conditions->filename().c_str(), CWFGM_WEATHERSTREAM_IMPORT_PURGE, myValid2);
if (FAILED(hr) || hr == ERROR_INVALID_DATA)
throw ISerializeProto::DeserializeError((boost::format("The import weather stream operation has failed. Unable to import \"%1%\"")
% conditions->filename()).str());
% conditions->filename()).str(), hr);
}
else if (myValid)
/// <summary>
Expand Down