From dbb8472fd069ed5a66b7d4587262f1d758c0be42 Mon Sep 17 00:00:00 2001 From: jfmartel Date: Fri, 8 Feb 2019 09:59:57 -0500 Subject: [PATCH] =?UTF-8?q?Ajout=20d=C3=A9tection=20fausse=20occupationd?= =?UTF-8?q?=20du=20CDV=20ZT1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + Configuration/ZTSettings.ztc | Bin 36 -> 36 bytes sources/Simulator/SimulationScenario.cpp | 24 ++++++------ sources/ZTStateMachine.cpp | 46 +++++++++++++++++++++-- sources/ZTStateMachine.h | 1 + 5 files changed, 58 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index b82f542..5e46f3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/sources/Modbus/ModbusTKTransport.cpp.autosave +/sources/ZTStateMachine.cpp.autosave /interfaces_tmp /ZT.pro.user.Pj2362 /Escape.ZT diff --git a/Configuration/ZTSettings.ztc b/Configuration/ZTSettings.ztc index 727225b50601add2c139ec030d1f2706a5880a24..080b8f76eee675329d8ef78b8cff3d590b0936fe 100644 GIT binary patch literal 36 fcmdnB_B10SBLfga00Rir0&xlu10@cuU`PW1Uo-^p literal 36 bcmdnB_B10hU;u$yAWi{dMn;AMD=g9gU%~|` diff --git a/sources/Simulator/SimulationScenario.cpp b/sources/Simulator/SimulationScenario.cpp index 6908eb6..430c351 100644 --- a/sources/Simulator/SimulationScenario.cpp +++ b/sources/Simulator/SimulationScenario.cpp @@ -148,22 +148,24 @@ unsigned int CSimulationScenario::CreateScenario() InsertNewStep(STEP_ACTION_OCCUPY_ZT1_APPROACH,300); InsertNewStep(STEP_ACTION_OCCUPY_ZT1,300); - for(int bogie = 1; bogie <= 12; bogie++) + InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0); + + for(int bogie = 1; bogie <= 18; bogie++) { // if(bogie != 5 && bogie != 7) - InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0); - InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0); + // InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0); + // InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0); //V00 DETECTION // if(bogie != 9) // { InsertNewStep(STEP_ACTION_ACTIVATE_S1,SENSOR_DELAY); // } InsertNewStep(STEP_ACTION_DEACTIVATE_S1,BOGIE_DELAY); - InsertNewStep(STEP_ACTION_DEACTIVATE_PGI,0); - InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0); + // InsertNewStep(STEP_ACTION_DEACTIVATE_PGI,0); + // InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0); //FN DETECTION - if(bogie != 5 && bogie != 8 && bogie != 3) + // if(bogie != 5 && bogie != 8 && bogie != 3) InsertNewStep(STEP_ACTION_ACTIVATE_FN,0); InsertNewStep(STEP_ACTION_ACTIVATE_S1,SENSOR_DELAY); @@ -175,7 +177,7 @@ unsigned int CSimulationScenario::CreateScenario() // InsertNewStep(STEP_ACTION_ACTIVATE_PPI,0); //FN DETECTION - if(bogie != 5 && bogie != 8 && bogie != 3) + // if(bogie != 5 && bogie != 8 && bogie != 3) InsertNewStep(STEP_ACTION_DEACTIVATE_FN,0); // InsertNewStep(STEP_ACTION_ACTIVATE_S2,SENSOR_DELAY); @@ -186,13 +188,13 @@ unsigned int CSimulationScenario::CreateScenario() // InsertNewStep(STEP_ACTION_DEACTIVATE_PPI,0); // if(bogie != 2 && bogie != 11) - InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0); + // InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0); // if(bogie != 2 && bogie != 11) - InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0); + // InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0); InsertNewStep(STEP_ACTION_ACTIVATE_S2,SENSOR_DELAY); InsertNewStep(STEP_ACTION_DEACTIVATE_S2,BOGIE_DELAY); - InsertNewStep(STEP_ACTION_DEACTIVATE_PGI,0); - InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0); + // InsertNewStep(STEP_ACTION_DEACTIVATE_PGI,0); + // InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0); } diff --git a/sources/ZTStateMachine.cpp b/sources/ZTStateMachine.cpp index 1f48c77..dc253a9 100644 --- a/sources/ZTStateMachine.cpp +++ b/sources/ZTStateMachine.cpp @@ -594,6 +594,31 @@ unsigned int CZTStateMachine::AnalyzeZT1PostDetection() if(mZTDetectionConfig->mZTDetectionConfig[DETECTION_FCT_ZT1].AnalysisActive) { + + if(mZT1PEQType == PEQ1_PG_PREDETECTION_TYPE) + { + CZTLog::instance()->AddBufferString("Panne équipement ZT1: Pré-détection Pneu de guidage",true); + } + if(mZT1PEQType == PEQ1_LAZER_SENSOR_INT_PREDETECTION_TYPE) + { + CZTLog::instance()->AddBufferString("Panne équipement ZT1: Pré-détection Sonde Lazer Intérieure",true); + } + if(mZT1PEQType == PEQ1_LAZER_SENSOR_EXT_PREDETECTION_TYPE) + { + CZTLog::instance()->AddBufferString("Panne équipement ZT1: Pré-détection Sonde Lazer Extérieure",true); + } + if(mZT1PEQType == PEQ1_PINT_PREDETECTION_TYPE) + { + CZTLog::instance()->AddBufferString("Panne équipement ZT1: Pré-détection Pneu Porteur Intérieur",true); + } + if(mZT1PEQType == PEQ1_PEXT_PREDETECTION_TYPE) + { + CZTLog::instance()->AddBufferString("Panne équipement ZT1: Pré-détection Pneu Porteur Extérieur",true); + } + if(mZT1PEQType == PEQ1_FN_PREDETECTION_TYPE) + { + CZTLog::instance()->AddBufferString("Panne équipement ZT1: Pré-détection frotteur négatif",true); + } if(mZT1PEQType == PEQ1_FN_STUCK_LOW_TYPE) { CZTLog::instance()->AddBufferString("Panne équipement ZT1: SDF à 1",true); @@ -724,16 +749,28 @@ unsigned int CZTStateMachine::AnalyzeZT1PostDetection() CEngLog::instance()->AddLogString(QString().sprintf("[Post-Détection]--> Résultat des données brutes: [S1Count = %d], [S2Count = %d], [PGCount = %d], [FNCount = %d], [PPICount = %d], [PPECount = %d]",S1Count,S2Count,PGCount,FNCount,PPICount,PPECount),3); - //First, try to detect a véhicule travaux. If we have a PG count of 0, it is a véhicule travaux and we - //just totally ignore this passage + //First, try to detect a false occupation of the ZT CDV. + //After, try to detect a véhicule travaux. If we have a PG count of 0, it is a véhicule travaux and we + //just totally ignore this passage if(PGCalibrationON == false) { - if(PGCount == 0) + + if(S1Count == 0 && S2Count == 0) + { + CZTLog::instance()->AddLogString("[POST DETECTION]--> Fausse occupation détectée. Annulation et fin de l'analyse ZT1",true); + ClearZT1DetectionsList(); + return RET_POST_DETECTION_FALSE_OCCUPATION; + } + + if(PGCount == 0 && mZTDetectionConfig->mZTDetectionConfig[DETECTION_FCT_PG].AnalysisActive == true) { CZTLog::instance()->AddLogString("[POST DETECTION]--> Véhicule travaux détecté. Annulation et fin de l'analyse ZT1",true); ClearZT1DetectionsList(); return RET_POST_DETECTION_WORK_VEHICLE; } + + + } @@ -1879,7 +1916,8 @@ void CZTStateMachine::ClearZT1DetectionsList() void CZTStateMachine::AddLogStringFromThread(QString logstring) { - CZTLog::instance()->AddLogString(logstring,true); + //CZTLog::instance()->AddLogString(logstring,true); + CZTLog::instance()->AddBufferString(logstring,true); } void CZTStateMachine::ModbusCCANUpdate() diff --git a/sources/ZTStateMachine.h b/sources/ZTStateMachine.h index 362ed21..ee21899 100644 --- a/sources/ZTStateMachine.h +++ b/sources/ZTStateMachine.h @@ -92,6 +92,7 @@ enum ePostDetectionRet { RET_POST_DETECTION_VALID, RET_POST_DETECTION_WORK_VEHICLE, + RET_POST_DETECTION_FALSE_OCCUPATION, RET_POST_DETECTION_MAX_RET };