mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 14:29:03 +08:00
tmp
This commit is contained in:
parent
a6a3602840
commit
51405ca0f7
@ -105,15 +105,6 @@ Rectangle
|
||||
anchors.topMargin: visible ? UM.Theme.getSize("sidebar_margin").height : 0
|
||||
}
|
||||
|
||||
onCurrentModeIndexChanged:
|
||||
{
|
||||
UM.Preferences.setValue("cura/active_mode", currentModeIndex);
|
||||
if(modesListModel.count > base.currentModeIndex)
|
||||
{
|
||||
sidebarContents.push({ "item": modesListModel.get(base.currentModeIndex).item, "replace": true });
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: settingsModeLabel
|
||||
text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox","Print Setup disabled\nG-code files cannot be modified");
|
||||
|
65
resources/qml/Sidebar/PrinterOutput.qml
Normal file
65
resources/qml/Sidebar/PrinterOutput.qml
Normal file
@ -0,0 +1,65 @@
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
{
|
||||
id: printerOutputSection
|
||||
|
||||
UM.I18nCatalog {
|
||||
id: catalog
|
||||
name: "cura"
|
||||
}
|
||||
|
||||
color: UM.Theme.getColor("sidebar")
|
||||
|
||||
// status
|
||||
property bool isMonitoring: false
|
||||
|
||||
// printer data
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
property int backendState: UM.Backend.state
|
||||
|
||||
// print job data
|
||||
property variant printDuration: PrintInformation.currentPrintTime
|
||||
property variant printMaterialLengths: PrintInformation.materialLengths
|
||||
property variant printMaterialWeights: PrintInformation.materialWeights
|
||||
property variant printMaterialCosts: PrintInformation.materialCosts
|
||||
property variant printMaterialNames: PrintInformation.materialNames
|
||||
|
||||
// helper function for padding pretty time
|
||||
function strPadLeft(string, pad, length) {
|
||||
return (new Array(length + 1).join(pad) + string).slice(-length);
|
||||
}
|
||||
|
||||
// convert a timestamp to a human readable pretty time
|
||||
function getPrettyTime (time) {
|
||||
var hours = Math.floor(time / 3600)
|
||||
time -= hours * 3600
|
||||
var minutes = Math.floor(time / 60)
|
||||
time -= minutes * 60
|
||||
var seconds = Math.floor(time)
|
||||
var finalTime = strPadLeft(hours, "0", 2) + ":" + strPadLeft(minutes, "0", 2) + ":" + strPadLeft(seconds, "0", 2)
|
||||
return finalTime
|
||||
}
|
||||
|
||||
// TODO: change name of this component
|
||||
MonitorButton
|
||||
{
|
||||
id: monitorButton
|
||||
implicitWidth: base.width
|
||||
anchors.top: footerSeparator.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
|
||||
anchors.bottom: parent.bottom
|
||||
visible: monitoringPrint
|
||||
}
|
||||
}
|
0
resources/qml/Sidebar/Settings.qml
Normal file
0
resources/qml/Sidebar/Settings.qml
Normal file
Loading…
x
Reference in New Issue
Block a user