Skip to content
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

[Away Mode] - Reach Temperature, Notify User #85

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

178 changes: 178 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

139 changes: 139 additions & 0 deletions out/production/SOEN343/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions src/Observer/Events/TemperatureEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package src.Observer.Events;

import src.logic.SimulationParameter;

public class TemperatureEvent extends Event {
private String eventType;

public TemperatureEvent(String type, String eventType) {
super(type);
this.eventType = eventType;
}

public String getEventType() {
return eventType;
}
}
9 changes: 5 additions & 4 deletions src/Observer/TempEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ public TempEvent(String type, SimulationParameter sp) {
this.simulationParameter = sp;

String date = sp.getDate().toString();
int month = Integer.parseInt(date.substring(5,7));
if(month >= 6 && month <=9) isSummer = true;
else isSummer = false;
int month = Integer.parseInt(date.substring(5, 7));
if (month >= 6 && month <= 9)
isSummer = true;
else
isSummer = false;
}

public double getIndoorTemp() {
Expand All @@ -34,7 +36,6 @@ public boolean getIsSummer() {
return isSummer;
}


public SimulationParameter getSimulationParameter() {
return simulationParameter;
}
Expand Down
Loading