83 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			83 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Drawing;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using AR;
 | |
| namespace Project
 | |
| {
 | |
| 	public partial class FMain
 | |
| 	{
 | |
| 
 | |
| 		void _BUTTON_START()
 | |
| 		{
 | |
| 			if (PUB.sm.Step == eSMStep.RUN)
 | |
| 			{
 | |
| 				//아무것도 하지 않는다
 | |
| 				PUB.log.Add("START button is not available during operation");
 | |
| 			}
 | |
| 			else if (PUB.sm.Step == eSMStep.IDLE)   //일반대기상태
 | |
| 			{
 | |
| 				if (DIO.isVacOKL() > 0)
 | |
| 				{
 | |
| 					DIO.SetBuzzer(true);
 | |
| 					PUB.popup.setMessage("PICKER ITEM DETECT\nItem detected in PICKER\nPress [Cancel Work] to DROP item and remove it.");
 | |
| 					return;
 | |
| 				}
 | |
| 				else if (DIO.getCartSize(1) == eCartSize.None)
 | |
| 				{
 | |
| 					DIO.SetBuzzer(true);
 | |
| 					PUB.popup.setMessage("Cart is not installed in loader");
 | |
| 					return;
 | |
| 				}
 | |
| 				else if (DIO.GetIOInput(eDIName.PORTC_LIM_DN) == true && DIO.GetIOInput(eDIName.PORTC_DET_UP) == true)
 | |
| 				{
 | |
| 					//하단리밋과, 자재감지가 동시에 들어오면 overload 이다
 | |
| 					DIO.SetBuzzer(true);
 | |
| 					PUB.popup.setMessage("Too many reels are loaded in the loader\n" +
 | |
| 						"Bottom limit sensor and top reel detection sensor are both active");
 | |
| 					return;
 | |
| 				}
 | |
| 				//else if (Util_DO.getCartSize(0) == eCartSize.None && Util_DO.getCartSize(2) == eCartSize.None)
 | |
| 				//{
 | |
| 				//	Util_DO.SetBuzzer(true);
 | |
| 				//	Pub.popup.setMessage("언로더에 카트가 장착되지 않았습니다");
 | |
| 				//	return;
 | |
| 				//}
 | |
| 
 | |
| 				Func_start_job_select();
 | |
| 
 | |
| 
 | |
| 			}
 | |
| 			else if (PUB.sm.Step == eSMStep.WAITSTART) //시작대기상태
 | |
| 			{
 | |
| 
 | |
| 				DIO.SetRoomLight(true);
 | |
| 
 | |
| 				//새로시작하면 포트 얼라인을 해제 해준다
 | |
| 				PUB.flag.set(eVarBool.FG_RDY_PORT_PL, false, "SW_START");
 | |
| 				PUB.flag.set(eVarBool.FG_RDY_PORT_PC, false, "SW_START");
 | |
| 				PUB.flag.set(eVarBool.FG_RDY_PORT_PR, false, "SW_START");
 | |
| 
 | |
| 				//얼라인 상태를 모두 초기화 한다
 | |
| 				//loader1.arVar_Port.ToList().ForEach(t => t.AlignOK = 0);
 | |
| 
 | |
| 				//언로더 체크작업은 항상 다시 시작한다
 | |
| 				if (PUB.Result.UnloaderSeq > 1) PUB.Result.UnloaderSeq = 1;
 | |
| 
 | |
| 				//팝업메세지가 사라지도록 한다
 | |
| 				PUB.popup.needClose = true;
 | |
| 				PUB.sm.SetNewStep(eSMStep.RUN);
 | |
| 				PUB.log.Add("[User pause] released => Work continues");
 | |
| 			}
 | |
| 			else
 | |
| 			{
 | |
| 				//string msg = "SYSTEM {0}\n[RESET] 버튼을 누른 후 다시 시도하세요";
 | |
| 				//msg = string.Format(msg, PUB.sm.Step);
 | |
| 				//PUB.popup.setMessage(msg);
 | |
|                 PUB.log.AddE($"Press [RESET] button and try again");
 | |
| 			}
 | |
| 		}
 | |
| 	}
 | |
| }
 | 
