Beispiel #1
0
import wx

from . import gcoder
from .gl.panel import wxGLPanel
from .gl.trackball import build_rotmatrix
from .gl.libtatlin import actors
from .gl.libtatlin.actors import vec

from pyglet.gl import glPushMatrix, glPopMatrix, \
    glTranslatef, glRotatef, glScalef, glMultMatrixd
from pyglet.gl import *

from .gviz import GvizBaseFrame

from printrun_utils import imagefile, install_locale
install_locale('pronterface')

def create_model(light):
    if light:
        return actors.GcodeModelLight()
    else:
        return actors.GcodeModel()

class GcodeViewPanel(wxGLPanel):

    def __init__(self, parent, id = wx.ID_ANY,
                 build_dimensions = None, realparent = None):
        super(GcodeViewPanel, self).__init__(parent, id, wx.DefaultPosition,
                                             wx.DefaultSize, 0)
        self.canvas.Bind(wx.EVT_MOUSE_EVENTS, self.move)
        self.canvas.Bind(wx.EVT_LEFT_DCLICK, self.double)
Beispiel #2
0
# 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/>.

from Queue import Queue
from collections import deque
import wx
import time
from printrun import gcoder

from printrun_utils import imagefile, install_locale, get_home_pos
install_locale('pronterface')


class GvizBaseFrame(wx.Frame):
    def create_base_ui(self):
        self.CreateStatusBar(1)
        self.SetStatusText(
            _("Layer number and Z position show here when you scroll"))

        hpanel = wx.Panel(self, -1)
        hbox = wx.BoxSizer(wx.HORIZONTAL)

        panel = wx.Panel(hpanel, -1)
        vbox = wx.BoxSizer(wx.VERTICAL)

        vbox = wx.BoxSizer(wx.VERTICAL)
Beispiel #3
0
import wx

from . import gcoder
from .gl.panel import wxGLPanel
from .gl.trackball import build_rotmatrix
from .gl.libtatlin import actors
from .gl.libtatlin.actors import vec

from pyglet.gl import glPushMatrix, glPopMatrix, glTranslatef, glRotatef, glScalef, glMultMatrixd
from pyglet.gl import *

from .gviz import GvizBaseFrame

from printrun_utils import imagefile, install_locale

install_locale("pronterface")


def create_model(light):
    if light:
        return actors.GcodeModelLight()
    else:
        return actors.GcodeModel()


class GcodeViewPanel(wxGLPanel):
    def __init__(self, parent, id=wx.ID_ANY, build_dimensions=None, realparent=None):
        super(GcodeViewPanel, self).__init__(parent, id, wx.DefaultPosition, wx.DefaultSize, 0)
        self.canvas.Bind(wx.EVT_MOUSE_EVENTS, self.move)
        self.canvas.Bind(wx.EVT_LEFT_DCLICK, self.double)
        self.canvas.Bind(wx.EVT_KEY_DOWN, self.keypress)