def __init__(self): wx.Frame.__init__(self, None, -1, 'Watterson the Manager', size=(1900, 1000), style = wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX |wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX) panel = wx.Panel(self, -1) MVW = 100 MTH = 0 lc = wx.ListCtrl(panel, -1, size=(1000 + MVW,900), pos=(30,20),style=wx.LC_REPORT) self.pageScroll = wx.ScrollBar(panel, -1, size = (300, 30), pos=(1060 + MVW, 20)) self.pageLabel = wx.StaticText(panel, -1, "PAGE=", size=(300,30), pos=(1060 + MVW,60)) self.sText = wx.TextCtrl(panel, -1, "", size=(600,400 + MTH), pos=(1060 + MVW, 100), style = wx.TE_MULTILINE) self.btnAnalysis = wx.Button(panel, -1, "PLOT", size=(120,40), pos = (1060+MVW, 520+MTH)) self.btnExportData = wx.Button(panel, -1, "EXPORT_FORM", size=(120,40), pos = (1200+MVW, 520+MTH)) self.btnApply = wx.Button(panel, -1, "ApplyPow", size=(120,40), pos=(1060+MVW+200, 580+MTH)) self.textPow = wx.TextCtrl(panel, -1, str(INIT_POW), size=(180, 40), pos=(1060+MVW, 580+MTH)) self.btnAnalysis.Bind(wx.EVT_BUTTON, self.OnAnalysisClick) self.btnExportData.Bind(wx.EVT_BUTTON, self.OnExportClick) self.btnApply.Bind(wx.EVT_BUTTON, self.OnApplyPowClick) self.pageScroll.SetScrollbar(0,100,1100,50) self.pageScroll.Bind(wx.EVT_SCROLL_CHANGED, self.OnScrollMove) tdx2.SetPath('Z:\\vipdoc', 'tdxpath') extendColumn('lastCL' ,lambda dline: dline[-1].cl) extendColumn('wattIndex' ,lambda dl: watterson_lib.wattIndex(dl)) extendColumn('lastTime' ,lambda dl: watterson_lib.get_last_dline_ftime(dl)) if TESTMODE: extendColumn('rd1' ,lambda dl: watterson_lib.delta_ratio(dl,-2,-1)) lc.InsertColumn(9999, "ID"); for i in varlist: lc.InsertColumn(9999, i); lc.SetColumnWidth(0, 140) lc.SetColumnWidth(lc.GetColumnCount()-2, 140) lc.SetColumnWidth(lc.GetColumnCount()-1, 140) lc.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick) lc.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.OnItemClick) self.lc = lc self.powConfig = INIT_POW self.isReverse = True self.LoadFile() self.ListControlRefresh() self.Center()
def __init__(self): wx.Frame.__init__(self, None, -1, 'Watterson the Manager', size=(1900, 1000), style=wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX) panel = wx.Panel(self, -1) MVW = 100 MTH = 0 lc = wx.ListCtrl(panel, -1, size=(1000 + MVW, 900), pos=(30, 20), style=wx.LC_REPORT) self.pageScroll = wx.ScrollBar(panel, -1, size=(300, 30), pos=(1060 + MVW, 20)) self.pageLabel = wx.StaticText(panel, -1, "PAGE=", size=(300, 30), pos=(1060 + MVW, 60)) self.sText = wx.TextCtrl(panel, -1, "", size=(600, 400 + MTH), pos=(1060 + MVW, 100), style=wx.TE_MULTILINE) self.btnAnalysis = wx.Button(panel, -1, "PLOT", size=(120, 40), pos=(1060 + MVW, 520 + MTH)) self.btnExportData = wx.Button(panel, -1, "EXPORT_FORM", size=(120, 40), pos=(1200 + MVW, 520 + MTH)) self.btnApply = wx.Button(panel, -1, "ApplyPow", size=(120, 40), pos=(1060 + MVW + 200, 580 + MTH)) self.textPow = wx.TextCtrl(panel, -1, str(INIT_POW), size=(180, 40), pos=(1060 + MVW, 580 + MTH)) self.btnAnalysis.Bind(wx.EVT_BUTTON, self.OnAnalysisClick) self.btnExportData.Bind(wx.EVT_BUTTON, self.OnExportClick) self.btnApply.Bind(wx.EVT_BUTTON, self.OnApplyPowClick) self.pageScroll.SetScrollbar(0, 100, 1100, 50) self.pageScroll.Bind(wx.EVT_SCROLL_CHANGED, self.OnScrollMove) tdx2.SetPath('Z:\\vipdoc', 'tdxpath') extendColumn('lastCL', lambda dline: dline[-1].cl) extendColumn('wattIndex', lambda dl: watterson_lib.wattIndex(dl)) extendColumn('lastTime', lambda dl: watterson_lib.get_last_dline_ftime(dl)) if TESTMODE: extendColumn('rd1', lambda dl: watterson_lib.delta_ratio(dl, -2, -1)) lc.InsertColumn(9999, "ID") for i in varlist: lc.InsertColumn(9999, i) lc.SetColumnWidth(0, 140) lc.SetColumnWidth(lc.GetColumnCount() - 2, 140) lc.SetColumnWidth(lc.GetColumnCount() - 1, 140) lc.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick) lc.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.OnItemClick) self.lc = lc self.powConfig = INIT_POW self.isReverse = True self.LoadFile() self.ListControlRefresh() self.Center()
outputfile = open(filename, 'rb') arr = pickle.load(outputfile) outputfile.close() return arr wordlist = [] INIT_POW = [100, 200, 300] MAX_LOAD_ITEM = 3000 FILTER1 = 1 # filename head excepting: sh0 sh1 sh2 sh5 sh8 FILTER2 = 1 # last date is max FILTER3 = 1 # dline[-1].op < 60 varlist = ['d5', 'd10', 'd15', 'd1', 'ma20'] varfunc = [ lambda dl: watterson_lib.delta_ratio(dl, -5), \ lambda dl: watterson_lib.delta_ratio(dl, -10), \ lambda dl: watterson_lib.delta_ratio(dl, -15), \ lambda dl: watterson_lib.delta_ratio(dl, -1), \ lambda dl: float('%.2f'%afunc.average(dl, 20))] varfunc_testMode = [ lambda dl: watterson_lib.delta_ratio(dl, -5, -3), \ lambda dl: watterson_lib.delta_ratio(dl, -10,-3), \ lambda dl: watterson_lib.delta_ratio(dl, -15,-3), \ lambda dl: watterson_lib.delta_ratio(dl, -1,-3), \ lambda dl: float('%.2f'%afunc.average(dl, 20))] TESTMODE = 1 if TESTMODE: varfunc = varfunc_testMode
def load_arr_from_file(filename): outputfile = open(filename, 'rb') arr = pickle.load(outputfile) outputfile.close() return arr wordlist = [] INIT_POW = [100,200,300] MAX_LOAD_ITEM = 3000 FILTER1 = 1 # filename head excepting: sh0 sh1 sh2 sh5 sh8 FILTER2 = 1 # last date is max FILTER3 = 1 # dline[-1].op < 60 varlist = ['d5', 'd10','d15', 'd1', 'ma20'] varfunc = [ lambda dl: watterson_lib.delta_ratio(dl, -5), \ lambda dl: watterson_lib.delta_ratio(dl, -10), \ lambda dl: watterson_lib.delta_ratio(dl, -15), \ lambda dl: watterson_lib.delta_ratio(dl, -1), \ lambda dl: float('%.2f'%afunc.average(dl, 20))] varfunc_testMode = [ lambda dl: watterson_lib.delta_ratio(dl, -5, -3), \ lambda dl: watterson_lib.delta_ratio(dl, -10,-3), \ lambda dl: watterson_lib.delta_ratio(dl, -15,-3), \ lambda dl: watterson_lib.delta_ratio(dl, -1,-3), \ lambda dl: float('%.2f'%afunc.average(dl, 20))] TESTMODE=1 if TESTMODE: varfunc = varfunc_testMode