mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
before task parser
This commit is contained in:
95
ServerLMS/ServerLMS/CMakeLists.txt
Normal file
95
ServerLMS/ServerLMS/CMakeLists.txt
Normal file
@@ -0,0 +1,95 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(ServerLMS LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(PROJECT_TYPE_DEBUG TRUE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_definitions(-DPROJECT_TYPE_DEBUG)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Network REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Sql REQUIRED)
|
||||
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Concurrent )
|
||||
|
||||
#set(TS_FILES ServerLMS_ru_RU.ts)
|
||||
|
||||
add_library(ServerLMS SHARED
|
||||
ServerLMS_global.h
|
||||
serverlmswidget.cpp
|
||||
serverlmswidget.h
|
||||
serverlmswidget.ui
|
||||
messangerwidget.cpp
|
||||
messangerwidget.h
|
||||
messangerwidget.ui
|
||||
typesDataServerClient.h
|
||||
Client.h
|
||||
clienthandler.cpp
|
||||
clienthandler.h
|
||||
multithreadserver.cpp
|
||||
multithreadserver.h
|
||||
Systems/recognizesystem.cpp
|
||||
Systems/recognizesystem.h
|
||||
Systems/updatecontroller.cpp
|
||||
Systems/updatecontroller.h
|
||||
Systems/logger.cpp
|
||||
Systems/logger.h
|
||||
Systems/dataparser.cpp
|
||||
Systems/dataparser.h
|
||||
Systems/processingsystem.cpp
|
||||
Systems/processingsystem.h
|
||||
Systems/sendsystem.cpp
|
||||
Systems/sendsystem.h
|
||||
Systems/tools.cpp
|
||||
Systems/tools.h
|
||||
resources.qrc
|
||||
#${TS_FILES}
|
||||
)
|
||||
|
||||
target_link_libraries(ServerLMS PRIVATE Qt5::Widgets)
|
||||
target_link_libraries(ServerLMS PRIVATE Qt5::Network)
|
||||
target_link_libraries(ServerLMS PRIVATE Qt5::Concurrent)
|
||||
target_link_libraries(ServerLMS PRIVATE Qt5::Sql)
|
||||
|
||||
#target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../SUO/InstructorsAndTrainees)
|
||||
#target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../SUO/InstructorsAndTrainees/instructors)
|
||||
#target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../SUO/InstructorsAndTrainees/trainees)
|
||||
#target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../SUO/InstructorsAndTrainees/tasks)
|
||||
#target_link_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../SUO/Debug64)
|
||||
#target_link_libraries(ServerLMS PRIVATE libInstructorsAndTrainees.dll)
|
||||
|
||||
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_IaT/InstructorsAndTrainees)
|
||||
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_IaT/InstructorsAndTrainees/instructors)
|
||||
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_IaT/InstructorsAndTrainees/trainees)
|
||||
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_IaT/InstructorsAndTrainees/tasks)
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
target_link_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_IaT/Debug64)
|
||||
elseif()
|
||||
target_link_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_IaT/Release64)
|
||||
endif()
|
||||
target_link_libraries(ServerLMS PRIVATE libInstructorsAndTrainees.dll)
|
||||
|
||||
|
||||
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_LMS/DataBaseLMS)
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
target_link_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_LMS/Debug64)
|
||||
elseif()
|
||||
target_link_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_LMS/Release64)
|
||||
endif()
|
||||
target_link_libraries(ServerLMS PRIVATE libDataBaseLMS.dll)
|
||||
|
||||
|
||||
target_compile_definitions(ServerLMS PRIVATE SERVERLMS_LIBRARY)
|
||||
|
||||
#qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
||||
348
ServerLMS/ServerLMS/CMakeLists.txt.user
Normal file
348
ServerLMS/ServerLMS/CMakeLists.txt.user
Normal file
@@ -0,0 +1,348 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.11.1, 2024-11-25T15:15:00. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{00ce76f6-77cf-4587-a216-9a8e243377cb}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
|
||||
<value type="QString">-fno-delayed-template-parsing</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win64_mingw73_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_INSTALL_PREFIX:PATH=/MyServerLMS</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/LMS/ServerLMS/Debug64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/LMS/ServerLMS/Release64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/MyServer/build-ServerLMS-Desktop_Qt_5_14_2_MinGW_64_bit-RelWithDebInfo</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск с отладочной информацией</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/MyServer/build-ServerLMS-Desktop_Qt_5_14_2_MinGW_64_bit-MinSizeRel</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск минимального размера</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
|
||||
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
348
ServerLMS/ServerLMS/CMakeLists.txt.user.00ce76f
Normal file
348
ServerLMS/ServerLMS/CMakeLists.txt.user.00ce76f
Normal file
@@ -0,0 +1,348 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.11.1, 2024-08-16T16:09:12. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{00ce76f6-77cf-4587-a216-9a8e243377cb}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
|
||||
<value type="QString">-fno-delayed-template-parsing</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win64_mingw73_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_INSTALL_PREFIX:PATH=/MyServerLMS</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/MyServer/Debug64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/MyServer/Release64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/MyServer/build-ServerLMS-Desktop_Qt_5_14_2_MinGW_64_bit-RelWithDebInfo</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск с отладочной информацией</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/MyServer/build-ServerLMS-Desktop_Qt_5_14_2_MinGW_64_bit-MinSizeRel</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск минимального размера</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
|
||||
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
347
ServerLMS/ServerLMS/CMakeLists.txt.user.02bbda2
Normal file
347
ServerLMS/ServerLMS/CMakeLists.txt.user.02bbda2
Normal file
@@ -0,0 +1,347 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.11.1, 2024-10-04T17:32:05. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{02bbda2a-ba75-44de-8881-59c42e3619cd}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
|
||||
<value type="QString">-fno-delayed-template-parsing</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win64_mingw73_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/Projects/QT/ALL/MyServer/Debug64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/Projects/QT/ALL/MyServer/build-ServerLMS-Desktop_Qt_5_14_2_MinGW_64_bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/Projects/QT/ALL/MyServer/build-ServerLMS-Desktop_Qt_5_14_2_MinGW_64_bit-RelWithDebInfo</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск с отладочной информацией</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/Projects/QT/ALL/MyServer/build-ServerLMS-Desktop_Qt_5_14_2_MinGW_64_bit-MinSizeRel</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск минимального размера</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
|
||||
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
82
ServerLMS/ServerLMS/Client.h
Normal file
82
ServerLMS/ServerLMS/Client.h
Normal file
@@ -0,0 +1,82 @@
|
||||
#ifndef CLIENT_H
|
||||
#define CLIENT_H
|
||||
|
||||
#include <QString>
|
||||
#include <QTcpSocket>
|
||||
|
||||
class Client
|
||||
{
|
||||
|
||||
public:
|
||||
Client(QString name, QString address, QString port,QObject *parent = nullptr):
|
||||
login(""),
|
||||
ready(false)
|
||||
{
|
||||
this->name = name;
|
||||
this->address = address;
|
||||
this->port = port;
|
||||
this->fullName = "Name: " + name + " IP: " + address + " port : " + port + " login: " + login;
|
||||
};
|
||||
~Client();
|
||||
|
||||
public:
|
||||
QString getFullName()
|
||||
{
|
||||
return fullName;
|
||||
};
|
||||
|
||||
void setLogin(QString login)
|
||||
{
|
||||
this->login = login;
|
||||
fullName = "Name: " + name + " IP: " + address + " port : " + port + " login: " + login;
|
||||
}
|
||||
QString getLogin()
|
||||
{
|
||||
return login;
|
||||
}
|
||||
|
||||
QString getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
QString getPort()
|
||||
{
|
||||
return port;
|
||||
}
|
||||
|
||||
bool getReady()
|
||||
{
|
||||
return ready;
|
||||
}
|
||||
void setReady(bool ready)
|
||||
{
|
||||
this->ready = ready;
|
||||
}
|
||||
void setUnity(bool flag){
|
||||
isUnity = flag;
|
||||
}
|
||||
bool getIsUnity()
|
||||
{
|
||||
return isUnity;
|
||||
}
|
||||
void changePackageResponse()
|
||||
{
|
||||
isUnity = !isUnity;
|
||||
}
|
||||
bool operator == (Client* right){
|
||||
return this->address == right->address;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
QString name;
|
||||
QString address;
|
||||
QString port;
|
||||
QString fullName;
|
||||
|
||||
QString login;
|
||||
bool ready;
|
||||
bool isUnity = false;
|
||||
};
|
||||
|
||||
#endif // CLIENT_H
|
||||
12
ServerLMS/ServerLMS/ServerLMS_global.h
Normal file
12
ServerLMS/ServerLMS/ServerLMS_global.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef SERVERLMS_GLOBAL_H
|
||||
#define SERVERLMS_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(SERVERLMS_LIBRARY)
|
||||
# define SERVERLMS_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define SERVERLMS_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // SERVERLMS_GLOBAL_H
|
||||
BIN
ServerLMS/ServerLMS/ServerLMS_ru_RU.qm
Normal file
BIN
ServerLMS/ServerLMS/ServerLMS_ru_RU.qm
Normal file
Binary file not shown.
70
ServerLMS/ServerLMS/ServerLMS_ru_RU.ts
Normal file
70
ServerLMS/ServerLMS/ServerLMS_ru_RU.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="ru_RU">
|
||||
<context>
|
||||
<name>MessangerWidget</name>
|
||||
<message>
|
||||
<location filename="messangerwidget.ui" line="20"/>
|
||||
<source>Form</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="messangerwidget.ui" line="28"/>
|
||||
<source>Messenger</source>
|
||||
<translation>Мессенджер</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="messangerwidget.ui" line="40"/>
|
||||
<source>Tab 1</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="messangerwidget.ui" line="45"/>
|
||||
<source>Tab 2</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="messangerwidget.ui" line="66"/>
|
||||
<source>Send</source>
|
||||
<translation>Отправить</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ServerLMSWidget</name>
|
||||
<message>
|
||||
<location filename="serverlmswidget.ui" line="20"/>
|
||||
<source>Form</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="serverlmswidget.ui" line="28"/>
|
||||
<source>Tasks</source>
|
||||
<translation>Задачи</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="serverlmswidget.ui" line="41"/>
|
||||
<source>Set</source>
|
||||
<translation>Назначить</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="serverlmswidget.ui" line="55"/>
|
||||
<source>List of clients</source>
|
||||
<translation>Список клиентов</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="serverlmswidget.ui" line="90"/>
|
||||
<source>Logger</source>
|
||||
<translation>Логгер</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="serverlmswidget.ui" line="157"/>
|
||||
<source>Start</source>
|
||||
<translation>Запустить</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="serverlmswidget.ui" line="185"/>
|
||||
<source>Stop</source>
|
||||
<translation>Остановить</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
317
ServerLMS/ServerLMS/Systems/dataparser.cpp
Normal file
317
ServerLMS/ServerLMS/Systems/dataparser.cpp
Normal file
@@ -0,0 +1,317 @@
|
||||
#include "dataparser.h"
|
||||
|
||||
#include <QFile>
|
||||
|
||||
DataParser::DataParser(ProcessingSystem *processingSystem,QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
this->processingSystem = processingSystem;
|
||||
mutex = new QMutex;
|
||||
|
||||
if (!QDir(staticDataFolderName).exists()){
|
||||
QDir().mkdir(staticDataFolderName);
|
||||
}
|
||||
qDebug() << "ParserThread: " << QThread::currentThreadId();
|
||||
}
|
||||
|
||||
void DataParser::xmlParser(ClientHandler *client, QByteArray array)
|
||||
{
|
||||
QXmlStreamReader xmlReader(array);
|
||||
|
||||
xmlReader.readNext(); // Переходим к первому элементу в файле
|
||||
|
||||
//Крутимся в цикле до тех пор, пока не достигнем конца документа
|
||||
while(!xmlReader.atEnd())
|
||||
{
|
||||
//Проверяем, является ли элемент началом тега
|
||||
if(xmlReader.isStartElement())
|
||||
{
|
||||
//Анализируем теги
|
||||
if(xmlReader.name() == "ClientAutorization")
|
||||
{//Запрос авторизации от клиента
|
||||
|
||||
ClientAutorization clientAutorization;
|
||||
|
||||
/*Перебираем все атрибуты тега*/
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
//addTextToLogger(name + ": " + value);
|
||||
|
||||
if(name == "Login")
|
||||
clientAutorization.Login = value;
|
||||
else if(name == "Password")
|
||||
clientAutorization.Password = value;
|
||||
else if(name == "NumberOfScreen")
|
||||
clientAutorization.NumberOfScreen = value.toInt();
|
||||
}
|
||||
|
||||
processingSystem->processingClientAutorization(client, clientAutorization);
|
||||
}
|
||||
else if(xmlReader.name() == "ClientMessage")
|
||||
{//Сообщение от клиента
|
||||
|
||||
ClientMessage clientMessage;
|
||||
|
||||
/*Перебираем все атрибуты тега*/
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
//addTextToLogger(name + ": " + value);
|
||||
|
||||
if(name == "Text")
|
||||
clientMessage.Text = value;
|
||||
}
|
||||
|
||||
processingSystem->processingClientMessage(client, clientMessage);
|
||||
}
|
||||
else if(xmlReader.name() == "ClientNotify")
|
||||
{//Уведомление от клиента
|
||||
|
||||
ClientNotify clientNotify;
|
||||
|
||||
/*Перебираем все атрибуты тега*/
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Code")
|
||||
clientNotify.Code = value;
|
||||
}
|
||||
|
||||
processingSystem->processingClientNotify(client, clientNotify);
|
||||
}
|
||||
else if(xmlReader.name() == "DataInfo")
|
||||
{
|
||||
dataInfo = new DataInfo;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "path")
|
||||
dataInfo->path= value.toUtf8();
|
||||
|
||||
if(name == "size")
|
||||
dataInfo->size = value.toLong();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
emit sigLogMessage("XmlParser: unrecognized tag");
|
||||
}
|
||||
|
||||
}
|
||||
xmlReader.readNext(); // Переходим к следующему элементу файла
|
||||
}//while(!xmlReader.atEnd())
|
||||
}
|
||||
|
||||
void DataParser::xmlFileDataParse(QByteArray array)
|
||||
{
|
||||
QXmlStreamReader xmlReader(array);
|
||||
datas = new QList<FileData>;
|
||||
xmlReader.readNext(); // Переходим к первому элементу в файле
|
||||
|
||||
//Крутимся в цикле до тех пор, пока не достигнем конца документа
|
||||
while(!xmlReader.atEnd())
|
||||
{
|
||||
//Проверяем, является ли элемент началом тега
|
||||
if(xmlReader.isStartElement())
|
||||
{
|
||||
if(xmlReader.name() == "FileData")
|
||||
{
|
||||
FileData data;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr,xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Path")
|
||||
data.path = value;
|
||||
else if(name == "Hash")
|
||||
data.hash = value;
|
||||
}
|
||||
|
||||
datas->append(data);
|
||||
}
|
||||
}
|
||||
|
||||
xmlReader.readNext();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QByteArray DataParser::xmlAnswer(QList<SXmlAnswerTag> listTag, QString elemUp1, QString elemUp2)
|
||||
{
|
||||
try {
|
||||
|
||||
mutex->lock();
|
||||
/* Открываем файл для Записи*/
|
||||
QFile file(tempFile);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
/* Создаем объект, с помощью которого осуществляется запись в файл */
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true); // Устанавливаем автоформатирование текста
|
||||
|
||||
xmlWriter.writeStartDocument(); // Запускаем запись в документ
|
||||
|
||||
if(elemUp1 != "")
|
||||
xmlWriter.writeStartElement(elemUp1); // Записываем тег
|
||||
|
||||
if(elemUp2 != "")
|
||||
xmlWriter.writeStartElement(elemUp2); // Записываем тег
|
||||
|
||||
//Записываем все элементы
|
||||
foreach(SXmlAnswerTag tag, listTag)
|
||||
{
|
||||
xmlWriter.writeStartElement(tag.elementName); // Записываем тег
|
||||
|
||||
// Записываем атрибуты
|
||||
foreach(SAttribute attr, tag.attr)
|
||||
xmlWriter.writeAttribute(attr.name, attr.value);
|
||||
|
||||
xmlWriter.writeEndElement(); // Закрываем тег
|
||||
}
|
||||
|
||||
if(elemUp1 != "")
|
||||
xmlWriter.writeEndElement(); // Закрываем тег
|
||||
|
||||
if(elemUp1 != "")
|
||||
xmlWriter.writeEndElement(); // Закрываем тег
|
||||
|
||||
/* Завершаем запись в документ*/
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close(); // Закрываем файл
|
||||
|
||||
QByteArray array;
|
||||
|
||||
/* Открываем файл для Чтения*/
|
||||
QFile fileR(tempFile);
|
||||
if (!fileR.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
QString str = "Не удалось открыть файл";
|
||||
qDebug() << "xmlAnswer: " << str;
|
||||
}
|
||||
else
|
||||
{
|
||||
array = fileR.readAll();
|
||||
fileR.close(); // Закрываем файл
|
||||
}
|
||||
mutex->unlock();
|
||||
|
||||
return array;
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
|
||||
{
|
||||
qDebug() << e.what();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_authorization(bool result, QString instructorName,QString clientName, QString accessType)
|
||||
{
|
||||
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Result", result? "true" : "false"};
|
||||
SAttribute attribute2 = {"InstructorName", instructorName};
|
||||
SAttribute attribute3 = {"ClientName", clientName};
|
||||
SAttribute attribute4 = {"AccessType", accessType};
|
||||
QList<SAttribute> listAttr = {attribute1, attribute2, attribute3, attribute4};
|
||||
SXmlAnswerTag tag = {"ServerAuthorization", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_message(QString text)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Text", text};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
SXmlAnswerTag tag = {"ServerMessage", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_task(QString text)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Text", text};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
SXmlAnswerTag tag = {"ServerTask", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_notify(QString code)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Code", code};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
SXmlAnswerTag tag = {"ServerNotify", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_tasks(QStringList listTasks)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
foreach(QString task, listTasks)
|
||||
{
|
||||
QList<SAttribute> listAttr;
|
||||
|
||||
SAttribute attribute1 = {"Head", task};
|
||||
SAttribute attribute2 = {"IsComplete", "false"};
|
||||
listAttr.append(attribute1);
|
||||
listAttr.append(attribute2);
|
||||
|
||||
SXmlAnswerTag tag = {"ServerTask", listAttr};
|
||||
listTag.append(tag);
|
||||
}
|
||||
|
||||
return xmlAnswer(listTag, "TaskArray", "Tasks");
|
||||
}
|
||||
|
||||
DataInfo *DataParser::getCurrentDataInfo()
|
||||
{
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
void DataParser::clearCurrentDataInfo()
|
||||
{
|
||||
delete dataInfo;
|
||||
}
|
||||
|
||||
QList<FileData> *DataParser::getDatas() const
|
||||
{
|
||||
return datas;
|
||||
}
|
||||
|
||||
DataParser::~DataParser()
|
||||
{
|
||||
|
||||
}
|
||||
49
ServerLMS/ServerLMS/Systems/dataparser.h
Normal file
49
ServerLMS/ServerLMS/Systems/dataparser.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef DATAPARSER_H
|
||||
#define DATAPARSER_H
|
||||
|
||||
|
||||
#include "Systems/processingsystem.h"
|
||||
#include "Systems/tools.h"
|
||||
#include "logger.h"
|
||||
#include "serverlmswidget.h"
|
||||
#include "typesDataServerClient.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QDebug>
|
||||
|
||||
class ProcessingSystem;
|
||||
class ClientHandler;
|
||||
|
||||
class DataParser : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
DataParser(ProcessingSystem *processingSystem,QObject* parent = nullptr);
|
||||
void xmlParser(ClientHandler *client, QByteArray array);
|
||||
void xmlFileDataParse(QByteArray array);
|
||||
|
||||
QByteArray xmlAnswer(QList<SXmlAnswerTag> listTag,QString elemUp1 = "", QString elemUp2 = "");
|
||||
QByteArray xmlAnswer_authorization(bool result, QString instructorName, QString clientName, QString accessType);
|
||||
QByteArray xmlAnswer_message(QString text);
|
||||
QByteArray xmlAnswer_task(QString text);
|
||||
QByteArray xmlAnswer_notify(QString code);
|
||||
QByteArray xmlAnswer_tasks(QStringList listTasks);
|
||||
DataInfo *getCurrentDataInfo();
|
||||
void clearCurrentDataInfo();
|
||||
~DataParser();
|
||||
|
||||
QList<FileData> *getDatas() const;
|
||||
|
||||
signals:
|
||||
void sigLogMessage(QString log);
|
||||
|
||||
private:
|
||||
QMutex *mutex;
|
||||
QList<FileData> *datas;
|
||||
ProcessingSystem *processingSystem;
|
||||
DataInfo *dataInfo;
|
||||
};
|
||||
|
||||
#endif // DATAPARSER_H
|
||||
35
ServerLMS/ServerLMS/Systems/logger.cpp
Normal file
35
ServerLMS/ServerLMS/Systems/logger.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "logger.h"
|
||||
|
||||
#include <QThread>
|
||||
|
||||
|
||||
Logger::Logger(QObject *parent):
|
||||
QObject(parent)
|
||||
{
|
||||
//this->listWidget = widget;
|
||||
}
|
||||
|
||||
Logger::~Logger()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Logger::setTypeLog(QString type)
|
||||
{
|
||||
typeLogger = type;
|
||||
}
|
||||
|
||||
void Logger::addTextToLogger(QString msg)
|
||||
{
|
||||
if(typeLogger == "widget")
|
||||
{
|
||||
emit sigSendTextToLogger(msg);
|
||||
}
|
||||
else if (typeLogger == "console")
|
||||
{
|
||||
//qDebug() << msg;
|
||||
}else
|
||||
{
|
||||
emit sigSendTextToLogger(msg);
|
||||
}
|
||||
}
|
||||
25
ServerLMS/ServerLMS/Systems/logger.h
Normal file
25
ServerLMS/ServerLMS/Systems/logger.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef LOGGER_H
|
||||
#define LOGGER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class Logger : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Logger(QObject *parent = nullptr);
|
||||
~Logger();
|
||||
void setTypeLog(QString type);
|
||||
public slots:
|
||||
void addTextToLogger(QString msg);
|
||||
|
||||
signals:
|
||||
void sigSendTextToLogger(QString msg);
|
||||
|
||||
private:
|
||||
//ServerLMSWidget *listWidget;
|
||||
QString typeLogger;
|
||||
};
|
||||
|
||||
#endif // LOGGER_H
|
||||
114
ServerLMS/ServerLMS/Systems/processingsystem.cpp
Normal file
114
ServerLMS/ServerLMS/Systems/processingsystem.cpp
Normal file
@@ -0,0 +1,114 @@
|
||||
#include "processingsystem.h"
|
||||
|
||||
#include <clienthandler.h>
|
||||
|
||||
ProcessingSystem::ProcessingSystem(QObject *parent):
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ProcessingSystem::initialize(DataParser *dataParser, ServerLMSWidget *server,InstructorsAndTraineesWidget *instructorsAndTrainees)
|
||||
{
|
||||
this->server = server;
|
||||
this->dataParser = dataParser;
|
||||
this->pInstructorsAndTrainees = instructorsAndTrainees;
|
||||
}
|
||||
|
||||
void ProcessingSystem::processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization)
|
||||
{
|
||||
if(server->getStateBlockAutorization() == blocked)
|
||||
{
|
||||
QByteArray arrayAnswer = dataParser->xmlAnswer_notify(NOTIFY_SERVER_BLOCKED);
|
||||
client->sendXmlAnswer(arrayAnswer);
|
||||
|
||||
QString str = QString(arrayAnswer);
|
||||
emit sigLogMessage("To Client: " + str);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Попытка авторизации клиента (проверка по БД)
|
||||
QString instructorName;
|
||||
QString traineeName;
|
||||
QByteArray arrayAnswer;
|
||||
|
||||
if(pInstructorsAndTrainees->authorizationTrainee(clientAutorization.Login, clientAutorization.Password, "", ""))
|
||||
{//Авторизуется обучаемый
|
||||
|
||||
client->getClient()->setLogin(clientAutorization.Login);
|
||||
emit sigUpdateListClients();
|
||||
|
||||
//KAV redact
|
||||
instructorName = pInstructorsAndTrainees->getMainInstructorName();
|
||||
traineeName = pInstructorsAndTrainees->getNameTraineeByLogin(clientAutorization.Login);
|
||||
|
||||
arrayAnswer = dataParser->xmlAnswer_authorization(true, instructorName, traineeName, "trainee");
|
||||
}
|
||||
else if(pInstructorsAndTrainees->authorizationInstructor(clientAutorization.Login, clientAutorization.Password))
|
||||
{//Авторизуется инструктор
|
||||
|
||||
client->getClient()->setLogin(clientAutorization.Login);
|
||||
emit sigUpdateListClients();
|
||||
|
||||
instructorName = pInstructorsAndTrainees->getNameInstructorByLogin(clientAutorization.Login);
|
||||
|
||||
arrayAnswer = dataParser->xmlAnswer_authorization(true, instructorName, instructorName, "instructor");
|
||||
}
|
||||
else
|
||||
{//Никто не авторизовался
|
||||
arrayAnswer = dataParser->xmlAnswer_authorization(false, "", "", "");
|
||||
}
|
||||
client->sendXmlAnswer(arrayAnswer);
|
||||
|
||||
QString str = QString(arrayAnswer);
|
||||
//logger->addTextToLogger("To Client: " + str);
|
||||
|
||||
//Извещаем об изменениях в авторизации
|
||||
emit sigAuthChanged();
|
||||
}
|
||||
|
||||
void ProcessingSystem::processingClientMessage(ClientHandler *client, ClientMessage clientMessage)
|
||||
{
|
||||
QString peerAddress = client->getSocket()->peerAddress().toString();
|
||||
QString peerPort = QString::number(client->getSocket()->peerPort());
|
||||
|
||||
QString str = "Msg From Client [" + peerAddress + ":" + peerPort + "] : " + clientMessage.Text;
|
||||
|
||||
emit sigLogMessage(str);
|
||||
emit sigAddToMessanger(client->getClient()->getLogin(), clientMessage.Text);
|
||||
}
|
||||
|
||||
void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotify clientNotify)
|
||||
{
|
||||
if(clientNotify.Code == "READY")
|
||||
{//Клиент готов принять задания
|
||||
client->getClient()->setReady(true); //скорее всего функции будут внутри хэндлера
|
||||
|
||||
//Отправляем пакет с заданиями для Обучаемого(клиента)
|
||||
|
||||
client->getSocket()->flush();
|
||||
|
||||
QStringList listTasks;
|
||||
//TODO KAV redact
|
||||
//listTasks = pInstructorsAndTrainees->getDbLMS()->getWhatItDoes(client->getClient()->getLogin());
|
||||
|
||||
QByteArray arrayAnswer = dataParser->xmlAnswer_tasks(listTasks);
|
||||
client->sendXmlAnswer(arrayAnswer);
|
||||
|
||||
QString str = QString(arrayAnswer);
|
||||
emit sigLogMessage("To Client: " + str);
|
||||
}
|
||||
else if(clientNotify.Code == "DISABLE")
|
||||
{
|
||||
client->sendDisable();
|
||||
//server->slotDisconnectClient(client->getClient()->getAddress(),client->getClient()->getPort());
|
||||
}
|
||||
else if(clientNotify.Code == "GETSERVERDATALIST")
|
||||
{
|
||||
client->sendHash();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
42
ServerLMS/ServerLMS/Systems/processingsystem.h
Normal file
42
ServerLMS/ServerLMS/Systems/processingsystem.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef PROCESSINGSYSTEM_H
|
||||
#define PROCESSINGSYSTEM_H
|
||||
|
||||
#include "sendsystem.h"
|
||||
#include "typesDataServerClient.h"
|
||||
|
||||
#include <clienthandler.h>
|
||||
#include <serverlmswidget.h>
|
||||
#include "instructorsandtraineeswidget.h"
|
||||
|
||||
class SendSystem;
|
||||
class ServerLMSWidget;
|
||||
class InstructorsAndTrainees;
|
||||
class Logger;
|
||||
class DataParser;
|
||||
class ClientHandler;
|
||||
|
||||
class ProcessingSystem : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ProcessingSystem(QObject *parent = nullptr);
|
||||
|
||||
void initialize(DataParser* dataParser,ServerLMSWidget *server,
|
||||
InstructorsAndTraineesWidget *instructorsAndTrainees);
|
||||
void processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization);
|
||||
void processingClientMessage(ClientHandler *client, ClientMessage clientMessage);
|
||||
void processingClientNotify(ClientHandler *client, ClientNotify clientNotify);
|
||||
|
||||
signals:
|
||||
void sigUpdateListClients();
|
||||
void sigAuthChanged();
|
||||
void sigLogMessage(QString log);
|
||||
void sigAddToMessanger(QString login,QString text);
|
||||
|
||||
private:
|
||||
ServerLMSWidget *server;
|
||||
DataParser *dataParser;
|
||||
InstructorsAndTraineesWidget *pInstructorsAndTrainees;
|
||||
};
|
||||
|
||||
#endif // PROCESSINGSYSTEM_H
|
||||
358
ServerLMS/ServerLMS/Systems/recognizesystem.cpp
Normal file
358
ServerLMS/ServerLMS/Systems/recognizesystem.cpp
Normal file
@@ -0,0 +1,358 @@
|
||||
#include "Client.h"
|
||||
#include "recognizesystem.h"
|
||||
|
||||
RecognizeSystem::RecognizeSystem(QObject *parent):
|
||||
QObject(parent)
|
||||
{
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
filePath.clear();
|
||||
fileSize = 0;
|
||||
sizeReceiveData = 0;
|
||||
tmpBlock.clear();
|
||||
countSend = 0;
|
||||
mutex = new QMutex;
|
||||
|
||||
}
|
||||
|
||||
void RecognizeSystem::initialize(UpdateController *updateController,DataParser* dataParser,
|
||||
ServerLMSWidget *server,SendSystem *sendSystem, ClientHandler *handler)
|
||||
{
|
||||
this->updateController = updateController;
|
||||
this->dataParser = dataParser;
|
||||
this->server = server;
|
||||
this->clientHandler = handler;
|
||||
this->sendSystem = sendSystem;
|
||||
socket = handler->getSocket();
|
||||
|
||||
connect(this,&RecognizeSystem::sigCalculateHash,updateController,&UpdateController::calculateHash,Qt::DirectConnection);
|
||||
connect(this,&RecognizeSystem::sigXmlParser,dataParser,&DataParser::xmlParser,Qt::DirectConnection);
|
||||
qDebug() << "Recognize init thread ID " << QThread::currentThreadId();
|
||||
}
|
||||
|
||||
void RecognizeSystem::recognize()
|
||||
{
|
||||
mutex->lock();
|
||||
qDebug() << "Recognize thread ID " << QThread::currentThreadId();
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
QByteArray data;
|
||||
Client *client = clientHandler->getClient();
|
||||
|
||||
while (socket->bytesAvailable() > 0)
|
||||
{
|
||||
|
||||
if (packetType == PacketType::TYPE_NONE)
|
||||
{
|
||||
stream.startTransaction();
|
||||
|
||||
if(!isPackageTypeInited) //первичная инициализация для типа клиента
|
||||
{
|
||||
char *read = new char[0];
|
||||
stream.readRawData(read,1);
|
||||
packetType = static_cast<PacketType>(QString(read[0]).toInt());
|
||||
|
||||
packetTypeInit(packetType,client);
|
||||
|
||||
if(!stream.commitTransaction()) continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(client->getIsUnity())
|
||||
{
|
||||
char *read = new char[0];
|
||||
stream.readRawData(read,1);
|
||||
packetType = static_cast<PacketType>(QString(read[0]).toInt());
|
||||
|
||||
if(!stream.commitTransaction()) continue;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
stream >> packetType;
|
||||
|
||||
if(!stream.commitTransaction()) continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (packetType == PacketType::TYPE_COMMAND)
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> command;
|
||||
|
||||
if (!stream.commitTransaction()) continue;
|
||||
}
|
||||
|
||||
if (command == "update") //запускает процесс оновления
|
||||
{
|
||||
sendSystem->updateFiles(updateController->getFileSendList(),
|
||||
updateController->getClientDataList());
|
||||
|
||||
qDebug()<< "Call update";
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
command = "";
|
||||
}
|
||||
|
||||
if (packetType == PacketType::TYPE_XMLANSWER)
|
||||
{
|
||||
|
||||
if(clientHandler->getClient()->getIsUnity())
|
||||
{
|
||||
data = socket->readAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> data;
|
||||
|
||||
if(!stream.commitTransaction()) continue;
|
||||
}
|
||||
|
||||
qDebug() << data;
|
||||
emit sigXmlParser(clientHandler,data);
|
||||
//dataParser->xmlParser(clientHandler,data);
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(packetType == PacketType::TYPE_FOLDER) //создание папок
|
||||
|
||||
{
|
||||
if(client->getIsUnity())
|
||||
{
|
||||
filePath = socket->readAll();
|
||||
filePath = Tools::createRootScenario(filePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> filePath;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
continue;
|
||||
}
|
||||
|
||||
filePath = createFullPath(filePath);
|
||||
|
||||
}
|
||||
|
||||
QDir dir(filePath);
|
||||
if(!dir.exists()){
|
||||
if(dir.mkpath(filePath)){
|
||||
qDebug() << "Dir Created";
|
||||
}
|
||||
}
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (packetType == PacketType::TYPE_FILE) //выгрузка одного файла
|
||||
{
|
||||
|
||||
if(client->getIsUnity())
|
||||
{
|
||||
DataInfo *currentFileData = dataParser->getCurrentDataInfo();
|
||||
filePath = currentFileData->path;
|
||||
|
||||
filePath = Tools::createLocalPath(filePath);
|
||||
|
||||
filePath = Tools::createUpdateFilePath(filePath);
|
||||
|
||||
filePath = Tools::createRootScenario(filePath);
|
||||
|
||||
QFile file(filePath);
|
||||
|
||||
|
||||
if (file.exists())
|
||||
{
|
||||
file.remove(); //удаление файла, если он уже есть, но необходимо обновить
|
||||
qDebug() << Tools::getTime() + "Delete exist file: " + filePath;
|
||||
}
|
||||
|
||||
if (!file.open(QFile::Append))
|
||||
{
|
||||
QString folderPath = Tools::createFolderPath(filePath);
|
||||
qDebug() << "FULL PATH: " << folderPath;
|
||||
QDir dir(folderPath);
|
||||
if (!dir.exists()){
|
||||
dir.mkpath(".");
|
||||
}
|
||||
|
||||
file.open(QFile::Append);
|
||||
}
|
||||
|
||||
//socket->waitForReadyRead(1000);
|
||||
|
||||
fileSize = currentFileData->size;
|
||||
|
||||
qint64 readSize = 65535;
|
||||
forever
|
||||
{
|
||||
if(fileSize < readSize)
|
||||
{
|
||||
readSize = fileSize;
|
||||
qDebug() << "LastPackage: " << readSize;
|
||||
}
|
||||
|
||||
socket->waitForReadyRead(20);
|
||||
tmpBlock = socket->read(readSize);
|
||||
|
||||
quint64 toFile = file.write(tmpBlock);
|
||||
fileSize -= toFile;
|
||||
sizeReceiveData += toFile;
|
||||
countSend++;
|
||||
|
||||
tmpBlock.clear();
|
||||
qDebug() << "Loading progress: " << fileSize << "/" << currentFileData->size;
|
||||
|
||||
if(fileSize == 0) break;
|
||||
|
||||
}
|
||||
|
||||
file.close();
|
||||
filePath.clear();
|
||||
dataParser->clearCurrentDataInfo();
|
||||
|
||||
socket->waitForReadyRead(100);
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
forever
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> filePath;
|
||||
stream >> fileSize;
|
||||
|
||||
if(!stream.commitTransaction()) continue;
|
||||
|
||||
filePath = createFullPath(filePath);
|
||||
socket->waitForReadyRead(100);
|
||||
break;
|
||||
}
|
||||
|
||||
QFile file(filePath);
|
||||
QFileInfo fileInfo(file);
|
||||
|
||||
if(file.exists())
|
||||
{
|
||||
file.remove();
|
||||
}
|
||||
|
||||
file.open(QFile::Append);
|
||||
|
||||
forever
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> tmpBlock;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
|
||||
if(socket->state() == QAbstractSocket::UnconnectedState){
|
||||
qDebug() << "UNCONNECT";
|
||||
mutex->unlock();
|
||||
file.close();
|
||||
return;
|
||||
}
|
||||
if(socket->waitForReadyRead(TCP_READ_TIMEOUT)){
|
||||
continue;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
quint64 toFile = file.write(tmpBlock);
|
||||
sizeReceiveData += toFile;
|
||||
countSend++;
|
||||
|
||||
tmpBlock.clear();
|
||||
|
||||
if(sizeReceiveData == fileSize) break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
QString logMessage = Tools::getTime() + " ";
|
||||
logMessage.append("Load from " + client->getLogin() + " ");
|
||||
logMessage.append(fileInfo.fileName());
|
||||
|
||||
emit sigSendToLogger(logMessage);
|
||||
|
||||
file.close();
|
||||
|
||||
if(command == "check")
|
||||
{
|
||||
QFile checkFile(filePath);
|
||||
checkFile.open(QIODevice::ReadOnly);
|
||||
updateController->compareFiles(clientHandler,checkFile.readAll());
|
||||
checkFile.close();
|
||||
}
|
||||
|
||||
filePath.clear();
|
||||
fileSize = 0;
|
||||
tmpBlock.clear();
|
||||
sizeReceiveData = 0;
|
||||
countSend = 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (packetType == PacketType::TYPE_FILESIZE)
|
||||
{
|
||||
fileSize = socket->readAll().toULong();
|
||||
qDebug() << fileSize;
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (packetType == PacketType::TYPE_FINISH)
|
||||
{
|
||||
emit sigCalculateHash();
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
mutex->unlock();
|
||||
}
|
||||
|
||||
void RecognizeSystem::packetTypeInit(PacketType packet,Client *client)
|
||||
{
|
||||
if(packet == PacketType::TYPE_QT)
|
||||
{
|
||||
client->setUnity(false);
|
||||
|
||||
qDebug() << "ConnectionType isUnity: " << client->getIsUnity();
|
||||
}
|
||||
else if (packet == PacketType::TYPE_UNITY)
|
||||
{
|
||||
client->setUnity(true);
|
||||
}
|
||||
|
||||
isPackageTypeInited = true;
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
QString RecognizeSystem::createFullPath(QString path)
|
||||
{
|
||||
QString fullPath;
|
||||
qint8 pos = path.indexOf("Application");
|
||||
|
||||
QString localPath = path.remove(0,--pos);
|
||||
|
||||
//qDebug() << "CLIENT: localPath" << localPath;
|
||||
fullPath = QDir::currentPath() + localPath;
|
||||
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
RecognizeSystem::~RecognizeSystem()
|
||||
{
|
||||
|
||||
}
|
||||
59
ServerLMS/ServerLMS/Systems/recognizesystem.h
Normal file
59
ServerLMS/ServerLMS/Systems/recognizesystem.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#ifndef RECOGNIZESYSTEM_H
|
||||
#define RECOGNIZESYSTEM_H
|
||||
|
||||
#include "client.h"
|
||||
#include "updatecontroller.h"
|
||||
|
||||
#include <QDataStream>
|
||||
#include <QTcpSocket>
|
||||
#include "Systems/tools.h"
|
||||
#include "Systems/dataparser.h"
|
||||
#include "serverlmswidget.h"
|
||||
#include <QMutex>
|
||||
|
||||
class UpdateController;
|
||||
class ServerLMSWidget;
|
||||
class ClientHandler;
|
||||
|
||||
class RecognizeSystem : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RecognizeSystem(QObject *parent = nullptr);
|
||||
void initialize(UpdateController *updateController,DataParser *dataParser,
|
||||
ServerLMSWidget *server,SendSystem *sendSystem, ClientHandler *handler);
|
||||
void recognize();
|
||||
~RecognizeSystem();
|
||||
|
||||
signals:
|
||||
void sigCalculateHash();
|
||||
void sigSendToLogger(QString string);
|
||||
void sigXmlParser(ClientHandler *clientHandler,QByteArray data);
|
||||
|
||||
private:
|
||||
UpdateController *updateController;
|
||||
SendSystem *sendSystem;
|
||||
DataParser *dataParser;
|
||||
ServerLMSWidget *server;
|
||||
QString command;
|
||||
PacketType packetType;
|
||||
QString filePath;
|
||||
ClientHandler *clientHandler;
|
||||
QMutex *mutex;
|
||||
|
||||
QTcpSocket *socket;
|
||||
|
||||
QByteArray tmpBlock;
|
||||
|
||||
qint64 sizeReceiveData;
|
||||
qint64 fileSize;
|
||||
int countSend;
|
||||
bool isPackageTypeInited;
|
||||
|
||||
void packetTypeInit(PacketType packet,Client *client);
|
||||
void packetTypeInit(PacketType type);
|
||||
QString createFullPath(QString path);
|
||||
};
|
||||
#endif // RECOGNIZESYSTEM_H
|
||||
266
ServerLMS/ServerLMS/Systems/sendsystem.cpp
Normal file
266
ServerLMS/ServerLMS/Systems/sendsystem.cpp
Normal file
@@ -0,0 +1,266 @@
|
||||
#include "sendsystem.h"
|
||||
|
||||
|
||||
SendSystem::SendSystem(QObject *parent) : QObject(parent)
|
||||
{
|
||||
isSendStopped = false;
|
||||
}
|
||||
|
||||
void SendSystem::initialize(DataParser *dataParser,Logger *logger)
|
||||
{
|
||||
this->dataParser = dataParser;
|
||||
this->logger = logger;
|
||||
|
||||
connect(this,&SendSystem::sigSendToLogger,logger,&Logger::addTextToLogger);
|
||||
connect(this,&SendSystem::sigSendXMLmessage,dataParser,&DataParser::xmlAnswer_message,Qt::BlockingQueuedConnection);
|
||||
connect(this,&SendSystem::sigSendNotify,dataParser,&DataParser::xmlAnswer_notify,Qt::BlockingQueuedConnection);
|
||||
|
||||
qDebug() << "SendSystem thread: " << QThread::currentThreadId();
|
||||
}
|
||||
|
||||
void SendSystem::setClient(Client *client,QTcpSocket *socket)
|
||||
{
|
||||
this->socket = socket;
|
||||
this->isUnity = client->getIsUnity();
|
||||
this->client = client;
|
||||
isSendStopped = false;
|
||||
}
|
||||
|
||||
|
||||
void SendSystem::sendMessageBlock(QString message)
|
||||
{
|
||||
auto messageBlock = emit sigSendXMLmessage(message);
|
||||
sendXmlAnswer(messageBlock);
|
||||
}
|
||||
|
||||
void SendSystem::sendFileBlock(QString path)
|
||||
{
|
||||
|
||||
qDebug() << "sendFileBlock thread: " << QThread::currentThreadId();
|
||||
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
QFile file(Tools::createRootPath(path));
|
||||
QFileInfo fileInfo(file);
|
||||
fileSize = fileInfo.size();
|
||||
|
||||
if(fileSize == 0){
|
||||
emit sigSendToLogger(Tools::getTime() + " WARNING! Zero size " + path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
stream << PacketType::TYPE_FILE; //Отправляем тип блока
|
||||
|
||||
stream << path << fileSize;
|
||||
|
||||
if(isSendStopped) { //Поведение на случай отключения клиента
|
||||
|
||||
file.close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
socket->waitForBytesWritten();
|
||||
|
||||
if(file.open(QFile::ReadOnly)){
|
||||
while(!file.atEnd()){
|
||||
QByteArray data = file.read(1025*250);
|
||||
stream << data;
|
||||
socket->waitForBytesWritten();
|
||||
countSend++;
|
||||
}
|
||||
|
||||
emit sigSendToLogger(Tools::getTime() + " send file " + fileInfo.fileName());
|
||||
}
|
||||
|
||||
file.close();
|
||||
countSend = 0;
|
||||
socket->waitForBytesWritten();
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::socketWrite(QByteArray array)
|
||||
{
|
||||
socket->write(array);
|
||||
socket->waitForBytesWritten(100);
|
||||
}
|
||||
|
||||
void SendSystem::socketClose()
|
||||
{
|
||||
socket->close();
|
||||
}
|
||||
|
||||
void SendSystem::sendFileBlockWithRename(QString path, QString newName)
|
||||
{
|
||||
qDebug() << "sendFileBlockWithRename thread: " << QThread::currentThreadId();
|
||||
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
QFile file(Tools::createRootPath(path));
|
||||
QFileInfo fileInfo(file);
|
||||
fileSize = fileInfo.size();
|
||||
|
||||
if(fileSize == 0){
|
||||
emit sigSendToLogger(Tools::getTime() + " WARNING! Zero size " + path);
|
||||
return;
|
||||
}
|
||||
|
||||
QString pathForSend = Tools::createFolderPath(path) + "/" + staticDataFolderName + newName;
|
||||
|
||||
stream << PacketType::TYPE_FILE; //Отправляем тип блока
|
||||
|
||||
stream << pathForSend << fileSize;
|
||||
|
||||
if(isSendStopped) { //Поведение на случай отключения клиента
|
||||
|
||||
file.close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
socket->waitForBytesWritten();
|
||||
|
||||
if(file.open(QFile::ReadOnly)){
|
||||
while(!file.atEnd()){
|
||||
QByteArray data = file.read(1025*250);
|
||||
stream << data;
|
||||
socket->waitForBytesWritten();
|
||||
countSend++;
|
||||
}
|
||||
|
||||
emit sigSendToLogger(Tools::getTime() + " send file " + fileInfo.fileName());
|
||||
}
|
||||
|
||||
file.close();
|
||||
countSend = 0;
|
||||
socket->waitForBytesWritten();
|
||||
socket->waitForReadyRead(100);
|
||||
|
||||
sendNotify("HASHSENDCOMPLETE");
|
||||
}
|
||||
|
||||
void SendSystem::sendFolderBlock(QString path)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
stream << PacketType::TYPE_FOLDER;
|
||||
stream << path;
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendDeleteBlock(QString path)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
stream << PacketType::TYPE_DELETE;
|
||||
stream << path;
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendHello()
|
||||
{
|
||||
socket->write(SERVER_HELLO);
|
||||
}
|
||||
|
||||
void SendSystem::sendFinish()
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::TYPE_FINISH;
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendNotify(QString notify)
|
||||
{
|
||||
qDebug() << "SendNotify thread: " << QThread::currentThreadId();
|
||||
auto answer = emit sigSendNotify(notify);//"END");
|
||||
sendXmlAnswer(answer);
|
||||
}
|
||||
|
||||
void SendSystem::sendXmlAnswer(QByteArray array)
|
||||
{
|
||||
qDebug() << "SendSystemThread: " << QThread::currentThreadId();
|
||||
if(!client->getIsUnity())
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
stream << PacketType::TYPE_XMLANSWER;
|
||||
stream << array;
|
||||
}
|
||||
else
|
||||
{
|
||||
socket->write(array);
|
||||
}
|
||||
|
||||
|
||||
socket->waitForReadyRead(1000);
|
||||
}
|
||||
|
||||
void SendSystem::sendNeedUpdate(bool flag,quint64 size,quint64 fileCount)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::TYPE_NEEDUPDATE;
|
||||
stream << flag;
|
||||
stream << size;
|
||||
stream << fileCount;
|
||||
}
|
||||
|
||||
void SendSystem::updateFiles(QList<FileData> fileSendList, QList<FileData> clientDataList){
|
||||
|
||||
QListIterator<FileData> serverIterator(fileSendList);
|
||||
|
||||
while(serverIterator.hasNext())
|
||||
{
|
||||
FileData data = serverIterator.next();
|
||||
|
||||
if (data.hash == "FOLDER")
|
||||
{
|
||||
sendFolderBlock(data.path);
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendFileBlock(data.path);
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
if(getIsSendStopped()) return;
|
||||
}
|
||||
|
||||
QListIterator<FileData> clientIterator(clientDataList);
|
||||
|
||||
while(clientIterator.hasNext()){
|
||||
FileData data = clientIterator.next();
|
||||
|
||||
sendDeleteBlock(data.path);
|
||||
if(getIsSendStopped()) return;
|
||||
}
|
||||
|
||||
emit sigLoadHash();
|
||||
|
||||
sendFinish();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SendSystem::sendStop()
|
||||
{
|
||||
isSendStopped = true;
|
||||
}
|
||||
|
||||
bool SendSystem::getIsSendStopped() const
|
||||
{
|
||||
return isSendStopped;
|
||||
}
|
||||
|
||||
SendSystem::~SendSystem()
|
||||
{
|
||||
|
||||
}
|
||||
62
ServerLMS/ServerLMS/Systems/sendsystem.h
Normal file
62
ServerLMS/ServerLMS/Systems/sendsystem.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#ifndef SENDSYSTEM_H
|
||||
#define SENDSYSTEM_H
|
||||
|
||||
#include "dataparser.h"
|
||||
#include "Systems/Tools.h"
|
||||
#include "Client.h"
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QtNetwork>
|
||||
|
||||
class DataParser;
|
||||
class FileData;
|
||||
class SendSystem : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SendSystem(QObject* parent = nullptr);
|
||||
|
||||
void initialize(DataParser* dataParser,Logger *logger);
|
||||
void setClient(Client* client,QTcpSocket *socket);
|
||||
void sendMessageBlock(QString message);
|
||||
void sendFileBlock(QString path);
|
||||
void sendFileBlockWithRename(QString path,QString newName);
|
||||
void sendFolderBlock(QString path);
|
||||
void sendDeleteBlock(QString path);
|
||||
void sendHello();
|
||||
void sendFinish();
|
||||
void sendNotify(QString notify);
|
||||
void sendStop();
|
||||
void sendXmlAnswer(QByteArray array);
|
||||
void sendNeedUpdate(bool flag,quint64 size,quint64 fileCount);
|
||||
void updateFiles(QList<FileData> fileSendList, QList<FileData> clientDataList);
|
||||
bool getIsSendStopped() const;
|
||||
|
||||
~SendSystem();
|
||||
|
||||
|
||||
public slots:
|
||||
void socketWrite(QByteArray array);
|
||||
void socketClose();
|
||||
signals:
|
||||
void sigLoadHash();
|
||||
void sigSendToLogger(QString message);
|
||||
QByteArray sigSendXMLmessage(QString message);
|
||||
QByteArray sigSendNotify(QString message);
|
||||
|
||||
private:
|
||||
Client *client;
|
||||
QTcpSocket* socket;
|
||||
DataParser* dataParser;
|
||||
Logger *logger;
|
||||
QMutex *mutex;
|
||||
quint64 fileSize;
|
||||
int countSend;
|
||||
bool isSendStopped;
|
||||
bool isUnity;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // SENDSYSTEM_H
|
||||
55
ServerLMS/ServerLMS/Systems/tools.cpp
Normal file
55
ServerLMS/ServerLMS/Systems/tools.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#include "tools.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
void Tools::printTime()
|
||||
{
|
||||
qDebug() << QTime::currentTime().toString("hh:mm:ss.zzz");
|
||||
}
|
||||
|
||||
|
||||
QString Tools::getTime()
|
||||
{
|
||||
return QTime::currentTime().toString("hh:mm:ss.zzz");
|
||||
}
|
||||
|
||||
QString Tools::createLocalPath(QString path)
|
||||
{
|
||||
//qDebug() << "Full path: " << path;
|
||||
qint8 pos = path.indexOf(applicationFolderName);
|
||||
|
||||
QString localPath = path.remove(0,--pos);
|
||||
|
||||
//qDebug() << "Local path: " << localPath;
|
||||
return localPath;
|
||||
}
|
||||
|
||||
QString Tools::createRootPath(QString path)
|
||||
{
|
||||
return QDir::currentPath() + path;
|
||||
}
|
||||
|
||||
QString Tools::createRootScenario(QString path){
|
||||
return QDir::currentPath() + scenarioRootPath + path;
|
||||
}
|
||||
|
||||
|
||||
QString Tools::createUpdateFilePath(QString path)
|
||||
{
|
||||
//qDebug() << "Full path: " << path;
|
||||
qint8 pos = path.indexOf(streamingAssetsFolderName);
|
||||
|
||||
QString localPath = path.remove(0,--pos);
|
||||
|
||||
//qDebug() << "Local path: " << localPath;
|
||||
return localPath;
|
||||
}
|
||||
|
||||
QString Tools::createFolderPath(QString path)
|
||||
{
|
||||
quint8 pos = path.lastIndexOf("\\");
|
||||
|
||||
QString folderPath = path.remove(pos,path.length() - pos);
|
||||
|
||||
return folderPath;
|
||||
}
|
||||
48
ServerLMS/ServerLMS/Systems/tools.h
Normal file
48
ServerLMS/ServerLMS/Systems/tools.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef TOOLS_H
|
||||
#define TOOLS_H
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
#include <QTime>
|
||||
#include <QDir>
|
||||
|
||||
#define TCP_READ_TIMEOUT 5000
|
||||
|
||||
static QString staticDataFolderName = "StaticData";
|
||||
static QString applicationFolderName = "Application";
|
||||
static QString streamingAssetsFolderName = "StreamingAssets";
|
||||
static QString tempFile = staticDataFolderName + "/save.xml";
|
||||
static QString hashFileName = staticDataFolderName + "/serverHash.xml";
|
||||
static QString scenarioRootPath = "\\Application\\RRJLoader\\RRJ_Data";
|
||||
|
||||
enum PacketType
|
||||
{
|
||||
TYPE_NONE = 0,
|
||||
TYPE_UNITY = 1,
|
||||
TYPE_FILE = 2,
|
||||
TYPE_COMMAND =3,
|
||||
TYPE_FOLDER = 4,
|
||||
TYPE_DELETE = 5,
|
||||
TYPE_FINISH = 6,
|
||||
TYPE_NEEDUPDATE = 7,
|
||||
TYPE_XMLANSWER = 8,
|
||||
TYPE_QT = 9,
|
||||
TYPE_DISABLE = 11,
|
||||
TYPE_FILESIZE = 20
|
||||
};
|
||||
|
||||
class Tools {
|
||||
public:
|
||||
static void printTime();
|
||||
static QString getTime();
|
||||
static QString createLocalPath(QString path);
|
||||
static QString createRootPath(QString path);
|
||||
static QString createUpdateFilePath(QString path);
|
||||
static QString createFolderPath(QString path);
|
||||
static QString createRootScenario(QString path);
|
||||
};
|
||||
|
||||
|
||||
#endif // TOOLS_H
|
||||
384
ServerLMS/ServerLMS/Systems/updatecontroller.cpp
Normal file
384
ServerLMS/ServerLMS/Systems/updatecontroller.cpp
Normal file
@@ -0,0 +1,384 @@
|
||||
#include "updatecontroller.h"
|
||||
|
||||
void UpdateController::initialize(TCPServer *server,DataParser *dataParser)
|
||||
{
|
||||
this->server = server;
|
||||
this->dataParser = dataParser;
|
||||
sizeToSend = 0;
|
||||
mutex = new QMutex;
|
||||
}
|
||||
|
||||
UpdateController::UpdateController(QObject *parent) : QObject(parent)
|
||||
{
|
||||
sourcePath = QDir::currentPath() + "/" + applicationFolderName;
|
||||
emit sigLogMessage(sourcePath);
|
||||
qDebug() << hashFileName;
|
||||
|
||||
if(!QFile::exists(hashFileName)){
|
||||
calculateHash();
|
||||
}else{
|
||||
loadHash();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void UpdateController::compareFiles(ClientHandler* handler, QByteArray array)
|
||||
{
|
||||
mutex->lock();
|
||||
loadHash();
|
||||
clientDataList.clear();
|
||||
dataParser->xmlFileDataParse(array);
|
||||
clientDataList.append(*dataParser->getDatas());
|
||||
|
||||
//Вывод информации о доступных файлов/*
|
||||
// QListIterator<FileData> iterator(clientDataList);
|
||||
// while(iterator.hasNext()){
|
||||
// auto data = iterator.next();
|
||||
// emit sigLogMessage(data.path);
|
||||
// emit sigLogMessage(data.hash);
|
||||
// emit sigLogMessage("____________");
|
||||
// }*/
|
||||
|
||||
checkNeedUpdate(handler);
|
||||
mutex->unlock();
|
||||
}
|
||||
|
||||
|
||||
void UpdateController::showHash()
|
||||
{
|
||||
for(FileData& str : serverDataList){
|
||||
emit sigLogMessage(str.hash);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateController::saveHash()
|
||||
{
|
||||
QFile hashFile(hashFileName);
|
||||
hashFile.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter xmlWriter(&hashFile);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("FileDataList");
|
||||
|
||||
foreach (FileData data,serverDataList)
|
||||
{
|
||||
xmlWriter.writeStartElement("FileData");
|
||||
|
||||
xmlWriter.writeAttribute("Path",data.path);
|
||||
xmlWriter.writeAttribute("Hash",data.hash);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
hashFile.close();
|
||||
|
||||
}
|
||||
|
||||
void UpdateController::loadHash()
|
||||
{
|
||||
serverDataList.clear();
|
||||
|
||||
QFile hashFile(hashFileName);
|
||||
QByteArray array;
|
||||
if(hashFile.open(QIODevice::ReadOnly)){
|
||||
array = hashFile.readAll();
|
||||
hashFile.close();
|
||||
}
|
||||
|
||||
QXmlStreamReader xmlReader(array);
|
||||
|
||||
while (!xmlReader.atEnd())
|
||||
{
|
||||
if(xmlReader.isStartElement())
|
||||
{
|
||||
if(xmlReader.name().toUtf8() == "FileData")
|
||||
{
|
||||
FileData data;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr,xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Path")
|
||||
data.path = value;
|
||||
else if(name == "Hash")
|
||||
data.hash = value;
|
||||
}
|
||||
|
||||
serverDataList.append(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
xmlReader.readNextStartElement();
|
||||
}
|
||||
|
||||
emit sigLogMessage("Hash load from file ");
|
||||
|
||||
}
|
||||
|
||||
void UpdateController::calculateSize()
|
||||
{
|
||||
QDirIterator iterator(sourcePath);
|
||||
quint64 total = 0;
|
||||
|
||||
while(iterator.hasNext()){
|
||||
if(iterator.fileInfo().isFile()){
|
||||
total += iterator.fileInfo().size();
|
||||
}
|
||||
|
||||
iterator.next();
|
||||
}
|
||||
|
||||
emit sigLogMessage("Full size: ");
|
||||
emit sigLogMessage(QString::number(total));
|
||||
}
|
||||
|
||||
QString UpdateController::getCommands()
|
||||
{
|
||||
QString commandsText;
|
||||
commandsText += "check - check version ";
|
||||
commandsText += "update - update files ";
|
||||
|
||||
return commandsText;
|
||||
|
||||
}
|
||||
|
||||
void UpdateController::setLocalFileData(QList<FileData> dataList)
|
||||
{
|
||||
serverDataList.append(dataList);
|
||||
}
|
||||
|
||||
bool UpdateController::checkNeedUpdate(ClientHandler *handler)
|
||||
{
|
||||
QList<FileData> *forSend = new QList<FileData>;
|
||||
QList<FileData> *forDelete = new QList<FileData>;
|
||||
|
||||
fileSendList.clear();
|
||||
fileDeleteList.clear();
|
||||
sizeToSend = 0;
|
||||
|
||||
bool needUpdate = false;
|
||||
|
||||
for (auto &item:clientDataList) //проверка на недостающие файлы по адресам
|
||||
{
|
||||
if(item.path.contains("Temp")) continue;
|
||||
|
||||
if (!serverDataList.contains(item))
|
||||
{
|
||||
forDelete->append(item);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &item:serverDataList)
|
||||
{
|
||||
if(item.path.contains("Temp")) continue;
|
||||
|
||||
if (!clientDataList.contains(item))
|
||||
{
|
||||
forSend->append(item);
|
||||
}
|
||||
}
|
||||
// for (auto &item:clientDataList) //проверка на недостающие файлы по адресам
|
||||
// {
|
||||
// if (!serverDataList.contains(item))
|
||||
// {
|
||||
// serverDataList.removeOne(item);
|
||||
// clientDataList.removeOne(item);
|
||||
// }
|
||||
// }
|
||||
|
||||
// for (auto &item:clientDataList) //проверка на недостающие файлы по адресам
|
||||
// {
|
||||
// if(item.path.contains("Temp")){
|
||||
// clientDataList.removeOne(item);
|
||||
// }
|
||||
// }
|
||||
|
||||
// QListIterator<FileData> serverDiffIterator(serverDataList);
|
||||
|
||||
// while (serverDiffIterator.hasNext()) //добавление недостающих файлов в список для отправки
|
||||
// {
|
||||
// auto fileForUpdate = serverDiffIterator.next();
|
||||
|
||||
// if(fileForUpdate.path.contains("Temp")) continue;
|
||||
|
||||
// fileSendList.append(fileForUpdate);
|
||||
// }
|
||||
|
||||
if(forSend->length() > 0) //формирование сообщения об обновлении
|
||||
{
|
||||
QString log;
|
||||
log.append(Tools::getTime());
|
||||
log.append(" Client: " + handler->getClient()->getLogin());
|
||||
log.append(" Need updates: ");
|
||||
log.append(QString::number(forSend->length()));
|
||||
log.append(" objects");
|
||||
fileSendList = *forSend;
|
||||
emit sigLogMessage(log);
|
||||
handler->sendMessageBlock(log);
|
||||
needUpdate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
QString log;
|
||||
log.append(Tools::getTime());
|
||||
log.append(" Client: " + handler->getClient()->getLogin());
|
||||
log.append(" no update required");
|
||||
emit sigLogMessage(log);
|
||||
handler->sendMessageBlock(log);
|
||||
}
|
||||
|
||||
if(forDelete->length() > 0){
|
||||
QString log;
|
||||
log.append(Tools::getTime());
|
||||
log.append(" Client: " + handler->getClient()->getLogin());
|
||||
|
||||
log.append(" Need delete: ");
|
||||
log.append(QString::number(forDelete->length()));
|
||||
log.append(" objects");
|
||||
//ОПАСНОСТЬ С РУКИ! УДАЛИТЬ И ПРИВЕСТИ В ПОРЯДОК
|
||||
clientDataList = *forDelete;
|
||||
//
|
||||
emit sigLogMessage(log);
|
||||
handler->sendMessageBlock(log);
|
||||
needUpdate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
QString log;
|
||||
log.append(Tools::getTime());
|
||||
log.append(" Client: " + handler->getClient()->getLogin());
|
||||
log.append(" no delete required");
|
||||
emit sigLogMessage(log);
|
||||
handler->sendMessageBlock(log);
|
||||
}
|
||||
|
||||
CalculateSizeToSend(*forSend);
|
||||
handler->sendNeedUpdate(needUpdate,sizeToSend,forSend->length());
|
||||
|
||||
return needUpdate;
|
||||
}
|
||||
|
||||
void UpdateController::calculateHash()
|
||||
{
|
||||
|
||||
QFile file(hashFileName);
|
||||
serverDataList.clear();
|
||||
|
||||
if(file.exists()){
|
||||
file.remove();
|
||||
}
|
||||
|
||||
QDirIterator iterator(sourcePath,QDirIterator::Subdirectories);
|
||||
|
||||
if(!QDir(applicationFolderName).exists()){
|
||||
QDir().mkdir(applicationFolderName);
|
||||
}
|
||||
|
||||
QDir dir(sourcePath);
|
||||
QString hashString;
|
||||
QList<FileData> *files = new QList<FileData>;
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
iterator.next();
|
||||
QFileInfo fileInfo = iterator.fileInfo();
|
||||
FileData currentFile;
|
||||
QFile file(fileInfo.absoluteFilePath());
|
||||
|
||||
quint64 fileSize = file.size();
|
||||
const quint64 bufferSize = 10240;
|
||||
|
||||
if (fileInfo.isHidden()) continue;
|
||||
|
||||
if(fileInfo.isFile() && file.open(QIODevice::ReadOnly) && !fileInfo.fileName().contains(".meta"))
|
||||
{
|
||||
char buffer[bufferSize];
|
||||
int bytesRead;
|
||||
int readSize = qMin(fileSize,bufferSize);
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Md5);
|
||||
while(readSize > 0 && (bytesRead = file.read(buffer,readSize)) > 0){
|
||||
fileSize -= bytesRead;
|
||||
hash.addData(buffer,bytesRead);
|
||||
readSize = qMin(fileSize,bufferSize);
|
||||
}
|
||||
|
||||
hashString = QString(hash.result().toHex());
|
||||
currentFile.hash = hashString;
|
||||
currentFile.path = Tools::createLocalPath(fileInfo.absoluteFilePath());
|
||||
|
||||
files->push_back(currentFile);
|
||||
file.close();
|
||||
|
||||
}
|
||||
else if(fileInfo.isDir() && fileInfo.fileName() != ".." && !fileInfo.isRoot())
|
||||
{
|
||||
currentFile.hash = "FOLDER";
|
||||
currentFile.path = Tools::createLocalPath(fileInfo.path());
|
||||
|
||||
if(!folderDataList.contains(currentFile)){
|
||||
folderDataList.push_back(currentFile);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
emit sigLogMessage("Calculate hash complete");
|
||||
serverDataList.append(folderDataList);
|
||||
serverDataList.append(*files);
|
||||
|
||||
saveHash();
|
||||
|
||||
qDebug() << "Recalculate complete";
|
||||
delete files;
|
||||
}
|
||||
|
||||
QByteArray UpdateController::getLocalHash()
|
||||
{
|
||||
QFile hashFile(hashFileName);
|
||||
QByteArray array;
|
||||
if(hashFile.open(QIODevice::ReadOnly)){
|
||||
array = hashFile.readAll();
|
||||
hashFile.close();
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
void UpdateController::CalculateSizeToSend(QList<FileData> diffList)
|
||||
{
|
||||
QListIterator<FileData> serverDiffIterator(diffList);
|
||||
|
||||
while (serverDiffIterator.hasNext()) //добавление недостающих файлов в список для отправки
|
||||
{
|
||||
auto pathForUpdate = serverDiffIterator.next();
|
||||
QString path = Tools::createRootPath(pathForUpdate.path);
|
||||
QFile file(path);
|
||||
|
||||
sizeToSend += file.size();
|
||||
}
|
||||
}
|
||||
|
||||
UpdateController::~UpdateController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QList<FileData> UpdateController::getFileSendList() const
|
||||
{
|
||||
return fileSendList;
|
||||
}
|
||||
|
||||
|
||||
QList<FileData> UpdateController::getClientDataList() const
|
||||
{
|
||||
return clientDataList;
|
||||
}
|
||||
|
||||
64
ServerLMS/ServerLMS/Systems/updatecontroller.h
Normal file
64
ServerLMS/ServerLMS/Systems/updatecontroller.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef UPDATECONTROLLER_H
|
||||
#define UPDATECONTROLLER_H
|
||||
|
||||
|
||||
#include <QString>
|
||||
#include <QObject>
|
||||
#include <QCryptographicHash>
|
||||
#include <QDirIterator>
|
||||
#include <QDebug>
|
||||
#include <QDataStream>
|
||||
#include <QMutex>
|
||||
#include "Systems/dataparser.h"
|
||||
#include "typesDataServerClient.h"
|
||||
|
||||
class TCPServer;
|
||||
class SendSystem;
|
||||
class DataParser;
|
||||
class ClientHandler;
|
||||
|
||||
class UpdateController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit UpdateController(QObject *parent = 0);
|
||||
void initialize(TCPServer* server,DataParser *dataParser);
|
||||
void compareFiles(ClientHandler* handler, QByteArray array);
|
||||
void showHash();
|
||||
void calculateHash();
|
||||
QByteArray getLocalHash();
|
||||
|
||||
QList<FileData> getFileSendList() const;
|
||||
QList<FileData> getClientDataList() const;
|
||||
|
||||
~UpdateController();
|
||||
|
||||
signals:
|
||||
void sigLogMessage(QString message);
|
||||
|
||||
private:
|
||||
QList<FileData> clientDataList;
|
||||
QList<FileData> serverDataList;
|
||||
QList<FileData> folderDataList;
|
||||
|
||||
QList<FileData> fileSendList;
|
||||
QList<FileData> fileDeleteList;
|
||||
|
||||
QString sourcePath;
|
||||
TCPServer *server;
|
||||
DataParser *dataParser;
|
||||
quint64 sizeToSend;
|
||||
QMutex *mutex;
|
||||
|
||||
QString getCommands();
|
||||
bool checkNeedUpdate(ClientHandler* handler);
|
||||
void setLocalFileData(QList<FileData> dataList);
|
||||
void calculateSize();
|
||||
void saveHash();
|
||||
void loadHash();
|
||||
void CalculateSizeToSend(QList<FileData> diffList);
|
||||
};
|
||||
|
||||
#endif // UPDATECONTROLLER_H
|
||||
139
ServerLMS/ServerLMS/clienthandler.cpp
Normal file
139
ServerLMS/ServerLMS/clienthandler.cpp
Normal file
@@ -0,0 +1,139 @@
|
||||
#include "clienthandler.h"
|
||||
|
||||
#include <QThread>
|
||||
|
||||
#include <Systems/sendsystem.h>
|
||||
|
||||
ClientHandler::ClientHandler( QObject *parent):
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void ClientHandler::initialize(int descriptor,ServerLMSWidget *serverWidget,
|
||||
UpdateController *updateController,DataParser *dataParser,Logger *logger)
|
||||
{
|
||||
this->socket = new QTcpSocket;
|
||||
this->thread = new QThread;
|
||||
|
||||
socket->setParent(nullptr);
|
||||
socket->setSocketDescriptor(descriptor);
|
||||
|
||||
qDebug() << "Client thread: " << QThread::currentThreadId();
|
||||
|
||||
sendSystem = new SendSystem;
|
||||
recognizeSystem = new RecognizeSystem;
|
||||
|
||||
thread->start();
|
||||
|
||||
socket->moveToThread(thread);
|
||||
sendSystem->moveToThread(thread);
|
||||
recognizeSystem->moveToThread(thread);
|
||||
|
||||
this->updateController = updateController;
|
||||
this->server = serverWidget;
|
||||
|
||||
QString peerName = socket->peerName();
|
||||
QString peerAddress = socket->peerAddress().toString();
|
||||
QString peerPort = QString::number(socket->peerPort());
|
||||
|
||||
client = new Client(peerName,peerAddress,peerPort,socket);
|
||||
|
||||
connect(this,&ClientHandler::sigSendXmlAnswer,sendSystem,&SendSystem::sendXmlAnswer,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigInitSender,sendSystem,&SendSystem::initialize,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigFileBlock,sendSystem,&SendSystem::sendFileBlock,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigFolderBlock,sendSystem,&SendSystem::sendFolderBlock,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigGetIsSendStopped,sendSystem,&SendSystem::getIsSendStopped,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSendDeleteBlock,sendSystem,&SendSystem::sendDeleteBlock,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSendFinish,sendSystem,&SendSystem::sendFinish,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSendMessageBlock,sendSystem,&SendSystem::sendMessageBlock,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigNeedUpdate,sendSystem,&SendSystem::sendNeedUpdate,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSendNotify,sendSystem,&SendSystem::sendNotify,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSendFileBlockWithRename,sendSystem,&SendSystem::sendFileBlockWithRename,Qt::AutoConnection);
|
||||
connect(socket,&QTcpSocket::readyRead,recognizeSystem,&RecognizeSystem::recognize,Qt::AutoConnection);
|
||||
connect(socket, &QTcpSocket::disconnected, this, &ClientHandler::sendDisable,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSocketWrite,sendSystem,&SendSystem::socketWrite,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSocketClose,sendSystem,&SendSystem::socketClose,Qt::AutoConnection);
|
||||
|
||||
|
||||
recognizeSystem->initialize(updateController,dataParser,serverWidget,sendSystem, this);
|
||||
sendSystem->setClient(client,socket);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigSendToLogger,logger,&Logger::addTextToLogger);
|
||||
emit sigInitSender(dataParser,logger);
|
||||
}
|
||||
|
||||
void ClientHandler::sendHash()
|
||||
{
|
||||
QString path = "\\" + hashFileName;
|
||||
emit sigSendFileBlockWithRename(path,"/serverHash.xml");
|
||||
//emit sigSendNotify("HASHSENDCOMPLETE");
|
||||
}
|
||||
|
||||
void ClientHandler::sendXmlAnswer(QByteArray array)
|
||||
{
|
||||
emit sigSendXmlAnswer(array);
|
||||
}
|
||||
|
||||
void ClientHandler::sendFolderBlock(QString path)
|
||||
{
|
||||
emit sigFolderBlock(path);
|
||||
}
|
||||
|
||||
void ClientHandler::sendFileBlock(QString path)
|
||||
{
|
||||
emit sigFileBlock(path);
|
||||
}
|
||||
|
||||
bool ClientHandler::getIsSendStopped()
|
||||
{
|
||||
return emit sigGetIsSendStopped();
|
||||
}
|
||||
|
||||
void ClientHandler::sendDeleteBlock(QString path)
|
||||
{
|
||||
emit sigSendDeleteBlock(path);
|
||||
}
|
||||
|
||||
void ClientHandler::sendFinish()
|
||||
{
|
||||
emit sigSendFinish();
|
||||
}
|
||||
|
||||
void ClientHandler::sendMessageBlock(QString text)
|
||||
{
|
||||
emit sigSendMessageBlock(text);
|
||||
}
|
||||
|
||||
void ClientHandler::sendNeedUpdate(bool flag, quint64 size, quint64 fileCount)
|
||||
{
|
||||
emit sigNeedUpdate(flag,size,fileCount);
|
||||
}
|
||||
|
||||
void ClientHandler::sendDisable()
|
||||
{
|
||||
thread->exit();
|
||||
thread->wait();
|
||||
emit sigClientDisconnected(client->getAddress(),client->getPort());
|
||||
|
||||
}
|
||||
|
||||
Client *ClientHandler::getClient() const
|
||||
{
|
||||
return client;
|
||||
}
|
||||
|
||||
SendSystem *ClientHandler::getSendSystem() const
|
||||
{
|
||||
return sendSystem;
|
||||
}
|
||||
|
||||
QTcpSocket *ClientHandler::getSocket() const
|
||||
{
|
||||
return socket;
|
||||
}
|
||||
|
||||
ClientHandler::~ClientHandler()
|
||||
{
|
||||
thread->quit();
|
||||
thread->wait();
|
||||
}
|
||||
77
ServerLMS/ServerLMS/clienthandler.h
Normal file
77
ServerLMS/ServerLMS/clienthandler.h
Normal file
@@ -0,0 +1,77 @@
|
||||
#ifndef CLIENTHANDLER_H
|
||||
#define CLIENTHANDLER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <Systems/sendsystem.h>
|
||||
#include "Client.h"
|
||||
#include <QTcpSocket>
|
||||
#include <QThread>
|
||||
|
||||
class SendSystem;
|
||||
class DataParser;
|
||||
class Logger;
|
||||
class ServerLMSWidget;
|
||||
class UpdateController;
|
||||
class RecognizeSystem;
|
||||
|
||||
class ClientHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClientHandler(QObject* parent = nullptr);
|
||||
void initSender(DataParser *dataParser,Logger *logger);
|
||||
void sendXmlAnswer(QByteArray array);
|
||||
void sendFolderBlock(QString path);
|
||||
void sendFileBlock(QString path);
|
||||
bool getIsSendStopped();
|
||||
void sendDeleteBlock(QString path);
|
||||
void sendFinish();
|
||||
void sendMessageBlock(QString text);
|
||||
void sendNeedUpdate(bool flag, quint64 size,quint64 fileCount);
|
||||
void sendDisable();
|
||||
void recognize();
|
||||
void sendHash();
|
||||
|
||||
~ClientHandler();
|
||||
|
||||
Client *getClient() const;
|
||||
SendSystem *getSendSystem() const;
|
||||
|
||||
QTcpSocket *getSocket() const;
|
||||
|
||||
signals:
|
||||
void sigSendXmlAnswer(QByteArray array);
|
||||
void sigInitSender (DataParser *dataParse,Logger *logger);
|
||||
void sigFolderBlock(QString path);
|
||||
void sigFileBlock(QString path);
|
||||
bool sigGetIsSendStopped();
|
||||
void sigSendDeleteBlock(QString path);
|
||||
void sigSendFinish();
|
||||
void sigSendMessageBlock(QString text);
|
||||
void sigNeedUpdate(bool flag,quint64 size,quint64 fileCount);
|
||||
void sigClientDisconnected(QString address,QString port);
|
||||
void sigSendHash();
|
||||
void sigRecognize(ClientHandler *handler);
|
||||
void sigSendNotify(QString notify);
|
||||
void sigSendFileBlockWithRename (QString path,QString newName);
|
||||
void sigSocketWrite(QByteArray array);
|
||||
void sigSocketClose();
|
||||
bool sigSocketFlush();
|
||||
|
||||
public :
|
||||
QThread *thread;
|
||||
QTcpSocket *socket;
|
||||
|
||||
void initialize(int descriptor, ServerLMSWidget *serverWidget,
|
||||
UpdateController *updateController, DataParser *dataParser,Logger *logger);
|
||||
private:
|
||||
UpdateController *updateController;
|
||||
RecognizeSystem *recognizeSystem;
|
||||
Client *client;
|
||||
|
||||
SendSystem *sendSystem;
|
||||
ServerLMSWidget *server;
|
||||
};
|
||||
|
||||
#endif // CLIENTHANDLER_H
|
||||
BIN
ServerLMS/ServerLMS/icons/instructor.png
Normal file
BIN
ServerLMS/ServerLMS/icons/instructor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
ServerLMS/ServerLMS/icons/instructorAdmin.png
Normal file
BIN
ServerLMS/ServerLMS/icons/instructorAdmin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
ServerLMS/ServerLMS/icons/trainee.png
Normal file
BIN
ServerLMS/ServerLMS/icons/trainee.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
151
ServerLMS/ServerLMS/messangerwidget.cpp
Normal file
151
ServerLMS/ServerLMS/messangerwidget.cpp
Normal file
@@ -0,0 +1,151 @@
|
||||
#include <QListWidget>
|
||||
#include <QBrush>
|
||||
#include "messangerwidget.h"
|
||||
#include "ui_messangerwidget.h"
|
||||
|
||||
MessangerWidget::MessangerWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::MessangerWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->tabWidget->removeTab(1);
|
||||
ui->tabWidget->removeTab(0);
|
||||
|
||||
ui->tabWidget->setStyleSheet("QTabBar::tab:selected {background-color: #AAAAAA;}");
|
||||
}
|
||||
|
||||
MessangerWidget::~MessangerWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MessangerWidget::addMsg(QString login, QString name, QString text, MessangerWidget::ETypeMsg typeMsg)
|
||||
{
|
||||
addDialogTab(login, name);
|
||||
|
||||
QString prefix = (typeMsg == MessangerWidget::ETypeMsg::fromClient)? ">> " : "<< ";
|
||||
|
||||
//Ищем нужный диалог
|
||||
foreach(DialogMsg dialogMsg, listDialogMsg)
|
||||
{
|
||||
if(dialogMsg.getLogin() == login)
|
||||
{
|
||||
//Добавляем в существующую вкладку
|
||||
ui->tabWidget->setCurrentIndex(dialogMsg.getIndexTab());
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem(QIcon(":/icons/trainee.png"), prefix + text);
|
||||
item->setBackground(QBrush(QColor(200, 200, 255)));
|
||||
dialogMsg.getListWidget()->addItem(item);
|
||||
|
||||
currLogin = login;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::addDialogTab(QString login, QString name)
|
||||
{
|
||||
if(listDialogMsg.count() == 0)
|
||||
{
|
||||
currLogin = login;
|
||||
emit signal_tabMessengerChanged(currLogin);
|
||||
}
|
||||
|
||||
//Проверяем наличие диалога с этим клиентом
|
||||
foreach(DialogMsg dialogMsg, listDialogMsg)
|
||||
{
|
||||
if(dialogMsg.getLogin() == login)
|
||||
{//Диалог для этого клиента уже существует
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Добавляем новую вкладку диалога
|
||||
QListWidget* listWidget = new QListWidget();
|
||||
int index = ui->tabWidget->addTab(listWidget, /*login + ": " +*/ name);
|
||||
|
||||
//Помещаем новый диалог в список диалогов
|
||||
DialogMsg dialogMsg(index, listWidget, login);
|
||||
listDialogMsg.append(dialogMsg);
|
||||
}
|
||||
|
||||
void MessangerWidget::on_btnSend_clicked()
|
||||
{
|
||||
QString text = ui->editMsg->text();
|
||||
|
||||
emit signal_msgToClientReady(currLogin, text);
|
||||
|
||||
ui->editMsg->clear();
|
||||
|
||||
QString prefix = "<< ";
|
||||
|
||||
//Ищем нужный диалог
|
||||
foreach(DialogMsg dialogMsg, listDialogMsg)
|
||||
{
|
||||
if(dialogMsg.getLogin() == currLogin)
|
||||
{
|
||||
//Добавляем в существующую вкладку
|
||||
ui->tabWidget->setCurrentIndex(dialogMsg.getIndexTab());
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem(QIcon(":/icons/instructor.png"), prefix + text);
|
||||
item->setBackground(QBrush(QColor(200, 255, 200)));
|
||||
dialogMsg.getListWidget()->addItem(item);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
//Ищем нужный диалог
|
||||
foreach(DialogMsg dialogMsg, listDialogMsg)
|
||||
{
|
||||
if(dialogMsg.getIndexTab() == index)
|
||||
{
|
||||
currLogin = dialogMsg.getLogin();
|
||||
emit signal_tabMessengerChanged(currLogin);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::slot_traineeSelected(QString login)
|
||||
{
|
||||
//Ищем нужный диалог
|
||||
foreach(DialogMsg dialogMsg, listDialogMsg)
|
||||
{
|
||||
if(dialogMsg.getLogin() == login)
|
||||
{
|
||||
//Активируем нужную вкладку
|
||||
ui->tabWidget->setCurrentIndex(dialogMsg.getIndexTab());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::slot_LanguageChanged(QString language)
|
||||
{
|
||||
qtLanguageTranslator.load(QString("translationsMy/ServerLMS_") + language, ".");
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
}
|
||||
|
||||
void MessangerWidget::slot_InitMessanger(QList<Trainee> listTrainees)
|
||||
{
|
||||
for(Trainee trainee: listTrainees)
|
||||
{
|
||||
if(! trainee.getArchived())
|
||||
this->addDialogTab(trainee.getLogin(), trainee.getName());
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
}
|
||||
}
|
||||
|
||||
80
ServerLMS/ServerLMS/messangerwidget.h
Normal file
80
ServerLMS/ServerLMS/messangerwidget.h
Normal file
@@ -0,0 +1,80 @@
|
||||
#ifndef MESSANGERWIDGET_H
|
||||
#define MESSANGERWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QListWidget>
|
||||
#include <QTranslator>
|
||||
#include "ServerLMS_global.h"
|
||||
#include "instructorsandtraineeswidget.h"
|
||||
|
||||
class DialogMsg
|
||||
{
|
||||
public:
|
||||
DialogMsg();
|
||||
DialogMsg(int indexTab, QListWidget* listWidget, QString login)
|
||||
{
|
||||
this->indexTab = indexTab;
|
||||
this->listWidget = listWidget;
|
||||
this->login = login;
|
||||
};
|
||||
|
||||
QString getLogin() {return login;};
|
||||
QListWidget* getListWidget() {return listWidget;};
|
||||
int getIndexTab() {return indexTab;};
|
||||
|
||||
private:
|
||||
QString login = "";
|
||||
int indexTab = 0;
|
||||
QListWidget* listWidget = nullptr;
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class MessangerWidget;
|
||||
}
|
||||
|
||||
class SERVERLMS_EXPORT MessangerWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MessangerWidget(QWidget *parent = nullptr);
|
||||
~MessangerWidget();
|
||||
|
||||
protected:
|
||||
// Метод получения событий
|
||||
// В нём будет производиться проверка события смены перевода приложения
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
public:
|
||||
enum ETypeMsg{fromClient, toClient};
|
||||
|
||||
void addMsg(QString login, QString name, QString text, ETypeMsg typeMsg);
|
||||
void addDialogTab(QString login, QString name);
|
||||
|
||||
private slots:
|
||||
void on_btnSend_clicked();
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
|
||||
signals:
|
||||
//сигнал о готовности нового сообщения на отправку клиенту
|
||||
void signal_msgToClientReady(QString login, QString text);
|
||||
//сигнал об изменении вкладки диалога
|
||||
void signal_tabMessengerChanged(QString login);
|
||||
|
||||
public slots:
|
||||
//слот обработки сигнала о выборе обучаемого
|
||||
void slot_traineeSelected(QString login);
|
||||
void slot_LanguageChanged(QString language);
|
||||
//слот обработки сигнала об инициализации мессенджера
|
||||
void slot_InitMessanger(QList<Trainee> listTrainees);
|
||||
|
||||
private:
|
||||
QList <DialogMsg> listDialogMsg;
|
||||
|
||||
QString currLogin = "";
|
||||
|
||||
Ui::MessangerWidget *ui;
|
||||
QTranslator qtLanguageTranslator;
|
||||
};
|
||||
|
||||
#endif // MESSANGERWIDGET_H
|
||||
81
ServerLMS/ServerLMS/messangerwidget.ui
Normal file
81
ServerLMS/ServerLMS/messangerwidget.ui
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MessangerWidget</class>
|
||||
<widget class="QWidget" name="MessangerWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Messenger</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Tab 2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editMsg"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnSend">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
57
ServerLMS/ServerLMS/multithreadserver.cpp
Normal file
57
ServerLMS/ServerLMS/multithreadserver.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
#include "multithreadserver.h"
|
||||
|
||||
MultiThreadServer::MultiThreadServer(ServerLMSWidget *widget,UpdateController *updateController,
|
||||
DataParser *dataParser,Logger *logger,QObject *parent):
|
||||
QTcpServer(parent),
|
||||
serverLmsWidget(widget),
|
||||
updateController(updateController),
|
||||
dataParser(dataParser),
|
||||
logger(logger)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MultiThreadServer::incomingConnection(qintptr socketDesriptor)
|
||||
{
|
||||
ClientHandler* newClient = new ClientHandler;
|
||||
|
||||
connect(this,&MultiThreadServer::sigInitClient,newClient,&ClientHandler::initialize,Qt::AutoConnection);
|
||||
connect(newClient,&ClientHandler::sigClientDisconnected,this,&MultiThreadServer::slotDisconnectClient,Qt::QueuedConnection);
|
||||
|
||||
emit sigInitClient(socketDesriptor,serverLmsWidget,updateController,dataParser,logger);
|
||||
disconnect(this,&MultiThreadServer::sigInitClient,newClient,&ClientHandler::initialize);
|
||||
|
||||
serverLmsWidget->addClient(socketDesriptor,newClient);
|
||||
|
||||
logger->addTextToLogger("To Client: " + QString(SERVER_HELLO));
|
||||
}
|
||||
|
||||
void MultiThreadServer::slotDisconnectClient(QString peerAddress, QString peerPort)
|
||||
{
|
||||
auto clientsMap = serverLmsWidget->getClientsMap();
|
||||
QString login = "";
|
||||
qDebug() << peerAddress << " " << peerPort << " " << "disconnect";
|
||||
|
||||
//Проходим все открытые сокеты, ищем нужный
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
{
|
||||
ClientHandler *client = clientsMap[idSocket];
|
||||
|
||||
if(client->getClient()->getAddress() == peerAddress && client->getClient()->getPort() == peerPort)
|
||||
{
|
||||
login = client->getClient()->getLogin();
|
||||
serverLmsWidget->removeClient(idSocket);
|
||||
delete client;
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
emit signalStopSendFile();
|
||||
|
||||
logger->addTextToLogger("SERVER: Client " + login + " disconnected");
|
||||
|
||||
serverLmsWidget->slotUpdateListClients();
|
||||
serverLmsWidget->autorizationHandler(login);
|
||||
}
|
||||
|
||||
34
ServerLMS/ServerLMS/multithreadserver.h
Normal file
34
ServerLMS/ServerLMS/multithreadserver.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef MULTITHREADSERVER_H
|
||||
#define MULTITHREADSERVER_H
|
||||
|
||||
#include "serverlmswidget.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
class MultiThreadServer : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MultiThreadServer( ServerLMSWidget *widget,UpdateController *updateController,
|
||||
DataParser *dataParser,Logger *logger,QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void sigInitClient(int descriptor, ServerLMSWidget *serverWidget,
|
||||
UpdateController *updateController, DataParser *dataParser,Logger *logger);
|
||||
void signalStopSendFile();
|
||||
|
||||
public slots:
|
||||
void slotDisconnectClient(QString peerAddress, QString peerPort);
|
||||
protected:
|
||||
void incomingConnection(qintptr handle) override;
|
||||
|
||||
private:
|
||||
ServerLMSWidget *serverLmsWidget;
|
||||
UpdateController *updateController;
|
||||
DataParser *dataParser;
|
||||
Logger *logger;
|
||||
};
|
||||
|
||||
#endif // MULTITHREADSERVER_H
|
||||
7
ServerLMS/ServerLMS/resources.qrc
Normal file
7
ServerLMS/ServerLMS/resources.qrc
Normal file
@@ -0,0 +1,7 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/instructor.png</file>
|
||||
<file>icons/instructorAdmin.png</file>
|
||||
<file>icons/trainee.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
6
ServerLMS/ServerLMS/serverlms.cpp.bak
Normal file
6
ServerLMS/ServerLMS/serverlms.cpp.bak
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "serverlms.h"
|
||||
|
||||
ServerLMS::ServerLMS()
|
||||
{
|
||||
|
||||
}
|
||||
13
ServerLMS/ServerLMS/serverlms.h.bak
Normal file
13
ServerLMS/ServerLMS/serverlms.h.bak
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef SERVERLMS_H
|
||||
#define SERVERLMS_H
|
||||
|
||||
#include "ServerLMS_global.h"
|
||||
|
||||
class SERVERLMS_EXPORT ServerLMS
|
||||
{
|
||||
public:
|
||||
ServerLMS();
|
||||
|
||||
};
|
||||
|
||||
#endif // SERVERLMS_H
|
||||
292
ServerLMS/ServerLMS/serverlmswidget.cpp
Normal file
292
ServerLMS/ServerLMS/serverlmswidget.cpp
Normal file
@@ -0,0 +1,292 @@
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QXmlStreamAttribute>
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
#include <QThread>
|
||||
|
||||
|
||||
#include "serverlmswidget.h"
|
||||
#include "ui_serverlmswidget.h"
|
||||
|
||||
//#include "instructorsAndTrainees.h"
|
||||
#include "instructorsandtraineeswidget.h"
|
||||
|
||||
|
||||
ServerLMSWidget::ServerLMSWidget(InstructorsAndTraineesWidget* instructorsAndTrainees, MessangerWidget* messangerWidget, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
tcpServer(nullptr),
|
||||
hostPort(6000),
|
||||
stateServer(stoped),
|
||||
stateBlockAutorization(/*unblocked*/blocked),
|
||||
pInstructorsAndTrainees(instructorsAndTrainees),
|
||||
pMessangerWidget(messangerWidget),
|
||||
ui(new Ui::ServerLMSWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// Сделаем первоначальную инициализацию перевода для окна виджета
|
||||
qtLanguageTranslator.load(QString("translations/ServerLMS_") + QString("ru_RU"), ".");
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
|
||||
updateThread = new QThread;
|
||||
loggerThread = new QThread;
|
||||
|
||||
ui->comboTasks->addItem("Задача 1");
|
||||
ui->comboTasks->addItem("Задача 2");
|
||||
ui->comboTasks->addItem("Задача 3");
|
||||
ui->comboTasks->addItem("Задача 4");
|
||||
ui->comboTasks->addItem("Задача 5");
|
||||
|
||||
logger = new Logger(ui->listWidgetLogger);
|
||||
connect(logger,&Logger::sigSendTextToLogger,this,&ServerLMSWidget::slotAddToLog,Qt::QueuedConnection);
|
||||
logger->moveToThread(loggerThread);
|
||||
|
||||
|
||||
processingSystem = new ProcessingSystem;
|
||||
dataParser = new DataParser(processingSystem);
|
||||
|
||||
updateController = new UpdateController;
|
||||
updateController->moveToThread(updateThread);
|
||||
|
||||
loggerThread->start();
|
||||
updateThread->start();
|
||||
|
||||
updateController->initialize(nullptr,dataParser);
|
||||
processingSystem->initialize(dataParser,this,instructorsAndTrainees);
|
||||
|
||||
logger->setTypeLog("widget");
|
||||
|
||||
//connect(processingSystem,&ProcessingSystem::sigAuthChanged,this,&ServerLMSWidget::signal_authorizationChanged); //Уже не требуется!
|
||||
connect(processingSystem,&ProcessingSystem::sigUpdateListClients,this, &ServerLMSWidget::slotUpdateListClients);
|
||||
connect(pMessangerWidget, &MessangerWidget::signal_msgToClientReady, this, &ServerLMSWidget::slot_msgToClientReady);
|
||||
|
||||
connect(updateController,&UpdateController::sigLogMessage,logger,&Logger::addTextToLogger);
|
||||
connect(dataParser,&DataParser::sigLogMessage,logger,&Logger::addTextToLogger);
|
||||
connect(processingSystem,&ProcessingSystem::sigLogMessage,logger,&Logger::addTextToLogger);
|
||||
connect(processingSystem,&ProcessingSystem::sigAddToMessanger,this,&ServerLMSWidget::slotAddToMessanger,Qt::QueuedConnection);
|
||||
connect(this,&ServerLMSWidget::sigLog,logger,&Logger::addTextToLogger);
|
||||
|
||||
startServer();
|
||||
|
||||
first = true;
|
||||
qDebug() << "WidgetThread: " << QThread::currentThreadId();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::autorizationHandler(QString login)
|
||||
{
|
||||
//Отмена авторизации в БД
|
||||
|
||||
if(pInstructorsAndTrainees->deAuthorizationTrainee(login))
|
||||
{//Деавторизовался обучаемый
|
||||
|
||||
}
|
||||
else if(pInstructorsAndTrainees->deAuthorizationInstructor(login))
|
||||
{//Деавторизовался инструктор
|
||||
|
||||
}
|
||||
|
||||
//Извещаем об изменениях в авторизации ??? не нашел, где он вызывает изменения
|
||||
//emit signal_authorizationChanged(); //Уже не требуется!
|
||||
}
|
||||
|
||||
ServerLMSWidget::~ServerLMSWidget()
|
||||
{
|
||||
stopServer();
|
||||
updateThread->exit();
|
||||
loggerThread->exit();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool ServerLMSWidget::startServer()
|
||||
{
|
||||
if(stateServer == stoped)
|
||||
{
|
||||
tcpServer = new MultiThreadServer(this,updateController,dataParser,logger);
|
||||
|
||||
//connect(tcpServer, &QTcpServer::newConnection, this, &ServerLMSWidget::slotNewConnection,Qt::AutoConnection);
|
||||
|
||||
if(!tcpServer->listen(QHostAddress::Any, hostPort))
|
||||
{
|
||||
logger->addTextToLogger("SERVER: start ERROR");
|
||||
stateServer = stoped;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
logger->addTextToLogger("SERVER: start OK");
|
||||
stateServer = started;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ServerLMSWidget::stopServer()
|
||||
{
|
||||
if(stateServer == started)
|
||||
{
|
||||
QByteArray arrayAnswer = dataParser->xmlAnswer_notify(NOTIFY_SERVER_END);
|
||||
|
||||
//Закрываем все открытые сокеты
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
{
|
||||
clientsMap[idSocket]->sigSocketWrite(arrayAnswer);
|
||||
//while (!clientsMap[idSocket]->sigSocketFlush()) {}
|
||||
|
||||
QString str = QString(arrayAnswer);
|
||||
emit sigLog("To Client: " + str);
|
||||
|
||||
//slotDisconnectClient(clientsMap[idSocket]->get, QString peerPort)
|
||||
autorizationHandler(clientsMap[idSocket]->getClient()->getLogin());
|
||||
|
||||
clientsMap[idSocket]->sigSocketClose();
|
||||
clientsMap.remove(idSocket);
|
||||
}
|
||||
|
||||
//Закрываем сервер
|
||||
tcpServer->close();
|
||||
stateServer = stoped;
|
||||
delete tcpServer;
|
||||
emit sigLog("Server is stopped");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
QMap<int, ClientHandler *> ServerLMSWidget::getClientsMap() const
|
||||
{
|
||||
return clientsMap;
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slotUpdateListClients()
|
||||
{
|
||||
//Очищаем список
|
||||
ui->listWidget_Clients->clear();
|
||||
|
||||
//Проходим все открытые сокеты
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
{
|
||||
//Добавляем в список Клиентов
|
||||
QString strClient = clientsMap[idSocket]->getClient()->getFullName();
|
||||
|
||||
ui->listWidget_Clients->addItem(strClient);
|
||||
ui->listWidget_Clients->scrollToBottom();
|
||||
ui->listWidget_Clients->setCurrentRow(ui->listWidget_Clients->count() - 1);
|
||||
}
|
||||
|
||||
int countClients = clientsMap.count();
|
||||
logger->addTextToLogger("SERVER: countClients = " + QString::number(countClients));
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_BlockAutorization(bool block)
|
||||
{
|
||||
if(block)
|
||||
blockAutorization();
|
||||
else
|
||||
unBlockAutorization();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slotAddToMessanger(QString login, QString text)
|
||||
{
|
||||
QString name = pInstructorsAndTrainees->getNameTraineeByLogin(login);
|
||||
pMessangerWidget->addMsg(login, name, text, MessangerWidget::ETypeMsg::fromClient);
|
||||
}
|
||||
|
||||
void ServerLMSWidget::removeClient(int idSocket)
|
||||
{
|
||||
clientsMap.remove(idSocket);
|
||||
}
|
||||
|
||||
void ServerLMSWidget::addClient(qintptr descriptor, ClientHandler *client)
|
||||
{
|
||||
clientsMap[descriptor] = client;
|
||||
slotUpdateListClients();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_LanguageChanged(QString language)
|
||||
{
|
||||
qtLanguageTranslator.load(QString("translations/ServerLMS_") + language, ".");
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
}
|
||||
|
||||
|
||||
void ServerLMSWidget::slot_msgToClientReady(QString login, QString text)
|
||||
{
|
||||
QString textMsg = text;
|
||||
|
||||
QByteArray byteArrayMsg = dataParser->xmlAnswer_message(textMsg);
|
||||
|
||||
//Проходим все открытые сокеты, ищем нужный
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
{
|
||||
ClientHandler *handler = clientsMap[idSocket];
|
||||
if(handler->getClient()->getLogin() == login)
|
||||
{//Отправляем ему
|
||||
|
||||
handler->sendXmlAnswer(byteArrayMsg);
|
||||
|
||||
QString peerAddress = clientsMap[idSocket]->getSocket()->peerAddress().toString();
|
||||
QString peerPort = QString::number(clientsMap[idSocket]->getSocket()->peerPort());
|
||||
|
||||
QString str = "Msg To Client [" + peerAddress + ":" + peerPort + "] : " + textMsg;
|
||||
|
||||
logger->addTextToLogger(str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slotAddToLog(QString msg)
|
||||
{
|
||||
ui->listWidgetLogger->addItem(msg);
|
||||
ui->listWidgetLogger->scrollToBottom();
|
||||
}
|
||||
|
||||
|
||||
void ServerLMSWidget::on_btnStartServer_clicked()
|
||||
{
|
||||
startServer();
|
||||
updateController->calculateHash();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::on_btnStopServer_clicked()
|
||||
{
|
||||
stopServer();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::on_btnTaskSet_clicked()
|
||||
{
|
||||
QString fullNameClient = ui->listWidget_Clients->currentItem()->text();
|
||||
|
||||
QString textTask = ui->comboTasks->currentText();
|
||||
|
||||
QByteArray byteArrayTask = dataParser->xmlAnswer_task(textTask);
|
||||
|
||||
//Проходим все открытые сокеты
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
{
|
||||
if(clientsMap[idSocket]->getClient()->getFullName() == fullNameClient)
|
||||
{//Отправляем ему
|
||||
clientsMap[idSocket]->getSocket()->write(byteArrayTask);
|
||||
|
||||
QString peerAddress = clientsMap[idSocket]->getSocket()->peerAddress().toString();
|
||||
QString peerPort = QString::number(clientsMap[idSocket]->getSocket()->peerPort());
|
||||
|
||||
QString str = "Task To Client [" + peerAddress + ":" + peerPort + "] : " + textTask;
|
||||
logger->addTextToLogger(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
}
|
||||
}
|
||||
|
||||
127
ServerLMS/ServerLMS/serverlmswidget.h
Normal file
127
ServerLMS/ServerLMS/serverlmswidget.h
Normal file
@@ -0,0 +1,127 @@
|
||||
#ifndef SERVERLMSWIDGET_H
|
||||
#define SERVERLMSWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QMap>
|
||||
#include <QTranslator>
|
||||
#include <Systems/dataparser.h>
|
||||
#include <Systems/sendsystem.h>
|
||||
#include <Systems/processingsystem.h>
|
||||
#include <Systems/updatecontroller.h>
|
||||
#include <Systems/recognizesystem.h>
|
||||
#include <Systems/logger.h>
|
||||
#include <QMutex>
|
||||
|
||||
#include "ServerLMS_global.h"
|
||||
#include "typesDataServerClient.h"
|
||||
#include "Client.h"
|
||||
//#include "instructorsAndTrainees.h"
|
||||
#include "instructorsandtraineeswidget.h"
|
||||
#include "messangerwidget.h"
|
||||
#include "multithreadserver.h"
|
||||
|
||||
namespace Ui {
|
||||
class ServerLMSWidget;
|
||||
}
|
||||
|
||||
class DataParser;
|
||||
class SendSystem;
|
||||
class ProcessingSystem;
|
||||
class Logger;
|
||||
class UpdateController;
|
||||
class RecognizeSystem;
|
||||
class ClientHandler;
|
||||
class MultiThreadServer;
|
||||
|
||||
class SERVERLMS_EXPORT ServerLMSWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ServerLMSWidget(InstructorsAndTraineesWidget* instructorsAndTrainees, MessangerWidget* messangerWidget, QWidget *parent = nullptr);
|
||||
void autorizationHandler(QString login);
|
||||
~ServerLMSWidget();
|
||||
|
||||
protected:
|
||||
// Метод получения событий
|
||||
// В нём будет производиться проверка события смены перевода приложения
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
signals:
|
||||
//void signal_authorizationChanged();
|
||||
void sigRecognize();
|
||||
QTcpSocket* sigGetSocket();
|
||||
void sigLog(QString log);
|
||||
|
||||
|
||||
public slots:
|
||||
void slot_LanguageChanged(QString language);
|
||||
void addClient(qintptr descriptor, ClientHandler *client);
|
||||
void slotUpdateListClients();
|
||||
void slot_BlockAutorization(bool block);
|
||||
|
||||
private slots:
|
||||
//слот обработки сигнала о готовности нового сообщения на отправку клиенту от мессенджера
|
||||
void slot_msgToClientReady(QString login, QString text);
|
||||
void slotAddToLog(QString msg);
|
||||
void slotAddToMessanger(QString login, QString text);
|
||||
|
||||
public:
|
||||
|
||||
void removeClient(int socketId);
|
||||
void blockAutorization()
|
||||
{
|
||||
stateBlockAutorization = blocked;
|
||||
}
|
||||
void unBlockAutorization()
|
||||
{
|
||||
stateBlockAutorization = unblocked;
|
||||
}
|
||||
|
||||
EStateBlockAutorization getStateBlockAutorization() const
|
||||
{
|
||||
return stateBlockAutorization;
|
||||
}
|
||||
|
||||
QMap<int, ClientHandler *> getClientsMap() const;
|
||||
|
||||
private slots:
|
||||
void on_btnStartServer_clicked();
|
||||
void on_btnStopServer_clicked();
|
||||
void on_btnTaskSet_clicked();
|
||||
|
||||
|
||||
private:
|
||||
bool startServer();
|
||||
bool stopServer();
|
||||
|
||||
private:
|
||||
MultiThreadServer * tcpServer;
|
||||
qint16 hostPort;
|
||||
QMap<int, ClientHandler*> clientsMap;
|
||||
EStateServer stateServer;
|
||||
EStateBlockAutorization stateBlockAutorization;
|
||||
|
||||
InstructorsAndTraineesWidget* pInstructorsAndTrainees;
|
||||
MessangerWidget* pMessangerWidget;
|
||||
|
||||
QThread *updateThread;
|
||||
QThread *loggerThread;
|
||||
|
||||
DataParser *dataParser;
|
||||
ProcessingSystem *processingSystem;
|
||||
UpdateController *updateController;
|
||||
Logger *logger;
|
||||
|
||||
bool first = true; // для тестов Unity
|
||||
|
||||
private:
|
||||
Ui::ServerLMSWidget *ui;
|
||||
QTranslator qtLanguageTranslator;
|
||||
|
||||
};
|
||||
|
||||
#endif // SERVERLMSWIDGET_H
|
||||
204
ServerLMS/ServerLMS/serverlmswidget.ui
Normal file
204
ServerLMS/ServerLMS/serverlmswidget.ui
Normal file
@@ -0,0 +1,204 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ServerLMSWidget</class>
|
||||
<widget class="QWidget" name="ServerLMSWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>574</width>
|
||||
<height>817</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Server LMS</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="4" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Logger</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidgetLogger">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>List of clients</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget_Clients">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnStartServer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnStopServer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>Tasks</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboTasks"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnTaskSet">
|
||||
<property name="text">
|
||||
<string>Set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
84
ServerLMS/ServerLMS/typesDataServerClient.h
Normal file
84
ServerLMS/ServerLMS/typesDataServerClient.h
Normal file
@@ -0,0 +1,84 @@
|
||||
#ifndef TYPESDATASERVERCLIENT_H
|
||||
#define TYPESDATASERVERCLIENT_H
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#define NOTIFY_SERVER_END "END"
|
||||
#define NOTIFY_SERVER_BLOCKED "BLOCKED"
|
||||
#define SERVER_HELLO "NewConnection. I am server LMS!"
|
||||
|
||||
enum EStateServer{started, stoped};
|
||||
enum EStateBlockAutorization{blocked, unblocked};
|
||||
|
||||
struct FileData
|
||||
{
|
||||
QString path;
|
||||
QString hash;
|
||||
|
||||
bool operator==(const FileData& other)const
|
||||
{
|
||||
if (this->path== other.path && this->hash == other.hash) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct SAttribute
|
||||
{
|
||||
QString name;
|
||||
QString value;
|
||||
|
||||
};
|
||||
|
||||
struct SXmlAnswerTag
|
||||
{
|
||||
QString elementName;
|
||||
QList<SAttribute> attr;
|
||||
};
|
||||
|
||||
class ClientAutorization
|
||||
{
|
||||
public:
|
||||
QString Login;
|
||||
QString Password;
|
||||
int NumberOfScreen;
|
||||
};
|
||||
|
||||
class ServerMessage
|
||||
{
|
||||
public:
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ClientMessage
|
||||
{
|
||||
public:
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ServerTask
|
||||
{
|
||||
public:
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ServerNotify
|
||||
{
|
||||
public:
|
||||
QString Code;
|
||||
};
|
||||
|
||||
class ClientNotify
|
||||
{
|
||||
public:
|
||||
QString Code;
|
||||
};
|
||||
|
||||
class DataInfo{
|
||||
public:
|
||||
QString path;
|
||||
quint64 size;
|
||||
};
|
||||
|
||||
#endif // TYPESDATASERVERCLIENT_H
|
||||
Reference in New Issue
Block a user