hlcc 2.0.0-beta2+pre1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
autoconnect_subtask.AutoconnectProcessesThread Class Reference

Used as a sub-thread of the application window to automatically connect with respective processes instantiated. More...

Inheritance diagram for autoconnect_subtask.AutoconnectProcessesThread:

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.
 

Detailed Description

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

hlcc/software/telsimui/src/hlcc/telsimui/applicationconfguration.py

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

Constructor & Destructor Documentation

◆ __init__()

def autoconnect_subtask.AutoconnectProcessesThread.__init__ (   self,
FacadesManager  facades_manager,
Ui_MainWindow  mainwindow_ui 
)

Constructor.

◆ __del__()

def autoconnect_subtask.AutoconnectProcessesThread.__del__ (   self)

Destructor.

Member Function Documentation

◆ change_state()

def autoconnect_subtask.AutoconnectProcessesThread.change_state (   self,
bool  new_state 
)

Change the running state of the present sub-thread.

◆ check_state()

def autoconnect_subtask.AutoconnectProcessesThread.check_state (   self)

Retrieve current sub-thread running state.

◆ get_autoconnect_period()

def autoconnect_subtask.AutoconnectProcessesThread.get_autoconnect_period (   self)

Get Autoconnect Period.

◆ get_failure_count()

def autoconnect_subtask.AutoconnectProcessesThread.get_failure_count (   self)

Get Autoconnect falure count.

◆ set_autoconnect_label_text()

def autoconnect_subtask.AutoconnectProcessesThread.set_autoconnect_label_text (   self,
  textToSet 
)

Set Autoconnect label text.

◆ set_autoconnect_period()

def autoconnect_subtask.AutoconnectProcessesThread.set_autoconnect_period (   self,
  newPeriod 
)

Set Autoconnect Period.

◆ set_failure_count()

def autoconnect_subtask.AutoconnectProcessesThread.set_failure_count (   self,
  newVal 
)

Set Autoconnect falure count.

◆ stop_event()

def autoconnect_subtask.AutoconnectProcessesThread.stop_event (   self)

Trigger a stop event on the this thread.


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