Jelajahi Sumber

Начали перехватывать ошибки подключения и пишем все это в логи

Alex Sidorov 1 tahun lalu
induk
melakukan
d62b4e5c97

+ 18 - 15
PropuskWidgets/PCamChecked.py

@@ -1,21 +1,23 @@
 
-from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, QComboBox, QPushButton
+from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, QComboBox, QPushButton, QMessageBox
 from PropuskWidgets.PStackedWidget import PStackedWidget
-from module.cam import IPCam, USBCam, load_image, get_list_name_cam
-import os
+from module.cam import IPCam, USBCam, get_list_name_cam, check_error
+from module.MyMessageBox import show_dialog
+from time import sleep
+
 
 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': 
+            case 'video':
                 self.line_cam = QComboBox(self)
-                #load list cam
+                # load list cam
                 [self.line_cam.addItem(x) for x in get_list_name_cam()]
             case 'snapshot': self.line_cam = QLineEdit(self)
 
@@ -40,9 +42,8 @@ class PCamChecked(QWidget):
         self.btn_stop.setText('Остановить')
         self.btn_stop.clicked.connect(self._stop_cam)
         self.hLayout.addWidget(self.btn_stop)
-        
-        self.vLayout.addLayout(self.hLayout)
 
+        self.vLayout.addLayout(self.hLayout)
 
     def get_value(self) -> str:
         match self.__mode:
@@ -53,21 +54,23 @@ class PCamChecked(QWidget):
             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.pStackedWidget.to_video()
+                self.__wwc = USBCam(self.pStackedWidget.video,
+                                    self.line_cam.currentText())
                 self.__wwc.start_cam()
             case 'snapshot':
+                self.pStackedWidget.to_video()
                 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()  
+        self.__wwc.stop_cam()
         del self.__wwc
-        self.pStackedWidget.to_image()
+        self.pStackedWidget.to_image()

+ 4 - 3
module/MyMessageBox.py

@@ -1,14 +1,15 @@
 from PySide6.QtWidgets import QMessageBox
 from logger import logger
 
-def show_dialog(state: QMessageBox.Icon, title: str, massage: str):
+def show_dialog(state: QMessageBox.Icon, title: str, massage: str) -> bool:
    msgBox = QMessageBox()
    msgBox.setIcon(state)
    msgBox.setText(massage)
    msgBox.setWindowTitle(title)
    msgBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
-#    msgBox.buttonClicked.connect(msgButtonClick)
 
    returnValue = msgBox.exec()
    if returnValue == QMessageBox.Ok:
-      logger.info('MyMessageBox press ok')
+      return True
+   else:
+      return False

+ 52 - 16
module/cam/IPCam.py

@@ -2,39 +2,74 @@ from PySide6.QtWidgets import QLabel
 from PySide6.QtCore import Qt
 from threading import Thread
 from PySide6.QtGui import QImage, QPixmap
+from PySide6.QtWidgets import QMessageBox
 import cv2
 from module.ImageTool import create_filename
+from logger import logger
+
+def check_error(func):
+    def wrapper(*args):
+        try:
+            print(args)
+            return func(*args)
+        except ConnectionError:
+            args[0].stop_cam()
+            
+    return wrapper
 
 class IPCam(Thread):
     lnk_connect: str = None
     qLabel: QLabel = None
+    net_work_error: bool = False
 
     def __init__(self, parent=None) -> None:
         Thread.__init__(self, parent)
         self.status = True
         self.cap = True
-
+    
     def run(self) -> None:
-        self.cap = cv2.VideoCapture()
+        logger.info("srarting take image from ip cam")
+        self.net_work_error = False
+        try:
+            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)
+            if 'rtsp' in self.lnk_connect:
+                self.cap.open(self.lnk_connect)    
+            
+                if not self.cap.isOpened():
+                    raise ConnectionError
             
-            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))
+            while self.status:
+            
+                if 'http' in self.lnk_connect:
+                    self.cap.open(self.lnk_connect)
+                    
+                    if not self.cap.isOpened():
+                        raise ConnectionError
+                
+                ret, frame = self.cap.read()
+                if not ret:
+                    continue
 
-            self.qLabel.setPixmap(self.__scaled_img)
+                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"\
-    
+            
+        except ConnectionError:
+            logger.error("Нет сети или не правильная строка подключения")
+            logger.info("stop take image from ip cam")
+            self.status = False
+            self.qLabel.setText('Нет сети или не правильная строка подключения')    
+        except RuntimeError:
+            self.status = False        
+
     def stop_cam(self):
-        print("Stopped...")
+        logger.info("stop take image from ip cam")
         self.cap.release()
         self.status = False
         # cv2.destroyAllWindows()
@@ -44,4 +79,5 @@ class IPCam(Thread):
         name_file = create_filename()
         qLabel.setPixmap(self.__scaled_img)
         self.__scaled_img.save(name_file, 'jpg')
-        return name_file
+        return name_file
+    

+ 1 - 1
module/cam/__init__.py

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

+ 7 - 2
window/MainWindow.py

@@ -80,11 +80,15 @@ class MainWindow(QMainWindow, Ui_MainWindow):
             self.__mode, self.__cam = self.__get_selected_cam()
         except ValueError:
             logger.warning(warring_cams.get("title"))
-            show_dialog(
+            if show_dialog(
                 QMessageBox.Warning,
                 warring_cams.get("title"),
                 warring_cams.get("body")
-            )
+            ):
+                self._show_setting_cam_window()
+                self._check_setting_cam()
+            else:
+                self.close()
 
     def _init_push_btn_action(self) -> None:
         self.btn_start_cam_photo.clicked.connect(
@@ -153,6 +157,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
                 raise ValueError('Нет записи о камерах')
 
     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)

+ 0 - 97
window/ui_py/ui_DialogSettingCam_back.py

@@ -1,97 +0,0 @@
-# -*- 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

+ 0 - 341
window/ui_py/ui_MainWindow_back.py

@@ -1,341 +0,0 @@
-# -*- 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
-