Merge commit '6de282f4b7c2a8d17fe5371d54b6a7825f55a120'

This commit is contained in:
Lawrence Johnston 2012-03-12 19:42:37 -07:00
commit e8596a4b54
5 changed files with 17 additions and 7 deletions

View File

@ -1,7 +1,7 @@
from __future__ import absolute_import
import __init__
import wx, os, platform, types
import wx, os, sys, platform, types
from fabmetheus_utilities import settings
@ -18,7 +18,7 @@ class configWindowBase(wx.Frame):
super(configWindowBase, self).__init__(None, title=title)
self.settingControlList = []
#Create the popup window
self.popup = wx.PopupWindow(self, wx.BORDER_SIMPLE)
self.popup.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_INFOBK))
@ -27,7 +27,10 @@ class configWindowBase(wx.Frame):
self.popup.sizer = wx.BoxSizer()
self.popup.sizer.Add(self.popup.text, flag=wx.EXPAND|wx.ALL, border=1)
self.popup.SetSizer(self.popup.sizer)
self.popup.Bind(wx.EVT_MOTION, self.OnPopupHide)
self.popup.text.Bind(wx.EVT_MOTION, self.OnPopupHide)
def CreateConfigTab(self, nb, name):
leftConfigPanel, rightConfigPanel, configPanel = self.CreateConfigPanel(nb)
nb.AddPage(configPanel, name)
@ -48,7 +51,7 @@ class configWindowBase(wx.Frame):
leftConfigPanel.main = self
rightConfigPanel.main = self
return leftConfigPanel, rightConfigPanel, configPanel
def OnPopupDisplay(self, setting):
self.popup.setting = setting
self.UpdatePopup(setting)
@ -125,6 +128,12 @@ class SettingRow():
self.ctrl.Bind(wx.EVT_ENTER_WINDOW, lambda e: panel.main.OnPopupDisplay(self))
self.ctrl.Bind(wx.EVT_LEAVE_WINDOW, panel.main.OnPopupHide)
#MacOS X doesn't get EVT_ENTER/LEAVE_WINDOW for controls. So we use the motion event then. This results in slightly less good popups, but it works.
if sys.platform == 'darwin':
self.ctrl.Bind(wx.EVT_MOTION, lambda e: panel.main.OnPopupDisplay(self))
self.defaultBGColour = self.ctrl.GetBackgroundColour()
panel.main.settingControlList.append(self)
sizer.Add(self.label, (x,y), flag=wx.ALIGN_CENTER_VERTICAL)
@ -151,7 +160,7 @@ class SettingRow():
elif result == validators.WARNING:
self.ctrl.SetBackgroundColour('Yellow')
else:
self.ctrl.SetBackgroundColour(wx.NullColour)
self.ctrl.SetBackgroundColour(self.defaultBGColour)
self.ctrl.Refresh()
self.validationMsg = '\n'.join(msgs)

View File

@ -110,6 +110,7 @@ class mainWindow(configBase.configWindowBase):
configBase.TitleRow(right, "Filament")
c = configBase.SettingRow(right, "Diameter (mm)", 'filament_diameter', '2.89', 'Diameter of your filament, as accurately as possible.\nIf you cannot measure this value you will have to callibrate it, a higher number means less extrusion, a smaller number generates more extrusion.')
validators.validFloat(c, 1.0)
validators.warningAbove(c, 3.5, "Are you sure your filament is that thick? Normal filament is around 3mm or 1.75mm.")
c = configBase.SettingRow(right, "Packing Density", 'filament_density', '1.00', 'Packing density of your filament. This should be 1.00 for PLA and 0.85 for ABS')
validators.validFloat(c, 0.5, 1.5)
@ -239,6 +240,7 @@ class mainWindow(configBase.configWindowBase):
def OnFirstRunWizard(self, e):
configWizard.configWizard()
self.updateProfileToControls()
def OnLoadSTL(self, e):
dlg=wx.FileDialog(self, "Open file to print", self.lastPath, style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)

View File

@ -113,6 +113,7 @@ class previewPanel(wx.Panel):
triangleMesh.origonalVertexes = list(triangleMesh.vertexes)
for i in xrange(0, len(triangleMesh.origonalVertexes)):
triangleMesh.origonalVertexes[i] = triangleMesh.origonalVertexes[i].copy()
triangleMesh.getMinimumZ()
self.triangleMesh = triangleMesh
self.gcode = None
self.updateModelTransform()

View File

@ -9,7 +9,6 @@ G28 Z0 ;move Z to min endstops
; height of the nozzle in mm. This can take some messing around
; with to get just right...
G92 X0 Y0 Z0 E0 ;reset software position to front/left/z=0.0
G21
G1 Z15.0 F400 ;move the platform down 15mm
G92 E0 ;zero the extruded length

View File

@ -134,7 +134,6 @@ class JorisSkein:
if len(splitLine) < 1:
return
firstWord = splitLine[0]
print 'joris:' + firstWord
if firstWord == 'G1':
self.feedRateMinute = gcodec.getFeedRateMinute(self.feedRateMinute, splitLine)
location = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine)