mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
report upgrade 0
This commit is contained in:
@@ -9,11 +9,11 @@ kanban-plugin: board
|
|||||||
- [ ] GUI: Сделать кнопку перезапроса общих списков FIM (по аналогии с АММ)
|
- [ ] GUI: Сделать кнопку перезапроса общих списков FIM (по аналогии с АММ)
|
||||||
- [ ] /RUS/Scens/tasksFIM.xml возможно изменится структура
|
- [ ] /RUS/Scens/tasksFIM.xml возможно изменится структура
|
||||||
- [ ] выгрузка назначенных задач с оценками в эксель таблицу или любой другой человекочитаемый вид
|
- [ ] выгрузка назначенных задач с оценками в эксель таблицу или любой другой человекочитаемый вид
|
||||||
- [ ] FIM процедура добавить кнопку сделать новой
|
|
||||||
|
|
||||||
|
|
||||||
## Completed
|
## Completed
|
||||||
|
|
||||||
|
- [ ] FIM процедура добавить кнопку сделать новой
|
||||||
- [ ] Не видно новых пришедших сообщений, если выбран другой Юзер
|
- [ ] Не видно новых пришедших сообщений, если выбран другой Юзер
|
||||||
- [ ] При смене УЗ в ГУИ остается история переписки в мессенджере. При этом Имя инструктора в диалоге подменяется. (Путается только в ГУИ!)
|
- [ ] При смене УЗ в ГУИ остается история переписки в мессенджере. При этом Имя инструктора в диалоге подменяется. (Путается только в ГУИ!)
|
||||||
[Возможно, поможет переинициализация мессенджера при переавторизации инструктора?]
|
[Возможно, поможет переинициализация мессенджера при переавторизации инструктора?]
|
||||||
|
|||||||
@@ -136,6 +136,18 @@ add_library(InstructorsAndTrainees SHARED
|
|||||||
tasks/subprocitemwidget.h
|
tasks/subprocitemwidget.h
|
||||||
tasks/subprocitemwidget.ui
|
tasks/subprocitemwidget.ui
|
||||||
|
|
||||||
|
tasks/reportfimwidget.cpp
|
||||||
|
tasks/reportfimwidget.h
|
||||||
|
tasks/reportfimwidget.ui
|
||||||
|
|
||||||
|
tasks/actionwidget.cpp
|
||||||
|
tasks/actionwidget.h
|
||||||
|
tasks/actionwidget.ui
|
||||||
|
|
||||||
|
tasks/devicewidget.cpp
|
||||||
|
tasks/devicewidget.h
|
||||||
|
tasks/devicewidget.ui
|
||||||
|
|
||||||
widgets/waitanimationwidget.cpp
|
widgets/waitanimationwidget.cpp
|
||||||
widgets/waitanimationwidget.h
|
widgets/waitanimationwidget.h
|
||||||
widgets/waitanimationwidget.ui
|
widgets/waitanimationwidget.ui
|
||||||
|
|||||||
57
LibInstructorsAndTrainees/tasks/actionwidget.cpp
Normal file
57
LibInstructorsAndTrainees/tasks/actionwidget.cpp
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#include <QStyle>
|
||||||
|
#include "actionwidget.h"
|
||||||
|
#include "ui_actionwidget.h"
|
||||||
|
|
||||||
|
ActionWidget::ActionWidget(QWidget *parent) :
|
||||||
|
QWidget(parent),
|
||||||
|
ui(new Ui::ActionWidget)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ui->lbl_Type->setObjectName("ActionWidget_lbl_Type");
|
||||||
|
ui->lbl_Status->setObjectName("ActionWidget_lbl_Status");
|
||||||
|
ui->plainTextEdit_Procedure->setObjectName("ActionWidget_plainTextEdit_Procedure");
|
||||||
|
ui->plainTextEdit_Comment->setObjectName("ActionWidget_plainTextEdit_Comment");
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionWidget::~ActionWidget()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActionWidget::setItem(FIMReportItem item)
|
||||||
|
{
|
||||||
|
QString str;
|
||||||
|
|
||||||
|
/*
|
||||||
|
//Item ID
|
||||||
|
str = QString("<p>Item ID: %1</p>").arg(QString::number(item.id));
|
||||||
|
ui->plainTextEdit_Procedure->appendHtml(str);
|
||||||
|
*/
|
||||||
|
|
||||||
|
//AMM/FIM
|
||||||
|
ui->lbl_Type->setText(item.procedure.doc);
|
||||||
|
|
||||||
|
//Title
|
||||||
|
str = QString("<p style=\"color:blue;\">%1</p>").arg(item.procedure.title);
|
||||||
|
ui->plainTextEdit_Procedure->appendHtml(str);
|
||||||
|
|
||||||
|
//DMcode
|
||||||
|
str = QString("<p style=\"color:gray;\">%1</p>").arg(item.procedure.dmCode);
|
||||||
|
ui->plainTextEdit_Procedure->appendHtml(str);
|
||||||
|
|
||||||
|
//Result
|
||||||
|
str = item.procedure.result;
|
||||||
|
if(str == "viewed")
|
||||||
|
str = tr("viewed");
|
||||||
|
else if(str == "completed")
|
||||||
|
{
|
||||||
|
str = tr("completed");
|
||||||
|
ui->lbl_Status->setStyleSheet("color: white; background: #2d5585;");
|
||||||
|
}
|
||||||
|
ui->lbl_Status->setText(str);
|
||||||
|
|
||||||
|
//Text
|
||||||
|
str = QString("<p style=\"color:gray;\">%1</p>").arg(item.text);
|
||||||
|
ui->plainTextEdit_Comment->appendHtml(str);
|
||||||
|
}
|
||||||
25
LibInstructorsAndTrainees/tasks/actionwidget.h
Normal file
25
LibInstructorsAndTrainees/tasks/actionwidget.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef ACTIONWIDGET_H
|
||||||
|
#define ACTIONWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include "tasksAmmFim.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ActionWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ActionWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ActionWidget(QWidget *parent = nullptr);
|
||||||
|
~ActionWidget();
|
||||||
|
|
||||||
|
void setItem(FIMReportItem item);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ActionWidget *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ACTIONWIDGET_H
|
||||||
140
LibInstructorsAndTrainees/tasks/actionwidget.ui
Normal file
140
LibInstructorsAndTrainees/tasks/actionwidget.ui
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ActionWidget</class>
|
||||||
|
<widget class="QWidget" name="ActionWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>539</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_Main">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_L">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_Status">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Status</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_Type">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_Type">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Type</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="plainTextEdit_Procedure">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="plainTextEdit_Comment">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -4,12 +4,14 @@
|
|||||||
#include "fimtaskswidget.h"
|
#include "fimtaskswidget.h"
|
||||||
#include "ammtaskswidget.h"
|
#include "ammtaskswidget.h"
|
||||||
|
|
||||||
|
|
||||||
CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, TypeChecker type, QWidget *parent) :
|
CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, TypeChecker type, QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::CheckerTask),
|
ui(new Ui::CheckerTask),
|
||||||
connectorToServer(connectorToServer),
|
connectorToServer(connectorToServer),
|
||||||
fimTasksWidget(nullptr),
|
fimTasksWidget(nullptr),
|
||||||
ammTasksWidget(nullptr),
|
ammTasksWidget(nullptr),
|
||||||
|
reportFimWidget(nullptr),
|
||||||
flChanged(false),
|
flChanged(false),
|
||||||
id_task(0),
|
id_task(0),
|
||||||
type(TypeChecker::fim_check)
|
type(TypeChecker::fim_check)
|
||||||
@@ -34,6 +36,9 @@ CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, TypeChecker type,
|
|||||||
|
|
||||||
ui->plainText->setReadOnly(true);
|
ui->plainText->setReadOnly(true);
|
||||||
ui->plainText->setObjectName("plainText");
|
ui->plainText->setObjectName("plainText");
|
||||||
|
|
||||||
|
reportFimWidget = new ReportFimWidget(this);
|
||||||
|
ui->horizontalLayout_ReportWidget->addWidget(reportFimWidget);
|
||||||
}
|
}
|
||||||
else if(type == TypeChecker::amm_check)
|
else if(type == TypeChecker::amm_check)
|
||||||
{
|
{
|
||||||
@@ -44,13 +49,15 @@ CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, TypeChecker type,
|
|||||||
ui->lblDMcode->setVisible(false);
|
ui->lblDMcode->setVisible(false);
|
||||||
|
|
||||||
ui->plainText->setVisible(false);
|
ui->plainText->setVisible(false);
|
||||||
ui->label->setVisible(false);
|
ui->groupBox_Report->setVisible(false);
|
||||||
|
|
||||||
ui->btnWrong->setEnabled(false);
|
ui->btnWrong->setEnabled(false);
|
||||||
ui->btnCheckup->setEnabled(false);
|
ui->btnCheckup->setEnabled(false);
|
||||||
ui->btnWrong->setVisible(false);
|
ui->btnWrong->setVisible(false);
|
||||||
ui->btnCheckup->setVisible(false);
|
ui->btnCheckup->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->plainText->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckerTask::~CheckerTask()
|
CheckerTask::~CheckerTask()
|
||||||
@@ -67,6 +74,12 @@ CheckerTask::~CheckerTask()
|
|||||||
ammTasksWidget = nullptr;
|
ammTasksWidget = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(reportFimWidget)
|
||||||
|
{
|
||||||
|
delete reportFimWidget;
|
||||||
|
reportFimWidget = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,6 +101,8 @@ void CheckerTask::setTask(TaskAmmFim* task)
|
|||||||
//Репорт
|
//Репорт
|
||||||
outReport(this->task.report);
|
outReport(this->task.report);
|
||||||
|
|
||||||
|
reportFimWidget->setReport(this->task.report);
|
||||||
|
|
||||||
if(this->task.status == "new")
|
if(this->task.status == "new")
|
||||||
{
|
{
|
||||||
ui->btnNew->setEnabled(false);
|
ui->btnNew->setEnabled(false);
|
||||||
@@ -96,7 +111,7 @@ void CheckerTask::setTask(TaskAmmFim* task)
|
|||||||
ui->btnCompleted->setEnabled(false);
|
ui->btnCompleted->setEnabled(false);
|
||||||
|
|
||||||
ui->plainText->setVisible(false);
|
ui->plainText->setVisible(false);
|
||||||
ui->label->setVisible(false);
|
ui->groupBox_Report->setVisible(false);
|
||||||
}
|
}
|
||||||
else if(this->task.status == "checkup")
|
else if(this->task.status == "checkup")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "connectortoserver.h"
|
#include "connectortoserver.h"
|
||||||
#include "specialmessagebox.h"
|
#include "specialmessagebox.h"
|
||||||
|
#include "reportfimwidget.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class CheckerTask;
|
class CheckerTask;
|
||||||
@@ -60,6 +61,8 @@ private:
|
|||||||
FIMtasksWidget* fimTasksWidget;
|
FIMtasksWidget* fimTasksWidget;
|
||||||
AMMtasksWidget* ammTasksWidget;
|
AMMtasksWidget* ammTasksWidget;
|
||||||
|
|
||||||
|
ReportFimWidget* reportFimWidget;
|
||||||
|
|
||||||
bool flChanged;
|
bool flChanged;
|
||||||
int id_task;
|
int id_task;
|
||||||
TypeChecker type;
|
TypeChecker type;
|
||||||
|
|||||||
@@ -109,36 +109,45 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QGroupBox" name="groupBox_Report">
|
||||||
<property name="text">
|
<property name="title">
|
||||||
<string>Completion Report</string>
|
<string>Completion Report</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>100</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QPlainTextEdit" name="plainText">
|
<layout class="QVBoxLayout" name="verticalLayout_Report">
|
||||||
<property name="sizePolicy">
|
<item>
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<widget class="QWidget" name="widget" native="true">
|
||||||
<horstretch>0</horstretch>
|
<property name="minimumSize">
|
||||||
<verstretch>0</verstretch>
|
<size>
|
||||||
</sizepolicy>
|
<width>0</width>
|
||||||
</property>
|
<height>100</height>
|
||||||
<property name="minimumSize">
|
</size>
|
||||||
<size>
|
</property>
|
||||||
<width>0</width>
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<height>0</height>
|
<item row="0" column="0">
|
||||||
</size>
|
<widget class="QPlainTextEdit" name="plainText">
|
||||||
</property>
|
<property name="sizePolicy">
|
||||||
</widget>
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_ReportWidget"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -147,6 +156,22 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Minimum</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
73
LibInstructorsAndTrainees/tasks/devicewidget.cpp
Normal file
73
LibInstructorsAndTrainees/tasks/devicewidget.cpp
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#include "devicewidget.h"
|
||||||
|
#include "ui_devicewidget.h"
|
||||||
|
|
||||||
|
DeviceWidget::DeviceWidget(QWidget *parent) :
|
||||||
|
QWidget(parent),
|
||||||
|
ui(new Ui::DeviceWidget)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ui->lbl_Status->setObjectName("DeviceWidget_lbl_Status");
|
||||||
|
ui->lbl_ObjName->setObjectName("DeviceWidget_lbl_ObjName");
|
||||||
|
ui->lbl_Code->setObjectName("DeviceWidget_lbl_Code");
|
||||||
|
}
|
||||||
|
|
||||||
|
DeviceWidget::~DeviceWidget()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeviceWidget::setItem(FIMReportWarehouseItem whItem)
|
||||||
|
{
|
||||||
|
//QString str;
|
||||||
|
|
||||||
|
//WhItem ID
|
||||||
|
//str = QString("<p>WhItem ID: %1</p>").arg(QString::number(whItem.id));
|
||||||
|
|
||||||
|
// статус GameObject-а в сцене
|
||||||
|
ui->lbl_Status->setText(getStatusStr(whItem.status));
|
||||||
|
setStyleStatusLabel(whItem.status);
|
||||||
|
|
||||||
|
// имя GameObject-а в сцене
|
||||||
|
//str = QString("<p>%1</p>").arg(whItem.goName);
|
||||||
|
|
||||||
|
// человеческое название прибора
|
||||||
|
ui->lbl_ObjName->setText(whItem.objName);
|
||||||
|
|
||||||
|
// его код из документации
|
||||||
|
ui->lbl_Code->setText(whItem.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DeviceWidget::getStatusStr(int status)
|
||||||
|
{
|
||||||
|
switch (status)
|
||||||
|
{
|
||||||
|
//демонтировано
|
||||||
|
case 0: return tr("dismantled");
|
||||||
|
//неисправно
|
||||||
|
case 1: return tr("faulty");
|
||||||
|
//заменено на новое со склада
|
||||||
|
case 2: return tr("replaced with a new one from the warehouse");
|
||||||
|
//unknown
|
||||||
|
default: return "unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeviceWidget::setStyleStatusLabel(int status)
|
||||||
|
{
|
||||||
|
switch (status)
|
||||||
|
{
|
||||||
|
//демонтировано
|
||||||
|
case 0: ui->lbl_Status->setStyleSheet("color: brown;");
|
||||||
|
break;
|
||||||
|
//неисправно
|
||||||
|
case 1: ui->lbl_Status->setStyleSheet("color: red;");
|
||||||
|
break;
|
||||||
|
//заменено на новое со склада
|
||||||
|
case 2: ui->lbl_Status->setStyleSheet("color: green;");
|
||||||
|
break;
|
||||||
|
//unknown
|
||||||
|
default: ui->lbl_Status->setStyleSheet("color: black;");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
29
LibInstructorsAndTrainees/tasks/devicewidget.h
Normal file
29
LibInstructorsAndTrainees/tasks/devicewidget.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef DEVICEWIDGET_H
|
||||||
|
#define DEVICEWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include "tasksAmmFim.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class DeviceWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
class DeviceWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit DeviceWidget(QWidget *parent = nullptr);
|
||||||
|
~DeviceWidget();
|
||||||
|
|
||||||
|
void setItem(FIMReportWarehouseItem whItem);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString getStatusStr(int status);
|
||||||
|
void setStyleStatusLabel(int status);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::DeviceWidget *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DEVICEWIDGET_H
|
||||||
81
LibInstructorsAndTrainees/tasks/devicewidget.ui
Normal file
81
LibInstructorsAndTrainees/tasks/devicewidget.ui
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>DeviceWidget</class>
|
||||||
|
<widget class="QWidget" name="DeviceWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_Main">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_L">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_Status">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Status</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_R">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_ObjName">
|
||||||
|
<property name="text">
|
||||||
|
<string>ObjName</string>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_Code">
|
||||||
|
<property name="text">
|
||||||
|
<string>Code</string>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
61
LibInstructorsAndTrainees/tasks/reportfimwidget.cpp
Normal file
61
LibInstructorsAndTrainees/tasks/reportfimwidget.cpp
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
#include "reportfimwidget.h"
|
||||||
|
#include "ui_reportfimwidget.h"
|
||||||
|
#include "actionwidget.h"
|
||||||
|
#include "devicewidget.h"
|
||||||
|
|
||||||
|
ReportFimWidget::ReportFimWidget(QWidget *parent) :
|
||||||
|
QWidget(parent),
|
||||||
|
ui(new Ui::ReportFimWidget)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
ui->checkBox_MMEL->setCheckable(false);
|
||||||
|
|
||||||
|
ui->label_MMEL->setObjectName("ReportFimWidget_label_MMEL");
|
||||||
|
}
|
||||||
|
|
||||||
|
ReportFimWidget::~ReportFimWidget()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportFimWidget::setReport(FIMReport report)
|
||||||
|
{
|
||||||
|
QString str;
|
||||||
|
|
||||||
|
//Действия обучаемого
|
||||||
|
if(!report.itemList.count())
|
||||||
|
ui->label_Actions->setVisible(false);
|
||||||
|
for(FIMReportItem item : report.itemList)
|
||||||
|
{
|
||||||
|
ActionWidget* actionW = new ActionWidget(this);
|
||||||
|
ui->verticalLayout_Actions->addWidget(actionW);
|
||||||
|
actionW->setMaximumHeight(100);
|
||||||
|
actionW->setItem(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Устройства/приборы
|
||||||
|
bool flNeedMMEL = false;
|
||||||
|
if(!report.warehouseItemList.count())
|
||||||
|
ui->label_Devices->setVisible(false);
|
||||||
|
for(FIMReportWarehouseItem whItem : report.warehouseItemList)
|
||||||
|
{
|
||||||
|
DeviceWidget* deviceW = new DeviceWidget(this);
|
||||||
|
ui->verticalLayout_Devices->addWidget(deviceW);
|
||||||
|
//deviceW->setMaximumHeight(50);
|
||||||
|
deviceW->setItem(whItem);
|
||||||
|
|
||||||
|
if(whItem.status == 0)
|
||||||
|
flNeedMMEL = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(flNeedMMEL)
|
||||||
|
{
|
||||||
|
ui->checkBox_MMEL->setChecked(report.mmel);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->checkBox_MMEL->setVisible(false);
|
||||||
|
ui->label_MMEL->setVisible(false);
|
||||||
|
ui->label_MMEL_text->setVisible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
25
LibInstructorsAndTrainees/tasks/reportfimwidget.h
Normal file
25
LibInstructorsAndTrainees/tasks/reportfimwidget.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef REPORTFIMWIDGET_H
|
||||||
|
#define REPORTFIMWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include "tasksAmmFim.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ReportFimWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ReportFimWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ReportFimWidget(QWidget *parent = nullptr);
|
||||||
|
~ReportFimWidget();
|
||||||
|
|
||||||
|
void setReport(FIMReport report);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ReportFimWidget *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // REPORTFIMWIDGET_H
|
||||||
109
LibInstructorsAndTrainees/tasks/reportfimwidget.ui
Normal file
109
LibInstructorsAndTrainees/tasks/reportfimwidget.ui
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ReportFimWidget</class>
|
||||||
|
<widget class="QWidget" name="ReportFimWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_Main">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_Actions">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Trainee's actions:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_Actions"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_Devices">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Devices/instruments:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_Devices"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_MMEL" native="true">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0" rowspan="2" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_MMEL">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox_MMEL">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_MMEL">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>MMEL</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_MMEL_text">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>The aircraft may operate with its equipment removed in accordance with the "Master Minimum Equipment List"</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Reference in New Issue
Block a user