mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
[tts] Change notification to 400-700 m
Signed-off-by: thesupertechie <thesupertechie1@gmail.com>
This commit is contained in:
@@ -104,5 +104,7 @@
|
||||
"in_1_mile":"In one mile",
|
||||
"in_1_5_miles":"In one and a half miles",
|
||||
"in_2_miles":"In two miles",
|
||||
"unknown_camera":"Camera ahead"
|
||||
"unknown_camera":"Camera ahead",
|
||||
"continue":"Continue on the current road until further instructions.",
|
||||
"continue_street":"Continue on"
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace
|
||||
{
|
||||
// If the distance between two sequential turns is less than kSecondTurnThresholdDistM
|
||||
// the information about the second turn will be shown or pronounced
|
||||
// when the user is approaching to the first one with "Then.".
|
||||
// when the user is approaching to the first one with "Then,".
|
||||
double constexpr kSecondTurnThresholdDistM = 400.0;
|
||||
// If the distance between two sequential turns is less than kDistanceNotifyThresholdM
|
||||
// the notification will *not* append second distance, (like "In 500 meters. Turn left. Then. Turn right.")
|
||||
@@ -25,7 +25,7 @@ double constexpr kDistanceNotifyThresholdM = 50.0;
|
||||
// Returns true if the closest turn is an entrance to a roundabout and the second is
|
||||
// an exit form a roundabout.
|
||||
// Note. There are some cases when another turn (besides an exit from roundabout)
|
||||
// follows an entrance to a roundabout. It could happend in case of turns inside a roundabout.
|
||||
// follows an entrance to a roundabout. It could happened in case of turns inside a roundabout.
|
||||
// Returns false otherwise.
|
||||
bool IsClassicEntranceToRoundabout(routing::turns::TurnItemDist const & firstTurn,
|
||||
routing::turns::TurnItemDist const & secondTurn)
|
||||
@@ -244,13 +244,13 @@ void NotificationManager::SetLengthUnits(measurement_utils::Units units)
|
||||
switch (units)
|
||||
{
|
||||
case measurement_utils::Units::Metric:
|
||||
m_settings.SetState(30 /* notificationTimeSeconds */, 200 /* minNotificationDistanceUnits */,
|
||||
m_settings.SetState(30 /* notificationTimeSeconds */, 400 /* minNotificationDistanceUnits */,
|
||||
2000 /* maxNotificationDistanceUnits */, GetSoundedDistMeters() /* soundedDistancesUnits */,
|
||||
measurement_utils::Units::Metric /* lengthUnits */);
|
||||
return;
|
||||
case measurement_utils::Units::Imperial:
|
||||
m_settings.SetState(30 /* notificationTimeSeconds */, 500 /* minNotificationDistanceUnits */,
|
||||
5000 /* maxNotificationDistanceUnits */, GetSoundedDistFeet() /* soundedDistancesUnits */,
|
||||
1000 /* maxNotificationDistanceUnits */, GetSoundedDistFeet() /* soundedDistancesUnits */,
|
||||
measurement_utils::Units::Imperial /* lengthUnits */);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ struct Notification
|
||||
uint32_t m_distanceUnits;
|
||||
uint8_t m_exitNum;
|
||||
/// if m_useThenInsteadOfDistance == true the m_distanceUnits is ignored.
|
||||
/// The word "Then" shall be pronounced intead of the distance.
|
||||
/// The word "Then" will be pronounced instead of the distance.
|
||||
bool m_useThenInsteadOfDistance;
|
||||
CarDirection m_turnDir = CarDirection::None;
|
||||
PedestrianDirection m_turnDirPedestrian = PedestrianDirection::None;
|
||||
|
||||
@@ -92,8 +92,7 @@ void FormatFullRoadName(RouteSegment::RoadNameInfo & road, std::string & name)
|
||||
if (!road.m_name.empty())
|
||||
outArr.emplace_back(road.m_name);
|
||||
}
|
||||
|
||||
name = strings::JoinStrings(outArr.begin(), outArr.end(), "; ");
|
||||
name = strings::JoinStrings(outArr.begin(), outArr.end(), ";");
|
||||
|
||||
strings::Trim(name);
|
||||
}
|
||||
@@ -133,7 +132,7 @@ std::string GetTtsText::GetTurnNotification(Notification const & notification) c
|
||||
if (notification.m_distanceUnits > 0)
|
||||
distStr = GetTextByIdTrimmed(GetDistanceTextId(notification));
|
||||
|
||||
// Get a string like 245; CA 123; Highway 99; San Francisco
|
||||
// Get a string like [245] > CA 123/Highway 99/San Francisco
|
||||
// In the future we could use the full RoadNameInfo struct to do some nice formatting.
|
||||
std::string streetOut;
|
||||
RouteSegment::RoadNameInfo nsi = notification.m_nextStreetInfo; // extract non-const
|
||||
@@ -344,6 +343,10 @@ std::string GetYouArriveTextId(Notification const & notification)
|
||||
return "you_have_reached_the_destination";
|
||||
}
|
||||
|
||||
std::string GetContinueTextId(Notification const & notification){
|
||||
return "continue"
|
||||
}
|
||||
|
||||
std::string GetDirectionTextId(Notification const & notification)
|
||||
{
|
||||
if (notification.IsPedestrianNotification())
|
||||
|
||||
Reference in New Issue
Block a user