Merge pull request #5 from Ranzo/fix_pack

Fix pack
This commit is contained in:
Risen 2023-06-03 19:18:06 +03:00 committed by GitHub
commit 53e56e4bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -47,8 +47,8 @@ def create_window():
[Sgi.Txt('_' * 46, pad=(10, 5))], [Sgi.Txt('_' * 46, pad=(10, 5))],
[Sgi.Text(_('Время печати')), Sgi.Push(), Sgi.InputText('0', size=(5, 20)), Sgi.Text(_('ч.')), [Sgi.Text(_('Время печати')), Sgi.Push(), Sgi.InputText('0', size=(5, 20)), Sgi.Text(_('ч.')),
Sgi.InputText('0', size=(5, 0)), 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.Push(), Sgi.InputText('0', size=(10, 20), justification='right', ),
Sgi.Text(_('гр. '))], Sgi.Text(_('г. '))],
[Sgi.Text(_('Количество экземпляров')), Sgi.Push(), Sgi.InputText('1', size=(10, 20), justification='right', ), [Sgi.Text(_('Количество экземпляров')), Sgi.Push(), Sgi.InputText('1', size=(10, 20), justification='right', ),
Sgi.Text(_('шт. '))], Sgi.Text(_('шт. '))],
[Sgi.Txt('_' * 46)], [Sgi.Txt('_' * 46)],
@ -57,7 +57,7 @@ def create_window():
[Sgi.Text(_('Постобработка')), Sgi.Push(), Sgi.InputText('0', size=(10, 20), justification='right', ), [Sgi.Text(_('Постобработка')), Sgi.Push(), Sgi.InputText('0', size=(10, 20), justification='right', ),
Sgi.Text(_('руб. '))], Sgi.Text(_('руб. '))],
[Sgi.Txt('_' * 46)], [Sgi.Txt('_' * 46)],
[Sgi.Txt(' ' * 15), Sgi.ReadFormButton(_('Расчитать'), size=(10, 2)), Sgi.Cancel(_('Выход'), size=(10, 2))] [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') return Sgi.Window(f'Calc3D by Risen ver.{ver}', layout, icon='logo.ico')
@ -86,7 +86,7 @@ def main():
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:
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(os.path.expanduser('setts.json')) as f:
params = json.load(f)["settings"] params = json.load(f)["settings"]
try: try:

View File

@ -15,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(md) * abs(d) * (abs(st) / abs(mk)) + abs(am) + abs(post)) * 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)

Binary file not shown.