private void CommandInput(int nIndex, string strID) { if (strID == "" || IDDatas.getDataTable()[strID].nPID == -1) { return; } string strInput = dataGridView_Command.Rows[nIndex].Cells["명령어"].Value.ToString(); ProcessControl.Display(IDDatas.getDataTable()[strID].nPID); string[] inputs = stringParser.ParserSpecial(strInput); foreach (string input in inputs) { if (input == "") { continue; } if (input.ToUpper() == "enter".ToUpper()) { ProcessControl.keyInput(Keys.Enter, 100); } else { SendKeys.SendWait(input); } } Log_move.Format(strID + ": " + strInput + "수행"); }
private void SingleExecute(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex < 0 || e.ColumnIndex != dataGridView_Info.Columns["Single Execute"].Index) { return; } int nIndex = e.RowIndex; if (IDDatas.getDataTable()[GetDataGridSelectID(nIndex)].nPID != -1) { ProcessControl.Display(IDDatas.getDataTable()[GetDataGridSelectID(nIndex)].nPID); } else { Thread_LE = new Thread(() => ThreadNewSequence(nIndex, true)); Thread_LE.Start(); } //This is the code which will show the button click row data. Thank you. } catch (Exception ex) { logs.Format(ex.ToString()); } }
private void ThreadMultiExecute() { try { for (int nIndex = 0; nIndex < IDDatas.getDataTable().Count; nIndex++) { if (dataGridView_Info.Rows[nIndex].Selected == false) { continue; } if (IDDatas.getDataTable()[GetDataGridSelectID(nIndex)].nPID != -1) { ProcessControl.Display(IDDatas.getDataTable()[GetDataGridSelectID(nIndex)].nPID); } else { Thread_LE = new Thread(() => ThreadNewSequence(nIndex)) { IsBackground = false }; Thread_LE.Start(); Thread_LE.Join(); } } } catch (Exception) { } }
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()); } }
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 + "이동완료."); }
private void BTDisplay_Click(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex < 0 || e.ColumnIndex != dataGridView_IDInfo.Columns["BTDisplay"].Index) { return; } int nIndex = e.RowIndex; string strID = GetDataGridSelectID(nIndex); ProcessControl.Display(GetDataGridSelectPID(nIndex)); //This is the code which will show the button click row data. Thank you. } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
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); }