hlcc 2.0.0-beta2+pre1
|
Used as a sub-thread of the application window to automatically connect with respective processes instantiated. More...
Public Member Functions | |
def | __init__ (self, FacadesManager facades_manager, Ui_MainWindow mainwindow_ui) |
Constructor. | |
def | __del__ (self) |
Destructor. | |
def | change_state (self, bool new_state) |
Change the running state of the present sub-thread. | |
def | check_state (self) |
Retrieve current sub-thread running state. | |
def | stop_event (self) |
Trigger a stop event on the this thread. | |
def | set_autoconnect_period (self, newPeriod) |
Set Autoconnect Period. | |
def | get_autoconnect_period (self) |
Get Autoconnect Period. | |
def | set_failure_count (self, newVal) |
Set Autoconnect falure count. | |
def | get_failure_count (self) |
Get Autoconnect falure count. | |
def | set_autoconnect_label_text (self, textToSet) |
Set Autoconnect label text. | |
Used as a sub-thread of the application window to automatically connect with respective processes instantiated.
Is controlled by a boolean variable.
When 'Server Autoconnect' checkbox is checked in Menu -> Server, the application reconnects to server automatically when the connection is broken.
The autoconnection thread is performed in a loop. At the beginning of each iteration, connection status is checked. When server disconnection is detected, reconnection attempt is made and __failure_count
is increased by 1. Then the autoconnect thread is put to sleep for a duration specified by the variable __sleep_time
(autoconnect period). After the thread wakes up, the process is repeated. Once __failure_count
is equal or greater than max_failure_count
, the autoconnect period (__sleep_time
) is increased by 5 minutes.
max_failure_count
is constant number, calculated with THREAD_SLEEP_TIME which is declared in
Once active connection is confirmed for all facades, __failure_count
is reset to 0, and __sleep_time
is reset to initial default value specified by THREAD_SLEEP_TIME.
Resetting of __failure_count
and __sleep_time
is also made when 'Connect to Server' menu option is selected or 'Server Autoconnect' checkbox is toggled
def autoconnect_subtask.AutoconnectProcessesThread.__init__ | ( | self, | |
FacadesManager | facades_manager, | ||
Ui_MainWindow | mainwindow_ui | ||
) |
Constructor.
def autoconnect_subtask.AutoconnectProcessesThread.__del__ | ( | self | ) |
Destructor.
def autoconnect_subtask.AutoconnectProcessesThread.change_state | ( | self, | |
bool | new_state | ||
) |
Change the running state of the present sub-thread.
def autoconnect_subtask.AutoconnectProcessesThread.check_state | ( | self | ) |
Retrieve current sub-thread running state.
def autoconnect_subtask.AutoconnectProcessesThread.get_autoconnect_period | ( | self | ) |
Get Autoconnect Period.
def autoconnect_subtask.AutoconnectProcessesThread.get_failure_count | ( | self | ) |
Get Autoconnect falure count.
def autoconnect_subtask.AutoconnectProcessesThread.set_autoconnect_label_text | ( | self, | |
textToSet | |||
) |
Set Autoconnect label text.
def autoconnect_subtask.AutoconnectProcessesThread.set_autoconnect_period | ( | self, | |
newPeriod | |||
) |
Set Autoconnect Period.
def autoconnect_subtask.AutoconnectProcessesThread.set_failure_count | ( | self, | |
newVal | |||
) |
Set Autoconnect falure count.
def autoconnect_subtask.AutoconnectProcessesThread.stop_event | ( | self | ) |
Trigger a stop event on the this thread.