diff --git a/pyfpdb/FpdbSQLQueries.py b/pyfpdb/FpdbSQLQueries.py index 6443c1ed..0c44ef96 100644 --- a/pyfpdb/FpdbSQLQueries.py +++ b/pyfpdb/FpdbSQLQueries.py @@ -681,6 +681,8 @@ class FpdbSQLQueries: ,stats.PFAFq ,hprof2.sum_profit/100 as Net ,(hprof2.sum_profit/stats.bigBlind)/(stats.n/100) as BBlPer100 + ,hprof2.profitperhand as Profitperhand + ,hprof2.variance as Variance FROM (select # stats from hudcache gt.base @@ -709,7 +711,9 @@ class FpdbSQLQueries: ) stats inner join ( select # profit from handsplayers/handsactions - hprof.gameTypeId, sum(hprof.profit) sum_profit + hprof.gameTypeId, sum(hprof.profit) sum_profit, + avg(hprof.profit/100.0) profitperhand, + variance(hprof.profit/100.0) variance from (select hp.handId, h.gameTypeId, hp.winnings, SUM(ha.amount) costs, hp.winnings - SUM(ha.amount) profit @@ -745,6 +749,8 @@ class FpdbSQLQueries: ,stats.PFAFq ,hprof2.sum_profit/100 as Net ,(hprof2.sum_profit/stats.bigBlind)/(stats.n/100) as BBlPer100 + ,hprof2.profitperhand as Profitperhand + ,hprof2.variance as Variance FROM (select gt.base ,upper(gt.limitType) as limitType @@ -774,7 +780,10 @@ class FpdbSQLQueries: ,hc.gametypeId ) stats inner join - ( select hprof.gameTypeId, sum(hprof.profit) as sum_profit + ( select + hprof.gameTypeId, sum(hprof.profit) sum_profit, + avg(hprof.profit/100.0) profitperhand, + variance(hprof.profit/100.0) variance from (select hp.handId, h.gameTypeId, diff --git a/pyfpdb/GuiPlayerStats.py b/pyfpdb/GuiPlayerStats.py index c486a664..91c972af 100644 --- a/pyfpdb/GuiPlayerStats.py +++ b/pyfpdb/GuiPlayerStats.py @@ -51,7 +51,7 @@ class GuiPlayerStats (threading.Thread): tmp = tmp.replace("", "(" + str(pid) + ")") self.cursor.execute(tmp) result = self.db.cursor.fetchall() - cols = 18 + cols = 20 rows = len(result)+1 # +1 for title row self.stats_table = gtk.Table(rows, cols, False) self.stats_table.set_col_spacings(4) @@ -59,7 +59,7 @@ class GuiPlayerStats (threading.Thread): vbox.add(self.stats_table) # Create header row - titles = ("GID", "base", "Style", "Site", "$BB", "Hands", "VPIP", "PFR", "saw_f", "sawsd", "wtsdwsf", "wmsd", "FlAFq", "TuAFq", "RvAFq", "PFAFq", "Net($)", "BB/100") + titles = ("GID", "base", "Style", "Site", "$BB", "Hands", "VPIP", "PFR", "saw_f", "sawsd", "wtsdwsf", "wmsd", "FlAFq", "TuAFq", "RvAFq", "PFAFq", "Net($)", "BB/100", "$/hand", "Variance") col = 0 row = 0