Skip to content

Commit

Permalink
Support floats for speed value in traffic updates CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Aug 24, 2022
1 parent 2faa992 commit 6d47340
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/updater/source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ struct Segment final

struct SpeedSource final
{
SpeedSource() : speed(0), rate() {}
unsigned speed;
SpeedSource() : speed(0.), rate() {}
double speed;
boost::optional<double> rate;
std::uint8_t source;
};
Expand Down
2 changes: 1 addition & 1 deletion src/updater/csv_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SegmentLookupTable readSegmentValues(const std::vector<std::string> &paths)
CSVFilesParser<Segment, SpeedSource> parser(
1,
qi::ulong_long >> ',' >> qi::ulong_long,
qi::uint_ >> -(',' >> (qi::double_ | qi::attr(value_if_blank))));
qi::double_ >> -(',' >> (qi::double_ | qi::attr(value_if_blank))));

// Check consistency of keys in the result lookup table
auto result = parser(paths);
Expand Down

0 comments on commit 6d47340

Please sign in to comment.