コード例 #1
0
ファイル: MovementForm.cs プロジェクト: ko9ma7/WinBaramMacro
        private void button_return_Click(object sender, EventArgs e)
        {
            try
            {
                int    nIdIndex = dataGridView_IDInfo.CurrentCell.RowIndex;
                string strID    = GetDataGridSelectID(nIdIndex);

                string strPlace = textBox_place.Text;

                int iPos = 0;
                for (iPos = 0; iPos < PLACE.strPLACE.Length; iPos++)
                {
                    if (strPlace == PLACE.strPLACE[iPos])
                    {
                        break;
                    }
                }

                if (iPos >= PLACE.strPLACE.Length)
                {
                    Log_move.Format(strID + " 복귀실패 : 장소를 잘못 입력하셨습니다.");
                    throw new Exception();
                }

                ProcessControl.Display(IDDatas.getDataTable()[strID].nPID);

                Log_move.Format(strID + ": " + PLACE.strPLACE[iPos] + "에서 복귀시작");

                SendKeys.SendWait("04");
                ProcessControl.keyInput(Keys.Enter, 300);

                if (iPos >= 10)
                {
                    string str = "9굴" + PLACE.strPLACE[iPos][0];
                    SendKeys.SendWait(str);
                    ProcessControl.keyInput(Keys.Enter, 300);
                }
                else
                {
                    SendKeys.SendWait("9조그만삐삐");
                    ProcessControl.keyInput(Keys.Enter, 300);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #2
0
        private bool SelectSeverProgram(int nID)
        {
            bool bRet = false;

            try
            {
                ProcessControl.keyInput(Keys.Down);
                ProcessControl.keyInput(Keys.Enter, 1000);


                bRet = ImageCompareSeq(ImageProc.m_strLogin + "3.bmp", eImagetype.total, nID);
            }
            catch (Exception e) { logs.Format(e.ToString());  bRet = false; }

            return(bRet);
        }
コード例 #3
0
ファイル: MovementForm.cs プロジェクト: ko9ma7/WinBaramMacro
        private void eventMove(int nIndex)
        {
            string strID = GetDataGridSelectID(nIndex);

            string strPlace = textBox_place.Text;

            int iPos = 0;

            for (iPos = 0; iPos < PLACE.strPLACE.Length; iPos++)
            {
                if (strPlace == PLACE.strPLACE[iPos])
                {
                    break;
                }
            }

            if (iPos >= PLACE.strPLACE.Length)
            {
                Log_move.Format(strID + "이동실패 : 장소를 잘못 입력하셨습니다");
                return;
            }

            ProcessControl.Display(IDDatas.getDataTable()[strID].nPID);

            if (iPos >= 10)
            {
                SendKeys.SendWait("ZX");
                iPos -= 10;
            }

            ProcessControl.keyInput(Keys.Enter, 100);
            SendKeys.SendWait("귀환");
            ProcessControl.keyInput(Keys.Enter, 300);

            for (int i = 0; i < iPos + 1; i++)
            {
                ProcessControl.keyInput(Keys.Down, 10);
            }
            ProcessControl.keyInput(Keys.Enter, 300);

            SendKeys.SendWait("01");
            ProcessControl.keyInput(Keys.Enter);

            Log_move.Format(strID + ": " + strPlace + "이동완료.");
        }
コード例 #4
0
        private void Connectingcheck(int nID)
        {
            bool bConnecting = false;

            try
            {
                string strFilePath    = ImageProc.m_strLogin + "6.bmp";
                Image  img_Connecting = ImageProc.ImageCrop(nID, eImagetype.isconnected);
                bConnecting = ImageProc.ImageCompare(strFilePath, new Bitmap(img_Connecting));

                if (bConnecting)
                {
                    ProcessControl.keyInput(Keys.Enter);
                    ProcessControl.keyInput(Keys.Enter, 400);
                }
            }
            catch (Exception e) { }
        }
コード例 #5
0
        private bool ConnectProgram(int nID)
        {
            bool bRet = false;

            try
            {
                ProcessControl.Display(nID);
                Thread.Sleep(400); // 어떻게 할수가없음.

                ProcessControl.keyInput(Keys.Tab);
                ProcessControl.keyInput(Keys.Tab);
                ProcessControl.keyInput(Keys.Enter, 1500);

                bRet = ImageCompareSeq(ImageProc.m_strLogin + "2.bmp", eImagetype.total, nID);
            }
            catch (Exception e)
            {
                logs.Format(e.ToString());
                bRet = false;
            }

            return(bRet);
        }