public IEnumerable <RotorInfo> TableToRotorInfoTransform(Table table)
        {
            var rotorDefinitions = new RotorInfo[3];

            foreach (TableRow row in table.Rows)
            {
                var rotorInfo = new RotorInfo(row["Type"], row["Starting Position"][0], row["Ring Setting"][0]);
                if (row["Position"] == "Left")
                {
                    rotorDefinitions[0] = rotorInfo;
                }
                else if (row["Position"] == "Middle")
                {
                    rotorDefinitions[1] = rotorInfo;
                }
                else
                {
                    rotorDefinitions[2] = rotorInfo;
                }
            }

            return(rotorDefinitions);
        }
Пример #2
0
 public RotorSocket SetupRotor(RotorInfo rotorInfo)
 {
     return(SetupRotor(Rotor.Create(rotorInfo.Type, rotorInfo.RingSettingOffset), rotorInfo.StartingOffset));
 }
Пример #3
0
 public virtual bool SetRotorSpeed(int rotorIndex, RotorInfo rotorInfo)
 {
     throw new NotImplementedException("This is supposed to be implemented in Drone sub class");
 }
Пример #4
0
 // Sets the animation for rotors on the drone. This is being done by AirLib through Pinvoke calls
 public override bool SetRotorSpeed(int rotorIndex, RotorInfo rotorInfo)
 {
     rotorInfos[rotorIndex] = rotorInfo;
     return(true);
 }
Пример #5
0
        private static bool SetRotorSpeed(int rotorIndex, RotorInfo rotorInfo, string vehicleName)
        {
            var vehicle = Vehicles.Find(element => element.vehicleName == vehicleName);

            return(vehicle.VehicleInterface.SetRotorSpeed(rotorIndex, rotorInfo));
        }
Пример #6
0
 public void SetupRotor(RotorInfo rotorInfo)
 {
     SetupRotor(Rotor.Create(rotorInfo.Type, rotorInfo.RingSettingOffset), rotorInfo.StartingOffset);
 }
Пример #7
0
 public void SetupRotor(RotorInfo rotorInfo)
 {
     SetupRotor(Rotor.Create(rotorInfo.Type, rotorInfo.RingSettingOffset), rotorInfo.StartingOffset);
 }