X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-ian.git;a=blobdiff_plain;f=src%2Fcom%2Ftedpearson%2Fypp%2Fmarket%2FMarketUploader.java;h=b20e359e10bda3c58aa1cbb8988f693c5392d647;hp=1b1382e7650d2be2e5e4aa622f94f5258a452292;hb=ef8e7f059efa5abf5e1b080d1c114a85ed9b8e43;hpb=06fbe9fd1dba651bd4b56cd36cf66ecbc2889c01
diff --git a/src/com/tedpearson/ypp/market/MarketUploader.java b/src/com/tedpearson/ypp/market/MarketUploader.java
index 1b1382e..b20e359 100644
--- a/src/com/tedpearson/ypp/market/MarketUploader.java
+++ b/src/com/tedpearson/ypp/market/MarketUploader.java
@@ -76,7 +76,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
int index = text.indexOf(":");
String name = text.substring(0,index);
islandName = name;
- //System.out.println(islandName);
+ // if (dtxt!=null) dtxt.println(islandName);
sidePanel.removePropertyChangeListener(this);
latch.countDown();
}
@@ -539,8 +539,8 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
}
int[] offerCount = getBuySellMaps(data,buys,sells,stallMap,commodMap);
//println(buys.toString());
- //System.out.println(sells);
- //System.out.println("\n\n\n"+buys);
+ // if (dtxt!=null) dtxt.println(sells);
+ // if (dtxt!=null) dtxt.println("\n\n\n"+buys);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
pm.setProgress(60);
@@ -607,13 +607,13 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
Accessible node1 = window;
Accessible node = descendNodes(node1,new int[] {0,1,0,0,0,0,1,0,0,1,0,0}); // commod market
// commod market: {0,1,0,0,0,0,1,0,0,1,0} {0,1,0,0,0,0,1,0,1,0,0,1,0,0})
- //System.out.println(node);
+ // if (dtxt!=null) dtxt.println(node);
if (!(node instanceof JTable)) {
node = descendNodes(node1,new int[] {0,1,0,0,0,0,1,0,1,0,0,1,0,0}); // commod market
}
if (!(node instanceof JTable)) return null;
AccessibleTable table = node.getAccessibleContext().getAccessibleTable();
- //System.out.println(table);
+ // if (dtxt!=null) dtxt.println(table);
return table;
}
@@ -630,7 +630,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
private Accessible descendNodes(Accessible parent, int[] path) {
for(int i=0;i.+?.+?");
@@ -1053,7 +1053,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
}
private int calculateArbitrageCommodity(ArrayList> arb_bs) {
- //System.out.println("ARBITRAGE?");
+ // if (dtxt!=null) dtxt.println("ARBITRAGE?");
int profit = 0;
SortedSet buys = arb_bs.get(0);
SortedSet sells = arb_bs.get(1);
@@ -1069,7 +1069,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
int unitprofit = buy[0] - sell[0];
int count = buy[1] < sell[1] ? buy[1] : sell[1];
- //System.out.println(" sell @"+sell[0]+" x"+sell[1]+" buy @"+buy[0]+" x"+buy[1]
+ // if (dtxt!=null) dtxt.println(" sell @"+sell[0]+" x"+sell[1]+" buy @"+buy[0]+" x"+buy[1]
// +" => x"+count+" @"+unitprofit);
if (unitprofit <= 0)
@@ -1081,7 +1081,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
if (buy[1]==0) buys.remove(buy);
if (sell[1]==0) sells.remove(sell);
}
- //System.out.println(" PROFIT "+profit);
+ // if (dtxt!=null) dtxt.println(" PROFIT "+profit);
return profit;
}
@@ -1102,15 +1102,15 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
for (ArrayList row : data) {
String thiscommod = row.get(0);
- //System.out.println("ROW "+row.toString());
+ // if (dtxt!=null) dtxt.println("ROW "+row.toString());
if (lastcommod == null || !thiscommod.equals(lastcommod)) {
if (lastcommod != null)
arbitrage += calculateArbitrageCommodity(arb_bs);
- //System.out.println("ROW rdy");
+ // if (dtxt!=null) dtxt.println("ROW rdy");
arb_bs = new ArrayList>(2);
arb_bs.add(0, new TreeSet(compar));
arb_bs.add(1, new TreeSet(compar));
- //System.out.println("ROW init");
+ // if (dtxt!=null) dtxt.println("ROW init");
lastcommod = thiscommod;
}
for (int bs = 0; bs < 2; bs++) {
@@ -1118,7 +1118,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
if (pricestr == null)
continue;
int[] entry = new int[2];
- //System.out.println("ROW BS "+bs);
+ // if (dtxt!=null) dtxt.println("ROW BS "+bs);
entry[0] = parseQty(pricestr);
entry[1] = parseQty(row.get(bs*2 + 3));
arb_bs.get(bs).add(entry);