-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS2113-T13-2] Timetable Comparer #39
base: master
Are you sure you want to change the base?
Changes from all commits
ef89eb0
160ffcb
e3415aa
6c30e11
30381a5
7f0f002
19fc5b4
0b2d8e3
bd46535
11d6364
450a5e6
b441343
62984a2
9168655
bfdc3bb
f45aad6
ad3b396
476e2e2
25336fe
28fe701
00473c0
bf21be6
448bfd6
90bde4e
1c8fdaa
e239cb1
4fe8197
c5b811a
757b5ee
95f6566
d3b22c7
3623593
70d97e2
a966310
266719d
79244dc
7b86a66
1a281a2
798aa34
c00e0e2
f2ce7cf
04e94da
b680681
d2cb16f
6cd21e1
9113e94
2d70c54
81a7ce2
ab0d0c8
ecac00f
d4d2ecd
be36cb5
fe55614
40a06f8
8d3f143
1a926a1
33fcd47
da98897
643204f
4f54de2
f6158d4
3a43fe2
aa88c0f
5848b52
cc678c2
8b955ac
4f78376
bd27819
80f87d8
4ee3fa4
c368035
7df8569
194e3ec
f5d7024
9d9169b
608aed7
a158be3
b2461e4
587bf37
4ab771e
899ea6f
35e94f0
9656609
6a09dd5
4c1431f
c1f6ab5
d3c0789
e5788c5
0319f77
d7300e2
36dfbe0
9d7de11
97862f5
6cfac07
ba7c4e4
817d5a6
e0611a7
2e27f4d
862ef0a
ed1d1e2
6d5356c
f65e95a
1ce4aa5
139d66c
5f51347
cb23ae0
46d8bca
12f57c8
d9e445a
9dbe139
65c01a9
47db8ea
3b0a088
b3ace78
6d73ef5
1a9448e
2a9b50a
2a0e85f
74ce604
c04c644
1204eb8
8c62056
dd2fb7e
dc31f1c
c5e485d
476a247
b7df7c6
095f5fc
1bd9140
6aec41b
721859b
e87f238
8bab691
3d3fa9b
3cfae32
17a9fe3
e2c142b
17371f8
b943f7d
c406d0e
374cdf6
d430fdd
f93fd8a
87c1bf9
f9e50fc
db022be
ff00609
3f77b12
4ba3ae1
95a50bf
707441e
7fe8c96
59b7531
f99a4b8
55c4ba2
57bd5f0
c18dccd
ae5fcc4
4776c71
0b4df7d
a7acf32
b9640ad
e327b0f
ae0642f
6b496e3
322318b
f4b5a47
9b01325
2dac250
21f0a74
17be789
fc34007
d39494b
5d8b2f3
ae96cfa
e2a8ab8
541955c
b5974cd
44c8e26
de80b93
0ec7133
4115dda
5c99c67
ee68d5e
dc1f47b
b2950b5
ae4bda6
0c69f8f
8b4733b
e9c5d00
a336551
11cb304
bfadc22
f5d23ae
d4857b1
1746671
ea2ac6a
db55a58
fb1c798
72c6098
66c6d45
dcc4a12
b728fe4
5c34d24
49010b1
a184547
0337453
1ee7f8f
afc1f42
0e30329
914d7e5
002209e
960e6ba
c7ec603
84491b1
6662ef1
7baf6de
b23b62e
850e78d
f1fd8fb
30800d1
cf778ee
e57e262
897a154
31d1269
2827a8d
da3acb8
1ec77a1
0655c35
35e33cb
0520a76
6432c42
2e0183e
3b0640c
9afa228
d3374f8
19ecf80
29cb5da
6bab4bd
8b31d84
45c1dd5
9dd9cd5
319f850
ad7dc50
41fdccc
e69d14b
4dcf6e5
d213497
f3a0af5
9e792ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: seedu.duke.Main | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
Display | Name | Github Profile | Portfolio | ||
--------|:--------------:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | Leong Zhe Ming | [Github](https://github.com/Leong-ZM) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Zhang Wenqing | [Github](https://github.com/z-wenqing) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Zhu Sijia | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Nguyen | [Github](https://github.com/john-nng) | [Portfolio](docs/team/johndoe.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@startuml | ||
title changeTaskTiming Sequence Diagram | ||
|
||
participant ":Parser" as Caller | ||
participant ":changeTaskTiming" as Method | ||
participant ":changeFlexibleTaskTiming" as FlexibleMethod | ||
participant ":InputValidator" as InputValidator | ||
participant ":UserList" as UserList | ||
participant ":User" as User | ||
participant ":Timetable" as Timetable | ||
|
||
Caller -> Method: changeTaskTiming(command, userList) | ||
activate Method | ||
Method -> InputValidator: validateChangeTaskTiming(command) | ||
activate InputValidator | ||
Method -> InputValidator: command.split("\\s+") | ||
Method <-- InputValidator: parts[] | ||
Method -> InputValidator: Arrays.asList(parts) | ||
Method <-- InputValidator: wordList[] | ||
Method -> InputValidator: parts[2] | ||
Method -> InputValidator: parts[wordList.indexOf("/index") + 1] | ||
Method -> InputValidator: parts[wordList.indexOf("/from") + 1] | ||
Method -> InputValidator: parts[wordList.indexOf("/to") + 1] | ||
Method -> InputValidator: validateDay(day) | ||
deactivate InputValidator | ||
Method -> UserList: userList.getActiveUser() | ||
Method <-- UserList: activeUser | ||
Method -> User: activeUser.getTimetable() | ||
activate User | ||
Method <-- User: timetable | ||
Method -> FlexibleMethod: timetable.changeFlexibleTaskTiming(day, index - 1, newStartTime, newEndTime) | ||
activate FlexibleMethod | ||
FlexibleMethod <-- Timetable: successful change | ||
deactivate FlexibleMethod | ||
deactivate User | ||
deactivate Method | ||
|
||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,151 @@ | ||
# Developer Guide | ||
|
||
## Acknowledgements | ||
## Design & implementation | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
### Save timetable function | ||
The saving timetable mechanism is facilitated by the Storage class. It implements the following operations: | ||
* `Storage#createFolder()`: Creates a folder in the directory where all the users' timetable will be stored in the local computer. | ||
* `Storage#addExistingUsers()`: Loops through the folder to add all previous saved users upon opening the app, as well as their corresponding tasks. | ||
* `Storage#addUserInFolder(User user)`: When a new user is added, a file with the name of the user will be created in the folder. | ||
* `Storage#writeTaskInFile(User user)`: when a new task of a specific user is added, it will be written into the correct file. | ||
|
||
## Design & implementation | ||
The following sequence diagram shows how the operations in the Storage class goes through when the app is opened and it loads data from history: | ||
![Storage UML](diagram%2FStorageUML.png) | ||
|
||
|
||
## Parser Component | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these sections (Parser Component, Timetable Component and Next Command) be under the Design & Implementation sections instead of under the Instructions for manual testing section? |
||
|
||
Here is a general guide of how Parse Class looks like in sequence diagram. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose this should be "Parser Class" instead? Considering the file is Parser.java (although the png file is Parse.png) |
||
|
||
![Parse.png](diagram%2FParse.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider updating this portion. Nevertheless, a very detailed sequence diagram. Good use of the note to add relevant information. 👍 |
||
|
||
Here is a class diagram for the method changeTaskTiming method in Parser Class. | ||
|
||
![changeTaskTimingClassDiagram.png](diagram%2FchangeTaskTimingClassDiagram.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding an explanation and the purpose of this class diagram to improve readability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the (C) logo be in the class diagrams? Do include |
||
|
||
The following sequence diagram of changeTaskTiming shows the interactions with other objects. | ||
|
||
![changeTaskTiming_Sequence_Diagram.png](diagram%2FchangeTaskTiming_Sequence_Diagram.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good sequence diagram with explanations below. Consider the following improvements:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the return arrow stem from the User class instead? |
||
|
||
Here is how this method works: | ||
|
||
1. The Parser calls the changeTaskTiming method with a command and the UserList. It calls InputValidator. | ||
|
||
2. The InputValidator validates the command, ensuring that it meets the required format in days and index. | ||
|
||
3. If validation is successful, the User calls the timetable and calls its changeFlexibleTaskTiming method with the specified parameters. | ||
|
||
4. The Timetable updates the timing of the flexible task. | ||
|
||
5. If successful, the InputValidator sends a success message back to the Parser. Otherwise, it throws a RuntimeException. | ||
|
||
## Timetable Component | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be good to include the design considerations the team had in mind when implementing the Timetable component. |
||
Here is a sequence diagram of changeTaskType method in Timetable class. It shows the interactions with other objects. | ||
![changeTaskType.png](diagram%2FchangeTaskType.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Here is how this method works: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good breakdown of the changeTaskType method. However, should there be the other methods of the Timetable class? |
||
1. The sequence starts with the Parser sending a request to the Timetable to change the type of a task. | ||
|
||
2. The Timetable activates and processes the changeTaskType method. | ||
|
||
3. Within the Timetable, the dayOfWeek parameter is capitalized to ensure consistency. | ||
|
||
4. The Timetable calls the list of tasks associated with the specified day (dayOfWeek). It activates the Task object to fetch the task at the specified index (index). | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
5. The Task object modifies the type of the task to the new type specified by the Parser. | ||
|
||
6. Finally, the modified task or any relevant status information is returned to the Parser. | ||
|
||
## Next Command | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good description of proposed implementation, with a detailed sequence diagram. 👍 |
||
|
||
Proposed implementation | ||
|
||
The next command displays the next task of the current user based on the current time. Given below is how it works. | ||
|
||
Step 1: The user launches the application, creates a user, and creates several tasks for the user. | ||
|
||
Step 2: The user types the command 'next' to see their next task. | ||
|
||
Step 3: The next command is triggered. It first determines the current day and takes the arraylist of tasks of the user's timetable on that day. | ||
|
||
Step 4: It then loops through the tasks on that day, starting from the back (the later tasks), until the task's start time is before the current time. | ||
|
||
Step 5: It displays the last task it looped though, or a special message if there is no task that day. | ||
|
||
![NextCommand UML](diagram%2FNextCommand.png) | ||
|
||
# Appendix: Project Requirements | ||
## Product scope | ||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
People who | ||
* have busy timetables | ||
* wish to be able to compare theirs with their friends' easily | ||
* prefer desktop apps over other types | ||
* can type fast | ||
* prefer typing to mouse interactions | ||
* are reasonably comfortable using CLI apps | ||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
The app can store multiple timetables and easily display and compare them automatically, saving the time and effort of doing so by hand. | ||
|
||
## User Stories | ||
|
||
|Version| As a ... | I want to ... | So that I can ...| | ||
|--------|----------|---------------|------------------| | ||
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application| | ||
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list| | ||
| Version | As a ... | I want to ... | So that I can ... | | ||
|---------|----------|---------------------------|------------------------------------------------------------------| | ||
| v1.0 | new user | see usage instructions | refer to them when I forget how to use the application | | ||
| | user | add a new user | store my timetable | | ||
| | user | switch users | interact with my own timetable | | ||
| | user | add a task | | | ||
| | user | compare two timetables | see the common time between them | | ||
| v2.0 | user | find a to-do item by name | locate a to-do without having to go through the entire list | | ||
| | user | specify task importance | remember if a task is important or not | | ||
| | user | compare all timetables | view a summarized timetable comprising of all current timetables | | ||
|
||
|
||
## Non-Functional Requirements | ||
|
||
{Give non-functional requirements} | ||
1. Should work on any mainstream OS (Windows, Linux, Unix, MacOS) as long as it has Java 11 or above installed. | ||
2. Should be able to hold up to 10 persons without a noticeable sluggishness in performance for typical usage. | ||
3. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse. | ||
|
||
## Glossary | ||
|
||
* *glossary item* - Definition | ||
* **User** - A person using this app. | ||
* **Timetable** - A number of tasks belonging to a specific user. | ||
* **Task** - An event in a timetable, with a description, start time, end time, and type. | ||
|
||
## Instructions for manual testing | ||
|
||
{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing} | ||
Given below are instructions to test the app manually. | ||
|
||
### Launch and Shutdown | ||
|
||
1. Initial launch | ||
|
||
Download the jar file and copy into an empty folder. Double-click the jar file. Expected: Shows the GUI with a list of commands. The window size may not be optimum; adjust it as necessary. | ||
|
||
2. Shutdown | ||
|
||
Enter 'bye'. The app should close and all current data should be saved in a data folder. | ||
|
||
### Add user | ||
|
||
Prerequisites: None | ||
|
||
* Valid command: `adduser User1`. Expected: Confirmation that user was added. | ||
* Invalid command: `adduser`. Expected: Error message shown. | ||
* Invalid command: `adduser User1`, where User1 already exists. Expected: Error message shown. | ||
|
||
### Add task | ||
|
||
Prerequisites: At least one user has been added | ||
|
||
* Valid command: `addtask /on Monday /task test1 /from 9:00 /to 11:00 /type f`. Expected: Confirmation that task was added. | ||
* Invalid commands. Expected: Error message shown detailing expected format. | ||
* `addtask /on Monday` | ||
* `addtask /on Monday /task description` | ||
* `addtask /on Monday /task description /from 09:00 /to 11:00` | ||
* `addtask Monday description 09:00 11:00` | ||
* `addtask /on MONDAY /task description /from 09:00 /to 11:00` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@startuml | ||
autonumber | ||
|
||
participant ":Main" as Main | ||
participant ":Parser" as Parser | ||
participant ":DayOfWeek" as DayOfWeek | ||
participant ":Timetable" as Timetable | ||
participant ":UI" as UI | ||
|
||
|
||
Main -> Parser: (parseCommand("next", userList)) | ||
activate Parser | ||
DayOfWeek -> Parser: dayOfWeek | ||
Parser -> Parser: capitalizeDay(dayOfWeek) | ||
activate Parser | ||
Parser --> Parser: result | ||
deactivate Parser | ||
|
||
Parser -> Timetable: getWeeklyTasks(dayOfWeek) | ||
activate Timetable | ||
Timetable --> Parser: tasksOfDay | ||
deactivate Timetable | ||
Parser -> Parser: tasksOfDay.size() | ||
activate Parser | ||
Parser --> Parser: result | ||
deactivate Parser | ||
|
||
alt numOfTasks == 0 | ||
Parser -> UI: printNoTasks() | ||
activate UI | ||
UI --> Main: display no text | ||
deactivate UI | ||
else | ||
loop numOfTasks | ||
alt currentTime < task.startTime | ||
Parser -> UI: nextTask() | ||
activate UI | ||
|
||
deactivate UI | ||
end | ||
end | ||
end | ||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@startuml | ||
participant ":UI" as UI | ||
participant ":Parser" as Parser | ||
participant ":UserList" as UserList | ||
participant ":Timetable" as Timetable | ||
participant ":InputValidator" as InputValidator | ||
|
||
UI -> Parser: parseCommand(command, userList) | ||
activate Parser | ||
|
||
Parser -> UserList: setActiveUser(user) | ||
activate UserList | ||
UserList --> Parser: Confirmation | ||
|
||
alt command = "changeTaskType" | ||
Parser -> InputValidator: validateChangeTaskType(command) | ||
activate InputValidator | ||
InputValidator -> Timetable: changeTaskType(dayOfWeek, index, newType) | ||
activate Timetable | ||
Timetable --> Parser: Success message | ||
deactivate Timetable | ||
InputValidator --> Parser: No exceptions thrown | ||
deactivate InputValidator | ||
Parser --> UI: "Task type changed successfully." | ||
else command = "deleteTask" | ||
Parser -> InputValidator: validateDeleteTaskInput(command) | ||
activate InputValidator | ||
InputValidator -> Timetable: deleteUserTask(day, index) | ||
activate Timetable | ||
Timetable --> Parser: Success message | ||
deactivate Timetable | ||
InputValidator --> Parser: No exceptions thrown | ||
deactivate InputValidator | ||
Parser --> UI: Success message | ||
else | ||
note right of Parser | ||
Other command cases handled similarly | ||
end note | ||
Parser --> UI: Output message | ||
end | ||
|
||
deactivate Parser | ||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
# Duke | ||
# TimetableComparer | ||
|
||
{Give product intro here} | ||
|
||
Useful links: | ||
* [User Guide](UserGuide.md) | ||
* [Developer Guide](DeveloperGuide.md) | ||
* [About Us](AboutUs.md) | ||
Refer to UserGuide: [User Guide](https://ay2324s2-cs2113-t13-2.github.io/tp/UserGuide.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can improve the DG by reordering and gathering the same components and putting them in the same section of the DG