mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 22:13:58 -06:00
Merge remote-tracking branch 'upstream/master' into master-CURA-2079
This commit is contained in:
commit
8179fabf1d
11 changed files with 50 additions and 25 deletions
|
@ -68,6 +68,7 @@ class ChangeLog(Extension, QObject,):
|
|||
line = line.replace("[","")
|
||||
line = line.replace("]","")
|
||||
open_version = Version(line)
|
||||
open_header = ""
|
||||
self._change_logs[open_version] = collections.OrderedDict()
|
||||
elif line.startswith("*"):
|
||||
open_header = line.replace("*","")
|
||||
|
|
|
@ -70,6 +70,7 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
|
|||
else:
|
||||
stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
new_instance.setProperty("value", stack.getProperty(item, "value"))
|
||||
new_instance.resetState() # Ensure that the state is not seen as a user state.
|
||||
settings.addInstance(new_instance)
|
||||
visibility_changed = True
|
||||
else:
|
||||
|
|
|
@ -311,6 +311,15 @@ Item {
|
|||
|
||||
property string labelFilter: ""
|
||||
|
||||
onVisibilityChanged:
|
||||
{
|
||||
// force updating the model to sync it with addedSettingsModel
|
||||
if(visible)
|
||||
{
|
||||
listview.model.forceUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: filter
|
||||
|
||||
|
|
|
@ -62,8 +62,11 @@ class SolidView(View):
|
|||
|
||||
uniforms = {}
|
||||
if not multi_extrusion:
|
||||
material = global_container_stack.findContainer({ "type": "material" })
|
||||
material_color = material.getMetaDataEntry("color_code", default = self._extruders_model.defaultColors[0]) if material else self._extruders_model.defaultColors[0]
|
||||
if global_container_stack:
|
||||
material = global_container_stack.findContainer({ "type": "material" })
|
||||
material_color = material.getMetaDataEntry("color_code", default = self._extruders_model.defaultColors[0]) if material else self._extruders_model.defaultColors[0]
|
||||
else:
|
||||
material_color = self._extruders_model.defaultColors[0]
|
||||
else:
|
||||
# Get color to render this mesh in from ExtrudersModel
|
||||
extruder_index = 0
|
||||
|
|
|
@ -186,7 +186,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
return
|
||||
|
||||
programmer = stk500v2.Stk500v2()
|
||||
programmer.progressCallback = self.setProgress
|
||||
programmer.progress_callback = self.setProgress
|
||||
|
||||
try:
|
||||
programmer.connect(self._serial_port)
|
||||
|
@ -307,7 +307,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
self.setConnectionState(ConnectionState.connected)
|
||||
self._listen_thread.start() # Start listening
|
||||
Logger.log("i", "Established printer connection on port %s" % self._serial_port)
|
||||
return
|
||||
return
|
||||
|
||||
self._sendCommand("M105") # Send M105 as long as we are listening, otherwise we end up in an undefined state
|
||||
|
||||
|
@ -335,7 +335,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
self._connect_thread = threading.Thread(target = self._connect)
|
||||
self._connect_thread.daemon = True
|
||||
|
||||
|
||||
self.setConnectionState(ConnectionState.closed)
|
||||
if self._serial is not None:
|
||||
try:
|
||||
|
@ -564,7 +564,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
ret = self._serial.readline()
|
||||
except Exception as e:
|
||||
Logger.log("e", "Unexpected error while reading serial port. %s" % e)
|
||||
self._setErrorState("Printer has been disconnected")
|
||||
self._setErrorState("Printer has been disconnected")
|
||||
self.close()
|
||||
return None
|
||||
return ret
|
||||
|
|
|
@ -20,8 +20,8 @@ class Stk500v2(ispBase.IspBase):
|
|||
self.serial = None
|
||||
self.seq = 1
|
||||
self.last_addr = -1
|
||||
self.progressCallback = None
|
||||
|
||||
self.progress_callback = None
|
||||
|
||||
def connect(self, port = "COM22", speed = 115200):
|
||||
if self.serial is not None:
|
||||
self.close()
|
||||
|
@ -69,7 +69,7 @@ class Stk500v2(ispBase.IspBase):
|
|||
self.serial = None
|
||||
return ret
|
||||
return None
|
||||
|
||||
|
||||
def isConnected(self):
|
||||
return self.serial is not None
|
||||
|
||||
|
@ -79,7 +79,7 @@ class Stk500v2(ispBase.IspBase):
|
|||
def sendISP(self, data):
|
||||
recv = self.sendMessage([0x1D, 4, 4, 0, data[0], data[1], data[2], data[3]])
|
||||
return recv[2:6]
|
||||
|
||||
|
||||
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
|
||||
page_size = self.chip["pageSize"] * 2
|
||||
|
@ -89,15 +89,15 @@ class Stk500v2(ispBase.IspBase):
|
|||
self.sendMessage([0x06, 0x80, 0x00, 0x00, 0x00])
|
||||
else:
|
||||
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)):
|
||||
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:
|
||||
self.progressCallback(i + 1, load_count)
|
||||
self.progress_callback(i + 1, load_count)
|
||||
else:
|
||||
self.progressCallback(i + 1, load_count * 2)
|
||||
|
||||
self.progress_callback(i + 1, load_count * 2)
|
||||
|
||||
def verifyFlash(self, flash_data):
|
||||
if self._has_checksum:
|
||||
self.sendMessage([0x06, 0x00, (len(flash_data) >> 17) & 0xFF, (len(flash_data) >> 9) & 0xFF, (len(flash_data) >> 1) & 0xFF])
|
||||
|
@ -120,8 +120,8 @@ class Stk500v2(ispBase.IspBase):
|
|||
load_count = (len(flash_data) + 0xFF) / 0x100
|
||||
for i in range(0, int(load_count)):
|
||||
recv = self.sendMessage([0x14, 0x01, 0x00, 0x20])[2:0x102]
|
||||
if self.progressCallback is not None:
|
||||
self.progressCallback(load_count + i + 1, load_count * 2)
|
||||
if self.progress_callback is not None:
|
||||
self.progress_callback(load_count + i + 1, load_count * 2)
|
||||
for j in range(0, 0x100):
|
||||
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))
|
||||
|
@ -141,7 +141,7 @@ class Stk500v2(ispBase.IspBase):
|
|||
raise ispBase.IspError("Serial send timeout")
|
||||
self.seq = (self.seq + 1) & 0xFF
|
||||
return self.recvMessage()
|
||||
|
||||
|
||||
def recvMessage(self):
|
||||
state = "Start"
|
||||
checksum = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue