diff -r c562031146e4 -r 4be515ac635e IDEFrame.py --- a/IDEFrame.py Sun Feb 17 23:47:41 2013 +0100 +++ b/IDEFrame.py Tue Feb 19 00:06:59 2013 +0100 @@ -6,6 +6,13 @@ import wx, wx.grid import wx.aui +try: + import matplotlib + matplotlib.use('WX') + USE_MPL = True +except: + USE_MPL = False + from editors.EditorPanel import EditorPanel from editors.SFCViewer import SFC_Viewer from editors.LDViewer import LD_Viewer @@ -2014,6 +2021,7 @@ def OpenDebugViewer(self, instance_category, instance_path, instance_type): openedidx = self.IsOpened(instance_path) + new_window = None if openedidx is not None: old_selected = self.TabsOpened.GetSelection() if old_selected != openedidx: @@ -2023,12 +2031,14 @@ elif instance_category in ITEMS_VARIABLE: if self.Controler.IsNumType(instance_type, True): - new_window = GraphicViewer(self.TabsOpened, self, self.Controler, instance_path) - icon = GetBitmap("GRAPH") + if USE_MPL: + self.AddDebugVariable(instance_path, True) + else: + new_window = GraphicViewer(self.TabsOpened, self, self.Controler, instance_path) + icon = GetBitmap("GRAPH") else: bodytype = self.Controler.GetEditedElementBodyType(instance_type, True) - new_window = None if bodytype == "FBD": new_window = Viewer(self.TabsOpened, instance_type, self, self.Controler, True, instance_path) new_window.RefreshScaling(False)