Browse Source

refs #1 Synchronize with release commit: f34fee94aa

tags/3.14.1.202107221253
parent
commit
68043fe359
100 changed files with 1231 additions and 331 deletions
  1. +1
    -1
      3.0/scripts/build/runtimes/terminal_ru.xml
  2. +10
    -1
      3.0/src/apps/PaymentProcessor/src/Services/CashAcceptorManager.cpp
  3. +33
    -23
      3.0/src/apps/PaymentProcessor/src/Services/DeviceService.cpp
  4. +5
    -2
      3.0/src/apps/PaymentProcessor/src/Services/DeviceService.h
  5. +14
    -3
      3.0/src/apps/PaymentProcessor/src/Services/PluginService.cpp
  6. +2
    -0
      3.0/src/apps/PaymentProcessor/src/Services/PrintConstants.h
  7. +20
    -29
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp
  8. +2
    -1
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.h
  9. +7
    -0
      3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp
  10. +2
    -2
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_de.ts
  11. +2
    -2
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_en.ts
  12. +2
    -2
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_kk.ts
  13. +2
    -2
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_ru.ts
  14. +9
    -2
      3.0/src/includes/Hardware/CashAcceptors/SerialCashAcceptor.h
  15. +1
    -0
      3.0/src/includes/Hardware/Common/ExternalPortDeviceBase.h
  16. +1
    -0
      3.0/src/includes/Hardware/Common/HardwareConstants.h
  17. +31
    -0
      3.0/src/includes/Hardware/IOPorts/IOPortTypeData.h
  18. +22
    -2
      3.0/src/includes/Hardware/Plugins/CommonParameters.h
  19. +2
    -0
      3.0/src/includes/Hardware/Printers/PortPrintersBase.h
  20. +19
    -4
      3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h
  21. +1
    -0
      3.0/src/includes/SDK/Drivers/FR/FiscalFields.h
  22. +9
    -0
      3.0/src/includes/SDK/Drivers/HardwareConstants.h
  23. +38
    -0
      3.0/src/includes/SDK/Drivers/ICardMachine.h
  24. +2
    -0
      3.0/src/includes/SDK/Drivers/IIOPort.h
  25. +67
    -0
      3.0/src/includes/SDK/Drivers/IOPort/VCOMData.h
  26. +1
    -1
      3.0/src/includes/SDK/Drivers/InteractionTypes.h
  27. +1
    -1
      3.0/src/includes/SDK/PaymentProcessor/Core/IDeviceService.h
  28. +2
    -1
      3.0/src/includes/SDK/PaymentProcessor/Payment/Amount.h
  29. +6
    -5
      3.0/src/includes/SDK/PaymentProcessor/Payment/Parameters.h
  30. +4
    -0
      3.0/src/includes/SDK/PaymentProcessor/Scripting/Settings.h
  31. +1
    -1
      3.0/src/includes/SDK/Plugins/PluginParameters.h
  32. +2
    -0
      3.0/src/interface/modern/controls/input_field.qml
  33. +2
    -7
      3.0/src/interface/modern/locale/root_groups_de.ts
  34. +2
    -7
      3.0/src/interface/modern/locale/root_groups_en.ts
  35. +1
    -1
      3.0/src/interface/modern/locale/root_groups_kk.ts
  36. +2
    -7
      3.0/src/interface/modern/locale/root_groups_ru.ts
  37. +9
    -30
      3.0/src/interface/modern/payment_method_selector_scene.qml
  38. +2
    -3
      3.0/src/interface/modern/scenario/card_ucs_charge_scenario.js
  39. +11
    -8
      3.0/src/interface/modern/scenario/payment_scenario.js
  40. +12
    -9
      3.0/src/interface/modern/scripts/gui.js
  41. +1
    -2
      3.0/src/interface/modern/scripts/root_groups.js
  42. +1
    -0
      3.0/src/interface/modern/widgets/qmldir
  43. +108
    -0
      3.0/src/interface/modern/widgets/validator_editor.qml
  44. +176
    -11
      3.0/src/modules/DeviceManager/src/DeviceManager.cpp
  45. +24
    -21
      3.0/src/modules/DeviceManager/src/DeviceManager.h
  46. +2
    -0
      3.0/src/modules/Hardware/Cardreaders/src/Creator/CreatorReader.h
  47. +4
    -2
      3.0/src/modules/Hardware/Cardreaders/src/IDTech/IDTechReader.h
  48. +1
    -0
      3.0/src/modules/Hardware/CashAcceptors/msvc/CashAcceptors.vcxproj
  49. +3
    -0
      3.0/src/modules/Hardware/CashAcceptors/msvc/CashAcceptors.vcxproj.filters
  50. +1
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashAcceptorBase.cpp
  51. +2
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashAcceptorBase.h
  52. +1
    -0
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashcodeGX.h
  53. +1
    -0
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCreator.h
  54. +1
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/FirmwareVersions.h
  55. +3
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/CCTalk/CCTalkCashAcceptor.h
  56. +1
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/EBDS/EBDSCashAcceptor.h
  57. +2
    -2
      3.0/src/modules/Hardware/CashAcceptors/src/ICT/ICTCashAcceptor.cpp
  58. +1
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/ICT/ICTCashAcceptor.h
  59. +1
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/ID003/ID003CashAcceptor.h
  60. +2
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/SSP/SSPCashAcceptor.h
  61. +1
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/V2e/V2eCashAcceptor.h
  62. +5
    -4
      3.0/src/modules/Hardware/CashDevices/src/CCTalk/CCTalkModelData.h
  63. +4
    -0
      3.0/src/modules/Hardware/CoinAcceptors/src/CCTalk/CCTalkCoinAcceptorBase.h
  64. +4
    -0
      3.0/src/modules/Hardware/CoinAcceptors/src/CCTalk/CCTalkComplexEnableCoinAcceptor.h
  65. +1
    -1
      3.0/src/modules/Hardware/CoinAcceptors/src/CoinAcceptorBase.h
  66. +8
    -6
      3.0/src/modules/Hardware/Common/msvc/Common.vcxproj
  67. +12
    -0
      3.0/src/modules/Hardware/Common/msvc/Common.vcxproj.filters
  68. +10
    -24
      3.0/src/modules/Hardware/Common/src/Base/DeviceBase.cpp
  69. +4
    -3
      3.0/src/modules/Hardware/Common/src/Base/DeviceBase.h
  70. +20
    -0
      3.0/src/modules/Hardware/Common/src/ConfigManager/DeviceConfigManager.cpp
  71. +43
    -0
      3.0/src/modules/Hardware/Common/src/ExternalPort/ExternalPortDeviceBase.cpp
  72. +25
    -0
      3.0/src/modules/Hardware/Common/src/ExternalPort/ExternalPortDeviceBase.h
  73. +10
    -0
      3.0/src/modules/Hardware/Common/src/Meta/MetaDevice.cpp
  74. +3
    -0
      3.0/src/modules/Hardware/Common/src/Meta/MetaDevice.h
  75. +3
    -3
      3.0/src/modules/Hardware/Common/src/OPOS/OPOSPollingDeviceBase.cpp
  76. +1
    -1
      3.0/src/modules/Hardware/Common/src/OPOS/OPOSPollingDeviceBase.h
  77. +14
    -12
      3.0/src/modules/Hardware/Common/src/Polling/PollingDeviceBase.cpp
  78. +3
    -1
      3.0/src/modules/Hardware/Common/src/Polling/PollingDeviceBase.h
  79. +8
    -17
      3.0/src/modules/Hardware/Common/src/Port/PortDeviceBase.cpp
  80. +8
    -6
      3.0/src/modules/Hardware/Common/src/Port/Serial/SerialDeviceBase.cpp
  81. +7
    -0
      3.0/src/modules/Hardware/Common/src/Port/Serial/SerialDeviceBase.h
  82. +2
    -2
      3.0/src/modules/Hardware/Common/src/PortPolling/PortPollingDeviceBase.cpp
  83. +1
    -1
      3.0/src/modules/Hardware/Common/src/PortPolling/PortPollingDeviceBase.h
  84. +14
    -10
      3.0/src/modules/Hardware/Common/src/Utils/Port/SerialDeviceUtils.cpp
  85. +40
    -3
      3.0/src/modules/Hardware/Common/src/Utils/Port/SerialDeviceUtils.h
  86. +28
    -4
      3.0/src/modules/Hardware/Common/src/Utils/Port/SystemDeviceUtils.cpp
  87. +16
    -4
      3.0/src/modules/Hardware/Common/src/Utils/Port/SystemDeviceUtils.h
  88. +38
    -1
      3.0/src/modules/Hardware/Common/src/Virtual/VirtualDeviceBase.cpp
  89. +9
    -0
      3.0/src/modules/Hardware/Common/src/Virtual/VirtualDeviceBase.h
  90. +1
    -1
      3.0/src/modules/Hardware/Common/src/locale/common_ru.ts
  91. +6
    -1
      3.0/src/modules/Hardware/FR/msvc/FR.vcxproj
  92. +20
    -2
      3.0/src/modules/Hardware/FR/msvc/FR.vcxproj.filters
  93. +1
    -0
      3.0/src/modules/Hardware/FR/src/Atol/AtolModelData.cpp
  94. +1
    -0
      3.0/src/modules/Hardware/FR/src/Atol/AtolModelData.h
  95. +2
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolFRBase.h
  96. +2
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Ejector/AtolEjectorFR.h
  97. +20
    -19
      3.0/src/modules/Hardware/FR/src/Atol/Online/ATOL5/Atol5OnlineFRBase.cpp
  98. +3
    -1
      3.0/src/modules/Hardware/FR/src/Atol/Online/ATOL5/Atol5OnlineFRBase.h
  99. +38
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Online/ATOL5/Proto/ProtoAtol5FR.h
  100. +97
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Online/ATOL5/Proto/SerialProtoAtol5FR.cpp

+ 1
- 1
3.0/scripts/build/runtimes/terminal_ru.xml View File

@@ -36,7 +36,7 @@
<option target="interface/interface/modern/interface.ini" key="ui/icon_set" value="modern" />
<option target="interface/interface/modern/interface.ini" key="ui/layouts" value="ru,en" />
<!-- Настройка ГосУслуг -->
<option target="interface/interface/modern/interface.ini" key="ui/use_smart_grid" value="9144,9176,9196,9200,9209,9210,9211" />
<option target="interface/interface/modern/interface.ini" key="ui/use_smart_grid" value="9144,9176,9196,9200,9209,9210,9211,9258" />
<!-- Настройка автоматического перевода остатка на ПК -->
<option target="interface/interface/modern/interface.ini" key="ui/use_platru_changeback" value="true" />


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

@@ -12,6 +12,7 @@
#include <SDK/PaymentProcessor/Core/IPaymentService.h>
#include <SDK/PaymentProcessor/Payment/Parameters.h>
#include <SDK/PaymentProcessor/Settings/TerminalSettings.h>
#include <SDK/PaymentProcessor/Settings/DealerSettings.h>

// Driver SDK
#include <SDK/Drivers/WarningLevel.h>
@@ -148,8 +149,16 @@ QStringList CashAcceptorManager::getPaymentMethods()
{
PPSDK::IPaymentService * ps = mApplication->getCore()->getPaymentService();
qint64 id = ps->getActivePayment();
QString procType = ps->getPaymentField(id, PPSDK::CPayment::Parameters::Type).value.toString();
qint64 providerId = ps->getPaymentField(id, PPSDK::CPayment::Parameters::Provider).value.toInt();
PPSDK::SProvider provider = SettingsService::instance(mApplication)->getAdapter<PPSDK::DealerSettings>()->getProvider(providerId);

// Разрешенные способы оплаты в описании оператора имеют более высокий приоритет по сравнению с системными настройками
if (!provider.isNull() && !provider.paymentMethods.isEmpty())
{
return provider.paymentMethods;
}
QString procType = ps->getPaymentField(id, PPSDK::CPayment::Parameters::Type).value.toString();
PPSDK::TerminalSettings * settings = SettingsService::instance(mApplication)->getAdapter<PPSDK::TerminalSettings>();
QVariantMap chargeAccess = settings->getChargeProviderAccess();


+ 33
- 23
3.0/src/apps/PaymentProcessor/src/Services/DeviceService.cpp View File

@@ -4,6 +4,7 @@
#include <Common/QtHeadersBegin.h>
#include <QtCore/QtConcurrentRun>
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <Common/QtHeadersEnd.h>

// STL
@@ -18,6 +19,9 @@
#include <SDK/Drivers/HardwareConstants.h>
#include <SDK/Drivers/FR/FiscalFields.h>

// Common
#include <Common/PluginConstants.h>

// Modules
#include "DeviceManager/DeviceManager.h"

@@ -201,18 +205,18 @@ DeviceService::~DeviceService()
}

//------------------------------------------------------------------------------
void DeviceService::detect(const QString & aFilter)
void DeviceService::detect(bool aFast, const QString & aFilter)
{
mAccessMutex.lock();

mDetectionResult.setFuture(QtConcurrent::run(this, &DeviceService::doDetect, aFilter));
mDetectionResult.setFuture(QtConcurrent::run(this, &DeviceService::doDetect, aFast, aFilter));
}

//------------------------------------------------------------------------------
void DeviceService::doDetect(const QString & aFilter)
void DeviceService::doDetect(bool aFast, const QString & aFilter)
{
LOG(mLog, LogLevel::Normal, "Starting device detection...");
mDeviceManager->detect(aFilter);
LOG(mLog, LogLevel::Normal, QString("Starting %1device detection...").arg(aFast ? "fast " : ""));
mDeviceManager->detect(aFast, aFilter);
}

//------------------------------------------------------------------------------
@@ -285,15 +289,7 @@ DSDK::IDevice * DeviceService::acquireDevice(const QString & aInstancePath)
{
mAcquiredDevices.insert(instancePath, device);

QMap<int, PPSDK::SKeySettings> keys = SettingsService::instance(mApplication)->getAdapter<PPSDK::TerminalSettings>()->getKeys();

if (keys.contains(0))
{
QVariantMap configuration;
configuration.insert(CFiscalSDK::AutomaticNumber, keys.value(0).ap);
device->setDeviceConfiguration(configuration);
}

setInitializationData(TNamedDevice(instancePath, device));
initializeDevice(instancePath, device);
}

@@ -302,6 +298,28 @@ DSDK::IDevice * DeviceService::acquireDevice(const QString & aInstancePath)
}

//------------------------------------------------------------------------------
void DeviceService::setInitializationData(const TNamedDevice & aNamedDevice)
{
QString dataDirectory = PluginService::instance(mApplication)->getDataDirectory();
QString configurationDirectory = QDir::toNativeSeparators(QDir::cleanPath(dataDirectory + QDir::separator() + "plugins"));

QVariantMap configuration;
configuration.insert(CPluginParameters::ConfigurationDirectory, configurationDirectory);

if (aNamedDevice.first.contains(DSDK::CComponents::FiscalRegistrator))
{
QMap<int, PPSDK::SKeySettings> keys = SettingsService::instance(mApplication)->getAdapter<PPSDK::TerminalSettings>()->getKeys();

if (keys.contains(0))
{
configuration.insert(CFiscalSDK::AutomaticNumber, keys.value(0).ap);
}
}

aNamedDevice.second->setDeviceConfiguration(configuration);
}

//------------------------------------------------------------------------------
void DeviceService::releaseDevice(DSDK::IDevice * aDevice)
{
QMutexLocker lock(&mAccessMutex);
@@ -360,15 +378,7 @@ QString DeviceService::createDevice(const QString & aDriverPath, const QVariantM
{
mAcquiredDevices.insert(result.first, result.second);

QMap<int, PPSDK::SKeySettings> keys = SettingsService::instance(mApplication)->getAdapter<PPSDK::TerminalSettings>()->getKeys();

if (keys.contains(0))
{
QVariantMap configuration;
configuration.insert(CFiscalSDK::AutomaticNumber, keys.value(0).ap);
result.second->setDeviceConfiguration(configuration);
}

setInitializationData(result);
initializeDevice(result.first, result.second);
}
else


+ 5
- 2
3.0/src/apps/PaymentProcessor/src/Services/DeviceService.h View File

@@ -111,7 +111,7 @@ public:
// IDeviceService

/// Неблокирующий поиск всех устройств.
virtual void detect(const QString & aDeviceType);
virtual void detect(bool aFast, const QString & aDeviceType);

/// Прервать поиск устройств.
virtual void stopDetection();
@@ -168,10 +168,13 @@ public:
virtual void overwriteDeviceStatus(SDK::Driver::IDevice * aDevice, SDK::Driver::EWarningLevel::Enum aLevel, const QString & aDescription, int aStatus);

private:
void doDetect(const QString & aDeviceType);
void doDetect(bool aFast, const QString & aDeviceType);
bool initializeDevice(const QString & aConfigName, SDK::Driver::IDevice * aDevice);
void statusChanged(SDK::Driver::IDevice * aDevice, Status & aStatus);

/// Устанавливает данные для инициализации.
void setInitializationData(const TNamedDevice & aNamedDevice);

private slots:
void onDeviceDetected(const QString & aConfigName, SDK::Driver::IDevice * aDevice);
void onDetectionFinished();


+ 14
- 3
3.0/src/apps/PaymentProcessor/src/Services/PluginService.cpp View File

@@ -65,8 +65,15 @@ bool PluginService::initialize()
mPluginLoader->addDirectory(mApplication->getUserPluginPath());

#ifndef _DEBUG
// Запустим фоновую проверку плагинов на наличие цифровой подписи
mPluginVerifierSynchronizer.addFuture(QtConcurrent::run(this, &PluginService::verifyPlugins));
if (QSysInfo::windowsVersion() != QSysInfo::WV_XP)
{
// Запустим фоновую проверку плагинов на наличие цифровой подписи
mPluginVerifierSynchronizer.addFuture(QtConcurrent::run(this, &PluginService::verifyPlugins));
}
else
{
toLog(LogLevel::Warning, "Windows XP found. Skip verify sign plugins.");
}
#endif

return true;
@@ -306,6 +313,9 @@ void PluginService::verifyPlugins()
}
}

#if 1
mUnsignedPlugins.clear();
#else
try
{
auto * eventService = EventService::instance(mApplication);
@@ -318,8 +328,9 @@ void PluginService::verifyPlugins()
}
catch (SDK::PaymentProcessor::ServiceIsNotImplemented & e)
{
toLog(LogLevel::Error, "Exception accured while verify plugins.");
toLog(LogLevel::Error, QString("Exception accured while verify plugins. %1").arg(e.what()));
}
#endif

#else
#pragma warning "PluginService::verifyPlugins not implemented on this platfotm."


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

@@ -58,6 +58,8 @@ namespace CPrintConstants
const char * const TaxAmount04 = "TAX_AMOUNT_04"; // сумма расчета по чеку с НДС по ставке 0% (1104)
const char * const TaxAmount05 = "TAX_AMOUNT_05"; // сумма расчета по чеку без НДС (1105)
}

const char PointAddressExists[] = "point_address_exists";
}

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

+ 20
- 29
3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp View File

@@ -82,34 +82,39 @@ DSDK::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap & aParam

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

unitDataList << DSDK::SUnitData(amount, vat, paymentTitle, operatorINN, DSDK::EPayOffSubjectTypes::Payment);
unitDataList << DSDK::SUnitData(amount, vat, paymentTitle, operatorName, 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();
QVariantList amountTitles = aParameters.value("[AMOUNT_TITLE]").toList();
QVariantList amountsVAT = aParameters.value("[AMOUNT_VAT]").toList();
QVariantList operatorNames = aParameters.value("[OPERATOR_NAME]").toList();
QVariantList operatorINNs = aParameters.value("[OPERATOR_INN]").toList();

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

bool combineFeeWithZeroVAT = aParameters.value("COMBINE_FEE_WITH_ZERO_VAT", false).toBool();
QString feeName = combineFeeWithZeroVAT ? tr("#dealer_bpa_fee") : tr("#dealer_fee");
QString dealerName = aParameters.value(CPrintConstants::DealerName).toString();
QString dealerINN = aParameters.value(CPrintConstants::DealerInn).toString();

if (dealerVAT == 0 && combineFeeWithZeroVAT)
{
@@ -117,24 +122,23 @@ DSDK::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap & aParam

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

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

@@ -290,19 +294,6 @@ bool PrintPayment::print(DSDK::IPrinter * aPrinter, const QVariantMap & aParamet

if (hasFiscalInfo)
{
QString pointAddress = parameters[CPrintConstants::PointAddress].toString();

if (std::find_if(receipt.begin(), receipt.end(), [&pointAddress] (const QString & line) -> bool { return line.contains(pointAddress); }) != receipt.end())
{
foreach (const QString & line, fiscalPart)
{
if (line.contains(pointAddress))
{
fiscalPart.removeAll(line);
}
}
}

receipt.append(fiscalPart);
}



+ 2
- 1
3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.h View File

@@ -35,7 +35,8 @@ namespace CPrintCommands
<< CPrintConstants::BankPhone
<< CPrintConstants::BankAddress
<< CPrintConstants::BankInn
<< CPrintConstants::BankName;
<< CPrintConstants::BankName
<< CPrintConstants::PointAddress;
}

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


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

@@ -343,6 +343,13 @@ int PrintingService::performPrint(PrintCommand * aCommand, const QVariantMap & a
configuration.insert(CHardwareSDK::Printer::ReceiptTemplate, aReceiptTemplate);
printer->setDeviceConfiguration(configuration);

QString regExpData = QString(".*%%1%.*").arg(CPrintConstants::PointAddress);
int index = aReceiptTemplate.indexOf(QRegExp(regExpData));
paymentParameters.insert(CPrintConstants::PointAddressExists, index != -1);

auto amountPrefix = printer->getDeviceConfiguration().value(CHardwareSDK::Printer::AmountPrefix, 0);
paymentParameters.insert(CHardwareSDK::Printer::AmountPrefix, amountPrefix);

bool result = aCommand->print(printer, paymentParameters);

if (result)


+ 2
- 2
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_de.ts View File

@@ -25,7 +25,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="129"/>
<location filename="../Services/PrintingCommands.cpp" line="130"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
@@ -35,7 +35,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="136"/>
<location filename="../Services/PrintingCommands.cpp" line="137"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 2
- 2
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_en.ts View File

@@ -25,7 +25,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="129"/>
<location filename="../Services/PrintingCommands.cpp" line="130"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
@@ -35,7 +35,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="136"/>
<location filename="../Services/PrintingCommands.cpp" line="137"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 2
- 2
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_kk.ts View File

@@ -25,7 +25,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="129"/>
<location filename="../Services/PrintingCommands.cpp" line="130"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
@@ -35,7 +35,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="136"/>
<location filename="../Services/PrintingCommands.cpp" line="137"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 2
- 2
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_ru.ts View File

@@ -25,7 +25,7 @@
<translation>Комиссия БПА</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="129"/>
<location filename="../Services/PrintingCommands.cpp" line="130"/>
<source>#bank_fee</source>
<translation>Комиссия БПА</translation>
</message>
@@ -35,7 +35,7 @@
<translation>Комиссия субагента</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="136"/>
<location filename="../Services/PrintingCommands.cpp" line="137"/>
<source>#processing_fee</source>
<translation>Комиссия КБ Платина</translation>
</message>


+ 9
- 2
3.0/src/includes/Hardware/CashAcceptors/SerialCashAcceptor.h View File

@@ -1,8 +1,15 @@
/* @file  упюроприемник на COM-порту. */

#pragma once

#include "Hardware/Common/PortPollingDeviceBase.h"
#include "Hardware/Common/SerialDeviceBase.h"
#include "Hardware/CashAcceptors/PortCashAcceptor.h"

//--------------------------------------------------------------------------------
typedef PortCashAcceptor<SerialDeviceBase<PortPollingDeviceBase<ProtoCashAcceptor>>> TSerialCashAcceptor;
class SerialCashAcceptor : public PortCashAcceptor<SerialDeviceBase<PortPollingDeviceBase<ProtoCashAcceptor>>>
{
SET_VCOM_DATA(None, ConnectionTypes::COMOnly, None)
};

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

+ 1
- 0
3.0/src/includes/Hardware/Common/ExternalPortDeviceBase.h View File

@@ -0,0 +1 @@
#include "../../../modules/Hardware/Common/src/ExternalPort/ExternalPortDeviceBase.h"

+ 1
- 0
3.0/src/includes/Hardware/Common/HardwareConstants.h View File

@@ -151,6 +151,7 @@ namespace CHardware
const char BlackMark[] = "black_mark";
const char PowerOnReaction[] = "power-on_reaction";
const char OutCall[] = "out_call";
const char BCMaxSize[] = "bar_code_max_size";

/// Команды.
namespace Commands


+ 31
- 0
3.0/src/includes/Hardware/IOPorts/IOPortTypeData.h View File

@@ -0,0 +1,31 @@
/* @file Описатель типов данных портов. */

#pragma once

// SDK
#include <SDK/Drivers/IIOPort.h>

// Modules
#include "Hardware/Common/Specifications.h"

//--------------------------------------------------------------------------------
class CPortTypeData: public CDescription<SDK::Driver::EPortTypes::Enum>
{
public:
CPortTypeData()
{
using namespace SDK::Driver;

append(EPortTypes::Unknown, "Unknown");
append(EPortTypes::COM, "COM");
append(EPortTypes::VirtualCOM, "Virtual COM");
append(EPortTypes::COMEmulator, "COM emulator");
append(EPortTypes::USB, "USB");
append(EPortTypes::TCP, "TCP");
}

};

static CPortTypeData PortTypeData;

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

+ 22
- 2
3.0/src/includes/Hardware/Plugins/CommonParameters.h View File

@@ -149,9 +149,27 @@ struct SNamedList<T1, DSDKIT::ItCOM>
{
QStringList optionalPortSettings = sortParameters(&T1::getOptionalPortSettings);

return createSimpleNamedList<T1>(aModels, aDefault)
TParameterList result = createSimpleNamedList<T1>(aModels, aDefault)
<< SPluginParameter(CHardwareSDK::RequiredResource, SPluginParameter::Text, false, CPPT::RequiredResource, QString(), "Common.Driver.IOPort.System.COM", QVariantMap(), true)
<< SPluginParameter(CHardwareSDK::OptionalPortSettings, false, QString(), QString(), optionalPortSettings[0], optionalPortSettings, true);

QString VCOMType = T1::getVCOMType();
QStringList VCOMTags = T1::getVCOMTags();
QString VCOMConnectionType = T1::getVCOMConnectionType();

if (!VCOMConnectionType.isEmpty())
{
using namespace SDK::Driver::VCOM;

QVariantMap VCOMData;
VCOMData.insert(CHardwareSDK::VCOMType, VCOMType);
VCOMData.insert(CHardwareSDK::VCOMTags, VCOMTags);
VCOMData.insert(CHardwareSDK::VCOMConnectionType, VCOMConnectionType);

result << SPluginParameter(CHardwareSDK::VCOMData, false, QString(), QString(), VCOMData, QStringList(), true);
}

return result;
}
};

@@ -267,7 +285,7 @@ inline SPluginParameter setExcludedParameters(const QStringList & aParameters)

//------------------------------------------------------------------------------
/// Исключенные параметры для устройства на COM-порту.
inline SPluginParameter setSerialPortExcludedParameters()
inline SPluginParameter setSerialPortExcludedParameters(const QString & aIncludedParameter = "")
{
QStringList serialPortParameters = QStringList()
<< COMPortSDK::BaudRate
@@ -277,6 +295,8 @@ inline SPluginParameter setSerialPortExcludedParameters()
<< COMPortSDK::ByteSize
<< COMPortSDK::StopBits;

serialPortParameters.removeAll(aIncludedParameter);

return setExcludedParameters(serialPortParameters);
}



+ 2
- 0
3.0/src/includes/Hardware/Printers/PortPrintersBase.h View File

@@ -8,6 +8,8 @@
template <class T>
class SerialPrinterBase : public PortPrinterBase<T>
{
SET_VCOM_DATA(None, ConnectionTypes::COMOnly, None)

public:
/// Получение списка настроек порта, необязательных для редактирования пользователем.
static QStringList getOptionalPortSettings()


+ 19
- 4
3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h View File

@@ -196,16 +196,31 @@ struct SUnitData
{
TSum sum; /// Сумма платежа.
TVAT VAT; /// НДС (value added tax).
QString name; /// Локализованное название платежа (товар).
QString providerINN; /// ИНН поставщика товара (оператор/дилер/Платина).
QString name; /// Локализованное название платежа (1030, Билайн).
QString providerName; /// Наименование поставщика товара (1225, ПАО Вымпелком).
QString providerINN; /// ИНН поставщика товара (1226, оператор/дилер/Платина).
EPayOffSubjectTypes::Enum payOffSubjectType; /// Признак предмета расчета (1212).
EPayOffSubjectMethodTypes::Enum payOffSubjectMethodType; /// Признак способа расчета (1214).
int section; /// Отдел.

SUnitData() : sum(0), VAT(0), payOffSubjectType(EPayOffSubjectTypes::None), payOffSubjectMethodType(EPayOffSubjectMethodTypes::None), section(-1) {}
SUnitData(double aSum, TVAT aVAT, const QString & aName, const QString & aProviderINN, EPayOffSubjectTypes::Enum aPayOffSubjectType, int aSection = -1,
SUnitData(
double aSum,
TVAT aVAT,
const QString & aName,
const QString & aProviderName,
const QString & aProviderINN,
EPayOffSubjectTypes::Enum aPayOffSubjectType,
int aSection = -1,
EPayOffSubjectMethodTypes::Enum aPayOffSubjectMethodType = EPayOffSubjectMethodTypes::Full):
sum(aSum), VAT(aVAT), name(aName), providerINN(aProviderINN), payOffSubjectType(aPayOffSubjectType), payOffSubjectMethodType(aPayOffSubjectMethodType), section(aSection) {}
sum(aSum),
VAT(aVAT),
name(aName),
providerName(aProviderName),
providerINN(aProviderINN),
payOffSubjectType(aPayOffSubjectType),
payOffSubjectMethodType(aPayOffSubjectMethodType),
section(aSection) {}
};

typedef QList<SUnitData> TUnitDataList;


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

@@ -51,6 +51,7 @@ namespace SDK { namespace Driver { namespace CAllHardware { namespace FiscalFiel

// Данные поставщика
const char ProviderPhone[] = "provider_phone"; // 1171 (Телефон поставщика).
const char ProviderName[] = "provider_name"; // 1225 (Наименование поставщика).
const char ProviderINN[] = "provider_inn"; // 1226 (ИНН поставщика).

// Данные платежного агента


+ 9
- 0
3.0/src/includes/SDK/Drivers/HardwareConstants.h View File

@@ -33,6 +33,13 @@ namespace CAllHardware
const char PluginDirectory[] = "plugin_directory";
const char LogDirectory[] = "log_directory";
const char DataDirectory[] = "data_directory";
const char VCOMData[] = "vcom_data";
const char VCOMType[] = "vcom_type";
const char VCOMTags[] = "vcom_tags";
const char VCOMConnectionType[] = "serial_connection";
const char Tag[] = "tag";
const char Type[] = "type";
const char FastAutoSearching[] = "fast_auto_searching";

/// Значения настроек.
namespace Values
@@ -81,6 +88,7 @@ namespace CAllHardware
const char WithoutPrinting[] = "without_printing";
const char CanWithoutPrinting[] = "can_without_printing";
const char NullingSumInCash[] = "nulling_sum_in_cash";
const char RewriteCashier[] = "rewrite_cashier";
}

/// Константы принтера.
@@ -92,6 +100,7 @@ namespace CAllHardware
const char ServiceOperation[] = "service_operation";
const char BlockTerminalOnError[] = "block_terminal_on_error";
const char OFDNotSentError[] = "ofd_not_sent_error";
const char AmountPrefix[] = "amount_prefix";
}

/// Константы HID-устройств.


+ 38
- 0
3.0/src/includes/SDK/Drivers/ICardMachine.h View File

@@ -0,0 +1,38 @@
/* @file Интерфейс банковского POS-терминала. */
#pragma once

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QObject>
#include <Common/QtHeadersEnd.h>

// SDK
#include <SDK/PaymentProcessor/Payment/Amount.h>

//------------------------------------------------------------------------------
namespace SDK {
namespace Driver {

class ICardMachine
{
public:
/// Списание денег выполнено.
static const char * SaleCompleteSignal; // = SIGNAL(saleComplete(double aAmount, int aCurrency, const QString & aRRN, const QString & aConfirmationCode, const QStringList& aReceipt))));

/// Вывести сообщение в интерфейсе.
static const char * MessageSignal; // = SIGNAL(message(const QString & aMessage));

/// Начать процедуру оплаты
virtual bool sale(SDK::PaymentProcessor::TPaymentAmount aAmount) = 0;

/// Отсоединиться
virtual void disable() = 0;

protected:
virtual ~ICardMachine() {}
};

}} // namespace SDK::Driver


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

+ 2
- 0
3.0/src/includes/SDK/Drivers/IIOPort.h View File

@@ -91,4 +91,6 @@ protected:

}} // namespace SDK::Driver

Q_DECLARE_METATYPE(SDK::Driver::EPortTypes::Enum);

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

+ 67
- 0
3.0/src/includes/SDK/Drivers/IOPort/VCOMData.h View File

@@ -0,0 +1,67 @@
/* @file Данные виртуальных COM-портов. */

#pragma once

namespace SDK {
namespace Driver {
namespace VCOM {

const char None[] = "";

/// Идентификаторы производителей устройств.
namespace ManufacturerTags
{
// Фискальные регистраторы.
namespace FR
{
const char Atol[] = "Atol"; // АТОЛы и Казначей
const char MStar[] = "MSTAR"; // MSTAR-TK, MSTAR-TUP-K (OPOS) или MSTAR-TK2
const char Virtual[] = "com0com"; // только NeoService
}

// Модемы. Но его на порту может и не быть, если unmanaged connection.
namespace Modem
{
const char Huawei[] = "Huawei";
const char Siemens[] = "Siemens";
const char SimTech[] = "SimTech HS-USB";
}

// Сканеры.
namespace Scanner
{
const char AreaImager[] = "Area Imager"; // сканер, но только если не найдётся на USB
}
}

/// Идентификаторы виртуальных портов, на которых находятся устройства.
namespace AdapterTags
{
// Silicon Labs CP210x.
const char CP210[] = "CP210";

// чип FTDI.
const char FTDI[] = "FTDI";

// Встроенный порт STMicroelectronics.
const char STMicroelectronics[] = "STMicroelectronics";
}

// Тип порта.
namespace Types
{
const char Manufacturer[] = "manufacturer"; // Порт фирмы-производителя устройства. Другие устройства искать на этом порту нет смысла.
const char Adapter[] = "adapter"; // Порт-адаптер на чипе типа FTDI или CP210x. Другие устройства также могут жить на таком порту.
};

/// Типы соединений по COM/VCOM порту.
namespace ConnectionTypes
{
const char Dual[] = "dual";
const char COMOnly[] = "com_only";
const char VCOMOnly[] = "vcom_only";
}

}}} // SDK::Driver::VCOM

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

+ 1
- 1
3.0/src/includes/SDK/Drivers/InteractionTypes.h View File

@@ -43,7 +43,7 @@ const QStringList LoggedInteractionTypes = QStringList()
<< CInteractionTypes::USB
<< CInteractionTypes::LibUSB;

/// Типы взаимодействия, для которых требуется отдельное логгирование средствами ТК.
/// Типы взаимодействия, для которых требуется выделять порт под внешний драйвер.
const QStringList ExternalWithRRTypes = QStringList()
<< CInteractionTypes::ExternalCOM
<< CInteractionTypes::ExternalVCOM;


+ 1
- 1
3.0/src/includes/SDK/PaymentProcessor/Core/IDeviceService.h View File

@@ -37,7 +37,7 @@ public:

public:
/// Неблокирующий поиск всех устройств.
virtual void detect(const QString & aDeviceType = QString()) = 0;
virtual void detect(bool aFast, const QString & aDeviceType = QString()) = 0;

/// Прервать поиск устройств.
virtual void stopDetection() = 0;


+ 2
- 1
3.0/src/includes/SDK/PaymentProcessor/Payment/Amount.h View File

@@ -24,7 +24,8 @@ namespace EAmountType
Bill = 0,
Coin,
EMoney,
BankCard
BankCard,
AmountOnDemand
};
}



+ 6
- 5
3.0/src/includes/SDK/PaymentProcessor/Payment/Parameters.h View File

@@ -47,11 +47,12 @@ namespace Parameters
/*
PAY_TOOL = N – тип оплаты :
0 – наличные средства,
1 – по банковской карте, эмитированной Банком - парнером(«свои» карты),
2 – по банковской карте, не эмитированной Банком - парнером(«чужие» карты).
В случае если Контрагент, не являющийся банком, принимает платеж по
банковской карте, значение параметра PAY_TOOL = 2.
При отсутствии параметра значение принимается равным 0. */
1 – по банковской карте, эмитированной Банком - парнером(«свои» карты),
2 – по банковской карте, не эмитированной Банком - парнером(«чужие» карты).
9 - виртуальные деньги?
В случае если Контрагент, не являющийся банком, принимает платеж по
банковской карте, значение параметра PAY_TOOL = 2.
При отсутствии параметра значение принимается равным 0. */
const char PayTool[] = "PAY_TOOL";

/// Вспомогательные параметры.


+ 4
- 0
3.0/src/includes/SDK/PaymentProcessor/Scripting/Settings.h View File

@@ -60,6 +60,7 @@ class TerminalSettings : public QObject
Q_PROPERTY(QString enabledCoins READ geEnabledCoins CONSTANT)
Q_PROPERTY(QString disabledNotes READ getDisabledNotes CONSTANT)
Q_PROPERTY(QString disabledCoins READ getDisabledCoins CONSTANT)
Q_PROPERTY(bool skipCheckWhileNetworkError READ getSkipCheckWhileNetworkError CONSTANT)
public:
TerminalSettings(ICore * aCore);
@@ -97,6 +98,9 @@ private:
QString getInterfacePath() const { return mTerminalSettings->getAppEnvironment().interfacePath; }
QString getCurrentSkinPath() const;
bool getSkipCheckWhileNetworkError() const {
return mTerminalSettings->getCommonSettings().skipCheckWhileNetworkError;
}
private:
SDK::PaymentProcessor::TerminalSettings * mTerminalSettings;


+ 1
- 1
3.0/src/includes/SDK/Plugins/PluginParameters.h View File

@@ -72,7 +72,7 @@ struct SPluginParameter
}
}

bool isValid()
bool isValid() const
{
return type && !name.isEmpty();
}


+ 2
- 0
3.0/src/interface/modern/controls/input_field.qml View File

@@ -32,6 +32,8 @@ FocusScope {
// Предикат проверки ввода
property alias validator: inputValidator.regExp

property alias validatorObject: input.validator

// Маска ввода
property alias mask: input.inputMask



+ 2
- 7
3.0/src/interface/modern/locale/root_groups_de.ts View File

@@ -11,13 +11,8 @@ verbindung</translation>
</message>
<message>
<location filename="../scripts/root_groups.js" line="6"/>
<source>root_groups#102</source>
<translation>Internet</translation>
</message>
<message>
<location filename="../scripts/root_groups.js" line="7"/>
<source>root_groups#103</source>
<translation>TV</translation>
<source>root_groups#9258</source>
<translation>Internet und TV</translation>
</message>
<message>
<location filename="../scripts/root_groups.js" line="8"/>


+ 2
- 7
3.0/src/interface/modern/locale/root_groups_en.ts View File

@@ -10,13 +10,8 @@
</message>
<message>
<location filename="../scripts/root_groups.js" line="6"/>
<source>root_groups#102</source>
<translation>Internet</translation>
</message>
<message>
<location filename="../scripts/root_groups.js" line="7"/>
<source>root_groups#103</source>
<translation>TV</translation>
<source>root_groups#9258</source>
<translation>Internet and TV</translation>
</message>
<message>
<location filename="../scripts/root_groups.js" line="8"/>


+ 1
- 1
3.0/src/interface/modern/locale/root_groups_kk.ts View File

@@ -10,7 +10,7 @@
</message>
<message>
<location filename="../scripts/root_groups.js" line="6"/>
<source>root_groups#102</source>
<source>root_groups#9258</source>
<translation>Интернет</translation>
</message>
<message>


+ 2
- 7
3.0/src/interface/modern/locale/root_groups_ru.ts View File

@@ -10,13 +10,8 @@
</message>
<message>
<location filename="../scripts/root_groups.js" line="6"/>
<source>root_groups#102</source>
<translation>Интернет</translation>
</message>
<message>
<location filename="../scripts/root_groups.js" line="7"/>
<source>root_groups#103</source>
<translation>ТВ</translation>
<source>root_groups#9258</source>
<translation>Интернет и ТВ</translation>
</message>
<message>
<location filename="../scripts/root_groups.js" line="8"/>


+ 9
- 30
3.0/src/interface/modern/payment_method_selector_scene.qml View File

@@ -10,30 +10,21 @@ import "scenario/constants.js" as Scenario
Widgets.SceneBase2 {
id: rootItem

rightButtonEnabled: editor.acceptable && !global.rightButtonDisabled
rightButtonEnabled: false
topPanelImage: global.provider ? ("image://ui/logoprovider/" + global.provider.id + "/button.operator.blank/" + global.provider.name) : ""
topPanelText: Utils.locale.tr(QT_TR_NOOP("payment_method_selector_scene#select_payment_method"))
infoButtonEnabled: true

Widgets.MultiEditorWrapper {
Widgets.EnumEditor {
id: editor

showFirstBackButton: false
anchors { left: parent.left; leftMargin: 30; right: parent.right; rightMargin: 30; top: parent.top; topMargin: 191 }
}

Connections {
target: editor
setupDefaultValue: false

onBackward: {
Core.postEvent(EventType.UpdateScenario, Scenario.Idle.Event.Back)
}

onForward: {
global.rightButtonDisabled = true;
anchors { left: parent.left; leftMargin: 30; right: parent.right; rightMargin: 30; top: parent.top; topMargin: 191 }

onSelected: {
Core.postEvent(EventType.StartScenario, {
name: editor.values().method.rawValue + "_charge",
name: aValue + "_charge",
printerIsReady: global.printerIsReady});
}
}
@@ -41,21 +32,13 @@ Widgets.SceneBase2 {
onBack: Core.postEvent(EventType.UpdateScenario, Scenario.Payment.Event.Abort)

// Переход к предыдущему полю
onLeftClick: editor.leftClick()

// Переход к следующему полю
onRightClick: {
editor.rightClick();
}
onLeftClick: Core.postEvent(EventType.UpdateScenario, Scenario.Idle.Event.Back)

QtObject {
id: global

property variant provider;
property bool printerIsReady;

// Признак, что кнопка Next уже нажата
property bool rightButtonDisabled
}

function formatNumber(aNumber) {
@@ -76,14 +59,10 @@ Widgets.SceneBase2 {
});

var e1 = {
type: "enum", id: "method", items: methods,
type: "enum", id: "method", items: methods, isRequired: true,
title: Utils.locale.tr(QT_TR_NOOP("payment_method_selector_scene#type"))
};

editor.setup({fields: [e1]});
}

function showHandler() {
global.rightButtonDisabled = false;
editor.setup(e1);
}
}

+ 2
- 3
3.0/src/interface/modern/scenario/card_ucs_charge_scenario.js View File

@@ -289,13 +289,12 @@ function onError(aError) {

Core.payment.setExternalParameter("CARD_CHARGE_ERROR", aError);

Core.postEvent(EventType.UpdateScenario, Scenario.Payment.Event.Abort);
GUI.notification(aError, 5000, Scenario.Payment.Event.Abort)
}

//------------------------------------------------------------------------------
function onMessage(aMessage) {
GUI.waiting(aMessage, 60000, Scenario.Payment.Event.Abort);
Core.postEvent(EventType.UpdateScenario, Scenario.Payment.Event.Retry)
GUI.waiting(aMessage, 0, Scenario.Payment.Event.Abort);
}

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


+ 11
- 8
3.0/src/interface/modern/scenario/payment_scenario.js View File

@@ -592,7 +592,7 @@ function processCheckEnterHandler(aParameters) {
var errorCode = Core.payment.getParameter(Scenario.Payment.Parameters.Error);
var errorMesage = Core.payment.getParameter(Scenario.Payment.Parameters.ErrorMessage);

if (errorCode) {
if (!Core.environment.terminal.skipCheckWhileNetworkError && errorCode) {
FORCE_CHANGEBACK = true;
Core.postEvent(EventType.UpdateScenario, {signal: Scenario.Payment.Event.Abort, payment_result: Scenario.Payment.ProcessError.BadPayment});
return;
@@ -759,13 +759,14 @@ function finishEnterHandler(aParameters) {
var amountAll = parseFloat(Core.payment.getParameter(Scenario.Payment.Parameters.AmountAll));
var zeroAmount = Number(0).toFixed(2);

var useBadPaymentAsChange = function() {
return GUI.toBool(GUI.ui("use_bad_payment_as_change")) ||
GUI.toBool(GUI.ui("use_bad_online_payment_as_change"));
}
var lowMoney = aParameters.payment_result ? aParameters.payment_result === Scenario.Payment.ProcessError.LowMoney : false
var badPayment = aParameters.payment_result ? aParameters.payment_result === Scenario.Payment.ProcessError.BadPayment : false
var useBadPaymentAsChange = GUI.toBool(GUI.ui("use_bad_payment_as_change")) || GUI.toBool(GUI.ui("use_bad_online_payment_as_change"));

// Разрешение на проведение платежей при остутствии связи
var skipCheckWhileNetworkError = Core.environment.terminal.skipCheckWhileNetworkError

// Если не хватило денег на оплату, превращаем внесенную сумму в сдачу
if ((useBadPaymentAsChange && (amount == zeroAmount || amount < minAmount)) || FORCE_CHANGEBACK) {
if ((useBadPaymentAsChange && badPayment && !skipCheckWhileNetworkError) || (useBadPaymentAsChange && lowMoney) || (amount == zeroAmount) || FORCE_CHANGEBACK) {
Core.payment.useChangeBack();
FORCE_CHANGEBACK = false;

@@ -805,7 +806,9 @@ function finishEnterHandler(aParameters) {

GUI.show("ResultScene", {reset: true, id: ScenarioEngine.context.id, receipt_printed: false,
auto_changeback: USE_AUTO_CHANGEBACK ? USE_AUTO_CHANGEBACK : false,
payment_result: aParameters.hasOwnProperty("payment_result") ? aParameters.payment_result : Scenario.Payment.ProcessError.OK});
payment_result: aParameters.hasOwnProperty("payment_result") ?
//(skipCheckWhileNetworkError && aParameters.payment_result === Scenario.Payment.ProcessError.BadPayment ? Scenario.Payment.ProcessError.OK :
aParameters.payment_result/*)*/ : Scenario.Payment.ProcessError.OK});

if (PRINTER_IS_READY && !SKIP_PRINT_RECEIPT) {
GUI.waiting({tr: QT_TR_NOOP("payment_scenario#printing_receipt")});


+ 12
- 9
3.0/src/interface/modern/scripts/gui.js View File

@@ -29,8 +29,11 @@ function popup(aWidget, aParameters) {
}

//------------------------------------------------------------------------------
function waiting(aText) {
popup("InfoPopup", {reset: true, message: aText, waiting: true});
function waiting(aText, aTimeout, aResult) {
popup("InfoPopup", {
reset: true, message: aText, waiting: true,
timeout: __isValid(aTimeout) ? aTimeout : null,
result: __isValid(aResult) ? aResult : null});
}

//------------------------------------------------------------------------------
@@ -75,13 +78,13 @@ function log() {
for (var i = 0; i < arguments.length; i++) {
msg.push(JSON.stringify(arguments[i], function(key, val) {
if (val != null && typeof val == "object") {
if (seen.indexOf(val) >= 0) {
return;
}
seen.push(val);
}
return val;
}));
if (seen.indexOf(val) >= 0) {
return;
}
seen.push(val);
}
return val;
}));
}

Core.log.debug(msg.join(" "));


+ 1
- 2
3.0/src/interface/modern/scripts/root_groups.js View File

@@ -3,8 +3,7 @@
var groups_name = [
// Ru, Kz
QT_TRANSLATE_NOOP("root_groups", "root_groups#101"), // Мобильная связь
QT_TRANSLATE_NOOP("root_groups", "root_groups#102"), // Интернет
QT_TRANSLATE_NOOP("root_groups", "root_groups#103"), // ТВ
QT_TRANSLATE_NOOP("root_groups", "root_groups#9258"), // Интернет и ТВ
QT_TRANSLATE_NOOP("root_groups", "root_groups#104"), // ЖКХ
QT_TRANSLATE_NOOP("root_groups", "root_groups#105"), // Банковские услуги
QT_TRANSLATE_NOOP("root_groups", "root_groups#106"), // Домашний телефон


+ 1
- 0
3.0/src/interface/modern/widgets/qmldir View File

@@ -39,5 +39,6 @@ HtmlEditor 1.0 html_editor.qml
FallbackEditor 1.0 fallback_editor.qml
MultiEditorWrapper 1.0 multieditor_wrapper.qml
PayConfirmEditor 1.0 pay_confirm_editor.qml
ValidatorEditor 1.0 validator_editor.qml

EditorDescription 1.0 editor_description.qml

+ 108
- 0
3.0/src/interface/modern/widgets/validator_editor.qml View File

@@ -0,0 +1,108 @@
/* @file Редактор с цифровой клавиатурой. */

import QtQuick 1.1

import Md5Validator 1.0

FocusScope {
id: rootItem

// Показывает содержит ли редактор допустимое значение. Если поле обязательно, то руководствуемся флагом inputField.
// Если поле необязательно, то допустимыми значениями являются только пустота и корректное значение в inputField.
property bool acceptable: global.enabled ? (global.required ? inputField.acceptable : (inputField.empty || inputField.acceptable)) : global.savedState

signal showComment

width: 1211
height: 630

Column {
anchors { left: parent.left; right: parent.right; top: parent.top }

EditorDescription {
id: description

anchors { left: parent.left; leftMargin: 12; right: parent.right }
height: 120

onClicked: rootItem.showComment()
}

// Поле ввода
InputField {
id: inputField

anchors { left: parent.left; leftMargin: -5; right: parent.right; rightMargin: -5 }
backspace: Item {}
validatorObject: Md5Validator {}
}

// Клавиатура
NumericKeyboard {
id: numpad

anchors.horizontalCenter: parent.horizontalCenter
onClicked: aKey == Qt.Key_Clear ? inputField.reset() : Utils.generateKeyEvent(aKey, aModifiers, aText)
}
}

QtObject {
id: global

property variant field
property bool required: true
property bool enabled
property bool savedState
}

// Сохраняет значение
function save(aField) {
// Для незаполненных полей с маской может вернуться что-то вроде ') -'.
// Подобные значения, без цифр, будем считать невалидным.
/*aField.rawValue = inputField.value.replace(new RegExp("[^0-9]", "gi"), '') ? inputField.value : "";
aField.value = inputField.displayText;
aField.formattedValue = Utils.format(inputField.value, global.field.format);

aField.value.replace("\u2022", "*");
aField.formattedValue.replace("\u2022", "*");*/

aField.rawValue = "***";
return aField;
}

function id() {
return global.field.id;
}

function update(aValue) {
inputField.reset(aValue.rawValue);
}

// Настраивает редактор
function setup(aField, aValue) {
global.savedState = rootItem.acceptable;
global.enabled = false;

try {
global.field = aField;
global.required = aField.isRequired;
description.title = aField.title + (aField.isRequired ? "" : Utils.locale.tr(QT_TRANSLATE_NOOP("editor", "editor#not_required")));
description.comment = aField.extendedComment ? "" : Utils.toPlain(aField.comment);
inputField.echoMode = TextInput.Password;
inputField.validatorObject.hash = aField.defaultValue

Core.log.normal(JSON.stringify(aValue))

inputField.reset("");
}
catch (e) {
Core.log.error("Failed to setup editor for field %1: %2.".arg(aField.id).arg(e.message));
}

global.enabled = true;
}

function setupValidator(aValidator) {
inputField.setupValidator(aValidator);
}
}

+ 176
- 11
3.0/src/modules/DeviceManager/src/DeviceManager.cpp View File

@@ -16,6 +16,8 @@
#include <SDK/Drivers/InteractionTypes.h>
#include <SDK/Drivers/HardwareConstants.h>
#include <SDK/Drivers/DetectingPriority.h>
#include <SDK/Drivers/IIOPort.h>
#include <SDK/Drivers/IOPort/VCOMData.h>

// Project
#include "RenamingPluginPaths.h"
@@ -25,7 +27,7 @@ using namespace SDK::Driver;
using namespace SDK::Plugin;

//--------------------------------------------------------------------------------
DeviceManager::DeviceManager(IPluginLoader * aPluginLoader) : mPluginLoader(aPluginLoader), mStopFlag(1)
DeviceManager::DeviceManager(IPluginLoader * aPluginLoader) : mPluginLoader(aPluginLoader), mStopFlag(1), mFastAutoSearching(false)
{
qRegisterMetaType<TNamedDevice>("TNamedDevice");
}
@@ -327,6 +329,7 @@ TNamedDevice DeviceManager::createDevice(const QString & aDriverPath, const QVar
mDeviceDependencyMap.insert(device, requiredDevice.second);
}

config[CHardwareSDK::SearchingType] = aDetecting ? CHardwareSDK::SearchingTypes::AutoDetecting : CHardwareSDK::SearchingTypes::Loading;
device->setDeviceConfiguration(config);

if (!aDetecting)
@@ -346,7 +349,7 @@ QMap<QString, QStringList> DeviceManager::getModelList(const QString & /*aFilter
}

//--------------------------------------------------------------------------------
TNamedDevice DeviceManager::findDevice(IDevice * aRequired, const QStringList & aDevicesToFind)
TNamedDevice DeviceManager::findDevice(IDevice * aRequired, const QStringList & aDevicesToFind, bool aVCOM)
{
QMap<QString, IDevice *> targetDevices;
QMap<QString, IDevice::IDetectingIterator *> detectingIterators;
@@ -358,9 +361,59 @@ TNamedDevice DeviceManager::findDevice(IDevice * aRequired, const QStringList &
ILog * log = ILog::getInstance(logFileName);
aRequired->setLog(log);

QVariantMap requiredConfig = aRequired->getDeviceConfiguration();
QString tag = requiredConfig[CHardwareSDK::Tag].toString();
QString systemName = requiredConfig[CHardwareSDK::SystemName].toString();

// Создаем все устройства, которые собираемся искать.
foreach (const QString & targetDevice, aDevicesToFind)
{
if (mFastAutoSearching)
{
SPluginParameter VCOMDataParameter = findParameter(CHardwareSDK::VCOMData, mDriverParameters[targetDevice]);

bool VCOMDataExists = VCOMDataParameter.isValid() && !VCOMDataParameter.defaultValue.toMap().isEmpty();
QVariantMap VCOMData = VCOMDataParameter.defaultValue.toMap();
QStringList VCOMTags = VCOMData[CHardwareSDK::VCOMTags].toStringList();
VCOMTags.removeAll("");

QString reasonLog = " for device " + targetDevice;
QString reasonTagLog = reasonLog + QString(", port tag \"%1\"").arg(tag);
QString log = QString("Blocking autosearch on virtual port %1 due to ").arg(systemName);

// пропускаем, если:
// либо ищем не COM-девайсы (VCOM + dual), и либо порт без тега, либо нет данных в девайсе о теге, либо теги девайса не содержат тега порта;
// либо ищем не VCOM-девайсы ( COM + dual), и порт с тегом, и данные о теге в девайсе есть: на портах со своими тегами уже искали, на чужих - искать не надо
if (aVCOM)
{
if (tag.isEmpty())
{
toLog(LogLevel::Normal, log + "no port tag" + reasonLog);
continue;
}
else if (!VCOMDataExists)
{
toLog(LogLevel::Normal, log + "no device tag data" + reasonTagLog);
continue;
}
else if (VCOMTags.isEmpty())
{
toLog(LogLevel::Debug, log + "no device tags" + reasonTagLog);
continue;
}
else if (!VCOMTags.contains(tag))
{
toLog(LogLevel::Debug, log + QString("device tags (%1) not contains").arg(VCOMTags.join(", ")) + reasonTagLog);
continue;
}
}
else if (!tag.isEmpty() && VCOMDataExists && !VCOMTags.isEmpty())
{
toLog(LogLevel::Debug, log + QString("device tags (%1)").arg(VCOMTags.join(", ")) + reasonTagLog);
continue;
}
}

// Создаем нужный плагин.
IPlugin * plugin = mPluginLoader->createPlugin(targetDevice);
IDevice * device = dynamic_cast<IDevice *>(plugin);
@@ -390,6 +443,7 @@ TNamedDevice DeviceManager::findDevice(IDevice * aRequired, const QStringList &
}

config[CHardwareSDK::SearchingType] = CHardwareSDK::SearchingTypes::AutoDetecting;
config[CHardwareSDK::FastAutoSearching] = mFastAutoSearching;
config[CHardwareSDK::RequiredDevice] = QVariant::fromValue(aRequired);
config[CHardwareSDK::RequiredResource] = dynamic_cast<IPlugin *>(aRequired)->getConfigurationName();

@@ -455,6 +509,12 @@ TNamedDevice DeviceManager::findDevice(IDevice * aRequired, const QStringList &

break;
}

if (aVCOM)
{
configNames.removeOne(targetDevice);
continue;
}
}
}

@@ -597,11 +657,10 @@ void DeviceManager::logRequiedDeviceData()
}

//--------------------------------------------------------------------------------
QStringList DeviceManager::detect(const QString & /*aDeviceType*/)
QStringList DeviceManager::detect(bool aFast, const QString & /*aDeviceType*/)
{
logRequiedDeviceData();

QStringList result;
mFastAutoSearching = aFast;

mStopFlag = 0;
mDetectedDeviceTypes.clear();
@@ -616,8 +675,15 @@ QStringList DeviceManager::detect(const QString & /*aDeviceType*/)

QStringSet OPOSDevices = simpleDevices.filter(CInteractionTypes::OPOS, Qt::CaseInsensitive).toSet();
QStringSet nonOPOSDevices = simpleDevices.toSet() - OPOSDevices;

QStringList result;
SSimpleSearchDeviceData deviceData(&result, &fallbackDevices, &nonMarkedDetectedDriverNames);

if (mFastAutoSearching)
{
findRRDevices(result, true);
}

foreach (const QString & driverName, nonOPOSDevices)
{
if (!mRDSystemNames.contains(driverName))
@@ -643,7 +709,7 @@ QStringList DeviceManager::detect(const QString & /*aDeviceType*/)
markDetected(driverName);
}

findRRDevices(result);
findRRDevices(result, false);

mStopFlag = 1;

@@ -664,8 +730,30 @@ QStringList DeviceManager::detect(const QString & /*aDeviceType*/)
}

//------------------------------------------------------------------------------
void DeviceManager::findRRDevices(QStringList & aFoundDevices)
void DeviceManager::findRRDevices(QStringList & aFoundDevices, bool aVCOM)
{
auto removeExternal = [] (QStringList & aDevices) { QString regExpData = QString(".+\\.Driver\\.[^\\.]+\\.(?!(%1))").arg(ExternalWithRRTypes.join("|"));
aDevices = aDevices.filter(QRegExp(regExpData)); };
QStringList allDevices = mRequiredResources.keys();
removeExternal(allDevices);

QMap<QString, QStringList> xCOMDevices;
QStringList allXCOMDevices;

foreach (const QString & device, allDevices)
{
SPluginParameter VCOMDataParameter = findParameter(CHardwareSDK::VCOMData, mDriverParameters[device]);

if (VCOMDataParameter.isValid() && !VCOMDataParameter.defaultValue.toMap().isEmpty())
{
QVariantMap VCOMData = VCOMDataParameter.defaultValue.toMap();
QString connectionType = VCOMData[CHardwareSDK::VCOMConnectionType].toString();

xCOMDevices[connectionType] << device;
allXCOMDevices << device;
}
}

QFutureSynchronizer<TNamedDevice> synchronizer;
QVector<IDevice *> requiredList;

@@ -673,14 +761,44 @@ void DeviceManager::findRRDevices(QStringList & aFoundDevices)
foreach (const QString & requiredDevice, mRDSystemNames.keys().toSet())
{
QStringList devicesToFind = mRequiredResources.keys(requiredDevice);
QStringList deviceTags;

if (mFastAutoSearching)
{
foreach(const QString & device, devicesToFind)
{
if ((aVCOM && xCOMDevices[VCOM::ConnectionTypes::COMOnly].contains(device)) ||
(!aVCOM && xCOMDevices[VCOM::ConnectionTypes::VCOMOnly].contains(device)))
{
devicesToFind.removeAll(device);
}
else if (aVCOM)
{
SPluginParameter VCOMDataParameter = findParameter(CHardwareSDK::VCOMData, mDriverParameters[device]);

if (VCOMDataParameter.isValid() && !VCOMDataParameter.defaultValue.toMap().isEmpty())
{
QVariantMap VCOMData = VCOMDataParameter.defaultValue.toMap();
QStringList tags = VCOMData[CHardwareSDK::VCOMTags].toStringList();

if (!tags.isEmpty())
{
deviceTags << tags;
}
}
}
}
}

deviceTags.removeDuplicates();
deviceTags.removeAll("");

if (devicesToFind.isEmpty() || requiredDevice.contains(CInteractionTypes::TCP))
{
{
continue;
}

QString regExpData = QString(".+\\.Driver\\.[^\\.]+\\.(?!(%1))").arg(ExternalWithRRTypes.join("|"));
devicesToFind = devicesToFind.filter(QRegExp(regExpData));
removeExternal(devicesToFind);
qSort(devicesToFind.begin(), devicesToFind.end(), std::bind(&DeviceManager::deviceSortPredicate, this, std::placeholders::_1, std::placeholders::_2));

// Для каждого системного имени создаем устройство.
@@ -696,13 +814,60 @@ void DeviceManager::findRRDevices(QStringList & aFoundDevices)
continue;
}

config[CHardwareSDK::SearchingType] = CHardwareSDK::SearchingTypes::AutoDetecting;
required.second->setDeviceConfiguration(config);

if (mFastAutoSearching)
{
required.second->initialize();
QVariantMap requiredСonfig = required.second->getDeviceConfiguration();

QString requiredVCOMType = requiredСonfig[CHardwareSDK::VCOMType].toString();
QString requiredTag = requiredСonfig[CHardwareSDK::Tag].toString();

auto logAndRelease = [&] (const QString aReason, bool aTagLog) { QString tagLog = aTagLog ? QString(", port tag \"%1\"").arg(requiredTag) : "";
toLog(LogLevel::Normal, QString("Blocking autosearching on virtual port %1 due to %2").arg(systemName).arg(aReason) + tagLog); releaseDevice(required.second); };

if (aVCOM)
{
if (requiredTag.isEmpty())
{
logAndRelease("no port tag", false);
continue;
}
else if (deviceTags.isEmpty())
{
logAndRelease("no device tag", true);
continue;
}
else if (!deviceTags.contains(requiredTag))
{
logAndRelease(QString("device tags (%1) not contains").arg(deviceTags.join(", ")), true);
continue;
}

toLog(LogLevel::Normal, QString("Starting autosearching on virtual port %1 with tag %2").arg(systemName).arg(requiredTag));
}
else
{
if (!requiredVCOMType.isEmpty() && (requiredVCOMType != VCOM::Types::Adapter))
{
logAndRelease("type is " + requiredVCOMType, true);
continue;
}

toLog(LogLevel::Normal, "Starting autosearching on port " + systemName);
}
}

// Запускаем асинхронный поиск.
synchronizer.addFuture(QtConcurrent::run(this, &DeviceManager::findDevice, required.second, devicesToFind));
synchronizer.addFuture(QtConcurrent::run(this, &DeviceManager::findDevice, required.second, devicesToFind, aVCOM));
requiredList.append(required.second);
}
}

synchronizer.waitForFinished();
toLog(LogLevel::Normal, "Waiting for results is completed");

// Формируем результат.
int i = 0;


+ 24
- 21
3.0/src/modules/DeviceManager/src/DeviceManager.h View File

@@ -46,31 +46,31 @@ public:
DeviceManager(SDK::Plugin::IPluginLoader * aPluginLoader);
~DeviceManager();

/// Инициализация DeviceManager.
/// Инициализирует DeviceManager.
bool initialize();

/// Освобождение ресурсов.
/// Освобождает ресурсы.
void shutdown();

/// Ищет все подключенные устройства без сохранения конфигуркции.
QStringList detect(const QString & aDeviceType);
QStringList detect(bool aFast, const QString & aDeviceType);

/// Подключение/захват устройства, c заданной конфигурацией. По умолчаю конфигурация грузится из конфига плагина.
SDK::Driver::IDevice * acquireDevice(const QString & aInstancePath, const QString & aConfigPath = "");

/// Отключение/освобождение указанного устройства.
/// Отключает/освобождает указанные устройства.
void releaseDevice(SDK::Driver::IDevice * aDevice);

/// Создание устройства. Возвращает имя новой конфигурации.
/// Создаёт устройства. Возвращает имя новой конфигурации.
Q_INVOKABLE TNamedDevice createDevice(const QString & aDriverPath, const QVariantMap & aConfig, bool aDetecting = false);

/// Сохранить конфигурацию устройства.
/// Сохраняет конфигурацию устройства.
void saveConfiguration(SDK::Driver::IDevice * aDevice);

/// Получение списка драверов (поддерживаемых устройста).
/// Получает список драверов (поддерживаемых устройств).
QMap<QString, QStringList> getModelList(const QString & aFilter);

/// Получени списка доступных драйверов.
/// Получает список доступных драйверов.
QStringList getDriverList() const;

/// Останавливает процесс поиска устройств.
@@ -82,54 +82,54 @@ public:
/// Устанавливает конфигурацию устройству.
void setDeviceConfiguration(SDK::Driver::IDevice * aDevice, const QVariantMap & aConfig);

/// Получить конфигурацию устройства.
/// Получает конфигурацию устройства.
QVariantMap getDeviceConfiguration(SDK::Driver::IDevice * aDevice) const;

/// Получить список возможных значений для параметров устройств.
/// Получает список возможных значений для параметров устройств.
SDK::Plugin::TParameterList getDriverParameters(const QString & aDriverPath) const;

/// Проверить правильность путей плагинов драйверов. Workaround для обратной совместимости при накате обновления без автопоиска драйверов, при изменении путей.
/// Проверяет правильность путей плагинов драйверов. Workaround для обратной совместимости при накате обновления без автопоиска драйверов, при изменении путей.
// TODO: убрать после реализации автопоиска через мониторинг.
void checkInstancePath(QString & aInstancePath);
void checkITInstancePath(QString & aInstancePath);

/// Попробовать изменить путь плагина драйвера. Workaround для обратной совместимости при накате обновления без автопоиска драйверов, при изменении путей.
/// Пробует изменить путь плагина драйвера. Workaround для обратной совместимости при накате обновления без автопоиска драйверов, при изменении путей.
typedef QSet<QString> TNewPaths;
typedef QMap<QString, TNewPaths> TPaths;
void changeInstancePath(QString & aInstancePath, const QString & aConfigPath, const TPaths & aPaths);

private:
/// Пробует найти устройство aDevicePath.
TNamedDevice findDevice(SDK::Driver::IDevice * aRequired, const QStringList & aDevicesToFind);
TNamedDevice findDevice(SDK::Driver::IDevice * aRequired, const QStringList & aDevicesToFind, bool aVCOM = false);

/// Пробует найти устройство aDriverName, не имеющее зависимых устройств
void findSimpleDevice(const SSimpleSearchDeviceData & aDeviceData);

/// Ищет все подключенные устройства, имеющие зависимые устройства, без сохранения конфигуркции.
void findRRDevices(QStringList & aFoundDevices);
void findRRDevices(QStringList & aFoundDevices, bool aVCOM);

/// Ищет все подключенные устройства, использующие зависимые устройства без сладения ими, без сохранения конфигуркции.
void findExternalRRDevices(SSimpleSearchDeviceData & aDeviceData);

/// Было ли устройство данного типа уже найдено.
/// Было ли устройство данного типа уже найдено?
bool isDetected(const QString & aConfigName);

/// Добавить устройство в список найденных.
/// Добавляет устройство в список найденных.
void markDetected(const QString & aConfigName);

/// Предикат для сортировки списка устройств при автодетекте.
bool deviceSortPredicate(const QString & aLhs, const QString & aRhs) const;

/// Установить лог для устройства.
/// Устанавливает лог для устройства.
void setDeviceLog(SDK::Driver::IDevice * aDevice, bool aDetecting);

/// Получить имя лога простого устройства.
/// Получает имя лога простого устройства.
QString getSimpleDeviceLogName(SDK::Driver::IDevice * aDevice, bool aDetecting);

/// Получить имя лога устройства.
/// Получает имя лога устройства.
QString getDeviceLogName(SDK::Driver::IDevice * aDevice, bool aDetecting);

/// Логгировать данные зависимых устройств.
/// Логгирует данные зависимых устройств.
void logRequiedDeviceData();

signals:
@@ -140,7 +140,7 @@ signals:
void progress(int aCurrent, int aMax);

private slots:
/// Обновить конфигурацию устройства (без зависимых устройств).
/// Обновляет конфигурацию устройства (без зависимых устройств).
void onConfigurationChanged();

private:
@@ -178,6 +178,9 @@ private:

/// Список путей всех использованных устройств.
QStringList mAcquiredDevices;

/// Список путей всех использованных устройств.
bool mFastAutoSearching;
};

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

+ 2
- 0
3.0/src/modules/Hardware/Cardreaders/src/Creator/CreatorReader.h View File

@@ -63,3 +63,5 @@ protected:
/// Тип IC карты.
CCreatorReader::CardTypes::EICCPU::Enum mICCPUType;
};

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

+ 4
- 2
3.0/src/modules/Hardware/Cardreaders/src/IDTech/IDTechReader.h View File

@@ -16,8 +16,10 @@ namespace CIDTechReader
const char DLLSDKName[] = "libIDTechSDK.dll.1.0.16";
}

//------------------------------------------------------------------------------
class IDTechReader: public PollingDeviceBase<ProtoHID>
//--------------------------------------------------------------------------------
typedef PollingDeviceBase<DeviceBase<ProtoHID>> TPollingHID;

class IDTechReader: public TPollingHID
{
SET_INTERACTION_TYPE(External)
SET_SERIES("IDTech")


+ 1
- 0
3.0/src/modules/Hardware/CashAcceptors/msvc/CashAcceptors.vcxproj View File

@@ -138,6 +138,7 @@
<ClInclude Include="..\..\..\..\includes\Hardware\CashAcceptors\BillTable.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\CashAcceptors\CurrencyDescriptions.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\CashAcceptors\CashAcceptorData.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\CashAcceptors\SerialCashAcceptor.h" />
<ClInclude Include="..\src\CashAcceptorStatusData.h" />
<ClInclude Include="..\src\CCNet\CCNetCashAcceptorBase.h" />
<ClInclude Include="..\src\CCNet\CCNetCashAcceptorDataTypes.h" />


+ 3
- 0
3.0/src/modules/Hardware/CashAcceptors/msvc/CashAcceptors.vcxproj.filters View File

@@ -239,6 +239,9 @@
<ClInclude Include="..\src\SSP\SSPModelDataTypes.h">
<Filter>SSP</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\includes\Hardware\CashAcceptors\SerialCashAcceptor.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\PortCashAcceptor.h">


+ 1
- 1
3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashAcceptorBase.cpp View File

@@ -396,7 +396,7 @@ bool CCNetCashAcceptorBase::setDefaultParameters()
//---------------------------------------------------------------------------
bool CCNetCashAcceptorBase::getStatus(TStatusCodes & aStatusCodes)
{
if (!TSerialCashAcceptor::getStatus(aStatusCodes))
if (!SerialCashAcceptor::getStatus(aStatusCodes))
{
return false;
}


+ 2
- 1
3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashAcceptorBase.h View File

@@ -11,9 +11,10 @@
#include "CCNetCashAcceptorDataTypes.h"

//--------------------------------------------------------------------------------
class CCNetCashAcceptorBase : public TSerialCashAcceptor
class CCNetCashAcceptorBase : public SerialCashAcceptor
{
SET_SERIES("CCNet")
SET_VCOM_DATA(Types::Adapter, ConnectionTypes::Dual, AdapterTags::FTDI)

public:
CCNetCashAcceptorBase();


+ 1
- 0
3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashcodeGX.h View File

@@ -18,6 +18,7 @@ namespace CCCNetCashcodeGX
class CCNetCashcodeGX : public CCNetCashAcceptorBase
{
SET_SUBSERIES("CashcodeGX")
SET_VCOM_DATA(Types::Adapter, ConnectionTypes::Dual, AdapterTags::STMicroelectronics)

public:
CCNetCashcodeGX();


+ 1
- 0
3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCreator.h View File

@@ -8,6 +8,7 @@
class CCNetCreator : public CCNetCashAcceptorBase
{
SET_SUBSERIES("Creator")
SET_VCOM_DATA(None, ConnectionTypes::COMOnly, None)

public:
CCNetCreator();


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

@@ -24,7 +24,7 @@ namespace CCCNet
{
data()[Models::CashcodeGX ][Currency::RUB][true] = TFimwareVersionSet() << 1208;

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

data()[Models::CashcodeSM ][Currency::RUB][false] = TFimwareVersionSet() << 1393 << 1434;
data()[Models::CashcodeMSM][Currency::RUB][false] = TFimwareVersionSet() << 1115;


+ 3
- 1
3.0/src/modules/Hardware/CashAcceptors/src/CCTalk/CCTalkCashAcceptor.h View File

@@ -7,10 +7,12 @@
#include "Hardware/CashAcceptors/SerialCashAcceptor.h"

//--------------------------------------------------------------------------------
typedef CCTalkAcceptorBase<TSerialCashAcceptor> TCCTalkCashAcceptor;
typedef CCTalkAcceptorBase<SerialCashAcceptor> TCCTalkCashAcceptor;

class CCTalkCashAcceptor : public TCCTalkCashAcceptor
{
SET_VCOM_DATA(Types::Adapter, ConnectionTypes::Dual, AdapterTags::FTDI)

public:
CCTalkCashAcceptor();



+ 1
- 1
3.0/src/modules/Hardware/CashAcceptors/src/EBDS/EBDSCashAcceptor.h View File

@@ -18,7 +18,7 @@
*/

//--------------------------------------------------------------------------------
class EBDSCashAcceptor : public TSerialCashAcceptor
class EBDSCashAcceptor : public SerialCashAcceptor
{
SET_SERIES("EBDS")



+ 2
- 2
3.0/src/modules/Hardware/CashAcceptors/src/ICT/ICTCashAcceptor.cpp View File

@@ -244,7 +244,7 @@ bool ICTCashAcceptor::isStatusesReplaceable(TStatusCodes & aStatusCodes)
}
}

return TSerialCashAcceptor::isStatusesReplaceable(aStatusCodes);
return SerialCashAcceptor::isStatusesReplaceable(aStatusCodes);