コード例 #1
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void frmDemo_Shown(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().Init("IPSScar");
            carDetector = new IPSScar();
            if (carDetector == null)
            {
                return;
            }

            CheckForIllegalCrossThreadCalls = false;
            this.KeyPreview = true;

            txtIpAddress.Text = TGMTregistry.GetInstance().ReadRegValueString("cameraAddress");

            chkEnableLog.Checked      = TGMTregistry.GetInstance().ReadRegValueBool("EnableLog");
            carDetector.EnableLog     = chkEnableLog.Checked;
            chkCrop.Checked           = TGMTregistry.GetInstance().ReadRegValueBool("CropResultImage");
            chkSaveInputImage.Checked = TGMTregistry.GetInstance().ReadRegValueBool("SaveInputImage");

            txtFolderOutput.Text = TGMTregistry.GetInstance().ReadRegValueString("folderOutput");
            txtFailedDir.Text    = TGMTregistry.GetInstance().ReadRegValueString("txtFailedDir");
            txtValidDir.Text     = TGMTregistry.GetInstance().ReadRegValueString("txtValidDir");
            txtInvalidDir.Text   = TGMTregistry.GetInstance().ReadRegValueString("txtInvalidDir");

            this.Text += " " + carDetector.Version;
            this.Text += carDetector.IsLicense ? " (Licensed)" : " (Vui lòng liên hệ: 0939.825.125)";
        }
コード例 #2
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region group_image_source

        private void txtFilePath_TextChanged(object sender, EventArgs e)
        {
            if (!File.Exists(txtFilePath.Text))
            {
                return;
            }

            TGMTregistry.GetInstance().SaveRegValue("txtFilePath", txtFilePath.Text);

            if (g_bmp != null)
            {
                g_bmp.Dispose();
            }
            try
            {
                g_bmp           = new Bitmap(txtFilePath.Text);
                picCamera.Image = g_bmp;

                SetScaleRatio();
            }
            catch (Exception ex)
            {
                PrintError(ex.Message);
            }
        }
コード例 #3
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void rdImage_CheckedChanged(object sender, EventArgs e)
        {
            if (rdImage.Checked)
            {
                StopAllCamera();
                grCamera.Visible = false;
                grImage.Visible  = true;
                grFolder.Visible = false;

                txtFilePath.Text = TGMTregistry.GetInstance().ReadRegValueString("txtFilePath");
            }
            else
            {
                if (picCamera.Image != null)
                {
                    picCamera.Image.Dispose();
                    picCamera.Image = null;
                }

                if (picResult.Image != null)
                {
                    picResult.Image.Dispose();
                    picResult.Image = null;
                }

                if (g_bmp != null)
                {
                    g_bmp.Dispose();
                    g_bmp = null;
                }
            }
        }
コード例 #4
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////

        public static TGMTregistry GetInstance()
        {
            if (m_instance == null)
            {
                m_instance = new TGMTregistry();
            }
            return(m_instance);
        }
コード例 #5
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void txtFolderInput_TextChanged(object sender, EventArgs e)
        {
            if (!Directory.Exists(txtFolderInput.Text))
            {
                return;
            }

            TGMTregistry.GetInstance().SaveRegValue("folderInput", txtFolderInput.Text);

            if (!m_isDrag)
            {
                PrintMessage("Loading files...");
                lstImage.Items.Clear();
                bgLoadFile.RunWorkerAsync();
            }
            m_isDrag = false;
        }
コード例 #6
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void rdFolder_CheckedChanged(object sender, EventArgs e)
        {
            txtResult.Text = "";
            if (picCamera.Image != null)
            {
                picCamera.Image.Dispose();
            }
            if (picResult.Image != null)
            {
                picResult.Image = null;
            }

            if (rdFolder.Checked)
            {
                if (m_isFirstLoading)
                {
                    txtFolderInput.Text = TGMTregistry.GetInstance().ReadRegValueString("folderInput");

                    m_isFirstLoading = false;
                }


                StopAllCamera();
                grFolder.Visible = true;
                grCamera.Visible = false;
                grImage.Visible  = false;

                g_scaleX = 1;
                g_scaleY = 1;

                picCamera.Visible = false;
                lstImage.Visible  = true;
            }
            else
            {
                picCamera.Visible = true;
                lstImage.Visible  = false;
            }
        }
コード例 #7
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void txtFolderOutput_TextChanged(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().SaveRegValue("folderOutput", txtFolderOutput.Text);
        }
コード例 #8
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region group_camera_source

        private void txtIpAddress_TextChanged(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().SaveRegValue("cameraAddress", txtIpAddress.Text);
        }
コード例 #9
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void txtValidDir_TextChanged(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().SaveRegValue("txtValidDir", txtValidDir.Text);
        }
コード例 #10
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkCrop_CheckedChanged(object sender, EventArgs e)
        {
            carDetector.CropResultImage = chkCrop.Checked;
            TGMTregistry.GetInstance().SaveRegValue("CropResultImage", carDetector.CropResultImage);
        }
コード例 #11
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkSaveInputImage_CheckedChanged(object sender, EventArgs e)
        {
            carDetector.SaveInputImage = chkSaveInputImage.Checked;
            TGMTregistry.GetInstance().SaveRegValue("SaveInputImage", carDetector.SaveInputImage);
        }
コード例 #12
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkEnableLog_CheckedChanged(object sender, EventArgs e)
        {
            carDetector.EnableLog = chkEnableLog.Checked;
            TGMTregistry.GetInstance().SaveRegValue("EnableLog", carDetector.EnableLog);
        }