Merge branch 'master' into BQ_printer_profiles_update

Conflicts:
	resources/machines/bq_hephestos_2.json
	resources/machines/bq_witbox_2.json
This commit is contained in:
Nicanor Romero Venier 2015-10-28 16:45:59 +01:00
commit 1f60504452
27 changed files with 215 additions and 120 deletions

View File

@ -44,6 +44,7 @@ from . import CameraAnimation
from . import PrintInformation from . import PrintInformation
from . import CuraActions from . import CuraActions
from . import MultiMaterialDecorator from . import MultiMaterialDecorator
from . import ZOffsetDecorator
from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS
from PyQt5.QtGui import QColor, QIcon from PyQt5.QtGui import QColor, QIcon
@ -349,14 +350,12 @@ class CuraApplication(QtApplication):
continue #Grouped nodes don't need resetting as their parent (the group) is resetted) continue #Grouped nodes don't need resetting as their parent (the group) is resetted)
nodes.append(node) nodes.append(node)
if nodes: if nodes:
op = GroupedOperation() op = GroupedOperation()
for node in nodes: for node in nodes:
# Ensure that the object is above the build platform node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
move_distance = node.getBoundingBox().center.y op.addOperation(SetTransformOperation(node, Vector(0,0,0)))
if move_distance <= 0:
move_distance = -node.getBoundingBox().bottom
op.addOperation(SetTransformOperation(node, Vector(0,move_distance,0)))
op.push() op.push()
@ -378,10 +377,8 @@ class CuraApplication(QtApplication):
for node in nodes: for node in nodes:
# Ensure that the object is above the build platform # Ensure that the object is above the build platform
move_distance = node.getBoundingBox().center.y node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
if move_distance <= 0: op.addOperation(SetTransformOperation(node, Vector(0,0,0), Quaternion(), Vector(1, 1, 1)))
move_distance = -node.getBoundingBox().bottom
op.addOperation(SetTransformOperation(node, Vector(0,move_distance,0), Quaternion(), Vector(1, 1, 1)))
op.push() op.push()
@ -478,17 +475,20 @@ class CuraApplication(QtApplication):
group_decorator = GroupDecorator() group_decorator = GroupDecorator()
group_node.addDecorator(group_decorator) group_node.addDecorator(group_decorator)
group_node.setParent(self.getController().getScene().getRoot()) group_node.setParent(self.getController().getScene().getRoot())
center = Selection.getSelectionCenter()
group_node.setPosition(center)
group_node.setCenterPosition(center)
for node in Selection.getAllSelectedObjects(): for node in Selection.getAllSelectedObjects():
world = node.getWorldPosition()
node.setParent(group_node) node.setParent(group_node)
group_node.setCenterPosition(group_node.getBoundingBox().center) node.setPosition(world - center)
#group_node.translate(Vector(0,group_node.getBoundingBox().center.y,0))
group_node.translate(group_node.getBoundingBox().center)
for node in group_node.getChildren(): for node in group_node.getChildren():
Selection.remove(node) Selection.remove(node)
Selection.add(group_node) Selection.add(group_node)
@pyqtSlot() @pyqtSlot()
def ungroupSelected(self): def ungroupSelected(self):
ungrouped_nodes = [] ungrouped_nodes = []
@ -499,12 +499,11 @@ class CuraApplication(QtApplication):
for child in node.getChildren(): for child in node.getChildren():
if type(child) is SceneNode: if type(child) is SceneNode:
children_to_move.append(child) children_to_move.append(child)
for child in children_to_move: for child in children_to_move:
position = child.getWorldPosition()
child.setParent(node.getParent()) child.setParent(node.getParent())
print(node.getPosition()) child.setPosition(position - node.getParent().getWorldPosition())
child.translate(node.getPosition())
child.setPosition(child.getPosition().scale(node.getScale()))
child.scale(node.getScale()) child.scale(node.getScale())
child.rotate(node.getOrientation()) child.rotate(node.getOrientation())

View File

@ -17,6 +17,7 @@ from cura.ConvexHullDecorator import ConvexHullDecorator
from . import PlatformPhysicsOperation from . import PlatformPhysicsOperation
from . import ConvexHullJob from . import ConvexHullJob
from . import ZOffsetDecorator
import time import time
import threading import threading
@ -69,8 +70,12 @@ class PlatformPhysics:
# Move it downwards if bottom is above platform # Move it downwards if bottom is above platform
move_vector = Vector() move_vector = Vector()
if not (node.getParent() and node.getParent().callDecoration("isGroup")): #If an object is grouped, don't move it down if not (node.getParent() and node.getParent().callDecoration("isGroup")): #If an object is grouped, don't move it down
z_offset = node.callDecoration("getZOffset") if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator) else 0
if bbox.bottom > 0: if bbox.bottom > 0:
move_vector.setY(-bbox.bottom) move_vector.setY(-bbox.bottom + z_offset)
elif bbox.bottom < z_offset:
move_vector.setY((-bbox.bottom) - z_offset)
#if not Float.fuzzyCompare(bbox.bottom, 0.0): #if not Float.fuzzyCompare(bbox.bottom, 0.0):
# pass#move_vector.setY(-bbox.bottom) # pass#move_vector.setY(-bbox.bottom)
@ -149,5 +154,16 @@ class PlatformPhysics:
self._enabled = False self._enabled = False
def _onToolOperationStopped(self, tool): def _onToolOperationStopped(self, tool):
if tool.getPluginId() == "TranslateTool":
for node in Selection.getAllSelectedObjects():
if node.getBoundingBox().bottom < 0:
if not node.getDecorator(ZOffsetDecorator.ZOffsetDecorator):
node.addDecorator(ZOffsetDecorator.ZOffsetDecorator())
node.callDecoration("setZOffset", node.getBoundingBox().bottom)
else:
if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator):
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
self._enabled = True self._enabled = True
self._onChangeTimerFinished() self._onChangeTimerFinished()

13
cura/ZOffsetDecorator.py Normal file
View File

@ -0,0 +1,13 @@
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
## A decorator that stores the amount an object has been moved below the platform.
class ZOffsetDecorator(SceneNodeDecorator):
def __init__(self):
self._z_offset = 0
def setZOffset(self, offset):
print("setZOffset", offset)
self._z_offset = offset
def getZOffset(self):
return self._z_offset

View File

@ -31,6 +31,7 @@ class ChangeLog(Extension, QObject,):
self._change_logs = None self._change_logs = None
Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated) Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
Preferences.getInstance().addPreference("general/latest_version_changelog_shown", "15.05.90") #First version of CURA with uranium Preferences.getInstance().addPreference("general/latest_version_changelog_shown", "15.05.90") #First version of CURA with uranium
self.addMenuItem(catalog.i18nc("@item:inmenu", "Show Changelog"), self.showChangelog)
#self.showChangelog() #self.showChangelog()
def getChangeLogs(self): def getChangeLogs(self):
@ -77,8 +78,8 @@ class ChangeLog(Extension, QObject,):
def _onEngineCreated(self): def _onEngineCreated(self):
if not self._version: if not self._version:
return #We're on dev branch. return #We're on dev branch.
if self._version > Preferences.getInstance().getValue("general/latest_version_changelog_shown"): #if self._version > Preferences.getInstance().getValue("general/latest_version_changelog_shown"):
self.showChangelog() #self.showChangelog()
def showChangelog(self): def showChangelog(self):
if not self._changelog_window: if not self._changelog_window:

View File

@ -9,7 +9,7 @@ catalog = i18nCatalog("cura")
def getMetaData(): def getMetaData():
return { return {
"plugin": { "plugin": {
"name": catalog.i18nc("@label", "Change Log"), "name": catalog.i18nc("@label", "Changelog"),
"author": "Ultimaker", "author": "Ultimaker",
"version": "1.0", "version": "1.0",
"description": catalog.i18nc("@info:whatsthis", "Shows changes since latest checked version"), "description": catalog.i18nc("@info:whatsthis", "Shows changes since latest checked version"),

View File

@ -123,6 +123,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
progressChanged = pyqtSignal() progressChanged = pyqtSignal()
extruderTemperatureChanged = pyqtSignal() extruderTemperatureChanged = pyqtSignal()
bedTemperatureChanged = pyqtSignal() bedTemperatureChanged = pyqtSignal()
firmwareUpdateComplete = pyqtSignal()
endstopStateChanged = pyqtSignal(str ,bool, arguments = ["key","state"]) endstopStateChanged = pyqtSignal(str ,bool, arguments = ["key","state"])

View File

@ -54,6 +54,15 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
addConnectionSignal = Signal() addConnectionSignal = Signal()
printerConnectionStateChanged = pyqtSignal() printerConnectionStateChanged = pyqtSignal()
progressChanged = pyqtSignal()
@pyqtProperty(float, notify = progressChanged)
def progress(self):
progress = 0
for name, connection in self._printer_connections.items():
progress += connection.progress
return progress / len(self._printer_connections)
def start(self): def start(self):
self._check_updates = True self._check_updates = True
self._update_thread.start() self._update_thread.start()
@ -91,6 +100,7 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
try: try:
self._printer_connections[printer_connection].updateFirmware(Resources.getPath(CuraApplication.ResourceTypes.Firmware, self._getDefaultFirmwareName())) self._printer_connections[printer_connection].updateFirmware(Resources.getPath(CuraApplication.ResourceTypes.Firmware, self._getDefaultFirmwareName()))
except FileNotFoundError: except FileNotFoundError:
Logger.log("w", "No firmware found for printer %s", printer_connection)
continue continue
@pyqtSlot(str, result = bool) @pyqtSlot(str, result = bool)
@ -154,6 +164,7 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
connection = PrinterConnection.PrinterConnection(serial_port) connection = PrinterConnection.PrinterConnection(serial_port)
connection.connect() connection.connect()
connection.connectionStateChanged.connect(self._onPrinterConnectionStateChanged) connection.connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
connection.progressChanged.connect(self.progressChanged)
self._printer_connections[serial_port] = connection self._printer_connections[serial_port] = connection
def _onPrinterConnectionStateChanged(self, serial_port): def _onPrinterConnectionStateChanged(self, serial_port):
@ -197,4 +208,4 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*") base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*")
return list(base_list) return list(base_list)
_instance = None _instance = None

View File

@ -4,22 +4,22 @@ To support more chips add the relevant data to the avrChipDB list.
This is a python 3 conversion of the code created by David Braam for the Cura project. This is a python 3 conversion of the code created by David Braam for the Cura project.
""" """
avrChipDB = { avr_chip_db = {
'ATMega1280': { "ATMega1280": {
'signature': [0x1E, 0x97, 0x03], "signature": [0x1E, 0x97, 0x03],
'pageSize': 128, "pageSize": 128,
'pageCount': 512, "pageCount": 512,
}, },
'ATMega2560': { "ATMega2560": {
'signature': [0x1E, 0x98, 0x01], "signature": [0x1E, 0x98, 0x01],
'pageSize': 128, "pageSize": 128,
'pageCount': 1024, "pageCount": 1024,
}, },
} }
def getChipFromDB(sig): def getChipFromDB(sig):
for chip in avrChipDB.values(): for chip in avr_chip_db.values():
if chip['signature'] == sig: if chip["signature"] == sig:
return chip return chip
return False return False

View File

@ -11,36 +11,36 @@ def readHex(filename):
Read an verify an intel hex file. Return the data as an list of bytes. Read an verify an intel hex file. Return the data as an list of bytes.
""" """
data = [] data = []
extraAddr = 0 extra_addr = 0
f = io.open(filename, "r") f = io.open(filename, "r")
for line in f: for line in f:
line = line.strip() line = line.strip()
if len(line) < 1: if len(line) < 1:
continue continue
if line[0] != ':': if line[0] != ":":
raise Exception("Hex file has a line not starting with ':'") raise Exception("Hex file has a line not starting with ':'")
recLen = int(line[1:3], 16) rec_len = int(line[1:3], 16)
addr = int(line[3:7], 16) + extraAddr addr = int(line[3:7], 16) + extra_addr
recType = int(line[7:9], 16) rec_type = int(line[7:9], 16)
if len(line) != recLen * 2 + 11: if len(line) != rec_len * 2 + 11:
raise Exception("Error in hex file: " + line) raise Exception("Error in hex file: " + line)
checkSum = 0 check_sum = 0
for i in range(0, recLen + 5): for i in range(0, rec_len + 5):
checkSum += int(line[i*2+1:i*2+3], 16) check_sum += int(line[i*2+1:i*2+3], 16)
checkSum &= 0xFF check_sum &= 0xFF
if checkSum != 0: if check_sum != 0:
raise Exception("Checksum error in hex file: " + line) raise Exception("Checksum error in hex file: " + line)
if recType == 0:#Data record if rec_type == 0:#Data record
while len(data) < addr + recLen: while len(data) < addr + rec_len:
data.append(0) data.append(0)
for i in range(0, recLen): for i in range(0, rec_len):
data[addr + i] = int(line[i*2+9:i*2+11], 16) data[addr + i] = int(line[i*2+9:i*2+11], 16)
elif recType == 1: #End Of File record elif rec_type == 1: #End Of File record
pass pass
elif recType == 2: #Extended Segment Address Record elif rec_type == 2: #Extended Segment Address Record
extraAddr = int(line[9:13], 16) * 16 extra_addr = int(line[9:13], 16) * 16
else: else:
print(recType, recLen, addr, checkSum, line) print(rec_type, rec_len, addr, check_sum, line)
f.close() f.close()
return data return data

View File

@ -14,18 +14,18 @@ class IspBase():
Base class for ISP based AVR programmers. Base class for ISP based AVR programmers.
Functions in this class raise an IspError when something goes wrong. Functions in this class raise an IspError when something goes wrong.
""" """
def programChip(self, flashData): def programChip(self, flash_data):
""" Program a chip with the given flash data. """ """ Program a chip with the given flash data. """
self.curExtAddr = -1 self.cur_ext_addr = -1
self.chip = chipDB.getChipFromDB(self.getSignature()) self.chip = chipDB.getChipFromDB(self.getSignature())
if not self.chip: if not self.chip:
raise IspError("Chip with signature: " + str(self.getSignature()) + "not found") raise IspError("Chip with signature: " + str(self.getSignature()) + "not found")
self.chipErase() self.chipErase()
print("Flashing %i bytes" % len(flashData)) print("Flashing %i bytes" % len(flash_data))
self.writeFlash(flashData) self.writeFlash(flash_data)
print("Verifying %i bytes" % len(flashData)) print("Verifying %i bytes" % len(flash_data))
self.verifyFlash(flashData) self.verifyFlash(flash_data)
print("Completed") print("Completed")
def getSignature(self): def getSignature(self):
@ -45,13 +45,13 @@ class IspBase():
""" """
self.sendISP([0xAC, 0x80, 0x00, 0x00]) self.sendISP([0xAC, 0x80, 0x00, 0x00])
def writeFlash(self, flashData): def writeFlash(self, flash_data):
""" """
Write the flash data, needs to be implemented in a subclass. Write the flash data, needs to be implemented in a subclass.
""" """
raise IspError("Called undefined writeFlash") raise IspError("Called undefined writeFlash")
def verifyFlash(self, flashData): def verifyFlash(self, flash_data):
""" """
Verify the flash data, needs to be implemented in a subclass. Verify the flash data, needs to be implemented in a subclass.
""" """

View File

@ -19,10 +19,10 @@ class Stk500v2(ispBase.IspBase):
def __init__(self): def __init__(self):
self.serial = None self.serial = None
self.seq = 1 self.seq = 1
self.lastAddr = -1 self.last_addr = -1
self.progressCallback = None self.progress_callback = None
def connect(self, port = 'COM22', speed = 115200): def connect(self, port = "COM22", speed = 115200):
if self.serial is not None: if self.serial is not None:
self.close() self.close()
try: try:
@ -82,49 +82,49 @@ class Stk500v2(ispBase.IspBase):
def writeFlash(self, flash_data): def writeFlash(self, flash_data):
#Set load addr to 0, in case we have more then 64k flash we need to enable the address extension #Set load addr to 0, in case we have more then 64k flash we need to enable the address extension
page_size = self.chip['pageSize'] * 2 page_size = self.chip["pageSize"] * 2
flashSize = page_size * self.chip['pageCount'] flash_size = page_size * self.chip["pageCount"]
print("Writing flash") print("Writing flash")
if flashSize > 0xFFFF: if flash_size > 0xFFFF:
self.sendMessage([0x06, 0x80, 0x00, 0x00, 0x00]) self.sendMessage([0x06, 0x80, 0x00, 0x00, 0x00])
else: else:
self.sendMessage([0x06, 0x00, 0x00, 0x00, 0x00]) self.sendMessage([0x06, 0x00, 0x00, 0x00, 0x00])
load_count = (len(flash_data) + page_size - 1) / page_size load_count = (len(flash_data) + page_size - 1) / page_size
for i in range(0, int(load_count)): for i in range(0, int(load_count)):
recv = self.sendMessage([0x13, page_size >> 8, page_size & 0xFF, 0xc1, 0x0a, 0x40, 0x4c, 0x20, 0x00, 0x00] + flash_data[(i * page_size):(i * page_size + page_size)]) recv = self.sendMessage([0x13, page_size >> 8, page_size & 0xFF, 0xc1, 0x0a, 0x40, 0x4c, 0x20, 0x00, 0x00] + flash_data[(i * page_size):(i * page_size + page_size)])
if self.progressCallback is not None: if self.progress_callback is not None:
if self._has_checksum: if self._has_checksum:
self.progressCallback(i + 1, load_count) self.progress_callback(i + 1, load_count)
else: else:
self.progressCallback(i + 1, load_count*2) self.progress_callback(i + 1, load_count*2)
def verifyFlash(self, flashData): def verifyFlash(self, flash_data):
if self._has_checksum: if self._has_checksum:
self.sendMessage([0x06, 0x00, (len(flashData) >> 17) & 0xFF, (len(flashData) >> 9) & 0xFF, (len(flashData) >> 1) & 0xFF]) self.sendMessage([0x06, 0x00, (len(flash_data) >> 17) & 0xFF, (len(flash_data) >> 9) & 0xFF, (len(flash_data) >> 1) & 0xFF])
res = self.sendMessage([0xEE]) res = self.sendMessage([0xEE])
checksum_recv = res[2] | (res[3] << 8) checksum_recv = res[2] | (res[3] << 8)
checksum = 0 checksum = 0
for d in flashData: for d in flash_data:
checksum += d checksum += d
checksum &= 0xFFFF checksum &= 0xFFFF
if hex(checksum) != hex(checksum_recv): if hex(checksum) != hex(checksum_recv):
raise ispBase.IspError('Verify checksum mismatch: 0x%x != 0x%x' % (checksum & 0xFFFF, checksum_recv)) raise ispBase.IspError("Verify checksum mismatch: 0x%x != 0x%x" % (checksum & 0xFFFF, checksum_recv))
else: else:
#Set load addr to 0, in case we have more then 64k flash we need to enable the address extension #Set load addr to 0, in case we have more then 64k flash we need to enable the address extension
flashSize = self.chip['pageSize'] * 2 * self.chip['pageCount'] flash_size = self.chip["pageSize"] * 2 * self.chip["pageCount"]
if flashSize > 0xFFFF: if flash_size > 0xFFFF:
self.sendMessage([0x06, 0x80, 0x00, 0x00, 0x00]) self.sendMessage([0x06, 0x80, 0x00, 0x00, 0x00])
else: else:
self.sendMessage([0x06, 0x00, 0x00, 0x00, 0x00]) self.sendMessage([0x06, 0x00, 0x00, 0x00, 0x00])
loadCount = (len(flashData) + 0xFF) / 0x100 load_count = (len(flash_data) + 0xFF) / 0x100
for i in range(0, int(loadCount)): for i in range(0, int(load_count)):
recv = self.sendMessage([0x14, 0x01, 0x00, 0x20])[2:0x102] recv = self.sendMessage([0x14, 0x01, 0x00, 0x20])[2:0x102]
if self.progressCallback is not None: if self.progress_callback is not None:
self.progressCallback(loadCount + i + 1, loadCount*2) self.progress_callback(load_count + i + 1, load_count*2)
for j in range(0, 0x100): for j in range(0, 0x100):
if i * 0x100 + j < len(flashData) and flashData[i * 0x100 + j] != recv[j]: if i * 0x100 + j < len(flash_data) and flash_data[i * 0x100 + j] != recv[j]:
raise ispBase.IspError('Verify error at: 0x%x' % (i * 0x100 + j)) raise ispBase.IspError("Verify error at: 0x%x" % (i * 0x100 + j))
def sendMessage(self, data): def sendMessage(self, data):
message = struct.pack(">BBHB", 0x1B, self.seq, len(data), 0x0E) message = struct.pack(">BBHB", 0x1B, self.seq, len(data), 0x0E)
@ -138,12 +138,12 @@ class Stk500v2(ispBase.IspBase):
self.serial.write(message) self.serial.write(message)
self.serial.flush() self.serial.flush()
except SerialTimeoutException: except SerialTimeoutException:
raise ispBase.IspError('Serial send timeout') raise ispBase.IspError("Serial send timeout")
self.seq = (self.seq + 1) & 0xFF self.seq = (self.seq + 1) & 0xFF
return self.recvMessage() return self.recvMessage()
def recvMessage(self): def recvMessage(self):
state = 'Start' state = "Start"
checksum = 0 checksum = 0
while True: while True:
s = self.serial.read() s = self.serial.read()
@ -152,31 +152,31 @@ class Stk500v2(ispBase.IspBase):
b = struct.unpack(">B", s)[0] b = struct.unpack(">B", s)[0]
checksum ^= b checksum ^= b
#print(hex(b)) #print(hex(b))
if state == 'Start': if state == "Start":
if b == 0x1B: if b == 0x1B:
state = 'GetSeq' state = "GetSeq"
checksum = 0x1B checksum = 0x1B
elif state == 'GetSeq': elif state == "GetSeq":
state = 'MsgSize1' state = "MsgSize1"
elif state == 'MsgSize1': elif state == "MsgSize1":
msgSize = b << 8 msg_size = b << 8
state = 'MsgSize2' state = "MsgSize2"
elif state == 'MsgSize2': elif state == "MsgSize2":
msgSize |= b msg_size |= b
state = 'Token' state = "Token"
elif state == 'Token': elif state == "Token":
if b != 0x0E: if b != 0x0E:
state = 'Start' state = "Start"
else: else:
state = 'Data' state = "Data"
data = [] data = []
elif state == 'Data': elif state == "Data":
data.append(b) data.append(b)
if len(data) == msgSize: if len(data) == msg_size:
state = 'Checksum' state = "Checksum"
elif state == 'Checksum': elif state == "Checksum":
if checksum != 0: if checksum != 0:
state = 'Start' state = "Start"
else: else:
return data return data
@ -190,7 +190,7 @@ def portList():
values = _winreg.EnumValue(key, i) values = _winreg.EnumValue(key, i)
except: except:
return ret return ret
if 'USBSER' in values[0]: if "USBSER" in values[0]:
ret.append(values[1]) ret.append(values[1])
i+=1 i+=1
return ret return ret
@ -205,7 +205,7 @@ def runProgrammer(port, filename):
def main(): def main():
""" Entry point to call the stk500v2 programmer from the commandline. """ """ Entry point to call the stk500v2 programmer from the commandline. """
import threading import threading
if sys.argv[1] == 'AUTO': if sys.argv[1] == "AUTO":
print(portList()) print(portList())
for port in portList(): for port in portList():
threading.Thread(target=runProgrammer, args=(port,sys.argv[2])).start() threading.Thread(target=runProgrammer, args=(port,sys.argv[2])).start()
@ -216,5 +216,5 @@ def main():
programmer.programChip(intelHex.readHex(sys.argv[2])) programmer.programChip(intelHex.readHex(sys.argv[2]))
sys.exit(1) sys.exit(1)
if __name__ == '__main__': if __name__ == "__main__":
main() main()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -18,6 +18,8 @@
"machine_nozzle_size": { "default": 0.4, "machine_nozzle_size": { "default": 0.4,
"visible": true "visible": true
}, },
"machine_nozzle_heat_up_speed": { "default": 2.0 },
"machine_nozzle_cool_down_speed": { "default": 2.0 },
"machine_head_shape_min_x": { "default": 0 }, "machine_head_shape_min_x": { "default": 0 },
"machine_head_shape_min_y": { "default": 0 }, "machine_head_shape_min_y": { "default": 0 },
"machine_head_shape_max_x": { "default": 0 }, "machine_head_shape_max_x": { "default": 0 },

View File

@ -16,6 +16,8 @@
"machine_heated_bed": { "default": true }, "machine_heated_bed": { "default": true },
"machine_nozzle_size": { "default": 0.4}, "machine_nozzle_size": { "default": 0.4},
"machine_nozzle_heat_up_speed": { "default": 2.0 },
"machine_nozzle_cool_down_speed": { "default": 2.0 },
"machine_head_shape_min_x": { "default": 0 }, "machine_head_shape_min_x": { "default": 0 },
"machine_head_shape_min_y": { "default": 0 }, "machine_head_shape_min_y": { "default": 0 },
"machine_head_shape_max_x": { "default": 0 }, "machine_head_shape_max_x": { "default": 0 },

View File

@ -38,6 +38,8 @@
"machine_nozzle_head_distance": { "default": 3, "SEE_machine_extruder_trains": true }, "machine_nozzle_head_distance": { "default": 3, "SEE_machine_extruder_trains": true },
"machine_nozzle_expansion_angle": { "default": 45, "SEE_machine_extruder_trains": true }, "machine_nozzle_expansion_angle": { "default": 45, "SEE_machine_extruder_trains": true },
"machine_heat_zone_length": { "default": 16, "SEE_machine_extruder_trains": true }, "machine_heat_zone_length": { "default": 16, "SEE_machine_extruder_trains": true },
"machine_nozzle_heat_up_speed": { "default": 2.0, "SEE_machine_extruder_trains": true },
"machine_nozzle_cool_down_speed": { "default": 2.0, "SEE_machine_extruder_trains": true },
"machine_gcode_flavor": { "machine_gcode_flavor": {
"default": "RepRap" "default": "RepRap"
}, },
@ -497,16 +499,7 @@
"type": "float", "type": "float",
"default": 0.1, "default": 0.1,
"visible": false, "visible": false,
"children": { "inherit_function": "layer_height"
"infill_sparse_combine": {
"label": "Infill Layers",
"description": "Amount of layers that are combined together to form sparse infill.",
"type": "int",
"default": 1,
"visible": false,
"inherit_function": "math.floor(( parent_value + 0.001) / layer_height)"
}
}
}, },
"infill_before_walls": { "infill_before_walls": {
"label": "Infill Before Walls", "label": "Infill Before Walls",
@ -522,6 +515,13 @@
"visible": true, "visible": true,
"icon": "category_material", "icon": "category_material",
"settings": { "settings": {
"material_flow_dependent_temperature": {
"label": "Auto Temperature",
"description": "Change the temperature each layer automatically with the average flow speed of that layer.",
"type": "boolean",
"default": true,
"visible": true
},
"material_print_temperature": { "material_print_temperature": {
"label": "Printing Temperature", "label": "Printing Temperature",
"description": "The temperature used for printing. Set at 0 to pre-heat yourself. For PLA a value of 210C is usually used.\nFor ABS a value of 230C or higher is required.", "description": "The temperature used for printing. Set at 0 to pre-heat yourself. For PLA a value of 210C is usually used.\nFor ABS a value of 230C or higher is required.",
@ -529,8 +529,35 @@
"type": "float", "type": "float",
"default": 210, "default": 210,
"min_value": "0", "min_value": "0",
"max_value_warning": "260",
"enabled": "not (material_flow_dependent_temperature)"
},
"material_flow_temp_graph": {
"label": "Flow Temperature Graph",
"description": "Data linking material flow (in mm³/s) to temperature (°C).",
"unit": "",
"type": "string",
"default": "[[0.1,180],[20,230]]",
"enabled": "material_flow_dependent_temperature"
},
"material_standby_temperature": {
"label": "Standby Temperature",
"description": "The temperature of the nozzle when another nozzle is currently used for printing.",
"unit": "°C",
"type": "float",
"default": 150,
"min_value": "0",
"max_value_warning": "260" "max_value_warning": "260"
}, },
"material_extrusion_cool_down_speed": {
"label": "Extrusion Cool Down Speed Modifier",
"description": "The extra speed by which the nozzle cools when while extruding. The same value is used to signify the heat up speed lost when heating up while extruding.",
"unit": "°C/s",
"type": "float",
"default": 0.5,
"min_value": "0",
"max_value_warning": "10.0"
},
"material_bed_temperature": { "material_bed_temperature": {
"label": "Bed Temperature", "label": "Bed Temperature",
"description": "The temperature used for the heated printer bed. Set at 0 to pre-heat it yourself.", "description": "The temperature used for the heated printer bed. Set at 0 to pre-heat it yourself.",

View File

@ -16,6 +16,8 @@
"machine_depth": { "default": 150 }, "machine_depth": { "default": 150 },
"machine_center_is_zero": { "default": false }, "machine_center_is_zero": { "default": false },
"machine_nozzle_size": { "default": 0.5 }, "machine_nozzle_size": { "default": 0.5 },
"machine_nozzle_heat_up_speed": { "default": 2.0 },
"machine_nozzle_cool_down_speed": { "default": 2.0 },
"machine_head_shape_min_x": { "default": 75 }, "machine_head_shape_min_x": { "default": 75 },
"machine_head_shape_min_y": { "default": 18 }, "machine_head_shape_min_y": { "default": 18 },
"machine_head_shape_max_x": { "default": 18 }, "machine_head_shape_max_x": { "default": 18 },

View File

@ -17,6 +17,8 @@
"machine_center_is_zero": { "default": false }, "machine_center_is_zero": { "default": false },
"machine_nozzle_size": { "default": 0.4 }, "machine_nozzle_size": { "default": 0.4 },
"machine_nozzle_heat_up_speed": { "default": 2.0 },
"machine_nozzle_cool_down_speed": { "default": 2.0 },
"machine_head_shape_min_x": { "default": 0 }, "machine_head_shape_min_x": { "default": 0 },
"machine_head_shape_min_y": { "default": 0 }, "machine_head_shape_min_y": { "default": 0 },
"machine_head_shape_max_x": { "default": 0 }, "machine_head_shape_max_x": { "default": 0 },

View File

@ -16,6 +16,8 @@
"machine_depth": { "default": 200 }, "machine_depth": { "default": 200 },
"machine_center_is_zero": { "default": false }, "machine_center_is_zero": { "default": false },
"machine_nozzle_size": { "default": 0.4 }, "machine_nozzle_size": { "default": 0.4 },
"machine_nozzle_heat_up_speed": { "default": 2.0 },
"machine_nozzle_cool_down_speed": { "default": 2.0 },
"machine_head_shape_min_x": { "default": 75 }, "machine_head_shape_min_x": { "default": 75 },
"machine_head_shape_min_y": { "default": 18 }, "machine_head_shape_min_y": { "default": 18 },
"machine_head_shape_max_x": { "default": 18 }, "machine_head_shape_max_x": { "default": 18 },

View File

@ -16,6 +16,12 @@
"machine_nozzle_size": { "machine_nozzle_size": {
"default": 0.4 "default": 0.4
}, },
"machine_nozzle_heat_up_speed": {
"default": 2.0
},
"machine_nozzle_cool_down_speed": {
"default": 2.0
},
"machine_nozzle_tip_outer_diameter": { "machine_nozzle_tip_outer_diameter": {
"default": 1 "default": 1
}, },
@ -61,6 +67,8 @@
}, },
"machine_center_is_zero": { "default": false }, "machine_center_is_zero": { "default": false },
"machine_nozzle_size": { "default": 0.4 }, "machine_nozzle_size": { "default": 0.4 },
"machine_nozzle_heat_up_speed": { "default": 2.0 },
"machine_nozzle_cool_down_speed": { "default": 2.0 },
"gantry_height": { "default": 55 }, "gantry_height": { "default": 55 },
"machine_use_extruder_offset_to_offset_coords": { "default": true }, "machine_use_extruder_offset_to_offset_coords": { "default": true },
"machine_gcode_flavor": { "default": "UltiGCode" }, "machine_gcode_flavor": { "default": "UltiGCode" },

View File

@ -21,6 +21,12 @@
"machine_nozzle_size": { "machine_nozzle_size": {
"default": 0.4 "default": 0.4
}, },
"machine_nozzle_heat_up_speed": {
"default": 2.0
},
"machine_nozzle_cool_down_speed": {
"default": 2.0
},
"machine_nozzle_tip_outer_diameter": { "machine_nozzle_tip_outer_diameter": {
"default": 1 "default": 1
}, },
@ -41,6 +47,8 @@
"machine_depth": { "default": 205 }, "machine_depth": { "default": 205 },
"machine_center_is_zero": { "default": false }, "machine_center_is_zero": { "default": false },
"machine_nozzle_size": { "default": 0.4 }, "machine_nozzle_size": { "default": 0.4 },
"machine_nozzle_heat_up_speed": { "default": 2.0 },
"machine_nozzle_cool_down_speed": { "default": 2.0 },
"machine_head_with_fans_polygon": "machine_head_with_fans_polygon":
{ {
"default": [ "default": [

View File

@ -47,7 +47,6 @@ Item
Action Action
{ {
id:toggleFullScreenAction id:toggleFullScreenAction
shortcut: StandardKey.FullScreen;
text: catalog.i18nc("@action:inmenu","Toggle Fu&ll Screen"); text: catalog.i18nc("@action:inmenu","Toggle Fu&ll Screen");
iconName: "view-fullscreen"; iconName: "view-fullscreen";
} }

View File

@ -152,10 +152,6 @@ UM.MainWindow
onObjectRemoved: top_view_menu.removeItem(object) onObjectRemoved: top_view_menu.removeItem(object)
} }
ExclusiveGroup { id: view_menu_top_group; } ExclusiveGroup { id: view_menu_top_group; }
MenuSeparator { }
MenuItem { action: actions.toggleFullScreen; }
} }
Menu Menu
{ {

View File

@ -81,6 +81,7 @@ Item{
text: catalog.i18nc("@label","Global Profile:"); text: catalog.i18nc("@label","Global Profile:");
width: parent.width/100*45 width: parent.width/100*45
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
} }

View File

@ -100,6 +100,7 @@ Item
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
} }
ToolButton { ToolButton {

View File

@ -33,6 +33,7 @@ Item
//: Infill selection label //: Infill selection label
text: catalog.i18nc("@label","Infill:"); text: catalog.i18nc("@label","Infill:");
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left anchors.left: parent.left
@ -166,6 +167,7 @@ Item
//: Helpers selection label //: Helpers selection label
text: catalog.i18nc("@label:listbox","Helpers:"); text: catalog.i18nc("@label:listbox","Helpers:");
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
} }
} }
Rectangle { Rectangle {

View File

@ -47,5 +47,6 @@ Rectangle {
} }
wrapMode: Text.Wrap; wrapMode: Text.Wrap;
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
} }
} }

View File

@ -50,6 +50,7 @@
}, },
"colors": { "colors": {
"text_default": [0, 0, 0, 255],
"sidebar": [255, 255, 255, 255], "sidebar": [255, 255, 255, 255],
"lining": [208, 210, 211, 255], "lining": [208, 210, 211, 255],