Browse Source

refs #1 Synchronize with release commit: 29d8a75477

qt5
parent
commit
111526d56f
60 changed files with 8826 additions and 0 deletions
  1. +2
    -0
      3.0/src/interface/.gitignore
  2. +25
    -0
      3.0/src/interface/interface.qbs
  3. +40
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/Migrator3000.qbs
  4. +3
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/msvc/CompileLocale.bat
  5. +212
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/msvc/Migrator3000.vcxproj
  6. +76
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/msvc/Migrator3000.vcxproj.filters
  7. +4
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/src/Locale/migrator3000_ru.ts
  8. +388
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/src/MainScenario.cpp
  9. +179
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/src/MainScenario.h
  10. +14
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/src/PluginFactoryDefinition.cpp
  11. +13
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/src/PluginLibraryDefinition.h
  12. +96
    -0
      3.0/src/plugins/NativeScenarios/Migrator3000/src/ScenarioPlugin.h
  13. +42
    -0
      3.0/src/plugins/ScenarioBackends/UCS/UCS.qbs
  14. +4
    -0
      3.0/src/plugins/ScenarioBackends/UCS/msvc/CompileLocale.bat
  15. +370
    -0
      3.0/src/plugins/ScenarioBackends/UCS/msvc/Ucs.vcxproj
  16. +156
    -0
      3.0/src/plugins/ScenarioBackends/UCS/msvc/Ucs.vcxproj.filters
  17. +943
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/API.cpp
  18. +198
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/API.h
  19. +133
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/APIErrors.cpp
  20. +130
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/DatabaseUtils.cpp
  21. +56
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/DatabaseUtils.h
  22. +494
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/Locale/ucs_ru.ts
  23. +39
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/Plugin.cpp
  24. +13
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/PluginFactoryDefinition.cpp
  25. +13
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/PluginLibraryDefinition.h
  26. +295
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/Responses.cpp
  27. +199
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/Responses.h
  28. +47
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/SingleDetectingIterator.h
  29. +184
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/Ucs.h
  30. +37
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/UcsBackend.cpp
  31. +90
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/UcsBackend.h
  32. +190
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/UcsChargeProvider.cpp
  33. +93
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/UcsChargeProvider.h
  34. +215
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/UcsDevice.cpp
  35. +141
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/UcsDevice.h
  36. +33
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/UscEncashTask.cpp
  37. +37
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/UscEncashTask.h
  38. +99
    -0
      3.0/src/plugins/ScenarioBackends/UCS/src/Utils.h
  39. +42
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/Uniteller.qbs
  40. +4
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/msvc/CompileLocale.bat
  41. +298
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/msvc/Uniteller.vcxproj
  42. +148
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/msvc/Uniteller.vcxproj.filters
  43. +533
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/API.cpp
  44. +141
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/API.h
  45. +133
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/APIErrors.cpp
  46. +495
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/Locale/uniteller_ru.ts
  47. +39
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/Plugin.cpp
  48. +13
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/PluginFactoryDefinition.cpp
  49. +13
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/PluginLibraryDefinition.h
  50. +225
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/Responses.cpp
  51. +156
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/Responses.h
  52. +47
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/SingleDetectingIterator.h
  53. +145
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/Uniteller.h
  54. +144
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/UnitellerBackend.cpp
  55. +144
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/UnitellerBackend.h
  56. +191
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/UnitellerChargeProvider.cpp
  57. +83
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/UnitellerChargeProvider.h
  58. +274
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/UnitellerDevice.cpp
  59. +142
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/UnitellerDevice.h
  60. +113
    -0
      3.0/src/plugins/ScenarioBackends/Uniteller/src/Utils.h

+ 2
- 0
3.0/src/interface/.gitignore View File

@@ -0,0 +1,2 @@
#Project files
[Bb]uild/

+ 25
- 0
3.0/src/interface/interface.qbs View File

@@ -0,0 +1,25 @@
import qbs 1.0

Project {

DynamicLibrary {
name: "utils"

Depends { name: 'cpp' }
Depends { name: "Qt"; submodules: ["core", "gui", "qml", "quick", "widgets", "xml", "multimedia"] }

Depends { name: "Core" }
Depends { name: "QZint" }

files: [
"../includes/Common/CoreVersion.rc",
"plugins/Utils/src/*.cpp",
"plugins/Utils/src/*.h"
]
Group {
qbs.install: true
qbs.installDir: "plugins/interface"
fileTagsFilter: product.type
}
}
}

+ 40
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/Migrator3000.qbs View File

@@ -0,0 +1,40 @@
import qbs 1.0
import "../../pluginTemplate.qbs" as PluginTemplate

Project {

PluginTemplate {
name: "migrator3000"

Depends { name: "Qt"; submodules: ["network", "xml", "script", "gui", "qml" ] }

Depends { name: "App" }
Depends { name: "Log" }
Depends { name: "NetworkTaskManager" }
Depends { name: "ScenarioEngine" }

Depends { name: "Migrator3000Translations" }

files: [
"../../../includes/Common/CoreVersion.rc",
"src/*.h",
"src/*.cpp",
]
}

Product {
name: "Migrator3000Translations"
type: "qm"

Depends { name: "Qt.core" }

files: "src/Locale/*.ts"

Group {
fileTagsFilter: product.type
qbs.install: true
qbs.installDir: "locale"
}
}
}

+ 3
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/msvc/CompileLocale.bat View File

@@ -0,0 +1,3 @@
call %QTDIR%\bin\qtvars.bat

lrelease "..\src\Locale\migrator3000_ru.ts" -qm "%~1\%~2_ru.qm"

+ 212
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/msvc/Migrator3000.vcxproj View File

@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseWithDebugInfo|Win32">
<Configuration>ReleaseWithDebugInfo</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>migrator3000</ProjectName>
<ProjectGuid>{1238F604-5909-48A1-839E-D2ABB23FD8A7}</ProjectGuid>
<RootNamespace>UADispenser</RootNamespace>
<Keyword>Qt4VSv1.0</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TC_BIN)\plugins\$(ProjectName)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(TC_BIN)\plugins\$(ProjectName)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)\obj\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(ProjectDir)\obj\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TC_BIN)\plugins\$(ProjectName)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)\obj\$(Configuration)\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)d</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(TC_INCLUDE_DIR);$(ProjectDir)\..\thirdparty\include;.\GeneratedFiles\$(ProjectName)\$(Configuration);.\GeneratedFiles\$(ProjectName);.\;$(THIRDPARTY_DIR);$(THIRDPARTY_DIR)\boost;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtQml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;TESTPLUGIN_LIB;QT_NETWORK_LIB;QT_GUI_LIB;QT_QML_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<DisableSpecificWarnings>4290</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>Application.lib;Log.lib;PluginSDK.lib;NetworkTaskManager.lib;PaymentProcessorSDK.lib;GUISDK.lib;ScenarioEngine.lib;Qt5Core.lib;Qt5Network.lib;Qt5Gui.lib;Qt5Qml.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(TargetPath)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(TC_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>true</MapExports>
</Link>
<PostBuildEvent>
<Command>call "$(ProjectDir)\CompileLocale.bat" "$(OutDir)" "$(TargetName)"</Command>
<Message>Performing locale compiling</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(TC_INCLUDE_DIR);$(ProjectDir)\..\thirdparty\include;.\GeneratedFiles\$(ProjectName)\$(Configuration);.\GeneratedFiles\$(ProjectName);.\;$(THIRDPARTY_DIR);$(THIRDPARTY_DIR)\boost;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtQml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;TESTPLUGIN_LIB;QT_NETWORK_LIB;QT_GUI_LIB;QT_QML_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4290</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>Application.lib;Log.lib;PluginSDK.lib;NetworkTaskManager.lib;PaymentProcessorSDK.lib;GUISDK.lib;ScenarioEngine.lib;Qt5Core.lib;Qt5Network.lib;Qt5Gui.lib;Qt5Qml.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(TargetPath)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(TC_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<PostBuildEvent>
<Command>call "$(ProjectDir)\CompileLocale.bat" "$(OutDir)" "$(TargetName)"</Command>
<Message>Performing locale compiling</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(TC_INCLUDE_DIR);$(ProjectDir)\..\thirdparty\include;.\GeneratedFiles\$(ProjectName)\$(Configuration);.\GeneratedFiles\$(ProjectName);.\;$(THIRDPARTY_DIR);$(THIRDPARTY_DIR)\boost;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtQml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_CORE_LIB;TESTPLUGIN_LIB;QT_NETWORK_LIB;QT_GUI_LIB;QT_QML_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4290</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<AdditionalDependencies>Applicationd.lib;Logd.lib;PluginSDKd.lib;NetworkTaskManagerd.lib;PaymentProcessorSDKd.lib;GUISDKd.lib;ScenarioEngined.lib;Qt5Cored.lib;Qt5Networkd.lib;Qt5Guid.lib;Qt5Qmld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(TargetPath)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(TC_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>true</MapExports>
</Link>
<PostBuildEvent>
<Command>call "$(ProjectDir)\CompileLocale.bat" "$(OutDir)" "$(TargetName)"</Command>
<Message>Performing locale compiling</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\MainScenario.cpp" />
<ClCompile Include="..\src\PluginFactoryDefinition.cpp" />
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_MainScenario.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_PluginLibraryDefinition.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_MainScenario.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_PluginLibraryDefinition.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_MainScenario.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_PluginLibraryDefinition.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\MainScenario.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing MainScenario.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_QML_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtQml"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Moc%27ing MainScenario.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_QML_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtQml"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing MainScenario.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_QML_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtQml"</Command>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<None Include="..\src\Locale\migrator3000_ru.ts" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\PluginLibraryDefinition.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Moc%27ing PluginLibraryDefinition.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_QML_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtQml"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing PluginLibraryDefinition.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_QML_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtQml"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing PluginLibraryDefinition.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_QML_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtQml"</Command>
</CustomBuild>
<ClInclude Include="..\src\ScenarioPlugin.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties lupdateOnBuild="1" MocDir=".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)" MocOptions="" QtVersion_x0020_Win32="$(DefaultQtVersion)" RccDir=".\GeneratedFiles\$(ProjectName)" UicDir=".\GeneratedFiles\$(ProjectName)" Qt5Version_x0020_Win32="$(DefaultQtVersion)" />
</VisualStudio>
</ProjectExtensions>
</Project>

+ 76
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/msvc/Migrator3000.vcxproj.filters View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;cxx;c;def</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>moc;h;cpp</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Translation Files">
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
<Extensions>ts</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Generated Files\Debug">
<UniqueIdentifier>{20a8acc0-1550-417c-a655-8c2fb5a2756d}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Generated Files\Release">
<UniqueIdentifier>{19f6fb7b-2c9b-42d4-aa01-1705ef1bd693}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Generated Files\ReleaseWithDebugInfo">
<UniqueIdentifier>{284eef90-da48-4125-afc3-cde14d6043a7}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\PluginFactoryDefinition.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\MainScenario.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_MainScenario.cpp">
<Filter>Generated Files\ReleaseWithDebugInfo</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_MainScenario.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_MainScenario.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_PluginLibraryDefinition.cpp">
<Filter>Generated Files\ReleaseWithDebugInfo</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_PluginLibraryDefinition.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_PluginLibraryDefinition.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\src\Locale\migrator3000_ru.ts">
<Filter>Translation Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\ScenarioPlugin.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\MainScenario.h">
<Filter>Source Files</Filter>
</CustomBuild>
<CustomBuild Include="..\src\PluginLibraryDefinition.h">
<Filter>Generated Files</Filter>
</CustomBuild>
</ItemGroup>
</Project>

+ 4
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/src/Locale/migrator3000_ru.ts View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
</TS>

+ 388
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/src/MainScenario.cpp View File

@@ -0,0 +1,388 @@
/* @file Плагин сценария для тестирования оборудования */

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QByteArray>
#include <QtCore/QFile>
#include <QtCore/QPair>
#include <QtCore/QSettings>
#include <Common/QtHeadersEnd.h>

// Stl
#include <string>

// Boost
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/foreach.hpp>

// Plugin SDK
#include <SDK/Plugins/PluginInitializer.h>
#include <SDK/Plugins/IExternalInterface.h>

// PP SDK
#include <SDK/PaymentProcessor/Components.h>
#include <SDK/PaymentProcessor/Core/IGUIService.h>
#include <SDK/PaymentProcessor/Core/IPrinterService.h>
#include <SDK/PaymentProcessor/Core/INetworkService.h>
#include <SDK/PaymentProcessor/Core/ICryptService.h>
#include <SDK/PaymentProcessor/Core/IDeviceService.h>
#include <SDK/PaymentProcessor/Core/IDatabaseService.h>
#include <SDK/PaymentProcessor/Scripting/Core.h>
#include <SDK/Drivers/DeviceTypes.h>
#include <SDK/GUI/IGraphicsHost.h>

// Modules
#include <Common/ExitCodes.h>
#include <Crypt/ICryptEngine.h>

// Проект
#include "ScenarioPlugin.h"
#include "MainScenario.h"

//--------------------------------------------------------------------------
namespace
{
/// Конструктор плагина.
SDK::Plugin::IPlugin * CreatePlugin(SDK::Plugin::IEnvironment * aFactory, const QString & aInstancePath)
{
return new Migrator3000::MainScenarioPlugin(aFactory, aInstancePath);
}
}

REGISTER_PLUGIN(SDK::Plugin::makePath(SDK::PaymentProcessor::Application, PPSDK::CComponents::ScenarioFactory,
CScenarioPlugin::PluginName), &CreatePlugin);

namespace Migrator3000
{

//---------------------------------------------------------------------------
MainScenario::MainScenario(SDK::PaymentProcessor::ICore * aCore, ILog * aLog)
: Scenario(CScenarioPlugin::PluginName, aLog),
mCore(aCore),
mNetworkService(aCore->getNetworkService()),
mTerminalService(aCore->getTerminalService()),
mSettingsService(aCore->getSettingsService()),
mCryptService(aCore->getCryptService()),
mDeviceService(aCore->getDeviceService()),
mMonitoringComandId(-1)
{
mTerminalSettings = static_cast<PPSDK::TerminalSettings *>
(mCore->getSettingsService()->getAdapter(PPSDK::CAdapterNames::TerminalAdapter));

Q_ASSERT(mTerminalSettings);

mScriptingCore = static_cast<SDK::PaymentProcessor::Scripting::Core *>
(dynamic_cast<SDK::GUI::IGraphicsHost *>(mCore->getGUIService())->
getInterface<QObject>(SDK::PaymentProcessor::Scripting::CProxyNames::Core));
Q_ASSERT(mScriptingCore);

connect(&mTaskWatcher, SIGNAL(finished()), SLOT(onTaskFinished()));
}

//---------------------------------------------------------------------------
MainScenario::~MainScenario()
{
}

//---------------------------------------------------------------------------
bool MainScenario::initialize(const QList<GUI::SScriptObject> & /*aScriptObjects*/)
{
return true;
}

//---------------------------------------------------------------------------
void MainScenario::start(const QVariantMap & aContext)
{
setStateTimeout(0);

mContext = aContext;
QStringList args = mContext["args"].toString().split(";");
mKiosk2InstallPath = args.first().split("#").last();
mMonitoringComandId = args.last().split("#").last().toInt();

QByteArray sign;
QString error;

//check keys
if (!mCryptService->getCryptEngine()->sign(0, "Hello Cyberplat", sign, error))
{
toLog(LogLevel::Error, QString("CHECK keys error, %1").arg(error));
signalTriggered("abort", QVariantMap());
return;
}

toLog(LogLevel::Normal, QString("CHECK keys OK"));

//setup connection
PPSDK::SConnection connection;

using boost::property_tree::ptree;
ptree pt;

QString terminalConfig = mKiosk2InstallPath + "/config/terminal.xml";

try
{
read_xml(terminalConfig.toStdString(), pt);

BOOST_FOREACH(ptree::value_type const & v, pt.get_child("terminal"))
{
if (v.first == "connection")
{
connection.type = QString::fromStdString(v.second.get<std::string>("<xmlattr>.type", "")) == "local" ? EConnectionTypes::Unmanaged : EConnectionTypes::Dialup;
connection.name = QString::fromStdString(v.second.get<std::string>("<xmlattr>.name", ""));

QNetworkProxy proxy;

auto proxyType = QString::fromStdString(v.second.get<std::string>("proxy.<xmlattr>.type", ""));

if (proxyType == "http")
{
proxy.setType(QNetworkProxy::HttpProxy);
}
else if (proxyType == "http_caching")
{
proxy.setType(QNetworkProxy::HttpCachingProxy);
}
else if (proxyType == "socks5")
{
proxy.setType(QNetworkProxy::Socks5Proxy);
}
else
{
proxy.setType(QNetworkProxy::NoProxy);
}

if (proxy.type() != QNetworkProxy::NoProxy)
{
proxy.setUser(QString::fromStdString(v.second.get<std::string>("proxy.<xmlattr>.username", "")));
proxy.setPassword(QString::fromStdString(v.second.get<std::string>("proxy.<xmlattr>.password", "")));
proxy.setHostName(QString::fromStdString(v.second.get<std::string>("proxy.<xmlattr>.host", "")));
proxy.setPort(QString::fromStdString(v.second.get<std::string>("proxy.<xmlattr>.port", "0")).toUShort());
}

connection.proxy = proxy;
}
}
}
catch (boost::property_tree::xml_parser_error & e)
{
toLog(LogLevel::Error, QString("PARSING '%1' error, %2").arg(terminalConfig).arg(QString::fromStdString(e.message())));
signalTriggered("abort", QVariantMap());
return;
}

mNetworkService->setConnection(connection);
mTerminalSettings->setConnection(connection);

//test connection
if (!mNetworkService->testConnection())
{
toLog(LogLevel::Error, QString("CHECK connection error, %1").arg(mNetworkService->getLastConnectionError().split(":").last()));
signalTriggered("abort", QVariantMap());
return;
}

toLog(LogLevel::Normal, QString("CHECK connection OK"));

// start find devices
connect(mDeviceService, SIGNAL(deviceDetected(const QString &)), this, SLOT(onDeviceDetected(const QString &)));
connect(mDeviceService, SIGNAL(detectionStopped()), this, SLOT(onDetectionStopped()));

toLog(LogLevel::Normal, QString("START autodetect."));

mFoundedDevices.clear();
mDeviceService->detect();
}

//---------------------------------------------------------------------------
void MainScenario::stop()
{
mTimeoutTimer.stop();

disconnect(mDeviceService, SIGNAL(deviceDetected(const QString &)), this, SLOT(onDeviceDetected(const QString &)));
disconnect(mDeviceService, SIGNAL(detectionStopped()), this, SLOT(onDetectionStopped()));
}

//---------------------------------------------------------------------------
void MainScenario::pause()
{
mTimeoutTimer.stop();
}

//---------------------------------------------------------------------------
void MainScenario::resume(const QVariantMap & aContext)
{
}

//---------------------------------------------------------------------------
void MainScenario::signalTriggered(const QString & aSignal, const QVariantMap & /*aArguments*/)
{
QVariantMap parameters;
int returnCode = -1;

if (aSignal == "abort")
{
parameters.insert("result", "abort");
returnCode = ExitCode::Error;

mTimeoutTimer.stop();
emit finished(parameters);
}
else if (aSignal == "finish")
{
returnCode = ExitCode::NoError;
mTimeoutTimer.stop();
emit finished(parameters);
}

//abort/finish - завершаем сценарий, закрываем приложение
if (returnCode == ExitCode::NoError || returnCode == ExitCode::Error)
{
QVariantMap parameters;
parameters.insert("returnCode", returnCode);
mScriptingCore->postEvent(PPSDK::EEventType::StopSoftware, parameters);
}
}

//---------------------------------------------------------------------------
QString MainScenario::getState() const
{
return QString("main");
}

//---------------------------------------------------------------------------
void MainScenario::onTimeout()
{
if (mTaskWatcher.isRunning())
{
mTaskWatcher.waitForFinished();
}

signalTriggered("finish", QVariantMap());
}

//---------------------------------------------------------------------------
void MainScenario::onTaskFinished()
{
signalTriggered("finish", QVariantMap());
}

//--------------------------------------------------------------------------
bool MainScenario::canStop()
{
return true;
}

//---------------------------------------------------------------------------
void MainScenario::onDeviceDetected(const QString & aConfigName)
{
toLog(LogLevel::Normal, QString("DETECT device %1").arg(aConfigName));
mFoundedDevices.append(aConfigName);
}

//---------------------------------------------------------------------------
void MainScenario::onDetectionStopped()
{
toLog(LogLevel::Normal, QString("STOP autodetect. WAIT device init."));
// Подождем, чтобы все устройства успели проинициализироваться
QTimer::singleShot(40000, this, SLOT(finishDeviceDetection()));
}

//---------------------------------------------------------------------------
void MainScenario::finishDeviceDetection()
{
toLog(LogLevel::Normal, QString("INIT devices done."));

// update configs
mDeviceService->saveConfigurations(mFoundedDevices);
mSettingsService->saveConfiguration();

// todo check validator/printer config settings
QStringList configurations = mDeviceService->getConfigurations();
auto isDeviceOK = [=](const QString & aDeviceType) -> bool
{
namespace DSDK = SDK::Driver;

foreach(QString config, configurations)
{
if (config.section('.', 2, 2) == aDeviceType)
{
auto status = mDeviceService->getDeviceStatus(config);

return status && status->isMatched(DSDK::EWarningLevel::Warning);
}
}

return false;
};

bool validatorOK = isDeviceOK(SDK::Driver::CComponents::BillAcceptor);

if (!validatorOK)
{
toLog(LogLevel::Error, QString("BILL VALIDATOR error or not found."));
signalTriggered("abort");
return;
}

toLog(LogLevel::Normal, QString("BILL VALIDATOR is OK."));

bool printerOK = isDeviceOK(SDK::Driver::CComponents::Printer) ||
isDeviceOK(SDK::Driver::CComponents::DocumentPrinter) ||
isDeviceOK(SDK::Driver::CComponents::FiscalRegistrator);

bool blockTerminalByPrinter = mTerminalSettings->getCommonSettings().blockOn(SDK::PaymentProcessor::SCommonSettings::PrinterError);

if (!printerOK && blockTerminalByPrinter)
{
toLog(LogLevel::Error, QString("PRINTER %1, BLOCK terminal by printer = %2.").arg(printerOK ? "OK" : "error").arg(blockTerminalByPrinter ? "YES" : "NO"));
signalTriggered("abort");
return;
}

toLog(LogLevel::Error, QString("PRINTER is OK."));

//fix standalone flag
{
QSettings ini("client.ini", QSettings::IniFormat);
ini.setIniCodec("UTF-8");
ini.setValue("common/standalone", false);

if (ini.status() != QSettings::NoError)
{
toLog(LogLevel::Error, QString("UPDATE standalone flag error: %1.").arg(ini.status() == QSettings::AccessError ?
"An access error occurred" : "A format error occurred"));

signalTriggered("abort");
return;
}

toLog(LogLevel::Normal, QString("UPDATE standalone flag OK."));
}

auto queryStr = QString("INSERT INTO `command` (`id`, `type`, `parameters`, `receive_date`, `status`, `last_update`, `on_monitoring`, `description`, `tag`) \
VALUES(%1, 18, \"""\", \"%2\", 3, %1, 0, \"OK\", 10)")
.arg(mMonitoringComandId)
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz"));

if (!mCore->getDatabaseService()->execQuery(queryStr))
{
toLog(LogLevel::Error, QString("UPDATE monitoring command error."));
signalTriggered("abort");
return;
}

toLog(LogLevel::Normal, QString("UPDATE monitoring command OK."));
signalTriggered("finish", QVariantMap());
}

}

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

+ 179
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/src/MainScenario.h View File

@@ -0,0 +1,179 @@
/* @file Плагин сценария для автоматической миграции с 2.х.х на 3.х.х версию терминального ПО */

#pragma once

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QMap>
#include <QtCore/QStringList>
#include <QtCore/QSharedPointer>
#include <QtCore/QFutureWatcher>
#include <QtCore/QReadWriteLock>
#include <Common/QtHeadersEnd.h>

#include <SDK/PaymentProcessor/Connection/Connection.h>

// Modules
#include <ScenarioEngine/Scenario.h>

// Plugin SDK
#include <SDK/Plugins/IFactory.h>

// Project

class IApplication;

namespace SDK {
namespace PaymentProcessor {
class ICore;
class INetworkService;
class ITerminalService;
class ISettingsService;
class ICryptService;
class TerminalSettings;
class IDeviceService;

namespace Scripting {
class Core;
}
}

namespace Plugin {
class IEnvironment;
}
}

namespace Migrator3000
{

//---------------------------------------------------------------------------
struct STerminal
{
struct SConnection
{
QString type;
QString name;

// proxy
QString username;
QString password;
QString host;
QString proxy_type;
size_t port;

SConnection() : port(0) {}

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

struct SPort
{
size_t baud_rate;
QString number;
size_t parity;
QString type;
QString uuid;

SPort() : baud_rate(0), parity(0) {}
};

struct SDevice
{
QString type;
QString model;
QString vendor;

size_t fiscal_mode;

QString uuid;

SPort port;

SDevice() : fiscal_mode(0) {}
};

bool isEmpty() { return connection.isEmpty(); }

typedef std::vector<SDevice> TDevices;
TDevices devices;
SConnection connection;
SDK::PaymentProcessor::SConnection connection2;
};

//---------------------------------------------------------------------------
class MainScenario : public GUI::Scenario
{
Q_OBJECT

public:
MainScenario(SDK::PaymentProcessor::ICore * aCore, ILog * aLog);
virtual ~MainScenario();

public:
/// Запуск сценария.
virtual void start(const QVariantMap & aContext);

/// Остановка сценария.
virtual void stop();

/// Приостановить сценарий с возможностью последующего возобновления.
virtual void pause();

/// Продолжение после паузы.
virtual void resume(const QVariantMap & aContext);

/// Инициализация сценария.
virtual bool initialize(const QList<GUI::SScriptObject> & aScriptObjects);

/// Обработка сигнала из активного состояния с дополнительными аргументами.
virtual void signalTriggered(const QString & aSignal, const QVariantMap & aArguments = QVariantMap());

/// Обработчик таймаута
virtual void onTimeout();

/// Возвращает false, если сценарий не может быть остановлен в текущий момент.
virtual bool canStop();

public slots:
/// Текущее состояние.
virtual QString getState() const;

private slots:
void onTaskFinished();

private slots:
/// Посылается, когда обнаружено очередное устройство.
void onDeviceDetected(const QString & aConfigName);

/// Посылается когда процесс обнаружения устройств останавливается.
void onDetectionStopped();

void finishDeviceDetection();

private:

private:
QVariantMap mContext;
QString mLastSignal;
SDK::PaymentProcessor::ICore * mCore;
SDK::PaymentProcessor::ISettingsService * mSettingsService;
SDK::PaymentProcessor::INetworkService * mNetworkService;
SDK::PaymentProcessor::ITerminalService * mTerminalService;
SDK::PaymentProcessor::TerminalSettings * mTerminalSettings;
SDK::PaymentProcessor::ICryptService * mCryptService;
SDK::PaymentProcessor::Scripting::Core * mScriptingCore;
SDK::PaymentProcessor::IDeviceService * mDeviceService;

QFutureWatcher<bool> mTaskWatcher;

QStringList mFoundedDevices;
int mMonitoringComandId;

//
QString mKiosk2InstallPath;
};

}

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


+ 14
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/src/PluginFactoryDefinition.cpp View File

@@ -0,0 +1,14 @@
/* @file Конфигурация фабрики. */

// Plugin SDK
#include <SDK/Plugins/PluginFactory.h>

//------------------------------------------------------------------------------
QString SDK::Plugin::PluginFactory::mName = "Migrator 3000";
QString SDK::Plugin::PluginFactory::mDescription = "Native scenario for automatic migration from 2.x.x to 3.x.x version";
QString SDK::Plugin::PluginFactory::mAuthor = "Cyberplat";
QString SDK::Plugin::PluginFactory::mVersion = "1.0";
QString SDK::Plugin::PluginFactory::mModuleName = "migrator3000";


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

+ 13
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/src/PluginLibraryDefinition.h View File

@@ -0,0 +1,13 @@
/* @file Êîíôèãóðàöèÿ ôàáðèêè ïëàãèíîâ. */

// Plugin SDK
#include <SDK/Plugins/PluginFactory.h>

class Migrator3000PluginFactory : public SDK::Plugin::PluginFactory
{
Q_OBJECT
Q_INTERFACES(SDK::Plugin::IPluginFactory)
Q_PLUGIN_METADATA(IID "com.cyberplat.migrator3000")
};

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

+ 96
- 0
3.0/src/plugins/NativeScenarios/Migrator3000/src/ScenarioPlugin.h View File

@@ -0,0 +1,96 @@
#pragma once

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QMap>
#include <QtCore/QSharedPointer>
#include <QtCore/QFutureWatcher>
#include <QtCore/QReadWriteLock>
#include <Common/QtHeadersEnd.h>

// Modules
#include <ScenarioEngine/Scenario.h>

// Plugin SDK
#include <SDK/Plugins/IFactory.h>

#include "MainScenario.h"

class IApplication;

//--------------------------------------------------------------------------
namespace SDK {
namespace PaymentProcessor {
class ICore;
class IPaymentService;
class IPrinterService;
class IHIDService;
class ISettingsService;
}

namespace Plugin {
class IEnvironment;
}
}

namespace PPSDK = SDK::PaymentProcessor;

namespace CScenarioPlugin
{
const QString PluginName = "Migrator3000";
}

namespace Migrator3000
{

//--------------------------------------------------------------------------
class MainScenarioPlugin : public SDK::Plugin::IFactory < GUI::Scenario >
{
public:
MainScenarioPlugin(SDK::Plugin::IEnvironment * aFactory, const QString & aInstancePath) : mEnvironment(aFactory), mInstancePath(aInstancePath) {}

public:
/// Возвращает название плагина.
virtual QString getPluginName() const { return CScenarioPlugin::PluginName; }

/// Возвращает параметры плагина.
virtual QVariantMap getConfiguration() const
{
QVariantMap parameters;
parameters["url"] = mUrl;
return parameters;
}

/// Настраивает плагин.
virtual void setConfiguration(const QVariantMap & aParameters)
{
QString url = aParameters["url"].toString();
mUrl = url.isEmpty() ? mUrl : url;
}

/// Возвращает имя файла конфигурации без расширения (ключ + идентификатор).
virtual QString getConfigurationName() const { return mInstancePath; }

/// Сохраняет конфигурацию плагина в постоянное хранилище (.ini файл или хранилище прикладной программы).
virtual bool saveConfiguration() { return mEnvironment->saveConfiguration(CScenarioPlugin::PluginName, getConfiguration()); }

/// Проверяет успешно ли инициализировался плагин при создании.
virtual bool isReady() const { return true; }

/// Возвращает список имен классов, которые создает фабрика.
virtual QStringList getClassNames() const { return QStringList(CScenarioPlugin::PluginName); }

/// Создает класс c заданным именем.
virtual GUI::Scenario * create(const QString & aClassName) const
{
PPSDK::ICore * core = dynamic_cast<SDK::PaymentProcessor::ICore *>(mEnvironment->getInterface(SDK::PaymentProcessor::CInterfaces::ICore));
return new MainScenario(core, mEnvironment->getLog(aClassName));
}

private:
QString mUrl;
QString mInstancePath;
SDK::Plugin::IEnvironment * mEnvironment;
};

}

+ 42
- 0
3.0/src/plugins/ScenarioBackends/UCS/UCS.qbs View File

@@ -0,0 +1,42 @@
import qbs 1.0
import "../../pluginTemplate.qbs" as PluginTemplate

Project {

PluginTemplate {
name: "ucs"

Depends { name: "Qt"; submodules: ["network"] }

Depends { name: "SysUtils" }
Depends { name: "Log" }
Depends { name: "NetworkTaskManager" }
Depends { name: "ScenarioEngine" }
Depends { name: "PaymentBase" }

Depends { name: "UCSTranslations" }

files: [
"../../../includes/Common/CoreVersion.rc",
"src/*.h",
"src/*.cpp",
"src/*.qrc",
]
}

Product {
name: "UCSTranslations"
type: "qm"

Depends { name: "Qt.core" }

files: "src/Locale/*.ts"

Group {
fileTagsFilter: product.type
qbs.install: true
qbs.installDir: "locale"
}
}
}

+ 4
- 0
3.0/src/plugins/ScenarioBackends/UCS/msvc/CompileLocale.bat View File

@@ -0,0 +1,4 @@
call %QTDIR%\bin\qtvars.bat

lupdate "..\src" -ts "..\src\Locale\ucs_ru.ts"
lrelease "..\src\Locale\ucs_ru.ts" -qm "%~1\%~2_ru.qm"

+ 370
- 0
3.0/src/plugins/ScenarioBackends/UCS/msvc/Ucs.vcxproj View File

@@ -0,0 +1,370 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseWithDebugInfo|Win32">
<Configuration>ReleaseWithDebugInfo</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\API.cpp" />
<ClCompile Include="..\src\APIErrors.cpp" />
<ClCompile Include="..\src\DatabaseUtils.cpp" />
<ClCompile Include="..\src\Plugin.cpp" />
<ClCompile Include="..\src\PluginFactoryDefinition.cpp" />
<ClCompile Include="..\src\Responses.cpp" />
<ClCompile Include="..\src\UcsBackend.cpp" />
<ClCompile Include="..\src\UcsChargeProvider.cpp" />
<ClCompile Include="..\src\UcsDevice.cpp" />
<ClCompile Include="..\src\UscEncashTask.cpp" />
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_API.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_UcsChargeProvider.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_UcsDevice.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_UscEncashTask.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_API.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_UcsChargeProvider.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_UcsDevice.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_UscEncashTask.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_API.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_UcsChargeProvider.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_UcsDevice.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_UscEncashTask.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\Responses.h">
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</AdditionalInputs>
</CustomBuild>
<CustomBuild Include="..\src\SingleDetectingIterator.h">
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</AdditionalInputs>
</CustomBuild>
<CustomBuild Include="..\src\Ucs.h">
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</AdditionalInputs>
</CustomBuild>
<CustomBuild Include="..\src\Utils.h">
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Performing Custom Build Tools</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</AdditionalInputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\UcsDevice.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Moc%27ing UcsDevice.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing UcsDevice.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing UcsDevice.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\API.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Moc%27ing API.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing API.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing API.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\UcsChargeProvider.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Moc%27ing UcsChargeProvider.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing UcsChargeProvider.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing UcsChargeProvider.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\DatabaseUtils.h" />
<ClInclude Include="..\src\UcsBackend.h" />
<CustomBuild Include="..\src\UscEncashTask.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">Moc%27ing UscEncashTask.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing UscEncashTask.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing UscEncashTask.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)\moc_%(Filename).cpp" -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DTESTPLUGIN_LIB -DQT_NETWORK_LIB -D_WINDLL "-I$(QTDIR)\include" "-I$(TC_INCLUDE_DIR)\." "-I$(ProjectDir)\..\thirdparty\include" "-I.\GeneratedFiles\$(ProjectName)\$(Configuration)\." "-I.\GeneratedFiles\$(ProjectName)\." "-I." "-I$(THIRDPARTY_DIR)\." "-I$(THIRDPARTY_DIR)\boost"</Command>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<None Include="..\src\Locale\ucs_ru.ts" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>ucs</ProjectName>
<ProjectGuid>{19B57FAA-6ECD-4B61-8406-3FB0B20F61C7}</ProjectGuid>
<RootNamespace>UADispenser</RootNamespace>
<Keyword>Qt4VSv1.0</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TC_BIN)\plugins\$(ProjectName)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(TC_BIN)\plugins\$(ProjectName)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)\obj\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">$(ProjectDir)\obj\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TC_BIN)\plugins\$(ProjectName)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)\obj\$(Configuration)\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)d</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(TC_INCLUDE_DIR);$(ProjectDir)\..\thirdparty\include;.\GeneratedFiles\$(ProjectName)\$(Configuration);.\GeneratedFiles\$(ProjectName);.\;$(THIRDPARTY_DIR);$(THIRDPARTY_DIR)\boost;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;TESTPLUGIN_LIB;QT_NETWORK_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<DisableSpecificWarnings>4290</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>QtCore4.lib;QtNetwork4.lib;QtXml4.lib;Log.lib;PluginSDK.lib;NetworkTaskManager.lib;PaymentProcessorSDK.lib;ScenarioEngine.lib;PaymentBase.lib;SysUtils.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(TargetPath)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(TC_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>true</MapExports>
</Link>
<PostBuildEvent>
<Command>call "$(ProjectDir)\CompileLocale.bat" "$(OutDir)" "$(TargetName)"</Command>
<Message>Performing locale compiling</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(TC_INCLUDE_DIR);$(ProjectDir)\..\thirdparty\include;.\GeneratedFiles\$(ProjectName)\$(Configuration);.\GeneratedFiles\$(ProjectName);.\;$(THIRDPARTY_DIR);$(THIRDPARTY_DIR)\boost;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;TESTPLUGIN_LIB;QT_NETWORK_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4290</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>QtCore4.lib;QtNetwork4.lib;QtXml4.lib;Log.lib;PluginSDK.lib;NetworkTaskManager.lib;PaymentProcessorSDK.lib;ScenarioEngine.lib;PaymentBase.lib;SysUtils.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(TargetPath)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(TC_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<PostBuildEvent>
<Command>call "$(ProjectDir)\CompileLocale.bat" "$(OutDir)" "$(TargetName)"</Command>
<Message>Performing locale compiling</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(TC_INCLUDE_DIR);$(ProjectDir)\..\thirdparty\include;.\GeneratedFiles\$(ProjectName)\$(Configuration);.\GeneratedFiles\$(ProjectName);.\;$(THIRDPARTY_DIR);$(THIRDPARTY_DIR)\boost;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_CORE_LIB;TESTPLUGIN_LIB;QT_NETWORK_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4290</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>QtCored4.lib;QtXmld4.lib;QtNetworkd4.lib;Logd.lib;PluginSDKd.lib;NetworkTaskManagerd.lib;PaymentProcessorSDKd.lib;ScenarioEngined.lib;PaymentBased.lib;SysUtilsd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(TargetPath)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(TC_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>true</MapExports>
</Link>
<PostBuildEvent>
<Command>call "$(ProjectDir)\CompileLocale.bat" "$(OutDir)" "$(TargetName)"</Command>
<Message>Performing locale compiling</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties MocDir=".\GeneratedFiles\$(ProjectName)\$(ConfigurationName)" UicDir=".\GeneratedFiles\$(ProjectName)" RccDir=".\GeneratedFiles\$(ProjectName)" lupdateOnBuild="1" Qt5Version_x0020_Win32="4.8.7" MocOptions="" QtVersion_x0020_Win32="$(DefaultQtVersion)" />
</VisualStudio>
</ProjectExtensions>
</Project>

+ 156
- 0
3.0/src/plugins/ScenarioBackends/UCS/msvc/Ucs.vcxproj.filters View File

@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;cxx;c;def</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>moc;h;cpp</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Translation Files">
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
<Extensions>ts</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Source Files\API">
<UniqueIdentifier>{8079c72e-4bee-4c42-8798-512e19102b05}</UniqueIdentifier>
</Filter>
<Filter Include="ChargeProvider">
<UniqueIdentifier>{6ceed7df-6311-489b-a60a-7e5842cabc1e}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Device">
<UniqueIdentifier>{74180c1e-0536-49ef-b889-5a659103c277}</UniqueIdentifier>
</Filter>
<Filter Include="BackendPlugin">
<UniqueIdentifier>{c3b84f5c-9440-4d5d-8106-7b030b5b252d}</UniqueIdentifier>
</Filter>
<Filter Include="Generated Files\ReleaseWithDebugInfo">
<UniqueIdentifier>{2a48621f-9fd0-4cb3-a6e1-39fc3f9516bb}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Generated Files\Debug">
<UniqueIdentifier>{dd2dda28-d202-4be5-8ac9-11c31b249338}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Generated Files\Release">
<UniqueIdentifier>{2ae99c8f-0358-4149-935c-f22532acc3df}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Source Files\Task">
<UniqueIdentifier>{7f353766-64be-4926-b18c-08bd32f090b2}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\PluginFactoryDefinition.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\API.cpp">
<Filter>Source Files\API</Filter>
</ClCompile>
<ClCompile Include="..\src\UcsChargeProvider.cpp">
<Filter>ChargeProvider</Filter>
</ClCompile>
<ClCompile Include="..\src\Responses.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\UcsDevice.cpp">
<Filter>Source Files\Device</Filter>
</ClCompile>
<ClCompile Include="..\src\Plugin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_UcsDevice.cpp">
<Filter>Generated Files\ReleaseWithDebugInfo</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_UcsDevice.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_UcsDevice.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_API.cpp">
<Filter>Generated Files\ReleaseWithDebugInfo</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_API.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_API.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_UcsChargeProvider.cpp">
<Filter>Generated Files\ReleaseWithDebugInfo</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_UcsChargeProvider.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_UcsChargeProvider.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="..\src\APIErrors.cpp">
<Filter>Source Files\API</Filter>
</ClCompile>
<ClCompile Include="..\src\UcsBackend.cpp">
<Filter>BackendPlugin</Filter>
</ClCompile>
<ClCompile Include="..\src\DatabaseUtils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\ReleaseWithDebugInfo\moc_UscEncashTask.cpp">
<Filter>Generated Files\ReleaseWithDebugInfo</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Debug\moc_UscEncashTask.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\$(ProjectName)\Release\moc_UscEncashTask.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="..\src\UscEncashTask.cpp">
<Filter>Source Files\Task</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\Responses.h">
<Filter>Source Files</Filter>
</CustomBuild>
<CustomBuild Include="..\src\SingleDetectingIterator.h">
<Filter>Source Files</Filter>
</CustomBuild>
<CustomBuild Include="..\src\Ucs.h">
<Filter>Source Files</Filter>
</CustomBuild>
<CustomBuild Include="..\src\Utils.h">
<Filter>Source Files</Filter>
</CustomBuild>
<CustomBuild Include="..\src\UcsDevice.h">
<Filter>Source Files\Device</Filter>
</CustomBuild>
<CustomBuild Include="..\src\API.h">
<Filter>Source Files\API</Filter>
</CustomBuild>
<CustomBuild Include="..\src\UcsChargeProvider.h">
<Filter>ChargeProvider</Filter>
</CustomBuild>
<CustomBuild Include="..\src\UscEncashTask.h">
<Filter>Source Files\Task</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\UcsBackend.h">
<Filter>BackendPlugin</Filter>
</ClInclude>
<ClInclude Include="..\src\DatabaseUtils.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\src\Locale\ucs_ru.ts">
<Filter>Translation Files</Filter>
</None>
</ItemGroup>
</Project>

+ 943
- 0
3.0/src/plugins/ScenarioBackends/UCS/src/API.cpp View File

@@ -0,0 +1,943 @@
/* Реализация протокола с EFTPOS 3.0 компании Ucs. */

#pragma once

#include <numeric>

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QTimer>
#include <QtCore/QTimerEvent>
#include <QtCore/QLibrary>
#include <QtConcurrent/QtConcurrentRun>
#include <Common/QtHeadersEnd.h>

// SDK
#include <SDK/PaymentProcessor/Core/ISettingsService.h>
#include <SDK/PaymentProcessor/Core/IGUIService.h>
#include <SDK/PaymentProcessor/Core/ISchedulerService.h>
#include "SDK/PaymentProcessor/Settings/ISettingsAdapter.h"
#include <SDK/PaymentProcessor/Core/IPrinterService.h>
#include <SDK/PaymentProcessor/Scripting/Core.h>
#include <SDK/PaymentProcessor/Scripting/PrinterService.h>
#include <SDK/GUI/IGraphicsHost.h>


// Project headers
#include "Ucs.h"
#include "API.h"
#include "Responses.h"
#include "Utils.h"
#include "UscEncashTask.h"

#pragma comment(lib, "psapi.lib")

namespace CUcs
{
const char * DefaultTerminalID = "0000000000";
const int ReconnectTimeout = 5000;
const int PollTimeout = 30 * 60 * 1000; // Проверяем раз в 30 мин.
const int LoginTimeout = 60 * 60 * 1000; // Проверяем раз в 1 час.
const int ExecuteEncashmentTimeout = 100;

const char * LibraryName = "ucs_ms";

const int USE_STATUS = 0; // Запрещаем выполнение запроса статуса, т.к. для новых прошивок POS она кривая.
const int ReceiveBufferSize = 320;
}

namespace Ucs
{

//---------------------------------------------------------------------------
API::API(SDK::PaymentProcessor::ICore * aCore, ILog * aLog) :
ILogable(aLog),
mCore(aCore),
mTerminalSettings(static_cast<PPSDK::TerminalSettings *>(aCore->getSettingsService()->getAdapter(PPSDK::CAdapterNames::TerminalAdapter))),
mTerminalID(CUcs::DefaultTerminalID),
mLastLineReceived(false),
mTimerEncashID(0),
mRuntimeInit(false),
mPySelf(nullptr),
mEftpCreate(nullptr),
mEftpDestroy(nullptr),
mEftpDo(nullptr),
mTerminalState(APIState::None),
mMaxAmount(0.0),
mNeedEncashment(false),
mNeedPrintAllEncashmentReports(false),
mDatabase(mCore->getDatabaseService(), ILog::getInstance(Ucs::LogName))
{
toLog(LogLevel::Normal, QString("UCS API created."));
connect(&mResponseWatcher, SIGNAL(finished()), this, SLOT(onResponseFinished()));

killOldUCSProcess();

//Заводим задачу в планировщике на ежесуточную инкассацию
mEncashmentTask = new UscEncashTask(Ucs::EncashmentTask, getLog()->getName(), QString());
connect(mEncashmentTask, SIGNAL(finished(const QString &, bool)), this, SLOT(onEncashTaskFinished(const QString &, bool)));
mCore->getSchedulerService()->registerTaskType(Ucs::EncashmentTask, mEncashmentTask);
}

//---------------------------------------------------------------------------
QSharedPointer<API> API::getInstance(SDK::PaymentProcessor::ICore * aCore, ILog * aLog)
{
static QSharedPointer<API> gApi = QSharedPointer<API>(new API(aCore, aLog));

return gApi;
}

//---------------------------------------------------------------------------
bool API::setupRuntime(const QString & aRuntimePath)
{
if (mRuntimeInit)
{
return true;
}

QString libPath = QString("%1/%2").arg(aRuntimePath).arg(CUcs::LibraryName);
QLibrary lib(libPath);
if (!lib.load())
{
toLog(LogLevel::Error, QString("Could not load library %1").arg(libPath));
return false;
}
mEftpCreate = (EftpCreate)lib.resolve("eftp_create");
if (!mEftpCreate)
{
toLog(LogLevel::Error, QString("Could not load resolve function 'eftp_create'"));
return false;
}

mEftpDestroy = (EftpDestroy)lib.resolve("eftp_destroy");
if (!mEftpDestroy)
{
toLog(LogLevel::Error, QString("Could not load resolve function 'eftp_destroy'"));
return false;
}
mEftpDo = (EftpDo)lib.resolve("eftp_do");
if (!mEftpDo)
{
toLog(LogLevel::Error, QString("Could not load resolve function 'eftp_do'"));
return false;
}

mRuntimeInit = true;

mTimerEncashID = startTimer(CUcs::PollTimeout);

// первый раз статус дергаем сразу после запуска
QTimer::singleShot(CUcs::ReconnectTimeout, this, SLOT(status()));

connect(mCore->getPrinterService(), SIGNAL(receiptPrinted(int, bool)), this, SLOT(onReceiptPrinted(int, bool)));

return true;
}

//---------------------------------------------------------------------------
bool API::isReady() const
{
return mRuntimeInit;
}

//---------------------------------------------------------------------------
bool API::enable(PPSDK::TPaymentAmount aAmount)
{
if (mTerminalState != APIState::None)
{
toLog(LogLevel::Error, QString("API is busy (state=%1). Could not enable charge provider.").arg(mTerminalState));

return false;
}

mTerminalState = APIState::Sale;

mMaxAmount = aAmount;
mCurrentReceipt.clear();

eftpCleanup();

return true;
}

//---------------------------------------------------------------------------
void API::disable()
{
mTerminalState = APIState::None;
mLoggedIn = QDateTime();

mCurrentReceipt.clear();

eftpCleanup();

if (mNeedEncashment && mNeedPrintAllEncashmentReports)
{
encashment(false);
}
}

//---------------------------------------------------------------------------
void API::eftpCleanup()
{
if (mPySelf)
{
mEftpDestroy(mPySelf);
mPySelf = nullptr;

toLog(LogLevel::Debug, "EFTP Object destroyed.");
}
}

//---------------------------------------------------------------------------
void API::onResponseFinished()
{
TResponse result = mResponseWatcher.result();

QByteArray responseBuffer = result.response;

QList<std::function<bool(API &, BaseResponsePtr)>> responseHandlers;
responseHandlers
<< std::mem_fun_ref(&API::isErrorResponse)
<< std::mem_fun_ref(&API::isConsoleResponse)
<< std::mem_fun_ref(&API::isLoginResponse)
<< std::mem_fun_ref(&API::isEnchashmentResponse)
<< std::mem_fun_ref(&API::isInitialResponse)
<< std::mem_fun_ref(&API::isPINRequiredResponse)
<< std::mem_fun_ref(&API::isOnlineRequiredResponse)
<< std::mem_fun_ref(&API::isAuthResponse)
<< std::mem_fun_ref(&API::isPrintLineResponse)
<< std::mem_fun_ref(&API::isBreakResponse)
<< std::mem_fun_ref(&API::isHoldResponse)
<< std::mem_fun_ref(&API::isMessageResponse);

while (!responseBuffer.isEmpty())
{
// Нам сюда могут прилететь пачкой несколько ответов POS терминала, разбираем их по одному.
QByteArray nextAnswer = responseBuffer.left(CUcs::ReceiveBufferSize);
responseBuffer.remove(0, CUcs::ReceiveBufferSize);

BaseResponsePtr response = BaseResponse::createResponse(nextAnswer);

if (!response)
{
toLog(LogLevel::Debug, QString("BaseResponsePtr corrupted."));
continue;;
}

// Переносим статус API из полученного сырого буфера в обработанный результат
response->mAPIState = result.state;

toLog(LogLevel::Debug, QString("BASE RESPONSE packet from EFTPOS. Class='%1' Code='%2'")
.arg(response->mClass)
.arg(response->mCode));

if (!response->isValid())
{
toLog(LogLevel::Error, QString("Receive unknown packet from EFTPOS. Class='%1' Code='%2'")
.arg(response->mClass)
.arg(response->mCode));

toLog(LogLevel::Error, QString("Raw response: %1").arg(QString::fromLatin1(responseBuffer.toHex())));
}
else
{
foreach (auto handler, responseHandlers)
{
if (handler(*this, response))
{
emit doComplete(false);
break;
}
}
}
}
}

//---------------------------------------------------------------------------
void API::onReceiptPrinted(int aJobIndex, bool aError)
{
if (mEncashmentInPrint.contains(aJobIndex))
{
auto encashment = mEncashmentInPrint.value(aJobIndex);

if (!aError)
{
toLog(LogLevel::Normal, QString("Encashment [%1] printed.").arg(encashment.date.toString("yyyy.MM.dd hh:mm:ss")));

mDatabase.markAsPrinted(encashment);
}
else
{
toLog(LogLevel::Error, QString("Encashment [%1] print FAILED.").arg(encashment.date.toString("yyyy.MM.dd hh:mm:ss")));
}

mEncashmentInPrint.remove(aJobIndex);
}
}

//---------------------------------------------------------------------------
void API::login()
{
if (!isLoggedInExpired())
{
emit ready();
return;
}
mLoggedIn = QDateTime();
mTerminalState = APIState::Login;

toLog(LogLevel::Normal, QString("> Login."));

QByteArray buffer;
buffer.append(mTerminalID);
buffer.append("01"); // Length
buffer.append("1"); // Info Code
mResponseWatcher.setFuture(QtConcurrent::run(
this, &API::send, makeRequest(Ucs::Class::Session, Ucs::Login::CodeRequest, buffer), true));
}

//---------------------------------------------------------------------------
void API::encashment(bool aOnDemand)
{
doEncashment(aOnDemand, false);
}

//---------------------------------------------------------------------------
void API::doEncashment(bool aOnDemand, bool aSkipPrintReceipt)
{
if (!mNeedEncashment && aOnDemand)
{
emit encashmentComplete();
return;
}

if (!aOnDemand)
{
toLog(LogLevel::Normal, "Start manual encashment.");

mNeedEncashment = true;
mNeedPrintAllEncashmentReports = !aSkipPrintReceipt;
}

if (mTerminalState != APIState::None && mTerminalState != APIState::Encashment)
{
toLog(LogLevel::Normal, "Wait for starting manual encashment...");
return;
}

mTerminalState = APIState::Encashment;
toLog(LogLevel::Normal, QString("> Encashment."));

QByteArray buffer;
buffer.append(mTerminalID);
buffer.append("00"); // Length

mResponseWatcher.setFuture(QtConcurrent::run(
this, &API::send, makeRequest(Ucs::Class::Service, Ucs::Encashment::CodeRequest, buffer), true));
}

//---------------------------------------------------------------------------
void API::sale(double aAmount)
{
mTerminalState = APIState::Sale;

toLog(LogLevel::Normal, QString("> Sale."));

QByteArray buffer;