James 4 년 전
커밋
7ace6d80c2

+ 5 - 0
ytDashBoard.pro

@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+    ytDashBoardCore \
+    ytDashBoardDog

+ 395 - 0
ytDashBoard.pro.user

@@ -0,0 +1,395 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 4.7.2, 2021-07-09T18:42:40. -->
+<qtcreator>
+ <data>
+  <variable>EnvironmentId</variable>
+  <value type="QByteArray">{3617412f-ba16-4fe4-83d8-8a9ba84ea18b}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+    <value type="QString" key="language">Cpp</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
+    </valuemap>
+   </valuemap>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+    <value type="QString" key="language">QmlJS</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
+    </valuemap>
+   </valuemap>
+   <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
+   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
+   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+   <value type="int" key="EditorConfiguration.IndentSize">4</value>
+   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
+   <value type="int" key="EditorConfiguration.MarginColumn">80</value>
+   <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
+   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+   <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
+   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+   <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
+   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+   <value type="int" key="EditorConfiguration.TabSize">8</value>
+   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap">
+   <valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
+   <value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.9.7</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.9.7</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{ba7ab7ec-e6d7-4239-8d06-20d6c39c5b99}</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/yt/Qt2/ytDashBoard</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.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></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"></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.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></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"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
+    <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="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/yt/Desktop/build-ytDashBoard-Qt_5_9_7-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.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></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"></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.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></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"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
+    <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="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/yt/Desktop/build-ytDashBoard-Qt_5_9_7-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.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></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"></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.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></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"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value>
+    <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="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</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">部署</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy Configuration</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <value type="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="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">ytDashBoardCore</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/yt/Desktop/ytDashBoard.20210708/ytDashBoard/ytDashBoardCore/ytDashBoardCore.pro</value>
+    <value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">ytDashBoardCore/ytDashBoardCore.pro</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">/home/yt/Desktop/build-ytDashBoard-Qt_5_9_7-Release/ytDashBoardCore</value>
+    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
+    <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="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">ytDashBoardDog</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/yt/Desktop/ytDashBoard.20210708/ytDashBoard/ytDashBoardDog/ytDashBoardDog.pro</value>
+    <value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">ytDashBoardDog/ytDashBoardDog.pro</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">/home/yt/Desktop/build-ytDashBoard-Qt_5_9_7-Release/ytDashBoardDog</value>
+    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</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">18</value>
+ </data>
+ <data>
+  <variable>Version</variable>
+  <value type="int">18</value>
+ </data>
+</qtcreator>

+ 68 - 0
ytDashBoardCore/dashboardshm.h

@@ -0,0 +1,68 @@
+#ifndef DASHBOARDSHM_H
+#define DASHBOARDSHM_H
+
+
+#include <stdbool.h>
+#include <sys/types.h>
+#include <sys/shm.h>
+#include <sys/ipc.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#pragma pack(1)
+
+typedef struct{
+    int AlarmStatus;
+    char Time[40];
+    double Value;
+} YtPointValue;
+
+typedef struct{
+    unsigned char Enabled;
+    int BusAddr;
+    int PointType;
+    int AlarmType;
+    int IsKeyPoint;
+    int AlarmStatus;
+    char Time[40];
+    double Value;
+    char PointName[240];
+    YtPointValue pointvaluelist[10];
+} YtPoint;
+
+typedef struct{
+    unsigned char Enabled;
+    char DeviceID[40];
+    char DeviceName[250];
+    char DeviceTypeID[40];
+    char DeviceType[240];
+    char DeviceStatusNote[250];
+    int DeviceStatus;
+    uint UpTime;
+    YtPoint DevicePoint[256];
+} YtDevice;
+
+typedef struct{
+    unsigned char Enabled;
+    char StationID[40];
+    char StationName[250];
+    char StationStatusNote[250];
+    int StationStatus;
+    int DeviceCount;
+    int DeviceAlarm;
+    int DeviceFault;
+    char LastCommTime[40];
+    YtDevice StationDevice[128];
+} YtStation;
+
+typedef struct{
+    int StationCount;
+    YtStation station[16];
+} YtStationCount;
+
+#pragma pack()
+
+#define MEM_PATH    "/"
+#define MEM_PORT    5222
+
+#endif // DASHBOARDSHM_H

+ 201 - 0
ytDashBoardCore/databasethread.cpp

@@ -0,0 +1,201 @@
+#include "databasethread.h"
+#include "databoardmem.h"
+
+DatabaseThread::DatabaseThread(QObject *parent) : QThread(parent)
+{
+    sqlList.clear();
+    keepwork = false;
+}
+
+
+void DatabaseThread::stop()
+{
+    keepwork = false;
+}
+
+void DatabaseThread::mem_init()
+{
+    int nrow[2];
+    QSqlQuery qry = db.exec("select count(*) from yt_t_station ");
+    if(qry.next()){
+        ytStationCount->StationCount = qry.value(0).toInt();
+    }
+    qry.clear();
+    nrow[0] = 0;
+    for(int i=0;i<16;i++)
+        ytStationCount->station[i].Enabled = 0x00;
+    qry = db.exec("select a.uq_station_id,a.v_station_name,(select count(*) from yt_t_devices where uq_station_id = a.uq_station_id) from yt_t_station a");
+    while (qry.next()) {
+        if(nrow[0]>15)
+            break;
+        sprintf(ytStationCount->station[nrow[0]].StationID,"%s",qry.value(0).toString().toUtf8().data());
+        sprintf(ytStationCount->station[nrow[0]].StationName,"%s",qry.value(1).toString().toUtf8().data());
+        ytStationCount->station[nrow[0]].DeviceCount = qry.value(2).toInt();
+        ytStationCount->station[nrow[0]].Enabled = 0x01;
+        nrow[1] = 0;
+        for(int i=0;i<128;i++)
+            ytStationCount->station[nrow[0]].StationDevice[i].Enabled = 0x00;
+        QSqlQuery qry2 = db.exec(QString("select a.uq_device_id,a.v_devicename,a.uq_devicetype_id,(select v_devicetype from yt_t_devicetype where uq_devicetype_id = a.uq_devicetype_id) from yt_t_devices a where a.uq_station_id = '%1' order by a.uq_devicetype_id,a.v_devicename").arg(qry.value(0).toString()));
+        while(qry2.next()){
+            if(nrow[1]>127)
+                break;
+            sprintf(ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DeviceID,"%s",qry2.value(0).toString().toUtf8().data());
+            sprintf(ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DeviceName,"%s",qry2.value(1).toString().toUtf8().data());
+            sprintf(ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DeviceTypeID,"%s",qry2.value(2).toString().toUtf8().data());
+            sprintf(ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DeviceType,"%s",qry2.value(3).toString().toUtf8().data());
+            ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DeviceStatus=0;
+            sprintf(ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DeviceStatusNote,"正常");
+            ytStationCount->station[nrow[0]].StationDevice[nrow[1]].UpTime = QDateTime::currentDateTime().toTime_t();
+            ytStationCount->station[nrow[0]].StationDevice[nrow[1]].Enabled = 0x01;
+            for(int i=0;i<256;i++)
+                ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DevicePoint[i].Enabled = 0x00;
+            QSqlQuery qry3 = db.exec(QString("select i_busaddr,v_pointname,e_pointtype,e_alarmtype,b_iskeypoint from yt_t_point where uq_device_id = '%1'").arg(qry2.value(0).toString()));
+            while (qry3.next()) {
+                int addr = qry3.value(0).toInt();
+                if((addr>=0)&&(addr<256)){
+                    ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DevicePoint[addr].BusAddr = addr;
+                    sprintf(ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DevicePoint[addr].PointName,"%s",qry3.value(1).toString().toUtf8().data());
+                    ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DevicePoint[addr].PointType = qry3.value(2).toInt();
+                    ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DevicePoint[addr].AlarmType = qry3.value(3).toInt();
+                    ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DevicePoint[addr].IsKeyPoint = qry3.value(4).toInt();
+                    ytStationCount->station[nrow[0]].StationDevice[nrow[1]].DevicePoint[addr].Enabled = 0x01;
+                }
+            }
+            qry3.clear();
+            nrow[1]++;
+        }
+        qry2.clear();
+        nrow[0]++;
+    }
+    qry.clear();
+}
+
+void DatabaseThread::savedata() //保存整点数据
+{
+    int minute = QDateTime::currentDateTime().time().minute();
+    printf("  enter into savedata() -----minute %d",minute);
+
+    for(int i=0;i<16;i++)
+    {
+        QString data;
+        QString stationStr;
+
+        if(ytStationCount->station[i].Enabled==0x01)
+        {
+            QString deviceStr;
+            for(int j=0;j<128;j++)
+            {
+                if(ytStationCount->station[i].StationDevice[j].Enabled==0x01)
+                {
+                    QString pointStr;
+
+                    for(int k=0;k<256;k++){
+                        if(ytStationCount->station[i].StationDevice[j].DevicePoint[k].Enabled==0x01){
+                            QString pointvalueStr;
+                            pointvalueStr.append(QString("\"AlarmStatus\":%1,\"Value\":%2,\"Time\":\"%3\"").arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[0].AlarmStatus).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[0].Value).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[0].Time));
+
+                            if(pointvalueStr.size()>1)
+                            {
+                                pointStr.append(QString("{\"BusAddr\":%1,\"PointName\":\"%2\",\"PointType\":%3,\"AlarmType\":%4,%5},").arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].BusAddr).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].PointName).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].PointType).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].AlarmType).arg(pointvalueStr));
+                            }else{
+                                pointStr.append(QString("{\"BusAddr\":%1,\"PointName\":\"%2\",\"PointType\":%3,\"AlarmType\":%4},").arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].BusAddr).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].PointName).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].PointType).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].AlarmType));
+                            }
+                        }
+
+                    }
+
+
+                    pointStr=pointStr.left(pointStr.length()-1);
+                    deviceStr.append(QString("{\"DeviceID\":\"%1\",\"DeviceName\":\"%2\",\"DeviceTypeID\":\"%3\",\"DeviceType\":\"%4\",\"DeviceStatus\":%5,\"DeviceStatusNote\":\"%6\",\"Points\":[%7]},").arg(ytStationCount->station[i].StationDevice[j].DeviceID).arg(ytStationCount->station[i].StationDevice[j].DeviceName).arg(ytStationCount->station[i].StationDevice[j].DeviceTypeID).arg(ytStationCount->station[i].StationDevice[j].DeviceType).arg(ytStationCount->station[i].StationDevice[j].DeviceStatus).arg(ytStationCount->station[i].StationDevice[j].DeviceStatusNote).arg(pointStr));
+
+
+                }
+
+            }
+            deviceStr=deviceStr.left(deviceStr.length()-1);
+            stationStr.append(QString("{\"StationID\":\"%1\",\"StationName\":\"%2\",\"Time\":\"%3\",\"LIST\":[%4]}").arg(ytStationCount->station[i].StationID).arg(ytStationCount->station[i].StationName).arg(ytStationCount->station[i].LastCommTime).arg(deviceStr));
+
+            data=QString("{\"time\":\"%1\",\"CMD\":\"getPatrolDetail\",\"VER\":\"1.00\",\"RESULT\":%2,\"TimeStamp\":\"%3\",\"REPLY\":1}").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")).arg(stationStr).arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"));
+
+            db.exec(QString("insert into yt_t_rec(v_datatime,uq_station_id,t_values) values('%1','%2','%3')").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")).arg(ytStationCount->station[i].StationID).arg(data));
+
+
+        }
+    }
+
+
+}
+
+void DatabaseThread::run()
+{
+    QString savetime = "2430";
+    QString savesecond = "1000";
+    keepwork = true;
+    db = QSqlDatabase::addDatabase("QMYSQL","databoard_db");
+    db.setHostName("127.0.0.1");
+    db.setUserName("root");
+    db.setPassword("root");
+    db.setDatabaseName("DataDashBoard");
+    if(db.open()){
+        mem_init();
+        while (keepwork) {
+            QDateTime dt = QDateTime::currentDateTime();
+            for(int s=0;s<16;s++){
+                if(ytStationCount->station[s].Enabled==0x01){
+                    for(int d=0;d<128;d++){
+                        if(ytStationCount->station[s].StationDevice[d].Enabled==0x01){
+                            if((dt.toTime_t()-ytStationCount->station[s].StationDevice[d].UpTime)>300){
+                                if(ytStationCount->station[s].StationDevice[d].DeviceStatus!=1){
+                                    ytStationCount->station[s].StationDevice[d].DeviceStatus = 2;
+                                    sprintf(ytStationCount->station[s].StationDevice[d].DeviceStatusNote,"%s",QString::fromUtf8("故障").toUtf8().data());
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            if((dt.time().minute()==0)||(dt.time().minute()==30)){
+                QString Stime = dt.toString("HHmm");
+                if(QString::compare(Stime,savetime)!=0){
+                    savetime = Stime;
+                    savedata();
+                }
+            }
+
+            //将从数据库查询出来的所有电子巡检记录封装到QList中,然后emit到Core主程序,然后主程序再调用前端处理线程中的函数
+            if(dt.time().second()==0){
+                QString Ssecond = dt.toString("mmss");
+                if(QString::compare(Ssecond,savesecond)!=0)
+                {
+                    savesecond = Ssecond;
+                    printf("  dt.time().second() ----- %d\n",dt.time().second());
+                    sendPatrolList.clear();
+                    QSqlQuery patrol = db.exec("select v_datatime,uq_station_id,t_values from yt_t_rec");
+                    while (patrol.next()) {
+                        QString DataTime = patrol.value(0).toDateTime().toString("yyyy-MM-dd HH:mm:ss").toUtf8().data();
+                        QString StationId = patrol.value(1).toString().toUtf8().data();
+                        QString Values = patrol.value(2).toString().toUtf8().data();
+
+                        sqlList.clear();
+                        sqlList<<DataTime<<StationId<<Values;
+
+                        if(sendPatrolList.size() == 2688){  //保留最近28天的数据 2*24*2*28
+                            sendPatrolList.removeAt(0);
+
+                        }
+
+                        sendPatrolList.append(sqlList);
+
+                    }
+                    patrol.clear();
+                    emit sendpatrol(sendPatrolList);
+                }
+
+            }
+
+
+            usleep(500000);
+        }
+        db.close();
+    }
+}

+ 51 - 0
ytDashBoardCore/databasethread.h

@@ -0,0 +1,51 @@
+#ifndef DATABASETHREAD_H
+#define DATABASETHREAD_H
+
+#include <QThread>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QVariant>
+#include <QDateTime>
+#include <QString>
+#include <QStringList>
+#include <QList>
+
+
+class SendPatrolRecord{
+public:
+    explicit SendPatrolRecord(QString time="",QString id="",QString value=""){
+        DataTime = time;
+        StationId = id;
+        Values = value;
+    }
+    QString DataTime;
+    QString StationId;
+    QString Values;
+};
+
+class DatabaseThread : public QThread
+{
+    Q_OBJECT
+public:
+    explicit DatabaseThread(QObject *parent = nullptr);
+    void run();
+    void mem_init();
+    void appendSql(QString sql);
+    void stop();
+    void savedata();
+
+
+signals:
+    void sendpatrol(QList<QStringList> sendPatrolList);
+
+public slots:
+
+private:
+    bool keepwork;
+    QSqlDatabase db;
+    QStringList sqlList;
+    QList<QStringList > sendPatrolList;
+
+};
+
+#endif // DATABASETHREAD_H

+ 58 - 0
ytDashBoardCore/databoardcore.cpp

@@ -0,0 +1,58 @@
+#include "databoardcore.h"
+
+#include "../ytDashBoardDog/dataprecess.h"
+
+DataBoardCore::DataBoardCore(QObject *parent) : QObject(parent)
+{
+    mDay = -1;
+    dbThread = new DatabaseThread(this);
+    ws = new WebSocketServer(this);
+    logThread = new LogThread(this);
+    infoServer = new InfoCenterServer(this);
+    timer = new QTimer(this);
+    connect(ws,&WebSocketServer::weblog,this,&DataBoardCore::weblog);
+    connect(infoServer,&InfoCenterServer::weblog,this,&DataBoardCore::weblog);
+    connect(timer,&QTimer::timeout,this,&DataBoardCore::timeout);
+
+    qRegisterMetaType<QList<QStringList>>("QList<QStringList>");
+
+    connect(dbThread,&DatabaseThread::sendpatrol,this,&DataBoardCore::receivepatrol);
+    dbThread->start();
+
+}
+
+void DataBoardCore::start()
+{
+    ws->start();
+    logThread->start();
+    infoServer->start();
+    timer->start(5);
+}
+
+void DataBoardCore::weblog(QString receivelog)
+{
+    logThread->appendData(receivelog);
+}
+
+//清除超过一个月的日志文件
+void DataBoardCore::timeout()
+{
+    dataProcessShm->UpTime = QDateTime::currentDateTime().toTime_t();
+    if(mDay != QDate::currentDate().day()){
+        mDay = QDate::currentDate().day();
+        uint l_time = QDateTime::currentDateTime().toTime_t()-30*86400;
+        QDir dir("/opt/log");
+        QFileInfoList file_list = dir.entryInfoList(QDir::Files);
+        for(int i=0;i<file_list.size();i++){
+            QFileInfo f_info = file_list.at(i);
+            if(f_info.lastModified().toTime_t()<l_time){
+                QFile(f_info.canonicalFilePath()).remove();
+            }
+        }
+    }
+}
+
+void DataBoardCore::receivepatrol(QList<QStringList > receivePatrolList)
+{
+    ws->patrolrecord(receivePatrolList);
+}

+ 42 - 0
ytDashBoardCore/databoardcore.h

@@ -0,0 +1,42 @@
+#ifndef DATABOARDCORE_H
+#define DATABOARDCORE_H
+
+#include <QObject>
+#include <QTimer>
+#include <QFileInfoList>
+#include <QDir>
+#include <QDateTime>
+#include <QDate>
+#include "logthread.h"
+#include "infocenterserver.h"
+#include "websocketserver.h"
+#include "databasethread.h"
+
+
+
+class DataBoardCore : public QObject
+{
+    Q_OBJECT
+public:
+    explicit DataBoardCore(QObject *parent = nullptr);
+    void start();
+
+signals:
+
+public slots:
+    void weblog(QString receivelog);
+    void timeout();
+    void receivepatrol(QList<QStringList > receivePatrolList);
+
+private:
+    int mDay;
+    QSqlDatabase db;
+    LogThread *logThread;
+    WebSocketServer *ws;
+    InfoCenterServer *infoServer;
+    DatabaseThread *dbThread;
+    QTimer *timer;
+    QList<QStringList > receivePatrolList;
+};
+
+#endif // DATABOARDCORE_H

+ 8 - 0
ytDashBoardCore/databoardmem.h

@@ -0,0 +1,8 @@
+#ifndef DATABOARDMEM_H
+#define DATABOARDMEM_H
+
+#include "dashboardshm.h"
+
+extern YtStationCount *ytStationCount;
+
+#endif // DATABOARDMEM_H

+ 62 - 0
ytDashBoardCore/infocenterserver.cpp

@@ -0,0 +1,62 @@
+#include "infocenterserver.h"
+
+InfoCenterServer::InfoCenterServer(QObject *parent) : QTcpServer(parent)
+{
+    clientList.clear();
+
+}
+
+void InfoCenterServer::start()
+{
+    if(!listen(QHostAddress::Any,6002)){
+        printf("listen 6002 failed\n");
+        this->appendData("listen 6002 failed");
+        exit(1);
+    }else{
+
+        printf("listen on 6002\n");
+        this->appendData("listen on 6002");
+    }
+}
+
+void InfoCenterServer::incomingConnection(qintptr socketDescriptor)
+{
+    printf("new incoming\n");
+    this->appendData("incomingConnection");
+    InfoClient *client = new InfoClient(socketDescriptor,this);
+    clientList.append(client);
+    connect(client,&InfoClient::write_error,this,&InfoCenterServer::write_error);
+    connect(client,&InfoClient::sendlog,this,&InfoCenterServer::receivelog);
+    connect(client,&InfoClient::finished,client,&InfoClient::quit);
+    client->start();
+}
+
+void InfoCenterServer::receivelog(QString recelog)
+{
+    this->appendData(recelog);
+}
+
+void InfoCenterServer::appendData(QString emitlog)
+{
+    emit weblog(emitlog);
+}
+
+
+
+
+
+void InfoCenterServer::write_error()
+{
+    this->appendData("enter into InfoCenterServer::write_error()");
+    InfoClient *pClient = qobject_cast<InfoClient *>(sender());
+    QList<InfoClient *>::iterator i;
+    for(i=clientList.begin();i!=clientList.end();i++){
+        InfoClient *client = *i;
+        if(client==pClient){
+            clientList.removeAll(client);
+            client->deleteLater();
+        }
+    }
+}
+
+

+ 40 - 0
ytDashBoardCore/infocenterserver.h

@@ -0,0 +1,40 @@
+#ifndef INFOCENTERSERVER_H
+#define INFOCENTERSERVER_H
+
+#include <QTcpServer>
+#include <QTcpSocket>
+#include <QStringList>
+#include <QTimer>
+#include <QList>
+#include "infoclient.h"
+
+
+class InfoCenterServer : public QTcpServer
+{
+    Q_OBJECT
+public:
+    explicit InfoCenterServer(QObject *parent = nullptr);
+    void start();
+    bool check_usercompany(QString agentid, QString compnaycode);
+    void appendData(QString data);
+
+
+protected:
+    void incomingConnection(qintptr socketDescriptor) override;
+
+signals:
+    void weblog(QString emitlog);
+
+public slots:
+    void write_error();
+    void receivelog(QString recelog);
+//    void savedata();
+
+private:
+    QList<InfoClient *> clientList;
+//    QTimer *timer;
+//    QSqlDatabase db;
+//    int flag;
+};
+
+#endif // INFOCENTERSERVER_H

+ 150 - 0
ytDashBoardCore/infoclient.cpp

@@ -0,0 +1,150 @@
+#include "infoclient.h"
+
+#include "databoardmem.h"
+
+InfoClient::InfoClient(qintptr socketDescriptor, QObject *parent)
+    :QThread(parent){
+
+    db = QSqlDatabase::database("DataDashBoard");
+
+    AgentId = "";
+    this->socketDescriptor = socketDescriptor;
+    count = 0;
+    isWorking = false;
+}
+
+
+
+void InfoClient::appendData(QString emitlog)
+{
+    emit sendlog(emitlog);
+}
+
+
+void InfoClient::run()
+{
+    QTcpSocket tcpSocket;
+    if(!tcpSocket.setSocketDescriptor(socketDescriptor)){
+        printf("setSocketDescriptor failed\n");
+        emit write_error();
+        return;
+    }
+    printf("InfoClient::run()\n");
+    this->appendData("enter into InfoClient::run()");
+    count = 0;
+    isWorking = true;
+    while(isWorking){
+        if(tcpSocket.state()!=QTcpSocket::ConnectedState){
+            tcpSocket.abort();
+            emit write_error();
+            return;
+        }
+
+        if(tcpSocket.waitForReadyRead(1000)){
+            QByteArray cmd = tcpSocket.readAll();
+
+
+            QString cmdlog = QString(cmd);
+            this->appendData(cmdlog);
+
+
+            QJsonParseError json_error;
+            QJsonDocument jsonDoc(QJsonDocument::fromJson(cmd,&json_error));
+            if(json_error.error==QJsonParseError::NoError){
+                QJsonObject root = jsonDoc.object();
+                QDateTime dt = QDateTime::currentDateTime();
+
+//                QString stationid;
+                if((!root.value("DeviceID").isUndefined())&&(!root.value("DeviceID").isNull())
+                        &&(!root.value("DeviceStatus").isUndefined())&&(!root.value("DeviceStatus").isNull())
+                        &&(!root.value("DeviceStatusNote").isUndefined())&&(!root.value("DeviceStatusNote").isNull())
+                        &&(!root.value("TimeStamp").isUndefined())&&(!root.value("TimeStamp").isNull())
+                        &&(!root.value("Values").isUndefined())&&(!root.value("Values").isNull()))
+                {
+                    QString deviceID = root.value("DeviceID").toString();
+                    int deviceStatus = root.value("DeviceStatus").toInt();
+                    QString deviceStatusNote = root.value("DeviceStatusNote").toString();
+                    QString timeStamp = root.value("TimeStamp").toString();
+                    QJsonArray valueArray = root.value("Values").toArray();
+                    for(int s=0;s<16;s++){
+                        if(ytStationCount->station[s].Enabled==0x01){
+                            int alarm=0,fault=0,deviceStatustemp=0;
+
+                            for(int d=0;d<128;d++){
+                                if(ytStationCount->station[s].StationDevice[d].Enabled==0x01){
+                                    if(QString::compare(deviceID,QString(ytStationCount->station[s].StationDevice[d].DeviceID))==0){
+                                        ytStationCount->station[s].StationDevice[d].UpTime = dt.toTime_t();
+                                        ytStationCount->station[s].StationDevice[d].DeviceStatus=deviceStatus;
+                                        sprintf(ytStationCount->station[s].StationDevice[d].DeviceStatusNote,"%s",deviceStatusNote.toUtf8().data());
+                                        sprintf(ytStationCount->station[s].LastCommTime,"%s",dt.toString("yyyy-MM-dd HH:mm:ss").toUtf8().data());
+                                        for(int n=0;n<valueArray.size();n++){
+                                            QJsonObject obj = valueArray.at(n).toObject();
+                                            if((!obj.value("BusAddr").isUndefined())&&(!obj.value("BusAddr").isNull())
+                                                    &&(!obj.value("AlarmStatus").isUndefined())&&(!obj.value("AlarmStatus").isNull())
+                                                    &&(!obj.value("Value").isUndefined())&&(!obj.value("Value").isNull())
+                                                    &&(!obj.value("Time").isUndefined())&&(!obj.value("Time").isNull())){
+                                                int addr = obj.value("BusAddr").toInt();
+                                                if((addr>=0)&&(addr<256)){
+                                                    for(int i=9;i>0;i--){
+                                                        ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[i].AlarmStatus= ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[i-1].AlarmStatus;
+                                                        sprintf(ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[i].Time,"%s",ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[i-1].Time);
+                                                        ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[i].Value= ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[i-1].Value;
+                                                    }
+                                                    ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[0].AlarmStatus= obj.value("AlarmStatus").toInt();
+                                                    sprintf(ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[0].Time,"%s",obj.value("Time").toString().toUtf8().data());
+                                                    ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[0].Value= obj.value("Value").toDouble();
+                                                    ytStationCount->station[s].StationDevice[d].DevicePoint[addr].AlarmStatus= ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[0].AlarmStatus;
+                                                    sprintf(ytStationCount->station[s].StationDevice[d].DevicePoint[addr].Time,"%s",ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[0].Time);
+                                                    ytStationCount->station[s].StationDevice[d].DevicePoint[addr].Value= ytStationCount->station[s].StationDevice[d].DevicePoint[addr].pointvaluelist[0].Value;
+                                                }
+                                            }
+                                        }
+                                    }
+
+                                    deviceStatustemp = ytStationCount->station[s].StationDevice[d].DeviceStatus;
+                                    if(deviceStatustemp == 1){
+                                        alarm++;
+                                    }else if(deviceStatustemp == 2){
+                                        fault++;
+                                    }
+
+                                }
+                            }
+                            if(alarm == 0 && fault == 0)
+                            {
+                                ytStationCount->station[s].StationStatus=0;
+                                sprintf(ytStationCount->station[s].StationStatusNote,"正常");
+                            }
+                            if(alarm != 0)
+                            {
+                                ytStationCount->station[s].StationStatus=1;
+                                sprintf(ytStationCount->station[s].StationStatusNote,"告警");
+                            }
+                            if(fault != 0 && alarm == 0)
+                            {
+                                ytStationCount->station[s].StationStatus=2;
+                                sprintf(ytStationCount->station[s].StationStatusNote,"故障");
+                            }
+                            ytStationCount->station[s].DeviceAlarm=alarm;
+                            ytStationCount->station[s].DeviceFault=fault;
+
+                        }
+                    }
+                }
+
+//                    cmd = QString("{\"CMD\":\"pushDeviceValues\",\"TimeStamp\":\"%1\",\"REPLY\":\"1\"}").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")).toUtf8();
+//                    tcpSocket.write(cmd);
+//                    tcpSocket.waitForBytesWritten(3000);
+
+
+            }
+
+
+        }
+        usleep(500000);
+    }
+
+}
+
+
+

+ 56 - 0
ytDashBoardCore/infoclient.h

@@ -0,0 +1,56 @@
+#ifndef INFOCLIENT_H
+#define INFOCLIENT_H
+
+#include <QThread>
+#include <QDateTime>
+#include <QTcpSocket>
+#include <QString>
+#include <QStringList>
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QJsonValue>
+#include <QJsonParseError>
+#include <QCryptographicHash>
+#include <QTimer>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QJsonArray>
+#include <QList>
+#include "dashboardshm.h"
+
+
+
+
+
+
+
+class InfoClient : public QThread
+{
+    Q_OBJECT
+public:
+    explicit InfoClient(qintptr socketDescriptor, QObject *parent);
+
+    void run() override;
+
+    void appendData(QString emitlog);
+
+
+signals:
+    void write_error();
+    void sendlog(QString sendlog);
+
+
+public slots:
+
+private:
+    qintptr socketDescriptor;
+    int count;
+    bool isWorking;
+    QString AgentId;
+    QString CompanyId;
+    QTcpSocket *So;
+    QStringList dataList;
+    QSqlDatabase db;
+};
+
+#endif // INFOCLIENT_H

+ 68 - 0
ytDashBoardCore/logthread.cpp

@@ -0,0 +1,68 @@
+#include "logthread.h"
+
+LogThread::LogThread(QObject *parent) :
+    QThread(parent)
+{
+    dataList.clear();
+    QDir dir;
+    if(!dir.exists("log"))
+        dir.mkdir("log");
+
+    QDir dir2;
+    if(!dir2.exists("err"))
+        dir2.mkdir("err");
+
+    file = new QFile("log/DashBoard01-"+QDate::currentDate().toString("yyyyMMdd")+".log");
+    wfile = new QFile("err/DashBoard01_message.log");
+    day = QDate::currentDate().day();
+}
+
+void LogThread::appendData(QString data)
+{
+    dataList.append(data);
+}
+
+void LogThread::appendWrongData(QString data)
+{
+    wrongList.append(data);
+}
+
+void LogThread::run()
+{
+    {
+        file = new QFile("log/DashBoard01-"+QDate::currentDate().toString("yyyyMMdd")+".log");
+        if(file->open(QIODevice::ReadWrite|QIODevice::Append|QIODevice::Text)){
+            file->write(QString("ytDashBoard start at %1.\r\n").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz")).toUtf8());
+            file->close();
+        }
+    }
+    while(1){
+        if(dataList.length()>0){
+            if(day!=QDate::currentDate().day()){
+                day = QDate::currentDate().day();
+                file = new QFile("log/DashBoard01-"+QDate::currentDate().toString("yyyyMMdd")+".log");
+            }
+            if(file->open(QIODevice::ReadWrite|QIODevice::Append|QIODevice::Text)){
+                while(dataList.length()>0){
+                    file->write(dataList.first().toUtf8());
+                    file->write("\r\n");
+                    dataList.removeFirst();
+                    usleep(1000);
+                }
+                file->close();
+            }
+        }
+        if(wrongList.length()>0){
+            if(wfile->open(QIODevice::ReadWrite|QIODevice::Append|QIODevice::Text)){
+                while(wrongList.length()>0){
+                    wfile->write(wrongList.first().toUtf8());
+                    wfile->write("\r\n");
+                    wrongList.removeFirst();
+                    usleep(1000);
+                }
+                wfile->close();
+            }
+        }
+        usleep(50000);
+    }
+}

+ 30 - 0
ytDashBoardCore/logthread.h

@@ -0,0 +1,30 @@
+#ifndef LOGTHREAD_H
+#define LOGTHREAD_H
+
+
+#include <QThread>
+#include <QStringList>
+#include <QDate>
+#include <QDir>
+#include <QFile>
+
+class LogThread : public QThread
+{
+    Q_OBJECT
+public:
+    explicit LogThread(QObject *parent = nullptr);
+    void appendData(QString data);
+    void appendWrongData(QString data);
+    void run();
+
+signals:
+
+public slots:
+private:
+    QFile *file,*wfile;
+    QStringList dataList;
+    QStringList wrongList;
+    int day;
+};
+
+#endif // LOGTHREAD_H

+ 37 - 0
ytDashBoardCore/main.cpp

@@ -0,0 +1,37 @@
+#include <QCoreApplication>
+//#include "mainwindow.h"
+#include "databoardcore.h"
+
+#include "../ytDashBoardDog/dataprecess.h"
+#include "databoardmem.h"
+
+YtDashBoardShm *dataProcessShm;
+YtStationCount *ytStationCount;
+
+bool load_shm(){
+    int shmid;
+    key_t key;
+    if((key = ftok(SHM_PATH,static_cast<int>(SHM_PORT)))==-1)
+        return false;
+    if((shmid = shmget(key,sizeof(YtDashBoardShm),IPC_CREAT|0666))==-1)
+        return false;
+    dataProcessShm = static_cast<YtDashBoardShm *>(shmat(shmid,nullptr,0));
+    if((key = ftok(MEM_PATH, static_cast<int>(MEM_PORT)))==-1)
+        return false;
+    if((shmid = shmget(key, sizeof (YtStationCount), IPC_CREAT|0666))==-1)
+        return false;
+    printf("****************shmid  = %d",shmid);
+    ytStationCount = static_cast<YtStationCount *>(shmat(shmid, nullptr, 0));
+    return true;
+}
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+    if(load_shm()){
+        DataBoardCore *core = new DataBoardCore(nullptr);
+        core->start();
+    }else
+        exit(1);
+    return a.exec();
+}

+ 24 - 0
ytDashBoardCore/mainwindow.ui

@@ -0,0 +1,24 @@
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>MainWindow</string>
+  </property>
+  <widget class="QMenuBar" name="menuBar" />
+  <widget class="QToolBar" name="mainToolBar" />
+  <widget class="QWidget" name="centralWidget" />
+  <widget class="QStatusBar" name="statusBar" />
+ </widget>
+ <layoutDefault spacing="6" margin="11" />
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>

+ 466 - 0
ytDashBoardCore/websocketserver.cpp

@@ -0,0 +1,466 @@
+#include "websocketserver.h"
+#include "QtWebSockets/qwebsocketserver.h"
+#include "QtWebSockets/qwebsocket.h"
+#include "../ytDashBoardDog/dataprecess.h"
+#include "infoclient.h"
+#include "databoardmem.h"
+#include "databasethread.h"
+
+
+
+WebSocketServer::WebSocketServer(QObject *parent) : QObject(parent),
+    m_pWebSocketServer(Q_NULLPTR)
+{
+    datalist.clear();
+    count = 0;
+    m_pWebSocketServer = new QWebSocketServer(QStringLiteral("WebSocket Server"), QWebSocketServer::NonSecureMode,this);
+    timer = new QTimer(this);
+    connect(timer, &QTimer::timeout, this, &WebSocketServer::timeout);
+
+    connect(m_pWebSocketServer, &QWebSocketServer::newConnection, this, &WebSocketServer::onNewConnection);
+    connect(m_pWebSocketServer, &QWebSocketServer::sslErrors, this, &WebSocketServer::onSslErrors);
+
+}
+
+
+WebSocketServer::~WebSocketServer()
+{
+    m_pWebSocketServer->close();
+    qDeleteAll(clientList.begin(), clientList.end());
+    emit closed();
+}
+
+void WebSocketServer::start()
+{
+    this->appendData("server listening start");
+    if(m_pWebSocketServer->listen(QHostAddress::Any, 6001)){
+        this->appendData("listening start on 6001");
+        printf("listening start on 6001\n");
+        timer->start(5000);
+    }else{
+        printf("EchoServer listening failed\n");
+        exit(1);
+    }
+
+}
+
+void WebSocketServer::onNewConnection()
+{
+    this->appendData("onNewConnection");
+    QWebSocket *pSocket = m_pWebSocketServer->nextPendingConnection();
+    connect(pSocket,&QWebSocket::textMessageReceived,this,&WebSocketServer::processTextMessage);
+    connect(pSocket,&QWebSocket::disconnected,this,&WebSocketServer::socketDisconnected);
+
+    clientList.append(new WebSocketClient("",pSocket));
+}
+
+
+void WebSocketServer::appendData(QString emitlog)
+{
+    emit weblog(emitlog);
+}
+
+
+void WebSocketServer::processTextMessage(QString message)
+{
+
+    QString data="";
+
+    printf("%s\n",message.toUtf8().data());
+    this->appendData(QString("processTextMessage message: %1").arg(message));
+
+    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());  //几个用户同时连接服务器,获取某个时刻一个设备请求ID
+
+
+    QList<WebSocketClient *>::iterator i;
+    for(i=clientList.begin();i!=clientList.end();i++){
+        printf("processTextMessage clientList size:%d\n",clientList.length());
+
+        WebSocketClient *client = *i;
+        if(client->m_client==pClient){ //判断某个时刻一个设备请求ID对应clientList的某个设备创建clientID
+
+            QStringList Dat = message.split("\r\n");
+            QByteArray cmd;
+            bool found = false;
+            for(int i=0;i<Dat.length();i++){
+                if(Dat.at(i).indexOf("{")>=0)
+                    found = true;
+                if(found)
+                    cmd.append(Dat.at(i).trimmed().toUtf8());
+            }
+
+            QJsonParseError json_error;
+            QJsonDocument jsonDoc(QJsonDocument::fromJson(cmd,&json_error));
+            if(json_error.error==QJsonParseError::NoError){
+                QJsonObject root = jsonDoc.object();
+                QString cmd = "";
+                if((!root.value("CMD").isUndefined())&&(!root.value("CMD").isNull())){
+                    if(root.value("CMD").isString())
+                        cmd = root.value("CMD").toString();
+                    else
+                        cmd = QString("%1").arg(root.value("CMD").toInt());
+                    //pClient->sendTextMessage(QString("CMD:%1").arg(cmd));
+                }
+                client->Cmd = cmd;
+
+                QString stationid="";
+                if((!root.value("StationID").isUndefined())&&(!root.value("StationID").isNull())){
+                    if(root.value("StationID").isString())
+                        stationid = root.value("StationID").toString();
+                    else
+                        stationid = QString("%1").arg(root.value("StationID").toInt());
+                    //pClient->sendTextMessage(QString("StationID:%1").arg(stationid));
+                }
+                client->StationId=stationid;
+
+                QString stationname="";
+                if((!root.value("StationName").isUndefined())&&(!root.value("StationName").isNull())){
+                    if(root.value("StationName").isString())
+                        stationname = root.value("StationName").toString();
+                    else
+                        stationname = QString("%1").arg(root.value("StationName").toInt());
+                    //pClient->sendTextMessage(QString("StationName:%1").arg(stationname));
+                }
+                client->StationName=stationname;
+
+                QString deviceid="";
+                if((!root.value("DeviceID").isUndefined())&&(!root.value("DeviceID").isNull())){
+                    if(root.value("DeviceID").isString())
+                        deviceid = root.value("DeviceID").toString();
+                    else
+                        deviceid = QString("%1").arg(root.value("DeviceID").toInt());
+                    //pClient->sendTextMessage(QString("DeviceID:%1").arg(deviceid));
+                }
+                client->DeviceId=deviceid;
+
+                QString busaddr="";
+                if((!root.value("BusAddr").isUndefined())&&(!root.value("BusAddr").isNull())){
+                    if(root.value("BusAddr").isString())
+                        busaddr = root.value("BusAddr").toString();
+                    else
+                        busaddr = QString("%1").arg(root.value("BusAddr").toInt());
+                    //pClient->sendTextMessage(QString("BusAddr:%1").arg(busaddr));
+                }
+                client->BusAddr=busaddr;
+
+                QString count="";
+                if((!root.value("Count").isUndefined())&&(!root.value("Count").isNull())){
+                    if(root.value("Count").isString())
+                        count = root.value("Count").toString();
+                    else
+                        count = QString("%1").arg(root.value("Count").toInt());
+                    //pClient->sendTextMessage(QString("Count:%1").arg(count));
+                }
+                client->Count=count;
+
+                QString start;
+                if((!root.value("Start").isUndefined())&&(!root.value("Start").isNull())){
+                    if(root.value("Start").isString())
+                        start = root.value("Start").toString();
+                    else
+                        start = QString("%1").arg(root.value("Start").toInt());
+                    //pClient->sendTextMessage(QString("Start:%1").arg(start));
+                }
+                client->Start=start;
+
+                QString limit="";
+                if((!root.value("Limit").isUndefined())&&(!root.value("Limit").isNull())){
+                    if(root.value("Limit").isString())
+                        limit = root.value("Limit").toString();
+                    else
+                        limit = QString("%1").arg(root.value("Limit").toInt());
+                    //pClient->sendTextMessage(QString("Limit:%1").arg(limit));
+                }
+                client->Limit=limit;
+
+                QString order;
+                if((!root.value("Order").isUndefined())&&(!root.value("Order").isNull())){
+                    if(root.value("Order").isString())
+                        order = root.value("Order").toString();
+                    else
+                        order = QString("%1").arg(root.value("Order").toInt());
+                    //pClient->sendTextMessage(QString("Order:%1").arg(order));
+                }
+                client->Order=order;
+
+                QString time="";
+                if((!root.value("Time").isUndefined())&&(!root.value("Time").isNull())){
+                    if(root.value("Time").isString())
+                        time = root.value("Time").toString();
+                    else
+                        time = QString("%1").arg(root.value("Time").toInt());
+                    //pClient->sendTextMessage(QString("Time:%1").arg(time));
+                }
+                client->Time = time;
+            }
+            printf("client->Cmd = %s\n",client->Cmd.toUtf8().data());
+
+
+            //sendtext to client  BEGIN
+            if(QString::compare(client->Cmd,"getStationInfo")==0){
+                QString stationStr;
+                for(int i=0;i<16;i++)
+                {
+                    if(ytStationCount->station[i].Enabled == 0x01){
+                        stationStr.append(QString("{\"StationID\":\"%1\",\"StationName\":\"%2\",\"StationStatus\":%3,\"StationStatusNote\":\"%4\",\"DeviceCount\":%5,\"DeviceAlarm\":%6,\"DeviceFault\":%7,\"LastCommTime\":\"%8\"},").arg(ytStationCount->station[i].StationID).arg(ytStationCount->station[i].StationName).arg(ytStationCount->station[i].StationStatus).arg(ytStationCount->station[i].StationStatusNote).arg(ytStationCount->station[i].DeviceCount).arg(ytStationCount->station[i].DeviceAlarm).arg(ytStationCount->station[i].DeviceFault).arg(ytStationCount->station[i].LastCommTime));
+                    }
+                }
+                stationStr=stationStr.left(stationStr.length()-1);
+                data=QString("{\"time\":\"%1\",\"CMD\":\"%2\",\"VER\":\"1.00\",\"TotalCount\":\"%3\",\"RESULT\":[%4],\"TimeStamp\":\"%5\",\"REPLY\":1}").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")).arg(client->Cmd).arg(ytStationCount->StationCount).arg(stationStr).arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"));
+                client->m_client->sendTextMessage(data);
+                this->appendData(QString("getStationInfo sendtoclient: %1").arg(data));
+
+            }else if(QString::compare(client->Cmd,"getStationDetail")==0){
+                QString stationStr;
+                for(int i=0;i<16;i++)
+                {
+                    if(QString::compare(client->StationId,ytStationCount->station[i].StationID)==0)
+                    {
+                        QString deviceStr;
+                        for(int j=0;j<128;j++)
+                        {
+                            if(ytStationCount->station[i].StationDevice[j].Enabled == 0x01)
+                            {
+                                QString pointStr;
+                                for(int k=0;k<256;k++){
+                                    if((ytStationCount->station[i].StationDevice[j].DevicePoint[k].Enabled==0x01)&&(ytStationCount->station[i].StationDevice[j].DevicePoint[k].IsKeyPoint == 1)){
+                                        QString pointvalueStr;
+
+                                        pointvalueStr.append(QString("{\"AlarmStatus\":%1,\"Value\":%2,\"Time\":\"%3\"}").arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[0].AlarmStatus).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[0].Value).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[0].Time));
+
+                                        pointStr.append(QString("{\"BusAddr\":%1,\"PointName\":\"%2\",\"PointType\":%3,\"AlarmType\":%4,\"AlarmStatus\":%5,\"ValueList\" :[%6],\"Time\":\"%7\"}").arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].BusAddr).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].PointName).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].PointType).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].AlarmType).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].AlarmStatus).arg(pointvalueStr).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].Time));
+                                        break;
+                                    }
+
+                                }
+
+                                deviceStr.append(QString("{\"DeviceID\":\"%1\",\"DeviceName\":\"%2\",\"DeviceTypeID\":\"%3\",\"DeviceType\":\"%4\",\"DeviceStatus\":%5,\"DeviceStatusNote\":\"%6\",\"KeyPoints\":[%7]},").arg(ytStationCount->station[i].StationDevice[j].DeviceID).arg(ytStationCount->station[i].StationDevice[j].DeviceName).arg(ytStationCount->station[i].StationDevice[j].DeviceTypeID).arg(ytStationCount->station[i].StationDevice[j].DeviceType).arg(ytStationCount->station[i].StationDevice[j].DeviceStatus).arg(ytStationCount->station[i].StationDevice[j].DeviceStatusNote).arg(pointStr));
+
+                            }
+                        }
+                        deviceStr=deviceStr.left(deviceStr.length()-1);
+                        stationStr.append(QString("{\"StationID\":\"%1\",\"StationName\":\"%2\",\"TotalCount\":%3,\"StationStatus\":%4,\"StationStatusNote\":\"%5\",\"LIST\":[%6]}").arg(ytStationCount->station[i].StationID).arg(ytStationCount->station[i].StationName).arg(ytStationCount->station[i].DeviceCount).arg(ytStationCount->station[i].StationStatus).arg(ytStationCount->station[i].StationStatusNote).arg(deviceStr));
+                        break;
+                    }
+                }
+
+                data=QString("{\"time\":\"%1\",\"CMD\":\"%2\",\"VER\":\"1.00\",\"RESULT\":%3,\"TimeStamp\":\"%4\",\"REPLY\":1}").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")).arg(client->Cmd).arg(stationStr).arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"));
+                client->m_client->sendTextMessage(data);
+                this->appendData(QString("getStationDetail sendtoclient: %1").arg(data));
+
+            }else if(QString::compare(client->Cmd,"getDeviceDetail")==0){
+                QString stationStr;
+                for(int i=0;i<16;i++)
+                {
+                    if(QString::compare(client->StationId,ytStationCount->station[i].StationID)==0)
+                    {
+                        QString deviceStr;
+                        for(int j=0;j<128;j++)
+                        {
+                            if(QString::compare(client->DeviceId,ytStationCount->station[i].StationDevice[j].DeviceID)==0)
+                            {
+                                QString pointStr;
+                                for(int k=0;k<256;k++)
+                                {
+                                    if(ytStationCount->station[i].StationDevice[j].DevicePoint[k].Enabled==0x01)
+                                    {
+                                        QString pointvalueStr;
+                                        for(int m=0;m<10;m++)
+                                        {
+                                            pointvalueStr.append(QString("{\"AlarmStatus\":%1,\"Value\":%2,\"Time\":\"%3\"},").arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[m].AlarmStatus).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[m].Value).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].pointvaluelist[m].Time));
+
+                                        }
+                                        pointvalueStr=pointvalueStr.left(pointvalueStr.length()-1);
+                                        pointStr.append(QString("{\"BusAddr\":%1,\"PointName\":\"%2\",\"PointType\":%3,\"AlarmType\":%4,\"AlarmStatus\":%5,\"Value\":%6,\"LIST\" :[%7],\"Time\":\"%8\"},").arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].BusAddr).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].PointName).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].PointType).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].AlarmType).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].AlarmStatus).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].Value).arg(pointvalueStr).arg(ytStationCount->station[i].StationDevice[j].DevicePoint[k].Time));
+
+
+                                    }
+
+                                }
+                                pointStr=pointStr.left(pointStr.length()-1);
+                                deviceStr.append(QString("{\"DeviceID\":\"%1\",\"DeviceName\":\"%2\",\"DeviceTypeID\":\"%3\",\"DeviceType\":\"%4\",\"DeviceStatus\":%5,\"DeviceStatusNote\":\"%6\",\"Points\":[%7]}").arg(ytStationCount->station[i].StationDevice[j].DeviceID).arg(ytStationCount->station[i].StationDevice[j].DeviceName).arg(ytStationCount->station[i].StationDevice[j].DeviceTypeID).arg(ytStationCount->station[i].StationDevice[j].DeviceType).arg(ytStationCount->station[i].StationDevice[j].DeviceStatus).arg(ytStationCount->station[i].StationDevice[j].DeviceStatusNote).arg(pointStr));
+                                break;
+                            }
+                        }
+
+                        stationStr.append(QString("{\"StationID\":\"%1\",\"StationName\":\"%2\",\"Device\":[%3]}").arg(ytStationCount->station[i].StationID).arg(ytStationCount->station[i].StationName).arg(deviceStr));
+                        break;
+                    }
+                }
+
+                data=QString("{\"time\":\"%1\",\"CMD\":\"%2\",\"VER\":\"1.00\",\"RESULT\":%3,\"TimeStamp\":\"%4\",\"REPLY\":1}").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")).arg(client->Cmd).arg(stationStr).arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"));
+                client->m_client->sendTextMessage(data);
+                this->appendData(QString("getDeviceDetail sendtoclient: %1").arg(data));
+
+            }else if(QString::compare(client->Cmd,"getPatrolRecord")==0){
+//                QString patrolrecord;
+//                db.open();
+//                QSqlQuery qry;
+//                qry=db.exec(QString("select v_datatime from yt_t_rec where uq_station_id = '%1' order by v_datatime %2 limit %3,%4").arg(client->StationId).arg(client->Order).arg(client->Start).arg(client->Limit));
+
+//                QString timestr;
+//                while(qry.next())
+//                {
+//                    timestr.append(QString("{\"Time\":\"%1\"},").arg(qry.value(0).toDateTime().toString("yyyy-MM-dd HH:mm:ss").toUtf8().data()));
+
+//                }
+//                timestr=timestr.left(timestr.length()-1);
+
+//                QSqlQuery qry1;
+//                QString stationname,totalcount;
+//                qry1=db.exec(QString("select v_station_name,(select count(*) from yt_t_rec) from yt_t_station where uq_station_id = '%1'").arg(client->StationId));
+//                while(qry1.next())
+//                {
+//                    stationname = qry1.value(0).toString().toUtf8().data();
+//                    totalcount = qry1.value(1).toString().toUtf8().data();
+//                }
+
+//                patrolrecord=QString("{\"StationID\":\"%1\",\"StationName\":\"%2\",\"LIST\":[%3]}").arg(client->StationId).arg(stationname).arg(timestr);
+
+//                db.close();
+                QString patrolrecord;
+                QString timestr;
+                int clientstart = client->Start.toInt();
+                int clientlimit = client->Limit.toInt() ;
+                printf("client->Order = %s\n",client->Order.toUtf8().data());
+                if(QString::compare(client->Order,"DESC")==0)
+                {
+                    //printf("testest11111");
+                    counttemp=0;
+                    for(int i=PatrolRecordList.size()-1;i>=0;i--){
+                        //printf("testest22222");
+                        if(QString::compare(PatrolRecordList.at(i).StationId,client->StationId)==0)
+                        {
+                            //printf("counttemp = %d\n",counttemp);
+                            counttemp++;
+                            if(counttemp >= clientstart && counttemp < clientstart+clientlimit)
+                            {
+                                printf("PatrolRecordList.at(i).DataTime = %s\n",PatrolRecordList.at(i).DataTime.toUtf8().data());
+                                timestr.append(QString("{\"Time\":\"%1\"},").arg(PatrolRecordList.at(i).DataTime));
+                            }
+
+                        }
+                    }
+                }
+
+                if(QString::compare(client->Order,"ASC")==0)
+                {
+                    counttemp=0;
+                    for(int i=0;i<PatrolRecordList.size();i++){
+                        if(QString::compare(PatrolRecordList.at(i).StationId,client->StationId)==0)
+                        {
+                            counttemp++;
+                            if(counttemp >= clientstart && counttemp < clientstart+clientlimit)
+                            {
+                                timestr.append(QString("{\"Time\":\"%1\"},").arg(PatrolRecordList.at(i).DataTime));
+                            }
+
+                        }
+                    }
+                }
+                timestr=timestr.left(timestr.length()-1);
+
+                QString stationname;
+                QString totalcount = QString::number(PatrolRecordList.size());
+                for(int i=0;i<16;i++)
+                {
+                    if(QString::compare(client->StationId,ytStationCount->station[i].StationID)==0)
+                    {
+                        stationname = ytStationCount->station[i].StationName;
+                    }
+                }
+
+                patrolrecord=QString("{\"StationID\":\"%1\",\"StationName\":\"%2\",\"LIST\":[%3]}").arg(client->StationId).arg(stationname).arg(timestr);
+
+
+                data=QString("{\"time\":\"%1\",\"CMD\":\"%2\",\"VER\":\"1.00\",\"TotalCount\":%3,\"Count\":%4,\"RESULT\":%5,\"TimeStamp\":\"%6\",\"REPLY\":1}").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")).arg(client->Cmd).arg(totalcount).arg(client->Limit).arg(patrolrecord).arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"));
+                client->m_client->sendTextMessage(data);
+                this->appendData(QString("getPatrolRecord sendtoclient: %1").arg(data));
+
+
+            }else if(QString::compare(client->Cmd,"getPatrolDetail")==0){
+//                db.open();
+//                QSqlQuery qry;
+//                qry=db.exec(QString("select t_values from yt_t_rec where uq_station_id = '%1' and v_datatime = '%2'").arg(client->StationId).arg(client->Time));
+//                while(qry.next())
+//                {
+//                    data = qry.value(0).toString().toUtf8().data();
+//                }
+//                db.close();
+
+                for(int i=0;i<PatrolRecordList.size();i++){
+
+                    if(QString::compare(client->StationId,PatrolRecordList.at(i).StationId)==0 && QString::compare(client->Time,PatrolRecordList.at(i).DataTime)==0){
+                        data = PatrolRecordList.at(i).Values;
+
+                    }
+                }
+
+                client->m_client->sendTextMessage(data);
+                this->appendData(QString("getPatrolDetail sendtoclient: %1").arg(data));
+
+            }
+            //sendtext to client  END
+
+        }
+
+    }
+}
+
+void WebSocketServer::patrolrecord(QList<QStringList> PatrolList)
+{
+    PatrolRecordList.clear();
+    for(int i=0;i<PatrolList.size();i++){
+        ReceivePatrolRecord patrolrecord;
+        patrolrecord.DataTime = PatrolList.at(i).at(0);
+        patrolrecord.StationId = PatrolList.at(i).at(1);
+        patrolrecord.Values = PatrolList.at(i).at(2);
+
+        PatrolRecordList.append(patrolrecord);
+
+    }
+
+}
+
+
+void WebSocketServer::socketDisconnected()
+{
+    this->appendData("socketDisconnected");
+    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
+    if(pClient){
+        QList<WebSocketClient *>::iterator i;
+        for(i=clientList.begin();i!=clientList.end();i++){
+            WebSocketClient *client = *i;
+            if(client->m_client==pClient){
+                clientList.removeAll(client);
+                pClient->deleteLater();
+                return;
+            }
+        }
+    }
+}
+
+void WebSocketServer::onSslErrors(const QList<QSslError> &)
+{
+    printf("Ssl errors occurred\n");
+    this->appendData("Ssl errors occurred");
+}
+
+void WebSocketServer::timeout()
+{
+    count++;
+    if(count>5){
+        QList<WebSocketClient *>::iterator i;
+        for(i=clientList.begin();i!=clientList.end();i++){
+            WebSocketClient *client = *i;
+            if(client->m_client){
+                client->m_client->sendTextMessage(QString("{\"Cmd\":\"HeartBeat\",\"time\":\"%1\"}").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")));
+                this->appendData(QString("{\"Cmd\":\"HeartBeat\",\"time\":\"%1\"}").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")));
+            }
+        }
+        count=0;
+    }
+}
+
+
+

+ 97 - 0
ytDashBoardCore/websocketserver.h

@@ -0,0 +1,97 @@
+#ifndef WEBSOCKETSERVER_H
+#define WEBSOCKETSERVER_H
+
+#include <QObject>
+#include <QList>
+#include <QByteArray>
+#include <QDateTime>
+#include <QString>
+#include <QTimer>
+#include <QFile>
+#include <QtNetwork/QSslError>
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QJsonValue>
+#include <QJsonParseError>
+#include <QUuid>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+
+QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
+QT_FORWARD_DECLARE_CLASS(QWebSocket)
+
+
+typedef struct  {
+    QString DataTime;
+    QString StationId;
+    QString Values;
+} ReceivePatrolRecord;
+
+
+class WebSocketClient {
+public:
+    explicit WebSocketClient(QString cmd="",QWebSocket *so=nullptr){
+        Cmd = cmd;
+        StationId = "";
+        StationName = "";
+        DeviceId="";
+        BusAddr="";
+        Count="";
+        Start="";
+        Limit="";
+        Order="";
+        Time="";
+        m_client=so;
+    }
+    QString Cmd ;
+    QString StationId;
+    QString StationName;
+    QString DeviceId;
+    QString BusAddr;
+    QString Count;
+    QString Start;
+    QString Limit;
+    QString Order;
+    QString Time;
+    QWebSocket *m_client;
+};
+
+class WebSocketServer : public QObject
+{
+    Q_OBJECT
+public:
+    explicit WebSocketServer(QObject *parent = nullptr);
+    ~WebSocketServer();
+
+    void start();
+    void appendData(QString data);
+    void patrolrecord(QList<QStringList> PatrolList);
+
+    void ercodeSent(QString phone);
+signals:
+    void closed();
+    void weblog(QString emitlog);
+
+public slots:
+    void onNewConnection();
+    void processTextMessage(QString message);
+    void socketDisconnected();
+    void timeout();
+    void onSslErrors(const QList<QSslError> &errors);
+
+private:
+    int counttemp;
+    QWebSocketServer *m_pWebSocketServer;
+    QList<WebSocketClient *> clientList;
+    QTimer *timer;
+    QTimer *timerdata;
+    QStringList datalist;
+    int count;
+    QSqlDatabase db;
+    QList<QStringList> PatrolList;
+
+    QList<ReceivePatrolRecord> PatrolRecordList;
+
+};
+
+#endif // WEBSOCKETSERVER_H

+ 44 - 0
ytDashBoardCore/ytDashBoardCore.pro

@@ -0,0 +1,44 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2021-06-21T10:06:44
+#
+#-------------------------------------------------
+QT += core network websockets sql
+QT -= gui
+
+CONFIG += c++11 console
+CONFIG -= app_bundle
+
+TARGET = ytDashBoardCore
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which as been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+SOURCES += \
+        main.cpp \
+    websocketserver.cpp \
+    logthread.cpp \
+    infocenterserver.cpp \
+    infoclient.cpp \
+    databoardcore.cpp \
+    databasethread.cpp
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+HEADERS += \
+    websocketserver.h \
+    logthread.h \
+    infocenterserver.h \
+    infoclient.h \
+    dashboardshm.h \
+    databoardmem.h \
+    databoardcore.h \
+    databasethread.h
+
+

+ 8 - 0
ytDashBoardDog/dataprecess.h

@@ -0,0 +1,8 @@
+#ifndef DATAPRECESS_H
+#define DATAPRECESS_H
+
+#include "ytdashboardshm.h"
+
+extern YtDashBoardShm *dataProcessShm;
+
+#endif // DATAPRECESS_H

+ 23 - 0
ytDashBoardDog/dogcore.cpp

@@ -0,0 +1,23 @@
+#include "dogcore.h"
+#include "dataprecess.h"
+
+
+DogCore::DogCore(QObject *parent) : QObject(parent)
+{
+    hour = 0;
+    timer = new QTimer(this);
+    connect(timer,&QTimer::timeout,this,&DogCore::time_out);
+    time_out();
+    timer->start(10000);
+
+}
+
+
+void DogCore::time_out()
+{
+    if((QDateTime::currentDateTime().toTime_t()-dataProcessShm->UpTime)>30){
+        dataProcessShm->UpTime = QDateTime::currentDateTime().toTime_t();
+        system("killall ytDashBoardCore");
+        system("./ytDashBoardCore &");
+    }
+}

+ 26 - 0
ytDashBoardDog/dogcore.h

@@ -0,0 +1,26 @@
+#ifndef DOGCORE_H
+#define DOGCORE_H
+
+#include <QObject>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QVariant>
+#include <QDateTime>
+#include <QTimer>
+
+class DogCore : public QObject
+{
+    Q_OBJECT
+public:
+    explicit DogCore(QObject *parent = nullptr);
+
+signals:
+
+public slots:
+    void time_out();
+private:
+    QTimer *timer;
+    int hour;
+};
+
+#endif // DOGCORE_H

+ 27 - 0
ytDashBoardDog/main.cpp

@@ -0,0 +1,27 @@
+#include <QCoreApplication>
+#include "dataprecess.h"
+#include "dogcore.h"
+YtDashBoardShm *dataProcessShm;
+
+
+bool load_shm(){
+    int shmid;
+    key_t key;
+    if((key = ftok(SHM_PATH,static_cast<int>(SHM_PORT)))==-1)
+        return false;
+    if((shmid = shmget(key,sizeof(YtDashBoardShm),IPC_CREAT|0666))==-1)
+        return false;
+    dataProcessShm = static_cast<YtDashBoardShm *>(shmat(shmid,nullptr,0));
+    return true;
+}
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+    if(load_shm()){
+        DogCore *core = new DogCore(nullptr);
+    }else{
+        exit(1);
+    }
+    return a.exec();
+}

+ 20 - 0
ytDashBoardDog/ytDashBoardDog.pro

@@ -0,0 +1,20 @@
+
+QT       += core sql
+
+QT       -= gui
+
+TARGET = ytDashBoardDog
+CONFIG   += console
+CONFIG   -= app_bundle
+
+TEMPLATE = app
+
+
+SOURCES += main.cpp \
+    dogcore.cpp
+
+HEADERS += \
+    ytdashboardshm.h \
+    dogcore.h \
+    dataprecess.h
+

+ 23 - 0
ytDashBoardDog/ytdashboardshm.h

@@ -0,0 +1,23 @@
+#ifndef YTDASHBOARDSHM_H
+#define YTDASHBOARDSHM_H
+
+
+#include <stdbool.h>
+#include <sys/types.h>
+#include <sys/shm.h>
+#include <sys/ipc.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#define SHM_PATH    "/"
+#define SHM_PORT    5122
+#define PHONE_PORT  5123
+#define INTER_PORT  5124
+
+typedef struct {
+    uint UpTime;
+}YtDashBoardShm;
+
+
+
+#endif // YTDASHBOARDSHM_H

+ 1213 - 0
物联网智慧看板综合通信协议.md

@@ -0,0 +1,1213 @@
+# 物联网智慧看板综合通信协议
+
+**修订历史记录**
+
+| 日期       | 版本 | 说明                                                         | 拟制/修改 | 拟制/修改人 |
+| :--------- | :--- | :----------------------------------------------------------- | :-------- | :---------- |
+| 2021-06-11 | 1.00 | 创建文档                                                     | 拟制      | 姚强        |
+| 2021-06-21 | 1.01 | 1)增加通用数据看板通信协议;<br />2)增加数据采集端向数据看板推送信息的数据格式定义<br />3)增加WebSocket心跳包定义<br />4)文件改名为“物联网智慧看板综合通信协议” | 修改      | 姚强        |
+| 2021-07-05 | 1.02 | 1)4.2.3.2 数据应答接口新增每个字段说明;<br/>2)4.2.2.2 站点详情查询数据中增加“设备名称”字段; | 修改      | 詹叶俊      |
+| 2021-07-13 | 1.03 | 1)4.2.5.2 数据应答接口新增每个字段说明;<br/>2)4.2.6.2 数据应答接口新增每个字段说明; | 修改      | 詹叶俊      |
+
+[TOC]
+
+## 1 简介
+
+本文描述了上海永天科技股份有限公司(以下简称永天)对于智能数据看板(含嵌入式设备)前后端的通信数据格式定义。
+
+### 1.1 目的
+
+本文档用于规范智能数据看板的前后端通信,便于前后端开发人员统一开发、测试标准,从而降低开发成本。
+
+### 1.2 范围
+
+本文档适用于永天数据看板类产品开发人员和产品测试人员。
+
+## 2 常见数据格式定义
+
+### 2.1 布尔量数据格式
+
+| 序号 | 数据格式 | 数据内容 | 数据值 |
+| :--: | :------: | :------: | :----: |
+|  1   |   BOOL   |   true   |   1    |
+|  2   |   BOOL   |   TRUE   |   1    |
+|  3   |   BOOL   |  false   |   0    |
+|  4   |   BOOL   |  FALSE   |   0    |
+|  5   |  String  |   “on”   |   1    |
+|  6   |  String  |   “ON”   |   1    |
+|  7   |  String  |  “off”   |   0    |
+|  8   |  String  |  “OFF”   |   0    |
+|  9   | Integer  |    1     |   1    |
+|  10  | Integer  |    0     |   0    |
+
+**表1 布尔数据格式定义表**
+
+数据看板前后端通信中常使用的布尔量采用布尔格式、字符串(String)格式或整型(Integer)格式传值。鉴于嵌入式设备的计算存储特殊性,后端向前端传值可选择三种格式中的任意一种,前端向后端传值只能使用整型(Integer)。
+
+### 2.2 字符串数据格式
+
+数据看板前后端通信中,字符串应放置在前后‘”’(半角双引号)符号内,字符串内的‘“’采用转义符方式,即:‘\\”’符号表示。
+
+### 2.3 日期、时间格式
+
+| 序号 |       数据格式       |       数据内容        |       数据值        |
+| :--: | :------------------: | :-------------------: | :-----------------: |
+|  1   |   日期格式化字符串   |     “yyyy-MM-dd”      |     2021-05-01      |
+|  2   |   时间格式化字符串   |      “HH:mm:ss”       |      08:03:02       |
+|  3   | 日期时间格式化字符串 | “yyyy-MM-dd HH:mm:ss” | 2021-05-01 08:03:02 |
+
+**表2 日期、时间格式定义表**
+
+数据看板前后端通信中,日期、时间数据均采用格式化字符串传值,其中:年月日中间的分隔符为“-”,时分秒中间的分隔符为“:”,日期时间中间的分隔符为“ ”。
+
+### 2.4 精度数据(Decimal)格式
+
+精度数据在数据看板前后端通信中统一采用双精度数据格式传值。鉴于看板的不同界面对面对于展示的数据精度要求不同,由前端界面对数据进行小数点后保留位数进行控制。
+
+### 2.5 JSON数据格式
+
+数据看板使用JSON对象、数组对所传数据进行封装。
+
+## 3 通信方法
+
+数据看板通信采用Ajax和WebSocket两种方法,其中Ajax为前端请求后端应答,WebSocket为长连接双向通信。嵌入式设备的数据看板中Ajax为必选,WebSocket为可选。两者可同时并存。
+
+### 3.1 Ajax方法
+
+Ajax方法在数据看板中主要有两种用途:
+
+#### 3.1.1 前端拉取后端数据
+
+数据看板采用B/S架构实现时,通过Ajax实现前端主动向后端拉取数据。相关参数:
+
+通信路径:http[s]://server_ip:server_port/application_path/sevice_name。具体通信路径由各个数据看板后端程序应用说明提供对应的参数值;
+
+上下文类型:"application/x-www-form-urlencoded"
+
+统一传值参数:queryJson=已封装的传值结构
+
+#### 3.1.2 设备数据采集端推送数据到看板后端
+
+数据看板提供B/S服务架构时,可以采用本方法获取到来自数据采集设备或第三方的推送数据。相关参数与前端拉取后端类似。
+
+### 3.2 WebSocket长连接方式
+
+数据看板实现后端向前端主动推送数据,除了适应B/S架构外,C/S架构也可完全使用WebSocket方式实现前后端的连接与数据通信
+
+通信路径:ws[s]://server_ip:server_port
+
+其中通信端口默认为:6001
+
+统一传值参数:已封装的传值结构。
+
+WebSocket由服务端管理各路通信,并按30~60秒的间隔发送心跳包。连续三次及以上心跳包发送异常,由服务端主动断开连接。心跳包的数据示例如下:
+
+```json
+{
+    "CMD":"HeartBeat",
+    "TimeStamp":"2021-06-15 13:01:22"
+}
+```
+
+
+
+## 4 通信传值数据结构
+
+### 4.1 嵌入式看板数据结构
+
+嵌入式看板程序通常封装在监测设备或物联网网关设备硬件程序内。通过较为简单的网页前后端数据交互,实现数据看板的交互。
+
+#### 4.1.1 数据请求
+
+请求方:前端
+
+请求数据示例:
+
+```json
+{
+    "CMD": 1,
+    "COMMID": 0,
+    "DEVICE": 0,
+    "BUSADD": 0,
+    "VALUE": 0
+}
+```
+
+请求数据格式说明:
+
+| 序号 | 参数名 | 参数说明                       | 参数值范围                                                   | 备注 |
+| ---- | ------ | ------------------------------ | ------------------------------------------------------------ | ---- |
+| 1    | CMD    | 命令码,定义本次通信的执行命令 | 1:数据采集<br />2:点位赋值(遥控、遥设)                   |      |
+| 2    | COMMID | 通信端口编号                   | 一个数据看板最多可以向16个通信端口实现通信业务,取值范围:1~16。采集命令中可以取值为0,表示采集1~16全部端口。通常一个通信端口代表一个监测站点 |      |
+| 3    | DEVICE | 监测设备编号                   | 每个通信端口最多可以有256个设备,采集命令中可以取值为0,表示1~256全部设备 |      |
+| 4    | BUSADD | 点位编号                       | 每个监测设备最多可以有256个点位,趋势范围1~256。采集命令中可以取值为0,表示1~256全部点位 |      |
+| 5    | VALUE  | 赋值参数                       | 当CMD为2,且端口编号、点位编号均不为0时生效                  |      |
+
+**表3 请求数据格式定义表**
+
+#### 4.1.2 数据应答
+
+应答方:后端
+
+应答数据示例:
+
+```json
+{
+    "VER": "1.00",
+    "RESULT": {
+        "COMM_LIST": [
+            {
+                "ID": 1,
+                "NAME": "001站点",
+                "COUNT": 0,
+                "OUT": 0,
+                "ALARM": 0,
+                "DEVICELIST": []
+            },
+            {
+                "ID": 2,
+                "NAME": "002站点",
+                "COUNT": 1,
+                "OUT": 0,
+                "ALARM": 0,
+                "DEVICELIST": [
+                    {
+                    	"ID": 1
+                        "NAME": "电气火灾监控设备",
+                        "COUNT": 4,
+                        "PNOLIST": [
+                            {
+                                "STATUS_ID": 0,
+                                "STATUS": "正常",
+                                "COMM": 2,
+                                "DEV": 1,
+                                "ADDR": 1,
+                                "PNO_NAME": "漏电告警",
+                                "PNO_TYPE": 1,
+                                "VALUE": 0,
+                                "TIME": "1970-01-01 00:00:00"
+                            },
+                            {
+                                "STATUS_ID": 0,
+                                "STATUS": "正常",
+                                "COMM": 2,
+                                "DEV": 1,
+                                "ADDR": 22,
+                                "PNO_NAME": "A相电压",
+                                "PNO_TYPE": 2,
+                                "VALUE": 0.00,
+                                "TIME": "1970-01-01 00:00:00"
+                            },
+                            {
+                                "STATUS_ID": 0,
+                                "STATUS": "正常",
+                                "COMM": 2,
+                                "DEV": 1,
+                                "ADDR": 23,
+                                "PNO_NAME": "B相电压",
+                                "PNO_TYPE": 2,
+                                "VALUE": 0.00,
+                                "TIME": "1970-01-01 00:00:00"
+                            },
+                            {
+                                "STATUS_ID": 0,
+                                "STATUS": "正常",
+                                "COMM": 2,
+                                "ADDR": 24,
+                                "PNO_NAME": "C相电压",
+                                "PNO_TYPE": 2,
+                                "VALUE": 0.00,
+                                "TIME": "1970-01-01 00:00:00"
+                            }
+                        ]
+                    }
+                ]
+            },
+            {
+                "ID": 3,
+                "NAME": "003站点",
+                "COUNT": 0,
+                "OUT": 0,
+                "ALARM": 0,
+                "DEVICELIST": []
+            }
+        ]
+    },
+    "REPLY": 1
+}
+```
+
+应答格式说明:
+
+| 序号 | 参数名  | 参数说明             | 参数值范围                                             | 备注 |
+| ---- | ------- | -------------------- | ------------------------------------------------------ | ---- |
+| 1    | VER     | 通信协议版本,字符串 | "1.00"                                                 |      |
+| 2    | RESULT  | 返回数据内容,JSON   | COMM_LIST,JSON数组,单个元素结构定义见表5站点数据格式 |      |
+| 3    | REPLY   | 返回状态,整型       | 1:正常<br />其他值:异常                              |      |
+| 4    | MESSAGE | 异常信息,字符串     | 当REPLY为非“1”时有效                                   |      |
+
+**表4 返回数据格式定义表**
+
+| 序号 | 参数名     | 参数说明                                   | 参数值范围                            | 备注                       |
+| ---- | ---------- | ------------------------------------------ | ------------------------------------- | -------------------------- |
+| 1    | ID         | 通信端口编号                               | 1~16                                  |                            |
+| 2    | NAME       | 通信端口对应的监控对象(站点)名称,字符串 |                                       |                            |
+| 3    | COUNT      | 设备数量,整型                             |                                       |                            |
+| 4    | OUT        | 离线设备总数,整型                         |                                       | 告警设备离线后计为离线设备 |
+| 5    | ALARM      | 告警设备总数,整型                         |                                       |                            |
+| 6    | DEVICELIST | 监测设备列表,JSON数组                     | 单个元素结构定义见表6监测设备数据格式 |                            |
+
+**表5 站点数据格式**
+
+| 序号 | 参数名  | 参数说明               | 参数值范围                            | 备注 |
+| ---- | ------- | ---------------------- | ------------------------------------- | ---- |
+| 1    | ID      | 监测设备编号,整型     | 1~256                                 |      |
+| 2    | NAME    | 监测设备名称           | 中文字符串描述当前监测设备的名称      |      |
+| 3    | COUNT   | 监测点位的数量         | 1~256                                 |      |
+| 4    | PNOLIST | 监测点位列表,JSON数组 | 单个元素结构定义见表7监测点位数据格式 |      |
+
+**表6 监测设备数据格式**
+
+| 序号 | 参数名    | 参数说明                                                     | 参数值范围                                                   | 备注 |
+| ---- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- |
+| 1    | STATUS_ID | 监测点状态编码,布尔量                                       | 0:正常/恢复正常/关闭<br />1:告警/开启                      |      |
+| 2    | STATUS    | 监测点状态,字符串                                           | 中文字符串定义当前点位的状态                                 |      |
+| 3    | COMM      | 通信端口编号,整型                                           | 1~16                                                         |      |
+| 4    | DEV       | 设备编号,整型                                               | 1~256                                                        |      |
+| 5    | ADDR      | 点位编号,整型                                               | 1~256                                                        |      |
+| 6    | PNO_NAME  | 点位名称,字符串                                             |                                                              |      |
+| 7    | PNO_TYPE  | 点位类型,整型                                               | 1:开关量输入<br />2:模拟量输入<br />3:开关量输出(遥控)<br />4:模拟量输出(遥设) |      |
+| 8    | VALUE     | 采集数据值,开关量点位采集值为整型(布尔),模拟量点位采集值为精度型 |                                                              |      |
+| 9    | TIME      | 采集时间,日期时间格式                                       |                                                              |      |
+
+**表7 监测点位数据格式**
+
+### 4.2 通用型看板数据结构
+
+通用型数据看板,一般可采用Nginx网页服务器伺服前端界面展示代码,后端可采用多种灵活的服务程序。
+
+通用型看板,考虑到数据的时效性和服务端的压力,动态数据类后端服务一般推荐采用WebSocket的通信方式。
+
+#### 4.2.1 站点工况信息查询
+
+##### 4.2.1.1 数据请求
+
+请求方:前端
+
+请求数据示例:
+
+```json
+{
+	"CMD": "getStationInfo",
+	"StationID": "7c9c30af-6132-43d1-98fb-020395183094",
+	"StationName": "上海"
+}
+```
+
+请求数据格式说明:
+
+| 序号 | 参数名      | 参数说明                                                     | 参数值范围                                       | 备注 |
+| ---- | ----------- | ------------------------------------------------------------ | ------------------------------------------------ | ---- |
+| 1    | CMD         | 命令,字符串                                                 | "getStationInfo"                                 |      |
+| 2    | StationID   | 站点编码,可选参数项,字符串。参数字符串长度为0时等同于未填选站点编码 | UUID字符串,系统中每个站点都有一个唯一的站点编码 |      |
+| 3    | StationName | 站点名称,可选参数项,字符串。查询站点名称中含StationName参数值的站点,返回为列表格式,即:符合站点名称包含StationName参数值的全部站点。StationName参数值字符串长度为0时,等同于未填选站点名称 |                                                  |      |
+
+**表8 站点工况请求数据格式**
+
+##### 4.2.1.2 数据应答
+
+应答方:后端
+
+应答数据示例:
+
+```json
+{
+	"CMD": "getStationInfo",
+	"VER": "1.00",
+    "TotalCount":1,
+	"RESULT": [{
+        "StationID":"7c9c30af-6132-43d1-98fb-020395183094",
+        "StationName":"上海市青浦区虹泾总部2楼机房",
+        "StationPic":"http[s]://ip:port/picurlpath",
+        "Location":{
+        	"Lng":40.113257,
+        	"Lat":116.611279
+        },
+        "ContactPerson":"张三",
+        "ContactTelphone":"12345678",
+        "StationStatus":0,
+        "StationStatusNote":"正常",
+        "DeviceOnline":2,
+        "DeviceAlarm":0,
+        "DeviceFault":0,
+        "LastCommTime":"2021-06-15 12:43:11"
+    }],
+    "TimeStamp":"2021-06-15 13:01:22"
+    "REPLY":1
+}
+```
+
+应答数据格式说明:
+
+| 序号 | 参数名     | 参数说明                                     | 参数值范围                               | 备注 |
+| ---- | ---------- | -------------------------------------------- | ---------------------------------------- | ---- |
+| 1    | CMD        | 命令,字符串                                 | 与请求参数值一致,"getStationInfo"       |      |
+| 2    | VER        | 通信协议版本,字符串                         | ”1.00“                                   |      |
+| 3    | TotalCount | 站点数量,整型,符合查询条件的站点总数       |                                          |      |
+| 4    | RESULT     | 站点列表,JSON数组                           | 单个元素数据结构参见表10站点信息数据格式 |      |
+| 5    | TimeStamp  | 时间戳,日期时间格式,数据看板服务端系统时间 |                                          |      |
+| 6    | REPLY      | 返回状态,整型                               | 1:正常<br />其他值:异常                |      |
+| 7    | MESSAGE    | 异常信息,字符串                             | 当REPLY为非“1”时有效                     |      |
+
+**表9 站点工况应答数据格式**
+
+| 序号 | 参数名            | 参数说明                                                     | 参数值范围                                                   | 备注 |
+| ---- | ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- |
+| 1    | StationID         | 站点编码,字符串                                             | 当请求数据中StationID不为空时,与请求参数值一致              |      |
+| 2    | StationName       | 站点名称,字符串                                             |                                                              |      |
+| 3    | StationPic        | 站点图片(缩略图)路径,可选参数项,字符串                   | 图片文件访问路径                                             |      |
+| 4    | Location          | 坐标,可选参数项,JSON数据                                   | 坐标JSON结构见表11坐标数据格式                               |      |
+| 4    | ContactPerson     | 联系人,可选参数项,字符串                                   |                                                              |      |
+| 5    | ContactTelphone   | 联系电话,可选参数项,字符串                                 |                                                              |      |
+| 6    | StationStatus     | 站点状态,整型                                               | 0:正常/恢复正常<br />1:告警状态<br />2:故障状态(含失联) |      |
+| 7    | StationStatusNote | 站点状态文字描述,字符串                                     | 对站点工况信息给出对应的文字描述                             |      |
+| 8    | DeviceCount       | 设备总数,整型                                               |                                                              |      |
+| 9    | DeviceAlarm       | 告警设备总数,整型                                           |                                                              |      |
+| 10   | DeviceFault       | 故障设备总数,整型                                           | 离线设备统计在故障设备内                                     |      |
+| 11   | LastCommTime      | 最新通信时间,站点(任何设备)最后与上位机(系统)通信时间,日期时间格式 |                                                              |      |
+
+**表10 站点信息数据格式**
+
+| 序号 | 参数名 | 参数说明       | 参数值范围 | 备注 |
+| ---- | ------ | -------------- | ---------- | ---- |
+| 1    | Lng    | 维度,精度数据 |            |      |
+| 2    | Lat    | 经度,经度数据 |            |      |
+
+**表11 坐标数据格式**
+
+#### 4.2.2 站点详情信息查询
+
+##### 4.2.2.1 数据请求
+
+请求方:前端
+
+请求数据示例:
+
+```
+{
+	"CMD": "getStationDetail",
+	"StationID": "7c9c30af-6132-43d1-98fb-020395183094"
+}
+```
+
+请求数据格式说明:
+
+| 序号 | 参数名    | 参数说明         | 参数值范围                                       | 备注 |
+| ---- | --------- | ---------------- | ------------------------------------------------ | ---- |
+| 1    | CMD       | 命令,字符串     | "getStationDetail"                               |      |
+| 2    | StationID | 站点编码,字符串 | UUID字符串,系统中每个站点都有一个唯一的站点编码 |      |
+
+**表12 站点详情请求数据格式**
+
+##### 4.2.2.2 数据应答
+
+应答方:后端
+
+应答数据示例:
+
+```json
+{
+	"CMD": "getStationDetail",
+	"VER": "1.00",
+    "RESULT":{
+        "StationID":"7c9c30af-6132-43d1-98fb-020395183094",
+        "StationName":"上海市青浦区虹泾总部2楼机房",
+        "TotalCount":2,
+        "StationStatus":0,
+        "StationStatusNote":"正常",
+        "StationPic":"http[s]://ip:port/pic1urlpath",
+        "ContactPerson":"张三",
+        "ContactTelphone":"12345678",
+        "Location":{
+        	"Lng":40.113257,
+        	"Lat":116.611279
+        },
+        "LIST":[{
+            "DeviceID":"3baa1051-d186-42df-901e-f5d1c6c67af5",
+            "DeviceTypeID":"7bb16bc5-6998-4d75-a783-e404f5d62f4b",
+            "DeviceType":"电气火灾监测装置",
+            "DeviceStatus":0,
+            "DeviceStatusNote":"正常",
+            "DevicePic":"http[s]://ip:port/pic2urlpath",
+            "VideoUrl":"http[s]://ip:port/videourlpath",
+            "KeyPoints":[{
+                "BusAddr":1,
+                "PointName":"漏电告警",
+                "PointType":1,
+                "AlarmType":1,
+                "ValueList" :[{
+                    "AlarmStatus":0,
+                    "Value":0,
+                    "Time":"2021-06-15 12:42:03"
+                }]
+            },{
+                "BusAddr":65,
+                "PointName":"A相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "ValueList": [{
+                    "AlarmStatus":0,
+                    "Value":25.3,
+                    "Time":"2021-06-15 13:00:54"  
+                }]
+            },{
+                "BusAddr":66,
+                "PointName":"B相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "ValueList": [{
+                    "AlarmStatus":0,
+                    "Value":25.7,
+                    "Time":"2021-06-15 13:00:54"
+                }]
+            },{
+                "BusAddr":67,
+                "PointName":"C相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "ValueList": [{
+                    "AlarmStatus":0,
+                    "Value":25.3,
+                    "Time":"2021-06-15 13:00:54"
+                }]
+            }]
+        },{
+            "DeviceID":"5beae624-d1c8-4c43-9981-d14298b16b4f",
+            "DeviceTypeID":"528d7050-80bb-4b0e-b743-4d5ca77c8f2a",
+            "DeviceType":"可燃气体监测装置",
+            "DeviceStatus":0,
+            "DeviceStatusNote":"正常",
+            "DevicePic":"http[s]://ip:port/pic3urlpath",
+            "KeyPoints":[{
+                "BusAddr":65,
+                "PointName":"可燃气体浓度",
+                "PointType":2,
+                "AlarmType":2,
+                "ValueList": [{
+                    "AlarmStatus":0,
+                    "Value":0.13,
+                    "Time":"2021-06-15 12:57:22"                    
+                }]
+            }]
+        }]
+    },
+    "TimeStamp":"2021-06-15 13:01:22"
+    "REPLY":1
+}
+```
+
+应答数据格式说明:
+
+| 序号 | 参数名    | 参数说明                                     | 参数值范围                           | 备注 |
+| ---- | --------- | -------------------------------------------- | ------------------------------------ | ---- |
+| 1    | CMD       | 命令,字符串                                 | 与请求参数值一致,"getStationDetail" |      |
+| 2    | VER       | 通信协议版本,字符串                         | ”1.00“                               |      |
+| 3    | RESULT    | 站点详情,JSON结构                           | 站点详情结构见表14站点详情数据格式   |      |
+| 4    | TimeStamp | 时间戳,日期时间格式,数据看板服务端系统时间 |                                      |      |
+| 5    | REPLY     | 返回状态,整型                               | 1:正常<br />其他值:异常            |      |
+| 6    | MESSAGE   | 异常信息,字符串                             | 当REPLY为非“1”时有效                 |      |
+
+**表13 站点详情应答数据格式**
+
+| 序号 | 参数名            | 参数说明                                   | 参数值范围                                                   | 备注 |
+| ---- | ----------------- | ------------------------------------------ | ------------------------------------------------------------ | ---- |
+| 1    | StationID         | 站点编码,字符串                           | 与请求参数值一致                                             |      |
+| 2    | StationName       | 站点名称,字符串                           |                                                              |      |
+| 3    | TotalCount        | 设备数量,整型,站点内设备总数             |                                                              |      |
+| 4    | StationStatus     | 站点状态,整型                             | 0:正常/恢复正常<br />1:告警状态<br />2:故障状态(含失联) |      |
+| 5    | StationStatusNote | 站点状态文字描述,字符串                   | 对站点工况信息给出对应的文字描述                             |      |
+| 6    | StationPic        | 站点图片(缩略图)路径,可选参数项,字符串 | 图片文件访问路径                                             |      |
+| 7    | ContactPerson     | 联系人,可选参数项,字符串                 |                                                              |      |
+| 8    | ContactTelphone   | 联系电话,可选参数项,字符串               |                                                              |      |
+| 9    | Location          | 坐标,可选参数项,JSON数据                 | 坐标JSON结构见表11坐标数据格式                               |      |
+| 10   | LIST              | 设备工况列表,JSON数组                     | 单个元素定义见表15设备工况数据格式                           |      |
+
+**表14 站点详情数据格式**
+
+| 序号 | 参数名           | 参数说明                                   | 参数值范围                                                   | 备注 |
+| ---- | ---------------- | ------------------------------------------ | ------------------------------------------------------------ | ---- |
+| 1    | DeviceID         | 设备编码,字符串                           | UUID字符串,系统中每个设备都有一个唯一的设备编码             |      |
+| 2    | DeviceName       | 设备名称,字符串                           |                                                              |      |
+| 3    | DeviceTypeID     | 设备类型编码,字符串                       | UUID字符串,每一设备类型再系统中都有一个唯一的类型编码,详见表18设备类型编码列表 |      |
+| 4    | DeviceType       | 设备类型名称,字符串                       |                                                              |      |
+| 5    | DeviceStatus     | 设备状态,整型                             | 0:正常/恢复正常<br />1:告警状态<br />2:故障状态(含失联) |      |
+| 6    | DeviceStatusNote | 设备状态文字描述,字符串                   | 对设备工况信息给出对应的文字描述                             |      |
+| 7    | DevicePic        | 设备图片(缩略图)路径,可选参数项,字符串 | 图片文件访问路径                                             |      |
+| 8    | VideoUrl         | 视频预览路径,可选参数项,字符串           | 视频预览数据访问路径                                         |      |
+| 9    | KeyPoints        | 重要点位数据,JSON数组                     | 单个元素定义见表16监控点位信息数据格式。设备采集数据应答中,字段名为Points表示全部点位。在字段名上差异表示区别 |      |
+
+**表15 设备工况数据格式**
+
+| 序号 | 参数名      | 参数说明               | 参数值范围                                                   | 备注 |
+| ---- | ----------- | ---------------------- | ------------------------------------------------------------ | ---- |
+| 1    | BusAddr     | 监控点位序号,整型     | 0~255,通常:<br />0:为通信状态<br />1~64:为布尔量输入(遥信)<br />65~128:为精度数据输入(遥测)<br />129~160:为布尔量输出(遥控)<br />161~192:为精度数据输出(遥调) |      |
+| 2    | PointName   | 监测点位名称,字符串   |                                                              |      |
+| 3    | PointType   | 监测点位类型,整型     | 1~4,定义监控点位的属性:<br />1:布尔量输入<br />2:精度数据输入<br />3:布尔量输出<br />4:精度数据输出 |      |
+| 4    | AlarmType   | 告警属性,整型         | 当监测点位类型属于布尔量时,0为不告警,1为告警;<br />当监测点位类型属于精度数据时,0为不告警,1为下限告警,2为上限告警,3为上下限均告警 |      |
+| 5    | AlarmStatus | 告警状态,整型         | 0:正常/恢复正常<br />1:告警<br />2:故障                   |      |
+| 6    | ValueList   | 采集值,JSON数组       | 单个元素格式参见表17采集值数组格式。<br />注:站点详情中,每个点位的采集值数量为一个,设备采集数据应答中采集值数量为三个 |      |
+| 7    | Time        | 采集时间,日期时间格式 |                                                              |      |
+
+**表16 监控点位信息数据格式**
+
+| 序号 | 参数名      | 参数说明               | 参数值范围                                                   | 备注 |
+| ---- | ----------- | ---------------------- | ------------------------------------------------------------ | ---- |
+| 1    | AlarmStatus | 告警状态,整型         | 0:正常/恢复正常<br />1:告警<br />2:故障                   |      |
+| 2    | Value       | 采集值                 | 当监测点位类型属于布尔量时,采集值为整型,范围:0,1;<br />当监测点位类型属于精度数据时,采集值为精度数据 |      |
+| 3    | Time        | 采集时间,日期时间格式 |                                                              |      |
+
+**表17 采集数据格式**
+
+| 序号 | 设备类型                       | 类型编码                             |
+| ---- | ------------------------------ | ------------------------------------ |
+| 1    | 紧急(求助)按钮               | 9d2d74d3-ead5-4eb4-8b0d-4f95bea965f2 |
+| 2    | 电气火灾监测装置               | 7bb16bc5-6998-4d75-a783-e404f5d62f4b |
+| 3    | 智慧用电监测装置               | 8a71a986-aeb9-4af2-8b2a-9c10f82037a8 |
+| 4    | 可燃其他探测装置               | 528d7050-80bb-4b0e-b743-4d5ca77c8f2a |
+| 5    | 火灾探测装置                   | 01648860-89ef-4a80-8756-f7451ca15d35 |
+| 6    | 门体开启状态探测装置           | b1b9ba82-8458-42d0-bd5e-841e64358b44 |
+| 7    | 二次供水探测装置               | 57afec3e-176e-481e-84c1-27e6cd4e0eb5 |
+| 8    | 窨井盖探测装置                 | b0224833-7a11-4602-a75a-79fa60852be4 |
+| 9    | 消防占道探测装置               | 2abfb073-336a-42d4-b1ad-8d6abc44dc48 |
+| 10   | 电梯运行采集探测装置           | 91bdd6be-2551-4279-afb0-f3dd3ad03dc3 |
+| 11   | 水质监测残疾探测装置           | 2fea27d9-67cd-4ba1-9930-30c5aa64d2f9 |
+| 12   | 消防给水系统探测装置(消火栓) | 9089dfe7-c6af-4030-905f-817b4363a69b |
+| 13   | 消防喷淋管道压力探测装置       | 20913825-5cf0-4617-9e65-f93188a52025 |
+| 14   | 消防水泵探测装置               | 00f97026-c053-410f-9f7c-9e8674f5439d |
+| 15   | 视频告警探测装置               | fed54c5f-eadf-4bc7-bbbb-61c17871016f |
+
+**表18 设备类型编码列表**
+
+#### 4.2.3 监控设备采集数据查询
+
+##### 4.2.3.1 数据请求
+
+请求方:前端
+
+请求数据示例:
+
+```json
+{
+	"CMD": "getDeviceDetail",
+	"StationID": "7c9c30af-6132-43d1-98fb-020395183094",
+	"DeviceID": "3baa1051-d186-42df-901e-f5d1c6c67af5"
+}
+```
+
+请求数据格式说明:
+
+| 序号 | 参数名    | 参数说明         | 参数值范围                                       | 备注 |
+| ---- | --------- | ---------------- | ------------------------------------------------ | ---- |
+| 1    | CMD       | 命令,字符串     | "getDeviceDetail"                                |      |
+| 2    | StationID | 站点编码,字符串 | UUID字符串,系统中每个站点都有一个唯一的站点编码 |      |
+| 3    | DeviceID  | 设备编码,字符串 | UUID字符串,系统中每个设备都有一个唯一的设备编码 |      |
+
+**表19 监控设备采集数据请求数据格式**
+
+##### 4.2.3.2 数据应答
+
+应答方:后端
+
+应答数据示例:
+
+```json
+{
+	"CMD": "getDeviceDetail",
+	"VER": "1.00",
+    "RESULT":{
+        "StationID":"7c9c30af-6132-43d1-98fb-020395183094",
+        "StationName":"上海市青浦区虹泾总部2楼机房",
+        "Device":{
+            "DeviceID":"3baa1051-d186-42df-901e-f5d1c6c67af5",
+            "DeviceTypeID":"7bb16bc5-6998-4d75-a783-e404f5d62f4b",
+            "DeviceType":"电气火灾监测装置",
+            "DeviceStatus":0,
+            "DeviceStatusNote":"正常",
+            "DevicePic":"http[s]://ip:port/pic2urlpath",
+            "VideoUrl":"http[s]://ip:port/videourlpath",
+            "Points":[{
+                "BusAddr":1,
+                "PointName":"漏电告警",
+                "PointType":1,
+                "AlarmType":1,
+                "LIST":[{
+                    "AlarmStatus":0,
+                    "Value":0,
+                    "Time":"2021-06-15 13:00:34"
+                },{
+                    "AlarmStatus":0,
+                    "Value":0,
+                    "Time":"2021-06-15 13:00:44"
+                },{
+                    "AlarmStatus":0,
+                    "Value":0,
+                    "Time":"2021-06-15 13:00:54"
+                }]
+            },{
+                "BusAddr":65,
+                "PointName":"A相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "LIST":[{
+                    "AlarmStatus":0,
+                    "Value":25.1,
+                    "Time":"2021-06-15 13:00:34"
+                },{
+                    "AlarmStatus":0,
+                    "Value":25.1,
+                    "Time":"2021-06-15 13:00:44"
+                },{
+                    "AlarmStatus":0,
+                    "Value":25.3,
+                    "Time":"2021-06-15 13:00:54"
+                }]
+            },{
+                "BusAddr":66,
+                "PointName":"B相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "LIST":[{
+                    "AlarmStatus":0,
+                    "Value":23.4,
+                    "Time":"2021-06-15 13:00:34"
+                },{
+                    "AlarmStatus":0,
+                    "Value":23.5,
+                    "Time":"2021-06-15 13:00:44"
+                },{
+                    "AlarmStatus":0,
+                    "Value":23.1,
+                    "Time":"2021-06-15 13:00:54"
+                }]
+            },{
+                "BusAddr":67,
+                "PointName":"C相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "LIST":[{
+                    "AlarmStatus":0,
+                    "Value":23.2,
+                    "Time":"2021-06-15 13:00:34"
+                },{
+                    "AlarmStatus":0,
+                    "Value":23.2,
+                    "Time":"2021-06-15 13:00:44"
+                },{
+                    "AlarmStatus":0,
+                    "Value":23.2,
+                    "Time":"2021-06-15 13:00:54"
+                }]
+            }]
+        }
+    },
+    "TimeStamp":"2021-06-15 13:01:22"
+    "REPLY":1
+}
+```
+
+应答数据格式说明:
+
+| 序号 | 参数名    | 参数说明                                     | 参数值范围                                 | 备注 |
+| ---- | --------- | -------------------------------------------- | ------------------------------------------ | ---- |
+| 1    | CMD       | 命令,字符串                                 | 与请求参数值一致,"getDeviceDetail"        |      |
+| 2    | VER       | 通信协议版本,字符串                         | ”1.00“                                     |      |
+| 3    | RESULT    | 站点详情,JSON结构                           | 站点详情结构见表21监测设备站点详情数据格式 |      |
+| 4    | TimeStamp | 时间戳,日期时间格式,数据看板服务端系统时间 |                                            |      |
+| 5    | REPLY     | 返回状态,整型                               | 1:正常<br />其他值:异常                  |      |
+| 6    | MESSAGE   | 异常信息,字符串                             | 当REPLY为非“1”时有效                       |      |
+
+**表20 监测设备采集应答数据应答数据格式**
+
+| 序号 | 参数名      | 参数说明               | 参数值范围                             | 备注 |
+| ---- | ----------- | ---------------------- | -------------------------------------- | ---- |
+| 1    | StationID   | 站点编码,字符串       | 与请求参数值一致                       |      |
+| 2    | StationName | 站点名称,字符串       |                                        |      |
+| 3    | Device      | 设备工况列表,JSON数组 | 单个元素定义见表22监测设备工况数据格式 |      |
+
+**表21 监测设备站点详情数据格式**
+
+| 序号 | 参数名           | 参数说明                                   | 参数值范围                                                   | 备注 |
+| ---- | ---------------- | ------------------------------------------ | ------------------------------------------------------------ | ---- |
+| 1    | DeviceID         | 设备编码,字符串                           | UUID字符串,系统中每个设备都有一个唯一的设备编码             |      |
+| 2    | DeviceName       | 设备名称,字符串                           |                                                              |      |
+| 3    | DeviceTypeID     | 设备类型编码,字符串                       | UUID字符串,每一设备类型再系统中都有一个唯一的类型编码,详见表18设备类型编码列表 |      |
+| 4    | DeviceType       | 设备类型名称,字符串                       |                                                              |      |
+| 5    | DeviceStatus     | 设备状态,整型                             | 0:正常/恢复正常<br />1:告警状态<br />2:故障状态(含失联) |      |
+| 6    | DeviceStatusNote | 设备状态文字描述,字符串                   | 对设备工况信息给出对应的文字描述                             |      |
+| 7    | DevicePic        | 设备图片(缩略图)路径,可选参数项,字符串 | 图片文件访问路径                                             |      |
+| 8    | VideoUrl         | 视频预览路径,可选参数项,字符串           | 视频预览数据访问路径                                         |      |
+| 9    | Points           | 点位数据,JSON数组                         | 单个元素定义见表23监控设备监控点位信息数据格式。设备采集数据应答中,字段名为Points表示全部点位 |      |
+
+**表22 监测设备工况数据格式**
+
+| 序号 | 参数名      | 参数说明               | 参数值范围                                                   | 备注 |
+| ---- | ----------- | ---------------------- | ------------------------------------------------------------ | ---- |
+| 1    | BusAddr     | 监控点位序号,整型     | 0~255,通常:<br />0:为通信状态<br />1~64:为布尔量输入(遥信)<br />65~128:为精度数据输入(遥测)<br />129~160:为布尔量输出(遥控)<br />161~192:为精度数据输出(遥调) |      |
+| 2    | PointName   | 监测点位名称,字符串   |                                                              |      |
+| 3    | PointType   | 监测点位类型,整型     | 1~4,定义监控点位的属性:<br />1:布尔量输入<br />2:精度数据输入<br />3:布尔量输出<br />4:精度数据输出 |      |
+| 4    | AlarmType   | 告警属性,整型         | 当监测点位类型属于布尔量时,0为不告警,1为告警;<br />当监测点位类型属于精度数据时,0为不告警,1为下限告警,2为上限告警,3为上下限均告警 |      |
+| 5    | AlarmStatus | 告警状态,整型         | 0:正常/恢复正常<br />1:告警<br />2:故障                   |      |
+| 6    | Value       | 采集值                 | 当监测点位类型属于布尔量时,采集值为整型,范围:0,1;<br />当监测点位类型属于精度数据时,采集值为精度数据 |      |
+| 7    | LIST        | 采集值,JSON数组       | 单个元素格式参见表24监控设备采集值数组格式。<br />注:站点详情中,每个点位的采集值数量为一个,设备采集数据应答中采集值数量为三个 |      |
+| 8    | Time        | 采集时间,日期时间格式 |                                                              |      |
+
+**表23 监测设备监控点位信息数据格式**
+
+| 序号 | 参数名      | 参数说明               | 参数值范围                                                   | 备注 |
+| ---- | ----------- | ---------------------- | ------------------------------------------------------------ | ---- |
+| 1    | AlarmStatus | 告警状态,整型         | 0:正常/恢复正常<br />1:告警<br />2:故障                   |      |
+| 2    | Value       | 采集值                 | 当监测点位类型属于布尔量时,采集值为整型,范围:0,1;<br />当监测点位类型属于精度数据时,采集值为精度数据 |      |
+| 3    | Time        | 采集时间,日期时间格式 |                                                              |      |
+
+**表24 监测设备采集数据格式**
+
+#### 4.2.4 监控点位数据查询
+
+##### 4.2.4.1 数据请求
+
+请求方:前端
+
+请求数据示例:
+
+```json
+{
+	"CMD": "getPointValue",
+	"StationID": "7c9c30af-6132-43d1-98fb-020395183094",
+	"DeviceID": "3baa1051-d186-42df-901e-f5d1c6c67af5",
+	"BusAddr": 65,
+	"Count": 3
+}
+```
+
+请求数据格式说明:
+
+| 序号 | 参数名    | 参数说明               | 参数值范围                                                   | 备注 |
+| ---- | --------- | ---------------------- | ------------------------------------------------------------ | ---- |
+| 1    | CMD       | 命令,字符串           | "getPointValue"                                              |      |
+| 2    | StationID | 站点编码,字符串       | UUID字符串,系统中每个站点都有一个唯一的站点编码             |      |
+| 3    | DeviceID  | 设备编码,字符串       | UUID字符串,系统中每个设备都有一个唯一的设备编码             |      |
+| 4    | BusAddr   | 监控点位编号,整型     | 0~255,通常:<br />0:为通信状态<br />1~64:为布尔量输入(遥信)<br />65~128:为精度数据输入(遥测)<br />129~160:为布尔量输出(遥控)<br />161~192:为精度数据输出(遥调) |      |
+| 5    | Count     | 获取数据元素数量,整型 | 1~10。小型本地看板,存储实时数据有限,一般为3个及以内        |      |
+
+**表25  监控点位采集数据请求数据格式**
+
+##### 4.2.4.2 数据应答
+
+应答方:后端
+
+应答数据示例:
+
+```json
+{
+	"CMD": "getPointValue",
+	"VER": "1.00",
+    "RESULT":{
+        "StationID":"7c9c30af-6132-43d1-98fb-020395183094",
+        "StationName":"上海市青浦区虹泾总部2楼机房",
+        "DeviceID":"3baa1051-d186-42df-901e-f5d1c6c67af5",
+        "DeviceTypeID":"7bb16bc5-6998-4d75-a783-e404f5d62f4b",
+        "DeviceType":"电气火灾监测装置",
+        "BusAddr":65,
+        "PointName":"A相线缆温度",
+        "PointType":2,
+        "AlarmType":2,
+        "Count":5,
+        "LIST":[{
+        	"AlarmStatus":0,
+            "Value":25.3,
+            "Time":"2021-06-15 13:00:54"
+        },{
+        	"AlarmStatus":0,
+            "Value":25.3,
+            "Time":"2021-06-15 13:00:59"
+        },{
+        	"AlarmStatus":0,
+            "Value":25.3,
+            "Time":"2021-06-15 13:01:04"
+        },{
+        	"AlarmStatus":0,
+            "Value":25.3,
+            "Time":"2021-06-15 13:01:09"
+        },{
+        	"AlarmStatus":0,
+            "Value":25.3,
+            "Time":"2021-06-15 13:01:14"
+        }]
+    },
+    "TimeStamp":"2021-06-15 13:01:22"
+    "REPLY":1
+}
+```
+
+应答数据格式说明:
+
+| 序号 | 参数名    | 参数说明                                     | 参数值范围                                     | 备注 |
+| ---- | --------- | -------------------------------------------- | ---------------------------------------------- | ---- |
+| 1    | CMD       | 命令,字符串                                 | 与请求参数值一致,"getPointValue"              |      |
+| 2    | VER       | 通信协议版本,字符串                         | ”1.00“                                         |      |
+| 3    | RESULT    | 监控点位采集数据,JSON结构                   | 监控点位采集数据结构见表22点位数据采集数据格式 |      |
+| 4    | TimeStamp | 时间戳,日期时间格式,数据看板服务端系统时间 |                                                |      |
+| 5    | REPLY     | 返回状态,整型                               | 1:正常<br />其他值:异常                      |      |
+| 6    | MESSAGE   | 异常信息,字符串                             | 当REPLY为非“1”时有效                           |      |
+
+**表26 监控点位数据查询应答数据结构**
+
+| 序号 | 参数名       | 参数说明               | 参数值范围                                                   | 备注 |
+| ---- | ------------ | ---------------------- | ------------------------------------------------------------ | ---- |
+| 1    | StationID    | 站点编码,字符串       | UUID字符串,系统中每个站点都有一个唯一的站点编码             |      |
+| 2    | StationName  | 站点名称,字符串       |                                                              |      |
+| 3    | DeviceID     | 设备编码,字符串       | UUID字符串,系统中每个设备都有一个唯一的设备编码             |      |
+| 4    | DeviceTypeID | 设备类型编码,字符串   | UUID字符串,每一设备类型再系统中都有一个唯一的类型编码,详见表17设备类型编码列表 |      |
+| 5    | DeviceType   | 设备类型名称,字符串   |                                                              |      |
+| 6    | BusAddr      | 监控点位编号,整型     | 与请求数据值一致                                             |      |
+| 7    | PointName    | 监测点位名称,字符串   |                                                              |      |
+| 8    | PointType    | 监测点位类型,整型     | 1~4,定义监控点位的属性:<br />1:布尔量输入<br />2:精度数据输入<br />3:布尔量输出<br />4:精度数据输出 |      |
+| 9    | AlarmType    | 告警属性,整型         | 当监测点位类型属于布尔量时,0为不告警,1为告警;<br />当监测点位类型属于精度数据时,0为不告警,1为下限告警,2为上限告警,3为上下限均告警 |      |
+| 10   | Count        | 获取数据元素数量,整型 | 1~10。与请求数据一致,当看板后端实际存储的采集次数小于该请求数字时返回实际采集次数 |      |
+| 11   | LIST         | 采集数据,JSON数组     | 单元数据格式参见表23采集数据格式                             |      |
+
+**表27 点位数据采集数据格式**
+
+#### 4.2.5 电子巡检记录查询
+
+##### 4.2.5.1 数据请求
+
+请求方:前端
+
+请求数据示例:
+
+```
+{
+	"CMD": "getPatrolRecord",
+	"StationID": "7c9c30af-6132-43d1-98fb-020395183094",
+	"Start": 0,
+	"Limit": 5,
+	"Order": "DESC"
+}
+```
+
+请求数据格式说明:
+
+| 序号 | 参数名    | 参数说明           | 参数值范围                                       | 备注               |
+| ---- | --------- | ------------------ | ------------------------------------------------ | ------------------ |
+| 1    | CMD       | 命令,字符串       | "getPatrolRecord"                                |                    |
+| 2    | StationID | 站点编码,字符串   | UUID字符串,系统中每个站点都有一个唯一的站点编码 |                    |
+| 3    | Start     | 起始记录序号,整型 |                                                  |                    |
+| 4    | Limit     | 查询记录数量,整型 |                                                  |                    |
+| 5    | Order     | 排序,字符串       | 正序:"ASC";<br />逆序:"DESC"                  | 排序字段为记录时间 |
+
+**表28  电子巡检记录查询请求数据格式**
+
+##### 4.2.5.2 数据应答
+
+应答方:后端
+
+应答数据示例:
+
+```json
+{
+	"CMD": "getPatrolRecord",
+	"VER": "1.00",
+    "TotalCount": 100,
+    "Count": 5,
+    "RESULT":{
+        "StationID":"7c9c30af-6132-43d1-98fb-020395183094",
+        "StationName":"上海市青浦区虹泾总部2楼机房",
+        "LIST": [{
+            "Time": "2021-06-15 13:01:14"
+        },{
+            "Time": "2021-06-15 13:01:09"
+        },{
+            "Time": "2021-06-15 13:01:04"
+        },{
+            "Time": "2021-06-15 13:00:59"
+        },{
+            "Time": "2021-06-15 13:00:54"
+        }]
+    },
+    "TimeStamp":"2021-06-15 13:01:22"
+    "REPLY":1
+}
+```
+
+应答数据格式说明:
+
+| 序号 | 参数名     | 参数说明                                     | 参数值范围                                                   | 备注 |
+| ---- | ---------- | -------------------------------------------- | ------------------------------------------------------------ | ---- |
+| 1    | CMD        | 命令,字符串                                 | 与请求参数值一致,"getPointValue"                            |      |
+| 2    | VER        | 通信协议版本,字符串                         | ”1.00“                                                       |      |
+| 3    | TotalCount | 巡检记录总数,整型                           |                                                              |      |
+| 4    | Count      | 获取数据元素数量,整型                       | 与请求数据LIMIT一致,当看板后端实际存储的采集次数小于该请求数字时返回实际采集次数 |      |
+| 5    | RESULT     | 巡检记录,JSON数组                           | 单个元素定义见表30巡检记录格式                               |      |
+| 6    | TimeStamp  | 时间戳,日期时间格式,数据看板服务端系统时间 |                                                              |      |
+| 7    | REPLY      | 返回状态,整型                               | 1:正常<br />其他值:异常                                    |      |
+| 8    | MESSAGE    | 异常信息,字符串                             | 当REPLY为非“1”时有效                                         |      |
+
+**表29 巡检记录查询应答数据格式**
+
+| 序号 | 参数名      | 参数说明               | 参数值范围                         | 备注 |
+| ---- | ----------- | ---------------------- | ---------------------------------- | ---- |
+| 1    | StationID   | 站点编码,字符串       | 与请求参数值一致                   |      |
+| 2    | StationName | 站点名称,字符串       |                                    |      |
+| 3    | LIST        | 设备工况列表,JSON数组 | 单个元素定义见表31巡检记录时间格式 |      |
+
+**表30 巡检记录格式**
+
+| 序号 | 参数名 | 参数说明                           | 参数值范围 | 备注 |
+| ---- | ------ | ---------------------------------- | ---------- | ---- |
+| 1    | Time   | 巡检记录数据采集时间,日期时间格式 |            |      |
+
+**表31 巡检记录时间格式**
+
+#### 4.2.6 电子巡检记录数据查询
+
+##### 4.2.6.1 数据请求
+
+请求方:前端
+
+请求数据示例:
+
+```json
+{
+	"CMD": "getPatrolDetail",
+	"StationID": "7c9c30af-6132-43d1-98fb-020395183094",
+	"Time": "2021-06-15 13:01:14"
+}
+```
+
+请求数据格式说明:
+
+| 序号 | 参数名    | 参数说明                           | 参数值范围                                       | 备注 |
+| ---- | --------- | ---------------------------------- | ------------------------------------------------ | ---- |
+| 1    | CMD       | 命令,字符串                       | "getPatrolDetail"                                |      |
+| 2    | StationID | 站点编码,字符串                   | UUID字符串,系统中每个站点都有一个唯一的站点编码 |      |
+| 3    | Time      | 巡检记录数据采集时间,日期时间格式 |                                                  |      |
+
+**表32  电子巡检记录数据查询请求数据格式**
+
+##### 4.2.6.2 数据应答
+
+应答方:后端
+
+应答数据示例:
+
+```json
+{
+	"CMD": "getPatrolDetail",
+	"VER": "1.00",
+    "RESULT":{
+        "StationID":"7c9c30af-6132-43d1-98fb-020395183094",
+        "StationName":"上海市青浦区虹泾总部2楼机房",
+        "Time": "2021-06-15 13:01:14",
+        "LIST":[{
+            "DeviceID":"3baa1051-d186-42df-901e-f5d1c6c67af5",
+            "DeviceTypeID":"7bb16bc5-6998-4d75-a783-e404f5d62f4b",
+            "DeviceType":"电气火灾监测装置",
+            "DeviceStatus":0,
+            "DeviceStatusNote":"正常",
+            "Points":[{
+                "BusAddr":1,
+                "PointName":"漏电告警",
+                "PointType":1,
+                "AlarmType":1,
+                "AlarmStatus":0,
+                "Value":0,
+                "Time":"2021-06-15 12:42:03"
+            },{
+                "BusAddr":65,
+                "PointName":"A相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "AlarmStatus":0,
+                "Value":25.3,
+                "Time":"2021-06-15 13:00:54"
+            },{
+                "BusAddr":66,
+                "PointName":"B相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "AlarmStatus":0,
+                "Value":25.7,
+                "Time":"2021-06-15 13:00:54"
+            },{
+                "BusAddr":67,
+                "PointName":"C相线缆温度",
+                "PointType":2,
+                "AlarmType":2,
+                "AlarmStatus":0,
+                "Value":25.3,
+                "Time":"2021-06-15 13:00:54"
+            }]
+        },{
+            "DeviceID":"5beae624-d1c8-4c43-9981-d14298b16b4f",
+            "DeviceTypeID":"528d7050-80bb-4b0e-b743-4d5ca77c8f2a",
+            "DeviceType":"可燃气体监测装置",
+            "DeviceStatus":0,
+            "DeviceStatusNote":"正常",
+            "Points":[{
+                "BusAddr":65,
+                "PointName":"可燃气体浓度",
+                "PointType":2,
+                "AlarmType":2,
+                "AlarmStatus":0,
+                "Value":0.13,
+                "Time":"2021-06-15 12:57:22"
+            }]
+        }]
+    },
+    "TimeStamp":"2021-06-15 13:01:22"
+    "REPLY":1
+}
+```
+
+应答数据格式说明:
+
+| 序号 | 参数名    | 参数说明                                     | 参数值范围                          | 备注 |
+| ---- | --------- | -------------------------------------------- | ----------------------------------- | ---- |
+| 1    | CMD       | 命令,字符串                                 | 与请求参数值一致,"getPatrolDetail" |      |
+| 2    | VER       | 通信协议版本,字符串                         | ”1.00“                              |      |
+| 4    | RESULT    | 巡检记录数据,JSON对象                       | 结构定义见表34巡检记录数据格式      |      |
+| 5    | TimeStamp | 时间戳,日期时间格式,数据看板服务端系统时间 |                                     |      |
+| 6    | REPLY     | 返回状态,整型                               | 1:正常<br />其他值:异常           |      |
+| 7    | MESSAGE   | 异常信息,字符串                             | 当REPLY为非“1”时有效                |      |
+
+**表33 电气巡检记录数据查询应答格式**
+
+| 序号 | 参数名      | 参数说明                           | 参数值范围                                       | 备注 |
+| ---- | ----------- | ---------------------------------- | ------------------------------------------------ | ---- |
+| 1    | StationID   | 站点编码,字符串                   | UUID字符串,系统中每个站点都有一个唯一的站点编码 |      |
+| 2    | StationName | 站点名称,字符串                   |                                                  |      |
+| 3    | Time        | 巡检记录数据采集时间,日期时间格式 |                                                  |      |
+| 4    | LIST        | 设备工况列表,JSON数组             | 单个元素定义见表35设备工况数据格式               |      |
+
+**表34 巡检记录数据格式**
+
+| 序号 | 参数名           | 参数说明                                   | 参数值范围                                                   | 备注 |
+| ---- | ---------------- | ------------------------------------------ | ------------------------------------------------------------ | ---- |
+| 1    | DeviceID         | 设备编码,字符串                           | UUID字符串,系统中每个设备都有一个唯一的设备编码             |      |
+| 2    | DeviceName       | 设备名称,字符串                           |                                                              |      |
+| 3    | DeviceTypeID     | 设备类型编码,字符串                       | UUID字符串,每一设备类型再系统中都有一个唯一的类型编码,详见表18设备类型编码列表 |      |
+| 4    | DeviceType       | 设备类型名称,字符串                       |                                                              |      |
+| 5    | DeviceStatus     | 设备状态,整型                             | 0:正常/恢复正常<br />1:告警状态<br />2:故障状态(含失联) |      |
+| 6    | DeviceStatusNote | 设备状态文字描述,字符串                   | 对设备工况信息给出对应的文字描述                             |      |
+| 7    | DevicePic        | 设备图片(缩略图)路径,可选参数项,字符串 | 图片文件访问路径                                             |      |
+| 8    | VideoUrl         | 视频预览路径,可选参数项,字符串           | 视频预览数据访问路径                                         |      |
+| 9    | Points           | 重要点位数据,JSON数组                     | 单个元素定义见表36监控点位信息数据格式。设备采集数据应答中,字段名为Points表示全部点位。在字段名上差异表示区别 |      |
+
+**表35 设备工况数据格式**
+
+| 序号 | 参数名      | 参数说明               | 参数值范围                                                   | 备注 |
+| ---- | ----------- | ---------------------- | ------------------------------------------------------------ | ---- |
+| 1    | BusAddr     | 监控点位序号,整型     | 0~255,通常:<br />0:为通信状态<br />1~64:为布尔量输入(遥信)<br />65~128:为精度数据输入(遥测)<br />129~160:为布尔量输出(遥控)<br />161~192:为精度数据输出(遥调) |      |
+| 2    | PointName   | 监测点位名称,字符串   |                                                              |      |
+| 3    | PointType   | 监测点位类型,整型     | 1~4,定义监控点位的属性:<br />1:布尔量输入<br />2:精度数据输入<br />3:布尔量输出<br />4:精度数据输出 |      |
+| 4    | AlarmType   | 告警属性,整型         | 当监测点位类型属于布尔量时,0为不告警,1为告警;<br />当监测点位类型属于精度数据时,0为不告警,1为下限告警,2为上限告警,3为上下限均告警 |      |
+| 5    | AlarmStatus | 告警状态,整型         | 0:正常/恢复正常<br />1:告警<br />2:故障                   |      |
+| 6    | Value       | 采集值                 | 当监测点位类型属于布尔量时,采集值为整型,范围:0,1;<br />当监测点位类型属于精度数据时,采集值为精度数据 |      |
+| 7    | Time        | 采集时间,日期时间格式 |                                                              |      |
+
+**表36 监控点位信息数据格式**
+
+### 4.3 采集端推送数据格式
+
+#### 4.3.1 数据请求
+
+请求方:数据采集端
+
+请求数据示例:
+
+```
+{
+	"CMD": "pushDeviceValues",
+	"DeviceID":"3baa1051-d186-42df-901e-f5d1c6c67af5",
+    "DeviceTypeID":"7bb16bc5-6998-4d75-a783-e404f5d62f4b",
+    "DeviceType":"电气火灾监测装置",
+    "DeviceStatus":0,
+    "DeviceStatusNote":"正常",
+    "Values":[{
+        "BusAddr":1,
+        "PointName":"漏电告警",
+        "PointType":1,
+        "AlarmType":1,
+        "AlarmStatus":0,
+        "Value":0,
+        "Time":"2021-06-15 12:42:03"
+    },{
+        "BusAddr":65,
+        "PointName":"A相线缆温度",
+        "PointType":2,
+        "AlarmType":2,
+        "AlarmStatus":0,
+        "Value":25.3,
+        "Time":"2021-06-15 13:00:54"
+    },{
+        "BusAddr":66,
+        "PointName":"B相线缆温度",
+        "PointType":2,
+        "AlarmType":2,
+        "AlarmStatus":0,
+        "Value":25.7,
+        "Time":"2021-06-15 13:00:54"
+    },{
+        "BusAddr":67,
+        "PointName":"C相线缆温度",
+        "PointType":2,
+        "AlarmType":2,
+        "AlarmStatus":0,
+        "Value":25.3,
+        "Time":"2021-06-15 13:00:54"
+    }],
+    "TimeStamp":"2021-06-15 13:01:22"
+}
+```
+
+请求数据格式说明:
+
+| 序号 | 参数名           | 参数说明                 | 参数值范围                                                   | 备注 |
+| ---- | ---------------- | ------------------------ | ------------------------------------------------------------ | ---- |
+| 1    | CMD              | 命令,字符串             | "pushDeviceValues"                                           |      |
+| 2    | DeviceID         | 设备编码,字符串         | UUID字符串,系统中每个设备都有一个唯一的站点编码             |      |
+| 3    | DeviceTypeID     | 设备类型编码,字符串     | 详见表18 设备类型编码列表                                    |      |
+| 4    | DeviceType       | 设备类型说明,字符串     |                                                              |      |
+| 5    | DeviceStatus     | 装备状态编号,整型       | 0:正常/恢复正常<br />1:告警状态<br />2:故障状态(含失联) |      |
+| 6    | DeviceStatusNote | 设备状态文字描述,字符串 | 对设备工况信息给出对应的文字描述                             |      |
+| 7    | Values           | 设备点位采集值,JSON数组 | 单个元素定义见表16监控点位信息数据格式                       |      |
+| 8    | TimeStamp        | 时间戳                   | 采集端数据上报时间值                                         |      |
+
+**表37  采集端推送请求数据格式**
+
+#### 4.3.2 数据应答
+
+应答方:数据看板后端
+
+应答数据示例:
+
+```
+{
+	"CMD": "pushDeviceValues",
+	"TimeStamp":"2021-06-15 13:01:25"
+	"REPLY": 1
+}
+```
+
+应答数据格式说明:
+
+| 序号 | 参数名    | 参数说明                                     | 参数值范围                | 备注 |
+| ---- | --------- | -------------------------------------------- | ------------------------- | ---- |
+| 1    | CMD       | 命令码,字符串,与请求命令一致               | "pushDeviceValues"        |      |
+| 2    | TimeStamp | 时间戳,日期时间格式,数据看板服务端系统时间 |                           |      |
+| 3    | REPLY     | 返回状态,整型                               | 1:正常<br />其他值:异常 |      |
+| 4    | MESSAGE   | 异常信息,字符串                             | 当REPLY为非“1”时有效      |      |
+
+**表38 采集端推送应答数据格式**
+