| 253 | } |
| 254 | |
| 255 | SpeedMacro MaxspeedConverter::SpeedToMacro(SpeedInUnits const & speed) const |
| 256 | { |
| 257 | auto const it = m_speedToMacro.find(speed); |
| 258 | if (it == m_speedToMacro.cend()) |
| 259 | { |
| 260 | switch (speed.GetSpeed()) |
| 261 | { |
| 262 | case kNoneMaxSpeed: return SpeedMacro::None; |
| 263 | case kWalkMaxSpeed: return SpeedMacro::Walk; |
| 264 | case kCommonMaxSpeedValue: return SpeedMacro::Speed60KmPH; |
| 265 | } |
| 266 | |
| 267 | return SpeedMacro::Undefined; |
| 268 | } |
| 269 | |
| 270 | return it->second; |
| 271 | } |
| 272 | |
| 273 | SpeedInUnits MaxspeedConverter::ClosestValidMacro(SpeedInUnits const & speed) const |
| 274 | { |