|
From: <cs...@us...> - 2013-10-07 11:57:48
|
Revision: 327
http://sourceforge.net/p/advance-project/code/327
Author: csirobi
Date: 2013-10-07 11:57:44 +0000 (Mon, 07 Oct 2013)
Log Message:
-----------
HubDepot: summary chart fix
Modified Paths:
--------------
advance-live-reporter-os/src/eu/advance/logistics/live/reporter/charts/SumChart.java
advance-live-reporter-os/src/eu/advance/logistics/live/reporter/charts/SumData.java
advance-live-reporter-os/src/eu/advance/logistics/live/reporter/model/ServiceLevel.java
Modified: advance-live-reporter-os/src/eu/advance/logistics/live/reporter/charts/SumChart.java
===================================================================
--- advance-live-reporter-os/src/eu/advance/logistics/live/reporter/charts/SumChart.java 2013-10-07 07:39:21 UTC (rev 326)
+++ advance-live-reporter-os/src/eu/advance/logistics/live/reporter/charts/SumChart.java 2013-10-07 11:57:44 UTC (rev 327)
@@ -71,6 +71,24 @@
return result;
}
+ /** The relevant service levels. */
+ private static final ServiceLevel[] SERVICE_LEVELS = {
+ ServiceLevel.ALL,
+ ServiceLevel.STANDARD,
+ ServiceLevel.PRIORITY,
+ ServiceLevel.SPECIAL
+ };
+
+ /** The relevant item statuses. */
+ private static final ItemStatus[] ITEM_STATUSES = {
+ ItemStatus.LEFT_HUB_TODAY,
+ ItemStatus.AT_HUB,
+ ItemStatus.DECLARED,
+ ItemStatus.SCANNED,
+ ItemStatus.CREATED,
+ ItemStatus.PREDICTED
+ };
+
/**
* Create the direction JSON object.
* @param sumData the data source
@@ -116,7 +134,7 @@
switch(sumData.type) {
case HUB:
JSONArray tickArray = new JSONArray();
- for (ServiceLevel sKey : ServiceLevel.values()) {
+ for (ServiceLevel sKey : SERVICE_LEVELS) {
tickArray.add(((HubCoord)coord).noOfTotalTick.get(sKey).toPlainString());
}
result.put("noOfTotalTick", tickArray);
@@ -135,16 +153,7 @@
return result;
}
- /** The relevant item statuses. */
- private static final ItemStatus[] ITEM_STATUSES = {
- ItemStatus.CREATED,
- ItemStatus.SCANNED,
- ItemStatus.DECLARED,
- ItemStatus.AT_HUB,
- ItemStatus.LEFT_HUB_TODAY,
- ItemStatus.PREDICTED
- };
-
+
/**
* Create the status JSON array.
* @return the created JSON array
@@ -162,6 +171,7 @@
return resultArray;
}
+
/**
* Create the bars JSON array.
* @param coord the coordinate object
@@ -176,7 +186,7 @@
JSONArray orientRec;
EnumSet<OrientStatus> orientKeys = bar.getOrientKeys();
- for (ServiceLevel uKey: ServiceLevel.values()) {
+ for (ServiceLevel uKey: SERVICE_LEVELS) {
typeRec = new JSONObject();
typeRec.put("unit", uKey.getMessage());
typeRec.put("name", bar.name);
Modified: advance-live-reporter-os/src/eu/advance/logistics/live/reporter/charts/SumData.java
===================================================================
--- advance-live-reporter-os/src/eu/advance/logistics/live/reporter/charts/SumData.java 2013-10-07 07:39:21 UTC (rev 326)
+++ advance-live-reporter-os/src/eu/advance/logistics/live/reporter/charts/SumData.java 2013-10-07 11:57:44 UTC (rev 327)
@@ -124,10 +124,12 @@
*/
public void checkBaus() {
GraphDecimal value = new GraphDecimal(0);
+ // Widest range case: login at hub and selected any depot.
+ ItemStatus[] statuses = {ItemStatus.AT_HUB, ItemStatus.DECLARED, ItemStatus.SCANNED, ItemStatus.CREATED, ItemStatus.PREDICTED};
for (OrientStatus oKey : this.getOrientKeys()) {
- GraphDecimal inner = new GraphDecimal(0);
- for (ItemStatus pKey : ItemStatus.values()) {
+ GraphDecimal inner = this.maxLeftHub(true);
+ for (ItemStatus pKey : statuses) {
BarData bd = this.items.get(ServiceLevel.ALL).get(oKey).get(pKey);
if (bd != null) {
inner = inner.add(new GraphDecimal(bd.value));
Modified: advance-live-reporter-os/src/eu/advance/logistics/live/reporter/model/ServiceLevel.java
===================================================================
--- advance-live-reporter-os/src/eu/advance/logistics/live/reporter/model/ServiceLevel.java 2013-10-07 07:39:21 UTC (rev 326)
+++ advance-live-reporter-os/src/eu/advance/logistics/live/reporter/model/ServiceLevel.java 2013-10-07 11:57:44 UTC (rev 327)
@@ -29,7 +29,7 @@
STANDARD("Standard"),
/** Priority level. */
PRIORITY("Priority"),
- /** Special levle. */
+ /** Special level. */
SPECIAL("Special"),
/** Used by the screens to indicate aggregation. */
ALL("All services");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|