diff --git a/cpp/CWFGM_WeatherGridFilter.cpp b/cpp/CWFGM_WeatherGridFilter.cpp index f2e0f05..4acc58c 100644 --- a/cpp/CWFGM_WeatherGridFilter.cpp +++ b/cpp/CWFGM_WeatherGridFilter.cpp @@ -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; diff --git a/cpp/CWFGM_WeatherStream.Serialize.cpp b/cpp/CWFGM_WeatherStream.Serialize.cpp index a2050a9..02cea58 100644 --- a/cpp/CWFGM_WeatherStream.Serialize.cpp +++ b/cpp/CWFGM_WeatherStream.Serialize.cpp @@ -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(); diff --git a/cpp/CWFGM_WindDirectionGrid.Serialize.cpp b/cpp/CWFGM_WindDirectionGrid.Serialize.cpp index 45daf43..cad0f8d 100644 --- a/cpp/CWFGM_WindDirectionGrid.Serialize.cpp +++ b/cpp/CWFGM_WindDirectionGrid.Serialize.cpp @@ -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))) diff --git a/cpp/CWFGM_WindDirectionGrid.cpp b/cpp/CWFGM_WindDirectionGrid.cpp index d1f2922..aa67e52 100644 --- a/cpp/CWFGM_WindDirectionGrid.cpp +++ b/cpp/CWFGM_WindDirectionGrid.cpp @@ -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; diff --git a/cpp/CWFGM_WindSpeedGrid.cpp b/cpp/CWFGM_WindSpeedGrid.cpp index 4852539..537b55d 100644 --- a/cpp/CWFGM_WindSpeedGrid.cpp +++ b/cpp/CWFGM_WindSpeedGrid.cpp @@ -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; @@ -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 gridEngine; diff --git a/cpp/DayCondition.cpp b/cpp/DayCondition.cpp index 112760a..aece556 100644 --- a/cpp/DayCondition.cpp +++ b/cpp/DayCondition.cpp @@ -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) diff --git a/cpp/WeatherStream.cpp b/cpp/WeatherStream.cpp index 242b6b5..b3013a2 100644 --- a/cpp/WeatherStream.cpp +++ b/cpp/WeatherStream.cpp @@ -1140,14 +1140,29 @@ HSS_PRAGMA_WARNING_POP std::string fn = fileName; wc = wStream.importHourly(fn, &hr, &size); std::vector 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; } @@ -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) { @@ -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) ///