Advertisement
Kurles

Untitled

Apr 29th, 2020
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.59 KB | None | 0 0
  1. void NotificationTemplateHandler::fillInfoTable(OdtReportGenerator::Rules &rules, NotificationReportSharePtr &data)
  2. {
  3.     // TODO: не показывать неиспользуемые параметры
  4.     if (data->info->mode == QStringLiteral("circular")){
  5.         addRowTableInfo(rules, tr("Режим оповещения"),tr("Циркулярный"));
  6.     } else {
  7.         addRowTableInfo(rules, tr("Режим оповещения"),tr("Избирательный"));
  8.     }
  9.     addRowTableInfo(rules, tr("Код оповещения"),data->info->notifyCode);
  10.     addRowTableInfo(rules, tr("Время подведения итогов оповещения, сек."),QString::number(data->info->maxNotifyDuration));
  11.     if (data->info->mode == QStringLiteral("circular")){
  12.         QStringList netLst;
  13.         for(auto type : data->info->types){
  14.             if (type == tr("phone")){
  15.                 netLst.append(tr("Телефон"));
  16.             } else if (type == tr("siren")){
  17.                 netLst.append(tr("Сирена"));
  18.             } else if (type == tr("speaker")){
  19.                 netLst.append(tr("Громкоговоритель"));
  20.             } else {
  21.                 netLst.append(tr("Текст"));
  22.             }
  23.         }
  24.         addRowTableInfo(rules, tr("Сети оповещения"), netLst.join(", "));
  25.     }
  26.     addRowTableInfo(rules, tr("Текстовое сообщение"),data->info->textMessage);
  27.     //
  28.     QString fileNotify;
  29.     if(!data->info->synthezText.isEmpty() && !data->info->synthezFile.isEmpty()){
  30.         fileNotify = tr("Синтезированный на сервере файл с текстом \"%0\" (%1/get_by_name/synthez_files/%2)").arg(data->info->synthezText, getFileServer(), data->info->synthezFile);
  31.     } else if (data->info->synthezText.isEmpty() && !data->info->synthezFile.isEmpty()){
  32.         fileNotify = tr("Заранее подготовленный на сервере файл (%0/get_by_name/notification_files/%1)").arg(getFileServer(),data->info->synthezFile);
  33.     } else if (data->info->realVoice && !data->audioRecordFileName.isEmpty()){
  34.         fileNotify = tr("Речь с микрофона (%0/get_by_name/record_files/%1)").arg(getFileServer(),data->audioRecordFileName);
  35.     } else {
  36.         fileNotify = tr("Без речевого сообщения");
  37.     }
  38.     addRowTableInfo(rules, tr("Речевое сообщение"),fileNotify);
  39.  
  40.     //
  41.     QString siren;
  42.     if (data->info->siren == "no_siren"){
  43.         siren = tr("Без сирены");
  44.     } else if (data->info->siren == "continuous"){
  45.         siren = tr("Непрерывная");
  46.     } else if (data->info->siren == "discontinuous"){
  47.         siren = tr("Прерывистая");
  48.     }
  49.     addRowTableInfo(rules, tr("Тип сирены"),siren);
  50.     //
  51.     addRowTableInfo(rules, tr("Длительность сирены"),QString::number(data->info->sirenDuration));
  52.     addRowTableInfo(rules, tr("Количество циклов сирены"),QString::number(data->info->sirenCycles));
  53.     addRowTableInfo(rules, tr("Количество воспроизведений речевого сообщения"),QString::number(data->info->voiceRepeat));
  54.     addRowTableInfo(rules, tr("Число попыток дозвона"),QString::number(data->info->phoneNumberRepeat));
  55.     addRowTableInfo(rules, tr("Пауза между дозвонами, сек."),QString::number(data->info->phonePauseDials));
  56.     addRowTableInfo(rules, tr("Продолжительность дозвона, сек."),QString::number(data->info->phoneDurationDialer));
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement