Initial commit
This commit is contained in:
86
Handler/Project/Button/RESET.cs
Normal file
86
Handler/Project/Button/RESET.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UIControl;
|
||||
using AR;
|
||||
namespace Project
|
||||
{
|
||||
public partial class FMain
|
||||
{
|
||||
|
||||
void _BUTTON_RESET()
|
||||
{
|
||||
//RESET 버튼 눌렸을때 공통 처리 사항
|
||||
DIO.SetBuzzer(false); //buzzer off
|
||||
|
||||
if (PUB.popup.Visible)
|
||||
PUB.popup.needClose = true;
|
||||
|
||||
if (
|
||||
hmi1.Scean == HMI.eScean.xmove)
|
||||
hmi1.Scean = UIControl.HMI.eScean.Nomal;
|
||||
|
||||
PUB.flag.set(eVarBool.FG_KEYENCE_OFFF, false, "USER");
|
||||
PUB.flag.set(eVarBool.FG_KEYENCE_OFFR, false, "USER");
|
||||
|
||||
//팝업메세지가 제거가능한 메세지라면 없앤다.
|
||||
if (hmi1.HasPopupMenu && hmi1.PopupMenuRequireInput == false)
|
||||
hmi1.DelMenu();
|
||||
|
||||
//알람클리어작업(모션에 오류가 있는 경우에만)
|
||||
if (PUB.mot.IsInit && PUB.mot.HasServoAlarm)
|
||||
{
|
||||
PUB.mot.SetAlarmClearOn();
|
||||
System.Threading.Thread.Sleep(200);
|
||||
PUB.mot.SetAlarmClearOff();
|
||||
}
|
||||
|
||||
//자재가 없고, 센서도 반응안하는데. 진공이 되어잇으면 off한다
|
||||
if (DIO.isVacOKL() == 0 && PUB.flag.get(eVarBool.FG_PK_ITEMON) == false && DIO.GetIOOutput(eDOName.PICK_VAC1) == false)
|
||||
DIO.SetPickerVac(false, true);
|
||||
|
||||
|
||||
//중단, 오류 모드일때에는 이 리셋이 의미가 있다.
|
||||
if (PUB.sm.Step == eSMStep.RUN)
|
||||
{
|
||||
PUB.log.Add("동작중에는 [RESET] 버튼이 동작하지 않습니다");
|
||||
}
|
||||
else if (PUB.sm.Step == eSMStep.PAUSE)
|
||||
{
|
||||
//시작대기상태로 전환(대기상태일때 시작키를 누르면 실행 됨)
|
||||
PUB.sm.SetNewStep(eSMStep.WAITSTART);
|
||||
PUB.log.AddAT("Reset Clear System Resume & Pause ON");
|
||||
}
|
||||
else if (PUB.sm.Step == eSMStep.EMERGENCY)
|
||||
{
|
||||
PUB.popup.setMessage("EMERGENCY RESET\n" +
|
||||
"[비상정지] 상태에는 [시스템초기화] 를 실행 해야 합니다\n" +
|
||||
"상단메뉴 [초기화] 를 실행하세요");
|
||||
|
||||
PUB.log.Add("RESET버튼으로 인해 EMG 상황에서 IDLE전환");
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
}
|
||||
else if (PUB.sm.Step == eSMStep.ERROR)
|
||||
{
|
||||
PUB.log.Add("RESET버튼으로 인해 ERR 상황에서 IDLE전환");
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
}
|
||||
else if (PUB.sm.Step == eSMStep.WAITSTART)
|
||||
{
|
||||
//시작대기중일때에도 아무 처리안함
|
||||
//Pub.log.Add("시작버튼대기중에는 [RESET] 버튼이 동작하지 않습니다");
|
||||
}
|
||||
else if (PUB.sm.Step == eSMStep.IDLE)
|
||||
{
|
||||
//Pub.log.Add("대기중에는 [RESET] 버튼이 동작하지 않습니다");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Pub.log.AddE("정의되지 않은 상태에서의 REST 키 버튼 입력 - 대기상태로 전환합니다");
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user