void CModHudElement::LevelShutdown() { LevelEnd(); }
bool CAbfTraceIdealization::DownTransition(int nI0, int nLag, short stLevel, int nLevelBeginning, short &stNextLevel, int &nLevelEnd, float &fAmpMean, float &fAmpDev, float &fAmpMin, float & fAmpMax, bool &bAnchor) { bool bDownTransition=false; int nI1=m_pnLMaxima[nI0]; int nI2=m_pnLMinima[nI0+1+nLag]; float fAmp1=m_pfData[nI1]; float fAmp2=m_pfData[nI2]; float fAmp3; if(nI2>0) fAmp3=m_pfData[nI2-1]; else fAmp3=m_pfData[nI2]; float fDelta=0.f; float fDeltaC=0.f; float fThreshold=0.f; float fTemp; int nSign; for(int i=stLevel;i>0;i--) { fThreshold=m_vstructLTC[i].fDTMax; if(fAmp1>fThreshold) { bDownTransition=true; stNextLevel=i-1; } else { if(m_bLTCFromTraces) { fTemp=0.5*(m_vstructSegMinimaHist[i].f5_thBin+m_vstructSegMinimaHist[i-1].f5_thBin)-4.*m_vstructSegMinimaHist[i].fInterval; if(fAmp1>fTemp) { fDelta=m_pfData[m_pnLMinima[nI0+nLag]]-fAmp1; fDeltaC=m_vstructLTC[stLevel].fDTDelta; if(fabs(fDelta)>fabs(fDeltaC)) { nSign=-1; bDownTransition=true; NextLevel(stLevel, stNextLevel, fAmp1, m_fThreshold, nSign); } break; } } } } int nDelta=1; int nLevelLength=0; if(bDownTransition) { m_fThreshold=0.5*(fAmp1+fAmp3); nLevelEnd=LevelEnd(stLevel, stNextLevel, nI1); nLevelLength=nLevelEnd-nLevelBeginning+1; if(nLevelLength>0) { structSemNode aSemNode=CalSem_Amp(m_pfData,nLevelBeginning,nLevelLength,nDelta); fAmpMean=aSemNode.fMean; fAmpDev=aSemNode.fSem; fAmpMax=aSemNode.fMax; fAmpMin=aSemNode.fMin; } else { bDownTransition=false; stNextLevel=stLevel; m_fThreshold0=m_fThreshold; } } if(bDownTransition) { if(nI0-m_nLMaxI>m_nLTCWindowSize&&stLevel==0) { CalRunTimeLTC(stLevel,nI0); if(stLevel==0) bAnchor=true; else bAnchor=false; } else { bAnchor=false; } //RuntimeLTC should not include nI0 m_nLMaxI=nI0; } return bDownTransition; }
PrivateMethod void CModHudElement::LevelShutdown() { LevelEnd(); }
bool CAbfTraceIdealization::UpTransition(int nI0, int nLag, short stLevel, int nLevelBeginning, short &stNextLevel, int &nLevelEnd, float &fAmpMean, float &fAmpDev, float &fAmpMin, float & fAmpMax, bool &bAnchor) { float fProportionMin=0.99; float fProportionMin0=0.99; float fProportionMin1=0.9999; bool bUpTransition=false; int nI1=m_pnLMaxima[nI0]; int nI2=m_pnLMinima[nI0+nLag]; int nDelta=1; float fAmp1=m_pfData[nI1]; float fAmp2=m_pfData[nI2]; int nLevelLength, nIndex; float fInterval=1.f; float fMin=0.f; float fTotalCounts; float fSum=1.f; float fCutoff1=0.f; float fCutoff2=0.f; float fAmp3; if(nI1>0) fAmp3=m_pfData[nI1-1]; else fAmp3=m_pfData[nI1]; float fTime=nI2*m_fTimePerPoint/1000.; if(fTime > 252740) { fTime=fTime; } for(int i=stLevel;i<m_nMaxLevel;i++) { fCutoff1=m_vstructLTC[i].fUTMin; fCutoff2=m_vstructLTC[i].fUTMax; if(fAmp2<fCutoff1) { bUpTransition=true; stNextLevel=i+1; // m_fThreshold=fCutoff1; } else if(fAmp1<fCutoff2) { if((nI0-m_nLMaxI)>100) { fProportionMin=fProportionMin1; } fInterval=m_vstructSegMinimaHist[stLevel].fInterval; fTotalCounts=m_vstructSegMinimaHist[stLevel].fTotalCounts; fMin=m_vstructSegMinimaHist[stLevel].fMin; nIndex=int((fAmp2-fMin)/fInterval); fSum=m_vstructSegMinimaHist[stLevel].vfHist_Sum[nIndex]; if(fSum/fTotalCounts<(1.-fProportionMin)) { bUpTransition=true; stNextLevel=i+1; // m_fThreshold=fCutoff2; } } } if(bUpTransition) { m_fThreshold=0.5*(fAmp2+fAmp3); nLevelEnd=LevelEnd(stLevel, stNextLevel,nI2); nLevelLength=nLevelEnd-nLevelBeginning+1; if(nLevelLength>0) { structSemNode aSemNode=CalSem_Amp(m_pfData,nLevelBeginning,nLevelLength,nDelta); fAmpMean=aSemNode.fMean; fAmpDev=aSemNode.fSem; fAmpMax=aSemNode.fMax; fAmpMin=aSemNode.fMin; } else { stNextLevel=stLevel; bUpTransition=false; } } if(bUpTransition) { if(nI0-m_nLMaxI>m_nLTCWindowSize&&stLevel==0) { if(m_bCalRTLTC && m_bLTCFromTraces) CalRunTimeLTC(stLevel,nI0); if(stLevel==0) bAnchor=true; else bAnchor=false; } else { bAnchor=false; } //RuntimeLTC should not include nI0 m_nLMaxI=nI0; } return bUpTransition; }