Переглянути джерело

Erste Qml-Implementation der Systeminformationen.

Rind 5 роки тому
батько
коміт
0664dadd97

+ 100 - 100
Test/Test.pro.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.11.1, 2020-03-17T16:28:46. -->
+<!-- Written by QtCreator 4.11.1, 2020-03-24T14:58:04. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
@@ -68,14 +68,14 @@
  <data>
   <variable>ProjectExplorer.Project.Target.0</variable>
   <valuemap type="QVariantMap">
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Sitara 1</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Sitara 1</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b0a415a1-ecbe-4123-8afc-05ffc0004131}</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.gcc_64_kit</value>
    <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">3</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Test/Debug/Sitara_1</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Test/Debug/Desktop_Qt_5_7_1_GCC_64bit</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>
@@ -123,7 +123,7 @@
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Test/Release/Sitara_1</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Test/Release/Desktop_Qt_5_7_1_GCC_64bit</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>
@@ -173,47 +173,13 @@
    <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">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.CheckForFreeDiskSpaceStep</value>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
-      <value type="QString" key="RemoteLinux.CheckForFreeDiskSpaceStep.PathToCheck">/</value>
-      <value type="qlonglong" key="RemoteLinux.CheckForFreeDiskSpaceStep.RequiredSpace">5242880</value>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.KillAppStep</value>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.DirectUploadStep</value>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
-      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.IgnoreMissingFiles">false</value>
-      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.Incremental">false</value>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">3</value>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
     </valuemap>
     <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToGenericLinux</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"/>
@@ -275,26 +241,21 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">app1 (auf Sitara 1)</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/Test/app1/app1.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/Test/app1/app1.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/Test/app1/app1.pro</value>
-    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
-    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
-    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
-    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
-    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
-    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/wrk/share/gfaipc/Test/Debug/Desktop_Qt_5_7_1_GCC_64bit/app1</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
     <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
@@ -354,26 +315,21 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">app2 (auf Sitara 1)</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/Test/app2/app2.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/Test/app2/app2.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/Test/app2/app2.pro</value>
-    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
-    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
-    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
-    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/wrk/share/gfaipc/Test/Debug/Desktop_Qt_5_7_1_GCC_64bit/app2</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.2">
     <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
@@ -433,26 +389,21 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">app3 (auf Sitara 1)</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/Test/app3/app3.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/Test/app3/app3.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/Test/app3/app3.pro</value>
-    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
-    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
-    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
-    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/wrk/share/gfaipc/Test/Debug/Desktop_Qt_5_7_1_GCC_64bit/app3</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.3">
     <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
@@ -512,26 +463,21 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">qmlApp (auf Sitara 1)</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/Test/qmlApp/qmlApp.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/Test/qmlApp/qmlApp.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/Test/qmlApp/qmlApp.pro</value>
-    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
-    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
-    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
-    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/wrk/share/gfaipc/Test/Debug/Desktop_Qt_5_7_1_GCC_64bit/qmlApp</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">4</value>
   </valuemap>
@@ -539,14 +485,14 @@
  <data>
   <variable>ProjectExplorer.Project.Target.1</variable>
   <valuemap type="QVariantMap">
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.gcc_64_kit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Sitara 1</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Sitara 1</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b0a415a1-ecbe-4123-8afc-05ffc0004131}</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">3</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Test/Debug/Desktop_Qt_5_7_1_GCC_64bit</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Test/Debug/Sitara_1</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>
@@ -594,7 +540,7 @@
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Test/Release/Desktop_Qt_5_7_1_GCC_64bit</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Test/Release/Sitara_1</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>
@@ -644,13 +590,47 @@
    <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>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.CheckForFreeDiskSpaceStep</value>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
+      <value type="QString" key="RemoteLinux.CheckForFreeDiskSpaceStep.PathToCheck">/</value>
+      <value type="qlonglong" key="RemoteLinux.CheckForFreeDiskSpaceStep.RequiredSpace">5242880</value>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.KillAppStep</value>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.DirectUploadStep</value>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
+      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.IgnoreMissingFiles">false</value>
+      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.Incremental">false</value>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">3</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
     </valuemap>
     <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToGenericLinux</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
@@ -712,21 +692,26 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/Test/app1/app1.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">app1 (auf Sitara 1)</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/Test/app1/app1.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/Test/app1/app1.pro</value>
+    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
-    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
+    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
     <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
+    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
     <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
@@ -786,21 +771,26 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/Test/app2/app2.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">app2 (auf Sitara 1)</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/Test/app2/app2.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/Test/app2/app2.pro</value>
+    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
     <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
+    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.2">
     <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
@@ -860,21 +850,26 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/Test/app3/app3.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">app3 (auf Sitara 1)</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/Test/app3/app3.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/Test/app3/app3.pro</value>
+    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
     <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
+    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.3">
     <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
@@ -934,21 +929,26 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/Test/qmlApp/qmlApp.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">qmlApp (auf Sitara 1)</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/Test/qmlApp/qmlApp.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/Test/qmlApp/qmlApp.pro</value>
+    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
     <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
+    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">4</value>
   </valuemap>

+ 4 - 4
Test/main.cpp

@@ -189,21 +189,21 @@ static void _ProcessSystemEvents(HAPPCTRL hAC, HAPPINFO hAI)
 		case GFA_APPCTRL_SYSEVENT_PART_EVT:
 			while((nIndex = ::GfaIpcAppCtrlGetNextPartitionRemoved(hAC, &part)) >= 0)
 			{
-				TRACE("Partition [ID=%zd:%d] removed: %s [%s]\n", part.nDiskIdx, nIndex, part.szDevNode, *part.szFsLabel ? part.szFsLabel : "Unnamed");
+				TRACE("Partition [ID=%d:%d] removed: %s [%s]\n", part.nDiskIdx, nIndex, part.szDevNode, *part.szFsLabel ? part.szFsLabel : "Unnamed");
 			}
 			while((nIndex = ::GfaIpcAppCtrlGetNextPartitionAdded(hAC, &part)) >= 0)
 			{
-				TRACE("Partition [ID=%zd:%d] added:   %s [%s]\n", part.nDiskIdx, nIndex, part.szDevNode, *part.szFsLabel ? part.szFsLabel : "Unnamed");
+				TRACE("Partition [ID=%d:%d] added:   %s [%s]\n", part.nDiskIdx, nIndex, part.szDevNode, *part.szFsLabel ? part.szFsLabel : "Unnamed");
 			}
 			break;
 		case GFA_APPCTRL_SYSEVENT_MOUNT_EVT:
 			while((nIndex = ::GfaIpcAppCtrlGetNextMountRemoved(hAC, &part)) >= 0)
 			{
-				TRACE("Mountpoint [ID=%zd:%d] removed: %s\n", part.nDiskIdx, nIndex, part.szDevNode);
+				TRACE("Partition [ID=%d:%d] unmounted: %s\n", part.nDiskIdx, nIndex, part.szDevNode);
 			}
 			while((nIndex = ::GfaIpcAppCtrlGetNextMountAdded(hAC, &part)) >= 0)
 			{
-				TRACE("Mountpoint [ID=%zd:%d] added:   %s -> %s\n", part.nDiskIdx, nIndex, part.szDevNode, part.szMntPoint);
+				TRACE("Partition [ID=%d:%d] mounted:   %s -> %s\n", part.nDiskIdx, nIndex, part.szDevNode, part.szMntPoint);
 			}
 			break;
 		}

+ 82 - 0
Test/qmlApp/dev.qml

@@ -0,0 +1,82 @@
+import QtQuick 2.7
+import QtQuick.Window 2.2
+import QtQuick.Controls 1.4
+import com.gfa.ipc.appctrl 1.0
+
+Window {
+    visible: true
+    title: qsTr("GfA Storage Device Map")
+    width: 800
+    height: 480
+
+	Component {
+		id: imageDelegate
+		Item {
+			Image {
+				anchors.centerIn: parent
+				fillMode: Image.PreserveAspectFit
+				height:20
+	            source: (styleData.value) === "usb" ? "qrc:/res/img/usb64.png" : ((styleData.value) === "ata" ? "qrc:/res/img/ata64.png" : "qrc:/res/img/mmc64.png")
+			}
+		}
+	}
+
+	TableView {
+		anchors.fill: parent
+
+		TableViewColumn {
+			role: "DiskBusType"
+			width: 32
+			delegate:imageDelegate
+		}
+
+		TableViewColumn {
+			width: 120
+			title: "Disk"
+			role: "DiskName"
+		}
+
+		TableViewColumn {
+			width: 80
+			title: "Volume"
+			role: "PartFsLabel"
+		}
+
+/*		TableViewColumn {
+			width: 60
+			title: "Type"
+			role: "DiskBusType"
+		}*/
+
+		TableViewColumn {
+			width: 80
+			title: "Size"
+			role: "PartSize"
+		}
+
+		TableViewColumn {
+			width: 80
+			title: "Used"
+			role: "PartFsUsed"
+		}
+
+		TableViewColumn {
+			width: 80
+			title: "Free"
+			role: "PartFsFree"
+		}
+
+		TableViewColumn {
+			width: 165
+			title: "Node"
+			role: "PartDevNode"
+		}
+
+		TableViewColumn {
+			title: "Mountpoint"
+			role: "PartMountPoint"
+		}
+
+		model: qGfaAppCtrl.sysInfo.stgDev
+	}
+}

+ 2 - 1
Test/qmlApp/main.cpp

@@ -14,7 +14,8 @@ int main(int argc, char *argv[])
     QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
     QGuiApplication app(argc, argv);
     QQmlApplicationEngine engine;
-    const QUrl url(QStringLiteral("qrc:/main.qml"));
+//    const QUrl url(QStringLiteral("qrc:/main.qml"));
+    const QUrl url(QStringLiteral("qrc:/dev.qml"));
 
     if(appCtrl.Create(_APP_ID, _APP_NAME, _UPDATE_TIMER_INT, _UPDATE_TIMER_INT_HEAVY_LOAD))
     {

+ 104 - 505
Test/qmlApp/qappctrl.cpp

@@ -13,483 +13,17 @@
 #define _TIMESPEC_DIFF_US(ts1, ts2)						(_TIMESPEC_2_US(ts1) - _TIMESPEC_2_US(ts2))
 #define _MIN_TIMER_INT									20
 
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-QGfaAppInfo::QGfaAppInfo(int nIndex, QObject *pParent) :	QObject(pParent),
-															m_state(GIAS_StateNotRunning),
-															m_nIndex(nIndex),
-															m_cycInt(0),
-															m_cycCur(0),
-															m_cycMin(0),
-															m_cycMax(0),
-															m_wktCur(0),
-															m_wktMin(0),
-															m_wktMax(0),
-															m_upTime(0),
-															m_cpuTime(0.0),
-															m_cpuPercCur(0.0),
-															m_cpuPercAvg(0.0),
-															m_vmPeak(0),
-															m_vmSize(0),
-															m_vmHWM(0),
-															m_vmRSS(0),
-															m_appSize(0)
-{
-	m_nAppID = 1ull << m_nIndex;
-	setStateText(m_state);
-}
-
-QGfaAppInfo::~QGfaAppInfo(void)
-{
-	this->disconnect();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-appid_t QGfaAppInfo::appId(void) const
-{
-	return m_nAppID;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-int QGfaAppInfo::state(void) const
-{
-	return m_state;
-}
-
-bool QGfaAppInfo::setState(int val)
-{
-	if(m_state != val)
-	{
-		m_state = val;
-		emit stateChanged(val);
-		setStateText(val);
-		return true;
-	}
-
-	return false;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-QString QGfaAppInfo::stateText(void) const
-{
-	return m_stateText;
-}
-
-void QGfaAppInfo::setStateText(int val)
-{
-	QString sval = ::GfaIpcAppCtrlGetStateText((GfaIpcAppStates)val);
-	if(m_stateText != sval)
-	{
-		m_stateText = sval;
-		emit stateTextChanged(sval);
-	}
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-QString QGfaAppInfo::name(void) const
-{
-	return m_name;
-}
-
-void QGfaAppInfo::setName(const QString &val)
-{
-	if(m_name != val)
-	{
-		m_name = val;
-		emit nameChanged(val);
-	}
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-quint64 QGfaAppInfo::cycInt(void) const
-{
-	return m_cycInt;
-}
-
-quint64 QGfaAppInfo::cycCur(void) const
-{
-	return m_cycCur;
-}
-
-quint64 QGfaAppInfo::cycMin(void) const
-{
-	return m_cycMin;
-}
-
-quint64 QGfaAppInfo::cycMax(void) const
-{
-	return m_cycMax;
-}
-
-
-quint64 QGfaAppInfo::wktCur(void) const
-{
-	return m_wktCur;
-}
-
-quint64 QGfaAppInfo::wktMin(void) const
-{
-	return m_wktMin;
-}
-
-quint64 QGfaAppInfo::wktMax(void) const
-{
-	return m_wktMax;
-}
-
-
-quint64 QGfaAppInfo::upTime(void) const
-{
-	return m_upTime;
-}
-
-double QGfaAppInfo::cpuTime(void) const
-{
-	return m_cpuTime;
-}
-
-double QGfaAppInfo::cpuCur(void) const
-{
-	return m_cpuPercCur;
-}
-
-double QGfaAppInfo::cpuAvg(void) const
-{
-	return m_cpuPercAvg;
-}
-
-quint32 QGfaAppInfo::vmPeak(void) const
-{
-	return m_vmPeak;
-}
-
-quint32 QGfaAppInfo::vmSize(void) const
-{
-	return m_vmSize;
-}
-
-quint32 QGfaAppInfo::vmHWM(void) const
-{
-	return m_vmHWM;
-}
-
-quint32 QGfaAppInfo::vmRSS(void) const
-{
-	return m_vmRSS;
-}
-
-quint32 QGfaAppInfo::appSize(void) const
-{
-	return m_appSize;
-}
-
-void QGfaAppInfo::setAppSize(quint32 size, GfaIpcAppStates state)
-{
-	if((state > GIAS_StateNotRunning) && (state < GIAS_Invalid))
-	{
-		if(m_appSize != size)
-		{
-			m_appSize = size;
-			emit appSizeChanged(m_appSize);
-		}
-	}
-	else
-	{
-		if(m_appSize != 0)
-		{
-			m_appSize = 0;
-			emit appSizeChanged(m_appSize);
-		}
-	}
-}
-
-void QGfaAppInfo::setAppMemInfo(LPCGFA_APPCTRL_APPMEM pam, GfaIpcAppStates state, bool bDoHeavyLoadUpdate)
-{
-	UNUSED(state);
-	
-	if(pam)
-	{
-		if(bDoHeavyLoadUpdate)
-		{
-			if(m_vmPeak != pam->vmPeak)
-			{
-				m_vmPeak = pam->vmPeak;
-				emit vmPeakChanged(m_vmPeak);
-			}
-
-			if(m_vmSize != pam->vmSize)
-			{
-				m_vmSize = pam->vmSize;
-				emit vmSizeChanged(m_vmSize);
-			}
-
-			if(m_vmHWM != pam->vmHWM)
-			{
-				m_vmHWM = pam->vmHWM;
-				emit vmHWMChanged(m_vmHWM);
-			}
-
-			if(m_vmRSS != pam->vmRSS)
-			{
-				m_vmRSS = pam->vmRSS;
-				emit vmRSSChanged(m_vmRSS);
-			}
-		}
-	}
-	else if(state != GIAS_Hanging)
-	{
-		if(m_vmPeak != 0)
-		{
-			m_vmPeak = 0;
-			emit vmPeakChanged(m_vmPeak);
-		}
-
-		if(m_vmSize != 0)
-		{
-			m_vmSize = 0;
-			emit vmSizeChanged(m_vmSize);
-		}
-
-		if(m_vmHWM != 0)
-		{
-			m_vmHWM = 0;
-			emit vmHWMChanged(m_vmHWM);
-		}
-
-		if(m_vmRSS != 0)
-		{
-			m_vmRSS = 0;
-			emit vmRSSChanged(m_vmRSS);
-		}
-	}
-}
-
-void QGfaAppInfo::setAppTimes(LPCGFA_APPCTRL_APPTIMES pat, GfaIpcAppStates state, bool bDoHeavyLoadUpdate)
-{
-	if(pat)
-	{
-		if(m_cycInt != (quint64)pat->nCyclePresetUs)
-		{
-			m_cycInt = (quint64)pat->nCyclePresetUs;
-			emit cycIntChanged(m_cycInt);
-		}
-
-		if(state == GIAS_Running)
-		{
-			if(m_cycMin != (quint64)pat->nCycleMinUs)
-			{
-				m_cycMin = (quint64)pat->nCycleMinUs;
-				emit cycMinChanged(m_cycMin);
-			}
-
-			if(m_cycMax != (quint64)pat->nCycleMaxUs)
-			{
-				m_cycMax = (quint64)pat->nCycleMaxUs;
-				emit cycMaxChanged(m_cycMax);
-			}
-
-			if(m_wktMin != (quint64)pat->nWorkMinUs)
-			{
-				m_wktMin = (quint64)pat->nWorkMinUs;
-				emit wktMinChanged(m_wktMin);
-			}
-
-			if(m_wktMax != (quint64)pat->nWorkMaxUs)
-			{
-				m_wktMax = (quint64)pat->nWorkMaxUs;
-				emit wktMaxChanged(m_wktMax);
-			}
-		}
-		else
-		{
-			if(m_cycCur != 0)
-			{
-				m_cycCur = 0;
-				emit cycCurChanged(m_cycCur);
-			}
-
-			if(m_wktCur != 0)
-			{
-				m_wktCur = 0;
-				emit wktCurChanged(m_wktCur);
-			}
-		}
-
-		if(bDoHeavyLoadUpdate)
-		{
-			quint64 upTime = time(NULL) - pat->nTsStart;
-			
-			if(m_upTime != upTime)
-			{
-				m_upTime = upTime;
-				emit upTimeChanged(m_upTime);
-			}
-
-			if(state == GIAS_Running)
-			{
-				if(m_cycCur != (quint64)pat->nCycleLastUs)
-				{
-					m_cycCur = (quint64)pat->nCycleLastUs;
-					emit cycCurChanged(m_cycCur);
-				}
-
-				if(m_wktCur != (quint64)pat->nWorkLastUs)
-				{
-					m_wktCur = (quint64)pat->nWorkLastUs;
-					emit wktCurChanged(m_wktCur);
-				}
-			}
-			
-			if(state != GIAS_Hanging)
-			{
-				if(m_cpuTime != pat->fCpuTime)
-				{
-					m_cpuTime = pat->fCpuTime;
-					emit cpuTimeChanged(m_cpuTime);
-				}
-				
-				if(m_cpuPercCur != pat->fCpuCur)
-				{
-					m_cpuPercCur = pat->fCpuCur;
-					emit cpuCurChanged(m_cpuPercCur);
-				}
-				
-				if(m_cpuPercAvg != pat->fCpuAvg)
-				{
-					m_cpuPercAvg = pat->fCpuAvg;
-					emit cpuAvgChanged(m_cpuPercAvg);
-				}
-			}
-		}
-	}
-	else
-	{
-		if(m_cycInt != 0)
-		{
-			m_cycInt = 0;
-			emit cycIntChanged(m_cycInt);
-		}
-
-		if(m_cycCur != 0)
-		{
-			m_cycCur = 0;
-			emit cycCurChanged(m_cycCur);
-		}
-
-		if(m_wktCur != 0)
-		{
-			m_wktCur = 0;
-			emit wktCurChanged(m_wktCur);
-		}
-
-		if(state == GIAS_Hanging)
-		{
-			if(m_cpuTime != -1)
-			{
-				m_cpuTime = -1;
-				emit cpuTimeChanged(m_cpuTime);
-			}
-			
-			if(m_cpuPercCur != -1)
-			{
-				m_cpuPercCur = -1;
-				emit cpuCurChanged(m_cpuPercCur);
-			}
-			
-			if(m_cpuPercAvg != -1)
-			{
-				m_cpuPercAvg = -1;
-				emit cpuAvgChanged(m_cpuPercAvg);
-			}
-		}
-		else
-		{
-			if(m_cycMin != 0)
-			{
-				m_cycMin = 0;
-				emit cycMinChanged(m_cycMin);
-			}
-
-			if(m_cycMax != 0)
-			{
-				m_cycMax = 0;
-				emit cycMaxChanged(m_cycMax);
-			}
-
-			if(m_wktMin != 0)
-			{
-				m_wktMin = 0;
-				emit wktMinChanged(m_wktMin);
-			}
-
-			if(m_wktMax != 0)
-			{
-				m_wktMax = 0;
-				emit wktMaxChanged(m_wktMax);
-			}
-
-			if(m_upTime != 0)
-			{
-				m_upTime = 0;
-				emit upTimeChanged(m_upTime);
-			}
-				
-			if(m_cpuTime != 0)
-			{
-				m_cpuTime = 0;
-				emit cpuTimeChanged(m_cpuTime);
-			}
-			
-			if(m_cpuPercCur != 0)
-			{
-				m_cpuPercCur = 0;
-				emit cpuCurChanged(m_cpuPercCur);
-			}
-			
-			if(m_cpuPercAvg != 0)
-			{
-				m_cpuPercAvg = 0;
-				emit cpuAvgChanged(m_cpuPercAvg);
-			}
-		}
-	}
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-bool QGfaAppInfo::pause(void)
-{
-	emit sendControlMessage(m_nAppID, GFA_APPCTRL_CTRLMSG_PAUSE);
-	return true;
-}
-
-bool QGfaAppInfo::resume(void)
-{
-	emit sendControlMessage(m_nAppID, GFA_APPCTRL_CTRLMSG_RESUME);
-	return true;
-}
-
-bool QGfaAppInfo::stop(void)
-{
-	emit sendControlMessage(m_nAppID, GFA_APPCTRL_CTRLMSG_STOP);
-	return true;
-}
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
 QGfaAppCtrl::QGfaAppCtrl(QObject *pParent) :	QObject(pParent),
+												m_bSysInfoRunning(false),
 												m_hAC(NULL),
 												m_nAppID(0),
 												m_nTimerID(0),
+												m_sysInfo(this),
 												m_curPass(0),
 												m_minPass(LLONG_MAX),
 												m_maxPass(LLONG_MIN),
@@ -505,6 +39,7 @@ QGfaAppCtrl::QGfaAppCtrl(QObject *pParent) :	QObject(pParent),
 	}
 
 	memset(&m_tsLastHeavyLoadUpdate, 0, sizeof(m_tsLastHeavyLoadUpdate));
+    setObjectName("QGfaAppCtrl");
 }
 
 QGfaAppCtrl::~QGfaAppCtrl(void)
@@ -532,6 +67,7 @@ bool QGfaAppCtrl::Create(appid_t nAppID, const char *pszDisplayName, int nTimerI
 		{
 			m_nAppID = nAppID;
 			m_nHeavyLoadUpdateIntervalUs = nHeavyLoadUpdateIntervalMs * 1000;
+			::GfaIpcAppCtrlSubscribeSysEvents(m_hAC, GFA_APPCTRL_SYSEVENT_ALL_STG_DEV);
 			m_nTimerID = startTimer(nTimerIntMs, Qt::CoarseTimer);
 		}
 	}
@@ -555,6 +91,8 @@ void QGfaAppCtrl::Release(void)
 
 void QGfaAppCtrl::RegisterQmlTypes(QQmlEngine &rEng, int nVerMajor, int nVerMinor)
 {
+	qmlRegisterUncreatableType<QGfaStgDevList>("com.gfa.ipc.appctrl", nVerMajor, nVerMinor, "QGfaStgDevList", QStringLiteral("class not creatable in QML"));
+	qmlRegisterUncreatableType<QGfaSysInfo>("com.gfa.ipc.appctrl", nVerMajor, nVerMinor, "QGfaSysInfo", QStringLiteral("class not creatable in QML"));
 	qmlRegisterUncreatableType<QGfaAppInfo>("com.gfa.ipc.appctrl", nVerMajor, nVerMinor, "QGfaAppInfo", QStringLiteral("class not creatable in QML"));
 	qmlRegisterUncreatableType<QGfaAppCtrl>("com.gfa.ipc.appctrl", nVerMajor, nVerMinor, "QGfaAppCtrl", QStringLiteral("class not creatable in QML"));
 	rEng.rootContext()->setContextProperty(QStringLiteral("qGfaAppCtrl"), this);
@@ -586,20 +124,24 @@ bool QGfaAppCtrl::SubscribeStateEvents(appid_t nAppMask)
 
 void QGfaAppCtrl::timerEvent(QTimerEvent *event)
 {
-	static clock64_t nCurPass = 0;
-	struct timespec	tsEnterUpdate, tsLeaveUpdate;
-	::clock_gettime(CLOCK_MONOTONIC, &tsEnterUpdate);
-
 	if((event->timerId() == m_nTimerID) && m_hAC)
 	{
+		static clock64_t nCurPass = 0;
+		struct timespec	tsEnterUpdate, tsLeaveUpdate;
+		::clock_gettime(CLOCK_MONOTONIC, &tsEnterUpdate);
+		GFA_APPCTRL_SYSMEM sm;
 		HAPPINFO hAI;
+		bool bDoHeavyLoadUpdate = (_TIMESPEC_DIFF_US(tsEnterUpdate, m_tsLastHeavyLoadUpdate) >= m_nHeavyLoadUpdateIntervalUs);
 
 		if((hAI = ::GfaIpcAppCtrlInfoUpdate(m_hAC, nCurPass)))
 		{
 			int b;
 		    appid_t app, nAppIdSrc;
+		    sysevt_t nSysEvt;
 			GFA_APPCTRL_APPTIMES at;
 			GFA_APPCTRL_APPMEM am;
+			GFA_SYSINFO_DISK disk;
+			GFA_SYSINFO_PARTITION part;
 			char szDispName[128];
 
 			while((nAppIdSrc = ::GfaIpcAppCtrlGetNextStateEvtSrc(hAI)))
@@ -618,6 +160,12 @@ void QGfaAppCtrl::timerEvent(QTimerEvent *event)
 						ai.setAppTimes(NULL, state);
 						ai.setAppMemInfo(NULL, state);
 					}
+					
+					if(nAppIdSrc == GFA_APPCTRL_APPID_SYSINFO)
+					{
+						m_bSysInfoRunning = (state == GIAS_Running);
+						m_sysInfo.setSysInfoRunning(m_bSysInfoRunning);
+					}
 				}
 
 				if((state >= GIAS_StateNotRunning) && (state <= GIAS_Paused))
@@ -628,9 +176,51 @@ void QGfaAppCtrl::timerEvent(QTimerEvent *event)
 					}
 				}
 			}
+			
+			if(m_bSysInfoRunning)
+			{
+				while((nSysEvt = ::GfaIpcAppCtrlGetNextSysEvt(hAI)))
+				{
+					int nIndex;
+					
+					switch(nSysEvt)
+					{
+					case GFA_APPCTRL_SYSEVENT_DISK_EVT:
+						while((nIndex = ::GfaIpcAppCtrlGetNextDiskRemoved(m_hAC, &disk)) >= 0)
+						{
+							m_sysInfo.diskRemoved(nIndex, disk);
+						}
+						while((nIndex = ::GfaIpcAppCtrlGetNextDiskAdded(m_hAC, &disk)) >= 0)
+						{
+							m_sysInfo.diskAdded(nIndex, disk);
+						}
+						break;
+					case GFA_APPCTRL_SYSEVENT_PART_EVT:
+						while((nIndex = ::GfaIpcAppCtrlGetNextPartitionRemoved(m_hAC, &part)) >= 0)
+						{
+							m_sysInfo.partitionRemoved(nIndex, part);
+						}
+						while((nIndex = ::GfaIpcAppCtrlGetNextPartitionAdded(m_hAC, &part)) >= 0)
+						{
+							m_sysInfo.partitionAdded(nIndex, part);
+						}
+						break;
+					case GFA_APPCTRL_SYSEVENT_MOUNT_EVT:
+						while((nIndex = ::GfaIpcAppCtrlGetNextMountRemoved(m_hAC, &part)) >= 0)
+						{
+							m_sysInfo.mountRemoved(nIndex, part);
+						}
+						while((nIndex = ::GfaIpcAppCtrlGetNextMountAdded(m_hAC, &part)) >= 0)
+						{
+							m_sysInfo.mountAdded(nIndex, part);
+						}
+						break;
+					}
+				}
+			}
 
 			nAppIdSrc = m_nEvtSrcs;
-			bool bDontSaveLast = false, bUpdate = (_TIMESPEC_DIFF_US(tsEnterUpdate, m_tsLastHeavyLoadUpdate) >= m_nHeavyLoadUpdateIntervalUs);
+			bool bDontSaveLast = false;
 
 			while(nAppIdSrc)
 			{
@@ -642,7 +232,7 @@ void QGfaAppCtrl::timerEvent(QTimerEvent *event)
 
 				if(::GfaIpcAppCtrlGetAppMem(m_hAC, app, &am))
 				{
-					ai.setAppMemInfo(&am, state, bUpdate);
+					ai.setAppMemInfo(&am, state, bDoHeavyLoadUpdate);
 				}
 
 				if(::GfaIpcAppCtrlGetAppTimes(m_hAC, app, &at) >= 0)
@@ -653,49 +243,53 @@ void QGfaAppCtrl::timerEvent(QTimerEvent *event)
 						continue;
 					}
 
-					ai.setAppTimes(&at, state, bUpdate);
+					ai.setAppTimes(&at, state, bDoHeavyLoadUpdate);
 				}
 
 				size_t nSize = ::GfaIpcAppCtrlGetAppSize(m_hAC, app);
 				ai.setAppSize((quint32)nSize, state);
 			}
 
-			if(bUpdate && !bDontSaveLast)
+			if(bDoHeavyLoadUpdate && !bDontSaveLast)
 				m_tsLastHeavyLoadUpdate = tsEnterUpdate;
 		}
-	}
+			
+		if(::GfaIpcAppCtrlGetSysMem(m_hAC, &sm))
+		{
+			m_sysInfo.setSysMemInfo(&sm, bDoHeavyLoadUpdate);
+		}
 
-	::clock_gettime(CLOCK_MONOTONIC, &tsLeaveUpdate);
-	m_curPass = nCurPass = _TIMESPEC_DIFF_US(tsLeaveUpdate, tsEnterUpdate);
+		::clock_gettime(CLOCK_MONOTONIC, &tsLeaveUpdate);
+		m_curPass = nCurPass = _TIMESPEC_DIFF_US(tsLeaveUpdate, tsEnterUpdate);
 
-	if(m_minPass > m_curPass)
-	{
-		m_minPass = m_curPass;
-		emit minPassChanged(m_minPass);
-	}
+		if(m_minPass > m_curPass)
+		{
+			m_minPass = m_curPass;
+			emit minPassChanged(m_minPass);
+		}
 
-	if(m_maxPass < m_curPass)
-	{
-		m_maxPass = m_curPass;
-		emit maxPassChanged(m_maxPass);
-	}
-	
-	if(!m_avgPass)
-	{
-		m_avgPass = m_curPass;
-		emit avgPassChanged(m_avgPass);
-	}
-	else
-	{
-		static uint64_t nPasses = 0;
-		++nPasses;
-		clock64_t avgPass = (m_avgPass + m_curPass) / 2;
-//		clock64_t avgPass = (clock64_t)sqrt(double((m_avgPass * m_avgPass + m_curPass * m_curPass) / 2));
-		if(m_avgPass != avgPass)
+		if(m_maxPass < m_curPass)
+		{
+			m_maxPass = m_curPass;
+			emit maxPassChanged(m_maxPass);
+		}
+		
+		if(!m_avgPass)
 		{
-			m_avgPass = avgPass;
-			if(!(nPasses % 50))
-				emit avgPassChanged(m_avgPass);
+			m_avgPass = m_curPass;
+			emit avgPassChanged(m_avgPass);
+		}
+		else
+		{
+			static uint64_t nPasses = 0;
+			++nPasses;
+			clock64_t avgPass = (m_avgPass + m_curPass) / 2;
+			if(m_avgPass != avgPass)
+			{
+				m_avgPass = avgPass;
+				if(!(nPasses % 50))
+					emit avgPassChanged(m_avgPass);
+			}
 		}
 	}
 }
@@ -734,6 +328,11 @@ quint64 QGfaAppCtrl::avgPass(void) const
 	return m_avgPass;
 }
 
+QGfaSysInfo* QGfaAppCtrl::sysInfo(void)
+{
+	return &m_sysInfo;
+}
+
 /////////////////////////////////////////////////////////////////////////////
 
 int QGfaAppCtrl::appIndexFromAppID(quint64 nAppID)

+ 120 - 0
Test/qmlApp/qappctrl.h

@@ -7,13 +7,129 @@
 #include <QObject>
 #include <QQmlEngine>
 #include <QQmlContext>
+#include <QAbstractTableModel>
+#include <vector>
 #include <gfa/gfaipc.h>
+#include "../../src/ipcpriv.h"
 
 #ifdef __cplusplus
 
 /////////////////////////////////////////////////////////////////////////////
 // qappctrl.h - Declarations:
 
+typedef struct _STG_DEV_DISK_PART
+{
+	_STG_DEV_DISK_PART(int d, int p) {
+		nDiskIdx = d;
+		nPartIdx = p;
+	}
+	int nDiskIdx;
+	int nPartIdx;
+}STG_DEV_DISK_PART, *LPSTG_DEV_DISK_PART;
+typedef const STG_DEV_DISK_PART *LPCSTG_DEV_DISK_PART;
+
+/////////////////////////////////////////////////////////////////////////////
+
+class QGfaStgDevList : public QAbstractTableModel
+{
+    Q_OBJECT
+
+public:
+	explicit QGfaStgDevList(QObject *pParent = NULL);
+	virtual ~QGfaStgDevList(void);
+
+	int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+	int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+	QHash<int, QByteArray> roleNames(void) const Q_DECL_OVERRIDE;
+	
+	void diskAdded(int nIndex, const GFA_SYSINFO_DISK &disk);
+	void diskRemoved(int nIndex, const GFA_SYSINFO_DISK &disk);
+	void partitionAdded(int nIndex, const GFA_SYSINFO_PARTITION &part);
+	void partitionRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part);
+	void mountAdded(int nIndex, const GFA_SYSINFO_PARTITION &part);
+	void mountRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part);
+	void clearAll(void);
+
+private:
+	void insertPartition(int nDiskIdx, int nPartIdx);
+	void removePartition(int nDiskIdx, int nPartIdx);
+	int FindPartVecEntry(int nDiskIdx, int nPartIdx);
+
+private:
+	GFA_SYSINFO_STORAGE_DEVICE_MAP m_stgDevShadowCpy;
+	std::vector<STG_DEV_DISK_PART> m_partVec;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+class QGfaSysInfo : public QObject
+{
+    Q_OBJECT
+	Q_PROPERTY(quint64 memTotal READ memTotal NOTIFY memTotalChanged)
+	Q_PROPERTY(quint64 memUsed READ memUsed NOTIFY memUsedChanged)
+	Q_PROPERTY(quint64 memFree READ memFree NOTIFY memFreeChanged)
+	Q_PROPERTY(quint64 memAvailable READ memAvailable NOTIFY memAvailableChanged)
+	Q_PROPERTY(quint64 memBuffers READ memBuffers NOTIFY memBuffersChanged)
+	Q_PROPERTY(quint64 memCached READ memCached NOTIFY memCachedChanged)
+    Q_PROPERTY(QGfaStgDevList *stgDev READ stgDev CONSTANT)
+
+public:
+	explicit QGfaSysInfo(QObject *pParent = NULL);
+	virtual ~QGfaSysInfo(void);
+
+signals:
+	void memTotalChanged(quint64 val);
+	void memUsedChanged(quint64 val);
+	void memFreeChanged(quint64 val);
+	void memAvailableChanged(quint64 val);
+	void memBuffersChanged(quint64 val);
+	void memCachedChanged(quint64 val);
+
+private:
+	quint64 memTotal(void) const;
+	quint64 memUsed(void) const;
+	quint64 memFree(void) const;
+	quint64 memAvailable(void) const;
+	quint64 memBuffers(void) const;
+	quint64 memCached(void) const;
+	QGfaStgDevList* stgDev(void);
+
+public:
+	void setSysMemInfo(LPCGFA_APPCTRL_SYSMEM psm, bool bDoHeavyLoadUpdate = false);
+	void setSysInfoRunning(bool bRunning);
+
+	inline void diskAdded(int nIndex, const GFA_SYSINFO_DISK &disk) {
+		return m_stgDevList.diskAdded(nIndex, disk);}
+
+	inline void diskRemoved(int nIndex, const GFA_SYSINFO_DISK &disk) {
+		return m_stgDevList.diskRemoved(nIndex, disk);}
+
+	inline void partitionAdded(int nIndex, const GFA_SYSINFO_PARTITION &part) {
+		return m_stgDevList.partitionAdded(nIndex, part);}
+		
+	inline void partitionRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part) {
+		return m_stgDevList.partitionRemoved(nIndex, part);}
+
+	inline void mountAdded(int nIndex, const GFA_SYSINFO_PARTITION &part) {
+		return m_stgDevList.mountAdded(nIndex, part);}
+
+	inline void mountRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part) {
+		return m_stgDevList.mountRemoved(nIndex, part);}
+
+private:
+	bool m_bSysInfoRunning;
+	quint64 m_nMemTotal;
+	quint64 m_nMemUsed;
+	quint64 m_nMemFree;
+	quint64 m_nMemAvailable;
+	quint64 m_nMemBuffers;
+	quint64 m_nMemCached;
+	QGfaStgDevList m_stgDevList;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
 class QGfaAppInfo : public QObject
 {
     Q_OBJECT
@@ -136,6 +252,7 @@ class QGfaAppCtrl : public QObject
 	Q_PROPERTY(quint64 minPass READ minPass NOTIFY minPassChanged)
 	Q_PROPERTY(quint64 maxPass READ maxPass NOTIFY maxPassChanged)
 	Q_PROPERTY(quint64 avgPass READ avgPass NOTIFY avgPassChanged)
+    Q_PROPERTY(QGfaSysInfo *sysInfo READ sysInfo CONSTANT)
 
 public:
 	enum AppStates
@@ -185,15 +302,18 @@ public:
 	quint64 minPass(void) const;
 	quint64 maxPass(void) const;
 	quint64 avgPass(void) const;
+	QGfaSysInfo* sysInfo(void);
 
 private slots:
 	void onSendControlMessage(appid_t nAppID, ctrlmsg_t msg);
 	void timerEvent(QTimerEvent *event) override;
 
 private:
+	bool m_bSysInfoRunning;
 	HAPPCTRL m_hAC;
 	appid_t m_nAppID;
 	int m_nTimerID;
+	QGfaSysInfo m_sysInfo;
 	QList<QGfaAppInfo*> m_appInfo;
 	clock64_t m_curPass;
 	clock64_t m_minPass;

+ 472 - 0
Test/qmlApp/qappinfo.cpp

@@ -0,0 +1,472 @@
+#include "qappctrl.h"
+#include "../../src/defines.h"
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+QGfaAppInfo::QGfaAppInfo(int nIndex, QObject *pParent) :	QObject(pParent),
+															m_state(GIAS_StateNotRunning),
+															m_nIndex(nIndex),
+															m_cycInt(0),
+															m_cycCur(0),
+															m_cycMin(0),
+															m_cycMax(0),
+															m_wktCur(0),
+															m_wktMin(0),
+															m_wktMax(0),
+															m_upTime(0),
+															m_cpuTime(0.0),
+															m_cpuPercCur(0.0),
+															m_cpuPercAvg(0.0),
+															m_vmPeak(0),
+															m_vmSize(0),
+															m_vmHWM(0),
+															m_vmRSS(0),
+															m_appSize(0)
+{
+	m_nAppID = 1ull << m_nIndex;
+	setStateText(m_state);
+    setObjectName("QGfaAppInfo");
+}
+
+QGfaAppInfo::~QGfaAppInfo(void)
+{
+	this->disconnect();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+appid_t QGfaAppInfo::appId(void) const
+{
+	return m_nAppID;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+int QGfaAppInfo::state(void) const
+{
+	return m_state;
+}
+
+bool QGfaAppInfo::setState(int val)
+{
+	if(m_state != val)
+	{
+		m_state = val;
+		emit stateChanged(val);
+		setStateText(val);
+		return true;
+	}
+
+	return false;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+QString QGfaAppInfo::stateText(void) const
+{
+	return m_stateText;
+}
+
+void QGfaAppInfo::setStateText(int val)
+{
+	QString sval = ::GfaIpcAppCtrlGetStateText((GfaIpcAppStates)val);
+	if(m_stateText != sval)
+	{
+		m_stateText = sval;
+		emit stateTextChanged(sval);
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+QString QGfaAppInfo::name(void) const
+{
+	return m_name;
+}
+
+void QGfaAppInfo::setName(const QString &val)
+{
+	if(m_name != val)
+	{
+		m_name = val;
+		emit nameChanged(val);
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+quint64 QGfaAppInfo::cycInt(void) const
+{
+	return m_cycInt;
+}
+
+quint64 QGfaAppInfo::cycCur(void) const
+{
+	return m_cycCur;
+}
+
+quint64 QGfaAppInfo::cycMin(void) const
+{
+	return m_cycMin;
+}
+
+quint64 QGfaAppInfo::cycMax(void) const
+{
+	return m_cycMax;
+}
+
+
+quint64 QGfaAppInfo::wktCur(void) const
+{
+	return m_wktCur;
+}
+
+quint64 QGfaAppInfo::wktMin(void) const
+{
+	return m_wktMin;
+}
+
+quint64 QGfaAppInfo::wktMax(void) const
+{
+	return m_wktMax;
+}
+
+
+quint64 QGfaAppInfo::upTime(void) const
+{
+	return m_upTime;
+}
+
+double QGfaAppInfo::cpuTime(void) const
+{
+	return m_cpuTime;
+}
+
+double QGfaAppInfo::cpuCur(void) const
+{
+	return m_cpuPercCur;
+}
+
+double QGfaAppInfo::cpuAvg(void) const
+{
+	return m_cpuPercAvg;
+}
+
+quint32 QGfaAppInfo::vmPeak(void) const
+{
+	return m_vmPeak;
+}
+
+quint32 QGfaAppInfo::vmSize(void) const
+{
+	return m_vmSize;
+}
+
+quint32 QGfaAppInfo::vmHWM(void) const
+{
+	return m_vmHWM;
+}
+
+quint32 QGfaAppInfo::vmRSS(void) const
+{
+	return m_vmRSS;
+}
+
+quint32 QGfaAppInfo::appSize(void) const
+{
+	return m_appSize;
+}
+
+void QGfaAppInfo::setAppSize(quint32 size, GfaIpcAppStates state)
+{
+	if((state > GIAS_StateNotRunning) && (state < GIAS_Invalid))
+	{
+		if(m_appSize != size)
+		{
+			m_appSize = size;
+			emit appSizeChanged(m_appSize);
+		}
+	}
+	else
+	{
+		if(m_appSize != 0)
+		{
+			m_appSize = 0;
+			emit appSizeChanged(m_appSize);
+		}
+	}
+}
+
+void QGfaAppInfo::setAppMemInfo(LPCGFA_APPCTRL_APPMEM pam, GfaIpcAppStates state, bool bDoHeavyLoadUpdate)
+{
+	UNUSED(state);
+	
+	if(pam)
+	{
+		if(bDoHeavyLoadUpdate)
+		{
+			if(m_vmPeak != pam->vmPeak)
+			{
+				m_vmPeak = pam->vmPeak;
+				emit vmPeakChanged(m_vmPeak);
+			}
+
+			if(m_vmSize != pam->vmSize)
+			{
+				m_vmSize = pam->vmSize;
+				emit vmSizeChanged(m_vmSize);
+			}
+
+			if(m_vmHWM != pam->vmHWM)
+			{
+				m_vmHWM = pam->vmHWM;
+				emit vmHWMChanged(m_vmHWM);
+			}
+
+			if(m_vmRSS != pam->vmRSS)
+			{
+				m_vmRSS = pam->vmRSS;
+				emit vmRSSChanged(m_vmRSS);
+			}
+		}
+	}
+	else if(state != GIAS_Hanging)
+	{
+		if(m_vmPeak != 0)
+		{
+			m_vmPeak = 0;
+			emit vmPeakChanged(m_vmPeak);
+		}
+
+		if(m_vmSize != 0)
+		{
+			m_vmSize = 0;
+			emit vmSizeChanged(m_vmSize);
+		}
+
+		if(m_vmHWM != 0)
+		{
+			m_vmHWM = 0;
+			emit vmHWMChanged(m_vmHWM);
+		}
+
+		if(m_vmRSS != 0)
+		{
+			m_vmRSS = 0;
+			emit vmRSSChanged(m_vmRSS);
+		}
+	}
+}
+
+void QGfaAppInfo::setAppTimes(LPCGFA_APPCTRL_APPTIMES pat, GfaIpcAppStates state, bool bDoHeavyLoadUpdate)
+{
+	if(pat)
+	{
+		if(m_cycInt != (quint64)pat->nCyclePresetUs)
+		{
+			m_cycInt = (quint64)pat->nCyclePresetUs;
+			emit cycIntChanged(m_cycInt);
+		}
+
+		if(state == GIAS_Running)
+		{
+			if(m_cycMin != (quint64)pat->nCycleMinUs)
+			{
+				m_cycMin = (quint64)pat->nCycleMinUs;
+				emit cycMinChanged(m_cycMin);
+			}
+
+			if(m_cycMax != (quint64)pat->nCycleMaxUs)
+			{
+				m_cycMax = (quint64)pat->nCycleMaxUs;
+				emit cycMaxChanged(m_cycMax);
+			}
+
+			if(m_wktMin != (quint64)pat->nWorkMinUs)
+			{
+				m_wktMin = (quint64)pat->nWorkMinUs;
+				emit wktMinChanged(m_wktMin);
+			}
+
+			if(m_wktMax != (quint64)pat->nWorkMaxUs)
+			{
+				m_wktMax = (quint64)pat->nWorkMaxUs;
+				emit wktMaxChanged(m_wktMax);
+			}
+		}
+		else
+		{
+			if(m_cycCur != 0)
+			{
+				m_cycCur = 0;
+				emit cycCurChanged(m_cycCur);
+			}
+
+			if(m_wktCur != 0)
+			{
+				m_wktCur = 0;
+				emit wktCurChanged(m_wktCur);
+			}
+		}
+
+		if(bDoHeavyLoadUpdate)
+		{
+			quint64 upTime = time(NULL) - pat->nTsStart;
+			
+			if(m_upTime != upTime)
+			{
+				m_upTime = upTime;
+				emit upTimeChanged(m_upTime);
+			}
+
+			if(state == GIAS_Running)
+			{
+				if(m_cycCur != (quint64)pat->nCycleLastUs)
+				{
+					m_cycCur = (quint64)pat->nCycleLastUs;
+					emit cycCurChanged(m_cycCur);
+				}
+
+				if(m_wktCur != (quint64)pat->nWorkLastUs)
+				{
+					m_wktCur = (quint64)pat->nWorkLastUs;
+					emit wktCurChanged(m_wktCur);
+				}
+			}
+			
+			if(state != GIAS_Hanging)
+			{
+				if(m_cpuTime != pat->fCpuTime)
+				{
+					m_cpuTime = pat->fCpuTime;
+					emit cpuTimeChanged(m_cpuTime);
+				}
+				
+				if(m_cpuPercCur != pat->fCpuCur)
+				{
+					m_cpuPercCur = pat->fCpuCur;
+					emit cpuCurChanged(m_cpuPercCur);
+				}
+				
+				if(m_cpuPercAvg != pat->fCpuAvg)
+				{
+					m_cpuPercAvg = pat->fCpuAvg;
+					emit cpuAvgChanged(m_cpuPercAvg);
+				}
+			}
+		}
+	}
+	else
+	{
+		if(m_cycInt != 0)
+		{
+			m_cycInt = 0;
+			emit cycIntChanged(m_cycInt);
+		}
+
+		if(m_cycCur != 0)
+		{
+			m_cycCur = 0;
+			emit cycCurChanged(m_cycCur);
+		}
+
+		if(m_wktCur != 0)
+		{
+			m_wktCur = 0;
+			emit wktCurChanged(m_wktCur);
+		}
+
+		if(state == GIAS_Hanging)
+		{
+			if(m_cpuTime != -1)
+			{
+				m_cpuTime = -1;
+				emit cpuTimeChanged(m_cpuTime);
+			}
+			
+			if(m_cpuPercCur != -1)
+			{
+				m_cpuPercCur = -1;
+				emit cpuCurChanged(m_cpuPercCur);
+			}
+			
+			if(m_cpuPercAvg != -1)
+			{
+				m_cpuPercAvg = -1;
+				emit cpuAvgChanged(m_cpuPercAvg);
+			}
+		}
+		else
+		{
+			if(m_cycMin != 0)
+			{
+				m_cycMin = 0;
+				emit cycMinChanged(m_cycMin);
+			}
+
+			if(m_cycMax != 0)
+			{
+				m_cycMax = 0;
+				emit cycMaxChanged(m_cycMax);
+			}
+
+			if(m_wktMin != 0)
+			{
+				m_wktMin = 0;
+				emit wktMinChanged(m_wktMin);
+			}
+
+			if(m_wktMax != 0)
+			{
+				m_wktMax = 0;
+				emit wktMaxChanged(m_wktMax);
+			}
+
+			if(m_upTime != 0)
+			{
+				m_upTime = 0;
+				emit upTimeChanged(m_upTime);
+			}
+				
+			if(m_cpuTime != 0)
+			{
+				m_cpuTime = 0;
+				emit cpuTimeChanged(m_cpuTime);
+			}
+			
+			if(m_cpuPercCur != 0)
+			{
+				m_cpuPercCur = 0;
+				emit cpuCurChanged(m_cpuPercCur);
+			}
+			
+			if(m_cpuPercAvg != 0)
+			{
+				m_cpuPercAvg = 0;
+				emit cpuAvgChanged(m_cpuPercAvg);
+			}
+		}
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+bool QGfaAppInfo::pause(void)
+{
+	emit sendControlMessage(m_nAppID, GFA_APPCTRL_CTRLMSG_PAUSE);
+	return true;
+}
+
+bool QGfaAppInfo::resume(void)
+{
+	emit sendControlMessage(m_nAppID, GFA_APPCTRL_CTRLMSG_RESUME);
+	return true;
+}
+
+bool QGfaAppInfo::stop(void)
+{
+	emit sendControlMessage(m_nAppID, GFA_APPCTRL_CTRLMSG_STOP);
+	return true;
+}

+ 4 - 0
Test/qmlApp/qml.qrc

@@ -1,5 +1,9 @@
 <RCC>
     <qresource prefix="/">
         <file>main.qml</file>
+        <file>dev.qml</file>
+        <file>res/img/mmc64.png</file>
+        <file>res/img/usb64.png</file>
+        <file>res/img/ata64.png</file>
     </qresource>
 </RCC>

+ 6 - 2
Test/qmlApp/qmlApp.pro

@@ -1,4 +1,4 @@
-QT += quick
+QT += quick core
 
 CONFIG += c++11
 
@@ -6,7 +6,9 @@ DEFINES += QT_DEPRECATED_WARNINGS
 
 SOURCES += \
         main.cpp \
-        qappctrl.cpp
+        qappctrl.cpp \
+        qappinfo.cpp \
+        qsysinfo.cpp
 
 RESOURCES += qml.qrc
 
@@ -35,3 +37,5 @@ linux-buildroot-g++ {
 HEADERS += \
     qappctrl.h
 
+DISTFILES +=
+

+ 492 - 0
Test/qmlApp/qsysinfo.cpp

@@ -0,0 +1,492 @@
+#include "qappctrl.h"
+#include "../../src/defines.h"
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+#define _countof(a)							(sizeof(a) / sizeof(*a))
+
+#define _BYTE_SIZE_KIB						(1ULL << 10) // Kibibyte
+#define _BYTE_SIZE_MIB						(1ULL << 20) // Mebibyte
+#define _BYTE_SIZE_GIB						(1ULL << 30) // Gibibyte
+#define _BYTE_SIZE_TIB						(1ULL << 40) // Tebibyte
+#define _BYTE_SIZE_PIB						(1ULL << 50) // Pebibyte
+#define _BYTE_SIZE_EIB						(1ULL << 60) // Exbibyte
+
+static const char *_FormatByteSize(unsigned long long nCb, char *pszBuf, size_t nCChBuf, bool bShortUnits = true, int nPrec = 1);
+
+/////////////////////////////////////////////////////////////////////////////
+
+static const char *_FormatByteSize(unsigned long long nCb, char *pszBuf, size_t nCChBuf, bool bShortUnits, int nPrec)
+{
+	if(pszBuf && nCChBuf)
+	{
+		double val = nCb;
+		
+		if(nCb < _BYTE_SIZE_KIB)
+		{
+			snprintf(pszBuf, nCChBuf, "%llu %s", nCb, bShortUnits ? "" : "Byte"); // Byte
+		}
+		else if(nCb < _BYTE_SIZE_MIB)
+		{
+			val /= _BYTE_SIZE_KIB;
+			snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "K" : "KiB"); // KiB
+		}
+		else if(nCb < _BYTE_SIZE_GIB)
+		{
+			val /= _BYTE_SIZE_MIB;
+			snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "M" : "MiB"); // MiB
+		}
+		else if(nCb < _BYTE_SIZE_TIB)
+		{
+			val /= _BYTE_SIZE_GIB;
+			snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "G" : "GiB"); // GiB
+		}
+		else if(nCb < _BYTE_SIZE_PIB)
+		{
+			val /= _BYTE_SIZE_TIB;
+			snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "T" : "TiB"); // TiB
+		}
+		else if(nCb < _BYTE_SIZE_EIB)
+		{
+			val /= _BYTE_SIZE_PIB;
+			snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "P" : "PiB"); // PiB
+		}
+		
+		return pszBuf;
+	}
+	
+	return NULL;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+typedef enum
+{
+    SDR_DiskName = Qt::UserRole,
+    SDR_DiskDevNode,
+    SDR_DiskBusType,
+    SDR_DiskVendorName,
+    SDR_DiskVendorID,
+	SDR_DiskProductID,
+	SDR_PartFsLabel,
+	SDR_PartFsType,
+	SDR_PartFsVersion,
+	SDR_PartDevNode,
+	SDR_PartMountPoint,
+	SDR_PartSize,
+	SDR_PartFsSize,
+	SDR_PartFsFree,
+	SDR_PartFsUsed
+}StgDevRoles;
+
+typedef struct _STG_DEV_ROLES
+{
+	int nRole;
+	const char *pszRoleName;
+}STG_DEV_ROLES, *LPSTG_DEV_ROLES;
+typedef const STG_DEV_ROLES *LPCSTG_DEV_ROLES;
+
+/////////////////////////////////////////////////////////////////////////////
+
+static const STG_DEV_ROLES g_roles[] =
+{
+	{SDR_DiskName,			"DiskName"},
+	{SDR_DiskDevNode,		"DiskDevNode"},
+	{SDR_DiskBusType,		"DiskBusType"},
+	{SDR_DiskVendorName,	"DiskVendorName"},
+	{SDR_DiskVendorID,		"DiskVendorID"},
+	{SDR_DiskProductID,		"DiskProductID"},
+	{SDR_PartFsLabel,		"PartFsLabel"},
+	{SDR_PartFsType,		"PartFsType"},
+	{SDR_PartFsVersion,		"PartFsVersion"},
+	{SDR_PartDevNode,		"PartDevNode"},
+	{SDR_PartMountPoint,	"PartMountPoint"},
+	{SDR_PartSize,			"PartSize"},
+	{SDR_PartFsSize,		"PartFsSize"},
+	{SDR_PartFsFree,		"PartFsFree"},
+	{SDR_PartFsUsed,		"PartFsUsed"}
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+QGfaStgDevList::QGfaStgDevList(QObject *pParent) : 	QAbstractTableModel(pParent)
+{
+	memset(&m_stgDevShadowCpy, 0, sizeof(m_stgDevShadowCpy));
+    setObjectName("QGfaStgDevList");
+}
+
+QGfaStgDevList::~QGfaStgDevList(void)
+{
+}
+
+int QGfaStgDevList::rowCount(const QModelIndex &parent) const
+{
+	Q_UNUSED(parent);
+	return (int)m_partVec.size();
+}
+
+int QGfaStgDevList::columnCount(const QModelIndex &parent) const
+{
+	Q_UNUSED(parent);
+	return (int)_countof(g_roles);
+}
+
+#define _OPT_STRING(s, o)	(*s ? s : o)
+
+#define _NA_STRING(s)		_OPT_STRING(s, "n/a")
+
+QVariant QGfaStgDevList::data(const QModelIndex &index, int role) const
+{
+	if(!index.isValid())
+		return QVariant();
+
+	QVariant val;
+	char szBuf[64];
+	int nIndex = index.row();
+	const STG_DEV_DISK_PART &dp = m_partVec[nIndex];
+	const GFA_SYSINFO_DISK &disk = m_stgDevShadowCpy.disks[dp.nDiskIdx];
+	const GFA_SYSINFO_PARTITION &part = m_stgDevShadowCpy.parts[dp.nPartIdx];
+	
+	if(disk.valid && part.valid)
+	{
+		switch(role)
+		{
+		case SDR_DiskName:
+			val = _NA_STRING(disk.szName);
+			break;
+		case SDR_DiskDevNode:
+			val = _NA_STRING(disk.szDevNode);
+			break;
+		case SDR_DiskBusType:
+			val = _OPT_STRING(disk.szBus, "mmc");
+			break;
+		case SDR_DiskVendorName:
+			val = _NA_STRING(disk.szVendor);
+			break;
+		case SDR_DiskVendorID:
+			val = (int)disk.nVendorID;
+			break;
+		case SDR_DiskProductID:
+			val = (int)disk.nProductID;
+			break;
+		case SDR_PartFsLabel:
+			val = _NA_STRING(part.szFsLabel);
+			break;
+		case SDR_PartFsType:
+			val = _NA_STRING(part.szFsType);
+			break;
+		case SDR_PartFsVersion:
+			val = _NA_STRING(part.szFsVersion);
+			break;
+		case SDR_PartDevNode:
+			val = _NA_STRING(part.szDevNode);
+			break;
+		case SDR_PartMountPoint:
+			val = _NA_STRING(part.szMntPoint);
+			break;
+		case SDR_PartSize:
+			val = _FormatByteSize(part.nKiBPartSize * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
+			break;
+		case SDR_PartFsSize:
+			val = _FormatByteSize(part.nKiBSize * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
+			break;
+		case SDR_PartFsFree:
+			val = _FormatByteSize(part.nKiBFree * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
+			break;
+		case SDR_PartFsUsed:
+			val = _FormatByteSize(part.nKiBUsed * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
+			break;
+		default:
+			break;
+		}
+	}
+
+	return val;
+}
+
+QHash<int, QByteArray> QGfaStgDevList::roleNames(void) const
+{
+	QHash<int, QByteArray> roles;
+	
+	for(size_t i = 0; i < _countof(g_roles); ++i)
+	{
+		roles[g_roles[i].nRole] = g_roles[i].pszRoleName;
+	}
+
+	return roles;
+}
+
+int QGfaStgDevList::FindPartVecEntry(int nDiskIdx, int nPartIdx)
+{
+	for(auto it = m_partVec.begin(); it != m_partVec.end(); ++it)
+	{
+		const STG_DEV_DISK_PART &dp = *it;
+		if((dp.nDiskIdx == nDiskIdx) && (dp.nPartIdx == nPartIdx))
+			return it - m_partVec.begin();
+	}
+	return -1;
+}
+
+void QGfaStgDevList::insertPartition(int nDiskIdx, int nPartIdx)
+{
+	QModelIndex parent = QModelIndex();
+	int nIndex = (int)m_partVec.size();
+	emit beginInsertRows(parent, nIndex, nIndex);
+	m_partVec.emplace_back(nDiskIdx, nPartIdx);
+	emit endInsertRows();
+}
+
+void QGfaStgDevList::removePartition(int nDiskIdx, int nPartIdx)
+{
+	int nIndex;
+	if((nIndex = FindPartVecEntry(nDiskIdx, nPartIdx)) >= 0)
+	{
+		QModelIndex parent = QModelIndex();
+		emit beginRemoveRows(parent, nIndex, nIndex);
+		m_partVec.erase(m_partVec.begin() + nIndex);
+		emit endRemoveRows();
+	}
+}
+
+void QGfaStgDevList::diskAdded(int nIndex, const GFA_SYSINFO_DISK &disk)
+{
+	if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.disks)) && !disk.internal)
+	{
+		TRACE("Disk [ID=%d] added:   %s [%s]\n", nIndex, disk.szDevNode, *disk.szName ? disk.szName : "Unnamed");
+		memcpy(&m_stgDevShadowCpy.disks[nIndex], &disk, sizeof(GFA_SYSINFO_DISK));
+	}
+}
+
+void QGfaStgDevList::diskRemoved(int nIndex, const GFA_SYSINFO_DISK &disk)
+{
+	if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.disks)) && !disk.internal)
+	{
+		TRACE("Disk [ID=%d] removed: %s [%s]\n", nIndex, disk.szDevNode, *disk.szName ? disk.szName : "Unnamed");
+		m_stgDevShadowCpy.disks[nIndex].valid = false;
+	}
+}
+
+void QGfaStgDevList::partitionAdded(int nIndex, const GFA_SYSINFO_PARTITION &part)
+{
+	if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.parts)) && !part.internal)
+	{
+		TRACE("Partition [ID=%d:%d] added:   %s [%s]\n", part.nDiskIdx, nIndex, part.szDevNode, *part.szFsLabel ? part.szFsLabel : "Unnamed");
+		memcpy(&m_stgDevShadowCpy.parts[nIndex], &part, sizeof(GFA_SYSINFO_PARTITION));
+		insertPartition(part.nDiskIdx, nIndex);
+	}
+}
+
+void QGfaStgDevList::partitionRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part)
+{
+	if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.parts)) && !part.internal)
+	{
+		TRACE("Partition [ID=%d:%d] removed: %s [%s]\n", part.nDiskIdx, nIndex, part.szDevNode, *part.szFsLabel ? part.szFsLabel : "Unnamed");
+		m_stgDevShadowCpy.parts[nIndex].valid = false;
+		removePartition(part.nDiskIdx, nIndex);
+	}
+}
+
+void QGfaStgDevList::mountAdded(int nIndex, const GFA_SYSINFO_PARTITION &part)
+{
+	if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.parts)) && !part.internal)
+	{
+		TRACE("Partition [ID=%d:%d] mounted:   %s -> %s\n", part.nDiskIdx, nIndex, part.szDevNode, part.szMntPoint);
+		GFA_SYSINFO_PARTITION &p = m_stgDevShadowCpy.parts[nIndex];
+		memcpy(&p.szMntPoint, &part.szMntPoint, sizeof(GFA_SYSINFO_PARTITION::szMntPoint));
+		if((nIndex = FindPartVecEntry(part.nDiskIdx, nIndex)) >= 0)
+		{
+			p.nKiBSize = part.nKiBSize;
+			p.nKiBFree = part.nKiBFree;
+			p.nKiBUsed = part.nKiBUsed;
+			QModelIndex i = createIndex(nIndex, 0);
+			emit dataChanged(i, i, {SDR_PartMountPoint, SDR_PartFsSize, SDR_PartFsFree, SDR_PartFsUsed});
+		}
+	}
+}
+
+void QGfaStgDevList::mountRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part)
+{
+	if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.parts)) && !part.internal)
+	{
+		TRACE("Partition [ID=%d:%d] unmounted: %s\n", part.nDiskIdx, nIndex, part.szDevNode);
+		GFA_SYSINFO_PARTITION &p = m_stgDevShadowCpy.parts[nIndex];
+		memset(&p.szMntPoint, 0, sizeof(GFA_SYSINFO_PARTITION::szMntPoint));
+		if((nIndex = FindPartVecEntry(part.nDiskIdx, nIndex)) >= 0)
+		{
+			p.nKiBSize = 0;
+			p.nKiBFree = 0;
+			p.nKiBUsed = 0;
+			QModelIndex i = createIndex(nIndex, 0);
+			emit dataChanged(i, i, {SDR_PartMountPoint, SDR_PartFsSize, SDR_PartFsFree, SDR_PartFsUsed});
+		}
+	}
+}
+
+void QGfaStgDevList::clearAll(void)
+{
+	int nLast = m_partVec.size() - 1;
+	if(nLast >= 0)
+	{
+		QModelIndex parent = QModelIndex();
+		emit beginRemoveRows(parent, 0, nLast);
+		m_partVec.clear();
+		memset(&m_stgDevShadowCpy, 0, sizeof(m_stgDevShadowCpy));
+		emit endRemoveRows();
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+QGfaSysInfo::QGfaSysInfo(QObject *pParent) : 	QObject(pParent),
+												m_bSysInfoRunning(false),
+												m_nMemTotal(0),
+												m_nMemUsed(0),
+												m_nMemFree(0),
+												m_nMemAvailable(0),
+												m_nMemBuffers(0),
+												m_nMemCached(0)
+{
+}
+
+QGfaSysInfo::~QGfaSysInfo(void)
+{
+    setObjectName("QGfaSysInfo");
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+void QGfaSysInfo::setSysInfoRunning(bool bRunning)
+{
+	if(m_bSysInfoRunning != bRunning)
+	{
+		if(!(m_bSysInfoRunning = bRunning))
+		{
+			setSysMemInfo(NULL);
+			m_stgDevList.clearAll();
+		}
+	}
+}
+
+void QGfaSysInfo::setSysMemInfo(LPCGFA_APPCTRL_SYSMEM psm, bool bDoHeavyLoadUpdate)
+{
+	if(psm && m_bSysInfoRunning)
+	{
+		if(bDoHeavyLoadUpdate)
+		{
+			if(m_nMemTotal != psm->nMemTotal)
+			{
+				m_nMemTotal = psm->nMemTotal;
+				emit memTotalChanged(m_nMemTotal);
+			}
+
+			if(m_nMemUsed != psm->nMemUsed)
+			{
+				m_nMemUsed = psm->nMemUsed;
+				emit memUsedChanged(m_nMemUsed);
+			}
+			
+			if(m_nMemFree != psm->nMemFree)
+			{
+				m_nMemFree = psm->nMemFree;
+				emit memFreeChanged(m_nMemFree);
+			}
+
+			if(m_nMemAvailable != psm->nMemAvailable)
+			{
+				m_nMemAvailable = psm->nMemAvailable;
+				emit memAvailableChanged(m_nMemAvailable);
+			}
+			
+			if(m_nMemBuffers != psm->nMemBuffers)
+			{
+				m_nMemBuffers = psm->nMemBuffers;
+				emit memBuffersChanged(m_nMemBuffers);
+			}
+			
+			if(m_nMemCached != psm->nMemCached)
+			{
+				m_nMemCached = psm->nMemCached;
+				emit memCachedChanged(m_nMemCached);
+			}
+		}
+	}
+	else
+	{
+		if(m_nMemTotal != 0)
+		{
+			m_nMemTotal = 0;
+			emit memTotalChanged(m_nMemTotal);
+		}
+
+		if(m_nMemUsed != 0)
+		{
+			m_nMemUsed = 0;
+			emit memUsedChanged(m_nMemUsed);
+		}
+		
+		if(m_nMemFree != 0)
+		{
+			m_nMemFree = 0;
+			emit memFreeChanged(m_nMemFree);
+		}
+
+		if(m_nMemAvailable != 0)
+		{
+			m_nMemAvailable = 0;
+			emit memAvailableChanged(m_nMemAvailable);
+		}
+		
+		if(m_nMemBuffers != 0)
+		{
+			m_nMemBuffers = 0;
+			emit memBuffersChanged(m_nMemBuffers);
+		}
+		
+		if(m_nMemCached != 0)
+		{
+			m_nMemCached = 0;
+			emit memCachedChanged(m_nMemCached);
+		}
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+quint64 QGfaSysInfo::memTotal(void) const
+{
+	return m_nMemTotal;
+}
+
+quint64 QGfaSysInfo::memUsed(void) const
+{
+	return m_nMemUsed;
+}
+
+quint64 QGfaSysInfo::memFree(void) const
+{
+	return m_nMemFree;
+}
+
+quint64 QGfaSysInfo::memAvailable(void) const
+{
+	return m_nMemAvailable;
+}
+
+quint64 QGfaSysInfo::memBuffers(void) const
+{
+	return m_nMemBuffers;
+}
+
+quint64 QGfaSysInfo::memCached(void) const
+{
+	return m_nMemCached;
+}
+
+QGfaStgDevList* QGfaSysInfo::stgDev(void)
+{
+	return &m_stgDevList;
+}

BIN
Test/qmlApp/res/img/ata64.png


BIN
Test/qmlApp/res/img/mmc64.png


BIN
Test/qmlApp/res/img/usb64.png


+ 2 - 0
gfaipc.pro

@@ -110,6 +110,8 @@ linux-buildroot-g++ {
 		utoolchain.depends = uninstall_library uninstall_includes
 		QMAKE_EXTRA_TARGETS += utoolchain
 	}
+    QMAKE_CXXFLAGS += -D_TARGET_BUILD
+    QMAKE_CFLAGS += -D_TARGET_BUILD
 }
 
 ####################################################################################

+ 111 - 111
gfaipc.pro.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.11.1, 2020-03-17T16:28:46. -->
+<!-- Written by QtCreator 4.11.1, 2020-03-24T14:59:52. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
@@ -8,7 +8,7 @@
  </data>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
-  <value type="int">0</value>
+  <value type="int">1</value>
  </data>
  <data>
   <variable>ProjectExplorer.Project.EditorSettings</variable>
@@ -59,14 +59,14 @@
  <data>
   <variable>ProjectExplorer.Project.Target.0</variable>
   <valuemap type="QVariantMap">
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Sitara 1</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Sitara 1</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b0a415a1-ecbe-4123-8afc-05ffc0004131}</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.gcc_64_kit</value>
    <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Debug/Sitara_1</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Debug/Desktop_Qt_5_7_1_GCC_64bit</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>
@@ -91,7 +91,7 @@
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
       <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">install_toolchain</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">install</value>
       <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
       <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
      </valuemap>
@@ -122,7 +122,7 @@
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
       <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">uninstall_toolchain</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">uninstall</value>
       <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
       <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
      </valuemap>
@@ -139,7 +139,7 @@
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Release/Sitara_1</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Release/Desktop_Qt_5_7_1_GCC_64bit</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>
@@ -164,7 +164,7 @@
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
       <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">install_toolchain</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">install</value>
       <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
       <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
      </valuemap>
@@ -195,7 +195,7 @@
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
       <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">uninstall_toolchain</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">uninstall</value>
       <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
       <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
      </valuemap>
@@ -214,20 +214,13 @@
    <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">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProcessStep.Arguments">&quot;%{Device:UserName}&quot; &quot;%{Device:HostAddress}&quot; &quot;%{Device:KeyFile}&quot;</value>
-      <value type="QString" key="ProjectExplorer.ProcessStep.Command">/home/wrk/share/gfaipc/deploylib.sh</value>
-      <value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.ProcessStep</value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
     </valuemap>
     <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToGenericLinux</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"/>
@@ -305,98 +298,20 @@
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
     <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
    </valuemap>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
-    <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
-    <valuelist type="QVariantList" key="Analyzer.Perf.Events">
-     <value type="QString">cpu-cycles</value>
-    </valuelist>
-    <valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
-    <value type="int" key="Analyzer.Perf.Frequency">250</value>
-    <valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
-     <value type="QString">-e</value>
-     <value type="QString">cpu-cycles</value>
-     <value type="QString">--call-graph</value>
-     <value type="QString">dwarf,4096</value>
-     <value type="QString">-F</value>
-     <value type="QString">250</value>
-    </valuelist>
-    <value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
-    <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
-    <value type="int" key="Analyzer.Perf.StackSize">4096</value>
-    <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
-    <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
-    <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
-    <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
-    <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
-    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
-    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
-    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
-    <value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
-    <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
-    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
-    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
-    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
-    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
-    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
-    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
-     <value type="int">0</value>
-     <value type="int">1</value>
-     <value type="int">2</value>
-     <value type="int">3</value>
-     <value type="int">4</value>
-     <value type="int">5</value>
-     <value type="int">6</value>
-     <value type="int">7</value>
-     <value type="int">8</value>
-     <value type="int">9</value>
-     <value type="int">10</value>
-     <value type="int">11</value>
-     <value type="int">12</value>
-     <value type="int">13</value>
-     <value type="int">14</value>
-    </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
-    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.CustomRunConfig</value>
-    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
-    <value type="QString" key="RemoteLinux.CustomRunConfig.LocalExecutable"></value>
-    <value type="QString" key="RemoteLinux.CustomRunConfig.RemoteExecutable"></value>
-    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
-    <value type="QString" key="RunConfiguration.Arguments"></value>
-    <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
-    <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
-    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
-    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
-    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
-    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
-    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
-   </valuemap>
-   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
   </valuemap>
  </data>
  <data>
   <variable>ProjectExplorer.Project.Target.1</variable>
   <valuemap type="QVariantMap">
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.gcc_64_kit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Sitara 1</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Sitara 1</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b0a415a1-ecbe-4123-8afc-05ffc0004131}</value>
    <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Debug/Desktop_Qt_5_7_1_GCC_64bit</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Debug/Sitara_1</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>
@@ -421,7 +336,7 @@
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
       <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">install</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">install_toolchain</value>
       <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
       <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
      </valuemap>
@@ -452,7 +367,7 @@
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
       <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">uninstall</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">uninstall_toolchain</value>
       <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
       <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
      </valuemap>
@@ -469,7 +384,7 @@
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Release/Desktop_Qt_5_7_1_GCC_64bit</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/Release/Sitara_1</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>
@@ -494,7 +409,7 @@
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
       <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">install</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">install_toolchain</value>
       <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
       <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
      </valuemap>
@@ -525,7 +440,7 @@
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
       <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">uninstall</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">uninstall_toolchain</value>
       <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
       <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
      </valuemap>
@@ -544,13 +459,20 @@
    <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>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProcessStep.Arguments">&quot;%{Device:UserName}&quot; &quot;%{Device:HostAddress}&quot; &quot;%{Device:KeyFile}&quot;</value>
+      <value type="QString" key="ProjectExplorer.ProcessStep.Command">/home/wrk/share/gfalibtools/deploylib.sh</value>
+      <value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.ProcessStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
     </valuemap>
     <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToGenericLinux</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
@@ -628,7 +550,85 @@
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
     <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
    </valuemap>
-   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
+    <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
+    <valuelist type="QVariantList" key="Analyzer.Perf.Events">
+     <value type="QString">cpu-cycles</value>
+    </valuelist>
+    <valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
+    <value type="int" key="Analyzer.Perf.Frequency">250</value>
+    <valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
+     <value type="QString">-e</value>
+     <value type="QString">cpu-cycles</value>
+     <value type="QString">--call-graph</value>
+     <value type="QString">dwarf,4096</value>
+     <value type="QString">-F</value>
+     <value type="QString">250</value>
+    </valuelist>
+    <value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
+    <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
+    <value type="int" key="Analyzer.Perf.StackSize">4096</value>
+    <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
+    <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
+    <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
+    <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
+    <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
+    <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.CustomRunConfig</value>
+    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
+    <value type="QString" key="RemoteLinux.CustomRunConfig.LocalExecutable"></value>
+    <value type="QString" key="RemoteLinux.CustomRunConfig.RemoteExecutable"></value>
+    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+    <value type="QString" key="RunConfiguration.Arguments"></value>
+    <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
+    <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
+    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
   </valuemap>
  </data>
  <data>

+ 61 - 61
gfasysinfo/gfasysinfo.pro.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.11.1, 2020-03-17T16:28:46. -->
+<!-- Written by QtCreator 4.11.1, 2020-03-24T14:58:04. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
@@ -59,14 +59,14 @@
  <data>
   <variable>ProjectExplorer.Project.Target.0</variable>
   <valuemap type="QVariantMap">
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Sitara 1</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Sitara 1</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b0a415a1-ecbe-4123-8afc-05ffc0004131}</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.gcc_64_kit</value>
    <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/gfasysinfo/Debug/Sitara_1</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/gfasysinfo/Debug/Desktop_Qt_5_7_1_GCC_64bit</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>
@@ -114,7 +114,7 @@
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/gfasysinfo/Release/Sitara_1</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/gfasysinfo/Release/Desktop_Qt_5_7_1_GCC_64bit</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>
@@ -164,47 +164,13 @@
    <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">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.CheckForFreeDiskSpaceStep</value>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
-      <value type="QString" key="RemoteLinux.CheckForFreeDiskSpaceStep.PathToCheck">/</value>
-      <value type="qlonglong" key="RemoteLinux.CheckForFreeDiskSpaceStep.RequiredSpace">5242880</value>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.KillAppStep</value>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.DirectUploadStep</value>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
-      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
-      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.IgnoreMissingFiles">false</value>
-      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.Incremental">true</value>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
-      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">3</value>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
     </valuemap>
     <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToGenericLinux</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"/>
@@ -266,26 +232,21 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">gfasysinfo (auf Sitara 1)</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/gfasysinfo/gfasysinfo.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/gfasysinfo/gfasysinfo.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/gfasysinfo/gfasysinfo.pro</value>
-    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
-    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
-    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
-    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/wrk/share/gfaipc/gfasysinfo/Debug/Desktop_Qt_5_7_1_GCC_64bit</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
   </valuemap>
@@ -293,14 +254,14 @@
  <data>
   <variable>ProjectExplorer.Project.Target.1</variable>
   <valuemap type="QVariantMap">
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.1 GCC 64bit</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.gcc_64_kit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Sitara 1</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Sitara 1</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b0a415a1-ecbe-4123-8afc-05ffc0004131}</value>
    <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/gfasysinfo/Debug/Desktop_Qt_5_7_1_GCC_64bit</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/gfasysinfo/Debug/Sitara_1</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>
@@ -348,7 +309,7 @@
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/gfasysinfo/Release/Desktop_Qt_5_7_1_GCC_64bit</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/wrk/share/gfaipc/gfasysinfo/Release/Sitara_1</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>
@@ -398,13 +359,47 @@
    <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>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.CheckForFreeDiskSpaceStep</value>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
+      <value type="QString" key="RemoteLinux.CheckForFreeDiskSpaceStep.PathToCheck">/</value>
+      <value type="qlonglong" key="RemoteLinux.CheckForFreeDiskSpaceStep.RequiredSpace">5242880</value>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.KillAppStep</value>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.DirectUploadStep</value>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
+      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.IgnoreMissingFiles">false</value>
+      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.Incremental">true</value>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">3</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
     </valuemap>
     <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToGenericLinux</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
@@ -466,21 +461,26 @@
      <value type="int">13</value>
      <value type="int">14</value>
     </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/wrk/share/gfaipc/gfasysinfo/gfasysinfo.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">gfasysinfo (auf Sitara 1)</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinuxRunConfiguration:/home/wrk/share/gfaipc/gfasysinfo/gfasysinfo.pro</value>
     <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/wrk/share/gfaipc/gfasysinfo/gfasysinfo.pro</value>
+    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
     <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
     <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseX11Forwarding">false</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
     <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
+    <value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
   </valuemap>

+ 208 - 146
gfasysinfo/src/main.cpp

@@ -4,6 +4,7 @@
 #include <string.h>
 #include <string>
 #include <vector>
+//#include <regex>
 #include <map>
 #include <ext/stdio_filebuf.h>
 #include <iostream>
@@ -17,9 +18,8 @@
 #include <limits.h>
 #include <libudev.h>
 #include <poll.h>
-//#include <usb.h>
+#include <errno.h>
 #include <gfa/gfasitarautils.h>
-//#include <gfa/gfaipc.h>
 #include "../../src/gfaipc.h"
 #include "../../src/ipcpriv.h"
 
@@ -34,14 +34,22 @@
 #define UNUSED(v)							(void)v
 #define _countof(a)							(sizeof(a) / sizeof(*a))
 
+/////////////////////////////////////////////////////////////////////////////
+
+#define _BYTE_SIZE_KIB						(1ULL << 10) // Kibibyte
+#define _BYTE_SIZE_MIB						(1ULL << 20) // Mebibyte
+#define _BYTE_SIZE_GIB						(1ULL << 30) // Gibibyte
+#define _BYTE_SIZE_TIB						(1ULL << 40) // Tebibyte
+#define _BYTE_SIZE_PIB						(1ULL << 50) // Pebibyte
+#define _BYTE_SIZE_EIB						(1ULL << 60) // Exbibyte
+
 #define _APPID								GFA_APPCTRL_APPID_SYSINFO
 #define _APPNAME							"SysInfo"
 #define _CYCLE_INTV							500
 
 #define _STR_EQUALS(s, t)					(!!s && !strcmp(s, t))
-#define _NUM_TO_BIT(i)						(0x01 << (i))
-#define _MOUNTS_FILE						"/proc/mounts"
 
+#define _MOUNTS_FILE						"/proc/mounts"
 #define _INTERNAL_EMMC_DISK					"mmcblk1"
 #define _INTERNAL_EMMC_PART1				"mmcblk1p1"
 #define _INTERNAL_EMMC_PART2				"mmcblk1p2"
@@ -52,21 +60,35 @@ typedef std::map<std::string, std::string>	MountMap;
 
 /////////////////////////////////////////////////////////////////////////////
 
-static long long _NumberFromString(const char *pszString, int base = 10, bool *pbErr = NULL);
-static const char* _ReadDevPropertyValue(struct udev_device* dev, const char *pszKey, char *pszValue, size_t nCChValue, bool bTruncate = false);
-static long long _ReadDevPropertyValue(struct udev_device* dev, const char *pszKey, int base = 10, bool *pbErr = NULL);
+static volatile bool						g_fRun		= false;
+static volatile bool						g_fPause	= false;
 
 /////////////////////////////////////////////////////////////////////////////
 
-// console=ttyO0,115200 root=/dev/mmcblk0p2 rw rootwait vram=50M cma=50M
+static const char *g_pszStateNames[] =
+{
+	"Not running",
+	"Initializing",
+	"Running",
+	"Paused",
+	"Hanging",
+	"Terminating",
+	"Invalid"
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+static long long	_NumberFromString(const char *pszString, int base = 10, bool *pbErr = NULL);
+static const char*	_ReadDevPropertyValue(struct udev_device* dev, const char *pszKey, char *pszValue, size_t nCChValue, bool bTruncate = false);
+static long long	_ReadDevPropertyValue(struct udev_device* dev, const char *pszKey, int base = 10, bool *pbErr = NULL);
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-ssize_t _LookupPartition(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDevNode)
+static int _LookupPartition(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDevNode)
 {
-	ssize_t nIndex = -1;
+	int nIndex = -1;
 
 	if(pszDevNode && *pszDevNode)
 	{
@@ -83,9 +105,9 @@ ssize_t _LookupPartition(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *
 	return nIndex;
 }
 
-ssize_t _AddPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const GFA_SYSINFO_PARTITION &part, bool &bChange)
+static int _AddPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const GFA_SYSINFO_PARTITION &part, bool &bChange)
 {
-	ssize_t nIndex = -1;
+	int nIndex = -1;
 	bChange = false;
 
 	if((nIndex = _LookupPartition(sdm, part.szDevNode)) >= 0)
@@ -106,71 +128,79 @@ ssize_t _AddPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const GFA_SYSINFO_PAR
 	return nIndex;
 }
 
-ssize_t _RemovePartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t nIndex, bool &bChange)
+static int _RemovePartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, int nIndex, bool &bChange)
 {
 	bChange = false;
-	if(nIndex >= 0 && nIndex < (ssize_t)_countof(sdm.parts))
+
+	if(nIndex >= 0 && nIndex < (int)_countof(sdm.parts))
 	{
 		bChange = sdm.parts[nIndex].valid;
 		sdm.parts[nIndex].valid = false;
 	}
+
 	return nIndex;
 }
 
-ssize_t _RemovePartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDevNode, bool &bChange)
+#if 0
+static int _RemovePartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDevNode, bool &bChange)
 {
-	ssize_t nIndex = _LookupPartition(sdm, pszDevNode);
+	int nIndex = _LookupPartition(sdm, pszDevNode);
 	return _RemovePartition(sdm, nIndex, bChange);
 }
+#endif
 
-bool _PartitionSetDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t nPartIdx, ssize_t nDiskIdx, bool &bChange)
+static bool _PartitionSetDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, int nPartIdx, int nDiskIdx, bool &bChange)
 {
 	bChange = false;
-	if(	(nPartIdx >= 0) && (nPartIdx < (ssize_t)_countof(sdm.parts)) &&
-		(nDiskIdx >= 0) && (nDiskIdx < (ssize_t)_countof(sdm.disks)))
+
+	if(	(nPartIdx >= 0) && (nPartIdx < (int)_countof(sdm.parts)) &&
+		(nDiskIdx >= 0) && (nDiskIdx < (int)_countof(sdm.disks)))
 	{
 		if(sdm.parts[nPartIdx].nDiskIdx != nDiskIdx)
 		{
 			sdm.parts[nPartIdx].nDiskIdx = nDiskIdx;
 			bChange = true;
 		}
+
 		return true;
 	}
+
 	return false;
 }
 
-ssize_t _PartitionGetDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t nPartIdx)
+static int _PartitionGetDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, int nPartIdx)
 {
-	if((nPartIdx >= 0) && (nPartIdx < (ssize_t)_countof(sdm.parts)))
+	if((nPartIdx >= 0) && (nPartIdx < (int)_countof(sdm.parts)))
 		return sdm.parts[nPartIdx].nDiskIdx;
 	return -1;
 }
 
-void _ClearMapChanges(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
+static void _ClearMapChanges(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 {
 	sdm.nPartChangeMask = 0;
 }
 
-bool _MapChanged(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
+static bool _DeviceMapChanged(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 {
 	return !!sdm.nPartChangeMask;
 }
 
-unsigned int _SetPartitionChange(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t nPartIdx)
+static unsigned int _SetPartitionChange(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, int nPartIdx)
 {
-	if((nPartIdx >= 0) && (nPartIdx < (ssize_t)_countof(sdm.parts)))
+	if((nPartIdx >= 0) && (nPartIdx < (int)_countof(sdm.parts)))
 	{
-		unsigned int nChanged = _NUM_TO_BIT(nPartIdx);
+		unsigned int nChanged = (0x01 << nPartIdx);
 		sdm.nPartChangeMask |= nChanged;
 	}
+
 	return sdm.nPartChangeMask;
 }
 
 /////////////////////////////////////////////////////////////////////////////
 
-ssize_t _LookupDisk(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDevNode)
+static int _LookupDisk(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDevNode)
 {
-	ssize_t nIndex = -1;
+	int nIndex = -1;
 
 	if(pszDevNode && *pszDevNode)
 	{
@@ -187,9 +217,9 @@ ssize_t _LookupDisk(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDe
 	return nIndex;
 }
 
-ssize_t _AddDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const GFA_SYSINFO_DISK &disk, bool &bChange)
+static int _AddDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const GFA_SYSINFO_DISK &disk, bool &bChange)
 {
-	ssize_t nIndex = -1;
+	int nIndex = -1;
 	bChange = false;
 
 	if((nIndex = _LookupDisk(sdm, disk.szDevNode)) >= 0)
@@ -210,28 +240,33 @@ ssize_t _AddDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const GFA_SYSINFO_DISK &di
 	return nIndex;
 }
 
-ssize_t _RemoveDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t nIndex, bool &bChange)
+static int _RemoveDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, int nIndex, bool &bChange)
 {
 	bChange = false;
-	if(nIndex >= 0 && nIndex < (ssize_t)_countof(sdm.disks))
+
+	if(nIndex >= 0 && nIndex < (int)_countof(sdm.disks))
 	{
 		bChange = sdm.disks[nIndex].valid;
 		sdm.disks[nIndex].valid = false;
 	}
+
 	return nIndex;
 }
 
-ssize_t _RemoveDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDevNode, bool &bChange)
+#if 0
+static int _RemoveDisk(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, const char *pszDevNode, bool &bChange)
 {
-	ssize_t nIndex = _LookupDisk(sdm, pszDevNode);
+	int nIndex = _LookupDisk(sdm, pszDevNode);
 	return _RemoveDisk(sdm, nIndex, bChange);
 }
+#endif
 
-unsigned int _DiskAddPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t nDiskIdx, ssize_t nPartIdx, bool &bChange)
+static unsigned int _DiskAddPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, int nDiskIdx, int nPartIdx, bool &bChange)
 {
 	bChange = false;
-	if(	(nPartIdx >= 0) && (nPartIdx < (ssize_t)_countof(sdm.parts)) &&
-		(nDiskIdx >= 0) && (nDiskIdx < (ssize_t)_countof(sdm.disks)))
+
+	if(	(nPartIdx >= 0) && (nPartIdx < (int)_countof(sdm.parts)) &&
+		(nDiskIdx >= 0) && (nDiskIdx < (int)_countof(sdm.disks)))
 	{
 		GFA_SYSINFO_DISK &disk = sdm.disks[nDiskIdx];
 
@@ -248,14 +283,16 @@ unsigned int _DiskAddPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t nDis
 			return disk.nPartCount;
 		}
 	}
+
 	return 0;
 }
 
-unsigned int _DiskRemovePartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t nDiskIdx, ssize_t nPartIdx, bool &bChange)
+static unsigned int _DiskRemovePartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, int nDiskIdx, int nPartIdx, bool &bChange)
 {
 	bChange = false;
-	if(	(nPartIdx >= 0) && (nPartIdx < (ssize_t)_countof(sdm.parts)) &&
-		(nDiskIdx >= 0) && (nDiskIdx < (ssize_t)_countof(sdm.disks)))
+
+	if(	(nPartIdx >= 0) && (nPartIdx < (int)_countof(sdm.parts)) &&
+		(nDiskIdx >= 0) && (nDiskIdx < (int)_countof(sdm.disks)))
 	{
 		unsigned int i, j;
 		GFA_SYSINFO_DISK &disk = sdm.disks[nDiskIdx];
@@ -275,39 +312,15 @@ unsigned int _DiskRemovePartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, ssize_t n
 			bChange = true;
 			return --disk.nPartCount;
 		}
+
 		return disk.nPartCount;
 	}
+
 	return 0;
 }
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-
-static const char *g_pszStateNames[] =
-{
-	"Not running",
-	"Initializing",
-	"Running",
-	"Paused",
-	"Hanging",
-	"Terminating",
-	"Invalid"
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-static volatile bool g_fRun		= false;
-static volatile bool g_fPause	= false;
-
-/////////////////////////////////////////////////////////////////////////////
-
-static void _SigHandler(int sig)
-{
-	UNUSED(sig);
-	g_fPause = false;
-	g_fRun = false;
-}
-
 /////////////////////////////////////////////////////////////////////////////
 
 static bool _LookupMountPoint(MountMap &mm, const char *pszNode, char *pszMntPoint, size_t nCChMntPoint)
@@ -326,7 +339,7 @@ static bool _LookupMountPoint(MountMap &mm, const char *pszNode, char *pszMntPoi
 	return false;
 }
 
-static bool _UpdatePartitionSizeInfo(MountMap &mm, GFA_SYSINFO_PARTITION &part)
+static bool _UpdatePartitionFsInfo(MountMap &mm, GFA_SYSINFO_PARTITION &part)
 {
 	if(_LookupMountPoint(mm, part.szDevNode, part.szMntPoint, sizeof(part.szMntPoint)))
 	{
@@ -340,6 +353,8 @@ static bool _UpdatePartitionSizeInfo(MountMap &mm, GFA_SYSINFO_PARTITION &part)
 		}
 		else
 		{
+			TRACE("statvfs failed on \"%s\": %s\n", part.szMntPoint, strerror(errno));
+			memset(part.szMntPoint, 0, sizeof(part.szMntPoint));
 			part.nKiBSize = 0;
 			part.nKiBFree = 0;
 			part.nKiBUsed = 0;
@@ -360,6 +375,33 @@ static bool _UpdatePartitionSizeInfo(MountMap &mm, GFA_SYSINFO_PARTITION &part)
 
 /////////////////////////////////////////////////////////////////////////////
 
+static std::string _StrReplace(std::string &s, const char *pszFind, const char *pszRepl)
+{
+	std::string r = s;
+
+	if(pszFind && *pszFind && pszRepl)
+	{
+		size_t nFind, nLen = strlen(pszFind);
+
+		while((nFind = r.find(pszFind)) !=  std::string::npos)
+		{
+			r = r.replace(nFind, nLen, pszRepl);
+		}
+	}
+	
+	return r;
+}
+	
+static std::string _UnescapeMountpointString(std::string &s)
+{
+	std::string r = s;
+	r = _StrReplace(r, "\\040", " ");
+	r = _StrReplace(r, "\\011", "\t");
+	r = _StrReplace(r, "\\012", "\n");
+	r = _StrReplace(r, "\\134", "\\");
+	return r;
+}
+
 static void _UpdateMountMap(MountMap &mm)
 {
 	char szLine[512], szNode[512], szMount[512];
@@ -371,7 +413,9 @@ static void _UpdateMountMap(MountMap &mm)
 		if((sscanf(szLine, "%s %s", szNode, szMount) == 2))
 		{
 			std::string key(szNode);
+			key = _UnescapeMountpointString(key);
 			std::string val(szMount);
+			val = _UnescapeMountpointString(val);
 			mm.emplace(key, val);
 		}
 	}
@@ -395,17 +439,15 @@ static bool _ProcessMounts(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, MountMap &mm)
 
 			if(!bMountedOld && bMountedNew)
 			{
-//				TRACE("Partition %s: mounted at %s\n", part.szDevNode, szMntPoint);
 				memcpy(part.szMntPoint, szMntPoint, sizeof(part.szMntPoint));
-				_UpdatePartitionSizeInfo(mm, part);
+				_UpdatePartitionFsInfo(mm, part);
 				_SetPartitionChange(sdm, i);
 				bChange = true;
 			}
 			else if(bMountedOld && !bMountedNew)
 			{
-//				TRACE("Partition %s: unmounted from %s\n", part.szDevNode, part.szMntPoint);
 				memset(part.szMntPoint, 0, sizeof(part.szMntPoint));
-				_UpdatePartitionSizeInfo(mm, part);
+				_UpdatePartitionFsInfo(mm, part);
 				_SetPartitionChange(sdm, i);
 				bChange = true;
 			}
@@ -413,15 +455,15 @@ static bool _ProcessMounts(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, MountMap &mm)
 			{
 				if(strcmp(part.szMntPoint, szMntPoint))
 				{
-//					TRACE("Partition %s: mount point changed: %s -> %s\n", part.szDevNode, part.szMntPoint, szMntPoint);
 					memcpy(part.szMntPoint, szMntPoint, sizeof(part.szMntPoint));
-					_UpdatePartitionSizeInfo(mm, part);
+					_UpdatePartitionFsInfo(mm, part);
 					_SetPartitionChange(sdm, i);
 					bChange = true;
 				}
 			}
 		}
 	}
+
 	return bChange;
 }
 
@@ -461,15 +503,15 @@ static void _ProcessCtrlMessages(HAPPCTRL hAC, HAPPINFO hAI)
 	}
 }
 
-static const char* _GetFileSpec(const char *pszName)
+static const char* _GetFileSpec(const char *pszPathname)
 {
-	if(pszName && *pszName)
+	if(pszPathname && *pszPathname)
 	{
-		const char *pSlash =  strrchr(pszName, '/');
+		const char *pSlash =  strrchr(pszPathname, '/');
 		if(pSlash)
 			return  ++pSlash;
 		else
-			return pszName;
+			return pszPathname;
 	}
 
 	return NULL;
@@ -480,7 +522,7 @@ static bool _IsInternalEmmc(const char *pszDevNode)
 	if(pszDevNode)
 	{
 		const char *pszDevName = _GetFileSpec(pszDevNode);
-		return _STR_EQUALS(pszDevName, _INTERNAL_EMMC_PART1) || _STR_EQUALS(pszDevName, _INTERNAL_EMMC_PART2);
+		return _STR_EQUALS(pszDevName, _INTERNAL_EMMC_PART2) || _STR_EQUALS(pszDevName, _INTERNAL_EMMC_PART1);
 	}
 
 	return false;
@@ -492,14 +534,14 @@ static void _EnumDevProperties(struct udev_device *dev, int nIndent)
 	if(dev)
 	{
 		struct udev_list_entry *prop;
-		struct udev_list_entry *props = udev_device_get_properties_list_entry(dev);
+		struct udev_list_entry *props = ::udev_device_get_properties_list_entry(dev);
 
 		if(props)
 		{
 			udev_list_entry_foreach(prop, props)
 			{
-				const char *pszName = udev_list_entry_get_name(prop);
-				const char *pszValue = udev_list_entry_get_value(prop);
+				const char *pszName = ::udev_list_entry_get_name(prop);
+				const char *pszValue = ::udev_list_entry_get_value(prop);
 
 				if(pszName && pszValue)
 				{
@@ -515,13 +557,13 @@ static void _EnumDevSysAttributes(struct udev_device *dev, int nIndent)
 	if(dev)
 	{
 		struct udev_list_entry *att;
-		struct udev_list_entry *atts = udev_device_get_sysattr_list_entry(dev);
+		struct udev_list_entry *atts = ::udev_device_get_sysattr_list_entry(dev);
 		if(atts)
 		{
 			udev_list_entry_foreach(att, atts)
 			{
-				const char *pszName = udev_list_entry_get_name(att);
-				const char *pszValue = udev_device_get_sysattr_value(dev, pszName);
+				const char *pszName = ::udev_list_entry_get_name(att);
+				const char *pszValue = ::udev_device_get_sysattr_value(dev, pszName);
 
 				if(pszName && pszValue && strcmp(pszName, "uevent"))
 				{
@@ -533,13 +575,6 @@ static void _EnumDevSysAttributes(struct udev_device *dev, int nIndent)
 }
 #endif
 
-#define _BYTE_SIZE_KIB					(1ULL << 10) // Kibibyte
-#define _BYTE_SIZE_MIB					(1ULL << 20) // Mebibyte
-#define _BYTE_SIZE_GIB					(1ULL << 30) // Gibibyte
-#define _BYTE_SIZE_TIB					(1ULL << 40) // Tebibyte
-#define _BYTE_SIZE_PIB					(1ULL << 50) // Pebibyte
-#define _BYTE_SIZE_EIB					(1ULL << 60) // Exbibyte
-
 static const char *_FormatByteSize(unsigned long long nCb, char *pszBuf, size_t nCChBuf)
 {
 	if(pszBuf && nCChBuf)
@@ -549,7 +584,7 @@ static const char *_FormatByteSize(unsigned long long nCb, char *pszBuf, size_t
 		
 		if(nCb < _BYTE_SIZE_KIB)
 		{
-			snprintf(pszBuf, nCChBuf, "%llu Byte", nCb); // Byte
+			snprintf(pszBuf, nCChBuf, "%llu B", nCb); // Byte
 		}
 		else if(nCb < _BYTE_SIZE_MIB)
 		{
@@ -583,7 +618,7 @@ static const char *_FormatByteSize(unsigned long long nCb, char *pszBuf, size_t
 	return NULL;
 }
 
-static void _DumpStorageDeviceMap(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
+static void _DumpDeviceMap(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 {
 	TRACE("\n");
 	for(size_t i = 0; i < _countof(sdm.disks); ++i)
@@ -591,17 +626,17 @@ static void _DumpStorageDeviceMap(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 		char szByteBuf[16];
 		const GFA_SYSINFO_DISK &disk = sdm.disks[i];
 
-		if(disk.valid)
+		if(disk.valid && !disk.internal)
 		{
 			TRACE("Disk:\n");
 			TRACE("  |-Label:  %s\n", disk.szName);
-			TRACE("  |-Vendor: %s\n", *disk.szVendor ? disk.szVendor : "");
+			TRACE("  |-Vendor: %s\n", *disk.szVendor ? disk.szVendor : "n/a");
 			TRACE("  |-Node:   %s\n", disk.szDevNode);
 			TRACE("  |-Type:   %s\n", *disk.szBus ? disk.szBus : "mmc");
 
 			for(unsigned int j = 0; j < disk.nPartCount; ++j)
 			{
-				ssize_t nIndex = disk.aPartIdx[j];
+				int nIndex = disk.aPartIdx[j];
 				const GFA_SYSINFO_PARTITION &part = sdm.parts[nIndex];
 				bool bMounted = !!*part.szMntPoint;
 
@@ -662,7 +697,7 @@ static const char* _ReadDevPropertyValue(struct udev_device* dev, const char *ps
 	    return NULL;
    memset(pszValue, 0, nCChValue);
 
-    const char *pszVal = udev_device_get_property_value(dev, pszKey);
+    const char *pszVal = ::udev_device_get_property_value(dev, pszKey);
 
     if(pszVal)
     {
@@ -692,18 +727,19 @@ static void _ProcessPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, MountMap &mm,
 		GFA_SYSINFO_PARTITION part;
 		memset(&part, 0, sizeof(part));
 		part.nDiskIdx = -1;
-		ssize_t nPartIdx = -1;
-		ssize_t nDiskIdx = -1;
+		int nPartIdx = -1;
+		int nDiskIdx = -1;
 
-		const char *pszDevNode = udev_device_get_devnode(dev);
+		const char *pszDevNode = ::udev_device_get_devnode(dev);
 
 		if(!pszDevNode)
 			return;
-		if(_IsInternalEmmc(pszDevNode))
-			return;	// skip internal emmc
+//		if(_IsInternalEmmc(pszDevNode))
+//			return;	// skip internal emmc
+		bool bInternalEmmc = _IsInternalEmmc(pszDevNode);
 		strncpy(part.szDevNode, pszDevNode, sizeof(part.szDevNode) - 1);
 
-		const char *pszAction = udev_device_get_action(dev);
+		const char *pszAction = ::udev_device_get_action(dev);
 		bool bAdd = _STR_EQUALS(pszAction, "add");
 		bool bRem = _STR_EQUALS(pszAction, "remove");
 		bool bEnum = !pszAction;
@@ -713,20 +749,20 @@ static void _ProcessPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, MountMap &mm,
 			if(_LookupPartition(sdm, part.szDevNode) >= 0)
 				return;
 
+			part.internal = bInternalEmmc;
 			_ReadDevPropertyValue(dev, "ID_FS_LABEL", part.szFsLabel, sizeof(part.szFsLabel), true);
 			_ReadDevPropertyValue(dev, "ID_FS_TYPE", part.szFsType, sizeof(part.szFsType), true);
 			_ReadDevPropertyValue(dev, "ID_FS_VERSION", part.szFsVersion, sizeof(part.szFsVersion), true);
 			part.nKiBPartSize = _ReadDevPropertyValue(dev, "ID_PART_ENTRY_SIZE") / 2;
-
-			_UpdatePartitionSizeInfo(mm, part);
+			_UpdatePartitionFsInfo(mm, part);
 
 			struct udev_device* cur = dev;
 
-			while((cur = udev_device_get_parent(cur)))
+			while((cur = ::udev_device_get_parent(cur)))
 			{
-				const char *pszSs = udev_device_get_subsystem(cur);
-				const char *pszDt = udev_device_get_devtype(cur);
-				const char *pszDn = udev_device_get_devnode(cur);
+				const char *pszSs = ::udev_device_get_subsystem(cur);
+				const char *pszDt = ::udev_device_get_devtype(cur);
+				const char *pszDn = ::udev_device_get_devnode(cur);
 
 				if(!pszDn)
 					break;
@@ -739,11 +775,15 @@ static void _ProcessPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, MountMap &mm,
 						memset(&disk, 0, sizeof(disk));
 						strncpy(disk.szDevNode, pszDn, sizeof(disk.szDevNode) - 1);
 
+						disk.internal = bInternalEmmc;
 						if(!_ReadDevPropertyValue(cur, "ID_NAME", disk.szName, sizeof(disk.szName), true))
 							_ReadDevPropertyValue(cur, "ID_MODEL", disk.szName, sizeof(disk.szName), true);
 						_ReadDevPropertyValue(cur, "ID_VENDOR", disk.szVendor, sizeof(disk.szVendor), true);
 						_ReadDevPropertyValue(cur, "ID_BUS", disk.szBus, sizeof(disk.szBus), true);
 
+						disk.nVendorID	= _ReadDevPropertyValue(cur, "ID_VENDOR_ID", 16);
+						disk.nProductID	= _ReadDevPropertyValue(cur, "ID_MODEL_ID", 16);
+
 						if((nDiskIdx = _AddDisk(sdm, disk, bChange)) >= 0)
 						{
 							if((nPartIdx = _AddPartition(sdm, part, bChange)) < 0)
@@ -781,26 +821,34 @@ static void _ProcessPartition(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, MountMap &mm,
 	}
 }
 
-static void _EnumStorageDevices(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, MountMap &mm, struct udev* udev)
+static void _EnumStorageDevices(GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm, MountMap &mm, struct udev *pUdev)
 {
-	struct udev_enumerate* enumerate = udev_enumerate_new(udev);
-	udev_enumerate_add_match_subsystem(enumerate, "block");
-	udev_enumerate_add_match_property(enumerate, "DEVTYPE", "partition");
-	udev_enumerate_scan_devices(enumerate);
+	struct udev_enumerate *pEnum = ::udev_enumerate_new(pUdev);
+	::udev_enumerate_add_match_subsystem(pEnum, "block");
+	::udev_enumerate_add_match_property(pEnum, "DEVTYPE", "partition");
+	::udev_enumerate_scan_devices(pEnum);
 
-	struct udev_list_entry *devices = udev_enumerate_get_list_entry(enumerate);
+	struct udev_list_entry *devices = ::udev_enumerate_get_list_entry(pEnum);
 	struct udev_list_entry *entry;
 
 	udev_list_entry_foreach(entry, devices)
 	{
-		const char *pszPath = udev_list_entry_get_name(entry);
-		struct udev_device* dev = udev_device_new_from_syspath(udev, pszPath);
+		const char *pszPath = ::udev_list_entry_get_name(entry);
+		struct udev_device* dev = ::udev_device_new_from_syspath(pUdev, pszPath);
 
 		_ProcessPartition(sdm, mm, dev);
-		udev_device_unref(dev);
+		::udev_device_unref(dev);
 	}
 
-	udev_enumerate_unref(enumerate);
+	::udev_enumerate_unref(pEnum);
+}
+/////////////////////////////////////////////////////////////////////////////
+
+static void _SigHandler(int sig)
+{
+	UNUSED(sig);
+	g_fPause = false;
+	g_fRun = false;
 }
 
 /////////////////////////////////////////////////////////////////////////////
@@ -816,7 +864,7 @@ int main(int argc, char *argv[])
 	HAPPINFO hAI;
 	CCycleTimer ct(_CYCLE_INTV);
 	cy_time_t wStart, wEnd, wCur = 0;
-	struct udev* udev = NULL;
+	struct udev *pUdev = NULL;
 	struct timeval tv;
 	memset(&tv, 0, sizeof(tv));
 	struct udev_monitor *pUdevMon = NULL;
@@ -857,39 +905,53 @@ int main(int argc, char *argv[])
 	do
 	{
 		if(!(hAC = ::GfaIpcAppCtrlAcquire(_APPID, _APPNAME, _CYCLE_INTV * 1000, _CYCLE_INTV * 3000)))
+	    {
+	        TRACE("GfaIpcAppCtrlAcquire failed\n");
 			break;
+	    }
 
 		if(!::GfaIpcAppCtrlCreateSysInfo(hAC))
+	    {
+	        TRACE("GfaIpcAppCtrlCreateSysInfo failed\n");
 			break;
+	    }
 
-	    if(!(udev = udev_new()))
+	    if(!(pUdev = ::udev_new()))
 	    {
-	        fprintf(stderr, "udev_new() failed\n");
-	        return 1;
+	        TRACE("udev_new failed\n");
+			break;
 	    }
 
 		_UpdateMountMap(mm);
-		_EnumStorageDevices(sdm, mm, udev);
-		_DumpStorageDeviceMap(sdm);
+		_EnumStorageDevices(sdm, mm, pUdev);
 
-		if((pUdevMon = udev_monitor_new_from_netlink(udev, "udev")))
+		if(!(pUdevMon = ::udev_monitor_new_from_netlink(pUdev, "udev")))
 		{
-			udev_monitor_filter_add_match_subsystem_devtype(pUdevMon, "block", "partition");
-			udev_monitor_enable_receiving(pUdevMon);
-
-			pfd[0].fd = udev_monitor_get_fd(pUdevMon);
-			pfd[0].events = POLLIN;
-			pfd[0].revents = 0;
-			pfd[1].fd = open(_MOUNTS_FILE, O_RDONLY, 0);
-			pfd[1].events = POLLPRI;
-			pfd[1].revents = 0;
+	        TRACE("udev_monitor_new_from_netlink failed\n");
+			break;
 		}
 
-//		;;GfaIpcDumpSHMROT();
-		::GfaIpcAppCtrlSetState(hAC, GIAS_Initializing);
+		if(::udev_monitor_filter_add_match_subsystem_devtype(pUdevMon, "block", "partition") < 0)
+		{
+	        TRACE("udev_monitor_filter_add_match_subsystem_devtype failed\n");
+			break;
+		}
 
-//		if(!::GfaIpcAppCtrlSubscribeStateEvents(hAC, GFA_APPCTRL_APPID_USER_01))
-//			break;
+		if(::udev_monitor_enable_receiving(pUdevMon) < 0)
+		{
+	        TRACE("udev_monitor_enable_receiving failed\n");
+			break;
+		}
+
+		pfd[0].fd = ::udev_monitor_get_fd(pUdevMon);
+		pfd[0].events = POLLIN;
+		pfd[0].revents = 0;
+		pfd[1].fd = open(_MOUNTS_FILE, O_RDONLY, 0);
+		pfd[1].events = POLLPRI;
+		pfd[1].revents = 0;
+
+		;;GfaIpcDumpSHMROT();
+		::GfaIpcAppCtrlSetState(hAC, GIAS_Initializing);
 
 		TRACE("My Name:  %s\n", _APPNAME);
 		TRACE("My AppID: %llu\n", _APPID);
@@ -899,6 +961,7 @@ int main(int argc, char *argv[])
 		g_fRun = true;
 		::GfaIpcAppCtrlSetState(hAC, GIAS_Running);
 		::GfaIpcAppCtrlUpdateStorageDeviceMap(hAC, sdm);
+//		_DumpDeviceMap(sdm);
 	}
 	while(false);
 
@@ -920,7 +983,6 @@ int main(int argc, char *argv[])
 		if((hAI = ::GfaIpcAppCtrlInfoUpdate(hAC, wCur)))
 		{
 			_ProcessCtrlMessages(hAC, hAI);
-//			_ProcessStateEvents(hAC, hAI);
 		}
 
 		/////////////////////////////////////////////////////////////////////
@@ -943,7 +1005,7 @@ int main(int argc, char *argv[])
 				{
 					struct udev_device* dev;
 
-					while((dev = udev_monitor_receive_device(pUdevMon)))
+					while((dev = ::udev_monitor_receive_device(pUdevMon)))
 					{
 						_ProcessPartition(sdm, mm, dev);
 					}
@@ -955,10 +1017,10 @@ int main(int argc, char *argv[])
 				}
 			}
 
-			if(_MapChanged(sdm))
+			if(_DeviceMapChanged(sdm))
 			{
 				::GfaIpcAppCtrlUpdateStorageDeviceMap(hAC, sdm);
-				_DumpStorageDeviceMap(sdm);
+//				_DumpDeviceMap(sdm);
 			}
 		}
 
@@ -979,9 +1041,9 @@ int main(int argc, char *argv[])
 	if(pfd[1].fd >= 0)
 		close(pfd[1].fd);
 	if(pUdevMon)
-		udev_monitor_unref(pUdevMon);
-	if(udev)
-		udev_unref(udev);
+		::udev_monitor_unref(pUdevMon);
+	if(pUdev)
+		::udev_unref(pUdev);
 
 	if(hAC)
 	{

+ 56 - 21
src/appctrl.cpp

@@ -32,7 +32,10 @@
 #define _DELETE_DISK(pd)						pd.valid = false
 #define _COPY_PARTITION(pd, ps)					memcpy(&pd, &ps, sizeof(pd))
 #define _DELETE_PARTITION(pd)					pd.valid = false
-#define _COPY_MOUNTPOINT(pd, ps)				memcpy(pd.szMntPoint, ps.szMntPoint, sizeof(pd.szMntPoint))
+#define _COPY_MOUNTPOINT(pd, ps)				memcpy(pd.szMntPoint, ps.szMntPoint, sizeof(pd.szMntPoint)), \
+												pd.nKiBSize = ps.nKiBSize, \
+												pd.nKiBFree = ps.nKiBFree, \
+												pd.nKiBUsed = ps.nKiBUsed
 #define _DELETE_MOUNTPOINT(pd)					memset(pd.szMntPoint, 0, sizeof(pd.szMntPoint))
 
 /////////////////////////////////////////////////////////////////////////////
@@ -786,16 +789,43 @@ bool CAppCtrl::GetAppMem(appid_t nAppID, LPGFA_APPCTRL_APPMEM pam)
 
 /////////////////////////////////////////////////////////////////////////////
 
+bool CAppCtrl::GetSysMem(LPGFA_APPCTRL_SYSMEM psm)
+{
+	if(m_hShm)
+	{
+		const APP_CTRL_SYSTEM &sys = m_pAppCtrl->sys;
+		if(psm)
+		{
+			CAppCtrlShmLocker locker(*this);
+			memcpy(psm, &sys.mem, sizeof(GFA_APPCTRL_SYSMEM));
+			return true;
+		}
+	}
+
+	return false;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
 bool CAppCtrl::CreateSysInfo(void)
 {
 	APP_CTRL_SYSTEM &sys = m_pAppCtrl->sys;
 	CAppCtrlShmLocker locker(*this);
+	bool bBootFromEmmc = false;
 
 	if(!sys.nPidInCharge)
 	{
 		memset(&sys, 0, sizeof(APP_CTRL_SYSTEM));
 		sys.nPidInCharge = m_pid;
-		return true;
+#if _TARGET_BUILD
+		if(m_sysInfo.GetBootInfo(bBootFromEmmc))
+		{
+			sys.bBootFromEmmc = bBootFromEmmc;
+			return true;
+		}
+#else	//	_TARGET_BUILD
+			return true;
+#endif	//	_TARGET_BUILD
 	}
 	else
 	{
@@ -805,7 +835,11 @@ bool CAppCtrl::CreateSysInfo(void)
 		{
 			memset(&sys, 0, sizeof(APP_CTRL_SYSTEM));
 			sys.nPidInCharge = m_pid;
-			return true;
+			if(m_sysInfo.GetBootInfo(bBootFromEmmc))
+			{
+				sys.bBootFromEmmc = bBootFromEmmc;
+				return true;
+			}
 		}
 	}
 
@@ -843,22 +877,22 @@ bool CAppCtrl::UpdateSysInfo(void)
 		if(m_sysInfo.Update())
 		{
 			const SI_VAL &rMemTotal = m_sysInfo.MemTotal();
-			sys.nMemTotal = rMemTotal.valid ? (uint32_t)rMemTotal.cb : 0;
+			sys.mem.nMemTotal = rMemTotal.valid ? (uint32_t)rMemTotal.cb : 0;
 
 			const SI_VAL &rMemUsed = m_sysInfo.MemUsed();
-			sys.nMemUsed = rMemUsed.valid ? (uint32_t)rMemUsed.cb : 0;
+			sys.mem.nMemUsed = rMemUsed.valid ? (uint32_t)rMemUsed.cb : 0;
 
 			const SI_VAL &rMemFree = m_sysInfo.MemFree();
-			sys.nMemFree = rMemFree.valid ? (uint32_t)rMemFree.cb : 0;
+			sys.mem.nMemFree = rMemFree.valid ? (uint32_t)rMemFree.cb : 0;
 
 			const SI_VAL &rMemAvailable = m_sysInfo.MemAvailable();
-			sys.nMemAvailable = rMemAvailable.valid ? (uint32_t)rMemAvailable.cb : 0;
+			sys.mem.nMemAvailable = rMemAvailable.valid ? (uint32_t)rMemAvailable.cb : 0;
 
 			const SI_VAL &rMemBuffers = m_sysInfo.MemBuffers();
-			sys.nMemBuffers = rMemBuffers.valid ? (uint32_t)rMemBuffers.cb : 0;
+			sys.mem.nMemBuffers = rMemBuffers.valid ? (uint32_t)rMemBuffers.cb : 0;
 
 			const SI_VAL &rMemCached = m_sysInfo.MemCached();
-			sys.nMemCached = rMemCached.valid ? (uint32_t)rMemCached.cb : 0;
+			sys.mem.nMemCached = rMemCached.valid ? (uint32_t)rMemCached.cb : 0;
 
 			sys.nUpdateError = 0;
 			sys.nClkLastUpdate = t;
@@ -881,7 +915,7 @@ bool CAppCtrl::UpdateStorageDeviceMap(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 
 	while(nPartChangeMask)
 	{
-		ssize_t nPartIdx = ffsll(nPartChangeMask) - 1;
+		int nPartIdx = ffsll(nPartChangeMask) - 1;
 		uint32_t nPartBit = (0x01 << nPartIdx);
 		nPartChangeMask &= ~nPartBit;
 		
@@ -889,7 +923,7 @@ bool CAppCtrl::UpdateStorageDeviceMap(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 		{
 			const GFA_SYSINFO_PARTITION &partNew = sdm.parts[nPartIdx];
 			GFA_SYSINFO_PARTITION &partShm = sys.sdm.parts[nPartIdx];
-			ssize_t nDiskIdx = partNew.nDiskIdx;
+			int nDiskIdx = partNew.nDiskIdx;
 			
 			if((nDiskIdx >= 0) && (nDiskIdx < (ssize_t)_countof(sdm.disks)))
 			{
@@ -900,21 +934,18 @@ bool CAppCtrl::UpdateStorageDeviceMap(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 				if(diskNew.valid && !diskShm.valid)
 				{
 					// disk add
-					TRACE("IPC: Disk add!\n");
 					_COPY_DISK(diskShm, diskNew);
 					sys.nDiskMask |= nDiskBit;
 				}
 				else if(!diskNew.valid && diskShm.valid)
 				{
 					// disk remove
-					TRACE("IPC: Disk remove!\n");
 					_DELETE_DISK(diskShm);
 					sys.nDiskMask &= ~nDiskBit;
 				}
 				else if(diskNew.valid && diskShm.valid)
 				{
 					// disk change
-					TRACE("IPC: Disk change!\n");
 					_COPY_DISK(diskShm, diskNew);
 					sys.nDiskMask |= nDiskBit;
 				}
@@ -922,39 +953,36 @@ bool CAppCtrl::UpdateStorageDeviceMap(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 				if(partNew.valid && !partShm.valid)
 				{
 					// partition add
-					TRACE("IPC: Partition add!\n");
 					_COPY_PARTITION(partShm, partNew);
 					sys.nPartMask |= nPartBit;
 				}
 				else if(!partNew.valid && partShm.valid)
 				{
 					// partition remove
-					TRACE("IPC: Partition remove!\n");
 					_DELETE_PARTITION(partShm);
 					sys.nPartMask &= ~nPartBit;
 				}
-				else if(partNew.valid && partShm.valid)
+
+				if(partNew.valid && partShm.valid)
 				{
 					// partition change
 					if(*partNew.szMntPoint && !*partShm.szMntPoint)
 					{
 						// mountpoint add
-						TRACE("IPC: Mountpoint add!\n");
 						_COPY_MOUNTPOINT(partShm, partNew);
 						sys.nMountMask |= nPartBit;
 					}
 					else if(!*partNew.szMntPoint && *partShm.szMntPoint)
 					{
 						// mountpoint remove
-						TRACE("IPC: Mountpoint remove!\n");
 						_DELETE_MOUNTPOINT(partShm);
 						sys.nMountMask &= ~nPartBit;
 					}
 					else if(*partNew.szMntPoint && *partShm.szMntPoint)
 					{
 						// mountpoint change
-						TRACE("IPC: Mountpoint change!\n");
-						_COPY_MOUNTPOINT(partShm, partNew);
+						if(strcmp(partNew.szMntPoint, partShm.szMntPoint))
+							_COPY_MOUNTPOINT(partShm, partNew);
 						sys.nMountMask |= nPartBit;
 					}
 				}
@@ -1458,6 +1486,13 @@ int GfaIpcAppCtrlGetNextMountRemoved(HAPPCTRL hAC, LPGFA_SYSINFO_PARTITION pPart
 	return -1;
 }
 
+bool GfaIpcAppCtrlGetSysMem(HAPPCTRL hAC, LPGFA_APPCTRL_SYSMEM psm)
+{
+	CAppCtrl *p = reinterpret_cast<CAppCtrl*>(hAC);
+	if(p)
+		return p->GetSysMem(psm);
+	return false;
+}
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////

+ 3 - 8
src/appctrl.h

@@ -45,20 +45,14 @@ typedef const APP_CTRL_INFO *LPCAPP_CTRL_INFO;
 typedef struct _APP_CTRL_SYSTEM
 {
 	pid_t nPidInCharge;
+	bool bBootFromEmmc;
 	time_t nTsSystemStart;
 	clock64_t nClkLastUpdate;
 	int nUpdateError;
-	uint32_t nMemTotal;
-	uint32_t nMemUsed;
-	uint32_t nMemFree;
-	uint32_t nMemAvailable;
-	uint32_t nMemBuffers;
-	uint32_t nMemCached;
+	GFA_APPCTRL_SYSMEM mem;
 	uint32_t nDiskMask;
 	uint32_t nPartMask;
 	uint32_t nMountMask;
-//	uint64_t nUsbDeviceMask;
-//	GFA_USB_DEVICE_INFO usb[_USB_DEVICE_LIST_MAX_ENTRIES];
 	GFA_SYSINFO_STORAGE_DEVICE_MAP sdm;
 }APP_CTRL_SYSTEM, *LPAPP_CTRL_SYSTEM;
 typedef const APP_CTRL_SYSTEM *LPCAPP_CTRL_SYSTEM;
@@ -156,6 +150,7 @@ public:
 	bool UpdateSysInfo(void);
 	bool UpdateStorageDeviceMap(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm);
 
+	bool GetSysMem(LPGFA_APPCTRL_SYSMEM psm);
 
 	bool SubscribeSysEvents(sysevt_t nEvtMask);
 	bool UnsubscribeSysEvents(sysevt_t nEvtMask);

+ 57 - 34
src/gfaipc.h

@@ -6,6 +6,7 @@
 
 #include <stdlib.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <linux/limits.h>
 
 #ifdef __cplusplus
@@ -71,11 +72,11 @@ typedef enum
 #define GFA_APPCTRL_APPID_MQTTCL					GFA_APPCTRL_MAKE_APPID(GAI_Mqttcl)
 #define GFA_APPCTRL_APPID_SYSINFO					GFA_APPCTRL_MAKE_APPID(GAI_SysInfo)
 
-#define GFA_APPCTRL_APPID_ALL_GFA					(GFA_APPCTRL_APPID_REMANENT |	\
-													GFA_APPCTRL_APPID_DATALOGGER |	\
-													GFA_APPCTRL_APPID_SUMMARIST |	\
-													GFA_APPCTRL_APPID_REST |		\
-													GFA_APPCTRL_APPID_MQTTCL |		\
+#define GFA_APPCTRL_APPID_ALL_GFA					(GFA_APPCTRL_APPID_REMANENT		|	\
+													GFA_APPCTRL_APPID_DATALOGGER	|	\
+													GFA_APPCTRL_APPID_SUMMARIST		|	\
+													GFA_APPCTRL_APPID_REST			|	\
+													GFA_APPCTRL_APPID_MQTTCL		|	\
 													GFA_APPCTRL_APPID_SYSINFO)
 
 /////////////////////////////////////////////////////////////////////////////
@@ -166,6 +167,19 @@ typedef enum
 
 /////////////////////////////////////////////////////////////////////////////
 
+#define GFA_APPCTRL_MAX_DISKS						8
+#define GFA_APPCTRL_MAX_PARTITIONS					16
+#define GFA_APPCTRL_MAX_DEV_NODE_LENGTH				128
+#define GFA_APPCTRL_MAX_MOUNT_POINT_LENGTH			256
+#define GFA_APPCTRL_MAX_BUS_NAME_LENGTH				32
+#define GFA_APPCTRL_MAX_FS_LABEL_LENGTH				32
+#define GFA_APPCTRL_MAX_FS_TYPE_LENGTH				32
+#define GFA_APPCTRL_MAX_FS_VERSION_LENGTH			32
+#define GFA_APPCTRL_MAX_DISK_NAME_LENGTH			64
+#define GFA_APPCTRL_MAX_DISK_VENDOR_NAME_LENGTH		64
+
+/////////////////////////////////////////////////////////////////////////////
+
 typedef enum
 {
 	GIAS_StateNotRunning,
@@ -211,23 +225,24 @@ typedef const GFA_APPCTRL_APPMEM *LPCGFA_APPCTRL_APPMEM;
 
 /////////////////////////////////////////////////////////////////////////////
 
-#define GFA_APPCTRL_MAX_DISKS						8
-#define GFA_APPCTRL_MAX_PARTITIONS					16
-#define GFA_APPCTRL_MAX_DEV_NODE_LENGTH				128
-#define GFA_APPCTRL_MAX_MOUNT_POINT_LENGTH			256
-#define GFA_APPCTRL_MAX_BUS_NAME_LENGTH				32
-#define GFA_APPCTRL_MAX_FS_LABEL_LENGTH				32
-#define GFA_APPCTRL_MAX_FS_TYPE_LENGTH				32
-#define GFA_APPCTRL_MAX_FS_VERSION_LENGTH			32
-#define GFA_APPCTRL_MAX_DISK_NAME_LENGTH			64
-#define GFA_APPCTRL_MAX_DISK_VENDOR_NAME_LENGTH		64
+typedef struct _GFA_APPCTRL_SYSMEM
+{
+	size_t nMemTotal;
+	size_t nMemUsed;
+	size_t nMemFree;
+	size_t nMemAvailable;
+	size_t nMemBuffers;
+	size_t nMemCached;
+}GFA_APPCTRL_SYSMEM, *LPGFA_APPCTRL_SYSMEM;
+typedef const GFA_APPCTRL_SYSMEM *LPCGFA_APPCTRL_SYSMEM;
 
 /////////////////////////////////////////////////////////////////////////////
 
 typedef struct _GFA_SYSINFO_PARTITION
 {
 	bool valid;
-	ssize_t nDiskIdx;
+	bool internal;
+	int nDiskIdx;
 	size_t nKiBPartSize;
 	size_t nKiBSize;
 	size_t nKiBFree;
@@ -245,45 +260,50 @@ typedef const GFA_SYSINFO_PARTITION *LPCGFA_SYSINFO_PARTITION;
 typedef struct _GFA_SYSINFO_DISK
 {
 	bool valid;
+	bool internal;
+	uint8_t nVendorID;
+	uint8_t nProductID;
 	char szDevNode[GFA_APPCTRL_MAX_DEV_NODE_LENGTH];
 	char szName[GFA_APPCTRL_MAX_DISK_NAME_LENGTH];
 	char szVendor[GFA_APPCTRL_MAX_DISK_VENDOR_NAME_LENGTH];
 	char szBus[GFA_APPCTRL_MAX_BUS_NAME_LENGTH];
 	unsigned int nPartCount;
-	ssize_t aPartIdx[GFA_APPCTRL_MAX_PARTITIONS];
+	int aPartIdx[GFA_APPCTRL_MAX_PARTITIONS];
 }GFA_SYSINFO_DISK, *LPGFA_SYSINFO_DISK;
 typedef const GFA_SYSINFO_DISK *LPCGFA_SYSINFO_DISK;
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-HAPPCTRL		GfaIpcAppCtrlAcquire			(appid_t nAppID, const char *pszDisplayName, clock64_t nCycleIntvUs, clock64_t nMaxHeartbeatDelayUs);
-void			GfaIpcAppCtrlRelease			(HAPPCTRL hAC);
+HAPPCTRL		GfaIpcAppCtrlAcquire				(appid_t nAppID, const char *pszDisplayName, clock64_t nCycleIntvUs, clock64_t nMaxHeartbeatDelayUs);
+void			GfaIpcAppCtrlRelease				(HAPPCTRL hAC);
 
-appid_t			GfaIpcAppCtrlGetRunningMask		(HAPPCTRL hAC);
-HAPPINFO		GfaIpcAppCtrlInfoUpdate			(HAPPCTRL hAC, clock64_t nCurWorkingTime);
+appid_t			GfaIpcAppCtrlGetRunningMask			(HAPPCTRL hAC);
+HAPPINFO		GfaIpcAppCtrlInfoUpdate				(HAPPCTRL hAC, clock64_t nCurWorkingTime);
 
-GfaIpcAppStates	GfaIpcAppCtrlGetState			(HAPPCTRL hAC, appid_t nAppID);
-GfaIpcAppStates	GfaIpcAppCtrlSetState			(HAPPCTRL hAC, GfaIpcAppStates state);
+GfaIpcAppStates	GfaIpcAppCtrlGetState				(HAPPCTRL hAC, appid_t nAppID);
+GfaIpcAppStates	GfaIpcAppCtrlSetState				(HAPPCTRL hAC, GfaIpcAppStates state);
 
-const char*		GfaIpcAppCtrlGetDisplayName		(HAPPCTRL hAC, appid_t nAppID, char *pszName, size_t nCChName);
-bool			GfaIpcAppCtrlPresetDisplayName	(HAPPCTRL hAC, appid_t nAppID, const char *pszName);
+const char*		GfaIpcAppCtrlGetDisplayName			(HAPPCTRL hAC, appid_t nAppID, char *pszName, size_t nCChName);
+bool			GfaIpcAppCtrlPresetDisplayName		(HAPPCTRL hAC, appid_t nAppID, const char *pszName);
 
 bool			GfaIpcAppCtrlSubscribeStateEvents	(HAPPCTRL hAC, appid_t nAppMask);
 bool			GfaIpcAppCtrlUnsubscribeStateEvents	(HAPPCTRL hAC, appid_t nAppMask);
 appid_t			GfaIpcAppCtrlGetPendingStateEvents	(HAPPCTRL hAC);
 
-bool			GfaIpcAppCtrlSendCtrlMsg		(HAPPCTRL hAC, appid_t nAppID, ctrlmsg_t msg);
-ctrlmsg_t		GfaIpcAppCtrlGetPendingCtrlMsg	(HAPPCTRL hAC);
+bool			GfaIpcAppCtrlSendCtrlMsg			(HAPPCTRL hAC, appid_t nAppID, ctrlmsg_t msg);
+ctrlmsg_t		GfaIpcAppCtrlGetPendingCtrlMsg		(HAPPCTRL hAC);
 
-clock64_t		GfaIpcAppCtrlGetAppTimes		(HAPPCTRL hAC, appid_t nAppID, LPGFA_APPCTRL_APPTIMES pat);
-bool			GfaIpcAppCtrlGetAppMem			(HAPPCTRL hAC, appid_t nAppID, LPGFA_APPCTRL_APPMEM pam);
-size_t			GfaIpcAppCtrlGetAppSize			(HAPPCTRL hAC, appid_t nAppID);
+clock64_t		GfaIpcAppCtrlGetAppTimes			(HAPPCTRL hAC, appid_t nAppID, LPGFA_APPCTRL_APPTIMES pat);
+bool			GfaIpcAppCtrlGetAppMem				(HAPPCTRL hAC, appid_t nAppID, LPGFA_APPCTRL_APPMEM pam);
+size_t			GfaIpcAppCtrlGetAppSize				(HAPPCTRL hAC, appid_t nAppID);
 
 bool			GfaIpcAppCtrlSubscribeSysEvents		(HAPPCTRL hAC, sysevt_t nEvtMask);
 bool			GfaIpcAppCtrlUnsubscribeSysEvents	(HAPPCTRL hAC, sysevt_t nEvtMask);
 sysevt_t		GfaIpcAppCtrlGetPendingSysEvents	(HAPPCTRL hAC);
 
+bool			GfaIpcAppCtrlGetSysMem				(HAPPCTRL hAC, LPGFA_APPCTRL_SYSMEM psm);
+
 int				GfaIpcAppCtrlGetNextDiskAdded		(HAPPCTRL hAC, LPGFA_SYSINFO_DISK pDisk);
 int				GfaIpcAppCtrlGetNextDiskRemoved		(HAPPCTRL hAC, LPGFA_SYSINFO_DISK pDisk);
 int				GfaIpcAppCtrlGetNextPartitionAdded	(HAPPCTRL hAC, LPGFA_SYSINFO_PARTITION pPart);
@@ -292,12 +312,15 @@ int				GfaIpcAppCtrlGetNextMountAdded		(HAPPCTRL hAC, LPGFA_SYSINFO_PARTITION pP
 int				GfaIpcAppCtrlGetNextMountRemoved	(HAPPCTRL hAC, LPGFA_SYSINFO_PARTITION pPart);
 
 /////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+ctrlmsg_t		GfaIpcAppCtrlGetNextCtrlMsg			(HAPPINFO hAI);
+appid_t			GfaIpcAppCtrlGetNextStateEvtSrc		(HAPPINFO hAI);
+sysevt_t		GfaIpcAppCtrlGetNextSysEvt			(HAPPINFO hAI);
 
-ctrlmsg_t		GfaIpcAppCtrlGetNextCtrlMsg		(HAPPINFO hAI);
-appid_t			GfaIpcAppCtrlGetNextStateEvtSrc	(HAPPINFO hAI);
-sysevt_t		GfaIpcAppCtrlGetNextSysEvt		(HAPPINFO hAI);
+/////////////////////////////////////////////////////////////////////////////
 
-const char*		GfaIpcAppCtrlGetStateText		(GfaIpcAppStates state);
+const char*		GfaIpcAppCtrlGetStateText			(GfaIpcAppStates state);
 
 /////////////////////////////////////////////////////////////////////////////
 #ifdef __cplusplus

+ 56 - 0
src/sysinfo.cpp

@@ -6,6 +6,10 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <regex>
 #include "defines.h"
 #include "sysinfo.h"
 
@@ -19,6 +23,7 @@
 
 #define _BUFFER_SIZE						2048
 #define _MEM_INFO_PATH						"/proc/meminfo"
+#define _CMD_LINE_PATH						"/proc/cmdline"
 
 #define _FLAG_MEM_TOTAL						0x0001
 #define _FLAG_MEM_FREE						0x0002
@@ -27,6 +32,12 @@
 #define _FLAG_MEM_CACHED					0x0010
 
 #define _FLAG_ALL_MEM						(_FLAG_MEM_TOTAL | _FLAG_MEM_FREE | _FLAG_MEM_AVAIL | _FLAG_MEM_BUFFERS | _FLAG_MEM_CACHED)
+#define _INTERNAL_EMMC_DISK1				"mmcblk1"
+#define _INTERNAL_EMMC_PART11				"mmcblk1p1"
+#define _INTERNAL_EMMC_PART12				"mmcblk1p2"
+#define _INTERNAL_EMMC_DISK0				"mmcblk0"
+#define _INTERNAL_EMMC_PART01				"mmcblk0p1"
+#define _INTERNAL_EMMC_PART02				"mmcblk0p2"
 
 /////////////////////////////////////////////////////////////////////////////
 
@@ -93,6 +104,51 @@ CSysInfo::~CSysInfo(void)
 {
 }
 
+static const char* _FileToStdString(const char *pszFilepath, std::string &str)
+{
+	std::ifstream fBoot(pszFilepath);
+	str.clear();
+
+	if(fBoot.good())
+	{
+		str.assign((std::istreambuf_iterator<char>(fBoot)), std::istreambuf_iterator<char>());
+		return str.c_str();
+	}
+
+	return NULL;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// console=ttyO0,115200 root=/dev/mmcblk0p2 rw rootwait vram=50M cma=50M
+
+bool CSysInfo::GetBootInfo(bool &bootFromEMMC)
+{
+	if(_FileToStdString(_CMD_LINE_PATH, m_strCmdLine))
+	{
+		std::regex rg("\\broot=.+(mmcblk[0-9]p[0-9])\\b");
+		std::smatch m;
+
+		if(	std::regex_search(m_strCmdLine, m, rg) &&
+			m.size() >= 2)
+		{
+			std::string sPart = m[1];
+			
+			if(!sPart.compare(_INTERNAL_EMMC_PART12) || sPart.compare(_INTERNAL_EMMC_PART11))
+			{
+				bootFromEMMC = true;
+				return true;
+			}
+			else if(!sPart.compare(_INTERNAL_EMMC_PART02) || sPart.compare(_INTERNAL_EMMC_PART01))
+			{
+				bootFromEMMC = false;
+				return true;
+			}
+		}
+	}
+
+	return false;
+}
+
 /////////////////////////////////////////////////////////////////////////////
 
 bool CSysInfo::Update(void)

+ 4 - 0
src/sysinfo.h

@@ -4,6 +4,8 @@
 #if !defined(AGD_SYSINFO_H__2BA1C607_39A9_4627_8B42_DD0B57F6106D__INCLUDED_)
 #define AGD_SYSINFO_H__2BA1C607_39A9_4627_8B42_DD0B57F6106D__INCLUDED_
 
+#include <string>
+
 #ifdef __cplusplus
 
 /////////////////////////////////////////////////////////////////////////////
@@ -35,6 +37,7 @@ public:
 	CSysInfo(void);
 	~CSysInfo(void);
 	
+	bool GetBootInfo(bool &bootFromEMMC);
 	bool Update(void);
 
 	const SI_VAL& MemTotal(void) const {
@@ -65,6 +68,7 @@ private:
 
 private:
 	MEM_INFO m_memInfo;
+	std::string m_strCmdLine;
 };
 
 /////////////////////////////////////////////////////////////////////////////