// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/test/java/com/iamcontent/device/controller/pololu/maestro/AbstractPololuMaestroServoCardIT.java
// public abstract class AbstractPololuMaestroServoCardIT {
// 
// 	private static final int CHANNEL = 0;
// 
// 	private final double acceleration;
// 	private final double speed;
// 	private final double position;
// 	private final double midPosition;
// 
// 	public AbstractPololuMaestroServoCardIT(double acceleration, double speed, double position, double midPosition) {
// 		this.acceleration = acceleration;
// 		this.speed = speed;
// 		this.position = position;
// 		this.midPosition = midPosition;
// 	}
// 
// 	@Test
// 	public void testRawDynamics() throws Exception {
// 		resetDynamics();
// 		
// 		setAcceleration(CHANNEL, acceleration);
// 		setSpeed(CHANNEL, speed);
// 		setPosition(CHANNEL, position);
// 		
// 		waitForServoPosition(CHANNEL, position);
// 		
// 		final double measuredPosition = getPosition(CHANNEL);
// 		
// 		assertEquals(position, measuredPosition, 0.0001);
// 	}
// 
// 	protected abstract void setAcceleration(int channel, double acceleration);
// 	protected abstract void setSpeed(int channel, double speed);
// 	protected abstract void setPosition(int channel, double position);
// 	protected abstract double getPosition(int channel);
// 
// 	private void waitForServoPosition(int channel, double position) {
// 		ThreadUtils.sleepUntil(() -> getPosition(channel) == position, 5000, 20);
// 		System.out.println("-----");
// 	}
// 
// 	private void resetDynamics() {
// 		setAcceleration(CHANNEL, (short) 0);
// 		setSpeed(CHANNEL, (short) 0);
// 		setPosition(CHANNEL, midPosition);
// 		waitForServoPosition(CHANNEL, midPosition);
// 	}
// }
// 
// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/MaestroCardType.java
// public enum MaestroCardType {
// 	
// 	MICRO_MAESTRO_6(6),
// 	MINI_MAESTRO_12(12),
// 	MINI_MAESTRO_18(18),
// 	MINI_MAESTRO_24(24);
// 	
// 	private final int channelCount;
// 
// 	private MaestroCardType(int channelCount) {
// 		this.channelCount = channelCount;
// 	}
// 
// 	public int channelCount() {
// 		return channelCount;
// 	}
// }
// 
// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/PololuMaestroServoCard.java
// public interface PololuMaestroServoCard {
// 
// 	interface State {
// 		short getPosition(short channel);
// 	}
// 	
// 	void setPosition(short channel, short position);
// 	void setSpeed(short channel, short speed);
// 	void setAcceleration(short channel, short acceleration);
// 
// 	short getPosition(short channel);
// 	State getState();
// 	
// 	MaestroCardType getType();
// 
// }


import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import com.iamcontent.device.controller.pololu.maestro.AbstractPololuMaestroServoCardIT;
import com.iamcontent.device.controller.pololu.maestro.MaestroCardType;
import com.iamcontent.device.controller.pololu.maestro.PololuMaestroServoCard;

/**
  IAmContent Public Libraries.
  Copyright (C) 2015-2021 Greg Elderfield
  @author Greg Elderfield, support@jarchitect.co.uk
 
  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU General Public License as published by the Free Software Foundation; either version 2 of 
  the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with this program;
  if not, write to the Free Software Foundation, Inc., 
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.iamcontent.device.controller.pololu.maestro.usb;




/**
 * A simple integration test, which doubles as an example of how to use the maestro.usb package.
 * @author Greg Elderfield
 */
public class UsbPololuMaestroServoCardIT extends AbstractPololuMaestroServoCardIT {

	private static final double ACCELERATION = 120;
	private static final double SPEED = 50;
	private static final double POSITION = 7000;
	private static final double MID_POSITION = 6000;
	

// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/test/java/com/iamcontent/device/controller/pololu/maestro/AbstractPololuMaestroServoCardIT.java
// public abstract class AbstractPololuMaestroServoCardIT {
// 
// 	private static final int CHANNEL = 0;
// 
// 	private final double acceleration;
// 	private final double speed;
// 	private final double position;
// 	private final double midPosition;
// 
// 	public AbstractPololuMaestroServoCardIT(double acceleration, double speed, double position, double midPosition) {
// 		this.acceleration = acceleration;
// 		this.speed = speed;
// 		this.position = position;
// 		this.midPosition = midPosition;
// 	}
// 
// 	@Test
// 	public void testRawDynamics() throws Exception {
// 		resetDynamics();
// 		
// 		setAcceleration(CHANNEL, acceleration);
// 		setSpeed(CHANNEL, speed);
// 		setPosition(CHANNEL, position);
// 		
// 		waitForServoPosition(CHANNEL, position);
// 		
// 		final double measuredPosition = getPosition(CHANNEL);
// 		
// 		assertEquals(position, measuredPosition, 0.0001);
// 	}
// 
// 	protected abstract void setAcceleration(int channel, double acceleration);
// 	protected abstract void setSpeed(int channel, double speed);
// 	protected abstract void setPosition(int channel, double position);
// 	protected abstract double getPosition(int channel);
// 
// 	private void waitForServoPosition(int channel, double position) {
// 		ThreadUtils.sleepUntil(() -> getPosition(channel) == position, 5000, 20);
// 		System.out.println("-----");
// 	}
// 
// 	private void resetDynamics() {
// 		setAcceleration(CHANNEL, (short) 0);
// 		setSpeed(CHANNEL, (short) 0);
// 		setPosition(CHANNEL, midPosition);
// 		waitForServoPosition(CHANNEL, midPosition);
// 	}
// }
// 
// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/MaestroCardType.java
// public enum MaestroCardType {
// 	
// 	MICRO_MAESTRO_6(6),
// 	MINI_MAESTRO_12(12),
// 	MINI_MAESTRO_18(18),
// 	MINI_MAESTRO_24(24);
// 	
// 	private final int channelCount;
// 
// 	private MaestroCardType(int channelCount) {
// 		this.channelCount = channelCount;
// 	}
// 
// 	public int channelCount() {
// 		return channelCount;
// 	}
// }
// 
// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/PololuMaestroServoCard.java
// public interface PololuMaestroServoCard {
// 
// 	interface State {
// 		short getPosition(short channel);
// 	}
// 	
// 	void setPosition(short channel, short position);
// 	void setSpeed(short channel, short speed);
// 	void setAcceleration(short channel, short acceleration);
// 
// 	short getPosition(short channel);
// 	State getState();
// 	
// 	MaestroCardType getType();
// 
// }


// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/test/java/com/iamcontent/device/controller/pololu/maestro/usb/UsbPololuMaestroServoCardIT.java
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import com.iamcontent.device.controller.pololu.maestro.AbstractPololuMaestroServoCardIT;
import com.iamcontent.device.controller.pololu.maestro.MaestroCardType;
import com.iamcontent.device.controller.pololu.maestro.PololuMaestroServoCard;

/**
  IAmContent Public Libraries.
  Copyright (C) 2015-2021 Greg Elderfield
  @author Greg Elderfield, support@jarchitect.co.uk
 
  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU General Public License as published by the Free Software Foundation; either version 2 of 
  the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with this program;
  if not, write to the Free Software Foundation, Inc., 
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.iamcontent.device.controller.pololu.maestro.usb;




/**
 * A simple integration test, which doubles as an example of how to use the maestro.usb package.
 * @author Greg Elderfield
 */
public class UsbPololuMaestroServoCardIT extends AbstractPololuMaestroServoCardIT {

	private static final double ACCELERATION = 120;
	private static final double SPEED = 50;
	private static final double POSITION = 7000;
	private static final double MID_POSITION = 6000;
	

	private PololuMaestroServoCard card;
