# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Printrun is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Printrun. If not, see <http://www.gnu.org/licenses/>. import wx from math import log10, floor, ceil from printrun.utils import install_locale install_locale('pronterface') from .bufferedcanvas import BufferedCanvas class GraphWindow(wx.Frame): def __init__(self, root, parent_graph = None, size = (600, 600)): super(GraphWindow, self).__init__(None, title = _("Temperature graph"), size = size) panel = wx.Panel(self, -1) vbox = wx.BoxSizer(wx.VERTICAL) self.graph = Graph(panel, wx.ID_ANY, root, parent_graph = parent_graph) vbox.Add(self.graph, 1, wx.EXPAND) panel.SetSizer(vbox) class Graph(BufferedCanvas): '''A class to show a Graph with Pronterface.'''
# You should have received a copy of the GNU General Public License # along with Printrun. If not, see <http://www.gnu.org/licenses/>. import logging try: import wx if wx.VERSION < (4, ): raise ImportError() except: logging.error( _("WX >= 4 is not installed. This program requires WX >= 4 to run.")) raise from printrun.utils import install_locale install_locale('pronterface') from .controls import ControlsSizer, add_extra_controls #from .viz import VizPane from .log import LogPane from .toolbar import MainToolbar class ToggleablePane(wx.BoxSizer): def __init__(self, root, label, parentpanel, parentsizers): super(ToggleablePane, self).__init__(wx.HORIZONTAL) if not parentpanel: parentpanel = root.panel self.root = root self.visible = True self.parentpanel = parentpanel self.parentsizers = parentsizers
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Printrun. If not, see <http://www.gnu.org/licenses/>. import logging try: import wx except: logging.error(_("WX is not installed. This program requires WX to run.")) raise from printrun.utils import install_locale install_locale("pronterface") from .controls import ControlsSizer, add_extra_controls from .viz import VizPane from .log import LogPane from .toolbar import MainToolbar class ToggleablePane(wx.BoxSizer): def __init__(self, root, label, parentpanel, parentsizers): super(ToggleablePane, self).__init__(wx.HORIZONTAL) if not parentpanel: parentpanel = root.panel self.root = root self.visible = True self.parentpanel = parentpanel