..
This commit is contained in:
@@ -35,58 +35,58 @@ namespace Project
|
||||
}
|
||||
}
|
||||
|
||||
ePosition ParsePosition(uint tag, out string dirBW)
|
||||
{
|
||||
var tagstr = tag.ToString();
|
||||
var tagno = tagstr.Substring(0, tagstr.Length - 1);
|
||||
//ePosition ParsePosition(uint tag, out string dirBW)
|
||||
//{
|
||||
// var tagstr = tag.ToString();
|
||||
// var tagno = tagstr.Substring(0, tagstr.Length - 1);
|
||||
|
||||
if (tag == PUB.setting.TAGNOT) { dirBW = "0"; return ePosition.NOT; }
|
||||
// if (tag == PUB.setting.TAGNOT) { dirBW = "0"; return ePosition.NOT; }
|
||||
|
||||
else if (tag == PUB.setting.TAG_QA_QC) { dirBW = "0"; return ePosition.QA_QC; }
|
||||
else if (tag == PUB.setting.TAG_QC_F1) { dirBW = "0"; return ePosition.QC_F1; }
|
||||
else if (tag == PUB.setting.TAG_F1_F2) { dirBW = "0"; return ePosition.F1_F2; }
|
||||
else if (tag == PUB.setting.TAG_F2_F3) { dirBW = "0"; return ePosition.F2_F3; }
|
||||
else if (tag == PUB.setting.TAG_F3_F4) { dirBW = "0"; return ePosition.F3_F4; }
|
||||
else if (tag == PUB.setting.TAG_F4_F5) { dirBW = "0"; return ePosition.F4_F5; }
|
||||
// else if (tag == PUB.setting.TAG_QA_QC) { dirBW = "0"; return ePosition.QA_QC; }
|
||||
// else if (tag == PUB.setting.TAG_QC_F1) { dirBW = "0"; return ePosition.QC_F1; }
|
||||
// else if (tag == PUB.setting.TAG_F1_F2) { dirBW = "0"; return ePosition.F1_F2; }
|
||||
// else if (tag == PUB.setting.TAG_F2_F3) { dirBW = "0"; return ePosition.F2_F3; }
|
||||
// else if (tag == PUB.setting.TAG_F3_F4) { dirBW = "0"; return ePosition.F3_F4; }
|
||||
// else if (tag == PUB.setting.TAG_F4_F5) { dirBW = "0"; return ePosition.F4_F5; }
|
||||
|
||||
else if (tag == PUB.setting.TAGQAB) { dirBW = "0"; return ePosition.QA; }
|
||||
else if (tag == PUB.setting.TAGQCB) { dirBW = "0"; return ePosition.QC; }
|
||||
else if (tag == PUB.setting.TAGF1B) { dirBW = "0"; return ePosition.F1; }
|
||||
else if (tag == PUB.setting.TAGF2B) { dirBW = "0"; return ePosition.F2; }
|
||||
else if (tag == PUB.setting.TAGF3B) { dirBW = "0"; return ePosition.F3; }
|
||||
else if (tag == PUB.setting.TAGF4B) { dirBW = "0"; return ePosition.F4; }
|
||||
else if (tag == PUB.setting.TAGF5B) { dirBW = "0"; return ePosition.F5; }
|
||||
//else if (tag == PUB.setting.TAGQAA) { dirBW = "1"; return ePosition.QA; }
|
||||
//else if (tag == PUB.setting.TAGCHA) { dirBW = "1"; return ePosition.CHARGE; }
|
||||
else if (tag == PUB.setting.TAGQAA) { dirBW = "1"; return ePosition.QA; }
|
||||
else if (tag == PUB.setting.TAGQCA) { dirBW = "1"; return ePosition.QC; }
|
||||
else if (tag == PUB.setting.TAGF1A) { dirBW = "1"; return ePosition.F1; }
|
||||
else if (tag == PUB.setting.TAGF2A) { dirBW = "1"; return ePosition.F2; }
|
||||
else if (tag == PUB.setting.TAGF3A) { dirBW = "1"; return ePosition.F3; }
|
||||
else if (tag == PUB.setting.TAGF4A) { dirBW = "1"; return ePosition.F4; }
|
||||
else if (tag == PUB.setting.TAGF5A) { dirBW = "1"; return ePosition.F5; }
|
||||
else if (tag == PUB.setting.TAGPOT) { dirBW = "0"; return ePosition.POT; }
|
||||
else
|
||||
{
|
||||
if (tag > 9350 && tag < 9400)
|
||||
{
|
||||
dirBW = "0"; return ePosition.QC_F1;
|
||||
}
|
||||
else if (tag > 9250 && tag < 9300)
|
||||
{
|
||||
dirBW = "0"; return ePosition.QA_QC;
|
||||
}
|
||||
else if (tag > 9000 && tag < 9100)
|
||||
{
|
||||
dirBW = "0"; return ePosition.NOT;
|
||||
}
|
||||
else
|
||||
{
|
||||
dirBW = "0"; return ePosition.NONE;
|
||||
}
|
||||
// else if (tag == PUB.setting.TAGQAB) { dirBW = "0"; return ePosition.QA; }
|
||||
// else if (tag == PUB.setting.TAGQCB) { dirBW = "0"; return ePosition.QC; }
|
||||
// else if (tag == PUB.setting.TAGF1B) { dirBW = "0"; return ePosition.F1; }
|
||||
// else if (tag == PUB.setting.TAGF2B) { dirBW = "0"; return ePosition.F2; }
|
||||
// else if (tag == PUB.setting.TAGF3B) { dirBW = "0"; return ePosition.F3; }
|
||||
// else if (tag == PUB.setting.TAGF4B) { dirBW = "0"; return ePosition.F4; }
|
||||
// else if (tag == PUB.setting.TAGF5B) { dirBW = "0"; return ePosition.F5; }
|
||||
// //else if (tag == PUB.setting.TAGQAA) { dirBW = "1"; return ePosition.QA; }
|
||||
// //else if (tag == PUB.setting.TAGCHA) { dirBW = "1"; return ePosition.CHARGE; }
|
||||
// else if (tag == PUB.setting.TAGQAA) { dirBW = "1"; return ePosition.QA; }
|
||||
// else if (tag == PUB.setting.TAGQCA) { dirBW = "1"; return ePosition.QC; }
|
||||
// else if (tag == PUB.setting.TAGF1A) { dirBW = "1"; return ePosition.F1; }
|
||||
// else if (tag == PUB.setting.TAGF2A) { dirBW = "1"; return ePosition.F2; }
|
||||
// else if (tag == PUB.setting.TAGF3A) { dirBW = "1"; return ePosition.F3; }
|
||||
// else if (tag == PUB.setting.TAGF4A) { dirBW = "1"; return ePosition.F4; }
|
||||
// else if (tag == PUB.setting.TAGF5A) { dirBW = "1"; return ePosition.F5; }
|
||||
// else if (tag == PUB.setting.TAGPOT) { dirBW = "0"; return ePosition.POT; }
|
||||
// else
|
||||
// {
|
||||
// if (tag > 9350 && tag < 9400)
|
||||
// {
|
||||
// dirBW = "0"; return ePosition.QC_F1;
|
||||
// }
|
||||
// else if (tag > 9250 && tag < 9300)
|
||||
// {
|
||||
// dirBW = "0"; return ePosition.QA_QC;
|
||||
// }
|
||||
// else if (tag > 9000 && tag < 9100)
|
||||
// {
|
||||
// dirBW = "0"; return ePosition.NOT;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// dirBW = "0"; return ePosition.NONE;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
bool _charging = false;
|
||||
@@ -196,51 +196,53 @@ namespace Project
|
||||
case arDev.Narumi.DataType.TAG:
|
||||
{
|
||||
//자동 실행 중이다.
|
||||
PUB.log.Add($"RFID값에서 위치정보를 추출할 수 있도록 해야한다");
|
||||
PUB.log.Add($"AGV 태그수신 : {PUB.AGV.data.TagNo}");
|
||||
PUB.Result.LastTAG = PUB.AGV.data.TagNo.ToString();
|
||||
|
||||
var curpos = ParsePosition(PUB.AGV.data.TagNo, out string dirForward);
|
||||
if (curpos != PUB.Result.CurrentPos)
|
||||
{
|
||||
PUB.log.Add($"현재위치변경 {PUB.Result.CurrentPos} -> {curpos}");
|
||||
PUB.Result.CurrentPos = curpos;
|
||||
}
|
||||
|
||||
PUB.Result.CurrentPosCW = dirForward;
|
||||
ctlPos1.SetPositionDeActive();
|
||||
ctlPos1.SetPosition(PUB.Result.CurrentPos);
|
||||
ctlPos1.SetDirection(dirForward);
|
||||
ctlPos1.Invalidate();
|
||||
|
||||
|
||||
|
||||
//pot not를 보면 일단 바로 멈추게한다
|
||||
//POT/NOT 보면 일단 바로 멈추게한다
|
||||
if (PUB.Result.CurrentPos == ePosition.POT || PUB.Result.CurrentPos == ePosition.NOT)
|
||||
{
|
||||
PUB.AGV.AGVMoveStop("TAG:pot/not 발견으로 즉시 멈춤");
|
||||
var logEMsg = $"Stop by [POT/NOT]";
|
||||
PUB.AGV.AGVMoveStop(logEMsg);
|
||||
PUB.log.AddE(logEMsg);
|
||||
}
|
||||
|
||||
//자동, 상하차 모드일때 RFID 가 타겟위치에 올때는 - 멈춤을 설정해준다
|
||||
if (VAR.BOOL[eVarBool.FLAG_AUTORUN] == true &&
|
||||
PUB.Result.CurrentPos == PUB.Result.TargetPos &&
|
||||
PUB.Result.TargetPos != ePosition.NONE &&
|
||||
(PUB.sm.RunStep == ERunStep.GODOWN ||
|
||||
PUB.sm.RunStep == ERunStep.GOUP ||
|
||||
PUB.sm.RunStep == ERunStep.GOHOME ||
|
||||
PUB.sm.RunStep == ERunStep.GOCHARGE))
|
||||
//맵데이터에서 현재 위치를 찾는다
|
||||
if (PUB.mapctl.SetCurrentPosition(PUB.AGV.data.TagNo) == false)
|
||||
{
|
||||
if (PUB.AGV.data.Sts == 'F' && dirForward == "0") //아래로 내려오고있음
|
||||
{
|
||||
PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
|
||||
PUB.Speak( Lang.다음마크위치에서정지합니다);
|
||||
}
|
||||
else if (PUB.AGV.data.Sts == 'B' && dirForward == "1")
|
||||
{
|
||||
//VAR.BOOL[eVarBool.FLAG_NEXTSTOP_MARK] = true;
|
||||
PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
|
||||
PUB.Speak(Lang.다음마크위치에서정지합니다);
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.FLAG_AUTORUN] && PUB.AGV.system1.agv_run)
|
||||
PUB.AGV.AGVMoveStop("unknown tag no");
|
||||
|
||||
//존재하지 않는 태그가 읽히면 관련 오류를 표시한다.
|
||||
}
|
||||
else
|
||||
{
|
||||
//위치는 찾았다 해당 위치가 내 목적지라면 mark stop기능으로 전환한다
|
||||
|
||||
}
|
||||
|
||||
|
||||
////자동, 상하차 모드일때 RFID 가 타겟위치에 올때는 - 멈춤을 설정해준다
|
||||
//if (VAR.BOOL[eVarBool.FLAG_AUTORUN] == true &&
|
||||
// PUB.Result.CurrentPos == PUB.Result.TargetPos &&
|
||||
// PUB.Result.TargetPos != ePosition.NONE &&
|
||||
// (PUB.sm.RunStep == ERunStep.GODOWN ||
|
||||
// PUB.sm.RunStep == ERunStep.GOUP ||
|
||||
// PUB.sm.RunStep == ERunStep.GOHOME ||
|
||||
// PUB.sm.RunStep == ERunStep.GOCHARGE))
|
||||
//{
|
||||
// if (PUB.AGV.data.Sts == 'F' && dirForward == "0") //아래로 내려오고있음
|
||||
// {
|
||||
// PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
|
||||
// PUB.Speak( Lang.다음마크위치에서정지합니다);
|
||||
// }
|
||||
// else if (PUB.AGV.data.Sts == 'B' && dirForward == "1")
|
||||
// {
|
||||
// //VAR.BOOL[eVarBool.FLAG_NEXTSTOP_MARK] = true;
|
||||
// PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
|
||||
// PUB.Speak(Lang.다음마크위치에서정지합니다);
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user