-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNLET.py
More file actions
executable file
·175 lines (127 loc) · 6.03 KB
/
NLET.py
File metadata and controls
executable file
·175 lines (127 loc) · 6.03 KB
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
#!/usr/bin/python
import string
import glob
import os
import subprocess
import time
from pickle import dump, load
# Import GTK stuff
import pygtk
import gobject
pygtk.require('2.0')
import gtk
import numpy as np
import LTCTI_Window
import PITCHMAN_Window
class TrackEventsGUI:
#================== Other Class Methods ================================
#======================CALLBACKS========================================
#-----------------------------------------------------------------------
#
# call back function when the window is closed or when quit button is
# pressed.
#
#-----------------------------------------------------------------------
def QuitButtonCallback(self, widget,string):
gtk.main_quit()
return False
#-------------------------------------------------------------------------------
#
# GObuttoncallback - Captures all text entry fields.
# Determines if this is a test run or for real run;
# then determines which event to process
# and then calls the appropriate method to process the events.
#
#-------------------------------------------------------------------------------
def GOButtonCallback(self, widget, data = None):
# Figure out which radio button the user had clicked upon and bring up
# the appropriate window. Or, in the case of "Cancel" do nothing.
# ---- PITCH CHANGE MANEUVER
if self.ECbuttonPITCHMAN.get_active() == True:
PITCHMAN.Pop_UP_MAN_Window()
# ---- LONG TERM CTI RUN
elif self.ECbuttonLTCTICAP.get_active() == True:
LTCTI.Pop_UP_LTCTI_Window()
# ---- SOME OTHER CAP
#elif self.ECbuttonOTHERCAP.get_active() == True:
# OTHERCLD.Pop_UP_OTHERCLD_Window()
# ---- Some weirdo ANOMALOUS EVENT
# elif self.ECbuttonANOMALOUSEVENT.get_active() == True:
# self.ProcessNonCTI(self.Event_Tracking_output_filespec, "Anomaly", date, '---', description, "Final")
#=======================MAIN=============================================
def __init__(self):
self.CLDfile_filespec = ""
self.CAP_Number = 0
self.Event_Tracking_output_filespec = "/data/acis/LoadReviews/EventsTrack.txt"
#
# 1111 WINDOW Basic Window Creation - Create a new window
self.BuildEVENTTRACKERWindow = gtk.Window(gtk.WINDOW_TOPLEVEL)
# set the title and size of the window.
self.BuildEVENTTRACKERWindow.set_title("Event Tracker V1.0")
self.BuildEVENTTRACKERWindow.set_size_request(1000,500)
self.BuildEVENTTRACKERWindow.set_border_width(10)
# set a handler for delete event that immediately exits GTK.
self.BuildEVENTTRACKERWindow.connect("delete_event", self.QuitButtonCallback)
# 2222 VBOX Create Vertical box to hold the toolbar and the plot
# The first row will hold the toolbar
# The second row item will contain the plotting area
self.BuildEVENTTRACKERWindowBox = gtk.VBox(False, 20)
# 3333 - EVENT CHOICE RADIO GROUP - create the event choice radio
# button group that allows the user to select the event
# Long Term CTI CAP
self.ECbuttonLTCTICAP = gtk.RadioButton(None, "Long Term CTI Cap")
self.ECbuttonLTCTICAP.set_active(False)
self.BuildEVENTTRACKERWindowBox.pack_start(self.ECbuttonLTCTICAP, False, False, 0)
# Other CAP
self.ECbuttonOTHERCAP = gtk.RadioButton(self.ECbuttonLTCTICAP, "Other Cap (Future enhancement)")
self.ECbuttonOTHERCAP.set_active(False)
self.BuildEVENTTRACKERWindowBox.pack_start(self.ECbuttonOTHERCAP, False, False, 0)
# Pitch Maneuver
self.ECbuttonPITCHMAN = gtk.RadioButton(self.ECbuttonLTCTICAP, "Maneuver")
self.ECbuttonPITCHMAN.set_active(False)
self.BuildEVENTTRACKERWindowBox.pack_start(self.ECbuttonPITCHMAN, False, False, 0)
# Anomalous Event
self.ECbuttonANOMALOUSEVENT = gtk.RadioButton(self.ECbuttonPITCHMAN, "Anomalous Event (Future enhancement)")
self.ECbuttonANOMALOUSEVENT.set_active(False)
self.BuildEVENTTRACKERWindowBox.pack_start(self.ECbuttonANOMALOUSEVENT, False, False, 0)
# 5555 - TABLE for Text Entries
self.TextEntry_Table = gtk.Table(10,3, True)
start_row = 0
start_col = 0
# -------------------- FOR REAL CANCEL BUTTON -------------------------
# 5555c - BUTTON For Real Cancel button
self.CANCELbutton = gtk.Button("Cancel")
self.CANCELbutton.connect("clicked", self.QuitButtonCallback, "CANCEL")
self.TextEntry_Table.attach(self.CANCELbutton,
start_col, start_col + 1,
start_row, start_row + 1)
# -------------------- SELECT GO BUTTON -------------------------
start_col = 14
# 5555c - BUTTON Go button
self.GObutton = gtk.Button("Select")
self.GObutton.connect("clicked", self.GOButtonCallback, "SELECT")
self.TextEntry_Table.attach(self.GObutton,
start_col, start_col + 1,
start_row, start_row + 1)
# 5555 - Add the table to the VBOX
self.BuildEVENTTRACKERWindowBox.pack_start(self.TextEntry_Table)
# Add the VBox to the window box
self.BuildEVENTTRACKERWindow.add(self.BuildEVENTTRACKERWindowBox)
# 1111 Done creating the BuildEVENTTRACKER Window. Show it.
self.BuildEVENTTRACKERWindow.show_all()
def main():
#
# Drop into the GTK infinite loop
#
gtk.main()
if __name__ == "__main__":
# Initialize a number of characteristics
# Create the GUI
EVENTTRACKERGUI = TrackEventsGUI()
# Instance of the Long Term CTI Handler class
LTCTI = LTCTI_Window.LTCTI()
# Instance of the "Other" CLD Handler class
# OTHERCLD = OTHERCLD_Window.OTHERCLD()
# Instance of the Manueuver Handler class
PITCHMAN = PITCHMAN_Window.PITCHMAN()
main()