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
14
15 public class SetJoint extends CommandMessage
16 {
17
18 public SetJoint(String Type, String Name, String Opcode, double param1, double param2)
19 {
20 this.Type = Type;
21 this.Name = Name;
22 this.Opcode = Opcode;
23 this.Param1 = param1;
24 this.Param2 = param2;
25 }
26
27
28
29
30
31 public SetJoint()
32 {
33 }
34
35 protected String Type = "Joint";
36
37 public String getType()
38 {
39 return Type;
40 }
41 protected String Name = null;
42
43 public String getName()
44 {
45 return Name;
46 }
47
48 public SetJoint setName(String Name)
49 {
50 this.Name = Name;
51 return this;
52 }
53
54
55
56
57
58
59 protected String Opcode = null;
60
61 public String getOpcode()
62 {
63 return Opcode;
64 }
65
66 public SetJoint setOpcode(String Opcode)
67 {
68 this.Opcode = Opcode;
69 return this;
70 }
71
72 protected double Param1 = 0;
73
74 public double getParam1()
75 {
76 return Param1;
77 }
78
79 public SetJoint setParam1(double Param1)
80 {
81 this.Param1 = Param1;
82 return this;
83 }
84
85 protected double Param2 = 0;
86
87 public double getParam2()
88 {
89 return Param2;
90 }
91
92 public SetJoint setParam2(double Param2)
93 {
94 this.Param2 = Param2;
95 return this;
96 }
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112 public SetJoint(SetJoint original)
113 {
114 this.Name = original.Name;
115 this.Opcode = original.Opcode;
116 this.Param1 = original.Param1;
117 this.Param2 = original.Param2;
118 }
119
120 @Override
121 public String toString()
122 {
123 return toMessage();
124 }
125
126 public String toHtmlString()
127 {
128 return super.toString()
129 + "<b>Type</b> : "
130 + String.valueOf(Type)
131 + " <br/> "
132 + "<b>Name</b> : "
133 + String.valueOf(Name)
134 + " <br/> "
135 + "<b>Opcode</b> : "
136 + String.valueOf(Opcode)
137 + " <br/> "
138 + "<b>Param1</b> : "
139 + String.valueOf(Param1)
140 + " <br/> "
141 + "<b>Param2</b> : "
142 + String.valueOf(Param2)
143 + " <br/> "
144 + "";
145
146 }
147
148 public String toMessage()
149 {
150
151 StringBuilder buf = new StringBuilder();
152 buf.append("SET");
153
154 if(Type != null)
155 {
156 buf.append(" {Type ").append(Type).append("}");
157 }
158
159 if(Name != null)
160 {
161 buf.append(" {Name ").append(Name).append("}");
162 }
163
164 if(Opcode != null)
165 {
166 buf.append(" {Opcode ").append(Opcode).append("}");
167 }
168
169 if(Opcode != null)
170 {
171 buf.append(" {Params ").append(Param1).append(",").append(Param2).append("}");
172 }
173
174
175 return buf.toString();
176 }
177 }