Blame |
Last modification |
View Log
| RSS feed
package dongfang.mkt.frames;
public class DebugResponseFrame
extends ResponseFrame
{
private int[] digital =
new int[2];
private int[] analog =
new int[32];
public DebugResponseFrame
(int address
) {
super(address
);
}
public int[] getDigital
() {
return digital
;
}
public void setDigital
(int index,
int value
) {
this.
digital[index
]= value
;
}
public int[] getAnalog
() {
return analog
;
}
public void setAnalog
(int index,
int value
) {
this.
analog[index
]= value
;
}
@
Override
public boolean isResponseTo
(RequestFrame r
) {
return r
instanceof DebugRequestFrame
;
}
public String toString
() {
StringBuilder result =
new StringBuilder();
result.
append(getClass
().
getSimpleName()+
"\r");
result.
append("digital\r");
for (int i=
0; i
<digital.
length; i++
) {
result.
append(i
);
result.
append(':');
result.
append(digital
[i
]);
result.
append('\r');
}
result.
append("analog\r");
for (int i=
0; i
<analog.
length; i++
) {
result.
append(i
);
result.
append(':');
result.
append(analog
[i
]);
result.
append('\r');
}
return result.
toString();
}
}