Calc3D_by_Risen/calc3dui.py
2024-12-08 14:58:25 +03:00

372 lines
21 KiB
Python

from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient,
QCursor, QFont, QFontDatabase, QGradient,
QIcon, QImage, QKeySequence, QLinearGradient,
QPainter, QPalette, QPixmap, QRadialGradient,
QTransform)
from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QHBoxLayout,
QLCDNumber, QLabel, QMainWindow, QMenu,
QMenuBar, QPlainTextEdit, QPushButton, QSizePolicy,
QWidget)
class Ui_Calc3DbyRisen(object):
def setupUi(self, Calc3DbyRisen):
if not Calc3DbyRisen.objectName():
Calc3DbyRisen.setObjectName(u"Calc3DbyRisen")
Calc3DbyRisen.resize(373, 471)
font = QFont()
font.setBold(True)
Calc3DbyRisen.setFont(font)
Calc3DbyRisen.setAcceptDrops(False)
icon = QIcon()
icon.addFile(u"img/logo-1.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
Calc3DbyRisen.setWindowIcon(icon)
Calc3DbyRisen.setAutoFillBackground(True)
Calc3DbyRisen.setStyleSheet(u"")
Calc3DbyRisen.setDockOptions(QMainWindow.AllowTabbedDocks|QMainWindow.AnimatedDocks)
self.check_update = QAction(Calc3DbyRisen)
self.check_update.setObjectName(u"check_update")
self.check_update.setCheckable(False)
self.formula = QAction(Calc3DbyRisen)
self.formula.setObjectName(u"formula")
self.about = QAction(Calc3DbyRisen)
self.about.setObjectName(u"about")
self.settings_2 = QAction(Calc3DbyRisen)
self.settings_2.setObjectName(u"settings_2")
self.add_printer = QAction(Calc3DbyRisen)
self.add_printer.setObjectName(u"add_printer")
self.edit_printer = QAction(Calc3DbyRisen)
self.edit_printer.setObjectName(u"edit_printer")
self.del_printer = QAction(Calc3DbyRisen)
self.del_printer.setObjectName(u"del_printer")
self.centralwidget = QWidget(Calc3DbyRisen)
self.centralwidget.setObjectName(u"centralwidget")
self.quantity = QLabel(self.centralwidget)
self.quantity.setObjectName(u"quantity")
self.quantity.setGeometry(QRect(20, 270, 171, 17))
font1 = QFont()
font1.setPointSize(10)
font1.setBold(True)
self.quantity.setFont(font1)
self.quantity.setStyleSheet(u"color: rgb(255, 255, 255);")
self.weight = QLabel(self.centralwidget)
self.weight.setObjectName(u"weight")
self.weight.setGeometry(QRect(20, 240, 101, 17))
self.weight.setFont(font1)
self.weight.setStyleSheet(u"color: rgb(255, 255, 255);")
self.time_print = QLabel(self.centralwidget)
self.time_print.setObjectName(u"time_print")
self.time_print.setGeometry(QRect(20, 210, 101, 17))
self.time_print.setFont(font1)
self.time_print.setStyleSheet(u"color: rgb(255, 255, 255);")
self.printer = QLabel(self.centralwidget)
self.printer.setObjectName(u"printer")
self.printer.setGeometry(QRect(21, 171, 81, 17))
self.printer.setFont(font1)
self.printer.setStyleSheet(u"color: rgb(255, 255, 255);")
self.printer_menu = QComboBox(self.centralwidget)
self.printer_menu.addItem("")
self.printer_menu.addItem("")
self.printer_menu.setObjectName(u"printer_menu")
self.printer_menu.setGeometry(QRect(181, 170, 171, 25))
self.printer_menu.setAcceptDrops(True)
self.printer_menu.setStyleSheet(u"alternate-background-color: rgb(77, 77, 77);")
self.printer_menu.setInsertPolicy(QComboBox.NoInsert)
self.lcd_result = QLCDNumber(self.centralwidget)
self.lcd_result.setObjectName(u"lcd_result")
self.lcd_result.setGeometry(QRect(20, 10, 301, 71))
self.lcd_result.setFont(font1)
self.lcd_result.setAutoFillBackground(False)
self.lcd_result.setStyleSheet(u"background-color: rgb(36, 36, 36);")
self.lcd_result.setFrameShape(QFrame.StyledPanel)
self.lcd_result.setFrameShadow(QFrame.Raised)
self.lcd_result.setDigitCount(10)
self.lcd_result.setSegmentStyle(QLCDNumber.Flat)
self.lcd_result_2 = QLCDNumber(self.centralwidget)
self.lcd_result_2.setObjectName(u"lcd_result_2")
self.lcd_result_2.setGeometry(QRect(180, 90, 141, 41))
self.lcd_result_2.setStyleSheet(u"background-color: rgb(36, 36, 36);")
self.lcd_result_2.setDigitCount(10)
self.lcd_result_2.setSegmentStyle(QLCDNumber.Flat)
self.cost_price = QLabel(self.centralwidget)
self.cost_price.setObjectName(u"cost_price")
self.cost_price.setGeometry(QRect(20, 110, 141, 17))
font2 = QFont()
font2.setPointSize(12)
font2.setBold(True)
self.cost_price.setFont(font2)
self.cost_price.setStyleSheet(u"color: rgb(255, 255, 255);")
self.input_hours = QPlainTextEdit(self.centralwidget)
self.input_hours.setObjectName(u"input_hours")
self.input_hours.setGeometry(QRect(180, 210, 51, 20))
sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.input_hours.sizePolicy().hasHeightForWidth())
self.input_hours.setSizePolicy(sizePolicy)
font3 = QFont()
font3.setPointSize(10)
font3.setBold(True)
font3.setStyleStrategy(QFont.PreferAntialias)
self.input_hours.setFont(font3)
self.input_hours.setAcceptDrops(False)
self.input_hours.setToolTipDuration(0)
self.input_hours.setAutoFillBackground(False)
self.input_hours.setStyleSheet(u"background-color: rgb(77, 77, 77);")
self.input_hours.setInputMethodHints(Qt.ImhDigitsOnly)
self.input_hours.setLineWidth(0)
self.input_hours.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.input_hours.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.input_hours.setUndoRedoEnabled(False)
self.input_hours.setLineWrapMode(QPlainTextEdit.NoWrap)
self.input_hours.setPlainText(u"")
self.input_hours.setTabStopDistance(80.000000000000000)
self.input_hours.setMaximumBlockCount(3)
self.input_hours.setCenterOnScroll(False)
self.input_hours.setPlaceholderText(u"0")
self.text_time_hours = QLabel(self.centralwidget)
self.text_time_hours.setObjectName(u"text_time_hours")
self.text_time_hours.setGeometry(QRect(240, 210, 21, 17))
self.text_time_hours.setFont(font1)
self.text_time_hours.setStyleSheet(u"color: rgb(255, 255, 255);")
self.input_minutes = QPlainTextEdit(self.centralwidget)
self.input_minutes.setObjectName(u"input_minutes")
self.input_minutes.setGeometry(QRect(260, 210, 51, 21))
self.input_minutes.setAcceptDrops(False)
self.input_minutes.setStyleSheet(u"background-color: rgb(77, 77, 77);")
self.input_minutes.setInputMethodHints(Qt.ImhDigitsOnly)
self.input_minutes.setMaximumBlockCount(3)
self.input_minutes.setCenterOnScroll(True)
self.text_time_minuts = QLabel(self.centralwidget)
self.text_time_minuts.setObjectName(u"text_time_minuts")
self.text_time_minuts.setGeometry(QRect(320, 210, 31, 17))
self.text_time_minuts.setFont(font1)
self.text_time_minuts.setStyleSheet(u"color: rgb(255, 255, 255);")
self.input_gram = QPlainTextEdit(self.centralwidget)
self.input_gram.setObjectName(u"input_gram")
self.input_gram.setGeometry(QRect(230, 240, 81, 20))
sizePolicy.setHeightForWidth(self.input_gram.sizePolicy().hasHeightForWidth())
self.input_gram.setSizePolicy(sizePolicy)
self.input_gram.setFont(font3)
self.input_gram.setAcceptDrops(False)
self.input_gram.setToolTipDuration(0)
self.input_gram.setAutoFillBackground(False)
self.input_gram.setStyleSheet(u"background-color: rgb(77, 77, 77);")
self.input_gram.setInputMethodHints(Qt.ImhFormattedNumbersOnly)
self.input_gram.setLineWidth(0)
self.input_gram.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.input_gram.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.input_gram.setPlainText(u"")
self.input_gram.setCenterOnScroll(True)
self.input_things = QPlainTextEdit(self.centralwidget)
self.input_things.setObjectName(u"input_things")
self.input_things.setGeometry(QRect(230, 270, 81, 20))
sizePolicy.setHeightForWidth(self.input_things.sizePolicy().hasHeightForWidth())
self.input_things.setSizePolicy(sizePolicy)
self.input_things.setFont(font3)
self.input_things.setAcceptDrops(False)
self.input_things.setToolTipDuration(0)
self.input_things.setAutoFillBackground(False)
self.input_things.setStyleSheet(u"background-color: rgb(77, 77, 77);")
self.input_things.setInputMethodHints(Qt.ImhDigitsOnly)
self.input_things.setLineWidth(0)
self.input_things.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.input_things.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.input_things.setPlainText(u"")
self.input_things.setCenterOnScroll(True)
self.input_mod = QPlainTextEdit(self.centralwidget)
self.input_mod.setObjectName(u"input_mod")
self.input_mod.setGeometry(QRect(230, 330, 81, 20))
sizePolicy.setHeightForWidth(self.input_mod.sizePolicy().hasHeightForWidth())
self.input_mod.setSizePolicy(sizePolicy)
self.input_mod.setFont(font3)
self.input_mod.setAcceptDrops(False)
self.input_mod.setToolTipDuration(0)
self.input_mod.setAutoFillBackground(False)
self.input_mod.setStyleSheet(u"background-color: rgb(77, 77, 77);")
self.input_mod.setInputMethodHints(Qt.ImhDigitsOnly)
self.input_mod.setLineWidth(0)
self.input_mod.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.input_mod.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.input_mod.setPlainText(u"")
self.input_mod.setCenterOnScroll(True)
self.input_post = QPlainTextEdit(self.centralwidget)
self.input_post.setObjectName(u"input_post")
self.input_post.setGeometry(QRect(230, 360, 81, 20))
sizePolicy.setHeightForWidth(self.input_post.sizePolicy().hasHeightForWidth())
self.input_post.setSizePolicy(sizePolicy)
self.input_post.setFont(font3)
self.input_post.setAcceptDrops(False)
self.input_post.setToolTipDuration(0)
self.input_post.setAutoFillBackground(False)
self.input_post.setStyleSheet(u"background-color: rgb(77, 77, 77);")
self.input_post.setInputMethodHints(Qt.ImhDigitsOnly)
self.input_post.setLineWidth(0)
self.input_post.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.input_post.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.input_post.setPlainText(u"")
self.input_post.setCenterOnScroll(True)
self.text_gram = QLabel(self.centralwidget)
self.text_gram.setObjectName(u"text_gram")
self.text_gram.setGeometry(QRect(320, 240, 31, 17))
self.text_gram.setFont(font1)
self.text_gram.setStyleSheet(u"color: rgb(255, 255, 255);")
self.text_things = QLabel(self.centralwidget)
self.text_things.setObjectName(u"text_things")
self.text_things.setGeometry(QRect(320, 270, 31, 17))
self.text_things.setFont(font1)
self.text_things.setStyleSheet(u"color: rgb(255, 255, 255);")
self.text_rub_mod = QLabel(self.centralwidget)
self.text_rub_mod.setObjectName(u"text_rub_mod")
self.text_rub_mod.setGeometry(QRect(320, 330, 31, 17))
self.text_rub_mod.setFont(font1)
self.text_rub_mod.setStyleSheet(u"color: rgb(255, 255, 255);")
self.text_rub_post = QLabel(self.centralwidget)
self.text_rub_post.setObjectName(u"text_rub_post")
self.text_rub_post.setGeometry(QRect(320, 360, 31, 17))
self.text_rub_post.setFont(font1)
self.text_rub_post.setStyleSheet(u"color: rgb(255, 255, 255);")
self.ico_rub = QLabel(self.centralwidget)
self.ico_rub.setObjectName(u"ico_rub")
self.ico_rub.setGeometry(QRect(330, 50, 31, 31))
self.ico_rub.setPixmap(QPixmap(u"img/rubl.png"))
self.ico_rub.setScaledContents(True)
self.frame = QFrame(self.centralwidget)
self.frame.setObjectName(u"frame")
self.frame.setGeometry(QRect(20, 130, 331, 31))
self.frame.setFrameShape(QFrame.HLine)
self.frame.setFrameShadow(QFrame.Raised)
self.frame.setLineWidth(2)
self.frame_2 = QFrame(self.centralwidget)
self.frame_2.setObjectName(u"frame_2")
self.frame_2.setGeometry(QRect(20, 300, 331, 31))
self.frame_2.setFrameShape(QFrame.HLine)
self.frame_2.setFrameShadow(QFrame.Raised)
self.frame_2.setLineWidth(2)
self.layoutWidget = QWidget(self.centralwidget)
self.layoutWidget.setObjectName(u"layoutWidget")
self.layoutWidget.setGeometry(QRect(20, 400, 331, 41))
self.buttons = QHBoxLayout(self.layoutWidget)
self.buttons.setObjectName(u"buttons")
self.buttons.setContentsMargins(0, 0, 0, 0)
self.get_result_btn = QPushButton(self.layoutWidget)
self.get_result_btn.setObjectName(u"get_result_btn")
font4 = QFont()
font4.setPointSize(10)
font4.setBold(True)
font4.setItalic(False)
font4.setKerning(True)
font4.setStyleStrategy(QFont.PreferAntialias)
self.get_result_btn.setFont(font4)
self.get_result_btn.setAcceptDrops(True)
self.get_result_btn.setStyleSheet(u"background-color: rgb(0, 80, 0);")
icon1 = QIcon()
icon1.addFile(u"img/calc.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
self.get_result_btn.setIcon(icon1)
self.get_result_btn.setIconSize(QSize(20, 20))
self.buttons.addWidget(self.get_result_btn)
self.exit_btn = QPushButton(self.layoutWidget)
self.exit_btn.setObjectName(u"exit_btn")
self.exit_btn.setFont(font1)
self.exit_btn.setStyleSheet(u"background-color: rgb(0, 80, 0);")
icon2 = QIcon()
icon2.addFile(u"img/exit.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
self.exit_btn.setIcon(icon2)
self.exit_btn.setIconSize(QSize(20, 20))
self.buttons.addWidget(self.exit_btn)
self.modeling = QLabel(self.centralwidget)
self.modeling.setObjectName(u"modeling")
self.modeling.setGeometry(QRect(20, 330, 141, 17))
self.modeling.setFont(font1)
self.modeling.setStyleSheet(u"color: rgb(255, 255, 255);")
self.post_print = QLabel(self.centralwidget)
self.post_print.setObjectName(u"post_print")
self.post_print.setEnabled(False)
self.post_print.setGeometry(QRect(20, 360, 121, 17))
self.post_print.setFont(font1)
self.post_print.setStyleSheet(u"color: rgb(255, 255, 255);")
Calc3DbyRisen.setCentralWidget(self.centralwidget)
self.menubar = QMenuBar(Calc3DbyRisen)
self.menubar.setObjectName(u"menubar")
self.menubar.setGeometry(QRect(0, 0, 373, 22))
self.settings = QMenu(self.menubar)
self.settings.setObjectName(u"settings")
self.pressets = QMenu(self.settings)
self.pressets.setObjectName(u"pressets")
self.help = QMenu(self.menubar)
self.help.setObjectName(u"help")
self.help.setContextMenuPolicy(Qt.DefaultContextMenu)
self.help.setAutoFillBackground(False)
self.help.setTearOffEnabled(False)
self.help.setSeparatorsCollapsible(False)
Calc3DbyRisen.setMenuBar(self.menubar)
self.menubar.addAction(self.settings.menuAction())
self.menubar.addAction(self.help.menuAction())
self.settings.addAction(self.settings_2)
self.settings.addAction(self.pressets.menuAction())
self.pressets.addAction(self.add_printer)
self.pressets.addAction(self.edit_printer)
self.pressets.addAction(self.del_printer)
self.help.addAction(self.check_update)
self.help.addAction(self.formula)
self.help.addAction(self.about)
self.retranslateUi(Calc3DbyRisen)
self.printer_menu.setCurrentIndex(-1)
QMetaObject.connectSlotsByName(Calc3DbyRisen)
# setupUi
def retranslateUi(self, Calc3DbyRisen):
Calc3DbyRisen.setWindowTitle(QCoreApplication.translate("Calc3DbyRisen", u"Calc3D by Risen v.1.0.0", None))
self.check_update.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f", None))
self.formula.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041a\u0430\u043a \u0440\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c", None))
self.about.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0435", None))
self.settings_2.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
self.add_printer.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043d\u0442\u0435\u0440", None))
self.edit_printer.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0442\u0435\u0440", None))
self.del_printer.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0438\u043d\u0442\u0435\u0440", None))
self.quantity.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432", None))
self.weight.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041c\u0430\u0441\u0441\u0430 \u0434\u0435\u0442\u0430\u043b\u0438", None))
self.time_print.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0412\u0440\u0435\u043c\u044f \u043f\u0435\u0447\u0430\u0442\u0438", None))
self.printer.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041f\u0440\u0438\u043d\u0442\u0435\u0440", None))
self.printer_menu.setItemText(0, QCoreApplication.translate("Calc3DbyRisen", u"Ender3/Ender3pro", None))
self.printer_menu.setItemText(1, QCoreApplication.translate("Calc3DbyRisen", u"FlyBeer", None))
self.printer_menu.setCurrentText("")
self.printer_menu.setPlaceholderText(QCoreApplication.translate("Calc3DbyRisen", u"\u0412\u044b\u0431\u043e \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430", None))
self.cost_price.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0421\u0435\u0431\u0435\u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c", None))
#if QT_CONFIG(whatsthis)
self.input_hours.setWhatsThis("")
#endif // QT_CONFIG(whatsthis)
self.text_time_hours.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0447.", None))
self.input_minutes.setPlaceholderText(QCoreApplication.translate("Calc3DbyRisen", u"0", None))
self.text_time_minuts.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u043c\u0438\u043d.", None))
self.input_gram.setPlaceholderText(QCoreApplication.translate("Calc3DbyRisen", u"0", None))
self.input_things.setPlaceholderText(QCoreApplication.translate("Calc3DbyRisen", u"0", None))
self.input_mod.setPlaceholderText(QCoreApplication.translate("Calc3DbyRisen", u"0", None))
self.input_post.setPlaceholderText(QCoreApplication.translate("Calc3DbyRisen", u"0", None))
self.text_gram.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0433.", None))
self.text_things.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0448\u0442.", None))
self.text_rub_mod.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0440\u0443\u0431.", None))
self.text_rub_post.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0440\u0443\u0431.", None))
self.ico_rub.setText("")
self.get_result_btn.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0420\u0430\u0441\u0447\u0438\u0442\u0430\u0442\u044c", None))
self.exit_btn.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u0412\u044b\u0445\u043e\u0434", None))
self.modeling.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435", None))
self.post_print.setText(QCoreApplication.translate("Calc3DbyRisen", u"\u041f\u043e\u0441\u0442\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430", None))
self.settings.setTitle(QCoreApplication.translate("Calc3DbyRisen", u"\u0424\u0430\u0439\u043b", None))
self.pressets.setTitle(QCoreApplication.translate("Calc3DbyRisen", u"\u041f\u0440\u0435\u0441\u0435\u0442\u044b \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430", None))
self.help.setTitle(QCoreApplication.translate("Calc3DbyRisen", u"\u041f\u043e\u043c\u043e\u0449\u044c", None))
# retranslateUi