0,0 → 1,68 |
package dongfang.mkt.frames; |
|
public class ReadMotorMixerResponseFrame extends ResponseFrame { |
private int[][] matrix; |
// private int[] oppositeMotors; |
private int configurationVersion; |
private int dataLength; // not used really... |
|
public ReadMotorMixerResponseFrame() { |
super(FC_ADDRESS); |
} |
|
@Override |
public boolean isResponseTo(RequestFrame r) { |
return r instanceof ReadMotorMixerRequestFrame; |
} |
|
public int getConfigurationVersion() { |
return configurationVersion; |
} |
|
public void setConfigurationVersion(int configurationVersion) { |
this.configurationVersion = configurationVersion; |
} |
|
public int[][] getMatrix() { |
return matrix; |
} |
|
public void setMatrix(int[][] matrix) { |
this.matrix = matrix; |
} |
|
/* |
public int[] getOppositeMotors() { |
return oppositeMotors; |
} |
|
public void setOppositeMotors(int[] oppositeMotors) { |
this.oppositeMotors = oppositeMotors; |
} |
*/ |
|
public int getDataLength() { |
return dataLength; |
} |
|
public void setDataLength(int dataLength) { |
this.dataLength = dataLength; |
} |
|
public String toString() { |
StringBuilder result = new StringBuilder(getClass().getSimpleName() + ": "); |
if (matrix != null) { |
for (int i=0; i<matrix.length; i++) { |
result.append(i + "->"); |
result.append("Pitch: " + matrix[i][0]); |
result.append("Roll: " + matrix[i][1]); |
result.append("Throttle: " + matrix[i][2]); |
result.append("Yaw: " + matrix[i][3]); |
result.append("Opposite motor: " + matrix[i][4]); |
if (i<matrix.length-1) result.append("\n"); |
} |
} |
return result.toString(); |
} |
} |
|