mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 03:46:05 +08:00
Merge pull request #13131 from Ultimaker/CURA-9422_monitor_for_abstract_type
[CURA-9422] 'Monitor page' for abstract printer types
This commit is contained in:
commit
6de9079a2c
@ -530,6 +530,10 @@ class MachineManager(QObject):
|
|||||||
def printerConnected(self) -> bool:
|
def printerConnected(self) -> bool:
|
||||||
return bool(self._printer_output_devices)
|
return bool(self._printer_output_devices)
|
||||||
|
|
||||||
|
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||||
|
def activeMachineIsAbstract(self) -> bool:
|
||||||
|
return (self.activeMachine is not None) and parseBool(self.activeMachine.getMetaDataEntry("is_abstract_machine", False))
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||||
def activeMachineIsGroup(self) -> bool:
|
def activeMachineIsGroup(self) -> bool:
|
||||||
if self.activeMachine is None:
|
if self.activeMachine is None:
|
||||||
@ -554,6 +558,8 @@ class MachineManager(QObject):
|
|||||||
|
|
||||||
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||||
def activeMachineHasCloudRegistration(self) -> bool:
|
def activeMachineHasCloudRegistration(self) -> bool:
|
||||||
|
if self.activeMachineIsAbstract:
|
||||||
|
return any(m.getMetaDataEntry("is_online", False) for m in self.getMachinesWithDefinition(self.activeMachine.definition.getId(), True))
|
||||||
return self.activeMachine is not None and ConnectionType.CloudConnection in self.activeMachine.configuredConnectionTypes
|
return self.activeMachine is not None and ConnectionType.CloudConnection in self.activeMachine.configuredConnectionTypes
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||||
|
@ -12,6 +12,7 @@ Rectangle
|
|||||||
id: viewportOverlay
|
id: viewportOverlay
|
||||||
|
|
||||||
property bool isConnected: Cura.MachineManager.activeMachineHasNetworkConnection || Cura.MachineManager.activeMachineHasCloudConnection
|
property bool isConnected: Cura.MachineManager.activeMachineHasNetworkConnection || Cura.MachineManager.activeMachineHasCloudConnection
|
||||||
|
property bool isAbstractCloudPrinter: Cura.MachineManager.activeMachineIsAbstract
|
||||||
property bool isNetworkConfigurable:
|
property bool isNetworkConfigurable:
|
||||||
{
|
{
|
||||||
if(Cura.MachineManager.activeMachine === null)
|
if(Cura.MachineManager.activeMachine === null)
|
||||||
@ -96,7 +97,7 @@ Rectangle
|
|||||||
{
|
{
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
visible: isNetworkConfigured && !isConnected
|
visible: isNetworkConfigured && !isConnected && !isAbstractCloudPrinter
|
||||||
text: catalog.i18nc("@info", "Please make sure your printer has a connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network.\n- Check if you are signed in to discover cloud-connected printers.")
|
text: catalog.i18nc("@info", "Please make sure your printer has a connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network.\n- Check if you are signed in to discover cloud-connected printers.")
|
||||||
font: UM.Theme.getFont("medium")
|
font: UM.Theme.getFont("medium")
|
||||||
width: contentWidth
|
width: contentWidth
|
||||||
@ -109,18 +110,62 @@ Rectangle
|
|||||||
{
|
{
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
visible: !isNetworkConfigured && isNetworkConfigurable
|
visible: !isNetworkConfigured && isNetworkConfigurable && !isAbstractCloudPrinter
|
||||||
text: catalog.i18nc("@info", "Please connect your printer to the network.")
|
text: catalog.i18nc("@info", "Please connect your printer to the network.")
|
||||||
font: UM.Theme.getFont("medium")
|
font: UM.Theme.getFont("medium")
|
||||||
width: contentWidth
|
width: contentWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle
|
||||||
|
{
|
||||||
|
id: sendToFactoryCard
|
||||||
|
color: UM.Theme.getColor("detail_background")
|
||||||
|
height: childrenRect.height + UM.Theme.getSize("default_margin").height * 2
|
||||||
|
width: childrenRect.width + UM.Theme.getSize("wide_margin").width * 2
|
||||||
|
Column
|
||||||
|
{
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: UM.Theme.getSize("wide_margin").height
|
||||||
|
padding: UM.Theme.getSize("default_margin").width
|
||||||
|
topPadding: 0
|
||||||
|
|
||||||
|
Image
|
||||||
|
{
|
||||||
|
id: sendToFactoryImage
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
source: UM.Theme.getImage("first_run_ultimaker_cloud")
|
||||||
|
}
|
||||||
|
|
||||||
|
UM.Label
|
||||||
|
{
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
visible: isAbstractCloudPrinter
|
||||||
|
text: catalog.i18nc("@info", "Monitor your printers from everywhere using Ultimaker Digital Factory")
|
||||||
|
font: UM.Theme.getFont("medium")
|
||||||
|
width: sendToFactoryImage.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Cura.PrimaryButton
|
||||||
|
{
|
||||||
|
id: sendToFactoryButton
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
text: catalog.i18nc("@button", "View printers in Digital Factory")
|
||||||
|
onClicked: Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/print-jobs?utm_source=cura&utm_medium=software&utm_campaign=monitor-view-cloud-printer-type")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
left: noNetworkLabel.left
|
left: noNetworkLabel.left
|
||||||
}
|
}
|
||||||
visible: !isNetworkConfigured && isNetworkConfigurable
|
visible: !isNetworkConfigured && isNetworkConfigurable && !isAbstractCloudPrinter
|
||||||
width: childrenRect.width
|
width: childrenRect.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user