Project

General

Profile

Revision 333

Added by Greg Tress over 14 years ago

Added battery packet parsing. The applet now correctly displays battery information sent from a robot using the graphical battery meter.

View differences:

trunk/code/projects/colonet/ColonetGUI/Colonet.xcodeproj/gmtress.pbxuser
163 163
					PBXFileDataSource_Warnings_ColumnID,
164 164
				);
165 165
			};
166
			PBXPerProjectTemplateStateSaveDate = 218756837;
167
			PBXWorkspaceStateSaveDate = 218756837;
166
			PBXPerProjectTemplateStateSaveDate = 219194497;
167
			PBXWorkspaceStateSaveDate = 219194497;
168 168
		};
169 169
		perUserProjectItems = {
170
			A30FC0970CBD7DFA000A16EC /* PBXTextBookmark */ = A30FC0970CBD7DFA000A16EC /* PBXTextBookmark */;
171
			A312666C0C9B131A00D15EBF /* PBXTextBookmark */ = A312666C0C9B131A00D15EBF /* PBXTextBookmark */;
172
			A3C65E1D0CD262BC00D77B7B /* PBXTextBookmark */ = A3C65E1D0CD262BC00D77B7B /* PBXTextBookmark */;
173
			A3C65E6B0CD275C200D77B7B /* PBXTextBookmark */ = A3C65E6B0CD275C200D77B7B /* PBXTextBookmark */;
174
			A3D78E650CB72FF100A79632 /* PBXTextBookmark */ = A3D78E650CB72FF100A79632 /* PBXTextBookmark */;
175
			A3DAF7F40D09EC670015B97D /* PBXTextBookmark */ = A3DAF7F40D09EC670015B97D /* PBXTextBookmark */;
176
			A3DAF7F50D09EC670015B97D /* PBXTextBookmark */ = A3DAF7F50D09EC670015B97D /* PBXTextBookmark */;
177
			A3DAF8800D09F6B90015B97D /* PBXTextBookmark */ = A3DAF8800D09F6B90015B97D /* PBXTextBookmark */;
178
			A3DAF88C0D09F6F20015B97D /* PBXTextBookmark */ = A3DAF88C0D09F6F20015B97D /* PBXTextBookmark */;
179
			A3F558940CF276B100E3EBD1 /* PBXTargetBookmark */ = A3F558940CF276B100E3EBD1 /* PBXTargetBookmark */;
180
			A3FD76ED0CEBBBC10048CD0C /* PBXTextBookmark */ = A3FD76ED0CEBBBC10048CD0C /* PBXTextBookmark */;
170
			A30FC0970CBD7DFA000A16EC = A30FC0970CBD7DFA000A16EC /* PBXTextBookmark */;
171
			A312666C0C9B131A00D15EBF = A312666C0C9B131A00D15EBF /* PBXTextBookmark */;
172
			A36606FF0D0E387B00B9F19F = A36606FF0D0E387B00B9F19F /* PBXTextBookmark */;
173
			A36607020D0E38C600B9F19F = A36607020D0E38C600B9F19F /* PBXTextBookmark */;
174
			A36607050D0E38E300B9F19F = A36607050D0E38E300B9F19F /* PBXTextBookmark */;
175
			A36607060D0E38E300B9F19F = A36607060D0E38E300B9F19F /* PBXTextBookmark */;
176
			A3B867610D10A4BB00B6F595 /* PBXTextBookmark */ = A3B867610D10A4BB00B6F595 /* PBXTextBookmark */;
177
			A3B867690D10AD1900B6F595 /* PBXTextBookmark */ = A3B867690D10AD1900B6F595 /* PBXTextBookmark */;
178
			A3B8676A0D10AD1900B6F595 /* PBXTextBookmark */ = A3B8676A0D10AD1900B6F595 /* PBXTextBookmark */;
179
			A3B8676B0D10AD1900B6F595 /* PBXTextBookmark */ = A3B8676B0D10AD1900B6F595 /* PBXTextBookmark */;
180
			A3B8676C0D10AD1900B6F595 /* PBXTextBookmark */ = A3B8676C0D10AD1900B6F595 /* PBXTextBookmark */;
181
			A3B8676D0D10AD1900B6F595 /* PBXTextBookmark */ = A3B8676D0D10AD1900B6F595 /* PBXTextBookmark */;
182
			A3B8676E0D10AD1900B6F595 /* PBXTextBookmark */ = A3B8676E0D10AD1900B6F595 /* PBXTextBookmark */;
183
			A3B8676F0D10AD1900B6F595 /* PBXTextBookmark */ = A3B8676F0D10AD1900B6F595 /* PBXTextBookmark */;
184
			A3B867730D10AD1900B6F595 /* PBXTextBookmark */ = A3B867730D10AD1900B6F595 /* PBXTextBookmark */;
185
			A3B8677E0D10B2C900B6F595 /* PBXTextBookmark */ = A3B8677E0D10B2C900B6F595 /* PBXTextBookmark */;
186
			A3B8677F0D10B2C900B6F595 /* PBXTextBookmark */ = A3B8677F0D10B2C900B6F595 /* PBXTextBookmark */;
187
			A3B867800D10B2C900B6F595 /* PBXTextBookmark */ = A3B867800D10B2C900B6F595 /* PBXTextBookmark */;
188
			A3B867810D10B2C900B6F595 /* PBXTextBookmark */ = A3B867810D10B2C900B6F595 /* PBXTextBookmark */;
189
			A3B867820D10B2C900B6F595 /* PBXTextBookmark */ = A3B867820D10B2C900B6F595 /* PBXTextBookmark */;
190
			A3B867830D10B2C900B6F595 /* PBXTextBookmark */ = A3B867830D10B2C900B6F595 /* PBXTextBookmark */;
191
			A3B867870D10B34A00B6F595 /* PBXTextBookmark */ = A3B867870D10B34A00B6F595 /* PBXTextBookmark */;
192
			A3B867880D10B34A00B6F595 /* PBXTextBookmark */ = A3B867880D10B34A00B6F595 /* PBXTextBookmark */;
193
			A3B8678B0D10B60C00B6F595 /* PBXTextBookmark */ = A3B8678B0D10B60C00B6F595 /* PBXTextBookmark */;
194
			A3B8678C0D10B60C00B6F595 /* PBXTextBookmark */ = A3B8678C0D10B60C00B6F595 /* PBXTextBookmark */;
195
			A3B867920D10B6D500B6F595 /* PBXTextBookmark */ = A3B867920D10B6D500B6F595 /* PBXTextBookmark */;
196
			A3B867930D10B6D500B6F595 /* PBXTextBookmark */ = A3B867930D10B6D500B6F595 /* PBXTextBookmark */;
197
			A3B867990D10B7DB00B6F595 /* PBXTextBookmark */ = A3B867990D10B7DB00B6F595 /* PBXTextBookmark */;
198
			A3B8679A0D10B7DB00B6F595 /* PBXTextBookmark */ = A3B8679A0D10B7DB00B6F595 /* PBXTextBookmark */;
199
			A3B8679E0D10B81200B6F595 /* PBXTextBookmark */ = A3B8679E0D10B81200B6F595 /* PBXTextBookmark */;
200
			A3B8679F0D10B81200B6F595 /* PBXTextBookmark */ = A3B8679F0D10B81200B6F595 /* PBXTextBookmark */;
201
			A3B867A30D10B89C00B6F595 /* PBXTextBookmark */ = A3B867A30D10B89C00B6F595 /* PBXTextBookmark */;
202
			A3B867A40D10B89C00B6F595 /* PBXTextBookmark */ = A3B867A40D10B89C00B6F595 /* PBXTextBookmark */;
203
			A3B867A90D10B90700B6F595 /* PBXTextBookmark */ = A3B867A90D10B90700B6F595 /* PBXTextBookmark */;
204
			A3B867AA0D10B90700B6F595 /* PBXTextBookmark */ = A3B867AA0D10B90700B6F595 /* PBXTextBookmark */;
205
			A3B867AF0D10B96200B6F595 /* PBXTextBookmark */ = A3B867AF0D10B96200B6F595 /* PBXTextBookmark */;
206
			A3B867B00D10B96200B6F595 /* PBXTextBookmark */ = A3B867B00D10B96200B6F595 /* PBXTextBookmark */;
207
			A3B867B40D10B9B800B6F595 /* PBXTextBookmark */ = A3B867B40D10B9B800B6F595 /* PBXTextBookmark */;
208
			A3B867B50D10B9B800B6F595 /* PBXTextBookmark */ = A3B867B50D10B9B800B6F595 /* PBXTextBookmark */;
209
			A3C65E1D0CD262BC00D77B7B = A3C65E1D0CD262BC00D77B7B /* PBXTextBookmark */;
210
			A3C65E6B0CD275C200D77B7B = A3C65E6B0CD275C200D77B7B /* PBXTextBookmark */;
211
			A3D78E650CB72FF100A79632 = A3D78E650CB72FF100A79632 /* PBXTextBookmark */;
212
			A3DAF7F40D09EC670015B97D = A3DAF7F40D09EC670015B97D /* PBXTextBookmark */;
213
			A3DAF7F50D09EC670015B97D = A3DAF7F50D09EC670015B97D /* PBXTextBookmark */;
214
			A3DAF9740D0BADA40015B97D = A3DAF9740D0BADA40015B97D /* PBXTextBookmark */;
215
			A3F558940CF276B100E3EBD1 = A3F558940CF276B100E3EBD1 /* PBXTargetBookmark */;
216
			A3FD76ED0CEBBBC10048CD0C = A3FD76ED0CEBBBC10048CD0C /* PBXTextBookmark */;
181 217
		};
182 218
		sourceControlManager = A341617E0C989B510007BEF2 /* Source Control */;
183 219
		userBuildSettings = {
......
185 221
	};
186 222
	00E68290FEC88D7311DB9C8B /* Colonet.java */ = {
187 223
		uiCtxt = {
188
			sepNavIntBoundsRect = "{{0, 0}, {1011, 11760}}";
189
			sepNavSelRange = "{9135, 0}";
190
			sepNavVisRect = "{{0, 3738}, {1011, 525}}";
224
			sepNavIntBoundsRect = "{{0, 0}, {1011, 20524}}";
225
			sepNavSelRange = "{42707, 0}";
226
			sepNavVisRect = "{{0, 19146}, {1011, 546}}";
191 227
			sepNavWindowFrame = "{{38, 133}, {613, 699}}";
192 228
		};
193 229
	};
......
240 276
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
241 277
		name = "Colonet.java: 300";
242 278
		rLen = 0;
243
		rLoc = 11023;
279
		rLoc = 11027;
244 280
		rType = 0;
245 281
		vrLen = 949;
246 282
		vrLoc = 0;
......
278 314
	};
279 315
	A34161900C989CB30007BEF2 /* ColonetServerInterface.java */ = {
280 316
		uiCtxt = {
281
			sepNavIntBoundsRect = "{{0, 0}, {1011, 5208}}";
282
			sepNavSelRange = "{5797, 0}";
283
			sepNavVisRect = "{{0, 2758}, {1011, 525}}";
317
			sepNavIntBoundsRect = "{{0, 0}, {1011, 7028}}";
318
			sepNavSelRange = "{18062, 0}";
319
			sepNavVisRect = "{{0, 6462}, {1011, 546}}";
284 320
			sepNavWindowFrame = "{{15, 56}, {651, 776}}";
285 321
		};
286 322
	};
323
	A36606FF0D0E387B00B9F19F /* PBXTextBookmark */ = {
324
		isa = PBXTextBookmark;
325
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
326
		name = "Colonet.java: 1467";
327
		rLen = 0;
328
		rLoc = 44974;
329
		rType = 0;
330
		vrLen = 393;
331
		vrLoc = 39225;
332
	};
333
	A36607020D0E38C600B9F19F /* PBXTextBookmark */ = {
334
		isa = PBXTextBookmark;
335
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
336
		name = "Colonet.java: 1467";
337
		rLen = 0;
338
		rLoc = 44974;
339
		rType = 0;
340
		vrLen = 1260;
341
		vrLoc = 43868;
342
	};
343
	A36607050D0E38E300B9F19F /* PBXTextBookmark */ = {
344
		isa = PBXTextBookmark;
345
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
346
		name = "Colonet.java: 1467";
347
		rLen = 0;
348
		rLoc = 44974;
349
		rType = 0;
350
		vrLen = 1254;
351
		vrLoc = 43868;
352
	};
353
	A36607060D0E38E300B9F19F /* PBXTextBookmark */ = {
354
		isa = PBXTextBookmark;
355
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
356
		name = "Colonet.java: 1467";
357
		rLen = 0;
358
		rLoc = 44974;
359
		rType = 0;
360
		vrLen = 583;
361
		vrLoc = 43868;
362
	};
363
	A3B867610D10A4BB00B6F595 /* PBXTextBookmark */ = {
364
		isa = PBXTextBookmark;
365
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
366
		name = "Colonet.java: 1467";
367
		rLen = 0;
368
		rLoc = 44974;
369
		rType = 0;
370
		vrLen = 583;
371
		vrLoc = 43868;
372
	};
373
	A3B867690D10AD1900B6F595 /* PBXTextBookmark */ = {
374
		isa = PBXTextBookmark;
375
		fRef = A34161900C989CB30007BEF2 /* ColonetServerInterface.java */;
376
		name = "ColonetServerInterface.java: 476";
377
		rLen = 0;
378
		rLoc = 17519;
379
		rType = 0;
380
		vrLen = 1001;
381
		vrLoc = 17098;
382
	};
383
	A3B8676A0D10AD1900B6F595 /* PBXTextBookmark */ = {
384
		isa = PBXTextBookmark;
385
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
386
		name = "Colonet.java: 415";
387
		rLen = 0;
388
		rLoc = 14077;
389
		rType = 0;
390
		vrLen = 1032;
391
		vrLoc = 13620;
392
	};
393
	A3B8676B0D10AD1900B6F595 /* PBXTextBookmark */ = {
394
		isa = PBXTextBookmark;
395
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
396
		name = "Colonet.java: 1467";
397
		rLen = 0;
398
		rLoc = 44974;
399
		rType = 0;
400
		vrLen = 1262;
401
		vrLoc = 43682;
402
	};
403
	A3B8676C0D10AD1900B6F595 /* PBXTextBookmark */ = {
404
		isa = PBXTextBookmark;
405
		fRef = A34161900C989CB30007BEF2 /* ColonetServerInterface.java */;
406
		name = "ColonetServerInterface.java: 336";
407
		rLen = 0;
408
		rLoc = 12025;
409
		rType = 0;
410
		vrLen = 1438;
411
		vrLoc = 1855;
412
	};
413
	A3B8676D0D10AD1900B6F595 /* PBXTextBookmark */ = {
414
		isa = PBXTextBookmark;
415
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
416
		name = "Colonet.java: 415";
417
		rLen = 0;
418
		rLoc = 14077;
419
		rType = 0;
420
		vrLen = 1032;
421
		vrLoc = 13620;
422
	};
423
	A3B8676E0D10AD1900B6F595 /* PBXTextBookmark */ = {
424
		isa = PBXTextBookmark;
425
		fRef = A34161900C989CB30007BEF2 /* ColonetServerInterface.java */;
426
		name = "ColonetServerInterface.java: 476";
427
		rLen = 0;
428
		rLoc = 17519;
429
		rType = 0;
430
		vrLen = 1001;
431
		vrLoc = 17098;
432
	};
433
	A3B8676F0D10AD1900B6F595 /* PBXTextBookmark */ = {
434
		isa = PBXTextBookmark;
435
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
436
		name = "Colonet.java: 612";
437
		rLen = 0;
438
		rLoc = 21808;
439
		rType = 0;
440
		vrLen = 1413;
441
		vrLoc = 20474;
442
	};
443
	A3B867730D10AD1900B6F595 /* PBXTextBookmark */ = {
444
		isa = PBXTextBookmark;
445
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
446
		name = "Colonet.java: 1469";
447
		rLen = 0;
448
		rLoc = 44974;
449
		rType = 0;
450
		vrLen = 531;
451
		vrLoc = 43873;
452
	};
453
	A3B8677E0D10B2C900B6F595 /* PBXTextBookmark */ = {
454
		isa = PBXTextBookmark;
455
		fRef = A34161900C989CB30007BEF2 /* ColonetServerInterface.java */;
456
		name = "ColonetServerInterface.java: 488";
457
		rLen = 0;
458
		rLoc = 18062;
459
		rType = 0;
460
		vrLen = 1172;
461
		vrLoc = 17143;
462
	};
463
	A3B8677F0D10B2C900B6F595 /* PBXTextBookmark */ = {
464
		isa = PBXTextBookmark;
465
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
466
		name = "Colonet.java: 645";
467
		rLen = 0;
468
		rLoc = 22502;
469
		rType = 0;
470
		vrLen = 963;
471
		vrLoc = 22358;
472
	};
473
	A3B867800D10B2C900B6F595 /* PBXTextBookmark */ = {
474
		isa = PBXTextBookmark;
475
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
476
		name = "Colonet.java: 645";
477
		rLen = 0;
478
		rLoc = 22502;
479
		rType = 0;
480
		vrLen = 992;
481
		vrLoc = 22358;
482
	};
483
	A3B867810D10B2C900B6F595 /* PBXTextBookmark */ = {
484
		isa = PBXTextBookmark;
485
		fRef = A34161900C989CB30007BEF2 /* ColonetServerInterface.java */;
486
		name = "ColonetServerInterface.java: 488";
487
		rLen = 0;
488
		rLoc = 18062;
489
		rType = 0;
490
		vrLen = 1172;
491
		vrLoc = 17143;
492
	};
493
	A3B867820D10B2C900B6F595 /* PBXTextBookmark */ = {
494
		isa = PBXTextBookmark;
495
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
496
		name = "Colonet.java: 612";
497
		rLen = 0;
498
		rLoc = 21808;
499
		rType = 0;
500
		vrLen = 1382;
501
		vrLoc = 20908;
502
	};
503
	A3B867830D10B2C900B6F595 /* PBXTextBookmark */ = {
504
		isa = PBXTextBookmark;
505
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
506
		name = "Colonet.java: 1469";
507
		rLen = 0;
508
		rLoc = 44974;
509
		rType = 0;
510
		vrLen = 531;
511
		vrLoc = 43939;
512
	};
513
	A3B867870D10B34A00B6F595 /* PBXTextBookmark */ = {
514
		isa = PBXTextBookmark;
515
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
516
		name = "Colonet.java: 607";
517
		rLen = 0;
518
		rLoc = 21552;
519
		rType = 0;
520
		vrLen = 1374;
521
		vrLoc = 20908;
522
	};
523
	A3B867880D10B34A00B6F595 /* PBXTextBookmark */ = {
524
		isa = PBXTextBookmark;
525
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
526
		name = "Colonet.java: 1469";
527
		rLen = 0;
528
		rLoc = 44974;
529
		rType = 0;
530
		vrLen = 531;
531
		vrLoc = 43931;
532
	};
533
	A3B8678B0D10B60C00B6F595 /* PBXTextBookmark */ = {
534
		isa = PBXTextBookmark;
535
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
536
		name = "Colonet.java: 1377";
537
		rLen = 0;
538
		rLoc = 42742;
539
		rType = 0;
540
		vrLen = 923;
541
		vrLoc = 42472;
542
	};
543
	A3B8678C0D10B60C00B6F595 /* PBXTextBookmark */ = {
544
		isa = PBXTextBookmark;
545
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
546
		name = "Colonet.java: 1466";
547
		rLen = 0;
548
		rLoc = 44974;
549
		rType = 0;
550
		vrLen = 600;
551
		vrLoc = 43625;
552
	};
553
	A3B867920D10B6D500B6F595 /* PBXTextBookmark */ = {
554
		isa = PBXTextBookmark;
555
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
556
		name = "Colonet.java: 614";
557
		rLen = 0;
558
		rLoc = 21808;
559
		rType = 0;
560
		vrLen = 1471;
561
		vrLoc = 20528;
562
	};
563
	A3B867930D10B6D500B6F595 /* PBXTextBookmark */ = {
564
		isa = PBXTextBookmark;
565
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
566
		name = "Colonet.java: 1468";
567
		rLen = 0;
568
		rLoc = 44974;
569
		rType = 0;
570
		vrLen = 567;
571
		vrLoc = 43642;
572
	};
573
	A3B867990D10B7DB00B6F595 /* PBXTextBookmark */ = {
574
		isa = PBXTextBookmark;
575
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
576
		name = "Colonet.java: 216";
577
		rLen = 0;
578
		rLoc = 6832;
579
		rType = 0;
580
		vrLen = 1729;
581
		vrLoc = 5999;
582
	};
583
	A3B8679A0D10B7DB00B6F595 /* PBXTextBookmark */ = {
584
		isa = PBXTextBookmark;
585
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
586
		name = "Colonet.java: 1470";
587
		rLen = 0;
588
		rLoc = 44974;
589
		rType = 0;
590
		vrLen = 501;
591
		vrLoc = 43603;
592
	};
593
	A3B8679E0D10B81200B6F595 /* PBXTextBookmark */ = {
594
		isa = PBXTextBookmark;
595
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
596
		name = "Colonet.java: 215";
597
		rLen = 0;
598
		rLoc = 6832;
599
		rType = 0;
600
		vrLen = 1717;
601
		vrLoc = 5999;
602
	};
603
	A3B8679F0D10B81200B6F595 /* PBXTextBookmark */ = {
604
		isa = PBXTextBookmark;
605
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
606
		name = "Colonet.java: 1470";
607
		rLen = 0;
608
		rLoc = 44974;
609
		rType = 0;
610
		vrLen = 501;
611
		vrLoc = 43591;
612
	};
613
	A3B867A30D10B89C00B6F595 /* PBXTextBookmark */ = {
614
		isa = PBXTextBookmark;
615
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
616
		name = "Colonet.java: 235";
617
		rLen = 0;
618
		rLoc = 7641;
619
		rType = 0;
620
		vrLen = 1740;
621
		vrLoc = 6079;
622
	};
623
	A3B867A40D10B89C00B6F595 /* PBXTextBookmark */ = {
624
		isa = PBXTextBookmark;
625
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
626
		name = "Colonet.java: 1472";
627
		rLen = 0;
628
		rLoc = 44974;
629
		rType = 0;
630
		vrLen = 455;
631
		vrLoc = 43668;
632
	};
633
	A3B867A90D10B90700B6F595 /* PBXTextBookmark */ = {
634
		isa = PBXTextBookmark;
635
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
636
		name = "Colonet.java: 216";
637
		rLen = 0;
638
		rLoc = 6832;
639
		rType = 0;
640
		vrLen = 1718;
641
		vrLoc = 6079;
642
	};
643
	A3B867AA0D10B90700B6F595 /* PBXTextBookmark */ = {
644
		isa = PBXTextBookmark;
645
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
646
		name = "Colonet.java: 1469";
647
		rLen = 0;
648
		rLoc = 44974;
649
		rType = 0;
650
		vrLen = 531;
651
		vrLoc = 43547;
652
	};
653
	A3B867AF0D10B96200B6F595 /* PBXTextBookmark */ = {
654
		isa = PBXTextBookmark;
655
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
656
		name = "Colonet.java: 214";
657
		rLen = 0;
658
		rLoc = 6718;
659
		rType = 0;
660
		vrLen = 1720;
661
		vrLoc = 5912;
662
	};
663
	A3B867B00D10B96200B6F595 /* PBXTextBookmark */ = {
664
		isa = PBXTextBookmark;
665
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
666
		name = "Colonet.java: 1469";
667
		rLen = 0;
668
		rLoc = 44974;
669
		rType = 0;
670
		vrLen = 531;
671
		vrLoc = 43548;
672
	};
673
	A3B867B40D10B9B800B6F595 /* PBXTextBookmark */ = {
674
		isa = PBXTextBookmark;
675
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
676
		name = "Colonet.java: 214";
677
		rLen = 0;
678
		rLoc = 6681;
679
		rType = 0;
680
		vrLen = 1754;
681
		vrLoc = 5912;
682
	};
683
	A3B867B50D10B9B800B6F595 /* PBXTextBookmark */ = {
684
		isa = PBXTextBookmark;
685
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
686
		name = "Colonet.java: 1469";
687
		rLen = 0;
688
		rLoc = 44974;
689
		rType = 0;
690
		vrLen = 531;
691
		vrLoc = 43582;
692
	};
287 693
	A3C65E1D0CD262BC00D77B7B /* PBXTextBookmark */ = {
288 694
		isa = PBXTextBookmark;
289 695
		fRef = 00E68291FEC88ED911DB9C8B /* index.html */;
......
315 721
		fRef = A34161900C989CB30007BEF2 /* ColonetServerInterface.java */;
316 722
		name = "ColonetServerInterface.java: 251";
317 723
		rLen = 0;
318
		rLoc = 6858;
724
		rLoc = 10307;
319 725
		rType = 0;
320 726
		vrLen = 810;
321 727
		vrLoc = 9006;
......
335 741
		fRef = A34161900C989CB30007BEF2 /* ColonetServerInterface.java */;
336 742
		name = "ColonetServerInterface.java: 207";
337 743
		rLen = 0;
338
		rLoc = 5797;
744
		rLoc = 7428;
339 745
		rType = 0;
340 746
		vrLen = 912;
341 747
		vrLoc = 5611;
342 748
	};
343
	A3DAF8800D09F6B90015B97D /* PBXTextBookmark */ = {
749
	A3DAF9740D0BADA40015B97D /* PBXTextBookmark */ = {
344 750
		isa = PBXTextBookmark;
345
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
346
		name = "Colonet.java: 271";
751
		fRef = A34161900C989CB30007BEF2 /* ColonetServerInterface.java */;
752
		name = "ColonetServerInterface.java: 336";
347 753
		rLen = 0;
348
		rLoc = 9135;
754
		rLoc = 12025;
349 755
		rType = 0;
350
		vrLen = 1065;
351
		vrLoc = 9042;
756
		vrLen = 1463;
757
		vrLoc = 1830;
352 758
	};
353
	A3DAF88C0D09F6F20015B97D /* PBXTextBookmark */ = {
354
		isa = PBXTextBookmark;
355
		fRef = 00E68290FEC88D7311DB9C8B /* Colonet.java */;
356
		name = "Colonet.java: 271";
357
		rLen = 0;
358
		rLoc = 9135;
359
		rType = 0;
360
		vrLen = 1037;
361
		vrLoc = 9042;
362
	};
363 759
	A3F558860CF2766C00E3EBD1 /* Sources */ = {
364 760
		isa = PBXSourcesBuildPhase;
365 761
		buildActionMask = 2147483647;
trunk/code/projects/colonet/ColonetGUI/Colonet.xcodeproj/gmtress.perspective
275 275
								</array>
276 276
							</array>
277 277
							<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
278
							<string>{{0, 0}, {200, 662}}</string>
278
							<string>{{0, 0}, {200, 661}}</string>
279 279
						</dict>
280 280
						<key>PBXTopSmartGroupGIDs</key>
281 281
						<array/>
......
285 285
					<key>GeometryConfiguration</key>
286 286
					<dict>
287 287
						<key>Frame</key>
288
						<string>{{0, 0}, {217, 680}}</string>
288
						<string>{{0, 0}, {217, 679}}</string>
289 289
						<key>GroupTreeTableConfiguration</key>
290 290
						<array>
291 291
							<string>SCMStatusColumn</string>
......
294 294
							<real>178</real>
295 295
						</array>
296 296
						<key>RubberWindowFrame</key>
297
						<string>0 111 1280 721 0 0 1280 832 </string>
297
						<string>0 112 1280 720 0 0 1280 832 </string>
298 298
					</dict>
299 299
					<key>Module</key>
300 300
					<string>PBXSmartGroupTreeModule</string>
......
324 324
										<key>_historyCapacity</key>
325 325
										<integer>0</integer>
326 326
										<key>bookmark</key>
327
										<string>A3DAF88C0D09F6F20015B97D</string>
327
										<string>A3B867B40D10B9B800B6F595</string>
328 328
										<key>history</key>
329 329
										<array>
330 330
											<string>A3C65E6B0CD275C200D77B7B</string>
331 331
											<string>A3FD76ED0CEBBBC10048CD0C</string>
332 332
											<string>A3F558940CF276B100E3EBD1</string>
333 333
											<string>A3DAF7F40D09EC670015B97D</string>
334
											<string>A3DAF7F50D09EC670015B97D</string>
335
											<string>A3DAF8800D09F6B90015B97D</string>
334
											<string>A3B8677E0D10B2C900B6F595</string>
335
											<string>A3B8677F0D10B2C900B6F595</string>
336 336
										</array>
337 337
										<key>prevStack</key>
338 338
										<array>
......
340 340
											<string>A3D78E650CB72FF100A79632</string>
341 341
											<string>A3C65E1D0CD262BC00D77B7B</string>
342 342
											<string>A30FC0970CBD7DFA000A16EC</string>
343
											<string>A3B8676B0D10AD1900B6F595</string>
344
											<string>A3B8676C0D10AD1900B6F595</string>
345
											<string>A3B8676D0D10AD1900B6F595</string>
346
											<string>A3B8676E0D10AD1900B6F595</string>
347
											<string>A3B867800D10B2C900B6F595</string>
348
											<string>A3B867810D10B2C900B6F595</string>
343 349
										</array>
344 350
									</dict>
345 351
									<key>SplitCount</key>
......
353 359
							<key>GeometryConfiguration</key>
354 360
							<dict>
355 361
								<key>Frame</key>
356
								<string>{{0, 0}, {1058, 557}}</string>
362
								<string>{{0, 0}, {1058, 578}}</string>
357 363
								<key>RubberWindowFrame</key>
358
								<string>0 111 1280 721 0 0 1280 832 </string>
364
								<string>0 112 1280 720 0 0 1280 832 </string>
359 365
							</dict>
360 366
							<key>Module</key>
361 367
							<string>PBXNavigatorGroup</string>
362 368
							<key>Proportion</key>
363
							<string>557pt</string>
369
							<string>578pt</string>
364 370
						</dict>
365 371
						<dict>
366 372
							<key>Proportion</key>
367
							<string>118pt</string>
373
							<string>96pt</string>
368 374
							<key>Tabs</key>
369 375
							<array>
370 376
								<dict>
......
378 384
									<key>GeometryConfiguration</key>
379 385
									<dict>
380 386
										<key>Frame</key>
381
										<string>{{10, 27}, {1058, 91}}</string>
387
										<string>{{10, 27}, {1058, 69}}</string>
382 388
										<key>RubberWindowFrame</key>
383
										<string>0 111 1280 721 0 0 1280 832 </string>
389
										<string>0 112 1280 720 0 0 1280 832 </string>
384 390
									</dict>
385 391
									<key>Module</key>
386 392
									<string>XCDetailModule</string>
......
396 402
									<key>GeometryConfiguration</key>
397 403
									<dict>
398 404
										<key>Frame</key>
399
										<string>{{10, 27}, {1058, 113}}</string>
405
										<string>{{10, 27}, {1058, 69}}</string>
400 406
									</dict>
401 407
									<key>Module</key>
402 408
									<string>PBXProjectFindModule</string>
......
412 418
									<key>GeometryConfiguration</key>
413 419
									<dict>
414 420
										<key>Frame</key>
415
										<string>{{10, 27}, {1058, 113}}</string>
421
										<string>{{10, 27}, {1058, 69}}</string>
416 422
									</dict>
417 423
									<key>Module</key>
418 424
									<string>PBXCVSModule</string>
......
439 445
			</array>
440 446
			<key>TableOfContents</key>
441 447
			<array>
442
				<string>A3DAF88D0D09F6F20015B97D</string>
448
				<string>A3B867700D10AD1900B6F595</string>
443 449
				<string>1CA23ED40692098700951B8B</string>
444
				<string>A3DAF88E0D09F6F20015B97D</string>
450
				<string>A3B867710D10AD1900B6F595</string>
445 451
				<string>A34161A50C989E610007BEF2</string>
446
				<string>A3DAF88F0D09F6F20015B97D</string>
452
				<string>A3B867720D10AD1900B6F595</string>
447 453
				<string>1CA23EDF0692099D00951B8B</string>
448 454
				<string>1CA23EE00692099D00951B8B</string>
449 455
				<string>1CA23EE10692099D00951B8B</string>
......
491 497
						<dict>
492 498
							<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
493 499
							<array>
494
								<real>1000</real>
500
								<real>215</real>
495 501
							</array>
496 502
							<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
497 503
							<array>
......
508 514
							<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
509 515
							<array>
510 516
								<array>
511
									<integer>2</integer>
517
									<integer>6</integer>
518
									<integer>5</integer>
512 519
									<integer>0</integer>
513 520
								</array>
514 521
							</array>
515 522
							<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
516
							<string>{{0, 0}, {0, 0}}</string>
523
							<string>{{0, 0}, {215, 661}}</string>
517 524
						</dict>
518 525
						<key>PBXTopSmartGroupGIDs</key>
519 526
						<array/>
......
523 530
					<key>GeometryConfiguration</key>
524 531
					<dict>
525 532
						<key>Frame</key>
526
						<string>{{0, 0}, {1275, 680}}</string>
533
						<string>{{0, 0}, {232, 679}}</string>
527 534
						<key>GroupTreeTableConfiguration</key>
528 535
						<array>
529 536
							<string>MainColumn</string>
530
							<real>1000</real>
537
							<real>215</real>
531 538
						</array>
532 539
					</dict>
533 540
					<key>Module</key>
534 541
					<string>PBXSmartGroupTreeModule</string>
535 542
					<key>Proportion</key>
536
					<string>1275pt</string>
543
					<string>232pt</string>
537 544
				</dict>
538 545
				<dict>
539 546
					<key>Dock</key>
......
553 560
										<string>A34161AD0C989F140007BEF2</string>
554 561
										<key>PBXProjectModuleLabel</key>
555 562
										<string>Colonet.java</string>
563
										<key>_historyCapacity</key>
564
										<integer>0</integer>
565
										<key>bookmark</key>
566
										<string>A3B867B50D10B9B800B6F595</string>
556 567
										<key>history</key>
557 568
										<array>
558 569
											<string>A3FD76ED0CEBBBC10048CD0C</string>
559 570
											<string>A3C65E6B0CD275C200D77B7B</string>
560 571
											<string>A3F558940CF276B100E3EBD1</string>
572
											<string>A3DAF7F40D09EC670015B97D</string>
573
											<string>A3DAF7F50D09EC670015B97D</string>
574
											<string>A36607060D0E38E300B9F19F</string>
561 575
										</array>
562 576
										<key>prevStack</key>
563 577
										<array>
......
578 592
							<key>GeometryConfiguration</key>
579 593
							<dict>
580 594
								<key>Frame</key>
581
								<string>{{0, 0}, {0, 308}}</string>
595
								<string>{{0, 0}, {1043, 292}}</string>
582 596
							</dict>
583 597
							<key>Module</key>
584 598
							<string>PBXNavigatorGroup</string>
585 599
							<key>Proportion</key>
586
							<string>308pt</string>
600
							<string>292pt</string>
587 601
						</dict>
588 602
						<dict>
589 603
							<key>Proportion</key>
590
							<string>0pt</string>
604
							<string>382pt</string>
591 605
							<key>Tabs</key>
592 606
							<array>
593 607
								<dict>
......
605 619
									<key>GeometryConfiguration</key>
606 620
									<dict>
607 621
										<key>Frame</key>
608
										<string>{{10, 27}, {0, -27}}</string>
622
										<string>{{10, 27}, {1043, 355}}</string>
609 623
									</dict>
610 624
									<key>Module</key>
611 625
									<string>PBXBuildResultsModule</string>
......
658 672
									<key>GeometryConfiguration</key>
659 673
									<dict>
660 674
										<key>Frame</key>
661
										<string>{{10, 27}, {0, 105}}</string>
675
										<string>{{10, 27}, {1043, 355}}</string>
662 676
									</dict>
663 677
									<key>Module</key>
664 678
									<string>PBXRunSessionModule</string>
......
667 681
						</dict>
668 682
					</array>
669 683
					<key>Proportion</key>
670
					<string>0pt</string>
684
					<string>1043pt</string>
671 685
				</dict>
672 686
			</array>
673 687
			<key>Name</key>
......
685 699
			</array>
686 700
			<key>TableOfContents</key>
687 701
			<array>
688
				<string>A3DAF8900D09F6F20015B97D</string>
702
				<string>A3B867740D10AD1900B6F595</string>
689 703
				<string>1CA23EE50692099D00951B8B</string>
690
				<string>A3DAF8910D09F6F20015B97D</string>
704
				<string>A3B867750D10AD1900B6F595</string>
691 705
				<string>A34161AC0C989F140007BEF2</string>
692
				<string>A3DAF8920D09F6F20015B97D</string>
706
				<string>A3B867760D10AD1900B6F595</string>
693 707
				<string>XCMainBuildResultsModuleGUID</string>
694 708
				<string>1CA23EE80692099D00951B8B</string>
695
				<string>A3DAF8930D09F6F20015B97D</string>
709
				<string>A3B867770D10AD1900B6F595</string>
696 710
			</array>
697 711
			<key>ToolbarConfiguration</key>
698 712
			<string>xcode.toolbar.config.buildAndRun</string>
......
823 837
			</array>
824 838
			<key>TableOfContents</key>
825 839
			<array>
826
				<string>A30FC0D20CBD7F2B000A16EC</string>
840
				<string>A3DAF8DA0D0A2E700015B97D</string>
827 841
				<string>1CCC7628064C1048000F2A68</string>
828 842
				<string>1CCC7629064C1048000F2A68</string>
829
				<string>A30FC0D30CBD7F2B000A16EC</string>
830
				<string>A30FC0D40CBD7F2B000A16EC</string>
831
				<string>A30FC0D50CBD7F2B000A16EC</string>
832
				<string>A30FC0D60CBD7F2B000A16EC</string>
833
				<string>A30FC0C60CBD7E7F000A16EC</string>
834
				<string>A30FC0D70CBD7F2B000A16EC</string>
843
				<string>A3DAF8DB0D0A2E700015B97D</string>
844
				<string>A3DAF8DC0D0A2E700015B97D</string>
845
				<string>A3DAF8DD0D0A2E700015B97D</string>
846
				<string>A3DAF8DE0D0A2E700015B97D</string>
847
				<string>A3DAF8DF0D0A2E700015B97D</string>
848
				<string>A3DAF8E00D0A2E700015B97D</string>
835 849
			</array>
836 850
			<key>ToolbarConfiguration</key>
837 851
			<string>xcode.toolbar.config.debug</string>
......
860 874
	<key>WindowJustification</key>
861 875
	<integer>5</integer>
862 876
	<key>WindowOrderList</key>
863
	<array>
864
		<string>/Users/gmtress/Documents/Colony/roboclub_repository/colony/trunk/code/projects/colonet/ColonetGUI/Colonet.xcodeproj</string>
865
	</array>
877
	<array/>
866 878
	<key>WindowString</key>
867
	<string>0 111 1280 721 0 0 1280 832 </string>
879
	<string>0 112 1280 720 0 0 1280 832 </string>
868 880
	<key>WindowTools</key>
869 881
	<array>
870 882
		<dict>
trunk/code/projects/colonet/ColonetGUI/Colonet.java
51 51
	JButton btnF, btnB, btnL, btnR, btnActivate;
52 52
	JComboBox cmbRobotNum;
53 53
	JLabel lblBattery;
54
	BatteryIcon batteryIcon;
54 55
	JPanel panelBattery;
55 56
	VectorController vectorController;
56 57
	BufferedImage imageVectorControl;
......
88 89
	DataUpdater dataUpdater;  
89 90
	
90 91
	Font botFont;
91
	Random random = new Random();
92 92
	volatile int tokenLoc;  //the token is currently here
93 93
	volatile int numBots;
94 94
	volatile int selectedBot;  //the user has selected this bot
......
209 209
		panelRobotCommands = new JPanel();
210 210
		panelRobotCommands.setLayout(new GridLayout(5,2));
211 211
		cmbRobotNum = new JComboBox();
212
		lblBattery = new JLabel(new BatteryIcon(75, 70, 70));
213
		lblBattery.setPreferredSize(new Dimension(100,100));
212
		// Battery subset
213
		lblBattery = new JLabel();
214
		batteryIcon = new BatteryIcon(50);
215
		//batteryIcon = new BatteryIcon(50, lblBattery.getMaximumSize().height, lblBattery.getMaximumSize().height);
216
		lblBattery = new JLabel(batteryIcon);
214 217
		btnCommand_StopTask = new JButton("Stop Current Task");
215 218
		btnCommand_ResumeTask = new JButton("Resume Current Task");
216 219
		btnCommand_ChargeNow = new JButton("Recharge Now");
......
227 230
		panelRobotControl.setLayout(new GridLayout(2,1));
228 231
		panelRobotControl.add(panelRobotDirection);
229 232
		panelRobotControl.add(panelRobotCommands);
230
		lblBattery.setIcon(new BatteryIcon(75, lblBattery.getMaximumSize().height, 
231
				lblBattery.getMaximumSize().height));
232 233
		
234
		
233 235
		// Task Manager
234 236
		panelTaskManager = new JPanel();
235 237
		panelTaskManager.setLayout(new BorderLayout());
......
344 346
		paint(g);
345 347
	}
346 348
	
347
	private void randomize () {
348
		Random r = new Random();
349
		StringBuilder s = new StringBuilder();
350
		
351
		int count = r.nextInt(8) + 1;
352
		for (int i = 0; i < count; i++) {
353
			for (int j = 0; j < count; j++) {
354
				if (r.nextBoolean())	
355
					s.append("" + (r.nextInt(16) + 1));
356
				else 
357
					s.append("-");
358
				if (j != count-1)
359
					s.append(" ");
360
			}
361
			if (i != count-1) s.append("\n");
362
		}
363
		
364
		txtMatrix.setText(s.toString());
365
	}
366
	
367 349
	public void drawRobot (int id, int x, int y) {
368 350
		//save the bot in memory, so we can tell if we click on it later
369 351
		botRect[id] = new Rectangle(x-RADIUS, y-RADIUS, 2*RADIUS, 2*RADIUS);
......
434 416
		}
435 417
	}
436 418
	
437
	public void step () {
419
	private void step () {
438 420
		final int DIAMETER = image.getWidth() - 2*BUFFER;
439 421
		final int BIGRADIUS = DIAMETER / 2;
440 422
		final int TOKENRADIUS = 40;
......
501 483
	
502 484
	}
503 485
	
486
	/** 
487
	* Gets the JTextArea used for storing the activity log. This method returns a reference to the 
488
	* JTextArea that stores the log. The log can contain any activity that is revelant to the use
489
	* of the applet, and may optionally display debugging information.
490
	*
491
	* @return the JTextArea where BOM matrix information is stored.
492
	*/ 
504 493
	public JTextArea getLog () {
505 494
		return log;
506 495
	}
507 496
	
497
	/** 
498
	* Gets the JTextArea used for storing the BOM matrix data. This method returns a reference to the 
499
	* JTextArea that stores the BOM matrix. The values in the matrix are stored as integers separated 
500
	* by spaces, and the lines should be separated by a newline.
501
	* 
502
	* @return the JTextArea where BOM matrix information is stored.
503
	*/
508 504
	public JTextArea getMatrixInput () {
509 505
		return txtMatrix;
510 506
	}
511 507
	
508
	/**
509
	* Parses a String containing BOM matrix information.
510
	* The ColonetServerInterface receives lines of the BOM matrix.  (For encoding 
511
	* information, see the ColonetServerInterface documentation.)  The entire matrix is passed
512
	* to the client when requested. This method takes a string of the form 
513
	* "[command code] [command code] [number of robots] [data0] [data1] ..."
514
	* with tokens separated by spaces and containing no brackets.  
515
	* The [command code]s are predefined values identifying this String as a BOM data
516
	* String, [number of robots] is an integer, and the values that follow are 
517
	* the sensor readings of the robots in order, starting with robot 0.  Only [number of robots]^2
518
	* data entries will be read.  The matrix values are saved locally until the next String is parsed.
519
	* 
520
	*
521
	* @param line the String containing BOM matrix information.
522
	* @throws ArrayIndexOutOfBoundsException if there are fewer than [number of robots]^2 data entries in the String
523
	*/
512 524
	public void parseMatrix (String line) {
513 525
		txtMatrix.setText("");
514 526
		String [] str = line.split(" ");
......
529 541
		
530 542
	}
531 543
	
544
	/**
545
	* Parses a String containing a task queue update.
546
	* Format is currently not specified.
547
	* This method currently does nothing.
548
	*
549
	* @param line the String containing task queue update information.
550
	*/
532 551
	public void parseQueue (String line) {
533 552
		log.append("Got queue update\n");
553
		//TODO: display new queue data in tasks tab
534 554
	}
535 555
	
556
	/**
557
	* Parses a String containing XBee ID values.
558
	* The ColonetServerInterface receives Strings of XBee information.  (For encoding 
559
	* information, see the ColonetServerInterface documentation.)  This method takes
560
	* a string of the form "[command code] [command code] [number of robots] [id0] [id1] ..."
561
	* with tokens separated by spaces and containing no brackets.  
562
	* The [command code]s are predefined values identifying this String as an XBee
563
	* ID String, [number of robots] is an integer, and the values that follow are 
564
	* the IDs of the robots in order, starting with robot 0.  Only [number of robots] 
565
	* will be read.  The ID values are saved locally until the next String is parsed.
566
	* The purpose of having this list is to ensure that robots are properly identified for control purposes.
567
	* This keeps robot identification consistent between sessions and prevents arbitrary assignment. 
568
	*
569
	* @param line the String containing XBee ID information.
570
	* @throws ArrayIndexOutOfBoundsException if there are fewer than [number of robots] IDs in the String
571
	* @see ColonetServerInterface#sendXBeeIDRequest()
572
	*/
536 573
	public void parseXBeeIDs (String line) {
574
		//TODO: check if this string actually has xbee command codes
575
	
537 576
		String [] str = line.split(" ");
538 577
		int num = Integer.parseInt(str[2]);
539 578
		xbeeID = new int[num];
......
550 589
		cmbRobotNum.setSelectedItem(oldSelection);
551 590
	}
552 591
	
592
	/**
593
	* Parses a String containing battery information.
594
	* The ColonetServerInterface receives Strings of battery information.  (For encoding 
595
	* information, see the ColonetServerInterface documentation.)  This method takes
596
	* a string of the form "[command code] [command code] [robot ID] [value]"
597
	* with tokens separated by spaces and containing no brackets.  
598
	* The [command code]s are predefined values identifying this String as a battery
599
	* information String, [robot ID] is an integer, and [value] is a battery measurement.
600
	* This updates the batery information for a single robot.
601
	* 
602
	*
603
	* @param line the String containing battery information.
604
	* @see ColonetServerInterface#sendBatteryRequest(int)
605
	*/
553 606
	public void parseBattery (String line) {
607
		System.out.println("Got battery update: " + line);
554 608
		String [] str = line.split(" ");
555
		int botNum = Integer.parseInt(str[2]);
556
		int batteryVal = Integer.parseInt(str[3]);
557
		if (cmbRobotNum != null && cmbRobotNum.getSelectedIndex()-1 == botNum)
558
			lblBattery.setText("" + batteryVal);
609
		int botNum = (int) line.charAt(4);
610
		int batteryVal = (int) line.charAt(6);
611
		if (cmbRobotNum != null && cmbRobotNum.getSelectedIndex()-1 == botNum) {
612
			//TODO: update battery info graphically
613
		}
614
		// For now, just update the bar whenever we get an update.
615
		batteryIcon.setLevel((int) (100.0 * batteryVal / 255));
559 616
	}
560 617
	
561 618
	//
......
892 949
				try {
893 950
					//request more data
894 951
					if (csi != null && csi.isReady()) {
895
						csi.sendSensorDataRequest();
896
						csi.sendXBeeIDRequest();
952
						//csi.sendSensorDataRequest();
953
						//csi.sendXBeeIDRequest();
897 954
						if (cmbRobotNum.getSelectedIndex() > 0)
898 955
							csi.sendBatteryRequest(cmbRobotNum.getSelectedIndex()-1);
956
						else
957
							csi.sendBatteryRequest(200);
899 958
					}
900 959
					Thread.sleep(DATAUPDATER_DELAY);
901 960
				} catch (InterruptedException e) {
......
1198 1257
					csi.sendData(ColonetServerInterface.MOTORS_OFF, dest);
1199 1258
				} else {
1200 1259
					//Directional commands
1201
					/*
1260
					
1202 1261
					if (x > cx && y == cy) {  //move right
1203 1262
						csi.sendData(ColonetServerInterface.MOTOR2_SET + " 0 200", dest);
1204 1263
						csi.sendData(ColonetServerInterface.MOTOR1_SET + " 1 200", dest);
......
1215 1274
						csi.sendData(ColonetServerInterface.MOTOR2_SET + " 1 0", dest);
1216 1275
						csi.sendData(ColonetServerInterface.MOTOR1_SET + " 1 0", dest);
1217 1276
					}
1218
					*/
1219 1277
					
1278
					
1220 1279
				}
1221 1280
			}
1222 1281
				
1223 1282
			//The move command doesn't really work...or does it?
1283
			/*
1224 1284
			csi.sendData(ColonetServerInterface.MOVE + " " + 
1225 1285
				vectorController.getSpeed() + " " + 
1226 1286
				vectorController.getAngle(), dest);
1227
				
1287
			*/	
1228 1288
			
1229 1289
		}
1230 1290
	
......
1319 1379
				case 0: return "SLAM and junk";
1320 1380
				case 1: return "I'm not sure this works";
1321 1381
				case 2: return "Push them into the light";
1322
				case 3: return "Watch out for clock repair guys";
1323
				case 4: return "But make sure he's dead, geez, why would you let him get away? I mean come on, "
1324
					+"he's just lying there and everyone's too busy looking at people flying through the sky to "
1325
					+"notice? Oh yeah, that's a good transition to a new season, let's make the audience think "
1326
					+"he's dead and then pull a fast one on them, they'll never see that coming.";
1382
				case 3: return "...";
1383
				case 4: return "...";
1327 1384
			
1328 1385
				default: return "Task not recognized";
1329 1386
			}
......
1394 1451
	        g2d.dispose();
1395 1452
	    }
1396 1453
	    
1397
	    public void setLevel(int newLevel){
1454
	    public void setLevel(int newLevel) {
1398 1455
	    	level = newLevel;
1399 1456
	    }
1400 1457
	    
trunk/code/projects/colonet/ColonetGUI/ColonetServerInterface.java
8 8
import javax.swing.JOptionPane;
9 9
import javax.swing.JTextArea;
10 10

  
11
/**
12
* The Colonet server interface class. This class handles direct communication with the Colonet server. The general
13
* contract is that this class will encapsulate the process of sending commands and requests to the server and 
14
* receiving responses. This class should provide methods to send specific commands and requests so that the 
15
* Colonet can easily communicate with the server. When data is received from the server, the ColonetServerInterface 
16
* decides how to handle it and in many cases this means simply passing it to the Colonet. 
17
* <p>
18
* The motivation is that any number of Colonet-type classes could be designed for different purposes if needed, with
19
* this class being used by each one for communication. 
20
* For instance, if an application is designed which only monitors sensor data, or that only has access to
21
* the task queue, etc., the application could easily plug in to this interface.
22
* The Colonet should generally not contain communication-specific code or Strings of command and request data. 
23
* If additional commands and requests are needed for permanent implementation, it is suggested that convenience
24
* classes be created in the ColonetServerInterface and called from the Colonet.
25
*
26
* @author Gregory Tress 
27
*/
11 28
public class ColonetServerInterface 
12 29
{
13 30

  
......
89 106
	public static final String ORB_SEND = "22"; //0x16
90 107

  
91 108
		
92
	Colonet colonet;  //save the entire applet locally
109
	Colonet colonet;  //save reference to the entire applet locally
93 110
	Socket socket;
94 111
	OutputStreamWriter out;
95 112
	BufferedReader reader;
......
101 118
	*	FUNCTION IMPLEMENTATIONS
102 119
	*/
103 120

  
121
	/**
122
	* Constructs a new ColonetServerInterface. When constructing a ColonetServerInterface, a valid Colonet object
123
	* reference must be provided to ensure that data is routed correctly. 
124
	*
125
	* @param colonet The Colonet object to save locally. This reference cannot be changed once the 
126
	*		ColonetSreverInterface has been contsructed.
127
	* @throws NullPointerException if colonet is null
128
	*
129
	*/
104 130
	public ColonetServerInterface (Colonet colonet) {
105 131
		this.colonet = colonet;
106 132
		this.log = colonet.getLog();
......
121 147
	}
122 148
	
123 149
	public boolean isReady () {
124
		if (socket == null || out == null || reader == null) return false;
125
		if (!socket.isConnected() || socket.isClosed() || socket.isInputShutdown() || socket.isOutputShutdown()) return false;
150
		if (socket == null || out == null || reader == null)
151
			return false;
152
		if (!socket.isConnected() || socket.isClosed() || socket.isInputShutdown() || socket.isOutputShutdown())
153
			return false;
126 154
		return true;
127 155
	}
128 156
	
......
149 177
  
150 178
	/**
151 179
	 * Create socket connection to Colonet server.
152
	 * If successful, start threads for loading the webcam image and listening for incoming data.
180
	 * If successful, start thread for listening for incoming data.
153 181
	 */
154 182
	public void connect (String strHost, String strPort) {
155 183
		//make sure hostname and port are valid
......
203 231
	/*
204 232
	*	sendString - only this method should actually write data to the output stream
205 233
	*/
206
	public void sendString (String s) {
234
	private void sendString (String s) {
207 235
		//make sure we can send
208 236
		if (!this.isReady()) {
209 237
			log.append("Could not send data.\n");
......
222 250
		}
223 251
	}
224 252
	
253
	/**
254
	* General send-to-server method. This method is used by other command methods, which are usually convenience
255
	* methods that simply specify arguments to this method. A command consists of a String which holds integers 
256
	* separated by spaces. This method should not be used directly unless you know the format of the particular 
257
	* command you are sending. If implementing a particular command for permanent use, it is recommended that 
258
	* you create a new wrapper method specific to that command in the ColonetServerInterface file.
259
	*
260
	* Note that no checking is performed in this method to ensure the correct formatting of the String arguments.
261
	* If malformed commands or robot numbers are specified, the behavior of the request at the server will be
262
	* undefined and could result in server failure. 
263
	*
264
	* @param s The command String in its correct format. The format of a command String is ultimately specified
265
	* by the Colonet server application and may change. 
266
	* @param robotNumber The number of the robot that is the subject of the command, if any. The robot number 
267
	* is specified as a single integer in a String. If the command does not have a single robot subject, this 
268
	* argument can be null or an empty String, whichever is convenient. 
269
	*/
225 270
	public void sendData (String s, String robotNumber) { 
226 271
		//create packet
227 272
		String packet = "";
228 273
		packet += ColonetServerInterface.SEND_TO_ROBOT;
229
		packet += " " + robotNumber;
274
		if (robotNumber != null)
275
			packet += " " + robotNumber;
230 276
		packet += " " + ColonetServerInterface.COLONET_COMMAND;
231 277
		packet += " " + s;  //add  the command code here
232 278
		packet += "\n";
233 279
		sendString(packet);
234 280
	}
235 281
	
236
	public void sendRequest (String s, String robotNumber) {
282
	/**
283
	* General request-from-server method. This method is used by other request methods, which are usually convenience
284
	* methods that simply specify arguments to this method. A request consists of a String which holds integers 
285
	* separated by spaces. This method should not be used directly unless you know the format of the particular 
286
	* request you are making. If implementing a particular request, it is recommended that you create a new method
287
	* specific to that request in the ColonetServerInterface file.
288
	*
289
	*/
290
	private void sendRequest (String s, String robotNumber) {
237 291
		//create packet
238 292
		String packet = "";
239 293
		packet += ColonetServerInterface.REQUEST_FROM_SERVER;
......
244 298
		sendString(packet);
245 299
	}
246 300
	
301
	/** 
302
	* Sends a request to the server to report the entire BOM sensor matrix. The server will reply at its convenience. 
303
	* No guarantee is made (end-to-end or otherwise) that the server will respond in a timely manner or at all
304
	* to any individual request.
305
	*/
247 306
	public void sendSensorDataRequest () {
248 307
		sendRequest(ColonetServerInterface.REQUEST_BOM_MATRIX, "");
249 308
	}
250 309
	
310
	/**
311
	* Sends a request to the server to report a list of XBee IDs. The server will reply at its convenience. 
312
	* The purpose of having this list is to ensure that robots are properly identified for control purposes.
313
	* This keeps robot identification consistent between sessions and prevents arbitrary assignment. 
314
	* No guarantee is made (end-to-end or otherwise) that the server will respond in a timely manner or at all
315
	* to any individual request.
316
	*
317
	* @see Colonet#parseXBeeIDs(String)
318
	*/
251 319
	public void sendXBeeIDRequest () {
252 320
		sendRequest(ColonetServerInterface.REQUEST_XBEE_IDS, "");
253 321
	}
254 322
	
323
	/**
324
	* Sends a battery request for a specific robot to the server. The server will reply at its convenience. 
325
	* Behavior is undefined if an invalid robot number is specified. The server will probably not respond in 
326
	* this case.
327
	* No guarantee is made (end-to-end or otherwise) that the server will respond in a timely manner or at all
328
	* to any individual request.
329
	*
330
	* @param robotNum The number of the robot for which we are requesting the battery. Note that this value
331
	* is sent as-is to the server. No mapping to or from XBee IDs is performed. The contract for this is
332
	* currently undefined.
333
	* @see Colonet#parseBattery(String)
334
	*/
255 335
	public void sendBatteryRequest (int robotNum) {
256
		sendRequest(ColonetServerInterface.BATTERY, "" + robotNum);
336
		sendData(ColonetServerInterface.BATTERY, "" + robotNum);
257 337
	}
258 338
	
259 339
	/*
260 340
	*	Queue management
261 341
	*/
262
	public void sendQueueInstruction (String inst) {
342
	private void sendQueueInstruction (String inst) {
263 343
		String packet = "";
264 344
		packet += ColonetServerInterface.COLONET_QUEUE;
265 345
		packet += " " + inst;
......
267 347
		sendString(packet);
268 348
	}
269 349
	
350
	/**
351
	* Notifies the Colonet server to add a task to the current task queue. The Colonet server holds the canonical 
352
	* task queue. Any applet can send tasks to add to the queue. Local copies of the queue in the applet are for
353
	* display purposes only, and are not authoritative when adding tasks. All clients send additions asynchronously,
354
	* and as a result no guarantee is made that a task will be added in the specificed location in the queue or at 
355
	* all. If an invalid position is specified, the task will probably not be added to the queue and may cause
356
	* server failure. Due to the asynchronous nature of the queue, we cannot easily account for concurrent
357
	* modification failures on the client side.
358
	*
359
	* @param pos The position in the queue at which we would like the task to be placed. Note that this is not 
360
	* guaranteed. Invalid positions may cause the task to be discarded at the server.
361
	* @param data The String containing the command code(s) for the task and any arguments necessary to fully 
362
	* define the behavior of the task. This format is currently not specified. In the future, the canonical format
363
	* of the data String will ultimately be defined by the Colonet server.
364
	* @param description A String that contains a description of the task. This will be the message displayed to
365
	* the user when information about the task is requested. 
366
	*/
270 367
	public void sendQueueAdd (int pos, String data, String description) {
271 368
		String packet = "";
272 369
		packet += ColonetServerInterface.QUEUE_ADD;
......
277 374
		sendQueueInstruction(packet);
278 375
	}
279 376
	
377
	/**
378
	* Notifies the Colonet server to remove a task from the current task queue. The Colonet server holds the canonical 
379
	* task queue. Any applet can remove a task from the queue. Local copies of the queue in the applet are for
380
	* display purposes only, and are not authoritative when removing tasks. All clients remove tasks asynchronously,
381
	* and as a result no guarantee is made that the correct task will actually be removed. 
382
	* If an invalid position is specified, the state of the queue is undefined and server failure may result.
383
	* Due to the asynchronous nature of the queue, we cannot easily account for concurrent
384
	* modification failures on the client side.
385
	*
386
	* @param pos The position in the queue at which we would like the task to be removed. Note that this is not 
387
	* guaranteed. Invalid positions may result in a corrupted queue.
388
	*/
280 389
	public void sendQueueRemove (int pos) {
281 390
		String packet = "";
282 391
		packet += ColonetServerInterface.QUEUE_REMOVE;
......
285 394
		sendQueueInstruction(packet);
286 395
	}
287 396

  
397
	/**
398
	* Notifies the Colonet server to reorder tasks in the current task queue. The Colonet server holds the canonical 
399
	* task queue. Any applet can reorder tasks in the queue. Local copies of the queue in the applet are for
400
	* display purposes only, and are not authoritative when reordering tasks. All clients reorder tasks asynchronously,
401
	* and as a result no guarantee is made that the correct tasks will actually be reordered. 
402
	* If an invalid position is specified, the state of the queue is undefined and server failure may result.
403
	* Due to the asynchronous nature of the queue, we cannot easily account for concurrent
404
	* modification failures on the client side.
405
	*
406
	* @param pos1 The queue position of a task which we would like to reorder.
407
	* @param pos2 The queue position of a task which we would like to reorder.
408
	*/
288 409
	public void sendQueueReorder (int pos1, int pos2) {
289 410
		String packet = "";
290 411
		packet += ColonetServerInterface.QUEUE_REORDER;
......
350 471
		}
351 472
		
352 473
		public void parseData (String line) {
353
			// Senser Matrix
474
			// Sensor Matrix
354 475
			if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " +
355 476
				ColonetServerInterface.REQUEST_BOM_MATRIX))
356 477
				colonet.parseMatrix(line);
......
362 483
				ColonetServerInterface.REQUEST_XBEE_IDS))
363 484
				colonet.parseXBeeIDs(line);
364 485
			// Battery
486
			else if (line.charAt(0) == Integer.parseInt(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST)
487
				&& line.charAt(2) == Integer.parseInt(ColonetServerInterface.BATTERY))
488
				colonet.parseBattery(line);
489
			/*
365 490
			else if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " +
366 491
				ColonetServerInterface.BATTERY))
367 492
				colonet.parseBattery(line);
493
			*/
494
			// Unknown type
495
			else
496
				System.out.println("Got data:" + line);
497
				
368 498
		}
369 499

  
370 500
	}

Also available in: Unified diff