Browse Source

refs #1 Syncronizing with release commit: 9fc3458240

qt5
parent
commit
ca6b171305
100 changed files with 1333 additions and 538 deletions
  1. +4
    -0
      3.0/scripts/build/runtimes/terminal_common.xml
  2. +107
    -1
      3.0/src/apps/PaymentProcessor/msvc/PaymentProcessor.rc
  3. +5
    -5
      3.0/src/apps/PaymentProcessor/msvc/PaymentProcessor.vcxproj
  4. +1
    -1
      3.0/src/apps/PaymentProcessor/src/Services/GUIService.cpp
  5. +5
    -4
      3.0/src/apps/PaymentProcessor/src/Services/HIDService.cpp
  6. +1
    -1
      3.0/src/apps/PaymentProcessor/src/Services/PluginService.cpp
  7. +24
    -9
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp
  8. +2
    -2
      3.0/src/apps/PaymentProcessor/src/Services/SchedulerService.cpp
  9. +1
    -1
      3.0/src/apps/PaymentProcessor/src/Services/SettingsService.cpp
  10. +2
    -0
      3.0/src/apps/PaymentProcessor/src/System/PPApplication.cpp
  11. +8
    -3
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_de.ts
  12. +8
    -3
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_en.ts
  13. +8
    -3
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_kk.ts
  14. +8
    -3
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_ru.ts
  15. +1
    -1
      3.0/src/apps/PaymentProcessor/src/main.cpp
  16. +1
    -0
      3.0/src/apps/Updater/Updater.qbs
  17. +5
    -5
      3.0/src/apps/Updater/msvc/Updater.vcxproj
  18. +186
    -38
      3.0/src/apps/Updater/src/UpdaterApp.cpp
  19. +12
    -2
      3.0/src/apps/Updater/src/UpdaterApp.h
  20. +24
    -13
      3.0/src/apps/Updater/src/locale/updater_en.ts
  21. +24
    -13
      3.0/src/apps/Updater/src/locale/updater_kk.ts
  22. +24
    -13
      3.0/src/apps/Updater/src/locale/updater_ru.ts
  23. +1
    -1
      3.0/src/apps/Updater/src/main.cpp
  24. +59
    -0
      3.0/src/apps/WatchService/msvc/Resources.rc
  25. +8
    -8
      3.0/src/apps/WatchService/msvc/WatchService.vcxproj
  26. +59
    -0
      3.0/src/apps/WatchServiceController/msvc/Resources.rc
  27. +5
    -5
      3.0/src/apps/WatchServiceController/msvc/WatchServiceController.vcxproj
  28. +38
    -0
      3.0/src/includes/Hardware/Common/DataPointer.h
  29. +79
    -0
      3.0/src/includes/Hardware/Common/DeviceDataConstants.h
  30. +10
    -1
      3.0/src/includes/Hardware/Common/HardwareConstants.h
  31. +3
    -1
      3.0/src/includes/Hardware/Common/Specifications.h
  32. +4
    -4
      3.0/src/includes/Hardware/Common/USBDeviceModelData.h
  33. +79
    -0
      3.0/src/includes/Hardware/IOPorts/LibUSBDeviceDataTypes.h
  34. +3
    -0
      3.0/src/includes/Hardware/IOPorts/LibUSBPort.h
  35. +1
    -0
      3.0/src/includes/Hardware/IOPorts/LibUSBUtils.h
  36. +3
    -0
      3.0/src/includes/Hardware/IOPorts/USBPort.h
  37. +0
    -3
      3.0/src/includes/Hardware/IOPorts/USBSerialPort.h
  38. +1
    -0
      3.0/src/includes/SDK/Drivers/HardwareConstants.h
  39. +6
    -6
      3.0/src/includes/SDK/Drivers/IIOPort.h
  40. +1
    -0
      3.0/src/includes/SDK/Drivers/InteractionTypes.h
  41. +7
    -1
      3.0/src/interface/modern/addinfo_scene.qml
  42. +31
    -8
      3.0/src/interface/modern/info_content/terminal_info.qml
  43. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_de.ts
  44. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_en.ts
  45. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_kk.ts
  46. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_ru.ts
  47. +2
    -2
      3.0/src/interface/modern/locale/edit_amount_scene_de.ts
  48. +2
    -2
      3.0/src/interface/modern/locale/edit_amount_scene_en.ts
  49. +2
    -2
      3.0/src/interface/modern/locale/edit_amount_scene_kk.ts
  50. +2
    -2
      3.0/src/interface/modern/locale/edit_amount_scene_ru.ts
  51. +7
    -7
      3.0/src/interface/modern/locale/main_menu_scene_de.ts
  52. +7
    -7
      3.0/src/interface/modern/locale/main_menu_scene_en.ts
  53. +7
    -7
      3.0/src/interface/modern/locale/main_menu_scene_ru.ts
  54. +7
    -7
      3.0/src/interface/modern/locale/payment_scenario_de.ts
  55. +7
    -7
      3.0/src/interface/modern/locale/payment_scenario_en.ts
  56. +7
    -7
      3.0/src/interface/modern/locale/payment_scenario_kk.ts
  57. +7
    -7
      3.0/src/interface/modern/locale/payment_scenario_ru.ts
  58. +38
    -33
      3.0/src/interface/modern/locale/result_scene_de.ts
  59. +38
    -33
      3.0/src/interface/modern/locale/result_scene_en.ts
  60. +37
    -32
      3.0/src/interface/modern/locale/result_scene_kk.ts
  61. +37
    -32
      3.0/src/interface/modern/locale/result_scene_ru.ts
  62. +3
    -3
      3.0/src/interface/modern/locale/send_receipt_scene_kk.ts
  63. +14
    -14
      3.0/src/interface/modern/locale/terminal_info_de.ts
  64. +14
    -14
      3.0/src/interface/modern/locale/terminal_info_en.ts
  65. +14
    -14
      3.0/src/interface/modern/locale/terminal_info_kk.ts
  66. +14
    -14
      3.0/src/interface/modern/locale/terminal_info_ru.ts
  67. +1
    -1
      3.0/src/interface/modern/locale/topup_platru_scene_ru.ts
  68. +5
    -3
      3.0/src/interface/modern/platru_menu_scene.qml
  69. +26
    -7
      3.0/src/interface/modern/result_scene.qml
  70. +2
    -1
      3.0/src/interface/modern/scenario/constants.js
  71. +4
    -0
      3.0/src/interface/modern/scenario/menu_scenario.js
  72. +65
    -27
      3.0/src/interface/modern/scenario/payment_scenario.js
  73. +1
    -1
      3.0/src/interface/modern/scripts/gui.js
  74. +0
    -1
      3.0/src/interface/modern/search_scene.qml
  75. +2
    -2
      3.0/src/interface/plugins/FlashPlayerItem/msvc/FlashPlayerItemPlugin.vcxproj
  76. +5
    -5
      3.0/src/interface/plugins/Utils/msvc/Utils.vcxproj
  77. +4
    -4
      3.0/src/modules/AdBackend/msvc/AdBackend.vcxproj
  78. +4
    -4
      3.0/src/modules/Common/Application/msvc/Application.vcxproj
  79. +5
    -5
      3.0/src/modules/Common/Application/src/BasicApplication.cpp
  80. +4
    -4
      3.0/src/modules/Common/Log/QFile based/msvc/Log.vcxproj
  81. +3
    -3
      3.0/src/modules/Common/Log/QFile based/src/SimpleLog.cpp
  82. +4
    -4
      3.0/src/modules/Connection/Win32/Connection.vcxproj
  83. +4
    -4
      3.0/src/modules/CryptEngine/msvc/CryptEngine.vcxproj
  84. +4
    -4
      3.0/src/modules/DatabaseProxy/msvc/DatabaseProxy.vcxproj
  85. +4
    -4
      3.0/src/modules/DebugUtils/msvc/DebugUtils.vcxproj
  86. +4
    -4
      3.0/src/modules/DeviceManager/msvc/DeviceManager.vcxproj
  87. +5
    -5
      3.0/src/modules/GraphicsEngine/msvc/GraphicsEngine.vcxproj
  88. +5
    -5
      3.0/src/modules/GraphicsEngine/src/GraphicsEngine.cpp
  89. +0
    -2
      3.0/src/modules/GraphicsEngine/src/GraphicsEngine.h
  90. +4
    -4
      3.0/src/modules/Hardware/Cardreaders/Protocols/Creator/msvc/Creator.vcxproj
  91. +4
    -4
      3.0/src/modules/Hardware/Cardreaders/msvc/CardReaders.vcxproj
  92. +5
    -5
      3.0/src/modules/Hardware/CashAcceptors/msvc/CashAcceptors.vcxproj
  93. +1
    -0
      3.0/src/modules/Hardware/CashAcceptors/src/ID003/ID003CashAcceptor.cpp
  94. +6
    -0
      3.0/src/modules/Hardware/CashAcceptors/src/V2e/V2eCashAcceptor.cpp
  95. +4
    -4
      3.0/src/modules/Hardware/CashDispensers/msvc/CashDispensers.vcxproj
  96. +4
    -4
      3.0/src/modules/Hardware/CoinAcceptors/msvc/CoinAcceptors.vcxproj
  97. +6
    -4
      3.0/src/modules/Hardware/Common/msvc/Common.vcxproj
  98. +9
    -0
      3.0/src/modules/Hardware/Common/msvc/Common.vcxproj.filters
  99. +0
    -1
      3.0/src/modules/Hardware/Common/src/Base/DeviceBase.cpp
  100. +0
    -3
      3.0/src/modules/Hardware/Common/src/Base/DeviceBase.h

+ 4
- 0
3.0/scripts/build/runtimes/terminal_common.xml View File

@@ -13,4 +13,8 @@
<!-- Интерфейс modern, компонент interface_plugins -->
<file source="{QBS_RESULT_PATH}/plugins/interface/utils.dll" target="interface_plugins/interface/modern/plugins/utils.dll"/>
<!-- Выключение BITS -->
<option target="data/updater.ini" key="bits/ignore" value="true" />
</runtime>

+ 107
- 1
3.0/src/apps/PaymentProcessor/msvc/PaymentProcessor.rc View File

@@ -1,5 +1,23 @@
// Microsoft Visual C++ generated resource script.
//
#include "Resource.h"
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// Neutral resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1251)

/////////////////////////////////////////////////////////////////////////////
//
@@ -9,5 +27,93 @@
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "..\\src\\icons\\PaymentProcessor.ico"
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// Russian (Russia) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,0,0
PRODUCTVERSION 3,0,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "041904b0"
BEGIN
VALUE "CompanyName", "CyberPlat"
VALUE "FileDescription", "PaymentP Application"
VALUE "FileVersion", "3.0.0.0"
VALUE "InternalName", "PaymentProcessor"
VALUE "LegalCopyright", "CyberPlat ©"
VALUE "OriginalFilename", "PaymentProcessor.exe"
VALUE "ProductName", "Terminal client"
VALUE "ProductVersion", "3.0.0.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x419, 1200
END
END

#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED


+ 5
- 5
3.0/src/apps/PaymentProcessor/msvc/PaymentProcessor.vcxproj View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -22,15 +22,15 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">


+ 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::IntruderLogName, message));
ILog::getInstance(CGUIService::IntruderLogName)->write(LogLevel::Warning, message);
#endif
}


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

@@ -83,10 +83,6 @@ void HIDService::updateHardwareConfiguration()

// Подписываемся на сигнал от устройства.
device->subscribe(SDK::Driver::IHID::DataSignal, this, SIGNAL(data(const QVariantMap &)));

// Включаем устройство на чтение
device->enable(true);

toLog(LogLevel::Normal, QString("Device '%1' added...").arg(device->getName()));
}
else
@@ -222,6 +218,11 @@ bool HIDService::setEnable(bool aEnable, const QString & aDevice)
}
}

toLog(LogLevel::Debug, QString("Update HID device state: name [%1], state [%2], result: [%3]")
.arg(aDevice)
.arg(aEnable ? "ENABLE" : "DISABLE")
.arg(result ? "OK" : "ERROR"));

return result;
}



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

@@ -1,4 +1,4 @@
/* @file Реализация менеджера плагинов. */
/* @file Реализация менеджера плагинов. */

// Qt
#include <Common/QtHeadersBegin.h>


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

@@ -95,18 +95,33 @@ DSDK::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap & aParam
}
}
if (!qFuzzyIsNull(fee))
bool combineFeeWithZeroVAT = aParameters.value("COMBINE_FEE_WITH_ZERO_VAT", false).toBool();
QString feeName = combineFeeWithZeroVAT ? tr("#dealer_bpa_fee") : tr("#dealer_fee");
if (dealerVAT == 0 && combineFeeWithZeroVAT)
{
QString dealerINN = aParameters.value(CPrintConstants::DealerInn).toString();
unitDataList << (dealerIsBank ?
DSDK::SUnitData(fee, dealerVAT, tr("#bank_fee"), dealerINN, DSDK::EPayOffSubjectTypes::Payment) :
DSDK::SUnitData(fee, dealerVAT, tr("#dealer_fee"), dealerINN, DSDK::EPayOffSubjectTypes::AgentFee));
fee = aParameters.value("FEE").toDouble();
if (!qFuzzyIsNull(fee))
{
QString dealerINN = aParameters.value(CPrintConstants::DealerInn).toString();
unitDataList << DSDK::SUnitData(fee, dealerVAT, feeName, dealerINN, DSDK::EPayOffSubjectTypes::AgentFee);
}
}
if (!qFuzzyIsNull(processingFee))
else
{
QString bankINN = aParameters.value(CPrintConstants::BankInn).toString();
unitDataList << DSDK::SUnitData(processingFee, 0, tr("#processing_fee"), bankINN, DSDK::EPayOffSubjectTypes::Payment);
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));
}
if (!qFuzzyIsNull(processingFee))
{
QString bankINN = aParameters.value(CPrintConstants::BankInn).toString();
unitDataList << DSDK::SUnitData(processingFee, 0, tr("#processing_fee"), bankINN, DSDK::EPayOffSubjectTypes::Payment);
}
}
bool EMoney = aParameters.value(PPSDK::CPayment::Parameters::PayTool).toInt() > 0;


+ 2
- 2
3.0/src/apps/PaymentProcessor/src/Services/SchedulerService.cpp View File

@@ -100,8 +100,8 @@ SchedulerService::~SchedulerService()
//---------------------------------------------------------------------------
bool SchedulerService::initialize()
{
QSettings settings(IApplication::toAbsolutePath(IApplication::getWorkingDirectory() + CScheduler::ConfigName), QSettings::IniFormat);
QSettings userSettings(IApplication::toAbsolutePath(IApplication::getWorkingDirectory() + CScheduler::UserConfigName), QSettings::IniFormat);
QSettings settings(ISysUtils::rmBOM(IApplication::toAbsolutePath(IApplication::getWorkingDirectory() + CScheduler::ConfigName)), QSettings::IniFormat);
QSettings userSettings(ISysUtils::rmBOM(IApplication::toAbsolutePath(IApplication::getWorkingDirectory() + CScheduler::UserConfigName)), QSettings::IniFormat);
foreach (QString taskName, settings.childGroups())
{


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

@@ -1,4 +1,4 @@
/* @file Сервис для работы с настройками. */
/* @file Сервис для работы с настройками. */

// Qt
#include <Common/QtHeadersBegin.h>


+ 2
- 0
3.0/src/apps/PaymentProcessor/src/System/PPApplication.cpp View File

@@ -51,6 +51,8 @@ PPApplication::PPApplication(
: BasicQtApplication<SafeQApplication>(aName, aVersion, aArgumentCount, aArguments),
mProtection("PaymentProcessorProtection")
{
CatchUnhandledExceptions();

// Производим проверку на наличие еще одной запущенной копии приложения.
mProtection.attach();



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

@@ -20,17 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="102"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="103"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="109"/>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


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

@@ -20,17 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="102"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="103"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="109"/>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


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

@@ -20,17 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="102"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="103"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="109"/>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


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

@@ -20,17 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="102"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_bpa_fee</source>
<translation>Комиссия БПА</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<source>#bank_fee</source>
<translation>Комиссия БПА</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="103"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_fee</source>
<translation>Комиссия субагента</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="109"/>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<source>#processing_fee</source>
<translation>Комиссия КБ Платина</translation>
</message>


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

@@ -1,4 +1,4 @@
/* @file Mainline. */
/* @file Mainline. */

#ifdef Q_OS_WIN
#define NOMINMAX


+ 1
- 0
3.0/src/apps/Updater/Updater.qbs View File

@@ -16,6 +16,7 @@ Project {
Depends { name: "UpdateEngine" }
Depends { name: "Packer" }
Depends { name: "qBreakpad" }
Depends { name: "TaskScheduler" }

Depends { name: "UpdaterTranslations" }



+ 5
- 5
3.0/src/apps/Updater/msvc/Updater.vcxproj View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -133,15 +133,15 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">


+ 186
- 38
3.0/src/apps/Updater/src/UpdaterApp.cpp View File

@@ -19,6 +19,7 @@
#include <Common/Version.h>
#include <SysUtils/ISysUtils.h>
#include <WatchServiceClient/Constants.h>
#include <PhishMeWrapper.h>

// Project
#include "UpdaterApp.h"
@@ -42,6 +43,7 @@ namespace Opt
const char NoRestart[] = "no-restart";
const char DestinationSubdirs[] = "destination-subdir";
const char AcceptKeys[] = "accept-keys";
const char WithoutBITS[] = "no-bits";
}

namespace Command
@@ -50,6 +52,7 @@ namespace Command
const char UserPack[] = "userpack";
const char Update[] = "update";
const char Integrity[] = "integrity";
const char Bits[] = "bits";
}

//---------------------------------------------------------------------------
@@ -73,13 +76,14 @@ UpdaterApp::~UpdaterApp()
SDK::PaymentProcessor::IRemoteService::EStatus status;

// Обновляем отчет.
switch (mResultCode)
switch (mResultCode_)
{
case CUpdaterApp::ExitCode::NoError:
status = SDK::PaymentProcessor::IRemoteService::OK;
break;

case CUpdaterApp::ExitCode::ContunueExecution:
case CUpdaterApp::ExitCode::WorkInProgress:
status = SDK::PaymentProcessor::IRemoteService::Executing;
break;

@@ -87,24 +91,7 @@ UpdaterApp::~UpdaterApp()
status = SDK::PaymentProcessor::IRemoteService::Error;
}

QMap<int, QString> descriptions;

descriptions.insert(CUpdaterApp::ExitCode::ErrorRunFromTempDir, tr("#error_run_from_temp_dir"));
descriptions.insert(CUpdaterApp::ExitCode::NoWatchService, tr("#error_connection_to_guard"));
descriptions.insert(CUpdaterApp::ExitCode::UnknownCommand, tr("#error_unknown_command"));
descriptions.insert(CUpdaterApp::ExitCode::SecondInstance, tr("#error_second_instance"));
descriptions.insert(CUpdaterApp::ExitCode::UnknownError, tr("#error_unknown"));
descriptions.insert(CUpdaterApp::ExitCode::NetworkError, tr("#error_network"));
descriptions.insert(CUpdaterApp::ExitCode::ParseError, tr("#error_parse_response"));
descriptions.insert(CUpdaterApp::ExitCode::DeployError, tr("#error_deploy"));
descriptions.insert(CUpdaterApp::ExitCode::Aborted, tr("#error_aborted"));
descriptions.insert(CUpdaterApp::ExitCode::Blocked, tr("#error_update_blocked"));
descriptions.insert(CUpdaterApp::ExitCode::FailIntegrity, tr("#error_check_integrity"));

if (descriptions.contains(mResultCode))
{
mReportBuilder.setStatusDescription(descriptions.value(mResultCode));
}
mReportBuilder.setStatusDescription(mResultDescription);
mReportBuilder.setStatus(status);
}

@@ -126,7 +113,7 @@ void UpdaterApp::onCloseCommandReceived()
{
getLog()->write(LogLevel::Normal, "Receive close signal from watch service. Update aborted.");

mResultCode = CUpdaterApp::ExitCode::Aborted;
setResultCode(CUpdaterApp::ExitCode::Aborted);

errorExit();
}
@@ -220,6 +207,10 @@ void UpdaterApp::run()
bool woRestart = getArgument(Opt::NoRestart).compare("true", Qt::CaseInsensitive) == 0;
// подпапка, в которую распаковываем архив
QString subdir = getArgument(Opt::DestinationSubdirs);
bool woBITS = getArgument(Opt::WithoutBITS).compare("true", Qt::CaseInsensitive) == 0;

// Отключение BITS через updater.ini
woBITS = settings.value("bits/ignore", woBITS).toBool();

// Создаем файл с отчетом.
mReportBuilder.open(cmndId, server, md5);
@@ -227,10 +218,28 @@ void UpdaterApp::run()

// Проверка на запуск второй копии программы.
QtLocalPeer * peer = new QtLocalPeer(this, getName());

if (command == Command::Bits)
{
mUpdater = new Updater(this);
mUpdater->setWorkingDir(workingDir);
CUpdaterApp::ExitCode::Enum result = bitsCheckStatus(peer->isClient());
if (result == CUpdaterApp::ExitCode::ContunueExecution)
{
setResultCode(CUpdaterApp::ExitCode::NoError, tr("Update in progress"));
}
else
{
setResultCode(result);
}
return;
}

// Проверка на запуск второй копии программы.
if (peer->isClient())
{
getLog()->write(LogLevel::Warning, "Another instance is already running.");
mResultCode = CUpdaterApp::ExitCode::SecondInstance;
setResultCode(CUpdaterApp::ExitCode::SecondInstance);
return;
}

@@ -238,8 +247,10 @@ void UpdaterApp::run()
if (!mWatchServiceClient->start())
{
getLog()->write(LogLevel::Error, "Cannot connect to watch service.");
mResultCode = CUpdaterApp::ExitCode::NoWatchService;
setResultCode(CUpdaterApp::ExitCode::NoWatchService);
#ifndef _DEBUG
return;
#endif
}

QTimer * tooLongDownloadTimer = new QTimer(this);
@@ -251,6 +262,7 @@ void UpdaterApp::run()
mUpdater->setParent(this);
mUpdater->setProxy(proxy);
mUpdater->setAcceptedKeys(acceptKeys);
mUpdater->useBITS(!woBITS, settings.value("bits/priority", CBITS::HIGH).toInt());
connect(mUpdater, SIGNAL(progress(int)), &mReportBuilder, SLOT(setProgress(int)));

// Создаем файл отчета.
@@ -284,13 +296,13 @@ void UpdaterApp::run()
if (reRunFromTempDirectory())
{
getLog()->write(LogLevel::Normal, QString("Run updater from temp path: '%1' is OK.").arg(getUpdaterTempDir()));
mResultCode = CUpdaterApp::ExitCode::ContunueExecution;
setResultCode(CUpdaterApp::ExitCode::ContunueExecution);
return;
}
else
{
getLog()->write(LogLevel::Error, QString("Failed run updater from temp path: '%1'.").arg(getUpdaterTempDir()));
mResultCode = CUpdaterApp::ExitCode::ErrorRunFromTempDir;
setResultCode(CUpdaterApp::ExitCode::ErrorRunFromTempDir);
return;
}
}
@@ -331,16 +343,16 @@ void UpdaterApp::run()
if (result < 0)
{
mResultCode = CUpdaterApp::ExitCode::UnknownCommand;
setResultCode(CUpdaterApp::ExitCode::UnknownCommand);
}
else if (result > 0)
{
mResultCode = CUpdaterApp::ExitCode::FailIntegrity;
setResultCode(CUpdaterApp::ExitCode::FailIntegrity);
mReportBuilder.setStatusDescription(tr("#error_check_integrity").arg(result));
}
else
{
mResultCode = CUpdaterApp::ExitCode::NoError;
setResultCode(CUpdaterApp::ExitCode::NoError);
}

return;
@@ -348,11 +360,93 @@ void UpdaterApp::run()
else
{
getLog()->write(LogLevel::Error, QString("Unknown command: %1.").arg(command));
mResultCode = CUpdaterApp::ExitCode::UnknownCommand;
setResultCode(CUpdaterApp::ExitCode::UnknownCommand);
return;
}

mResultCode = exec();
int result = exec();
if (result != mResultCode_)
{
setResultCode(static_cast<CUpdaterApp::ExitCode::Enum>(result));
}
}

//---------------------------------------------------------------------------
CUpdaterApp::ExitCode::Enum UpdaterApp::bitsCheckStatus(bool aAlreadyRunning)
{
getLog()->write(LogLevel::Normal, QString("Check bits status '%1'...").arg(qApp->applicationFilePath()));

QStringList parameters;

if (!mUpdater->bitsLoadState(&parameters))
{
getLog()->write(LogLevel::Error, QString("Failed load bits.ini."));
return CUpdaterApp::ExitCode::ParseError;
}

if (mUpdater->bitsIsComplete())
{
getLog()->write(LogLevel::Normal, QString("BITS jobs are complete. Restart for deploy."));

if (!aAlreadyRunning)
{
int stub = 0;
mUpdater->bitsCompleteAllJobs(stub, stub, stub);

// Restart for deploy
if (!QProcess::startDetached(qApp->applicationFilePath(), parameters))
{
getLog()->write(LogLevel::Fatal, QString("Couldn't start updater from '%1'.").arg(qApp->applicationFilePath()));
return CUpdaterApp::ExitCode::UnknownError;
}
}
else
{
QString commanLine = QDir::toNativeSeparators(qApp->applicationFilePath());
QString arguments = QString("--command bits --workdir %1").arg(mUpdater->getWorkingDir());
QString workDir = QDir::toNativeSeparators(mUpdater->getWorkingDir());

try
{
// Shedule restart myself
PhishMe::AddScheduledTask(L"TC_Updater",
commanLine.toStdWString(),
arguments.toStdWString(),
workDir.toStdWString(),
CUpdaterApp::BITSCompleteTimeout);

getLog()->write(LogLevel::Normal, QString("Do create updater restart scheduler task OK. Timeout: %1 min.").arg(CUpdaterApp::BITSCompleteTimeout / 60));
}
catch (std::exception & ex)
{
// Something seriously went wrong inside ScheduleTask
getLog()->write(LogLevel::Fatal, QString("Didn't create updater restart scheduler task '%1'. Reason: %2.")
.arg(commanLine).arg(QString::fromLocal8Bit(ex.what())));

return CUpdaterApp::ExitCode::UnknownError;
}
}

return CUpdaterApp::ExitCode::NoError;
}

if (mUpdater->bitsIsError())
{
getLog()->write(LogLevel::Error, QString("BITS jobs are failed. Restart for download w/o bits."));

// Restart for download w/o bits
parameters << "--no-bits" << "true";

if (!QProcess::startDetached(qApp->applicationFilePath(), parameters))
{
getLog()->write(LogLevel::Fatal, QString("Couldn't start updater from '%1'.").arg(qApp->applicationFilePath()));
}

return CUpdaterApp::ExitCode::NetworkError;
}
getLog()->write(LogLevel::Normal, QString("BITS contunue execution."));
return CUpdaterApp::ExitCode::ContunueExecution;
}

//---------------------------------------------------------------------------
@@ -491,13 +585,18 @@ void UpdaterApp::onUpdateComplete(CUpdaterErrors::Enum aError)
//---------------------------------------------------------------------------
void UpdaterApp::errorExit()
{
getQtApplication().exit(mResultCode ? mResultCode : CUpdaterApp::ExitCode::UnknownError);
if (!mResultCode_)
{
mResultCode_ = CUpdaterApp::ExitCode::UnknownError;
}

getQtApplication().exit(mResultCode_);
}

//---------------------------------------------------------------------------
int UpdaterApp::getResultCode() const
{
return mResultCode;
return mResultCode_;
}

//---------------------------------------------------------------------------
@@ -529,7 +628,7 @@ void UpdaterApp::delayedExit(int aTimeout, CUpdaterErrors::Enum aError)
getLog()->write(aError ? LogLevel::Error : LogLevel::Normal, QString("Closing after %1 seconds.").arg(aTimeout));

if (aError)
if (mResultCode_)
{
QTimer::singleShot(aTimeout * 1000, this, SLOT(errorExit()));
}
@@ -697,33 +796,82 @@ bool UpdaterApp::cleanDir(const QString & dirName)
}

//---------------------------------------------------------------------------
void UpdaterApp::setResultCode(CUpdaterErrors::Enum aError)
void UpdaterApp::setResultCode(CUpdaterErrors::Enum aError, const QString aMessage /*= QString()*/)
{
mResultDescription = aMessage;

switch (aError)
{
case CUpdaterErrors::OK:
setResultCode(CUpdaterApp::ExitCode::NoError, aMessage);
break;

case CUpdaterErrors::UnknownError:
mResultCode = CUpdaterApp::ExitCode::UnknownError;
setResultCode(CUpdaterApp::ExitCode::UnknownError, aMessage);
break;

case CUpdaterErrors::NetworkError:
mResultCode = CUpdaterApp::ExitCode::NetworkError;
setResultCode(CUpdaterApp::ExitCode::NetworkError, aMessage);
break;

case CUpdaterErrors::ParseError:
mResultCode = CUpdaterApp::ExitCode::ParseError;
setResultCode(CUpdaterApp::ExitCode::ParseError, aMessage);
break;

case CUpdaterErrors::DeployError:
mResultCode = CUpdaterApp::ExitCode::DeployError;
setResultCode(CUpdaterApp::ExitCode::DeployError, aMessage);
break;

case CUpdaterErrors::UpdateBlocked:
mResultCode = CUpdaterApp::ExitCode::Blocked;
setResultCode(CUpdaterApp::ExitCode::Blocked, aMessage);
break;

case CUpdaterErrors::BitsInProgress:
setResultCode(CUpdaterApp::ExitCode::NoError, tr("Update in progress"));
break;

default:

break;
}
updateErrorDescription();
}

//---------------------------------------------------------------------------
void UpdaterApp::setResultCode(CUpdaterApp::ExitCode::Enum aExitCode, const QString aMessage /*= QString()*/)
{
mResultCode_ = aExitCode;
mResultDescription = aMessage;

updateErrorDescription();
}

//---------------------------------------------------------------------------
void UpdaterApp::updateErrorDescription()
{
static QMap<int, QString> descriptions;

if (descriptions.isEmpty())
{
descriptions.insert(CUpdaterApp::ExitCode::ErrorRunFromTempDir, tr("#error_run_from_temp_dir"));
descriptions.insert(CUpdaterApp::ExitCode::NoWatchService, tr("#error_connection_to_guard"));
descriptions.insert(CUpdaterApp::ExitCode::UnknownCommand, tr("#error_unknown_command"));
descriptions.insert(CUpdaterApp::ExitCode::SecondInstance, tr("#error_second_instance"));
descriptions.insert(CUpdaterApp::ExitCode::UnknownError, tr("#error_unknown"));
descriptions.insert(CUpdaterApp::ExitCode::NetworkError, tr("#error_network"));
descriptions.insert(CUpdaterApp::ExitCode::ParseError, tr("#error_parse_response"));
descriptions.insert(CUpdaterApp::ExitCode::DeployError, tr("#error_deploy"));
descriptions.insert(CUpdaterApp::ExitCode::Aborted, tr("#error_aborted"));
descriptions.insert(CUpdaterApp::ExitCode::Blocked, tr("#error_update_blocked"));
descriptions.insert(CUpdaterApp::ExitCode::FailIntegrity, tr("#error_check_integrity"));
descriptions.insert(CUpdaterApp::ExitCode::WorkInProgress, tr("#work_in_progress"));
}

if (mResultDescription.isEmpty() && descriptions.contains(mResultCode_))
{
mResultDescription = descriptions.value(mResultCode_);
}
}

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

+ 12
- 2
3.0/src/apps/Updater/src/UpdaterApp.h View File

@@ -26,6 +26,9 @@ namespace CUpdaterApp
/// Глобальный таймаут скачивания обновлений
const int MaxDownloadTime = 4 * 60 * 60 * 1000; // 4 часа

/// Таймаут попыток повторнго запуска по финишу BITS
const long BITSCompleteTimeout = 15 * 60; // 15 минут

typedef enum
{
Download, // закачиваем обновления
@@ -49,6 +52,7 @@ namespace CUpdaterApp
Aborted, /// Команда прервана снаружи
Blocked, /// Обновление заблокировано на стороне сервера
FailIntegrity, /// Проверка целостности закончилась неуспехом
WorkInProgress, /// Фоновая обработка задания
ContunueExecution = 54321 /// Перезапуск из временной папки
};
}
@@ -65,6 +69,8 @@ public:

void run();

CUpdaterApp::ExitCode::Enum bitsCheckStatus(bool aAlreadyRunning);

int getResultCode() const;

/// Возвращает рабочий каталог приложения (может быть задан в .ini файле).
@@ -115,10 +121,12 @@ private:

SplashScreen mSplashScreen;
ReportBuilder mReportBuilder;
int mResultCode;
CUpdaterApp::State mState;
QPointer<QTimer> mErrorStopTimer;

int mResultCode_;
QString mResultDescription;

private:
/// Получить значение параметра командной строки
QString getArgument(const char * aName, const QString & aDafaultValue = QString()) const;
@@ -139,7 +147,9 @@ private:
void delayedExit(int aTimeout, CUpdaterErrors::Enum aError);

/// Выставить код возврата updater
void setResultCode(CUpdaterErrors::Enum aError);
void setResultCode(CUpdaterErrors::Enum aResult, const QString aMessage = QString());
void setResultCode(CUpdaterApp::ExitCode::Enum aExitCode, const QString aMessage = QString());
void updateErrorDescription();

private:
/// Скопировать файлы


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

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<TS version="2.0" language="en_US">
<context>
<name>SplashScreenClass</name>
<message>
@@ -17,58 +17,69 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="92"/>
<location filename="../UpdaterApp.cpp" line="228"/>
<location filename="../UpdaterApp.cpp" line="818"/>
<source>Update in progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="845"/>
<source>#error_run_from_temp_dir</source>
<translation>Failed to run updater from a temp path</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="93"/>
<location filename="../UpdaterApp.cpp" line="846"/>
<source>#error_connection_to_guard</source>
<translation>Failed to connect to guard.exe</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="94"/>
<location filename="../UpdaterApp.cpp" line="847"/>
<source>#error_unknown_command</source>
<translation>Unknown command</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="95"/>
<location filename="../UpdaterApp.cpp" line="848"/>
<source>#error_second_instance</source>
<translation>Deny second updater instance</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="849"/>
<source>#error_unknown</source>
<translation>Unknown error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="850"/>
<source>#error_network</source>
<translation>Network error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="851"/>
<source>#error_parse_response</source>
<translation>Update server parse response error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="852"/>
<source>#error_deploy</source>
<translation>Error while copying files</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="853"/>
<source>#error_aborted</source>
<translation>External abort</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="854"/>
<source>#error_update_blocked</source>
<translation>Update is blocked</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="102"/>
<location filename="../UpdaterApp.cpp" line="339"/>
<location filename="../UpdaterApp.cpp" line="856"/>
<source>#work_in_progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="350"/>
<location filename="../UpdaterApp.cpp" line="855"/>
<source>#error_check_integrity</source>
<translation>The integrity of the distribution is broken. Number of differences:%1. Run software update</translation>
</message>


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

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="kk_KZ">
<TS version="2.0" language="kk_KZ">
<context>
<name>SplashScreenClass</name>
<message>
@@ -17,58 +17,69 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="92"/>
<location filename="../UpdaterApp.cpp" line="228"/>
<location filename="../UpdaterApp.cpp" line="818"/>
<source>Update in progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="845"/>
<source>#error_run_from_temp_dir</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="93"/>
<location filename="../UpdaterApp.cpp" line="846"/>
<source>#error_connection_to_guard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="94"/>
<location filename="../UpdaterApp.cpp" line="847"/>
<source>#error_unknown_command</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="95"/>
<location filename="../UpdaterApp.cpp" line="848"/>
<source>#error_second_instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="849"/>
<source>#error_unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="850"/>
<source>#error_network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="851"/>
<source>#error_parse_response</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="852"/>
<source>#error_deploy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="853"/>
<source>#error_aborted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="854"/>
<source>#error_update_blocked</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="102"/>
<location filename="../UpdaterApp.cpp" line="339"/>
<location filename="../UpdaterApp.cpp" line="856"/>
<source>#work_in_progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="350"/>
<location filename="../UpdaterApp.cpp" line="855"/>
<source>#error_check_integrity</source>
<translation type="unfinished"></translation>
</message>


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

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
<TS version="2.0" language="ru_RU">
<context>
<name>SplashScreenClass</name>
<message>
@@ -17,58 +17,69 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="92"/>
<location filename="../UpdaterApp.cpp" line="228"/>
<location filename="../UpdaterApp.cpp" line="818"/>
<source>Update in progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="845"/>
<source>#error_run_from_temp_dir</source>
<translation>Ошибка запуска updater из временной папки</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="93"/>
<location filename="../UpdaterApp.cpp" line="846"/>
<source>#error_connection_to_guard</source>
<translation>Ошибка соединения с guard.exe</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="94"/>
<location filename="../UpdaterApp.cpp" line="847"/>
<source>#error_unknown_command</source>
<translation>Неизвестная команда</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="95"/>
<location filename="../UpdaterApp.cpp" line="848"/>
<source>#error_second_instance</source>
<translation>Запуск второй копии updater</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="849"/>
<source>#error_unknown</source>
<translation>Неизвестная ошибка</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="850"/>
<source>#error_network</source>
<translation>Сетевая ошибка</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="851"/>
<source>#error_parse_response</source>
<translation>Ошибка обработки ответа сервера обновления</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="852"/>
<source>#error_deploy</source>
<translation>Ошибка копирования файлов</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="853"/>
<source>#error_aborted</source>
<translation>Прерван внешним процессом</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="854"/>
<source>#error_update_blocked</source>
<translation>Обновление заблокировано</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="102"/>
<location filename="../UpdaterApp.cpp" line="339"/>
<location filename="../UpdaterApp.cpp" line="856"/>
<source>#work_in_progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="350"/>
<location filename="../UpdaterApp.cpp" line="855"/>
<source>#error_check_integrity</source>
<translation>Целостность дистрибутива нарушена. Кол-во отличий: %1. Выполните команду обновления ПО</translation>
</message>


+ 1
- 1
3.0/src/apps/Updater/src/main.cpp View File

@@ -22,7 +22,7 @@ int main(int aArgc, char * aArgv[])
app.run();
app.getLog()->write(LogLevel::Normal, QString("Exit. resultCode = %1").arg(app.getResultCode()));
app.getLog()->write(LogLevel::Normal, QString("Exit with resultCode = %1").arg(app.getResultCode()));
return app.getResultCode();
}


+ 59
- 0
3.0/src/apps/WatchService/msvc/Resources.rc View File

@@ -2,6 +2,51 @@
//
#include "Resources.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// Russian resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"Resources.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
@@ -10,4 +55,18 @@
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "..\\src\\icons\\main.ico"
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED


+ 8
- 8
3.0/src/apps/WatchService/msvc/WatchService.vcxproj View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -22,15 +22,15 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -329,15 +329,15 @@
<None Include="..\src\icons\main.ico" />
<CustomBuild Include="..\src\SplashScreen.ui">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Uic%27ing %(Filename)%(Extension)...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\$(ProjectName)\ui_%(Filename).h" "%(FullPath)"
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\$(ProjectName)\ui_%(Filename).h" "%(FullPath)"
</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ProjectName)\ui_%(Filename).h;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Uic%27ing %(Filename)%(Extension)...</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Uic%27ing %(Filename)%(Extension)...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\$(ProjectName)\ui_%(Filename).h" "%(FullPath)"
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\$(ProjectName)\ui_%(Filename).h" "%(FullPath)"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\$(ProjectName)\ui_%(Filename).h" "%(FullPath)"
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\$(ProjectName)\ui_%(Filename).h" "%(FullPath)"
</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>


+ 59
- 0
3.0/src/apps/WatchServiceController/msvc/Resources.rc View File

@@ -2,6 +2,51 @@
//
#include "Resources.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// Russian resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"Resources.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
@@ -10,4 +55,18 @@
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "..\\src\\icons\\main.ico"
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED


+ 5
- 5
3.0/src/apps/WatchServiceController/msvc/WatchServiceController.vcxproj View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -22,15 +22,15 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">


+ 38
- 0
3.0/src/includes/Hardware/Common/DataPointer.h View File

@@ -0,0 +1,38 @@
/* @file Обертка указателя на произвольный тип. Структура нужна для инициализации в статической функции. */

#pragma once

//--------------------------------------------------------------------------------
template <class T>
struct SPData
{
public:
SPData<T>() : mData(nullptr) {}

operator T * ()
{
return mData;
}

SPData<T> & operator = (T * aResult)
{
mData = aResult;

return *this;
}

T ** operator & ()
{
return &mData;
}

operator bool()
{
return mData;
}

private:
T * mData;
};

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

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

@@ -56,6 +56,85 @@ namespace CDeviceData
{
const char Mine[] = "port_data";
const char Other[] = "other_port_data";
namespace USB
{
const char ConfigAmount[] = "config_amount";
const char BusNumber[] = "device_bus_number";
const char Address[] = "device_address";
const char PortNumber[] = "device_port_number";
const char ConfigData[] = "config_data";
const char Specification[] = "usb_specification";
const char FirmwareVersion[] = "device_firmware_version";
const char Code[] = "device_code";
const char Description[] = "device_description";
const char EP0PacketSize[] = "ep0_packet_size";
const char Vendor[] = "device_vendor";
const char Product[] = "device_product";
const char BOSData[] = "bos_data";
namespace BOS
{
const char Capability[] = "capability";
namespace Capability2_0
{
const char Attributes[] = "2_0_attributes";
}
namespace Capability3_0
{
const char Attributes[] = "3_0_attributes";
const char SpeedSupported[] = "speed_supported";
const char FunctionalitySupport[] = "functionality_support";
const char U1ExitLatency[] = "u1_exit_latency";
const char U2ExitLatency[] = "u2_exit_latency";
}
}
namespace Config
{
const char InterfaceAmount[] = "interface_amount";
const char InterfaceData[] = "interface_data";
const char Index[] = "config_index";
const char Value[] = "config_value";
const char Attributes[] = "config_attributes";
const char MaxPower[] = "config_max_power";
namespace Interface
{
const char EndpointAmount[] = "endpoint_amount";
const char EndpointData[] = "endpoint_data";
const char Number[] = "interface_number";
const char Index[] = "interface_index";
const char AlternateSetting[] = "interface_alternate_setting";
const char Code[] = "interface_code";
const char Description[] = "interface_description";
namespace Endpoint
{
const char TransferType[] = "ep_transfer_type";
const char IsoSyncType[] = "ep_iso_sync_type";
const char IsoUsageType[] = "ep_iso_usage_type";
const char CompanionAmount[] = "ep_companion_amount";
const char CompanionData[] = "ep_companion_data";
const char Address[] = "ep_address";
const char Attributes[] = "ep_attributes";
const char MaxPacketSize[] = "ep_max_packet_size";
const char PollingInterval[] = "ep_polling_interval";
const char SyncRefreshRate[] = "ep_sync_refresh_rate";
const char SynchAddress[] = "ep_sync_address";
namespace Companion
{
const char MaxBurstPacketAmount[] = "companion_ep_max_burst";
const char Attributes[] = "companion_ep_attributes";
const char BytesPerInterval[] = "companion_ep_bytes_per_interval";
}
}
}
}
}
}
/// OPOS-устройства.


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

@@ -18,7 +18,9 @@ namespace CHardware
const char RequiredResourceNames[] = "required_resource_names";
const char PluginPath[] = "plugin_path";
const char ConfigData[] = "config_data";
const char CanSoftReboot[] = "can_soft_reboot"; const char ProtocolType[] = "protocol_type";
const char CanSoftReboot[] = "can_soft_reboot";
const char ProtocolType[] = "protocol_type";
/// Типы вызова функционала драйвера.
namespace CallingTypes
{
@@ -72,6 +74,13 @@ namespace CHardware
const char WaitResult[] = "wait_result";
const char ControlRemoving[] = "control_removing";
}
/// Константы USB-порта.
namespace USB
{
const char VID[] = "vid";
const char PID[] = "pid";
}
}
/// Константы кардридера.


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

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

#pragma once

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QStringList>
#include <QtCore/QVariantMap>
@@ -64,7 +65,8 @@ protected:
}
};

#define APPEND(Key) append(Key, #Key)
#define APPEND(aKey) append(aKey, #aKey)
#define ADD(aKey) add(aKey, #aKey)

// базовый класс для хранения данных в виде пар ключ-значение со статическим заполнением данных
template <class T1, class T2>


+ 4
- 4
3.0/src/includes/Hardware/Common/USBDeviceModelData.h View File

@@ -24,10 +24,10 @@ namespace CUSBDevice
};

/// данные моделей по PID-ам.
class CData : public CSpecification<quint32, SData>
class CData : public CSpecification<quint16, SData>
{
public:
void add(quint32 aPID, const QString & aModel, bool aVerified = false)
void add(quint16 aPID, const QString & aModel, bool aVerified = false)
{
append(aPID, SData(aModel, aVerified));
}
@@ -39,10 +39,10 @@ namespace CUSBDevice
};

/// Данные моделей по VID-ам.
class CDetectingData : public CSpecification<quint32, CData>
class CDetectingData : public CSpecification<quint16, CData>
{
public:
void add(quint32 aVID, quint32 aPID, const QString & aModel, bool aVerified = false)
void add(quint16 aVID, quint16 aPID, const QString & aModel, bool aVerified = false)
{
data()[aVID].append(aPID, SData(aModel, aVerified));
}


+ 79
- 0
3.0/src/includes/Hardware/IOPorts/LibUSBDeviceDataTypes.h View File

@@ -0,0 +1,79 @@
/* @file Типы данных USB-устройств для использования в функционале LibUSB-порта. */

#pragma once

// LibUSB SDK
#pragma warning(push, 1)
#include "libusb/src/libusb/libusb.h"
#pragma warning(pop)

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QVariantMap>
#include <QtCore/QMetaType>
#include <QtCore/QList>
#include <Common/QtHeadersEnd.h>

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

namespace CLibUSB
{
/// Данные конечной точки.
struct SEndPoint
{
libusb_transfer_type transferType;
char data;
int maxPacketSize;
int pollingInterval;

SEndPoint(): transferType(LIBUSB_TRANSFER_TYPE_CONTROL), data(ASCII::NUL), maxPacketSize(0), pollingInterval(0) {}
SEndPoint(libusb_transfer_type aTransferType, char aData, int aMaxPacketSize, int aPollingInterval):
transferType(aTransferType), data(aData), maxPacketSize(aMaxPacketSize), pollingInterval(aPollingInterval) {}

bool getDirection() { return bool(data & LIBUSB_ENDPOINT_DIR_MASK); }
bool valid() { return maxPacketSize && ~(data & (LIBUSB_ENDPOINT_DIR_MASK | LIBUSB_ENDPOINT_ADDRESS_MASK)) &&
((transferType == LIBUSB_TRANSFER_TYPE_BULK) || (transferType == LIBUSB_TRANSFER_TYPE_INTERRUPT)); }
char operator()() { return data; }
};

/// Параметры устройства.
struct SDeviceProperties
{
QVariantMap deviceData;
quint16 VID;
quint16 PID;
QString portData;
SEndPoint deviceToHost;
SEndPoint hostToDevice;
bool valid() { return VID && PID && deviceToHost.valid() && hostToDevice.valid() && deviceToHost.getDirection() && !hostToDevice.getDirection(); }

SDeviceProperties(): VID(0), PID(0) {}
SDeviceProperties(const QVariantMap & aDeviceData): deviceData(aDeviceData) {}
};

typedef QMap<libusb_device *, SDeviceProperties> TDeviceProperties;
typedef QList<QVariantMap> TDeviceDataList;

//--------------------------------------------------------------------------------
template <class T, int aIndex>
class CConfigTypeDescriptions: public CDescription<T>
{
public:
void add(T aKey, const QString & aDescription)
{
append(T(aKey << aIndex), aDescription);
}

const QString operator[] (uint8_t aData) const
{
return mBuffer.value(T(aData & ('\x03' << aIndex)), "unknown");
}
};
}

typedef QList<QVariantMap> TLibUSBDataList;
Q_DECLARE_METATYPE(TLibUSBDataList);

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

+ 3
- 0
3.0/src/includes/Hardware/IOPorts/LibUSBPort.h View File

@@ -0,0 +1,3 @@
#ifdef Q_OS_WIN32
#include "../../../modules/Hardware/IOPorts/src/LibUSB/LibUSBPort.h"
#endif

+ 1
- 0
3.0/src/includes/Hardware/IOPorts/LibUSBUtils.h View File

@@ -0,0 +1 @@
#include "../../../modules/Hardware/IOPorts/src/LibUSB/LibUSBUtils.h"

+ 3
- 0
3.0/src/includes/Hardware/IOPorts/USBPort.h View File

@@ -0,0 +1,3 @@
#ifdef Q_OS_WIN32
#include "../../../modules/Hardware/IOPorts/src/USB/USBPort.h"
#endif

+ 0
- 3
3.0/src/includes/Hardware/IOPorts/USBSerialPort.h View File

@@ -1,3 +0,0 @@
#ifdef Q_OS_WIN32
#include "../../../modules/Hardware/IOPorts/src/USB/USBSerialPort.h"
#endif

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

@@ -26,6 +26,7 @@ namespace CAllHardware
const char OptionalPortSettingsEnable[] = "optional_port_settings_enable";
const char SerialNumber[] = "serial_number";
const char CanOnline[] = "can_online";
const char LibraryVersion[] = "library_version";
/// Значения настроек.
namespace Values


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

@@ -41,22 +41,22 @@ public: // методы
/// Закрыть порт.
virtual bool close() = 0;

/// Очистка буферов порта.
/// Очистить буферы порта.
virtual bool clear() = 0;

/// Установка параметров порта.
/// Установить параметры порта.
virtual bool setParameters(const TPortParameters & aParameters) = 0;

/// Получение параметров порта.
/// Получить параметры порта.
virtual void getParameters(TPortParameters & aParameters) = 0;

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

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

/// Возвращает тип порта.
/// Получить тип порта.
virtual EPortTypes::Enum getType() = 0;

/// Порт существует?


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

@@ -11,6 +11,7 @@ namespace CInteractionTypes
{
ADD_IT(COM)
ADD_IT(USB)
ADD_IT(LibUSB)
ADD_IT(TCP)
ADD_IT(OPOS)
ADD_IT(System)


+ 7
- 1
3.0/src/interface/modern/addinfo_scene.qml View File

@@ -160,7 +160,6 @@ Widgets.SceneBase2 {
}
if (global.needChooseService) {
Core.payment.setExternalParameter(Core.payment.findAliasFromRequest("EXTACCOUNT"), "");
Core.postEvent(EventType.UpdateScenario, Scenario.Payment.Event.Retry);
}
else {
@@ -236,6 +235,13 @@ Widgets.SceneBase2 {
// Если есть доп-поля, то обновляем редакторы после того, как распарсится модель
if (addFields) {
addFields.forEach(function(aItem){fields.push(aItem)})
// Сохраним имена полей, полученных в ADD_FIELDS
var af = [];
for (var i in addFields) {
af.push(addFields[i].id);
}
Core.userProperties.set("payment.add_fields", af);
}
global.fields = fields;


+ 31
- 8
3.0/src/interface/modern/info_content/terminal_info.qml View File

@@ -45,7 +45,7 @@ Item {
onPressed: {
timer.start();
global.key += String(about.model.indexOf(modelData));
if (global.key === "11111") {
if (global.key === "00000" || global.key === "11111") {
GUI.notification(Core.environment.terminal.version);
}
}
@@ -77,7 +77,11 @@ Item {
var model = [];
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#about_terminal")));
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#terminal")).arg(Core.environment.terminal.AP));
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#terminal_address")).arg(Core.environment.dealer.pointAddress));
if (Core.environment.dealer.pointAddress) {
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#terminal_address")).arg(Core.environment.dealer.pointAddress));
}
model.push(Core.environment.dealer.isBank == "1" ?
Utils.locale.tr(QT_TR_NOOP("terminal_info#about_bank_agent")) :
Utils.locale.tr(QT_TR_NOOP("terminal_info#about_agent")));
@@ -91,13 +95,32 @@ Item {
}
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#about_processing")));
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#processing_name_inn")).arg(Core.environment.dealer.operatorName).arg(Core.environment.dealer.operatorInn));
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#processing_address")).arg(Core.environment.dealer.operatorAddress));
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#processing_contract")).arg(Core.environment.dealer.operatorContractNumber));
if (Core.environment.dealer.operatorName || Core.environment.dealer.operatorInn) {
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#processing_name_inn")).arg(Core.environment.dealer.operatorName).arg(Core.environment.dealer.operatorInn));
}
if (Core.environment.dealer.operatorAddress) {
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#processing_address")).arg(Core.environment.dealer.operatorAddress));
}
if (Core.environment.dealer.operatorContractNumber) {
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#processing_contract")).arg(Core.environment.dealer.operatorContractNumber));
}
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#about_bank")));
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#bank_name_inn_bik")).arg(Core.environment.dealer.bankName).arg(Core.environment.dealer.bankInn).arg(Core.environment.dealer.bankBik));
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#bank_address_phone")).arg(Core.environment.dealer.bankAddress).arg(Core.environment.dealer.bankPhone));
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#bank_contract")).arg(Core.environment.dealer.bankContractNumber));
if (Core.environment.dealer.bankName || Core.environment.dealer.bankInn || Core.environment.dealer.bankBik) {
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#bank_name_inn_bik")).arg(Core.environment.dealer.bankName).arg(Core.environment.dealer.bankInn).arg(Core.environment.dealer.bankBik));
}
if (Core.environment.dealer.bankAddress || Core.environment.dealer.bankPhone) {
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#bank_address_phone")).arg(Core.environment.dealer.bankAddress).arg(Core.environment.dealer.bankPhone));
}
if (Core.environment.dealer.bankContractNumber) {
model.push(Utils.locale.tr(QT_TR_NOOP("terminal_info#bank_contract")).arg(Core.environment.dealer.bankContractNumber));
}
about.model = model;
}


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

@@ -19,7 +19,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../addinfo_scene.qml" line="260"/>
<location filename="../addinfo_scene.qml" line="249"/>
<source>payment_scenario#cannot_check_payment</source>
<translation type="unfinished"></translation>
</message>


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