Belle II Software development
ProgressPython Class Reference
Inheritance diagram for ProgressPython:

Public Member Functions

def __init__ (self, queue)
 
def initialize (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 queue
 The queue to handle.
 
 event_number
 The current event number.
 
 total_number_of_events
 The total number of events.
 

Detailed Description

A small module that prints every now and then the event number to the given connection.
It is used for status viewers. Do not call it by yourself.

Definition at line 85 of file python_modules.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  queue 
)
 Init the module 

Definition at line 92 of file python_modules.py.

92 def __init__(self, queue):
93 """ Init the module """
94 super().__init__()
95
96 self.queue = queue
97
98 self.event_number = 0
99
100 self.total_number_of_events = 0
101 self.queue.send("init")
102

Member Function Documentation

◆ event()

def event (   self)
 Send the event number to the connection 

Definition at line 111 of file python_modules.py.

111 def event(self):
112 """ Send the event number to the connection """
113 if self.total_number_of_events == 0:
114 return
115
116 current_percentage = 1.0 * self.event_number / self.total_number_of_events
117
118 if 100 * current_percentage % 5 == 0:
119 self.queue.send(current_percentage)
120
121 self.event_number += 1
122

◆ initialize()

def initialize (   self)
 Send start to the connection 

Definition at line 103 of file python_modules.py.

103 def initialize(self):
104 """ Send start to the connection """
105 self.queue.send("start")
106
107 # Receive the total number of events
108
109 self.total_number_of_events = Belle2.Environment.Instance().getNumberOfEvents()
110
static Environment & Instance()
Static method to get a reference to the Environment instance.
Definition: Environment.cc:28

◆ terminate()

def terminate (   self)
 Send stop to the connection 

Definition at line 123 of file python_modules.py.

123 def terminate(self):
124 """ Send stop to the connection """
125 self.queue.send(1)
126 self.queue.send("end")

Member Data Documentation

◆ event_number

event_number

The current event number.

Definition at line 98 of file python_modules.py.

◆ queue

queue

The queue to handle.

Definition at line 96 of file python_modules.py.

◆ total_number_of_events

total_number_of_events

The total number of events.

Definition at line 100 of file python_modules.py.


The documentation for this class was generated from the following file: