Browse Source

change decition_braion_sf. for add ivfault.

yuchuli 3 years ago
parent
commit
5e86f743b7
2 changed files with 14 additions and 0 deletions
  1. 8 0
      src/decition/common/main.cpp
  2. 6 0
      src/decition/decition_brain_sf/decition/brain.cpp

+ 8 - 0
src/decition/common/main.cpp

@@ -9,6 +9,9 @@
 #include "ivbacktrace.h"
 
 #include "ivchart.h"
+
+#include "ivfault.h"
+
 iv::Ivchart * givchart;
 
 std::string gstrmemgps;
@@ -19,6 +22,7 @@ std::string gstrmemchassis;
 std::string gstrmembraincarstate;
 
 iv::Ivlog * givlog;
+iv::Ivfault * givfault;
 
 
 int main(int argc, char *argv[])
@@ -27,6 +31,10 @@ int main(int argc, char *argv[])
     showversion("decition_brain");
     QCoreApplication a(argc, argv);
 
+    givfault = new iv::Ivfault("decition_brain_sf");
+
+    givfault->SetFaultState(0,0,"Application Started.");
+
      QString strpath = QCoreApplication::applicationDirPath();
 
     if(argc < 2)

+ 6 - 0
src/decition/decition_brain_sf/decition/brain.cpp

@@ -12,6 +12,9 @@
 #include <fstream>
 #include <QTime>
 
+#include "ivfault.h"
+extern iv::Ivfault * givfault;
+
 using namespace std;
 
 extern std::string gstrmemdecition;
@@ -80,6 +83,7 @@ iv::decition::BrainDecition * gbrain;
 
 iv::decition::BrainDecition::BrainDecition()
 {
+    givfault->SetFaultState(0,0,"Application Initializing.");
     //    mpasd = new Adcivstatedb();
     look1 = 0.0;
     look2 = 0.0;
@@ -164,6 +168,7 @@ void iv::decition::BrainDecition::inialize() {
 
 void iv::decition::BrainDecition::run() {
 
+    givfault->SetFaultState(0,0,"Start Running.");
     double last = 0;
 
     iv::decition::Decition decition_gps = NULL;
@@ -437,6 +442,7 @@ void iv::decition::BrainDecition::run() {
     mstrmemmap_index = xp.GetParam("msg_mapindex","map_index");
 
 
+    givfault->SetFaultState(0,0,"OK.");
     while (eyes->isAllSensorRunning())
     {
         if(navigation_data.size() <1)