diff --git a/ADIS_Csharp/RaspiControl/ChallengeFactory.cs b/ADIS_Csharp/RaspiControl/ChallengeFactory.cs index 941a357..97ee6b3 100644 --- a/ADIS_Csharp/RaspiControl/ChallengeFactory.cs +++ b/ADIS_Csharp/RaspiControl/ChallengeFactory.cs @@ -1,10 +1,5 @@ using RobotLib.Communication; using RobotLib; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RaspiControl { internal class ChallengeFactory { @@ -14,8 +9,8 @@ namespace RaspiControl { public ChallengeFactory() { this.PublisherSubscriber = MqttPublisherSubscriber.Instance; - this.RobotStationary = new Robot(this.PublisherSubscriber); - this.RobotMobile = new Robot(this.PublisherSubscriber); + this.RobotStationary = new Robot(this.PublisherSubscriber, RobotMode.Stationary); + this.RobotMobile = new Robot(this.PublisherSubscriber, RobotMode.Mobile); } } } diff --git a/ADIS_Csharp/RobotClientWpf/ChallengeFactory.cs b/ADIS_Csharp/RobotClientWpf/ChallengeFactory.cs index a1675a6..98efa15 100644 --- a/ADIS_Csharp/RobotClientWpf/ChallengeFactory.cs +++ b/ADIS_Csharp/RobotClientWpf/ChallengeFactory.cs @@ -12,8 +12,8 @@ namespace RobotClientWpf public ChallengeFactory() { this.PublisherSubscriber = MqttPublisherSubscriber.Instance; - this.RobotStationary = new Robot(this.PublisherSubscriber, RobotTypes.Stationary); - this.RobotMobile = new Robot(this.PublisherSubscriber, RobotTypes.Mobile); + this.RobotStationary = new Robot(this.PublisherSubscriber, RobotMode.Stationary); + this.RobotMobile = new Robot(this.PublisherSubscriber, RobotMode.Mobile); } } } diff --git a/ADIS_Csharp/RobotConsoleClient/Program.cs b/ADIS_Csharp/RobotConsoleClient/Program.cs index 3720897..b35b535 100644 --- a/ADIS_Csharp/RobotConsoleClient/Program.cs +++ b/ADIS_Csharp/RobotConsoleClient/Program.cs @@ -9,8 +9,8 @@ namespace RobotConsoleClient { var com = MqttPublisherSubscriber.Instance; com.Connect("192.168.20.22", "ADIS", "TEST"); - var robotStationary = new Robot(com); - var robotMobile = new Robot(com); + var robotStationary = new Robot(com, RobotMode.Stationary); + var robotMobile = new Robot(com, RobotMode.Mobile); robotStationary.SplitFlap.SplitFlapDisplayChanged += SplitFlap_SplitFlapDisplayChanged; //Console.ReadLine(); Thread.Sleep(1000); diff --git a/ADIS_Csharp/RobotLib/Robot.cs b/ADIS_Csharp/RobotLib/Robot.cs index 1cf4fc0..edb1f5f 100644 --- a/ADIS_Csharp/RobotLib/Robot.cs +++ b/ADIS_Csharp/RobotLib/Robot.cs @@ -8,23 +8,23 @@ namespace RobotLib { public class Robot { - public Robot(IPublisherSubscriber com, RobotTypes type) + public Robot(IPublisherSubscriber com, RobotMode type) { Com = com; Type = type; - if(type == RobotTypes.Undefined) + if(type == RobotMode.Undefined) { - throw new System.ArgumentException("Undefined robot type, must define type!"); + throw new System.ArgumentException("Undefined robot mode, must define mode!"); } - if(type == RobotTypes.Mobile) + if(type == RobotMode.Mobile) { //Buzzer = new DevBuzzer(Com); Battery = new DevBattery(Com); LineSensor = new DevLineSensor(com); Movement = new DevMovement(com); } - else if(type == RobotTypes.Stationary) + else if(type == RobotMode.Stationary) { SplitFlap = new DevSplitFlap(com); } @@ -38,7 +38,7 @@ namespace RobotLib } public IPublisherSubscriber Com { get; } - public RobotTypes Type { get; } + public RobotMode Type { get; } //public DevBuzzer Buzzer { get; } public DevBattery Battery { get; } diff --git a/ADIS_Csharp/RobotLib/RobotTypes.cs b/ADIS_Csharp/RobotLib/RobotMode.cs similarity index 62% rename from ADIS_Csharp/RobotLib/RobotTypes.cs rename to ADIS_Csharp/RobotLib/RobotMode.cs index 2f8aa8a..d15d810 100644 --- a/ADIS_Csharp/RobotLib/RobotTypes.cs +++ b/ADIS_Csharp/RobotLib/RobotMode.cs @@ -1,9 +1,9 @@ namespace RobotLib { - public enum RobotTypes + public enum RobotMode { Undefined = 0, Mobile = 1, - Stationary + Stationary = 2 } }