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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user