From: Ian Jackson Date: Sun, 5 Sep 2010 11:53:49 +0000 (+0100) Subject: replace commented-out debugging printlns with ones which use dtxt X-Git-Tag: 0.9.9~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-ian.git;a=commitdiff_plain;h=ef8e7f059efa5abf5e1b080d1c114a85ed9b8e43;hp=06fbe9fd1dba651bd4b56cd36cf66ecbc2889c01;ds=sidebyside replace commented-out debugging printlns with ones which use dtxt --- 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);