|
@@ -21,7 +21,7 @@ import six
|
|
|
|
|
|
import wx
|
|
import wx
|
|
|
|
|
|
-import gui_core.wxlibplot as plot
|
|
|
|
|
|
+import wx.lib.plot as plot
|
|
from core.globalvar import ICONDIR
|
|
from core.globalvar import ICONDIR
|
|
from core.settings import UserSettings
|
|
from core.settings import UserSettings
|
|
from wxplot.dialogs import TextDialog, OptDialog
|
|
from wxplot.dialogs import TextDialog, OptDialog
|
|
@@ -105,7 +105,7 @@ class BasePlotFrame(wx.Frame):
|
|
self.client = plot.PlotCanvas(self)
|
|
self.client = plot.PlotCanvas(self)
|
|
|
|
|
|
# define the function for drawing pointLabels
|
|
# define the function for drawing pointLabels
|
|
- self.client.SetPointLabelFunc(self.DrawPointLabel)
|
|
|
|
|
|
+ self.client.pointLabelFunc = self.DrawPointLabel
|
|
|
|
|
|
# Create mouse event for showing cursor coords in status bar
|
|
# Create mouse event for showing cursor coords in status bar
|
|
self.client.canvas.Bind(wx.EVT_LEFT_DOWN, self.OnMouseLeftDown)
|
|
self.client.canvas.Bind(wx.EVT_LEFT_DOWN, self.OnMouseLeftDown)
|
|
@@ -187,19 +187,19 @@ class BasePlotFrame(wx.Frame):
|
|
self.zoom = False # zooming disabled
|
|
self.zoom = False # zooming disabled
|
|
self.drag = False # draging disabled
|
|
self.drag = False # draging disabled
|
|
# vertical and horizontal scrollbars
|
|
# vertical and horizontal scrollbars
|
|
- self.client.SetShowScrollbars(True)
|
|
|
|
|
|
+ self.client.showScrollbars = True
|
|
|
|
|
|
# x and y axis set to normal (non-log)
|
|
# x and y axis set to normal (non-log)
|
|
- self.client.setLogScale((False, False))
|
|
|
|
|
|
+ self.client.logScale = (False, False)
|
|
if self.properties['x-axis']['prop']['type']:
|
|
if self.properties['x-axis']['prop']['type']:
|
|
- self.client.SetXSpec(self.properties['x-axis']['prop']['type'])
|
|
|
|
|
|
+ self.client.xSpec = self.properties['x-axis']['prop']['type']
|
|
else:
|
|
else:
|
|
- self.client.SetXSpec('auto')
|
|
|
|
|
|
+ self.client.xSpec = 'auto'
|
|
|
|
|
|
if self.properties['y-axis']['prop']['type']:
|
|
if self.properties['y-axis']['prop']['type']:
|
|
- self.client.SetYSpec(self.properties['y-axis']['prop']['type'])
|
|
|
|
|
|
+ self.client.ySpec = self.properties['y-axis']['prop']['type']
|
|
else:
|
|
else:
|
|
- self.client.SetYSpec('auto')
|
|
|
|
|
|
+ self.client.ySpec = 'auto'
|
|
|
|
|
|
def InitRasterOpts(self, rasterList, plottype):
|
|
def InitRasterOpts(self, rasterList, plottype):
|
|
"""Initialize or update raster dictionary for plotting
|
|
"""Initialize or update raster dictionary for plotting
|
|
@@ -337,26 +337,24 @@ class BasePlotFrame(wx.Frame):
|
|
"""Set plot and text options
|
|
"""Set plot and text options
|
|
"""
|
|
"""
|
|
self.client.SetFont(self.properties['font']['wxfont'])
|
|
self.client.SetFont(self.properties['font']['wxfont'])
|
|
- self.client.SetFontSizeTitle(
|
|
|
|
- self.properties['font']['prop']['titleSize'])
|
|
|
|
- self.client.SetFontSizeAxis(
|
|
|
|
- self.properties['font']['prop']['axisSize'])
|
|
|
|
|
|
+ self.client.fontSizeTitle = self.properties['font']['prop']['titleSize']
|
|
|
|
+ self.client.fontSizeAxis = self.properties['font']['prop']['axisSize']
|
|
|
|
|
|
- self.client.SetEnableZoom(self.zoom)
|
|
|
|
- self.client.SetEnableDrag(self.drag)
|
|
|
|
|
|
+ self.client.enableZoom = self.zoom
|
|
|
|
+ self.client.enableDrag = self.drag
|
|
|
|
|
|
#
|
|
#
|
|
# axis settings
|
|
# axis settings
|
|
#
|
|
#
|
|
if self.properties['x-axis']['prop']['type'] == 'custom':
|
|
if self.properties['x-axis']['prop']['type'] == 'custom':
|
|
- self.client.SetXSpec('min')
|
|
|
|
|
|
+ self.client.xSpec = 'min'
|
|
else:
|
|
else:
|
|
- self.client.SetXSpec(self.properties['x-axis']['prop']['type'])
|
|
|
|
|
|
+ self.client.xSpec = self.properties['x-axis']['prop']['type']
|
|
|
|
|
|
if self.properties['y-axis']['prop']['type'] == 'custom':
|
|
if self.properties['y-axis']['prop']['type'] == 'custom':
|
|
- self.client.SetYSpec('min')
|
|
|
|
|
|
+ self.client.ySpec = 'min'
|
|
else:
|
|
else:
|
|
- self.client.SetYSpec(self.properties['y-axis']['prop'])
|
|
|
|
|
|
+ self.client.ySpec = self.properties['y-axis']['prop']['type']
|
|
|
|
|
|
if self.properties['x-axis']['prop']['type'] == 'custom' and self.properties[
|
|
if self.properties['x-axis']['prop']['type'] == 'custom' and self.properties[
|
|
'x-axis']['prop']['min'] < self.properties['x-axis']['prop']['max']:
|
|
'x-axis']['prop']['min'] < self.properties['x-axis']['prop']['max']:
|
|
@@ -376,32 +374,28 @@ class BasePlotFrame(wx.Frame):
|
|
|
|
|
|
if self.properties['x-axis']['prop']['log'] == True:
|
|
if self.properties['x-axis']['prop']['log'] == True:
|
|
self.properties['x-axis']['axis'] = None
|
|
self.properties['x-axis']['axis'] = None
|
|
- self.client.SetXSpec('min')
|
|
|
|
|
|
+ self.client.xSpec = 'min'
|
|
if self.properties['y-axis']['prop']['log'] == True:
|
|
if self.properties['y-axis']['prop']['log'] == True:
|
|
self.properties['y-axis']['axis'] = None
|
|
self.properties['y-axis']['axis'] = None
|
|
- self.client.SetYSpec('min')
|
|
|
|
|
|
+ self.client.ySpec = 'min'
|
|
|
|
|
|
- self.client.setLogScale((self.properties['x-axis']['prop']['log'],
|
|
|
|
- self.properties['y-axis']['prop']['log']))
|
|
|
|
|
|
+ self.client.logScale = (self.properties['x-axis']['prop']['log'],
|
|
|
|
+ self.properties['y-axis']['prop']['log'])
|
|
|
|
|
|
#
|
|
#
|
|
# grid settings
|
|
# grid settings
|
|
#
|
|
#
|
|
- self.client.SetEnableGrid(self.properties['grid']['enabled'])
|
|
|
|
-
|
|
|
|
- self.client.SetGridColour(
|
|
|
|
- wx.Colour(
|
|
|
|
- self.properties['grid']['color'][0],
|
|
|
|
- self.properties['grid']['color'][1],
|
|
|
|
- self.properties['grid']['color'][2],
|
|
|
|
- 255))
|
|
|
|
|
|
+ self.client.enableGrid = self.properties['grid']['enabled']
|
|
|
|
+ gridpen = wx.Pen(colour=wx.Colour(self.properties['grid']['color'][0],
|
|
|
|
+ self.properties['grid']['color'][1],
|
|
|
|
+ self.properties['grid']['color'][2], 255))
|
|
|
|
+ self.client.gridPen = gridpen
|
|
|
|
|
|
#
|
|
#
|
|
# legend settings
|
|
# legend settings
|
|
#
|
|
#
|
|
- self.client.SetFontSizeLegend(
|
|
|
|
- self.properties['font']['prop']['legendSize'])
|
|
|
|
- self.client.SetEnableLegend(self.properties['legend']['enabled'])
|
|
|
|
|
|
+ self.client.fontSizeLegend = self.properties['font']['prop']['legendSize']
|
|
|
|
+ self.client.enableLegend = self.properties['legend']['enabled']
|
|
|
|
|
|
def DrawPlot(self, plotlist):
|
|
def DrawPlot(self, plotlist):
|
|
"""Draw line and point plot from list plot elements.
|
|
"""Draw line and point plot from list plot elements.
|
|
@@ -413,14 +407,14 @@ class BasePlotFrame(wx.Frame):
|
|
ylabel)
|
|
ylabel)
|
|
|
|
|
|
if self.properties['x-axis']['prop']['type'] == 'custom':
|
|
if self.properties['x-axis']['prop']['type'] == 'custom':
|
|
- self.client.SetXSpec('min')
|
|
|
|
|
|
+ self.client.xSpec = 'min'
|
|
else:
|
|
else:
|
|
- self.client.SetXSpec(self.properties['x-axis']['prop']['type'])
|
|
|
|
|
|
+ self.client.xSpec = self.properties['x-axis']['prop']['type']
|
|
|
|
|
|
if self.properties['y-axis']['prop']['type'] == 'custom':
|
|
if self.properties['y-axis']['prop']['type'] == 'custom':
|
|
- self.client.SetYSpec('min')
|
|
|
|
|
|
+ self.client.ySpec = 'min'
|
|
else:
|
|
else:
|
|
- self.client.SetYSpec(self.properties['y-axis']['prop']['type'])
|
|
|
|
|
|
+ self.client.ySpec = self.properties['y-axis']['prop']['type']
|
|
|
|
|
|
self.client.Draw(self.plot, self.properties['x-axis']['axis'],
|
|
self.client.Draw(self.plot, self.properties['x-axis']['axis'],
|
|
self.properties['y-axis']['axis'])
|
|
self.properties['y-axis']['axis'])
|
|
@@ -454,16 +448,16 @@ class BasePlotFrame(wx.Frame):
|
|
"""
|
|
"""
|
|
self.zoom = True
|
|
self.zoom = True
|
|
self.drag = False
|
|
self.drag = False
|
|
- self.client.SetEnableZoom(self.zoom)
|
|
|
|
- self.client.SetEnableDrag(self.drag)
|
|
|
|
|
|
+ self.client.enableZoom = self.zoom
|
|
|
|
+ self.client.enableDrag = self.drag
|
|
|
|
|
|
def OnDrag(self, event):
|
|
def OnDrag(self, event):
|
|
"""Enable dragging and disable zooming
|
|
"""Enable dragging and disable zooming
|
|
"""
|
|
"""
|
|
self.zoom = False
|
|
self.zoom = False
|
|
self.drag = True
|
|
self.drag = True
|
|
- self.client.SetEnableDrag(self.drag)
|
|
|
|
- self.client.SetEnableZoom(self.zoom)
|
|
|
|
|
|
+ self.client.enableDrag = self.drag
|
|
|
|
+ self.client.enableZoom = self.zoom
|
|
|
|
|
|
def OnRedraw(self, event):
|
|
def OnRedraw(self, event):
|
|
"""Redraw the plot window. Unzoom to original size
|
|
"""Redraw the plot window. Unzoom to original size
|
|
@@ -490,7 +484,7 @@ class BasePlotFrame(wx.Frame):
|
|
def OnMotion(self, event):
|
|
def OnMotion(self, event):
|
|
"""Indicate when mouse is outside the plot area
|
|
"""Indicate when mouse is outside the plot area
|
|
"""
|
|
"""
|
|
- if self.client.GetEnablePointLabel() is True:
|
|
|
|
|
|
+ if self.client.enablePointLabel:
|
|
# make up dict with info for the pointLabel
|
|
# make up dict with info for the pointLabel
|
|
# I've decided to mark the closest point on the closest curve
|
|
# I've decided to mark the closest point on the closest curve
|
|
dlst = self.client.GetClosestPoint(
|
|
dlst = self.client.GetClosestPoint(
|
|
@@ -560,7 +554,7 @@ class BasePlotFrame(wx.Frame):
|
|
self.ylabel = dlg.ylabel
|
|
self.ylabel = dlg.ylabel
|
|
|
|
|
|
if self.plot:
|
|
if self.plot:
|
|
- self.plot.setTitle(dlg.ptitle)
|
|
|
|
|
|
+ self.plot.title = dlg.ptitle
|
|
|
|
|
|
self.OnRedraw(event=None)
|
|
self.OnRedraw(event=None)
|
|
|
|
|
|
@@ -568,14 +562,12 @@ class BasePlotFrame(wx.Frame):
|
|
x, y = self._getPlotLabels()
|
|
x, y = self._getPlotLabels()
|
|
|
|
|
|
self.client.SetFont(self.properties['font']['wxfont'])
|
|
self.client.SetFont(self.properties['font']['wxfont'])
|
|
- self.client.SetFontSizeTitle(
|
|
|
|
- self.properties['font']['prop']['titleSize'])
|
|
|
|
- self.client.SetFontSizeAxis(
|
|
|
|
- self.properties['font']['prop']['axisSize'])
|
|
|
|
|
|
+ self.client.fontSizeTitle = self.properties['font']['prop']['titleSize']
|
|
|
|
+ self.client.fontSizeAxis = self.properties['font']['prop']['axisSize']
|
|
|
|
|
|
if self.plot:
|
|
if self.plot:
|
|
- self.plot.setXLabel(x)
|
|
|
|
- self.plot.setYLabel(y)
|
|
|
|
|
|
+ self.plot.xLabel = x
|
|
|
|
+ self.plot.yLabel = y
|
|
|
|
|
|
def PlotText(self, event):
|
|
def PlotText(self, event):
|
|
"""Set custom text values for profile title and axis labels.
|
|
"""Set custom text values for profile title and axis labels.
|