Merge branch 'master' of github.com:daid/Cura

master
daid 2012-07-02 10:11:52 +02:00
commit 402c2223ca
15 changed files with 11661 additions and 5558 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,118 @@
#ifndef __CONFIGURATION_H
#define __CONFIGURATION_H
#define STRING_VERSION_CONFIG_H "Marlin-Mon, 11 Jun 2012 17:33:42 +0200 - b67dacdc8f1bd489e058e16d92ba29c364b2a8e5"
#define STRING_CONFIG_H_AUTHOR "Build-Me-Marlin"
#define BAUDRATE 115200
#define __ARDUINO_NR__ 4
#define EXTRUDERS 1
#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 5
#define TEMP_HYSTERESIS 3
#define TEMP_WINDOW 1
#define TEMP_SENSOR_AD595_OFFSET 0.000000
#define TEMP_SENSOR_AD595_GAIN 1.000000
#define CooldownNoWait true
#define HEATING_EARLY_FINISH_DEG_OFFSET 1
#define PIDTEMP
#define PID_MAX 255
#define PID_INTEGRAL_DRIVE_MAX 255
#define K1 0.95
#define PID_dT 0.128
#define PID_PID
#define DEFAULT_Kp 22.2
#define DEFAULT_Ki 1.08
#define DEFAULT_Kd 114
#define PID_ADD_EXTRUSION_RATE
#define DEFAULT_Kc (1)
#define ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN
const bool X_ENDSTOPS_INVERTING = true;
const bool Y_ENDSTOPS_INVERTING = true;
const bool Z_ENDSTOPS_INVERTING = true;
#define X_ENABLE_ON 0
#define Y_ENABLE_ON 0
#define Z_ENABLE_ON 0
#define E_ENABLE_ON 0
#define DISABLE_X false
#define DISABLE_Y false
#define DISABLE_Z false
#define DISABLE_E false
#define INVERT_X_DIR true
#define INVERT_Y_DIR false
#define INVERT_Z_DIR true
#define INVERT_E0_DIR false
#define INVERT_E1_DIR false
#define INVERT_E2_DIR false
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1
#define min_software_endstops false
#define max_software_endstops false
#define X_MAX_LENGTH 205
#define Y_MAX_LENGTH 205
#define Z_MAX_LENGTH 200
#define X_HOME_POS 0
#define Y_HOME_POS 0
#define Z_HOME_POS 0
#define NUM_AXIS 4
#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}
#define X_HOME_RETRACT_MM 5
#define Y_HOME_RETRACT_MM 5
#define Z_HOME_RETRACT_MM 1
#define QUICK_HOME
#define AXIS_RELATIVE_MODES {false, false, false, false}
#define MAX_STEP_FREQUENCY 40000
#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,533.333333333,865.888}
#define DEFAULT_MAX_FEEDRATE {250, 250, 5, 45}
#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000}
#define DEFAULT_ACCELERATION 3000
#define DEFAULT_RETRACT_ACCELERATION 3000
#define DEFAULT_MINIMUMFEEDRATE 0.0
#define DEFAULT_MINTRAVELFEEDRATE 0.0
#define DEFAULT_MINSEGMENTTIME 20000
#define DEFAULT_XYJERK 20.0
#define DEFAULT_ZJERK 0.4
#define DEFAULT_EJERK 5.0
#define SLOWDOWN
#define DEFAULT_STEPPER_DEACTIVE_TIME 60
#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 ULTIMAKERCONTROLLER
#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
#define ABS_PREHEAT_HOTEND_TEMP 240
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 255
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25
#define PREVENT_DANGEROUS_EXTRUDE
#define PREVENT_LENGTHY_EXTRUDE
#define EXTRUDE_MINTEMP 170
#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH)
const int dropsegments=5;
#define FAST_PWM_FAN
#define BLOCK_BUFFER_SIZE 16
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
#include "thermistortables.h"
#endif //__CONFIGURATION_H

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#ifndef __CONFIGURATION_H
#define __CONFIGURATION_H
#define STRING_VERSION_CONFIG_H "Marlin-Thu, 12 Apr 2012 14:01:30 +0200 - 414408b2d0fed428b55445f48b01d00932a7a92c"
#define STRING_VERSION_CONFIG_H "Marlin-Mon, 11 Jun 2012 17:33:42 +0200 - b67dacdc8f1bd489e058e16d92ba29c364b2a8e5"
#define STRING_CONFIG_H_AUTHOR "Build-Me-Marlin"
#define BAUDRATE 250000
#define __ARDUINO_NR__ 4
@ -13,6 +13,7 @@
#define BED_CHECK_INTERVAL 5000
#define TEMP_RESIDENCY_TIME 5
#define TEMP_HYSTERESIS 3
#define TEMP_WINDOW 1
#define TEMP_SENSOR_AD595_OFFSET 0.000000
#define TEMP_SENSOR_AD595_GAIN 1.000000
#define CooldownNoWait true
@ -29,6 +30,12 @@
#define PID_ADD_EXTRUSION_RATE
#define DEFAULT_Kc (1)
#define ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN
const bool X_ENDSTOPS_INVERTING = true;
const bool Y_ENDSTOPS_INVERTING = true;
const bool Z_ENDSTOPS_INVERTING = true;
@ -86,6 +93,7 @@ const bool Z_ENDSTOPS_INVERTING = true;
#define SD_FINISHED_RELEASECOMMAND "M84 X Y E"
#define ULTIPANEL
#define NEWPANEL
#define ULTIMAKERCONTROLLER
#define ULTRA_LCD
#define LCD_WIDTH 20
#define LCD_HEIGHT 4
@ -98,9 +106,11 @@ const bool Z_ENDSTOPS_INVERTING = true;
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25
#define PREVENT_DANGEROUS_EXTRUDE
#define PREVENT_LENGTHY_EXTRUDE
#define EXTRUDE_MINTEMP 170
#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH)
const int dropsegments=5;
#define FAST_PWM_FAN
#define BLOCK_BUFFER_SIZE 16
#define MAX_CMD_SIZE 96
#define BUFSIZE 4

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
from __future__ import absolute_import
import __init__
import wx, os, platform, types, webbrowser, math, subprocess, multiprocessing, threading, time, re
import wx, os, platform, types, webbrowser, math, subprocess, multiprocessing, threading, time, re, shutil
from util import profile
from util import sliceRun
@ -113,7 +113,7 @@ class BatchSliceProgressWindow(wx.Frame):
self.progressGauge = []
self.statusText = []
for i in xrange(0, self.threadCount):
self.statusText.append(wx.StaticText(self, -1, "Building: %d XXXXXXXXXXXXXXXXXXXXX" % (len(self.sliceCmdList))))
self.statusText.append(wx.StaticText(self, -1, "Building: %d " % (len(self.sliceCmdList))))
self.progressGauge.append(wx.Gauge(self, -1))
self.progressGauge[i].SetRange(10000)
self.progressGaugeTotal = wx.Gauge(self, -1)
@ -204,7 +204,18 @@ class BatchSliceProgressWindow(wx.Frame):
self.abortButton.Destroy()
self.closeButton = wx.Button(self, -1, "Close")
self.sizer.Add(self.closeButton, (2+self.threadCount*2,0), span=(1,1))
if profile.getPreference('sdpath') != '':
self.copyToSDButton = wx.Button(self, -1, "To SDCard")
self.Bind(wx.EVT_BUTTON, self.OnCopyToSD, self.copyToSDButton)
self.sizer.Add(self.copyToSDButton, (2+self.threadCount*2,1), span=(1,1))
self.Bind(wx.EVT_BUTTON, self.OnAbort, self.closeButton)
self.Layout()
self.Fit()
def OnCopyToSD(self, e):
for f in self.filenameList:
exportFilename = sliceRun.getExportFilename(f)
filename = os.path.basename(exportFilename)
if profile.getPreference('sdshortnames') == 'True':
filename = sliceRun.getShortFilename(filename)
shutil.copy(exportFilename, os.path.join(profile.getPreference('sdpath'), filename))

View File

@ -42,7 +42,7 @@ class configWindowBase(wx.Frame):
rightConfigPanel.SetSizer(sizer)
sizer = wx.BoxSizer(wx.HORIZONTAL)
configPanel.SetSizer(sizer)
sizer.Add(leftConfigPanel)
sizer.Add(leftConfigPanel, border=35, flag=wx.RIGHT)
sizer.Add(rightConfigPanel)
leftConfigPanel.main = self
rightConfigPanel.main = self
@ -92,7 +92,7 @@ class TitleRow():
x = sizer.GetRows()
self.title = wx.StaticText(panel, -1, name)
self.title.SetFont(wx.Font(wx.SystemSettings.GetFont(wx.SYS_ANSI_VAR_FONT).GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_BOLD))
sizer.Add(self.title, (x,0), (1,3), flag=wx.EXPAND)
sizer.Add(self.title, (x,0), (1,3), flag=wx.EXPAND|wx.TOP, border=10)
sizer.Add(wx.StaticLine(panel), (x+1,0), (1,3), flag=wx.EXPAND)
sizer.SetRows(x + 2)

View File

@ -98,6 +98,7 @@ class MachineSelectPage(InfoPage):
profile.putPreference('machine_width', '205')
profile.putPreference('machine_depth', '205')
profile.putPreference('machine_height', '200')
profile.putPreference('machine_type', 'ultimaker')
profile.putProfileSetting('nozzle_size', '0.4')
profile.putProfileSetting('machine_center_x', '100')
profile.putProfileSetting('machine_center_y', '100')
@ -105,6 +106,7 @@ class MachineSelectPage(InfoPage):
profile.putPreference('machine_width', '80')
profile.putPreference('machine_depth', '80')
profile.putPreference('machine_height', '60')
profile.putPreference('machine_type', 'reprap')
profile.putProfileSetting('nozzle_size', '0.5')
profile.putProfileSetting('machine_center_x', '40')
profile.putProfileSetting('machine_center_y', '40')
@ -124,7 +126,6 @@ class FirmwareUpgradePage(InfoPage):
self.AddHiddenSeperator()
self.AddText('Do not upgrade to this firmware if:')
self.AddText('* You have an older machine based on ATMega1280')
self.AddText('* Using an LCD panel')
self.AddText('* Have other changes in the firmware')
button = self.AddButton('Goto this page for a custom firmware')
button.Bind(wx.EVT_BUTTON, self.OnUrlClick)
@ -133,7 +134,7 @@ class FirmwareUpgradePage(InfoPage):
return False
def OnUpgradeClick(self, e):
if firmwareInstall.InstallFirmware(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../firmware/default.hex")):
if firmwareInstall.InstallFirmware():
self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
def OnSkipClick(self, e):

View File

@ -12,11 +12,25 @@ from avr_isp import intelHex
from util import machineCom
from util import profile
def getDefaultFirmware():
if profile.getPreference('machine_type') == 'ultimaker':
if sys.platform.startswith('linux'):
return os.path.join(os.path.dirname(os.path.abspath(__file__)), "../firmware/ultimaker_115200.hex")
else:
return os.path.join(os.path.dirname(os.path.abspath(__file__)), "../firmware/ultimaker_250000.hex")
return None
class InstallFirmware(wx.Dialog):
def __init__(self, filename, port = None):
def __init__(self, filename = None, port = None):
super(InstallFirmware, self).__init__(parent=None, title="Firmware install", size=(250, 100))
if port == None:
port = profile.getPreference('serial_port')
if filename == None:
filename = getDefaultFirmware()
if filename == None:
wx.MessageBox('Cura does not ship with a default firmware for your machine.', 'Firmware update', wx.OK | wx.ICON_ERROR)
self.Destroy()
return
sizer = wx.BoxSizer(wx.VERTICAL)
@ -37,7 +51,6 @@ class InstallFirmware(wx.Dialog):
self.ShowModal()
self.Destroy()
return
def OnRun(self):

View File

@ -129,13 +129,13 @@ class mainWindow(configBase.configWindowBase):
c = configBase.SettingRow(left, "Start distance (mm)", 'skirt_gap', '6.0', 'The distance between the skirt and the first layer.\nThis is the minimal distance, multiple skirt lines will be put outwards from this distance.')
validators.validFloat(c, 0.0)
configBase.TitleRow(right, "Speed")
configBase.TitleRow(right, "Speed && Temperature")
c = configBase.SettingRow(right, "Print speed (mm/s)", 'print_speed', '50', 'Speed at which printing happens. A well adjusted Ultimaker can reach 150mm/s, but for good quality prints you want to print slower. Printing speed depends on a lot of factors. So you will be experimenting with optimal settings for this.')
validators.validFloat(c, 1.0)
validators.warningAbove(c, 150.0, "It is highly unlikely that your machine can achieve a printing speed above 150mm/s")
validators.printSpeedValidator(c)
configBase.TitleRow(right, "Temperature")
#configBase.TitleRow(right, "Temperature")
c = configBase.SettingRow(right, "Printing temperature", 'print_temperature', '0', 'Temperature used for printing. Set at 0 to pre-heat yourself')
validators.validFloat(c, 0.0, 340.0)
validators.warningAbove(c, 260.0, "Temperatures above 260C could damage your machine, be careful!")
@ -155,7 +155,7 @@ class mainWindow(configBase.configWindowBase):
configBase.TitleRow(left, "Machine size")
c = configBase.SettingRow(left, "Nozzle size (mm)", 'nozzle_size', '0.4', 'The nozzle size is very important, this is used to calculate the line width of the infill, and used to calculate the amount of outside wall lines and thickness for the wall thickness you entered in the print settings.')
validators.validFloat(c, 0.1, 1.0)
validators.validFloat(c, 0.1, 10.0)
c = configBase.SettingRow(left, "Machine center X (mm)", 'machine_center_x', '100', 'The center of your machine, your print will be placed at this location')
validators.validInt(c, 10)
configBase.settingNotify(c, self.preview3d.updateCenterX)
@ -268,6 +268,10 @@ class mainWindow(configBase.configWindowBase):
dlg.Destroy()
if result:
profile.resetGlobalProfile()
if profile.getPreference('machine_type') == 'reprap':
profile.putProfileSetting('nozzle_size', '0.5')
profile.putProfileSetting('machine_center_x', '40')
profile.putProfileSetting('machine_center_y', '40')
self.updateProfileToControls()
def OnBatchRun(self, e):
@ -286,7 +290,7 @@ class mainWindow(configBase.configWindowBase):
self.Close()
def OnDefaultMarlinFirmware(self, e):
firmwareInstall.InstallFirmware(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../firmware/default.hex"))
firmwareInstall.InstallFirmware()
def OnCustomFirmware(self, e):
dlg=wx.FileDialog(self, "Open firmware to upload", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)

View File

@ -46,7 +46,7 @@ class preferencesDialog(configBase.configWindowBase):
configBase.TitleRow(right, 'Communication settings')
c = configBase.SettingRow(right, 'Serial port', 'serial_port', ['AUTO'] + machineCom.serialList(), 'Serial port to use for communication with the printer', type = 'preference')
c = configBase.SettingRow(right, 'Baudrate', 'serial_baud', '250000', 'Speed of the serial port communication\nNeeds to match your firmware settings\nCommon values are 250000, 115200, 57600', type = 'preference')
c = configBase.SettingRow(right, 'Baudrate', 'serial_baud', ['AUTO'] + map(str, machineCom.baudrateList()), 'Speed of the serial port communication\nNeeds to match your firmware settings\nCommon values are 250000, 115200, 57600', type = 'preference')
configBase.TitleRow(right, 'Slicer settings')
#c = configBase.SettingRow(right, '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')

View File

@ -136,7 +136,7 @@ class simpleModeWindow(configBase.configWindowBase):
prefDialog.Show(True)
def OnDefaultMarlinFirmware(self, e):
firmwareInstall.InstallFirmware(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../firmware/default.hex"))
firmwareInstall.InstallFirmware()
def OnCustomFirmware(self, e):
dlg=wx.FileDialog(self, "Open firmware to upload", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)

View File

@ -15,7 +15,7 @@ def openExporer(filename):
subprocess.Popen(r'explorer /select,"%s"' % (filename))
if sys.platform == 'darwin':
subprocess.Popen(['open', os.path.split(filename)[0]])
if sys.platform == 'linux2':
if sys.platform.startswith('linux'):
if os.path.isfile('/usr/bin/nautilus'):
subprocess.Popen(['/usr/bin/nautilus', os.path.split(filename)[0]])
elif os.path.isfile('/usr/bin/dolphin'):

View File

@ -29,6 +29,9 @@ def serialList():
pass
return baselist+glob.glob('/dev/ttyUSB*') + glob.glob('/dev/ttyACM*') +glob.glob("/dev/tty.usb*")+glob.glob("/dev/cu.*")+glob.glob("/dev/rfcomm*")
def baudrateList():
return [250000, 115200, 57600, 38400, 19200, 9600]
class VirtualPrinter():
def __init__(self):
self.readList = ['start\n']
@ -81,20 +84,23 @@ class MachineCom():
if port == None:
port = profile.getPreference('serial_port')
if baudrate == None:
baudrate = int(profile.getPreference('serial_baud'))
if profile.getPreference('serial_baud') == 'AUTO':
baudrate = 0
else:
baudrate = int(profile.getPreference('serial_baud'))
self.serial = None
if port == 'AUTO':
programmer = stk500v2.Stk500v2()
for port in serialList():
try:
print "Connecting to: %s %i" % (port, baudrate)
print "Connecting to: %s" % (port)
programmer.connect(port)
programmer.close()
time.sleep(1)
self.serial = Serial(port, baudrate, timeout=2)
self.serial = self._openPortWithBaudrate(port, baudrate)
break
except ispBase.IspError as (e):
print "Error while connecting to %s %i" % (port, baudrate)
print "Error while connecting to %s" % (port)
print e
pass
except:
@ -104,10 +110,29 @@ class MachineCom():
self.serial = VirtualPrinter()
else:
try:
self.serial = Serial(port, baudrate, timeout=2)
self.serial = self._openPortWithBaudrate(port, baudrate)
except:
print "Unexpected error while connecting to serial port:" + port, sys.exc_info()[0]
print self.serial
def _openPortWithBaudrate(self, port, baudrate):
if baudrate != 0:
return Serial(port, baudrate, timeout=2)
for baudrate in baudrateList():
try:
ser = Serial(port, baudrate, timeout=2)
except:
print "Unexpected error while connecting to serial port:" + port, sys.exc_info()[0]
continue
starttime = time.time()
for line in ser:
if line.startswith('start'):
ser.close()
return Serial(port, baudrate, timeout=2)
if starttime - time.time() > 10:
break
ser.close()
return None
def readline(self):
if self.serial == None:
@ -133,4 +158,3 @@ class MachineCom():
return
#print 'Send: ' + cmd
self.serial.write(cmd + '\n')

View File

@ -146,6 +146,7 @@ preferencesDefaultSettings = {
'machine_width': '205',
'machine_depth': '205',
'machine_height': '200',
'machine_type': 'unknown',
'extruder_amount': '1',
'extruder_offset_x1': '-22.0',
'extruder_offset_y1': '0.0',
@ -156,7 +157,7 @@ preferencesDefaultSettings = {
'filament_density': '1300',
'steps_per_e': '0',
'serial_port': 'AUTO',
'serial_baud': '250000',
'serial_baud': 'AUTO',
'slicer': 'Cura (Skeinforge based)',
'save_profile': 'False',
'filament_cost_kg': '0',