Bladeren bron

RDIMM source code

Wg 2 weken geleden
bovenliggende
commit
33cc7c86ba
39 gewijzigde bestanden met toevoegingen van 57420 en 0 verwijderingen
  1. 35 0
      XJKJ-rdimm/XJKJ_QT/XJKJ_QT.pro
  2. 318 0
      XJKJ-rdimm/XJKJ_QT/XJKJ_QT.pro.user
  3. 12 0
      XJKJ-rdimm/XJKJ_QT/clickframe.cpp
  4. 21 0
      XJKJ-rdimm/XJKJ_QT/clickframe.h
  5. 21 0
      XJKJ-rdimm/XJKJ_QT/main.cpp
  6. 196 0
      XJKJ-rdimm/XJKJ_QT/mainwindow.cpp
  7. 48 0
      XJKJ-rdimm/XJKJ_QT/mainwindow.h
  8. 1051 0
      XJKJ-rdimm/XJKJ_QT/mainwindow.ui
  9. 268 0
      XJKJ-rdimm/XJKJ_QT/pid.cpp
  10. 30 0
      XJKJ-rdimm/XJKJ_QT/pid.h
  11. 35529 0
      XJKJ-rdimm/XJKJ_QT/qcustomplot.cpp
  12. 7774 0
      XJKJ-rdimm/XJKJ_QT/qcustomplot.h
  13. 5 0
      XJKJ-rdimm/XJKJ_QT/resource.qrc
  14. 29 0
      XJKJ-rdimm/XJKJ_QT/resources/style.qss
  15. 539 0
      XJKJ-rdimm/XJKJ_QT/serialworker.cpp
  16. 442 0
      XJKJ-rdimm/XJKJ_QT/serialworker.cpp.kznwOI
  17. 59 0
      XJKJ-rdimm/XJKJ_QT/serialworker.h
  18. 23 0
      XJKJ-rdimm/bin/.qmake.stash
  19. 502 0
      XJKJ-rdimm/bin/Makefile
  20. BIN
      XJKJ-rdimm/bin/XJKJ_QT
  21. BIN
      XJKJ-rdimm/bin/clickframe.o
  22. BIN
      XJKJ-rdimm/bin/main.o
  23. BIN
      XJKJ-rdimm/bin/mainwindow.o
  24. 134 0
      XJKJ-rdimm/bin/moc_clickframe.cpp
  25. BIN
      XJKJ-rdimm/bin/moc_clickframe.o
  26. 211 0
      XJKJ-rdimm/bin/moc_mainwindow.cpp
  27. BIN
      XJKJ-rdimm/bin/moc_mainwindow.o
  28. 387 0
      XJKJ-rdimm/bin/moc_predefs.h
  29. 8902 0
      XJKJ-rdimm/bin/moc_qcustomplot.cpp
  30. BIN
      XJKJ-rdimm/bin/moc_qcustomplot.o
  31. 166 0
      XJKJ-rdimm/bin/moc_serialworker.cpp
  32. BIN
      XJKJ-rdimm/bin/moc_serialworker.o
  33. 2 0
      XJKJ-rdimm/bin/motor.ini
  34. BIN
      XJKJ-rdimm/bin/pid.o
  35. BIN
      XJKJ-rdimm/bin/qcustomplot.o
  36. 119 0
      XJKJ-rdimm/bin/qrc_resource.cpp
  37. BIN
      XJKJ-rdimm/bin/qrc_resource.o
  38. BIN
      XJKJ-rdimm/bin/serialworker.o
  39. 597 0
      XJKJ-rdimm/bin/ui_mainwindow.h

+ 35 - 0
XJKJ-rdimm/XJKJ_QT/XJKJ_QT.pro

@@ -0,0 +1,35 @@
+QT       += core gui serialport printsupport
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+CONFIG += c++11
+
+# You can make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    clickframe.cpp \
+    main.cpp \
+    mainwindow.cpp \
+    pid.cpp \
+    qcustomplot.cpp \
+    serialworker.cpp
+
+HEADERS += \
+    clickframe.h \
+    mainwindow.h \
+    pid.h \
+    qcustomplot.h \
+    serialworker.h
+
+FORMS += \
+    mainwindow.ui
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+RESOURCES += \
+    resource.qrc

+ 318 - 0
XJKJ-rdimm/XJKJ_QT/XJKJ_QT.pro.user

@@ -0,0 +1,318 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 4.14.1, 2026-08-20T15:17:29. -->
+<qtcreator>
+ <data>
+  <variable>EnvironmentId</variable>
+  <value type="QByteArray">{cc1c2086-c619-45e9-babe-59ba62d7a23b}</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="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+   <value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap">
+   <valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
+    <value type="bool" key="AutoTest.Framework.Boost">true</value>
+    <value type="bool" key="AutoTest.Framework.Catch">true</value>
+    <value type="bool" key="AutoTest.Framework.GTest">true</value>
+    <value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
+    <value type="bool" key="AutoTest.Framework.QtTest">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
+   <value type="int" key="AutoTest.RunAfterBuild">0</value>
+   <value type="bool" key="AutoTest.UseGlobal">true</value>
+   <valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
+   <value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
+   <value type="QString" key="ClangCodeModel.WarningConfigId">Builtin.Questionable</value>
+   <valuemap type="QVariantMap" key="ClangTools">
+    <value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
+    <value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
+    <value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
+    <value type="int" key="ClangTools.ParallelJobs">4</value>
+    <valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
+    <valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
+    <valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
+    <value type="bool" key="ClangTools.UseGlobalSettings">true</value>
+   </valuemap>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="DeviceType">Desktop</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">桌面</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">桌面</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{c5a7b7cd-0623-479c-a954-80d09f33d5ef}</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">
+    <value type="int" key="EnableQmlDebugging">0</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wg/桌面/Project/XJKJ-rdimm/bin</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/wg/桌面/Project/XJKJ-rdimm/bin</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</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="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</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"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+    <value type="int" key="RunSystemFunction">0</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wg/桌面/Project/LANGCHAO/build-XJKJ_QT-unknown-Release</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/wg/桌面/Project/LANGCHAO/build-XJKJ_QT-unknown-Release</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</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="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</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"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="int" key="RunSystemFunction">0</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
+    <value type="int" key="EnableQmlDebugging">0</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wg/桌面/Project/LANGCHAO/build-XJKJ_QT-unknown-Profile</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/wg/桌面/Project/LANGCHAO/build-XJKJ_QT-unknown-Profile</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</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="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</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"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="int" key="RunSystemFunction">0</value>
+    <value type="int" key="SeparateDebugInfo">0</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</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">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
+    <value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</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.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>
+    <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.DisplayName">XJKJ_QT2</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wg/桌面/Project/XJKJ-rdimm/XJKJ_QT/XJKJ_QT.pro</value>
+    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wg/桌面/Project/XJKJ-rdimm/XJKJ_QT/XJKJ_QT.pro</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/wg/桌面/Project/XJKJ-rdimm/bin</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>

+ 12 - 0
XJKJ-rdimm/XJKJ_QT/clickframe.cpp

@@ -0,0 +1,12 @@
+#include "clickframe.h"
+
+ClickFrame::ClickFrame(QWidget *parent) : QFrame(parent)
+{
+
+}
+
+void ClickFrame::mousePressEvent(QMouseEvent *event)
+{
+    emit clicked();
+    QFrame::mousePressEvent(event);
+}

+ 21 - 0
XJKJ-rdimm/XJKJ_QT/clickframe.h

@@ -0,0 +1,21 @@
+#ifndef CLICKFRAME_H
+#define CLICKFRAME_H
+
+#include <QFrame>
+#include <QObject>
+#include <QMouseEvent>
+
+class ClickFrame : public QFrame
+{
+    Q_OBJECT
+public:
+    explicit ClickFrame(QWidget *parent = nullptr);
+
+signals:
+    void clicked();
+
+protected:
+    void mousePressEvent(QMouseEvent *event) override;
+};
+
+#endif // CLICKFRAME_H

+ 21 - 0
XJKJ-rdimm/XJKJ_QT/main.cpp

@@ -0,0 +1,21 @@
+#include "mainwindow.h"
+
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+
+    QFile file(":/resources/style.qss");   // 如果放 qrc
+
+    if(file.open(QFile::ReadOnly))
+    {
+        QString style = file.readAll();
+        a.setStyleSheet(style);
+        file.close();
+    }
+
+    MainWindow w;
+    w.show();
+    return a.exec();
+}

+ 196 - 0
XJKJ-rdimm/XJKJ_QT/mainwindow.cpp

@@ -0,0 +1,196 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include <QDebug>
+#include <QMessageBox>
+
+#define WINDOW_SIZE 200
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent)
+    , ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+    initThread();
+    initPlot();
+    initCombox();
+
+    QList<ClickFrame*> frames = ui->widgetLegend->findChildren<ClickFrame*>();
+    for(ClickFrame *frame : frames)
+    {
+        connect(frame,&ClickFrame::clicked,this,&MainWindow::onLegendClick);
+    }
+}
+
+void MainWindow::initThread()
+{
+    portTh = new QThread(this);
+    serialthread = new SerialWorker();
+    serialthread->moveToThread(portTh);
+
+    connect(serialthread,&SerialWorker::signalNewTemps,this,&MainWindow::updatePlot,Qt::QueuedConnection);
+    connect(portTh,&QThread::started,serialthread,&SerialWorker::start);
+    connect(this,&MainWindow::sigOpenSerialBMC,serialthread,&SerialWorker::openBMCSerial,Qt::QueuedConnection);
+    connect(this,&MainWindow::sigOpenSerialCPLD,serialthread,&SerialWorker::openCPLDSerial,Qt::QueuedConnection);
+    connect(this,&MainWindow::siganlStartTest,serialthread,&SerialWorker::onStartTest,Qt::QueuedConnection);
+//    connect(this,&MainWindow::destroyed,portTh,&QThread::quit);
+//    connect(portTh,&QThread::finished,serialthread,&QObject::deleteLater);
+//    connect(portTh,&QThread::finished,portTh,&QObject::deleteLater);
+
+    portTh->start();
+}
+
+void MainWindow::onLegendClick()
+{
+    ClickFrame *frame = qobject_cast<ClickFrame*>(sender());
+
+    if(!frame) return;
+
+    int index = m_names.indexOf(frame->objectName());
+
+    if(m_currentIndex == index)
+    {
+        QCPGraph *graph = ui->customPlot->graph(index);
+
+        QPen pen = graph->pen();
+        pen.setWidth(2);
+        graph->setPen(pen);
+        m_currentIndex = -1;
+    }
+    else
+    {
+        if(m_currentIndex >= 0)
+        {
+            QCPGraph *beforeGraph = ui->customPlot->graph(m_currentIndex);
+            QPen beforePen = beforeGraph->pen();
+            beforePen.setWidth(2);
+            beforeGraph->setPen(beforePen);
+        }
+
+        QCPGraph *nextGraph = ui->customPlot->graph(index);
+        QPen nextPen = nextGraph->pen();
+        nextPen.setWidth(3);
+        nextGraph->setPen(nextPen);
+        m_currentIndex = index;
+    }
+
+    ui->customPlot->replot();
+}
+
+void MainWindow::initCombox()
+{
+    QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
+    if(ports.isEmpty())
+        return;
+    for(const auto &info : ports)
+    {
+        ui->comboBox->addItem(info.portName());
+    }
+}
+
+MainWindow::~MainWindow()
+{
+    portTh->quit();
+    portTh->wait();
+
+    delete ui;
+}
+
+void MainWindow::initPlot()
+{
+    m_names <<
+        "CPU0_CHA"<<"CPU0_CHB"<<"CPU0_CHC"<<"CPU0_CHD"<<
+        "CPU0_CHE"<<"CPU0_CHF"<<"CPU0_CHG"<<"CPU0_CHH"<<
+        "CPU0_CHI"<<"CPU0_CHJ"<<"CPU0_CHK"<<"CPU0_CHL"<<
+
+        "CPU1_CHA"<<"CPU1_CHB"<<"CPU1_CHC"<<"CPU1_CHD"<<
+        "CPU1_CHE"<<"CPU1_CHF"<<"CPU1_CHG"<<"CPU1_CHH"<<
+        "CPU1_CHI"<<"CPU1_CHJ"<<"CPU1_CHK"<<"CPU1_CHL";
+
+    QList<QColor> colors =
+    {
+        QColor("#1f77b4"), QColor("#ff7f0e"), QColor("#2ca02c"),
+        QColor("#d62728"), QColor("#9467bd"), QColor("#8c564b"),
+        QColor("#e377c2"), QColor("#7f7f7f"), QColor("#bcbd22"),
+        QColor("#17becf"), QColor("#393b79"), QColor("#637939"),
+
+        QColor("#8c6d31"), QColor("#843c39"), QColor("#7b4173"),
+        QColor("#3182bd"), QColor("#31a354"), QColor("#756bb1"),
+        QColor("#636363"), QColor("#e6550d"), QColor("#969696"),
+        QColor("#6baed6"), QColor("#74c476"), QColor("#fd8d3c")
+    };
+
+    for(int i = 0; i < m_names.size(); i++)
+    {
+        QCPGraph *graph = ui->customPlot->addGraph();
+        graph->setName(m_names[i]); QPen pen(colors[i]);
+        pen.setWidth(1);
+        graph->setPen(pen);
+    }
+
+    ui->customPlot->xAxis->setLabel("Time");
+    ui->customPlot->yAxis->setLabel("Temperature (°C)");
+    ui->customPlot->xAxis->setRange(0, WINDOW_SIZE);
+    ui->customPlot->yAxis->setRange(30.0, 100.0);
+    ui->customPlot->yAxis->setNumberFormat("f");
+    ui->customPlot->yAxis->setNumberPrecision(1);
+
+    // 主刻度: 每5℃显示数字
+    QSharedPointer<QCPAxisTickerFixed> yTicker(new QCPAxisTickerFixed);
+    yTicker->setTickStep(5);
+    ui->customPlot->yAxis->setTicker(yTicker);
+    // 开启子刻度
+    ui->customPlot->yAxis->setSubTicks(true);
+    // X轴不要网格(不要竖线)
+    ui->customPlot->xAxis->grid()->setVisible(false);
+    // X轴不要子刻度
+    ui->customPlot->xAxis->setSubTicks(false);
+    // Y轴主网格
+    ui->customPlot->yAxis->grid()->setVisible(true);
+    // Y轴子网格
+    ui->customPlot->yAxis->grid()->setSubGridVisible(true);
+    // ================= 允许x轴拖动 缩放 =================
+    ui->customPlot->setInteractions(QCP::iNone);
+    ui->customPlot->replot();
+}
+
+void MainWindow::updatePlot(QVector<double> values)
+{
+    for(int i = 0; i < 24; i++)
+    {
+        if(!std::isnan(values[i]))
+        {
+            ui->customPlot->graph(i)->addData(m_timeIndex,values[i]);
+        }
+    }
+
+    for(int i=0;i<24;i++)
+    {
+        ui->customPlot->graph(i)->data()->removeBefore(m_timeIndex - WINDOW_SIZE);
+    }
+
+    if(m_timeIndex > WINDOW_SIZE)
+    {
+        ui->customPlot->xAxis->setRange(m_timeIndex - WINDOW_SIZE,m_timeIndex);
+    }
+
+    ui->customPlot->replot();
+    m_timeIndex++;
+}
+
+void MainWindow::on_start_btn_clicked()
+{
+    int index = ui->comboBox_temp->currentIndex();
+    emit siganlStartTest(index);
+}
+
+void MainWindow::on_pushButton_BMC_clicked()
+{
+    QString portname = ui->comboBox->currentText();
+    emit sigOpenSerialBMC(portname);
+}
+
+void MainWindow::on_pushButton_CPLD_clicked()
+{
+    QString portname = ui->comboBox->currentText();
+    emit sigOpenSerialCPLD(portname);
+}

+ 48 - 0
XJKJ-rdimm/XJKJ_QT/mainwindow.h

@@ -0,0 +1,48 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include <QSerialPortInfo>
+#include "clickframe.h"
+#include "qcustomplot.h"
+#include "serialworker.h"
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindow; }
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = nullptr);
+    ~MainWindow();
+
+signals:
+    void sigOpenSerialBMC(const QString &portname);
+    void sigOpenSerialCPLD(const QString &portname);
+    void siganlStartTest(int index);
+
+private slots:
+    void updatePlot(QVector<double> values);
+    void on_start_btn_clicked();
+    void on_pushButton_BMC_clicked();
+    void on_pushButton_CPLD_clicked();
+
+private:
+    void initPlot(); //初始化图表
+    void initThread();
+    void onLegendClick();
+    void initCombox();
+
+private:
+    Ui::MainWindow *ui;
+    QStringList m_names;
+    SerialWorker *serialthread;
+    QThread *portTh;
+    QVector<double> m_xData;
+    int m_timeIndex = 0;
+    int m_currentIndex = -1;
+};
+#endif // MAINWINDOW_H

File diff suppressed because it is too large
+ 1051 - 0
XJKJ-rdimm/XJKJ_QT/mainwindow.ui


+ 268 - 0
XJKJ-rdimm/XJKJ_QT/pid.cpp

@@ -0,0 +1,268 @@
+#include "pid.h"
+#include <QtMath>
+
+
+PID::PID()
+{
+    //-----------------------------------------
+    // PID参数
+    //-----------------------------------------
+
+    kp = 4.0;
+    ki = 0.02;
+    kd = 2.0;
+
+    integral = 0;
+    lastError = 0;
+
+    // 积分最大值
+    integralMax = 100;
+}
+
+
+//====================================================
+// 加热控制
+//====================================================
+
+double PID::calculate(double target, double current)
+{
+    // PID执行周期
+    const double dt = 0.5;
+
+    double error = target - current;
+
+
+    //-----------------------------------------
+    // 1. 65℃以前
+    //
+    // 快速升温
+    //-----------------------------------------
+
+    if(current < 65.0)
+    {
+        integral = 0;
+        lastError = error;
+
+        return 100.0;
+    }
+
+
+    //-----------------------------------------
+    // 2. 65~68℃
+    //
+    // 开始提前降低加热功率
+    //
+    // 65℃ -> 80%
+    // 68℃ -> 40%
+    //-----------------------------------------
+
+    if(current < 68.0)
+    {
+        integral = 0;
+        lastError = error;
+
+        double duty = 80.0 - (current - 65.0) / 3.0 * 40.0;
+
+        return qBound(0.0, duty, 100.0);
+    }
+
+
+    //-----------------------------------------
+    // 3. 68℃以后
+    //
+    // 正式进入PID控温
+    //-----------------------------------------
+
+    //-----------------------------------------
+    // 积分
+    //-----------------------------------------
+
+    integral += error * dt;
+
+    integral = qBound(-integralMax,integral,integralMax);
+
+
+    //-----------------------------------------
+    // 微分
+    //-----------------------------------------
+
+    double derivative = (error - lastError) / dt;
+
+    lastError = error;
+
+
+    //-----------------------------------------
+    // PID
+    //-----------------------------------------
+
+    double output =
+            kp * error +
+            ki * integral +
+            kd * derivative;
+
+
+    //-----------------------------------------
+    // 4. 70℃附近
+    //
+    // 防止到达目标后继续大功率加热
+    //-----------------------------------------
+
+    if(current >= 70.0)
+    {
+        if(output > 25.0)
+            output = 25.0;
+    }
+
+
+    //-----------------------------------------
+    // 5. 71℃以后
+    //
+    // 进一步限制加热
+    //-----------------------------------------
+
+    if(current >= 71.0)
+    {
+        if(output > 10.0)
+            output = 10.0;
+    }
+
+
+    //-----------------------------------------
+    // 6. 72℃保护
+    //
+    // 超过控制范围,停止加热
+    //-----------------------------------------
+
+    if(current >= 72.0)
+    {
+        output = 0.0;
+
+        // 清除积分,避免降温后仍然异常
+        integral = 0;
+    }
+
+
+    //-----------------------------------------
+    // 最终限幅
+    //-----------------------------------------
+
+    return qBound(0.0, output, 100.0);
+}
+
+
+//====================================================
+// 风扇控制
+//====================================================
+
+double PID::calculateFanDuty(double temp)
+{
+    double duty;
+
+
+    //-----------------------------------------
+    // 68℃以前
+    //
+    // 固定10%
+    //-----------------------------------------
+
+    if(temp < 68.0)
+    {
+        duty = 10.0;
+    }
+
+
+    //-----------------------------------------
+    // 68~72℃
+    //
+    // 10% -> 60%
+    //-----------------------------------------
+
+    else if(temp <= 72.0)
+    {
+        duty = 10.0 + (temp - 68.0) / 4.0 * 50.0;
+    }
+
+
+    //-----------------------------------------
+    // 72~75℃
+    //
+    // 60% -> 100%
+    //-----------------------------------------
+
+    else if(temp <= 75.0)
+    {
+        duty = 60.0 + (temp - 72.0) / 3.0 * 40.0;
+    }
+
+
+    //-----------------------------------------
+    // 75℃以上
+    //
+    // 全速
+    //-----------------------------------------
+
+    else
+    {
+        duty = 100.0;
+    }
+
+
+    return qBound(10.0, duty, 100.0);
+}
+
+
+//====================================================
+// 第二组风扇控制
+//====================================================
+
+double PID::calculateFanDuty1(double temp)
+{
+    double duty;
+
+
+    //-----------------------------------------
+    // 30℃以下
+    //-----------------------------------------
+
+    if(temp <= 30.0)
+    {
+        duty = 10.0;
+    }
+
+
+    //-----------------------------------------
+    // 30~40℃
+    //
+    // 0 -> 50%
+    //-----------------------------------------
+
+    else if(temp <= 40.0)
+    {
+        duty = (temp - 30.0) / 10.0 * 40.0;
+    }
+
+
+    //-----------------------------------------
+    // 40~45℃
+    //
+    // 50 -> 100%
+    //-----------------------------------------
+
+    else if(temp <= 45.0)
+    {
+        duty = 50.0 + (temp - 40.0) / 5.0 * 50.0;
+    }
+
+
+    //-----------------------------------------
+    // 45℃以上
+    //-----------------------------------------
+
+    else
+    {
+        duty = 100.0;
+    }
+
+
+    return qBound(0.0, duty, 100.0);
+}

+ 30 - 0
XJKJ-rdimm/XJKJ_QT/pid.h

@@ -0,0 +1,30 @@
+#ifndef PID_H
+#define PID_H
+
+class PID
+{
+public:
+    PID();
+
+    // 加热PID
+    double calculate(double target, double current);
+
+    // 主风扇
+    double calculateFanDuty(double temp);
+
+    // 其他风扇
+    double calculateFanDuty1(double temp);
+
+private:
+
+    double kp;
+    double ki;
+    double kd;
+
+    double integral;
+    double lastError;
+
+    double integralMax;
+};
+
+#endif // PID_H

File diff suppressed because it is too large
+ 35529 - 0
XJKJ-rdimm/XJKJ_QT/qcustomplot.cpp


File diff suppressed because it is too large
+ 7774 - 0
XJKJ-rdimm/XJKJ_QT/qcustomplot.h


+ 5 - 0
XJKJ-rdimm/XJKJ_QT/resource.qrc

@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>resources/style.qss</file>
+    </qresource>
+</RCC>

+ 29 - 0
XJKJ-rdimm/XJKJ_QT/resources/style.qss

@@ -0,0 +1,29 @@
+QWidget#widgetLegend { background-color: #FFFFFF; }
+
+/* ========== CPU0 ========== */
+QFrame#CPU0_CHA { background-color: #1f77b4; }
+QFrame#CPU0_CHB { background-color: #ff7f0e; }
+QFrame#CPU0_CHC { background-color: #2ca02c; }
+QFrame#CPU0_CHD { background-color: #d62728; }
+QFrame#CPU0_CHE { background-color: #9467bd; }
+QFrame#CPU0_CHF { background-color: #8c564b; }
+QFrame#CPU0_CHG { background-color: #e377c2; }
+QFrame#CPU0_CHH { background-color: #7f7f7f; }
+QFrame#CPU0_CHI { background-color: #bcbd22; }
+QFrame#CPU0_CHJ { background-color: #17becf; }
+QFrame#CPU0_CHK { background-color: #393b79; }
+QFrame#CPU0_CHL { background-color: #637939; }
+
+/* ========== CPU1 ========== */
+QFrame#CPU1_CHA { background-color: #8c6d31; }
+QFrame#CPU1_CHB { background-color: #843c39; }
+QFrame#CPU1_CHC { background-color: #7b4173; }
+QFrame#CPU1_CHD { background-color: #3182bd; }
+QFrame#CPU1_CHE { background-color: #31a354; }
+QFrame#CPU1_CHF { background-color: #756bb1; }
+QFrame#CPU1_CHG { background-color: #636363; }
+QFrame#CPU1_CHH { background-color: #e6550d; }
+QFrame#CPU1_CHI { background-color: #969696; }
+QFrame#CPU1_CHJ { background-color: #6baed6; }
+QFrame#CPU1_CHK { background-color: #74c476; }
+QFrame#CPU1_CHL { background-color: #fd8d3c; }

+ 539 - 0
XJKJ-rdimm/XJKJ_QT/serialworker.cpp

@@ -0,0 +1,539 @@
+#include "serialworker.h"
+#include "QDebug"
+#include <QCoreApplication>
+#include <QDateTime>
+#include <QElapsedTimer>
+#include <QtMath>
+#include <QSerialPortInfo>
+#include <QTimer>
+#include <QRegularExpression>
+#include <QSettings>
+#include <QThread>
+
+//#define FRAME_LEN 66
+#define CHANNEL_COUNT 24
+#define MAX_STEP  9
+
+SerialWorker::SerialWorker(QObject *parent) : QObject(parent)
+{
+}
+
+SerialWorker::~SerialWorker()
+{
+    if(m_portBMC && m_portBMC->isOpen())
+    {
+        m_portBMC->close();
+    }
+
+    if(m_portCPLD && m_portCPLD->isOpen())
+    {
+        m_portCPLD->close();
+    }
+}
+
+void SerialWorker::initFrame()
+{
+    memset(txFrame, 0, sizeof(txFrame));
+
+    txFrame[0] = 0xA5;
+    txFrame[1] = 0x5A;
+    txFrame[2] = 0x02;
+    txFrame[3] = 0x04;
+    txFrame[4] = 0x07;
+    txFrame[5] = 0x00;
+    txFrame[6] = 0x00;
+    txFrame[7] = 0x00;
+    txFrame[8] = 0x00;
+    txFrame[9]  = 0x00;
+    txFrame[10] = 0x00;
+    txFrame[11] = 0x00;
+    txFrame[12] = 0x00;
+    txFrame[13] = 0x22;
+    txFrame[14] = 0x2A;
+    txFrame[15] = 0x00;
+    txFrame[44] = 0x00;
+    txFrame[45] = 0x00;
+    txFrame[46] = 0x00;
+    txFrame[47] = 0x00;
+}
+
+void SerialWorker::start()
+{
+    m_pid.resize(4);
+    initFrame();
+
+    QString path = QCoreApplication::applicationDirPath() + "/motor.ini";
+
+    QSettings settings(path, QSettings::IniFormat);
+
+    // 读取保存的位置,没有则默认0
+    m_position = settings.value("Motor/Position", 0).toInt();
+
+    qDebug()<<m_position;
+
+    static int a = 0;
+    preTimer = new QTimer(this);
+    connect(preTimer,&QTimer::timeout,this,[=](){
+        a++;
+        qDebug()<<"a = "<<a;
+        QByteArray data = QByteArray::fromHex(
+            "A55A020405000000000000000004280000009E0C"
+        );
+        m_portCPLD->write(data);
+        m_portCPLD->flush();
+
+        sendDownCmd();
+
+        for(int fan = 0; fan < 24; fan++)
+        {
+            txFrame[16 + fan] = (uint8_t)100;
+        }
+
+        for(int fan = 0; fan < 4; fan++)
+        {
+            txFrame[40 + fan] = (uint8_t)30;
+        }
+
+        sendSnapshot();
+    });
+
+    pidTimer = new QTimer(this);
+    connect(pidTimer,&QTimer::timeout,this,[=](){
+        m_portBMC->write("ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03\r");
+        m_portBMC->flush();
+    });
+}
+
+void SerialWorker::openBMCSerial(const QString &portname)
+{
+    m_portBMC = new QSerialPort(this);
+    m_portBMC->setPortName(portname);
+    m_portBMC->setBaudRate(115200);
+    m_portBMC->setDataBits(QSerialPort::Data8);
+    m_portBMC->setParity(QSerialPort::NoParity);
+    m_portBMC->setStopBits(QSerialPort::OneStop);
+    m_portBMC->setFlowControl(QSerialPort::NoFlowControl);
+
+    if(!m_portBMC->open(QIODevice::ReadWrite))
+    {
+        qDebug()<<"bmc串口打开失败";
+        return;
+    }
+    else
+    {
+        m_portBMC->write("stty -echo\r");
+        m_portBMC->flush();
+        qDebug()<<"bmc串口打开成功";
+    }
+}
+
+void SerialWorker::openCPLDSerial(const QString &portname)
+{
+    m_portCPLD = new QSerialPort(this);
+    m_portCPLD->setPortName(portname);
+    m_portCPLD->setBaudRate(921600);
+    m_portCPLD->setDataBits(QSerialPort::Data8);
+    m_portCPLD->setParity(QSerialPort::NoParity);
+    m_portCPLD->setStopBits(QSerialPort::OneStop);
+    m_portCPLD->setFlowControl(QSerialPort::NoFlowControl);
+
+    if(!m_portCPLD->open(QIODevice::ReadWrite))
+    {
+        qDebug()<<"cpld串口打开失败";
+        return;
+    }
+    else
+    {
+        connect(m_portCPLD,&QSerialPort::readyRead,this,&SerialWorker::onReadyReadCPLD);
+        qDebug()<<"cpld串口打开成功";
+    }
+}
+
+uint16_t SerialWorker::crc16(const uint8_t *data, uint16_t len)
+{
+    uint16_t crc = 0xFFFF;
+
+    for(uint16_t i = 0; i < len; i++)
+    {
+        crc ^= ((uint16_t)data[i] << 8);
+
+        for(uint8_t j = 0; j < 8; j++)
+        {
+            if(crc & 0x8000)
+            {
+                crc = (crc << 1) ^ 0x1021;
+            }
+            else
+            {
+                crc <<= 1;
+            }
+        }
+    }
+
+    return crc;
+}
+
+void SerialWorker::onStartTest(int index)
+{
+    m_tempIndex = index;
+
+    preTimer->start(1000);
+}
+
+void SerialWorker::onReadyReadBMC()
+{
+    m_buffer += m_portBMC->readAll();
+
+    QString text = QString::fromUtf8(m_buffer);
+
+    QRegularExpression re("root@[^#]*#");
+    QRegularExpressionMatch match = re.match(text);
+
+    if (!match.hasMatch())
+        return;
+
+    // 前面的HEX字符串
+    QString hex = text.left(match.capturedStart());
+
+    // 删除已经处理的数据
+    m_buffer.remove(0, match.capturedEnd());
+
+    // 去掉所有空白
+    hex.remove(QRegularExpression("\\s+"));
+
+    // 转二进制
+    QByteArray data = QByteArray::fromHex(hex.toLatin1());
+
+    if(data.size() != 48)
+    {
+        return;
+    }
+    parsePIDData(data);
+}
+
+void SerialWorker::onReadyReadCPLD()
+{
+    m_cpldBuffer.append(m_portCPLD->readAll());
+
+
+    while(m_cpldBuffer.size() >= 6)
+    {
+        // 找帧头
+        int index = m_cpldBuffer.indexOf(
+                    QByteArray::fromHex("A55A"));
+
+        if(index < 0)
+        {
+            m_cpldBuffer.clear();
+            return;
+        }
+
+
+        // 删除前面的垃圾
+        if(index > 0)
+            m_cpldBuffer.remove(0,index);
+
+
+
+        // 不够判断类型
+        if(m_cpldBuffer.size() < 6)
+            return;
+
+
+
+        // 判断帧类型
+
+        uint8_t cmd1 = (uint8_t)m_cpldBuffer[4];
+        uint8_t cmd2 = (uint8_t)m_cpldBuffer[5];
+
+
+        // 只处理温度帧
+        if(cmd1 != 0x10 || cmd2 != 0x1B)
+        {
+            // 不是温度帧,丢掉这一帧
+            m_cpldBuffer.remove(0,2);
+            continue;
+        }
+
+
+        // 等待完整35字节
+        if(m_cpldBuffer.size() < 35)
+            return;
+
+
+
+        QByteArray data =
+                m_cpldBuffer.left(35);
+
+
+        m_cpldBuffer.remove(0,35);
+
+
+
+        qDebug()<<"温度帧:"
+                <<data.toHex();
+
+
+
+        //--------------------
+        // CRC
+        //--------------------
+
+        uint16_t recvCrc =
+                ((uint8_t)data[34]<<8)
+                |
+                (uint8_t)data[33];
+
+
+        uint16_t calcCrc =
+                crc16((uint8_t*)data.data()+2,31);
+
+
+
+        if(recvCrc != calcCrc)
+        {
+            qDebug()<<"CRC错误";
+            continue;
+        }
+
+
+
+        int temp=(uint8_t)data[25];
+
+        qDebug()<<"sensor温度:"
+                <<temp;
+
+
+
+        if(temp >=40 && m_tempIndex==0)
+        {
+            preTimer->stop();
+
+            QTimer::singleShot(200,this,[=](){
+                connect(m_portBMC,&QSerialPort::readyRead,this,&SerialWorker::onReadyReadBMC);
+                pidTimer->start(500);
+            });
+        }
+        else if(temp>=70 && m_tempIndex==1)
+        {
+            preTimer->stop();
+            QTimer::singleShot(200,this,[=](){
+                connect(m_portBMC,&QSerialPort::readyRead,this,&SerialWorker::onReadyReadBMC);
+                pidTimer->start(500);
+            });
+        }
+    }
+}
+
+void SerialWorker::parsePIDData(const QByteArray &data)
+{
+    QVector<double> temps;
+    temps.reserve(CHANNEL_COUNT);
+
+    for(int i = 0; i < CHANNEL_COUNT; ++i)
+    {
+        quint8 intPart = static_cast<quint8>(data[i * 2]);
+        //quint8 decPart = static_cast<quint8>(data[i * 2 + 1]);
+
+        if(intPart == 0xFF /*&& decPart == 0xFF*/)
+        {
+            temps.append(qQNaN());
+        }
+        else
+        {
+            temps.append(intPart/* + decPart / 100.0*/);
+        }
+    }
+    qDebug()<<"temps"<<temps;
+
+    emit signalNewTemps(temps); //发送给数据给主界面绘制
+
+    if(m_tempIndex == 0)
+    {
+        controlHeat40(temps); //控温核心代码
+    }
+    else if(m_tempIndex == 1)
+    {
+        controlHeat(temps); //控温核心代码
+    }
+}
+
+void SerialWorker::controlHeat(const QVector<double> &temps)
+{
+    double target = 70.0;
+
+    double sumTemp = 0.0;
+    int count = 0;
+
+    for(int i = 0; i < 6; i++)
+    {
+        double temp = temps[i];
+
+        if(qIsNaN(temp))
+            continue;
+
+        sumTemp += temp;
+        count++;
+    }
+
+    double fanDuty = 0.0;
+    double duty = 0.0;
+    double avgTemp = 0.0;
+
+    if(count > 0)
+    {
+        avgTemp = sumTemp / count;
+
+        // 第一组计算风扇
+        fanDuty = m_pid[0].calculateFanDuty(avgTemp);
+
+        // PID计算加热
+        duty = m_pid[0].calculate(target, avgTemp);
+
+        if(avgTemp > target)
+        {
+            sendUpCmd();
+        }
+        else
+        {
+            sendDownCmd();
+        }
+
+        for(int fan = 0; fan < 24; fan++)
+        {
+            txFrame[16 + fan] = (uint8_t)duty;
+        }
+
+        for(int fan = 0; fan < 4; fan++)
+        {
+            txFrame[40 + fan] = (uint8_t)fanDuty;
+        }
+
+        sendSnapshot();
+
+        qDebug()<<"duty = "<<duty<<"fanDuty = "<<fanDuty;
+    }
+}
+
+void SerialWorker::controlHeat40(const QVector<double> &temps)
+{
+    double sumTemp = 0.0;
+    int count = 0;
+
+    for(int i = 0; i < 6; i++)
+    {
+        double temp = temps[i];
+
+        if(qIsNaN(temp))
+            continue;
+
+        sumTemp += temp;
+        count++;
+    }
+
+    double fanDuty = 0.0;
+    double duty = 0.0;
+    double avgTemp = 0.0;
+
+    if(count > 0)
+    {
+        avgTemp = sumTemp / count;
+
+        // 第一组计算风扇
+        fanDuty = m_pid[0].calculateFanDuty1(avgTemp);
+
+        if(avgTemp >= 40)
+        {
+            sendUpCmd();
+        }
+        else
+        {
+            sendDownCmd();
+        }
+
+        for(int fan = 0; fan < 24; fan++)
+        {
+            txFrame[16 + fan] = (uint8_t)duty;
+        }
+
+        for(int fan = 0; fan < 4; fan++)
+        {
+            txFrame[40 + fan] = (uint8_t)fanDuty;
+        }
+
+        sendSnapshot();
+
+        qDebug()<<"duty = "<<duty<<"fanDuty = "<<fanDuty;
+    }
+}
+
+void SerialWorker::sendSnapshot()
+{
+    uint16_t crc = crc16(txFrame + 2,46);
+
+    txFrame[48] = crc & 0xff;
+    txFrame[49] = (crc >> 8)&0xff;
+
+    QByteArray frame((char*)txFrame,50);
+    m_portCPLD->write(frame);
+    m_portCPLD->flush();
+}
+
+void SerialWorker::sendDownCmd()
+{
+    if (m_position <= 0)
+    {
+        qDebug()<<m_position;
+        return;     // 已经到底了
+    }
+
+    QByteArray dataX = QByteArray::fromHex(
+        "A55A02041100000000000000000835000103C20100001C32"
+    );
+    QByteArray dataY = QByteArray::fromHex(
+        "A55A02041100000000000000000835010003C2010000DDCF"
+    );
+
+    m_portCPLD->write(dataX);
+    m_portCPLD->write(dataY);
+    m_portCPLD->flush();
+
+    --m_position;
+    qDebug()<<m_position;
+    saveMotorPosition();
+}
+
+void SerialWorker::sendUpCmd()
+{
+    if (m_position >= MAX_STEP)
+    {
+        qDebug()<<m_position;
+        return;     // 已经到顶了
+    }
+
+    QByteArray dataX = QByteArray::fromHex(
+        "A55A02041100000000000000000835000003C2010000BC77"
+    );
+    QByteArray dataY = QByteArray::fromHex(
+        "A55A02041100000000000000000835010103C20100007D8A"
+
+    );
+
+    m_portCPLD->write(dataX);
+    m_portCPLD->write(dataY);
+    m_portCPLD->flush();
+
+    ++m_position;
+    qDebug()<<m_position;
+    saveMotorPosition();
+}
+
+void SerialWorker::saveMotorPosition()
+{
+    QString path = QCoreApplication::applicationDirPath() + "/motor.ini";
+
+    QSettings settings(path, QSettings::IniFormat);
+
+    settings.setValue("Motor/Position", m_position);
+    settings.sync();
+}

+ 442 - 0
XJKJ-rdimm/XJKJ_QT/serialworker.cpp.kznwOI

@@ -0,0 +1,442 @@
+#include "serialworker.h"
+#include "QDebug"
+#include <QCoreApplication>
+#include <QDateTime>
+#include <QElapsedTimer>
+#include <QtMath>
+#include <QSerialPortInfo>
+#include <QTimer>
+#include <QRegularExpression>
+#include <QSettings>
+
+//#define FRAME_LEN 66
+#define CHANNEL_COUNT 24
+#define MAX_STEP  10
+
+SerialWorker::SerialWorker(QObject *parent) : QObject(parent)
+{
+    m_pid.resize(4);
+
+    preTimer = new QTimer(this);
+    connect(preTimer,&QTimer::timeout,this,[=](){
+        m_portCPLD->write("A55A020405000000000000000004280000009E0C");
+        m_portCPLD->flush();
+
+        for(int fan = 0; fan < 24; fan++)
+        {
+            txFrame[16 + fan] = (uint8_t)100;
+        }
+        for(int fan = 0; fan < 4; fan++)
+        {
+            txFrame[40 + fan] = (uint8_t)10;
+        }
+
+        sendSnapshot();
+    });
+
+    pidTimer = new QTimer(this);
+    connect(pidTimer,&QTimer::timeout,this,[=](){
+        m_portBMC->write("ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03\r");
+        m_portBMC->flush();
+    });
+}
+
+SerialWorker::~SerialWorker()
+{
+    if(m_portBMC && m_portBMC->isOpen())
+    {
+        m_portBMC->close();
+    }
+
+    if(m_portCPLD && m_portCPLD->isOpen())
+    {
+        m_portCPLD->close();
+    }
+}
+
+void SerialWorker::openBMCSerial(const QString &portname)
+{
+    m_portBMC = new QSerialPort(this);
+    m_portBMC->setPortName(portname);
+    m_portBMC->setBaudRate(115200);
+    m_portBMC->setDataBits(QSerialPort::Data8);
+    m_portBMC->setParity(QSerialPort::NoParity);
+    m_portBMC->setStopBits(QSerialPort::OneStop);
+    m_portBMC->setFlowControl(QSerialPort::NoFlowControl);
+
+    if(!m_portBMC->open(QIODevice::ReadWrite))
+    {
+        qDebug()<<"bmc串口打开失败";
+        return;
+    }
+    else
+    {
+        connect(m_portBMC,&QSerialPort::readyRead,this,&SerialWorker::onReadyReadBMC);
+        qDebug()<<"bmc串口打开成功";
+    }
+}
+
+void SerialWorker::openCPLDSerial(const QString &portname)
+{
+    m_portCPLD = new QSerialPort(this);
+    m_portCPLD->setPortName(portname);
+    m_portCPLD->setBaudRate(921600);
+    m_portCPLD->setDataBits(QSerialPort::Data8);
+    m_portCPLD->setParity(QSerialPort::NoParity);
+    m_portCPLD->setStopBits(QSerialPort::OneStop);
+    m_portCPLD->setFlowControl(QSerialPort::NoFlowControl);
+
+    if(!m_portCPLD->open(QIODevice::ReadWrite))
+    {
+        qDebug()<<"cpld串口打开失败";
+        return;
+    }
+    else
+    {
+        initFrame();
+        connect(m_portCPLD,&QSerialPort::readyRead,this,&SerialWorker::onReadyReadCPLD);
+        qDebug()<<"cpld串口打开成功";
+    }
+}
+
+uint16_t SerialWorker::crc16(const uint8_t *data, uint16_t len)
+{
+    uint16_t crc = 0xFFFF;
+
+    for(uint16_t i = 0; i < len; i++)
+    {
+        crc ^= ((uint16_t)data[i] << 8);
+
+        for(uint8_t j = 0; j < 8; j++)
+        {
+            if(crc & 0x8000)
+            {
+                crc = (crc << 1) ^ 0x1021;
+            }
+            else
+            {
+                crc <<= 1;
+            }
+        }
+    }
+
+    return crc;
+}
+
+void SerialWorker::initFrame()
+{
+    memset(txFrame, 0, sizeof(txFrame));
+
+    txFrame[0] = 0xA5;
+    txFrame[1] = 0x5A;
+    txFrame[2] = 0x02;
+    txFrame[3] = 0x04;
+    txFrame[4] = 0x07;
+    txFrame[5] = 0x00;
+    txFrame[6] = 0x00;
+    txFrame[7] = 0x00;
+    txFrame[8] = 0x00;
+    txFrame[9]  = 0x00;
+    txFrame[10] = 0x00;
+    txFrame[11] = 0x00;
+    txFrame[12] = 0x00;
+    txFrame[13] = 0x22;
+    txFrame[14] = 0x2A;
+    txFrame[15] = 0x00;
+    txFrame[44] = 0x00;
+    txFrame[45] = 0x00;
+    txFrame[46] = 0x00;
+    txFrame[47] = 0x00;
+}
+
+void SerialWorker::onStartTest(int index)
+{
+    if(!m_portBMC)
+        return;
+
+    m_tempIndex = index;
+    preTimer->start(500);
+
+//    m_portBMC->write("stty -echo\r");
+//    m_portBMC->flush();
+
+//    QTimer::singleShot(200, this, [=]() {
+//        pidTimer->start(500);
+//    });
+}
+
+void SerialWorker::onReadyReadBMC()
+{
+    m_buffer += m_portBMC->readAll();
+
+    QString text = QString::fromUtf8(m_buffer);
+
+    QRegularExpression re("root@[^#]*#");
+    QRegularExpressionMatch match = re.match(text);
+
+    if (!match.hasMatch())
+        return;
+
+    // 前面的HEX字符串
+    QString hex = text.left(match.capturedStart());
+
+    // 删除已经处理的数据
+    m_buffer.remove(0, match.capturedEnd());
+
+    // 去掉所有空白
+    hex.remove(QRegularExpression("\\s+"));
+
+    // 转二进制
+    QByteArray data = QByteArray::fromHex(hex.toLatin1());
+
+    if(data.size() != 48)
+    {
+        return;
+    }
+    parsePIDData(data);
+}
+
+void SerialWorker::onReadyReadCPLD()
+{
+    QByteArray data = m_portCPLD->readAll();
+
+    // 一帧35字节
+    if(data.size() < 35)
+        return;
+
+    // 帧头
+    if((uint8_t)data[0] != 0xA5 ||
+       (uint8_t)data[1] != 0x5A)
+    {
+        return;
+    }
+
+    // 固定字段
+    if((uint8_t)data[2] != 0x02)
+        return;
+    if((uint8_t)data[3] != 0x04)
+        return;
+    if((uint8_t)data[4] != 0x10)
+        return;
+    if((uint8_t)data[5] != 0x1B)
+        return;
+
+    //-------------------------
+    // CRC校验
+    //-------------------------
+
+    // 小端
+    uint16_t recvCrc = ((uint8_t)data[34] << 8) | (uint8_t)data[33];
+
+    // 计算2-32字节
+    uint16_t calcCrc = crc16((uint8_t*)data.data()+2,31);
+
+    if(recvCrc != calcCrc)
+    {
+        qDebug()<<"CRC错误";
+        return;
+    }
+
+    //-------------------------
+    // CRC正确,解析温度
+    //-------------------------
+
+    int temp[27];
+
+    for(int i=0;i<27;i++)
+    {
+        temp[i] = (uint8_t)data[6+i];
+    }
+    qDebug()<<"第1路温度:" <<temp[0];
+}
+
+void SerialWorker::parsePIDData(const QByteArray &data)
+{
+    QVector<double> temps;
+    temps.reserve(CHANNEL_COUNT);
+
+    for(int i = 0; i < CHANNEL_COUNT; ++i)
+    {
+        quint8 intPart = static_cast<quint8>(data[i * 2]);
+        //quint8 decPart = static_cast<quint8>(data[i * 2 + 1]);
+
+        if(intPart == 0xFF /*&& decPart == 0xFF*/)
+        {
+            temps.append(qQNaN());
+        }
+        else
+        {
+            temps.append(intPart/* + decPart / 100.0*/);
+        }
+    }
+    qDebug()<<"temps"<<temps;
+
+    emit signalNewTemps(temps); //发送给数据给主界面绘制
+
+    if(m_tempIndex == 0)
+    {
+        controlHeat40(temps); //控温核心代码
+    }
+    else if(m_tempIndex == 1)
+    {
+        controlHeat(temps); //控温核心代码
+    }
+}
+
+void SerialWorker::controlHeat(const QVector<double> &temps)
+{
+    double target = 70.0;
+    //double target = 40.0;
+
+    double sumTemp = 0;
+    int count = 0;
+
+    for(int i = 0; i < 6; i++)
+    {
+        double temp = temps[i];
+
+        if(qIsNaN(temp))
+            continue;
+
+        sumTemp += temp;
+        count++;
+    }
+
+    double fanDuty = 0;
+    double duty = 0;
+    double avgTemp = 0.0;
+
+    if(count > 0)
+    {
+        avgTemp = sumTemp / count;
+
+        // 第一组计算风扇
+        fanDuty = m_pid[0].calculateFanDuty(avgTemp);
+        //fanDuty = m_pid[0].calculateFanDuty1(avgTemp);
+
+        // PID计算加热
+        duty = m_pid[0].calculate(target, avgTemp);
+    }
+
+    if(avgTemp >= 63)
+    {
+        sendUpCmd();
+    }
+    else
+    {
+        sendDownCmd();
+    }
+
+    for(int fan = 0; fan < 24; fan++)
+    {
+        txFrame[16 + fan] = (uint8_t)duty;
+    }
+
+    for(int fan = 0; fan < 4; fan++)
+    {
+        txFrame[40 + fan] = (uint8_t)fanDuty;
+    }
+
+    sendSnapshot();
+}
+
+void SerialWorker::controlHeat40(const QVector<double> &temps)
+{
+    double sumTemp = 0;
+    int count = 0;
+
+    for(int i = 0; i < 6; i++)
+    {
+        double temp = temps[i];
+
+        if(qIsNaN(temp))
+            continue;
+
+        sumTemp += temp;
+        count++;
+    }
+
+    double fanDuty = 0;
+    double duty = 0;
+    double avgTemp = 0.0;
+
+    if(count > 0)
+    {
+        avgTemp = sumTemp / count;
+
+        // 第一组计算风扇
+        fanDuty = m_pid[0].calculateFanDuty1(avgTemp);
+    }
+
+    if(avgTemp >= 30)
+    {
+        sendUpCmd();
+    }
+    else
+    {
+        sendDownCmd();
+    }
+
+    for(int fan = 0; fan < 24; fan++)
+    {
+        txFrame[16 + fan] = (uint8_t)duty;
+    }
+
+    for(int fan = 0; fan < 4; fan++)
+    {
+        txFrame[40 + fan] = (uint8_t)fanDuty;
+    }
+
+    sendSnapshot();
+}
+
+void SerialWorker::sendSnapshot()
+{
+    uint16_t crc = crc16(txFrame + 2,46);
+
+    txFrame[48] = crc & 0xff;
+    txFrame[49] = (crc >> 8)&0xff;
+
+    QByteArray frame((char*)txFrame,50);
+    qDebug()<<frame.toHex(' ');
+    m_portCPLD->write(frame);
+    m_portCPLD->flush();
+}
+
+void SerialWorker::sendDownCmd()
+{
+    if (m_position <= 0)
+        return;     // 已经到底了
+
+    QByteArray dataX = QByteArray::fromHex(
+        "A55A02041100000000000000000835000103C20100001C32"
+    );
+    QByteArray dataY = QByteArray::fromHex(
+        "A55A02041100000000000000000835010103C20100007D8A"
+    );
+
+    m_portCPLD->write(dataX);
+    m_portCPLD->write(dataY);
+    m_portCPLD->flush();
+
+    --m_position;
+}
+
+void SerialWorker::sendUpCmd()
+{
+    if (m_position >= MAX_STEP)
+        return;     // 已经到顶了
+
+    QByteArray dataX = QByteArray::fromHex(
+        "A55A02041100000000000000000835000003C2010000BC77"
+    );
+    QByteArray dataY = QByteArray::fromHex(
+        "A55A02041100000000000000000835010003C2010000DDCF"
+    );
+
+    m_portCPLD->write(dataX);
+    m_portCPLD->write(dataY);
+    m_portCPLD->flush();
+
+    ++m_position;
+}

+ 59 - 0
XJKJ-rdimm/XJKJ_QT/serialworker.h

@@ -0,0 +1,59 @@
+#ifndef SERIALWORKER_H
+#define SERIALWORKER_H
+
+#include <QFile>
+#include <QObject>
+#include <QSerialPort>
+#include <QTextStream>
+#include <QTimer>
+#include <QVector>
+#include "pid.h"
+
+class SerialWorker : public QObject
+{
+    Q_OBJECT
+public:
+    explicit SerialWorker(QObject *parent = nullptr);
+    ~SerialWorker();
+
+    void openBMCSerial(const QString &portname);
+    void openCPLDSerial(const QString &portname);
+    void onStartTest(int index);
+
+public slots:
+    void onReadyReadBMC();
+    void onReadyReadCPLD();
+    void start();
+
+private:
+    void parsePIDData(const QByteArray &data);
+    void controlHeat(const QVector<double>& temps); //控温核心
+    void controlHeat40(const QVector<double>& temps); //控温核心40
+    void initFrame();
+    void sendSnapshot();
+    uint16_t crc16(const uint8_t *data, uint16_t len);
+    void sendDownCmd(); //初始化电机向下
+    void sendUpCmd(); //初始化电机向上
+
+    void saveMotorPosition();
+
+signals:
+    void signalNewTemps(QVector<double> values);
+
+private:
+    QSerialPort *m_portBMC = nullptr;
+    QSerialPort *m_portCPLD = nullptr;
+    QByteArray m_buffer;      // 接收缓冲区
+    QByteArray m_cpldBuffer;
+    QVector<PID> m_pid;
+    QTimer *pidTimer;
+    QTimer *preTimer;
+    uint8_t txFrame[50];
+    int m_position = 0;   // 当前在最高点
+
+    int m_tempIndex = -1;
+
+    //QTimer *timer = nullptr;
+};
+
+#endif // SERIALWORKER_H

+ 23 - 0
XJKJ-rdimm/bin/.qmake.stash

@@ -0,0 +1,23 @@
+QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
+QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 10
+QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 2
+QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 1
+QMAKE_CXX.COMPILER_MACROS = \
+    QT_COMPILER_STDCXX \
+    QMAKE_GCC_MAJOR_VERSION \
+    QMAKE_GCC_MINOR_VERSION \
+    QMAKE_GCC_PATCH_VERSION
+QMAKE_CXX.INCDIRS = \
+    /usr/include/c++/10 \
+    /usr/include/x86_64-linux-gnu/c++/10 \
+    /usr/include/c++/10/backward \
+    /usr/lib/gcc/x86_64-linux-gnu/10/include \
+    /usr/local/include \
+    /usr/include/x86_64-linux-gnu \
+    /usr/include
+QMAKE_CXX.LIBDIRS = \
+    /usr/lib/gcc/x86_64-linux-gnu/10 \
+    /usr/lib/x86_64-linux-gnu \
+    /usr/lib \
+    /lib/x86_64-linux-gnu \
+    /lib

File diff suppressed because it is too large
+ 502 - 0
XJKJ-rdimm/bin/Makefile


BIN
XJKJ-rdimm/bin/XJKJ_QT


BIN
XJKJ-rdimm/bin/clickframe.o


BIN
XJKJ-rdimm/bin/main.o


BIN
XJKJ-rdimm/bin/mainwindow.o


+ 134 - 0
XJKJ-rdimm/bin/moc_clickframe.cpp

@@ -0,0 +1,134 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'clickframe.h'
+**
+** Created by: The Qt Meta Object Compiler version 67 (Qt 5.15.2)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include <memory>
+#include "../XJKJ_QT/clickframe.h"
+#include <QtCore/qbytearray.h>
+#include <QtCore/qmetatype.h>
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'clickframe.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 67
+#error "This file was generated using the moc from 5.15.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+struct qt_meta_stringdata_ClickFrame_t {
+    QByteArrayData data[3];
+    char stringdata0[20];
+};
+#define QT_MOC_LITERAL(idx, ofs, len) \
+    Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
+    qptrdiff(offsetof(qt_meta_stringdata_ClickFrame_t, stringdata0) + ofs \
+        - idx * sizeof(QByteArrayData)) \
+    )
+static const qt_meta_stringdata_ClickFrame_t qt_meta_stringdata_ClickFrame = {
+    {
+QT_MOC_LITERAL(0, 0, 10), // "ClickFrame"
+QT_MOC_LITERAL(1, 11, 7), // "clicked"
+QT_MOC_LITERAL(2, 19, 0) // ""
+
+    },
+    "ClickFrame\0clicked\0"
+};
+#undef QT_MOC_LITERAL
+
+static const uint qt_meta_data_ClickFrame[] = {
+
+ // content:
+       8,       // revision
+       0,       // classname
+       0,    0, // classinfo
+       1,   14, // methods
+       0,    0, // properties
+       0,    0, // enums/sets
+       0,    0, // constructors
+       0,       // flags
+       1,       // signalCount
+
+ // signals: name, argc, parameters, tag, flags
+       1,    0,   19,    2, 0x06 /* Public */,
+
+ // signals: parameters
+    QMetaType::Void,
+
+       0        // eod
+};
+
+void ClickFrame::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
+{
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        auto *_t = static_cast<ClickFrame *>(_o);
+        Q_UNUSED(_t)
+        switch (_id) {
+        case 0: _t->clicked(); break;
+        default: ;
+        }
+    } else if (_c == QMetaObject::IndexOfMethod) {
+        int *result = reinterpret_cast<int *>(_a[0]);
+        {
+            using _t = void (ClickFrame::*)();
+            if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&ClickFrame::clicked)) {
+                *result = 0;
+                return;
+            }
+        }
+    }
+    Q_UNUSED(_a);
+}
+
+QT_INIT_METAOBJECT const QMetaObject ClickFrame::staticMetaObject = { {
+    QMetaObject::SuperData::link<QFrame::staticMetaObject>(),
+    qt_meta_stringdata_ClickFrame.data,
+    qt_meta_data_ClickFrame,
+    qt_static_metacall,
+    nullptr,
+    nullptr
+} };
+
+
+const QMetaObject *ClickFrame::metaObject() const
+{
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
+}
+
+void *ClickFrame::qt_metacast(const char *_clname)
+{
+    if (!_clname) return nullptr;
+    if (!strcmp(_clname, qt_meta_stringdata_ClickFrame.stringdata0))
+        return static_cast<void*>(this);
+    return QFrame::qt_metacast(_clname);
+}
+
+int ClickFrame::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+    _id = QFrame::qt_metacall(_c, _id, _a);
+    if (_id < 0)
+        return _id;
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        if (_id < 1)
+            qt_static_metacall(this, _c, _id, _a);
+        _id -= 1;
+    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
+        if (_id < 1)
+            *reinterpret_cast<int*>(_a[0]) = -1;
+        _id -= 1;
+    }
+    return _id;
+}
+
+// SIGNAL 0
+void ClickFrame::clicked()
+{
+    QMetaObject::activate(this, &staticMetaObject, 0, nullptr);
+}
+QT_WARNING_POP
+QT_END_MOC_NAMESPACE

BIN
XJKJ-rdimm/bin/moc_clickframe.o


+ 211 - 0
XJKJ-rdimm/bin/moc_mainwindow.cpp

@@ -0,0 +1,211 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'mainwindow.h'
+**
+** Created by: The Qt Meta Object Compiler version 67 (Qt 5.15.2)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include <memory>
+#include "../XJKJ_QT/mainwindow.h"
+#include <QtCore/qbytearray.h>
+#include <QtCore/qmetatype.h>
+#include <QtCore/QVector>
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'mainwindow.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 67
+#error "This file was generated using the moc from 5.15.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+struct qt_meta_stringdata_MainWindow_t {
+    QByteArrayData data[13];
+    char stringdata0[186];
+};
+#define QT_MOC_LITERAL(idx, ofs, len) \
+    Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
+    qptrdiff(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs \
+        - idx * sizeof(QByteArrayData)) \
+    )
+static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = {
+    {
+QT_MOC_LITERAL(0, 0, 10), // "MainWindow"
+QT_MOC_LITERAL(1, 11, 16), // "sigOpenSerialBMC"
+QT_MOC_LITERAL(2, 28, 0), // ""
+QT_MOC_LITERAL(3, 29, 8), // "portname"
+QT_MOC_LITERAL(4, 38, 17), // "sigOpenSerialCPLD"
+QT_MOC_LITERAL(5, 56, 15), // "siganlStartTest"
+QT_MOC_LITERAL(6, 72, 5), // "index"
+QT_MOC_LITERAL(7, 78, 10), // "updatePlot"
+QT_MOC_LITERAL(8, 89, 15), // "QVector<double>"
+QT_MOC_LITERAL(9, 105, 6), // "values"
+QT_MOC_LITERAL(10, 112, 20), // "on_start_btn_clicked"
+QT_MOC_LITERAL(11, 133, 25), // "on_pushButton_BMC_clicked"
+QT_MOC_LITERAL(12, 159, 26) // "on_pushButton_CPLD_clicked"
+
+    },
+    "MainWindow\0sigOpenSerialBMC\0\0portname\0"
+    "sigOpenSerialCPLD\0siganlStartTest\0"
+    "index\0updatePlot\0QVector<double>\0"
+    "values\0on_start_btn_clicked\0"
+    "on_pushButton_BMC_clicked\0"
+    "on_pushButton_CPLD_clicked"
+};
+#undef QT_MOC_LITERAL
+
+static const uint qt_meta_data_MainWindow[] = {
+
+ // content:
+       8,       // revision
+       0,       // classname
+       0,    0, // classinfo
+       7,   14, // methods
+       0,    0, // properties
+       0,    0, // enums/sets
+       0,    0, // constructors
+       0,       // flags
+       3,       // signalCount
+
+ // signals: name, argc, parameters, tag, flags
+       1,    1,   49,    2, 0x06 /* Public */,
+       4,    1,   52,    2, 0x06 /* Public */,
+       5,    1,   55,    2, 0x06 /* Public */,
+
+ // slots: name, argc, parameters, tag, flags
+       7,    1,   58,    2, 0x08 /* Private */,
+      10,    0,   61,    2, 0x08 /* Private */,
+      11,    0,   62,    2, 0x08 /* Private */,
+      12,    0,   63,    2, 0x08 /* Private */,
+
+ // signals: parameters
+    QMetaType::Void, QMetaType::QString,    3,
+    QMetaType::Void, QMetaType::QString,    3,
+    QMetaType::Void, QMetaType::Int,    6,
+
+ // slots: parameters
+    QMetaType::Void, 0x80000000 | 8,    9,
+    QMetaType::Void,
+    QMetaType::Void,
+    QMetaType::Void,
+
+       0        // eod
+};
+
+void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
+{
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        auto *_t = static_cast<MainWindow *>(_o);
+        Q_UNUSED(_t)
+        switch (_id) {
+        case 0: _t->sigOpenSerialBMC((*reinterpret_cast< const QString(*)>(_a[1]))); break;
+        case 1: _t->sigOpenSerialCPLD((*reinterpret_cast< const QString(*)>(_a[1]))); break;
+        case 2: _t->siganlStartTest((*reinterpret_cast< int(*)>(_a[1]))); break;
+        case 3: _t->updatePlot((*reinterpret_cast< QVector<double>(*)>(_a[1]))); break;
+        case 4: _t->on_start_btn_clicked(); break;
+        case 5: _t->on_pushButton_BMC_clicked(); break;
+        case 6: _t->on_pushButton_CPLD_clicked(); break;
+        default: ;
+        }
+    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
+        switch (_id) {
+        default: *reinterpret_cast<int*>(_a[0]) = -1; break;
+        case 3:
+            switch (*reinterpret_cast<int*>(_a[1])) {
+            default: *reinterpret_cast<int*>(_a[0]) = -1; break;
+            case 0:
+                *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QVector<double> >(); break;
+            }
+            break;
+        }
+    } else if (_c == QMetaObject::IndexOfMethod) {
+        int *result = reinterpret_cast<int *>(_a[0]);
+        {
+            using _t = void (MainWindow::*)(const QString & );
+            if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigOpenSerialBMC)) {
+                *result = 0;
+                return;
+            }
+        }
+        {
+            using _t = void (MainWindow::*)(const QString & );
+            if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigOpenSerialCPLD)) {
+                *result = 1;
+                return;
+            }
+        }
+        {
+            using _t = void (MainWindow::*)(int );
+            if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::siganlStartTest)) {
+                *result = 2;
+                return;
+            }
+        }
+    }
+}
+
+QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = { {
+    QMetaObject::SuperData::link<QMainWindow::staticMetaObject>(),
+    qt_meta_stringdata_MainWindow.data,
+    qt_meta_data_MainWindow,
+    qt_static_metacall,
+    nullptr,
+    nullptr
+} };
+
+
+const QMetaObject *MainWindow::metaObject() const
+{
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
+}
+
+void *MainWindow::qt_metacast(const char *_clname)
+{
+    if (!_clname) return nullptr;
+    if (!strcmp(_clname, qt_meta_stringdata_MainWindow.stringdata0))
+        return static_cast<void*>(this);
+    return QMainWindow::qt_metacast(_clname);
+}
+
+int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+    _id = QMainWindow::qt_metacall(_c, _id, _a);
+    if (_id < 0)
+        return _id;
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        if (_id < 7)
+            qt_static_metacall(this, _c, _id, _a);
+        _id -= 7;
+    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
+        if (_id < 7)
+            qt_static_metacall(this, _c, _id, _a);
+        _id -= 7;
+    }
+    return _id;
+}
+
+// SIGNAL 0
+void MainWindow::sigOpenSerialBMC(const QString & _t1)
+{
+    void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))) };
+    QMetaObject::activate(this, &staticMetaObject, 0, _a);
+}
+
+// SIGNAL 1
+void MainWindow::sigOpenSerialCPLD(const QString & _t1)
+{
+    void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))) };
+    QMetaObject::activate(this, &staticMetaObject, 1, _a);
+}
+
+// SIGNAL 2
+void MainWindow::siganlStartTest(int _t1)
+{
+    void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))) };
+    QMetaObject::activate(this, &staticMetaObject, 2, _a);
+}
+QT_WARNING_POP
+QT_END_MOC_NAMESPACE

BIN
XJKJ-rdimm/bin/moc_mainwindow.o


+ 387 - 0
XJKJ-rdimm/bin/moc_predefs.h

@@ -0,0 +1,387 @@
+#define __DBL_MIN_EXP__ (-1021)
+#define __cpp_attributes 200809L
+#define __UINT_LEAST16_MAX__ 0xffff
+#define __ATOMIC_ACQUIRE 2
+#define __FLT128_MAX_10_EXP__ 4932
+#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F
+#define __GCC_IEC_559_COMPLEX 2
+#define __UINT_LEAST8_TYPE__ unsigned char
+#define __SIZEOF_FLOAT80__ 16
+#define __INTMAX_C(c) c ## L
+#define __CHAR_BIT__ 8
+#define __UINT8_MAX__ 0xff
+#define __SCHAR_WIDTH__ 8
+#define __WINT_MAX__ 0xffffffffU
+#define __FLT32_MIN_EXP__ (-125)
+#define __cpp_static_assert 200410L
+#define __ORDER_LITTLE_ENDIAN__ 1234
+#define __SIZE_MAX__ 0xffffffffffffffffUL
+#define __WCHAR_MAX__ 0x7fffffff
+#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
+#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
+#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
+#define __DBL_DENORM_MIN__ double(4.94065645841246544176568792868221372e-324L)
+#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
+#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
+#define __GCC_IEC_559 2
+#define __FLT32X_DECIMAL_DIG__ 17
+#define __FLT_EVAL_METHOD__ 0
+#define __cpp_binary_literals 201304L
+#define __FLT64_DECIMAL_DIG__ 17
+#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
+#define __cpp_variadic_templates 200704L
+#define __UINT_FAST64_MAX__ 0xffffffffffffffffUL
+#define __SIG_ATOMIC_TYPE__ int
+#define __DBL_MIN_10_EXP__ (-307)
+#define __FINITE_MATH_ONLY__ 0
+#define __FLT32X_MAX_EXP__ 1024
+#define __FLT32_HAS_DENORM__ 1
+#define __UINT_FAST8_MAX__ 0xff
+#define __cpp_rvalue_reference 200610L
+#define __FLT32_MAX_10_EXP__ 38
+#define __DEC64_MAX_EXP__ 385
+#define __INT8_C(c) c
+#define __INT_LEAST8_WIDTH__ 8
+#define __UINT_LEAST64_MAX__ 0xffffffffffffffffUL
+#define __SHRT_MAX__ 0x7fff
+#define __LDBL_MAX__ 1.18973149535723176502126385303097021e+4932L
+#define __FLT64X_MAX_10_EXP__ 4932
+#define __FLT64X_HAS_QUIET_NAN__ 1
+#define __UINT_LEAST8_MAX__ 0xff
+#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
+#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128
+#define __UINTMAX_TYPE__ long unsigned int
+#define __linux 1
+#define __DEC32_EPSILON__ 1E-6DF
+#define __FLT_EVAL_METHOD_TS_18661_3__ 0
+#define __unix 1
+#define __UINT32_MAX__ 0xffffffffU
+#define __GXX_EXPERIMENTAL_CXX0X__ 1
+#define __FLT128_MIN_EXP__ (-16381)
+#define __WINT_MIN__ 0U
+#define __FLT128_MIN_10_EXP__ (-4931)
+#define __INT_LEAST16_WIDTH__ 16
+#define __SCHAR_MAX__ 0x7f
+#define __FLT128_MANT_DIG__ 113
+#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
+#define __INT64_C(c) c ## L
+#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
+#define __FLT32X_MANT_DIG__ 53
+#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
+#define __USER_LABEL_PREFIX__ 
+#define __FLT64X_EPSILON__ 1.08420217248550443400745280086994171e-19F64x
+#define __STDC_HOSTED__ 1
+#define __DEC64_MIN_EXP__ (-382)
+#define __DBL_DIG__ 15
+#define __FLT32_DIG__ 6
+#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F
+#define __GXX_WEAK__ 1
+#define __SHRT_WIDTH__ 16
+#define __FLT32_MAX_EXP__ 128
+#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
+#define __DEC32_MAX__ 9.999999E96DF
+#define __cpp_threadsafe_static_init 200806L
+#define __FLT64X_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951F64x
+#define __FLT32X_HAS_INFINITY__ 1
+#define __INT32_MAX__ 0x7fffffff
+#define __unix__ 1
+#define __INT_WIDTH__ 32
+#define __SIZEOF_LONG__ 8
+#define __STDC_IEC_559__ 1
+#define __STDC_ISO_10646__ 201706L
+#define __UINT16_C(c) c
+#define __DECIMAL_DIG__ 21
+#define __STDC_IEC_559_COMPLEX__ 1
+#define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64
+#define __gnu_linux__ 1
+#define __INT16_MAX__ 0x7fff
+#define __FLT64_MIN_EXP__ (-1021)
+#define __FLT64X_MIN_10_EXP__ (-4931)
+#define __LDBL_HAS_QUIET_NAN__ 1
+#define __FLT64_MANT_DIG__ 53
+#define __FLT64X_MANT_DIG__ 64
+#define __GNUC__ 10
+#define __GXX_RTTI 1
+#define __pie__ 2
+#define __MMX__ 1
+#define __FLT_HAS_DENORM__ 1
+#define __SIZEOF_LONG_DOUBLE__ 16
+#define __BIGGEST_ALIGNMENT__ 16
+#define __STDC_UTF_16__ 1
+#define __FLT64_MAX_10_EXP__ 308
+#define __cpp_delegating_constructors 200604L
+#define __FLT32_HAS_INFINITY__ 1
+#define __DBL_MAX__ double(1.79769313486231570814527423731704357e+308L)
+#define __cpp_raw_strings 200710L
+#define __INT_FAST32_MAX__ 0x7fffffffffffffffL
+#define __DBL_HAS_INFINITY__ 1
+#define __SIZEOF_FLOAT__ 4
+#define __HAVE_SPECULATION_SAFE_VALUE 1
+#define __DEC32_MIN_EXP__ (-94)
+#define __INTPTR_WIDTH__ 64
+#define __FLT64X_HAS_INFINITY__ 1
+#define __UINT_LEAST32_MAX__ 0xffffffffU
+#define __FLT32X_HAS_DENORM__ 1
+#define __INT_FAST16_TYPE__ long int
+#define __MMX_WITH_SSE__ 1
+#define __LDBL_HAS_DENORM__ 1
+#define __cplusplus 201103L
+#define __cpp_ref_qualifiers 200710L
+#define __DEC32_MIN__ 1E-95DF
+#define __DEPRECATED 1
+#define __cpp_rvalue_references 200610L
+#define __DBL_MAX_EXP__ 1024
+#define __WCHAR_WIDTH__ 32
+#define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32
+#define __DEC128_EPSILON__ 1E-33DL
+#define __SSE2_MATH__ 1
+#define __ATOMIC_HLE_RELEASE 131072
+#define __PTRDIFF_MAX__ 0x7fffffffffffffffL
+#define __amd64 1
+#define __ATOMIC_HLE_ACQUIRE 65536
+#define __GNUG__ 10
+#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
+#define __SIZEOF_SIZE_T__ 8
+#define __cpp_nsdmi 200809L
+#define __FLT64X_MIN_EXP__ (-16381)
+#define __SIZEOF_WINT_T__ 4
+#define __LONG_LONG_WIDTH__ 64
+#define __cpp_initializer_lists 200806L
+#define __cpp_hex_float 201603L
+#define __GXX_ABI_VERSION 1014
+#define __FLT128_HAS_INFINITY__ 1
+#define __FLT_MIN_EXP__ (-125)
+#define __GCC_HAVE_DWARF2_CFI_ASM 1
+#define __x86_64 1
+#define __cpp_lambdas 200907L
+#define __INT_FAST64_TYPE__ long int
+#define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64
+#define __DBL_MIN__ double(2.22507385850720138309023271733240406e-308L)
+#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128
+#define __FLT64X_NORM_MAX__ 1.18973149535723176502126385303097021e+4932F64x
+#define __SIZEOF_POINTER__ 8
+#define __LP64__ 1
+#define __DBL_HAS_QUIET_NAN__ 1
+#define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x
+#define __DECIMAL_BID_FORMAT__ 1
+#define __FLT64_MIN_10_EXP__ (-307)
+#define __FLT64X_DECIMAL_DIG__ 21
+#define __DEC128_MIN__ 1E-6143DL
+#define __REGISTER_PREFIX__ 
+#define __UINT16_MAX__ 0xffff
+#define __LDBL_HAS_INFINITY__ 1
+#define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32
+#define __UINT8_TYPE__ unsigned char
+#define __FLT_DIG__ 6
+#define __NO_INLINE__ 1
+#define __DEC_EVAL_METHOD__ 2
+#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
+#define __FLT_MANT_DIG__ 24
+#define __LDBL_DECIMAL_DIG__ 21
+#define __VERSION__ "10.2.1 20210110"
+#define __UINT64_C(c) c ## UL
+#define __cpp_unicode_characters 200704L
+#define _STDC_PREDEF_H 1
+#define __INT_LEAST32_MAX__ 0x7fffffff
+#define __GCC_ATOMIC_INT_LOCK_FREE 2
+#define __FLT128_MAX_EXP__ 16384
+#define __FLT32_MANT_DIG__ 24
+#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
+#define __FLT128_HAS_DENORM__ 1
+#define __FLT32_DECIMAL_DIG__ 9
+#define __FLT128_DIG__ 33
+#define __INT32_C(c) c
+#define __DEC64_EPSILON__ 1E-15DD
+#define __ORDER_PDP_ENDIAN__ 3412
+#define __DEC128_MIN_EXP__ (-6142)
+#define __INT_FAST32_TYPE__ long int
+#define __UINT_LEAST16_TYPE__ short unsigned int
+#define unix 1
+#define __DBL_HAS_DENORM__ 1
+#define __cpp_rtti 199711L
+#define __SIZE_TYPE__ long unsigned int
+#define __UINT64_MAX__ 0xffffffffffffffffUL
+#define __FLT64X_DIG__ 18
+#define __INT8_TYPE__ signed char
+#define __ELF__ 1
+#define __GCC_ASM_FLAG_OUTPUTS__ 1
+#define __UINT32_TYPE__ unsigned int
+#define __FLT_RADIX__ 2
+#define __INT_LEAST16_TYPE__ short int
+#define __LDBL_EPSILON__ 1.08420217248550443400745280086994171e-19L
+#define __UINTMAX_C(c) c ## UL
+#define __GLIBCXX_BITSIZE_INT_N_0 128
+#define __k8 1
+#define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x
+#define __SIG_ATOMIC_MAX__ 0x7fffffff
+#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
+#define __SIZEOF_PTRDIFF_T__ 8
+#define __LDBL_DIG__ 18
+#define __x86_64__ 1
+#define __FLT32X_MIN_EXP__ (-1021)
+#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
+#define __INT_FAST16_MAX__ 0x7fffffffffffffffL
+#define __FLT64_DIG__ 15
+#define __UINT_FAST32_MAX__ 0xffffffffffffffffUL
+#define __UINT_LEAST64_TYPE__ long unsigned int
+#define __FLT_HAS_QUIET_NAN__ 1
+#define __FLT_MAX_10_EXP__ 38
+#define __LONG_MAX__ 0x7fffffffffffffffL
+#define __FLT64X_HAS_DENORM__ 1
+#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
+#define __FLT_HAS_INFINITY__ 1
+#define __cpp_unicode_literals 200710L
+#define __UINT_FAST16_TYPE__ long unsigned int
+#define __DEC64_MAX__ 9.999999999999999E384DD
+#define __INT_FAST32_WIDTH__ 64
+#define __CHAR16_TYPE__ short unsigned int
+#define __PRAGMA_REDEFINE_EXTNAME 1
+#define __SIZE_WIDTH__ 64
+#define __SEG_FS 1
+#define __INT_LEAST16_MAX__ 0x7fff
+#define __DEC64_MANT_DIG__ 16
+#define __INT64_MAX__ 0x7fffffffffffffffL
+#define __SEG_GS 1
+#define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32
+#define __SIG_ATOMIC_WIDTH__ 32
+#define __INT_LEAST64_TYPE__ long int
+#define __INT16_TYPE__ short int
+#define __INT_LEAST8_TYPE__ signed char
+#define __SIZEOF_INT__ 4
+#define __DEC32_MAX_EXP__ 97
+#define __INT_FAST8_MAX__ 0x7f
+#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128
+#define __INTPTR_MAX__ 0x7fffffffffffffffL
+#define linux 1
+#define __FLT64_HAS_QUIET_NAN__ 1
+#define __FLT32_MIN_10_EXP__ (-37)
+#define __EXCEPTIONS 1
+#define __PTRDIFF_WIDTH__ 64
+#define __LDBL_MANT_DIG__ 64
+#define __cpp_range_based_for 200907L
+#define __FLT64_HAS_INFINITY__ 1
+#define __FLT64X_MAX__ 1.18973149535723176502126385303097021e+4932F64x
+#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
+#define __code_model_small__ 1
+#define __GCC_ATOMIC_LONG_LOCK_FREE 2
+#define __DEC32_MANT_DIG__ 7
+#define __k8__ 1
+#define __INTPTR_TYPE__ long int
+#define __UINT16_TYPE__ short unsigned int
+#define __WCHAR_TYPE__ int
+#define __pic__ 2
+#define __UINTPTR_MAX__ 0xffffffffffffffffUL
+#define __INT_FAST64_WIDTH__ 64
+#define __cpp_decltype 200707L
+#define __INT_FAST64_MAX__ 0x7fffffffffffffffL
+#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
+#define __FLT_NORM_MAX__ 3.40282346638528859811704183484516925e+38F
+#define __FLT64X_MAX_EXP__ 16384
+#define __UINT_FAST64_TYPE__ long unsigned int
+#define __INT_MAX__ 0x7fffffff
+#define __linux__ 1
+#define __INT64_TYPE__ long int
+#define __FLT_MAX_EXP__ 128
+#define __ORDER_BIG_ENDIAN__ 4321
+#define __DBL_MANT_DIG__ 53
+#define __cpp_inheriting_constructors 201511L
+#define __SIZEOF_FLOAT128__ 16
+#define __INT_LEAST64_MAX__ 0x7fffffffffffffffL
+#define __DEC64_MIN__ 1E-383DD
+#define __WINT_TYPE__ unsigned int
+#define __UINT_LEAST32_TYPE__ unsigned int
+#define __SIZEOF_SHORT__ 2
+#define __FLT32_NORM_MAX__ 3.40282346638528859811704183484516925e+38F32
+#define __SSE__ 1
+#define __LDBL_MIN_EXP__ (-16381)
+#define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64
+#define __amd64__ 1
+#define __WINT_WIDTH__ 32
+#define __INT_LEAST8_MAX__ 0x7f
+#define __INT_LEAST64_WIDTH__ 64
+#define __LDBL_MAX_EXP__ 16384
+#define __FLT32X_MAX_10_EXP__ 308
+#define __SIZEOF_INT128__ 16
+#define __LDBL_MAX_10_EXP__ 4932
+#define __ATOMIC_RELAXED 0
+#define __DBL_EPSILON__ double(2.22044604925031308084726333618164062e-16L)
+#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128
+#define _LP64 1
+#define __UINT8_C(c) c
+#define __FLT64_MAX_EXP__ 1024
+#define __INT_LEAST32_TYPE__ int
+#define __SIZEOF_WCHAR_T__ 4
+#define __GNUC_PATCHLEVEL__ 1
+#define __FLT128_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F128
+#define __FLT64_NORM_MAX__ 1.79769313486231570814527423731704357e+308F64
+#define __FLT128_HAS_QUIET_NAN__ 1
+#define __INTMAX_MAX__ 0x7fffffffffffffffL
+#define __INT_FAST8_TYPE__ signed char
+#define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x
+#define __GNUC_STDC_INLINE__ 1
+#define __FLT64_HAS_DENORM__ 1
+#define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32
+#define __DBL_DECIMAL_DIG__ 17
+#define __STDC_UTF_32__ 1
+#define __INT_FAST8_WIDTH__ 8
+#define __FXSR__ 1
+#define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x
+#define __DBL_NORM_MAX__ double(1.79769313486231570814527423731704357e+308L)
+#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+#define __INTMAX_WIDTH__ 64
+#define __cpp_runtime_arrays 198712L
+#define __UINT64_TYPE__ long unsigned int
+#define __UINT32_C(c) c ## U
+#define __cpp_alias_templates 200704L
+#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F
+#define __INT8_MAX__ 0x7f
+#define __LONG_WIDTH__ 64
+#define __PIC__ 2
+#define __UINT_FAST32_TYPE__ long unsigned int
+#define __FLT32X_NORM_MAX__ 1.79769313486231570814527423731704357e+308F32x
+#define __CHAR32_TYPE__ unsigned int
+#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F
+#define __cpp_constexpr 200704L
+#define __SSE2__ 1
+#define __INT32_TYPE__ int
+#define __SIZEOF_DOUBLE__ 8
+#define __cpp_exceptions 199711L
+#define __FLT_MIN_10_EXP__ (-37)
+#define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64
+#define __INT_LEAST32_WIDTH__ 32
+#define __INTMAX_TYPE__ long int
+#define __DEC128_MAX_EXP__ 6145
+#define __FLT32X_HAS_QUIET_NAN__ 1
+#define __ATOMIC_CONSUME 1
+#define __GNUC_MINOR__ 2
+#define __GLIBCXX_TYPE_INT_N_0 __int128
+#define __INT_FAST16_WIDTH__ 64
+#define __UINTMAX_MAX__ 0xffffffffffffffffUL
+#define __PIE__ 2
+#define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x
+#define __DBL_MAX_10_EXP__ 308
+#define __LDBL_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951L
+#define __INT16_C(c) c
+#define __STDC__ 1
+#define __FLT32X_DIG__ 15
+#define __PTRDIFF_TYPE__ long int
+#define __ATOMIC_SEQ_CST 5
+#define __FLT32X_MIN_10_EXP__ (-307)
+#define __UINTPTR_TYPE__ long unsigned int
+#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
+#define __DEC128_MANT_DIG__ 34
+#define __LDBL_MIN_10_EXP__ (-4931)
+#define __SSE_MATH__ 1
+#define __SIZEOF_LONG_LONG__ 8
+#define __cpp_user_defined_literals 200809L
+#define __FLT128_DECIMAL_DIG__ 36
+#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
+#define __FLT32_HAS_QUIET_NAN__ 1
+#define __FLT_DECIMAL_DIG__ 9
+#define __UINT_FAST16_MAX__ 0xffffffffffffffffUL
+#define __LDBL_NORM_MAX__ 1.18973149535723176502126385303097021e+4932L
+#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
+#define __UINT_FAST8_TYPE__ unsigned char
+#define _GNU_SOURCE 1
+#define __ATOMIC_ACQ_REL 4
+#define __ATOMIC_RELEASE 3

File diff suppressed because it is too large
+ 8902 - 0
XJKJ-rdimm/bin/moc_qcustomplot.cpp


BIN
XJKJ-rdimm/bin/moc_qcustomplot.o


+ 166 - 0
XJKJ-rdimm/bin/moc_serialworker.cpp

@@ -0,0 +1,166 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'serialworker.h'
+**
+** Created by: The Qt Meta Object Compiler version 67 (Qt 5.15.2)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include <memory>
+#include "../XJKJ_QT/serialworker.h"
+#include <QtCore/qbytearray.h>
+#include <QtCore/qmetatype.h>
+#include <QtCore/QVector>
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'serialworker.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 67
+#error "This file was generated using the moc from 5.15.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+struct qt_meta_stringdata_SerialWorker_t {
+    QByteArrayData data[8];
+    char stringdata0[89];
+};
+#define QT_MOC_LITERAL(idx, ofs, len) \
+    Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
+    qptrdiff(offsetof(qt_meta_stringdata_SerialWorker_t, stringdata0) + ofs \
+        - idx * sizeof(QByteArrayData)) \
+    )
+static const qt_meta_stringdata_SerialWorker_t qt_meta_stringdata_SerialWorker = {
+    {
+QT_MOC_LITERAL(0, 0, 12), // "SerialWorker"
+QT_MOC_LITERAL(1, 13, 14), // "signalNewTemps"
+QT_MOC_LITERAL(2, 28, 0), // ""
+QT_MOC_LITERAL(3, 29, 15), // "QVector<double>"
+QT_MOC_LITERAL(4, 45, 6), // "values"
+QT_MOC_LITERAL(5, 52, 14), // "onReadyReadBMC"
+QT_MOC_LITERAL(6, 67, 15), // "onReadyReadCPLD"
+QT_MOC_LITERAL(7, 83, 5) // "start"
+
+    },
+    "SerialWorker\0signalNewTemps\0\0"
+    "QVector<double>\0values\0onReadyReadBMC\0"
+    "onReadyReadCPLD\0start"
+};
+#undef QT_MOC_LITERAL
+
+static const uint qt_meta_data_SerialWorker[] = {
+
+ // content:
+       8,       // revision
+       0,       // classname
+       0,    0, // classinfo
+       4,   14, // methods
+       0,    0, // properties
+       0,    0, // enums/sets
+       0,    0, // constructors
+       0,       // flags
+       1,       // signalCount
+
+ // signals: name, argc, parameters, tag, flags
+       1,    1,   34,    2, 0x06 /* Public */,
+
+ // slots: name, argc, parameters, tag, flags
+       5,    0,   37,    2, 0x0a /* Public */,
+       6,    0,   38,    2, 0x0a /* Public */,
+       7,    0,   39,    2, 0x0a /* Public */,
+
+ // signals: parameters
+    QMetaType::Void, 0x80000000 | 3,    4,
+
+ // slots: parameters
+    QMetaType::Void,
+    QMetaType::Void,
+    QMetaType::Void,
+
+       0        // eod
+};
+
+void SerialWorker::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
+{
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        auto *_t = static_cast<SerialWorker *>(_o);
+        Q_UNUSED(_t)
+        switch (_id) {
+        case 0: _t->signalNewTemps((*reinterpret_cast< QVector<double>(*)>(_a[1]))); break;
+        case 1: _t->onReadyReadBMC(); break;
+        case 2: _t->onReadyReadCPLD(); break;
+        case 3: _t->start(); break;
+        default: ;
+        }
+    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
+        switch (_id) {
+        default: *reinterpret_cast<int*>(_a[0]) = -1; break;
+        case 0:
+            switch (*reinterpret_cast<int*>(_a[1])) {
+            default: *reinterpret_cast<int*>(_a[0]) = -1; break;
+            case 0:
+                *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QVector<double> >(); break;
+            }
+            break;
+        }
+    } else if (_c == QMetaObject::IndexOfMethod) {
+        int *result = reinterpret_cast<int *>(_a[0]);
+        {
+            using _t = void (SerialWorker::*)(QVector<double> );
+            if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&SerialWorker::signalNewTemps)) {
+                *result = 0;
+                return;
+            }
+        }
+    }
+}
+
+QT_INIT_METAOBJECT const QMetaObject SerialWorker::staticMetaObject = { {
+    QMetaObject::SuperData::link<QObject::staticMetaObject>(),
+    qt_meta_stringdata_SerialWorker.data,
+    qt_meta_data_SerialWorker,
+    qt_static_metacall,
+    nullptr,
+    nullptr
+} };
+
+
+const QMetaObject *SerialWorker::metaObject() const
+{
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
+}
+
+void *SerialWorker::qt_metacast(const char *_clname)
+{
+    if (!_clname) return nullptr;
+    if (!strcmp(_clname, qt_meta_stringdata_SerialWorker.stringdata0))
+        return static_cast<void*>(this);
+    return QObject::qt_metacast(_clname);
+}
+
+int SerialWorker::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+    _id = QObject::qt_metacall(_c, _id, _a);
+    if (_id < 0)
+        return _id;
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        if (_id < 4)
+            qt_static_metacall(this, _c, _id, _a);
+        _id -= 4;
+    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
+        if (_id < 4)
+            qt_static_metacall(this, _c, _id, _a);
+        _id -= 4;
+    }
+    return _id;
+}
+
+// SIGNAL 0
+void SerialWorker::signalNewTemps(QVector<double> _t1)
+{
+    void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))) };
+    QMetaObject::activate(this, &staticMetaObject, 0, _a);
+}
+QT_WARNING_POP
+QT_END_MOC_NAMESPACE

BIN
XJKJ-rdimm/bin/moc_serialworker.o


+ 2 - 0
XJKJ-rdimm/bin/motor.ini

@@ -0,0 +1,2 @@
+[Motor]
+Position=0

BIN
XJKJ-rdimm/bin/pid.o


BIN
XJKJ-rdimm/bin/qcustomplot.o


+ 119 - 0
XJKJ-rdimm/bin/qrc_resource.cpp

@@ -0,0 +1,119 @@
+/****************************************************************************
+** Resource object code
+**
+** Created by: The Resource Compiler for Qt version 5.15.2
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+static const unsigned char qt_resource_data[] = {
+  // /home/wg/桌面/Project/XJKJ-rdimm/XJKJ_QT/resources/style.qss
+  0x0,0x0,0x1,0x2f,
+  0x0,
+  0x0,0x4,0xe0,0x78,0x9c,0x75,0xd3,0x3d,0x4f,0x84,0x40,0x10,0x80,0xe1,0x9e,0x5f,
+  0x41,0x42,0x77,0x89,0x39,0x76,0x67,0xd9,0x61,0x35,0x16,0x8a,0xe2,0xa9,0x57,0x78,
+  0x85,0xb1,0x34,0xec,0x7,0xc4,0xa8,0x47,0x42,0x34,0x16,0xc6,0xff,0xae,0x50,0x18,
+  0xcf,0x99,0xd9,0x2d,0x8,0xe1,0xc9,0x0,0xe1,0x65,0xf7,0xf0,0x14,0x87,0xf4,0x56,
+  0x7c,0x2c,0x87,0x6d,0x1a,0xd2,0x3e,0xe6,0x9f,0xb9,0xef,0xc2,0xf3,0x30,0x8d,0xef,
+  0xfb,0x78,0x14,0xc6,0x97,0x71,0x3a,0xce,0x8b,0x76,0x59,0x27,0xf9,0x57,0x96,0xad,
+  0x57,0xf9,0xe9,0xef,0xca,0x9b,0xbb,0xfb,0xf2,0xef,0xf9,0x6a,0x9d,0xed,0xda,0xa9,
+  0x7b,0x4d,0xc5,0x7c,0xe5,0xb1,0xd9,0x9c,0xf1,0x3,0x55,0x8f,0xe8,0xcd,0x3c,0xf0,
+  0x90,0x9f,0xf3,0xbc,0xef,0xb1,0x2f,0x13,0xe5,0xd,0xcf,0x75,0xe8,0x4a,0x1d,0x28,
+  0xbf,0xe0,0x79,0xb4,0x1a,0x75,0x4d,0xf9,0x25,0xcf,0x9d,0xb1,0xe8,0x23,0xe5,0x2d,
+  0xcf,0xeb,0x50,0x59,0xe3,0x29,0xbf,0xe2,0x79,0x2,0xc4,0xa0,0x29,0xdf,0xf0,0x1c,
+  0xfb,0x79,0x53,0x7e,0xcd,0x73,0x1f,0x7c,0xd4,0xcc,0xf4,0x1b,0xe1,0x33,0xa1,0x4f,
+  0x81,0x99,0x7e,0xcb,0x73,0x70,0xe0,0xd1,0x51,0xbe,0xe5,0xb9,0x5,0x74,0xe0,0xf8,
+  0xaa,0x94,0x58,0x95,0x92,0xab,0xaa,0x83,0x8d,0xa0,0xe,0xef,0xaf,0xe4,0xaa,0x6a,
+  0x3,0x1,0x1c,0xe5,0x42,0x55,0x3f,0xc1,0x2a,0x4,0xca,0x85,0xaa,0x40,0xd5,0xfa,
+  0x7f,0x26,0x4a,0xae,0xa,0x54,0x7,0x95,0xa1,0x5c,0xa8,0xa,0x2b,0xeb,0x3d,0xf3,
+  0xaa,0x42,0x55,0x16,0xe6,0x4d,0xb9,0x50,0x55,0xb2,0x55,0x55,0x32,0xcf,0x2e,0x54,
+  0xe5,0xec,0xbc,0x29,0x17,0xaa,0xb2,0xbe,0x4b,0x91,0xe1,0x42,0x55,0x68,0x82,0x41,
+  0x86,0xb,0x55,0xf5,0xb1,0x8e,0xb0,0xfc,0xfc,0xdf,0x32,0x36,0x83,0x5,
+  
+};
+
+static const unsigned char qt_resource_name[] = {
+  // resources
+  0x0,0x9,
+  0xa,0x6c,0x78,0x43,
+  0x0,0x72,
+  0x0,0x65,0x0,0x73,0x0,0x6f,0x0,0x75,0x0,0x72,0x0,0x63,0x0,0x65,0x0,0x73,
+    // style.qss
+  0x0,0x9,
+  0x0,0x28,0xad,0x23,
+  0x0,0x73,
+  0x0,0x74,0x0,0x79,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x71,0x0,0x73,0x0,0x73,
+  
+};
+
+static const unsigned char qt_resource_struct[] = {
+  // :
+  0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+  // :/resources
+  0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+  // :/resources/style.qss
+  0x0,0x0,0x0,0x18,0x0,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+0x0,0x0,0x1,0x9f,0x68,0xac,0x27,0xe1,
+
+};
+
+#ifdef QT_NAMESPACE
+#  define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
+#  define QT_RCC_MANGLE_NAMESPACE0(x) x
+#  define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
+#  define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
+#  define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
+        QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
+#else
+#   define QT_RCC_PREPEND_NAMESPACE(name) name
+#   define QT_RCC_MANGLE_NAMESPACE(name) name
+#endif
+
+#ifdef QT_NAMESPACE
+namespace QT_NAMESPACE {
+#endif
+
+bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+#if defined(__ELF__) || defined(__APPLE__)
+static inline unsigned char qResourceFeatureZlib()
+{
+    extern const unsigned char qt_resourceFeatureZlib;
+    return qt_resourceFeatureZlib;
+}
+#else
+unsigned char qResourceFeatureZlib();
+#endif
+
+#ifdef QT_NAMESPACE
+}
+#endif
+
+int QT_RCC_MANGLE_NAMESPACE(qInitResources_resource)();
+int QT_RCC_MANGLE_NAMESPACE(qInitResources_resource)()
+{
+    int version = 3;
+    QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData)
+        (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+    return 1;
+}
+
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resource)();
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resource)()
+{
+    int version = 3;
+    version += QT_RCC_PREPEND_NAMESPACE(qResourceFeatureZlib());
+    QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData)
+       (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+    return 1;
+}
+
+namespace {
+   struct initializer {
+       initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_resource)(); }
+       ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resource)(); }
+   } dummy;
+}

BIN
XJKJ-rdimm/bin/qrc_resource.o


BIN
XJKJ-rdimm/bin/serialworker.o


+ 597 - 0
XJKJ-rdimm/bin/ui_mainwindow.h

@@ -0,0 +1,597 @@
+/********************************************************************************
+** Form generated from reading UI file 'mainwindow.ui'
+**
+** Created by: Qt User Interface Compiler version 5.15.2
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_MAINWINDOW_H
+#define UI_MAINWINDOW_H
+
+#include <QtCore/QVariant>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QSpacerItem>
+#include <QtWidgets/QWidget>
+#include <clickframe.h>
+#include "qcustomplot.h"
+
+QT_BEGIN_NAMESPACE
+
+class Ui_MainWindow
+{
+public:
+    QWidget *centralwidget;
+    QGridLayout *gridLayout;
+    QPushButton *pushButton_BMC;
+    QSpacerItem *horizontalSpacer;
+    QComboBox *comboBox_temp;
+    QPushButton *start_btn;
+    QHBoxLayout *horizontalLayout_legend;
+    QCustomPlot *customPlot;
+    QWidget *widgetLegend;
+    QGridLayout *gridLayout_5;
+    ClickFrame *CPU1_CHG;
+    QLabel *label_46;
+    ClickFrame *CPU0_CHC;
+    ClickFrame *CPU1_CHL;
+    ClickFrame *CPU0_CHJ;
+    ClickFrame *CPU1_CHI;
+    QLabel *label_32;
+    QLabel *label_45;
+    QLabel *label_40;
+    ClickFrame *CPU1_CHC;
+    ClickFrame *CPU0_CHE;
+    QLabel *label_34;
+    ClickFrame *CPU1_CHB;
+    ClickFrame *CPU0_CHH;
+    ClickFrame *CPU0_CHB;
+    ClickFrame *CPU0_CHF;
+    QLabel *label_37;
+    ClickFrame *CPU0_CHL;
+    ClickFrame *CPU1_CHF;
+    ClickFrame *CPU0_CHK;
+    QLabel *label_39;
+    ClickFrame *CPU1_CHK;
+    ClickFrame *CPU1_CHE;
+    ClickFrame *CPU0_CHI;
+    QLabel *label_51;
+    QLabel *label_47;
+    ClickFrame *CPU1_CHJ;
+    QLabel *label_31;
+    QLabel *label_48;
+    ClickFrame *CPU1_CHA;
+    QLabel *label_42;
+    QLabel *label_38;
+    ClickFrame *CPU0_CHA;
+    QLabel *label_30;
+    QLabel *label_50;
+    QLabel *label_49;
+    QLabel *label_52;
+    QLabel *label_35;
+    QLabel *label_43;
+    ClickFrame *CPU1_CHH;
+    ClickFrame *CPU0_CHG;
+    QLabel *label_29;
+    QLabel *label_44;
+    QLabel *label_36;
+    ClickFrame *CPU0_CHD;
+    ClickFrame *CPU1_CHD;
+    QLabel *label_33;
+    QLabel *label_41;
+    QPushButton *pushButton_CPLD;
+    QComboBox *comboBox;
+    QSpacerItem *horizontalSpacer_2;
+
+    void setupUi(QMainWindow *MainWindow)
+    {
+        if (MainWindow->objectName().isEmpty())
+            MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
+        MainWindow->resize(1200, 900);
+        centralwidget = new QWidget(MainWindow);
+        centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
+        gridLayout = new QGridLayout(centralwidget);
+        gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+        pushButton_BMC = new QPushButton(centralwidget);
+        pushButton_BMC->setObjectName(QString::fromUtf8("pushButton_BMC"));
+
+        gridLayout->addWidget(pushButton_BMC, 0, 1, 1, 1);
+
+        horizontalSpacer = new QSpacerItem(1043, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+        gridLayout->addItem(horizontalSpacer, 0, 6, 1, 1);
+
+        comboBox_temp = new QComboBox(centralwidget);
+        comboBox_temp->addItem(QString());
+        comboBox_temp->addItem(QString());
+        comboBox_temp->setObjectName(QString::fromUtf8("comboBox_temp"));
+        comboBox_temp->setMinimumSize(QSize(80, 0));
+
+        gridLayout->addWidget(comboBox_temp, 0, 4, 1, 1);
+
+        start_btn = new QPushButton(centralwidget);
+        start_btn->setObjectName(QString::fromUtf8("start_btn"));
+
+        gridLayout->addWidget(start_btn, 0, 5, 1, 1);
+
+        horizontalLayout_legend = new QHBoxLayout();
+        horizontalLayout_legend->setSpacing(0);
+        horizontalLayout_legend->setObjectName(QString::fromUtf8("horizontalLayout_legend"));
+        horizontalLayout_legend->setContentsMargins(5, 5, 5, 5);
+        customPlot = new QCustomPlot(centralwidget);
+        customPlot->setObjectName(QString::fromUtf8("customPlot"));
+
+        horizontalLayout_legend->addWidget(customPlot);
+
+        widgetLegend = new QWidget(centralwidget);
+        widgetLegend->setObjectName(QString::fromUtf8("widgetLegend"));
+        widgetLegend->setStyleSheet(QString::fromUtf8(""));
+        gridLayout_5 = new QGridLayout(widgetLegend);
+        gridLayout_5->setSpacing(6);
+        gridLayout_5->setObjectName(QString::fromUtf8("gridLayout_5"));
+        gridLayout_5->setContentsMargins(10, 0, 10, 0);
+        CPU1_CHG = new ClickFrame(widgetLegend);
+        CPU1_CHG->setObjectName(QString::fromUtf8("CPU1_CHG"));
+        CPU1_CHG->setMinimumSize(QSize(20, 12));
+        CPU1_CHG->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHG->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHG->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHG->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHG, 8, 2, 1, 1);
+
+        label_46 = new QLabel(widgetLegend);
+        label_46->setObjectName(QString::fromUtf8("label_46"));
+        QFont font;
+        font.setPointSize(10);
+        label_46->setFont(font);
+
+        gridLayout_5->addWidget(label_46, 12, 1, 1, 1);
+
+        CPU0_CHC = new ClickFrame(widgetLegend);
+        CPU0_CHC->setObjectName(QString::fromUtf8("CPU0_CHC"));
+        CPU0_CHC->setMinimumSize(QSize(20, 12));
+        CPU0_CHC->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHC->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHC->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHC->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHC, 2, 0, 1, 1);
+
+        CPU1_CHL = new ClickFrame(widgetLegend);
+        CPU1_CHL->setObjectName(QString::fromUtf8("CPU1_CHL"));
+        CPU1_CHL->setMinimumSize(QSize(20, 12));
+        CPU1_CHL->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHL->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHL->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHL->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHL, 13, 2, 1, 1);
+
+        CPU0_CHJ = new ClickFrame(widgetLegend);
+        CPU0_CHJ->setObjectName(QString::fromUtf8("CPU0_CHJ"));
+        CPU0_CHJ->setMinimumSize(QSize(20, 12));
+        CPU0_CHJ->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHJ->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHJ->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHJ->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHJ, 11, 0, 1, 1);
+
+        CPU1_CHI = new ClickFrame(widgetLegend);
+        CPU1_CHI->setObjectName(QString::fromUtf8("CPU1_CHI"));
+        CPU1_CHI->setMinimumSize(QSize(20, 12));
+        CPU1_CHI->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHI->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHI->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHI->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHI, 10, 2, 1, 1);
+
+        label_32 = new QLabel(widgetLegend);
+        label_32->setObjectName(QString::fromUtf8("label_32"));
+        label_32->setFont(font);
+
+        gridLayout_5->addWidget(label_32, 1, 3, 1, 1);
+
+        label_45 = new QLabel(widgetLegend);
+        label_45->setObjectName(QString::fromUtf8("label_45"));
+        label_45->setFont(font);
+
+        gridLayout_5->addWidget(label_45, 13, 3, 1, 1);
+
+        label_40 = new QLabel(widgetLegend);
+        label_40->setObjectName(QString::fromUtf8("label_40"));
+        label_40->setFont(font);
+
+        gridLayout_5->addWidget(label_40, 8, 1, 1, 1);
+
+        CPU1_CHC = new ClickFrame(widgetLegend);
+        CPU1_CHC->setObjectName(QString::fromUtf8("CPU1_CHC"));
+        CPU1_CHC->setMinimumSize(QSize(20, 12));
+        CPU1_CHC->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHC->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHC->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHC->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHC, 2, 2, 1, 1);
+
+        CPU0_CHE = new ClickFrame(widgetLegend);
+        CPU0_CHE->setObjectName(QString::fromUtf8("CPU0_CHE"));
+        CPU0_CHE->setMinimumSize(QSize(20, 12));
+        CPU0_CHE->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHE->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHE->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHE->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHE, 6, 0, 1, 1);
+
+        label_34 = new QLabel(widgetLegend);
+        label_34->setObjectName(QString::fromUtf8("label_34"));
+        label_34->setFont(font);
+
+        gridLayout_5->addWidget(label_34, 2, 1, 1, 1);
+
+        CPU1_CHB = new ClickFrame(widgetLegend);
+        CPU1_CHB->setObjectName(QString::fromUtf8("CPU1_CHB"));
+        CPU1_CHB->setMinimumSize(QSize(20, 12));
+        CPU1_CHB->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHB->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHB->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHB->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHB, 1, 2, 1, 1);
+
+        CPU0_CHH = new ClickFrame(widgetLegend);
+        CPU0_CHH->setObjectName(QString::fromUtf8("CPU0_CHH"));
+        CPU0_CHH->setMinimumSize(QSize(20, 12));
+        CPU0_CHH->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHH->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHH->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHH->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHH, 9, 0, 1, 1);
+
+        CPU0_CHB = new ClickFrame(widgetLegend);
+        CPU0_CHB->setObjectName(QString::fromUtf8("CPU0_CHB"));
+        CPU0_CHB->setMinimumSize(QSize(20, 12));
+        CPU0_CHB->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHB->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHB->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHB->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHB, 1, 0, 1, 1);
+
+        CPU0_CHF = new ClickFrame(widgetLegend);
+        CPU0_CHF->setObjectName(QString::fromUtf8("CPU0_CHF"));
+        CPU0_CHF->setMinimumSize(QSize(20, 12));
+        CPU0_CHF->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHF->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHF->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHF->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHF, 7, 0, 1, 1);
+
+        label_37 = new QLabel(widgetLegend);
+        label_37->setObjectName(QString::fromUtf8("label_37"));
+        label_37->setFont(font);
+
+        gridLayout_5->addWidget(label_37, 9, 3, 1, 1);
+
+        CPU0_CHL = new ClickFrame(widgetLegend);
+        CPU0_CHL->setObjectName(QString::fromUtf8("CPU0_CHL"));
+        CPU0_CHL->setMinimumSize(QSize(20, 12));
+        CPU0_CHL->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHL->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHL->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHL->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHL, 13, 0, 1, 1);
+
+        CPU1_CHF = new ClickFrame(widgetLegend);
+        CPU1_CHF->setObjectName(QString::fromUtf8("CPU1_CHF"));
+        CPU1_CHF->setMinimumSize(QSize(20, 12));
+        CPU1_CHF->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHF->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHF->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHF->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHF, 7, 2, 1, 1);
+
+        CPU0_CHK = new ClickFrame(widgetLegend);
+        CPU0_CHK->setObjectName(QString::fromUtf8("CPU0_CHK"));
+        CPU0_CHK->setMinimumSize(QSize(20, 12));
+        CPU0_CHK->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHK->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHK->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHK->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHK, 12, 0, 1, 1);
+
+        label_39 = new QLabel(widgetLegend);
+        label_39->setObjectName(QString::fromUtf8("label_39"));
+        label_39->setFont(font);
+
+        gridLayout_5->addWidget(label_39, 6, 1, 1, 1);
+
+        CPU1_CHK = new ClickFrame(widgetLegend);
+        CPU1_CHK->setObjectName(QString::fromUtf8("CPU1_CHK"));
+        CPU1_CHK->setMinimumSize(QSize(20, 12));
+        CPU1_CHK->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHK->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHK->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHK->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHK, 12, 2, 1, 1);
+
+        CPU1_CHE = new ClickFrame(widgetLegend);
+        CPU1_CHE->setObjectName(QString::fromUtf8("CPU1_CHE"));
+        CPU1_CHE->setMinimumSize(QSize(20, 12));
+        CPU1_CHE->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHE->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHE->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHE->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHE, 6, 2, 1, 1);
+
+        CPU0_CHI = new ClickFrame(widgetLegend);
+        CPU0_CHI->setObjectName(QString::fromUtf8("CPU0_CHI"));
+        CPU0_CHI->setMinimumSize(QSize(20, 12));
+        CPU0_CHI->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHI->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHI->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHI->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHI, 10, 0, 1, 1);
+
+        label_51 = new QLabel(widgetLegend);
+        label_51->setObjectName(QString::fromUtf8("label_51"));
+        label_51->setFont(font);
+
+        gridLayout_5->addWidget(label_51, 11, 3, 1, 1);
+
+        label_47 = new QLabel(widgetLegend);
+        label_47->setObjectName(QString::fromUtf8("label_47"));
+        label_47->setFont(font);
+
+        gridLayout_5->addWidget(label_47, 10, 1, 1, 1);
+
+        CPU1_CHJ = new ClickFrame(widgetLegend);
+        CPU1_CHJ->setObjectName(QString::fromUtf8("CPU1_CHJ"));
+        CPU1_CHJ->setMinimumSize(QSize(20, 12));
+        CPU1_CHJ->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHJ->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHJ->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHJ->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHJ, 11, 2, 1, 1);
+
+        label_31 = new QLabel(widgetLegend);
+        label_31->setObjectName(QString::fromUtf8("label_31"));
+        label_31->setFont(font);
+
+        gridLayout_5->addWidget(label_31, 1, 1, 1, 1);
+
+        label_48 = new QLabel(widgetLegend);
+        label_48->setObjectName(QString::fromUtf8("label_48"));
+        label_48->setFont(font);
+
+        gridLayout_5->addWidget(label_48, 11, 1, 1, 1);
+
+        CPU1_CHA = new ClickFrame(widgetLegend);
+        CPU1_CHA->setObjectName(QString::fromUtf8("CPU1_CHA"));
+        CPU1_CHA->setMinimumSize(QSize(20, 12));
+        CPU1_CHA->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHA->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHA->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHA->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHA, 0, 2, 1, 1);
+
+        label_42 = new QLabel(widgetLegend);
+        label_42->setObjectName(QString::fromUtf8("label_42"));
+        label_42->setFont(font);
+
+        gridLayout_5->addWidget(label_42, 7, 1, 1, 1);
+
+        label_38 = new QLabel(widgetLegend);
+        label_38->setObjectName(QString::fromUtf8("label_38"));
+        label_38->setFont(font);
+
+        gridLayout_5->addWidget(label_38, 8, 3, 1, 1);
+
+        CPU0_CHA = new ClickFrame(widgetLegend);
+        CPU0_CHA->setObjectName(QString::fromUtf8("CPU0_CHA"));
+        CPU0_CHA->setMinimumSize(QSize(20, 12));
+        CPU0_CHA->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHA->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHA->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHA->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHA, 0, 0, 1, 1);
+
+        label_30 = new QLabel(widgetLegend);
+        label_30->setObjectName(QString::fromUtf8("label_30"));
+        label_30->setFont(font);
+
+        gridLayout_5->addWidget(label_30, 0, 3, 1, 1);
+
+        label_50 = new QLabel(widgetLegend);
+        label_50->setObjectName(QString::fromUtf8("label_50"));
+        label_50->setFont(font);
+
+        gridLayout_5->addWidget(label_50, 10, 3, 1, 1);
+
+        label_49 = new QLabel(widgetLegend);
+        label_49->setObjectName(QString::fromUtf8("label_49"));
+        label_49->setFont(font);
+
+        gridLayout_5->addWidget(label_49, 12, 3, 1, 1);
+
+        label_52 = new QLabel(widgetLegend);
+        label_52->setObjectName(QString::fromUtf8("label_52"));
+        label_52->setFont(font);
+
+        gridLayout_5->addWidget(label_52, 13, 1, 1, 1);
+
+        label_35 = new QLabel(widgetLegend);
+        label_35->setObjectName(QString::fromUtf8("label_35"));
+        label_35->setFont(font);
+
+        gridLayout_5->addWidget(label_35, 2, 3, 1, 1);
+
+        label_43 = new QLabel(widgetLegend);
+        label_43->setObjectName(QString::fromUtf8("label_43"));
+        label_43->setFont(font);
+
+        gridLayout_5->addWidget(label_43, 7, 3, 1, 1);
+
+        CPU1_CHH = new ClickFrame(widgetLegend);
+        CPU1_CHH->setObjectName(QString::fromUtf8("CPU1_CHH"));
+        CPU1_CHH->setMinimumSize(QSize(20, 12));
+        CPU1_CHH->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHH->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHH->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHH->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHH, 9, 2, 1, 1);
+
+        CPU0_CHG = new ClickFrame(widgetLegend);
+        CPU0_CHG->setObjectName(QString::fromUtf8("CPU0_CHG"));
+        CPU0_CHG->setMinimumSize(QSize(20, 12));
+        CPU0_CHG->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHG->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHG->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHG->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHG, 8, 0, 1, 1);
+
+        label_29 = new QLabel(widgetLegend);
+        label_29->setObjectName(QString::fromUtf8("label_29"));
+        label_29->setFont(font);
+
+        gridLayout_5->addWidget(label_29, 0, 1, 1, 1);
+
+        label_44 = new QLabel(widgetLegend);
+        label_44->setObjectName(QString::fromUtf8("label_44"));
+        label_44->setFont(font);
+
+        gridLayout_5->addWidget(label_44, 9, 1, 1, 1);
+
+        label_36 = new QLabel(widgetLegend);
+        label_36->setObjectName(QString::fromUtf8("label_36"));
+        label_36->setFont(font);
+
+        gridLayout_5->addWidget(label_36, 3, 1, 1, 1);
+
+        CPU0_CHD = new ClickFrame(widgetLegend);
+        CPU0_CHD->setObjectName(QString::fromUtf8("CPU0_CHD"));
+        CPU0_CHD->setMinimumSize(QSize(20, 12));
+        CPU0_CHD->setMaximumSize(QSize(16777215, 10));
+        CPU0_CHD->setStyleSheet(QString::fromUtf8(""));
+        CPU0_CHD->setFrameShape(QFrame::StyledPanel);
+        CPU0_CHD->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU0_CHD, 3, 0, 1, 1);
+
+        CPU1_CHD = new ClickFrame(widgetLegend);
+        CPU1_CHD->setObjectName(QString::fromUtf8("CPU1_CHD"));
+        CPU1_CHD->setMinimumSize(QSize(20, 12));
+        CPU1_CHD->setMaximumSize(QSize(16777215, 10));
+        CPU1_CHD->setStyleSheet(QString::fromUtf8(""));
+        CPU1_CHD->setFrameShape(QFrame::StyledPanel);
+        CPU1_CHD->setFrameShadow(QFrame::Raised);
+
+        gridLayout_5->addWidget(CPU1_CHD, 3, 2, 1, 1);
+
+        label_33 = new QLabel(widgetLegend);
+        label_33->setObjectName(QString::fromUtf8("label_33"));
+        label_33->setFont(font);
+
+        gridLayout_5->addWidget(label_33, 3, 3, 1, 1);
+
+        label_41 = new QLabel(widgetLegend);
+        label_41->setObjectName(QString::fromUtf8("label_41"));
+        label_41->setFont(font);
+
+        gridLayout_5->addWidget(label_41, 6, 3, 1, 1);
+
+
+        horizontalLayout_legend->addWidget(widgetLegend);
+
+        horizontalLayout_legend->setStretch(0, 8);
+
+        gridLayout->addLayout(horizontalLayout_legend, 1, 0, 1, 7);
+
+        pushButton_CPLD = new QPushButton(centralwidget);
+        pushButton_CPLD->setObjectName(QString::fromUtf8("pushButton_CPLD"));
+
+        gridLayout->addWidget(pushButton_CPLD, 0, 2, 1, 1);
+
+        comboBox = new QComboBox(centralwidget);
+        comboBox->setObjectName(QString::fromUtf8("comboBox"));
+        comboBox->setMinimumSize(QSize(120, 0));
+
+        gridLayout->addWidget(comboBox, 0, 0, 1, 1);
+
+        horizontalSpacer_2 = new QSpacerItem(300, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
+
+        gridLayout->addItem(horizontalSpacer_2, 0, 3, 1, 1);
+
+        MainWindow->setCentralWidget(centralwidget);
+
+        retranslateUi(MainWindow);
+
+        QMetaObject::connectSlotsByName(MainWindow);
+    } // setupUi
+
+    void retranslateUi(QMainWindow *MainWindow)
+    {
+        MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr));
+        pushButton_BMC->setText(QCoreApplication::translate("MainWindow", "\350\277\236\346\216\245BMC", nullptr));
+        comboBox_temp->setItemText(0, QCoreApplication::translate("MainWindow", "40", nullptr));
+        comboBox_temp->setItemText(1, QCoreApplication::translate("MainWindow", "70", nullptr));
+
+        start_btn->setText(QCoreApplication::translate("MainWindow", "\345\274\200\345\247\213\346\265\213\350\257\225", nullptr));
+        label_46->setText(QCoreApplication::translate("MainWindow", "CPU0_CHK", nullptr));
+        label_32->setText(QCoreApplication::translate("MainWindow", "CPU1_CHB", nullptr));
+        label_45->setText(QCoreApplication::translate("MainWindow", "CPU1_CHL", nullptr));
+        label_40->setText(QCoreApplication::translate("MainWindow", "CPU0_CHG", nullptr));
+        label_34->setText(QCoreApplication::translate("MainWindow", "CPU0_CHC", nullptr));
+        label_37->setText(QCoreApplication::translate("MainWindow", "CPU1_CHH", nullptr));
+        label_39->setText(QCoreApplication::translate("MainWindow", "CPU0_CHE", nullptr));
+        label_51->setText(QCoreApplication::translate("MainWindow", "CPU1_CHJ", nullptr));
+        label_47->setText(QCoreApplication::translate("MainWindow", "CPU0_CHI", nullptr));
+        label_31->setText(QCoreApplication::translate("MainWindow", "CPU0_CHB", nullptr));
+        label_48->setText(QCoreApplication::translate("MainWindow", "CPU0_CHJ", nullptr));
+        label_42->setText(QCoreApplication::translate("MainWindow", "CPU0_CHF", nullptr));
+        label_38->setText(QCoreApplication::translate("MainWindow", "CPU1_CHG", nullptr));
+        label_30->setText(QCoreApplication::translate("MainWindow", "CPU1_CHA", nullptr));
+        label_50->setText(QCoreApplication::translate("MainWindow", "CPU1_CHI", nullptr));
+        label_49->setText(QCoreApplication::translate("MainWindow", "CPU1_CHK", nullptr));
+        label_52->setText(QCoreApplication::translate("MainWindow", "CPU0_CHL", nullptr));
+        label_35->setText(QCoreApplication::translate("MainWindow", "CPU1_CHC", nullptr));
+        label_43->setText(QCoreApplication::translate("MainWindow", "CPU1_CHF", nullptr));
+        label_29->setText(QCoreApplication::translate("MainWindow", "CPU0_CHA", nullptr));
+        label_44->setText(QCoreApplication::translate("MainWindow", "CPU0_CHH", nullptr));
+        label_36->setText(QCoreApplication::translate("MainWindow", "CPU0_CHD", nullptr));
+        label_33->setText(QCoreApplication::translate("MainWindow", "CPU1_CHD", nullptr));
+        label_41->setText(QCoreApplication::translate("MainWindow", "CPU1_CHE", nullptr));
+        pushButton_CPLD->setText(QCoreApplication::translate("MainWindow", "\350\277\236\346\216\245CPLD", nullptr));
+    } // retranslateUi
+
+};
+
+namespace Ui {
+    class MainWindow: public Ui_MainWindow {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_MAINWINDOW_H