Prechádzať zdrojové kódy

Добавление справочной системы

phoenix.XLIX 2 rokov pred
rodič
commit
cd25fb4a60

+ 23 - 8
T FaceRecognizer/FormMain.Designer.cs

@@ -90,6 +90,7 @@
             this.PbxLogo = new System.Windows.Forms.PictureBox();
             this.SplitContainer = new System.Windows.Forms.SplitContainer();
             this.TimerCamsControl = new System.Windows.Forms.Timer(this.components);
+            this.LblLinkHelp = new System.Windows.Forms.LinkLabel();
             ((System.ComponentModel.ISupportInitialize)(this.PbxFaces)).BeginInit();
             this.PanelMenu.SuspendLayout();
             this.PanSettings.SuspendLayout();
@@ -508,11 +509,11 @@
             this.tabPage2.Controls.Add(this.BtnIn);
             this.tabPage2.Controls.Add(this.BtnOut);
             this.tabPage2.Controls.Add(this.PbxIdentification);
-            this.tabPage2.Location = new System.Drawing.Point(4, 30);
+            this.tabPage2.Location = new System.Drawing.Point(4, 22);
             this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.tabPage2.Name = "tabPage2";
             this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.tabPage2.Size = new System.Drawing.Size(429, 355);
+            this.tabPage2.Size = new System.Drawing.Size(429, 363);
             this.tabPage2.TabIndex = 1;
             this.tabPage2.Text = "Ident";
             this.tabPage2.UseVisualStyleBackColor = true;
@@ -564,9 +565,9 @@
             this.tabPage3.Controls.Add(this.label11);
             this.tabPage3.Controls.Add(this.TbxSearch);
             this.tabPage3.Controls.Add(this.DgbJournal);
-            this.tabPage3.Location = new System.Drawing.Point(4, 30);
+            this.tabPage3.Location = new System.Drawing.Point(4, 22);
             this.tabPage3.Name = "tabPage3";
-            this.tabPage3.Size = new System.Drawing.Size(429, 355);
+            this.tabPage3.Size = new System.Drawing.Size(429, 363);
             this.tabPage3.TabIndex = 2;
             this.tabPage3.Text = "Journal";
             this.tabPage3.UseVisualStyleBackColor = true;
@@ -649,9 +650,9 @@
             this.tabPage4.Controls.Add(this.CbxSaveLocationForm);
             this.tabPage4.Controls.Add(this.CmbCams);
             this.tabPage4.Controls.Add(this.label7);
-            this.tabPage4.Location = new System.Drawing.Point(4, 30);
+            this.tabPage4.Location = new System.Drawing.Point(4, 22);
             this.tabPage4.Name = "tabPage4";
-            this.tabPage4.Size = new System.Drawing.Size(429, 355);
+            this.tabPage4.Size = new System.Drawing.Size(429, 363);
             this.tabPage4.TabIndex = 3;
             this.tabPage4.Text = "Settings";
             this.tabPage4.UseVisualStyleBackColor = true;
@@ -725,13 +726,14 @@
             this.GbxInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
+            this.GbxInfo.Controls.Add(this.LblLinkHelp);
             this.GbxInfo.Controls.Add(this.label10);
             this.GbxInfo.Controls.Add(this.label9);
             this.GbxInfo.Controls.Add(this.label8);
             this.GbxInfo.Controls.Add(this.label6);
             this.GbxInfo.Location = new System.Drawing.Point(6, 110);
             this.GbxInfo.Name = "GbxInfo";
-            this.GbxInfo.Size = new System.Drawing.Size(415, 221);
+            this.GbxInfo.Size = new System.Drawing.Size(415, 237);
             this.GbxInfo.TabIndex = 1;
             this.GbxInfo.TabStop = false;
             this.GbxInfo.Text = "О программе";
@@ -742,7 +744,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label10.Location = new System.Drawing.Point(6, 176);
             this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(403, 58);
+            this.label10.Size = new System.Drawing.Size(403, 32);
             this.label10.TabIndex = 3;
             this.label10.Text = "• Настройка параметров приложения";
             // 
@@ -832,6 +834,18 @@
             this.TimerCamsControl.Enabled = true;
             this.TimerCamsControl.Tick += new System.EventHandler(this.TimerCamsControl_Tick);
             // 
+            // LblLinkHelp
+            // 
+            this.LblLinkHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.LblLinkHelp.Location = new System.Drawing.Point(6, 208);
+            this.LblLinkHelp.Name = "LblLinkHelp";
+            this.LblLinkHelp.Size = new System.Drawing.Size(403, 26);
+            this.LblLinkHelp.TabIndex = 4;
+            this.LblLinkHelp.TabStop = true;
+            this.LblLinkHelp.Text = "• Подробно";
+            this.LblLinkHelp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LblLinkHelp_LinkClicked);
+            // 
             // FormMain
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F);
@@ -946,6 +960,7 @@
         private System.Windows.Forms.Label label11;
         private System.Windows.Forms.TextBox TbxSearch;
         private System.Windows.Forms.Timer TimerCamsControl;
+        private System.Windows.Forms.LinkLabel LblLinkHelp;
     }
 }
 

+ 25 - 8
T FaceRecognizer/FormMain.cs

@@ -495,7 +495,6 @@ values (@last,@first,@patr,@phone,@snils,@photo)
             }
         }
 
-
         /// <summary>
         /// получение информации о пользователе и тренировка модели для распознавания
         /// </summary>
@@ -529,13 +528,21 @@ from Users";
             {
                 while (Res.Read())
                 {
-                    FaceItem = new FaceData();
-                    FaceItem.FaceImage = new Image<Gray, byte>(Application.StartupPath + "\\" + Res["Photo"].ToString());
-                    FaceItem.PersonName = Res["Firstname"].ToString();
-                    FaceItem.LastName = Res["Lastname"].ToString();
-                    FaceItem.Patronymic = Res["Patronymic"].ToString();
-                    FaceItem.UserID = Res["UserID"].ToString();
-                    FaceList.Add(FaceItem);
+                    try
+                    {
+                        FaceItem = new FaceData();
+                        FaceItem.FaceImage = new Image<Gray, byte>(Application.StartupPath + "\\" + Res["Photo"].ToString());
+                        FaceItem.PersonName = Res["Firstname"].ToString();
+                        FaceItem.LastName = Res["Lastname"].ToString();
+                        FaceItem.Patronymic = Res["Patronymic"].ToString();
+                        FaceItem.UserID = Res["UserID"].ToString();
+                        FaceList.Add(FaceItem);
+                    }
+                    catch (Exception ex)
+                    {
+                        MessageBox.Show(ex.Message, "FaceTrack", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
+
                 }
             }
             else
@@ -874,5 +881,15 @@ from Users
         {
             CamsPreview();
         }
+
+        private void LblLinkHelp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            if (!File.Exists(Application.StartupPath + "\\Source\\help.chm"))
+            {
+                MessageBox.Show("В данный момент времени справочная система приложения недоступна!", "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+                return;
+            }
+            System.Diagnostics.Process.Start(Application.StartupPath + "\\Source\\help.chm");
+        }
     }
 }

BIN
T FaceRecognizer/bin/Debug/Source/Faces/Наталья74858464851.bmp


BIN
T FaceRecognizer/bin/Debug/Source/T FaceRecognizer.exe


BIN
T FaceRecognizer/bin/Debug/Source/help.chm


BIN
T FaceRecognizer/bin/Debug/T FaceRecognizer.exe


+ 2 - 2
T FaceRecognizer/bin/Debug/localSettings.txt

@@ -1,5 +1,5 @@
 0
 -1
 -1
--1
--1
+64
+36