Merge upstream, fixed conflicts, showing complete toolbar at bottom of preview
commit
e25d5cb300
|
@ -4,5 +4,4 @@ G1 Z+10 E-5 F400 ;move Z up a bit and retract filament by 5mm
|
|||
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
|
||||
M84 ;steppers off
|
||||
G90 ;absolute positioning
|
||||
M107 ;fan off
|
||||
|
||||
|
|
|
@ -46,9 +46,15 @@ __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agp
|
|||
def main():
|
||||
parser = OptionParser(usage="usage: %prog [options] <filename>.stl")
|
||||
parser.add_option("-p", "--profile", action="store", type="string", dest="profile", help="Use these profile settings instead of loading current_profile.ini")
|
||||
parser.add_option("-r", "--print", action="store", type="string", dest="printfile", help="Open the printing interface, instead of the normal cura interface.")
|
||||
(options, args) = parser.parse_args()
|
||||
if options.profile != None:
|
||||
profile.loadGlobalProfileFromString(options.profile)
|
||||
if options.printfile != None:
|
||||
from gui import printWindow
|
||||
printWindow.startPrintInterface(options.printfile)
|
||||
return
|
||||
|
||||
if len( args ) > 0:
|
||||
sliceRun.runSlice(args)
|
||||
else:
|
||||
|
|
|
@ -90,6 +90,9 @@ def calcLayerSkip(setting):
|
|||
return 0
|
||||
return int(math.ceil((bottomThickness - layerThickness) / layerThickness + 0.0001) - 1)
|
||||
|
||||
def calculateBridgeFlow(setting):
|
||||
return (profile.getProfileSettingFloat('bridge_speed') / 100) * (profile.getProfileSettingFloat('bridge_material_amount') / 100)
|
||||
|
||||
def getProfileInformation():
|
||||
return {
|
||||
'carve': {
|
||||
|
@ -179,7 +182,7 @@ def getProfileInformation():
|
|||
'Activate_Speed': "True",
|
||||
'Add_Flow_Rate': "True",
|
||||
'Bridge_Feed_Rate_Multiplier_ratio': storedPercentSetting('bridge_speed'),
|
||||
'Bridge_Flow_Rate_Multiplier_ratio': storedPercentSetting('bridge_material_amount'),
|
||||
'Bridge_Flow_Rate_Multiplier_ratio': calculateBridgeFlow,
|
||||
'Duty_Cyle_at_Beginning_portion': DEFSET,
|
||||
'Duty_Cyle_at_Ending_portion': DEFSET,
|
||||
'Feed_Rate_mm/s': storedSettingFloat("print_speed"),
|
||||
|
@ -295,7 +298,7 @@ def getProfileInformation():
|
|||
'Name_of_Cool_Start_File': DEFSET,
|
||||
'Orbital_Outset_millimeters': DEFSET,
|
||||
'Turn_Fan_On_at_Beginning': storedSetting("fan_enabled"),
|
||||
'Turn_Fan_Off_at_Ending': "False",
|
||||
'Turn_Fan_Off_at_Ending': storedSetting("fan_enabled"),
|
||||
'Minimum_feed_rate_mm/s': storedSettingFloat("cool_min_feedrate"),
|
||||
'Fan_on_at_layer': storedSettingInt('fan_layer'),
|
||||
'Fan_speed_%': storedSettingInt('fan_speed'),
|
||||
|
|
|
@ -238,6 +238,7 @@ class CombSkein:
|
|||
|
||||
def getAroundBetweenPath(self, begin, end):
|
||||
'Get the path around the loops in the way of the original line segment.'
|
||||
addedJumpLine = False
|
||||
aroundBetweenPath = []
|
||||
boundaries = self.getBoundaries()
|
||||
boundarySegments = self.getBoundarySegments(begin, boundaries, end)
|
||||
|
@ -245,6 +246,9 @@ class CombSkein:
|
|||
segment = boundarySegment.segment
|
||||
if boundarySegmentIndex < len(boundarySegments) - 1 and self.runningJumpSpace > 0.0:
|
||||
segment = boundarySegment.getSegment(boundarySegmentIndex, boundarySegments, self.edgeWidth, self.runningJumpSpace)
|
||||
if not addedJumpLine:
|
||||
self.distanceFeedRate.addLine("(<nextmovehasspacejump>)")
|
||||
addedJumpLine = True
|
||||
aroundBetweenPath += self.getAroundBetweenLineSegment(segment[0], boundaries, segment[1])
|
||||
if boundarySegmentIndex < len(boundarySegments) - 1:
|
||||
aroundBetweenPath.append(segment[1])
|
||||
|
|
|
@ -191,6 +191,7 @@ class DimensionSkein:
|
|||
self.totalExtrusionDistance = 0.0
|
||||
self.travelFeedRatePerSecond = None
|
||||
self.zDistanceRatio = 5.0
|
||||
self.addRetraction = False
|
||||
|
||||
def addLinearMoveExtrusionDistanceLine(self, extrusionDistance):
|
||||
'Get the extrusion distance string from the extrusion distance.'
|
||||
|
@ -379,11 +380,17 @@ class DimensionSkein:
|
|||
self.absoluteDistanceMode = True
|
||||
elif firstWord == 'G91':
|
||||
self.absoluteDistanceMode = False
|
||||
elif firstWord == '(<nextmovehasspacejump>)':
|
||||
#Check for the space jump moves for retraction, these tags are added by the comb plugin.
|
||||
self.addLinearMoveExtrusionDistanceLine(-self.repository.retractionDistance.value * self.retractionRatio)
|
||||
self.addRetraction = True
|
||||
elif firstWord == '(<layer>':
|
||||
self.layerIndex += 1
|
||||
settings.printProgress(self.layerIndex, 'dimension')
|
||||
elif firstWord == 'M101':
|
||||
self.addLinearMoveExtrusionDistanceLine(self.restartDistance * self.retractionRatio)
|
||||
if self.addRetraction:
|
||||
self.addLinearMoveExtrusionDistanceLine(self.restartDistance * self.retractionRatio)
|
||||
self.addRetraction = False
|
||||
if self.totalExtrusionDistance > self.repository.maximumEValueBeforeReset.value:
|
||||
if not self.repository.relativeExtrusionDistance.value:
|
||||
self.distanceFeedRate.addLine('G92 E0')
|
||||
|
@ -391,7 +398,6 @@ class DimensionSkein:
|
|||
self.isExtruderActive = True
|
||||
elif firstWord == 'M103':
|
||||
self.retractionRatio = self.getRetractionRatio(lineIndex)
|
||||
self.addLinearMoveExtrusionDistanceLine(-self.repository.retractionDistance.value * self.retractionRatio)
|
||||
self.isExtruderActive = False
|
||||
elif firstWord == 'M108':
|
||||
self.flowRate = float( splitLine[1][1 :] )
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#ifndef __CONFIGURATION_H
|
||||
#define __CONFIGURATION_H
|
||||
#define STRING_VERSION_CONFIG_H "Marlin-Mon, 5 Mar 2012 09:56:50 -0800 - f3095493b06d52a33ae77a0b8c1f92a22633261a"
|
||||
#define STRING_VERSION_CONFIG_H "Marlin-Thu, 12 Apr 2012 14:01:30 +0200 - 414408b2d0fed428b55445f48b01d00932a7a92c"
|
||||
#define STRING_CONFIG_H_AUTHOR "Build-Me-Marlin"
|
||||
#define BAUDRATE 250000
|
||||
#define __ARDUINO_NR__ 4
|
||||
#define EXTRUDERS 1
|
||||
#define MINIMUM_PLANNER_SPEED 2.0
|
||||
#define MINIMUM_PLANNER_SPEED 0.05
|
||||
#define MOTHERBOARD 7
|
||||
#define HEATER_0_USES_AD595
|
||||
#define HEATER_0_MINTEMP 5
|
||||
#define HEATER_0_MAXTEMP 275
|
||||
#define BED_CHECK_INTERVAL 5000
|
||||
#define TEMP_RESIDENCY_TIME 30
|
||||
#define TEMP_RESIDENCY_TIME 5
|
||||
#define TEMP_HYSTERESIS 3
|
||||
#define TEMP_SENSOR_AD595_OFFSET 0.000000
|
||||
#define TEMP_SENSOR_AD595_GAIN 1.000000
|
||||
|
@ -24,8 +24,8 @@
|
|||
#define PID_dT 0.128
|
||||
#define PID_PID
|
||||
#define DEFAULT_Kp 22.2
|
||||
#define DEFAULT_Ki (1.25*PID_dT)
|
||||
#define DEFAULT_Kd (99/PID_dT)
|
||||
#define DEFAULT_Ki 1.08
|
||||
#define DEFAULT_Kd 114
|
||||
#define PID_ADD_EXTRUSION_RATE
|
||||
#define DEFAULT_Kc (1)
|
||||
#define ENDSTOPPULLUPS
|
||||
|
@ -81,6 +81,14 @@ const bool Z_ENDSTOPS_INVERTING = true;
|
|||
#define DEFAULT_STEPPER_DEACTIVE_COMMAND "M84 X Y E"
|
||||
#define EEPROM_SETTINGS
|
||||
#define EEPROM_CHITCHAT
|
||||
#define SDSUPPORT
|
||||
#define SD_FINISHED_STEPPERRELEASE true
|
||||
#define SD_FINISHED_RELEASECOMMAND "M84 X Y E"
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#define ULTRA_LCD
|
||||
#define LCD_WIDTH 20
|
||||
#define LCD_HEIGHT 4
|
||||
#define PLA_PREHEAT_HOTEND_TEMP 180
|
||||
#define PLA_PREHEAT_HPB_TEMP 70
|
||||
#define PLA_PREHEAT_FAN_SPEED 255
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -97,6 +97,7 @@ class MachineSelectPage(InfoPage):
|
|||
profile.putPreference('machine_width', '205')
|
||||
profile.putPreference('machine_depth', '205')
|
||||
profile.putPreference('machine_height', '200')
|
||||
profile.putPreference('steps_per_e', '865.888')
|
||||
profile.putProfileSetting('nozzle_size', '0.4')
|
||||
profile.putProfileSetting('machine_center_x', '100')
|
||||
profile.putProfileSetting('machine_center_y', '100')
|
||||
|
|
|
@ -21,8 +21,6 @@ from util import version
|
|||
def main():
|
||||
app = wx.App(False)
|
||||
if profile.getPreference('wizardDone') == 'False':
|
||||
if os.name == 'darwin':
|
||||
wx.MessageBox('The MacOS version of Cura is experimental.\nThere are still UI/usability bugs. Check the issue list at:\nhttps://github.com/daid/Cura/issues\nfor details.\nPlease report any extra issue you find.', 'MacOS Warning', wx.OK | wx.ICON_INFORMATION)
|
||||
configWizard.configWizard()
|
||||
profile.putPreference("wizardDone", "True")
|
||||
if profile.getPreference('startMode') == 'Simple':
|
||||
|
@ -274,6 +272,7 @@ class mainWindow(configBase.configWindowBase):
|
|||
|
||||
def OnSlice(self, e):
|
||||
if self.filename == None:
|
||||
wx.MessageBox('You need to load a file before you can slice it.', 'Print error', wx.OK | wx.ICON_INFORMATION)
|
||||
return
|
||||
#Create a progress panel and add it to the window. The progress panel will start the Skein operation.
|
||||
spp = sliceProgessPanel.sliceProgessPanel(self, self, self.filename)
|
||||
|
@ -286,7 +285,7 @@ class mainWindow(configBase.configWindowBase):
|
|||
|
||||
def OnPrint(self, e):
|
||||
if self.filename == None:
|
||||
wx.MessageBox('You need to load a file before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION)
|
||||
wx.MessageBox('You need to load a file and slice it before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION)
|
||||
return
|
||||
if not os.path.exists(self.filename[: self.filename.rfind('.')] + "_export.gcode"):
|
||||
wx.MessageBox('You need to slice the file to GCode before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION)
|
||||
|
|
|
@ -32,7 +32,7 @@ def InitGL(window, view3D, zoom):
|
|||
glLoadIdentity()
|
||||
aspect = float(size.GetWidth()) / float(size.GetHeight())
|
||||
if view3D:
|
||||
gluPerspective(90.0, aspect, 1.0, 1000.0)
|
||||
gluPerspective(45.0, aspect, 1.0, 1000.0)
|
||||
else:
|
||||
glOrtho(-aspect, aspect, -1, 1, -1000.0, 1000.0)
|
||||
|
||||
|
|
|
@ -28,6 +28,10 @@ class preferencesDialog(configBase.configWindowBase):
|
|||
configBase.TitleRow(left, 'Filament settings')
|
||||
c = configBase.SettingRow(left, 'Filament density (kg/m3)', 'filament_density', '1300', 'Weight of the filament per m3. Around 1300 for PLA. And around 1040 for ABS. This value is used to estimate the weight if the filament used for the print.', type = 'preference')
|
||||
validators.validFloat(c, 500.0, 3000.0)
|
||||
c = configBase.SettingRow(left, 'Filament cost (price/kg)', 'filament_cost_kg', '0', 'Cost of your filament per kg, to estimate the cost of the final print.', type = 'preference')
|
||||
validators.validFloat(c, 0.0)
|
||||
c = configBase.SettingRow(left, 'Filament cost (price/m)', 'filament_cost_meter', '0', 'Cost of your filament per meter, to estimate the cost of the final print.', type = 'preference')
|
||||
validators.validFloat(c, 0.0)
|
||||
|
||||
configBase.TitleRow(left, 'Communication settings')
|
||||
c = configBase.SettingRow(left, 'Serial port', 'serial_port', ['AUTO'] + machineCom.serialList(), 'Serial port to use for communication with the printer', type = 'preference')
|
||||
|
@ -35,6 +39,7 @@ class preferencesDialog(configBase.configWindowBase):
|
|||
|
||||
configBase.TitleRow(left, 'Slicer settings')
|
||||
c = configBase.SettingRow(left, 'Slicer selection', 'slicer', ['Cura (Skeinforge based)', 'Slic3r'], 'Which slicer to use to slice objects. Usually the Cura engine produces the best results. But Slic3r is developing fast and is faster with slicing.', type = 'preference')
|
||||
c = configBase.SettingRow(left, 'Save profile on slice', 'save_profile', False, 'When slicing save the profile as [stl_file]_profile.ini next to the model.', type = 'preference')
|
||||
|
||||
self.MakeModal(True)
|
||||
main.Fit()
|
||||
|
|
|
@ -139,34 +139,38 @@ class previewPanel(wx.Panel):
|
|||
self.toolbar2.AddControl(self.swapYZ)
|
||||
self.Bind(wx.EVT_BUTTON, self.OnSwapYZClick, self.swapYZ)
|
||||
|
||||
#self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())
|
||||
#self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale'))
|
||||
#self.scale = wx.TextCtrl(self.toolbar2, -1, profile.getProfileSetting('model_scale'), size=(21*2,21))
|
||||
#self.toolbar2.AddControl(self.scale)
|
||||
#self.Bind(wx.EVT_TEXT, self.OnScale, self.scale)
|
||||
self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())
|
||||
self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale'))
|
||||
self.scale = wx.TextCtrl(self.toolbar2, -1, profile.getProfileSetting('model_scale'), size=(21*2,21))
|
||||
self.toolbar2.AddControl(self.scale)
|
||||
self.Bind(wx.EVT_TEXT, self.OnScale, self.scale)
|
||||
|
||||
#self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())
|
||||
#self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy'))
|
||||
#self.mulXsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))
|
||||
#self.toolbar2.AddControl(self.mulXsub)
|
||||
#self.Bind(wx.EVT_BUTTON, self.OnMulXSubClick, self.mulXsub)
|
||||
#self.mulXadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))
|
||||
#self.toolbar2.AddControl(self.mulXadd)
|
||||
#self.Bind(wx.EVT_BUTTON, self.OnMulXAddClick, self.mulXadd)
|
||||
self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())
|
||||
self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy'))
|
||||
self.mulXsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))
|
||||
self.toolbar2.AddControl(self.mulXsub)
|
||||
self.Bind(wx.EVT_BUTTON, self.OnMulXSubClick, self.mulXsub)
|
||||
self.mulXadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))
|
||||
self.toolbar2.AddControl(self.mulXadd)
|
||||
self.Bind(wx.EVT_BUTTON, self.OnMulXAddClick, self.mulXadd)
|
||||
|
||||
#self.mulYsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))
|
||||
#self.toolbar2.AddControl(self.mulYsub)
|
||||
#self.Bind(wx.EVT_BUTTON, self.OnMulYSubClick, self.mulYsub)
|
||||
#self.mulYadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))
|
||||
#self.toolbar2.AddControl(self.mulYadd)
|
||||
#self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd)
|
||||
self.mulYsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))
|
||||
self.toolbar2.AddControl(self.mulYsub)
|
||||
self.Bind(wx.EVT_BUTTON, self.OnMulYSubClick, self.mulYsub)
|
||||
self.mulYadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))
|
||||
self.toolbar2.AddControl(self.mulYadd)
|
||||
self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd)
|
||||
|
||||
#self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())
|
||||
#self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot'))
|
||||
#self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS)
|
||||
#self.rotate.SetRange(0, 360)
|
||||
#self.toolbar2.AddControl(self.rotate)
|
||||
#self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate)
|
||||
self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())
|
||||
self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot'))
|
||||
self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS)
|
||||
self.rotate.SetRange(0, 360)
|
||||
self.toolbar2.AddControl(self.rotate)
|
||||
self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate)
|
||||
|
||||
self.scaleMax = wx.Button(self.toolbar, -1, 'Max size', size=(21*3.5,21))
|
||||
self.toolbar.AddControl(self.scaleMax)
|
||||
self.Bind(wx.EVT_BUTTON, self.OnScaleMax, self.scaleMax)
|
||||
|
||||
self.toolbar2.Realize()
|
||||
self.updateToolbar()
|
||||
|
@ -256,6 +260,22 @@ class previewPanel(wx.Panel):
|
|||
profile.putProfileSetting('model_scale', self.scale.GetValue())
|
||||
self.updateModelTransform()
|
||||
|
||||
def OnScaleMax(self, e):
|
||||
if self.triangleMesh == None:
|
||||
return
|
||||
scale = float(self.scale.GetValue())
|
||||
vMin = self.triangleMesh.getMinimum() / scale
|
||||
vMax = self.triangleMesh.getMaximum() / scale
|
||||
scaleX1 = (self.machineSize.x - self.machineCenter.x) / ((vMax.x - vMin.x) / 2)
|
||||
scaleY1 = (self.machineSize.y - self.machineCenter.y) / ((vMax.y - vMin.y) / 2)
|
||||
scaleX2 = (self.machineCenter.x) / ((vMax.x - vMin.x) / 2)
|
||||
scaleY2 = (self.machineCenter.y) / ((vMax.y - vMin.y) / 2)
|
||||
scaleZ = self.machineSize.z / (vMax.z - vMin.z)
|
||||
scale = min(scaleX1, scaleY1, scaleX2, scaleY2, scaleZ)
|
||||
self.scale.SetValue(str(scale))
|
||||
profile.putProfileSetting('model_scale', self.scale.GetValue())
|
||||
self.updateModelTransform()
|
||||
|
||||
def OnRotate(self, e):
|
||||
profile.putProfileSetting('model_rotate_base', self.rotate.GetValue())
|
||||
self.updateModelTransform()
|
||||
|
@ -448,7 +468,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
|
|||
wx.EVT_MOUSEWHEEL(self, self.OnMouseWheel)
|
||||
self.yaw = 30
|
||||
self.pitch = 60
|
||||
self.zoom = 150
|
||||
self.zoom = 300
|
||||
self.offsetX = 0
|
||||
self.offsetY = 0
|
||||
self.view3D = True
|
||||
|
|
|
@ -1,22 +1,54 @@
|
|||
from __future__ import absolute_import
|
||||
import __init__
|
||||
|
||||
import wx, threading, re
|
||||
import wx, threading, re, subprocess, sys
|
||||
|
||||
from gui import machineCom
|
||||
from gui import icon
|
||||
from util import profile
|
||||
from util import gcodeInterpreter
|
||||
|
||||
printWindowHandle = None
|
||||
printWindowMonitorHandle = None
|
||||
|
||||
def printFile(filename):
|
||||
global printWindowHandle
|
||||
if printWindowHandle == None:
|
||||
printWindowHandle = printWindow()
|
||||
printWindowHandle.OnConnect(None)
|
||||
global printWindowMonitorHandle
|
||||
if printWindowMonitorHandle == None:
|
||||
printWindowMonitorHandle = printProcessMonitor()
|
||||
printWindowMonitorHandle.loadFile(filename)
|
||||
|
||||
|
||||
def startPrintInterface(filename):
|
||||
#startPrintInterface is called from the main script when we want the printer interface to run in a seperate process.
|
||||
# It needs to run in a seperate process, as any running python code blocks the GCode sender pyton code (http://wiki.python.org/moin/GlobalInterpreterLock).
|
||||
app = wx.App(False)
|
||||
printWindowHandle = printWindow()
|
||||
printWindowHandle.Show(True)
|
||||
printWindowHandle.Raise()
|
||||
printWindowHandle.OnConnect(None)
|
||||
printWindowHandle.LoadGCodeFile(filename)
|
||||
app.MainLoop()
|
||||
|
||||
class printProcessMonitor():
|
||||
def __init__(self):
|
||||
self.handle = None
|
||||
|
||||
def loadFile(self, filename):
|
||||
if self.handle == None:
|
||||
self.handle = subprocess.Popen([sys.executable, sys.argv[0], '-r', filename], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
self.thread = threading.Thread(target=self.Monitor)
|
||||
self.thread.start()
|
||||
else:
|
||||
self.handle.stdin.write(filename + '\n')
|
||||
|
||||
def Monitor(self):
|
||||
p = self.handle
|
||||
line = p.stdout.readline()
|
||||
while(len(line) > 0):
|
||||
print line.rstrip()
|
||||
line = p.stdout.readline()
|
||||
p.wait()
|
||||
self.handle = None
|
||||
self.thread = None
|
||||
|
||||
class printWindow(wx.Frame):
|
||||
"Main user interface window"
|
||||
|
@ -95,14 +127,22 @@ class printWindow(wx.Frame):
|
|||
status = ""
|
||||
if self.gcode != None:
|
||||
status += "Filament: %.2fm %.2fg\n" % (self.gcode.extrusionAmount / 1000, self.gcode.calculateWeight() * 1000)
|
||||
cost_kg = float(profile.getPreference('filament_cost_kg'))
|
||||
cost_meter = float(profile.getPreference('filament_cost_meter'))
|
||||
if cost_kg > 0.0 and cost_meter > 0.0:
|
||||
status += "Filament cost: %.2f / %.2f\n" % (self.gcode.calculateWeight() * cost_kg, self.gcode.extrusionAmount / 1000 * cost_meter)
|
||||
elif cost_kg > 0.0:
|
||||
status += "Filament cost: %.2f\n" % (self.gcode.calculateWeight() * cost_kg)
|
||||
elif cost_meter > 0.0:
|
||||
status += "Filament cost: %.2f\n" % (self.gcode.extrusionAmount / 1000 * cost_meter)
|
||||
status += "Print time: %02d:%02d\n" % (int(self.gcode.totalMoveTimeMinute / 60), int(self.gcode.totalMoveTimeMinute % 60))
|
||||
if self.printIdx == None:
|
||||
self.progress.SetValue(0)
|
||||
if self.gcodeList != None:
|
||||
status += 'Line: -/%d\n' % (len(self.gcodeList))
|
||||
else:
|
||||
self.progress.SetValue(self.printIdx)
|
||||
status += 'Line: %d/%d\n' % (self.printIdx, len(self.gcodeList))
|
||||
self.progress.SetValue(self.printIdx)
|
||||
if self.temp != None:
|
||||
status += 'Temp: %d\n' % (self.temp)
|
||||
self.statsText.SetLabel(status.strip())
|
||||
|
|
|
@ -164,6 +164,7 @@ class simpleModeWindow(configBase.configWindowBase):
|
|||
|
||||
def OnSlice(self, e):
|
||||
if self.filename == None:
|
||||
wx.MessageBox('You need to load a file before you can slice it.', 'Print error', wx.OK | wx.ICON_INFORMATION)
|
||||
return
|
||||
#save the current profile so we can put it back latter
|
||||
oldProfile = profile.getGlobalProfileString()
|
||||
|
@ -273,7 +274,13 @@ class simpleModeWindow(configBase.configWindowBase):
|
|||
profile.loadGlobalProfileFromString(oldProfile)
|
||||
|
||||
def OnPrint(self, e):
|
||||
printWindow.printWindow()
|
||||
if self.filename == None:
|
||||
wx.MessageBox('You need to load a file and slice it before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION)
|
||||
return
|
||||
if not os.path.exists(self.filename[: self.filename.rfind('.')] + "_export.gcode"):
|
||||
wx.MessageBox('You need to slice the file to GCode before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION)
|
||||
return
|
||||
printWindow.printFile(self.filename[: self.filename.rfind('.')] + "_export.gcode")
|
||||
|
||||
def OnNormalSwitch(self, e):
|
||||
from gui import mainWindow
|
||||
|
|
|
@ -8,6 +8,7 @@ import threading
|
|||
import subprocess
|
||||
import time
|
||||
|
||||
from util import profile
|
||||
from util import sliceRun
|
||||
|
||||
class sliceProgessPanel(wx.Panel):
|
||||
|
@ -58,6 +59,8 @@ class sliceProgessPanel(wx.Panel):
|
|||
self.prevStep = 'start'
|
||||
self.totalDoneFactor = 0.0
|
||||
self.startTime = time.time()
|
||||
if profile.getPreference('save_profile') == 'True':
|
||||
profile.saveGlobalProfile(self.filename[: self.filename.rfind('.')] + "_profile.ini")
|
||||
p = subprocess.Popen(sliceRun.getSliceCommand(self.filename), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
self.thread = WorkerThread(self, filename, p)
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ profileDefaultSettings = {
|
|||
'raft_margin': '5',
|
||||
'raft_base_material_amount': '100',
|
||||
'raft_interface_material_amount': '100',
|
||||
'bottom_thickness': '0.0',
|
||||
'bottom_thickness': '0.3',
|
||||
}
|
||||
preferencesDefaultSettings = {
|
||||
'wizardDone': 'False',
|
||||
|
@ -79,6 +79,9 @@ preferencesDefaultSettings = {
|
|||
'serial_port': 'AUTO',
|
||||
'serial_baud': '250000',
|
||||
'slicer': 'Cura (Skeinforge based)',
|
||||
'save_profile': 'False',
|
||||
'filament_cost_kg': '0',
|
||||
'filament_cost_meter': '0',
|
||||
}
|
||||
|
||||
def getDefaultProfilePath():
|
||||
|
@ -179,7 +182,7 @@ def putPreference(name, value):
|
|||
globalPreferenceParser.read(getPreferencePath())
|
||||
if not globalPreferenceParser.has_section('preference'):
|
||||
globalPreferenceParser.add_section('preference')
|
||||
globalPreferenceParser.set('preference', name, str(value).encode("utf-8"))
|
||||
globalPreferenceParser.set('preference', name, unicode(value).encode("utf-8"))
|
||||
globalPreferenceParser.write(open(getPreferencePath(), 'w'))
|
||||
|
||||
#########################################################
|
||||
|
|
|
@ -27,6 +27,7 @@ class Vector3():
|
|||
|
||||
def __div__(self, v):
|
||||
return Vector3( self.x / v, self.y / v, self.z / v )
|
||||
__truediv__ = __div__
|
||||
|
||||
def __neg__(self):
|
||||
return Vector3( - self.x, - self.y, - self.z )
|
||||
|
|
|
@ -166,6 +166,7 @@ if (( ${ARCHIVE_FOR_DISTRIBUTION} )); then
|
|||
|
||||
if [ ! -z `which wine` ]; then
|
||||
#if we have wine, try to run our nsis script.
|
||||
rm -rf scripts/win32/dist
|
||||
ln -sf `pwd`/${TARGET_DIR} scripts/win32/dist
|
||||
wine ~/.wine/drive_c/Program\ Files/NSIS/makensis.exe /DVERSION=${BUILD_NAME} scripts/win32/installer.nsi
|
||||
fi
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
!ifndef VERSION
|
||||
!define VERSION 'DEV'
|
||||
!endif
|
||||
!addplugindir "nsisPlugins"
|
||||
|
||||
; The name of the installer
|
||||
Name "Cura ${VERSION}"
|
||||
|
@ -97,6 +98,9 @@ Section "Cura Installer"
|
|||
ExecWait '"$INSTDIR\drivers\dpinst32.exe" /lm'
|
||||
${EndIf}
|
||||
|
||||
; Give all users write permissions in the install directory, so they can read/write profile and preferences files.
|
||||
AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "FullAccess"
|
||||
|
||||
SectionEnd
|
||||
|
||||
;--------------------------------
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue