Skip to content

Commit

Permalink
Use Channel Type pids
Browse files Browse the repository at this point in the history
  • Loading branch information
kadhikari committed Oct 9, 2024
1 parent c808ae1 commit dcc3a3f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/chaos-proto
Submodule chaos-proto updated 1 files
+4 −0 chaos.proto
4 changes: 3 additions & 1 deletion source/jormungandr/tests/disruptions_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,9 @@ def test_disruption_on_route_and_line(self):
channel = get_not_null(message[2], 'channel')
assert channel['id'] == 'beacon'
assert channel['name'] == 'beacon channel'
assert len(channel['types']) == 3
assert len(channel['types']) == 4
assert 'web' in channel['types']
assert 'pids' in channel['types']

def test_disruption_date_filtering(self):
"""
Expand Down
2 changes: 2 additions & 0 deletions source/kraken/fill_disruption_from_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ struct DisruptionDatabaseReader {
channel->add_types(chaos::Channel_Type_title);
} else if (type_ == "beacon") {
channel->add_types(chaos::Channel_Type_beacon);
} else if (type_ == "pids") {
channel->add_types(chaos::Channel_Type_pids);
} else {
channel->add_types(chaos::Channel_Type_unkown_type);
}
Expand Down
3 changes: 3 additions & 0 deletions source/kraken/make_disruption_from_chaos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ static std::set<nt::disruption::ChannelType> create_channel_types(const chaos::C
case chaos::Channel_Type_beacon:
res.insert(nt::disruption::ChannelType::beacon);
break;
case chaos::Channel_Type_pids:
res.insert(nt::disruption::ChannelType::pids);
break;
default:
res.insert(nt::disruption::ChannelType::unknown_type);
LOG4CPLUS_WARN(log4cplus::Logger::getInstance("log"),
Expand Down
2 changes: 1 addition & 1 deletion source/navitia-proto
Submodule navitia-proto updated 1 files
+1 −0 type.proto
2 changes: 1 addition & 1 deletion source/routing/tests/routing_api_test_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ struct routing_api_data {
"content type",
default_date,
default_date,
{ChannelType::web, ChannelType::title, ChannelType::beacon},
{ChannelType::web, ChannelType::title, ChannelType::beacon, ChannelType::pids},
{}});

disruption_maker.impact()
Expand Down
4 changes: 3 additions & 1 deletion source/type/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ enum class Effect {

enum class ActiveStatus { past = 0, active = 1, future = 2 };

enum class ChannelType { web = 0, sms, email, mobile, notification, twitter, facebook, unknown_type, title, beacon };
enum class ChannelType { web = 0, sms, email, mobile, notification, twitter, facebook, unknown_type, title, beacon, pids };

inline std::string to_string(Effect effect) {
switch (effect) {
Expand Down Expand Up @@ -149,6 +149,8 @@ inline std::string to_string(ChannelType ct) {
return "title";
case ChannelType::beacon:
return "beacon";
case ChannelType::pids:
return "pids";
default:
throw navitia::exception("unhandled channeltype case");
}
Expand Down
3 changes: 3 additions & 0 deletions source/type/pb_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,9 @@ void PbCreator::Filler::fill_pb_object(const nd::Impact* impact, pbnavitia::Impa
case nd::ChannelType::beacon:
pb_channel->add_channel_types(pbnavitia::Channel::beacon);
break;
case nd::ChannelType::pids:
pb_channel->add_channel_types(pbnavitia::Channel::pids);
break;
}
}
}
Expand Down

0 comments on commit dcc3a3f

Please sign in to comment.