1 package cz.cuni.amis.pogamut.usar2004.communication.messages.usarcommands;
2
3 import cz.cuni.amis.pogamut.base.communication.messages.*;
4 import cz.cuni.amis.pogamut.usar2004.communication.messages.datatypes.CustomTypes.*;
5
6
7
8
9
10
11
12
13 public class DriveJoint extends CommandMessage
14 {
15
16 public DriveJoint(String Name, int Steer, int Order, double Value)
17 {
18 this.Name = Name;
19 this.Steer = Steer;
20 this.Order = Order;
21 this.Value = Value;
22 }
23
24
25
26
27
28 public DriveJoint()
29 {
30 }
31
32
33
34 protected String Name = null;
35
36 public String getName()
37 {
38 return Name;
39 }
40
41 public DriveJoint setName(String Name)
42 {
43 this.Name = Name;
44 return this;
45 }
46
47 protected int Steer = 0;
48
49 public int getSteer()
50 {
51 return Steer;
52 }
53
54 public DriveJoint setSteer(int Steer)
55 {
56 this.Steer = Steer;
57 return this;
58 }
59
60
61
62
63
64 protected int Order = 0;
65
66 public int getOrder()
67 {
68 return Order;
69 }
70
71 public DriveJoint setOrder(int Order)
72 {
73 this.Order = Order;
74 return this;
75 }
76
77
78
79
80
81 protected double Value = 0;
82
83 public double getValue()
84 {
85 return Value;
86 }
87
88 public DriveJoint setValue(double Value)
89 {
90 this.Value = Value;
91 return this;
92 }
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110 public DriveJoint(DriveJoint original)
111 {
112 this.Name = original.Name;
113 this.Steer = original.Steer;
114 this.Order = original.Order;
115 this.Value = original.Value;
116 }
117
118 @Override
119 public String toString()
120 {
121 return toMessage();
122 }
123
124 public String toHtmlString()
125 {
126 return super.toString()
127 + "<b>Name</b> : "
128 + String.valueOf(Name)
129 + " <br/> "
130 + "<b>Steer</b> : "
131 + String.valueOf(Steer)
132 + " <br/> "
133 + "<b>Order</b> : "
134 + String.valueOf(Order)
135 + " <br/> "
136 + "<b>Value</b> : "
137 + String.valueOf(Value)
138 + " <br/> "
139 + "";
140 }
141
142 public String toMessage()
143 {
144
145 StringBuilder buf = new StringBuilder();
146 buf.append("DRIVE");
147
148 if(Name != null)
149 {
150 buf.append(" {Name ").append(Name).append("}");
151 }
152 buf.append(" {Steer ").append(Steer).append("}");
153 buf.append(" {Order ").append(Order).append("}");
154 buf.append(" {Value ").append(Value).append("}");
155
156 return buf.toString();
157 }
158 }