Commit 5072d3e4 authored by Vrignault's avatar Vrignault

Version 0.72

parent ff72d39e
This diff is collapsed.
//-------------------------------------------------------------------------
//! \file CAnalyseRL.h
//! \brief Classes gd'analyse en mode RhinoLogger
//! \details class CAnalyzerRL, CFCAnalyzerRL, CFMAnalyzerRL
//! \details class CAnalyzerRL, CQFCAnalyzerRL, CFMAnalyzerRL
//! \author Jean-Do. Vrignault
//! Copyright (c) 2018 Vrignault Jean-Do. All rights reserved.
/*
......@@ -21,6 +21,7 @@
* Classes :
* - CAnalyzerRL
* - CFCAnalyzerRL
* - CQFCAnalyzerRL
* - CFMAnalyzerRL
*/
#include <Arduino.h>
......@@ -198,7 +199,7 @@ protected:
//-------------------------------------------------------------------------
//! \class CFCAnalyzerRL
//! \brief Class for FC type cries analysis
//! \brief Class for FC Rhinolophus type cries analysis
class CFCAnalyzerRL: public CAnalyzerRL
{
public:
......@@ -206,6 +207,10 @@ public:
//! \brief Constructor (initialization of parameters to default values)
CFCAnalyzerRL();
//-------------------------------------------------------------------------
//! \brief Destructor
virtual ~CFCAnalyzerRL();
//-------------------------------------------------------------------------
//! \brief Initialization of the characteristics of the analysis
//! \param iFe Sampling frequency
......@@ -234,18 +239,64 @@ public:
//! \brief Cries analysis in the timer period
virtual void OnTimerProcessing();
protected:
// Number of channels in the band
int iNbCnx;
// Detections duration and level max per channel over a timer period
DetectionFC *pTimerDetections;
};
//-------------------------------------------------------------------------
//! \class CQFCAnalyzerRL
//! \brief Class for FC type cries analysis
class CQFCAnalyzerRL: public CAnalyzerRL
{
public:
//-------------------------------------------------------------------------
//! \brief Update the current minute
virtual void UpdateCurrentMinute();
//! \brief Constructor (initialization of parameters to default values)
CQFCAnalyzerRL();
//-------------------------------------------------------------------------
//! \brief Destructor
virtual ~CQFCAnalyzerRL();
//-------------------------------------------------------------------------
//! \brief Initialization of the characteristics of the analysis
//! \param iFe Sampling frequency
//! \param pBand Band characteristics
//! \param bDebugDet For debugging bands
virtual void InitializingAnalysis(
uint32_t iFe,
MonitoringBand *pBand,
bool bDebugDet
);
//-------------------------------------------------------------------------
//! \brief Initialization before the start of the analysis time of the timer period
virtual void RAZBeforeTimer();
//-------------------------------------------------------------------------
//! \brief Processing FFT results
//! \param piTbSeuilCnx Table of thresholds
//! \param pFFTResults Table of FFT levels
virtual void FFTProcessing(
volatile uint32_t *piTbSeuilCnx,
volatile int32_t *pFFTResults
);
//-------------------------------------------------------------------------
//! \brief Cries analysis in the timer period
virtual void OnTimerProcessing();
protected:
// Number of channels in the band
int iNbCnx;
// CF Detection Charts
// Table of current FC detections
DetectionFC TbCurrentFC[MFFTLENRL];
DetectionFC *pTbCurrentFC;
// Longest FC backup table on each channel during timer period
DetectionFC TbSaveFC[MFFTLENRL];
// Longest FC backup and number of valid FC on each channel during one second
DetectionFC TbSaveSecond[MFFTLENRL];
DetectionFC *pTbSaveFC;
};
//-------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -21,6 +21,7 @@
* Classes :
* - CModeGeneric
* - CModeVeille
* - CModeTestSD
*/
#include "Const.h"
#include "ModesModifiers.h"
......@@ -255,6 +256,9 @@ public:
void TestSD();
protected:
//! Chaine de taille SD
char sSizeSD[25];
//! Booléen de RAZ des fichiers de la carte SD
bool bRAZ;
......
This diff is collapsed.
......@@ -16,7 +16,7 @@
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define USBSDCARD
//#define USBSDCARD
#ifdef USBSDCARD
#include "MTPsd.h"
#endif
......@@ -40,6 +40,7 @@ enum IDXPARAMS {
IDXSEUILR, //!< Seuil de détection relatif en dB (5-99)
IDXSEUILA, //!< Seuil de détection absolu en dB (-110/-30)
IDXHRECM, //!< Heterodyne recording mode
IDXHREFGR, //!< Refresh period of the heterodyne graph
IDXHDEB , //!< Heure de début
IDXHFIN , //!< Heure de fin
IDXFMIN , //!< Fréquence d'intéret minimale en Hz (1-FMax)
......@@ -56,10 +57,10 @@ enum IDXPARAMS {
IDXPETM , //!< Période de mesure température
IDXTHV , //!< Mesure T/H y compris en veille
IDXBDRL , //!< Modification des bandes RhinoLogger
IDXAFFRL, //!< Affichage RhinoLogger permanent
IDXLANG , //!< Langue utilisée
IDXTSTSD, //!< Test SD
IDXSNOISE, //!< Sauvegarde bruit
//IDXPRESS, //!< Correction pression atmosphérique
IDXDEF , //!< Paramètres par défaut
IDXLED , //!< Utilisation de la LED
IDXBOOT //!< Goto Bootloader to load a new version in Active Recorder
......
......@@ -154,22 +154,27 @@ extern U8G2 *pDisplay;
CModeGenericRec::CModeGenericRec()
{
pRecorder = NULL;
iNbSizeSD = 0;
}
//-------------------------------------------------------------------------
// Destructeur
CModeGenericRec::~CModeGenericRec()
{
//Serial.println("CModeGenericRec delete pRecorder");
Serial.println("CModeGenericRec Destructeur");
if (pRecorder != NULL)
{
Serial.println("CModeGenericRec delete pRecorder");
delete pRecorder;
pRecorder = NULL;
}
}
//-------------------------------------------------------------------------
//! \brief Creation du gestionnaire d'enregistrement
void CModeGenericRec::CreateRecorder()
{
//Serial.println("CModeGenericRec new CRecorder");
Serial.println("CModeGenericRec new CRecorder");
pRecorder = new CRecorder( &paramsOperateur, NBBUFFERRECORD);
}
......@@ -180,9 +185,10 @@ void CModeGenericRec::BeginMode()
if (IsTempSensor())
{
// Présence d'une sonde de température
logPR.SetbConsole( true);
bool bMemo = logPR.GetbConsole();
LogFile::SetbConsole( true);
LogFile::AddLog( LLOG, txtProbeTH[paramsOperateur.iLanguage], paramsOperateur.iPeriodTemp);
logPR.SetbConsole( CModeGeneric::bDebug);
logPR.SetbConsole( bMemo);
cTemp = 100.0;
humidity = 0.0;
if (paramsOperateur.iModeRecord != PRHINOLOG)
......@@ -196,9 +202,10 @@ void CModeGenericRec::BeginMode()
{
// Pas de sonde de température
uiTimeTemp = 0;
bool bMemo = LogFile::GetbConsole();
logPR.SetbConsole( true);
LogFile::AddLog( LLOG, txtNoProbeTH[paramsOperateur.iLanguage], paramsOperateur.iPeriodTemp);
logPR.SetbConsole( CModeGeneric::bDebug);
logPR.SetbConsole( bMemo);
}
// Test de la taille restante sur la carte SD
uiTimeTestSD = 0;
......@@ -208,6 +215,7 @@ void CModeGenericRec::BeginMode()
CModeGeneric::BeginMode();
// On restitue le mode réel
paramsOperateur.iModeRecord = iMemoMode;
PrintRamUsage( (char *)"Before CreateRecorder");
// Création de gestionnaire d'enregistrement
CreateRecorder();
// Mémo des paramètres d'enregistrement dans le Log
......@@ -295,15 +303,27 @@ void CModeGenericRec::OnLoop()
if (millis() > uiTimeTestSD)
{
// On teste s'il reste de la place sur la carte SD (>50MO)
if (CSDModifier::GetSDFreeSpace() > 0.05)
float fSize = CSDModifier::GetSDFreeSpace();
if (fSize <= 0.05)
{
iNbSizeSD++;
LogFile::AddLog( LLOG, "%d problem SD free space %fGO", iNbSizeSD, fSize);
if (iNbSizeSD > 3)
{
// Plus de place sur la carte SD, on passe en erreur carte pleine
LogFile::AddLog( LLOG, "Error SD free space %fGO", fSize);
CModeError::SetTxtError( (char *)txtErrFullSD[paramsOperateur.iLanguage]);
iNewMode = MERROR;
}
}
else if (iNbSizeSD > 0)
iNbSizeSD--;
if (iNbSizeSD == 0)
// Prochain test dans 1mn
uiTimeTestSD = millis() + 60000;
else
{
// Plus de place sur la carte SD, on passe en erreur carte pleine
CModeError::SetTxtError( (char *)txtErrFullSD[paramsOperateur.iLanguage]);
iNewMode = MERROR;
}
// Prochain test dans 15s
uiTimeTestSD = millis() + 15000;
}
// Test si erreur DMA
if (pRecorder != NULL and pRecorder->IsDMAError())
......@@ -353,9 +373,10 @@ void CModeAutoRecorder::BeginMode()
CModeGenericRec::BeginMode();
// Print Ram usage
PrintRamUsage( (char *)txtRamUsage);
//bool bMemo = LogFile::GetbConsole();
//logPR.SetbConsole( true);
//LogFile::AddLog( LLOG, "Size of Record buffer %d bytes (int16_t * MAXSAMPLE %d * Nb Buffer %d)", pRecorder->GetSizeoffSamplesRecordBuffer(), MAXSAMPLE, pRecorder->GetiNbSampleBuffer());
//logPR.SetbConsole( CModeGeneric::bDebug);
//logPR.SetbConsole( bMemo);
//Serial.println("CModeAutoRecorder Avant StartAcquisition");
// On lance l'acquisition
pRecorder->StartAcquisition();
......@@ -547,9 +568,10 @@ void CModeProtocole::BeginMode()
CModeGenericRec::BeginMode();
// Print Ram usage
PrintRamUsage( (char *)txtRamUsageProtocole);
bool bMemo = LogFile::GetbConsole();
logPR.SetbConsole( true);
LogFile::AddLog( LLOG, "Size of Record buffer %d bytes (int16_t * MAXSAMPLE %d * Nb Buffer %d)", ((CRecorder *)pRecorder)->GetSizeoffSamplesRecordBuffer(), MAXSAMPLE, ((CRecorder *)pRecorder)->GetiNbSampleBuffer());
logPR.SetbConsole( CModeGeneric::bDebug);
logPR.SetbConsole( bMemo);
// Point 1 pour commencer
iPointProto = 1;
bDoPrintProtocole = true;
......@@ -1131,9 +1153,10 @@ void CModeTestMicro::BeginMode()
uiCurentTimeMax = 0;
// Print Ram usage
PrintRamUsage( (char *)txtRamUsageTstMicro);
bool bMemo = LogFile::GetbConsole();
logPR.SetbConsole( true);
LogFile::AddLog( LLOG, "Size of Record buffer %d bytes (int16_t * MAXSAMPLE %d * Nb Buffer %d)", ((CRecorder *)pRecorder)->GetSizeoffSamplesRecordBuffer(), MAXSAMPLE, ((CRecorder *)pRecorder)->GetiNbSampleBuffer());
logPR.SetbConsole( CModeGeneric::bDebug);
logPR.SetbConsole( bMemo);
//Serial.println("CModeTestMicro avant StartAcquisition");
// On lance l'acquisition
pRecorder->StartAcquisition();
......
......@@ -66,6 +66,9 @@ protected:
//! Pour mesure de la taille restante sur la carte SD
unsigned long uiTimeTestSD;
// Nombre de test de taille SD erroné
unsigned int iNbSizeSD;
};
//-------------------------------------------------------------------------
......
......@@ -31,8 +31,10 @@ const char *txtFBdINVALID[] = {" %s Invalid ",
" %s Invalide"};
const char *txtFBdFM[] = {" %s FM %d det. %6.2f-%06.2fkHz %02.0fkHz",
" %s FM %d det. %6.2f-%06.2fkHz %02.0fkHz"};
const char *txtFBdCF[] = {" %s CF %d det. %6.2f-%06.2fkHz %02dms %02dms",
" %s FC %d det. %6.2f-%06.2fkHz %02dms %02dms"};
const char *txtFBdRH[] = {" %s CF %d det. %6.2f-%06.2fkHz %02dms",
" %s FC %d det. %6.2f-%06.2fkHz %02dms"};
const char *txtFBdCF[] = {" %s QCF %d det. %6.2f-%06.2fkHz %02dms %02dms",
" %s QFC %d det. %6.2f-%06.2fkHz %02dms %02dms"};
const char *txtGNum[] = {" 0", " 6", "12", "18", "24"};
const char txtRamUsageRL[] = "Ram after CModeRhinoLogger::BeginMode";
......@@ -44,13 +46,24 @@ const char txtRamUsageRL[] = "Ram after CModeRhinoLogger::BeginMode";
// Constructeur
CModeRhinoLogger::CModeRhinoLogger()
{
pRecorder = NULL;
}
//-------------------------------------------------------------------------
//! \brief Destructeur
CModeRhinoLogger::~CModeRhinoLogger()
{
if (pRecorder != NULL)
{
delete pRecorder;
pRecorder = NULL;
}
}
//-------------------------------------------------------------------------
//! \brief Creation du gestionnaire d'enregistrement
void CModeRhinoLogger::CreateRecorder()
{
Serial.println("CModeRhinoLogger new CRecorderRL");
pRecorder = new CRecorderRL( &paramsOperateur);
}
......@@ -67,10 +80,11 @@ void CModeRhinoLogger::BeginMode()
paramsOperateur.bTypeSeuil = false; // Seuil relatif
paramsOperateur.bFiltre = false; // Pas de filtre
paramsOperateur.iPeriodTemp = 60; // Période de lecture température de 60s
paramsOperateur.uiFreqMin = 500;
paramsOperateur.uiFreqMax = 0;
// Mémorisation de la bande d'intéret générale et calcul de la bande d'intéret des bandes RhinoLogger
iMemoFMin = paramsOperateur.uiFreqMin;
iMemoFMax = paramsOperateur.uiFreqMax;
paramsOperateur.uiFreqMin = 500;
paramsOperateur.uiFreqMax = 0;
for (int b=0; b<MAXBD; b++)
{
if (paramsOperateur.batBand[b].iType != BDINVALID)
......@@ -132,7 +146,11 @@ void CModeRhinoLogger::BeginMode()
sprintf( sTempA, txtFBdFM[iLanguage] , paramsOperateur.batBand[b].sName, paramsOperateur.batBand[b].iNbDetections, paramsOperateur.batBand[b].fMin,
paramsOperateur.batBand[b].fMax, paramsOperateur.batBand[b].fMinFWidth);
break;
case BDCF : // Constant frequency
case BDFC : // Rhinolophus frequency
iNbBandesValides++;
sprintf( sTempA, txtFBdRH[iLanguage] , paramsOperateur.batBand[b].sName, paramsOperateur.batBand[b].iNbDetections, paramsOperateur.batBand[b].fMin, paramsOperateur.batBand[b].fMax, paramsOperateur.batBand[b].iMinDuration);
break;
case BDQFC : // Constant frequency
iNbBandesValides++;
sprintf( sTempA, txtFBdCF[iLanguage] , paramsOperateur.batBand[b].sName, paramsOperateur.batBand[b].iNbDetections, paramsOperateur.batBand[b].fMin, paramsOperateur.batBand[b].fMax, paramsOperateur.batBand[b].iMinDuration, paramsOperateur.batBand[b].iMaxDuration);
break;
......@@ -141,9 +159,11 @@ void CModeRhinoLogger::BeginMode()
}
// Print Ram usage
PrintRamUsage( (char *)txtRamUsageRL);
//Serial.println("CModeRhinoLogger::BeginMode avant StartAcquisition");
if (iNbBandesValides > 0 and pRecorder != NULL)
// On lance l'acquisition
pRecorder->StartAcquisition();
//Serial.println("CModeRhinoLogger::BeginMode après StartAcquisition");
}
//-------------------------------------------------------------------------
......@@ -151,9 +171,9 @@ void CModeRhinoLogger::BeginMode()
void CModeRhinoLogger::EndMode()
{
// We restore the operator parameters
/*ReadParams();
ReadParams();
paramsOperateur.uiFreqMin = iMemoFMin;
paramsOperateur.uiFreqMax = iMemoFMax;*/
paramsOperateur.uiFreqMax = iMemoFMax;
// Appel de la méthode de base qui stoppe l'acquisition
bWriteParams = false;
CModeGenericRec::EndMode();
......@@ -167,6 +187,7 @@ void CModeRhinoLogger::EndMode()
// à charge des différents modes d'afficher les informations nécessaires
void CModeRhinoLogger::PrintMode()
{
//Serial.println("CModeRhinoLogger::PrintMode");
char Message[30];
if (iCurrentSecond != second())
{
......@@ -350,7 +371,7 @@ void CModeRhinoLogger::PrintMode()
{
if (paramsOperateur.batBand[b].iType != BDINVALID)
{
((CRecorderRL *)pRecorder)->GetSavedMinute( b, &ResMinute);
((CRecorderRL *)pRecorder)->GetCurentMinute( b, &ResMinute);
iNivMax = pRecorder->GetNivDB ( ResMinute.iMagMax) / 10;
fMax = pRecorder->GetFreqIdx( ResMinute.iIdxMagMax);
if (fMax < 1) fMax = 0.0;
......@@ -361,12 +382,12 @@ void CModeRhinoLogger::PrintMode()
}
}
UpdateScreen();
// En mode debug, affichage permanent
if (CModeGeneric::bDebug == false)
// On décompte si affichage non permanent
if (!paramsOperateur.bRLAffPerm and iDecompteurAffBd > 1)
iDecompteurAffBd--;
}
}
else if (CModeGeneric::bDebug == false and iDecompteurAffBd == 1)
else if (iDecompteurAffBd == 1)
{
// Effacement écran
pDisplay->clearBuffer();
......@@ -408,43 +429,18 @@ int CModeRhinoLogger::KeyManager(
// Test si temps de passer en veille
if (IsTimeVeille())
iNewMode = MVEILLE;
if (pRecorder != NULL and ((CRecorderRL *)pRecorder)->IsFCtooLarge())
{
if (CModeGeneric::GetParamsOperator()->iLanguage == LFRENCH)
CModeError::SetTxtError((char *)"RL Trop de canaux FC!");
else
CModeError::SetTxtError((char *)"RL too many FC chann!");
iNewMode = MERROR;
}
if (iNewMode != NOMODE)
{
newMode = iNewMode;
iNewMode = NOMODE;
}
#ifdef CrutchRhinoLogger
/*
Crutch to bypass the memory bug of the RhinoLogger mode when leaving.
We reset to leave clean and go into settings mode
*/
if (newMode == MPARAMS)
{
// Restore operator parameters
ReadParams();
// Set record mode to MAXPROT
paramsOperateur.iModeRecord = MAXPROT;
// Save parameters
WriteParams();
//LogFile::AddLog( LLOG, "Reset MPARAMS avec iModeRecord == %d", paramsOperateur.iModeRecord);
// and Reset
WRITE_RESTART(0x5FA0004);
}
else if (newMode == MVEILLE)
{
// Restore operator parameters
ReadParams();
// Set record mode to PROTSLEEP
paramsOperateur.iModeRecord = PROTSLEEP;
// Save parameters
WriteParams();
//LogFile::AddLog( LLOG, "Reset MVEILLE avec iModeRecord == %d", paramsOperateur.iModeRecord);
// and Reset
WRITE_RESTART(0x5FA0004);
}
/*
* End Crutch
*/
#endif
return newMode;
}
......@@ -31,6 +31,10 @@ public:
//! \brief Constructeur
CModeRhinoLogger();
//-------------------------------------------------------------------------
//! \brief Destructeur
virtual ~CModeRhinoLogger();
//-------------------------------------------------------------------------
//! \brief Début du mode
virtual void BeginMode();
......
......@@ -108,7 +108,7 @@ CModeHeterodyne::CModeHeterodyne():graphe( 20, 30)
//! \brief Creation du gestionnaire d'enregistrement
void CModeHeterodyne::CreateRecorder()
{
Serial.println("CModeHeterodyne::CreateRecorder");
//Serial.println("CModeHeterodyne::CreateRecorder");
pRecorder = new CRecorderH( &paramsOperateur, NBBUFFERRECORDH);
}
......@@ -152,7 +152,8 @@ void CModeHeterodyne::BeginMode()
LstModifParams[IDXHSEUILR ]->SetbValid( false);
iCptTh = 0;
graphe.SetMinMaxScale( paramsOperateur.uiFreqMin, paramsOperateur.uiFreqMax);
graphe.SetTimeScroll( 200);
int iRafGrape = (int)(paramsOperateur.fRefreshGRH * 1000.0);
graphe.SetTimeScroll( iRafGrape);
// Test battery
CheckBatteries();
uiTimeCheck = millis() + TIMECHECKBATTERY;
......@@ -174,9 +175,10 @@ void CModeHeterodyne::BeginMode()
uiFFTChannel = (uiFe/2)/(FFTLEN/2);
// Print Ram usage
PrintRamUsage( (char *)txtRamUsageHet);
bool bMemo = logPR.GetbConsole();
logPR.SetbConsole( true);
LogFile::AddLog( LLOG, "Size of Record buffer %d bytes (int16_t * MAXSAMPLE %d * Nb Buffer %d)", ((CRecorder *)pRecorder)->GetSizeoffSamplesRecordBuffer(), MAXSAMPLE, ((CRecorder *)pRecorder)->GetiNbSampleBuffer());
logPR.SetbConsole( CModeGeneric::bDebug);
logPR.SetbConsole( bMemo);
// On lance l'acquisition
pRecorder->StartAcquisition();
// Autorisation audio
......
......@@ -21,8 +21,8 @@
#include "Const.h"
#include "CModifBandRL.h"
const char *txtTypeBand[2][3] = {{"No ", "FM ", "CF "},
{"Non", "FM ", "FC "}};
const char *txtTypeBand[2][4] = {{"No ", "FM ", "CF ", "QCF"},
{"Non", "FM ", "FC ", "QFC"}};
const char formIDXBand[] = "[&$]";
const char *txtIDXBand[] = {"[%02d]",
"[%02d]"};
......@@ -78,23 +78,23 @@ CModeBandsRL::CModeBandsRL()
// IDXRETURN Return to parameters mode
LstModifParams.push_back(new CPushButtonModifier( formIDXRet, false, txtIDXRet, 0, 0));
// IDXNUMBAND Band Index
LstModifParams.push_back(new CModificatorInt ( formIDXBand, false, txtIDXBand, (int *)&idxBand, 1, MAXBD, 1, 60, 0));
LstModifParams.push_back(new CModificatorInt ( formIDXBand, false, txtIDXBand, (int *)&idxBand, 1, MAXBD, 1, 60, 0));
// IDXNAME Name of the band
LstModifParams.push_back(new CCharModifier ( formIDXName, false, txtIDXName, (char *)&tmpBand.sName, MAXNAMEBD, false, true, false, true, true, 90, 0));
LstModifParams.push_back(new CCharModifier ( formIDXName, false, txtIDXName, (char *)&tmpBand.sName, MAXNAMEBD, false, true, false, true, true, 90, 0));
// IDXTYPE Type of the band
LstModifParams.push_back(new CEnumModifier ( formIDXTBD, false, true, txtIDXTBD, (int *)&tmpBand.iType, BDTYPEMAX, (const char **)txtTypeBand, 0, 9));
LstModifParams.push_back(new CEnumModifier ( formIDXTBD, false, true, txtIDXTBD, (int *)&tmpBand.iType, BDTYPEMAX, (const char **)txtTypeBand, 0, 9));
// IDXNBDET Minimum detections to consider a positive second
LstModifParams.push_back(new CModificatorInt ( formIDXNbD, false, txtIDXNbD, (int *)&tmpBand.iNbDetections, 1, 20, 1, 60, 9));
LstModifParams.push_back(new CModificatorInt ( formIDXNbD, false, txtIDXNbD, (int *)&tmpBand.iNbDetections, 1, 5, 1, 60, 9));
// IDXBDFMIN Minimum frequency of the band
LstModifParams.push_back(new CFloatModifier ( formIDXFMIN, false, txtIDXFMINB, &tmpBand.fMin, 8.0, 125.0, 0.25, 0, 18));
LstModifParams.push_back(new CFloatModifier ( formIDXFMIN, false, txtIDXFMINB, &tmpBand.fMin, 8.0, 125.0, 0.25, 0, 18));
// IDXBDFMAX Maximum frequency of the band
LstModifParams.push_back(new CFloatModifier ( formIDXFMAX, false, txtIDXFMAXB, &tmpBand.fMax, 10.0, 125.0, 0.25, 0, 27));
LstModifParams.push_back(new CFloatModifier ( formIDXFMAX, false, txtIDXFMAXB, &tmpBand.fMax, 10.0, 125.0, 0.25, 0, 27));
// IDXMINDUR Minimum duration of the band
LstModifParams.push_back(new CModificatorInt ( formIDXMIND, false, txtIDXMIND, (int *)&tmpBand.iMinDuration, 4, 96, 4, 0, 36));
LstModifParams.push_back(new CModificatorInt ( formIDXMIND, false, txtIDXMIND, (int *)&tmpBand.iMinDuration, 4, 96, 4, 0, 36));
// IDXMAXDUR Maximum duration of the band
LstModifParams.push_back(new CModificatorInt ( formIDXMAXD, false, txtIDXMAXD, (int *)&tmpBand.iMaxDuration, 4, 96, 4, 0, 45));
LstModifParams.push_back(new CModificatorInt ( formIDXMAXD, false, txtIDXMAXD, (int *)&tmpBand.iMaxDuration, 4, 96, 4, 0, 45));
// IDXMINWIDTH Minimum width of the band
LstModifParams.push_back(new CFloatModifier ( formIDXWidth, false, txtIDXWidth, &tmpBand.fMinFWidth, 0.5, 99.0, 0.5, 0, 54));
LstModifParams.push_back(new CFloatModifier ( formIDXWidth, false, txtIDXWidth, &tmpBand.fMinFWidth, 0.5, 99.0, 0.5, 0, 54));
}
//-------------------------------------------------------------------------
......@@ -106,6 +106,7 @@ void CModeBandsRL::BeginMode()
// Copy first band
idxBand = 1;
tmpBand = paramsOperateur.batBand[0];
idxSelParam = IDXRETURN;
ControleParams();
}
......@@ -218,7 +219,16 @@ void CModeBandsRL::ControleParams()
LstModifParams[IDXMINWIDTH]->SetbValid( true);
LstModifParams[IDXNBDET ]->SetbValid( true);
break;
case BDCF:
case BDFC:
LstModifParams[IDXNAME ]->SetbValid( true);
LstModifParams[IDXBDFMIN ]->SetbValid( true);
LstModifParams[IDXBDFMAX ]->SetbValid( true);
LstModifParams[IDXMINDUR ]->SetbValid( true);
LstModifParams[IDXMAXDUR ]->SetbValid( false);
LstModifParams[IDXMINWIDTH]->SetbValid( false);
LstModifParams[IDXNBDET ]->SetbValid( true);
break;
case BDQFC:
LstModifParams[IDXNAME ]->SetbValid( true);
LstModifParams[IDXBDFMIN ]->SetbValid( true);
LstModifParams[IDXBDFMAX ]->SetbValid( true);
......
......@@ -356,7 +356,7 @@ void CGenericRecorder::TraitementDetections()
//! \brief Traitement du bruit
void CGenericRecorder::TraitementBruit()
{
// Calcul du bruit moyen
//Serial.printf("TraitementBruit FFT %d\n", iNbFFTNoise); // Calcul du bruit moyen
for( int j=idxFMin; j<=idxFMax; j++)
{
//if (j >= iFFTLen/2)
......@@ -407,6 +407,7 @@ void CGenericRecorder::TraitementBruit()
if (iBruitdB < iTotalNoisedB)
// On prend le bruit le plus fort
iBruitdB = iTotalNoisedB;
//Serial.printf("Fin TraitementBruit idxFMin %d idxFMax %d\n", idxFMin, idxFMax);
// On calcule le seuil de chaque canaux, le bruit de chaque canaux ne pouvant pas être plus faible que le bruit moyen
for( int j=idxFMin; j<=idxFMax; j++)
{
......@@ -1056,7 +1057,7 @@ void CRecorder::SetFreqHighPass(
// Rappel du temps d'un buffer de 8192 : 250kHz=33.77ms, 384kHz=21.33ms, 500kHz=16.38ms
// PassiveRecorder : 7.4ms
// Hétérodyne : 384/250=9.7ms, 500kHz=8.8ms
inline void CRecorder::OnDMA_ISR()
void CRecorder::OnDMA_ISR()
{
#ifdef TESTTIMEISR
unsigned long uiTime = micros();
......@@ -1111,7 +1112,7 @@ inline void CRecorder::OnDMA_ISR()
//-------------------------------------------------------------------------
// Traitement sous interruption d'un buffer d'acquisition plein
inline void CRecorder::TraiteBuffer()
void CRecorder::TraiteBuffer()
{
#ifdef TESTTEMPSREEL
unsigned long uiTime = millis();
......@@ -1150,9 +1151,9 @@ inline void CRecorder::TraiteBuffer()
//-------------------------------------------------------------------------
// Préparation du traitement FFT avec filtre
inline void CRecorder::PrepareFFTWithoutFilter()
void CRecorder::PrepareFFTWithoutFilter()
{
for (int f=0; f<FFTLEN; f++, iSample++)
for (int f=0; f<iFFTLen; f++, iSample++)
{
// Echantillon signé pour enregistrement et application gain numérique
pSaveEch[iSample] = (pBufferATraiter[iSample] - 2048) << shift;
......@@ -1176,9 +1177,9 @@ inline void CRecorder::PrepareFFTWithoutFilter()