-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RSL: Status page improvements (#411)
- Loading branch information
Showing
46 changed files
with
2,429 additions
and
801 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include "motis/core/schedule/schedule.h" | ||
|
||
#include "motis/module/message.h" | ||
|
||
#include "motis/paxmon/paxmon_data.h" | ||
|
||
namespace motis::paxmon::api { | ||
|
||
motis::module::msg_ptr dataset_info(paxmon_data& data, schedule const& sched); | ||
|
||
} // namespace motis::paxmon::api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include <chrono> | ||
#include <filesystem> | ||
|
||
#include "motis/core/common/unixtime.h" | ||
|
||
namespace motis::paxmon { | ||
|
||
inline unixtime get_last_modified_time(std::filesystem::path const& path) { | ||
auto const file_time = std::filesystem::last_write_time(path); | ||
|
||
#ifdef _MSC_VER | ||
auto const sys_time = | ||
std::chrono::clock_cast<std::chrono::system_clock>(file_time); | ||
#else | ||
auto const sys_time = | ||
std::chrono::time_point_cast<std::chrono::system_clock::duration>( | ||
file_time - std::chrono::file_clock::now() + | ||
std::chrono::system_clock::now()); | ||
#endif | ||
|
||
return static_cast<unixtime>( | ||
std::chrono::time_point_cast<std::chrono::seconds>(sys_time) | ||
.time_since_epoch() | ||
.count()); | ||
} | ||
|
||
} // namespace motis::paxmon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include <cstddef> | ||
#include <filesystem> | ||
|
||
#include "motis/core/common/unixtime.h" | ||
|
||
#include "motis/paxmon/loader/capacities/load_capacities.h" | ||
|
||
namespace motis::paxmon { | ||
|
||
struct loaded_journey_file { | ||
std::filesystem::path path_; | ||
unixtime last_modified_{}; | ||
|
||
std::size_t matched_journeys_{}; | ||
std::size_t unmatched_journeys_{}; | ||
std::size_t unmatched_journeys_rerouted_{}; | ||
|
||
std::size_t matched_groups_{}; | ||
std::size_t unmatched_groups_{}; | ||
std::size_t unmatched_groups_rerouted_{}; | ||
|
||
std::size_t matched_pax_{}; | ||
std::size_t unmatched_pax_{}; | ||
std::size_t unmatched_pax_rerouted_{}; | ||
}; | ||
|
||
struct loaded_capacity_file { | ||
std::filesystem::path path_; | ||
unixtime last_modified_{}; | ||
|
||
loader::capacities::csv_format format_{}; | ||
std::size_t loaded_entry_count_{}; | ||
std::size_t skipped_entry_count_{}; | ||
std::size_t station_not_found_count_{}; | ||
}; | ||
|
||
} // namespace motis::paxmon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
#pragma once | ||
|
||
#include <cstddef> | ||
#include <vector> | ||
|
||
#include "motis/paxmon/loader/unmatched_journey.h" | ||
|
||
namespace motis::paxmon::loader { | ||
|
||
struct loader_result { | ||
std::size_t loaded_journeys_{}; | ||
std::vector<unmatched_journey> unmatched_journeys_; | ||
|
||
std::size_t loaded_journey_count_{}; | ||
std::size_t loaded_group_count_{}; | ||
std::size_t loaded_pax_count_{}; | ||
|
||
std::size_t unmatched_journey_count_{}; | ||
std::size_t unmatched_group_count_{}; | ||
std::size_t unmatched_pax_count_{}; | ||
}; | ||
|
||
} // namespace motis::paxmon::loader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.