Merge branch 'master' of git://git.assembla.com/fpdboz

This commit is contained in:
eblade 2008-12-13 11:51:31 -05:00
commit 2002da9fb7
2 changed files with 13 additions and 4 deletions

View File

@ -681,6 +681,8 @@ class FpdbSQLQueries:
,stats.PFAFq ,stats.PFAFq
,hprof2.sum_profit/100 as Net ,hprof2.sum_profit/100 as Net
,(hprof2.sum_profit/stats.bigBlind)/(stats.n/100) as BBlPer100 ,(hprof2.sum_profit/stats.bigBlind)/(stats.n/100) as BBlPer100
,hprof2.profitperhand as Profitperhand
,hprof2.variance as Variance
FROM FROM
(select # stats from hudcache (select # stats from hudcache
gt.base gt.base
@ -709,7 +711,9 @@ class FpdbSQLQueries:
) stats ) stats
inner join inner join
( select # profit from handsplayers/handsactions ( 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 from
(select hp.handId, h.gameTypeId, hp.winnings, SUM(ha.amount) (select hp.handId, h.gameTypeId, hp.winnings, SUM(ha.amount)
costs, hp.winnings - SUM(ha.amount) profit costs, hp.winnings - SUM(ha.amount) profit
@ -745,6 +749,8 @@ class FpdbSQLQueries:
,stats.PFAFq ,stats.PFAFq
,hprof2.sum_profit/100 as Net ,hprof2.sum_profit/100 as Net
,(hprof2.sum_profit/stats.bigBlind)/(stats.n/100) as BBlPer100 ,(hprof2.sum_profit/stats.bigBlind)/(stats.n/100) as BBlPer100
,hprof2.profitperhand as Profitperhand
,hprof2.variance as Variance
FROM FROM
(select gt.base (select gt.base
,upper(gt.limitType) as limitType ,upper(gt.limitType) as limitType
@ -774,7 +780,10 @@ class FpdbSQLQueries:
,hc.gametypeId ,hc.gametypeId
) stats ) stats
inner join 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 from
(select hp.handId, (select hp.handId,
h.gameTypeId, h.gameTypeId,

View File

@ -51,7 +51,7 @@ class GuiPlayerStats (threading.Thread):
tmp = tmp.replace("<player_test>", "(" + str(pid) + ")") tmp = tmp.replace("<player_test>", "(" + str(pid) + ")")
self.cursor.execute(tmp) self.cursor.execute(tmp)
result = self.db.cursor.fetchall() result = self.db.cursor.fetchall()
cols = 18 cols = 20
rows = len(result)+1 # +1 for title row rows = len(result)+1 # +1 for title row
self.stats_table = gtk.Table(rows, cols, False) self.stats_table = gtk.Table(rows, cols, False)
self.stats_table.set_col_spacings(4) self.stats_table.set_col_spacings(4)
@ -59,7 +59,7 @@ class GuiPlayerStats (threading.Thread):
vbox.add(self.stats_table) vbox.add(self.stats_table)
# Create header row # 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 col = 0
row = 0 row = 0