mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
statAMM statFIM в Перс Карте
This commit is contained in:
@@ -103,19 +103,19 @@ void PersonalCardTrainee::loadInfo()
|
||||
ui->lblTimeExit->setText(timing.getExitTimeS());
|
||||
}
|
||||
|
||||
void PersonalCardTrainee::slot_countTasksAMMforTraineeChanged(int trainee_id, int count)
|
||||
void PersonalCardTrainee::slot_countTasksAMMforTraineeChanged(int trainee_id, QString statAMM)
|
||||
{
|
||||
if(id_trainee == trainee_id)
|
||||
{
|
||||
ui->lblCntAMM->setText(QString::number(count));
|
||||
ui->lblCntAMM->setText(statAMM);
|
||||
}
|
||||
}
|
||||
|
||||
void PersonalCardTrainee::slot_countTasksFIMforTraineeChanged(int trainee_id, int count)
|
||||
void PersonalCardTrainee::slot_countTasksFIMforTraineeChanged(int trainee_id, QString statFIM)
|
||||
{
|
||||
if(id_trainee == trainee_id)
|
||||
{
|
||||
ui->lblCntFIM->setText(QString::number(count));
|
||||
ui->lblCntFIM->setText(statFIM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ private:
|
||||
void loadInfo();
|
||||
|
||||
public slots:
|
||||
void slot_countTasksAMMforTraineeChanged(int trainee_id, int count);
|
||||
void slot_countTasksFIMforTraineeChanged(int trainee_id, int count);
|
||||
void slot_countTasksAMMforTraineeChanged(int trainee_id, QString statAMM);
|
||||
void slot_countTasksFIMforTraineeChanged(int trainee_id, QString statFIM);
|
||||
|
||||
void slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Assigned AMM</string>
|
||||
<string>Tasks AMM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblCntAMM">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
<string>0 / 0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@@ -135,14 +135,14 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Assigned FIM</string>
|
||||
<string>Tasks FIM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblCntFIM">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
<string>0/0/0 / 0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
||||
@@ -21,70 +21,6 @@ void TraineesView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
||||
}
|
||||
}
|
||||
|
||||
QString TraineesView::buildStatisticTasksAMM(QList<TaskAmmFim> listTasks)
|
||||
{
|
||||
QString stat = "X/X";
|
||||
int cntAll = 0;
|
||||
int cntCompleted = 0;
|
||||
|
||||
for(TaskAmmFim task : listTasks)
|
||||
{
|
||||
cntAll++;
|
||||
|
||||
if(task.status == "completed")
|
||||
cntCompleted++;
|
||||
}
|
||||
|
||||
stat = QString("%1/%2").arg(
|
||||
QString::number(cntCompleted),
|
||||
QString::number(cntAll));
|
||||
|
||||
QString statHTML = QString("<p><span style=\"color: green;\">%1</span>/"
|
||||
"<span style=\"color: black;\">%2</span></p>").arg(
|
||||
QString::number(cntCompleted),
|
||||
QString::number(cntAll));
|
||||
|
||||
return /*stat*/statHTML;
|
||||
}
|
||||
|
||||
QString TraineesView::buildStatisticTasksFIM(QList<TaskAmmFim> listTasks)
|
||||
{
|
||||
QString stat = "X/X/X/X";
|
||||
int cntAll = 0;
|
||||
int cntCompleted = 0;
|
||||
int cntCheckup = 0;
|
||||
int cntFailed = 0;
|
||||
|
||||
for(TaskAmmFim task : listTasks)
|
||||
{
|
||||
cntAll++;
|
||||
|
||||
if(task.status == "completed")
|
||||
cntCompleted++;
|
||||
else if(task.status == "checkup")
|
||||
cntCheckup++;
|
||||
else if(task.status == "failed")
|
||||
cntFailed++;
|
||||
}
|
||||
|
||||
stat = QString("%1/%2/%3/%4").arg(
|
||||
QString::number(cntCompleted),
|
||||
QString::number(cntFailed),
|
||||
QString::number(cntCheckup),
|
||||
QString::number(cntAll));
|
||||
|
||||
QString statHTML = QString("<p><span style=\"color: green;\">%1</span>/"
|
||||
"<span style=\"color: red;\">%2</span>/"
|
||||
"<span style=\"color: darkorange;\">%3</span>/"
|
||||
"<span style=\"color: black;\">%4</span></p>").arg(
|
||||
QString::number(cntCompleted),
|
||||
QString::number(cntFailed),
|
||||
QString::number(cntCheckup),
|
||||
QString::number(cntAll));
|
||||
|
||||
return /*stat*/statHTML;
|
||||
}
|
||||
|
||||
void TraineesView::loadTraineesFromDB()
|
||||
{
|
||||
mtxTreeWidget.lock();
|
||||
@@ -126,9 +62,6 @@ void TraineesView::loadTraineesFromDB()
|
||||
ItemTrainee->setText(ColumnsTreeUsers::clmn_Computer, trainee.getComputer().getName());
|
||||
ItemTrainee->setText(ColumnsTreeUsers::clmn_IP_address, trainee.getComputer().getIpAddress());
|
||||
|
||||
//ItemTrainee->setText(ColumnsTreeUsers::clmn_AMMtasks, statAMM);
|
||||
//ItemTrainee->setText(ColumnsTreeUsers::clmn_FIMtasks, statFIM);
|
||||
|
||||
//Сокрытие пароля
|
||||
ItemTrainee->setText(ColumnsTreeUsers::clmn_Password, QStringLiteral("******"));
|
||||
|
||||
@@ -161,8 +94,8 @@ void TraineesView::loadTraineesFromDB()
|
||||
|
||||
QList<TaskAmmFim> listAMM = connectorToServer->getListTasksAMMforTrainee(trainee.getID());
|
||||
QList<TaskAmmFim> listFIM = connectorToServer->getListTasksFIMforTrainee(trainee.getID());
|
||||
QString statAMM = buildStatisticTasksAMM(listAMM);
|
||||
QString statFIM = buildStatisticTasksFIM(listFIM);
|
||||
QString statAMM = TaskAmmFim::buildStatisticTasksAMM(listAMM);
|
||||
QString statFIM = TaskAmmFim::buildStatisticTasksFIM(listFIM);
|
||||
|
||||
QPlainTextEdit *plainTextEditAMM = new QPlainTextEdit();
|
||||
plainTextEditAMM->setObjectName("plainTextEditAMM");
|
||||
|
||||
@@ -17,10 +17,6 @@ public Q_SLOTS:
|
||||
//Слот обработки сигнала необходимости обновления интерфейса
|
||||
void slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
private:
|
||||
QString buildStatisticTasksAMM(QList<TaskAmmFim> listTasks);
|
||||
QString buildStatisticTasksFIM(QList<TaskAmmFim> listTasks);
|
||||
|
||||
protected:
|
||||
virtual void updateButtons(){};
|
||||
void loadTraineesFromDB();
|
||||
|
||||
Reference in New Issue
Block a user