Initial commit
This commit is contained in:
12
Handler/Project/Button/AIR.cs
Normal file
12
Handler/Project/Button/AIR.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
public partial class FMain
|
||||
{
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
82
Handler/Project/Button/START.cs
Normal file
82
Handler/Project/Button/START.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
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 버튼이 사용되지 않습니다");
|
||||
}
|
||||
else if (PUB.sm.Step == eSMStep.IDLE) //일반대기상태
|
||||
{
|
||||
if (DIO.isVacOKL() > 0)
|
||||
{
|
||||
DIO.SetBuzzer(true);
|
||||
PUB.popup.setMessage("PICKER ITEM DETECT\nPICKER 에서 아이템이 감지되었습니다\n[작업취소] 를 눌러서 아이템을 DROP 한 후 제거해주세요.");
|
||||
return;
|
||||
}
|
||||
else if (DIO.getCartSize(1) == eCartSize.None)
|
||||
{
|
||||
DIO.SetBuzzer(true);
|
||||
PUB.popup.setMessage("로더에 카트가 장착되지 않았습니다");
|
||||
return;
|
||||
}
|
||||
else if (DIO.GetIOInput(eDIName.PORTC_LIM_DN) == true && DIO.GetIOInput(eDIName.PORTC_DET_UP) == true)
|
||||
{
|
||||
//하단리밋과, 자재감지가 동시에 들어오면 overload 이다
|
||||
DIO.SetBuzzer(true);
|
||||
PUB.popup.setMessage("로더에 너무 많은 릴이 적재 되어 있습니다\n" +
|
||||
"하단 리밋 센서와 상단 릴 감지 센서가 동시에 확인 됩니다");
|
||||
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("[사용자 일시정지] 해제 => 작업이 계속됩니다");
|
||||
}
|
||||
else
|
||||
{
|
||||
//string msg = "SYSTEM {0}\n[RESET] 버튼을 누른 후 다시 시도하세요";
|
||||
//msg = string.Format(msg, PUB.sm.Step);
|
||||
//PUB.popup.setMessage(msg);
|
||||
PUB.log.AddE($"[RESET] 버튼을 누른 후 다시 시도하세요");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Handler/Project/Button/STOP.cs
Normal file
49
Handler/Project/Button/STOP.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
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_STOP()
|
||||
{
|
||||
//매거진 투입모터 멈춤
|
||||
if (DIO.GetIOOutput(eDOName.PORTL_MOT_RUN)) DIO.SetPortMotor(0, eMotDir.CW, false, "Button Stop");
|
||||
if (DIO.GetIOOutput(eDOName.PORTC_MOT_RUN)) DIO.SetPortMotor(1, eMotDir.CW, false, "Button Stop");
|
||||
if (DIO.GetIOOutput(eDOName.PORTR_MOT_RUN)) DIO.SetPortMotor(2, eMotDir.CW, false, "Button Stop");
|
||||
|
||||
//자재가 없고, 센서도 반응안하는데. 진공이 되어잇으면 off한다
|
||||
if (DIO.isVacOKL() == 0 && PUB.flag.get(eVarBool.FG_PK_ITEMON) == false && DIO.GetIOOutput(eDOName.PICK_VAC1) == true)
|
||||
DIO.SetPickerVac(false, true);
|
||||
|
||||
//조명켜기
|
||||
if (AR.SETTING.Data.Disable_RoomLight == false)
|
||||
DIO.SetRoomLight(true);
|
||||
|
||||
//컨베이어 멈춘다 230502
|
||||
DIO.SetOutput(eDOName.LEFT_CONV, false);
|
||||
DIO.SetOutput(eDOName.RIGHT_CONV, false);
|
||||
|
||||
//모든 모터도 멈춘다
|
||||
if (PUB.mot.HasMoving) PUB.mot.MoveStop("Stop Button");
|
||||
|
||||
if (PUB.sm.Step == eSMStep.RUN)
|
||||
{
|
||||
//일시중지상태로 전환한다
|
||||
PUB.Result.SetResultMessage(eResult.OPERATION, eECode.USER_STOP, eNextStep.PAUSE);
|
||||
PUB.log.Add("[사용자 일시정지]");
|
||||
}
|
||||
else if (PUB.sm.Step == eSMStep.HOME_FULL) //홈진행중에는 대기상태로 전환
|
||||
{
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
}
|
||||
|
||||
//로그 기록
|
||||
PUB.LogFlush();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user