This commit is contained in:
Tim Kuipers 2015-08-31 14:32:21 +02:00
commit 5cbeed753c
9 changed files with 262 additions and 70 deletions

View File

@ -85,6 +85,7 @@ class CuraApplication(QtApplication):
Preferences.getInstance().addPreference("cura/recent_files", "") Preferences.getInstance().addPreference("cura/recent_files", "")
Preferences.getInstance().addPreference("cura/categories_expanded", "") Preferences.getInstance().addPreference("cura/categories_expanded", "")
Preferences.getInstance().addPreference("view/center_on_select", True) Preferences.getInstance().addPreference("view/center_on_select", True)
Preferences.getInstance().addPreference("mesh/scale_to_fit", True)
JobQueue.getInstance().jobFinished.connect(self._onJobFinished) JobQueue.getInstance().jobFinished.connect(self._onJobFinished)

View File

@ -6,7 +6,6 @@ from PyQt5.QtCore import QTimer
from UM.Scene.SceneNode import SceneNode from UM.Scene.SceneNode import SceneNode
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
from UM.Operations.TranslateOperation import TranslateOperation from UM.Operations.TranslateOperation import TranslateOperation
from UM.Operations.ScaleToBoundsOperation import ScaleToBoundsOperation
from UM.Math.Float import Float from UM.Math.Float import Float
from UM.Math.Vector import Vector from UM.Math.Vector import Vector
from UM.Math.AxisAlignedBox import AxisAlignedBox from UM.Math.AxisAlignedBox import AxisAlignedBox

View File

@ -0,0 +1,98 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.i18n import i18nCatalog
from UM.Extension import Extension
from UM.Preferences import Preferences
from UM.Application import Application
from UM.PluginRegistry import PluginRegistry
from UM.Version import Version
from PyQt5.QtQuick import QQuickView
from PyQt5.QtQml import QQmlComponent, QQmlContext
from PyQt5.QtCore import QUrl, pyqtSlot, QObject
import os.path
catalog = i18nCatalog("cura")
class ChangeLog(Extension, QObject,):
def __init__(self, parent = None):
QObject.__init__(self, parent)
Extension.__init__(self)
self._changelog_window = None
self._changelog_context = None
version_string = Application.getInstance().getVersion()
if version_string is not "master":
self._version = Version(version_string)
else:
self._version = None
self._change_logs = None
Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
Preferences.getInstance().addPreference("general/latest_version_changelog_shown", "15.05.90") #First version of CURA with uranium
#self.showChangelog()
def getChangeLogs(self):
if not self._change_logs:
self.loadChangeLogs()
return self._change_logs
@pyqtSlot(result = str)
def getChangeLogString(self):
logs = self.getChangeLogs()
latest_version = Version(Preferences.getInstance().getValue("general/latest_version_changelog_shown"))
result = ""
for version in logs:
result += "<h1>" + str(version) + "</h1><br>"
result += ""
for change in logs[version]:
result += "<b>" + str(change) + "</b><br>"
for line in logs[version][change]:
result += str(line) + "<br>"
result += "<br>"
pass
return result
def loadChangeLogs(self):
self._change_logs = {}
with open(os.path.join(PluginRegistry.getInstance().getPluginPath("ChangeLogPlugin"), "ChangeLog.txt"), 'r') as f:
open_version = None
open_header = None
for line in f:
line = line.replace("\n","")
if "[" in line and "]" in line:
line = line.replace("[","")
line = line.replace("]","")
open_version = Version(line)
self._change_logs[Version(line)] = {}
elif line.startswith("*"):
open_header = line.replace("*","")
self._change_logs[open_version][open_header] = []
else:
if line != "":
self._change_logs[open_version][open_header].append(line)
def _onEngineCreated(self):
if not self._version:
return #We're on dev branch.
if self._version > Preferences.getInstance().getValue("general/latest_version_changelog_shown"):
self.showChangelog()
def showChangelog(self):
if not self._changelog_window:
self.createChangelogWindow()
self._changelog_window.show()
Preferences.getInstance().setValue("general/latest_version_changelog_shown", Application.getInstance().getVersion())
def hideChangelog(self):
if self._changelog_window:
self._changelog_window.hide()
def createChangelogWindow(self):
path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath("ChangeLogPlugin"), "ChangeLog.qml"))
component = QQmlComponent(Application.getInstance()._engine, path)
self._changelog_context = QQmlContext(Application.getInstance()._engine.rootContext())
self._changelog_context.setContextProperty("manager", self)
self._changelog_window = component.create(self._changelog_context)
#print(self._changelog_window)

View File

@ -0,0 +1,28 @@
// Copyright (c) 2015 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import UM 1.1 as UM
UM.Dialog
{
id: base
width: 300 * Screen.devicePixelRatio;
height: 500 * Screen.devicePixelRatio;
title: "Changelog"
ScrollView
{
anchors.fill:parent
Text
{
text: manager.getChangeLogString()
width:base.width - 35
wrapMode: Text.Wrap;
//Component.onCompleted: console.log()
}
}
}

View File

@ -0,0 +1,41 @@
[15.10.0]
*All at Once/One at a Time
Curas default mode is set to All At Once. You can print multiple objects faster with the option print objects One At A Time. This can be changed in Advanced Settings. Please note that in One At A Time mode, grouped objects will still be printed as a single object.
*Setting Profiles
Now you can create preferred setting favourites and share them with others.
*Post-Processing Plugin
This plugin supports post-processing on the GCode generated by the engine allowing for custom scripts. For example, Pause At Height and Tweak At Z.
*Support for Bed Levelling and other wizards
We have restored the Bed Levelling function and several other wizards that were previously available for the Ultimaker Original. Additionally, these are ready to be used with machines from other vendors (BQ, Rep Rap neo).
*Third-Party Printer Profiles
We received printer profiles for third-party vendors (BQ, Rep Rap neo) from the community (thanks guys!). These have been included in this release.
*3MF File Loading Support (New)
Were happy to report we now support loading 3MF files. This is a new file format similar to AMF, but freely available.
*Output Device API for Developers (New)
The Storage Device API has now been replaced with the Output Device API for saving files. Its designed to make it easier for anyone that wants to write a plugin giving them some form of output device, whether its a printer or a web service.
*Improved Cut-Off Object Bottom (New)
Weve added a feature than allows you to move objects below the build plate. You can either correct a model with a rough bottom, or print only a part of an object. Please note that the implementation greatly differs from the old one where it was a setting.
*Improved File Saving (new)
Were happy to report that the way file saving is handled has received a huge overhaul. Now the default action is to save everything on the build plate to a file.
*Select Multiple Objects (New)
You now have the freedom to select and manipulate multiple objects at the same time.
*Grouping (New)
You can now group objects together to make it easier to manipulate multiple objects.
*Per-Object Settings (New)
You can now select different profiles for different objects and in advance mode override individual settings.
*64-bit Windows Builds (New)
Cura now allows 64-bit Windows builds in addition to the 32-bit builds. For users running the 64-bit version of Windows, you can now load models in more detail.

View File

@ -0,0 +1,21 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.i18n import i18nCatalog
from . import ChangeLog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": "Change log",
"author": "Ultimaker",
"version": "1.0",
"description": catalog.i18nc("Change log plugin description", "Shows changes since latest checked version"),
"api": 2
}
}
def register(app):
return {"extension": ChangeLog.ChangeLog()}

View File

@ -17,9 +17,11 @@ UM.PreferencesPage
{ {
UM.Preferences.resetPreference("general/language") UM.Preferences.resetPreference("general/language")
UM.Preferences.resetPreference("physics/automatic_push_free") UM.Preferences.resetPreference("physics/automatic_push_free")
UM.Preferences.resetPreference("mesh/scale_to_fit")
UM.Preferences.resetPreference("info/send_slice_info") UM.Preferences.resetPreference("info/send_slice_info")
pushFreeCheckbox.checked = UM.Preferences.getValue("physics/automatic_push_free") pushFreeCheckbox.checked = UM.Preferences.getValue("physics/automatic_push_free")
sendDataCheckbox.checked = UM.Preferences.getValue("info/send_slice_info") sendDataCheckbox.checked = UM.Preferences.getValue("info/send_slice_info")
scaleToFitCheckbox.checked = UM.Preferences.getValue("mesh/scale_to_fit")
languageComboBox.currentIndex = 0 languageComboBox.currentIndex = 0
} }
GridLayout GridLayout
@ -163,6 +165,38 @@ UM.PreferencesPage
} }
} }
} }
CheckBox
{
id: scaleToFitCheckbox
checked: UM.Preferences.getValue("mesh/scale_to_fit")
onCheckedChanged: UM.Preferences.setValue("mesh/scale_to_fit", checked)
}
Button
{
id: scaleToFitText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
//: Display Overhang preference checkbox
text: catalog.i18nc("@action:checkbox","Scale loaded meshes when too large");
onClicked: scaleToFitCheckbox.checked = !scaleToFitCheckbox.checked
//: Display Overhang preference tooltip
tooltip: catalog.i18nc("@info:tooltip","Should loaded meshes be scaled to the max build volume if they are too large.")
style: ButtonStyle
{
background: Rectangle
{
border.width: 0
color: "transparent"
}
label: Text
{
renderType: Text.NativeRendering
horizontalAlignment: Text.AlignLeft
text: control.text
}
}
}
Item { Layout.fillHeight: true; Layout.columnSpan: 2 } Item { Layout.fillHeight: true; Layout.columnSpan: 2 }
} }
} }

View File

@ -8,8 +8,7 @@ import QtQuick.Layouts 1.1
import UM 1.1 as UM import UM 1.1 as UM
Rectangle Rectangle {
{
id: base; id: base;
property real progress: UM.Backend.progress; property real progress: UM.Backend.progress;
@ -17,34 +16,27 @@ Rectangle
Behavior on progress { NumberAnimation { duration: 250; } } Behavior on progress { NumberAnimation { duration: 250; } }
property int totalHeight: childrenRect.height property int totalHeight: childrenRect.height
UM.I18nCatalog { id: catalog; name:"cura"}
property variant printDuration: PrintInformation.currentPrintTime; property variant printDuration: PrintInformation.currentPrintTime;
property real printMaterialAmount: PrintInformation.materialAmount; property real printMaterialAmount: PrintInformation.materialAmount;
UM.I18nCatalog { id: catalog; name:"cura"}
Rectangle Rectangle{
{ id: printJobRow
id: background
implicitWidth: base.width; implicitWidth: base.width;
implicitHeight: parent.height; implicitHeight: UM.Theme.sizes.sidebar_header.height
color: UM.Theme.colors.save_button_background; anchors.top: parent.top
border.width: UM.Theme.sizes.save_button_border.width color: UM.Theme.colors.sidebar_header_bar
border.color: UM.Theme.colors.save_button_border Label{
id: printJobTextfieldLabel
Rectangle text: catalog.i18nc("@label","Printjob name");
{
id: infoBox
width: parent.width - UM.Theme.sizes.default_margin.width * 2;
height: UM.Theme.sizes.save_button_slicing_bar.height
anchors.top: parent.top
anchors.topMargin: UM.Theme.sizes.default_margin.height;
anchors.left: parent.left anchors.left: parent.left
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_white color: UM.Theme.colors.text_white
} }
TextField TextField {
{
id: printJobTextfield id: printJobTextfield
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width; anchors.rightMargin: UM.Theme.sizes.default_margin.width;
@ -53,23 +45,18 @@ Rectangle
height: UM.Theme.sizes.sidebar_inputFields.height height: UM.Theme.sizes.sidebar_inputFields.height
property int unremovableSpacing: 5 property int unremovableSpacing: 5
text: "UM2" + "_" + "filename" ///TODO KOMT NOG text: "UM2" + "_" + "filename" ///TODO KOMT NOG
onEditingFinished: onEditingFinished: {
{ if (printJobTextfield.text != ''){
if (printJobTextfield.text != '')
{
printJobTextfield.focus = false printJobTextfield.focus = false
} }
} }
validator: RegExpValidator validator: RegExpValidator {
{
regExp: /^[0-9a-zA-Z\_\-]*$/ regExp: /^[0-9a-zA-Z\_\-]*$/
} }
style: TextFieldStyle style: TextFieldStyle{
{
textColor: UM.Theme.colors.setting_control_text; textColor: UM.Theme.colors.setting_control_text;
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
background: Rectangle background: Rectangle {
{
radius: 0 radius: 0
implicitWidth: parent.width implicitWidth: parent.width
implicitHeight: parent.height implicitHeight: parent.height
@ -80,14 +67,12 @@ Rectangle
} }
} }
Rectangle Rectangle {
{
id: specsRow id: specsRow
implicitWidth: base.width implicitWidth: base.width
implicitHeight: UM.Theme.sizes.sidebar_specs_bar.height implicitHeight: UM.Theme.sizes.sidebar_specs_bar.height
anchors.top: printJobRow.bottom anchors.top: printJobRow.bottom
Item Item{
{
id: time id: time
width: (parent.width / 100 * 45) - UM.Theme.sizes.default_margin.width * 2 width: (parent.width / 100 * 45) - UM.Theme.sizes.default_margin.width * 2
height: parent.height height: parent.height
@ -95,8 +80,7 @@ Rectangle
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.top: parent.top anchors.top: parent.top
visible: base.printMaterialAmount > 0 ? true : false visible: base.printMaterialAmount > 0 ? true : false
UM.RecolorImage UM.RecolorImage {
{
id: timeIcon id: timeIcon
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
@ -107,26 +91,23 @@ Rectangle
color: UM.Theme.colors.text_hover color: UM.Theme.colors.text_hover
source: UM.Theme.icons.print_time; source: UM.Theme.icons.print_time;
} }
Label Label{
{
id: timeSpec id: timeSpec
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: timeIcon.right anchors.left: timeIcon.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2 anchors.leftMargin: UM.Theme.sizes.default_margin.width/2
font: UM.Theme.fonts.default font: UM.Theme.fonts.default
color: UM.Theme.colors.text color: UM.Theme.colors.text
text: (!base.printDuration || !base.printDuration.valid) ? "" : catalog.i18nc("@label","%1 h:m").arg(base.printDuration.getDisplayString(UM.DurationFormat.Short)) text: (!base.printDuration || !base.printDuration.valid) ? "" : catalog.i18nc("@label", "%1 m").arg(base.printDuration.getDisplayString(UM.DurationFormat.Short))
} }
} }
Item Item{
{
width: parent.width / 100 * 55 width: parent.width / 100 * 55
height: parent.height height: parent.height
anchors.left: time.right anchors.left: time.right
anchors.top: parent.top anchors.top: parent.top
visible: base.printMaterialAmount > 0 ? true : false visible: base.printMaterialAmount > 0 ? true : false
UM.RecolorImage UM.RecolorImage {
{
id: lengthIcon id: lengthIcon
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
@ -137,8 +118,7 @@ Rectangle
color: UM.Theme.colors.text_hover color: UM.Theme.colors.text_hover
source: UM.Theme.icons.category_material; source: UM.Theme.icons.category_material;
} }
Label Label{
{
id: lengthSpec id: lengthSpec
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: lengthIcon.right anchors.left: lengthIcon.right
@ -150,8 +130,7 @@ Rectangle
} }
} }
Item Item{
{
id: saveRow id: saveRow
implicitWidth: base.width / 100 * 55 implicitWidth: base.width / 100 * 55
implicitHeight: saveToButton.height + (UM.Theme.sizes.default_margin.height / 2) // height + bottomMargin implicitHeight: saveToButton.height + (UM.Theme.sizes.default_margin.height / 2) // height + bottomMargin
@ -159,8 +138,7 @@ Rectangle
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width anchors.rightMargin: UM.Theme.sizes.default_margin.width
Button Button {
{
id: saveToButton id: saveToButton
anchors.left: parent.left anchors.left: parent.left
tooltip: UM.OutputDeviceManager.activeDeviceDescription; tooltip: UM.OutputDeviceManager.activeDeviceDescription;
@ -171,15 +149,12 @@ Rectangle
text: UM.OutputDeviceManager.activeDeviceShortDescription; text: UM.OutputDeviceManager.activeDeviceShortDescription;
style: ButtonStyle style: ButtonStyle {
{ background: Rectangle {
background: Rectangle
{
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
Label Label {
{
anchors.centerIn: parent anchors.centerIn: parent
color: UM.Theme.colors.load_save_button_text color: UM.Theme.colors.load_save_button_text
font: UM.Theme.fonts.default font: UM.Theme.fonts.default
@ -191,10 +166,9 @@ Rectangle
onClicked: UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice) onClicked: UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice)
} }
Button Button {
{
id: deviceSelectionMenu; id: deviceSelectionMenu;
tooltip: catalog.i18nc("@action:button","Select the active output device"); tooltip: catalog.i18nc("@info:tooltip","Select the active output device");
anchors.right: parent.right anchors.right: parent.right
width: UM.Theme.sizes.save_button_save_to_button.height width: UM.Theme.sizes.save_button_save_to_button.height
height: UM.Theme.sizes.save_button_save_to_button.height height: UM.Theme.sizes.save_button_save_to_button.height
@ -225,20 +199,16 @@ Rectangle
label: Label{ } label: Label{ }
} }
menu: Menu menu: Menu {
{
id: devicesMenu; id: devicesMenu;
Instantiator Instantiator {
{
model: devicesModel; model: devicesModel;
MenuItem MenuItem {
{
text: model.description text: model.description
checkable: true; checkable: true;
checked: model.id == UM.OutputDeviceManager.activeDevice; checked: model.id == UM.OutputDeviceManager.activeDevice;
exclusiveGroup: devicesMenuGroup; exclusiveGroup: devicesMenuGroup;
onTriggered: onTriggered: {
{
UM.OutputDeviceManager.setActiveDevice(model.id); UM.OutputDeviceManager.setActiveDevice(model.id);
} }
} }

View File

@ -42,7 +42,7 @@ UM.PreferencesPage
onClicked: overhangCheckbox.checked = !overhangCheckbox.checked onClicked: overhangCheckbox.checked = !overhangCheckbox.checked
//: Display Overhang preference tooltip //: Display Overhang preference tooltip
tooltip: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly." tooltip: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly.")
style: ButtonStyle style: ButtonStyle
{ {