hamyar_paygah.controllers.widgets.personnel_analyzer_tab_controller

Controller for the personnel analyzer tab.

Attributes

COUNT_PERSIAN_TEXT

Persian text for the word (count)

Classes

PersonnelAnalyzerTab

Tab that analyzes the personnel and shows its details.

Module Contents

hamyar_paygah.controllers.widgets.personnel_analyzer_tab_controller.COUNT_PERSIAN_TEXT: str = 'تعداد'

Persian text for the word (count)

class hamyar_paygah.controllers.widgets.personnel_analyzer_tab_controller.PersonnelAnalyzerTab

Bases: PySide6.QtWidgets.QWidget

Tab that analyzes the personnel and shows its details.

ui
_populate_region_picker()

Populates the region picker with regions dictionary.

Return type:

None

on_from_date_picker_userDateChanged(new_date)

Ensure from date is always equal or less than the to date.

Parameters:

new_date (PySide6.QtCore.QDate) – User input date when from date picker is changed.

Return type:

None

on_to_date_picker_userDateChanged(new_date)

Ensure to date is always equal or more that the from date.

Parameters:

new_date (PySide6.QtCore.QDate) – User input date when to date picker is changed.

Return type:

None

async on_load_button_clicked()

Dynamically load the missions list from the server and build the tabs based on it.

Return type:

None

_clear_data()

Clears all the fields and checkboxes in the UI.

Return type:

None

async _build_tabs(missions_list)

Build dynamic tabs per personnel and one overall tab.

Parameters:

missions_list (list[hamyar_paygah.models.mission_model.Mission])

Return type:

None

async _group_missions_by_personnel_code(missions_list)

Groups the missions by personnel code.

Parameters:

missions_list (list[Mission]) – List of missions to be grouped.

Returns:

A dictionary where the keys are personnel codes and the values are lists of missions.

Return type:

dict[int, list[Mission]]

_sorted_counter(counter)
Parameters:

counter (collections.Counter[Any])

Return type:

list[tuple[str, int]]

async _create_summary_widget(missions_list)

Create a simple summary display widget for a mission list.

Parameters:

missions_list (list[hamyar_paygah.models.mission_model.Mission])

Return type:

PySide6.QtWidgets.QWidget | None

async _summarize_missions(missions_list)

Compute basic statistics from the missions list.

Parameters:

missions_list (list[hamyar_paygah.models.mission_model.Mission])

Return type:

dict[str, int | list[tuple[str, int]] | collections.Counter[Any]] | None

async _process_missions(missions_list, progress_callback)

Process missions asynchronously with progress reporting.

Parameters:
Return type:

dict[str, int | list[tuple[Any, int]] | collections.Counter[Any]]

_populate_missions_per_code_table(missions_per_code, ui)

Populate the missions per code table with the given data.

Parameters:
Return type:

None