Przeglądaj źródła

record staffer no.

lixioayao 6 lat temu
rodzic
commit
df1d088cb0
18 zmienionych plików z 163 dodań i 318 usunięć
  1. 0 245
      CMakeLists.txt.user
  2. 31 15
      Makefile
  3. 1 1
      Makefile.am
  4. 31 15
      Makefile.in
  5. 4 16
      card.cpp
  6. 6 9
      card.h
  7. 1 1
      cardMgr.h
  8. 4 3
      card_person.cpp
  9. 57 0
      card_tool.cpp
  10. 17 0
      card_tool.h
  11. 1 2
      db/db_tool.cpp
  12. 1 1
      db/db_tool.h
  13. BIN
      db/libyadb.a
  14. 3 3
      message.cpp
  15. 0 3
      mine.h
  16. 0 3
      monkey_car/monkeycar_area.h
  17. 5 0
      net-service.cpp
  18. 1 1
      znet.cpp

+ 0 - 245
CMakeLists.txt.user

@@ -1,245 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.7.0, 2018-10-20T21:16:35. -->
-<qtcreator>
- <data>
-  <variable>EnvironmentId</variable>
-  <value type="QByteArray">{149fbad2-c2c1-46e2-b53b-a02601bae2a5}</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">桌面</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">桌面</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{9a595fce-5778-4edd-9faa-19eb476f9ba8}</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <valuelist type="QVariantList" key="CMake.Configuration">
-     <value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
-    </valuelist>
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/root/projection/ya-serv/Debug</value>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
-      <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
-       <value type="QString">all</value>
-      </valuelist>
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">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="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
-      <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
-       <value type="QString">all</value>
-      </valuelist>
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">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">CMakeProjectManager.CMakeBuildConfiguration</value>
-   </valuemap>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <valuelist type="QVariantList" key="CMake.Configuration">
-     <value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
-    </valuelist>
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/root/projection/ya-serv/Release</value>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
-      <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
-       <value type="QString">all</value>
-      </valuelist>
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">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="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
-      <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
-       <value type="QString">all</value>
-      </valuelist>
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">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">CMakeProjectManager.CMakeBuildConfiguration</value>
-   </valuemap>
-   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</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="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
-    <value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
-    <value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory.default">/root/projection/ya-serv/Debug</value>
-    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
-    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">ya-serv</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.ya-serv
-/root/projection/ya-serv/</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">1</value>
-  </valuemap>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.TargetCount</variable>
-  <value type="int">1</value>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
-  <value type="int">18</value>
- </data>
- <data>
-  <variable>Version</variable>
-  <value type="int">18</value>
- </data>
-</qtcreator>

+ 31 - 15
Makefile

@@ -88,20 +88,21 @@ am__objects_2 = yals-module_call.$(OBJEXT) \
 	yals-module_web.$(OBJEXT)
 am__objects_3 = yals-ant.$(OBJEXT) yals-area.$(OBJEXT) \
 	yals-base64.$(OBJEXT) yals-bindmorecard.$(OBJEXT) \
-	yals-card_area.$(OBJEXT) yals-card_base.$(OBJEXT) \
-	yals-card_car.$(OBJEXT) yals-card.$(OBJEXT) \
-	yals-card_message_handle.$(OBJEXT) yals-cardMgr.$(OBJEXT) \
-	yals-card_path.$(OBJEXT) yals-card_person.$(OBJEXT) \
-	yals-crc.$(OBJEXT) yals-geo_hash.$(OBJEXT) \
-	yals-landmark.$(OBJEXT) yals-line_fit.$(OBJEXT) \
-	yals-loc_point.$(OBJEXT) yals-loc_tool.$(OBJEXT) \
-	yals-message.$(OBJEXT) yals-message_file.$(OBJEXT) \
-	yals-mine.$(OBJEXT) yals-net-service.$(OBJEXT) \
-	yals-point.$(OBJEXT) yals-select_tool.$(OBJEXT) \
-	yals-site_area.$(OBJEXT) yals-special_area.$(OBJEXT) \
-	yals-tdoa_sync.$(OBJEXT) yals-visit.$(OBJEXT) \
-	yals-web-client.$(OBJEXT) yals-worker.$(OBJEXT) \
-	yals-ya_event.$(OBJEXT) yals-znet.$(OBJEXT)
+	yals-card_tool.$(OBJEXT) yals-card_area.$(OBJEXT) \
+	yals-card_base.$(OBJEXT) yals-card_car.$(OBJEXT) \
+	yals-card.$(OBJEXT) yals-card_message_handle.$(OBJEXT) \
+	yals-cardMgr.$(OBJEXT) yals-card_path.$(OBJEXT) \
+	yals-card_person.$(OBJEXT) yals-crc.$(OBJEXT) \
+	yals-geo_hash.$(OBJEXT) yals-landmark.$(OBJEXT) \
+	yals-line_fit.$(OBJEXT) yals-loc_point.$(OBJEXT) \
+	yals-loc_tool.$(OBJEXT) yals-message.$(OBJEXT) \
+	yals-message_file.$(OBJEXT) yals-mine.$(OBJEXT) \
+	yals-net-service.$(OBJEXT) yals-point.$(OBJEXT) \
+	yals-select_tool.$(OBJEXT) yals-site_area.$(OBJEXT) \
+	yals-special_area.$(OBJEXT) yals-tdoa_sync.$(OBJEXT) \
+	yals-visit.$(OBJEXT) yals-web-client.$(OBJEXT) \
+	yals-worker.$(OBJEXT) yals-ya_event.$(OBJEXT) \
+	yals-znet.$(OBJEXT)
 am__objects_4 = $(am__objects_1) $(am__objects_2) $(am__objects_3)
 am_yals_OBJECTS = $(am__objects_4) yals-main.$(OBJEXT)
 yals_OBJECTS = $(am_yals_OBJECTS)
@@ -239,7 +240,7 @@ top_builddir = .
 top_srcdir = .
 SRC_MONKEYCAR = monkey_car/monkeycar_area.cpp monkey_car/monkeycar_bus.cpp monkey_car/monkeycar_person.cpp
 SRC_MODULE_SERVICE = module_service/module_call.cpp module_service/module_meta_date_changed.cpp module_service/module_web.cpp
-SRC_MAIN = ant.cpp area.cpp base64.cpp bindmorecard.cpp card_area.cpp card_base.cpp card_car.cpp \
+SRC_MAIN = ant.cpp area.cpp base64.cpp bindmorecard.cpp card_tool.cpp card_area.cpp card_base.cpp card_car.cpp \
     	  card.cpp card_message_handle.cpp cardMgr.cpp card_path.cpp card_person.cpp crc.cpp geo_hash.cpp \
 		  landmark.cpp line_fit.cpp loc_point.cpp loc_tool.cpp message.cpp message_file.cpp mine.cpp \
 		  net-service.cpp point.cpp select_tool.cpp site_area.cpp special_area.cpp tdoa_sync.cpp visit.cpp \
@@ -379,6 +380,7 @@ include ./$(DEPDIR)/yals-card_car.Po
 include ./$(DEPDIR)/yals-card_message_handle.Po
 include ./$(DEPDIR)/yals-card_path.Po
 include ./$(DEPDIR)/yals-card_person.Po
+include ./$(DEPDIR)/yals-card_tool.Po
 include ./$(DEPDIR)/yals-crc.Po
 include ./$(DEPDIR)/yals-geo_hash.Po
 include ./$(DEPDIR)/yals-landmark.Po
@@ -631,6 +633,20 @@ yals-bindmorecard.obj: bindmorecard.cpp
 #	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
 #	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o yals-bindmorecard.obj `if test -f 'bindmorecard.cpp'; then $(CYGPATH_W) 'bindmorecard.cpp'; else $(CYGPATH_W) '$(srcdir)/bindmorecard.cpp'; fi`
 
+yals-card_tool.o: card_tool.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT yals-card_tool.o -MD -MP -MF $(DEPDIR)/yals-card_tool.Tpo -c -o yals-card_tool.o `test -f 'card_tool.cpp' || echo '$(srcdir)/'`card_tool.cpp
+	$(am__mv) $(DEPDIR)/yals-card_tool.Tpo $(DEPDIR)/yals-card_tool.Po
+#	source='card_tool.cpp' object='yals-card_tool.o' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o yals-card_tool.o `test -f 'card_tool.cpp' || echo '$(srcdir)/'`card_tool.cpp
+
+yals-card_tool.obj: card_tool.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT yals-card_tool.obj -MD -MP -MF $(DEPDIR)/yals-card_tool.Tpo -c -o yals-card_tool.obj `if test -f 'card_tool.cpp'; then $(CYGPATH_W) 'card_tool.cpp'; else $(CYGPATH_W) '$(srcdir)/card_tool.cpp'; fi`
+	$(am__mv) $(DEPDIR)/yals-card_tool.Tpo $(DEPDIR)/yals-card_tool.Po
+#	source='card_tool.cpp' object='yals-card_tool.obj' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o yals-card_tool.obj `if test -f 'card_tool.cpp'; then $(CYGPATH_W) 'card_tool.cpp'; else $(CYGPATH_W) '$(srcdir)/card_tool.cpp'; fi`
+
 yals-card_area.o: card_area.cpp
 	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT yals-card_area.o -MD -MP -MF $(DEPDIR)/yals-card_area.Tpo -c -o yals-card_area.o `test -f 'card_area.cpp' || echo '$(srcdir)/'`card_area.cpp
 	$(am__mv) $(DEPDIR)/yals-card_area.Tpo $(DEPDIR)/yals-card_area.Po

+ 1 - 1
Makefile.am

@@ -5,7 +5,7 @@ SRC_MONKEYCAR= monkey_car/monkeycar_area.cpp monkey_car/monkeycar_bus.cpp monkey
 
 SRC_MODULE_SERVICE= module_service/module_call.cpp module_service/module_meta_date_changed.cpp module_service/module_web.cpp
 
-SRC_MAIN= ant.cpp area.cpp base64.cpp bindmorecard.cpp card_area.cpp card_base.cpp card_car.cpp \
+SRC_MAIN= ant.cpp area.cpp base64.cpp bindmorecard.cpp card_tool.cpp card_area.cpp card_base.cpp card_car.cpp \
     	  card.cpp card_message_handle.cpp cardMgr.cpp card_path.cpp card_person.cpp crc.cpp geo_hash.cpp \
 		  landmark.cpp line_fit.cpp loc_point.cpp loc_tool.cpp message.cpp message_file.cpp mine.cpp \
 		  net-service.cpp point.cpp select_tool.cpp site_area.cpp special_area.cpp tdoa_sync.cpp visit.cpp \

+ 31 - 15
Makefile.in

@@ -88,20 +88,21 @@ am__objects_2 = yals-module_call.$(OBJEXT) \
 	yals-module_web.$(OBJEXT)
 am__objects_3 = yals-ant.$(OBJEXT) yals-area.$(OBJEXT) \
 	yals-base64.$(OBJEXT) yals-bindmorecard.$(OBJEXT) \
-	yals-card_area.$(OBJEXT) yals-card_base.$(OBJEXT) \
-	yals-card_car.$(OBJEXT) yals-card.$(OBJEXT) \
-	yals-card_message_handle.$(OBJEXT) yals-cardMgr.$(OBJEXT) \
-	yals-card_path.$(OBJEXT) yals-card_person.$(OBJEXT) \
-	yals-crc.$(OBJEXT) yals-geo_hash.$(OBJEXT) \
-	yals-landmark.$(OBJEXT) yals-line_fit.$(OBJEXT) \
-	yals-loc_point.$(OBJEXT) yals-loc_tool.$(OBJEXT) \
-	yals-message.$(OBJEXT) yals-message_file.$(OBJEXT) \
-	yals-mine.$(OBJEXT) yals-net-service.$(OBJEXT) \
-	yals-point.$(OBJEXT) yals-select_tool.$(OBJEXT) \
-	yals-site_area.$(OBJEXT) yals-special_area.$(OBJEXT) \
-	yals-tdoa_sync.$(OBJEXT) yals-visit.$(OBJEXT) \
-	yals-web-client.$(OBJEXT) yals-worker.$(OBJEXT) \
-	yals-ya_event.$(OBJEXT) yals-znet.$(OBJEXT)
+	yals-card_tool.$(OBJEXT) yals-card_area.$(OBJEXT) \
+	yals-card_base.$(OBJEXT) yals-card_car.$(OBJEXT) \
+	yals-card.$(OBJEXT) yals-card_message_handle.$(OBJEXT) \
+	yals-cardMgr.$(OBJEXT) yals-card_path.$(OBJEXT) \
+	yals-card_person.$(OBJEXT) yals-crc.$(OBJEXT) \
+	yals-geo_hash.$(OBJEXT) yals-landmark.$(OBJEXT) \
+	yals-line_fit.$(OBJEXT) yals-loc_point.$(OBJEXT) \
+	yals-loc_tool.$(OBJEXT) yals-message.$(OBJEXT) \
+	yals-message_file.$(OBJEXT) yals-mine.$(OBJEXT) \
+	yals-net-service.$(OBJEXT) yals-point.$(OBJEXT) \
+	yals-select_tool.$(OBJEXT) yals-site_area.$(OBJEXT) \
+	yals-special_area.$(OBJEXT) yals-tdoa_sync.$(OBJEXT) \
+	yals-visit.$(OBJEXT) yals-web-client.$(OBJEXT) \
+	yals-worker.$(OBJEXT) yals-ya_event.$(OBJEXT) \
+	yals-znet.$(OBJEXT)
 am__objects_4 = $(am__objects_1) $(am__objects_2) $(am__objects_3)
 am_yals_OBJECTS = $(am__objects_4) yals-main.$(OBJEXT)
 yals_OBJECTS = $(am_yals_OBJECTS)
@@ -239,7 +240,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SRC_MONKEYCAR = monkey_car/monkeycar_area.cpp monkey_car/monkeycar_bus.cpp monkey_car/monkeycar_person.cpp
 SRC_MODULE_SERVICE = module_service/module_call.cpp module_service/module_meta_date_changed.cpp module_service/module_web.cpp
-SRC_MAIN = ant.cpp area.cpp base64.cpp bindmorecard.cpp card_area.cpp card_base.cpp card_car.cpp \
+SRC_MAIN = ant.cpp area.cpp base64.cpp bindmorecard.cpp card_tool.cpp card_area.cpp card_base.cpp card_car.cpp \
     	  card.cpp card_message_handle.cpp cardMgr.cpp card_path.cpp card_person.cpp crc.cpp geo_hash.cpp \
 		  landmark.cpp line_fit.cpp loc_point.cpp loc_tool.cpp message.cpp message_file.cpp mine.cpp \
 		  net-service.cpp point.cpp select_tool.cpp site_area.cpp special_area.cpp tdoa_sync.cpp visit.cpp \
@@ -379,6 +380,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yals-card_message_handle.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yals-card_path.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yals-card_person.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yals-card_tool.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yals-crc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yals-geo_hash.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yals-landmark.Po@am__quote@
@@ -631,6 +633,20 @@ yals-bindmorecard.obj: bindmorecard.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o yals-bindmorecard.obj `if test -f 'bindmorecard.cpp'; then $(CYGPATH_W) 'bindmorecard.cpp'; else $(CYGPATH_W) '$(srcdir)/bindmorecard.cpp'; fi`
 
+yals-card_tool.o: card_tool.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT yals-card_tool.o -MD -MP -MF $(DEPDIR)/yals-card_tool.Tpo -c -o yals-card_tool.o `test -f 'card_tool.cpp' || echo '$(srcdir)/'`card_tool.cpp
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/yals-card_tool.Tpo $(DEPDIR)/yals-card_tool.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='card_tool.cpp' object='yals-card_tool.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o yals-card_tool.o `test -f 'card_tool.cpp' || echo '$(srcdir)/'`card_tool.cpp
+
+yals-card_tool.obj: card_tool.cpp
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT yals-card_tool.obj -MD -MP -MF $(DEPDIR)/yals-card_tool.Tpo -c -o yals-card_tool.obj `if test -f 'card_tool.cpp'; then $(CYGPATH_W) 'card_tool.cpp'; else $(CYGPATH_W) '$(srcdir)/card_tool.cpp'; fi`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/yals-card_tool.Tpo $(DEPDIR)/yals-card_tool.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='card_tool.cpp' object='yals-card_tool.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o yals-card_tool.obj `if test -f 'card_tool.cpp'; then $(CYGPATH_W) 'card_tool.cpp'; else $(CYGPATH_W) '$(srcdir)/card_tool.cpp'; fi`
+
 yals-card_area.o: card_area.cpp
 @am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(yals_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT yals-card_area.o -MD -MP -MF $(DEPDIR)/yals-card_area.Tpo -c -o yals-card_area.o `test -f 'card_area.cpp' || echo '$(srcdir)/'`card_area.cpp
 @am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/yals-card_area.Tpo $(DEPDIR)/yals-card_area.Po

+ 4 - 16
card.cpp

@@ -111,7 +111,6 @@ void card_list::load_his_card_postion_from_db()
 {
     load_his_card_postion_vehicle();
     load_his_card_postion_staff();
-	run();
 
     for(auto&iter: m_map)
     {
@@ -390,24 +389,13 @@ void card_list::on_message(zloop<task*> *loop,const message_locinfo&loc,bool is_
 
 	c->on_message(loop,loc,is_history);
 }
-struct local_visit:visitor<std::shared_ptr<card_location_base>>
-{
-	bool visit(std::shared_ptr<card_location_base> c)
-	{
-		c->on_timer();
-		return true;	
-	}
-};
 
-void card_list::onTimer()
+bool card_list_visit::visit(std::shared_ptr<card_location_base> c)
 {
-	local_visit lv;
-	while(!m_bflag)
-	{
-		card_list::instance()->accept(lv);	
-		std::this_thread::sleep_for(std::chrono::seconds(1));
-	}
+	c->on_timer();
+	return true;	
 }
+
 template<> std::shared_ptr<card_list> 
 single_base<card_list, uint64_t, std::shared_ptr<card_location_base>>::m_instance=std::make_shared<card_list>();
 

+ 6 - 9
card.h

@@ -5,6 +5,11 @@
 #include "card_base.h"
 #include "write-copy.h"
 
+struct card_list_visit:visitor<std::shared_ptr<card_location_base>>
+{
+	bool visit(std::shared_ptr<card_location_base> c);
+};
+
 struct card_list:single_base<card_list,uint64_t,std::shared_ptr<card_location_base>>
 {
     ///id64=-1为初始化所有卡, id格式为:10000001016
@@ -17,14 +22,6 @@ struct card_list:single_base<card_list,uint64_t,std::shared_ptr<card_location_ba
     void load_his_card_postion_staff();
     void load_his_card_postion_from_db();
 
-	std::unique_ptr<std::thread> m_pThread;
-
-	bool m_bflag=false;
-	void run()
-	{
-		m_pThread.reset(new std::thread(std::bind(&card_list::onTimer,this)));
-	}
-	void onTimer();
-    ~card_list(){m_bflag=true;}
+    ~card_list(){}
 };
 #endif

+ 1 - 1
cardMgr.h

@@ -70,7 +70,6 @@ struct Msg
 class CardFactory;
 struct cardMgr
 {
-	cardMgr();
 	static cardMgr* instance();
 	void run();
 	void onMessage(const Msg &m);
@@ -100,6 +99,7 @@ struct cardMgr
 	}
 	~cardMgr();
 private:
+	cardMgr();
 	BoundedQueue<Msg>				m_queue;
 	bool							m_bstop;
 	geo_list						m_glist;

+ 4 - 3
card_person.cpp

@@ -1,7 +1,6 @@
 
 #include <string>
 #include <thread>
-
 #include "card_person.h"
 #include "loc_point.h"
 #include "card_message_handle.h"
@@ -14,6 +13,7 @@
 #include "monkey_car/monkeycar_person.h"
 #include "websocket/ws_common.h"
 #include "ya_event.h"
+#include "card_tool.h"
 person::person(const std::string &type,uint32_t cardid,uint16_t needdisplay,int16_t t,int32_t deptid,int32_t level_id,uint32_t cid,int wl,const std::string &sname,const std::string &dname)
 	:card_location_base(type,cardid,needdisplay,t,deptid,level_id,cid)
 	,m_workLine(wl)
@@ -43,7 +43,7 @@ void person::site_hover(int sid)
 	m_site_area->on_point(m_id,sid,nullptr, m_type);
 	IKSDK_DB(sid);
 }
-	//虹膜识别入库功能	
+//虹膜识别入库功能	
 void person::IKSDK_DB(int sid)
 {
 	auto sit_ptr = sit_list::instance()->get(sid);
@@ -117,7 +117,8 @@ void person::on_timer()
 	if(!m_mine_tool->is_attendance())
 		return;
 	YA::_CARD_POS_ cp;
-
+	if(m_display)
+	  card_tool::inst()->fetch_add();
 	uint64_t _time=0;
 	point pt = getSmoothPoint(_time);
 	const auto lm = m_area_tool->getLandmark();

+ 57 - 0
card_tool.cpp

@@ -0,0 +1,57 @@
+#include <cmath>
+#include "card_tool.h"
+#include "log.h"
+#include "db/db_tool.h"
+#include "sstream"
+
+card_tool::card_tool()
+	:m_staff_num(0)
+	,m_record_staffer_timeval(0)
+{}
+card_tool* card_tool::inst()
+{
+	static card_tool ct;
+	return &ct;
+}
+
+void card_tool::fetch_add()
+{
+	m_staff_num++;
+}
+void card_tool::reset()
+{
+	m_staff_num=0;
+}
+void card_tool::record_stffer_num()
+{
+	static uint32_t min_num=0,max_num=0;
+	std::time_t t = time(NULL);
+	char ti[64] = { 0 };
+	strftime(ti,sizeof(ti),"%Y/%m/%d %H:%M:%S",localtime(&t));
+	std::string sti(ti);
+	int minute = atoi(sti.substr(sti.find_first_of(':')+1,2).c_str());
+	if(m_record_staffer_timeval==0)
+	{
+		min_num=max_num=m_staff_num;
+		m_record_staffer_timeval = t;
+	}
+
+	if(t-m_record_staffer_timeval>=120 && minute%2 == 0)
+	{
+		std::stringstream ss;
+		ss<< "INSERT INTO his_staff_number(max_num,min_num,ave_num) VALUES("<<max_num<<','<<min_num<<','<<std::lround((max_num+min_num)/2)<<");";
+		logn_info(2,"staff_number:%s",ss.str().c_str());
+        db_tool::PushAsync(ss.str().c_str());
+
+		min_num=max_num=m_staff_num;
+		m_record_staffer_timeval = t;
+	}
+	else
+	{
+		if (min_num>m_staff_num)   min_num = m_staff_num;
+		if (max_num < m_staff_num) max_num = m_staff_num;
+	}
+	reset();
+	return;
+}
+

+ 17 - 0
card_tool.h

@@ -0,0 +1,17 @@
+#ifndef __CARD__TOOL__HPP__
+#define __CARD__TOOL__HPP__
+#include <atomic>
+#include <ctime>
+
+struct card_tool
+{
+	static card_tool *inst();
+	void record_stffer_num();
+	void fetch_add();
+private:
+	card_tool();
+	void reset();
+	std::atomic<uint32_t> m_staff_num;
+	std::time_t m_record_staffer_timeval;
+};
+#endif

+ 1 - 2
db/db_tool.cpp

@@ -11,7 +11,7 @@
 #include "../common_tool.h"
 namespace db_tool
 {
-    void PushAsync(char* sql)
+    void PushAsync(const char* sql)
     {
         if(!sDBConnPool.PushAsync(sql))
         {
@@ -61,4 +61,3 @@ namespace db_tool
     }
 }
 
-

+ 1 - 1
db/db_tool.h

@@ -5,7 +5,7 @@
 struct card_location_base;
 namespace db_tool
 {
-    void PushAsync(char* sql);
+    void PushAsync(const char* sql);
     void save_attendance(const std::shared_ptr<card_location_base>& card_ptr);
 }
 

BIN
db/libyadb.a


+ 3 - 3
message.cpp

@@ -18,7 +18,6 @@ void message_locinfo::load(zistream&is,bool tdoa)
 	m_card_type=b;
 	m_batty_status&=0xF;
 
-	//角度
 	is>>b;
 	if(m_card_type==1)
 	{
@@ -31,10 +30,11 @@ void message_locinfo::load(zistream&is,bool tdoa)
 
 	//加速度
 	is>>b;
-	if(m_card_type==4 || m_card_type==5)
+	if(m_card_type == 1 || m_card_type==4 || m_card_type==5)
 		m_acc=b;
 	else
-		m_acc=((b&0x80)?-1.:1.)*(b&0x7f)*98;
+		m_acc =b*0.01;
+		//m_acc=((b&0x80)?-1.:1.)*(b&0x7f)*98;
 
 	//TOF
 	is>>b>>i; 	

+ 0 - 3
mine.h

@@ -42,7 +42,4 @@ struct mine_tool
         return AS_ATTENDANCE == m_stat_attendance;
     }
 };
-
-
-
 #endif // MINE_H

+ 0 - 3
monkey_car/monkeycar_area.h

@@ -23,9 +23,6 @@ struct monkey_area : area,std::enable_shared_from_this<monkey_area>
 {
 public:
 	monkey_area(std::shared_ptr<db_area> dap,int area_id,int over_count_person,int over_time_person,double scale,int32_t ,int32_t);
-	//	:area(area_id,over_count_person,over_time_person)
-	//	,m_scale(scale)
-	//	{}
 	~monkey_area()
 	{}
 	std::shared_ptr<monkey_person> find(uint32_t cardid);

+ 5 - 0
net-service.cpp

@@ -15,6 +15,8 @@
 #include "tdoa_sync.h"
 #include "net-service.h"
 #include "ant.h"
+#include "card.h"
+#include "card_tool.h"
 net_service::net_service()
 {
 	m_loc_worker=worker::instance();
@@ -31,6 +33,9 @@ void net_service::on_timer()
 {
 	visit_site_status vss;
 	sit_list::instance()->accept(vss);
+	card_list_visit cls;
+	card_list::instance()->accept(cls);
+	card_tool::inst()->record_staffer_num();
 }
 void net_service::on_message(std::shared_ptr<client> clt,const char*data,size_t len)
 {

+ 1 - 1
znet.cpp

@@ -39,7 +39,7 @@ public:
 	{
 		m_thread_clts.reserve(2048);
 		m_timer.set<io_context,&io_context::on_timer>(this);
-		m_timer.start(20,2);
+		m_timer.start(20,1);
 	}
 
 	virtual ~io_context()