Esempio n. 1
0
        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            Rectangle rect = new Rectangle();

            FullScreen.SetFullScreen(false, ref rect);
            //UnitechDSDll.CloseCamera();
            SyncHelp.StopSync();
            UploadHelp.StopUpload();

            try
            {
                //this.DecodeApi.aDecodeSetDecodeEnable(0);
                //this.DecodeApi.Close();
            }
            catch
            {
            }
            try
            {
                this.CamSdk.Close();
            }
            catch
            {
            }

            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
Esempio n. 2
0
        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            Rectangle rect = new Rectangle();

            FullScreen.SetFullScreen(false, ref rect);
            //Scanner.GetScanner().Close();
            //Scanner.GetScanner().Unregister();
            //UnitechDSDll.CloseCamera();
            try
            {
                SyncHelp.StopSync();
            }
            catch
            {
            }
            try
            {
                UploadHelp.StopUpload();
            }
            catch
            {
            }
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
Esempio n. 3
0
        private unsafe bool Init()
        {
            //if (!Common.CheckProecess())
            //{
            //    if (MessageBox.Show("点否后退出程序,进入任务管理器查看是否有正在运行的本程序!", "确认您只打开了一次本程序吗?点是则继续运行!", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
            //        == DialogResult.No)
            //        return false;
            //}
            ParentForm       = this;
            tmUpload.Enabled = false;//不使用这个计时器开启上报了

            Rectangle rect = new Rectangle();

            FullScreen.SetFullScreen(true, ref rect);//隐藏顶部任务栏
            pnlState.BackColor = Color.DeepSkyBlue;
            lblTime.Visible    = true;
            lblTime.Location   = new Point((this.Width - lblTime.Width) / 2 + 12, lblTime.Location.Y);
            lblAbout.Location  = new Point((this.Width - lblAbout.Width) / 2 + 14, lblAbout.Location.Y);
            lblTime.Text       = lblTime.Text = DateTime.Now.ToString("HH:mm");
            try
            {
                //初始化扫码枪
                this.DecodeApi = new DecodeApi.net.CDecodeApi();
                uint dwReturnValue;
                this.DecodeApi.aDecodeGetModuleType(&dwReturnValue);
                uint dwModuleType = dwReturnValue;
                if (dwModuleType == (uint)MODULE_TYPE.DCD_MODULE_TYPE_NONE)
                {
                    this.DecodeApi.Close();
                    Application.Exit();
                }
                this.DecodeApi.aDecodeSetDecodeEnable(1);
                this.DecodeApi.OnScanned += new DecodeApi.net.ScannerEventHandler(this.FormScanTest_OnScanned);
                DecodeApi.aDecodeSetBeepEnable(1);     //声音
                DecodeApi.aDecodeSetVibratorEnable(1); //扫描失败时的震动
                DecodeApi.aDecodeSymSetEnableAll(1);


                //this.DecodeApi = new DecodeApi.net.CDecodeApi();
                ////this.DecodeApi.aDecodeSetBeepEnable(1);//开启声音
                ////this.DecodeApi.aDecodeSetVibratorEnable(1);//关闭震动
                ////this.DecodeApi.aDecodeSetDecodeEnable(1);
                //this.DecodeApi.OnScanned += new DecodeApi.net.ScannerEventHandler(this.FormScanTest_OnScanned);
                //初始化照相机
                CamSdk = new PM_CAMSDK();
                CamSdk.CamSetPreviewResolutionType((int)_Image_Type_.RESOLUTION_QVGA);
                CamSdk.CamSetCaptureResolutionType((int)_Image_Type_.RESOLUTION_QVGA);
                CamSdk.CamSetWindowPOS(0, 150, 382, 300);
                CamSdk.CamTargetWindow(this.Handle);
                CamSdk.CamSetCaptureDecodeDelay(1000);
            }
            catch
            {
            }
            return(true);
        }
Esempio n. 4
0
        private void FrmParent_Closing(object sender, CancelEventArgs e)
        {
            Rectangle rect = new Rectangle();

            FullScreen.SetFullScreen(false, ref rect);
            //Scanner.GetScanner().Close();
            Scanner.GetScanner().Unregister();
            UnitechDSDll.CloseCamera();
            SyncHelp.StopSync();
            UploadHelp.StopUpload();
        }
Esempio n. 5
0
        public FrmParent()
        {
            InitializeComponent();
            Rectangle rect = new Rectangle();

            FullScreen.SetFullScreen(true, ref rect);//隐藏顶部任务栏
            pnlState.BackColor = Color.DeepSkyBlue;
            lblTime.Visible    = true;
            lblTime.Location   = new Point((this.Width - lblTime.Width) / 2 + 2, lblTime.Location.Y);
            //lblAbout.Location = new Point((this.Width - lblAbout.Width) / 2 + 2, lblAbout.Location.Y);
            lblTime.Text = lblTime.Text = DateTime.Now.ToString("HH:mm");
            ParentForm   = this;
        }
Esempio n. 6
0
 private void btnExit_Click(object sender, EventArgs e)
 {
     if (CheckPDAPassword("010203"))
     {
         DialogResult dr = MessageBox.Show("确定要退出本系统吗?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
         if (dr == DialogResult.Yes)
         {
             Rectangle rect = new Rectangle();
             FullScreen.SetFullScreen(false, ref rect);
             //UnitechDSDll.CloseCamera();
             SyncHelp.StopSync();
             UploadHelp.StopUpload();
             //Common. WriteIsClose();
             FrmParent.ParentForm.DecodeApi.aDecodeSetDecodeEnable(0);
             FrmParent.ParentForm.DecodeApi.Close();
             FrmParent.ParentForm.CamSdk.Close();
             Application.Exit();
         }
     }
 }
Esempio n. 7
0
 private void btnShowHideTop_Click(object sender, EventArgs e)
 {
     if (CheckPDAPassword())
     {
         Rectangle rect = new Rectangle();
         if (btnShowHideTop.Tag == null)
         {
             FullScreen.SetFullScreen(true, ref rect);//隐藏顶部任务栏
             FrmParent.ParentForm.pnlState.BackColor = Color.DeepSkyBlue;
             FrmParent.ParentForm.lblTime.Visible    = true;
             btnShowHideTop.Tag = "1";
         }
         else
         {
             FullScreen.SetFullScreen(false, ref rect);//显示顶部任务了
             FrmParent.ParentForm.pnlState.BackColor = Color.Transparent;
             FrmParent.ParentForm.lblTime.Visible    = false;
             btnShowHideTop.Tag = null;
         }
     }
 }
Esempio n. 8
0
        /// <summary>
        /// 打开子窗体
        /// </summary>
        /// <param name="ps"></param>
        /// <returns></returns>
        public UserControl OpenForm(PageState ps)
        {
            if (this.InvokeRequired)
            {
                OpenFormDelegate ofd = new OpenFormDelegate(OpenForm);
                this.Invoke(ofd, ps);
            }
            else
            {
                if (ps != PageState.Sync && DateTime.Now < DateTime.Parse("2017-01-01"))
                {
                    MessageBox.Show("系统时间异常,请通过[信息同步]界面同步服务器时间!", "请同步系统时间", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                    if (ps != PageState.Main)
                    {
                        ps = PageState.Main;
                    }
                }
                this.TopMost = false;
                switch (ps)
                {
                case PageState.Main:
                    CurrentUc = new UCMain();
                    break;

                case PageState.Sync:
                    CurrentUc = new UCSyncAll();
                    Rectangle rect = new Rectangle();
                    FullScreen.SetFullScreen(true, ref rect);    //隐藏顶部任务栏
                    break;

                case PageState.SetNumber:
                    CurrentUc = new UCSetNumber(Common._PDANumber);
                    break;

                case PageState.SetStorage:
                    CurrentUc = new UCSetStorage();
                    break;

                case PageState.SetDestin:
                    CurrentUc = new UCSetDestin();
                    break;

                case PageState.OrderInout:
                    CurrentUc = new UCOrderInput();
                    break;

                case PageState.NodeScan:
                    CurrentUc = new UCNodeScan();
                    break;

                case PageState.UploadConfig:
                    CurrentUc = new UCUploadConfig();
                    break;

                case PageState.ThirdParty:
                    CurrentUc = new UCThirdParty();
                    break;

                case PageState.Connect:
                    CurrentUc = new UCConnect();
                    break;

                case PageState.WaitUploadNode:
                    CurrentUc = new UCNodeList();
                    break;
                }
                CurrentUc.Dock = DockStyle.Fill;
                if (pnlMain.Controls.Count == 1)
                {
                    pnlMain.Controls[0].Dispose();
                    //pnlMain.Controls.Remove(pnlMain.Controls[0]);
                }
                pnlMain.Controls.Add(CurrentUc);
                pnlMain.Tag = ps;
                CheckInputPnl(false);
            }
            ConnectHelp.wcdma_procwnd = new HT380_WCDMA_PROCWND(CurrentUc);
            return(CurrentUc);
        }