...
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Project
|
||||
{
|
||||
public partial class fMain
|
||||
{
|
||||
|
||||
|
||||
private void XBE_ProtocReceived(object sender, ENIG.EEProtocol.DataEventArgs e)
|
||||
{
|
||||
//TODO : 기능 처리필요 (XBee 메세지 데이터처리)
|
||||
@@ -29,23 +29,40 @@ namespace Project
|
||||
{
|
||||
|
||||
case ENIGProtocol.AGVCommands.SetCurrent: //Set Current Position
|
||||
|
||||
if (uint.TryParse(dataStr, out uint tagno))
|
||||
|
||||
if (dataStr.Length == 6)
|
||||
{
|
||||
if (PUB.mapctl.SetCurrentPosition(tagno) == true)
|
||||
var targID = dataStr.Substring(0, 2);
|
||||
var targstr = dataStr.Substring(2);
|
||||
|
||||
if(byte.TryParse(targID,out byte tID))
|
||||
{
|
||||
PUB.log.AddI($"Set Position:{tagno}");
|
||||
if (PUB.setting.XBE_ID == tID)
|
||||
{
|
||||
if (uint.TryParse(targstr, out uint tagno))
|
||||
{
|
||||
if (PUB.mapctl.SetCurrentPosition(tagno) == true)
|
||||
{
|
||||
PUB.log.AddI($"Set Position:{tagno}");
|
||||
}
|
||||
else PUB.log.AddE($"Position Set Error:{tagno}");
|
||||
}
|
||||
else PUB.log.AddE($"Position Param(tagstr) Error:{dataStr}");
|
||||
}
|
||||
else PUB.log.AddI($"Another Target {tID}:{PUB.setting.XBE_ID}");
|
||||
}
|
||||
else PUB.log.AddE($"Position Error:{tagno}");
|
||||
else PUB.log.AddE($"Position Param(targetid) Error:{dataStr}");
|
||||
|
||||
}
|
||||
else PUB.log.AddE($"Position Param Error:{dataStr}");
|
||||
|
||||
break;
|
||||
case ENIGProtocol.AGVCommands.Goto: //move to tag
|
||||
if (uint.TryParse(dataStr, out uint tagno2))
|
||||
{
|
||||
var currPos = PUB.mapctl.agv.CurrentRFID;///.AGVMoveToRFID(;
|
||||
if (currPos == 0) currPos = 10;
|
||||
var pathRlt = PUB.mapctl.CalculatePath(currPos,tagno2);
|
||||
var pathRlt = PUB.mapctl.CalculatePath(currPos, tagno2);
|
||||
if (pathRlt.Success == true)
|
||||
{
|
||||
PUB.log.AddI($"New Target:{tagno2}");
|
||||
|
||||
Reference in New Issue
Block a user