Ejemplo n.º 1
0
        private void InitAttr()
        {
            settingIsLoaded = false;
            try
            {
                setting         = ModuleSetting.Load();
                settingIsLoaded = true;

                reportServer1 = setting.serveraddress1;
                reportServer2 = setting.serveraddress2;
                //screenID = setting.screen_id;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            numFacesDetected = 0;
            showGrid         = false;
            doRegister       = false;
            isAutoRegister   = true;
            isDBLoaded       = false;
            lastRegisterTime = DateTime.Now;
            failedCount      = new int[5] {
                0, 0, 0, 0, 0
            };

            isRecordingEnabled = true;
            ConfigureRecording();

            autoRegisterToolStripMenuItem.Checked = isAutoRegister;
            btRegister.Enabled = !isAutoRegister;
            showGridToolStripMenuItem.Checked = showGrid;

            faceRectColor = new List <Color>();
            faceRectColor.Add(Color.Coral);
            faceRectColor.Add(Color.Lime);
            faceRectColor.Add(Color.Cyan);
            faceRectColor.Add(Color.Beige);
            faceRectColor.Add(Color.Yellow);

            msgCount = 1;
            logFile  = Application.StartupPath + "\\openscreen.log";
            //saveFaceImgRootDir = Application.StartupPath + "\\faceimg\\";
            saveFaceImgRootDir = "c:\\AG_Image\\";
            allRecogFaces      = new List <FaceObject>();

            try
            {
                agClient = new UdpClient(agServerAddr, agServerPort);
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }


            autoRegTimer.Start();
            pictureBox.Paint += PictureBox_Paint;
        }
Ejemplo n.º 2
0
        private bool ValidateConfigutation()
        {
            bool isValid = false;

            try
            {
                setting = new ModuleSetting();
                setting.serveraddress1       = cfgServerAddress1.Text;
                setting.serveraddress2       = cfgServerAddress2.Text;
                setting.screen_id            = cfgScreenID.Text;
                setting.location             = cfgLocation.Text;
                setting.directorient         = cfgDirectionOrientation.Text;
                setting.centroidbound        = cfgCentroidBound.Text;
                setting.facesizebound        = cfgFaceSizeBound.Text;
                setting.registrationinterval = (int)cfgInterval.Value;
                setting.recogcompensaation   = (int)cfgCompensation.Value;

                isValid = true;
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }

            return(isValid);
        }
Ejemplo n.º 3
0
        private void configurationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ConfigForm configForm = new ConfigForm();

            if (configForm.ShowDialog() == DialogResult.OK)
            {
                setting = ModuleSetting.Load();
                ConfigureCameraInfo();
                ConfigureRecogInfo();
            }
        }
Ejemplo n.º 4
0
 private void LoadConfigFile()
 {
     try
     {
         setting = ModuleSetting.Load();
         this.DisplayConfigContent();
     }
     catch (Exception ex)
     {
         ShowError(ex.Message);
     }
 }
Ejemplo n.º 5
0
        public static ModuleSetting Load()
        {
            ModuleSetting setting = null;

            try
            {
                String configContent = File.ReadAllText(configFilePath);
                setting = new JavaScriptSerializer().Deserialize <ModuleSetting>(configContent);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(setting);
        }