mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 20:19:32 +08:00
Added missing time/date completed
CL-541
This commit is contained in:
parent
70cfbf0180
commit
a49d3dbd8e
@ -18,7 +18,7 @@ from PyQt5.QtGui import QDesktopServices
|
|||||||
from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty
|
from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty
|
||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
|
from datetime import datetime
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -171,6 +171,19 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
def formatDuration(self, seconds):
|
def formatDuration(self, seconds):
|
||||||
return Duration(seconds).getDisplayString(DurationFormat.Format.Short)
|
return Duration(seconds).getDisplayString(DurationFormat.Format.Short)
|
||||||
|
|
||||||
|
@pyqtSlot(int, result=str)
|
||||||
|
def getTimeCompleted(self, time_remaining):
|
||||||
|
current_time = time()
|
||||||
|
datetime_completed = datetime.fromtimestamp(current_time + time_remaining)
|
||||||
|
return "{hour:02d}:{minute:02d}".format(hour=datetime_completed.hour, minute=datetime_completed.minute)
|
||||||
|
|
||||||
|
@pyqtSlot(int, result=str)
|
||||||
|
def getDateCompleted(self, time_remaining):
|
||||||
|
current_time = time()
|
||||||
|
datetime_completed = datetime.fromtimestamp(current_time + time_remaining)
|
||||||
|
|
||||||
|
return (datetime_completed.strftime("%a %b ") + "{day}".format(day=datetime_completed.day)).upper()
|
||||||
|
|
||||||
def _update(self):
|
def _update(self):
|
||||||
if not super()._update():
|
if not super()._update():
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user