Beispiel #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkResize_CheckedChanged(object sender, EventArgs e)
        {
            numWidth.Enabled      = chkResize.Checked;
            numHeight.Enabled     = chkResize.Checked;
            chkKeepAspect.Enabled = chkResize.Checked;
            TGMTregistry.GetInstance().SaveRegValue("chkResize", chkResize.Checked);
        }
Beispiel #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();

                ReadPlate();
            }
            catch (Exception ex)
            {
                PrintError(ex.Message);
            }
        }
Beispiel #3
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

            CheckForIllegalCrossThreadCalls = false;
            this.KeyPreview = true;

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

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

            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 += " " + bikeDetector.Version;
            this.Text += bikeDetector.IsLicense ? " (Licensed)" : " (Vui lòng liên hệ: 0939.825.125)";
        }
Beispiel #4
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;
                }
            }
        }
Beispiel #5
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        private void FrmSelect_Load(object sender, EventArgs e)
        {
            lblUser.Text     = "User: "******"Bãi xe: " + Program.building_id;

            TGMTregistry.GetInstance().Init("CardRegister");
            Program.token = TGMTregistry.GetInstance().ReadRegValueString("token");
            CheckToken();
        }
Beispiel #6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void Form1_Load(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().Init("TGMT cr2 to jpg");
            chkOverwrite.Checked  = TGMTregistry.GetInstance().ReadRegValueBool("chkOverwrite");
            chkRotate.Checked     = TGMTregistry.GetInstance().ReadRegValueBool("chkRotate");
            chkDelete.Checked     = TGMTregistry.GetInstance().ReadRegValueBool("chkDelete");
            chkResize.Checked     = TGMTregistry.GetInstance().ReadRegValueBool("chkResize");
            chkKeepAspect.Checked = TGMTregistry.GetInstance().ReadRegValueBool("chkKeepAspect");

            numWidth.Value  = TGMTregistry.GetInstance().ReadRegValueInt("numWidth");
            numHeight.Value = TGMTregistry.GetInstance().ReadRegValueInt("numHeight");

            this.KeyPreview = true;
        }
Beispiel #7
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        private void BtnLogout_Click(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().SaveRegValue("token", "");

            Program.token       = "";
            Program.user        = "";
            Program.building_id = "";
            Program.validToken  = false;

            frmLogin frm = new frmLogin();

            frm.FormClosed += OnFrmLoginClosed;
            frm.ShowDialog();

            lblUser.Text     = Program.user;
            lblBuilding.Text = Program.building_id;
        }
Beispiel #8
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;
        }
Beispiel #9
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;
            }
        }
Beispiel #10
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkMoveInvalid_CheckedChanged(object sender, EventArgs e)
        {
            if (chkMoveInvalid.Checked)
            {
                errorProvider1.Clear();

                if (txtInvalidDir.Text == "")
                {
                    PrintError("Invalid directory is empty");
                    chkMoveInvalid.Checked = false;
                }
                else if (!Directory.Exists(txtInvalidDir.Text))
                {
                    //does not create new dir to avoid replace existed file
                    errorProvider1.SetError(txtInvalidDir, "Dir does not exist");
                    chkMoveInvalid.Checked = false;
                }
                else
                {
                    TGMTregistry.GetInstance().SaveRegValue("txtInvalidDir", txtInvalidDir.Text);
                }
            }
        }
Beispiel #11
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkRotate_CheckedChanged(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().SaveRegValue("chkRotate", chkRotate.Checked);
        }
Beispiel #12
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkKeepAspect_CheckedChanged(object sender, EventArgs e)
        {
            numHeight.Enabled = !chkKeepAspect.Checked;
            numHeight.Value   = 0;
            TGMTregistry.GetInstance().SaveRegValue("chkKeepAspect", chkKeepAspect.Checked);
        }
Beispiel #13
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void txtFolderOutput_TextChanged(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().SaveRegValue("folderOutput", txtFolderOutput.Text);
        }
Beispiel #14
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region group_camera_source

        private void txtIpAddress_TextChanged(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().SaveRegValue("cameraAddress", txtIpAddress.Text);
        }
Beispiel #15
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void numHeight_ValueChanged(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().SaveRegValue("numHeight", numHeight.Value);
        }
Beispiel #16
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkEnableLog_CheckedChanged(object sender, EventArgs e)
        {
            bikeDetector.EnableLog = chkEnableLog.Checked;
            TGMTregistry.GetInstance().SaveRegValue("EnableLog", bikeDetector.EnableLog);
        }
Beispiel #17
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkSaveInputImage_CheckedChanged(object sender, EventArgs e)
        {
            bikeDetector.SaveInputImage = chkSaveInputImage.Checked;
            TGMTregistry.GetInstance().SaveRegValue("SaveInputImage", bikeDetector.SaveInputImage);
        }
Beispiel #18
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void chkCrop_CheckedChanged(object sender, EventArgs e)
        {
            bikeDetector.CropResultImage = chkCrop.Checked;
            TGMTregistry.GetInstance().SaveRegValue("CropResultImage", bikeDetector.CropResultImage);
        }