0606更新

main
“zcw” 3 years ago
parent fc6092fb31
commit 1a164dd24e

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 10.0.0, 2023-06-05T15:13:37. --> <!-- Written by QtCreator 10.0.0, 2023-06-06T09:53:46. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@ -401,305 +401,9 @@
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value> <value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap> </valuemap>
</data> </data>
<data>
<variable>ProjectExplorer.Project.Target.1</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">WebAssemblyDeviceType</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.14.2 WebAssembly</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.14.2 WebAssembly</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.wasm_32_kit</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">-1</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="CMake.Build.Type">Debug</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\zcw\Desktop\DAM\build-DAM-Qt_5_14_2_WebAssembly-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="CMake.Build.Type">Release</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\zcw\Desktop\DAM\build-DAM-Qt_5_14_2_WebAssembly-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\zcw\Desktop\DAM\build-DAM-Qt_5_14_2_WebAssembly-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\zcw\Desktop\DAM\build-DAM-Qt_5_14_2_WebAssembly-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.4">
<value type="QString" key="CMake.Build.Type">MinSizeRel</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_BUILD_TYPE:STRING=MinSizeRel
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\zcw\Desktop\DAM\build-DAM-Qt_5_14_2_WebAssembly-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" 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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">5</value>
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data> <data>
<variable>ProjectExplorer.Project.TargetCount</variable> <variable>ProjectExplorer.Project.TargetCount</variable>
<value type="qlonglong">2</value> <value type="qlonglong">1</value>
</data> </data>
<data> <data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable> <variable>ProjectExplorer.Project.Updater.FileVersion</variable>

@ -3,5 +3,17 @@
<file>Static/close.png</file> <file>Static/close.png</file>
<file>Static/min.png</file> <file>Static/min.png</file>
<file>Static/DamQSS.Qss</file> <file>Static/DamQSS.Qss</file>
<file>Static/fanNormal.png</file>
<file>Static/fanError.png</file>
<file>Static/fanHutdown.png</file>
<file>Static/fanRun.png</file>
<file>Static/fanStandby.png</file>
<file>Static/flangeError.png</file>
<file>Static/flangeNormal.png</file>
<file>Static/gyroError.png</file>
<file>Static/gyroNormal.png</file>
<file>Static/headError.png</file>
<file>Static/headNormal.png</file>
<file>Static/fanInterrupted.png</file>
</qresource> </qresource>
</RCC> </RCC>

@ -13,6 +13,27 @@ using json = nlohmann::json;
using namespace std; using namespace std;
HTTPClient httpClient; HTTPClient httpClient;
FanManage fans;
void delNameFromList(QString element){
fans.interruptedFans.erase(std::remove(fans.interruptedFans.begin(), fans.interruptedFans.end(), element), fans.interruptedFans.end());
fans.standbyFans.erase(std::remove(fans.standbyFans.begin(), fans.standbyFans.end(), element), fans.standbyFans.end());
fans.normalFans.erase(std::remove(fans.normalFans.begin(), fans.normalFans.end(), element), fans.normalFans.end());
fans.failureFans.erase(std::remove(fans.failureFans.begin(), fans.failureFans.end(), element), fans.failureFans.end());
fans.hutdownFans.erase(std::remove(fans.hutdownFans.begin(), fans.hutdownFans.end(), element), fans.hutdownFans.end());
fans.runFans.erase(std::remove(fans.runFans.begin(), fans.runFans.end(), element), fans.runFans.end());
}
bool isInLists(QString element) {
// 使用 std::find_first_of 函数查找元素是否在列表中
auto it1 = std::find_first_of(fans.standbyFans.begin(), fans.standbyFans.end(), &element, &element + 1);
auto it2 = std::find_first_of(fans.hutdownFans.begin(), fans.hutdownFans.end(), &element, &element + 1);
auto it3 = std::find_first_of(fans.runFans.begin(), fans.runFans.end(), &element, &element + 1);
// 如果元素在任意一个列表中,则返回 true否则返回 false
return it1 != fans.standbyFans.end() || it2 != fans.hutdownFans.end() || it3 != fans.runFans.end();
}
HTTPClient::HTTPClient() : client("https://121.36.33.250:9000") { HTTPClient::HTTPClient() : client("https://121.36.33.250:9000") {
header = {{"GroupId", "dam"}}; header = {{"GroupId", "dam"}};
@ -24,26 +45,42 @@ HTTPClient httpClient;
client.enable_server_certificate_verification(false); // 取消SSL验证 client.enable_server_certificate_verification(false); // 取消SSL验证
} }
FanManage HTTPClient::getFanList(){ void HTTPClient::getFanList(){
FanManage Fans; if (auto res = client.Post(fanListIndex, header)) {
if (auto res = client.Post(fanListIndex, header)) { json resJson = json::parse(res->body);
json resJson = json::parse(res->body); for (const auto& data : resJson["data"]) {
for (const auto& data : resJson["data"]) { FanClass fan;
FanClass fan; fan.fanCode = QString::fromStdString(data["fanCode"]);
fan.fanCode = QString::fromStdString(data["fanCode"]); if (data["functions"]["gyro"]["features"][0]["featureValue"].is_number()) {
if (data["functions"]["gyro"]["features"][0]["featureValue"].is_number() && data["functions"]["headRoom"]["features"][0]["featureValue"].is_number()) {
fan.angle = data["functions"]["gyro"]["features"][0]["featureValue"].get<double>(); fan.angle = data["functions"]["gyro"]["features"][0]["featureValue"].get<double>();
fan.distance = data["functions"]["headRoom"]["features"][0]["featureValue"].get<double>(); }
} if (data["functions"]["headRoom"]["features"][0]["featureValue"].is_number()){
fan.gyroState = QString::fromStdString(data["functions"]["flange"]["state"]); fan.distance = data["functions"]["headRoom"]["features"][0]["featureValue"].get<double>();
fan.flangeState = QString::fromStdString(data["functions"]["gyro"]["state"]); }
fan.headroomState = QString::fromStdString(data["functions"]["headRoom"]["state"]); fan.gyroState = QString::fromStdString(data["functions"]["flange"]["state"]);
Fans.allFans[fan.fanCode] = fan; fan.flangeState = QString::fromStdString(data["functions"]["gyro"]["state"]);
//std::cout << fan.angle << std::endl; fan.headroomState = QString::fromStdString(data["functions"]["headRoom"]["state"]);
fans.allFans[fan.fanCode] = fan;
} if (isInLists(fan.fanCode)){
} return;
return Fans; }
delNameFromList(fan.fanCode);
if (fan.gyroState == QString("正常") && fan.flangeState == QString("正常") && fan.headroomState == QString("正常")){
fans.normalFans.push_back(fan.fanCode);
fans.states[fan.fanCode] = QString("正常运行");
}
if (fan.gyroState == QString("故障") || fan.flangeState == QString("故障") || fan.headroomState == QString("故障")){
fans.failureFans.push_back(fan.fanCode);
fans.states[fan.fanCode] = QString("故障停机");
}
if (fan.gyroState == QString("通讯中断") || fan.flangeState == QString("通讯中断") || fan.headroomState == QString("通讯中断")){
fans.interruptedFans.push_back(fan.fanCode);
fans.states[fan.fanCode] = QString("通讯中断");
}
// std::cout << fan.distance << std::endl;
}
}
} }
QString HTTPClient::getFlangeList(int fanId) { QString HTTPClient::getFlangeList(int fanId) {

@ -10,15 +10,18 @@
#include <iostream> #include <iostream>
#include <httplib.h> #include <httplib.h>
#include <QString> #include <QString>
#include <QMenu>
using namespace std; using namespace std;
void delNameFromList(QString element);
class FanClass // 风机类 class FanClass // 风机类
{ {
public: public:
int errorCode; int errorCode;
int fanId; int fanId;
double angle; // 角度 double angle = 0; // 角度
double distance; // 相对距离 double distance = 0; // 相对距离
QString errorInfo; QString errorInfo;
QString fanCode; QString fanCode;
QString flangeState; QString flangeState;
@ -31,6 +34,7 @@ class FanManage // 所有风机管理类
{ {
public: public:
std::map<QString, FanClass> allFans; // 所有风机 std::map<QString, FanClass> allFans; // 所有风机
std::map<QString, QString> states; // 风机状态
std::vector<QString> interruptedFans; // 通讯中断 std::vector<QString> interruptedFans; // 通讯中断
std::vector<QString> standbyFans; // 待机等风 std::vector<QString> standbyFans; // 待机等风
std::vector<QString> normalFans; // 正常运行 std::vector<QString> normalFans; // 正常运行
@ -54,7 +58,7 @@ private:
public: public:
httplib::Client client; httplib::Client client;
HTTPClient(); HTTPClient();
FanManage getFanList(); void getFanList();
QString getFlangeList(int fanId); QString getFlangeList(int fanId);
QString getHeadroomList(int fanId); QString getHeadroomList(int fanId);
QString getGyroList(int fanId); QString getGyroList(int fanId);
@ -62,7 +66,7 @@ public:
}; };
extern HTTPClient httpClient; extern HTTPClient httpClient;
extern FanManage fans;

@ -32,7 +32,7 @@ public:
QPushButton *clearanceButton; QPushButton *clearanceButton;
QPushButton *gyroscopeButton; QPushButton *gyroscopeButton;
QStackedWidget *stackedWidget; QStackedWidget *stackedWidget;
Ui::MonitorWidget *monitorPage; MonitorWidget *monitorPage;
Ui::ClearanceAnalyticWidget *clearancePage; Ui::ClearanceAnalyticWidget *clearancePage;
Ui::FlangeAnalyticWidget *flangePage; Ui::FlangeAnalyticWidget *flangePage;
Ui::GyroscopeAnalyticWidget *gyroscopePage; Ui::GyroscopeAnalyticWidget *gyroscopePage;
@ -113,7 +113,7 @@ public:
stackedWidget = new QStackedWidget(centralwidget); stackedWidget = new QStackedWidget(centralwidget);
stackedWidget->setObjectName(QString::fromUtf8("stackedWidget")); stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
monitorPage = new Ui::MonitorWidget(); monitorPage = new MonitorWidget();
monitorPage->setObjectName(QString::fromUtf8("monitorPage")); monitorPage->setObjectName(QString::fromUtf8("monitorPage"));
stackedWidget->addWidget(monitorPage); stackedWidget->addWidget(monitorPage);

@ -11,6 +11,11 @@
#include <QtWidgets/QStackedWidget> #include <QtWidgets/QStackedWidget>
#include <QtWidgets/QVBoxLayout> #include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
#include <QTimer>
#include <QContextMenuEvent>
#include <QComboBox>
#include <QDebug>
#include "../HTTPClient/client.h" #include "../HTTPClient/client.h"
@ -30,13 +35,18 @@ public:
QPushButton *clearanceButton; QPushButton *clearanceButton;
QPushButton *flangeButton; QPushButton *flangeButton;
QPushButton *gyroscopeButton; QPushButton *gyroscopeButton;
QLabel *speedLabel; QLabel *distanceLabel;
QLabel *powerLabel; QLabel *angelLabel;
QWidget *simplifyPage; QWidget *simplifyPage;
QWidget *horizontalLayoutWidget; QWidget *horizontalLayoutWidget;
QHBoxLayout *horizontalLayout_2; QHBoxLayout *horizontalLayout_2;
QLabel *pictureLabel_2; QLabel *pictureLabel_2;
QLabel *statusLabel; QLabel *statusLabel;
QComboBox *stateBox;
FanClass fan;
QTimer timer;
int state;
void setupUi(QWidget *MonitorTag) void setupUi(QWidget *MonitorTag)
{ {
@ -46,7 +56,7 @@ public:
horizontalLayout = new QHBoxLayout(MonitorTag); horizontalLayout = new QHBoxLayout(MonitorTag);
horizontalLayout->setSpacing(0); horizontalLayout->setSpacing(0);
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
horizontalLayout->setContentsMargins(0, 0, 0, 0); horizontalLayout->setContentsMargins(10, 10, 10, 10);
stackedWidget = new QStackedWidget(MonitorTag); stackedWidget = new QStackedWidget(MonitorTag);
stackedWidget->setObjectName(QString::fromUtf8("stackedWidget")); stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
@ -59,6 +69,31 @@ public:
verticalLayout = new QVBoxLayout(); verticalLayout = new QVBoxLayout();
verticalLayout->setSpacing(0); verticalLayout->setSpacing(0);
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
stateBox = new QComboBox(MonitorTag);
QStringList options = {"远程模式", "待机等风", "停机维护", "启动"};
stateBox->addItems(options);
auto it1 = std::find(fans.standbyFans.begin(), fans.standbyFans.end(), fan.fanCode);
auto it2 = std::find(fans.hutdownFans.begin(), fans.hutdownFans.end(), fan.fanCode);
auto it3 = std::find(fans.runFans.begin(), fans.runFans.end(), fan.fanCode);
if (it1 != fans.standbyFans.end()){
stateBox->setCurrentIndex(1);
}
else if (it2 != fans.hutdownFans.end()){
stateBox->setCurrentIndex(2);
}
else if (it3 != fans.runFans.end()){
stateBox->setCurrentIndex(3);
}
else{
stateBox->setCurrentIndex(0);
}
connect(stateBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) {this->stateChanged(index);});
verticalLayout->addWidget(stateBox);
pictureLabel = new QLabel(detailPage); pictureLabel = new QLabel(detailPage);
pictureLabel->setObjectName(QString::fromUtf8("pictureLabel")); pictureLabel->setObjectName(QString::fromUtf8("pictureLabel"));
pictureLabel->setAlignment(Qt::AlignCenter); pictureLabel->setAlignment(Qt::AlignCenter);
@ -71,7 +106,8 @@ public:
verticalLayout->addWidget(nameLabel); verticalLayout->addWidget(nameLabel);
verticalLayout->setStretch(0, 8); verticalLayout->setStretch(0, 1);
verticalLayout->setStretch(1, 9);
verticalLayout->setStretch(1, 2); verticalLayout->setStretch(1, 2);
horizontalLayout_3->addLayout(verticalLayout); horizontalLayout_3->addLayout(verticalLayout);
@ -94,15 +130,15 @@ public:
gridLayout->addWidget(gyroscopeButton, 0, 2, 1, 1); gridLayout->addWidget(gyroscopeButton, 0, 2, 1, 1);
speedLabel = new QLabel(detailPage); distanceLabel = new QLabel(detailPage);
speedLabel->setObjectName(QString::fromUtf8("speedLabel")); distanceLabel->setObjectName(QString::fromUtf8("distanceLabel"));
gridLayout->addWidget(speedLabel, 2, 0, 1, 3); gridLayout->addWidget(distanceLabel, 2, 0, 1, 3);
powerLabel = new QLabel(detailPage); angelLabel = new QLabel(detailPage);
powerLabel->setObjectName(QString::fromUtf8("powerLabel")); angelLabel->setObjectName(QString::fromUtf8("angelLabel"));
gridLayout->addWidget(powerLabel, 1, 0, 1, 3); gridLayout->addWidget(angelLabel, 1, 0, 1, 3);
horizontalLayout_3->addLayout(gridLayout); horizontalLayout_3->addLayout(gridLayout);
@ -110,9 +146,9 @@ public:
stackedWidget->addWidget(detailPage); stackedWidget->addWidget(detailPage);
simplifyPage = new QWidget(); simplifyPage = new QWidget();
simplifyPage->setObjectName(QString::fromUtf8("simplifyPage")); simplifyPage->setObjectName(QString::fromUtf8("simplifyPage"));
horizontalLayoutWidget = new QWidget(simplifyPage); horizontalLayoutWidget = new QWidget(simplifyPage);
horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget")); horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget"));
horizontalLayoutWidget->setGeometry(QRect(110, 50, 471, 241));
horizontalLayout_2 = new QHBoxLayout(horizontalLayoutWidget); horizontalLayout_2 = new QHBoxLayout(horizontalLayoutWidget);
horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
horizontalLayout_2->setContentsMargins(0, 0, 0, 0); horizontalLayout_2->setContentsMargins(0, 0, 0, 0);
@ -126,6 +162,8 @@ public:
statusLabel->setObjectName(QString::fromUtf8("statusLabel")); statusLabel->setObjectName(QString::fromUtf8("statusLabel"));
statusLabel->setAlignment(Qt::AlignCenter); statusLabel->setAlignment(Qt::AlignCenter);
statusLabel->setText(fan.fanCode + fans.states[fan.fanCode]);
simplifyPage->setLayout(horizontalLayout_2); simplifyPage->setLayout(horizontalLayout_2);
horizontalLayout_2->addWidget(statusLabel); horizontalLayout_2->addWidget(statusLabel);
@ -134,35 +172,123 @@ public:
horizontalLayout->addWidget(stackedWidget); horizontalLayout->addWidget(stackedWidget);
if (state == 1){
stackedWidget->setCurrentIndex(1);
}else{
stackedWidget->setCurrentIndex(0);
}
nameLabel->setText(fan.fanCode);
if (fan.angle != 0){
angelLabel->setText("角度: " + QString::number(fan.angle));
}else{
angelLabel->setText("角度: 数据为空");
}
if (fan.distance != 0){
distanceLabel->setText("距离: " + QString::number(fan.distance));
}else{
distanceLabel->setText("距离: 数据为空");
}
QMetaObject::connectSlotsByName(MonitorTag);
if (fans.states[fan.fanCode] == QString("正常运行")){
QPixmap pixmap(":/Static/fanNormal.png");
pixmap = pixmap.scaled(100, 100, Qt::KeepAspectRatio);
pictureLabel->setPixmap(pixmap);
pictureLabel_2->setPixmap(pixmap);
this->setStyleSheet("QWidget#MonitorTag{background-color: #374065;border-radius: 5px;border: 3px solid;border-color: #1AFA29;}");
}else if (fans.states[fan.fanCode] == QString("通讯中断")){
QPixmap pixmap(":/Static/fanfanInterrupted.png");
pixmap = pixmap.scaled(100, 100, Qt::KeepAspectRatio);
pictureLabel->setPixmap(pixmap);
pictureLabel_2->setPixmap(pixmap);
this->setStyleSheet("QWidget#MonitorTag{background-color: #374065;border-radius: 5px;border: 3px solid;border-color: white;}");
}else if (fans.states[fan.fanCode] == QString("待机等风")){
QPixmap pixmap(":/Static/fanStandby.png");
pixmap = pixmap.scaled(100, 100, Qt::KeepAspectRatio);
pictureLabel->setPixmap(pixmap);
pictureLabel_2->setPixmap(pixmap);
this->setStyleSheet("QWidget#MonitorTag{background-color: #374065;border-radius: 5px;border: 3px solid;border-color: #F4EA2A;}");
}else if (fans.states[fan.fanCode] == QString("停机维护")){
QPixmap pixmap(":/Static/fanHutdown.png");
pixmap = pixmap.scaled(100, 100, Qt::KeepAspectRatio);
pictureLabel->setPixmap(pixmap);
pictureLabel_2->setPixmap(pixmap);
this->setStyleSheet("QWidget#MonitorTag{background-color: #374065;border-radius: 5px;border: 3px solid;border-color: #C0397C;}");
}else if (fans.states[fan.fanCode] == QString("故障停机")){
QPixmap pixmap(":/Static/fanError.png");
pixmap = pixmap.scaled(100, 100, Qt::KeepAspectRatio);
pictureLabel->setPixmap(pixmap);
pictureLabel_2->setPixmap(pixmap);
this->setStyleSheet("QWidget#MonitorTag{background-color: #374065;border-radius: 5px;border: 3px solid;border-color: #d81e06;}");
}else if (fans.states[fan.fanCode] == QString("启动")){
QPixmap pixmap(":/Static/fanRun.png");
pixmap = pixmap.scaled(100, 100, Qt::KeepAspectRatio);
pictureLabel->setPixmap(pixmap);
pictureLabel_2->setPixmap(pixmap);
this->setStyleSheet("QWidget#MonitorTag{background-color: #374065;border-radius: 5px;border: 3px solid;border-color: #0caba2;}");
}
if (fan.headroomState == QString("正常")){
clearanceButton->setIcon(QIcon(":/Static/headNormal.png"));
}
if (fan.headroomState == QString("故障")){
clearanceButton->setIcon(QIcon(":/Static/headError.png"));
}
if (fan.flangeState == QString("正常")){
flangeButton->setIcon(QIcon(":/Static/flangeNormal.png"));
}
if (fan.flangeState == QString("故障")){
flangeButton->setIcon(QIcon(":/Static/flangeError.png"));
}
if (fan.gyroState == QString("正常")){
gyroscopeButton->setIcon(QIcon(":/Static/gyroNormal.png"));
}
if (fan.gyroState == QString("故障")){
gyroscopeButton->setIcon(QIcon(":/Static/gyroError.png"));
}
} // setupUi
retranslateUi(MonitorTag); void stateChanged(int index){
// "远程模式", "待机等风", "停机维护", "启动"
switch (index){
case 0:
delNameFromList(fan.fanCode);
break;
case 1:
delNameFromList(fan.fanCode);
fans.standbyFans.push_back(fan.fanCode);
fans.states[fan.fanCode] = QString("待机等风");
break;
case 2:
delNameFromList(fan.fanCode);
fans.hutdownFans.push_back(fan.fanCode);
for (auto it = fans.runFans.begin(); it != fans.runFans.end(); ++it) {qDebug() << *it;}
fans.states[fan.fanCode] = QString("停机维护");
break;
case 3:
delNameFromList(fan.fanCode);
fans.runFans.push_back(fan.fanCode);
fans.states[fan.fanCode] = QString("启动");
break;
}
}
stackedWidget->setCurrentIndex(0);
QMetaObject::connectSlotsByName(MonitorTag);
} // setupUi
void retranslateUi(QWidget *MonitorTag)
{ MonitorTag(FanClass fan, int state) : fan(fan), state(state)
MonitorTag->setWindowTitle(QCoreApplication::translate("MonitorTag", "Form", nullptr));
pictureLabel->setText(QCoreApplication::translate("MonitorTag", "\350\256\276\345\244\207\345\233\276", nullptr));
nameLabel->setText(QCoreApplication::translate("MonitorTag", "\350\256\276\345\244\207\345\220\215\347\247\260", nullptr));
clearanceButton->setText(QCoreApplication::translate("MonitorTag", "\345\212\237\350\203\2752", nullptr));
flangeButton->setText(QCoreApplication::translate("MonitorTag", "\345\212\237\350\203\2751", nullptr));
gyroscopeButton->setText(QCoreApplication::translate("MonitorTag", "\345\212\237\350\203\2753", nullptr));
speedLabel->setText(QCoreApplication::translate("MonitorTag", "\346\225\260\345\200\274B\357\274\232", nullptr));
powerLabel->setText(QCoreApplication::translate("MonitorTag", "\346\225\260\345\200\274A\357\274\232", nullptr));
pictureLabel_2->setText(QCoreApplication::translate("MonitorTag", "\350\256\276\345\244\207\345\233\276\347\211\207", nullptr));
statusLabel->setText(QCoreApplication::translate("MonitorTag", "\350\256\276\345\244\207\347\212\266\346\200\201", nullptr));
} // retranslateUi
MonitorTag(FanClass fan)
{ {
setupUi(this); setupUi(this);
} }
}; };

@ -12,13 +12,17 @@
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
#include <QtWidgets/QScrollArea> #include <QtWidgets/QScrollArea>
#include <QDebug> #include <QDebug>
#include <QTimer>
#include <QMouseEvent>
#include <QApplication>
#include <QIcon>
#include "MonitorTagUI.h" #include "MonitorTagUI.h"
#include "../HTTPClient/client.h" #include "../HTTPClient/client.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class Ui_MonitorWidget:public QWidget class MonitorWidget:public QWidget
{ {
public: public:
QVBoxLayout *verticalLayout; QVBoxLayout *verticalLayout;
@ -37,6 +41,7 @@ public:
int state; int state;
QList<QList<MonitorTag*>> tagList; QList<QList<MonitorTag*>> tagList;
QTimer *timer;
void setupUi(QWidget *MonitorWidget) void setupUi(QWidget *MonitorWidget)
{ {
@ -90,31 +95,38 @@ public:
filterlLayout->setObjectName(QString::fromUtf8("filterlLayout")); filterlLayout->setObjectName(QString::fromUtf8("filterlLayout"));
interruptedButton = new QPushButton(MonitorWidget); interruptedButton = new QPushButton(MonitorWidget);
interruptedButton->setObjectName(QString::fromUtf8("interruptedButton")); interruptedButton->setObjectName(QString::fromUtf8("interruptedButton"));
interruptedButton->setIcon(QIcon(":/Static/fanInterrupted.png"));
filterlLayout->addWidget(interruptedButton); filterlLayout->addWidget(interruptedButton);
normalButton = new QPushButton(MonitorWidget); normalButton = new QPushButton(MonitorWidget);
normalButton->setObjectName(QString::fromUtf8("normalButton")); normalButton->setObjectName(QString::fromUtf8("normalButton"));
normalButton->setIcon(QIcon(":/Static/fanNormal.png"));
filterlLayout->addWidget(normalButton); filterlLayout->addWidget(normalButton);
standbyButton = new QPushButton(MonitorWidget); standbyButton = new QPushButton(MonitorWidget);
standbyButton->setObjectName(QString::fromUtf8("standbyButton")); standbyButton->setObjectName(QString::fromUtf8("standbyButton"));
standbyButton->setIcon(QIcon(":/Static/fanStandby.png"));
filterlLayout->addWidget(standbyButton); filterlLayout->addWidget(standbyButton);
hutdownButton = new QPushButton(MonitorWidget); hutdownButton = new QPushButton(MonitorWidget);
hutdownButton->setObjectName(QString::fromUtf8("hutdownButton")); hutdownButton->setObjectName(QString::fromUtf8("hutdownButton"));
hutdownButton->setIcon(QIcon(":/Static/fanHutdown.png"));
filterlLayout->addWidget(hutdownButton); filterlLayout->addWidget(hutdownButton);
failureButton = new QPushButton(MonitorWidget); failureButton = new QPushButton(MonitorWidget);
failureButton->setObjectName(QString::fromUtf8("failureButton")); failureButton->setObjectName(QString::fromUtf8("failureButton"));
failureButton->setIcon(QIcon(":/Static/fanError.png"));
filterlLayout->addWidget(failureButton); filterlLayout->addWidget(failureButton);
runButton = new QPushButton(MonitorWidget); runButton = new QPushButton(MonitorWidget);
runButton->setObjectName(QString::fromUtf8("runButton")); runButton->setObjectName(QString::fromUtf8("runButton"));
runButton->setIcon(QIcon(":/Static/fanRun.png"));
filterlLayout->addWidget(runButton); filterlLayout->addWidget(runButton);
filterlLayout->setContentsMargins(10, 10, 10, 10); filterlLayout->setContentsMargins(10, 10, 10, 10);
@ -128,33 +140,46 @@ public:
MonitorWidget->setLayout(verticalLayout); MonitorWidget->setLayout(verticalLayout);
retranslateUi(MonitorWidget);
QMetaObject::connectSlotsByName(MonitorWidget); QMetaObject::connectSlotsByName(MonitorWidget);
retranslateUi(MonitorWidget);
addTag(); addTag();
timer = new QTimer(MonitorWidget);
QObject::connect(timer, &QTimer::timeout, [&]() {
// 计时器超时时更新标签
addTag();
});
timer->start(5000);
connect(exchangeButton, &QPushButton::clicked, this, [=](){this->exchangeClicked();});
} // setupUi } // setupUi
void retranslateUi(QWidget *MonitorWidget) void retranslateUi(QWidget *MonitorWidget)
{ {
MonitorWidget->setWindowTitle(QCoreApplication::translate("MonitorWidget", "Form", nullptr)); MonitorWidget->setWindowTitle(QCoreApplication::translate("MonitorWidget", "Form", nullptr));
exchangeButton->setText(QCoreApplication::translate("MonitorWidget", "\345\244\247\345\260\217\345\233\276\346\240\207\345\210\207\346\215\242", nullptr)); exchangeButton->setText(QCoreApplication::translate("MonitorWidget", "\345\244\247\345\260\217\345\233\276\346\240\207\345\210\207\346\215\242", nullptr));
interruptedButton->setText(QCoreApplication::translate("MonitorWidget", "\351\200\232\350\256\257\344\270\255\346\226\255 x\345\217\260", nullptr));
normalButton->setText(QCoreApplication::translate("MonitorWidget", "\346\255\243\345\270\270\350\277\220\350\241\214 x\345\217\260", nullptr));
standbyButton->setText(QCoreApplication::translate("MonitorWidget", "\345\276\205\346\234\272\347\255\211\351\243\216 x\345\217\260", nullptr));
hutdownButton->setText(QCoreApplication::translate("MonitorWidget", "\345\201\234\346\234\272\347\273\264\346\212\244 x\345\217\260", nullptr));
failureButton->setText(QCoreApplication::translate("MonitorWidget", "\346\225\205\351\232\234\345\276\205\346\234\272 x\345\217\260", nullptr));
runButton->setText(QCoreApplication::translate("MonitorWidget", "\345\220\257\345\212\250 x\345\217\260", nullptr));
} // retranslateUi } // retranslateUi
void exchangeClicked(MonitorTag *newTag) void exchangeClicked()
{ {
if (this->state == 1) { int count = monitorLayout->count();
newTag->stackedWidget->setCurrentIndex(1);
} else if (this->state == 0) { // 遍历布局中的所有子对象
newTag->stackedWidget->setCurrentIndex(0); for (int i = 0; i < count; ++i) {
// 获取第 i 个子对象的指针
QLayoutItem *item = monitorLayout->itemAt(i);
MonitorTag *tag = dynamic_cast<MonitorTag*>(item->widget());
// 判断子对象的类型
if (tag) {
if (this->state == 1) {
tag->stackedWidget->setCurrentIndex(1);
} else if (this->state == 0) {
tag->stackedWidget->setCurrentIndex(0);
}
}
} }
} }
void changeState() void changeState()
@ -168,27 +193,35 @@ public:
void addTag() void addTag()
{ {
map fans = httpClient.getFanList().allFans; httpClient.getFanList();
map allFans = fans.allFans;
// 获取与 clicked() 信号相关的接收器数量
while (QLayoutItem *item = monitorLayout->takeAt(0)) {
if (QWidget *widget = item->widget()) {
widget->deleteLater(); // 或使用 delete 关键字删除控件的内存
}
delete item;
}
tagList.clear(); tagList.clear();
int count = 0; int count = 0;
int index = 0; int index = 0;
QList<MonitorTag*> tags; QList<MonitorTag*> tags;
for (auto it = fans.begin(); it != fans.end(); ++it) { for (auto it = allFans.begin(); it != allFans.end(); ++it) {
if (index == 6){ if (index == 6){
tagList.append(tags); tagList.append(tags);
tags.clear(); tags.clear();
index = 0; index = 0;
count++; count++;
} }
MonitorTag *newTag = new MonitorTag(it->second); MonitorTag *newTag = new MonitorTag(it->second, state);
connect(exchangeButton, &QPushButton::clicked, this, [=](){this->exchangeClicked(newTag);});
monitorLayout->addWidget(newTag, count, index); monitorLayout->addWidget(newTag, count, index);
tags.append(newTag); tags.append(newTag);
index++; index++;
} }
if (fans.size() < 28){ if (allFans.size() < 28){
fillWidget->setFixedHeight(228 * 4); fillWidget->setFixedHeight(228 * 4);
for (int i = 0; i < 28 - fans.size(); i++) { for (int i = 0; i < 28 - allFans.size(); i++) {
if (index == 6){ if (index == 6){
index = 0; index = 0;
count++; count++;
@ -203,12 +236,22 @@ public:
monitorLayout->setRowStretch(3, 1); monitorLayout->setRowStretch(3, 1);
} }
fillWidget->setFixedWidth(1900); fillWidget->setFixedWidth(1900);
int c = monitorLayout->count(); setButtonMes();
qDebug() << c; // int c = monitorLayout->count();
// qDebug() << c;
}
void setButtonMes(){
interruptedButton->setText(QString("通讯中断") + QString::number(fans.interruptedFans.size()));
normalButton->setText(QString("正常运行") + QString::number(fans.normalFans.size()));
standbyButton->setText(QString("待机等风") + QString::number(fans.standbyFans.size()));
hutdownButton->setText(QString("停机维护") + QString::number(fans.hutdownFans.size()));
failureButton->setText(QString("故障停机") + QString::number(fans.interruptedFans.size()));
runButton->setText(QString("启动") + QString::number(fans.runFans.size()));
} }
Ui_MonitorWidget() MonitorWidget()
{ {
setupUi(this); setupUi(this);
} }
@ -219,9 +262,7 @@ public:
namespace Ui {
class MonitorWidget: public Ui_MonitorWidget {};
} // namespace Ui
QT_END_NAMESPACE QT_END_NAMESPACE

@ -21,6 +21,12 @@ QLabel{
} }
QPushButton#ClearanceButton, QPushButton#FlangeButton, QPushButton#GyroscopeButton{
border: none;
}
QPushButton#monitorButton, QPushButton#flangeButton, QPushButton#clearanceButton, QPushButton#gyroscopeButton{ QPushButton#monitorButton, QPushButton#flangeButton, QPushButton#clearanceButton, QPushButton#gyroscopeButton{
color: white; color: white;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Loading…
Cancel
Save