/// <summary> /// IPS Scan 버튼 클릭 이벤트 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnIPSScan_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (state_ips != LGCNS.ezControl.Common.enumReferenceState.Active || state_sorter != LGCNS.ezControl.Common.enumReferenceState.Active) { this.BaseClass.MsgInfo("시뮬레이터와 연결해주세요.", BaseEnumClass.CodeMessage.MESSAGE); return; } List <BCDResult> SelectedBCDResult = BCDResultList.Where(p => p.IsSelected == true).ToList(); for (int i = 0; i < SelectedBCDResult.Count(); i++) { SendData(2, CEnum2.EnumToCoreEventForSimulator.TestIPSScan, SelectedBCDResult[i].CART_NO, SelectedBCDResult[i].CART_CNT, SelectedBCDResult[i].PID, SelectedBCDResult[i].INDUCTION_NO, BCD_PIDMap[SelectedBCDResult[i].PID]); } }
private void BtnAIScan_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { List <BCDResult> SelectedBCDResult = BCDResultList.Where(p => p.IsSelected == true).ToList(); string[] type = { "P", "B" }; Random r = new Random(); if (SelectedBCDResult.Count() == 2 && SelectedBCDResult[0].CART_CNT == "1" && SelectedBCDResult[1].CART_CNT == "1") { SendData(3, CEnum2.EnumToCoreEventForSimulator.TestAIScan, SelectedBCDResult[0].PID, SelectedBCDResult[0].CART_NO, SelectedBCDResult[0].CART_CNT, SelectedBCDResult[1].PID, SelectedBCDResult[1].CART_NO, SelectedBCDResult[1].CART_CNT, type[r.Next(0, 2)], type[r.Next(0, 2)]); } else { for (int i = 0; i < SelectedBCDResult.Count(); i++) { if (SelectedBCDResult[i].CART_CNT == "1") { int tmp = r.Next(1, 3); switch (tmp) { case 1: //화물 1개, 빈카트 1개 SendData(3, CEnum2.EnumToCoreEventForSimulator.TestAIScan, SelectedBCDResult[i].PID, SelectedBCDResult[i].CART_NO, SelectedBCDResult[i].CART_CNT, "0", Convert.ToInt32(SelectedBCDResult[i].CART_NO + 1).ToString(), SelectedBCDResult[i].CART_CNT, type[r.Next(0, 2)], "?"); break; case 2: //빈카트 1개, 화물 1개 SendData(3, CEnum2.EnumToCoreEventForSimulator.TestAIScan, "0", (Convert.ToInt32(SelectedBCDResult[i].CART_NO) - 1).ToString(), SelectedBCDResult[i].CART_CNT, SelectedBCDResult[i].PID, SelectedBCDResult[i].CART_NO, SelectedBCDResult[i].CART_CNT, "?", type[r.Next(0, 2)]); break; } } if (SelectedBCDResult[i].CART_CNT == "2") { string temp = type[r.Next(0, 2)]; SendData(3, CEnum2.EnumToCoreEventForSimulator.TestAIScan, SelectedBCDResult[i].PID, SelectedBCDResult[i].CART_NO, SelectedBCDResult[i].CART_CNT, SelectedBCDResult[i].PID, (Convert.ToInt32(SelectedBCDResult[i].CART_NO) + 1).ToString(), SelectedBCDResult[i].CART_CNT, temp, temp); } } } }
/// <summary> /// Discharged 버튼 클릭 이벤트 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnDischarged_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (state_ips != LGCNS.ezControl.Common.enumReferenceState.Active || state_sorter != LGCNS.ezControl.Common.enumReferenceState.Active) { this.BaseClass.MsgInfo("시뮬레이터와 연결해주세요.", BaseEnumClass.CodeMessage.MESSAGE); return; } List <BCDResult> SelectedBCDResult = BCDResultList.Where(p => p.IsSelected == true).ToList(); for (int i = 0; i < SelectedBCDResult.Count(); i++) { List <short> data = new List <short> { short.Parse(SelectedBCDResult[i].CART_NO), short.Parse(SelectedBCDResult[i].CART_CNT), short.Parse(SelectedBCDResult[i].PID), 0, short.Parse(SelectedBCDResult[i].INDUCTION_NO), 1, short.Parse(SelectedBCDResult[i].PLAN_CHUTE_ID1), 0 }; SendData(1, CEnum2.EnumToCoreEventForSimulator.TestDischarged, data); } }
/// <summary> /// Reset 버튼 클릭 이벤트 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnReset_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { curTime = DateTime.Now.ToString("yyyyMMddHHmmss"); BCDResultList.Clear(); BCDSampleList.Clear(); }
private async void Get_Result_ITEM(List <BCDResult> input) { //System.Threading.Thread.Sleep(1000); #region + 파라메터 변수 선언 및 값 할당 DataSet dsRtnValue = null; var strProcedureName = "PK_R0000_SRT.SP_RESULT_INQ"; Dictionary <string, object> dicInputParam = new Dictionary <string, object>(); string[] arrOutputParam = { "O_RSLT_LIST" }; #endregion #region + Input 파라메터 var DATE = curTime; //DATE #endregion dicInputParam.Add("P_DATE", DATE); #region + 데이터 조회 using (BaseDataAccess dataAccess = new BaseDataAccess()) { await System.Threading.Tasks.Task.Run(() => { dsRtnValue = dataAccess.GetSpDataSet(strProcedureName, dicInputParam, arrOutputParam); }).ConfigureAwait(true); } #endregion if (dsRtnValue == null) { return; } BCDResultList.Clear(); for (int i = 0; i < dsRtnValue.Tables[0].Rows.Count; i++) { BCDResult data = new BCDResult(); data.PID = dsRtnValue.Tables[0].Rows[i][0].ToString(); data.INDT_YMD_HMS = dsRtnValue.Tables[0].Rows[i][1].ToString(); data.PLAN_CD = dsRtnValue.Tables[0].Rows[i][2].ToString(); data.BOX_CD = dsRtnValue.Tables[0].Rows[i][3].ToString(); data.RGN_CD = dsRtnValue.Tables[0].Rows[i][4].ToString(); data.BCD_INFO = dsRtnValue.Tables[0].Rows[i][5].ToString(); data.INV_BCD = dsRtnValue.Tables[0].Rows[i][6].ToString(); data.PLAN_CHUTE_ID1 = dsRtnValue.Tables[0].Rows[i][7].ToString(); data.SRT_ERR_CD = dsRtnValue.Tables[0].Rows[i][8].ToString(); data.SRT_RSN_CD = dsRtnValue.Tables[0].Rows[i][9].ToString(); data.RSLT_CHUTE_ID = dsRtnValue.Tables[0].Rows[i][10].ToString(); data.SRT_WRK_STAT_CD = dsRtnValue.Tables[0].Rows[i][11].ToString(); data.INDUCTION_NO = dsRtnValue.Tables[0].Rows[i][12].ToString(); data.CART_NO = dsRtnValue.Tables[0].Rows[i][13].ToString(); data.CART_CNT = dsRtnValue.Tables[0].Rows[i][14].ToString(); foreach (var res in input) { if (data.PID == res.PID) { data.IsSelected = true; break; } } BCDResultList.Add(data); } gridMaster.ItemsSource = BCDResultList; }
private void _ref_AI_OnElementEvent(CReference reference, int iElementNo, string strElementPath, string strSubjectName, int iEventID, params object[] args) { Get_Result_ITEM(BCDResultList.Where(p => p.IsSelected == true).ToList()); }