Main view updates every Hour instead of min

This commit is contained in:
HeshamTB 2020-12-14 04:40:45 +03:00
parent 5143ae2891
commit 270e89ee5b
Signed by: Hesham
GPG Key ID: 74876157D199B09E

View File

@ -69,9 +69,6 @@ public class MakkahCity {
makeRoutes();
// Vehicle car = traceCar();
//TODO Arrival Time for Each Day
//GUI
autoModeCheckBox = new Checkbox();
makkahFrame = new JFrame("Hajj Simulation");
@ -165,7 +162,7 @@ public class MakkahCity {
btnViewBuses.setForeground(Color.white);
btnViewBuses.addActionListener(e -> {
GUI_ViewBuses t = new GUI_ViewBuses(listOfCampaigns , currenttimeManager);
});// TODO: the list is update every MINUTE, we don't need it.
});
JButton btnViewCampaigns = new JButton("View Campaigns");
btnViewCampaigns.setBounds(1307, 119, 166, 29);
@ -369,6 +366,7 @@ public class MakkahCity {
//Start of Every hour
if (firstDayTimeMan.getCurrentCalendar().get(Calendar.MINUTE) == 0){
System.out.println("\n\n" + getStreetsReport());
updateStreetFrame();
saveState();
}
else System.out.print(".");
@ -407,9 +405,7 @@ public class MakkahCity {
}
}
if (isAllArrived() && allArrivedToArafatTime == null) allArrivedToArafatTime = (Date)currenttimeManager.getCurrentTime().clone();
updateStreetFrame();
firstDayTimeMan.step(Calendar.MINUTE, 1);
// System.out.println(car);
}
currenttimeManager = lastDayTimeMan;
@ -430,6 +426,8 @@ public class MakkahCity {
//Start of Every hour
if (lastDayTimeMan.getCurrentCalendar().get(Calendar.MINUTE) == 0){
System.out.println("\n\n" + getStreetsReport());
updateStreetFrame();
saveState();
}
else System.out.print(".");
@ -467,7 +465,6 @@ public class MakkahCity {
}
}
if (isAllArrived() && allArrivedToHotelsTime == null) allArrivedToHotelsTime = (Date)currenttimeManager.getCurrentTime().clone();
updateStreetFrame();
lastDayTimeMan.step(Calendar.MINUTE, 1);
}
//When done show menu to analyze. Exit from menu too.