mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
ПКМ для FIM AMM
This commit is contained in:
@@ -20,6 +20,56 @@ 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));
|
||||
|
||||
return stat;
|
||||
}
|
||||
|
||||
QString TraineesView::buildStatisticTasksFIM(QList<TaskAmmFim> listTasks)
|
||||
{
|
||||
QString stat = "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));
|
||||
|
||||
return stat;
|
||||
}
|
||||
|
||||
void TraineesView::loadTraineesFromDB()
|
||||
{
|
||||
mtxTreeWidget.lock();
|
||||
@@ -51,6 +101,11 @@ void TraineesView::loadTraineesFromDB()
|
||||
if(trainee.getGroup().getID() != group.getID())
|
||||
continue;
|
||||
|
||||
QList<TaskAmmFim> listAMM = connectorToServer->getListTasksAMMforTrainee(trainee.getID());
|
||||
QList<TaskAmmFim> listFIM = connectorToServer->getListTasksFIMforTrainee(trainee.getID());
|
||||
QString statAMM = buildStatisticTasksAMM(listAMM);
|
||||
QString statFIM = buildStatisticTasksFIM(listFIM);
|
||||
|
||||
QTreeWidgetItem *ItemTrainee = new QTreeWidgetItem();
|
||||
|
||||
ItemTrainee->setText(ColumnsTreeUsers::clmn_ID, QString::number(trainee.getID()));
|
||||
@@ -61,6 +116,9 @@ 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("******"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user