Implement ACS Command Handlers (PickOn, PickOff, Charge), Manual Mode Safety, and Map UI Commands
This commit is contained in:
@@ -9,6 +9,7 @@ using Project.StateMachine;
|
||||
using COMM;
|
||||
using AR;
|
||||
using AGVNavigationCore.Models;
|
||||
using AGVNavigationCore.Controls;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
@@ -60,6 +61,20 @@ namespace Project
|
||||
//if (chg_run && PUB.AGV.system1.agv_run) PUB.Speak("이동을 시작 합니다");
|
||||
VAR.BOOL[eVarBool.AGVDIR_BACK] = PUB.AGV.data.Direction == 'B';
|
||||
|
||||
// [Sync] Update VirtualAGV Direction
|
||||
var syncDir = PUB.AGV.data.Direction == 'B' ? AgvDirection.Backward : AgvDirection.Forward;
|
||||
if (PUB._virtualAGV.CurrentDirection != syncDir)
|
||||
PUB.UpdateAGVDirection(syncDir);
|
||||
|
||||
// [Sync] Update VirtualAGV State
|
||||
AGVState syncState = AGVState.Idle;
|
||||
if (PUB.AGV.error.Value > 0) syncState = AGVState.Error;
|
||||
else if (PUB.AGV.system1.Battery_charging) syncState = AGVState.Charging;
|
||||
else if (PUB.AGV.system1.agv_run) syncState = AGVState.Moving;
|
||||
|
||||
if (PUB._virtualAGV.GetCurrentState() != syncState)
|
||||
PUB.UpdateAGVState(syncState);
|
||||
|
||||
if (VAR.BOOL[eVarBool.AGV_ERROR] != (agv_err > 0))
|
||||
{
|
||||
VAR.BOOL[eVarBool.AGV_ERROR] = (agv_err > 0);
|
||||
|
||||
Reference in New Issue
Block a user