Subversion Repositories Projects

Rev

Rev 1688 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1688 Rev 1689
1
package dongfang.mkt.frames;
1
package dongfang.mkt.frames;
2
 
2
 
3
import java.io.IOException;
3
import java.io.IOException;
4
 
4
 
5
import dongfang.mkt.RequestFrameVisitor;
5
import dongfang.mkt.RequestFrameVisitor;
6
 
6
 
7
 
7
 
8
public class WriteMotorMixerRequestFrame extends RequestFrame {
8
public class WriteMotorMixerRequestFrame extends RequestFrame {
-
 
9
        private char[] name;
9
        private int[][] matrix;
10
        private int[][] matrix;
10
        // private int[] oppositeMotors;
11
        // private int[] oppositeMotors;
11
        private int motorMixerVersionNumber;
12
        private int motorMixerVersionNumber;
12
        private int configurationVersion;
-
 
13
       
13
       
14
        public WriteMotorMixerRequestFrame(int motorMixerVersionNumber, int[][] matrix /*, int[] oppositeMotors*/) {
14
        public WriteMotorMixerRequestFrame(int motorMixerVersionNumber, char[] name, int[][] matrix /*, int[] oppositeMotors*/) {
15
                super(FC_ADDRESS);
15
                super(FC_ADDRESS);
-
 
16
                this.motorMixerVersionNumber = motorMixerVersionNumber;
16
                this.motorMixerVersionNumber = motorMixerVersionNumber;
17
                this.name = name;
17
                this.matrix = matrix;
18
                this.matrix = matrix;
18
                // this.oppositeMotors = oppositeMotors;
19
                // this.oppositeMotors = oppositeMotors;
19
        }
20
        }
20
       
21
       
21
        @Override
22
        @Override
22
        public void accept(RequestFrameVisitor o) throws IOException {
23
        public void accept(RequestFrameVisitor o) throws IOException {
23
                o.visit(this);
24
                o.visit(this);
24
        }
25
        }
25
       
26
       
26
        public int getMotorMixerVersionNumber() {
27
        public int getMotorMixerVersionNumber() {
27
                return motorMixerVersionNumber;
28
                return motorMixerVersionNumber;
28
        }
29
        }
-
 
30
 
-
 
31
        public void setMotorMixerVersionNumber(int motorMixerVersionNumber) {
-
 
32
                this.motorMixerVersionNumber = motorMixerVersionNumber;
-
 
33
        }
-
 
34
 
-
 
35
        public char[] getName() {
-
 
36
                return name;
-
 
37
        }
-
 
38
 
-
 
39
        public void setName(char[] name) {
-
 
40
                this.name = name;
-
 
41
        }
29
 
42
 
30
        public int[][] getMatrix() {
43
        public int[][] getMatrix() {
31
                return matrix;
44
                return matrix;
32
        }
45
        }
33
 
46
 
34
        /*
47
        /*
35
        public int[] getOppositeMotors() {
48
        public int[] getOppositeMotors() {
36
                return oppositeMotors;
49
                return oppositeMotors;
37
        }
50
        }
38
        */
51
        */
39
 
-
 
40
        public int getConfigurationVersion() {
-
 
41
                return configurationVersion;
-
 
42
        }
-
 
43
 
-
 
44
        public void setConfigurationVersion(int configurationVersion) {
-
 
45
                this.configurationVersion = configurationVersion;
-
 
46
        }
-
 
47
       
52
       
48
        public int getDataLength() {
53
        public int getDataLength() {
49
                return matrix.length * 5; // return matrix.length * 4 + oppositeMotors.length;*/
54
                return 12 + matrix.length * 5; // return matrix.length * 4 + oppositeMotors.length;*/
50
        }
55
        }
51
}
56
}
52
 
57