void LoadEncodersTests(LogicPart logic, DWMRules rules) { logic.Tests["Encoder_MoveForward"] = new DWMMovementTestBase( EncodersTest( new EncodersData { Timestamp = 0, TotalLeftRotation = Angle.FromGrad(114.3), TotalRightRotation = Angle.FromGrad(114.3) }, rules.DWMMoveForward(10.0), rules.DWMStand(1.0))); logic.Tests["Encoder_ArcMoving"] = new DWMMovementTestBase( EncodersTest( new EncodersData { Timestamp = 0, TotalLeftRotation = Angle.FromGrad(234.0), TotalRightRotation = Angle.FromGrad(52.0) }, rules.DWMMoveArc(3.0, Angle.HalfPi, true))); //езда назад, поворот на месте, одна склейка двух-трех движений }
void LoadDWMTests(LogicPart logic, DWMRules rules) { logic.Tests["DWM_Movement_LongForward"] = new DWMMovementTestBase( LocationTest(100, 0, 0, 10, rules.DWMMoveForward(100.0), rules.DWMStand(1.0))); //basic DWM tests logic.Tests["DWM_Movement_Forward"] = new DWMMovementTestBase( LocationTest(10, 0, 0, 10, rules.DWMMoveForward(10.0), rules.DWMStand(1.0))); logic.Tests["DWM_Movement_Backward"] = new DWMMovementTestBase( LocationTest(-10, 0, 0, 10, rules.DWMMoveForward(-10.0), rules.DWMStand(1.0))); logic.Tests["DWM_Movement_RightRotate"] = new DWMMovementTestBase( LocationTest(0, 0, -45, 10, rules.DWMRotate(AIRLab.Mathematics.Angle.FromGrad(45.0)),rules.DWMStand(1.0))); logic.Tests["DWM_Movement_LeftRotate"] = new DWMMovementTestBase( LocationTest(0, 0, 45, 10, rules.DWMRotate(-1 * AIRLab.Mathematics.Angle.FromGrad(45.0)),rules.DWMStand(1.0))); logic.Tests["DWM_Movement_ArcRight"] = new DWMMovementTestBase( LocationTest(3, 3, 0, 10, rules.DWMMoveArc(3.0, AIRLab.Mathematics.Angle.FromGrad(90.0), true), rules.DWMStand(1.0))); logic.Tests["DWM_Movement_ArcLeft"] = new DWMMovementTestBase( LocationTest(3, -3, 0, 10, rules.DWMMoveArc(3.0, AIRLab.Mathematics.Angle.FromGrad(90.0), false), rules.DWMStand(1.0))); //advanced DWM tests logic.Tests["DWM_Movement_Turning"] = new DWMMovementTestBase( LocationTest(6, 6, 90, 10, rules.DWMMoveForward(3.0), rules.DWMRotate(AIRLab.Mathematics.Angle.FromGrad(90.0)), rules.DWMMoveForward(3.0), rules.DWMRotate(AIRLab.Mathematics.Angle.FromGrad(-90.0)), rules.DWMMoveForward(3.0), rules.DWMRotate(AIRLab.Mathematics.Angle.FromGrad(90.0)), rules.DWMMoveForward(3.0), rules.DWMStand(1.0))); logic.Tests["DWM_Movement_ArcMoving"] = new DWMMovementTestBase( LocationTest(6, 6, 90, 10, rules.DWMMoveArc(3.0, AIRLab.Mathematics.Angle.FromGrad(90.0), true), rules.DWMStand(1.0), rules.DWMMoveArc(3.0, AIRLab.Mathematics.Angle.FromGrad(90.0), false))); }