-
Notifications
You must be signed in to change notification settings - Fork 9
/
command_panel.py
2237 lines (1794 loc) · 120 KB
/
command_panel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import tkinter as tk
from tkinter import ttk
# There are probably better ways to code this, but it works just as well as you'd want.
# For loops create evil bugs for some reason, so I just did a lot of copy-pasting as a substitude.
def use_command_panel(vessels, bodies, surface_points, barycenters, maneuvers, radiation_pressures, atmospheric_drags, schwarzschilds, lensethirrings,
proximity_zones, surface_coverages, projections, resources, observations, plots, auto_dt_buffer, sim_time, delta_t, cycle_time,
output_rate, cam_strafe_speed, cam_rotate_speed, rapid_compute_buffer, scene_lock, scene_rot_target, solver_type, tolerance,
starfield, default_star_num):
command_buffer = []
def on_panel_close():
root.destroy()
return command_buffer
def clear_command_buffer():
for i in range(len(command_buffer)):
remove_from_buffer(0)
def generate_objects_text():
objects_text = ""
for v in vessels:
objects_text += "VESSEL: " + v.get_name() + "\n"
for b in bodies:
objects_text += "BODY: " + b.get_name() + "\n"
for sp in surface_points:
objects_text += "SURFACE POINT: " + sp.get_name() + "\n"
for bc in barycenters:
objects_text += "BARYCENTER: " + bc.get_name() + "\n"
for m in maneuvers:
objects_text += "MANEUVER: " + m.get_name() + "\n"
for rp in radiation_pressures:
objects_text += "RADIATION PRESSURE: " + rp.get_name() + "\n"
for ad in atmospheric_drags:
objects_text += "ATMOSPHERIC DRAG: " + ad.get_name() + "\n"
for sch in schwarzschilds:
objects_text += "SCHWARZCHILD EFFECT: " + sch.get_name() + "\n"
for lt in lensethirrings:
objects_text += "LENSE-THIRRING EFFECT: " + lt.get_name() + "\n"
for pz in proximity_zones:
objects_text += "PROXIMITY ZONE: " + pz.get_name() + "\n"
for p in projections:
objects_text += "PROJECTION: " + p.get_name() + "\n"
for res in resources:
objects_text += "RESOURCE: " + res.get_name() + "\n"
for obs in observations:
objects_text += "OBSERVATION: " + obs.get_name() + "\n"
for sc in surface_coverages:
objects_text += "SURFACE COV.: " + sc.get_name() + "\n"
for pl in plots:
objects_text += "PLOTTER: " + pl.get_name() + "\n"
return objects_text
def set_objects_text():
objects_panel.config(state="normal")
obj_text = generate_objects_text()
objects_panel.delete(1.0, "end")
objects_panel.insert(1.0, obj_text)
objects_panel.config(state="disabled")
def set_buffer_field():
cbx.config(state="normal")
cb_out = ""
for i in range(len(command_buffer)):
cb_out += str(i) + ": " + command_buffer[i] + "\n"
cbx.delete(1.0, "end")
cbx.insert(1.0, cb_out)
cbx.config(state="disabled")
def set_vars_field():
sim_variables_field.config(state="normal")
vars_text = "Sim. Time: " + str(sim_time) + "\n\n"
vars_text += "Solver Type: " + str(solver_type) + "\n("
if solver_type == 0:
vars_text += "Sym. Euler" + ")\n"
elif solver_type == 1:
vars_text += "Vel. Verlet" + ")\n"
elif solver_type == 2:
vars_text += "Yoshida4" + ")\n"
elif solver_type == 3:
vars_text += "Yoshida8" + ")\n"
elif solver_type == 4:
vars_text += "Adap. Sym. Euler" + ")\n"
elif solver_type == 5:
vars_text += "Adap. Vel. Verlet" + ")\n"
elif solver_type == 6:
vars_text += "Adap. Yoshida4" + ")\n"
elif solver_type == 7:
vars_text += "Adap. Yoshida8" + ")\n"
vars_text += "Adap. Tolerance: " + str(tolerance) + "\n"
if solver_type < 4:
vars_text += "Using nonadaptive solver.\nTolerance is disregarded.\n\n"
vars_text += "Delta T: " + str(delta_t) + "\n"
vars_text += "Cycle Time: " + str(cycle_time) + "\n"
vars_text += "Output Rate: " + str(output_rate) + "\n"
vars_text += "\nCam. Strafe Speed: " + str(cam_strafe_speed) + "\n"
vars_text += "Cam. Rotate Speed: " + str(cam_rotate_speed) + "\n"
if scene_lock:
vars_text += "Scene Lock: " + str(scene_lock.get_name()) + "\n"
else:
vars_text += "Scene Lock: None\n"
if scene_rot_target:
vars_text += "Scene Rot. Target: " + str(scene_rot_target.get_name()) + "\n"
else:
vars_text += "Scene Rot. Target: None\n"
if starfield:
vars_text += "Strfld. Star Count: " + str(len(starfield)) + "\n"
else:
vars_text += "Strfld. Disabled\n"
sim_variables_field.delete(1.0, "end")
sim_variables_field.insert(1.0, vars_text)
sim_variables_field.config(state="disabled")
def add_to_buffer(command):
command_buffer.append(command)
set_buffer_field()
def remove_from_buffer(cmd_index):
if len(command_buffer):
cmd_index = int(cmd_index)
cmd_index = min(cmd_index, len(command_buffer)-1)
command_buffer.remove(command_buffer[cmd_index])
set_buffer_field()
def time_command_on_buffer(cmd_idx, assigned_time):
if len(command_buffer):
cmd_idx = int(cmd_idx)
cmd_idx = min(cmd_idx, len(command_buffer)-1)
untimed_cmd = command_buffer[cmd_idx]
command_buffer[cmd_idx] = "t=" + assigned_time + " " + untimed_cmd
set_buffer_field()
def use_command_delete_window():
if len(command_buffer):
deletion_window = tk.Tk()
deletion_window.title("Delete Command")
deletion_label = tk.Label(deletion_window, text="Type the index number of the command you want to delete from the buffer.")
deletion_label.grid(row=0, column=0, columnspan=10)
deletion_input = tk.Text(deletion_window, width=20, height=1)
deletion_input.grid(row=1, column=4)
deletion_button = tk.Button(deletion_window, text="Delete", command=lambda:remove_from_buffer(deletion_input.get("1.0","end-1c")))
deletion_button.grid(row=2, column=4)
def assign_cmd_time():
if len(command_buffer):
cmd_time_window = tk.Tk()
cmd_time_window.title("Assign Command Execution Time")
cmd_time_idx_label = tk.Label(cmd_time_window, text="Cmd. Index:")
cmd_time_idx_label.grid(row=0, column=0)
cmd_time_asgn_label = tk.Label(cmd_time_window, text="Exec. Time:")
cmd_time_asgn_label.grid(row=0, column=1)
cmd_time_idx_input = tk.Text(cmd_time_window, width=20, height=1)
cmd_time_idx_input.grid(row=1, column=0)
cmd_time_asgn_input = tk.Text(cmd_time_window, width=20, height=1)
cmd_time_asgn_input.grid(row=1, column=1)
cmd_time_asgn_button = tk.Button(cmd_time_window, text="Assign Time",
command=lambda:time_command_on_buffer(cmd_time_idx_input.get("1.0","end-1c"),
cmd_time_asgn_input.get("1.0","end-1c")))
cmd_time_asgn_button.grid(row=2, column=0, columnspan=2)
def use_command_window():
def on_command_window_close():
cmd_window.destroy()
def enter_cmd(cmd_a):
entry_panel = tk.Tk()
entry_panel.title(cmd_a)
# SHOW COMMAND
if cmd_a == "show":
show_help = tk.Label(entry_panel, text="'show' command adds an output element to the command prompt/terminal.")
show_help.grid(row=0, column=0, columnspan=10)
# option 1
show_s1t1_label = tk.Label(entry_panel, text="Object")
show_s1t2_label = tk.Label(entry_panel, text="Variable")
show_s1t3_label = tk.Label(entry_panel, text="Display Label")
show_s1t1_label.grid(row=1, column=1)
show_s1t2_label.grid(row=1, column=2)
show_s1t3_label.grid(row=1, column=3)
show_s1t1 = tk.Text(entry_panel, width=20, height=1)
show_s1t2 = tk.Text(entry_panel, width=20, height=1)
show_s1t3 = tk.Text(entry_panel, width=20, height=1)
show_s1t1.grid(row=2, column=1)
show_s1t2.grid(row=2, column=2)
show_s1t3.grid(row=2, column=3)
def generate_s1():
if show_s1t1.get("1.0","end-1c") and show_s1t2.get("1.0","end-1c") and show_s1t3.get("1.0","end-1c"):
command = "show " + show_s1t1.get("1.0","end-1c") + " " + show_s1t2.get("1.0","end-1c") + " " + show_s1t3.get("1.0","end-1c")
add_to_buffer(command)
show_s1_button = tk.Button(entry_panel, text="Show Global Variable", command=generate_s1)
show_s1_button.grid(row=2, column=0)
show_s1_button.config(width=20,height=1)
# option 2
show_s2t1_label = tk.Label(entry_panel, text="Object")
show_s2t2_label = tk.Label(entry_panel, text= "Variable")
show_s2t3_label = tk.Label(entry_panel, text="Frame of Ref.")
show_s2t4_label = tk.Label(entry_panel, text="Display Label")
show_s2t1_label.grid(row=3, column=1)
show_s2t2_label.grid(row=3, column=2)
show_s2t3_label.grid(row=3, column=3)
show_s2t4_label.grid(row=3, column=4)
show_s2t1 = tk.Text(entry_panel, width=20, height=1)
show_s2t2 = tk.Text(entry_panel, width=20, height=1)
show_s2t3 = tk.Text(entry_panel, width=20, height=1)
show_s2t4 = tk.Text(entry_panel, width=20, height=1)
show_s2t1.grid(row=4, column=1)
show_s2t2.grid(row=4, column=2)
show_s2t3.grid(row=4, column=3)
show_s2t4.grid(row=4, column=4)
def generate_s2():
if show_s2t1.get("1.0","end-1c") and show_s2t2.get("1.0","end-1c") and show_s2t3.get("1.0","end-1c") and show_s2t4.get("1.0","end-1c"):
command = "show " + show_s2t1.get("1.0","end-1c") + " " + show_s2t2.get("1.0","end-1c") + " " + show_s2t3.get("1.0","end-1c") + " " + show_s2t4.get("1.0","end-1c")
add_to_buffer(command)
show_s2_button = tk.Button(entry_panel, text="Show Relative Variable", command=generate_s2)
show_s2_button.grid(row=4, column=0)
show_s2_button.config(width=20,height=1)
# option 3
show_s3t1_label = tk.Label(entry_panel, text="Maneuver")
show_s3t2_label = tk.Label(entry_panel, text="Data ('active'/'state'/'params')")
show_s3t3_label = tk.Label(entry_panel, text="Display Label")
show_s3t1_label.grid(row=5, column=1)
show_s3t2_label.grid(row=5, column=2)
show_s3t3_label.grid(row=5, column=3)
show_s3t1 = tk.Text(entry_panel, width=20, height=1)
show_s3t2 = tk.Text(entry_panel, width=20, height=1)
show_s3t3 = tk.Text(entry_panel, width=20, height=1)
show_s3t1.grid(row=6, column=1)
show_s3t2.grid(row=6, column=2)
show_s3t3.grid(row=6, column=3)
def generate_s3():
if show_s3t1.get("1.0","end-1c") and show_s3t2.get("1.0","end-1c") and show_s3t3.get("1.0","end-1c"):
command = "show " + show_s3t1.get("1.0","end-1c") + " " + show_s3t2.get("1.0","end-1c") + " " + show_s3t3.get("1.0","end-1c")
add_to_buffer(command)
show_s3_button = tk.Button(entry_panel, text="Show Maneuver Data", command=generate_s3)
show_s3_button.grid(row=6, column=0)
show_s3_button.config(width=20,height=1)
# option 4
show_s4t1_label = tk.Label(entry_panel, text="Radiation Press.")
show_s4t2_label = tk.Label(entry_panel, text="Data ('params')")
show_s4t3_label = tk.Label(entry_panel, text="Display Label")
show_s4t1_label.grid(row=7, column=1)
show_s4t2_label.grid(row=7, column=2)
show_s4t3_label.grid(row=7, column=3)
show_s4t1 = tk.Text(entry_panel, width=20, height=1)
show_s4t2 = tk.Text(entry_panel, width=20, height=1)
show_s4t3 = tk.Text(entry_panel, width=20, height=1)
show_s4t1.grid(row=8, column=1)
show_s4t2.grid(row=8, column=2)
show_s4t3.grid(row=8, column=3)
def generate_s4():
if show_s4t1.get("1.0","end-1c") and show_s4t2.get("1.0","end-1c") and show_s4t3.get("1.0","end-1c"):
command = "show " + show_s4t1.get("1.0","end-1c") + " " + show_s4t2.get("1.0","end-1c") + " " + show_s4t3.get("1.0","end-1c")
add_to_buffer(command)
show_s4_button = tk.Button(entry_panel, text="Show Rad. Press. Data", command=generate_s4)
show_s4_button.grid(row=8, column=0)
show_s4_button.config(width=20,height=1)
# option 5
show_s5t1_label = tk.Label(entry_panel, text="Atmo. Drag")
show_s5t2_label = tk.Label(entry_panel, text="Data ('params')")
show_s5t3_label = tk.Label(entry_panel, text="Display Label")
show_s5t1_label.grid(row=9, column=1)
show_s5t2_label.grid(row=9, column=2)
show_s5t3_label.grid(row=9, column=3)
show_s5t1 = tk.Text(entry_panel, width=20, height=1)
show_s5t2 = tk.Text(entry_panel, width=20, height=1)
show_s5t3 = tk.Text(entry_panel, width=20, height=1)
show_s5t1.grid(row=10, column=1)
show_s5t2.grid(row=10, column=2)
show_s5t3.grid(row=10, column=3)
def generate_s5():
if show_s5t1.get("1.0","end-1c") and show_s5t2.get("1.0","end-1c") and show_s5t3.get("1.0","end-1c"):
command = "show " + show_s5t1.get("1.0","end-1c") + " " + show_s5t2.get("1.0","end-1c") + " " + show_s5t3.get("1.0","end-1c")
add_to_buffer(command)
show_s5_button = tk.Button(entry_panel, text="Show Atmo. Drag Data", command=generate_s5)
show_s5_button.grid(row=10, column=0)
show_s5_button.config(width=20,height=1)
# option 6
show_s6t1_label = tk.Label(entry_panel, text="Projection")
show_s6t2_label = tk.Label(entry_panel, text="Data (attribute/'params')")
show_s6t3_label = tk.Label(entry_panel, text="Display Label")
show_s6t1_label.grid(row=11, column=1)
show_s6t2_label.grid(row=11, column=2)
show_s6t3_label.grid(row=11, column=3)
show_s6t1 = tk.Text(entry_panel, width=20, height=1)
show_s6t2 = tk.Text(entry_panel, width=20, height=1)
show_s6t3 = tk.Text(entry_panel, width=20, height=1)
show_s6t1.grid(row=12, column=1)
show_s6t2.grid(row=12, column=2)
show_s6t3.grid(row=12, column=3)
def generate_s6():
if show_s6t1.get("1.0","end-1c") and show_s6t2.get("1.0","end-1c") and show_s6t3.get("1.0","end-1c"):
command = "show " + show_s6t1.get("1.0","end-1c") + " " + show_s6t2.get("1.0","end-1c") + " " + show_s6t3.get("1.0","end-1c")
add_to_buffer(command)
show_s6_button = tk.Button(entry_panel, text="Show Projection Data", command=generate_s6)
show_s6_button.grid(row=12, column=0)
show_s6_button.config(width=20,height=1)
# option 7
show_s7t1_label = tk.Label(entry_panel, text="Resource")
show_s7t2_label = tk.Label(entry_panel, text="Data ('value'/'delta')")
show_s7t3_label = tk.Label(entry_panel, text="Display Label")
show_s7t1_label.grid(row=13, column=1)
show_s7t2_label.grid(row=13, column=2)
show_s7t3_label.grid(row=13, column=3)
show_s7t1 = tk.Text(entry_panel, width=20, height=1)
show_s7t2 = tk.Text(entry_panel, width=20, height=1)
show_s7t3 = tk.Text(entry_panel, width=20, height=1)
show_s7t1.grid(row=14, column=1)
show_s7t2.grid(row=14, column=2)
show_s7t3.grid(row=14, column=3)
def generate_s7():
if show_s7t1.get("1.0", "end-1c") and show_s7t2.get("1.0", "end-1c") and show_s7t3.get("1.0", "end-1c"):
command = "show " + show_s7t1.get("1.0", "end-1c") + " " + show_s7t2.get("1.0", "end-1c") + " " + show_s7t3.get("1.0", "end-1c")
add_to_buffer(command)
show_s7_button = tk.Button(entry_panel, text="Show Resource Data", command=generate_s7)
show_s7_button.grid(row=14, column=0)
show_s7_button.config(width=20, height=1)
# option 8
show_s8t1_label = tk.Label(entry_panel, text="Observation")
show_s8t2_label = tk.Label(entry_panel, text="Display Label")
show_s8t1_label.grid(row=15, column=1)
show_s8t2_label.grid(row=15, column=2)
show_s8t1 = tk.Text(entry_panel, width=20, height=1)
show_s8t2 = tk.Text(entry_panel, width=20, height=1)
show_s8t1.grid(row=16, column=1)
show_s8t2.grid(row=16, column=2)
def generate_s8():
if show_s8t1.get("1.0", "end-1c") and show_s8t2.get("1.0", "end-1c"):
command = "show " + show_s8t1.get("1.0", "end-1c") + " " + show_s8t2.get("1.0", "end-1c")
add_to_buffer(command)
show_s8_button = tk.Button(entry_panel, text="Show Obsrv. Data", command=generate_s8)
show_s8_button.grid(row=16, column=0)
show_s8_button.config(width=20, height=1)
# option 9
show_traj_button = tk.Button(entry_panel, text="Show Trajectories", command=lambda:add_to_buffer("show traj"))
show_traj_button.grid(row=17, column=0)
show_traj_button.config(width=20,height=1)
# option 10
show_labels_button = tk.Button(entry_panel, text="Show Labels", command=lambda:add_to_buffer("show labels"))
show_labels_button.grid(row=17, column=1)
show_labels_button.config(width=20,height=1)
# option 11
show_grid_button = tk.Button(entry_panel, text="Show Grid", command=lambda:add_to_buffer("show grid"))
show_grid_button.grid(row=17, column=2)
show_grid_button.config(width=20, height=1)
# option 12
show_polar_grid_button = tk.Button(entry_panel, text="Show Polar Grid", command=lambda:add_to_buffer("show polar_grid"))
show_polar_grid_button.grid(row=17, column=3)
show_polar_grid_button.config(width=20, height=1)
# option 13
show_pmcs_button = tk.Button(entry_panel, text="Show PMCs", command=lambda:add_to_buffer("show pmcs"))
show_pmcs_button.grid(row=17, column=4)
show_pmcs_button.config(width=20, height=1)
elif cmd_a == "hide":
hide_help = tk.Label(entry_panel, text="'hide' command removes an output element from the command prompt/terminal.")
hide_help.grid(row=0, column=0, columnspan=10)
hide_s1_button = tk.Button(entry_panel, text="Hide Trajectories", command=lambda:add_to_buffer("hide traj"))
hide_s1_button.grid(row=1, column=0)
hide_s1_button.config(width=20,height=1)
hide_s2t1_label = tk.Label(entry_panel, text="Display Label")
hide_s2t1_label.grid(row=2, column=1)
hide_s2t1 = tk.Text(entry_panel, width=20, height=1)
hide_s2t1.grid(row=3, column=1)
def generate_s2():
if hide_s2t1.get("1.0","end-1c"):
command = "hide " + hide_s2t1.get("1.0","end-1c")
add_to_buffer(command)
hide_s2_button = tk.Button(entry_panel, text="Hide Output", command=generate_s2)
hide_s2_button.grid(row=3, column=0)
hide_s2_button.config(width=20,height=1)
hide_s3_button = tk.Button(entry_panel, text="Hide Labels", command=lambda:add_to_buffer("hide labels"))
hide_s3_button.grid(row=4, column=0)
hide_s3_button.config(width=20,height=1)
hide_s4_button = tk.Button(entry_panel, text="Hide Grid", command=lambda:add_to_buffer("hide grid"))
hide_s4_button.grid(row=5, column=0)
hide_s4_button.config(width=20, height=1)
hide_s5_button = tk.Button(entry_panel, text="Hide Plr. Grid", command=lambda:add_to_buffer("hide polar_grid"))
hide_s5_button.grid(row=5, column=1)
hide_s5_button.config(width=20, height=1)
hide_s6_button = tk.Button(entry_panel, text="Hide PMCs", command=lambda:add_to_buffer("hide pmcs"))
hide_s6_button.grid(row=5, column=2)
hide_s6_button.config(width=20, height=1)
elif cmd_a == "clear":
clear_help = tk.Label(entry_panel, text="'clear' command can remove all output element from the command prompt/terminal,\nremove all objects from the simulation, or clear trajectory trails up to current simulation time.")
clear_help.grid(row=0, column=0, columnspan=10)
clear_s1_button = tk.Button(entry_panel, text="Clear Output", command=lambda:add_to_buffer("clear output"))
clear_s2_button = tk.Button(entry_panel, text="Clear Scene", command=lambda:add_to_buffer("clear scene"))
clear_s3_button = tk.Button(entry_panel, text="Clear Trajectory Trails", command=lambda:add_to_buffer("clear traj_visuals"))
clear_s1_button.grid(row=1, column=0)
clear_s2_button.grid(row=2, column=0)
clear_s3_button.grid(row=3, column=0)
elif cmd_a == "generate_starfield":
gsf_help_text = "'generate_starfield' command generates a starfield to aid the eye with camera rotations as well as make the sky look a bit more familiar.\nDefault number of stars is " + str(default_star_num) + ", you can click the button without entering a number to use the default.\nDefault number can be modified by editing the config file (requires restart)."
gsf_help = tk.Label(entry_panel, text=gsf_help_text)
gsf_help.grid(row=0, column=0, columnspan=10)
gsf_s1t1_label = tk.Label(entry_panel, text="Num. of Stars")
gsf_s1t1_label.grid(row=1, column=1)
gsf_s1t1 = tk.Text(entry_panel, width=20, height=1)
gsf_s1t1.grid(row=2, column=1)
def generate_s1():
if gsf_s1t1.get("1.0","end-1c"):
command = "generate_starfield " + gsf_s1t1.get("1.0","end-1c")
else:
command = "generate_starfield"
add_to_buffer(command)
gsf_s1_button = tk.Button(entry_panel, text="Gen. Strfld.", command=generate_s1)
gsf_s1_button.grid(row=2, column=0)
elif cmd_a == "create_vessel":
cv_help = tk.Label(entry_panel, text="'create_vessel' command adds a new space vessel to the simulation.")
cv_help.grid(row=0, column=0, columnspan=10)
# option 1
cv_s1t1_label = tk.Label(entry_panel, text="Vessel Name")
cv_s1t2_label = tk.Label(entry_panel, text="3D Model Name")
cv_s1t3_label = tk.Label(entry_panel, text="Color")
cv_s1t4_label = tk.Label(entry_panel, text="Position")
cv_s1t5_label = tk.Label(entry_panel, text="Velocity")
cv_s1t1_label.grid(row=1, column=1)
cv_s1t2_label.grid(row=1, column=2)
cv_s1t3_label.grid(row=1, column=3)
cv_s1t4_label.grid(row=1, column=4)
cv_s1t5_label.grid(row=1, column=5)
cv_s1t1 = tk.Text(entry_panel, width=20, height=1)
cv_s1t2 = tk.Text(entry_panel, width=20, height=1)
cv_s1t3 = tk.Text(entry_panel, width=20, height=1)
cv_s1t4 = tk.Text(entry_panel, width=20, height=1)
cv_s1t5 = tk.Text(entry_panel, width=20, height=1)
cv_s1t1.grid(row=2, column=1)
cv_s1t2.grid(row=2, column=2)
cv_s1t3.grid(row=2, column=3)
cv_s1t4.grid(row=2, column=4)
cv_s1t5.grid(row=2, column=5)
def generate_s1():
if cv_s1t1.get("1.0","end-1c") and cv_s1t2.get("1.0","end-1c") and cv_s1t3.get("1.0","end-1c") and cv_s1t4.get("1.0","end-1c") and cv_s1t5.get("1.0","end-1c"):
command = "create_vessel " + cv_s1t1.get("1.0","end-1c") + " " + cv_s1t2.get("1.0","end-1c") + " " + cv_s1t3.get("1.0","end-1c") + " " + cv_s1t4.get("1.0","end-1c") + " " + cv_s1t5.get("1.0","end-1c")
add_to_buffer(command)
cv_s1_button = tk.Button(entry_panel, text="Create Vessel", command=generate_s1)
cv_s1_button.grid(row=2, column=0)
# option 2
cv_s2t1_label = tk.Label(entry_panel, text="Vessel Name")
cv_s2t2_label = tk.Label(entry_panel, text="3D Model Name")
cv_s2t3_label = tk.Label(entry_panel, text="Color")
cv_s2t4_label = tk.Label(entry_panel, text="Frame of Ref.")
cv_s2t5_label = tk.Label(entry_panel, text="Position (spherical)")
cv_s2t6_label = tk.Label(entry_panel, text="Velocity")
cv_s2t1_label.grid(row=3, column=1)
cv_s2t2_label.grid(row=3, column=2)
cv_s2t3_label.grid(row=3, column=3)
cv_s2t4_label.grid(row=3, column=4)
cv_s2t5_label.grid(row=3, column=5)
cv_s2t6_label.grid(row=3, column=6)
cv_s2t1 = tk.Text(entry_panel, width=20, height=1)
cv_s2t2 = tk.Text(entry_panel, width=20, height=1)
cv_s2t3 = tk.Text(entry_panel, width=20, height=1)
cv_s2t4 = tk.Text(entry_panel, width=20, height=1)
cv_s2t5 = tk.Text(entry_panel, width=20, height=1)
cv_s2t6 = tk.Text(entry_panel, width=20, height=1)
cv_s2t1.grid(row=4, column=1)
cv_s2t2.grid(row=4, column=2)
cv_s2t3.grid(row=4, column=3)
cv_s2t4.grid(row=4, column=4)
cv_s2t5.grid(row=4, column=5)
cv_s2t6.grid(row=4, column=6)
def generate_s2():
if cv_s2t1.get("1.0","end-1c") and cv_s2t2.get("1.0","end-1c") and cv_s2t3.get("1.0","end-1c") and cv_s2t4.get("1.0","end-1c") and cv_s2t5.get("1.0","end-1c") and cv_s2t6.get("1.0","end-1c") :
command = "create_vessel " + cv_s2t1.get("1.0","end-1c") + " " + cv_s2t2.get("1.0","end-1c") + " " + cv_s2t3.get("1.0","end-1c") + " " + cv_s2t4.get("1.0","end-1c") + " " + cv_s2t5.get("1.0","end-1c") + " " + cv_s2t5.get("1.0","end-1c")
add_to_buffer(command)
cv_s2_button = tk.Button(entry_panel, text="Create Vessel", command=generate_s1)
cv_s2_button.grid(row=4, column=0)
elif cmd_a == "delete_vessel":
dv_help = tk.Label(entry_panel, text="'delete_vessel' command removes a space vessel from the simulation.")
dv_help.grid(row=0, column=0, columnspan=10)
dv_s1t1_label = tk.Label(entry_panel, text="Vessel Name")
dv_s1t1_label.grid(row=1, column=1)
dv_s1t1 = tk.Text(entry_panel, width=20, height=1)
dv_s1t1.grid(row=2, column=1)
def generate_s1():
if dv_s1t1.get("1.0","end-1c"):
command = "delete_vessel " + dv_s1t1.get("1.0","end-1c")
add_to_buffer(command)
dv_s1_button = tk.Button(entry_panel, text="Delete Vessel", command=generate_s1)
dv_s1_button.grid(row=2, column=0)
elif cmd_a == "fragment":
frag_help = tk.Label(entry_panel, text="'fragment' command creates small fragments from an object in space\n(as if it was hit by a kinetic impactor).")
frag_help.grid(row=0, column=0, columnspan=10)
frag_s1t1_label = tk.Label(entry_panel, text="Object to Frag.")
frag_s1t1_label.grid(row=1, column=1)
frag_s1t2_label = tk.Label(entry_panel, text="Num. of Fragments")
frag_s1t2_label.grid(row=1, column=2)
frag_s1t3_label = tk.Label(entry_panel, text="Rel. Vel. of Fragments")
frag_s1t3_label.grid(row=1, column=3)
frag_s1t1 = tk.Text(entry_panel, width=20, height=1)
frag_s1t1.grid(row=2, column=1)
frag_s1t2 = tk.Text(entry_panel, width=20, height=1)
frag_s1t2.grid(row=2, column=2)
frag_s1t3 = tk.Text(entry_panel, width=20, height=1)
frag_s1t3.grid(row=2, column=3)
def generate_s1():
if frag_s1t1.get("1.0","end-1c") and frag_s1t2.get("1.0","end-1c") and frag_s1t3.get("1.0","end-1c"):
command = "fragment " + frag_s1t1.get("1.0","end-1c") + " " + frag_s1t2.get("1.0","end-1c") + " " + frag_s1t3.get("1.0","end-1c")
add_to_buffer(command)
frag_s1_button = tk.Button(entry_panel, text="Fragment", command=generate_s1)
frag_s1_button.grid(row=2, column=0)
# s2 ---
frag_s2t1_label = tk.Label(entry_panel, text="Object to Frag.")
frag_s2t1_label.grid(row=3, column=1)
frag_s2t2_label = tk.Label(entry_panel, text="Num. of Fragments")
frag_s2t2_label.grid(row=3, column=2)
frag_s2t1 = tk.Text(entry_panel, width=20, height=1)
frag_s2t1.grid(row=4, column=1)
frag_s2t2 = tk.Text(entry_panel, width=20, height=1)
frag_s2t2.grid(row=4, column=2)
def generate_s2():
if frag_s2t1.get("1.0","end-1c") and frag_s2t2.get("1.0","end-1c"):
command = "fragment " + frag_s2t1.get("1.0","end-1c") + " " + frag_s2t2.get("1.0","end-1c")
add_to_buffer(command)
frag_s2_button = tk.Button(entry_panel, text="Fragment", command=generate_s2)
frag_s2_button.grid(row=4, column=0)
# s3 ---
frag_s3t1_label = tk.Label(entry_panel, text="Object to Frag.")
frag_s3t1_label.grid(row=5, column=1)
frag_s3t1 = tk.Text(entry_panel, width=20, height=1)
frag_s3t1.grid(row=6, column=1)
def generate_s3():
if frag_s3t1.get("1.0","end-1c"):
command = "fragment " + frag_s3t1.get("1.0","end-1c")
add_to_buffer(command)
frag_s3_button = tk.Button(entry_panel, text="Fragment", command=generate_s3)
frag_s3_button.grid(row=6, column=0)
elif cmd_a == "create_maneuver":
cm_help = tk.Label(entry_panel, text="'create_maneuver' command adds a new maneuver to be performed by a space vessel.")
cm_help.grid(row=0, column=0, columnspan=10)
# option 1
cm_s1t1_label = tk.Label(entry_panel, text="Maneuver Name")
cm_s1t2_label = tk.Label(entry_panel, text="Vessel Name")
cm_s1t3_label = tk.Label(entry_panel, text="Frame of Ref.")
cm_s1t4_label = tk.Label(entry_panel, text="Orientation")
cm_s1t5_label = tk.Label(entry_panel, text="Acceleration")
cm_s1t6_label = tk.Label(entry_panel, text="Start Time")
cm_s1t7_label = tk.Label(entry_panel, text="Duration")
cm_s1t1_label.grid(row=1, column=1)
cm_s1t2_label.grid(row=1, column=2)
cm_s1t3_label.grid(row=1, column=3)
cm_s1t4_label.grid(row=1, column=4)
cm_s1t5_label.grid(row=1, column=5)
cm_s1t6_label.grid(row=1, column=6)
cm_s1t7_label.grid(row=1, column=7)
cm_s1t1 = tk.Text(entry_panel, width=15, height=1)
cm_s1t2 = tk.Text(entry_panel, width=15, height=1)
cm_s1t3 = tk.Text(entry_panel, width=15, height=1)
cm_s1t4 = tk.Text(entry_panel, width=15, height=1)
cm_s1t5 = tk.Text(entry_panel, width=15, height=1)
cm_s1t6 = tk.Text(entry_panel, width=15, height=1)
cm_s1t7 = tk.Text(entry_panel, width=15, height=1)
cm_s1t1.grid(row=2, column=1)
cm_s1t2.grid(row=2, column=2)
cm_s1t3.grid(row=2, column=3)
cm_s1t4.grid(row=2, column=4)
cm_s1t5.grid(row=2, column=5)
cm_s1t6.grid(row=2, column=6)
cm_s1t7.grid(row=2, column=7)
def generate_s1():
if cm_s1t1.get("1.0","end-1c") and cm_s1t2.get("1.0","end-1c") and cm_s1t3.get("1.0","end-1c") and cm_s1t4.get("1.0","end-1c") and cm_s1t5.get("1.0","end-1c") and cm_s1t6.get("1.0","end-1c") and cm_s1t7.get("1.0","end-1c"):
command = "create_maneuver " + cm_s1t1.get("1.0","end-1c") + " const_accel " + cm_s1t2.get("1.0","end-1c") + " " + cm_s1t3.get("1.0","end-1c") + " " + cm_s1t4.get("1.0","end-1c") + " " + cm_s1t5.get("1.0","end-1c") + " " + cm_s1t6.get("1.0","end-1c") + " " + cm_s1t7.get("1.0","end-1c")
add_to_buffer(command)
cm_s1_button = tk.Button(entry_panel, text="Create Const. Accel. Mnv.", command=generate_s1)
cm_s1_button.grid(row=2, column=0)
# option 2
cm_s2t1_label = tk.Label(entry_panel, text="Maneuver Name")
cm_s2t2_label = tk.Label(entry_panel, text="Vessel Name")
cm_s2t3_label = tk.Label(entry_panel, text="Frame of Ref.")
cm_s2t4_label = tk.Label(entry_panel, text="Orientation")
cm_s2t5_label = tk.Label(entry_panel, text="Thrust")
cm_s2t6_label = tk.Label(entry_panel, text="Initial Mass")
cm_s2t7_label = tk.Label(entry_panel, text="Mass Flow")
cm_s2t8_label = tk.Label(entry_panel, text="Start Time")
cm_s2t9_label = tk.Label(entry_panel, text="Duration")
cm_s2t1_label.grid(row=3, column=1)
cm_s2t2_label.grid(row=3, column=2)
cm_s2t3_label.grid(row=3, column=3)
cm_s2t4_label.grid(row=3, column=4)
cm_s2t5_label.grid(row=3, column=5)
cm_s2t6_label.grid(row=3, column=6)
cm_s2t7_label.grid(row=3, column=7)
cm_s2t8_label.grid(row=3, column=8)
cm_s2t9_label.grid(row=3, column=9)
cm_s2t1 = tk.Text(entry_panel, width=15, height=1)
cm_s2t2 = tk.Text(entry_panel, width=15, height=1)
cm_s2t3 = tk.Text(entry_panel, width=15, height=1)
cm_s2t4 = tk.Text(entry_panel, width=15, height=1)
cm_s2t5 = tk.Text(entry_panel, width=15, height=1)
cm_s2t6 = tk.Text(entry_panel, width=15, height=1)
cm_s2t7 = tk.Text(entry_panel, width=15, height=1)
cm_s2t8 = tk.Text(entry_panel, width=15, height=1)
cm_s2t9 = tk.Text(entry_panel, width=15, height=1)
cm_s2t1.grid(row=4, column=1)
cm_s2t2.grid(row=4, column=2)
cm_s2t3.grid(row=4, column=3)
cm_s2t4.grid(row=4, column=4)
cm_s2t5.grid(row=4, column=5)
cm_s2t6.grid(row=4, column=6)
cm_s2t7.grid(row=4, column=7)
cm_s2t8.grid(row=4, column=8)
cm_s2t9.grid(row=4, column=9)
def generate_s2():
if cm_s2t1.get("1.0","end-1c") and cm_s2t2.get("1.0","end-1c") and cm_s2t3.get("1.0","end-1c") and cm_s2t4.get("1.0","end-1c") and cm_s2t5.get("1.0","end-1c") and cm_s2t6.get("1.0","end-1c") and cm_s2t7.get("1.0","end-1c") and cm_s2t8.get("1.0","end-1c") and cm_s2t9.get("1.0","end-1c"):
command = "create_maneuver " + cm_s2t1.get("1.0","end-1c") + " const_thrust " + cm_s2t2.get("1.0","end-1c") + " " + cm_s2t3.get("1.0","end-1c") + " " + cm_s2t4.get("1.0","end-1c") + " " + cm_s2t5.get("1.0","end-1c") + " " + cm_s2t6.get("1.0","end-1c") + " " + cm_s2t7.get("1.0","end-1c") + " " + cm_s2t8.get("1.0","end-1c") + " " + cm_s2t9.get("1.0","end-1c")
add_to_buffer(command)
cm_s2_button = tk.Button(entry_panel, text="Create Const. Thrust Mnv.", command=generate_s2)
cm_s2_button.grid(row=4, column=0)
# option 3
cm_s3t1_label = tk.Label(entry_panel, text="Maneuver Name")
cm_s3t2_label = tk.Label(entry_panel, text="Vessel Name")
cm_s3t3_label = tk.Label(entry_panel, text="Frame of Ref.")
cm_s3t4_label = tk.Label(entry_panel, text="Orientation")
cm_s3t5_label = tk.Label(entry_panel, text="Delta-v")
cm_s3t6_label = tk.Label(entry_panel, text="Perform Time")
cm_s3t1_label.grid(row=5, column=1)
cm_s3t2_label.grid(row=5, column=2)
cm_s3t3_label.grid(row=5, column=3)
cm_s3t4_label.grid(row=5, column=4)
cm_s3t5_label.grid(row=5, column=5)
cm_s3t6_label.grid(row=5, column=6)
cm_s3t1 = tk.Text(entry_panel, width=15, height=1)
cm_s3t2 = tk.Text(entry_panel, width=15, height=1)
cm_s3t3 = tk.Text(entry_panel, width=15, height=1)
cm_s3t4 = tk.Text(entry_panel, width=15, height=1)
cm_s3t5 = tk.Text(entry_panel, width=15, height=1)
cm_s3t6 = tk.Text(entry_panel, width=15, height=1)
cm_s3t1.grid(row=6, column=1)
cm_s3t2.grid(row=6, column=2)
cm_s3t3.grid(row=6, column=3)
cm_s3t4.grid(row=6, column=4)
cm_s3t5.grid(row=6, column=5)
cm_s3t6.grid(row=6, column=6)
def generate_s3():
if cm_s3t1.get("1.0","end-1c") and cm_s3t2.get("1.0","end-1c") and cm_s3t3.get("1.0","end-1c") and cm_s3t4.get("1.0","end-1c") and cm_s3t5.get("1.0","end-1c") and cm_s3t6.get("1.0","end-1c"):
command = "create_maneuver " + cm_s3t1.get("1.0", "end-1c") + " impulsive " + cm_s3t2.get("1.0","end-1c") + " " + cm_s3t3.get("1.0","end-1c") + " " + cm_s3t4.get("1.0","end-1c") + " " + cm_s3t5.get("1.0","end-1c") + " " + cm_s3t6.get("1.0","end-1c")
add_to_buffer(command)
cm_s3_button = tk.Button(entry_panel, text="Create Impulsive Mnv.", command=generate_s3)
cm_s3_button.grid(row=6, column=0)
elif cmd_a == "delete_maneuver":
dm_help = tk.Label(entry_panel, text="'delete_maneuver' command removes a maneuver from the simulation.")
dm_help.grid(row=0, column=0, columnspan=10)
dm_s1t1_label = tk.Label(entry_panel, text="Maneuver Name")
dm_s1t1_label.grid(row=1, column=1)
dm_s1t1 = tk.Text(entry_panel, width=20, height=1)
dm_s1t1.grid(row=2, column=1)
def generate_s1():
if dm_s1t1.get("1.0","end-1c"):
command = "delete_maneuver " + dm_s1t1.get("1.0","end-1c")
add_to_buffer(command)
dm_s1_button = tk.Button(entry_panel, text="Delete Maneuver", command=generate_s1)
dm_s1_button.grid(row=2, column=0)
elif cmd_a == "apply_radiation_pressure":
arp_help = tk.Label(entry_panel, text="'apply_radiation_pressure' command sets up a radiation pressure effect on a vessel.")
arp_help.grid(row=0, column=0, columnspan=10)
arp_s1t1_label = tk.Label(entry_panel, text="Rad. Press. Name")
arp_s1t2_label = tk.Label(entry_panel, text="Vessel Name")
arp_s1t3_label = tk.Label(entry_panel, text="Rad. Source Body")
arp_s1t4_label = tk.Label(entry_panel, text="Illuminated Area")
arp_s1t5_label = tk.Label(entry_panel, text="Orient. Frame Body")
arp_s1t6_label = tk.Label(entry_panel, text="React. Direction")
arp_s1t7_label = tk.Label(entry_panel, text="Vessel Mass")
arp_s1t8_label = tk.Label(entry_panel, text="Mass AutoUpdate(0/1)")
arp_s1t1_label.grid(row=1, column=1)
arp_s1t2_label.grid(row=1, column=2)
arp_s1t3_label.grid(row=1, column=3)
arp_s1t4_label.grid(row=1, column=4)
arp_s1t5_label.grid(row=1, column=5)
arp_s1t6_label.grid(row=1, column=6)
arp_s1t7_label.grid(row=1, column=7)
arp_s1t8_label.grid(row=1, column=8)
arp_s1t1 = tk.Text(entry_panel, width=20, height=1)
arp_s1t2 = tk.Text(entry_panel, width=20, height=1)
arp_s1t3 = tk.Text(entry_panel, width=20, height=1)
arp_s1t4 = tk.Text(entry_panel, width=20, height=1)
arp_s1t5 = tk.Text(entry_panel, width=20, height=1)
arp_s1t6 = tk.Text(entry_panel, width=20, height=1)
arp_s1t7 = tk.Text(entry_panel, width=20, height=1)
arp_s1t8 = tk.Text(entry_panel, width=20, height=1)
arp_s1t1.grid(row=2, column=1)
arp_s1t2.grid(row=2, column=2)
arp_s1t3.grid(row=2, column=3)
arp_s1t4.grid(row=2, column=4)
arp_s1t5.grid(row=2, column=5)
arp_s1t6.grid(row=2, column=6)
arp_s1t7.grid(row=2, column=7)
arp_s1t8.grid(row=2, column=8)
def generate_s1():
if (arp_s1t1.get("1.0", "end-1c") and arp_s1t2.get("1.0", "end-1c") and arp_s1t3.get("1.0", "end-1c") and arp_s1t4.get("1.0", "end-1c") and
arp_s1t5.get("1.0", "end-1c") and arp_s1t6.get("1.0", "end-1c") and arp_s1t7.get("1.0", "end-1c") and arp_s1t8.get("1.0", "end-1c")):
command = "apply_radiation_pressure " + arp_s1t1.get("1.0", "end-1c") + " " + arp_s1t2.get("1.0", "end-1c") + " " + arp_s1t3.get("1.0", "end-1c") + " " + arp_s1t4.get("1.0", "end-1c") + " " + arp_s1t5.get("1.0", "end-1c") + " " + arp_s1t6.get("1.0", "end-1c") + " " + arp_s1t7.get("1.0", "end-1c") + " " + arp_s1t8.get("1.0", "end-1c")
add_to_buffer(command)
arp_s1_button = tk.Button(entry_panel, text="Apply Rad. Press.", command=generate_s1)
arp_s1_button.grid(row=2, column=0)
elif cmd_a == "remove_radiation_pressure":
rrp_help = tk.Label(entry_panel, text="'remove_radiation_pressure' command removes a radiation pressure effect from the simulation.")
rrp_help.grid(row=0, column=0, columnspan=10)
rrp_s1t1_label = tk.Label(entry_panel, text="Rad. Press. Name")
rrp_s1t1_label.grid(row=1, column=1)
rrp_s1t1 = tk.Text(entry_panel, width=20, height=1)
rrp_s1t1.grid(row=2, column=1)
def generate_s1():
if rrp_s1t1.get("1.0","end-1c"):
command = "remove_radiation_pressure " + rrp_s1t1.get("1.0","end-1c")
add_to_buffer(command)
rrp_s1_button = tk.Button(entry_panel, text="Remove Rad. Press.", command=generate_s1)
rrp_s1_button.grid(row=2, column=0)
elif cmd_a == "apply_atmospheric_drag":
aad_help = tk.Label(entry_panel, text="'apply_atmospheric_drag' command sets up an atmospheric drag effect on a vessel.")
aad_help.grid(row=0, column=0, columnspan=10)
aad_s1t1_label = tk.Label(entry_panel, text="Atmo. Drag Name")
aad_s1t2_label = tk.Label(entry_panel, text="Vessel Name")
aad_s1t3_label = tk.Label(entry_panel, text="Body Name")
aad_s1t4_label = tk.Label(entry_panel, text="Drag Area")
aad_s1t5_label = tk.Label(entry_panel, text="Drag Coeff.")
aad_s1t6_label = tk.Label(entry_panel, text="Vessel Mass")
aad_s1t7_label = tk.Label(entry_panel, text="Mass AutoUpdate(0/1)")
aad_s1t1_label.grid(row=1, column=1)
aad_s1t2_label.grid(row=1, column=2)
aad_s1t3_label.grid(row=1, column=3)
aad_s1t4_label.grid(row=1, column=4)
aad_s1t5_label.grid(row=1, column=5)
aad_s1t6_label.grid(row=1, column=6)
aad_s1t7_label.grid(row=1, column=7)
aad_s1t1 = tk.Text(entry_panel, width=20, height=1)
aad_s1t2 = tk.Text(entry_panel, width=20, height=1)
aad_s1t3 = tk.Text(entry_panel, width=20, height=1)
aad_s1t4 = tk.Text(entry_panel, width=20, height=1)
aad_s1t5 = tk.Text(entry_panel, width=20, height=1)
aad_s1t6 = tk.Text(entry_panel, width=20, height=1)
aad_s1t7 = tk.Text(entry_panel, width=20, height=1)
aad_s1t1.grid(row=2, column=1)
aad_s1t2.grid(row=2, column=2)
aad_s1t3.grid(row=2, column=3)
aad_s1t4.grid(row=2, column=4)
aad_s1t5.grid(row=2, column=5)
aad_s1t6.grid(row=2, column=6)
aad_s1t7.grid(row=2, column=7)
def generate_s1():
if (aad_s1t1.get("1.0", "end-1c") and aad_s1t2.get("1.0", "end-1c") and aad_s1t3.get("1.0", "end-1c") and aad_s1t4.get("1.0", "end-1c") and
aad_s1t5.get("1.0", "end-1c") and aad_s1t6.get("1.0", "end-1c") and aad_s1t7.get("1.0", "end-1c")):
command = "apply_atmospheric_drag " + aad_s1t1.get("1.0", "end-1c") + " " + aad_s1t2.get("1.0", "end-1c") + " " + aad_s1t3.get("1.0", "end-1c") + " " + aad_s1t4.get("1.0", "end-1c") + " " + aad_s1t5.get("1.0", "end-1c") + " " + aad_s1t6.get("1.0", "end-1c") + " " + aad_s1t7.get("1.0", "end-1c")
add_to_buffer(command)
aad_s1_button = tk.Button(entry_panel, text="Apply Atmo. Drag", command=generate_s1)
aad_s1_button.grid(row=2, column=0)
elif cmd_a == "remove_atmospheric_drag":
rad_help = tk.Label(entry_panel, text="'remove_atmospheric_drag' command removes an atmospheric drag effect from the simulation.")
rad_help.grid(row=0, column=0, columnspan=10)
rad_s1t1_label = tk.Label(entry_panel, text="Atmo. Drag Name")
rad_s1t1_label.grid(row=1, column=1)
rad_s1t1 = tk.Text(entry_panel, width=20, height=1)
rad_s1t1.grid(row=2, column=1)
def generate_s1():
if rad_s1t1.get("1.0","end-1c"):
command = "remove_atmospheric_drag " + rad_s1t1.get("1.0","end-1c")
add_to_buffer(command)
rad_s1_button = tk.Button(entry_panel, text="Remove Atmo. Drag", command=generate_s1)
rad_s1_button.grid(row=2, column=0)
elif cmd_a == "create_projection":
cp_help = tk.Label(entry_panel, text="'create_projection' command creates a 2-body Keplerian orbit projection of an object around a body.")
cp_help.grid(row=0, column=0, columnspan=10)
cp_s1t1_label = tk.Label(entry_panel, text="Projection Name")
cp_s1t2_label = tk.Label(entry_panel, text="Satellite")
cp_s1t3_label = tk.Label(entry_panel, text="Parent Body")
cp_s1t1_label.grid(row=1, column=1)
cp_s1t2_label.grid(row=1, column=2)
cp_s1t3_label.grid(row=1, column=3)
cp_s1t1 = tk.Text(entry_panel, width=20, height=1)
cp_s1t2 = tk.Text(entry_panel, width=20, height=1)
cp_s1t3 = tk.Text(entry_panel, width=20, height=1)
cp_s1t1.grid(row=2, column=1)
cp_s1t2.grid(row=2, column=2)
cp_s1t3.grid(row=2, column=3)
def generate_s1():
if cp_s1t1.get("1.0", "end-1c") and cp_s1t2.get("1.0", "end-1c") and cp_s1t2.get("1.0", "end-1c"):
command = "create_projection " + cp_s1t1.get("1.0", "end-1c") + " " + cp_s1t2.get("1.0", "end-1c") + " " + cp_s1t3.get("1.0", "end-1c")
add_to_buffer(command)
cp_s1_button = tk.Button(entry_panel, text="Create Projection", command=generate_s1)
cp_s1_button.grid(row=2, column=0)
elif cmd_a == "delete_projection":
dp_help = tk.Label(entry_panel, text="'delete_projection' command removes a 2-body Keplerian orbit projection from the simulation.")
dp_help.grid(row=0, column=0, columnspan=10)
dp_s1t1_label = tk.Label(entry_panel, text="Projection Name")
dp_s1t1_label.grid(row=1, column=1)
dp_s1t1 = tk.Text(entry_panel, width=20, height=1)
dp_s1t1.grid(row=2, column=1)
def generate_s1():
if dp_s1t1.get("1.0", "end-1c"):
command = "delete_projection " + dp_s1t1.get("1.0", "end-1c")
add_to_buffer(command)
dp_s1_button = tk.Button(entry_panel, text="Delete Projection", command=generate_s1)
dp_s1_button.grid(row=2, column=0)
elif cmd_a == "update_projection":
up_help = tk.Label(entry_panel, text="'update_projection' command recalculates a 2-body Keplerian orbit projection at current simulation time.")
up_help.grid(row=0, column=0, columnspan=10)
up_s1t1_label = tk.Label(entry_panel, text="Projection Name")
up_s1t1_label.grid(row=1, column=1)
up_s1t1 = tk.Text(entry_panel, width=20, height=1)
up_s1t1.grid(row=2, column=1)
def generate_s1():
if up_s1t1.get("1.0", "end-1c"):
command = "update_projection " + up_s1t1.get("1.0", "end-1c")
add_to_buffer(command)
up_s1_button = tk.Button(entry_panel, text="Update Projection", command=generate_s1)
up_s1_button.grid(row=2, column=0)
elif cmd_a == "create_resource":
crs_help = tk.Label(entry_panel, text="'create_resource' command adds a resource item to the simulation to keep track of resources\nsuch as the stored energy aboard a vessel or the signal strength between vessels.")
crs_help.grid(row=0, column=0, columnspan=10)
# option 1
crs_s1t1_label = tk.Label(entry_panel, text="Resource Name")
crs_s1t2_label = tk.Label(entry_panel, text="Initial Value")
crs_s1t3_label = tk.Label(entry_panel, text="Equation Type")
crs_s1t4_label = tk.Label(entry_panel, text="Variable")
crs_s1t5_label = tk.Label(entry_panel, text="Object 1")
crs_s1t6_label = tk.Label(entry_panel, text="Object 2")
crs_s1t7_label = tk.Label(entry_panel, text="Eqn. Coeffs.")
crs_s1t8_label = tk.Label(entry_panel, text="Value Limits")
crs_s1t1_label.grid(row=1, column=1)
crs_s1t2_label.grid(row=1, column=2)
crs_s1t3_label.grid(row=1, column=3)
crs_s1t4_label.grid(row=1, column=4)
crs_s1t5_label.grid(row=1, column=5)
crs_s1t6_label.grid(row=1, column=6)
crs_s1t7_label.grid(row=1, column=7)
crs_s1t8_label.grid(row=1, column=8)