Skip to content

CG-Matt/timetable-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timetable Viewer

Timetable viewer is a simple C++ and Raylib program for viewing timetables. The timetables are user defineable JSON files in the timetables folder.

Dependencies

The following dependencies are required to build this program:

C++20
make
raylib
cppjp

Build Instructions

All Platforms

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.

Linux / MacOS

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 ..
$ make

The compiled program can then be found inside of the build folder.

Windows

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.git

Or 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.

Using the program

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.

Timetable file format

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.

Timetable file

{
    "modules": [ ... ],
    "timetable": [ ... ]
}

Modules

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 the timetable section 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 #RRGGBB where RR, GG and BB are hex values.

Timetable

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 above module section.
  • day: This is the day on which this lecture / laboratory falls on. It must be one of the following values:
    • Monday OR Mon
    • Tuesday OR Tue
    • Wednesday OR Wed
    • Thursday OR Thu
    • Friday OR Fri
  • timeslot: This is the timeslot on which this lecture / laboratory falls on. It must be one of the following values:
    • 09:00
    • 10:00
    • 11:00
    • 12:00
    • 13:00
    • 14:00
    • 15:00
    • 16:00
    • 17: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 is 1.
  • lab: This is an optional parameter, signifies if this is a laboratory or not. The default values is false.
  • start_week: This is an optional parameter, signifies in which week this lecutre / laboratory starts. The default value is 1.
  • end_week: This is an optional parameter, signifies in which week this lecture / laboratory ends. The default value is 12.

Full timetable example

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 }
    ]
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors