1 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2
3
4 import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 public class ControlMessage
28 extends InfoMessage
29 implements IWorldEvent, IWorldChangeEvent
30
31 {
32
33
34 public static final String PROTOTYPE =
35 "CTRLMSG {Type text} {PS1 text} {PS2 text} {PS3 text} {PI1 0} {PI2 0} {PI3 0} {PF1 0} {PF2 0} {PF3 0} {PB1 False} {PB2 False} {PB3 False} ";
36
37
38
39
40
41
42 public ControlMessage()
43 {
44 }
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113 public ControlMessage(
114 String Type, String PS1, String PS2, String PS3, Integer PI1, Integer PI2, Integer PI3, Double PF1, Double PF2, Double PF3, Boolean PB1, Boolean PB2, Boolean PB3
115 ) {
116
117 this.Type = Type;
118
119 this.PS1 = PS1;
120
121 this.PS2 = PS2;
122
123 this.PS3 = PS3;
124
125 this.PI1 = PI1;
126
127 this.PI2 = PI2;
128
129 this.PI3 = PI3;
130
131 this.PF1 = PF1;
132
133 this.PF2 = PF2;
134
135 this.PF3 = PF3;
136
137 this.PB1 = PB1;
138
139 this.PB2 = PB2;
140
141 this.PB3 = PB3;
142
143 }
144
145
146
147
148
149
150 public ControlMessage(ControlMessage original) {
151
152 this.Type = original.getType()
153 ;
154
155 this.PS1 = original.getPS1()
156 ;
157
158 this.PS2 = original.getPS2()
159 ;
160
161 this.PS3 = original.getPS3()
162 ;
163
164 this.PI1 = original.getPI1()
165 ;
166
167 this.PI2 = original.getPI2()
168 ;
169
170 this.PI3 = original.getPI3()
171 ;
172
173 this.PF1 = original.getPF1()
174 ;
175
176 this.PF2 = original.getPF2()
177 ;
178
179 this.PF3 = original.getPF3()
180 ;
181
182 this.PB1 = original.isPB1()
183 ;
184
185 this.PB2 = original.isPB2()
186 ;
187
188 this.PB3 = original.isPB3()
189 ;
190
191 this.SimTime = original.getSimTime();
192 }
193
194
195 protected long SimTime;
196
197
198
199
200 @Override
201 public long getSimTime() {
202 return SimTime;
203 }
204
205
206
207
208 protected void setSimTime(long SimTime) {
209 this.SimTime = SimTime;
210 }
211
212
213
214
215
216 protected
217 String Type =
218 null;
219
220
221
222
223 public String getType()
224 {
225 return Type;
226 }
227
228
229
230
231
232 protected
233 String PS1 =
234 null;
235
236
237
238
239 public String getPS1()
240 {
241 return PS1;
242 }
243
244
245
246
247
248 protected
249 String PS2 =
250 null;
251
252
253
254
255 public String getPS2()
256 {
257 return PS2;
258 }
259
260
261
262
263
264 protected
265 String PS3 =
266 null;
267
268
269
270
271 public String getPS3()
272 {
273 return PS3;
274 }
275
276
277
278
279
280 protected
281 Integer PI1 =
282 null;
283
284
285
286
287 public Integer getPI1()
288 {
289 return PI1;
290 }
291
292
293
294
295
296 protected
297 Integer PI2 =
298 null;
299
300
301
302
303 public Integer getPI2()
304 {
305 return PI2;
306 }
307
308
309
310
311
312 protected
313 Integer PI3 =
314 null;
315
316
317
318
319 public Integer getPI3()
320 {
321 return PI3;
322 }
323
324
325
326
327
328 protected
329 Double PF1 =
330 null;
331
332
333
334
335 public Double getPF1()
336 {
337 return PF1;
338 }
339
340
341
342
343
344 protected
345 Double PF2 =
346 null;
347
348
349
350
351 public Double getPF2()
352 {
353 return PF2;
354 }
355
356
357
358
359
360 protected
361 Double PF3 =
362 null;
363
364
365
366
367 public Double getPF3()
368 {
369 return PF3;
370 }
371
372
373
374
375
376 protected
377 Boolean PB1 =
378 null;
379
380
381
382
383 public Boolean isPB1()
384 {
385 return PB1;
386 }
387
388
389
390
391
392 protected
393 Boolean PB2 =
394 null;
395
396
397
398
399 public Boolean isPB2()
400 {
401 return PB2;
402 }
403
404
405
406
407
408 protected
409 Boolean PB3 =
410 null;
411
412
413
414
415 public Boolean isPB3()
416 {
417 return PB3;
418 }
419
420
421 public String toString() {
422 return
423 super.toString() + "[" +
424
425 "Type = " + String.valueOf(getType()
426 ) + " | " +
427
428 "PS1 = " + String.valueOf(getPS1()
429 ) + " | " +
430
431 "PS2 = " + String.valueOf(getPS2()
432 ) + " | " +
433
434 "PS3 = " + String.valueOf(getPS3()
435 ) + " | " +
436
437 "PI1 = " + String.valueOf(getPI1()
438 ) + " | " +
439
440 "PI2 = " + String.valueOf(getPI2()
441 ) + " | " +
442
443 "PI3 = " + String.valueOf(getPI3()
444 ) + " | " +
445
446 "PF1 = " + String.valueOf(getPF1()
447 ) + " | " +
448
449 "PF2 = " + String.valueOf(getPF2()
450 ) + " | " +
451
452 "PF3 = " + String.valueOf(getPF3()
453 ) + " | " +
454
455 "PB1 = " + String.valueOf(isPB1()
456 ) + " | " +
457
458 "PB2 = " + String.valueOf(isPB2()
459 ) + " | " +
460
461 "PB3 = " + String.valueOf(isPB3()
462 ) + " | " +
463
464 "]";
465 }
466
467
468 public String toHtmlString() {
469 return super.toString() + "[<br/>" +
470
471 "<b>Type</b> = " + String.valueOf(getType()
472 ) + " <br/> " +
473
474 "<b>PS1</b> = " + String.valueOf(getPS1()
475 ) + " <br/> " +
476
477 "<b>PS2</b> = " + String.valueOf(getPS2()
478 ) + " <br/> " +
479
480 "<b>PS3</b> = " + String.valueOf(getPS3()
481 ) + " <br/> " +
482
483 "<b>PI1</b> = " + String.valueOf(getPI1()
484 ) + " <br/> " +
485
486 "<b>PI2</b> = " + String.valueOf(getPI2()
487 ) + " <br/> " +
488
489 "<b>PI3</b> = " + String.valueOf(getPI3()
490 ) + " <br/> " +
491
492 "<b>PF1</b> = " + String.valueOf(getPF1()
493 ) + " <br/> " +
494
495 "<b>PF2</b> = " + String.valueOf(getPF2()
496 ) + " <br/> " +
497
498 "<b>PF3</b> = " + String.valueOf(getPF3()
499 ) + " <br/> " +
500
501 "<b>PB1</b> = " + String.valueOf(isPB1()
502 ) + " <br/> " +
503
504 "<b>PB2</b> = " + String.valueOf(isPB2()
505 ) + " <br/> " +
506
507 "<b>PB3</b> = " + String.valueOf(isPB3()
508 ) + " <br/> " +
509
510 "<br/>]";
511 }
512
513 public String toJsonLiteral() {
514 return "ControlMessage(null, "
515
516 + ")";
517 }
518
519
520
521
522
523
524
525
526
527
528 }
529