Example #1
0
        public frmImgProcess()
        {
            InitializeComponent();
            imgProcess = this;
            this.drawArea.Initialize();
            SaveImageToXml           = new SaveImageToXml();
            m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
            string configFile = Application.StartupPath + "\\Config\\ImgProDockPanel.config";

            if (File.Exists(configFile))
            {
                dockPanel.LoadFromXml(configFile, m_deserializeDockContent);
            }
            else
            {
                backImages           = new frmBackImages(this.p_Main);
                preferImages         = new frmPreferImages(this.p_Main);
                backImages.dbClick   = new frmBackImages.DbClick(BackPtbDbClick);
                preferImages.dbClick = new frmPreferImages.DbClick(PreferPtbDbClick);
                backImages.Show(this.dockPanel, BaseControls.Docking.DockState.DockRight);
                preferImages.Show(this.dockPanel, BaseControls.Docking.DockState.DockRight);
                if (GetConfig.IsAddLocMap)
                {
                    frmSLocMap = new frmSimpleLocMap(this.p_Main);
                    frmSLocMap.Show(this.dockPanel, BaseControls.Docking.DockState.DockRight);
                }
            }
        }
Example #2
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            switch (persistString)
            {
            case "SIS.frmBackImages":
                backImages         = new frmBackImages(this.p_Main);
                backImages.dbClick = new frmBackImages.DbClick(BackPtbDbClick);
                return(backImages);

            case "SIS.frmPreferImages":
                preferImages         = new frmPreferImages(this.p_Main);
                preferImages.dbClick = new frmPreferImages.DbClick(PreferPtbDbClick);
                return(preferImages);

            case "SIS.frmSimpleLocMap":
                frmSLocMap = new frmSimpleLocMap(this.p_Main);
                return(frmSLocMap);

            default:
                return(null);
            }
        }
Example #3
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            switch (persistString)
            {
            case "SIS.frmBackImages":
                backImages         = new frmBackImages(this.p_Main);
                backImages.dbClick = new frmBackImages.DbClick(PtbCtlDbClick);
                return(backImages);

            case "SIS.frmPreferImages":
                preferImages         = new frmPreferImages(this.p_Main);
                preferImages.dbClick = new frmPreferImages.DbClick(PtbCtlDbClick);
                return(preferImages);

            case "SIS.frmQuickReg":
                frmQuickReg = new frmQuickReg(this.p_Main);
                frmQuickReg.Show(this.dockPanel, BaseControls.Docking.DockState.DockRightAutoHide);
                return(preferImages);

            default:
                return(null);
            }
        }
Example #4
0
        public frmImageGather()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;
            this.p_Main.Dock = DockStyle.Fill;
            GatherCallBack gtb = new GatherCallBack(GetCallBack);

            gather                   = new Gather(gtb);
            gather.parentHwnd        = this.Handle;
            m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
            this.msComm              = new MSComm(this.axMSComm1);
            this.msComm.onCommGather = new SIS.ImgGather.MSComm.OnCommGather(GatherMultimedia);
            // UsbjoyStick.joySetCapture(this.Handle, UsbjoyStick.JOYSTICKID1, 100, false);//测试USE手柄
            if (gather.OpenCard())
            {
                gather.initCard();
                if (GetConfig.COS_IsUse)
                {
                    if (!this.msComm.OpenCom())
                    {
                        MessageBoxEx.Show("串行端口打开失败!请检查设置参数是否正确!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    if (GetConfig.COS_CommMode == "2")
                    {
                        UsbjoyStick.joySetCapture(this.Handle, UsbjoyStick.JOYSTICKID1, 100, false);
                    }
                }
            }
            else
            {
                MessageBoxEx.Show("采集卡打开失败!请确保正确安装上采集卡!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            //this.axHYImage1.OnEventCallback += new EventHandler(axHYImage1_OnEventCallback);
            //if (this.OpenCard())
            //{
            //    this.InitCard();
            //    if (GetConfig.COS_IsUse)
            //        if (!this.msComm.OpenCom())
            //            MessageBoxEx.Show("串行端口打开失败!请检查设置参数是否正确!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //}
            //else
            //    MessageBoxEx.Show("采集卡打开失败!请确保正确安装上采集卡!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            string configFile = Application.StartupPath + "\\Config\\ImgGatDockPanel.config";

            if (!dockPanel.LoadFromXml(configFile, m_deserializeDockContent))
            {
                backImages           = new frmBackImages(this.p_Main);
                preferImages         = new frmPreferImages(this.p_Main);
                backImages.dbClick   = new frmBackImages.DbClick(PtbCtlDbClick);
                preferImages.dbClick = new frmPreferImages.DbClick(PtbCtlDbClick);
                backImages.Show(this.dockPanel, BaseControls.Docking.DockState.DockRight);
                preferImages.Show(this.dockPanel, BaseControls.Docking.DockState.DockRight);
                if (GetConfig.IsQuickReg)
                {
                    frmQuickReg = new frmQuickReg(this.p_Main);
                    frmQuickReg.Show(this.dockPanel, BaseControls.Docking.DockState.DockRight);
                }
            }
        }