Browse Source

refs #795 Syncronizing with release commit:59b22f9c04ff82be3ee5bff1666a1fde71421b96 build:201801251916.

git-svn-id: https://help.cyberplat.com/svn@702 03a3ef96-f0a9-4432-b0b0-a3692ed642c1
tags/3.11.0
svn 4 years ago
parent
commit
90e4d99a33
52 changed files with 539 additions and 306 deletions
  1. +1
    -0
      3.0/src/apps/PaymentProcessor/src/Services/PrintConstants.h
  2. +9
    -5
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp
  3. +1
    -1
      3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp
  4. +12
    -12
      3.0/src/apps/Updater/src/locale/updater_en.ts
  5. +12
    -12
      3.0/src/apps/Updater/src/locale/updater_kk.ts
  6. +12
    -12
      3.0/src/apps/Updater/src/locale/updater_ru.ts
  7. +12
    -12
      3.0/src/apps/Updater/src/locale/updater_ru_bankomat.ts
  8. +2
    -0
      3.0/src/includes/Hardware/FR/FiscalFieldDescriptions.h
  9. +1
    -1
      3.0/src/includes/Hardware/Printers/CustomVKP80.h
  10. +1
    -1
      3.0/src/includes/Hardware/Printers/POSPrinterData.h
  11. +10
    -10
      3.0/src/includes/Hardware/Printers/PrinterDevices.h
  12. +7
    -6
      3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h
  13. +1
    -0
      3.0/src/includes/SDK/Drivers/FR/FiscalFields.h
  14. +2
    -1
      3.0/src/interface/modern/scene_with_context/operators/11611/widgets/kzd_ticket_editor.qml
  15. +3
    -3
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/FirmwareVersions.h
  16. +52
    -3
      3.0/src/modules/Hardware/FR/src/Base/FRBase.cpp
  17. +19
    -16
      3.0/src/modules/Hardware/FR/src/Base/FRBase.h
  18. +42
    -0
      3.0/src/modules/Hardware/FR/src/Base/Port/PortFRBase.cpp
  19. +9
    -0
      3.0/src/modules/Hardware/FR/src/Base/Port/PortFRBase.h
  20. +1
    -1
      3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihOnlineFRBase.cpp
  21. +0
    -1
      3.0/src/modules/Hardware/FR/src/Spark/SparkFR.cpp
  22. +19
    -18
      3.0/src/modules/Hardware/Printers/msvc/Printers.vcxproj
  23. +70
    -55
      3.0/src/modules/Hardware/Printers/msvc/Printers.vcxproj.filters
  24. +2
    -2
      3.0/src/modules/Hardware/Printers/src/Base/Port/PortPrinterBase.cpp
  25. +3
    -3
      3.0/src/modules/Hardware/Printers/src/Base/Port/PortPrinterBase.h
  26. +25
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenBase.h
  27. +2
    -6
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCBM1000II.h
  28. +2
    -6
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCPP8001.h
  29. +2
    -6
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCTS2000.h
  30. +47
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCTS310II.h
  31. +1
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU231/CitizenPPU231.cpp
  32. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU231/CitizenPPU231.h
  33. +74
    -74
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU231/CitizenPPU231Constants.h
  34. +0
    -4
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU700/CitizenPPU700.cpp
  35. +3
    -2
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU700/CitizenPPU700.h
  36. +1
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenBase.h
  37. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomPrinters.cpp
  38. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomPrinters.h
  39. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomTG2480H.h
  40. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80.cpp
  41. +1
    -1
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80.h
  42. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80III.cpp
  43. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80III.h
  44. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/EjectorPOS.cpp
  45. +0
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/EjectorPOS.h
  46. +0
    -1
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Epson/EpsonEUT400.cpp
  47. +8
    -0
      3.0/src/modules/NetworkTaskManager/src/FileDataStream.cpp
  48. +2
    -0
      3.0/src/modules/NetworkTaskManager/src/FileDataStream.h
  49. +2
    -0
      3.0/src/modules/NetworkTaskManager/src/NetworkTask.h
  50. +17
    -8
      3.0/src/modules/NetworkTaskManager/src/NetworkTaskManager.cpp
  51. +46
    -23
      3.0/src/modules/UpdateEngine/src/Updater.cpp
  52. +3
    -0
      3.0/src/modules/UpdateEngine/src/Updater.h

+ 1
- 0
3.0/src/apps/PaymentProcessor/src/Services/PrintConstants.h View File

@@ -28,6 +28,7 @@ namespace CPrintConstants
const char * const PointExternalID = "POINT_EXTERNAL_ID";
const char * const OpBrand = "OPERATOR_BRAND";
const char * const OpName = "OPERATOR_NAME";
const char * const OpINN = "OPERATOR_INN";
const char * const RecipientInn = "RECIPIENT_INN";
const char * const RecipientName = "RECIPIENT_NAME";
const char * const ServiceType = "SERVICE_TYPE";


+ 9
- 5
3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp View File

@@ -67,35 +67,39 @@ SDK::Driver::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap &

if (amountList.isNull())
{
QString operatorINN = aParameters.value(CPrintConstants::OpINN).toString();
QString paymentTitle = QString("%1 (%2)")
.arg(aParameters[CPrintConstants::ServiceType].toString())
.arg(aParameters[CPrintConstants::OpBrand].toString());

fiscalAmountList << DSDK::SAmountData(amount, vat, paymentTitle, DSDK::EPayOffSubjectTypes::Payment);
fiscalAmountList << DSDK::SAmountData(amount, vat, paymentTitle, operatorINN, DSDK::EPayOffSubjectTypes::Payment);
}
else
{
QVariantList amounts = amountList.toList();
QVariantList amountTitles = aParameters.value("[AMOUNT_TITLE]").toList();
QVariantList amountsVAT = aParameters.value("[AMOUNT_VAT]").toList();
QVariantList operatorINNs = aParameters.value("[OPERATOR_INN]").toList();

// amount содержит список сумм для печати реестра нераспечатанных чеков
for (int i = 0; i < amounts.size(); i++)
{
fiscalAmountList << DSDK::SAmountData(amounts[i].toDouble(), amountsVAT[i].toInt(), amountTitles[i].toString(), DSDK::EPayOffSubjectTypes::Payment);
fiscalAmountList << DSDK::SAmountData(amounts[i].toDouble(), amountsVAT[i].toInt(), amountTitles[i].toString(), operatorINNs[i].toString(), DSDK::EPayOffSubjectTypes::Payment);
}
}

if (!qFuzzyIsNull(fee))
{
QString dealerINN = aParameters.value(CPrintConstants::DealerInn).toString();
fiscalAmountList << (dealerIsBank ?
DSDK::SAmountData(fee, dealerVAT, tr("#bank_fee"), DSDK::EPayOffSubjectTypes::Payment) :
DSDK::SAmountData(fee, dealerVAT, tr("#dealer_fee"), DSDK::EPayOffSubjectTypes::AgentFee));
DSDK::SAmountData(fee, dealerVAT, tr("#bank_fee"), dealerINN, DSDK::EPayOffSubjectTypes::Payment) :
DSDK::SAmountData(fee, dealerVAT, tr("#dealer_fee"), dealerINN, DSDK::EPayOffSubjectTypes::AgentFee));
}

if (!qFuzzyIsNull(processingFee))
{
fiscalAmountList << DSDK::SAmountData(processingFee, 0, tr("#processing_fee"), DSDK::EPayOffSubjectTypes::Payment);
QString bankINN = aParameters.value(CPrintConstants::BankInn).toString();
fiscalAmountList << DSDK::SAmountData(processingFee, 0, tr("#processing_fee"), bankINN, DSDK::EPayOffSubjectTypes::Payment);
}

bool EMoney = aParameters.value(PPSDK::CPayment::Parameters::PayTool).toInt() > 0;


+ 1
- 1
3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp View File

@@ -1407,7 +1407,7 @@ void PrintingService::updateHardwareConfiguration()
if (device)
{
QVariantMap dealerSettings;
dealerSettings.insert(CHardwareSDK::FR::DealerTaxation, mStaticParameters.value(CPrintConstants::DealerTaxation));
dealerSettings.insert(CHardwareSDK::FR::DealerTaxation, mStaticParameters.value(CPrintConstants::DealerTaxation));
dealerSettings.insert(CHardwareSDK::FR::DealerAgentFlag, mStaticParameters.value(CPrintConstants::DealerAgentFlag));

mPrinterDevices.append(device);


+ 12
- 12
3.0/src/apps/Updater/src/locale/updater_en.ts View File

@@ -17,58 +17,58 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="91"/>
<source>#error_run_from_temp_dir</source>
<translation>Failed to run updater from a temp path</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="92"/>
<source>#error_connection_to_guard</source>
<translation>Failed to connect to guard.exe</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="93"/>
<source>#error_unknown_command</source>
<translation>Unknown command</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="94"/>
<source>#error_second_instance</source>
<translation>Deny second updater instance</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="95"/>
<source>#error_unknown</source>
<translation>Unknown error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="96"/>
<source>#error_network</source>
<translation>Network error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="102"/>
<location filename="../UpdaterApp.cpp" line="97"/>
<source>#error_parse_response</source>
<translation>Update server parse response error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="103"/>
<location filename="../UpdaterApp.cpp" line="98"/>
<source>#error_deploy</source>
<translation>Error while copying files</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="104"/>
<location filename="../UpdaterApp.cpp" line="99"/>
<source>#error_aborted</source>
<translation>External abort</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="105"/>
<location filename="../UpdaterApp.cpp" line="100"/>
<source>#error_update_blocked</source>
<translation>Update is blocked</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="106"/>
<location filename="../UpdaterApp.cpp" line="349"/>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="338"/>
<source>#error_check_integrity</source>
<translation>The integrity of the distribution is broken. Number of differences:%1. Run software update</translation>
</message>


+ 12
- 12
3.0/src/apps/Updater/src/locale/updater_kk.ts View File

@@ -17,58 +17,58 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="91"/>
<source>#error_run_from_temp_dir</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="92"/>
<source>#error_connection_to_guard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="93"/>
<source>#error_unknown_command</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="94"/>
<source>#error_second_instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="95"/>
<source>#error_unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="96"/>
<source>#error_network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="102"/>
<location filename="../UpdaterApp.cpp" line="97"/>
<source>#error_parse_response</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="103"/>
<location filename="../UpdaterApp.cpp" line="98"/>
<source>#error_deploy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="104"/>
<location filename="../UpdaterApp.cpp" line="99"/>
<source>#error_aborted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="105"/>
<location filename="../UpdaterApp.cpp" line="100"/>
<source>#error_update_blocked</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="106"/>
<location filename="../UpdaterApp.cpp" line="349"/>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="338"/>
<source>#error_check_integrity</source>
<translation type="unfinished"></translation>
</message>


+ 12
- 12
3.0/src/apps/Updater/src/locale/updater_ru.ts View File

@@ -17,58 +17,58 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="91"/>
<source>#error_run_from_temp_dir</source>
<translation>Ошибка запуска updater из временной папки</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="92"/>
<source>#error_connection_to_guard</source>
<translation>Ошибка соединения с guard.exe</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="93"/>
<source>#error_unknown_command</source>
<translation>Неизвестная команда</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="94"/>
<source>#error_second_instance</source>
<translation>Запуск второй копии updater</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="95"/>
<source>#error_unknown</source>
<translation>Неизвестная ошибка</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="96"/>
<source>#error_network</source>
<translation>Сетевая ошибка</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="102"/>
<location filename="../UpdaterApp.cpp" line="97"/>
<source>#error_parse_response</source>
<translation>Ошибка обработки ответа сервера обновления</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="103"/>
<location filename="../UpdaterApp.cpp" line="98"/>
<source>#error_deploy</source>
<translation>Ошибка копирования файлов</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="104"/>
<location filename="../UpdaterApp.cpp" line="99"/>
<source>#error_aborted</source>
<translation>Прерван внешним процессом</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="105"/>
<location filename="../UpdaterApp.cpp" line="100"/>
<source>#error_update_blocked</source>
<translation>Обновление заблокировано</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="106"/>
<location filename="../UpdaterApp.cpp" line="349"/>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="338"/>
<source>#error_check_integrity</source>
<translation>Целостность дистрибутива нарушена. Кол-во отличий: %1. Выполните команду обновления ПО</translation>
</message>


+ 12
- 12
3.0/src/apps/Updater/src/locale/updater_ru_bankomat.ts View File

@@ -17,58 +17,58 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="91"/>
<source>#error_run_from_temp_dir</source>
<translation>Ошибка запуска updater из временной папки</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="92"/>
<source>#error_connection_to_guard</source>
<translation>Ошибка соединения с guard.exe</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="93"/>
<source>#error_unknown_command</source>
<translation>Неизвестная команда</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="94"/>
<source>#error_second_instance</source>
<translation>Запуск второй копии updater</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="95"/>
<source>#error_unknown</source>
<translation>Неизвестная ошибка</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="96"/>
<source>#error_network</source>
<translation>Сетевая ошибка</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="102"/>
<location filename="../UpdaterApp.cpp" line="97"/>
<source>#error_parse_response</source>
<translation>Ошибка обработки ответа сервера обновления</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="103"/>
<location filename="../UpdaterApp.cpp" line="98"/>
<source>#error_deploy</source>
<translation>Ошибка копирования файлов</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="104"/>
<location filename="../UpdaterApp.cpp" line="99"/>
<source>#error_aborted</source>
<translation>Прерван внешним процессом</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="105"/>
<location filename="../UpdaterApp.cpp" line="100"/>
<source>#error_update_blocked</source>
<translation>Обновление заблокировано</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="106"/>
<location filename="../UpdaterApp.cpp" line="349"/>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="338"/>
<source>#error_check_integrity</source>
<translation>Целостность дистрибутива нарушена. Кол-во отличий: %1. Выполните команду обновления ПО</translation>
</message>


+ 2
- 0
3.0/src/includes/Hardware/FR/FiscalFieldDescriptions.h View File

@@ -68,6 +68,7 @@ namespace CHardware { namespace FiscalFields
const char PayOffSubjectType[] = "payoff_subject_type"; // 1212 (Признак предмета расчета).
const char PayOffMethodType[] = "payoff_method_type"; // 1214 (Признак способа расчета).
const char AgentFlag[] = "agent_flag"; // 1222 (Признак платежного агента на платеже).
const char ProviderINN[] = "provider_inn"; // 1226 (ИНН поставщика).

}} // namespace CHardware::FiscalFields

@@ -215,6 +216,7 @@ namespace CFR { namespace FiscalFields
ADD_FISCAL_FIELD(PayOffSubjectType, Byte); // 1212 (Признак предмета расчета).
ADD_FISCAL_FIELD(PayOffMethodType, Byte); // 1214 (Признак способа расчета).
ADD_FISCAL_FIELD(AgentFlag, Byte); // 1222 (Признак платежного агента на платеже).
ADD_FISCAL_FIELD(ProviderINN, String); // 1226 (ИНН поставщика).
}
};



+ 1
- 1
3.0/src/includes/Hardware/Printers/CustomVKP80.h View File

@@ -1 +1 @@
#include "../../../modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CustomVKP80.h"
#include "../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80.h"

+ 1
- 1
3.0/src/includes/Hardware/Printers/POSPrinterData.h View File

@@ -40,7 +40,7 @@ namespace CPOSPrinter
}
}

const char RussianCodePage = '\x07'; /// Номер русской кодовой страницы.
const char RussianCodePage = '\x11'; /// Номер русской кодовой страницы.
const char USACharacters = '\x30'; /// Спец. международный набор символов, принятый в США.
const char DefaultName[] = "Unknown POS Printer"; /// Имя принтера по умолчанию.



+ 10
- 10
3.0/src/includes/Hardware/Printers/PrinterDevices.h View File

@@ -1,14 +1,14 @@
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Common/POSPrinter.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CustomVKP80.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CustomVKP80III.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CitizenPPU700.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/CitizenCPP8001.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/CitizenCBM1000II.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/CustomPrinters.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/CustomTG2480H.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/CitizenCTS2000.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/CitizenPPU231/CitizenPPU231.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/CitizenCTS310II.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU700/CitizenPPU700.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCPP8001.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCBM1000II.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCTS2000.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU231/CitizenPPU231.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCTS310II.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80III.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomPrinters.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomTG2480H.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Epson/EpsonEUT400.h"

#include "../../../../modules/Hardware/Printers/src/AV268/AV268.h"


+ 7
- 6
3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h View File

@@ -148,15 +148,16 @@ typedef double TSum;

struct SAmountData
{
TSum sum; /// Сумма платежа.
TVAT VAT; /// НДС (value added tax).
QString name; /// Локализованное название платежа (товар).
TSum sum; /// Сумма платежа.
TVAT VAT; /// НДС (value added tax).
QString name; /// Локализованное название платежа (товар).
QString providerINN; /// ИНН поставщика товара (оператор/дилер/Платина).
EPayOffSubjectTypes::Enum payOffSubjectType; /// Признак предмета расчета.
int section; /// Отдел.
int section; /// Отдел.

SAmountData() : sum(0), VAT(0), section(-1) {}
SAmountData(double aSum, TVAT aVAT, const QString & aName, EPayOffSubjectTypes::Enum aPayOffSubjectType, int aSection = -1):
sum(aSum), VAT(aVAT), name(aName), payOffSubjectType(aPayOffSubjectType), section(aSection) {}
SAmountData(double aSum, TVAT aVAT, const QString & aName, const QString & aProviderINN, EPayOffSubjectTypes::Enum aPayOffSubjectType, int aSection = -1):
sum(aSum), VAT(aVAT), name(aName), providerINN(aProviderINN), payOffSubjectType(aPayOffSubjectType), section(aSection) {}
};

typedef QList<SAmountData> TAmountDataList;


+ 1
- 0
3.0/src/includes/SDK/Drivers/FR/FiscalFields.h View File

@@ -64,6 +64,7 @@ namespace FiscalFields
const int PayOffSubjectType = 1212; // Признак предмета расчета.
const int PayOffMethodType = 1214; // Признак способа расчета.
const int AgentFlag = 1222; // Признак платежного агента на платеже.
const int ProviderINN = 1226; // ИНН поставщика.

// Является ли поле денежным.
inline bool isMoney(int aField)


+ 2
- 1
3.0/src/interface/modern/scene_with_context/operators/11611/widgets/kzd_ticket_editor.qml View File

@@ -14,7 +14,7 @@ Item {
// Показывает содержит ли редактор допустимое значение
property bool acceptable: global.enabled

property bool rollup: false
property bool rollup: true

property bool setupDefaultValue: true

@@ -122,6 +122,7 @@ Item {
var errmsg = aResult.hasOwnProperty("ERRMSG");

global.enabled = !errmsg;
rootItem.rollup = !global.enabled

bookingResult.text = errmsg ? aResult.ERRMSG : ""



+ 3
- 3
3.0/src/modules/Hardware/CashAcceptors/src/CCNet/FirmwareVersions.h View File

@@ -22,12 +22,12 @@ namespace CCCNet
public:
CFimwareVersions()
{
data()[Models::CashcodeGX ][Currency::RUB][true] = TFimwareVersionSet() << 1205;
data()[Models::CashcodeGX ][Currency::RUB][true] = TFimwareVersionSet() << 1205;

data()[Models::CashcodeSM ][Currency::RUB][true] = TFimwareVersionSet() << 1351;
data()[Models::CashcodeSM ][Currency::RUB][true] = TFimwareVersionSet() << 1351;

data()[Models::CashcodeSM ][Currency::RUB][false] = TFimwareVersionSet() << 1378 << 1434;
data()[Models::CashcodeMSM][Currency::RUB][false] = TFimwareVersionSet() << 1114;
data()[Models::CashcodeMSM][Currency::RUB][false] = TFimwareVersionSet() << 1115;
data()[Models::CashcodeMSM][Currency::EUR][false] = TFimwareVersionSet() << 1130 << 1228 << 1329 << 1411 << 1527;
data()[Models::CashcodeMVU][Currency::RUB][false] = TFimwareVersionSet() << 1330;
data()[Models::CashcodeMFL][Currency::RUB][false] = TFimwareVersionSet() << 1140;


+ 52
- 3
3.0/src/modules/Hardware/FR/src/Base/FRBase.cpp View File

@@ -152,17 +152,23 @@ void FRBase<T>::finaliseInitialization()
agentFlagsData.insert(EAgentFlags::Enum(agentFlag), CFR::AgentFlags[agentFlag]);
}

TOperationModeData operationModedata;
TOperationModeData operationModeData;

foreach(char operationMode, mOperationModes)
{
operationModedata.insert(EOperationModes::Enum(operationMode), CFR::OperationModes::Data[operationMode].description);
operationModeData.insert(EOperationModes::Enum(operationMode), CFR::OperationModes::Data[operationMode].description);
}

QStringList operationModeDescriptions = operationModeData.values();

if (getConfigParameter(CHardware::FiscalFields::LotteryMode, 0).toInt()) operationModeDescriptions += CFR::LotteryMode;
if (getConfigParameter(CHardware::FiscalFields::GamblingMode, 0).toInt()) operationModeDescriptions += CFR::GamblingMode;
if (getConfigParameter(CHardware::FiscalFields::ExcisableUnitMode, 0).toInt()) operationModeDescriptions += CFR::ExcisableUnitMode;

setDeviceParameter(CDeviceData::FS::SerialNumber, mFSSerialNumber);
setDeviceParameter(CDeviceData::FR::Taxations, QStringList(taxationData.values()).join(", "));
setDeviceParameter(CDeviceData::FR::AgentFlags, QStringList(agentFlagsData.values()).join(", "));
setDeviceParameter(CDeviceData::FR::OperationModes, QStringList(operationModedata.values()).join(", "));
setDeviceParameter(CDeviceData::FR::OperationModes, operationModeDescriptions.join(", "));
setDeviceParameter(CDeviceData::FR::FFDFR, CFR::FFD[mFFDFR].description);
setDeviceParameter(CDeviceData::FR::FFDFS, CFR::FFD[mFFDFS].description);

@@ -861,6 +867,16 @@ bool FRBase<T>::printFiscal(const QStringList & aReceipt, const SPaymentData & a
if (getConfigParameter(CHardware::FiscalFields::GamblingMode, 0).toInt()) aFPData.insert(FiscalFields::GamblingMode, CFR::GamblingMode);
if (getConfigParameter(CHardware::FiscalFields::ExcisableUnitMode, 0).toInt()) aFPData.insert(FiscalFields::ExcisableUnitMode, CFR::ExcisableUnitMode);

toLog(LogLevel::Normal, mDeviceName + ": Fiscal payment data:\n" + getFPDataLog(aFPData));
QString log;

foreach(const TFiscalPaymentData FPData, aPSData)
{
log += getFPDataLog(FPData);
}

toLog(LogLevel::Normal, mDeviceName + ": Payoff subject data:\n" + log);

return true;
}

@@ -1430,3 +1446,36 @@ void FRBase<T>::parseSTLVData(const CFR::STLV & aTLV, TComplexFiscalPaymentData
}

//--------------------------------------------------------------------------------
template <class T>
QString FRBase<T>::getFPDataLog(const TFiscalPaymentData & aFPData) const
{
if (aFPData.isEmpty())
{
return "";
}

QList<int> fields = aFPData.keys();
qSort(fields);

QList<int> descriptionSizes;

foreach(int field, fields)
{
descriptionSizes << mFiscalFieldData[field].description.size();
}

qSort(descriptionSizes);
int maxDescriptionSize = descriptionSizes.last();
QStringList log;

foreach(int field, fields)
{
QString description = mFiscalFieldData[field].description;
QString descriptionLog = QString("(%1)%2").arg(description).arg("", maxDescriptionSize - description.size());
log << QString("%1 %2 = %3").arg(field).arg(descriptionLog).arg(aFPData[field].toString());
}

return "\n" + log.join("\n") + "\n";
}

//--------------------------------------------------------------------------------

+ 19
- 16
3.0/src/modules/Hardware/FR/src/Base/FRBase.h View File

@@ -24,24 +24,12 @@ public:
/// Устанавливает конфигурацию устройству.
virtual void setDeviceConfiguration(const QVariantMap & aConfiguration);

/// Завершение инициализации.
virtual void finaliseInitialization();

/// Готов ли к печати.
virtual bool isDeviceReady(bool aOnline);

/// Готов ли к обработке данной фискальной команды.
virtual bool isFiscalReady(bool aOnline, SDK::Driver::EFiscalPrinterCommand::Enum aCommand = SDK::Driver::EFiscalPrinterCommand::Sale);

/// Запрос статуса.
virtual bool processStatus(TStatusCodes & aStatusCodes);

/// Проверить установки сервера ОФД.
bool checkOFDData(const QByteArray & aAddressData, const QByteArray & aPortData);

/// Проверить возможность использования фискального реквизита.
bool checkFiscalField(int aField, bool & aResult);

/// Печать фискального чека.
virtual bool printFiscal(const QStringList & aReceipt, const SDK::Driver::SPaymentData & aPaymentData, SDK::Driver::TFiscalPaymentData & aFPData, SDK::Driver::TComplexFiscalPaymentData & aPSData);

@@ -55,9 +43,6 @@ public:
virtual bool printEncashment(const QStringList & aReceipt);
virtual bool printEncashment(const QStringList & aReceipt, double aAmount);

/// Открыта ли сессия.
virtual SDK::Driver::ESessionState::Enum getSessionState();

/// Находится ли в фискальном режиме.
virtual bool isFiscal() const;

@@ -65,6 +50,21 @@ public:
virtual bool isOnline() const;

protected:
/// Завершение инициализации.
virtual void finaliseInitialization();

/// Запрос статуса.
virtual bool processStatus(TStatusCodes & aStatusCodes);

/// Проверить установки сервера ОФД.
bool checkOFDData(const QByteArray & aAddressData, const QByteArray & aPortData);

/// Проверить возможность использования фискального реквизита.
bool checkFiscalField(int aField, bool & aResult);

/// Открыта ли сессия.
virtual SDK::Driver::ESessionState::Enum getSessionState();

/// Установить начальные параметры.
virtual void setInitialData();

@@ -170,9 +170,12 @@ protected:
/// Получить все налоговые ставки платежа.
SDK::Driver::TVATs getVATs(const SDK::Driver::SPaymentData & aPaymentData) const;

/// Получить все налоговые ставки платежа.
/// Логгировать данные налогов.
QString getVATLog(const SDK::Driver::TVATs & aVATs) const;

/// Получить лог фискальных данных платежа.
QString getFPDataLog(const SDK::Driver::TFiscalPaymentData & aFPData) const;

/// Наличие ЭКЛЗ.
bool mEKLZ;



+ 42
- 0
3.0/src/modules/Hardware/FR/src/Base/Port/PortFRBase.cpp View File

@@ -79,3 +79,45 @@ void PortFRBase<T>::makeReceipt(const QStringList & aReceipt, TReceiptBuffer & a
}

//--------------------------------------------------------------------------------
template <class T>
bool PortFRBase<T>::printFiscal(const QStringList & aReceipt, const SDK::Driver::SPaymentData & aPaymentData, SDK::Driver::TFiscalPaymentData & aFPData, SDK::Driver::TComplexFiscalPaymentData & aPSData)
{
bool result = FRBase<T>::printFiscal(aReceipt, aPaymentData, aFPData, aPSData);

if (mOperatorPresence)
{
mIOPort->close();
}

return result;
}

//--------------------------------------------------------------------------------
template <class T>
bool PortFRBase<T>::printZReport(bool aPrintDeferredReports)
{
bool result = FRBase<T>::printZReport(aPrintDeferredReports);

if (mOperatorPresence)
{
mIOPort->close();
}

return result;
}

//--------------------------------------------------------------------------------
template <class T>
bool PortFRBase<T>::printXReport(const QStringList & aReceipt)
{
bool result = FRBase<T>::printXReport(aReceipt);

if (mOperatorPresence)
{
mIOPort->close();
}

return result;
}

//--------------------------------------------------------------------------------

+ 9
- 0
3.0/src/modules/Hardware/FR/src/Base/Port/PortFRBase.h View File

@@ -21,6 +21,15 @@ class PortFRBase : public FRBase<T>
public:
PortFRBase();

/// Печать фискального чека.
virtual bool printFiscal(const QStringList & aReceipt, const SDK::Driver::SPaymentData & aPaymentData, SDK::Driver::TFiscalPaymentData & aFPData, SDK::Driver::TComplexFiscalPaymentData & aPSData);

/// Выполнить Z-отчет [и распечатать отложенные Z-отчеты].
virtual bool printZReport(bool aPrintDeferredReports);

/// Выполнить X-отчет [и распечатать нефискальный чек - баланс].
virtual bool printXReport(const QStringList & aReceipt);

protected:
/// Идентификация.
virtual bool checkExistence();


+ 1
- 1
3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihOnlineFRBase.cpp View File

@@ -105,7 +105,7 @@ bool ShtrihOnlineFRBase<T>::updateParameters()
return false;
}

bool result = false;
bool result = true;

if (processCommand(CShtrihOnlineFR::Commands::FS::StartFiscalTLVData, data.mid(43, 4)))
{


+ 0
- 1
3.0/src/modules/Hardware/FR/src/Spark/SparkFR.cpp View File

@@ -9,7 +9,6 @@
#include <Common/QtHeadersEnd.h>

// Modules
#include "PaymentProcessor/PrintConstants.h"
#include "Hardware/Common/PollingExpector.h"

// Project


+ 19
- 18
3.0/src/modules/Hardware/Printers/msvc/Printers.vcxproj View File

@@ -112,14 +112,15 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\Base\Port\PortPrinterBase.cpp" />
<ClCompile Include="..\src\POSPrinters\CitizenPPU231\CitizenPPU231.cpp" />
<ClCompile Include="..\src\POSPrinters\Citizen\CitizenPPU231\CitizenPPU231.cpp" />
<ClCompile Include="..\src\POSPrinters\Citizen\CitizenPPU700\CitizenPPU700.cpp" />
<ClCompile Include="..\src\POSPrinters\Common\POSParameters.cpp" />
<ClCompile Include="..\src\POSPrinters\Common\POSPrinter.cpp" />
<ClCompile Include="..\src\POSPrinters\CustomPrinters.cpp" />
<ClCompile Include="..\src\POSPrinters\EjectorPOS\CitizenPPU700.cpp" />
<ClCompile Include="..\src\POSPrinters\EjectorPOS\CustomVKP80.cpp" />
<ClCompile Include="..\src\POSPrinters\EjectorPOS\CustomVKP80III.cpp" />
<ClCompile Include="..\src\Base\PrinterBase.cpp" />
<ClCompile Include="..\src\POSPrinters\Custom\CustomPrinters.cpp" />
<ClCompile Include="..\src\POSPrinters\Custom\CustomVKP\CustomVKP80.cpp" />
<ClCompile Include="..\src\POSPrinters\Custom\CustomVKP\CustomVKP80III.cpp" />
<ClCompile Include="..\src\POSPrinters\EjectorPOS\EjectorPOS.cpp" />
<ClCompile Include="..\src\POSPrinters\Epson\EpsonEUT400.cpp" />
<ClCompile Include="..\src\Star\EjectorStarPrinters.cpp" />
<ClCompile Include="..\src\Star\StarMemorySwitchesBase.cpp" />
@@ -131,7 +132,6 @@
<ClCompile Include="..\src\SwecoinTTP20XXBase\SwecoinTTP20XXBase.cpp" />
<ClCompile Include="..\src\Star\StarPrinters.cpp" />
<ClCompile Include="..\src\SystemPrinter\SystemPrinter.cpp" />
<ClCompile Include="..\src\POSPrinters\EjectorPOS\Common\EjectorPOS.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\includes\Hardware\Printers\POSPrinterData.h" />
@@ -139,17 +139,25 @@
<ClInclude Include="..\src\AV268\AV268.h" />
<ClInclude Include="..\src\AV268\AV268Constants.h" />
<ClInclude Include="..\src\Base\Port\PortPrinterBase.h" />
<ClInclude Include="..\src\POSPrinters\CitizenCTS310II.h" />
<ClInclude Include="..\src\POSPrinters\CitizenPPU231\CitizenPPU231.h" />
<ClInclude Include="..\src\POSPrinters\CitizenPPU231\CitizenPPU231Constants.h" />
<ClInclude Include="..\src\Fujitsu\FujitsuPrinterData.h" />
<ClInclude Include="..\src\Fujitsu\FujitsuPrinters.h" />
<ClInclude Include="..\src\GeBe\GeBe.h" />
<ClInclude Include="..\src\GeBe\GeBEData.h" />
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenBase.h" />
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenCBM1000II.h" />
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenCPP8001.h" />
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenCTS2000.h" />
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenCTS310II.h" />
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenPPU231\CitizenPPU231.h" />
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenPPU231\CitizenPPU231Constants.h" />
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenPPU700\CitizenPPU700.h" />
<ClInclude Include="..\src\POSPrinters\Common\POSParameters.h" />
<ClInclude Include="..\src\POSPrinters\Common\POSPrinter.h" />
<ClInclude Include="..\src\POSPrinters\CustomTG2480H.h" />
<ClInclude Include="..\src\POSPrinters\EjectorPOS\CustomVKP80III.h" />
<ClInclude Include="..\src\POSPrinters\Custom\CustomPrinters.h" />
<ClInclude Include="..\src\POSPrinters\Custom\CustomTG2480H.h" />
<ClInclude Include="..\src\POSPrinters\Custom\CustomVKP\CustomVKP80.h" />
<ClInclude Include="..\src\POSPrinters\Custom\CustomVKP\CustomVKP80III.h" />
<ClInclude Include="..\src\POSPrinters\EjectorPOS\EjectorPOS.h" />
<ClInclude Include="..\src\POSPrinters\Epson\EpsonConstants.h" />
<ClInclude Include="..\src\POSPrinters\Epson\EpsonEUT400.h" />
<ClInclude Include="..\src\PrimexNP2511\PrimexNP2511.h" />
@@ -164,13 +172,6 @@
<ClInclude Include="..\src\SwecoinTTP20XXBase\SwecoinPrinterData.h" />
<ClInclude Include="..\src\SwecoinTTP20XXBase\SwecoinTTP20XXBase.h" />
<ClInclude Include="..\src\Star\StarPrinters.h" />
<ClInclude Include="..\src\POSPrinters\EjectorPOS\CitizenPPU700.h" />
<ClInclude Include="..\src\POSPrinters\EjectorPOS\Common\EjectorPOS.h" />
<ClInclude Include="..\src\POSPrinters\EjectorPOS\CustomVKP80.h" />
<ClInclude Include="..\src\POSPrinters\CustomPrinters.h" />
<ClInclude Include="..\src\POSPrinters\CitizenCTS2000.h" />
<ClInclude Include="..\src\POSPrinters\CitizenCBM1000II.h" />
<ClInclude Include="..\src\POSPrinters\CitizenCPP8001.h" />
<ClInclude Include="..\src\SystemPrinter\SystemPrinters.h" />
<ClInclude Include="..\src\SystemPrinter\SystemPrinter.h" />
<ClInclude Include="..\src\Base\PrinterBase.h" />


+ 70
- 55
3.0/src/modules/Hardware/Printers/msvc/Printers.vcxproj.filters View File

@@ -59,9 +59,6 @@
<Filter Include="POS\EjectorPOS">
<UniqueIdentifier>{7521f91b-6a8a-47d8-aa9f-8afa3060f6a2}</UniqueIdentifier>
</Filter>
<Filter Include="POS\CitizenPPU231">
<UniqueIdentifier>{89d81058-9366-4d23-b311-81ee1467f351}</UniqueIdentifier>
</Filter>
<Filter Include="Base">
<UniqueIdentifier>{0e672ad4-6b61-4fbc-9f89-926d2c796f84}</UniqueIdentifier>
</Filter>
@@ -81,6 +78,21 @@
<Filter Include="Base\Port\Serial">
<UniqueIdentifier>{2e544532-b61b-487d-b9fc-32ed72e0d186}</UniqueIdentifier>
</Filter>
<Filter Include="POS\Citizen">
<UniqueIdentifier>{897999e0-df6b-484a-af86-d2e4602c8f63}</UniqueIdentifier>
</Filter>
<Filter Include="POS\Custom">
<UniqueIdentifier>{fbd1be4c-7695-457d-b1e5-64726883dbc3}</UniqueIdentifier>
</Filter>
<Filter Include="POS\Citizen\CitizenPPU231">
<UniqueIdentifier>{89d81058-9366-4d23-b311-81ee1467f351}</UniqueIdentifier>
</Filter>
<Filter Include="POS\Citizen\CitizenPPU700">
<UniqueIdentifier>{34e3caa9-3f99-47e9-8bcf-904b7e1eb947}</UniqueIdentifier>
</Filter>
<Filter Include="POS\Custom\CustomVKP">
<UniqueIdentifier>{6de47b8e-fda3-4c91-a9f8-6dbb5d95e887}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\Tags\Tags.cpp">
@@ -110,9 +122,6 @@
<ClCompile Include="..\src\POSPrinters\Common\POSPrinter.cpp">
<Filter>POS\Common</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\EjectorPOS\Common\EjectorPOS.cpp">
<Filter>POS\EjectorPOS</Filter>
</ClCompile>
<ClCompile Include="..\src\Star\EjectorStarPrinters.cpp">
<Filter>STAR\Ejector</Filter>
</ClCompile>
@@ -122,30 +131,33 @@
<ClCompile Include="..\src\POSPrinters\Common\POSParameters.cpp">
<Filter>POS\Common</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\CitizenPPU231\CitizenPPU231.cpp">
<Filter>POS\CitizenPPU231</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\EjectorPOS\CitizenPPU700.cpp">
<Filter>POS\EjectorPOS</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\EjectorPOS\CustomVKP80III.cpp">
<Filter>POS\EjectorPOS</Filter>
</ClCompile>
<ClCompile Include="..\src\Base\PrinterBase.cpp">
<Filter>Base</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\CustomPrinters.cpp">
<Filter>POS</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\Epson\EpsonEUT400.cpp">
<Filter>POS\Epson</Filter>
</ClCompile>
<ClCompile Include="..\src\Base\Port\PortPrinterBase.cpp">
<Filter>Base\Port</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\EjectorPOS\CustomVKP80.cpp">
<ClCompile Include="..\src\POSPrinters\EjectorPOS\EjectorPOS.cpp">
<Filter>POS\EjectorPOS</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\Citizen\CitizenPPU231\CitizenPPU231.cpp">
<Filter>POS\Citizen\CitizenPPU231</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\Citizen\CitizenPPU700\CitizenPPU700.cpp">
<Filter>POS\Citizen\CitizenPPU700</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\Custom\CustomVKP\CustomVKP80.cpp">
<Filter>POS\Custom\CustomVKP</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\Custom\CustomVKP\CustomVKP80III.cpp">
<Filter>POS\Custom\CustomVKP</Filter>
</ClCompile>
<ClCompile Include="..\src\POSPrinters\Custom\CustomPrinters.cpp">
<Filter>POS\Custom</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\AV268\AV268.h">
@@ -178,27 +190,6 @@
<ClInclude Include="..\src\POSPrinters\Common\POSParameters.h">
<Filter>POS\Common</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\EjectorPOS\CustomVKP80.h">
<Filter>POS\EjectorPOS</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\EjectorPOS\CitizenPPU700.h">
<Filter>POS\EjectorPOS</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\EjectorPOS\Common\EjectorPOS.h">
<Filter>POS\EjectorPOS</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\CustomPrinters.h">
<Filter>POS</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\CitizenCTS2000.h">
<Filter>POS</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\CitizenCPP8001.h">
<Filter>POS</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\CitizenCBM1000II.h">
<Filter>POS</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\includes\Hardware\Printers\POSPrinterData.h">
<Filter>POS\Common</Filter>
</ClInclude>
@@ -235,18 +226,6 @@
<ClInclude Include="..\src\SystemPrinter\SystemPrinters.h">
<Filter>System</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\CitizenPPU231\CitizenPPU231.h">
<Filter>POS\CitizenPPU231</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\CitizenPPU231\CitizenPPU231Constants.h">
<Filter>POS\CitizenPPU231</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\EjectorPOS\CustomVKP80III.h">
<Filter>POS\EjectorPOS</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\CitizenCTS310II.h">
<Filter>POS</Filter>
</ClInclude>
<ClInclude Include="..\src\Base\PrinterBase.h">
<Filter>Base</Filter>
</ClInclude>
@@ -271,11 +250,47 @@
<ClInclude Include="..\src\POSPrinters\Epson\EpsonConstants.h">
<Filter>POS\Epson</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\CustomTG2480H.h">
<Filter>POS</Filter>
</ClInclude>
<ClInclude Include="..\src\Base\Port\PortPrinterBase.h">
<Filter>Base\Port</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\EjectorPOS\EjectorPOS.h">
<Filter>POS\EjectorPOS</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenPPU231\CitizenPPU231.h">
<Filter>POS\Citizen\CitizenPPU231</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenPPU231\CitizenPPU231Constants.h">
<Filter>POS\Citizen\CitizenPPU231</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenPPU700\CitizenPPU700.h">
<Filter>POS\Citizen\CitizenPPU700</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Custom\CustomVKP\CustomVKP80.h">
<Filter>POS\Custom\CustomVKP</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Custom\CustomVKP\CustomVKP80III.h">
<Filter>POS\Custom\CustomVKP</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Custom\CustomPrinters.h">
<Filter>POS\Custom</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Custom\CustomTG2480H.h">
<Filter>POS\Custom</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenBase.h">
<Filter>POS\Citizen</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenCBM1000II.h">
<Filter>POS\Citizen</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenCPP8001.h">
<Filter>POS\Citizen</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenCTS310II.h">
<Filter>POS\Citizen</Filter>
</ClInclude>
<ClInclude Include="..\src\POSPrinters\Citizen\CitizenCTS2000.h">
<Filter>POS\Citizen</Filter>
</ClInclude>
</ItemGroup>
</Project>

+ 2
- 2
3.0/src/modules/Hardware/Printers/src/Base/Port/PortPrinterBase.cpp View File

@@ -71,9 +71,9 @@ bool PortPrinterBase<T>::isPossible(bool aOnline, QVariant aCommand)

//---------------------------------------------------------------------------
template <class T>
bool PortPrinterBase<T>::processNonReentrant(TBoolMethod aCommand)
bool PortPrinterBase<T>::print(const QStringList & aReceipt)
{
bool result = T::processNonReentrant(aCommand);
bool result = T::print(aReceipt);

if (mOperatorPresence)
{


+ 3
- 3
3.0/src/modules/Hardware/Printers/src/Base/Port/PortPrinterBase.h View File

@@ -50,6 +50,9 @@ public:
/// Инициализация устройства.
virtual bool updateParametersOut() { return true; };

/// Напечатать массив строк.
virtual bool print(const QStringList & aReceipt);

/// Напечатать массив строк из другого драйвера.
virtual bool printOut(const SPrintingOutData & aPrintingOutData);

@@ -63,9 +66,6 @@ protected:
/// Возможна ли печать.
virtual bool isPossible(bool aOnline, QVariant aCommand = QVariant());

/// Выполнить нереентерабельную команду.
virtual bool processNonReentrant(TBoolMethod aCommand);

/// Напечатать чек.
virtual bool printReceipt(const Tags::TLexemeReceipt & aLexemeReceipt);



+ 25
- 0
3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenBase.h View File

@@ -0,0 +1,25 @@
/* @file Базовый принтер Citizen. */

#pragma once

#include "Hardware/Printers/POSPrinter.h"

//--------------------------------------------------------------------------------
template <class T>
class CitizenBase : public T
{
public:
CitizenBase()
{
mRussianCodePage = '\x07';

// теги
POSPrinters::SModelData modelData = mModelData.getDefault();
modelData.parameters.tagEngine->appendCommon(Tags::Type::DoubleWidth, "\x1B\x21", "\x20");
modelData.parameters.tagEngine->appendCommon(Tags::Type::DoubleHeight, "\x1B\x21", "\x10");

mModelData.setDefault(modelData);
}
};

//--------------------------------------------------------------------------------

3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenCBM1000II.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCBM1000II.h View File

@@ -2,10 +2,10 @@

#pragma once

#include "Hardware/Printers/POSPrinter.h"
#include "CitizenBase.h"

//--------------------------------------------------------------------------------
class CitizenCBM1000II : public POSPrinter
class CitizenCBM1000II : public CitizenBase<POSPrinter>
{
SET_SUBSERIES("CitizenCBM1000II")

@@ -45,10 +45,6 @@ CitizenCBM1000II::CitizenCBM1000II()
parameters.errors->data()[4][1].insert('\x0C', PrinterStatusCode::Warning::PaperNearEnd);
parameters.errors->data()[4][1].insert('\x60', PrinterStatusCode::Error::PaperEnd);

// теги
parameters.tagEngine->appendCommon(Tags::Type::DoubleWidth, "\x1B\x21", "\x20");
parameters.tagEngine->appendCommon(Tags::Type::DoubleHeight, "\x1B\x21", "\x10");

// параметры моделей
mDeviceName = "Citizen CBM-1000II";
mModelID = '\x30';

3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenCPP8001.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCPP8001.h View File

@@ -2,10 +2,10 @@

#pragma once

#include "Hardware/Printers/POSPrinter.h"
#include "CitizenBase.h"

//--------------------------------------------------------------------------------
class CitizenCPP8001 : public POSPrinter
class CitizenCPP8001 : public CitizenBase<POSPrinter>
{
SET_SUBSERIES("CitizenCPP8001")

@@ -43,10 +43,6 @@ CitizenCPP8001::CitizenCPP8001()
parameters.errors->data()[4][1].insert('\x0C', PrinterStatusCode::Warning::PaperNearEnd);
parameters.errors->data()[4][1].insert('\x60', PrinterStatusCode::Error::PaperEnd);

// теги
parameters.tagEngine->appendCommon(Tags::Type::DoubleWidth, "\x1B\x21", "\x20");
parameters.tagEngine->appendCommon(Tags::Type::DoubleHeight, "\x1B\x21", "\x10");

// параметры моделей
mDeviceName = "Citizen CPP-8001";
mModelID = '\x20';

3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenCTS2000.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCTS2000.h View File

@@ -2,10 +2,10 @@

#pragma once

#include "Hardware/Printers/POSPrinter.h"
#include "CitizenBase.h"

//--------------------------------------------------------------------------------
class CitizenCTS2000 : public POSPrinter
class CitizenCTS2000 : public CitizenBase<POSPrinter>
{
SET_SUBSERIES("CitizenCTS2000")

@@ -36,10 +36,6 @@ CitizenCTS2000::CitizenCTS2000()
parameters.errors->data()[4][1].insert('\x0C', PrinterStatusCode::Warning::PaperNearEnd);
parameters.errors->data()[4][1].insert('\x60', PrinterStatusCode::Error::PaperEnd);

// теги
parameters.tagEngine->appendCommon(Tags::Type::DoubleWidth, "\x1B\x21", "\x20");
parameters.tagEngine->appendCommon(Tags::Type::DoubleHeight, "\x1B\x21", "\x10");

// параметры моделей
setConfigParameter(CHardware::Printer::FeedingAmount, 5);
mDeviceName = "Citizen CT-S2000";

+ 47
- 0
3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenCTS310II.h View File

@@ -0,0 +1,47 @@
/* @file Принтер Citizen CT-S310II. */

#pragma once

#include "CitizenBase.h"

//--------------------------------------------------------------------------------
class CitizenCTS310II : public CitizenBase<POSPrinter>
{
SET_SUBSERIES("CitizenCTS310II")

public:
CitizenCTS310II();
};

CitizenCTS310II::CitizenCTS310II()
{
POSPrinters::SParameters parameters(mModelData.getDefault().parameters);

// статусы ошибок
parameters.errors->data().clear();

parameters.errors->data()[1][1].insert('\x08', DeviceStatusCode::Error::Unknown);

parameters.errors->data()[2][1].insert('\x04', DeviceStatusCode::Error::CoverIsOpened);
parameters.errors->data()[2][1].insert('\x20', PrinterStatusCode::Error::PaperEnd);
parameters.errors->data()[2][1].insert('\x40', DeviceStatusCode::Error::Unknown);

parameters.errors->data()[3][1].insert('\x04', DeviceStatusCode::Error::MechanismPosition);
parameters.errors->data()[3][1].insert('\x08', PrinterStatusCode::Error::Cutter);
parameters.errors->data()[3][1].insert('\x60', DeviceStatusCode::Error::Unknown);

parameters.errors->data()[4][1].insert('\x0C', PrinterStatusCode::Warning::PaperNearEnd);
parameters.errors->data()[4][1].insert('\x60', PrinterStatusCode::Error::PaperEnd);

// параметры моделей
setConfigParameter(CHardware::Printer::FeedingAmount, 3);
mDeviceName = "Citizen CT-S310II";
mModelID = '\x3D';

// модели
mModelData.data().clear();
mModelData.add(mModelID, true, mDeviceName, parameters);
mPortParameters = parameters.portSettings->data();
}

//--------------------------------------------------------------------------------

3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenPPU231/CitizenPPU231.cpp → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU231/CitizenPPU231.cpp View File

@@ -32,6 +32,7 @@ CitizenPPU231::CitizenPPU231()
mLineSize = CCitizenPPU231::LineSize;
mAutoDetectable = false;
mPrintingStringTimeout = 100;
mRussianCodePage = '\x07';
}

//--------------------------------------------------------------------------------

3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenPPU231/CitizenPPU231.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU231/CitizenPPU231.h View File


3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenPPU231/CitizenPPU231Constants.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU231/CitizenPPU231Constants.h View File

@@ -1,74 +1,74 @@
/* @file Константы принтера Citizen PPU-231. */
#pragma once
#include "Hardware/Printers/Tags.h"
//--------------------------------------------------------------------------------
/// Константы, команды и коды состояний принтера Citizen PPU-231.
namespace CCitizenPPU231
{
/// Максимальное количество символов в строке.
const int LineSize = 48;
/// Статусы.
class CStatuses : public CSpecification<int, int>
{
public:
CStatuses()
{
append(0, PrinterStatusCode::Warning::PaperNearEnd);
append(2, PrinterStatusCode::Error::PaperEnd);
append(4, DeviceStatusCode::Error::NotAvailable);
}
};
static CStatuses Statuses;
//--------------------------------------------------------------------------------
/// Штрих-коды.
namespace Barcode
{
const char CodeSystem128 = '\x07'; /// Система штрих-кода - CODE128.
const char Code128Spec = 'B'; /// Cпецификация (уточнение, подвид) системы Code128.
const char Postfix = ASCII::NUL; /// Постфикс.
}
//--------------------------------------------------------------------------------
/// Таймауты, [мс].
namespace Timeouts
{
/// Ожидание прихода XOn-а.
const int Full = 30 * 1000;
/// Ожидание реакции на статус.
const int Status = 500;
}
/// Интервалы поллинга, [мс].
namespace PollIntervals
{
/// при ожидании реакции на статус.
const int Status = 100;
}
//----------------------------------------------------------------------------
/// Теги.
class TagEngine : public Tags::Engine
{
public:
TagEngine()
{
QByteArray prefix("\x1B\x21");
appendCommon(Tags::Type::Bold, prefix, "\x08");
appendCommon(Tags::Type::DoubleWidth, prefix, "\x20");
appendCommon(Tags::Type::DoubleHeight, prefix, "\x10");
appendCommon(Tags::Type::UnderLine, prefix, "\x80");
set(Tags::Type::BarCode);
}
};
}
//--------------------------------------------------------------------------------
/* @file Константы принтера Citizen PPU-231. */
#pragma once
#include "Hardware/Printers/Tags.h"
//--------------------------------------------------------------------------------
/// Константы, команды и коды состояний принтера Citizen PPU-231.
namespace CCitizenPPU231
{
/// Максимальное количество символов в строке.
const int LineSize = 48;
/// Статусы.
class CStatuses : public CSpecification<int, int>
{
public:
CStatuses()
{
append(0, PrinterStatusCode::Warning::PaperNearEnd);
append(2, PrinterStatusCode::Error::PaperEnd);
append(4, DeviceStatusCode::Error::NotAvailable);
}
};
static CStatuses Statuses;
//--------------------------------------------------------------------------------
/// Штрих-коды.
namespace Barcode
{
const char CodeSystem128 = '\x07'; /// Система штрих-кода - CODE128.
const char Code128Spec = 'B'; /// Cпецификация (уточнение, подвид) системы Code128.
const char Postfix = ASCII::NUL; /// Постфикс.
}
//--------------------------------------------------------------------------------
/// Таймауты, [мс].
namespace Timeouts
{
/// Ожидание прихода XOn-а.
const int Full = 30 * 1000;
/// Ожидание реакции на статус.
const int Status = 500;
}
/// Интервалы поллинга, [мс].
namespace PollIntervals
{
/// при ожидании реакции на статус.
const int Status = 100;
}
//----------------------------------------------------------------------------
/// Теги.
class TagEngine : public Tags::Engine
{
public:
TagEngine()
{
QByteArray prefix("\x1B\x21");
appendCommon(Tags::Type::Bold, prefix, "\x08");
appendCommon(Tags::Type::DoubleWidth, prefix, "\x20");
appendCommon(Tags::Type::DoubleHeight, prefix, "\x10");
appendCommon(Tags::Type::UnderLine, prefix, "\x80");
set(Tags::Type::BarCode);
}
};
}
//--------------------------------------------------------------------------------

3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CitizenPPU700.cpp → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU700/CitizenPPU700.cpp View File

@@ -43,10 +43,6 @@ CitizenPPU700::CitizenPPU700()
parameters.errors->data()[6][1].insert('\x20', PrinterStatusCode::Error::Presenter);
parameters.errors->data()[6][1].insert('\x40', DeviceStatusCode::Error::Electronic);

// теги
parameters.tagEngine->appendCommon(Tags::Type::DoubleWidth, "\x1B\x21", "\x20");
parameters.tagEngine->appendCommon(Tags::Type::DoubleHeight, "\x1B\x21", "\x10");

// параметры моделей
mDeviceName = "Citizen PPU-700";
mModelID = '\x75';

3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CitizenPPU700.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU700/CitizenPPU700.h View File

@@ -2,7 +2,8 @@

#pragma once

#include "Common/EjectorPOS.h"
#include "../CitizenBase.h"
#include "../../EjectorPOS/EjectorPOS.h"

//--------------------------------------------------------------------------------
namespace CCitizenPPU700
@@ -16,7 +17,7 @@ namespace CCitizenPPU700
}

//--------------------------------------------------------------------------------
class CitizenPPU700 : public EjectorPOS
class CitizenPPU700 : public CitizenBase<EjectorPOS>
{
SET_SUBSERIES("CitizenPPU700")


3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenCTS310II.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/CitizenBase.h View File

@@ -41,6 +41,7 @@ CitizenCTS310II::CitizenCTS310II()
setConfigParameter(CHardware::Printer::FeedingAmount, 3);
mDeviceName = "Citizen CT-S310II";
mModelID = '\x3D';
mRussianCodePage = '\x07';

// модели
mModelData.data().clear();

3.0/src/modules/Hardware/Printers/src/POSPrinters/CustomPrinters.cpp → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomPrinters.cpp View File


3.0/src/modules/Hardware/Printers/src/POSPrinters/CustomPrinters.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomPrinters.h View File


3.0/src/modules/Hardware/Printers/src/POSPrinters/CustomTG2480H.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomTG2480H.h View File


3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CustomVKP80.cpp → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80.cpp View File


3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CustomVKP80.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80.h View File

@@ -2,7 +2,7 @@

#pragma once

#include "Common/EjectorPOS.h"
#include "../../EjectorPOS/EjectorPOS.h"

//--------------------------------------------------------------------------------
/// Константы принтера Custom VKP-80.

3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CustomVKP80III.cpp → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80III.cpp View File


3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/CustomVKP80III.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80III.h View File


3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/Common/EjectorPOS.cpp → 3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/EjectorPOS.cpp View File


3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/Common/EjectorPOS.h → 3.0/src/modules/Hardware/Printers/src/POSPrinters/EjectorPOS/EjectorPOS.h View File


+ 0
- 1
3.0/src/modules/Hardware/Printers/src/POSPrinters/Epson/EpsonEUT400.cpp View File

@@ -42,7 +42,6 @@ EpsonEUT400::EpsonEUT400()
// параметры моделей
mDeviceName = "Epson EU-T400";
mModelID = '\x27';
mRussianCodePage = '\x11';
mIOMessageLogging = ELoggingType::Write;
setConfigParameter(CHardware::Printer::FeedingAmount, 0);
setConfigParameter(CHardware::Printer::Commands::Cutting, CEpsonEUT400::Command::CutBackFeed);


+ 8
- 0
3.0/src/modules/NetworkTaskManager/src/FileDataStream.cpp View File

@@ -33,3 +33,11 @@ bool FileDataStream::write(const QByteArray & aData)
}

//------------------------------------------------------------------------
qint64 FileDataStream::size() const
{
QFile * file = dynamic_cast<QFile *>(m_stream.data());

return file->size();
}

//------------------------------------------------------------------------

+ 2
- 0
3.0/src/modules/NetworkTaskManager/src/FileDataStream.h View File

@@ -15,6 +15,8 @@ public:

virtual bool clear();
virtual bool write(const QByteArray & aData);

virtual qint64 size() const;
};

//------------------------------------------------------------------------

+ 2
- 0
3.0/src/modules/NetworkTaskManager/src/NetworkTask.h View File

@@ -87,7 +87,9 @@ public:
void setTag(const QVariant & aTag);
const QVariant & getTag() const;

/// Возвращает размер скачиваемого контента в байтах. Будет не нулевым после получения первого пакета с данными.
qint64 getSize() const;

qint64 getCurrentSize() const;

/// Указатель забирает внутрь, память освобождает самостоятельно.


+ 17
- 8
3.0/src/modules/NetworkTaskManager/src/NetworkTaskManager.cpp View File

@@ -249,27 +249,36 @@ void NetworkTaskManager::onTaskReadyRead()
}

case 200: // Успех.
case 206: // Успех частичнного скачивания.
case 206: // Успех частичного скачивания.
{
if (task->getSize() == 0)
if (task->getSize() == 0) // выполняем этот код, только в момент получения первого пакета данных
{
if (statusCode == 200)
QString contentRange = QString::fromLatin1(reply->rawHeader("Content-Range"));

if (contentRange.isEmpty())
{
// Если запрашивали кусок данных, а пришел файл целиком - нужно начинать писать поток с 0-го байта
task->getDataStream()->clear();
}
else
else
{
// Если запрашивали кусок данных позиционируем на начало передаваемого диапазона
// Если запрашивали кусок данных, позиционируем на начало передаваемого диапазона
// http://tools.ietf.org/html/rfc2616#section-14.16
QRegExp rx("(\\d+)\\-\\d+/\\d+");

if (rx.indexIn(QString::fromLatin1(reply->rawHeader("Content-Range"))) > 0)
if (rx.indexIn(contentRange) > 0)
{
task->getDataStream()->seek(rx.cap(1).toLongLong());
qint64 pos = rx.cap(1).toLongLong();

if (!task->getDataStream()->seek(pos))
{
toLog(LogLevel::Error, QString("Content-Range: %1. Error seek stream to position: %2.").arg(contentRange).arg(pos));
}
}
else
{
toLog(LogLevel::Error, QString("Can't parse Content-Range: %1.").arg(contentRange));

task->getDataStream()->clear();
}
}
@@ -290,7 +299,7 @@ void NetworkTaskManager::onTaskReadyRead()
}

default:
toLog(LogLevel::Error, QString("Data is ready for read, but responce code is incorrect: %1").arg(httpStatusCode.toString()));
toLog(LogLevel::Error, QString("Data is ready for read, but response code is incorrect: %1").arg(httpStatusCode.toString()));
reply->abort();
}
}


+ 46
- 23
3.0/src/modules/UpdateEngine/src/Updater.cpp View File

@@ -396,6 +396,16 @@ void Updater::download()
}

//---------------------------------------------------------------------------
void closeFileTask(NetworkTask * aTask)
{
auto fileTask = qobject_cast<FileDownloadTask *>(aTask);
if (fileTask)
{
fileTask->closeFile();
}
}

//---------------------------------------------------------------------------
void Updater::downloadComplete()
{
auto task = mActiveTasks.front();
@@ -416,6 +426,8 @@ void Updater::downloadComplete()
{
Log(LogLevel::Normal, QString("File %1 downloaded successfully.").arg(task->getUrl().toString()));

closeFileTask(task);

return goToNextFile();
}

@@ -429,20 +441,8 @@ void Updater::downloadComplete()

if (task->getError() == NetworkTask::VerifyFailed || task->getHttpError() == 416) // 416 - Requested Range Not Satisfiable
{
IHashVerifier * verifier = dynamic_cast<IHashVerifier *>(task->getVerifier());
checkTaskVerifierResult(task);

if (verifier)
{
Log(LogLevel::Error, QString("Failed verify. Downloaded file hash:%1 required_hash:%2. Remove temporary file")
.arg(verifier->calculatedHash()).arg(verifier->referenceHash()));
}
else
{
Log(LogLevel::Error, "Failed verify downloaded file. Remove temporary file");
}

QMetaObject::invokeMethod(task, "resetFile", Qt::DirectConnection);
mCurrentTaskSize = 0;
nextTryTimeout = 1;

if (task->property(CComponent::OptionalTask()).toBool())
@@ -494,6 +494,26 @@ void Updater::downloadComplete()
}

//---------------------------------------------------------------------------
void Updater::checkTaskVerifierResult(NetworkTask * aTask)
{
IHashVerifier * verifier = dynamic_cast<IHashVerifier *>(aTask->getVerifier());

if (verifier)
{
Log(LogLevel::Error, QString("Failed verify. Downloaded file hash:%1 required_hash:%2. Remove temporary file")
.arg(verifier->calculatedHash()).arg(verifier->referenceHash()));
}
else
{
Log(LogLevel::Error, "Failed verify downloaded file. Remove temporary file");
}

QMetaObject::invokeMethod(aTask, "resetFile", Qt::DirectConnection);
mCurrentTaskSize = 0;
}

//---------------------------------------------------------------------------
void Updater::showProgress()
{
if (mAllTasksCount > 0)
@@ -904,6 +924,7 @@ void Updater::downloadPackage()
Log(LogLevel::Normal, QString("Downloading file %1...").arg(mConfigURL));

// Запускаем закачку.
mCurrentTaskSize = task->getDataStream()->size();
mNetworkTaskManager.addTask(task);
}
}
@@ -914,15 +935,14 @@ void Updater::packageDownloaded(QObject * aPackage)
auto task = qobject_cast<NetworkTask *>(mMapper.mapping(aPackage));
auto package = qobject_cast<Package *>(aPackage);

bool haveNewData = (mCurrentTaskSize != task->getDataStream()->size());
bool retryCountReached = ++mFailCount >= CUpdater::MaxFails;

if (!task->getError() || task->getError() == NetworkTask::TaskFailedButVerified)
{
Log(LogLevel::Normal, QString("File %1.zip was downloaded sucessfully.").arg(package->getId()));
Log(LogLevel::Normal, QString("File %1.zip was downloaded successfully.").arg(package->getId()));

auto fileTask = qobject_cast<FileDownloadTask *>(task);
if (fileTask)
{
fileTask->closeFile();
}
closeFileTask(task);

deployDownloadedPackage(package);
}
@@ -930,7 +950,12 @@ void Updater::packageDownloaded(QObject * aPackage)
{
Log(LogLevel::Error, QString("Failed to download file %1. Network error: %2.").arg(package->getId()).arg(task->errorString()));

if (mFailCount >= CUpdater::MaxFails)
if (task->getError() && task->getHttpError() == 416) // 416 - Requested Range Not Satisfiable
{
checkTaskVerifierResult(task);
}

if (retryCountReached)
{
emit done(CUpdaterErrors::NetworkError);
}
@@ -948,9 +973,7 @@ void Updater::packageDownloaded(QObject * aPackage)
Log(LogLevel::Error, QString("Waiting %1 minutes before next try...").arg(CUpdater::MinutesBeforeNextTry));
}

// Инициируем повторную попытку.
mFailCount++;

closeFileTask(task);
QTimer::singleShot(timeout, this, SLOT(downloadPackage()));
}
}


+ 3
- 0
3.0/src/modules/UpdateEngine/src/Updater.h View File

@@ -143,6 +143,9 @@ private slots:
void showProgress();

private:
/// Обработка результатов проверки контрольной суммы
void checkTaskVerifierResult(NetworkTask * task);

/// Сохранить текущую конфигурацию на диске
void saveUpdateConfiguration();


Loading…
Cancel
Save