6 import java.io.IOException;
15 private final int deviceAddress;
34 )
throws IOException {
35 super(deviceName, portCommunicator);
36 this.deviceAddress = deviceAddress;
51 return this.deviceAddress;
58 @Override
public Double
getVoltage() throws IOException {
67 @Override
public void setVoltage(
double newVoltage)
throws IOException {
68 String commandToWrite = String.format(
71 this.writeWithOKResponse(commandToWrite);
78 @Override
public void reset() throws IOException {
88 @Override
public Double
getCurrent() throws IOException {
96 @Override
public void setCurrent(
double newCurrent)
throws IOException {
97 String commandToWrite = String.format(
101 this.writeWithOKResponse(commandToWrite);
110 String commandToWrite = String.format(
114 this.writeWithOKResponse(commandToWrite);
122 @Override
public void outputOn() throws IOException {
123 String command = String.format(
127 this.writeWithOKResponse(command);
137 private void startDevice()
throws IOException {
141 this.writeWithOKResponse(commandToWrite);
154 private Double writeWithDoubleResponse(String commandToWrite)
throws 156 this.write(commandToWrite);
157 String response = this.read();
159 return Double.parseDouble(response);
167 private void writeWithOKResponse(String commandToWrite)
throws 169 this.write(commandToWrite);
170 String response = this.read();
String SET_VOLTAGE_COMMAND
void setVoltage(double newVoltage)
void setCurrent(double newCurrent)
String GET_CURRENT_COMMAND
String SET_CURRENT_COMMAND
String SET_OUTPUT_COMMAND
String GET_VOLTAGE_COMMAND
String GET_ADDRESS_COMMAND
TDKLambdaPowerSupply(String deviceName, PortCommunicator portCommunicator, int deviceAddress)