Merge branch '15.10'

* 15.10: (39 commits)
  Remove unused import in StartSliceJob
  conforming to code style
  fix typo's..
  Adjust initial view to be slightly from the side
  uses a different method to check whether a machine name excists
  Sets the languageComboBox to the default language
  Remove per-group settings for now
  Make sure to send all settings when an object overrides the profile
  Properly emit writeStarted in RemovableDriveOutputDevice
  Add xy_offset setting to list of settings that trigger a disallowed area update
  Properly trigger a reslice when the active instance is changed
  Wizardpages without hack
  Only hides the window when there are no more pages
  Only add layer data node after all processing
  Also account for "xy_offset" setting for the disallowed areas
  JSON: workaround for stutter in spiralize vase: set travel speed to printing speed
  Adds a color for the error-messages
  Shows an error message when a user tries to add a printer with a name that already excists.
  JSON: support bottom stair step height defaults changed so that the bottom distance to the model isn't violated too much
  Try to use Protobuf CPP implementation if it is available
  ...
This commit is contained in:
Arjen Hiemstra 2015-11-13 11:31:29 +01:00
commit 751f58fb02
24 changed files with 593 additions and 263 deletions

View file

@ -140,7 +140,7 @@
"unit": "mm",
"type": "float",
"default": 0.1,
"min_value": "0.0001",
"min_value": "0.001",
"min_value_warning": "0.04",
"max_value_warning": "0.32"
},
@ -150,7 +150,7 @@
"unit": "mm",
"type": "float",
"default": 0.3,
"min_value": "0.0001",
"min_value": "0.001",
"min_value_warning": "0.04",
"max_value_warning": "0.32",
"visible": false
@ -821,7 +821,8 @@
"type": "float",
"min_value": "0.1",
"max_value_warning": "300",
"default": 150
"default": 150,
"inherit_function": "speed_print if magic_spiralize else 150"
},
"speed_layer_0": {
"label": "Bottom Layer Speed",

View file

@ -567,7 +567,7 @@ UM.MainWindow
addMachine.onTriggered: addMachineWizard.visible = true;
preferences.onTriggered: { preferences.visible = true; }
preferences.onTriggered: { preferences.visible = true; preferences.setPage(0); }
configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(3); }
manageProfiles.onTriggered: { preferences.visible = true; preferences.setPage(4); }

View file

@ -13,6 +13,18 @@ UM.PreferencesPage
//: General configuration page title
title: catalog.i18nc("@title:tab","General");
function setDefaultLanguage(languageCode)
{
//loops trough the languageList and sets the language using the languageCode
for(var i = 0; i < languageList.count; i++)
{
if (languageComboBox.model.get(i).code == languageCode)
{
languageComboBox.currentIndex = i
}
}
}
function reset()
{
UM.Preferences.resetPreference("general/language")
@ -22,7 +34,8 @@ UM.PreferencesPage
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
scaleToFitCheckbox.checked = boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
languageComboBox.currentIndex = 0
var defaultLanguage = UM.Preferences.getValue("general/language")
setDefaultLanguage(defaultLanguage)
}
GridLayout

View file

@ -7,8 +7,6 @@ import QtQuick.Window 2.1
import QtQuick.Controls.Styles 1.1
import UM 1.1 as UM
import Cura 1.0 as Cura
import ".."
Item
{
@ -18,18 +16,69 @@ Item
property variant wizard: null;
property bool visibility: base.wizard.visible
onVisibilityChanged:
{
machineName.text = getMachineName()
errorMessage.show = false
}
function editMachineName(word)
{
//Adds '#2' at the end or increases the number by 1 if the word ends with '#' and 1 or more digits
var regEx = /[#][\d]+$///ends with '#' and then 1 or more digit
var result = word.match(regEx)
if (result != null)
{
result = result[0].split('')
var numberString = ''
for (var i = 1; i < result.length; i++){//starting at 1, makes it ignore the '#'
numberString += result[i]
}
var newNumber = Number(numberString) + 1
var newWord = word.replace(/[\d]+$/, newNumber)//replaces the last digits in the string by the same number + 1
return newWord
}
else {
return word + ' #2'
}
}
function getMachineName()
{
var name = machineList.model.getItem(machineList.currentIndex).name
//if the automatically assigned name is not unique, the editMachineName function keeps editing it untill it is.
while (UM.MachineManager.checkInstanceExists(name) != false)
{
name = editMachineName(name)
}
return name
}
Connections
{
target: base.wizard
onNextClicked: //You can add functions here that get triggered when the final button is clicked in the wizard-element
{
var old_page_count = base.wizard.getPageCount()
// Delete old pages (if any)
for (var i = old_page_count - 1; i > 0; i--)
var name = machineName.text
if (UM.MachineManager.checkInstanceExists(name) != false)
{
base.wizard.removePage(i)
errorMessage.show = true
}
else
{
var old_page_count = base.wizard.getPageCount()
// Delete old pages (if any)
for (var i = old_page_count - 1; i > 0; i--)
{
base.wizard.removePage(i)
}
saveMachine()
}
saveMachine()
}
onBackClicked:
{
@ -63,7 +112,8 @@ Item
{
id: machinesHolder
anchors{
anchors
{
left: parent.left;
top: subTitle.bottom;
right: parent.right;
@ -110,6 +160,7 @@ Item
onClicked: {
base.activeManufacturer = section;
machineList.currentIndex = machineList.model.find("manufacturer", section)
machineName.text = getMachineName()
}
}
@ -128,7 +179,10 @@ Item
text: model.name
onClicked: ListView.view.currentIndex = index;
onClicked: {
ListView.view.currentIndex = index;
machineName.text = getMachineName()
}
Label
{
@ -169,11 +223,33 @@ Item
}
}
Item
Column
{
id: machineNameHolder
height: childrenRect.height
anchors.bottom: parent.bottom;
//height: insertNameLabel.lineHeight * (2 + errorMessage.lineCount)
Item
{
height: errorMessage.lineHeight
anchors.bottom: insertNameLabel.top
anchors.bottomMargin: insertNameLabel.height * errorMessage.lineCount
Label
{
id: errorMessage
property bool show: false
width: base.width
height: errorMessage.show ? errorMessage.lineHeight : 0
visible: errorMessage.show
text: catalog.i18nc("@label", "This printer name has already been used. Please choose a different printer name.");
wrapMode: Text.WordWrap
Behavior on height {NumberAnimation {duration: 75; }}
color: UM.Theme.colors.error
}
}
Label
{
id: insertNameLabel
@ -182,8 +258,7 @@ Item
TextField
{
id: machineName;
anchors.top: insertNameLabel.bottom
text: machineList.model.getItem(machineList.currentIndex).name
text: getMachineName()
implicitWidth: UM.Theme.sizes.standard_list_input.width
}
}
@ -218,6 +293,9 @@ Item
break;
}
}
if(base.wizard.lastPage == true){
base.wizard.visible = false
}
}
}

View file

@ -7,6 +7,8 @@ import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import UM 1.1 as UM
import Cura 1.0 as Cura
import ".."
Item
{
@ -15,11 +17,22 @@ Item
property bool three_point_leveling: true
property int platform_width: UM.MachineManager.getSettingValue("machine_width")
property int platform_height: UM.MachineManager.getSettingValue("machine_depth")
property bool alreadyTested: base.addOriginalProgress.bedLeveling
anchors.fill: parent;
property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer
Component.onCompleted: printer_connection.homeHead()
UM.I18nCatalog { id: catalog; name:"cura"}
property variant wizard: null;
Connections
{
target: wizardPage.wizard
onNextClicked: //You can add functions here that get triggered when the final button is clicked in the wizard-element
{
if(wizardPage.wizard.lastPage == true){
wizardPage.wizard.visible = false
}
}
}
Label
{
@ -61,7 +74,6 @@ Item
id: bedlevelingButton
anchors.top: parent.top
anchors.left: parent.left
enabled: !alreadyTested
text: catalog.i18nc("@action:button","Move to Next Position");
onClicked:
{
@ -79,7 +91,6 @@ Item
}
wizardPage.leveling_state++
if (wizardPage.leveling_state >= 3){
base.addOriginalProgress.bedLeveling = true
resultText.visible = true
skipBedlevelingButton.enabled = false
bedlevelingButton.enabled = false
@ -91,7 +102,6 @@ Item
Button
{
id: skipBedlevelingButton
enabled: !alreadyTested
anchors.top: parent.width < wizardPage.width ? parent.top : bedlevelingButton.bottom
anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.sizes.default_margin.height/2
anchors.left: parent.width < wizardPage.width ? bedlevelingButton.right : parent.left
@ -104,13 +114,13 @@ Item
Label
{
id: resultText
visible: alreadyTested
visible: false
anchors.top: bedlevelingWrapper.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
width: parent.width
wrapMode: Text.WordWrap
text: catalog.i18nc("@label", "Everythink is in order! You're done with bedeleveling.")
text: catalog.i18nc("@label", "Everything is in order! You're done with bedleveling.")
}
function threePointLeveling(width, height)

View file

@ -17,11 +17,8 @@ Item
Component.onDestruction:
{
base.addOriginalProgress.upgrades[0] = extruderCheckBox.checked
base.addOriginalProgress.upgrades[1] = heatedBedCheckBox1.checked
base.addOriginalProgress.upgrades[2] = heatedBedCheckBox2.checked
if (extruderCheckBox.checked == true){
UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true);
UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true)
}
if (heatedBedCheckBox1.checked == true || heatedBedCheckBox2.checked == true){
UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
@ -58,14 +55,14 @@ Item
{
id: extruderCheckBox
text: catalog.i18nc("@option:check","Extruder driver ugrades")
checked: base.addOriginalProgress.upgrades[0]
checked: true
}
CheckBox
{
id: heatedBedCheckBox1
text: catalog.i18nc("@option:check","Heated printer bed (standard kit)")
text: catalog.i18nc("@option:check","Heated printer bed")
y: extruderCheckBox.height * 1
checked: base.addOriginalProgress.upgrades[1]
checked: false
onClicked: {
if (heatedBedCheckBox2.checked == true)
heatedBedCheckBox2.checked = false
@ -76,7 +73,7 @@ Item
id: heatedBedCheckBox2
text: catalog.i18nc("@option:check","Heated printer bed (self built)")
y: extruderCheckBox.height * 2
checked: base.addOriginalProgress.upgrades[2]
checked: false
onClicked: {
if (heatedBedCheckBox1.checked == true)
heatedBedCheckBox1.checked = false

View file

@ -14,35 +14,40 @@ Item
property int leftRow: wizardPage.width*0.40
property int rightRow: wizardPage.width*0.60
anchors.fill: parent;
property bool alreadyTested: base.addOriginalProgress.checkUp[base.addOriginalProgress.checkUp.length-1]
property bool x_min_pressed: false
property bool y_min_pressed: false
property bool z_min_pressed: false
property bool heater_works: false
property int extruder_target_temp: 0
property int bed_target_temp: 0
UM.I18nCatalog { id: catalog; name:"cura"}
property var checkupProgress: {
"connection": false,
"endstopX": wizardPage.x_min_pressed,
"endstopY": wizardPage.y_min_pressed,
"endstopZ": wizardPage.z_min_pressed,
"nozzleTemp": false,
"bedTemp": false
}
property variant printer_connection: {
if (UM.USBPrinterManager.connectedPrinterList.rowCount() != 0){
base.addOriginalProgress.checkUp[0] = true
checkTotalCheckUp()
wizardPage.checkupProgress.connection = true
return UM.USBPrinterManager.connectedPrinterList.getItem(0).printer
}
else {
return null
}
}
//property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer
UM.I18nCatalog { id: catalog; name:"cura"}
function checkTotalCheckUp(){
var allDone = true
for (var i = 0; i < (base.addOriginalProgress.checkUp.length - 1); i++){
if (base.addOriginalProgress.checkUp[i] == false){
for(var property in checkupProgress){
if (checkupProgress[property] == false){
allDone = false
}
}
if (allDone == true){
base.addOriginalProgress.checkUp[base.addOriginalProgress.checkUp.length] = true
skipCheckButton.enabled = false
resultText.visible = true
}
@ -91,7 +96,7 @@ Item
id: startCheckButton
anchors.top: parent.top
anchors.left: parent.left
enabled: !alreadyTested
//enabled: !alreadyTested
text: catalog.i18nc("@action:button","Start Printer Check");
onClicked: {
checkupContent.visible = true
@ -107,7 +112,7 @@ Item
anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.sizes.default_margin.height/2
anchors.left: parent.width < wizardPage.width ? startCheckButton.right : parent.left
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.sizes.default_margin.width : 0
enabled: !alreadyTested
//enabled: !alreadyTested
text: catalog.i18nc("@action:button","Skip Printer Check");
onClicked: {
base.currentPage += 1
@ -119,7 +124,7 @@ Item
id: checkupContent
anchors.top: startStopButtons.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
visible: alreadyTested
visible: false
//////////////////////////////////////////////////////////
Label
{
@ -156,7 +161,7 @@ Item
anchors.left: endstopXLabel.right
anchors.top: connectionLabel.bottom
wrapMode: Text.WordWrap
text: x_min_pressed || base.addOriginalProgress.checkUp[1] ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
text: x_min_pressed ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
}
//////////////////////////////////////////////////////////////
Label
@ -175,7 +180,7 @@ Item
anchors.left: endstopYLabel.right
anchors.top: endstopXLabel.bottom
wrapMode: Text.WordWrap
text: y_min_pressed || base.addOriginalProgress.checkUp[2] ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
text: y_min_pressed ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
}
/////////////////////////////////////////////////////////////////////
Label
@ -194,7 +199,7 @@ Item
anchors.left: endstopZLabel.right
anchors.top: endstopYLabel.bottom
wrapMode: Text.WordWrap
text: z_min_pressed || base.addOriginalProgress.checkUp[3] ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
text: z_min_pressed ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
}
////////////////////////////////////////////////////////////
Label
@ -233,14 +238,9 @@ Item
{
if(printer_connection != null)
{
if (alreadyTested){
nozzleTempStatus.text = catalog.i18nc("@info:status","Works")
}
else {
nozzleTempStatus.text = catalog.i18nc("@info:progress","Checking")
printer_connection.heatupNozzle(190)
wizardPage.extruder_target_temp = 190
}
nozzleTempStatus.text = catalog.i18nc("@info:progress","Checking")
printer_connection.heatupNozzle(190)
wizardPage.extruder_target_temp = 190
}
}
}
@ -294,14 +294,9 @@ Item
{
if(printer_connection != null)
{
if (alreadyTested){
bedTempStatus.text = catalog.i18nc("@info:status","Works")
}
else {
bedTempStatus.text = catalog.i18nc("@info:progress","Checking")
printer_connection.heatupBed(60)
wizardPage.bed_target_temp = 60
}
bedTempStatus.text = catalog.i18nc("@info:progress","Checking")
printer_connection.heatupBed(60)
wizardPage.bed_target_temp = 60
}
}
}
@ -320,7 +315,7 @@ Item
Label
{
id: resultText
visible: base.addOriginalProgress.checkUp[base.addOriginalProgress.checkUp.length-1]
visible: false
anchors.top: bedTemp.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
@ -338,19 +333,16 @@ Item
{
if(key == "x_min")
{
base.addOriginalProgress.checkUp[1] = true
x_min_pressed = true
checkTotalCheckUp()
}
if(key == "y_min")
{
base.addOriginalProgress.checkUp[2] = true
y_min_pressed = true
checkTotalCheckUp()
}
if(key == "z_min")
{
base.addOriginalProgress.checkUp[3] = true
z_min_pressed = true
checkTotalCheckUp()
}
@ -363,7 +355,7 @@ Item
if(printer_connection != null)
{
nozzleTempStatus.text = catalog.i18nc("@info:status","Works")
base.addOriginalProgress.checkUp[4] = true
wizardPage.checkupProgress.nozzleTemp = true
checkTotalCheckUp()
printer_connection.heatupNozzle(0)
}
@ -374,7 +366,7 @@ Item
if(printer_connection.bedTemperature > wizardPage.bed_target_temp - 5 && printer_connection.bedTemperature < wizardPage.bed_target_temp + 5)
{
bedTempStatus.text = catalog.i18nc("@info:status","Works")
base.addOriginalProgress.checkUp[5] = true
wizardPage.checkupProgress.bedTemp = true
checkTotalCheckUp()
printer_connection.heatupBed(0)
}

View file

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="415.582px"
height="415.582px"
viewBox="0 0 415.582 415.582"
style="enable-background:new 0 0 415.582 415.582;"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="check.svg"><metadata
id="metadata11"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs9" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1134"
id="namedview7"
showgrid="false"
inkscape:zoom="1.61"
inkscape:cx="211.31288"
inkscape:cy="137.35337"
inkscape:window-x="1440"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><g
id="g3"><path
d="m 411.47,96.426 -34.319,-34.32 c -5.48192,-5.482079 -14.34421,-5.455083 -19.853,0 L 152.348,265.058 56.282,174.994 c -5.48,-5.482 -14.37,-5.482 -19.851,0 l -32.319,32.32 c -5.482,5.481 -5.482,14.37 0,19.852 l 138.311,138.31 c 2.741,2.742 6.334,4.112 9.926,4.112 3.593,0 7.186,-1.37 9.926,-4.112 L 411.47,116.277 c 2.633,-2.632 4.111,-6.203 4.111,-9.925 10e-4,-3.724 -1.47804,-7.29296 -4.111,-9.926 z"
id="path5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sssccccscscccs" /></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -66,6 +66,7 @@
"text_hover": [35, 35, 35, 255],
"text_pressed": [12, 169, 227, 255],
"error": [255, 140, 0, 255],
"sidebar_header_bar": [12, 169, 227, 255],
"button": [139, 143, 153, 255],