Browse Source

refs #1 Syncronizing with release commit: b59bd28a0e

qt5
parent
commit
7789b7a8b3
100 changed files with 1191 additions and 471 deletions
  1. +9
    -10
      3.0/scripts/build/runtimes/terminal_ru.xml
  2. +21
    -1
      3.0/src/apps/PaymentProcessor/src/Services/CryptService.cpp
  3. +7
    -1
      3.0/src/apps/PaymentProcessor/src/Services/CryptService.h
  4. +1
    -1
      3.0/src/apps/PaymentProcessor/src/Services/GUIService.cpp
  5. +1
    -0
      3.0/src/apps/PaymentProcessor/src/Services/GUIService.h
  6. +4
    -4
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp
  7. +1
    -0
      3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp
  8. +1
    -1
      3.0/src/includes/Hardware/CardReaders/ProtoMifareReader.h
  9. +1
    -1
      3.0/src/includes/Hardware/CashAcceptors/ProtoCashAcceptor.h
  10. +2
    -0
      3.0/src/includes/Hardware/Common/DeviceDataConstants.h
  11. +3
    -0
      3.0/src/includes/Hardware/Common/ProtoDevice.h
  12. +3
    -3
      3.0/src/includes/Hardware/Common/ProtoDevices.h
  13. +1
    -1
      3.0/src/includes/Hardware/Dispensers/ProtoDispenser.h
  14. +6
    -5
      3.0/src/includes/Hardware/FR/FRBaseConstants.h
  15. +4
    -1
      3.0/src/includes/Hardware/FR/FRStatusCodes.h
  16. +4
    -1
      3.0/src/includes/Hardware/FR/FRStatusesDescriptions.h
  17. +1
    -1
      3.0/src/includes/Hardware/FR/ProtoFR.h
  18. +1
    -1
      3.0/src/includes/Hardware/HID/ProtoHID.h
  19. +0
    -4
      3.0/src/includes/Hardware/Plugins/DevicePluginBase.h
  20. +13
    -7
      3.0/src/includes/Hardware/Printers/POSPrinterData.h
  21. +2
    -1
      3.0/src/includes/Hardware/Protocols/Common/ProtocolNames.h
  22. +1
    -0
      3.0/src/includes/Hardware/Protocols/FR/Atol2FR.h
  23. +1
    -0
      3.0/src/includes/Hardware/Protocols/FR/Atol3FR.h
  24. +0
    -1
      3.0/src/includes/Hardware/Protocols/FR/AtolFR.h
  25. +1
    -1
      3.0/src/includes/Hardware/Watchdogs/ProtoWatchdog.h
  26. +12
    -10
      3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h
  27. +1
    -0
      3.0/src/includes/SDK/Drivers/HardwareConstants.h
  28. +1
    -1
      3.0/src/includes/SDK/Drivers/ICardReader.h
  29. +1
    -1
      3.0/src/includes/SDK/Drivers/ICashAcceptor.h
  30. +1
    -1
      3.0/src/includes/SDK/Drivers/IDispenser.h
  31. +1
    -1
      3.0/src/includes/SDK/Drivers/IHID.h
  32. +2
    -2
      3.0/src/includes/SDK/Drivers/IIOPort.h
  33. +1
    -1
      3.0/src/includes/SDK/Drivers/IModem.h
  34. +1
    -1
      3.0/src/includes/SDK/Drivers/IPrinter.h
  35. +1
    -1
      3.0/src/includes/SDK/Drivers/IWatchdog.h
  36. +17
    -1
      3.0/src/includes/SDK/PaymentProcessor/Core/ICryptService.h
  37. +10
    -0
      3.0/src/modules/DeviceManager/src/DeviceManager.cpp
  38. +18
    -9
      3.0/src/modules/Hardware.sln
  39. +3
    -8
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashAcceptorBase.cpp
  40. +3
    -3
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashAcceptorBase.h
  41. +1
    -14
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashcodeGX.cpp
  42. +0
    -3
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCashcodeGX.h
  43. +1
    -6
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCreator.cpp
  44. +0
    -3
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/CCNetCreator.h
  45. +3
    -3
      3.0/src/modules/Hardware/CashAcceptors/src/CCNet/FirmwareVersions.h
  46. +5
    -0
      3.0/src/modules/Hardware/CashAcceptors/src/ID003/ID003CashAcceptor.cpp
  47. +0
    -5
      3.0/src/modules/Hardware/Common/src/Base/DeviceBase.cpp
  48. +1
    -1
      3.0/src/modules/Hardware/Common/src/Base/DeviceBase.h
  49. +72
    -23
      3.0/src/modules/Hardware/Common/src/Meta/MetaDevice.cpp
  50. +2
    -5
      3.0/src/modules/Hardware/Common/src/Meta/MetaDevice.h
  51. +4
    -0
      3.0/src/modules/Hardware/FR/msvc/FR.vcxproj
  52. +15
    -0
      3.0/src/modules/Hardware/FR/msvc/FR.vcxproj.filters
  53. +6
    -6
      3.0/src/modules/Hardware/FR/src/Atol/AtolDataTypes.h
  54. +14
    -8
      3.0/src/modules/Hardware/FR/src/Atol/AtolFRConstants.h
  55. +30
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Base/Atol2FRBase.h
  56. +110
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Base/Atol3/Atol3FRBase.cpp
  57. +32
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Base/Atol3/Atol3FRBase.h
  58. +25
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Base/Atol3/Atol3FRBaseConstants.h
  59. +54
    -31
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolFRBase.cpp
  60. +11
    -11
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolFRBase.h
  61. +1
    -1
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolSerialFR.cpp
  62. +3
    -3
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolSerialFR.h
  63. +2
    -1
      3.0/src/modules/Hardware/FR/src/Atol/Ejector/AtolEjectorFR.cpp
  64. +7
    -4
      3.0/src/modules/Hardware/FR/src/Atol/Ejector/AtolVKP80BasedFR.cpp
  65. +1
    -1
      3.0/src/modules/Hardware/FR/src/Atol/Ejector/AtolVKP80BasedFR.h
  66. +60
    -33
      3.0/src/modules/Hardware/FR/src/Atol/Online/AtolOnlineFRBase.cpp
  67. +17
    -5
      3.0/src/modules/Hardware/FR/src/Atol/Online/AtolOnlineFRBase.h
  68. +2
    -2
      3.0/src/modules/Hardware/FR/src/Atol/Online/AtolOnlineFRConstants.h
  69. +38
    -19
      3.0/src/modules/Hardware/FR/src/Atol/Online/Paymaster.cpp
  70. +6
    -4
      3.0/src/modules/Hardware/FR/src/Atol/Online/Paymaster.h
  71. +8
    -1
      3.0/src/modules/Hardware/FR/src/Base/FFEngine.cpp
  72. +163
    -46
      3.0/src/modules/Hardware/FR/src/Base/FRBase.cpp
  73. +15
    -3
      3.0/src/modules/Hardware/FR/src/Base/FRBase.h
  74. +7
    -2
      3.0/src/modules/Hardware/FR/src/Kasbi/KasbiFRBase.cpp
  75. +1
    -1
      3.0/src/modules/Hardware/FR/src/Kasbi/KasbiFRConstants.h
  76. +20
    -21
      3.0/src/modules/Hardware/FR/src/MStar/Online/AFPFR.cpp
  77. +1
    -0
      3.0/src/modules/Hardware/FR/src/MStar/Online/AFPFR.h
  78. +54
    -37
      3.0/src/modules/Hardware/FR/src/MStar/Online/AFPFRConstants.h
  79. +1
    -1
      3.0/src/modules/Hardware/FR/src/MStar/Online/ModelData.h
  80. +5
    -3
      3.0/src/modules/Hardware/FR/src/OPOSMStarTUPK/OPOSMStarTUPK.cpp
  81. +1
    -1
      3.0/src/modules/Hardware/FR/src/OPOSMStarTUPK/OPOSMStarTUPK.h
  82. +2
    -2
      3.0/src/modules/Hardware/FR/src/Prim/Online/PrimOnlineFRBase.cpp
  83. +12
    -5
      3.0/src/modules/Hardware/FR/src/Prim/PrimFRBase.cpp
  84. +1
    -1
      3.0/src/modules/Hardware/FR/src/Prim/PrimFRBase.h
  85. +15
    -5
      3.0/src/modules/Hardware/FR/src/Prim/PrimFRConstants.h
  86. +17
    -11
      3.0/src/modules/Hardware/FR/src/Shtrih/Base/ProtoShtrihFR.cpp
  87. +3
    -3
      3.0/src/modules/Hardware/FR/src/Shtrih/Base/ProtoShtrihFR.h
  88. +0
    -7
      3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihFROnlineConstants.h
  89. +21
    -16
      3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihOnlineFRBase.cpp
  90. +1
    -1
      3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihOnlineFRBase.h
  91. +36
    -7
      3.0/src/modules/Hardware/FR/src/Shtrih/ShtrihFRConstants.h
  92. +12
    -2
      3.0/src/modules/Hardware/FR/src/Spark/SparkFR.cpp
  93. +5
    -3
      3.0/src/modules/Hardware/Hardware.qbs
  94. +1
    -1
      3.0/src/modules/Hardware/IOPorts/src/Base/IOPortBase.h
  95. +3
    -3
      3.0/src/modules/Hardware/IOPorts/src/COM/windows/AsyncSerialPort.cpp
  96. +2
    -2
      3.0/src/modules/Hardware/IOPorts/src/COM/windows/AsyncSerialPort.h
  97. +4
    -4
      3.0/src/modules/Hardware/IOPorts/src/TCP/TCPPort.cpp
  98. +2
    -2
      3.0/src/modules/Hardware/IOPorts/src/TCP/TCPPort.h
  99. +59
    -2
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU700/CitizenPPU700.cpp
  100. +34
    -0
      3.0/src/modules/Hardware/Printers/src/POSPrinters/Citizen/CitizenPPU700/CitizenPPU700.h

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

@@ -4,7 +4,7 @@
<!-- Общий контент Российской площадки -->
<directory source="src/runtimes/ru/common" target="" recursive="true"/>
<!-- Интерфейс Modern, компонент interface -->
<!-- Интерфейс modern, компонент interface -->
<directory source="src/interface/modern/build" target="interface/interface/modern" recursive="true">
<exclude>*.wav</exclude>
</directory>
@@ -35,11 +35,7 @@
<option target="interface/interface/modern/interface.ini" key="ui/show_sms_spam" value="true" />
<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/show_gfx" value="true" />
<!-- Настройка ГосУслуг -->
<!-- Настройка ГосУслуг -->
<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_platru_changeback" value="true" />
@@ -61,8 +57,8 @@
<!-- <file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/uniteller.dll" target="plugins/plugins/uniteller.dll"/> -->
<!-- UCS plugin -->
<!--<option target="user/user/plugins/ucs.ini" key="PaymentProcessor.ChargeProvider.UcsChargeProvider.configuration_singleton/ucs_runtime_path" value="C:/UCS/BIN" />
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/ucs.dll" target="plugins/plugins/ucs.dll"/>-->
<option target="user/user/plugins/ucs.ini" key="PaymentProcessor.ChargeProvider.UcsChargeProvider.configuration_singleton/ucs_runtime_path" value="C:/UCS/BIN" />
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/ucs.dll" target="plugins/plugins/ucs.dll"/>
<!-- Драйверы, компонент drivers -->
<file source="{QBS_RESULT_PATH}/plugins/drivers/fr.dll" target="drivers/plugins/drivers/fr.dll"/>
@@ -94,7 +90,7 @@
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/platru_ru.qm" target="locale/plugins/platru_ru.qm"/>
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/cyberchange_ru.qm" target="locale/plugins/cyberchange_ru.qm"/>
<!-- <file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/uniteller_ru.qm" target="locale/plugins/uniteller_ru.qm"/> -->
<!--<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/ucs_ru.qm" target="locale/plugins/ucs_ru.qm"/> -->
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/ucs_ru.qm" target="locale/plugins/ucs_ru.qm"/> -->
<!-- ###################################################################################### -->
@@ -109,8 +105,11 @@
<!-- ###################################################################################### -->
<!-- Token plugin -->
<file if="{TC_USE_TOKEN} &amp;&amp; {CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/drivers/token.dll" target="drivers/plugins/drivers/token.dll"/>
<!-- Fiscal client plugin -->
<!--<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/fiscal_client.dll" target="plugins/plugins/fiscal_client.dll"/>-->
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/fiscal_client.dll" target="plugins/plugins/fiscal_client.dll"/>
<!-- ###################################################################################### -->


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

@@ -322,7 +322,13 @@ bool CryptService::addKey(const PP::SKeySettings & aKey)
}

//---------------------------------------------------------------------------
int CryptService::generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL, QString & aSD, QString & aAP, QString & aOP)
QList<int> CryptService::getLoadedKeys() const
{
return mKeys.keys();
}

//---------------------------------------------------------------------------
int CryptService::generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL, QString & aSD, QString & aAP, QString & aOP, const QString & aDescription)
{
PP::INetworkService * networkService = mApplication->getCore()->getNetworkService();

@@ -342,6 +348,7 @@ int CryptService::generateKey(int aKeyId, const QString & aLogin, const QString
}

mKeyPair = keyPair;
mKeyPair.description = aDescription;

if ((result = registerKeyPair(getCryptEngine(), aKeyId, networkService->getNetworkTaskManager(), aURL, aLogin, aPassword, mKeyPair)) != EKeysUtilsError::Ok)
{
@@ -404,6 +411,18 @@ bool CryptService::replaceKeys(int aKeyIdSrc, int aKeyIdDst)
return result;
}

//---------------------------------------------------------------------------
SDK::PaymentProcessor::ICryptService::SKeyInfo CryptService::getKeyInfo(int aKeyId)
{
SDK::PaymentProcessor::SKeySettings key = getKey(aKeyId);
SDK::PaymentProcessor::ICryptService::SKeyInfo keyInfo;

keyInfo.sd = key.sd;
keyInfo.ap = key.ap;
keyInfo.op = key.op;

return keyInfo;
}

//---------------------------------------------------------------------------
bool CryptService::saveKey()
@@ -420,6 +439,7 @@ bool CryptService::saveKey()
key.op = mKeyPair.op;
key.sd = mKeyPair.sd;
key.engine = mKeyPair.engine;
key.description = mKeyPair.description;

QByteArray serverPublicKey = mKeyPair.serverPublicKey;



+ 7
- 1
3.0/src/apps/PaymentProcessor/src/Services/CryptService.h View File

@@ -51,7 +51,7 @@ public:
#pragma region SDK::PaymentProcessor::ICryptService interface

/// Сгенерировать и зарегистрировать ключ на сервере. Возвращает EKeysUtilsError::Enum.
virtual int generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL, QString & aSD, QString & aAP, QString & aOP);
virtual int generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL, QString & aSD, QString & aAP, QString & aOP, const QString & aDescription = QString());

/// Сохранить сгенерированный ключ.
virtual bool saveKey();
@@ -59,6 +59,12 @@ public:
/// Меняем ключи местами
virtual bool replaceKeys(int aKeyIdSrc, int aKeyIdDst);

/// Получить информацию о ключе по номеру пары
virtual SDK::PaymentProcessor::ICryptService::SKeyInfo getKeyInfo(int aKeyId);

/// Возвращает загруженные номера пар ключей
virtual QList<int> getLoadedKeys() const;

/// Возвращает интерфейс криптодвижка.
virtual ICryptEngine * getCryptEngine();



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

@@ -516,7 +516,7 @@ void GUIService::onIntruderActivity()
}
#ifndef _DEBUG
mEventManager->sendEvent(PPSDK::Event(event, CGUIService::LogName, message));
mEventManager->sendEvent(PPSDK::Event(event, CGUIService::IntruderLogName, message));
#endif
}


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

@@ -27,6 +27,7 @@ class GuardService;
namespace CGUIService
{
const char LogName[] = "Interface";
const char IntruderLogName[] = "Penetration";
const char BackedObjectPrefix[] = "Backend$";
const char IdleScenarioName[] = "idle";
const int CheckTopmostWindowTimeout = 5 * 1000;


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

@@ -54,7 +54,7 @@ QVariantMap toUpperCaseKeys(const QVariantMap & aParameters)
#endif
//---------------------------------------------------------------------------
SDK::Driver::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap & aParameters)
DSDK::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap & aParameters)
{
DSDK::TUnitDataList unitDataList;
@@ -114,7 +114,7 @@ SDK::Driver::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap &
auto taxSystem = aParameters.contains(CPrintConstants::DealerTaxSystem) ? static_cast<DSDK::ETaxSystems::Enum>(aParameters.value(CPrintConstants::DealerTaxSystem).toInt()) : DSDK::ETaxSystems::None;
auto agentFlag = aParameters.contains(CPrintConstants::DealerAgentFlag) ? static_cast<DSDK::EAgentFlags::Enum>(aParameters.value(CPrintConstants::DealerAgentFlag).toInt()) : DSDK::EAgentFlags::None;
DSDK::SPaymentData result(unitDataList, false, payType, taxSystem, agentFlag);
DSDK::SPaymentData result(unitDataList, DSDK::EPayOffTypes::Debit, payType, taxSystem, agentFlag);
result.fiscalParameters[CHardwareSDK::FR::UserPhone] = QString();
result.fiscalParameters[CHardwareSDK::FR::UserMail] = QString();
@@ -269,8 +269,8 @@ bool PrintPayment::print(DSDK::IPrinter * aPrinter, const QVariantMap & aParamet
mFiscalFieldData = aPrinter->getDeviceConfiguration().value(CHardwareSDK::FR::FiscalFieldData).value<DSDK::TFiscalFieldData>();
}
SDK::Driver::TFiscalPaymentData fiscalPaymentData;
SDK::Driver::TComplexFiscalPaymentData payOffSubjectData;
DSDK::TFiscalPaymentData fiscalPaymentData;
DSDK::TComplexFiscalPaymentData payOffSubjectData;
fiscalPrinter->checkFiscalFields(FDNumber, fiscalPaymentData, payOffSubjectData);
addFiscalPaymentData(fiscalPaymentData, receipt);


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

@@ -1447,6 +1447,7 @@ void PrintingService::updateHardwareConfiguration()
QVariantMap dealerSettings;
if (mStaticParameters.contains(CPrintConstants::DealerTaxSystem)) dealerSettings.insert(CHardwareSDK::FR::DealerTaxSystem, mStaticParameters[CPrintConstants::DealerTaxSystem]);
if (mStaticParameters.contains(CPrintConstants::DealerAgentFlag)) dealerSettings.insert(CHardwareSDK::FR::DealerAgentFlag, mStaticParameters[CPrintConstants::DealerAgentFlag]);
if (mStaticParameters.contains(CPrintConstants::DealerVAT)) dealerSettings.insert(CHardwareSDK::FR::DealerVAT, mStaticParameters[CPrintConstants::DealerVAT]);
mPrinterDevices.append(device);


+ 1
- 1
3.0/src/includes/Hardware/CardReaders/ProtoMifareReader.h View File

@@ -9,7 +9,7 @@
#include "Hardware/Common/ProtoDevice.h"

//--------------------------------------------------------------------------------
class ProtoMifareReader : public ProtoDevice, public SDK::Driver::IMifareReader
class ProtoMifareReader : public ProtoDevice, public MetaDevice<SDK::Driver::IMifareReader>
{
Q_OBJECT



+ 1
- 1
3.0/src/includes/Hardware/CashAcceptors/ProtoCashAcceptor.h View File

@@ -9,7 +9,7 @@
#include "Hardware/Common/ProtoDevice.h"

//--------------------------------------------------------------------------------
class ProtoCashAcceptor : public ProtoDevice, public SDK::Driver::ICashAcceptor
class ProtoCashAcceptor : public ProtoDevice, public MetaDevice<SDK::Driver::ICashAcceptor>
{
Q_OBJECT



+ 2
- 0
3.0/src/includes/Hardware/Common/DeviceDataConstants.h View File

@@ -139,6 +139,8 @@ namespace CDeviceData
const char AutomaticNumber[] = "automatic_number";
const char DTDBuild[] = "dtd_build"; // data transfer device
const char CanProcessZBuffer[] = "can_process_z_buffer";
const char Taxes[] = "taxes";
const char Taxes2019Applied[] = "taxes_2019_applied";
}
/// ЭКЛЗ.


+ 3
- 0
3.0/src/includes/Hardware/Common/ProtoDevice.h View File

@@ -12,6 +12,9 @@
#include <SDK/Drivers/WarningLevel.h>
#include <SDK/Drivers/Components.h>

// Project
#include "Hardware/Common/MetaDevice.h"

#define SET_DEVICE_TYPE(aType) public: static QString getDeviceType() { return SDK::Driver::CComponents::aType; }

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


+ 3
- 3
3.0/src/includes/Hardware/Common/ProtoDevices.h View File

@@ -10,9 +10,9 @@
#include "Hardware/Common/ProtoDevice.h"

//--------------------------------------------------------------------------------
class ProtoDeviceBase: virtual public SDK::Driver::IDevice, public ProtoDevice {};
class ProtoDeviceBase: public ProtoDevice, public MetaDevice<SDK::Driver::IDevice> {};

class ProtoPrinter: public ProtoDevice, public SDK::Driver::IPrinter { SET_DEVICE_TYPE(Printer) };
class ProtoModem : public ProtoDevice, public SDK::Driver::IModem { SET_DEVICE_TYPE(Modem) };
class ProtoPrinter: public ProtoDevice, public MetaDevice<SDK::Driver::IPrinter> { SET_DEVICE_TYPE(Printer) };
class ProtoModem : public ProtoDevice, public MetaDevice<SDK::Driver::IModem> { SET_DEVICE_TYPE(Modem) };

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

+ 1
- 1
3.0/src/includes/Hardware/Dispensers/ProtoDispenser.h View File

@@ -9,7 +9,7 @@
#include "Hardware/Common/ProtoDevice.h"

//--------------------------------------------------------------------------------
class ProtoDispenser : public ProtoDevice, public SDK::Driver::IDispenser
class ProtoDispenser : public ProtoDevice, public MetaDevice<SDK::Driver::IDispenser>
{
Q_OBJECT



+ 6
- 5
3.0/src/includes/Hardware/FR/FRBaseConstants.h View File

@@ -77,7 +77,7 @@ namespace EFFD
namespace CFR
{
/// Актуальный ФФД.
const EFFD::Enum ActualFFD = EFFD::F10;
const EFFD::Enum ActualFFD = EFFD::F105;
/// Формат представления даты.
const char DateFormat[] = "ddMMyyyy";
@@ -258,10 +258,11 @@ namespace CFR
struct SData
{
int group;
SDK::Driver::TVAT deviceVAT;
QString description;
SData() : group(0) {}
SData(int aGroup, const QString & aDescription = "") : group(aGroup), description(aDescription) {}
SData(int aGroup, SDK::Driver::TVAT aDeviceVAT, const QString & aDescription = "") : group(aGroup), deviceVAT(aDeviceVAT), description(aDescription) {}
};
class Data : public CSpecification<SDK::Driver::TVAT, SData>
@@ -269,7 +270,7 @@ namespace CFR
public:
void add(SDK::Driver::TVAT aVAT, int aGroup)
{
append(aVAT, SData(aGroup));
append(aVAT, SData(aGroup, aVAT));
}
};
@@ -277,7 +278,7 @@ namespace CFR
}
/// Скорректировать ставку НДС с 18% на 20% в РФ.
inline void adjustRFVAT(Taxes::TData & aData) { if (aData.contains(18) && isRFVAT20()) { aData.insert(20, aData[18]); aData.remove(18); }}
inline void adjustRFVAT(Taxes::TData & aData) { if (aData.contains(18) && isRFVAT20()) { aData.insert(20, aData[18]); aData[20].description.replace("18", "20"); aData.remove(18); }}
//--------------------------------------------------------------------------------
/// Типы оплаты
@@ -430,7 +431,7 @@ namespace CFR
//--------------------------------------------------------------------------------
/// Признаки расчета (1054).
class CPayOffTypes : public CDescription<SDK::Driver::EPayOffTypes::Enum>
class CPayOffTypes : public CDescription<char>
{
public:
CPayOffTypes()


+ 4
- 1
3.0/src/includes/Hardware/FR/FRStatusCodes.h View File

@@ -24,7 +24,9 @@ namespace FRStatusCode
const int WrongDealerTaxSystem = 261; /// Неверно настроена СНО (1! СНО в ФР).
const int WrongDealerAgentFlag = 262; /// Неверно настроен признак агента (1! признак агента в ФР).
const int WrongFiscalizationSettings = 263; /// Параметры фискализации некорректны.
const int Taxes = 264; /// Налоговые ставки неверны.
const int WrongTaxOnPayment = 264; /// Неверная налоговая ставка на платеже.
const int NeedTimeSynchronization = 265; /// Необходима синхронизация с системным временем.
const int FSVirtualEnd = 266; /// Срок действия ФН должен был закончиться.
}
/// Ошибки.
@@ -45,6 +47,7 @@ namespace FRStatusCode
const int WrongDealerTaxSystem = 282; /// Неверно настроена СНО.
const int WrongDealerAgentFlag = 283; /// Неверно настроен признак агента.
const int CashierINN = 284; /// Неправильный ИНН кассира.
const int Taxes = 285; /// Налоговые ставки неверны.
}
}


+ 4
- 1
3.0/src/includes/Hardware/FR/FRStatusesDescriptions.h View File

@@ -36,7 +36,9 @@ namespace FRStatusCode
ADD_FR_WARNING(WrongDealerTaxSystem, QCoreApplication::translate("FRStatuses", "#wrong_dealer_tax_system"));
ADD_FR_WARNING(WrongDealerAgentFlag, QCoreApplication::translate("FRStatuses", "#wrong_dealer_agent_flag"));
ADD_FR_WARNING(WrongFiscalizationSettings, QCoreApplication::translate("FRStatuses", "#wrong_fiscalization_settings"));
ADD_FR_WARNING(Taxes, QCoreApplication::translate("FRStatuses", "#taxes"));
ADD_FR_WARNING(WrongTaxOnPayment, QCoreApplication::translate("FRStatuses", "#wrong_tax_on_payment"));
ADD_FR_WARNING(NeedTimeSynchronization, QCoreApplication::translate("FRStatuses", "#need_time_synchronization"));
ADD_FR_WARNING(FSVirtualEnd, QCoreApplication::translate("FRStatuses", "#fs_virtual_end"));
/// Ошибки.
ADD_FR_ERROR(FR, QCoreApplication::translate("FRStatuses", "#fiscal_add_on_error"));
@@ -54,6 +56,7 @@ namespace FRStatusCode
ADD_FR_ERROR(WrongDealerTaxSystem, QCoreApplication::translate("FRStatuses", "#wrong_dealer_tax_system"));
ADD_FR_ERROR(WrongDealerAgentFlag, QCoreApplication::translate("FRStatuses", "#wrong_dealer_agent_flag"));
ADD_FR_ERROR(CashierINN, QCoreApplication::translate("FRStatuses", "#cashier_inn"));
ADD_FR_ERROR(Taxes, QCoreApplication::translate("FRStatuses", "#taxes"));
}
TStatusCodes getFiscalStatusCodes()


+ 1
- 1
3.0/src/includes/Hardware/FR/ProtoFR.h View File

@@ -9,7 +9,7 @@
#include "Hardware/Common/ProtoDevice.h"

//--------------------------------------------------------------------------------
class ProtoFR: public ProtoDevice, public SDK::Driver::IFiscalPrinter
class ProtoFR: public ProtoDevice, public MetaDevice<SDK::Driver::IFiscalPrinter>
{
Q_OBJECT



+ 1
- 1
3.0/src/includes/Hardware/HID/ProtoHID.h View File

@@ -14,7 +14,7 @@
#include "Hardware/Common/ProtoDevice.h"

//--------------------------------------------------------------------------------
class ProtoHID : public ProtoDevice, public SDK::Driver::IHID
class ProtoHID : public ProtoDevice, public MetaDevice<SDK::Driver::IHID>
{
Q_OBJECT



+ 0
- 4
3.0/src/includes/Hardware/Plugins/DevicePluginBase.h View File

@@ -7,10 +7,6 @@
#include <SDK/Plugins/IPluginFactory.h>
#include <SDK/Plugins/IPluginLoader.h>
#pragma warning ( disable : 4250 ) // warning 4250: 'class1' : inherits 'class2::member' via dominance
// Есть ветки наследования, интерфейсная и базовой реализации. Последняя содержит вызываемый функционал и
// сделана специально выше по уровню, чем соответствующий интерфейс, поэтому предупреждение подавлено и включается во все файлы.
//------------------------------------------------------------------------------
template <class T>
class DevicePluginBase : public SDK::Plugin::IPlugin, public T


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

@@ -2,6 +2,12 @@
#pragma once
// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QByteArray>
#include <Common/QtHeadersEnd.h>
// Project
#include "Hardware/Common/WaitingData.h"
//--------------------------------------------------------------------------------
@@ -16,9 +22,7 @@ namespace CPOSPrinter
const char GetROMVersion[] = "\x1D\x49\x03"; /// Получение версии прошивки.
const char Initialize[] = "\x1B\x40"; /// Инициализация.
const char SetEnabled[] = "\x1B\x3D\x01"; /// Включение доступности принтера.
const char SetLineWidthMultiplier[] = "\x1B\x33"; /// Неизменяемая часть команды установки множителя высоты строки.
const char SetCodePage[] = "\x1B\x74"; /// Неизменяемая часть команды установки кодовой страницы.
const char SetCharacterSet[] = "\x1B\x52"; /// Неизменяемая часть команды
const char SetUSCharacterSet[] = "\x1B\x52\x30"; /// Установка набора символов США (не кодовая страница).
const char SetStandartMode[] = "\x1B\x53"; /// Установка стандартного режима.
const char Present[] = "\x1D\x65\x03"; /// Неизменяемая часть команды презентации чека.
const char Retract[] = "\x1D\x65\x02"; /// Забирание чека в ретрактор.
@@ -26,11 +30,14 @@ namespace CPOSPrinter
const char LoopEnable[] = "\x1D\x65\x12"; /// Включение петли.
const char LoopDisable[] = "\x1D\x65\x14"; /// Выключение петли.
const char GetPaperStatus[] = "\x1B\x76"; /// Запрос статуса бумаги.
const char GetStatus[] = "\x10\x04"; /// Неизменяемая часть команды запроса статуса.
const char Cut[] = "\x1B\x69"; /// Отрезка.
const char PrintImage[] = "\x1D\x76\x30"; /// Печать картинки.
const char AlignLeft[] = "\x1B\x61\x30"; /// Выравнивание по левому краю.
inline QByteArray GetStatus(char aStatusType) { return QByteArray("\x10\x04") + aStatusType; } /// Запрос статуса.
inline QByteArray SetCodePage(char aCodePage) { return QByteArray("\x1B\x74") + aCodePage; } /// Установка кодовой страницы.
inline QByteArray SetLineSpacing(int aSpacing) { return QByteArray("\x1B\x33") + char(aSpacing); } /// Установка множителя высоты строки.
/// Штрих-коды.
namespace Barcode
{
@@ -43,7 +50,6 @@ namespace CPOSPrinter
}
const char RussianCodePage = '\x11'; /// Номер русской кодовой страницы.
const char USACharacters = '\x30'; /// Спец. международный набор символов, принятый в США.
const char DefaultName[] = "Unknown POS Printer"; /// Имя принтера по умолчанию.
/// Штрих-коды.
@@ -67,8 +73,8 @@ namespace CPOSPrinter
/// Таймауты ожидания ответа на запрос, [мс].
namespace Timeouts
{
const int Status = 200; /// Статус.
const int Info = 1000; /// Информация о модели.
const int Status = 200; /// Статус.
const int Info = 1000; /// Информация о модели.
}
/// Ожидание выхода из анабиоза, [мс].


+ 2
- 1
3.0/src/includes/Hardware/Protocols/Common/ProtocolNames.h View File

@@ -19,7 +19,8 @@ namespace ProtocolNames

namespace FR
{
const char ATOL[] = "ATOL";
const char ATOL2[] = "ATOL2";
const char ATOL3[] = "ATOL3";
const char Shtrih[] = "Shtrih";
const char PRIM[] = "PRIM";
const char SPARK[] = "SPARK";


+ 1
- 0
3.0/src/includes/Hardware/Protocols/FR/Atol2FR.h View File

@@ -0,0 +1 @@
#include "../../../../modules/Hardware/Protocols/FR/Atol2/src/Atol2FR.h"

+ 1
- 0
3.0/src/includes/Hardware/Protocols/FR/Atol3FR.h View File

@@ -0,0 +1 @@
#include "../../../../modules/Hardware/Protocols/FR/Atol3/src/Atol3FR.h"

+ 0
- 1
3.0/src/includes/Hardware/Protocols/FR/AtolFR.h View File

@@ -1 +0,0 @@
#include "../../../../modules/Hardware/Protocols/FR/Atol/src/AtolFR.h"

+ 1
- 1
3.0/src/includes/Hardware/Watchdogs/ProtoWatchdog.h View File

@@ -10,7 +10,7 @@
#include "Hardware/Watchdogs/WatchdogStatusCodes.h"

//--------------------------------------------------------------------------------
class ProtoWatchdog : public ProtoDevice, public SDK::Driver::IWatchdog
class ProtoWatchdog : public ProtoDevice, public MetaDevice<SDK::Driver::IWatchdog>
{
Q_OBJECT



+ 12
- 10
3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h View File

@@ -179,16 +179,18 @@ typedef QList<SUnitData> TUnitDataList;
/// Фискальные данные платежа
struct SPaymentData
{
TUnitDataList unitDataList; /// Список данных товара
bool back; /// Признак возврата товара
EPayTypes::Enum payType; /// Тип оплаты
ETaxSystems::Enum taxSystem; /// Система налогообложения (СНО)
EAgentFlags::Enum agentFlag; /// Флаг агента
QVariantMap fiscalParameters; /// Параметры платежа - теги или имеют к ним отношение
SPaymentData(): back(false), payType(EPayTypes::None), taxSystem(ETaxSystems::None), agentFlag(EAgentFlags::None) {}
SPaymentData(const TUnitDataList & aUnitDataList, bool aBack, EPayTypes::Enum aPayType = EPayTypes::None, ETaxSystems::Enum aTaxSystem = ETaxSystems::None, EAgentFlags::Enum aAgentFlag = EAgentFlags::None):
back(aBack), unitDataList(aUnitDataList), taxSystem(aTaxSystem), payType(aPayType), agentFlag(aAgentFlag) {}
TUnitDataList unitDataList; /// Список данных товара
EPayOffTypes::Enum payOffType; /// Признак расчета
EPayTypes::Enum payType; /// Тип оплаты
ETaxSystems::Enum taxSystem; /// Система налогообложения (СНО)
EAgentFlags::Enum agentFlag; /// Флаг агента
QVariantMap fiscalParameters; /// Параметры платежа - теги или имеют к ним отношение
SPaymentData(): payOffType(EPayOffTypes::None), payType(EPayTypes::None), taxSystem(ETaxSystems::None), agentFlag(EAgentFlags::None) {}
SPaymentData(const TUnitDataList & aUnitDataList, EPayOffTypes::Enum aPayOffType, EPayTypes::Enum aPayType = EPayTypes::None, ETaxSystems::Enum aTaxSystem = ETaxSystems::None, EAgentFlags::Enum aAgentFlag = EAgentFlags::None):
payOffType(aPayOffType), unitDataList(aUnitDataList), taxSystem(aTaxSystem), payType(aPayType), agentFlag(aAgentFlag) {}
bool back() const { return (payOffType == EPayOffTypes::DebitBack) || (payOffType == EPayOffTypes::Credit); }
};
//--------------------------------------------------------------------------------


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

@@ -64,6 +64,7 @@ namespace CAllHardware
const char SectionNames[] = "section_names";
const char DealerTaxSystem[] = "dealer_tax_system";
const char DealerAgentFlag[] = "dealer_agent_flag";
const char DealerVAT[] = "dealer_vat";
const char UserPhone[] = "user_phone";
const char UserMail[] = "user_mail";
const char ZReportTime[] = "z_report_time";


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

@@ -28,7 +28,7 @@ namespace ECardType
};
}

class ICardReader: virtual public IDevice
class ICardReader: public IDevice
{
public:
/// Карта вставлена.


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

@@ -11,7 +11,7 @@ namespace SDK {
namespace Driver {

//--------------------------------------------------------------------------------
class ICashAcceptor: virtual public IDevice
class ICashAcceptor: public IDevice
{
public:
/// Была принята купюра номиналом aPar.


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

@@ -16,7 +16,7 @@ namespace Driver {
typedef QVector<int> TUnitData;

//--------------------------------------------------------------------------------
class IDispenser: virtual public IDevice
class IDispenser: public IDevice
{
public:
/// Предметы выданы.


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

@@ -8,7 +8,7 @@ namespace SDK {
namespace Driver {

//--------------------------------------------------------------------------------
class IHID: virtual public IDevice
class IHID: public IDevice
{
public: // константы
/// Событие о новых введённых данных.


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

@@ -25,7 +25,7 @@ namespace EPortTypes
}

//--------------------------------------------------------------------------------
class IIOPort: virtual public IDevice
class IIOPort: public IDevice
{
public: // константы
/// Таймаут чтения по умолчанию, [мс].
@@ -51,7 +51,7 @@ public: // методы
virtual void getParameters(TPortParameters & aParameters) = 0;

/// Чтение данных.
virtual bool read(QByteArray & aData, int aTimeout = DefaultReadTimeout) = 0;
virtual bool read(QByteArray & aData, int aTimeout = DefaultReadTimeout, int aMinSize = 1) = 0;

/// Передача данных.
virtual bool write(const QByteArray & aData) = 0;


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

@@ -26,7 +26,7 @@ namespace GSM
}

//--------------------------------------------------------------------------------
class IModem: virtual public IDevice
class IModem: public IDevice
{
public:
/// Сброс.


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

@@ -9,7 +9,7 @@ namespace SDK {
namespace Driver {

//--------------------------------------------------------------------------------
class IPrinter: virtual public IDevice
class IPrinter: public IDevice
{
public: // методы
/// Напечатать.


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

@@ -9,7 +9,7 @@ namespace SDK {
namespace Driver {

//--------------------------------------------------------------------------------
class IWatchdog: virtual public IDevice
class IWatchdog: public IDevice
{
public:
/// Предметы выданы.


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

@@ -15,9 +15,19 @@ namespace PaymentProcessor {
class ICryptService
{
public:
struct SKeyInfo
{
QString sd; /// Код диллера.
QString ap; /// Код точки.
QString op; /// Код оператора.

bool isValid() { return !sd.isEmpty() && !ap.isEmpty() && !op.isEmpty(); }
};

public:
/// Генерирует и регистрирует ключ на сервере. Возвращает параметры сгенерированного ключа.
virtual int generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL,
QString & aSD, QString & aAP, QString & aOP) = 0;
QString & aSD, QString & aAP, QString & aOP, const QString & aDescription = QString()) = 0;

/// Сохраняет сгенерированный ключ.
virtual bool saveKey() = 0;
@@ -25,6 +35,12 @@ public:
/// Меняем ключи местами
virtual bool replaceKeys(int aKeyIdSrc, int aKeyIdDst) = 0;

/// Возвращает загруженные номера пар ключей
virtual QList<int> getLoadedKeys() const = 0;

/// Получить информацию о ключе по номеру пары
virtual SKeyInfo getKeyInfo(int aKeyId) = 0;

/// Возвращает интерфейс криптодвижка.
virtual ICryptEngine * getCryptEngine() = 0;



+ 10
- 0
3.0/src/modules/DeviceManager/src/DeviceManager.cpp View File

@@ -758,6 +758,16 @@ void DeviceManager::checkITInstancePath(QString & aInstancePath)
<< "Common.Driver.FiscalRegistrator.COM.ShtrihOnline.PayVKP80FA");
changeInstancePath(aInstancePath, configPath, paths);
QStringList pathData = aInstancePath.split(".");
if (pathData.size() > 4)
{
if (!pathData[4].compare("ATOL", Qt::CaseInsensitive)) pathData[4] = pathData[4].replace("ATOL", "ATOL2", Qt::CaseInsensitive);
if (!pathData[4].compare("AtolOnline", Qt::CaseInsensitive)) pathData[4] = pathData[4].replace("AtolOnline", "ATOL2Online", Qt::CaseInsensitive);
aInstancePath = pathData.join(".");
}
}
//------------------------------------------------------------------------------


+ 18
- 9
3.0/src/modules/Hardware.sln View File

@@ -23,8 +23,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CCNetProtocol", "Hardware\P
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ID003Protocol", "Hardware\Protocols\CashAcceptor\ID003\ID003Protocol.vcxproj", "{E56365ED-3C69-4D96-9A02-D449390B6E46}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AtolFRProtocol", "Hardware\Protocols\FR\Atol\AtolFRProtocol.vcxproj", "{8912050F-921E-4480-9597-55D7B8B08831}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IncotexProtocol", "Hardware\Protocols\FR\Incotex\IncotexProtocol.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShtrihFRProtocol", "Hardware\Protocols\FR\Shtrih\ShtrihFR.vcxproj", "{7E9FE953-C21A-4362-BE27-70B22132279A}"
@@ -73,6 +71,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Acceptors", "Hardware\Accep
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AFPFRProtocol", "Hardware\Protocols\FR\AFP\AFPFRProtocol.vcxproj", "{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Atol3FRProtocol", "Hardware\Protocols\FR\Atol3\Atol3FRProtocol.vcxproj", "{2B969FB3-3709-409D-BA4D-DCCD975B2F18}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Atol2FRProtocol", "Hardware\Protocols\FR\Atol2\Atol2FRProtocol.vcxproj", "{8912050F-921E-4480-9597-55D7B8B08831}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -134,12 +136,6 @@ Global
{E56365ED-3C69-4D96-9A02-D449390B6E46}.Release|Win32.Build.0 = Release|Win32
{E56365ED-3C69-4D96-9A02-D449390B6E46}.ReleaseWithDebugInfo|Win32.ActiveCfg = ReleaseWithDebugInfo|Win32
{E56365ED-3C69-4D96-9A02-D449390B6E46}.ReleaseWithDebugInfo|Win32.Build.0 = ReleaseWithDebugInfo|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.Debug|Win32.ActiveCfg = Debug|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.Debug|Win32.Build.0 = Debug|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.Release|Win32.ActiveCfg = Release|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.Release|Win32.Build.0 = Release|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.ReleaseWithDebugInfo|Win32.ActiveCfg = ReleaseWithDebugInfo|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.ReleaseWithDebugInfo|Win32.Build.0 = ReleaseWithDebugInfo|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|Win32.ActiveCfg = Debug|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.ActiveCfg = Release|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|Win32.ActiveCfg = ReleaseWithDebugInfo|Win32
@@ -263,6 +259,18 @@ Global
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.Release|Win32.Build.0 = Release|Win32
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.ReleaseWithDebugInfo|Win32.ActiveCfg = ReleaseWithDebugInfo|Win32
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.ReleaseWithDebugInfo|Win32.Build.0 = ReleaseWithDebugInfo|Win32
{2B969FB3-3709-409D-BA4D-DCCD975B2F18}.Debug|Win32.ActiveCfg = Debug|Win32
{2B969FB3-3709-409D-BA4D-DCCD975B2F18}.Debug|Win32.Build.0 = Debug|Win32
{2B969FB3-3709-409D-BA4D-DCCD975B2F18}.Release|Win32.ActiveCfg = Release|Win32
{2B969FB3-3709-409D-BA4D-DCCD975B2F18}.Release|Win32.Build.0 = Release|Win32
{2B969FB3-3709-409D-BA4D-DCCD975B2F18}.ReleaseWithDebugInfo|Win32.ActiveCfg = ReleaseWithDebugInfo|Win32
{2B969FB3-3709-409D-BA4D-DCCD975B2F18}.ReleaseWithDebugInfo|Win32.Build.0 = ReleaseWithDebugInfo|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.Debug|Win32.ActiveCfg = Debug|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.Debug|Win32.Build.0 = Debug|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.Release|Win32.ActiveCfg = Release|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.Release|Win32.Build.0 = Release|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.ReleaseWithDebugInfo|Win32.ActiveCfg = ReleaseWithDebugInfo|Win32
{8912050F-921E-4480-9597-55D7B8B08831}.ReleaseWithDebugInfo|Win32.Build.0 = ReleaseWithDebugInfo|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -273,7 +281,6 @@ Global
{5CEF800E-0984-4486-A804-313C92A72132} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
{A0C8EC67-25CC-45B6-93AE-D4DB1EE30B14} = {FEE80E00-C155-453F-B1A0-1411BF8A2A54}
{E56365ED-3C69-4D96-9A02-D449390B6E46} = {FEE80E00-C155-453F-B1A0-1411BF8A2A54}
{8912050F-921E-4480-9597-55D7B8B08831} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
{B12702AD-ABFB-343A-A199-8E24837244A3} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
{7E9FE953-C21A-4362-BE27-70B22132279A} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
{3179AD00-61EE-4221-AEC9-A9FFDF74F9F5} = {FEE80E00-C155-453F-B1A0-1411BF8A2A54}
@@ -293,6 +300,8 @@ Global
{B5773A56-AE4D-4945-BBFD-5A837DFD2895} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
{EE4C0DCD-F8D8-4D13-B028-A0CA7A386EF0} = {FEE80E00-C155-453F-B1A0-1411BF8A2A54}
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
{2B969FB3-3709-409D-BA4D-DCCD975B2F18} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
{8912050F-921E-4480-9597-55D7B8B08831} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
QtVersion = $(DefaultQtVersion)


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

@@ -39,6 +39,7 @@ CCNetCashAcceptorBase::CCNetCashAcceptorBase(): mFirmware(0)
mCurrencyCode = Currency::NoCurrency;
setConfigParameter(CHardwareSDK::WaitUpdatingTimeout, CCCNet::WaitUpdatingTimeout);
mSupportedModels = getModelList();
mNeedChangeBaudrate = false;
setConfigParameter(CHardware::CashAcceptor::InitializeTimeout, CCCNet::Timeouts::ExitInitialize);
@@ -187,7 +188,7 @@ bool CCNetCashAcceptorBase::checkConnection(QByteArray & aAnswer)
PollingExpector expector;
TStatusCodes statusCodes;
bool result;
bool result = true;
auto statusPoll = [&] () -> bool { statusCodes.clear(); result = getStatus(std::ref(statusCodes)); return result; };
if (expector.wait<bool>(statusPoll, [&] () -> bool { return !result && !mLastAnswer.isEmpty(); }, CCCNet::FalseAutoDetectionWaiting))
@@ -596,7 +597,7 @@ bool CCNetCashAcceptorBase::performUpdateFirmware(const QByteArray & aBuffer)
//--------------------------------------------------------------------------------
bool CCNetCashAcceptorBase::changeBaudRate(bool aHigh)
{
if (!canChangeBaudrate())
if (!mNeedChangeBaudrate)
{
return true;
}
@@ -628,12 +629,6 @@ bool CCNetCashAcceptorBase::changeBaudRate(bool aHigh)
}
//--------------------------------------------------------------------------------
bool CCNetCashAcceptorBase::canChangeBaudrate()
{
return false;
}
//--------------------------------------------------------------------------------
bool CCNetCashAcceptorBase::performBaudRateChanging(const TPortParameters & /*aPortParameters*/)
{
return false;


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

@@ -95,9 +95,6 @@ protected:
/// Поддерживается ли монетоприемник.
bool isCoinAcceptorSupported() const;

/// Может менять скорость?
virtual bool canChangeBaudrate();

/// Протокол.
CCNetProtocol mProtocol;

@@ -119,6 +116,9 @@ protected:

/// Данные команд и ответов.
CCCNet::Commands::Data mCommandData;

/// Нужно менять скорость при перепрошивке?
bool mNeedChangeBaudrate;
};

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

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

@@ -12,6 +12,7 @@ CCNetCashcodeGX::CCNetCashcodeGX()
// данные устройства
mDeviceName = CCCNet::Models::CashcodeGX;
mSupportedModels = QStringList() << mDeviceName;
mNeedChangeBaudrate = true;

setConfigParameter(CHardware::CashAcceptor::InitializeTimeout, CCCNetCashcodeGX::ExitInitializeTimeout);
}
@@ -93,20 +94,6 @@ bool CCNetCashcodeGX::processUpdating(const QByteArray & aBuffer, int aSectionSi
}

//--------------------------------------------------------------------------------
bool CCNetCashcodeGX::canChangeBaudrate()
{
if (mIOPort->getType() == EPortTypes::COM)
{
return true;
}

TPortParameters portParameters;
mIOPort->getParameters(portParameters);

return portParameters[EParameters::BaudRate] == EBaudRate::BR9600;
}

//--------------------------------------------------------------------------------
bool CCNetCashcodeGX::performBaudRateChanging(const TPortParameters & aPortParameters)
{
int baudRate = aPortParameters[EParameters::BaudRate];


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

@@ -35,9 +35,6 @@ protected:
/// Отправить буфер данных обновления прошивки для купюроприемника Cashcode GX.
virtual bool processUpdating(const QByteArray & aBuffer, int aSectionSize);

/// Может менять скорость?
virtual bool canChangeBaudrate();

/// Изменить скорость работы.
virtual bool performBaudRateChanging(const SDK::Driver::TPortParameters & aPortParameters);
};


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

@@ -19,6 +19,7 @@ CCNetCreator::CCNetCreator()
// данные устройства
mDeviceName = CCCNet::Models::CreatorC100;
mSupportedModels = QStringList() << mDeviceName;
mNeedChangeBaudrate = true;
setConfigParameter(CHardware::UpdatingFilenameExtension, "dat");
setConfigParameter(CHardware::CashAcceptor::InitializeTimeout, CCCNetCreator::ExitInitializeTimeout);
@@ -136,12 +137,6 @@ bool CCNetCreator::performUpdateFirmware(const QByteArray & aBuffer)
}
//--------------------------------------------------------------------------------
bool CCNetCreator::canChangeBaudrate()
{
return true;
}
//--------------------------------------------------------------------------------
bool CCNetCreator::performBaudRateChanging(const TPortParameters & aPortParameters)
{
mProtocol.changePortParameters(aPortParameters);


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

@@ -19,9 +19,6 @@ protected:
/// Обновить прошивку.
virtual bool performUpdateFirmware(const QByteArray & aBuffer);

/// Может менять скорость?
virtual bool canChangeBaudrate();

/// Изменить скорость работы.
virtual bool performBaudRateChanging(const SDK::Driver::TPortParameters & aPortParameters);



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

@@ -22,11 +22,11 @@ namespace CCCNet
public:
CFimwareVersions()
{
data()[Models::CashcodeGX ][Currency::RUB][true] = TFimwareVersionSet() << 1205;
data()[Models::CashcodeGX ][Currency::RUB][true] = TFimwareVersionSet() << 1208;
data()[Models::CashcodeSM ][Currency::RUB][true] = TFimwareVersionSet() << 1357;
data()[Models::CashcodeSM ][Currency::RUB][true] = TFimwareVersionSet() << 1359;
data()[Models::CashcodeSM ][Currency::RUB][false] = TFimwareVersionSet() << 1386 << 1434;
data()[Models::CashcodeSM ][Currency::RUB][false] = TFimwareVersionSet() << 1387 << 1434;
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;


+ 5
- 0
3.0/src/modules/Hardware/CashAcceptors/src/ID003/ID003CashAcceptor.cpp View File

@@ -162,6 +162,11 @@ bool ID003CashAcceptor::isConnected()
return false;
}
if (answerData.isEmpty() && isAutoDetecting())
{
return false;
}
QString answer = QString(answerData).trimmed() + ASCII::Space;
mVerified = false;


+ 0
- 5
3.0/src/modules/Hardware/Common/src/Base/DeviceBase.cpp View File

@@ -174,11 +174,6 @@ bool DeviceBase<T>::checkExistence()
toLog(LogLevel::Error, mDeviceName + " can not be found via autodetecting as unsupported by plugin " + getConfigParameter(CHardware::PluginPath).toString());
return false;
}
else if (!mVerified && autoDetecting)
{
toLog(LogLevel::Error, mDeviceName + " can not be found via autodetecting as unverified.");
return false;
}
else if (!mConnected)
{
toLog(LogLevel::Error, QString("Failed to identify %1.").arg(mDeviceName));


+ 1
- 1
3.0/src/modules/Hardware/Common/src/Base/DeviceBase.h View File

@@ -40,7 +40,7 @@ namespace CDevice
//--------------------------------------------------------------------------------
template <class T>
class DeviceBase : public T, public MetaDevice
class DeviceBase : public T
{
public:
DeviceBase();


+ 72
- 23
3.0/src/modules/Hardware/Common/src/Meta/MetaDevice.cpp View File

@@ -7,13 +7,40 @@
#include <QtCore/QReadLocker>
#include <Common/QtHeadersEnd.h>
// SDK
#include <SDK/Drivers/ICardReader.h>
#include <SDK/Drivers/ICashAcceptor.h>
#include <SDK/Drivers/IDevice.h>
#include <SDK/Drivers/IDispenser.h>
#include <SDK/Drivers/IFiscalPrinter.h>
#include <SDK/Drivers/IHID.h>
#include <SDK/Drivers/IIOPort.h>
#include <SDK/Drivers/IMifareReader.h>
#include <SDK/Drivers/IModem.h>
#include <SDK/Drivers/IPrinter.h>
#include <SDK/Drivers/IWatchdog.h>
// Project
#include "MetaDevice.h"
using namespace SDK::Driver;
//-------------------------------------------------------------------------------
MetaDevice::MetaDevice() :
template class MetaDevice<ICardReader>;
template class MetaDevice<ICashAcceptor>;
template class MetaDevice<IDevice>;
template class MetaDevice<IDispenser>;
template class MetaDevice<IFiscalPrinter>;
template class MetaDevice<IHID>;
template class MetaDevice<IIOPort>;
template class MetaDevice<IMifareReader>;
template class MetaDevice<IModem>;
template class MetaDevice<IPrinter>;
template class MetaDevice<IWatchdog>;
//-------------------------------------------------------------------------------
template <class T>
MetaDevice<T>::MetaDevice() :
mDeviceName(CMetaDevice::DefaultName),
mLogDate(QDate::currentDate()),
mOperatorPresence(false),
@@ -24,19 +51,22 @@ MetaDevice::MetaDevice() :
}
//--------------------------------------------------------------------------------
bool MetaDevice::subscribe(const char * /*aSignal*/, QObject * /*aReceiver*/, const char * /*aSlot*/)
template <class T>
bool MetaDevice<T>::subscribe(const char * /*aSignal*/, QObject * /*aReceiver*/, const char * /*aSlot*/)
{
return false;
}
//--------------------------------------------------------------------------------
bool MetaDevice::unsubscribe(const char * /*aSignal*/, QObject * /*aReceiver*/)
template <class T>
bool MetaDevice<T>::unsubscribe(const char * /*aSignal*/, QObject * /*aReceiver*/)
{
return false;
}
//--------------------------------------------------------------------------------
QString MetaDevice::getName() const
template <class T>
QString MetaDevice<T>::getName() const
{
QString deviceName = getConfigParameter(CHardwareSDK::ModelName).toString();
@@ -44,7 +74,8 @@ QString MetaDevice::getName() const
}
//--------------------------------------------------------------------------------
void MetaDevice::initialize()
template <class T>
void MetaDevice<T>::initialize()
{
logDeviceData(getDeviceData());
@@ -52,7 +83,8 @@ void MetaDevice::initialize()
}
//--------------------------------------------------------------------------------
bool MetaDevice::release()
template <class T>
bool MetaDevice<T>::release()
{
if (mThread.isRunning())
{
@@ -70,24 +102,28 @@ bool MetaDevice::release()
}
//--------------------------------------------------------------------------------
void MetaDevice::updateFirmware(const QByteArray & /*aBuffer*/)
template <class T>
void MetaDevice<T>::updateFirmware(const QByteArray & /*aBuffer*/)
{
}
//--------------------------------------------------------------------------------
bool MetaDevice::canUpdateFirmware()
template <class T>
bool MetaDevice<T>::canUpdateFirmware()
{
return false;
}
//--------------------------------------------------------------------------------
bool MetaDevice::isAutoDetecting() const
template <class T>
bool MetaDevice<T>::isAutoDetecting() const
{
return getConfigParameter(CHardwareSDK::SearchingType).toString() == CHardwareSDK::SearchingTypes::AutoDetecting;
}
//--------------------------------------------------------------------------------
void MetaDevice::setDeviceConfiguration(const QVariantMap & aConfiguration)
template <class T>
void MetaDevice<T>::setDeviceConfiguration(const QVariantMap & aConfiguration)
{
for (auto it = aConfiguration.begin(); it != aConfiguration.end(); ++it)
{
@@ -98,7 +134,8 @@ void MetaDevice::setDeviceConfiguration(const QVariantMap & aConfiguration)
}
//--------------------------------------------------------------------------------
QVariantMap MetaDevice::getDeviceConfiguration() const
template <class T>
QVariantMap MetaDevice<T>::getDeviceConfiguration() const
{
QReadLocker lock(&mConfigurationGuard);
@@ -106,7 +143,8 @@ QVariantMap MetaDevice::getDeviceConfiguration() const
}
//--------------------------------------------------------------------------------
void MetaDevice::setDeviceParameter(const QString & aName, const QVariant & aValue, const QString & aExtensibleName, bool aUpdateExtensible)
template <class T>
void MetaDevice<T>::setDeviceParameter(const QString & aName, const QVariant & aValue, const QString & aExtensibleName, bool aUpdateExtensible)
{
QString value = aValue.toString().simplified();
QVariant::Type type = aValue.type();
@@ -155,7 +193,8 @@ void MetaDevice::setDeviceParameter(const QString & aName, const QVariant & aVal
}
//--------------------------------------------------------------------------------
QVariant MetaDevice::getDeviceParameter(const QString & aName) const
template <class T>
QVariant MetaDevice<T>::getDeviceParameter(const QString & aName) const
{
QReadLocker lock(&mConfigurationGuard);
@@ -163,7 +202,8 @@ QVariant MetaDevice::getDeviceParameter(const QString & aName) const
}
//--------------------------------------------------------------------------------
bool MetaDevice::containsDeviceParameter(const QString & aName) const
template <class T>
bool MetaDevice<T>::containsDeviceParameter(const QString & aName) const
{
QReadLocker lock(&mConfigurationGuard);
@@ -171,7 +211,8 @@ bool MetaDevice::containsDeviceParameter(const QString & aName) const
}
//--------------------------------------------------------------------------------
void MetaDevice::removeDeviceParameter(const QString & aName)
template <class T>
void MetaDevice<T>::removeDeviceParameter(const QString & aName)
{
QWriteLocker lock(&mConfigurationGuard);
@@ -179,7 +220,8 @@ void MetaDevice::removeDeviceParameter(const QString & aName)
}
//---------------------------------------------------------------------------
void MetaDevice::logDeviceData(const SLogData & aData) const
template <class T>
void MetaDevice<T>::logDeviceData(const SLogData & aData) const
{
toLog(LogLevel::Normal, "Plugin path: " + getConfigParameter(CHardware::PluginPath).toString());
@@ -196,7 +238,8 @@ void MetaDevice::logDeviceData(const SLogData & aData) const
}
//---------------------------------------------------------------------------
SLogData MetaDevice::getDeviceData() const
template <class T>
SLogData MetaDevice<T>::getDeviceData() const
{
QReadLocker lock(&mConfigurationGuard);
@@ -246,7 +289,8 @@ SLogData MetaDevice::getDeviceData() const
}
//--------------------------------------------------------------------------------
QString MetaDevice::getPartDeviceData(const TDeviceData & aData, bool aHideEmpty) const
template <class T>
QString MetaDevice<T>::getPartDeviceData(const TDeviceData & aData, bool aHideEmpty) const
{
QStringList keys = aData.keys();
int maxSize = 0;
@@ -275,7 +319,8 @@ QString MetaDevice::getPartDeviceData(const TDeviceData & aData, bool aHideEmpty
}
//--------------------------------------------------------------------------------
IDevice::IDetectingIterator * MetaDevice::getDetectingIterator()
template <class T>
IDevice::IDetectingIterator * MetaDevice<T>::getDetectingIterator()
{
mDetectingPosition = 0;
@@ -283,25 +328,29 @@ IDevice::IDetectingIterator * MetaDevice::getDetectingIterator()
}
//--------------------------------------------------------------------------------
bool MetaDevice::find()
template <class T>
bool MetaDevice<T>::find()
{
return false;
}
//--------------------------------------------------------------------------------
bool MetaDevice::moveNext()
template <class T>
bool MetaDevice<T>::moveNext()
{
return (mDetectingPosition++ == 0);
}
//--------------------------------------------------------------------------------
void MetaDevice::setLog(ILog * aLog)
template <class T>
void MetaDevice<T>::setLog(ILog * aLog)
{
mLog = aLog;
}
//--------------------------------------------------------------------------------
bool MetaDevice::isWorkingThread()
template <class T>
bool MetaDevice<T>::isWorkingThread()
{
return &mThread == QThread::currentThread();
}


+ 2
- 5
3.0/src/modules/Hardware/Common/src/Meta/MetaDevice.h View File

@@ -27,10 +27,6 @@
#include "Hardware/Protocols/Common/ProtocolUtils.h"
#include "Hardware/Common/DeviceUtils.h"
#pragma warning(disable : 4250) // warning 4250: 'class1' : inherits 'class2::member' via dominance
// Есть ветки наследования, интерфейсная и базовой реализации. Последняя содержит вызываемый функционал и
// сделана специально выше по уровню, чем соответствующий интерфейс, поэтому предупреждение подавлено и включается во все файлы.
//--------------------------------------------------------------------------------
/// Общие константы мета-устройств.
namespace CMetaDevice
@@ -68,7 +64,8 @@ class DefaultSeriesType {};
typedef QMap<QString, QString> TDeviceData;
//--------------------------------------------------------------------------------
class MetaDevice : virtual private SDK::Driver::IDevice, public SDK::Driver::IDevice::IDetectingIterator, public DeviceLogicManager
template <class T>
class MetaDevice : public T, public SDK::Driver::IDevice::IDetectingIterator, public DeviceLogicManager
{
SET_INTERACTION_TYPE(System)
SET_SERIES("")


+ 4
- 0
3.0/src/modules/Hardware/FR/msvc/FR.vcxproj View File

@@ -111,6 +111,7 @@
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\Atol\Base\Atol3\Atol3FRBase.cpp" />
<ClCompile Include="..\src\Atol\Base\AtolSerialFR.cpp" />
<ClCompile Include="..\src\Atol\Ejector\AtolEjectorFR.cpp" />
<ClCompile Include="..\src\Atol\AtolModelData.cpp" />
@@ -155,6 +156,9 @@
<ClInclude Include="..\..\..\..\includes\Hardware\FR\FRStatusesDescriptions.h" />
<ClInclude Include="..\src\Atol\AtolCodec.h" />
<ClInclude Include="..\src\Atol\AtolDataTypes.h" />
<ClInclude Include="..\src\Atol\Base\Atol2FRBase.h" />
<ClInclude Include="..\src\Atol\Base\Atol3\Atol3FRBase.h" />
<ClInclude Include="..\src\Atol\Base\Atol3\Atol3FRBaseConstants.h" />
<ClInclude Include="..\src\Atol\Base\AtolFR.h" />
<ClInclude Include="..\src\Atol\Base\AtolFRBaseConstants.h" />
<ClInclude Include="..\src\Atol\Base\AtolSerialFR.h" />


+ 15
- 0
3.0/src/modules/Hardware/FR/msvc/FR.vcxproj.filters View File

@@ -108,6 +108,9 @@
<Filter Include="AFP">
<UniqueIdentifier>{164a8542-6bd2-4e7c-944a-96122f7ac099}</UniqueIdentifier>
</Filter>
<Filter Include="ATOL\Base\ATOL3">
<UniqueIdentifier>{d48b4d7d-c69c-4865-8de4-18ab61ba580c}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\Base\FRBase.cpp">
@@ -200,6 +203,9 @@
<ClCompile Include="..\src\MStar\Online\AFPFR.cpp">
<Filter>AFP</Filter>
</ClCompile>
<ClCompile Include="..\src\Atol\Base\Atol3\Atol3FRBase.cpp">
<Filter>ATOL\Base\ATOL3</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\includes\Hardware\Protocols\FR\FiscalChequeStates.h">
@@ -430,6 +436,15 @@
<ClInclude Include="..\src\MStar\Online\AFPFRDataTypes.h">
<Filter>AFP</Filter>
</ClInclude>
<ClInclude Include="..\src\Atol\Base\Atol2FRBase.h">
<Filter>ATOL\Base</Filter>
</ClInclude>
<ClInclude Include="..\src\Atol\Base\Atol3\Atol3FRBase.h">
<Filter>ATOL\Base\ATOL3</Filter>
</ClInclude>
<ClInclude Include="..\src\Atol\Base\Atol3\Atol3FRBaseConstants.h">
<Filter>ATOL\Base\ATOL3</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\OPOSMStarTUPK\OPOSMStarTUPK.h">


+ 6
- 6
3.0/src/modules/Hardware/FR/src/Atol/AtolDataTypes.h View File

@@ -34,11 +34,11 @@ namespace CAtolFR
{
bool error; /// Код ошибки бывает в ответе
bool status; /// Команда содержится в запросе статуса
bool prefix; /// Префикс бывает в ответе
int timeout; /// Таймаут на ENQ запроса чтения от устройства
bool prefix; /// Префикс бывает в ответе
SCommadData() : error(true), status(false), prefix(true), timeout(0) {}
SCommadData(bool aError, bool aStatus, bool aPrefix, int aTimeout) : error(aError), status(aStatus), prefix(aPrefix), timeout(aTimeout) {}
SCommadData() : error(true), status(false), timeout(0), prefix(false) {}
SCommadData(bool aError, bool aStatus, int aTimeout, bool aPrefix) : error(aError), status(aStatus), timeout(aTimeout), prefix(aPrefix) {}
};
/// Параметры.
@@ -92,11 +92,11 @@ namespace CAtolFR
public:
CommandData()
{
setDefault(SCommadData(true, false, true, Timeouts::CommandDefault));
setDefault(SCommadData(true, false, Timeouts::CommandDefault, true));
}
void add(char aCommand, bool aError = true, bool aStatus = false, bool aPrefix = true) { append(QByteArray(1, aCommand), SCommadData(aError, aStatus, aPrefix, Timeouts::CommandDefault)); }
void add(char aCommand, int aTimeout, bool aStatus = false) { append(QByteArray(1, aCommand), SCommadData(true, aStatus, true, aTimeout)); }
void add(char aCommand, bool aError = true, bool aStatus = false, bool aPrefix = true) { append(QByteArray(1, aCommand), SCommadData(aError, aStatus, Timeouts::CommandDefault, aPrefix)); }
void add(char aCommand, int aTimeout, bool aStatus = false) { append(QByteArray(1, aCommand), SCommadData(true, aStatus, aTimeout, true)); }
};
/// Структура для статических данных моделей.


+ 14
- 8
3.0/src/modules/Hardware/FR/src/Atol/AtolFRConstants.h View File

@@ -16,9 +16,6 @@ namespace CAtolFR
/// Количество товара.
const int GoodsCountByte = 1;

/// Минимальный размер распакованных данных.
const int MinUnPacketAnswerSize = 2;

/// Минимальный код ошибки.
const uchar MinErrorCode = 0x02;

@@ -106,12 +103,21 @@ namespace CAtolFR
const int XReportPoll = 500;
}

/// Тип фискального документа.
namespace DocumentTypes
class CPayOffTypeData: public CSpecification<SDK::Driver::EPayOffTypes::Enum, char>
{
const char Sale = 1; /// Продажа.
const char SaleBack = 2; /// Возврат продажи.
}
public:
CPayOffTypeData()
{
using namespace SDK::Driver;

append(EPayOffTypes::Debit, 1);
append(EPayOffTypes::DebitBack, 2);
append(EPayOffTypes::Credit, 4);
append(EPayOffTypes::CreditBack, 5);
}
};

static CPayOffTypeData PayOffTypeData;

/// Тип оплаты.
namespace PaymentSource


+ 30
- 0
3.0/src/modules/Hardware/FR/src/Atol/Base/Atol2FRBase.h View File

@@ -0,0 +1,30 @@
/* @file Базовый ФР на протоколе АТОЛ2. */

#pragma once

// Modules
#include "Hardware/Protocols/FR/Atol2FR.h"

// Project
#include "AtolFRBase.h"

//--------------------------------------------------------------------------------
class Atol2FRBase : public AtolFRBase
{
SET_SERIES("ATOL2")

protected:
/// Выполнить команду.
virtual TResult performCommand(const QByteArray & aCommandData, QByteArray & aAnswer, int aTimeout)
{
mProtocol.setPort(mIOPort);
mProtocol.setLog(mLog);

return mProtocol.processCommand(aCommandData, aAnswer, aTimeout);
}

/// Протокол.
Atol2FRProtocol mProtocol;
};

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

+ 110
- 0
3.0/src/modules/Hardware/FR/src/Atol/Base/Atol3/Atol3FRBase.cpp View File

@@ -0,0 +1,110 @@
/* @file Базовый ФР на протоколе АТОЛ3. */

#pragma once

#include "Atol3FRBase.h"
#include "Atol3FRBaseConstants.h"

using namespace ProtocolUtils;

//--------------------------------------------------------------------------------
Atol3FRBase::Atol3FRBase(): mTId(0)
{}

//--------------------------------------------------------------------------------
bool Atol3FRBase::isConnected()
{
mProtocol.setPort(mIOPort);
mProtocol.setLog(mLog);
mProtocol.cancel();

return AtolFRBase::isConnected();
}

//--------------------------------------------------------------------------------
TResult Atol3FRBase::performCommand(const QByteArray & aCommandData, QByteArray & aAnswer, int aTimeout)
{
mProtocol.setPort(mIOPort);
mProtocol.setLog(mLog);

QTime clockTimer;
clockTimer.start();

mTId = (mTId == uchar(CAtol3FR::LastTId)) ? ASCII::NUL : ++mTId;
TResult result = mProtocol.processCommand(mTId, aCommandData, aAnswer, aTimeout);

using namespace CAtol3FR;

if (aAnswer[0] == States::InProgress)
{
do
{
result = mProtocol.waitForAnswer(aAnswer);
}
while ((clockTimer.elapsed() < aTimeout) && ((result == CommandResult::NoAnswer) || (aAnswer[0] == States::InProgress)));
}

if (!result)
{
mProtocol.cancel();

return result;
}

auto answerResult = [&] (const QString aLog) -> TResult { if (!aLog.isEmpty()) toLog(LogLevel::Error, mDeviceName + QString(": %1, aborting").arg(aLog));
mProtocol.cancel(); return CommandResult::Answer; };

if (aAnswer.isEmpty())
{
toLog(LogLevel::Error, mDeviceName + ": No task state, trying to get the result");

if (!mProtocol.getResult(mTId, aAnswer) || aAnswer.isEmpty())
{
return answerResult("No task state again");
}
}

char state = aAnswer[0];
aAnswer = aAnswer.mid(1);

if ((state == States::AsyncResult) || (state == States::AsyncError))
{
if (!aAnswer.isEmpty())
{
uchar TId = uchar(aAnswer[0]);

if (mTId != TId)
{
return answerResult(QString("Invalid task Id = %1, need %2").arg(toHexLog(TId)).arg(toHexLog(mTId)));
}

aAnswer = aAnswer.mid(1);
}
else
{
toLog(LogLevel::Error, mDeviceName + ": No task Id, trying to get the result");

if (!mProtocol.getResult(mTId, aAnswer) || aAnswer.isEmpty())
{
return answerResult("No task Id again");
}
}
}

if ((state == States::Result) || (state == States::AsyncResult))
{
mProtocol.sendACK(mTId);

return CommandResult::OK;
}
else if ((state == States::Error) || (state == States::AsyncError))
{
mProtocol.cancel();

return CommandResult::OK;
}

return answerResult(QString("Task %1 state = %2").arg(toHexLog(mTId)).arg(toHexLog(state)));
}

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

+ 32
- 0
3.0/src/modules/Hardware/FR/src/Atol/Base/Atol3/Atol3FRBase.h View File

@@ -0,0 +1,32 @@
/* @file Базовый ФР на протоколе АТОЛ3. */

#pragma once

// Modules
#include "Hardware/Protocols/FR/Atol3FR.h"

// Project
#include "../AtolFRBase.h"

//--------------------------------------------------------------------------------
class Atol3FRBase : public AtolFRBase
{
SET_SERIES("ATOL3")

Atol3FRBase();

protected:
/// Попытка самоидентификации.
virtual bool isConnected();

/// Выполнить команду.
virtual TResult performCommand(const QByteArray & aCommandData, QByteArray & aAnswer, int aTimeout);

/// Протокол.
Atol3FRProtocol mProtocol;

/// Id задачи.
uchar mTId;
};

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

+ 25
- 0
3.0/src/modules/Hardware/FR/src/Atol/Base/Atol3/Atol3FRBaseConstants.h View File

@@ -0,0 +1,25 @@
/* @file Константы и коды запросов логического уровня ФР на протоколе АТОЛ3. */

#pragma once

//--------------------------------------------------------------------------------
namespace CAtol3FR
{
/// Последний TId.
const char LastTId = '\xDF';

/// Состояния.
namespace States
{
const char Pending = '\xA1'; /// Помещено в буфер, ждем.
const char InProgress = '\xA2'; /// Исполняется.
const char Result = '\xA3'; /// Исполнено, ошибок нет.
const char Error = '\xA4'; /// Исполнено, есть ошибка.
const char Stopped = '\xA5'; /// Было в Pending, когда возникла ошибка при исполнении предшествующих заданий.
const char AsyncResult = '\xA6'; /// В асинхронном ответе - исполнено, ошибок нет.
const char AsyncError = '\xA7'; /// В асинхронном ответе - исполнено, есть ошибка.
const char Waiting = '\xA8'; /// Исполняется в фоновом режиме. ждем данные от внешнего устройства.
}
}

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

+ 54
- 31
3.0/src/modules/Hardware/FR/src/Atol/Base/AtolFRBase.cpp View File

@@ -1,4 +1,4 @@
/* @file ФР АТОЛ и Пэй Киоск. */
/* @file Базовый ФР на протоколе АТОЛ. */
// Qt
#include <Common/QtHeadersBegin.h>
@@ -33,7 +33,6 @@ AtolFRBase::AtolFRBase()
mLineFeed = false;
mMode = CAtolFR::InnerModes::NoMode;
mSubmode = CAtolFR::InnerSubmodes::NoSubmode;
mFRBuild = 0;
mLocked = false;
mNonNullableAmount = 0;
@@ -75,6 +74,14 @@ AtolFRBase::AtolFRBase()
}
//--------------------------------------------------------------------------------
void AtolFRBase::setInitialData()
{
TSerialFRBase::setInitialData();
mFRBuild = 0;
}
//--------------------------------------------------------------------------------
QDateTime AtolFRBase::getDateTime()
{
QByteArray data;
@@ -90,7 +97,7 @@ QDateTime AtolFRBase::getDateTime()
}
//--------------------------------------------------------------------------------
bool AtolFRBase::checkTaxValue(TVAT aVAT, const CFR::Taxes::SData & aData, const CAtolFR::FRParameters::TData & aFRParameterData, bool aCanCorrectTaxValue)
bool AtolFRBase::checkTaxValue(TVAT aVAT, CFR::Taxes::SData & aData, const CAtolFR::FRParameters::TData & aFRParameterData, bool aCanCorrectTaxValue)
{
QByteArray taxData;
@@ -107,6 +114,10 @@ bool AtolFRBase::checkTaxValue(TVAT aVAT, const CFR::Taxes::SData & aData, const
{
FRValue = -1;
}
else
{
aData.deviceVAT = FRValue / 100;
}
int value = int(aVAT * 100);
@@ -265,17 +276,8 @@ QByteArray AtolFRBase::getBCD(double aValue, int aSize, int aPrecision, int aMan
}
//--------------------------------------------------------------------------------
TResult AtolFRBase::performCommand(const QByteArray & aCommandData, QByteArray & aAnswer, int aTimeout)
{
return mProtocol.processCommand(aCommandData, aAnswer, aTimeout);
}
//--------------------------------------------------------------------------------
TResult AtolFRBase::execCommand(const QByteArray & aCommand, const QByteArray & aCommandData, QByteArray * aAnswer)
{
mProtocol.setPort(mIOPort);
mProtocol.setLog(mLog);
// для пересчета ошибки виртуального конца буфера Z-отчетов:
// если открываем чек, либо делаем выплату (- операции, открывающие смену) и сессия сейчас закрыта, то
// после открытия чека она будет открыта открытием чека. Тогда потом просто обновим время последнего открытия смены.
@@ -300,9 +302,12 @@ TResult AtolFRBase::execCommand(const QByteArray & aCommand, const QByteArray &
return mLastCommandResult;
}
if (answer.size() < CAtolFR::MinUnPacketAnswerSize)
CAtolFR::SCommadData commandInfo = mCommandData[aCommand];
int minAnswerSize = int(commandInfo.error) + int(commandInfo.prefix);
if (answer.size() < minAnswerSize)
{
toLog(LogLevel::Error, "AtolFR: Data in packet is less than " + QString::number(CAtolFR::MinUnPacketAnswerSize));
toLog(LogLevel::Error, "AtolFR: Data in packet is less than " + QString::number(minAnswerSize));
return CommandResult::Answer;
}
@@ -342,9 +347,14 @@ TResult AtolFRBase::execCommand(const QByteArray & aCommand, const QByteArray &
return CommandResult::Device;
}
mProcessingErrors.pop_back();
TResult result = processCommand(aCommand, aCommandData, aAnswer);
if (result)
{
mProcessingErrors.pop_back();
}
return processCommand(aCommand, aCommandData, aAnswer);
return result;
}
//--------------------------------------------------------------------------------
@@ -356,15 +366,12 @@ char AtolFRBase::getError(char aCommand, const QByteArray & aAnswer)
//--------------------------------------------------------------------------------
char AtolFRBase::getError(const QByteArray & aCommand, const QByteArray & aAnswer)
{
char result = 0;
CAtolFR::SCommadData commandData = mCommandData[aCommand];
if (mCommandData[aCommand].error)
{
int index = mCommandData[aCommand].prefix ? 1 : 0;
result = aAnswer[index];
}
if (!commandData.error) return ASCII::NUL;
else if (commandData.prefix) return aAnswer[1];
return result;
return aAnswer[0];
}
//--------------------------------------------------------------------------------
@@ -489,6 +496,22 @@ bool AtolFRBase::processAnswer(const QByteArray & aCommand, char aError)
return false;
}
//---------------------------------------------------------------------------
bool AtolFRBase::checkTaxes()
{
char mode = mMode;
if (!enterInnerMode(CAtolFR::InnerModes::Programming))
{
return false;
}
bool result = TSerialFRBase::checkTaxes();
enterInnerMode(mode);
return result;
}
//--------------------------------------------------------------------------------
bool AtolFRBase::printLine(const QByteArray & aString)
{
@@ -617,7 +640,7 @@ void AtolFRBase::execTags(Tags::SLexeme & aTagLexeme, QVariant & aLine)
//--------------------------------------------------------------------------------
bool AtolFRBase::performFiscal(const QStringList & aReceipt, const SPaymentData & aPaymentData, quint32 * /*aFDNumber*/)
{
if (!enterInnerMode(CAtolFR::InnerModes::Register) || (!openDocument(aPaymentData.back) && !mLocked))
if (!enterInnerMode(CAtolFR::InnerModes::Register) || (!openDocument(aPaymentData.payOffType) && !mLocked))
{
return false;
}
@@ -635,7 +658,7 @@ bool AtolFRBase::performFiscal(const QStringList & aReceipt, const SPaymentData
{
result = setOFDParameters() && closeDocument(aPaymentData.payType);
}
else if (aPaymentData.back && (mLastError == CAtolFR::Errors::NoMoneyForPayout))
else if (aPaymentData.back() && (mLastError == CAtolFR::Errors::NoMoneyForPayout))
{
emitStatusCode(FRStatusCode::Error::NoMoney, EFRStatus::NoMoneyForSellingBack);
}
@@ -776,13 +799,11 @@ bool AtolFRBase::performZReport(bool aPrintDeferredReports)
}
//--------------------------------------------------------------------------------
bool AtolFRBase::openDocument(bool aBack)
bool AtolFRBase::openDocument(EPayOffTypes::Enum aPayOffType)
{
char documentType = aBack ? CAtolFR::DocumentTypes::SaleBack : CAtolFR::DocumentTypes::Sale;
QByteArray commandData;
commandData.append(CAtolFR::FiscalFlags::ExecutionMode);
commandData.append(documentType);
commandData.append(CAtolFR::PayOffTypeData[aPayOffType]);
if (processCommand(CAtolFR::Commands::OpenDocument, commandData))
{
@@ -1088,6 +1109,7 @@ bool AtolFRBase::setFRParameters()
return true;
}
//--------------------------------------------------------------------------------
bool AtolFRBase::getFRParameter(const CAtolFR::FRParameters::SData & aData, QByteArray & aValue)
{
@@ -1392,15 +1414,16 @@ bool AtolFRBase::execZReport(bool aAuto)
QVariantMap outData;
QByteArray data;
char FDType = CAtolFR::PayOffTypeData[EPayOffTypes::Debit];