add: qt.ui files

This commit is contained in:
Risen 2024-12-08 14:58:25 +03:00
parent cf79a7c838
commit 79b8960e43
42 changed files with 2304 additions and 262 deletions

55
Add_printer.ui Normal file
View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>169</height>
</rect>
</property>
<property name="windowTitle">
<string>Создать пресет</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>img/logo-1.png</normaloff>img/logo-1.png</iconset>
</property>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>22</x>
<y>130</y>
<width>331</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Сохранить</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Закрыть</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

131
Calc3D.py
View File

@ -1,122 +1,17 @@
import datetime
import json
import os
import PySimpleGUI as Sgi
import gettext
import requests
from calculating import calculating, amortization, cost_prise
from setts import window_setts, language, currency_setts
from texts import calc, about, new_marge, ver, not_connect
from update import upd_check
now = datetime.datetime.now()
import sys
from PySide6.QtWidgets import QApplication, QMainWindow
from calc3dui import Ui_Calc3DbyRisen
lang = gettext.translation('locale', localedir='locale', languages=[language()])
lang.install()
_ = lang.gettext
class App(QMainWindow):
def __init__(self):
super(App, self).__init__()
self.ui = Ui_Calc3DbyRisen()
self.ui.setupUi(self)
def create_window():
with open(os.path.expanduser('setts.json')) as f:
theme = json.load(f)['settings']['theme']
Sgi.theme(theme)
menu_def = [
[_('Файл'), [_('Настройки')], [_('Выход')]],
[_('Помощь'), [_('Как рассчитывается стоимость'), _('Обо мне'), _('Проверить обновления')]],
]
layout = [
[Sgi.Menu(menu_def)],
[Sgi.Txt('_' * 46)],
[Sgi.Text('0', size=(7, 1), font=('Consolas', 32),
text_color='white', key='result', auto_size_text=True, justification='right', expand_x=True),
Sgi.Text(currency_setts(), font=('Consolas', 32), text_color='white', key='result')],
[Sgi.Text(_('Себестоимость:'), font=12, text_color='white'),
Sgi.Text('0', size=(7, 1), font=12, text_color='white', key='cost', auto_size_text=True,
justification='right', expand_x=True),
Sgi.Text(currency_setts(), font=('Consolas', 12), text_color='white', key='cost')],
[Sgi.Txt('_' * 46, pad=(10, 5))],
[Sgi.Text(_('Время печати')), Sgi.Push(), Sgi.InputText('0', size=(5, 20)), Sgi.Text(_('ч.')),
Sgi.InputText('0', size=(5, 0)), Sgi.Text(_('мин. '))],
[Sgi.Text(_('Масса детали')), Sgi.Push(), Sgi.InputText('0', size=(10, 20), justification='right', ),
Sgi.Text(_('г. '))],
[Sgi.Text(_('Количество экземпляров')), Sgi.Push(), Sgi.InputText('1', size=(10, 20), justification='right', ),
Sgi.Text(_('шт. '))],
[Sgi.Txt('_' * 46)],
[Sgi.Text(_('Моделирование')), Sgi.Push(), Sgi.InputText('0', size=(10, 20), justification='right', ),
Sgi.Text(f'{currency_setts()} ')],
[Sgi.Text(_('Постобработка')), Sgi.Push(), Sgi.InputText('0', size=(10, 20), justification='right', ),
Sgi.Text(f'{currency_setts()} ')],
[Sgi.Txt('_' * 46)],
[Sgi.Txt(' ' * 15), Sgi.ReadFormButton(_('Рассчитать'), size=(10, 2)), Sgi.Cancel(_('Выход'), size=(10, 2))]
]
return Sgi.Window(f'Calc3D by Risen ver.{ver}', layout, icon='logo.ico')
def main():
window = create_window()
while True:
event, values = window.read()
if event == _("Настройки"):
window_setts()
window.close()
window = create_window()
elif event == _("Как рассчитывается стоимость"):
Sgi.popup_ok(calc)
elif event == _("Обо мне"):
Sgi.popup(about)
elif event == "Проверить обновления":
try:
upd_check()
except requests.exceptions.ConnectionError:
Sgi.popup_ok(not_connect)
elif event == _('Рассчитать'):
with open(os.path.expanduser('setts.json')) as f:
params = json.load(f)["settings"]
try:
hours = float(values[1])
except ValueError:
hours = 0
try:
minutes = float(values[2])
except ValueError:
minutes = 0
if minutes > 60:
hours = hours + minutes // 60
minutes = minutes % 60
t = hours * 60 + minutes
try:
md = values[3]
except ValueError:
md = 0
am = amortization(params['a'], t, params['spi'], now.year) # a, t, spi, year
cost = cost_prise(params['p'], t, params['h'], md, params['d'], params['st'], params['mk'], am,
values[6], values[4]) # p, t, h, md, d, st, mk, am, post, x
try:
result = calculating(abs(cost), values[5], params['marge']) # cost, mod, marg
except KeyError:
Sgi.popup_ok(new_marge)
result = 0
window.find_element('result').Update(result)
window.find_element('cost').Update(cost)
elif event in (Sgi.WIN_CLOSED, _('Выход')):
break
if __name__ == "__main__":
main()
if __name__ == '__main__':
app = QApplication(sys.argv)
window = App()
window.show()
sys.exit(app.exec())

View File

@ -1,38 +0,0 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['Calc3D.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='Calc3D',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['test.ico'],
)

957
Calc3d.ui Normal file
View File

@ -0,0 +1,957 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Calc3DbyRisen</class>
<widget class="QMainWindow" name="Calc3DbyRisen">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>373</width>
<height>471</height>
</rect>
</property>
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="windowTitle">
<string>Calc3D by Risen v.1.0.0</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>img/logo-1.png</normaloff>img/logo-1.png</iconset>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="dockOptions">
<set>QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QLabel" name="quantity">
<property name="geometry">
<rect>
<x>20</x>
<y>270</y>
<width>171</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Количество экземпляров</string>
</property>
</widget>
<widget class="QLabel" name="weight">
<property name="geometry">
<rect>
<x>20</x>
<y>240</y>
<width>101</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Масса детали</string>
</property>
</widget>
<widget class="QLabel" name="time_print">
<property name="geometry">
<rect>
<x>20</x>
<y>210</y>
<width>101</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Время печати</string>
</property>
</widget>
<widget class="QLabel" name="printer">
<property name="geometry">
<rect>
<x>21</x>
<y>171</y>
<width>81</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Принтер</string>
</property>
</widget>
<widget class="QComboBox" name="printer_menu">
<property name="geometry">
<rect>
<x>181</x>
<y>170</y>
<width>171</width>
<height>25</height>
</rect>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">alternate-background-color: rgb(77, 77, 77);</string>
</property>
<property name="currentText">
<string/>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
<property name="placeholderText">
<string>Выбо принтера</string>
</property>
<item>
<property name="text">
<string>Ender3/Ender3pro</string>
</property>
</item>
<item>
<property name="text">
<string>FlyBeer</string>
</property>
</item>
</widget>
<widget class="QLCDNumber" name="lcd_result">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>301</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(36, 36, 36);</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="digitCount">
<number>10</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
<widget class="QLCDNumber" name="lcd_result_2">
<property name="geometry">
<rect>
<x>180</x>
<y>90</y>
<width>141</width>
<height>41</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(36, 36, 36);</string>
</property>
<property name="digitCount">
<number>10</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
<widget class="QLabel" name="cost_price">
<property name="geometry">
<rect>
<x>20</x>
<y>110</y>
<width>141</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Себестоимость</string>
</property>
</widget>
<widget class="QPlainTextEdit" name="input_hours">
<property name="geometry">
<rect>
<x>180</x>
<y>210</y>
<width>51</width>
<height>20</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTipDuration">
<number>0</number>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(77, 77, 77);</string>
</property>
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="plainText">
<string notr="true"/>
</property>
<property name="tabStopDistance">
<double>80.000000000000000</double>
</property>
<property name="maximumBlockCount">
<number>3</number>
</property>
<property name="centerOnScroll">
<bool>false</bool>
</property>
<property name="placeholderText">
<string notr="true">0</string>
</property>
</widget>
<widget class="QLabel" name="text_time_hours">
<property name="geometry">
<rect>
<x>240</x>
<y>210</y>
<width>21</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>ч.</string>
</property>
</widget>
<widget class="QPlainTextEdit" name="input_minutes">
<property name="geometry">
<rect>
<x>260</x>
<y>210</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(77, 77, 77);</string>
</property>
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
<property name="maximumBlockCount">
<number>3</number>
</property>
<property name="centerOnScroll">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="text_time_minuts">
<property name="geometry">
<rect>
<x>320</x>
<y>210</y>
<width>31</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>мин.</string>
</property>
</widget>
<widget class="QPlainTextEdit" name="input_gram">
<property name="geometry">
<rect>
<x>230</x>
<y>240</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTipDuration">
<number>0</number>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(77, 77, 77);</string>
</property>
<property name="inputMethodHints">
<set>Qt::ImhFormattedNumbersOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="plainText">
<string notr="true"/>
</property>
<property name="centerOnScroll">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>0</string>
</property>
</widget>
<widget class="QPlainTextEdit" name="input_things">
<property name="geometry">
<rect>
<x>230</x>
<y>270</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTipDuration">
<number>0</number>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(77, 77, 77);</string>
</property>
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="plainText">
<string notr="true"/>
</property>
<property name="centerOnScroll">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>0</string>
</property>
</widget>
<widget class="QPlainTextEdit" name="input_mod">
<property name="geometry">
<rect>
<x>230</x>
<y>330</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTipDuration">
<number>0</number>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(77, 77, 77);</string>
</property>
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="plainText">
<string notr="true"/>
</property>
<property name="centerOnScroll">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>0</string>
</property>
</widget>
<widget class="QPlainTextEdit" name="input_post">
<property name="geometry">
<rect>
<x>230</x>
<y>360</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTipDuration">
<number>0</number>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(77, 77, 77);</string>
</property>
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="plainText">
<string notr="true"/>
</property>
<property name="centerOnScroll">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="text_gram">
<property name="geometry">
<rect>
<x>320</x>
<y>240</y>
<width>31</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>г.</string>
</property>
</widget>
<widget class="QLabel" name="text_things">
<property name="geometry">
<rect>
<x>320</x>
<y>270</y>
<width>31</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>шт.</string>
</property>
</widget>
<widget class="QLabel" name="text_rub_mod">
<property name="geometry">
<rect>
<x>320</x>
<y>330</y>
<width>31</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>руб.</string>
</property>
</widget>
<widget class="QLabel" name="text_rub_post">
<property name="geometry">
<rect>
<x>320</x>
<y>360</y>
<width>31</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>руб.</string>
</property>
</widget>
<widget class="QLabel" name="ico_rub">
<property name="geometry">
<rect>
<x>330</x>
<y>50</y>
<width>31</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>img/rubl.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>20</x>
<y>130</y>
<width>331</width>
<height>31</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="lineWidth">
<number>2</number>
</property>
</widget>
<widget class="QFrame" name="frame_2">
<property name="geometry">
<rect>
<x>20</x>
<y>300</y>
<width>331</width>
<height>31</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="lineWidth">
<number>2</number>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>400</y>
<width>331</width>
<height>41</height>
</rect>
</property>
<layout class="QHBoxLayout" name="buttons">
<item>
<widget class="QPushButton" name="get_result_btn">
<property name="font">
<font>
<pointsize>10</pointsize>
<italic>false</italic>
<bold>true</bold>
<stylestrategy>PreferAntialias</stylestrategy>
<kerning>true</kerning>
</font>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Расчитать</string>
</property>
<property name="icon">
<iconset>
<normaloff>img/calc.png</normaloff>img/calc.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="exit_btn">
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Выход</string>
</property>
<property name="icon">
<iconset>
<normaloff>img/exit.png</normaloff>img/exit.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="modeling">
<property name="geometry">
<rect>
<x>20</x>
<y>330</y>
<width>141</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Моделирование</string>
</property>
</widget>
<widget class="QLabel" name="post_print">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>360</y>
<width>121</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Постобработка</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>373</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="settings">
<property name="title">
<string>Файл</string>
</property>
<widget class="QMenu" name="pressets">
<property name="title">
<string>Пресеты принтера</string>
</property>
<addaction name="add_printer"/>
<addaction name="edit_printer"/>
<addaction name="del_printer"/>
</widget>
<addaction name="settings_2"/>
<addaction name="pressets"/>
</widget>
<widget class="QMenu" name="help">
<property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="tearOffEnabled">
<bool>false</bool>
</property>
<property name="title">
<string>Помощь</string>
</property>
<property name="separatorsCollapsible">
<bool>false</bool>
</property>
<addaction name="check_update"/>
<addaction name="formula"/>
<addaction name="about"/>
</widget>
<addaction name="settings"/>
<addaction name="help"/>
</widget>
<action name="check_update">
<property name="checkable">
<bool>false</bool>
</property>
<property name="text">
<string>Проверить обновления</string>
</property>
</action>
<action name="formula">
<property name="text">
<string>Как расчитывается стоимость</string>
</property>
</action>
<action name="about">
<property name="text">
<string>О програме</string>
</property>
</action>
<action name="settings_2">
<property name="text">
<string>Настройки</string>
</property>
</action>
<action name="add_printer">
<property name="text">
<string>Добавить принтер</string>
</property>
</action>
<action name="edit_printer">
<property name="text">
<string>Редактировать принтер</string>
</property>
</action>
<action name="del_printer">
<property name="text">
<string>Удалить принтер</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

68
Del_preset.ui Normal file
View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>369</width>
<height>347</height>
</rect>
</property>
<property name="windowTitle">
<string>Удалить пресет</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>img/logo-1.png</normaloff>img/logo-1.png</iconset>
</property>
<widget class="QTableWidget" name="tableWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>321</width>
<height>271</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(36, 36, 36);</string>
</property>
</widget>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>12</x>
<y>310</y>
<width>331</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Удалить</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Закрыть</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

55
Edit_presset.ui Normal file
View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>369</width>
<height>169</height>
</rect>
</property>
<property name="windowTitle">
<string>Изменить пресет</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>img/logo-1.png</normaloff>img/logo-1.png</iconset>
</property>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>22</x>
<y>130</y>
<width>321</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Сохранить</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Закрыть</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -18,27 +18,16 @@ S = ((p/1000*t/60*h)+(md*d*st/mk)+(a+post))*x+mod
где
```
S - стоимость печати, руб.
p - мощность принтера, Вт
t - время печати, мин.
h - тариф на электроэнергию, кВт/ч
md - вес детали, гр.
d - множитель отбраковки.
st - стоимость катушки пластика, руб.
mk - вес пластика в катушке, гр.
a - амортизация принтера, руб.
post - стоимость постобработки, руб.
х - количество печатаемых дубликатов, шт.
mod - стоимость моделирования, руб
```

39
Settings.ui Normal file
View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>369</width>
<height>375</height>
</rect>
</property>
<property name="windowTitle">
<string>Настройки</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>img/logo-1.png</normaloff>img/logo-1.png</iconset>
</property>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>100</x>
<y>340</y>
<width>161</width>
<height>25</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Закрыть</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

129
Updates.ui Normal file
View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>368</width>
<height>99</height>
</rect>
</property>
<property name="windowTitle">
<string>Updates</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>img/logo-1.png</normaloff>img/logo-1.png</iconset>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>73</x>
<y>0</y>
<width>191</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Ваша версия:</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>70</x>
<y>20</y>
<width>191</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Версия на сайте:</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>250</x>
<y>10</y>
<width>54</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>1.0.0</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>250</x>
<y>30</y>
<width>54</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>1.0.0</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>331</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Перейти на сайт</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Закрыть</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

Binary file not shown.

Binary file not shown.

54
about.ui Normal file
View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>About</class>
<widget class="QDialog" name="About">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>365</width>
<height>97</height>
</rect>
</property>
<property name="windowTitle">
<string>О прграмме</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>img/logo-1.png</normaloff>img/logo-1.png</iconset>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>331</width>
<height>231</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Калькулятор Calc3D by Risen предназначен для быстрой оценки стоимости печати на 3D принтере,
исходя из стоимости пластика, веса, тарифа электроэнергии и прочего...</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

371
calc3dui.py Normal file
View File

@ -0,0 +1,371 @@
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

78
db.py Normal file
View File

@ -0,0 +1,78 @@
import sqlite3
def sqlite_connect():
conn = sqlite3.connect("db/database.db", check_same_thread=False)
conn.execute("pragma journal_mode=wal;")
return conn
def init_sqlite():
conn = sqlite_connect()
cursor = conn.cursor()
try:
# Начинаем транзакцию
cursor.execute('BEGIN')
# Выполняем операции
cursor.execute('''CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tg_id INTEGER NOT NULL UNIQUE ,
school_nik TEXT NOT NULL UNIQUE,
username TEXT UNIQUE,
number_quest INTEGER,
city TEXT)''')
cursor.execute('''CREATE INDEX IF NOT EXISTS usrid ON users (number_quest)''')
cursor.execute('''CREATE TABLE IF NOT EXISTS flags (
id INTEGER PRIMARY KEY AUTOINCREMENT,
flags TEXT NOT NULL UNIQUE)''')
cursor.execute('''CREATE TABLE IF NOT EXISTS token (
id INTEGER PRIMARY KEY AUTOINCREMENT,
token TEXT NOT NULL UNIQUE)''')
cursor.execute('COMMIT')
except Exception as e:
print(e)
cursor.execute('ROLLBACK')
conn.close()
def registration(user_id, school_nik, uname, number_quest, city, class_name, end_14):
conn = sqlite_connect()
cursor = conn.cursor()
try:
cursor.execute('BEGIN')
cursor.execute('INSERT INTO users (tg_id, school_nik, username, number_quest, city, class_name, end_14)'
' VALUES (?, ?, ?, ?, ?, ?, ?)',
(user_id, school_nik, uname, number_quest, city, class_name, end_14))
cursor.execute('COMMIT')
except Exception as e:
print(e)
cursor.execute('ROLLBACK')
conn.close()
def quest_1(tg_id, date_begin):
conn = sqlite_connect()
cursor = conn.cursor()
try:
cursor.execute('BEGIN')
cursor.execute(f'UPDATE users SET date_begin=(?) WHERE tg_id=(?)', (date_begin, tg_id,))
cursor.execute('COMMIT')
except Exception as e:
print(e)
cursor.execute('ROLLBACK')
conn.close()
def get_time(username):
conn = sqlite_connect()
cursor = conn.cursor()
try:
cursor.execute('BEGIN')
time = cursor.execute('SELECT date_begin, end_13 FROM users WHERE school_nik = (?)', (username,)).fetchone()
return time
except Exception as e:
print(e)
cursor.execute('ROLLBACK')
conn.close()

63
del-preset.py Normal file
View File

@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'Del_preset.ui'
##
## Created by: Qt User Interface Compiler version 6.8.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QDialog, QHBoxLayout, QHeaderView,
QPushButton, QSizePolicy, QTableWidget, QTableWidgetItem,
QWidget)
class Ui_Dialog(object):
def setupUi(self, Dialog):
if not Dialog.objectName():
Dialog.setObjectName(u"Dialog")
Dialog.resize(369, 347)
icon = QIcon()
icon.addFile(u"img/logo-1.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
Dialog.setWindowIcon(icon)
self.tableWidget = QTableWidget(Dialog)
self.tableWidget.setObjectName(u"tableWidget")
self.tableWidget.setGeometry(QRect(20, 20, 321, 271))
self.tableWidget.setStyleSheet(u"background-color: rgb(36, 36, 36);")
self.widget = QWidget(Dialog)
self.widget.setObjectName(u"widget")
self.widget.setGeometry(QRect(12, 310, 331, 27))
self.horizontalLayout = QHBoxLayout(self.widget)
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.pushButton = QPushButton(self.widget)
self.pushButton.setObjectName(u"pushButton")
self.pushButton.setStyleSheet(u"background-color: rgb(0, 80, 0);")
self.horizontalLayout.addWidget(self.pushButton)
self.pushButton_2 = QPushButton(self.widget)
self.pushButton_2.setObjectName(u"pushButton_2")
self.pushButton_2.setStyleSheet(u"background-color: rgb(0, 80, 0);")
self.horizontalLayout.addWidget(self.pushButton_2)
self.retranslateUi(Dialog)
QMetaObject.connectSlotsByName(Dialog)
# setupUi
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0435\u0441\u0435\u0442", None))
self.pushButton.setText(QCoreApplication.translate("Dialog", u"\u0423\u0434\u0430\u043b\u0438\u0442\u044c", None))
self.pushButton_2.setText(QCoreApplication.translate("Dialog", u"\u0417\u0430\u043a\u0440\u044b\u0442\u044c", None))
# retranslateUi

58
edit-preset.py Normal file
View File

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'Edit_presset.ui'
##
## Created by: Qt User Interface Compiler version 6.8.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QDialog, QHBoxLayout, QPushButton,
QSizePolicy, QWidget)
class Ui_Dialog(object):
def setupUi(self, Dialog):
if not Dialog.objectName():
Dialog.setObjectName(u"Dialog")
Dialog.resize(369, 169)
icon = QIcon()
icon.addFile(u"img/logo-1.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
Dialog.setWindowIcon(icon)
self.widget = QWidget(Dialog)
self.widget.setObjectName(u"widget")
self.widget.setGeometry(QRect(22, 130, 321, 27))
self.horizontalLayout = QHBoxLayout(self.widget)
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.pushButton = QPushButton(self.widget)
self.pushButton.setObjectName(u"pushButton")
self.pushButton.setStyleSheet(u"background-color: rgb(0, 80, 0);")
self.horizontalLayout.addWidget(self.pushButton)
self.pushButton_2 = QPushButton(self.widget)
self.pushButton_2.setObjectName(u"pushButton_2")
self.pushButton_2.setStyleSheet(u"background-color: rgb(0, 80, 0);")
self.horizontalLayout.addWidget(self.pushButton_2)
self.retranslateUi(Dialog)
QMetaObject.connectSlotsByName(Dialog)
# setupUi
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0435\u0441\u0435\u0442", None))
self.pushButton.setText(QCoreApplication.translate("Dialog", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
self.pushButton_2.setText(QCoreApplication.translate("Dialog", u"\u0417\u0430\u043a\u0440\u044b\u0442\u044c", None))
# retranslateUi

93
formula.py Normal file
View File

@ -0,0 +1,93 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'formula.ui'
##
## Created by: Qt User Interface Compiler version 6.8.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QDialog, QLabel, QPushButton,
QSizePolicy, QWidget)
class Ui_Dialog(object):
def setupUi(self, Dialog):
if not Dialog.objectName():
Dialog.setObjectName(u"Dialog")
Dialog.resize(367, 377)
icon = QIcon()
icon.addFile(u"img/logo-1.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
Dialog.setWindowIcon(icon)
self.label = QLabel(Dialog)
self.label.setObjectName(u"label")
self.label.setGeometry(QRect(100, 10, 171, 41))
font = QFont()
font.setPointSize(9)
self.label.setFont(font)
self.label.setTextFormat(Qt.MarkdownText)
self.label.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
self.label_2 = QLabel(Dialog)
self.label_2.setObjectName(u"label_2")
self.label_2.setGeometry(QRect(30, 50, 341, 21))
font1 = QFont()
font1.setFamilies([u"Sans Serif"])
font1.setPointSize(10)
font1.setBold(True)
font1.setKerning(False)
self.label_2.setFont(font1)
self.label_2.setAutoFillBackground(False)
self.label_2.setTextFormat(Qt.MarkdownText)
self.label_2.setScaledContents(True)
self.label_2.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
self.label_2.setWordWrap(False)
self.label_3 = QLabel(Dialog)
self.label_3.setObjectName(u"label_3")
self.label_3.setGeometry(QRect(10, 80, 341, 281))
font2 = QFont()
font2.setPointSize(10)
self.label_3.setFont(font2)
self.label_3.setTextFormat(Qt.MarkdownText)
self.label_3.setScaledContents(False)
self.label_3.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
self.label_3.setWordWrap(True)
self.pushButton = QPushButton(Dialog)
self.pushButton.setObjectName(u"pushButton")
self.pushButton.setGeometry(QRect(100, 340, 161, 25))
self.pushButton.setStyleSheet(u"background-color: rgb(0, 80, 0);")
self.retranslateUi(Dialog)
QMetaObject.connectSlotsByName(Dialog)
# setupUi
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"\u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0440\u0430\u0441\u0447\u0435\u0442\u0430", None))
self.label.setText(QCoreApplication.translate("Dialog", u"## \u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0440\u0430\u0441\u0447\u0435\u0442\u0430", None))
self.label_2.setText(QCoreApplication.translate("Dialog", u"S = ((p/1000*t/60*h)+(md*d*st/mk)+(a+post))*x+mod", None))
self.label_3.setText(QCoreApplication.translate("Dialog", u"\u0433\u0434\u0435\n"
"```\n"
"S - \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0447\u0430\u0442\u0438, \u0440\u0443\u0431.\n"
"p - \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430, \u0412\u0442\n"
"t - \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0447\u0430\u0442\u0438, \u043c\u0438\u043d.\n"
"h - \u0442\u0430\u0440\u0438\u0444 \u043d\u0430 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u044d\u043d\u0435\u0440\u0433\u0438\u044e, \u043a\u0412\u0442/\u0447\n"
"md - \u0432\u0435\u0441 \u0434\u0435\u0442\u0430\u043b\u0438, \u0433\u0440.\n"
"d - \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u043e\u0442\u0431\u0440\u0430\u043a\u043e\u0432\u043a\u0438.\n"
"st - \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u0430\u0442\u0443\u0448\u043a\u0438 \u043f\u043b\u0430\u0441\u0442\u0438\u043a\u0430, \u0440\u0443\u0431.\n"
"mk - \u0432\u0435\u0441 \u043f\u043b\u0430\u0441\u0442\u0438\u043a\u0430 \u0432 \u043a\u0430\u0442\u0443\u0448"
"\u043a\u0435, \u0433\u0440.\n"
"a - \u0430\u043c\u043e\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430, \u0440\u0443\u0431.\n"
"post - \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0440\u0443\u0431.\n"
"\u0445 - \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c\u044b\u0445 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432, \u0448\u0442.\n"
"mod - \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0440\u0443\u0431\n"
"```", None))
self.pushButton.setText(QCoreApplication.translate("Dialog", u"\u0417\u0430\u043a\u0440\u044b\u0442\u044c", None))
# retranslateUi

143
formula.ui Normal file
View File

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>367</width>
<height>377</height>
</rect>
</property>
<property name="windowTitle">
<string>Формула расчета</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>img/logo-1.png</normaloff>img/logo-1.png</iconset>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>100</x>
<y>10</y>
<width>171</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>## Формула расчета</string>
</property>
<property name="textFormat">
<enum>Qt::MarkdownText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>30</x>
<y>50</y>
<width>341</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>10</pointsize>
<bold>true</bold>
<kerning>false</kerning>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="text">
<string>S = ((p/1000*t/60*h)+(md*d*st/mk)+(a+post))*x+mod</string>
</property>
<property name="textFormat">
<enum>Qt::MarkdownText</enum>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>341</width>
<height>281</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>где
```
S - стоимость печати, руб.
p - мощность принтера, Вт
t - время печати, мин.
h - тариф на электроэнергию, кВт/ч
md - вес детали, гр.
d - множитель отбраковки.
st - стоимость катушки пластика, руб.
mk - вес пластика в катушке, гр.
a - амортизация принтера, руб.
post - стоимость постобработки, руб.
х - количество печатаемых дубликатов, шт.
mod - стоимость моделирования, руб
```</string>
</property>
<property name="textFormat">
<enum>Qt::MarkdownText</enum>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>100</x>
<y>340</y>
<width>161</width>
<height>25</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 80, 0);</string>
</property>
<property name="text">
<string>Закрыть</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

BIN
img/calc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

1
img/calc.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#D9D9D9"><path d="M320-240h60v-80h80v-60h-80v-80h-60v80h-80v60h80v80Zm200-30h200v-60H520v60Zm0-100h200v-60H520v60Zm44-152 56-56 56 56 42-42-56-58 56-56-42-42-56 56-56-56-42 42 56 56-56 58 42 42Zm-314-70h200v-60H250v60Zm-50 472q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"/></svg>

After

Width:  |  Height:  |  Size: 482 B

BIN
img/exit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

1
img/exit.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#D9D9D9"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>

After

Width:  |  Height:  |  Size: 222 B

BIN
img/logo-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
img/logo-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
img/logo-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
img/logo-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
img/logo-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
img/logo-6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
img/logo-7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
img/logo-8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

BIN
img/modeling.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
img/quantity.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
img/rubl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

BIN
img/time.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
img/weight.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,26 +0,0 @@
themes_list = ['Black', 'BlueMono', 'BluePurple', 'BrightColors', 'BrownBlue', 'Dark', 'Dark2', 'DarkAmber',
'DarkBlack', 'DarkBlack1', 'DarkBlue', 'DarkBlue1', 'DarkBlue10', 'DarkBlue11', 'DarkBlue12',
'DarkBlue13', 'DarkBlue14', 'DarkBlue15', 'DarkBlue16', 'DarkBlue17', 'DarkBlue2', 'DarkBlue3',
'DarkBlue4', 'DarkBlue5', 'DarkBlue6', 'DarkBlue7', 'DarkBlue8', 'DarkBlue9', 'DarkBrown',
'DarkBrown1', 'DarkBrown2', 'DarkBrown3', 'DarkBrown4', 'DarkBrown5', 'DarkBrown6', 'DarkBrown7',
'DarkGreen', 'DarkGreen1', 'DarkGreen2', 'DarkGreen3', 'DarkGreen4', 'DarkGreen5', 'DarkGreen6',
'DarkGreen7', 'DarkGrey', 'DarkGrey1', 'DarkGrey10', 'DarkGrey11', 'DarkGrey12', 'DarkGrey13',
'DarkGrey14', 'DarkGrey15', 'DarkGrey2', 'DarkGrey3', 'DarkGrey4', 'DarkGrey5', 'DarkGrey6',
'DarkGrey7', 'DarkGrey8', 'DarkGrey9', 'DarkPurple', 'DarkPurple1', 'DarkPurple2', 'DarkPurple3',
'DarkPurple4', 'DarkPurple5', 'DarkPurple6', 'DarkPurple7', 'DarkRed', 'DarkRed1', 'DarkRed2',
'DarkTanBlue', 'DarkTeal', 'DarkTeal1', 'DarkTeal10', 'DarkTeal11', 'DarkTeal12', 'DarkTeal2',
'DarkTeal3', 'DarkTeal4', 'DarkTeal5', 'DarkTeal6', 'DarkTeal7', 'DarkTeal8', 'DarkTeal9', 'Default',
'Default1', 'DefaultNoMoreNagging', 'GrayGrayGray', 'Green', 'GreenMono', 'GreenTan', 'HotDogStand',
'Kayak', 'LightBlue', 'LightBlue1', 'LightBlue2', 'LightBlue3', 'LightBlue4', 'LightBlue5',
'LightBlue6', 'LightBlue7', 'LightBrown', 'LightBrown1', 'LightBrown10', 'LightBrown11',
'LightBrown12', 'LightBrown13', 'LightBrown2', 'LightBrown3', 'LightBrown4', 'LightBrown5',
'LightBrown6', 'LightBrown7', 'LightBrown8', 'LightBrown9', 'LightGray1', 'LightGreen',
'LightGreen1', 'LightGreen10', 'LightGreen2', 'LightGreen3', 'LightGreen4', 'LightGreen5',
'LightGreen6', 'LightGreen7', 'LightGreen8', 'LightGreen9', 'LightGrey', 'LightGrey1', 'LightGrey2',
'LightGrey3', 'LightGrey4', 'LightGrey5', 'LightGrey6', 'LightPurple', 'LightTeal', 'LightYellow',
'Material1', 'Material2', 'NeutralBlue', 'Purple', 'Python', 'PythonPlus', 'Reddit', 'Reds',
'SandyBeach', 'SystemDefault', 'SystemDefault1', 'SystemDefaultForReal', 'Tan', 'TanBlue',
'TealMono', 'Topanga']
lang_list = ['Русский', 'English']
currency_list = ['руб.', '$', '']

Binary file not shown.

Binary file not shown.

BIN
logo.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 KiB

43
settings.py Normal file
View File

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'Settings.ui'
##
## Created by: Qt User Interface Compiler version 6.8.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QDialog, QPushButton, QSizePolicy,
QWidget)
class Ui_Dialog(object):
def setupUi(self, Dialog):
if not Dialog.objectName():
Dialog.setObjectName(u"Dialog")
Dialog.resize(369, 375)
icon = QIcon()
icon.addFile(u"img/logo-1.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
Dialog.setWindowIcon(icon)
self.pushButton = QPushButton(Dialog)
self.pushButton.setObjectName(u"pushButton")
self.pushButton.setGeometry(QRect(100, 340, 161, 25))
self.pushButton.setStyleSheet(u"background-color: rgb(0, 80, 0);")
self.retranslateUi(Dialog)
QMetaObject.connectSlotsByName(Dialog)
# setupUi
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
self.pushButton.setText(QCoreApplication.translate("Dialog", u"\u0417\u0430\u043a\u0440\u044b\u0442\u044c", None))
# retranslateUi

View File

@ -1,11 +1,8 @@
import requests
import webbrowser
import json
import PySimpleGUI as Sgi
import gettext
from texts import ver
from setts import language
lang = gettext.translation('locale', localedir='locale', languages=[language()])
@ -21,70 +18,4 @@ def upd_check():
version_new = requests.get('https://risenhome.xyz/feed/Risen.json').json()["version"]["ver"]
version_old = ver
if version_new > version_old:
Sgi.theme(set_theme)
layout = [
[Sgi.Text(_("Обновление"))],
[Sgi.Text(_("Вышла новая версия программы\nНужно обновиться"))],
[Sgi.Button(_(' Скачать ')), Sgi.Push(), Sgi.Button(_(' Отмена '))]
]
window = Sgi.Window(_("Проверка обновления"), layout, modal=True)
while True:
event, button = window.read()
if event == _(' Скачать '):
webbrowser.open('https://risenhome.xyz/calc.html', new=2, autoraise=True)
window.close()
elif event == _(' Отмена '):
window.close()
elif event == "Exit" or event == Sgi.WIN_CLOSED:
break
else:
Sgi.theme(set_theme)
layout = [
[Sgi.Text(_('Последняя версия: ')+f'{version_new}'+_('\nВаша версия: ')+f'{version_old}'+_('\n\n'
'Обновление не'
' требуется'))],
[Sgi.Button(_(' Закрыть '))]
]
window = Sgi.Window(_("Проверка обновления"), layout, modal=True)
while True:
event, button = window.read()
if event == _(' Закрыть '):
window.close()
elif event == "Exit" or event == Sgi.WIN_CLOSED:
break
# def upd_start():
# with open('setts.json') as json_file:
# data = json.load(json_file)
# set_theme = data["settings"]["theme"]
#
# version_new = requests.get('https://risenhome.xyz/feed/Risen.json').json()["version"]["ver"]
# version_old = ver
#
# if version_new > version_old:
#
# Sgi.theme(set_theme)
# layout = [
# [Sgi.Text(_("Обновление"))],
# [Sgi.Text(_("Вышла новая версия программы\nНужно обновиться"))],
# [Sgi.Button(_(' Скачать ')), Sgi.Push(), Sgi.Button(' Отмена ')]
# ]
#
# window = Sgi.Window(_("Вышла новая версия!"), layout, modal=True)
#
# while True:
# event, button = window.read()
# if event == _(' Скачать '):
# webbrowser.open('https://risenhome.xyz', new=2, autoraise=True)
# window.close()
# elif event == _(' Отмена '):
# window.close()
# elif event == "Exit" or event == Sgi.WIN_CLOSED:
# break

83
updates.py Normal file
View File

@ -0,0 +1,83 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'Updates.ui'
##
## Created by: Qt User Interface Compiler version 6.8.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QDialog, QHBoxLayout, QLabel,
QPushButton, QSizePolicy, QWidget)
class Ui_Dialog(object):
def setupUi(self, Dialog):
if not Dialog.objectName():
Dialog.setObjectName(u"Dialog")
Dialog.resize(368, 99)
icon = QIcon()
icon.addFile(u"img/logo-1.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
Dialog.setWindowIcon(icon)
self.label = QLabel(Dialog)
self.label.setObjectName(u"label")
self.label.setGeometry(QRect(73, 0, 191, 31))
font = QFont()
font.setPointSize(10)
self.label.setFont(font)
self.label_2 = QLabel(Dialog)
self.label_2.setObjectName(u"label_2")
self.label_2.setGeometry(QRect(70, 20, 191, 31))
self.label_2.setFont(font)
self.label_3 = QLabel(Dialog)
self.label_3.setObjectName(u"label_3")
self.label_3.setGeometry(QRect(250, 10, 54, 17))
font1 = QFont()
font1.setPointSize(10)
font1.setBold(True)
self.label_3.setFont(font1)
self.label_4 = QLabel(Dialog)
self.label_4.setObjectName(u"label_4")
self.label_4.setGeometry(QRect(250, 30, 54, 17))
self.label_4.setFont(font1)
self.layoutWidget = QWidget(Dialog)
self.layoutWidget.setObjectName(u"layoutWidget")
self.layoutWidget.setGeometry(QRect(20, 60, 331, 27))
self.horizontalLayout = QHBoxLayout(self.layoutWidget)
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.pushButton = QPushButton(self.layoutWidget)
self.pushButton.setObjectName(u"pushButton")
self.pushButton.setStyleSheet(u"background-color: rgb(0, 80, 0);")
self.horizontalLayout.addWidget(self.pushButton)
self.pushButton_2 = QPushButton(self.layoutWidget)
self.pushButton_2.setObjectName(u"pushButton_2")
self.pushButton_2.setStyleSheet(u"background-color: rgb(0, 80, 0);")
self.horizontalLayout.addWidget(self.pushButton_2)
self.retranslateUi(Dialog)
QMetaObject.connectSlotsByName(Dialog)
# setupUi
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Updates", None))
self.label.setText(QCoreApplication.translate("Dialog", u"\u0412\u0430\u0448\u0430 \u0432\u0435\u0440\u0441\u0438\u044f:", None))
self.label_2.setText(QCoreApplication.translate("Dialog", u"\u0412\u0435\u0440\u0441\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435:", None))
self.label_3.setText(QCoreApplication.translate("Dialog", u"1.0.0", None))
self.label_4.setText(QCoreApplication.translate("Dialog", u"1.0.0", None))
self.pushButton.setText(QCoreApplication.translate("Dialog", u"\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442", None))
self.pushButton_2.setText(QCoreApplication.translate("Dialog", u"\u0417\u0430\u043a\u0440\u044b\u0442\u044c", None))
# retranslateUi