You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since bpmOutputLabel is null in DJView.java on startup, the bpmOutputLabel will display "offline" for a short time if the heart rate doesn't change on startup.
For example, the heart rate is 60 on startup, lastrate is -1, rate != lastrate, then lastrate = rate = 60, and notifies the view to update bpmOutputLabel. But the bpmOutputLabel is null, no update. If the rate is 60 and doesn't change for a short time, since lastrate has already changed to 60, the bpmOutputLabel will not be updated for a short time too.
Original Code
if (rate < 120 && rate > 50) {
time += change;
notifyBeatObservers();
if (rate != lastrate) {
lastrate = rate;
notifyBPMObservers();
}
}
// ...
New Code
if (rate < 120 && rate > 50) {
time += change;
notifyBeatObservers();
notifyBPMObservers();
}
// ...
And delete int lastrate = -1; in Line 19
The text was updated successfully, but these errors were encountered:
newryu
changed the title
The BPM display bugs of BeatModel.java in MVC compound pattern
The BPM display bugs of BeatModel.java and HeartModel.java in MVC compound pattern
Aug 2, 2022
BPM display bugs in BeatModel.java
Input bpm 100, click Set, then click Start. The view will display 100, but actually the bpm is 90. And some other cases of bpm display bugs ...
Original Code
New Code
BPM display bugs in HeartModel.java
Since bpmOutputLabel is null in DJView.java on startup, the bpmOutputLabel will display "offline" for a short time if the heart rate doesn't change on startup.
For example, the heart rate is 60 on startup, lastrate is -1, rate != lastrate, then lastrate = rate = 60, and notifies the view to update bpmOutputLabel. But the bpmOutputLabel is null, no update. If the rate is 60 and doesn't change for a short time, since lastrate has already changed to 60, the bpmOutputLabel will not be updated for a short time too.
Original Code
New Code
And delete
int lastrate = -1;
in Line 19The text was updated successfully, but these errors were encountered: