diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ddea64e..6732753 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,7 +4,7 @@ name: Docker Container Build on: push: - branches: [ "master"] + branches: [ "master", "mqtt-test"] pull_request: branches: [ "master" ] diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 016aa9a..c3a98eb 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -5,7 +5,7 @@ name: .NET build and test on: push: - branches: [ "master", "dominik_wip" ] + branches: [ "master", "mqtt-test"] pull_request: branches: [ "master" ] diff --git a/Simulator/Utility/ZonesManager.cs b/Simulator/Utility/ZonesManager.cs index 74e69eb..e7e7cae 100644 --- a/Simulator/Utility/ZonesManager.cs +++ b/Simulator/Utility/ZonesManager.cs @@ -95,6 +95,10 @@ public Zone GetWaypoint(string target, string machinepoint = "") result = (Zone)Enum.Parse(typeof(Zone), target.Replace("_", "").Substring(0, 5)); else result = (Zone)Enum.Parse(typeof(Zone), target.Replace("_", "").Substring(0, 4));*/ + if(target.Contains("C_Z") || target.Contains("M_Z")) + { + target = target.Substring(0, 5); + } result = (Zone)Enum.Parse(typeof(Zone), target.Replace("_", "")); MyLogger.Log("Is a Zone Waypoint!"); } diff --git a/Simulatortests/ZonesTests.cs b/Simulatortests/ZonesTests.cs index eb73c30..9e6e16f 100644 --- a/Simulatortests/ZonesTests.cs +++ b/Simulatortests/ZonesTests.cs @@ -188,5 +188,29 @@ public void PathPlaningFieldCyan() _mpsManager.StopAllMachines(); robot.RobotStop(); } + [TestMethod] + public void PathPlanningWaitingZoneGrips() + { + _configurations = new Configurations(); + _configurations.AddConfig(new RobotConfig("TestBot", jersey, team, "Test")); + _configurations.AddConfig(TeamConfig); + _mpsManager = new MpsManager(_configurations, false); + _robotManager = new RobotManager(_configurations, _mpsManager); + _zonesManager = ZonesManager.GetInstance(); + var initialZone = _zonesManager.GetZone(Zone.CZ11); + var robot = _robotManager.Robots[0]; + robot.SetZone(initialZone); + Assert.AreEqual(robot.GetZone().ZoneId, initialZone.ZoneId); + var targetZone = _zonesManager.GetZone(Zone.CZ12); + var task = new AgentTask(); + task.Move = new Move() + { + Waypoint = "C_Z12_waiting" + }; + robot.SetAgentTasks(task); + Thread.Sleep(1 * _configurations.RobotMoveZoneDuration + 1300); + Assert.AreEqual(robot.GetZone().ZoneId, targetZone.ZoneId); + robot.RobotStop(); + } } }