BeremizIDE.py
changeset 1782 5b6ad7a7fd9d
parent 1781 b112bfdde5cc
child 1783 3311eea28d56
equal deleted inserted replaced
1781:b112bfdde5cc 1782:5b6ad7a7fd9d
   365         self.LogConsole.Bind(wx.stc.EVT_STC_MARGINCLICK, self.OnLogConsoleMarginClick)
   365         self.LogConsole.Bind(wx.stc.EVT_STC_MARGINCLICK, self.OnLogConsoleMarginClick)
   366         self.LogConsole.Bind(wx.stc.EVT_STC_MODIFIED, self.OnLogConsoleModified)
   366         self.LogConsole.Bind(wx.stc.EVT_STC_MODIFIED, self.OnLogConsoleModified)
   367 
   367 
   368         self.MainTabs["LogConsole"] = (self.LogConsole, _("Console"))
   368         self.MainTabs["LogConsole"] = (self.LogConsole, _("Console"))
   369         self.BottomNoteBook.AddPage(*self.MainTabs["LogConsole"])
   369         self.BottomNoteBook.AddPage(*self.MainTabs["LogConsole"])
   370         #self.BottomNoteBook.Split(self.BottomNoteBook.GetPageIndex(self.LogConsole), wx.RIGHT)
   370         # self.BottomNoteBook.Split(self.BottomNoteBook.GetPageIndex(self.LogConsole), wx.RIGHT)
   371 
   371 
   372         self.LogViewer = LogViewer(self.BottomNoteBook, self)
   372         self.LogViewer = LogViewer(self.BottomNoteBook, self)
   373         self.MainTabs["LogViewer"] = (self.LogViewer, _("PLC Log"))
   373         self.MainTabs["LogViewer"] = (self.LogViewer, _("PLC Log"))
   374         self.BottomNoteBook.AddPage(*self.MainTabs["LogViewer"])
   374         self.BottomNoteBook.AddPage(*self.MainTabs["LogViewer"])
   375         #self.BottomNoteBook.Split(self.BottomNoteBook.GetPageIndex(self.LogViewer), wx.RIGHT)
   375         # self.BottomNoteBook.Split(self.BottomNoteBook.GetPageIndex(self.LogViewer), wx.RIGHT)
   376 
   376 
   377         StatusToolBar = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,
   377         StatusToolBar = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,
   378                                    wx.TB_FLAT | wx.TB_NODIVIDER | wx.NO_BORDER)
   378                                    wx.TB_FLAT | wx.TB_NODIVIDER | wx.NO_BORDER)
   379         StatusToolBar.SetToolBitmapSize(wx.Size(25, 25))
   379         StatusToolBar.SetToolBitmapSize(wx.Size(25, 25))
   380         StatusToolBar.Realize()
   380         StatusToolBar.Realize()
  1074                 confnode.CTNRemove()
  1074                 confnode.CTNRemove()
  1075                 del confnode
  1075                 del confnode
  1076                 self._Refresh(TITLE, FILEMENU, PROJECTTREE)
  1076                 self._Refresh(TITLE, FILEMENU, PROJECTTREE)
  1077             dialog.Destroy()
  1077             dialog.Destroy()
  1078 
  1078 
  1079 #-------------------------------------------------------------------------------
  1079 # -------------------------------------------------------------------------------
  1080 #                        Highlights showing functions
  1080 #                        Highlights showing functions
  1081 #-------------------------------------------------------------------------------
  1081 # -------------------------------------------------------------------------------
  1082 
  1082 
  1083     def ShowHighlight(self, infos, start, end, highlight_type):
  1083     def ShowHighlight(self, infos, start, end, highlight_type):
  1084         config_name = self.Controler.GetProjectMainConfigurationName()
  1084         config_name = self.Controler.GetProjectMainConfigurationName()
  1085         if config_name is not None and infos[0] == self.Controler.ComputeConfigurationName(config_name):
  1085         if config_name is not None and infos[0] == self.Controler.ComputeConfigurationName(config_name):
  1086             self.CTR._OpenView()
  1086             self.CTR._OpenView()
  1090                 viewer.AddHighlight(infos[1:], start, end, highlight_type)
  1090                 viewer.AddHighlight(infos[1:], start, end, highlight_type)
  1091         else:
  1091         else:
  1092             IDEFrame.ShowHighlight(self, infos, start, end, highlight_type)
  1092             IDEFrame.ShowHighlight(self, infos, start, end, highlight_type)
  1093 
  1093 
  1094 
  1094 
  1095 #-------------------------------------------------------------------------------
  1095 # -------------------------------------------------------------------------------
  1096 #                               Exception Handler
  1096 #                               Exception Handler
  1097 #-------------------------------------------------------------------------------
  1097 # -------------------------------------------------------------------------------
  1098 import threading
  1098 import threading
  1099 import traceback
  1099 import traceback
  1100 
  1100 
  1101 Max_Traceback_List_Size = 20
  1101 Max_Traceback_List_Size = 20
  1102 
  1102 
  1196             ignored_exceptions.append(ex)
  1196             ignored_exceptions.append(ex)
  1197             date = time.ctime()
  1197             date = time.ctime()
  1198             bug_report_path = path + os.sep + "bug_report_" + time.strftime("%Y_%m_%d__%H-%M-%S") + ".txt"
  1198             bug_report_path = path + os.sep + "bug_report_" + time.strftime("%Y_%m_%d__%H-%M-%S") + ".txt"
  1199             save_bug_report(e_type, e_value, e_traceback, bug_report_path, date)
  1199             save_bug_report(e_type, e_value, e_traceback, bug_report_path, date)
  1200             Display_Exception_Dialog(e_type, e_value, e_traceback, bug_report_path)
  1200             Display_Exception_Dialog(e_type, e_value, e_traceback, bug_report_path)
  1201     #sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args)
  1201     # sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args)
  1202     sys.excepthook = handle_exception
  1202     sys.excepthook = handle_exception
  1203 
  1203 
  1204     init_old = threading.Thread.__init__
  1204     init_old = threading.Thread.__init__
  1205 
  1205 
  1206     def init(self, *args, **kwargs):
  1206     def init(self, *args, **kwargs):