formatframe.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:GRIPy 作者: giruenf 项目源码 文件源码
def __init__(self, logplot, track_id=ID_ALL_TRACKS, logplotformat=None, ok_callback=None):

        self.logplot = logplot
        self.track_id = track_id

        self.welluid = self.logplot.get_well_uid()
        self._OM = ObjectManager(self)
        #well = self._OM.get(self.welluid)

        if logplotformat is None:
            logplotformat = LogPlotFormat()
        self.original_logplotformat = logplotformat
        self.edited_logplotformat = copy.deepcopy(self.original_logplotformat)


        wx.Frame.__init__(self, self.logplot, -1,
                                          title="Log Plot Format - TESTE",
                                          size=(850, 600),
                                          style=wx.DEFAULT_FRAME_STYLE & 
                                          (~wx.RESIZE_BORDER) &(~wx.MAXIMIZE_BOX))

        self.callback = ok_callback             
        sizer = wx.BoxSizer(wx.VERTICAL)                                  
        self.base = wx.Panel(self)
        note = wx.Notebook(self.base)
        bsizer = wx.BoxSizer(wx.HORIZONTAL)
        bsizer.Add(note, 1, wx.ALL|wx.EXPAND, border=5)        
        self.base.SetSizer(bsizer)

        self.tracks_model = None
        self.curves_model = CurvesModel(self.edited_logplotformat, self.track_id)

        if self.track_id == self.ID_ALL_TRACKS:
            self.tracks_model = TracksModel(self.edited_logplotformat)
            tn = TracksNotifier(self.edited_logplotformat, self.curves_model)
            self.tracks_model.AddNotifier(tn)
            tn.SetOwner(self.tracks_model)
            self.grid_panel = BasePanel(note, 'grid', self.welluid, self.track_id, self.tracks_model)                  
            note.AddPage(self.grid_panel, "Grid", True)
        else:
            self.grid_panel = None
        if self.tracks_model is not None:    
            cn = CurvesNotifier(self.edited_logplotformat, self.tracks_model)
            self.curves_model.AddNotifier(cn)
            cn.SetOwner(self.curves_model) 
        self.curves_panel = BasePanel(note, 'curves', self.welluid, self.track_id, self.curves_model)
        note.AddPage(self.curves_panel, "Curves", False)


        note.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self._OnNotePageChanging)
        sizer.Add(self.base, 1, wx.EXPAND)
        sizer.Add(self.getPanelBottomButtons(), 0, wx.EXPAND|wx.BOTTOM|wx.TOP)
        self.SetSizer(sizer)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号