Compare commits
No commits in common. "d1ec46d7e3604f2c4142c84129405e4bf8b32769" and "43ce6eaeef993b83dbfa76ad27ace4b22dc7f2b3" have entirely different histories.
d1ec46d7e3
...
43ce6eaeef
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
/venv
|
|
||||||
/.idea
|
|
||||||
/build
|
|
@ -8,7 +8,7 @@ import requests
|
|||||||
from calculating import calculating, amortization, cost_prise
|
from calculating import calculating, amortization, cost_prise
|
||||||
from setts import window_setts, language, currency_setts
|
from setts import window_setts, language, currency_setts
|
||||||
from texts import calc, about, new_marge, ver, not_connect
|
from texts import calc, about, new_marge, ver, not_connect
|
||||||
from update import upd_check
|
from update import upd_check, upd_start
|
||||||
|
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ _ = lang.gettext
|
|||||||
|
|
||||||
|
|
||||||
def create_window():
|
def create_window():
|
||||||
with open(os.path.expanduser('setts.json')) as f:
|
with open('setts.json') as f:
|
||||||
theme = json.load(f)['settings']['theme']
|
theme = json.load(f)['settings']['theme']
|
||||||
Sgi.theme(theme)
|
Sgi.theme(theme)
|
||||||
menu_def = [
|
menu_def = [
|
||||||
@ -57,6 +57,7 @@ def create_window():
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
upd_start()
|
||||||
window = create_window()
|
window = create_window()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@ -80,7 +81,7 @@ def main():
|
|||||||
Sgi.popup_ok(not_connect)
|
Sgi.popup_ok(not_connect)
|
||||||
|
|
||||||
elif event == _('Рассчитать'):
|
elif event == _('Рассчитать'):
|
||||||
with open(os.path.expanduser('setts.json')) as f:
|
with open('setts.json') as f:
|
||||||
params = json.load(f)["settings"]
|
params = json.load(f)["settings"]
|
||||||
try:
|
try:
|
||||||
hours = float(values[1])
|
hours = float(values[1])
|
||||||
|
38
Calc3D.spec
38
Calc3D.spec
@ -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'],
|
|
||||||
)
|
|
@ -3,10 +3,7 @@ def cost_prise(p, t, h, md, d, st, mk, am, post, x):
|
|||||||
t = int(t) # время печати, в минутах!!!
|
t = int(t) # время печати, в минутах!!!
|
||||||
h = float(h) # тариф электроэнергии
|
h = float(h) # тариф электроэнергии
|
||||||
md = float(md) # вес детали
|
md = float(md) # вес детали
|
||||||
if float(d) < 1:
|
d = float(d) # коэффициент выбраковки
|
||||||
d = 1
|
|
||||||
else:
|
|
||||||
d = float(d) # коэффициент выбраковки
|
|
||||||
st = float(st) # стоимость катушки
|
st = float(st) # стоимость катушки
|
||||||
mk = float(mk) # вес катушки
|
mk = float(mk) # вес катушки
|
||||||
am = float(am) # амортизация
|
am = float(am) # амортизация
|
||||||
@ -18,7 +15,7 @@ def cost_prise(p, t, h, md, d, st, mk, am, post, x):
|
|||||||
x = int(x) # количество экземпляров
|
x = int(x) # количество экземпляров
|
||||||
except ValueError:
|
except ValueError:
|
||||||
x = 1
|
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))
|
result = (abs(p) / 1000 * abs(t) / 60 * abs(h)) + (abs(md) * abs(d) * (abs(st) / abs(mk)) + abs(am) + abs(post)) * abs(x)
|
||||||
return round(result, 2)
|
return round(result, 2)
|
||||||
|
|
||||||
|
|
||||||
|
BIN
dist/Calc3D.exe
vendored
BIN
dist/Calc3D.exe
vendored
Binary file not shown.
33
dist/Calc3D.exe.ppdb
vendored
33
dist/Calc3D.exe.ppdb
vendored
@ -1,33 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#Author: risen
|
|
||||||
#Calc3D.exe
|
|
||||||
#Rating=1-5
|
|
||||||
#####################examples###########################
|
|
||||||
##export PW_WINDOWS_VER=10 # Set windows version 10, 7 or XP
|
|
||||||
##export PW_DLL_INSTALL="vcrun2017" # Install DLL in port prefix (used winetricks)
|
|
||||||
##export WINEDLLOVERRIDES="blabla=n,b"
|
|
||||||
##export LAUNCH_PARAMETERS="+com_skipIntroVideo 1 +com_skipSignInManager 1" # Additional launch options
|
|
||||||
export PW_VULKAN_USE="2"
|
|
||||||
##export PW_VULKAN_NO_ASYNC=1 # Disabled ASYNC for VULKAN
|
|
||||||
##export PW_OLD_GL_STRING=1
|
|
||||||
##export PW_HIDE_NVIDIA_GPU=1
|
|
||||||
##export PW_FORCE_USE_VSYNC=0 # Vsync: 0-FORCE_OFF, 1-FORCE_ON, 2-BY_DEFAULT
|
|
||||||
##export PW_VIRTUAL_DESKTOP=1
|
|
||||||
##export VKD3D_CONFIG=force_bindless_texel_buffer,multi_queue
|
|
||||||
##export ENABLE_VKBASALT=1
|
|
||||||
##export PW_VKBASALT_EFFECTS="FakeHDR:cas" # Use Reshade in others games (dx9-12 to vulkan only)
|
|
||||||
##export PW_VKBASALT_FFX_CAS="0.75" # FidelityFX Contrast Adaptive Sharpening (min 0 - max 1)
|
|
||||||
##export PW_NO_FSYNC=1 # Do not use futex-based in-process synchronization primitives. (Automatically disabled on systems with no FUTEX_WAIT_MULTIPLE support.
|
|
||||||
##export PW_NO_ESYNC=0 # Do not use eventfd-based in-process synchronization primitives
|
|
||||||
##export PW_USE_GSTREAMER=1 # 0 - disabled use winegstreamer
|
|
||||||
##export PW_REDUCE_PULSE_LATENCY=1 # Fix crackling audio in games
|
|
||||||
##export PW_NO_WRITE_WATCH=1 # Disable support for memory write watches in ntdll. This is a very dangerous hack and should only be applied if you have verified that the game can operate without write watches. This improves performance for some very specific games (e.g. CoreRT-based games).
|
|
||||||
##export PW_HEAP_DELAY_FREE=1
|
|
||||||
##export WINEARCH=win32 # defaut = win64
|
|
||||||
##export WINEPREFIX=
|
|
||||||
##export PW_USE_TERMINAL=1 # Force run in terminal
|
|
||||||
##export PW_GUI_DISABLED_CS=1 # 1 = disabled GUI
|
|
||||||
##export PATH_TO_GAME=
|
|
||||||
##add_in_start_portwine () { commands ; }
|
|
||||||
export PW_WINE_USE="PROTON_LG_9-2"
|
|
||||||
export PW_PREFIX_NAME="DEFAULT"
|
|
BIN
requirements.txt
Normal file
BIN
requirements.txt
Normal file
Binary file not shown.
15
setts.json
15
setts.json
@ -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."
|
|
||||||
}
|
|
||||||
}
|
|
26
setts.py
26
setts.py
@ -8,7 +8,7 @@ from lists import themes_list, lang_list, currency_list
|
|||||||
|
|
||||||
|
|
||||||
def language():
|
def language():
|
||||||
with open(os.path.expanduser('setts.json')) as file:
|
with open('setts.json') as file:
|
||||||
old_data = json.load(file)
|
old_data = json.load(file)
|
||||||
if old_data['settings']["locale"] == 'English':
|
if old_data['settings']["locale"] == 'English':
|
||||||
locale = 'en_US'
|
locale = 'en_US'
|
||||||
@ -25,19 +25,12 @@ _ = lang.gettext
|
|||||||
def currency_setts():
|
def currency_setts():
|
||||||
with open('setts.json') as file:
|
with open('setts.json') as file:
|
||||||
old_data = json.load(file)
|
old_data = json.load(file)
|
||||||
try:
|
if old_data['settings']["currency"] == 'руб.':
|
||||||
if old_data['settings']["currency"] == 'руб.':
|
currency = 'руб.'
|
||||||
currency = 'руб.'
|
elif old_data['settings']["currency"] == '$':
|
||||||
elif old_data['settings']["currency"] == '$':
|
currency = '$'
|
||||||
currency = '$'
|
else:
|
||||||
else:
|
currency = '€'
|
||||||
currency = '€'
|
|
||||||
|
|
||||||
except KeyError:
|
|
||||||
if old_data['settings']["locale"] == "рус.":
|
|
||||||
currency = 'руб.'
|
|
||||||
else:
|
|
||||||
currency = '$'
|
|
||||||
return currency
|
return currency
|
||||||
|
|
||||||
|
|
||||||
@ -52,10 +45,7 @@ def window_setts():
|
|||||||
mk = old_data["settings"]["mk"]
|
mk = old_data["settings"]["mk"]
|
||||||
a = old_data["settings"]["a"]
|
a = old_data["settings"]["a"]
|
||||||
locale = old_data['settings']["locale"]
|
locale = old_data['settings']["locale"]
|
||||||
try:
|
currency = old_data['settings']["currency"]
|
||||||
currency = old_data['settings']["currency"]
|
|
||||||
except KeyError:
|
|
||||||
currency = "руб."
|
|
||||||
try:
|
try:
|
||||||
spi = old_data["settings"]["spi"]
|
spi = old_data["settings"]["spi"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
2
texts.py
2
texts.py
@ -73,4 +73,4 @@ new_sets = (_('Задайте стоимость принтера, \n'
|
|||||||
new_marge = (_('Задайте процент желаемой наценки\n'
|
new_marge = (_('Задайте процент желаемой наценки\n'
|
||||||
'в настройках (можно просто проставить ноль)'))
|
'в настройках (можно просто проставить ноль)'))
|
||||||
|
|
||||||
ver = '0.6.4'
|
ver = '0.6.1'
|
||||||
|
60
update.py
60
update.py
@ -44,9 +44,7 @@ def upd_check():
|
|||||||
else:
|
else:
|
||||||
Sgi.theme(set_theme)
|
Sgi.theme(set_theme)
|
||||||
layout = [
|
layout = [
|
||||||
[Sgi.Text(_('Последняя версия: ')+f'{version_new}'+_('\nВаша версия: ')+f'{version_old}'+_('\n\n'
|
[Sgi.Text(_('Последняя версия: ')+f'{version_new}'+_('\nВаша версия: ')+f'{version_old}'+_('\n\nОбновление не требуется'))],
|
||||||
'Обновление не'
|
|
||||||
' требуется'))],
|
|
||||||
[Sgi.Button(_(' Закрыть '))]
|
[Sgi.Button(_(' Закрыть '))]
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -60,31 +58,31 @@ def upd_check():
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
# def upd_start():
|
def upd_start():
|
||||||
# with open('setts.json') as json_file:
|
with open('setts.json') as json_file:
|
||||||
# data = json.load(json_file)
|
data = json.load(json_file)
|
||||||
# set_theme = data["settings"]["theme"]
|
set_theme = data["settings"]["theme"]
|
||||||
#
|
|
||||||
# version_new = requests.get('https://risenhome.xyz/feed/Risen.json').json()["version"]["ver"]
|
version_new = requests.get('https://risenhome.xyz/feed/Risen.json').json()["version"]["ver"]
|
||||||
# version_old = ver
|
version_old = ver
|
||||||
#
|
|
||||||
# if version_new > version_old:
|
if version_new > version_old:
|
||||||
#
|
|
||||||
# Sgi.theme(set_theme)
|
Sgi.theme(set_theme)
|
||||||
# layout = [
|
layout = [
|
||||||
# [Sgi.Text(_("Обновление"))],
|
[Sgi.Text(_("Обновление"))],
|
||||||
# [Sgi.Text(_("Вышла новая версия программы\nНужно обновиться"))],
|
[Sgi.Text(_("Вышла новая версия программы\nНужно обновиться"))],
|
||||||
# [Sgi.Button(_(' Скачать ')), Sgi.Push(), Sgi.Button(' Отмена ')]
|
[Sgi.Button(_(' Скачать ')), Sgi.Push(), Sgi.Button(' Отмена ')]
|
||||||
# ]
|
]
|
||||||
#
|
|
||||||
# window = Sgi.Window(_("Вышла новая версия!"), layout, modal=True)
|
window = Sgi.Window(_("Вышла новая версия!"), layout, modal=True)
|
||||||
#
|
|
||||||
# while True:
|
while True:
|
||||||
# event, button = window.read()
|
event, button = window.read()
|
||||||
# if event == _(' Скачать '):
|
if event == _(' Скачать '):
|
||||||
# webbrowser.open('https://risenhome.xyz', new=2, autoraise=True)
|
webbrowser.open('https://risenhome.xyz', new=2, autoraise=True)
|
||||||
# window.close()
|
window.close()
|
||||||
# elif event == _(' Отмена '):
|
elif event == _(' Отмена '):
|
||||||
# window.close()
|
window.close()
|
||||||
# elif event == "Exit" or event == Sgi.WIN_CLOSED:
|
elif event == "Exit" or event == Sgi.WIN_CLOSED:
|
||||||
# break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user