Compare commits

...

11 Commits

Author SHA1 Message Date
badcaff6ab add: license ru 2025-03-03 08:22:37 +03:00
751c25b5ff add: changelog.md 2025-03-03 02:10:33 +03:00
c68bdc0d3e ref: del old python code 2025-03-03 01:38:49 +03:00
d2a6141372 add: pipline for build to exe 2025-03-03 01:32:11 +03:00
d452f436f4 rm: .vscode dir 2025-03-01 19:13:25 +03:00
5e81cfc343 add: ui files 2025-03-01 19:12:09 +03:00
d803766a42 ref: del calc year 2025-03-01 18:54:19 +03:00
a38c7c284f add: c library 2025-03-01 18:51:32 +03:00
0779292267 del: pycache 2024-12-08 19:49:44 +03:00
900a83be54 add: connection 2024-12-08 19:46:50 +03:00
79b8960e43 add: qt.ui files 2024-12-08 14:58:25 +03:00
45 changed files with 3041 additions and 434 deletions

View File

@ -0,0 +1,67 @@
name: Build and Release
on:
push:
branches: [develop]
jobs:
test:
runs-on: testing-bots
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc valgrind
- name: Compile for testing
working-directory: ./src
run: gcc program.c -o program
- name: Run Valgrind to check for memory leaks
working-directory: ./src
run: |
valgrind --leak-check=full --error-exitcode=1 ./program
continue-on-error: false
build:
runs-on: testing-bots
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y mingw-w64
- name: Compile for Windows
working-directory: ./src
run: x86_64-w64-mingw32-gcc program.c -o Calc3d.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Calc3d.exe
path: src/Calc3d.exe
release:
runs-on: testing-bots
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: Calc3d.exe
path: dist
- name: Create release
uses: actions/create-release@v1
with:
tag_name: v1.0.0
release_name: Release v1.0.0
body: Automated release
draft: false
prerelease: true
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}

2
.gitignore vendored
View File

@ -4,3 +4,5 @@
/dist
Calc3D.spec
/releases
__pycache__
/.vscode

0
CHANGELOG.md Normal file
View File

122
Calc3D.py
View File

@ -1,122 +0,0 @@
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()
lang = gettext.translation('locale', localedir='locale', languages=[language()])
lang.install()
_ = lang.gettext
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()

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'],
)

View File

@ -9,7 +9,11 @@
- [Зачем это всё](#почему-я-решил-реализовать-этот-проект?)
- [Команда проекта](#команда-проекта)
- [Лицензия](#лицензия)
-
## Changelog
Подробности изменений в каждой (ну почти) версии можно найти в [CHANGELOG.md](CHANGELOG.md)
## Формула расчета
```
@ -18,27 +22,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 - стоимость моделирования, руб
```
@ -48,23 +41,22 @@ S = ((p/1000*t/60*h)+(md*d*st/mk)+(a+post))*x+mod
Качаем последнюю версию, настраиваем свои параметры и пользуемся.
## FAQ
Раздел в процессе написания
## Почему я решил реализовать этот проект?
Не нашел в интернете таких калькуляторов офлайн. Решил сделать для себя, заодно потренироваться в программировании.
## Команда проекта
Вы можете написать мне в личку в телеграм, если у Вас есть каие-то вопросы по работе калькулятора.
Вы можете написать мне в личку в телеграм, если у Вас есть какие-то вопросы по работе калькулятора.
- [Risen (Colin Robinson)](tg://resolve?domain=RisenYT) — разработчик-любитель
- [Jun_Uno](tg://resolve?domain=Jun_Uno) — разработчик-любитель
## Лицензия
MIT
```
Copyright (c) <2024> <Risen>
Copyright (c) <2025> <Risen>
Данная лицензия разрешает лицам, получившим копию данного программного обеспечения и сопутствующей документации
(далее — Программное обеспечение), безвозмездно использовать Программное обеспечение без ограничений, включая
@ -82,7 +74,7 @@ Copyright (c) <2024> <Risen>
ВОЗНИКШИМ ИЗ-ЗА ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫХ ДЕЙСТВИЙ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ.
```
```
Copyright (c) <2024> <Risen>
Copyright (c) <2025> <Risen>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation

View File

@ -1,49 +0,0 @@
def cost_prise(p, t, h, md, d, st, mk, am, post, x):
p = int(p) # номинальная мощность принтера
t = int(t) # время печати, в минутах!!!
h = float(h) # тариф электроэнергии
md = float(md) # вес детали
if float(d) < 1:
d = 1
else:
d = float(d) # коэффициент выбраковки
st = float(st) # стоимость катушки
mk = float(mk) # вес катушки
am = float(am) # амортизация
try:
post = float(post) # постобработка
except ValueError:
post = 0
try:
x = int(x) # количество экземпляров
except ValueError:
x = 1
result = ((abs(p) / 1000) * (abs(t) / 60) * abs(h) * abs(x)) + (abs(md) * abs(d) * (abs(st) / abs(mk) * abs(x)) + abs(am) + abs(post) * abs(x))
return round(result, 2)
def calculating(cost, mod, marg):
try:
mod = float(mod) # моделирование
except ValueError:
mod = 0
try:
margin = float(marg) # процент наценки
except ValueError:
margin = 0
result = (cost / 100 * margin + cost) + mod
return round(result, 2)
def amortization(a, t, spi, year):
if (year % 400 == 0) or (year % 100 != 0) and (year % 4 == 0):
minutes_in_year = 527040 / 2
else:
minutes_in_year = 525600 / 2
try:
year_norm = 100 / float(spi)
except ZeroDivisionError:
year_norm = 100 / 1
year_am = float(a) / 100 * round(year_norm, 1)
am_per_minute = year_am / minutes_in_year * t
return round(am_per_minute, 2)

16
docs/LICENSE_RUS Executable file
View File

@ -0,0 +1,16 @@
Copyright (c) <2025> <Risen>
Данная лицензия разрешает лицам, получившим копию данного программного обеспечения и сопутствующей документации
(далее — Программное обеспечение), безвозмездно использовать Программное обеспечение без ограничений, включая
неограниченное право на использование, копирование, изменение, слияние, публикацию, распространение, сублицензирование
и/или продажу копий Программного обеспечения, а также лицам, которым предоставляется данное Программное обеспечение,
при соблюдении следующих условий:
Указанное выше уведомление об авторском праве и данные условия должны быть включены во все копии или значимые части
данного Программного обеспечения.
ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ,
ВКЛЮЧАЯ ГАРАНТИИ ТОВАРНОЙ ПРИГОДНОСТИ, СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ,
НО НЕ ОГРАНИЧИВАЯСЬ ИМИ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО КАКИМ-ЛИБО ИСКАМ,
ЗА УЩЕРБ ИЛИ ПО ИНЫМ ТРЕБОВАНИЯМ, В ТОМ ЧИСЛЕ, ПРИ ДЕЙСТВИИ КОНТРАКТА, ДЕЛИКТЕ ИЛИ ИНОЙ СИТУАЦИИ,
ВОЗНИКШИМ ИЗ-ЗА ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫХ ДЕЙСТВИЙ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ.

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

View File

@ -1,15 +0,0 @@
{
"settings": {
"theme": "Dark",
"p": "270",
"h": "3",
"d": "0",
"st": "1500",
"mk": "1000",
"a": "0",
"spi": "0",
"marge": "0",
"locale": "Ru",
"currency": "\u0440\u0443\u0431."
}
}

427
src/UI/Add_printer.ui Normal file
View File

@ -0,0 +1,427 @@
<?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>196</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="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>160</y>
<width>341</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 class="QLabel" name="power_printer">
<property name="geometry">
<rect>
<x>20</x>
<y>90</y>
<width>261</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_power">
<property name="geometry">
<rect>
<x>290</x>
<y>90</y>
<width>71</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="power_printer_2">
<property name="geometry">
<rect>
<x>20</x>
<y>120</y>
<width>181</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_power_2">
<property name="geometry">
<rect>
<x>290</x>
<y>120</y>
<width>71</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="power_printer_3">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>181</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_power_3">
<property name="geometry">
<rect>
<x>290</x>
<y>60</y>
<width>71</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="power_printer_4">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>181</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="QTextEdit" name="textEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>180</x>
<y>20</y>
<width>181</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<stylestrategy>PreferAntialias</stylestrategy>
<kerning>false</kerning>
</font>
</property>
<property name="tabletTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(77, 77, 77);</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="autoFormatting">
<set>QTextEdit::AutoBulletList</set>
</property>
<property name="tabChangesFocus">
<bool>true</bool>
</property>
<property name="documentTitle">
<string notr="true"/>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="lineWrapMode">
<enum>QTextEdit::WidgetWidth</enum>
</property>
<property name="markdown">
<string/>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property>
<property name="cursorWidth">
<number>1</number>
</property>
<property name="textInteractionFlags">
<set>Qt::TextEditorInteraction</set>
</property>
<property name="placeholderText">
<string>Название принтера</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

968
src/UI/Calc3d.ui Normal file
View File

@ -0,0 +1,968 @@
<?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::DockOption::AllowTabbedDocks|QMainWindow::DockOption::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::InsertPolicy::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::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<property name="digitCount">
<number>10</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::SegmentStyle::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::SegmentStyle::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::InputMethodHint::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::LineWrapMode::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::InputMethodHint::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::InputMethodHint::ImhFormattedNumbersOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::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::InputMethodHint::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::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::InputMethodHint::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::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::InputMethodHint::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::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::Shape::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::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::Shape::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::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"/>
<addaction name="separator"/>
<addaction name="separator"/>
<addaction name="action_3"/>
</widget>
<widget class="QMenu" name="help">
<property name="contextMenuPolicy">
<enum>Qt::ContextMenuPolicy::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>
<action name="action_3">
<property name="text">
<string>Выход</string>
</property>
<property name="menuRole">
<enum>QAction::MenuRole::QuitRole</enum>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

78
src/UI/Del_preset.ui Normal file
View File

@ -0,0 +1,78 @@
<?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>23</x>
<y>310</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_3">
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 0, 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
src/UI/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>

532
src/UI/Settings.ui Normal file
View File

@ -0,0 +1,532 @@
<?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>379</width>
<height>337</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="QPlainTextEdit" name="input_tarif">
<property name="geometry">
<rect>
<x>280</x>
<y>90</y>
<width>71</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="Tarif">
<property name="geometry">
<rect>
<x>20</x>
<y>90</y>
<width>221</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_q_trash">
<property name="geometry">
<rect>
<x>280</x>
<y>130</y>
<width>71</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="Q_trash">
<property name="geometry">
<rect>
<x>20</x>
<y>130</y>
<width>201</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_price_pastik">
<property name="geometry">
<rect>
<x>280</x>
<y>170</y>
<width>71</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="Price_plastik">
<property name="geometry">
<rect>
<x>20</x>
<y>170</y>
<width>181</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_overprice">
<property name="geometry">
<rect>
<x>280</x>
<y>210</y>
<width>71</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="Over_price">
<property name="geometry">
<rect>
<x>20</x>
<y>210</y>
<width>181</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_plastik">
<property name="geometry">
<rect>
<x>20</x>
<y>250</y>
<width>181</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="plastik_menu">
<property name="geometry">
<rect>
<x>280</x>
<y>250</y>
<width>71</width>
<height>25</height>
</rect>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="toolTipDuration">
<number>-1</number>
</property>
<property name="styleSheet">
<string notr="true">alternate-background-color: rgb(77, 77, 77);</string>
</property>
<property name="currentText">
<string>1000</string>
</property>
<property name="currentIndex">
<number>2</number>
</property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
<property name="placeholderText">
<string/>
</property>
<item>
<property name="text">
<string>5000</string>
</property>
</item>
<item>
<property name="text">
<string>2500</string>
</property>
</item>
<item>
<property name="text">
<string>1000</string>
</property>
</item>
<item>
<property name="text">
<string>750</string>
</property>
</item>
<item>
<property name="text">
<string>500</string>
</property>
</item>
<item>
<property name="text">
<string>250</string>
</property>
</item>
</widget>
<widget class="QLabel" name="warning_text">
<property name="geometry">
<rect>
<x>30</x>
<y>10</y>
<width>311</width>
<height>51</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string>ВНИМАНИЕ! Перед установкой параметра &quot;Коэффициент выбраковки&quot; прочитайте раздел Помощь, с описанием формулы расчета!</string>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>300</y>
<width>331</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="save">
<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="exit">
<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>

129
src/UI/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>379</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>

54
src/UI/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>

143
src/UI/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>

427
src/UI/preset_settings.ui Normal file
View File

@ -0,0 +1,427 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>addprinter</class>
<widget class="QDialog" name="addprinter">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>375</width>
<height>195</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="price_printer">
<property name="geometry">
<rect>
<x>20</x>
<y>120</y>
<width>181</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_prise_printer">
<property name="geometry">
<rect>
<x>290</x>
<y>120</y>
<width>71</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::InputMethodHint::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::LineWrapMode::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="power_printer">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>181</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="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>160</y>
<width>341</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="save">
<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="cancel">
<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 class="QPlainTextEdit" name="input_time_to_use">
<property name="geometry">
<rect>
<x>290</x>
<y>90</y>
<width>71</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::InputMethodHint::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::LineWrapMode::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="QPlainTextEdit" name="input_power">
<property name="geometry">
<rect>
<x>290</x>
<y>60</y>
<width>71</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::InputMethodHint::ImhDigitsOnly</set>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::LineWrapMode::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="QTextEdit" name="Input_name_printer">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>180</x>
<y>20</y>
<width>181</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<stylestrategy>PreferAntialias</stylestrategy>
<kerning>false</kerning>
</font>
</property>
<property name="tabletTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(77, 77, 77);</string>
</property>
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Sunken</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="autoFormatting">
<set>QTextEdit::AutoFormattingFlag::AutoBulletList</set>
</property>
<property name="tabChangesFocus">
<bool>true</bool>
</property>
<property name="documentTitle">
<string notr="true"/>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="lineWrapMode">
<enum>QTextEdit::LineWrapMode::WidgetWidth</enum>
</property>
<property name="markdown">
<string/>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property>
<property name="cursorWidth">
<number>1</number>
</property>
<property name="textInteractionFlags">
<set>Qt::TextInteractionFlag::TextEditorInteraction</set>
</property>
<property name="placeholderText">
<string>Название принтера</string>
</property>
</widget>
<widget class="QLabel" name="time_to_use">
<property name="geometry">
<rect>
<x>20</x>
<y>90</y>
<width>261</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="name_printer">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>181</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>
<resources/>
<connections/>
</ui>

50
src/calculating.c Normal file
View File

@ -0,0 +1,50 @@
#include "calculating.h"
// Функция cost_prise
double cost_prise(double p, double t, double h, double md, double d, double st, double mk, double am, double post, int x) {
p = fabs(p); // номинальная мощность принтера
t = fabs(t); // время печати, в минутах
h = fabs(h); // тариф электроэнергии
md = fabs(md); // вес детали
d = (d < 1) ? 1 : fabs(d); // коэффициент выбраковки
st = fabs(st); // стоимость катушки
mk = fabs(mk); // вес катушки
am = fabs(am); // амортизация
post = fabs(post); // постобработка (обязательно проверить значение)
x = abs(x); // количество экземпляров
double result = ((p / 1000) * (t / 60) * h + (md * d * (st / mk)) + (am + post)) * x;
return round(result * 100) / 100; // округление до 2 знаков после запятой
}
// Функция calculating
double calculating(double cost, double mod, double marg) {
mod = fabs(mod); // моделирование
double margin = fabs(marg); // процент наценки
double result = (margin / 100 * cost + cost) + mod;
return round(result * 100) / 100; // округление до 2 знаков после запятой
}
// Функция amortization
double amortization(double a, double t, double spi) {
// количество минут в году
double minutes_in_year = 525600;
// Если СПИ установлен на 0, то присваеваем 1 (год)
double year_norm;
if (spi == 0) {
year_norm = 100 / 1;
} else {
year_norm = 100 / spi;
}
//Считаем годовую амортизациюcost
double year_am = a * year_norm / 100;
//Считаем амортизацию за минуту и умножаем на время печати
double am_per_minute = year_am / minutes_in_year * t;
return am_per_minute; // округление до 2 знаков после запятой
}

12
src/calculating.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef CALCULATING_H
#define CALCULATING_H
#include <math.h>
#include <stdlib.h>
// Объявления функций
double cost_prise(double p, double t, double h, double md, double d, double st, double mk, double am, double post, int x);
double calculating(double cost, double mod, double marg);
double amortization(double a, double t, double spi);
#endif // CALCULATING_H

BIN
src/img/calc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

1
src/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
src/img/exit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

1
src/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
src/img/logo-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
src/img/logo-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/logo-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/img/logo-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
src/img/logo-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
src/img/logo-6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
src/img/logo-7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/img/logo-8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

BIN
src/img/modeling.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/img/quantity.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/img/rubl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

BIN
src/img/time.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/img/weight.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

69
src/main.c Normal file
View File

@ -0,0 +1,69 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "calculating.h" // Подключаем заголовочный файл
// Загрузка настроек (заглушка, нужно заменить на чтение из БД)
void load_settings(double *p, double *h, double *d, double *st, double *mk, double *a, double *spi, double *marge) {
*p = 270; // номинальная мощность принтера
*h = 3; // тариф электроэнергии
*d = 1.5; // коэффициент выбраковки
*st = 1500; // стоимость катушки
*mk = 1000; // вес катушки
*a = 15000; // амортизация
*spi = 3; // срок полезного использования
*marge = 150; // наценка
}
int main() {
// Загрузка настроек
double p, h, d, st, mk, a, spi, marge;
load_settings(&p, &h, &d, &st, &mk, &a, &spi, &marge);
// Ввод данных от пользователя
printf("Введите параметры для расчета:\n");
double hours, minutes;
printf("Время печати (часы): ");
scanf("%lf", &hours);
printf("Время печати (минуты): ");
scanf("%lf", &minutes);
if (minutes > 60) {
hours += (int)(minutes / 60);
minutes = fmod(minutes, 60); // Используем fmod для остатка от деления
}
double t = hours * 60 + minutes; // Общее время в минутах
double md;
printf("Масса детали (г): ");
scanf("%lf", &md);
int x;
printf("Количество экземпляров (шт): ");
scanf("%d", &x);
double mod;
printf("Моделирование (руб): ");
scanf("%lf", &mod);
double post;
printf("Постобработка (руб): ");
scanf("%lf", &post);
// Расчет амортизации
double am = amortization(a, t, spi);
// Расчет себестоимости
double cost = cost_prise(p, t, h, md, d, st, mk, am, post, x);
// Расчет итоговой стоимости
double result = calculating(cost, mod, marge);
// Вывод результатов
printf("\nРезультаты расчета:\n");
printf("Себестоимость: %.2f руб.\n", cost);
printf("Итоговая стоимость: %.2f руб.\n", result);
return 0;
}

View File

@ -1,76 +0,0 @@
import gettext
import json
import os
if not os.path.isfile('setts.json'):
with open('setts.json', 'w') as file:
data = {"settings": {"theme": "Dark",
"p": "270",
"h": "3",
"d": "1.5",
"st": "1500",
"mk": "1000",
"a": "0",
"spi": "3",
"marg": "0",
"locale": "Ru",
"currency": "руб."}}
json.dump(data, file, indent=2)
with open('setts.json') as file:
old_data = json.load(file)
if old_data['settings']["locale"] == 'English':
locale = 'en_US'
else:
locale = 'ru_RU'
lang = gettext.translation('locale', localedir='locale', languages=[locale])
lang.install()
_ = lang.gettext
calc = (_("Формула расчета стоимости печати выглядит так:\n\n"
"S = ((p/1000*t/60*h)+(md*d*st/mk)+am+post))*x+mod\n\n"
"где:\n"
"S - стоимость печати, руб.\n"
"p - мощность принтера, Вт\n"
"t - время печати, мин.\n"
"h - тариф на электроэнергию, кВт/ч\n"
"md - вес детали, гр.\n"
"st - стоимость катушки пластика, руб.\n"
"mk - вес пластика в катушке, гр.\n"
"d - коэффициент выбраковки\n"
"am - амортизация, руб.\n"
"post - стоимость постобработки, руб.\n"
"х - количество печатаемых дубликатов, шт.\n"
"mod - стоимость моделирования, руб.\n\n"
"При этом в расчете вес детали, умножается на 1.5,\n"
"это сделано для выбраковки и тестовой печати,"
"т.е. при калькуляции вес одной детали для печати\n"
"считается как 1,5 детали "
"Можете изменить этот пункт в настройках.\n\n"))
about = (_("По вопросам и предложениям писать в телеграм на @RisenYT\n\n"))
amortization_calc = (_('Как считается амортизация:\n\n'
'Отчисления записываются \n'
'частями в зависимости от времени \n'
'печати конкретного изделия\n'
'Рекомендую задавать СПИ (это время\n'
'окупаемости принтера) 3 года.\n'
'Калькулятор считает амортизацию в\n'
'минуту и умножает на количество минут,\n'
'которые принтер будет печатать.'))
not_connect = (_('Невозможно проверить обновление.\n\n'
'Отсутствует подключение к интернету\n'
'или программа заблокирована фаерволом.\n\n'
'Для продолжения работы нажмите "Ok"'))
new_sets = (_('Задайте стоимость принтера, \n'
'срок полезного использования\n'
'в настройках амортизации\n'))
new_marge = (_('Задайте процент желаемой наценки\n'
'в настройках (можно просто проставить ноль)'))
ver = '0.6.4'

View File

@ -1,90 +0,0 @@
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()])
lang.install()
_ = lang.gettext
def upd_check():
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/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