private void constructMotorMover() { mockMotor = MockMotor.Create(); motorLocator = new MotorLocator(new MockGpio(), mockMotor.Information); positionSignaler = new PositionSignaler(motorLocator); motorMover = new MotorMover(3, positionSignaler, motorLocator, mockMotor); }
private void setup() { mockMotor = MockMotor.Create(); locator = new MotorLocator(new MockGpio(), mockMotor.Information); signaler = new PositionSignaler(locator); mover = new MotorMover(3, signaler, locator, mockMotor); topInterrupt = new MockPhotoInterrupter(1, lowerTopIntPos, upperTopIntPos, locator, mockMotor); bottomInterrupt = new MockPhotoInterrupter(-1, lowerBottomIntPos, upperBottomIntPos, locator, mockMotor); calibrator = new MotorCalibrator(-5, 5, mover, mockMotor.Information, topInterrupt, bottomInterrupt); }
private void constructAnAxis(ref IMotorMover mover, ref IMotorCalibrator calibrator, ref IPreciseMotorMover preciseMover, ref IGridMotorMover gridMover) { var motor = MockMotor.Create(); var locator = new MotorLocator(new MockGpio(), motor.Information); var signaler = new PositionSignaler(locator); mover = new MotorMover(3, signaler, locator, motor); var topInterrupter = new MockPhotoInterrupter(1, 4, 6, locator, motor); var bottomInterrupter = new MockPhotoInterrupter(-1, -6, -4, locator, motor); calibrator = new MotorCalibrator(-5, 5, mover, motor.Information, topInterrupter, bottomInterrupter); preciseMover = new PreciseMotorMover(mover); gridMover = new GridMotorMover(preciseMover, calibrator); }
public MotorCalibrator(int gridMinValue, int gridMaxValue , IMotorMover motorMover, IMotorInformation motorInformation , IPhotoInterrupter topInterrupter, IPhotoInterrupter bottomInterrupter) { gridMin = gridMinValue; gridMax = gridMaxValue; locator = motorMover.Locator; mover = motorMover; motorInfo = motorInformation; top = topInterrupter; bottom = bottomInterrupter; top.ValueChanged += topInterruptDetected; bottom.ValueChanged += bottomInterruptDetected; // Estimate the steps per grid unit StepsPerGridUnit = (float)(top.StepPosition - bottom.StepPosition) / (top.GridPosition - bottom.GridPosition); State = CalibrationState.NeedsCalibrating; }
public PreciseMotorMover(IMotorMover motorMover) { mover = motorMover; }