Browse Source

1. sorted and reconfig import
2. add window lib and pyinstaller config lib
3. add module cam

Алексей Сидоров 1 year ago
parent
commit
eee06736a8

+ 73 - 0
PropuskWidgets/PCamChecked.py

@@ -0,0 +1,73 @@
+
+from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, QComboBox, QPushButton
+from PropuskWidgets.PStackedWidget import PStackedWidget
+from module.cam import IPCam, USBCam, load_image, get_list_name_cam
+import os
+
+class PCamChecked(QWidget):
+    def __init__(self, parent=None, mode: str = 'video') -> None:
+        super().__init__(parent)
+        
+        self.__mode = mode
+        self.vLayout = QVBoxLayout(self)
+        self.vLayout.setObjectName(u'vLayout')
+        
+        match self.__mode:
+            case 'video': 
+                self.line_cam = QComboBox(self)
+                #load list cam
+                [self.line_cam.addItem(x) for x in get_list_name_cam()]
+            case 'snapshot': self.line_cam = QLineEdit(self)
+
+        self.line_cam.setObjectName(u"line_cam")
+        self.vLayout.addWidget(self.line_cam)
+
+        self.pStackedWidget = PStackedWidget(self, mode=mode)
+        self.pStackedWidget.setObjectName(u'pStackedWidget')
+        self.vLayout.addWidget(self.pStackedWidget)
+
+        self.hLayout = QHBoxLayout()
+        self.hLayout.setObjectName(u'hLayout')
+
+        self.btn_check = QPushButton(self)
+        self.btn_check.setObjectName('btn_check')
+        self.btn_check.setText('Проверить')
+        self.btn_check.clicked.connect(self._start_cam)
+        self.hLayout.addWidget(self.btn_check)
+
+        self.btn_stop = QPushButton(self)
+        self.btn_stop.setObjectName('btn_stop')
+        self.btn_stop.setText('Остановить')
+        self.btn_stop.clicked.connect(self._stop_cam)
+        self.hLayout.addWidget(self.btn_stop)
+        
+        self.vLayout.addLayout(self.hLayout)
+
+
+    def get_value(self) -> str:
+        match self.__mode:
+            case 'video':
+                return self.line_cam.currentText()
+            case 'snapshot':
+                return self.line_cam.text()
+            case _: return None
+
+    def _start_cam(self) -> None:
+        self.pStackedWidget.to_video()
+        match self.__mode:
+            case 'video':
+                self.__wwc = USBCam(self.pStackedWidget.video, self.line_cam.currentText())
+                self.__wwc.start_cam()
+            case 'snapshot':
+                self.__wwc = IPCam()
+                self.__wwc.qLabel = self.pStackedWidget.video
+                self.__wwc.lnk_connect = self.line_cam.text()
+                self.__wwc.start()
+                print("Started...")
+            case _: return None
+
+
+    def _stop_cam(self):
+        self.__wwc.stop_cam()  
+        del self.__wwc
+        self.pStackedWidget.to_image()

+ 59 - 0
PropuskWidgets/PStackedWidget.py

@@ -0,0 +1,59 @@
+from PySide6.QtWidgets import QStackedWidget, QWidget, QLabel, QGridLayout
+from PySide6.QtMultimediaWidgets import QVideoWidget
+from module.cam.USBCam import load_image
+import os
+
+
+class PStackedWidget(QStackedWidget):
+    def __init__(self, parent=None, mode='video'):
+        super(PStackedWidget, self).__init__(parent)
+        self.__mode = mode
+
+        self.__setup_image_stacked()
+        self.__setup_video_stacked()
+        self.set_default_image()
+
+    def __setup_image_stacked(self) -> None:
+        self.page_image = QWidget()
+        self.page_image.setObjectName("page_image")
+
+        self.layout_image = QGridLayout(self.page_image)
+        self.layout_image.setObjectName("layout_image")
+
+        self.image = QLabel(self.page_image)
+        self.image.setObjectName("image")
+        self.layout_image.addWidget(self.image, 0, 0, 0, 0)
+
+        self.addWidget(self.page_image)
+
+    def __setup_video_stacked(self) -> None:
+        self.page_video = QWidget()
+        self.page_video.setObjectName("page_video")
+
+        self.layout_video = QGridLayout(self.page_video)
+        self.layout_video.setObjectName("layout_video")
+
+        if self.__mode == 'video':
+            self.video = QVideoWidget(self.page_video)
+        else:
+            self.video = QLabel(self.page_video)
+
+        self.video.setObjectName("video")
+        self.layout_video.addWidget(self.video, 0, 0, 0, 0)
+
+        self.addWidget(self.page_video)
+
+    def set_default_image(self) -> None:
+        load_image(self.image, os.environ.get("NO_MEDIA_IMAGE"))
+
+    def to_image(self) -> None:
+        self.setCurrentIndex(0)
+
+    def to_video(self) -> None:
+        self.setCurrentIndex(1)
+
+    def cupture_image(self) -> None:
+        if self.__mode == 'video':
+            self.video = self.video.cupture_image(self.image)
+        else:
+            self.video = self.video.cupture_image(self.image)

+ 0 - 13
PropuskWidgets/VIdeoPhotoStackedWidgets.py

@@ -1,13 +0,0 @@
-from PySide6.QtWidgets import QStackedWidget, QWidget, QLabel
-
-class StackedWidget(QStackedWidget):
-    def __init__(self, parent=None):
-        super(StackedWidget, self).__init__(parent)
-        
-        self.addWidget()
-    
-    def setup_image_stacked(self) -> None:
-        ...    
-        
-    def setup_video_stacked(self) -> None:
-        ...    

+ 1 - 1
init_var.py

@@ -5,7 +5,7 @@ from dotenv import load_dotenv
 from window.DialogCustomVariables import DialogCustomVariables
 from window.DialogCustomVariables import DialogCustomVariables
 
 
 
 
-__VERSION = "ver 0.2"
+__VERSION = "ver 0.3 beta"
 DEFAULT_PATH = os.path.join(appdirs.user_data_dir(), "propusk")
 DEFAULT_PATH = os.path.join(appdirs.user_data_dir(), "propusk")
 DEFAULT_PATH_PHOTO = os.path.join(DEFAULT_PATH, "photo")
 DEFAULT_PATH_PHOTO = os.path.join(DEFAULT_PATH, "photo")
 
 

+ 5 - 0
module/ImageTool.py

@@ -1,6 +1,8 @@
 from PIL import Image, UnidentifiedImageError
 from PIL import Image, UnidentifiedImageError
 import os
 import os
 from logger import logger
 from logger import logger
+from datetime import datetime
+
 
 
 def rotate_image(path_file: str, gradus: int = -90) -> str:
 def rotate_image(path_file: str, gradus: int = -90) -> str:
     try:
     try:
@@ -22,3 +24,6 @@ def rotate_image(path_file: str, gradus: int = -90) -> str:
         logger.error(F"Не правильный формат: {path_file=}")
         logger.error(F"Не правильный формат: {path_file=}")
         return None
         return None
 
 
+
+def create_filename() -> str:
+    return os.path.join(os.environ.get('PHOTO_DIR'), F"propusk_{datetime.now().timestamp()}.jpg")

+ 1 - 0
module/WorkWithDB.py

@@ -24,6 +24,7 @@ else:
     
     
 cam_setting = Table("сam_setting", meta,
 cam_setting = Table("сam_setting", meta,
                     Column('id', Integer, primary_key=True),
                     Column('id', Integer, primary_key=True),
+                    Column('mode', String, nullable=False),
                     Column("selected_cam", String, nullable=False),
                     Column("selected_cam", String, nullable=False),
                     Column('created', DateTime, default=func.now()),
                     Column('created', DateTime, default=func.now()),
                     Column('update', DateTime,
                     Column('update', DateTime,

+ 47 - 0
module/cam/IPCam.py

@@ -0,0 +1,47 @@
+from PySide6.QtWidgets import QLabel
+from PySide6.QtCore import Qt
+from threading import Thread
+from PySide6.QtGui import QImage, QPixmap
+import cv2
+from module.ImageTool import create_filename
+
+class IPCam(Thread):
+    lnk_connect: str = None
+    qLabel: QLabel = None
+
+    def __init__(self, parent=None) -> None:
+        Thread.__init__(self, parent)
+        self.status = True
+        self.cap = True
+
+    def run(self) -> None:
+        self.cap = cv2.VideoCapture()
+        
+        while self.status:
+            self.cap.open(self.lnk_connect)
+            ret, frame = self.cap.read()
+            if not ret:
+                continue
+
+            color_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
+            
+            h, w, ch = color_frame.shape
+            img = QImage(color_frame.data, w, h, ch * w, QImage.Format_RGB888)
+            self.__scaled_img = QPixmap.fromImage(img.scaled(640, 480, Qt.KeepAspectRatio))
+
+            self.qLabel.setPixmap(self.__scaled_img)
+
+            # "http://admin:admin102030@192.168.1.108/cgi-bin/snapshot.cgi?2"\
+    
+    def stop_cam(self):
+        print("Stopped...")
+        self.cap.release()
+        self.status = False
+        # cv2.destroyAllWindows()
+        self.join()
+
+    def cupture_image(self, qLabel: QLabel) -> str:
+        name_file = create_filename()
+        qLabel.setPixmap(self.__scaled_img)
+        self.__scaled_img.save(name_file, 'jpg')
+        return name_file

+ 3 - 8
module/WorkWithCam.py → module/cam/USBCam.py

@@ -1,4 +1,3 @@
-import sys
 import os
 import os
 
 
 from PySide6.QtMultimediaWidgets import QVideoWidget
 from PySide6.QtMultimediaWidgets import QVideoWidget
@@ -7,9 +6,9 @@ from PySide6.QtGui import QImage, QPixmap
 from PySide6.QtWidgets import QLabel
 from PySide6.QtWidgets import QLabel
 from PySide6.QtMultimedia import (
 from PySide6.QtMultimedia import (
     QMediaDevices, QCamera, QImageCapture, QMediaCaptureSession)
     QMediaDevices, QCamera, QImageCapture, QMediaCaptureSession)
-from datetime import datetime
 from itertools import groupby
 from itertools import groupby
 from logger import logger
 from logger import logger
+from module.ImageTool import create_filename
 
 
 if not os.environ.get("PHOTO_DIR"):
 if not os.environ.get("PHOTO_DIR"):
     logger.error("Не задана локальная переменная PHOTO_DIR")
     logger.error("Не задана локальная переменная PHOTO_DIR")
@@ -18,7 +17,7 @@ if not os.environ.get("PHOTO_DIR"):
     )
     )
 
 
 
 
-class WorkWithCam:
+class USBCam:
     def __init__(self, q_Video_Widget: QVideoWidget, name_cam: str) -> None:
     def __init__(self, q_Video_Widget: QVideoWidget, name_cam: str) -> None:
         self._create_dirs()
         self._create_dirs()
 
 
@@ -64,7 +63,7 @@ class WorkWithCam:
     def cupture_image(self, label: QLabel) -> str:
     def cupture_image(self, label: QLabel) -> str:
         self._label = label
         self._label = label
         self._current_preview = QImage()
         self._current_preview = QImage()
-        self._file_name = self.get_filename()
+        self._file_name = create_filename()
 
 
         logger.info(F"Создаем файл {self._file_name}")
         logger.info(F"Создаем файл {self._file_name}")
         self._image_capture.captureToFile(self._file_name)
         self._image_capture.captureToFile(self._file_name)
@@ -78,9 +77,6 @@ class WorkWithCam:
     def _camera_error(self, error, error_string):
     def _camera_error(self, error, error_string):
         logger.error(error_string)
         logger.error(error_string)
 
 
-    def get_filename(self) -> str:
-        return os.path.join(os.environ.get('PHOTO_DIR'), F"propusk_{datetime.now().timestamp()}.jpg")
-
     def _create_dirs(self):
     def _create_dirs(self):
         if not os.path.exists(os.environ.get('PHOTO_DIR')):
         if not os.path.exists(os.environ.get('PHOTO_DIR')):
             os.mkdir(os.environ.get('PHOTO_DIR'))
             os.mkdir(os.environ.get('PHOTO_DIR'))
@@ -112,4 +108,3 @@ def get_list_name_cam() -> list:
 
 
 def get_object_cam_by_name(name_cam: str) -> QMediaDevices:
 def get_object_cam_by_name(name_cam: str) -> QMediaDevices:
     return [x for x in QMediaDevices.videoInputs() if x.description() == name_cam][0]
     return [x for x in QMediaDevices.videoInputs() if x.description() == name_cam][0]
-    

+ 2 - 0
module/cam/__init__.py

@@ -0,0 +1,2 @@
+from .IPCam import IPCam
+from .USBCam import *

+ 57 - 0
pyinstaller_window.spec

@@ -0,0 +1,57 @@
+# -*- mode: python ; coding: utf-8 -*-
+
+
+block_cipher = None
+
+
+a = Analysis(
+    ['main.py'],
+    pathex=[],
+    binaries=[],
+    datas=[(
+         'C:/Users/user/AppData/Local/Programs/Python/Python311/Lib/site-packages/PySide6/plugins',
+         './PySide6/plugins'
+        ),
+        ('./win_sub_lib/api-ms-win-core-path-l1-1-0.dll', '.'),
+        ('./win_sub_lib/api-ms-win-shcore-scaling-l1-1-1.dll', '.'),
+        ('./docs', './docs'),
+        ('./image', './image')],
+    hiddenimports=[],
+    hookspath=[],
+    hooksconfig={},
+    runtime_hooks=[],
+    excludes=[],
+    win_no_prefer_redirects=False,
+    win_private_assemblies=False,
+    cipher=block_cipher,
+    noarchive=False,
+)
+pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
+
+exe = EXE(
+    pyz,
+    a.scripts,
+    [],
+    exclude_binaries=True,
+    name='Propusk',
+    debug=False,
+    bootloader_ignore_signals=False,
+    strip=False,
+    upx=True,
+    console=False,
+    disable_windowed_traceback=False,
+    argv_emulation=False,
+    target_arch=None,
+    codesign_identity=None,
+    entitlements_file=None,
+)
+coll = COLLECT(
+    exe,
+    a.binaries,
+    a.zipfiles,
+    a.datas,
+    strip=False,
+    upx=True,
+    upx_exclude=[],
+    name='Propusk',
+)

BIN
win_sub_lib/api-ms-win-core-path-l1-1-0.dll


BIN
win_sub_lib/api-ms-win-shcore-scaling-l1-1-1.dll


+ 38 - 35
window/DialogSettingCam.py

@@ -1,54 +1,57 @@
 from .ui_py.ui_DialogSettingCam import Ui_DialogSettingCam
 from .ui_py.ui_DialogSettingCam import Ui_DialogSettingCam
 from PySide6.QtWidgets import QDialog
 from PySide6.QtWidgets import QDialog
-from PySide6.QtCore import Qt, Slot
-from PySide6.QtMultimedia import QMediaDevices
-from module.WorkWithCam import WorkWithCam, get_list_name_cam, load_image
+from PySide6.QtCore import Qt
+
 from module.WorkWithDB import *
 from module.WorkWithDB import *
+from PropuskWidgets.PCamChecked import PCamChecked
+from logger import logger
+
 
 
 class SettingCam(QDialog, Ui_DialogSettingCam):
 class SettingCam(QDialog, Ui_DialogSettingCam):
     def __init__(self, parent=None) -> None:
     def __init__(self, parent=None) -> None:
         super(SettingCam, self).__init__(parent)
         super(SettingCam, self).__init__(parent)
         self.setAttribute(Qt.WA_DeleteOnClose)
         self.setAttribute(Qt.WA_DeleteOnClose)
         self.setupUi(self)
         self.setupUi(self)
-        
-        self.load_cams()
-        load_image(self.image, os.environ.get("NO_MEDIA_IMAGE"))      
-        self.chacked_cam_face.clicked.connect(self._open_cam_face)
-        self.stop_cam_face.clicked.connect(self._close_cam_face)
-        self.save_setting_cam.clicked.connect(self._save_setting_cam)
-
-    def load_cams(self) -> None:
-        for name in get_list_name_cam():
-            self.face_list_cam.addItem(name)
-        self.load_cams_from_db()
-
-    def _save_setting_cam(self) -> None:
-        self.save_cams(self.face_list_cam.currentText())
-
-    def _open_cam_face(self) -> None:
-        self.stackedWidget.setCurrentIndex(int(os.environ.get('INDEX_CAMERA')))
-        self._cam_face = WorkWithCam(
-            self.video, self.face_list_cam.currentText())
-        self._cam_face.start_cam()
-
-    def _close_cam_face(self) -> None:
-        if self._cam_face:
-            self.stackedWidget.setCurrentIndex(int(os.environ.get('INDEX_PHOTO')))
-        del self._cam_face
-
-    def load_cams_from_db(self):
+
+        self.save_setting_cam.clicked.connect(self.__save_cams)
+        self.mode_list.currentTextChanged.connect(self.__change_mode)
+
+        # self.__recreate_widget()
+        self.__load_cams_from_db()
+        self.__mode = self.mode_list.currentData()
+
+
+    def __change_mode(self) -> None:
+        self.__mode = self.mode_list.currentData()
+        self.__recreate_widget(self.__mode)
+        logger.info(F'Change cams to {self.__mode}')
+
+    def __recreate_widget(self, select_mode: str = 'video') -> None:
+        if hasattr(self, 'widget'):
+            delattr(self, 'widget')
+
+        self.widget = PCamChecked(self.groupBox, mode=select_mode)
+        self.widget.setObjectName('widget')
+        self.gridLayout_3.addWidget(self.widget, 1, 0, 1, 1)
+
+    def __load_cams_from_db(self):
         with connect() as conn:
         with connect() as conn:
             result = conn.execute(cam_setting.select()).fetchone()
             result = conn.execute(cam_setting.select()).fetchone()
             if result:
             if result:
-                self.face_list_cam.setCurrentText(result.selected_cam)
-                
-    def save_cams(self, description_cam: str) -> None:
+                self.__recreate_widget(result.mode)
+                match result.mode:
+                    case 'video': self.widget.line_cam.setCurrentText(result.mode)
+                    case 'snapshot': self.widget.line_cam.setText(result.selected_cam)
+            else: self.__recreate_widget()
+
+    def __save_cams(self) -> None:
         query = None
         query = None
         with connect() as conn:
         with connect() as conn:
             result = conn.execute(cam_setting.select()).fetchone()
             result = conn.execute(cam_setting.select()).fetchone()
             if result is None:
             if result is None:
-                query = cam_setting.insert().values(selected_cam=description_cam)
+                query = cam_setting.insert().values(
+                    mode=self.__mode, selected_cam=self.widget.get_value())
             else:
             else:
                 query = cam_setting.update().where(
                 query = cam_setting.update().where(
-                    cam_setting.c.id == 1).values(selected_cam=description_cam)
+                    cam_setting.c.id == 1).values(mode=self.__mode, selected_cam=self.widget.get_value())
             result = conn.execute(query)
             result = conn.execute(query)

+ 56 - 45
window/MainWindow.py

@@ -3,11 +3,12 @@ from PySide6.QtCore import Slot, QDate, QDateTime
 
 
 from module.WorkWithDB import *
 from module.WorkWithDB import *
 from module.MyMessageBox import show_dialog
 from module.MyMessageBox import show_dialog
-from module.WorkWithCam import WorkWithCam, load_image
+from PropuskWidgets.PStackedWidget import PStackedWidget
 from module.TemplatePropusk import TemplatePropusk
 from module.TemplatePropusk import TemplatePropusk
 from module.Printer import Printer
 from module.Printer import Printer
 from module.lang.ru import *
 from module.lang.ru import *
 from module.ImageTool import rotate_image
 from module.ImageTool import rotate_image
+from module.cam import IPCam, USBCam
 
 
 
 
 from .ui_py.ui_MainWindow import Ui_MainWindow
 from .ui_py.ui_MainWindow import Ui_MainWindow
@@ -33,24 +34,24 @@ class MainWindow(QMainWindow, Ui_MainWindow):
         self.date_from.setDateTime(QDateTime().currentDateTime())
         self.date_from.setDateTime(QDateTime().currentDateTime())
         self.date_to.setDateTime(QDateTime().currentDateTime())
         self.date_to.setDateTime(QDateTime().currentDateTime())
 
 
-        self.stacked_widget_photo.currentChanged.connect(
-            self.current_change_photo
-        )
+        # self.stacked_widget_photo.currentChanged.connect(
+        #     self.current_change_photo
+        # )
 
 
         self._init_menu_btn_action()
         self._init_menu_btn_action()
         self._init_push_btn_action()
         self._init_push_btn_action()
         self._update_list_combobox()
         self._update_list_combobox()
         self._check_setting_cam()
         self._check_setting_cam()
-        self._init_photo()
+        self._init_widget_cam()
 
 
     def open_history(self) -> None:
     def open_history(self) -> None:
         DialogHistory(self).exec_()
         DialogHistory(self).exec_()
 
 
-    def current_change_photo(self):
-        if self.stacked_widget_photo.currentIndex() == os.environ.get('INDEX_CAMERA'):
-            self.btn_start_cam_photo.setText(stop_cam)
-        else:
-            self.btn_start_cam_photo.setText(start_cam)
+    # def current_change_photo(self):
+    #     if self.stacked_widget_photo.currentIndex() == os.environ.get('INDEX_CAMERA'):
+    #         self.btn_start_cam_photo.setText(stop_cam)
+    #     else:
+    #         self.btn_start_cam_photo.setText(start_cam)
 
 
     def _init_menu_btn_action(self) -> None:
     def _init_menu_btn_action(self) -> None:
         self.action_open_history.triggered.connect(self.open_history)
         self.action_open_history.triggered.connect(self.open_history)
@@ -75,7 +76,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
         DialogAbout(self).exec_()
         DialogAbout(self).exec_()
 
 
     def _check_setting_cam(self) -> None:
     def _check_setting_cam(self) -> None:
-        if not self._get_selected_cam():
+        try:
+            self.__mode, self.__cam = self.__get_selected_cam()
+        except ValueError:
             logger.warning(warring_cams.get("title"))
             logger.warning(warring_cams.get("title"))
             show_dialog(
             show_dialog(
                 QMessageBox.Warning,
                 QMessageBox.Warning,
@@ -138,49 +141,52 @@ class MainWindow(QMainWindow, Ui_MainWindow):
                     userData={"id": place.id}
                     userData={"id": place.id}
                 )
                 )
 
 
-    def _get_selected_cam(self) -> bool | str:
+    def __get_selected_cam(self) -> bool:
         with connect() as conn:
         with connect() as conn:
             cam = conn.execute(
             cam = conn.execute(
                 cam_setting.select()
                 cam_setting.select()
             ).fetchone()
             ).fetchone()
 
 
             try:
             try:
-                return cam.selected_cam
+                return cam.mode, cam.selected_cam
             except:
             except:
-                return False
+                raise ValueError('Нет записи о камерах')
 
 
-    def _init_photo(self) -> None:
-        load_image(self.imagePhoto, os.environ.get('NO_MEDIA_IMAGE'))
+    def _init_widget_cam(self) -> None:
+        self.stacked_widget = PStackedWidget(self.groupBox_2, self.__mode)
+        self.stacked_widget.setObjectName(u'stacked_widget')
+        self.verticalLayout_4.addWidget(self.stacked_widget)
 
 
     @Slot()
     @Slot()
     def _start_cam_photo(self) -> None:
     def _start_cam_photo(self) -> None:
-        if self._get_selected_cam():
-            if self.stacked_widget_photo.currentIndex() == int(os.environ.get('INDEX_PHOTO')):
-                self.stacked_widget_photo.setCurrentIndex(
-                    int(os.environ.get('INDEX_CAMERA')))
-                self._create_wwc()
-
-                self.face_wwc.start_cam()
-            else:
-                self.face_wwc.stop_cam()
-                self.stacked_widget_photo.setCurrentIndex(
-                    int(os.environ.get('INDEX_PHOTO')))
+        if not hasattr(self, '__wwc'):
+            if self.stacked_widget.currentIndex() == int(os.environ.get('INDEX_CAMERA')):
+                self.__stop_cam()
+                self.stacked_widget.to_image()
+
+            self.stacked_widget.to_video()
+            self._create_wwc()
 
 
     def _create_wwc(self) -> None:
     def _create_wwc(self) -> None:
-        if not hasattr(self, "face_wwc"):
-            self.face_wwc = WorkWithCam(
-                q_Video_Widget=self.face_video_widget,
-                name_cam=self._get_selected_cam())
+        match self.__mode:
+            case 'video':
+                self.__wwc = USBCam(self.stacked_widget.video, self.__cam)
+                self.__wwc.start_cam()
+            case 'snapshot':
+                self.__wwc = IPCam()
+                self.__wwc.qLabel = self.stacked_widget.video
+                self.__wwc.lnk_connect = self.__cam
+                self.__wwc.start()
+                print("Started...")
+            case _: return None
 
 
     @Slot()
     @Slot()
     def _take_image_face(self) -> None:
     def _take_image_face(self) -> None:
-        if hasattr(self, "face_wwc"):
-            self.face_file_name = self.face_wwc.cupture_image(self.imagePhoto)
-
-            sleep(1)
-            self.stacked_widget_photo.setCurrentIndex(
-                int(os.environ.get('INDEX_PHOTO')))
-            self.face_wwc.stop_cam()
+        self.__file_name = self.__wwc.cupture_image(self.stacked_widget.image)
+            
+        sleep(1)
+        self.stacked_widget.to_image()
+        self.__stop_cam()
 
 
     @Slot()
     @Slot()
     def _print(self) -> None:
     def _print(self) -> None:
@@ -195,8 +201,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
         propusk_data["date_to"] = self.date_to.dateTime().toString(
         propusk_data["date_to"] = self.date_to.dateTime().toString(
             'dd.MM.yyyy hh:mm')
             'dd.MM.yyyy hh:mm')
 
 
-        rotate_img = rotate_image(self.face_file_name, -90)
-        
+        rotate_img = rotate_image(self.__file_name, -90)
+
         if platform.system() in 'Linux':
         if platform.system() in 'Linux':
             rotate_img = F"file://{rotate_img}"
             rotate_img = F"file://{rotate_img}"
 
 
@@ -229,8 +235,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
             "place": self.place_combobox.currentData()['id'],
             "place": self.place_combobox.currentData()['id'],
             "receiving_man": self.receiving_man.toPlainText(),
             "receiving_man": self.receiving_man.toPlainText(),
             "purpose_visite": self.purpose_visite.toPlainText(),
             "purpose_visite": self.purpose_visite.toPlainText(),
-            "face_photo": F"{Path(self.face_file_name).name}",
-            "pasport_photo": F"{Path(self.face_file_name).name}"
+            "face_photo": F"{Path(self.__file_name).name}",
+            "pasport_photo": F"{Path(self.__file_name).name}"
         }
         }
 
 
         with connect() as conn:
         with connect() as conn:
@@ -242,10 +248,15 @@ class MainWindow(QMainWindow, Ui_MainWindow):
         self.number_propusk.clear()
         self.number_propusk.clear()
         self.date_from.setDate(QDate().currentDate())
         self.date_from.setDate(QDate().currentDate())
         self.date_to.setDate(QDate().currentDate())
         self.date_to.setDate(QDate().currentDate())
-        self._init_photo()
+        self._init_widget_cam()
         self.receiving_man.clear()
         self.receiving_man.clear()
         self.purpose_visite.clear()
         self.purpose_visite.clear()
-        self.stacked_widget_photo.setCurrentIndex(
-            int(os.environ.get('INDEX_PHOTO')))
+        self.stacked_widget.to_image()
+
         if hasattr(self, "face_wwc"):
         if hasattr(self, "face_wwc"):
             delattr(self, "face_wwc")
             delattr(self, "face_wwc")
+
+    def __stop_cam(self):
+        self.__wwc.stop_cam()  
+        del self.__wwc
+        self.stacked_widget.to_image()

+ 2 - 9
window/ui_py/ui_DialogAbout.py

@@ -8,15 +8,8 @@
 ## WARNING! All changes made in this file will be lost when recompiling UI file!
 ## WARNING! All changes made in this file will be lost when recompiling UI file!
 ################################################################################
 ################################################################################
 
 
-from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
-    QMetaObject, QObject, QPoint, QRect,
-    QSize, QTime, QUrl, Qt)
-from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
-    QFont, QFontDatabase, QGradient, QIcon,
-    QImage, QKeySequence, QLinearGradient, QPainter,
-    QPalette, QPixmap, QRadialGradient, QTransform)
-from PySide6.QtWidgets import (QApplication, QDialog, QHBoxLayout, QLabel,
-    QSizePolicy, QSpacerItem, QVBoxLayout, QWidget)
+from PySide6.QtCore import (QCoreApplication, QMetaObject, QSize, Qt)
+from PySide6.QtWidgets import (QHBoxLayout, QLabel, QSizePolicy, QSpacerItem, QVBoxLayout)
 
 
 class Ui_DialogAbout(object):
 class Ui_DialogAbout(object):
     def setupUi(self, DialogAbout):
     def setupUi(self, DialogAbout):

+ 25 - 25
window/ui_py/ui_DialogCustomVariables.py

@@ -1,23 +1,19 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 
 
 ################################################################################
 ################################################################################
-## Form generated from reading UI file 'DialogCustomVariables.ui'
+# Form generated from reading UI file 'DialogCustomVariables.ui'
 ##
 ##
-## Created by: Qt User Interface Compiler version 6.4.1
+# Created by: Qt User Interface Compiler version 6.4.1
 ##
 ##
-## WARNING! All changes made in this file will be lost when recompiling UI file!
+# WARNING! All changes made in this file will be lost when recompiling UI file!
 ################################################################################
 ################################################################################
 
 
-from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
-    QMetaObject, QObject, QPoint, QRect,
-    QSize, QTime, QUrl, Qt)
-from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
-    QFont, QFontDatabase, QGradient, QIcon,
-    QImage, QKeySequence, QLinearGradient, QPainter,
-    QPalette, QPixmap, QRadialGradient, QTransform)
-from PySide6.QtWidgets import (QApplication, QDialog, QGroupBox, QHBoxLayout,
-    QLineEdit, QPushButton, QSizePolicy, QSpacerItem,
-    QVBoxLayout, QWidget)
+
+from PySide6.QtCore import (QCoreApplication, QMetaObject, QSize)
+from PySide6.QtWidgets import (QGroupBox, QHBoxLayout,
+                               QLineEdit, QPushButton, QSizePolicy, QSpacerItem,
+                               QVBoxLayout)
+
 
 
 class Ui_DialogCustomVariables(object):
 class Ui_DialogCustomVariables(object):
     def setupUi(self, DialogCustomVariables):
     def setupUi(self, DialogCustomVariables):
@@ -42,7 +38,6 @@ class Ui_DialogCustomVariables(object):
 
 
         self.horizontalLayout.addWidget(self.btn_show_path_photo)
         self.horizontalLayout.addWidget(self.btn_show_path_photo)
 
 
-
         self.verticalLayout.addWidget(self.groupBox)
         self.verticalLayout.addWidget(self.groupBox)
 
 
         self.groupBox_2 = QGroupBox(DialogCustomVariables)
         self.groupBox_2 = QGroupBox(DialogCustomVariables)
@@ -59,10 +54,10 @@ class Ui_DialogCustomVariables(object):
 
 
         self.horizontalLayout_2.addWidget(self.btn_show_path_database)
         self.horizontalLayout_2.addWidget(self.btn_show_path_database)
 
 
-
         self.verticalLayout.addWidget(self.groupBox_2)
         self.verticalLayout.addWidget(self.groupBox_2)
 
 
-        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
+        self.verticalSpacer = QSpacerItem(
+            20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
 
 
         self.verticalLayout.addItem(self.verticalSpacer)
         self.verticalLayout.addItem(self.verticalSpacer)
 
 
@@ -71,22 +66,27 @@ class Ui_DialogCustomVariables(object):
 
 
         self.verticalLayout.addWidget(self.btn_save)
         self.verticalLayout.addWidget(self.btn_save)
 
 
-        self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
+        self.verticalSpacer_2 = QSpacerItem(
+            20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
 
 
         self.verticalLayout.addItem(self.verticalSpacer_2)
         self.verticalLayout.addItem(self.verticalSpacer_2)
 
 
-
         self.retranslateUi(DialogCustomVariables)
         self.retranslateUi(DialogCustomVariables)
 
 
         QMetaObject.connectSlotsByName(DialogCustomVariables)
         QMetaObject.connectSlotsByName(DialogCustomVariables)
     # setupUi
     # setupUi
 
 
     def retranslateUi(self, DialogCustomVariables):
     def retranslateUi(self, DialogCustomVariables):
-        DialogCustomVariables.setWindowTitle(QCoreApplication.translate("DialogCustomVariables", u"\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
-        self.groupBox.setTitle(QCoreApplication.translate("DialogCustomVariables", u"\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u043c\u0438", None))
-        self.btn_show_path_photo.setText(QCoreApplication.translate("DialogCustomVariables", u"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438", None))
-        self.groupBox_2.setTitle(QCoreApplication.translate("DialogCustomVariables", u"\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445", None))
-        self.btn_show_path_database.setText(QCoreApplication.translate("DialogCustomVariables", u"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438", None))
-        self.btn_save.setText(QCoreApplication.translate("DialogCustomVariables", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
+        DialogCustomVariables.setWindowTitle(QCoreApplication.translate(
+            "DialogCustomVariables", u"\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
+        self.groupBox.setTitle(QCoreApplication.translate(
+            "DialogCustomVariables", u"\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u043c\u0438", None))
+        self.btn_show_path_photo.setText(QCoreApplication.translate(
+            "DialogCustomVariables", u"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438", None))
+        self.groupBox_2.setTitle(QCoreApplication.translate(
+            "DialogCustomVariables", u"\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445", None))
+        self.btn_show_path_database.setText(QCoreApplication.translate(
+            "DialogCustomVariables", u"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438", None))
+        self.btn_save.setText(QCoreApplication.translate(
+            "DialogCustomVariables", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
     # retranslateUi
     # retranslateUi
-

+ 11 - 18
window/ui_py/ui_DialogHistory.py

@@ -1,23 +1,17 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 
 
 ################################################################################
 ################################################################################
-## Form generated from reading UI file 'DialogHistory.ui'
+# Form generated from reading UI file 'DialogHistory.ui'
 ##
 ##
-## Created by: Qt User Interface Compiler version 6.4.1
+# Created by: Qt User Interface Compiler version 6.4.1
 ##
 ##
-## WARNING! All changes made in this file will be lost when recompiling UI file!
+# WARNING! All changes made in this file will be lost when recompiling UI file!
 ################################################################################
 ################################################################################
 
 
-from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
-    QMetaObject, QObject, QPoint, QRect,
-    QSize, QTime, QUrl, Qt)
-from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
-    QFont, QFontDatabase, QGradient, QIcon,
-    QImage, QKeySequence, QLinearGradient, QPainter,
-    QPalette, QPixmap, QRadialGradient, QTransform)
-from PySide6.QtWidgets import (QApplication, QDialog, QGroupBox, QHBoxLayout,
-    QLineEdit, QListWidget, QListWidgetItem, QSizePolicy,
-    QTextBrowser, QVBoxLayout, QWidget)
+from PySide6.QtCore import (QCoreApplication, QMetaObject)
+from PySide6.QtWidgets import (QGroupBox, QHBoxLayout,
+                               QLineEdit, QListWidget, QTextBrowser, QVBoxLayout)
+
 
 
 class Ui_DialogHistory(object):
 class Ui_DialogHistory(object):
     def setupUi(self, DialogHistory):
     def setupUi(self, DialogHistory):
@@ -40,7 +34,6 @@ class Ui_DialogHistory(object):
 
 
         self.verticalLayout.addWidget(self.list_propusk)
         self.verticalLayout.addWidget(self.list_propusk)
 
 
-
         self.horizontalLayout.addWidget(self.groupBox)
         self.horizontalLayout.addWidget(self.groupBox)
 
 
         self.browser = QTextBrowser(DialogHistory)
         self.browser = QTextBrowser(DialogHistory)
@@ -48,14 +41,14 @@ class Ui_DialogHistory(object):
 
 
         self.horizontalLayout.addWidget(self.browser)
         self.horizontalLayout.addWidget(self.browser)
 
 
-
         self.retranslateUi(DialogHistory)
         self.retranslateUi(DialogHistory)
 
 
         QMetaObject.connectSlotsByName(DialogHistory)
         QMetaObject.connectSlotsByName(DialogHistory)
     # setupUi
     # setupUi
 
 
     def retranslateUi(self, DialogHistory):
     def retranslateUi(self, DialogHistory):
-        DialogHistory.setWindowTitle(QCoreApplication.translate("DialogHistory", u"История пропусков", None))
-        self.groupBox.setTitle(QCoreApplication.translate("DialogHistory", u"\u0421\u043f\u0438\u0441\u043e\u043a", None))
+        DialogHistory.setWindowTitle(QCoreApplication.translate(
+            "DialogHistory", u"История пропусков", None))
+        self.groupBox.setTitle(QCoreApplication.translate(
+            "DialogHistory", u"\u0421\u043f\u0438\u0441\u043e\u043a", None))
     # retranslateUi
     # retranslateUi
-

+ 34 - 37
window/ui_py/ui_DialogListPersonal.py

@@ -1,24 +1,18 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 
 
 ################################################################################
 ################################################################################
-## Form generated from reading UI file 'DialogListPersonal.ui'
+# Form generated from reading UI file 'DialogListPersonal.ui'
 ##
 ##
-## Created by: Qt User Interface Compiler version 6.4.1
+# Created by: Qt User Interface Compiler version 6.4.1
 ##
 ##
-## WARNING! All changes made in this file will be lost when recompiling UI file!
+# WARNING! All changes made in this file will be lost when recompiling UI file!
 ################################################################################
 ################################################################################
 
 
-from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
-    QMetaObject, QObject, QPoint, QRect,
-    QSize, QTime, QUrl, Qt)
-from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
-    QFont, QFontDatabase, QGradient, QIcon,
-    QImage, QKeySequence, QLinearGradient, QPainter,
-    QPalette, QPixmap, QRadialGradient, QTransform)
-from PySide6.QtWidgets import (QApplication, QDialog, QGridLayout, QGroupBox,
-    QHBoxLayout, QLabel, QLineEdit, QListWidget,
-    QListWidgetItem, QPushButton, QSizePolicy, QSpacerItem,
-    QVBoxLayout, QWidget)
+from PySide6.QtCore import (QCoreApplication, QMetaObject, QSize)
+from PySide6.QtWidgets import (QGridLayout, QGroupBox,
+                               QHBoxLayout, QLabel, QLineEdit, QListWidget, QPushButton, QSizePolicy, QSpacerItem,
+                               QVBoxLayout)
+
 
 
 class Ui_DialogListPersonal(object):
 class Ui_DialogListPersonal(object):
     def setupUi(self, DialogListPersonal):
     def setupUi(self, DialogListPersonal):
@@ -36,7 +30,6 @@ class Ui_DialogListPersonal(object):
 
 
         self.gridLayout.addWidget(self.list_personal_widget, 0, 0, 1, 1)
         self.gridLayout.addWidget(self.list_personal_widget, 0, 0, 1, 1)
 
 
-
         self.gridLayout_3.addWidget(self.groupBox, 0, 0, 1, 1)
         self.gridLayout_3.addWidget(self.groupBox, 0, 0, 1, 1)
 
 
         self.groupBox_2 = QGroupBox(DialogListPersonal)
         self.groupBox_2 = QGroupBox(DialogListPersonal)
@@ -53,7 +46,8 @@ class Ui_DialogListPersonal(object):
 
 
         self.horizontalLayout_2.addWidget(self.label)
         self.horizontalLayout_2.addWidget(self.label)
 
 
-        self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
+        self.horizontalSpacer = QSpacerItem(
+            40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
 
 
         self.horizontalLayout_2.addItem(self.horizontalSpacer)
         self.horizontalLayout_2.addItem(self.horizontalSpacer)
 
 
@@ -63,7 +57,6 @@ class Ui_DialogListPersonal(object):
 
 
         self.horizontalLayout_2.addWidget(self.lastname)
         self.horizontalLayout_2.addWidget(self.lastname)
 
 
-
         self.verticalLayout_2.addLayout(self.horizontalLayout_2)
         self.verticalLayout_2.addLayout(self.horizontalLayout_2)
 
 
         self.horizontalLayout_3 = QHBoxLayout()
         self.horizontalLayout_3 = QHBoxLayout()
@@ -73,7 +66,8 @@ class Ui_DialogListPersonal(object):
 
 
         self.horizontalLayout_3.addWidget(self.label_2)
         self.horizontalLayout_3.addWidget(self.label_2)
 
 
-        self.horizontalSpacer_2 = QSpacerItem(50, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
+        self.horizontalSpacer_2 = QSpacerItem(
+            50, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
 
 
         self.horizontalLayout_3.addItem(self.horizontalSpacer_2)
         self.horizontalLayout_3.addItem(self.horizontalSpacer_2)
 
 
@@ -83,7 +77,6 @@ class Ui_DialogListPersonal(object):
 
 
         self.horizontalLayout_3.addWidget(self.firstname)
         self.horizontalLayout_3.addWidget(self.firstname)
 
 
-
         self.verticalLayout_2.addLayout(self.horizontalLayout_3)
         self.verticalLayout_2.addLayout(self.horizontalLayout_3)
 
 
         self.horizontalLayout_4 = QHBoxLayout()
         self.horizontalLayout_4 = QHBoxLayout()
@@ -93,7 +86,8 @@ class Ui_DialogListPersonal(object):
 
 
         self.horizontalLayout_4.addWidget(self.label_3)
         self.horizontalLayout_4.addWidget(self.label_3)
 
 
-        self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
+        self.horizontalSpacer_3 = QSpacerItem(
+            40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
 
 
         self.horizontalLayout_4.addItem(self.horizontalSpacer_3)
         self.horizontalLayout_4.addItem(self.horizontalSpacer_3)
 
 
@@ -103,7 +97,6 @@ class Ui_DialogListPersonal(object):
 
 
         self.horizontalLayout_4.addWidget(self.middlename)
         self.horizontalLayout_4.addWidget(self.middlename)
 
 
-
         self.verticalLayout_2.addLayout(self.horizontalLayout_4)
         self.verticalLayout_2.addLayout(self.horizontalLayout_4)
 
 
         self.verticalLayout = QVBoxLayout()
         self.verticalLayout = QVBoxLayout()
@@ -120,7 +113,6 @@ class Ui_DialogListPersonal(object):
 
 
         self.horizontalLayout.addWidget(self.btn_update_personal)
         self.horizontalLayout.addWidget(self.btn_update_personal)
 
 
-
         self.verticalLayout.addLayout(self.horizontalLayout)
         self.verticalLayout.addLayout(self.horizontalLayout)
 
 
         self.btn_delete_personal = QPushButton(self.groupBox_2)
         self.btn_delete_personal = QPushButton(self.groupBox_2)
@@ -128,34 +120,39 @@ class Ui_DialogListPersonal(object):
 
 
         self.verticalLayout.addWidget(self.btn_delete_personal)
         self.verticalLayout.addWidget(self.btn_delete_personal)
 
 
-        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
+        self.verticalSpacer = QSpacerItem(
+            20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
 
 
         self.verticalLayout.addItem(self.verticalSpacer)
         self.verticalLayout.addItem(self.verticalSpacer)
 
 
-
         self.verticalLayout_2.addLayout(self.verticalLayout)
         self.verticalLayout_2.addLayout(self.verticalLayout)
 
 
-
         self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
         self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
 
 
-
         self.gridLayout_3.addWidget(self.groupBox_2, 0, 1, 1, 1)
         self.gridLayout_3.addWidget(self.groupBox_2, 0, 1, 1, 1)
 
 
-
         self.retranslateUi(DialogListPersonal)
         self.retranslateUi(DialogListPersonal)
 
 
         QMetaObject.connectSlotsByName(DialogListPersonal)
         QMetaObject.connectSlotsByName(DialogListPersonal)
     # setupUi
     # setupUi
 
 
     def retranslateUi(self, DialogListPersonal):
     def retranslateUi(self, DialogListPersonal):
-        DialogListPersonal.setWindowTitle(QCoreApplication.translate("DialogListPersonal", u"Список сотрудников", None))
-        self.groupBox.setTitle(QCoreApplication.translate("DialogListPersonal", u"\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432", None))
-        self.groupBox_2.setTitle(QCoreApplication.translate("DialogListPersonal", u"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435", None))
-        self.label.setText(QCoreApplication.translate("DialogListPersonal", u"\u0424\u0430\u043c\u0438\u043b\u0438\u044f", None))
-        self.label_2.setText(QCoreApplication.translate("DialogListPersonal", u"\u0418\u043c\u044f", None))
-        self.label_3.setText(QCoreApplication.translate("DialogListPersonal", u"\u041e\u0442\u0447\u0435\u0442\u0432\u043e", None))
-        self.btn_save_personal.setText(QCoreApplication.translate("DialogListPersonal", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
-        self.btn_update_personal.setText(QCoreApplication.translate("DialogListPersonal", u"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c", None))
-        self.btn_delete_personal.setText(QCoreApplication.translate("DialogListPersonal", u"\u0423\u0434\u0430\u043b\u0438\u0442\u044c", None))
+        DialogListPersonal.setWindowTitle(QCoreApplication.translate(
+            "DialogListPersonal", u"Список сотрудников", None))
+        self.groupBox.setTitle(QCoreApplication.translate(
+            "DialogListPersonal", u"\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432", None))
+        self.groupBox_2.setTitle(QCoreApplication.translate(
+            "DialogListPersonal", u"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435", None))
+        self.label.setText(QCoreApplication.translate(
+            "DialogListPersonal", u"\u0424\u0430\u043c\u0438\u043b\u0438\u044f", None))
+        self.label_2.setText(QCoreApplication.translate(
+            "DialogListPersonal", u"\u0418\u043c\u044f", None))
+        self.label_3.setText(QCoreApplication.translate(
+            "DialogListPersonal", u"\u041e\u0442\u0447\u0435\u0442\u0432\u043e", None))
+        self.btn_save_personal.setText(QCoreApplication.translate(
+            "DialogListPersonal", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
+        self.btn_update_personal.setText(QCoreApplication.translate(
+            "DialogListPersonal", u"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c", None))
+        self.btn_delete_personal.setText(QCoreApplication.translate(
+            "DialogListPersonal", u"\u0423\u0434\u0430\u043b\u0438\u0442\u044c", None))
     # retranslateUi
     # retranslateUi
-

+ 24 - 30
window/ui_py/ui_DialogListPlace.py

@@ -1,24 +1,18 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 
 
 ################################################################################
 ################################################################################
-## Form generated from reading UI file 'DialogListPlace.ui'
+# Form generated from reading UI file 'DialogListPlace.ui'
 ##
 ##
-## Created by: Qt User Interface Compiler version 6.4.1
+# Created by: Qt User Interface Compiler version 6.4.1
 ##
 ##
-## WARNING! All changes made in this file will be lost when recompiling UI file!
+# WARNING! All changes made in this file will be lost when recompiling UI file!
 ################################################################################
 ################################################################################
 
 
-from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
-    QMetaObject, QObject, QPoint, QRect,
-    QSize, QTime, QUrl, Qt)
-from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
-    QFont, QFontDatabase, QGradient, QIcon,
-    QImage, QKeySequence, QLinearGradient, QPainter,
-    QPalette, QPixmap, QRadialGradient, QTransform)
-from PySide6.QtWidgets import (QApplication, QDialog, QGridLayout, QGroupBox,
-    QHBoxLayout, QLabel, QLineEdit, QListWidget,
-    QListWidgetItem, QPushButton, QSizePolicy, QSpacerItem,
-    QVBoxLayout, QWidget)
+from PySide6.QtCore import (QCoreApplication, QMetaObject, QSize)
+from PySide6.QtWidgets import (QGridLayout, QGroupBox,
+                               QHBoxLayout, QLabel, QLineEdit, QListWidget, QPushButton, QSizePolicy, QSpacerItem,
+                               QVBoxLayout)
+
 
 
 class Ui_DialogListPlace(object):
 class Ui_DialogListPlace(object):
     def setupUi(self, DialogListPlace):
     def setupUi(self, DialogListPlace):
@@ -36,7 +30,6 @@ class Ui_DialogListPlace(object):
 
 
         self.gridLayout.addWidget(self.list_place_widget, 0, 0, 1, 1)
         self.gridLayout.addWidget(self.list_place_widget, 0, 0, 1, 1)
 
 
-
         self.gridLayout_3.addWidget(self.groupBox, 0, 0, 1, 1)
         self.gridLayout_3.addWidget(self.groupBox, 0, 0, 1, 1)
 
 
         self.groupBox_2 = QGroupBox(DialogListPlace)
         self.groupBox_2 = QGroupBox(DialogListPlace)
@@ -59,7 +52,6 @@ class Ui_DialogListPlace(object):
 
 
         self.verticalLayout_3.addWidget(self.line_name_place)
         self.verticalLayout_3.addWidget(self.line_name_place)
 
 
-
         self.verticalLayout_2.addLayout(self.verticalLayout_3)
         self.verticalLayout_2.addLayout(self.verticalLayout_3)
 
 
         self.verticalLayout = QVBoxLayout()
         self.verticalLayout = QVBoxLayout()
@@ -76,7 +68,6 @@ class Ui_DialogListPlace(object):
 
 
         self.horizontalLayout.addWidget(self.btn_update_place)
         self.horizontalLayout.addWidget(self.btn_update_place)
 
 
-
         self.verticalLayout.addLayout(self.horizontalLayout)
         self.verticalLayout.addLayout(self.horizontalLayout)
 
 
         self.btn_delete_place = QPushButton(self.groupBox_2)
         self.btn_delete_place = QPushButton(self.groupBox_2)
@@ -84,32 +75,35 @@ class Ui_DialogListPlace(object):
 
 
         self.verticalLayout.addWidget(self.btn_delete_place)
         self.verticalLayout.addWidget(self.btn_delete_place)
 
 
-        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
+        self.verticalSpacer = QSpacerItem(
+            20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
 
 
         self.verticalLayout.addItem(self.verticalSpacer)
         self.verticalLayout.addItem(self.verticalSpacer)
 
 
-
         self.verticalLayout_2.addLayout(self.verticalLayout)
         self.verticalLayout_2.addLayout(self.verticalLayout)
 
 
-
         self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
         self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
 
 
-
         self.gridLayout_3.addWidget(self.groupBox_2, 0, 1, 1, 1)
         self.gridLayout_3.addWidget(self.groupBox_2, 0, 1, 1, 1)
 
 
-
         self.retranslateUi(DialogListPlace)
         self.retranslateUi(DialogListPlace)
 
 
         QMetaObject.connectSlotsByName(DialogListPlace)
         QMetaObject.connectSlotsByName(DialogListPlace)
     # setupUi
     # setupUi
 
 
     def retranslateUi(self, DialogListPlace):
     def retranslateUi(self, DialogListPlace):
-        DialogListPlace.setWindowTitle(QCoreApplication.translate("DialogListPlace", u"Список мест выдачи", None))
-        self.groupBox.setTitle(QCoreApplication.translate("DialogListPlace", u"\u0421\u043f\u0438\u0441\u043e\u043a \u043c\u0435\u0441\u0442 \u0432\u044b\u0434\u0430\u0447\u0438", None))
-        self.groupBox_2.setTitle(QCoreApplication.translate("DialogListPlace", u"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435", None))
-        self.label.setText(QCoreApplication.translate("DialogListPlace", u"\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432\u044b\u0434\u0430\u0447\u0438:", None))
-        self.btn_save_place.setText(QCoreApplication.translate("DialogListPlace", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
-        self.btn_update_place.setText(QCoreApplication.translate("DialogListPlace", u"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c", None))
-        self.btn_delete_place.setText(QCoreApplication.translate("DialogListPlace", u"\u0423\u0434\u0430\u043b\u0438\u0442\u044c", None))
+        DialogListPlace.setWindowTitle(QCoreApplication.translate(
+            "DialogListPlace", u"Список мест выдачи", None))
+        self.groupBox.setTitle(QCoreApplication.translate(
+            "DialogListPlace", u"\u0421\u043f\u0438\u0441\u043e\u043a \u043c\u0435\u0441\u0442 \u0432\u044b\u0434\u0430\u0447\u0438", None))
+        self.groupBox_2.setTitle(QCoreApplication.translate(
+            "DialogListPlace", u"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435", None))
+        self.label.setText(QCoreApplication.translate(
+            "DialogListPlace", u"\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432\u044b\u0434\u0430\u0447\u0438:", None))
+        self.btn_save_place.setText(QCoreApplication.translate(
+            "DialogListPlace", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
+        self.btn_update_place.setText(QCoreApplication.translate(
+            "DialogListPlace", u"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c", None))
+        self.btn_delete_place.setText(QCoreApplication.translate(
+            "DialogListPlace", u"\u0423\u0434\u0430\u043b\u0438\u0442\u044c", None))
     # retranslateUi
     # retranslateUi
-

+ 21 - 66
window/ui_py/ui_DialogSettingCam.py

@@ -1,29 +1,22 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 
 
 ################################################################################
 ################################################################################
-## Form generated from reading UI file 'DialogSettingCam.ui'
+# Form generated from reading UI file 'DialogSettingCam.ui'
 ##
 ##
-## Created by: Qt User Interface Compiler version 6.4.1
+# Created by: Qt User Interface Compiler version 6.4.1
 ##
 ##
-## WARNING! All changes made in this file will be lost when recompiling UI file!
+# WARNING! All changes made in this file will be lost when recompiling UI file!
 ################################################################################
 ################################################################################
 
 
-from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
-    QMetaObject, QObject, QPoint, QRect,
-    QSize, QTime, QUrl, Qt)
-from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
-    QFont, QFontDatabase, QGradient, QIcon,
-    QImage, QKeySequence, QLinearGradient, QPainter,
-    QPalette, QPixmap, QRadialGradient, QTransform)
-from PySide6.QtMultimediaWidgets import QVideoWidget
-from PySide6.QtWidgets import (QApplication, QComboBox, QDialog, QGridLayout,
-    QGroupBox, QHBoxLayout, QLabel, QPushButton,
-    QSizePolicy, QStackedWidget, QWidget)
+from PySide6.QtCore import (QCoreApplication, QMetaObject)
+from PySide6.QtWidgets import (QComboBox, QGridLayout, QGroupBox, QPushButton)
+
 
 
 class Ui_DialogSettingCam(object):
 class Ui_DialogSettingCam(object):
     def setupUi(self, DialogSettingCam):
     def setupUi(self, DialogSettingCam):
         if not DialogSettingCam.objectName():
         if not DialogSettingCam.objectName():
             DialogSettingCam.setObjectName(u"DialogSettingCam")
             DialogSettingCam.setObjectName(u"DialogSettingCam")
+
         DialogSettingCam.resize(640, 480)
         DialogSettingCam.resize(640, 480)
         self.gridLayout = QGridLayout(DialogSettingCam)
         self.gridLayout = QGridLayout(DialogSettingCam)
         self.gridLayout.setObjectName(u"gridLayout")
         self.gridLayout.setObjectName(u"gridLayout")
@@ -31,51 +24,10 @@ class Ui_DialogSettingCam(object):
         self.groupBox.setObjectName(u"groupBox")
         self.groupBox.setObjectName(u"groupBox")
         self.gridLayout_3 = QGridLayout(self.groupBox)
         self.gridLayout_3 = QGridLayout(self.groupBox)
         self.gridLayout_3.setObjectName(u"gridLayout_3")
         self.gridLayout_3.setObjectName(u"gridLayout_3")
-        self.face_list_cam = QComboBox(self.groupBox)
-        self.face_list_cam.setObjectName(u"face_list_cam")
-
-        self.gridLayout_3.addWidget(self.face_list_cam, 0, 0, 1, 1)
-
-        self.horizontalLayout = QHBoxLayout()
-        self.horizontalLayout.setObjectName(u"horizontalLayout")
-        self.chacked_cam_face = QPushButton(self.groupBox)
-        self.chacked_cam_face.setObjectName(u"chacked_cam_face")
-
-        self.horizontalLayout.addWidget(self.chacked_cam_face)
-
-        self.stop_cam_face = QPushButton(self.groupBox)
-        self.stop_cam_face.setObjectName(u"stop_cam_face")
-
-        self.horizontalLayout.addWidget(self.stop_cam_face)
-
-
-        self.gridLayout_3.addLayout(self.horizontalLayout, 2, 0, 1, 1)
-
-        self.stackedWidget = QStackedWidget(self.groupBox)
-        self.stackedWidget.setObjectName(u"stackedWidget")
-        self.page_3 = QWidget()
-        self.page_3.setObjectName(u"page_3")
-        self.gridLayout_2 = QGridLayout(self.page_3)
-        self.gridLayout_2.setObjectName(u"gridLayout_2")
-        self.image = QLabel(self.page_3)
-        self.image.setObjectName(u"image")
-
-        self.gridLayout_2.addWidget(self.image, 0, 0, 1, 1)
-
-        self.stackedWidget.addWidget(self.page_3)
-        self.page_4 = QWidget()
-        self.page_4.setObjectName(u"page_4")
-        self.gridLayout_4 = QGridLayout(self.page_4)
-        self.gridLayout_4.setObjectName(u"gridLayout_4")
-        self.video = QVideoWidget(self.page_4)
-        self.video.setObjectName(u"video")
-
-        self.gridLayout_4.addWidget(self.video, 0, 0, 1, 1)
-
-        self.stackedWidget.addWidget(self.page_4)
-
-        self.gridLayout_3.addWidget(self.stackedWidget, 1, 0, 1, 1)
 
 
+        self.mode_list = QComboBox(self.groupBox)
+        self.mode_list.setObjectName(u'mode_list')
+        self.gridLayout_3.addWidget(self.mode_list, 0, 0, 1, 1)
 
 
         self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
         self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
 
 
@@ -84,18 +36,21 @@ class Ui_DialogSettingCam(object):
 
 
         self.gridLayout.addWidget(self.save_setting_cam, 1, 0, 1, 1)
         self.gridLayout.addWidget(self.save_setting_cam, 1, 0, 1, 1)
 
 
-
         self.retranslateUi(DialogSettingCam)
         self.retranslateUi(DialogSettingCam)
 
 
         QMetaObject.connectSlotsByName(DialogSettingCam)
         QMetaObject.connectSlotsByName(DialogSettingCam)
     # setupUi
     # setupUi
 
 
     def retranslateUi(self, DialogSettingCam):
     def retranslateUi(self, DialogSettingCam):
-        DialogSettingCam.setWindowTitle(QCoreApplication.translate("DialogSettingCam", u"Настройка камеры", None))
-        self.groupBox.setTitle(QCoreApplication.translate("DialogSettingCam", u"\u0424\u043e\u0442\u043e \u043b\u0438\u0446\u0430", None))
-        self.chacked_cam_face.setText(QCoreApplication.translate("DialogSettingCam", u"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c", None))
-        self.stop_cam_face.setText(QCoreApplication.translate("DialogSettingCam", u"\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c", None))
-        self.image.setText(QCoreApplication.translate("DialogSettingCam", u"TextLabel", None))
-        self.save_setting_cam.setText(QCoreApplication.translate("DialogSettingCam", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
-    # retranslateUi
 
 
+        DialogSettingCam.setWindowTitle(QCoreApplication.translate(
+            "DialogSettingCam", u"Настройка камеры", None))
+
+        self.mode_list.addItem('USB Camera', userData='video')
+        self.mode_list.addItem('IP Camera', userData='snapshot')
+
+        self.groupBox.setTitle(QCoreApplication.translate(
+            "DialogSettingCam", u"\u0424\u043e\u0442\u043e \u043b\u0438\u0446\u0430", None))
+        self.save_setting_cam.setText(QCoreApplication.translate(
+            "DialogSettingCam", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
+    # retranslateUi

+ 97 - 0
window/ui_py/ui_DialogSettingCam_back.py

@@ -0,0 +1,97 @@
+# -*- coding: utf-8 -*-
+
+################################################################################
+# Form generated from reading UI file 'DialogSettingCam.ui'
+##
+# Created by: Qt User Interface Compiler version 6.4.1
+##
+# WARNING! All changes made in this file will be lost when recompiling UI file!
+################################################################################
+
+from PySide6.QtCore import (QCoreApplication, QMetaObject)
+from PySide6.QtMultimediaWidgets import QVideoWidget
+from PySide6.QtWidgets import (QComboBox, QGridLayout,
+                               QGroupBox, QHBoxLayout, QLabel, QPushButton, QStackedWidget, QWidget)
+
+
+class Ui_DialogSettingCam(object):
+    def setupUi(self, DialogSettingCam):
+        if not DialogSettingCam.objectName():
+            DialogSettingCam.setObjectName(u"DialogSettingCam")
+        DialogSettingCam.resize(640, 480)
+        self.gridLayout = QGridLayout(DialogSettingCam)
+        self.gridLayout.setObjectName(u"gridLayout")
+        self.groupBox = QGroupBox(DialogSettingCam)
+        self.groupBox.setObjectName(u"groupBox")
+        self.gridLayout_3 = QGridLayout(self.groupBox)
+        self.gridLayout_3.setObjectName(u"gridLayout_3")
+        self.face_list_cam = QComboBox(self.groupBox)
+        self.face_list_cam.setObjectName(u"face_list_cam")
+
+        self.gridLayout_3.addWidget(self.face_list_cam, 0, 0, 1, 1)
+
+        self.horizontalLayout = QHBoxLayout()
+        self.horizontalLayout.setObjectName(u"horizontalLayout")
+        self.chacked_cam_face = QPushButton(self.groupBox)
+        self.chacked_cam_face.setObjectName(u"chacked_cam_face")
+
+        self.horizontalLayout.addWidget(self.chacked_cam_face)
+
+        self.stop_cam_face = QPushButton(self.groupBox)
+        self.stop_cam_face.setObjectName(u"stop_cam_face")
+
+        self.horizontalLayout.addWidget(self.stop_cam_face)
+
+        self.gridLayout_3.addLayout(self.horizontalLayout, 2, 0, 1, 1)
+
+        self.stackedWidget = QStackedWidget(self.groupBox)
+        self.stackedWidget.setObjectName(u"stackedWidget")
+        self.page_3 = QWidget()
+        self.page_3.setObjectName(u"page_3")
+        self.gridLayout_2 = QGridLayout(self.page_3)
+        self.gridLayout_2.setObjectName(u"gridLayout_2")
+        self.image = QLabel(self.page_3)
+        self.image.setObjectName(u"image")
+
+        self.gridLayout_2.addWidget(self.image, 0, 0, 1, 1)
+
+        self.stackedWidget.addWidget(self.page_3)
+        self.page_4 = QWidget()
+        self.page_4.setObjectName(u"page_4")
+        self.gridLayout_4 = QGridLayout(self.page_4)
+        self.gridLayout_4.setObjectName(u"gridLayout_4")
+        self.video = QVideoWidget(self.page_4)
+        self.video.setObjectName(u"video")
+
+        self.gridLayout_4.addWidget(self.video, 0, 0, 1, 1)
+
+        self.stackedWidget.addWidget(self.page_4)
+
+        self.gridLayout_3.addWidget(self.stackedWidget, 1, 0, 1, 1)
+
+        self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
+
+        self.save_setting_cam = QPushButton(DialogSettingCam)
+        self.save_setting_cam.setObjectName(u"save_setting_cam")
+
+        self.gridLayout.addWidget(self.save_setting_cam, 1, 0, 1, 1)
+
+        self.retranslateUi(DialogSettingCam)
+
+        QMetaObject.connectSlotsByName(DialogSettingCam)
+    # setupUi
+
+    def retranslateUi(self, DialogSettingCam):
+        DialogSettingCam.setWindowTitle(QCoreApplication.translate(
+            "DialogSettingCam", u"Настройка камеры", None))
+        self.groupBox.setTitle(QCoreApplication.translate(
+            "DialogSettingCam", u"\u0424\u043e\u0442\u043e \u043b\u0438\u0446\u0430", None))
+        self.chacked_cam_face.setText(QCoreApplication.translate(
+            "DialogSettingCam", u"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c", None))
+        self.stop_cam_face.setText(QCoreApplication.translate(
+            "DialogSettingCam", u"\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c", None))
+        self.image.setText(QCoreApplication.translate(
+            "DialogSettingCam", u"TextLabel", None))
+        self.save_setting_cam.setText(QCoreApplication.translate(
+            "DialogSettingCam", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
+    # retranslateUi

+ 93 - 102
window/ui_py/ui_MainWindow.py

@@ -1,27 +1,25 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 
 
 ################################################################################
 ################################################################################
-## Form generated from reading UI file 'MainWindow.ui'
+# Form generated from reading UI file 'MainWindow.ui'
 ##
 ##
-## Created by: Qt User Interface Compiler version 6.4.1
+# Created by: Qt User Interface Compiler version 6.4.1
 ##
 ##
-## WARNING! All changes made in this file will be lost when recompiling UI file!
+# WARNING! All changes made in this file will be lost when recompiling UI file!
 ################################################################################
 ################################################################################
 
 
-from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
-    QMetaObject, QObject, QPoint, QRect,
-    QSize, QTime, QUrl, Qt)
+from PySide6.QtCore import (QCoreApplication, QDate, QDateTime,
+                            QMetaObject, QRect, QSize, QTime, Qt)
 from PySide6.QtGui import (QAction)
 from PySide6.QtGui import (QAction)
-from PySide6.QtMultimediaWidgets import QVideoWidget
-from PySide6.QtWidgets import (QApplication, QComboBox, QDateTimeEdit, QFrame,
-    QGridLayout, QGroupBox, QHBoxLayout, QLabel,
-    QLineEdit, QMainWindow, QMenu, QMenuBar,
-    QPushButton, QSizePolicy, QSplitter, QStackedWidget,
-    QStatusBar, QTextEdit, QVBoxLayout, QWidget)
+from PySide6.QtWidgets import (QComboBox, QDateTimeEdit,
+                               QGridLayout, QGroupBox, QHBoxLayout, QLabel, QMenu, QMenuBar,
+                               QPushButton, QSizePolicy, QSplitter, QStatusBar, QTextEdit, QVBoxLayout, QWidget)
 from PropuskWidgets.PLineEdit import PLineEdit
 from PropuskWidgets.PLineEdit import PLineEdit
+from PropuskWidgets.PStackedWidget import PStackedWidget
+
 
 
 class Ui_MainWindow(object):
 class Ui_MainWindow(object):
-    def setupUi(self, MainWindow):
+    def setupUi(self, MainWindow, mode='video'):
         if not MainWindow.objectName():
         if not MainWindow.objectName():
             MainWindow.setObjectName(u"MainWindow")
             MainWindow.setObjectName(u"MainWindow")
         MainWindow.setWindowModality(Qt.WindowModal)
         MainWindow.setWindowModality(Qt.WindowModal)
@@ -29,7 +27,8 @@ class Ui_MainWindow(object):
         sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
         sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setVerticalStretch(0)
-        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
+        sizePolicy.setHeightForWidth(
+            MainWindow.sizePolicy().hasHeightForWidth())
         MainWindow.setSizePolicy(sizePolicy)
         MainWindow.setSizePolicy(sizePolicy)
         MainWindow.setBaseSize(QSize(864, 430))
         MainWindow.setBaseSize(QSize(864, 430))
         self.actionExit = QAction(MainWindow)
         self.actionExit = QAction(MainWindow)
@@ -43,7 +42,8 @@ class Ui_MainWindow(object):
         self.setting_cam = QAction(MainWindow)
         self.setting_cam = QAction(MainWindow)
         self.setting_cam.setObjectName(u"setting_cam")
         self.setting_cam.setObjectName(u"setting_cam")
         self.btn_show_personal_window = QAction(MainWindow)
         self.btn_show_personal_window = QAction(MainWindow)
-        self.btn_show_personal_window.setObjectName(u"btn_show_personal_window")
+        self.btn_show_personal_window.setObjectName(
+            u"btn_show_personal_window")
         self.btn_show_place_window = QAction(MainWindow)
         self.btn_show_place_window = QAction(MainWindow)
         self.btn_show_place_window.setObjectName(u"btn_show_place_window")
         self.btn_show_place_window.setObjectName(u"btn_show_place_window")
         self.update_list = QAction(MainWindow)
         self.update_list = QAction(MainWindow)
@@ -57,7 +57,8 @@ class Ui_MainWindow(object):
         self.centralwidget = QWidget(MainWindow)
         self.centralwidget = QWidget(MainWindow)
         self.centralwidget.setObjectName(u"centralwidget")
         self.centralwidget.setObjectName(u"centralwidget")
         self.centralwidget.setEnabled(True)
         self.centralwidget.setEnabled(True)
-        sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
+        sizePolicy.setHeightForWidth(
+            self.centralwidget.sizePolicy().hasHeightForWidth())
         self.centralwidget.setSizePolicy(sizePolicy)
         self.centralwidget.setSizePolicy(sizePolicy)
         self.centralwidget.setFocusPolicy(Qt.NoFocus)
         self.centralwidget.setFocusPolicy(Qt.NoFocus)
         self.centralwidget.setAutoFillBackground(False)
         self.centralwidget.setAutoFillBackground(False)
@@ -72,7 +73,8 @@ class Ui_MainWindow(object):
         self.horizontalLayout.setObjectName(u"horizontalLayout")
         self.horizontalLayout.setObjectName(u"horizontalLayout")
         self.label = QLabel(self.groupBox)
         self.label = QLabel(self.groupBox)
         self.label.setObjectName(u"label")
         self.label.setObjectName(u"label")
-        sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
+        sizePolicy.setHeightForWidth(
+            self.label.sizePolicy().hasHeightForWidth())
         self.label.setSizePolicy(sizePolicy)
         self.label.setSizePolicy(sizePolicy)
 
 
         self.horizontalLayout.addWidget(self.label)
         self.horizontalLayout.addWidget(self.label)
@@ -83,7 +85,6 @@ class Ui_MainWindow(object):
 
 
         self.horizontalLayout.addWidget(self.number_propusk)
         self.horizontalLayout.addWidget(self.number_propusk)
 
 
-
         self.verticalLayout_3.addLayout(self.horizontalLayout)
         self.verticalLayout_3.addLayout(self.horizontalLayout)
 
 
         self.horizontalLayout_2 = QHBoxLayout()
         self.horizontalLayout_2 = QHBoxLayout()
@@ -95,12 +96,12 @@ class Ui_MainWindow(object):
 
 
         self.date_from = QDateTimeEdit(self.groupBox)
         self.date_from = QDateTimeEdit(self.groupBox)
         self.date_from.setObjectName(u"date_from")
         self.date_from.setObjectName(u"date_from")
-        self.date_from.setDateTime(QDateTime(QDate(1999, 12, 31), QTime(21, 0, 0)))
+        self.date_from.setDateTime(
+            QDateTime(QDate(1999, 12, 31), QTime(21, 0, 0)))
         self.date_from.setTimeSpec(Qt.UTC)
         self.date_from.setTimeSpec(Qt.UTC)
 
 
         self.horizontalLayout_2.addWidget(self.date_from)
         self.horizontalLayout_2.addWidget(self.date_from)
 
 
-
         self.verticalLayout_3.addLayout(self.horizontalLayout_2)
         self.verticalLayout_3.addLayout(self.horizontalLayout_2)
 
 
         self.horizontalLayout_3 = QHBoxLayout()
         self.horizontalLayout_3 = QHBoxLayout()
@@ -115,7 +116,6 @@ class Ui_MainWindow(object):
 
 
         self.horizontalLayout_3.addWidget(self.date_to)
         self.horizontalLayout_3.addWidget(self.date_to)
 
 
-
         self.verticalLayout_3.addLayout(self.horizontalLayout_3)
         self.verticalLayout_3.addLayout(self.horizontalLayout_3)
 
 
         self.horizontalLayout_4 = QHBoxLayout()
         self.horizontalLayout_4 = QHBoxLayout()
@@ -130,7 +130,6 @@ class Ui_MainWindow(object):
 
 
         self.horizontalLayout_4.addWidget(self.personal_combobox)
         self.horizontalLayout_4.addWidget(self.personal_combobox)
 
 
-
         self.verticalLayout_3.addLayout(self.horizontalLayout_4)
         self.verticalLayout_3.addLayout(self.horizontalLayout_4)
 
 
         self.horizontalLayout_5 = QHBoxLayout()
         self.horizontalLayout_5 = QHBoxLayout()
@@ -145,7 +144,6 @@ class Ui_MainWindow(object):
 
 
         self.horizontalLayout_5.addWidget(self.place_combobox)
         self.horizontalLayout_5.addWidget(self.place_combobox)
 
 
-
         self.verticalLayout_3.addLayout(self.horizontalLayout_5)
         self.verticalLayout_3.addLayout(self.horizontalLayout_5)
 
 
         self.verticalLayout = QVBoxLayout()
         self.verticalLayout = QVBoxLayout()
@@ -160,7 +158,6 @@ class Ui_MainWindow(object):
 
 
         self.verticalLayout.addWidget(self.receiving_man)
         self.verticalLayout.addWidget(self.receiving_man)
 
 
-
         self.verticalLayout_3.addLayout(self.verticalLayout)
         self.verticalLayout_3.addLayout(self.verticalLayout)
 
 
         self.verticalLayout_2 = QVBoxLayout()
         self.verticalLayout_2 = QVBoxLayout()
@@ -175,53 +172,19 @@ class Ui_MainWindow(object):
 
 
         self.verticalLayout_2.addWidget(self.purpose_visite)
         self.verticalLayout_2.addWidget(self.purpose_visite)
 
 
-
         self.verticalLayout_3.addLayout(self.verticalLayout_2)
         self.verticalLayout_3.addLayout(self.verticalLayout_2)
 
 
-
         self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
         self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
 
 
         self.groupBox_2 = QGroupBox(self.centralwidget)
         self.groupBox_2 = QGroupBox(self.centralwidget)
         self.groupBox_2.setObjectName(u"groupBox_2")
         self.groupBox_2.setObjectName(u"groupBox_2")
         self.verticalLayout_4 = QVBoxLayout(self.groupBox_2)
         self.verticalLayout_4 = QVBoxLayout(self.groupBox_2)
         self.verticalLayout_4.setObjectName(u"verticalLayout_4")
         self.verticalLayout_4.setObjectName(u"verticalLayout_4")
-        self.stacked_widget_photo = QStackedWidget(self.groupBox_2)
-        self.stacked_widget_photo.setObjectName(u"stacked_widget_photo")
-        self.stacked_widget_photo.setEnabled(True)
-#if QT_CONFIG(tooltip)
-        self.stacked_widget_photo.setToolTip(u"")
-#endif // QT_CONFIG(tooltip)
-        self.page = QWidget()
-        self.page.setObjectName(u"page")
-        self.gridLayout_2 = QGridLayout(self.page)
-        self.gridLayout_2.setObjectName(u"gridLayout_2")
-        self.imagePhoto = QLabel(self.page)
-        self.imagePhoto.setObjectName(u"imagePhoto")
-        self.imagePhoto.setEnabled(True)
-        sizePolicy.setHeightForWidth(self.imagePhoto.sizePolicy().hasHeightForWidth())
-        self.imagePhoto.setSizePolicy(sizePolicy)
-        self.imagePhoto.setFrameShape(QFrame.Box)
-        self.imagePhoto.setFrameShadow(QFrame.Raised)
-        self.imagePhoto.setWordWrap(False)
-
-        self.gridLayout_2.addWidget(self.imagePhoto, 0, 0, 1, 1)
-
-        self.stacked_widget_photo.addWidget(self.page)
-        self.page_2 = QWidget()
-        self.page_2.setObjectName(u"page_2")
-        self.gridLayout_4 = QGridLayout(self.page_2)
-        self.gridLayout_4.setObjectName(u"gridLayout_4")
-        self.face_video_widget = QVideoWidget(self.page_2)
-        self.face_video_widget.setObjectName(u"face_video_widget")
-        self.face_video_widget.setEnabled(False)
-        sizePolicy.setHeightForWidth(self.face_video_widget.sizePolicy().hasHeightForWidth())
-        self.face_video_widget.setSizePolicy(sizePolicy)
-
-        self.gridLayout_4.addWidget(self.face_video_widget, 0, 0, 1, 1)
-
-        self.stacked_widget_photo.addWidget(self.page_2)
-
-        self.verticalLayout_4.addWidget(self.stacked_widget_photo)
+
+        # self.stacked_widget = PStackedWidget(self.groupBox_2, mode)
+        # self.stacked_widget.setObjectName(u'stacked_widget')
+        # self.stacked_widget.setEnabled(True)
+        # self.verticalLayout_4.addWidget(self.stacked_widget)
 
 
         self.splitter = QSplitter(self.groupBox_2)
         self.splitter = QSplitter(self.groupBox_2)
         self.splitter.setObjectName(u"splitter")
         self.splitter.setObjectName(u"splitter")
@@ -235,26 +198,28 @@ class Ui_MainWindow(object):
 
 
         self.verticalLayout_4.addWidget(self.splitter)
         self.verticalLayout_4.addWidget(self.splitter)
 
 
-
         self.gridLayout.addWidget(self.groupBox_2, 0, 1, 1, 2)
         self.gridLayout.addWidget(self.groupBox_2, 0, 1, 1, 2)
 
 
         self.btn_clear = QPushButton(self.centralwidget)
         self.btn_clear = QPushButton(self.centralwidget)
         self.btn_clear.setObjectName(u"btn_clear")
         self.btn_clear.setObjectName(u"btn_clear")
-        sizePolicy.setHeightForWidth(self.btn_clear.sizePolicy().hasHeightForWidth())
+        sizePolicy.setHeightForWidth(
+            self.btn_clear.sizePolicy().hasHeightForWidth())
         self.btn_clear.setSizePolicy(sizePolicy)
         self.btn_clear.setSizePolicy(sizePolicy)
 
 
         self.gridLayout.addWidget(self.btn_clear, 1, 0, 1, 1)
         self.gridLayout.addWidget(self.btn_clear, 1, 0, 1, 1)
 
 
         self.btn_save = QPushButton(self.centralwidget)
         self.btn_save = QPushButton(self.centralwidget)
         self.btn_save.setObjectName(u"btn_save")
         self.btn_save.setObjectName(u"btn_save")
-        sizePolicy.setHeightForWidth(self.btn_save.sizePolicy().hasHeightForWidth())
+        sizePolicy.setHeightForWidth(
+            self.btn_save.sizePolicy().hasHeightForWidth())
         self.btn_save.setSizePolicy(sizePolicy)
         self.btn_save.setSizePolicy(sizePolicy)
 
 
         self.gridLayout.addWidget(self.btn_save, 1, 1, 1, 1)
         self.gridLayout.addWidget(self.btn_save, 1, 1, 1, 1)
 
 
         self.btn_print = QPushButton(self.centralwidget)
         self.btn_print = QPushButton(self.centralwidget)
         self.btn_print.setObjectName(u"btn_print")
         self.btn_print.setObjectName(u"btn_print")
-        sizePolicy.setHeightForWidth(self.btn_print.sizePolicy().hasHeightForWidth())
+        sizePolicy.setHeightForWidth(
+            self.btn_print.sizePolicy().hasHeightForWidth())
         self.btn_print.setSizePolicy(sizePolicy)
         self.btn_print.setSizePolicy(sizePolicy)
 
 
         self.gridLayout.addWidget(self.btn_print, 1, 2, 1, 1)
         self.gridLayout.addWidget(self.btn_print, 1, 2, 1, 1)
@@ -304,39 +269,65 @@ class Ui_MainWindow(object):
     # setupUi
     # setupUi
 
 
     def retranslateUi(self, MainWindow):
     def retranslateUi(self, MainWindow):
-        MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a", None))
-        self.actionExit.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
-        self.actionSave.setText(QCoreApplication.translate("MainWindow", u"Save", None))
-        self.actionLoad.setText(QCoreApplication.translate("MainWindow", u"Load", None))
-        self.actionExit_2.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
-        self.setting_cam.setText(QCoreApplication.translate("MainWindow", u"\u041d\u0430\u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u0430\u043c\u0435\u0440\u044b", None))
-        self.btn_show_personal_window.setText(QCoreApplication.translate("MainWindow", u"\u0421\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438", None))
-        self.btn_show_place_window.setText(QCoreApplication.translate("MainWindow", u"\u041c\u0435\u0441\u0442\u043e \u0432\u044b\u0434\u043e\u0447\u0438", None))
-        self.update_list.setText(QCoreApplication.translate("MainWindow", u"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438", None))
-        self.btn_show_about.setText(QCoreApplication.translate("MainWindow", u"\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435", None))
-        self.exit.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
-        self.action_open_history.setText(QCoreApplication.translate("MainWindow", u"\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432", None))
-        self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f:", None))
-        self.label.setText(QCoreApplication.translate("MainWindow", u"\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a \u2116:", None))
-        self.label_2.setText(QCoreApplication.translate("MainWindow", u"\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0434\u0430\u0447\u0438:", None))
-        self.label_4.setText(QCoreApplication.translate("MainWindow", u"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d\u0435 \u0434\u043e:", None))
-        self.label_3.setText(QCoreApplication.translate("MainWindow", u"\u0412\u044b\u0434\u0430\u043b:", None))
-        self.label_5.setText(QCoreApplication.translate("MainWindow", u"\u041c\u0435\u0441\u0442\u043e \u0432\u044b\u0434\u0430\u0447\u0438:", None))
-        self.label_6.setText(QCoreApplication.translate("MainWindow", u"\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439:", None))
-        self.label_7.setText(QCoreApplication.translate("MainWindow", u"\u0426\u0435\u043b\u044c \u0432\u0438\u0437\u0438\u0442\u0430:", None))
-        self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow", u"\u0424\u043e\u0442\u043e", None))
-#if QT_CONFIG(statustip)
-        self.stacked_widget_photo.setStatusTip("")
-#endif // QT_CONFIG(statustip)
-        self.imagePhoto.setText("")
-        self.btn_start_cam_photo.setText(QCoreApplication.translate("MainWindow", u"\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443", None))
-        self.capturePhoto.setText(QCoreApplication.translate("MainWindow", u"\u0421\u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u043e\u0432\u0430\u0442\u044c", None))
-        self.btn_clear.setText(QCoreApplication.translate("MainWindow", u"\u041e\u0442\u0447\u0438\u0441\u0442\u0438\u0442\u044c", None))
-        self.btn_save.setText(QCoreApplication.translate("MainWindow", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
-        self.btn_print.setText(QCoreApplication.translate("MainWindow", u"\u041f\u0435\u0447\u0430\u0442\u044c", None))
-        self.menuFile.setTitle(QCoreApplication.translate("MainWindow", u"File", None))
-        self.menu.setTitle(QCoreApplication.translate("MainWindow", u"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438", None))
-        self.menu_3.setTitle(QCoreApplication.translate("MainWindow", u"\u0421\u043f\u0438\u0441\u043a\u0438", None))
-        self.menu_2.setTitle(QCoreApplication.translate("MainWindow", u"\u0418\u0441\u0442\u043e\u0440\u0438\u044f", None))
+        MainWindow.setWindowTitle(QCoreApplication.translate(
+            "MainWindow", u"\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a", None))
+        self.actionExit.setText(
+            QCoreApplication.translate("MainWindow", u"Exit", None))
+        self.actionSave.setText(
+            QCoreApplication.translate("MainWindow", u"Save", None))
+        self.actionLoad.setText(
+            QCoreApplication.translate("MainWindow", u"Load", None))
+        self.actionExit_2.setText(
+            QCoreApplication.translate("MainWindow", u"Exit", None))
+        self.setting_cam.setText(QCoreApplication.translate(
+            "MainWindow", u"\u041d\u0430\u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u0430\u043c\u0435\u0440\u044b", None))
+        self.btn_show_personal_window.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0421\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438", None))
+        self.btn_show_place_window.setText(QCoreApplication.translate(
+            "MainWindow", u"\u041c\u0435\u0441\u0442\u043e \u0432\u044b\u0434\u043e\u0447\u0438", None))
+        self.update_list.setText(QCoreApplication.translate(
+            "MainWindow", u"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438", None))
+        self.btn_show_about.setText(QCoreApplication.translate(
+            "MainWindow", u"\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435", None))
+        self.exit.setText(QCoreApplication.translate(
+            "MainWindow", u"Exit", None))
+        self.action_open_history.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432", None))
+        self.groupBox.setTitle(QCoreApplication.translate(
+            "MainWindow", u"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f:", None))
+        self.label.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a \u2116:", None))
+        self.label_2.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0434\u0430\u0447\u0438:", None))
+        self.label_4.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d\u0435 \u0434\u043e:", None))
+        self.label_3.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0412\u044b\u0434\u0430\u043b:", None))
+        self.label_5.setText(QCoreApplication.translate(
+            "MainWindow", u"\u041c\u0435\u0441\u0442\u043e \u0432\u044b\u0434\u0430\u0447\u0438:", None))
+        self.label_6.setText(QCoreApplication.translate(
+            "MainWindow", u"\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439:", None))
+        self.label_7.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0426\u0435\u043b\u044c \u0432\u0438\u0437\u0438\u0442\u0430:", None))
+        self.groupBox_2.setTitle(QCoreApplication.translate(
+            "MainWindow", u"\u0424\u043e\u0442\u043e", None))
+
+        self.btn_start_cam_photo.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443", None))
+        self.capturePhoto.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0421\u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u043e\u0432\u0430\u0442\u044c", None))
+        self.btn_clear.setText(QCoreApplication.translate(
+            "MainWindow", u"\u041e\u0442\u0447\u0438\u0441\u0442\u0438\u0442\u044c", None))
+        self.btn_save.setText(QCoreApplication.translate(
+            "MainWindow", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
+        self.btn_print.setText(QCoreApplication.translate(
+            "MainWindow", u"\u041f\u0435\u0447\u0430\u0442\u044c", None))
+        self.menuFile.setTitle(
+            QCoreApplication.translate("MainWindow", u"File", None))
+        self.menu.setTitle(QCoreApplication.translate(
+            "MainWindow", u"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438", None))
+        self.menu_3.setTitle(QCoreApplication.translate(
+            "MainWindow", u"\u0421\u043f\u0438\u0441\u043a\u0438", None))
+        self.menu_2.setTitle(QCoreApplication.translate(
+            "MainWindow", u"\u0418\u0441\u0442\u043e\u0440\u0438\u044f", None))
     # retranslateUi
     # retranslateUi
-

+ 341 - 0
window/ui_py/ui_MainWindow_back.py

@@ -0,0 +1,341 @@
+# -*- coding: utf-8 -*-
+
+################################################################################
+## Form generated from reading UI file 'MainWindow.ui'
+##
+## Created by: Qt User Interface Compiler version 6.4.1
+##
+## WARNING! All changes made in this file will be lost when recompiling UI file!
+################################################################################
+
+from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
+    QMetaObject, QRect,
+    QSize, QTime, Qt)
+from PySide6.QtGui import (QAction)
+from PySide6.QtMultimediaWidgets import QVideoWidget
+from PySide6.QtWidgets import (QComboBox, QDateTimeEdit, QFrame,
+    QGridLayout, QGroupBox, QHBoxLayout, QLabel, QMenu, QMenuBar,
+    QPushButton, QSizePolicy, QSplitter, QStackedWidget,
+    QStatusBar, QTextEdit, QVBoxLayout, QWidget)
+from PropuskWidgets.PLineEdit import PLineEdit
+
+class Ui_MainWindow(object):
+    def setupUi(self, MainWindow):
+        if not MainWindow.objectName():
+            MainWindow.setObjectName(u"MainWindow")
+        MainWindow.setWindowModality(Qt.WindowModal)
+        MainWindow.resize(920, 511)
+        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
+        MainWindow.setSizePolicy(sizePolicy)
+        MainWindow.setBaseSize(QSize(864, 430))
+        self.actionExit = QAction(MainWindow)
+        self.actionExit.setObjectName(u"actionExit")
+        self.actionSave = QAction(MainWindow)
+        self.actionSave.setObjectName(u"actionSave")
+        self.actionLoad = QAction(MainWindow)
+        self.actionLoad.setObjectName(u"actionLoad")
+        self.actionExit_2 = QAction(MainWindow)
+        self.actionExit_2.setObjectName(u"actionExit_2")
+        self.setting_cam = QAction(MainWindow)
+        self.setting_cam.setObjectName(u"setting_cam")
+        self.btn_show_personal_window = QAction(MainWindow)
+        self.btn_show_personal_window.setObjectName(u"btn_show_personal_window")
+        self.btn_show_place_window = QAction(MainWindow)
+        self.btn_show_place_window.setObjectName(u"btn_show_place_window")
+        self.update_list = QAction(MainWindow)
+        self.update_list.setObjectName(u"update_list")
+        self.btn_show_about = QAction(MainWindow)
+        self.btn_show_about.setObjectName(u"btn_show_about")
+        self.exit = QAction(MainWindow)
+        self.exit.setObjectName(u"exit")
+        self.action_open_history = QAction(MainWindow)
+        self.action_open_history.setObjectName(u"action_open_history")
+        self.centralwidget = QWidget(MainWindow)
+        self.centralwidget.setObjectName(u"centralwidget")
+        self.centralwidget.setEnabled(True)
+        sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
+        self.centralwidget.setSizePolicy(sizePolicy)
+        self.centralwidget.setFocusPolicy(Qt.NoFocus)
+        self.centralwidget.setAutoFillBackground(False)
+        self.gridLayout = QGridLayout(self.centralwidget)
+        self.gridLayout.setObjectName(u"gridLayout")
+        self.groupBox = QGroupBox(self.centralwidget)
+        self.groupBox.setObjectName(u"groupBox")
+        self.groupBox.setMinimumSize(QSize(400, 0))
+        self.verticalLayout_3 = QVBoxLayout(self.groupBox)
+        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
+        self.horizontalLayout = QHBoxLayout()
+        self.horizontalLayout.setObjectName(u"horizontalLayout")
+        self.label = QLabel(self.groupBox)
+        self.label.setObjectName(u"label")
+        sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
+        self.label.setSizePolicy(sizePolicy)
+
+        self.horizontalLayout.addWidget(self.label)
+
+        self.number_propusk = PLineEdit(self.groupBox)
+        self.number_propusk.setObjectName(u"number_propusk")
+        self.number_propusk.setMaxLength(32767)
+
+        self.horizontalLayout.addWidget(self.number_propusk)
+
+
+        self.verticalLayout_3.addLayout(self.horizontalLayout)
+
+        self.horizontalLayout_2 = QHBoxLayout()
+        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
+        self.label_2 = QLabel(self.groupBox)
+        self.label_2.setObjectName(u"label_2")
+
+        self.horizontalLayout_2.addWidget(self.label_2)
+
+        self.date_from = QDateTimeEdit(self.groupBox)
+        self.date_from.setObjectName(u"date_from")
+        self.date_from.setDateTime(QDateTime(QDate(1999, 12, 31), QTime(21, 0, 0)))
+        self.date_from.setTimeSpec(Qt.UTC)
+
+        self.horizontalLayout_2.addWidget(self.date_from)
+
+
+        self.verticalLayout_3.addLayout(self.horizontalLayout_2)
+
+        self.horizontalLayout_3 = QHBoxLayout()
+        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
+        self.label_4 = QLabel(self.groupBox)
+        self.label_4.setObjectName(u"label_4")
+
+        self.horizontalLayout_3.addWidget(self.label_4)
+
+        self.date_to = QDateTimeEdit(self.groupBox)
+        self.date_to.setObjectName(u"date_to")
+
+        self.horizontalLayout_3.addWidget(self.date_to)
+
+
+        self.verticalLayout_3.addLayout(self.horizontalLayout_3)
+
+        self.horizontalLayout_4 = QHBoxLayout()
+        self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
+        self.label_3 = QLabel(self.groupBox)
+        self.label_3.setObjectName(u"label_3")
+
+        self.horizontalLayout_4.addWidget(self.label_3)
+
+        self.personal_combobox = QComboBox(self.groupBox)
+        self.personal_combobox.setObjectName(u"personal_combobox")
+
+        self.horizontalLayout_4.addWidget(self.personal_combobox)
+
+
+        self.verticalLayout_3.addLayout(self.horizontalLayout_4)
+
+        self.horizontalLayout_5 = QHBoxLayout()
+        self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
+        self.label_5 = QLabel(self.groupBox)
+        self.label_5.setObjectName(u"label_5")
+
+        self.horizontalLayout_5.addWidget(self.label_5)
+
+        self.place_combobox = QComboBox(self.groupBox)
+        self.place_combobox.setObjectName(u"place_combobox")
+
+        self.horizontalLayout_5.addWidget(self.place_combobox)
+
+
+        self.verticalLayout_3.addLayout(self.horizontalLayout_5)
+
+        self.verticalLayout = QVBoxLayout()
+        self.verticalLayout.setObjectName(u"verticalLayout")
+        self.label_6 = QLabel(self.groupBox)
+        self.label_6.setObjectName(u"label_6")
+
+        self.verticalLayout.addWidget(self.label_6)
+
+        self.receiving_man = QTextEdit(self.groupBox)
+        self.receiving_man.setObjectName(u"receiving_man")
+
+        self.verticalLayout.addWidget(self.receiving_man)
+
+
+        self.verticalLayout_3.addLayout(self.verticalLayout)
+
+        self.verticalLayout_2 = QVBoxLayout()
+        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
+        self.label_7 = QLabel(self.groupBox)
+        self.label_7.setObjectName(u"label_7")
+
+        self.verticalLayout_2.addWidget(self.label_7)
+
+        self.purpose_visite = QTextEdit(self.groupBox)
+        self.purpose_visite.setObjectName(u"purpose_visite")
+
+        self.verticalLayout_2.addWidget(self.purpose_visite)
+
+
+        self.verticalLayout_3.addLayout(self.verticalLayout_2)
+
+
+        self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
+
+        self.groupBox_2 = QGroupBox(self.centralwidget)
+        self.groupBox_2.setObjectName(u"groupBox_2")
+        self.verticalLayout_4 = QVBoxLayout(self.groupBox_2)
+        self.verticalLayout_4.setObjectName(u"verticalLayout_4")
+        self.stacked_widget_photo = QStackedWidget(self.groupBox_2)
+        self.stacked_widget_photo.setObjectName(u"stacked_widget_photo")
+        self.stacked_widget_photo.setEnabled(True)
+#if QT_CONFIG(tooltip)
+        self.stacked_widget_photo.setToolTip(u"")
+#endif // QT_CONFIG(tooltip)
+        self.page = QWidget()
+        self.page.setObjectName(u"page")
+        self.gridLayout_2 = QGridLayout(self.page)
+        self.gridLayout_2.setObjectName(u"gridLayout_2")
+        self.imagePhoto = QLabel(self.page)
+        self.imagePhoto.setObjectName(u"imagePhoto")
+        self.imagePhoto.setEnabled(True)
+        sizePolicy.setHeightForWidth(self.imagePhoto.sizePolicy().hasHeightForWidth())
+        self.imagePhoto.setSizePolicy(sizePolicy)
+        self.imagePhoto.setFrameShape(QFrame.Box)
+        self.imagePhoto.setFrameShadow(QFrame.Raised)
+        self.imagePhoto.setWordWrap(False)
+
+        self.gridLayout_2.addWidget(self.imagePhoto, 0, 0, 1, 1)
+
+        self.stacked_widget_photo.addWidget(self.page)
+        self.page_2 = QWidget()
+        self.page_2.setObjectName(u"page_2")
+        self.gridLayout_4 = QGridLayout(self.page_2)
+        self.gridLayout_4.setObjectName(u"gridLayout_4")
+        self.face_video_widget = QVideoWidget(self.page_2)
+        self.face_video_widget.setObjectName(u"face_video_widget")
+        self.face_video_widget.setEnabled(False)
+        sizePolicy.setHeightForWidth(self.face_video_widget.sizePolicy().hasHeightForWidth())
+        self.face_video_widget.setSizePolicy(sizePolicy)
+
+        self.gridLayout_4.addWidget(self.face_video_widget, 0, 0, 1, 1)
+
+        self.stacked_widget_photo.addWidget(self.page_2)
+
+        self.verticalLayout_4.addWidget(self.stacked_widget_photo)
+
+        self.splitter = QSplitter(self.groupBox_2)
+        self.splitter.setObjectName(u"splitter")
+        self.splitter.setOrientation(Qt.Horizontal)
+        self.btn_start_cam_photo = QPushButton(self.splitter)
+        self.btn_start_cam_photo.setObjectName(u"btn_start_cam_photo")
+        self.splitter.addWidget(self.btn_start_cam_photo)
+        self.capturePhoto = QPushButton(self.splitter)
+        self.capturePhoto.setObjectName(u"capturePhoto")
+        self.splitter.addWidget(self.capturePhoto)
+
+        self.verticalLayout_4.addWidget(self.splitter)
+
+
+        self.gridLayout.addWidget(self.groupBox_2, 0, 1, 1, 2)
+
+        self.btn_clear = QPushButton(self.centralwidget)
+        self.btn_clear.setObjectName(u"btn_clear")
+        sizePolicy.setHeightForWidth(self.btn_clear.sizePolicy().hasHeightForWidth())
+        self.btn_clear.setSizePolicy(sizePolicy)
+
+        self.gridLayout.addWidget(self.btn_clear, 1, 0, 1, 1)
+
+        self.btn_save = QPushButton(self.centralwidget)
+        self.btn_save.setObjectName(u"btn_save")
+        sizePolicy.setHeightForWidth(self.btn_save.sizePolicy().hasHeightForWidth())
+        self.btn_save.setSizePolicy(sizePolicy)
+
+        self.gridLayout.addWidget(self.btn_save, 1, 1, 1, 1)
+
+        self.btn_print = QPushButton(self.centralwidget)
+        self.btn_print.setObjectName(u"btn_print")
+        sizePolicy.setHeightForWidth(self.btn_print.sizePolicy().hasHeightForWidth())
+        self.btn_print.setSizePolicy(sizePolicy)
+
+        self.gridLayout.addWidget(self.btn_print, 1, 2, 1, 1)
+
+        MainWindow.setCentralWidget(self.centralwidget)
+        self.menubar = QMenuBar(MainWindow)
+        self.menubar.setObjectName(u"menubar")
+        self.menubar.setGeometry(QRect(0, 0, 920, 23))
+        self.menubar.setMouseTracking(True)
+        self.menubar.setAcceptDrops(True)
+        self.menubar.setNativeMenuBar(True)
+        self.menuFile = QMenu(self.menubar)
+        self.menuFile.setObjectName(u"menuFile")
+        self.menu = QMenu(self.menubar)
+        self.menu.setObjectName(u"menu")
+        self.menu_3 = QMenu(self.menu)
+        self.menu_3.setObjectName(u"menu_3")
+        self.menu_2 = QMenu(self.menubar)
+        self.menu_2.setObjectName(u"menu_2")
+        MainWindow.setMenuBar(self.menubar)
+        self.statusbar = QStatusBar(MainWindow)
+        self.statusbar.setObjectName(u"statusbar")
+        MainWindow.setStatusBar(self.statusbar)
+
+        self.menubar.addAction(self.menuFile.menuAction())
+        self.menubar.addAction(self.menu.menuAction())
+        self.menubar.addAction(self.menu_2.menuAction())
+        self.menuFile.addSeparator()
+        self.menuFile.addAction(self.actionSave)
+        self.menuFile.addAction(self.actionLoad)
+        self.menuFile.addAction(self.btn_show_about)
+        self.menuFile.addSeparator()
+        self.menuFile.addAction(self.exit)
+        self.menu.addAction(self.setting_cam)
+        self.menu.addAction(self.menu_3.menuAction())
+        self.menu_3.addSeparator()
+        self.menu_3.addSeparator()
+        self.menu_3.addAction(self.btn_show_personal_window)
+        self.menu_3.addAction(self.btn_show_place_window)
+        self.menu_3.addSeparator()
+        self.menu_3.addAction(self.update_list)
+        self.menu_2.addAction(self.action_open_history)
+
+        self.retranslateUi(MainWindow)
+
+        QMetaObject.connectSlotsByName(MainWindow)
+    # setupUi
+
+    def retranslateUi(self, MainWindow):
+        MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a", None))
+        self.actionExit.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
+        self.actionSave.setText(QCoreApplication.translate("MainWindow", u"Save", None))
+        self.actionLoad.setText(QCoreApplication.translate("MainWindow", u"Load", None))
+        self.actionExit_2.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
+        self.setting_cam.setText(QCoreApplication.translate("MainWindow", u"\u041d\u0430\u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u0430\u043c\u0435\u0440\u044b", None))
+        self.btn_show_personal_window.setText(QCoreApplication.translate("MainWindow", u"\u0421\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438", None))
+        self.btn_show_place_window.setText(QCoreApplication.translate("MainWindow", u"\u041c\u0435\u0441\u0442\u043e \u0432\u044b\u0434\u043e\u0447\u0438", None))
+        self.update_list.setText(QCoreApplication.translate("MainWindow", u"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438", None))
+        self.btn_show_about.setText(QCoreApplication.translate("MainWindow", u"\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435", None))
+        self.exit.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
+        self.action_open_history.setText(QCoreApplication.translate("MainWindow", u"\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432", None))
+        self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f:", None))
+        self.label.setText(QCoreApplication.translate("MainWindow", u"\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a \u2116:", None))
+        self.label_2.setText(QCoreApplication.translate("MainWindow", u"\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0434\u0430\u0447\u0438:", None))
+        self.label_4.setText(QCoreApplication.translate("MainWindow", u"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d\u0435 \u0434\u043e:", None))
+        self.label_3.setText(QCoreApplication.translate("MainWindow", u"\u0412\u044b\u0434\u0430\u043b:", None))
+        self.label_5.setText(QCoreApplication.translate("MainWindow", u"\u041c\u0435\u0441\u0442\u043e \u0432\u044b\u0434\u0430\u0447\u0438:", None))
+        self.label_6.setText(QCoreApplication.translate("MainWindow", u"\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439:", None))
+        self.label_7.setText(QCoreApplication.translate("MainWindow", u"\u0426\u0435\u043b\u044c \u0432\u0438\u0437\u0438\u0442\u0430:", None))
+        self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow", u"\u0424\u043e\u0442\u043e", None))
+#if QT_CONFIG(statustip)
+        self.stacked_widget_photo.setStatusTip("")
+#endif // QT_CONFIG(statustip)
+        self.imagePhoto.setText("")
+        self.btn_start_cam_photo.setText(QCoreApplication.translate("MainWindow", u"\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443", None))
+        self.capturePhoto.setText(QCoreApplication.translate("MainWindow", u"\u0421\u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u043e\u0432\u0430\u0442\u044c", None))
+        self.btn_clear.setText(QCoreApplication.translate("MainWindow", u"\u041e\u0442\u0447\u0438\u0441\u0442\u0438\u0442\u044c", None))
+        self.btn_save.setText(QCoreApplication.translate("MainWindow", u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", None))
+        self.btn_print.setText(QCoreApplication.translate("MainWindow", u"\u041f\u0435\u0447\u0430\u0442\u044c", None))
+        self.menuFile.setTitle(QCoreApplication.translate("MainWindow", u"File", None))
+        self.menu.setTitle(QCoreApplication.translate("MainWindow", u"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438", None))
+        self.menu_3.setTitle(QCoreApplication.translate("MainWindow", u"\u0421\u043f\u0438\u0441\u043a\u0438", None))
+        self.menu_2.setTitle(QCoreApplication.translate("MainWindow", u"\u0418\u0441\u0442\u043e\u0440\u0438\u044f", None))
+    # retranslateUi
+