Timetable viewer is a simple C++ and Raylib program for viewing timetables. The timetables are user defineable JSON files in the timetables folder.
The following dependencies are required to build this program:
C++20
make
raylib
cppjp
The user must provide their own copy of a font file (.ttf) in the fonts folder. You should also make sure that the FONT_PATH variable in the include/config.hpp file is set to fonts/<YOUR-FONT-FILE-NAME> for the program to operate as intended.
The user must either have raylib installed on their system or provide their own copy of libraylib.a in the lib folder and raylib.h in the include folder.
The user must also either have cppjp installed on thier system or provide their own copy of libcppjp.a in the lib folder and cppjp.hpp in the include folder.
$ git clone https://www.github.com/CG-Matt/timetable-viewer.git
$ cd timetable-viewer
$ mkdir build
$ cd build
$ cmake ..
$ makeThe compiled program can then be found inside of the build folder.
The user must provide their own copy of a statically compiled relase build of raylib.lib in the lib folder and raylib.h in the include folder.
The user must also provide their own copy of a statically compiled release build of cppjp.lib in the lib folder and cppjp.hpp in the include folder.
Begin by running:
$ git clone https://www.github.com/CG-Matt/timetable-viewer.gitOr dowload the source code from the repo.
Now open the folder with Visual Studio and press Ctrl + Shift + B to build the project.
The compiled program can then be found inside of the root project directory folder.
Once the program has been built you can add json files in the timetables folder. They will then be vieweable the next time that the program is started.
The timetable json files must follow a specific format which is outlined below. There is also a sample timetable.json file provided in the timetables folder. Ensure that any timetable files end with the .json extension to be read by the program.
{
"modules": [ ... ],
"timetable": [ ... ]
}modules specifies a list of modules that will be associated with this timetable. It groups data that is common between different lectures. Each module should be of the following format:
{
"name": "...",
"nickname": "...", (optional)
"code": "...",
"color": "..."
}name: Each module must have a name, this is the full name of the module.nickname: This will be displayed instead of the full name if provided.code: This is the module code for this module. It must be provided to uniquely identify this module, it wil also be used later in thetimetablesection for referencing lecutres / laboratories to modules.color: This is the color with which lectures / laboraties for this module will be displayed with. The color must be of the format#RRGGBBwhere RR, GG and BB are hex values.
timetable specifies a list of lectures and laboratories that will take place during the week. each timetable entry must be of the following format:
{
"code": "...",
"day": "...",
"timeslot": "...",
"venue": "...",
"duration": 1, (optional)
"lab": false, (optional)
"start_week": 1, (optional)
"end_week": 12 (optional)
}code: This is the associated module code for this lecture / laboratory. It must be a valid module code provided in the abovemodulesection.day: This is the day on which this lecture / laboratory falls on. It must be one of the following values:MondayORMonTuesdayORTueWednesdayORWedThursdayORThuFridayORFri
timeslot: This is the timeslot on which this lecture / laboratory falls on. It must be one of the following values:09:0010:0011:0012:0013:0014:0015:0016:0017:00
venue: This is the venue at which this lecture / laboratory takes place. This can be any arbitrary string value as it is only used for display pruposes.duration: This is an optional parameter, signifies across how many timeslots a lecture / laboratory takes place. The default value is1.lab: This is an optional parameter, signifies if this is a laboratory or not. The default values isfalse.start_week: This is an optional parameter, signifies in which week this lecutre / laboratory starts. The default value is1.end_week: This is an optional parameter, signifies in which week this lecture / laboratory ends. The default value is12.
A completed timetable file may look something like this:
{
"modules":
[
{ "name": "Module 1", "nickname": "Mod 1", "code": "EM101", "color": "#FFA050" },
{ "name": "Module 2", "code": "EM102", "color": "#E04030" },
],
"timetable":
[
{ "code": "EM101", "day": "Mon", "timeslot": "11:00", "venue": "SCB G001" },
{ "code": "EM101", "day": "Wed", "timeslot": "13:00", "venue": "SCB G001", "duration": 2 },
{ "code": "EM102", "day": "Tue", "timeslot": "12:00", "venue": "LAB 001", "lab": true, "start_week": 2, "end_week": 5 }
]
}