From c1d1942f4d4e182e1c9a388dc1163bf66a354079 Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Wed, 13 Apr 2016 14:56:28 +0300 Subject: Redone my position --- platform/location.hpp | 13 ++++++------- platform/settings.cpp | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 21 deletions(-) (limited to 'platform') diff --git a/platform/location.hpp b/platform/location.hpp index f068b213e7..38b5b4fe66 100644 --- a/platform/location.hpp +++ b/platform/location.hpp @@ -232,16 +232,15 @@ namespace location double GetDistanceFromBegin() const { return m_distanceFromBegin; } }; - // Do not change the order and values enum EMyPositionMode { - MODE_UNKNOWN_POSITION = 0x0, - MODE_PENDING_POSITION = 0x1, - MODE_NOT_FOLLOW = 0x2, - MODE_FOLLOW = 0x3, - MODE_ROTATE_AND_FOLLOW = 0x4, + PendingPosition = 0, + NotFollowNoPosition, + NotFollow, + Follow, + FollowAndRotate }; - using TMyPositionModeChanged = function; + using TMyPositionModeChanged = function; } // namespace location diff --git a/platform/settings.cpp b/platform/settings.cpp index 0cb17a4f3f..9feff99bc1 100644 --- a/platform/settings.cpp +++ b/platform/settings.cpp @@ -392,28 +392,28 @@ string ToString(location::EMyPositionMode const & v) { switch (v) { - case location::MODE_UNKNOWN_POSITION: return "Unknown"; - case location::MODE_PENDING_POSITION: return "Pending"; - case location::MODE_NOT_FOLLOW: return "NotFollow"; - case location::MODE_FOLLOW: return "Follow"; - case location::MODE_ROTATE_AND_FOLLOW: return "RotateAndFollow"; - default: return "Unknown"; + case location::PendingPosition: return "PendingPosition"; + case location::NotFollow: return "NotFollow"; + case location::NotFollowNoPosition: return "NotFollowNoPosition"; + case location::Follow: return "Follow"; + case location::FollowAndRotate: return "FollowAndRotate"; + default: return "Pending"; } } template <> bool FromString(string const & s, location::EMyPositionMode & v) { - if (s == "Unknown") - v = location::MODE_UNKNOWN_POSITION; - else if (s == "Pending") - v = location::MODE_PENDING_POSITION; + if (s == "PendingPosition") + v = location::PendingPosition; else if (s == "NotFollow") - v = location::MODE_NOT_FOLLOW; + v = location::NotFollow; + else if (s == "NotFollowNoPosition") + v = location::NotFollowNoPosition; else if (s == "Follow") - v = location::MODE_FOLLOW; - else if (s == "RotateAndFollow") - v = location::MODE_ROTATE_AND_FOLLOW; + v = location::Follow; + else if (s == "FollowAndRotate") + v = location::FollowAndRotate; else return false; -- cgit v1.2.3