ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | List of all members
python.iconfTool.gui.wrappers.DoublePad Class Reference
Collaboration diagram for python.iconfTool.gui.wrappers.DoublePad:

Public Member Functions

None __init__ (self, ComponentsDiffFileLoader data_loader)
 
None load_gui (self)
 
def search (self)
 
None refresh_whole_screen (self)
 
None change_actual_pad (self)
 
def show_help (self)
 

Public Attributes

 diff_structure
 
 width
 
 window
 
 pad
 
 diff_pad
 
 pad_height
 
 inactive_pad
 
 screen
 

Private Member Functions

None _initialize_window (self)
 
None _initialize (self, stdscreen)
 
None _start_event_loop (self)
 

Detailed Description

Definition at line 100 of file wrappers.py.

Constructor & Destructor Documentation

◆ __init__()

None python.iconfTool.gui.wrappers.DoublePad.__init__ (   self,
ComponentsDiffFileLoader  data_loader 
)

Definition at line 101 of file wrappers.py.

101  def __init__(self, data_loader: ComponentsDiffFileLoader) -> None:
102  self.data_loader: ComponentsDiffFileLoader = data_loader
103  self.data_structure: ComponentsStructure
104  self.diff_structure: ComponentsStructure
105  self.data_structure, self.diff_structure = self.data_loader.get_data()
106  self.width: int = 0
107  self.height: int = 0
108  self.pad_height: int = 0
109  self.pad: Pad
110  self.diff_pad: Pad
111  self.current_pad: Pad
112  self.inactive_pad: Pad
113  self.actual_offset: int = 0
114  self.screen: Any
115  self.show_diff_only: bool = False
116 

Member Function Documentation

◆ _initialize()

None python.iconfTool.gui.wrappers.DoublePad._initialize (   self,
  stdscreen 
)
private

Definition at line 135 of file wrappers.py.

135  def _initialize(self, stdscreen) -> None:
136  self.screen = stdscreen
137  self.screen.refresh()
138  self._initialize_window()
139  self._start_event_loop()
140 

◆ _initialize_window()

None python.iconfTool.gui.wrappers.DoublePad._initialize_window (   self)
private

Definition at line 117 of file wrappers.py.

117  def _initialize_window(self) -> None:
118  self.height, self.width = self.screen.getmaxyx()
119  self.window = curses.newwin(self.height, self.width, 0, 0)
120  self.pad = Pad(
121  self.data_structure, int(self.width / 2 - 1), self.height
122  )
123  self.diff_pad = Pad(
124  self.diff_structure,
125  int(self.width / 2) - 1,
126  self.height,
127  int(self.width / 2) + 2,
128  )
129  self.pad_height = self.height - 1
130  self.current_pad, self.inactive_pad = self.pad, self.diff_pad
131  self.diff_pad.hide_cursor()
132  self.diff_pad.refresh()
133  self.pad.refresh()
134 

◆ _start_event_loop()

None python.iconfTool.gui.wrappers.DoublePad._start_event_loop (   self)
private

Definition at line 190 of file wrappers.py.

190  def _start_event_loop(self) -> None:
191  self.show_help()
192  while True:
193  event = self.screen.getch()
194  logger.debug(f"Key pressed: [{event}, {chr(event)}]")
195  if event == ord("q"):
196  break
197  elif event == ord("\t"):
198  self.change_actual_pad()
199  elif event == ord("h"):
200  self.show_help()
201  elif event == ord("m"):
202  self.search()
203  elif event == ord("r"):
204  self.pad.clear()
205  self.diff_pad.clear()
206  (
207  self.data_structure,
208  self.diff_structure,
209  ) = self.data_loader.get_data()
210  self.pad.reload_data(self.data_structure)
211  self.diff_pad.reload_data(self.diff_structure)
212 
213  self.pad.redraw()
214  self.diff_pad.redraw()
215 
216  else:
217  self.current_pad.handle_event(event)

◆ change_actual_pad()

None python.iconfTool.gui.wrappers.DoublePad.change_actual_pad (   self)

Definition at line 164 of file wrappers.py.

164  def change_actual_pad(self) -> None:
165  if self.inactive_pad.lines_empty():
166  return
167  self.current_pad.hide_cursor()
168  self.current_pad, self.inactive_pad = (
169  self.inactive_pad,
170  self.current_pad,
171  )
172  self.inactive_pad.refresh()
173  self.current_pad.refresh()
174  self.current_pad.show_cursor()
175 

◆ load_gui()

None python.iconfTool.gui.wrappers.DoublePad.load_gui (   self)

Definition at line 141 of file wrappers.py.

141  def load_gui(self) -> None:
142  curses.wrapper(self._initialize)
143 

◆ refresh_whole_screen()

None python.iconfTool.gui.wrappers.DoublePad.refresh_whole_screen (   self)

Definition at line 159 of file wrappers.py.

159  def refresh_whole_screen(self) -> None:
160  self.window.refresh()
161  self.current_pad.refresh()
162  self.inactive_pad.refresh()
163 

◆ search()

def python.iconfTool.gui.wrappers.DoublePad.search (   self)

Definition at line 144 of file wrappers.py.

144  def search(self):
145  search_size: int = 50
146  b_starty: int = 0
147  b_startx: int = self.width - search_size - 2
148  b_width: int = search_size
149  b_height: int = 3
150  cursor_pos: Tuple[int, int] = curses.getsyx()
151  search: SearchModal = SearchModal(
152  b_startx, b_starty, b_width, b_height
153  )
154  text: str = search.edit()
155  curses.setsyx(cursor_pos[0], cursor_pos[1])
156  self.current_pad.filter(text)
157  self.inactive_pad.filter(text)
158 

◆ show_help()

def python.iconfTool.gui.wrappers.DoublePad.show_help (   self)

Definition at line 176 of file wrappers.py.

176  def show_help(self):
177  search_size: int = 60
178  b_width: int = search_size
179  b_height: int = 17
180  b_starty: int = self.screen.getmaxyx()[0] - b_height
181  b_startx: int = self.width - search_size - 2
182  cursor_pos: Tuple[int, int] = curses.getsyx()
183  search: DoubleHelpModal = DoubleHelpModal(
184  b_startx, b_starty, b_width, b_height
185  )
186  curses.setsyx(*cursor_pos)
187  search.show_help()
188  self.current_pad.initialize_cursor()
189 

Member Data Documentation

◆ diff_pad

python.iconfTool.gui.wrappers.DoublePad.diff_pad

Definition at line 123 of file wrappers.py.

◆ diff_structure

python.iconfTool.gui.wrappers.DoublePad.diff_structure

Definition at line 105 of file wrappers.py.

◆ inactive_pad

python.iconfTool.gui.wrappers.DoublePad.inactive_pad

Definition at line 130 of file wrappers.py.

◆ pad

python.iconfTool.gui.wrappers.DoublePad.pad

Definition at line 120 of file wrappers.py.

◆ pad_height

python.iconfTool.gui.wrappers.DoublePad.pad_height

Definition at line 129 of file wrappers.py.

◆ screen

python.iconfTool.gui.wrappers.DoublePad.screen

Definition at line 136 of file wrappers.py.

◆ width

python.iconfTool.gui.wrappers.DoublePad.width

Definition at line 118 of file wrappers.py.

◆ window

python.iconfTool.gui.wrappers.DoublePad.window

Definition at line 119 of file wrappers.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
search
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Definition: hcg.cxx:738
covarianceTool.filter
filter
Definition: covarianceTool.py:514
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
Pad
Definition: Pad.h:10