89 lines
2.3 KiB
C
89 lines
2.3 KiB
C
|
#ifndef MAINWINDOW_H
|
||
|
#define MAINWINDOW_H
|
||
|
|
||
|
#include <QMainWindow>
|
||
|
#include <QCloseEvent>
|
||
|
#include <QDialog>
|
||
|
#include <QButtonGroup>
|
||
|
#include <QScreen>
|
||
|
#include <QListWidget>
|
||
|
#include <QToolTip>
|
||
|
#include <QVBoxLayout>
|
||
|
#include <QHBoxLayout>
|
||
|
#include <QTextStream>
|
||
|
#include <service/serviceloaddb.h>
|
||
|
#include <service/projectlogic.h>
|
||
|
#include <service/filterparams.h>
|
||
|
|
||
|
namespace Ui {
|
||
|
class MainWindow;
|
||
|
}
|
||
|
|
||
|
class MainWindow : public QMainWindow
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
explicit MainWindow(QWidget *parent = nullptr);
|
||
|
~MainWindow();
|
||
|
|
||
|
protected:
|
||
|
void closeEvent(QCloseEvent *event) override;
|
||
|
|
||
|
private:
|
||
|
template <typename T>
|
||
|
void fillTable(const QMap<int, T> &map);
|
||
|
void updateListWidgetDevices(int entityId);
|
||
|
QWidget* createMessageEmptyCard();
|
||
|
QWidget* createDeviceCard(const Project &project);
|
||
|
void addDeviceToList(const Project &project);
|
||
|
void returnToDeviceList();
|
||
|
void showTableWithStructureElements(const QList<DeviceStructureElement>& elements);
|
||
|
void showTableWithDeviceModelCharacteristics(const DeviceModel& model);
|
||
|
void clearFilters();
|
||
|
void clearDevicesOutputSettings();
|
||
|
int getSelectedIndex();
|
||
|
|
||
|
|
||
|
public slots:
|
||
|
void getStages(QMap<int, Stages> &map);
|
||
|
void getTeams(QMap<int, Team> &map);
|
||
|
void getWorkers(QMap<int, Worker> &map);
|
||
|
void getDeviceTypes(QMap<int, DeviceType> &map);
|
||
|
void getDeviceModels(QMap<int, DeviceModel> &map);
|
||
|
void getProjects(QMap<int, Project> &map);
|
||
|
|
||
|
private slots:
|
||
|
void updateTableWidget(int index);
|
||
|
void updateListWidget();
|
||
|
void showItemInfo(QListWidgetItem*);
|
||
|
void changeSortOrder();
|
||
|
void pushButtonBackClicked();
|
||
|
void pushButtonClearClicked();
|
||
|
void pushButtonSearchClicked();
|
||
|
void pushButtonApplyFiltersClicked();
|
||
|
void pushButtonCancelFiltersClicked();
|
||
|
void pushButtonStructureClicked();
|
||
|
void pushButtonCharacteristicsClicked();
|
||
|
void pushButtonDefaultClicked();
|
||
|
|
||
|
private:
|
||
|
Ui::MainWindow *ui;
|
||
|
ProjectLogic *logic;
|
||
|
|
||
|
QString searchInfo = "";
|
||
|
FilterParams filterParams;
|
||
|
|
||
|
int idCard = 0;
|
||
|
|
||
|
QMap<int, QString> deviceTypeImages;
|
||
|
|
||
|
QMap<int, Stages> mapStages;
|
||
|
QMap<int, Worker> mapWorkers;
|
||
|
QMap<int, Team> mapTeams;
|
||
|
QMap<int, DeviceType> mapDeviceTypes;
|
||
|
QMap<int, DeviceModel> mapDeviceModels;
|
||
|
QMap<int, Project> mapDevices;
|
||
|
};
|
||
|
#endif // MAINWINDOW_H
|