private void btnSiguiente_Click(object sender, EventArgs e)
        {
            if (TabWizard.SelectedIndex == 0)
            {
                //Guardar los Datos del Scanner actuales
                clsScanner       Scanner = new clsScanner();
                clsConfiguracion config  = new clsConfiguracion();

                Scanner.Description = cboScanner.Text;
                Scanner.DPI         = comboDPI.Text;
                Scanner.Depth       = comboDepth.Text;
                Scanner.Size        = comboSize.Text;
                Scanner.Duplex      = ckDuplex.Checked;

                config.SaveScanner(Scanner);
            }

            if (TabWizard.SelectedIndex == 1)
            {
                return;
            }


            TabWizard.SelectedIndex++;
            if (TabWizard.SelectedIndex == 1)
            {
                btnSiguiente.Visible = false;
                btnFinalizar.Visible = true;
                btnAnterior.Enabled  = true;
            }
            else
            {
                btnSiguiente.Visible = true;
                btnFinalizar.Visible = false;
                btnAnterior.Enabled  = false;
            }
        }
Exemple #2
0
        private void InitialHal()
        {
            m_objComPort = new clsFixture.stComPort();
            if (Properties.Settings.Default.PLC_ComNum == "")
            {
                MessageBox.Show("Com Number 输入错误!");
                return;
            }
            m_objComPort.strComPortNumber = Properties.Settings.Default.PLC_ComNum;
            m_objComPort.iBaundRate       = Properties.Settings.Default.PLC_BaudRate;
            m_objComPort.iDataBit         = Properties.Settings.Default.PLC_DataBit;
            m_objComPort.iStopBit         = Properties.Settings.Default.PLC_StopBit;
            m_objComPort.strParity        = Properties.Settings.Default.PLC_Parity;

            //m_objFixtureAMP204 = new clsFixtureAMP204();
            //if (m_objFixtureAMP204.InitialFixture(Properties.Settings.Default.Card204, 0) == false)
            //{
            //    MessageBox.Show("APM 204 card initial fail 通信初始化失败!!!");
            //    ShowLog("APM 204 初始化失败");
            //    //return;
            //}
            //else
            //{
            //    ShowLog("APM 204 初始化成功");
            //}

            //m_objFixtureAMP204.ServoOn(true);
            //m_objFixtureAMP204.HomeXY();

            //scanner
            try
            {
                clsScanner.Callback += new clsScanner.OnMessageCallback(ShowLog);
                m_objScanner         = new clsScanner();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            m_objFixture8338 = new clsFixture8338();
            if (m_objFixture8338.InitialFixture(Properties.Settings.Default.Card8338ID) == false)
            {
                MessageBox.Show("card 8338  initial fail 通信初始化失败!!!");
                ShowLog("PCIE-8338 初始化失败");
                //return;
            }
            else
            {
                ShowLog("PCIE-8338 初始化成功");
            }

            m_objFixture8338.SickLaserPowerOnOff(true);
            m_objFixture8338.Scanner = m_objScanner;
            m_objFixture8338.ServoOn(true);
            m_objFixture8338.HomeXY();

            //frmShowImage objImageShowFromLocal = new frmShowImage();
            //pbxLocal = objImageShowFromLocal.PbxShowImage;
            m_objCameraLocl = new CCBasler();


            List <ICameraInfo> listCam = CCBasler.GetDeviceList();

            bool findLocalCam = false;

            foreach (ICameraInfo cam in listCam)
            {
                if (cam[CameraInfoKey.FriendlyName].Contains(Properties.Settings.Default.Camera_LocalSN))
                {
                    findLocalCam = true;
                    m_objCameraLocl.SetDeviceInfo(cam);
                    m_objCameraLocl.ConnectToDevice();
                    m_objCameraLocl.SetExposure(Properties.Settings.Default.Camera_LocalExp);

                    break;
                }
            }

            if (findLocalCam == false)
            {
                MessageBox.Show("局部相机 通信初始化失败!!!");
                ShowLog("未能找到局部相机 ID:" + Properties.Settings.Default.Camera_LocalSN);
                //return;
            }


            //remove plc
            //m_objFixture = new clsFixture();
            //m_objFixture.ComPort = m_objComPort;
            //if (m_objFixture.InitFixture() == false)
            //{
            //    MessageBox.Show("PLC 通信初始化失败!!!");
            //    ShowLog("PLC 通信失败");
            //    //return;
            //}
        }
        private void btnSiguiente_Click(object sender, EventArgs e)
        {
            if (TabWizard.SelectedIndex == 0 && iTXTidUnico.Text.Trim().Length == 0)
            {
                MessageBox.Show("Debe de Proporcionar un ID Unico,\n\rPara poder continuar", "Faltan Datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (TabWizard.SelectedIndex == 0)
            {
                //Guardar los Datos del Scanner actuales
                clsScanner       Scanner = new clsScanner();
                clsConfiguracion config  = new clsConfiguracion();

                Scanner.Description = cboScanner.Text;
                Scanner.DPI         = comboDPI.Text;
                Scanner.Depth       = comboDepth.Text;
                Scanner.Size        = comboSize.Text;
                Scanner.Duplex      = ckDuplex.Checked;

                config.SaveScanner(Scanner);
            }

            if (TabWizard.SelectedIndex == 1)
            {
                //Guardar la Configuracón de Hojas de Documentos
                clsConfiguracion config = new clsConfiguracion();
                config.DD_Cantidad_Guardar(lvDocumentos);

                //Cargar los Objetos en arbol de Preview
                //Generar el nuevo arbol y inicializar el objeto de imagenes Capturadas
                foreach (ListViewItem elemento in lvDocumentos.Items)
                {
                    TreeNode nn = new TreeNode(elemento.Text);
                    nn.Tag = elemento.Tag;
                    tvTiposDocumentos.Nodes.Add(nn);
                    imagenesCapturadas.Add(new ScannedImageList());
                }
                tvTiposDocumentos.SelectedNode = tvTiposDocumentos.Nodes[0];
                tvTiposDocumentos.Select();
            }

            //Cambiar de TAB
            if (TabWizard.SelectedIndex == 2)
            {
                return;
            }

            btnAnterior.Enabled = true;
            TabWizard.SelectedIndex++;
            if (TabWizard.SelectedIndex == 2)
            {
                btnSiguiente.Visible = false;
                btnFinalizar.Visible = true;
            }
            else
            {
                btnSiguiente.Visible = true;
                btnFinalizar.Visible = false;
            }
        }