示例#1
0
    def OnInit(self):
        if not globalvar.CheckWxVersion([2, 9]):
            wx.InitAllImageHandlers()
        if __name__ == "__main__":
            self.cmdTimeStamp = os.path.getmtime(monFile['cmd'])
            self.Map = Map(cmdfile=monFile['cmd'],
                           mapfile=monFile['map'],
                           envfile=monFile['env'],
                           monitor=monName)
        else:
            self.Map = None

        self.mapFrm = MapFrame(parent=None,
                               id=wx.ID_ANY,
                               Map=self.Map,
                               size=monSize)
        # self.SetTopWindow(Map)
        self.mapFrm.Show()

        if __name__ == "__main__":
            self.timer = wx.PyTimer(self.watcher)
            #check each 0.5s
            global mtime
            mtime = 500
            self.timer.Start(mtime)

        return True
示例#2
0
 def testMapDisplay(self, giface, map_):
     from mapdisp.frame import MapFrame
     # known issues (should be similar with d.mon):
     # * opening map in digitizer ends with: vdigit/toolbars.py:723: 'selection' referenced before assignment
     # * nviz start fails (closes window? segfaults?) after mapdisp/frame.py:306: 'NoneType' object has no attribute 'GetLayerNotebook'
     frame = MapFrame(parent=None, title=_("Map display test"),
                      giface=giface, Map=map_)
     # this is questionable: how complete the giface when creating objects
     # which are in giface
     giface.mapWindow = frame.GetMapWindow()
     frame.GetMapWindow().ZoomToMap()
     frame.Show()