add: connection

This commit is contained in:
Risen 2024-12-08 19:46:50 +03:00
parent 79b8960e43
commit 900a83be54
13 changed files with 48 additions and 1579 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@
/build /build
/dist /dist
Calc3D.spec Calc3D.spec
/releases /releases
*.ui

View File

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

957
Calc3d.ui
View File

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

View File

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

View File

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

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

View File

@ -1,129 +0,0 @@
<?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.

View File

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

BIN
calc3d Normal file

Binary file not shown.

46
connection.py Normal file
View File

@ -0,0 +1,46 @@
from PySide6 import QtWidgets, QtSql
class Data:
def __init__(self):
super(Data, self).__init__()
def create_connection(self):
db = QtSql.QSqlDatabase.addDatabase('QSQLITE')
db.setDatabaseName('calc3d')
if not db.open():
QtWidgets.QMessageBox.critical(None, 'Error', 'Не найдена база данных калькулятора',
'Cancel',
QtWidgets.QMessageBox.Cancel)
return False
query = QtSql.QSqlQuery()
query.exec("CREATE TABLE IF NOT EXISTS printers (ID integer primary key autoincrement,"
"Printer_name VARCHAR(30) unique, Price_printer integer, Printer_power integer, kilowatt_price)")
return True
def execute_query_with_params(self, sql_query, query_values=None):
query = QtSql.QSqlQuery()
query.prepare(sql_query)
if query_values is not None:
for value in query_values:
query.addBindValue(query_values)
query.exec()
def add_settings(self, kilowatt_price, ):
pass
def add_printer(self, printer_name, printer_power, price_printer):
sql_query = "INSERT INTO printers (Printer_name, Printer_power, Price_printer) VALUES (?, ?, ?)"
self.execute_query_with_params(sql_query, [printer_name, printer_power, price_printer])
def edit_printer(self, id, printer_name, printer_power, price_printer):
sql_query = "UPDATE printers SET Printer_name=?, Printer_power=?, Price_printer=? WHERE ID=?"
self.execute_query_with_params(sql_query, [id, printer_name, printer_power, price_printer])
def delete_printer(self, id):
sql_query = "DELETE FROM printers WHERE ID=?"
self.execute_query_with_params(sql_query, [id])

78
db.py
View File

@ -1,78 +0,0 @@
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()

View File

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