This commit is contained in:
parent
87c2e2e01c
commit
a6ff11ff71
@ -1,6 +1,8 @@
|
|||||||
#include "timetable.h"
|
#include "timetable.h"
|
||||||
|
#include <cstdint>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
|
|
||||||
@ -13,10 +15,18 @@ using nlohmann::json;
|
|||||||
#define DEFAULT_PADDING 4
|
#define DEFAULT_PADDING 4
|
||||||
|
|
||||||
void timetable_page() {
|
void timetable_page() {
|
||||||
// DONT FORGET TO UNCOMMENT
|
// DONT FORGET TO UNCOMMENT
|
||||||
json resp_from_api = bakaapi::get_data_from_endpoint("api/3/marks");
|
// json resp_from_api = bakaapi::get_data_from_endpoint("api/3/timetable/actual");
|
||||||
// std::ifstream f("test-data/marks3.json");
|
std::ifstream f("test-data/timetable.json");
|
||||||
// json resp_from_api = json::parse(f);
|
json resp_from_api = json::parse(f);
|
||||||
|
|
||||||
// calculate table size
|
// calculate table size
|
||||||
|
|
||||||
|
uint8_t column_number = 0;
|
||||||
|
for(uint8_t i = 0; i < resp_from_api["Days"].size(); i++) {
|
||||||
|
(resp_from_api["Days"][i]["Atoms"].size() > column_number) ? (column_number = resp_from_api["Days"][i]["Atoms"].size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user