Versão limpa em 04/09/2014. Telnet funcionando.
Dependencies: EthernetInterface mbed-rtos mbed NTPClient
Revision 30:9bf44d2785d5, committed 2015-04-28
- Comitter:
- rebonatto
- Date:
- Tue Apr 28 14:38:37 2015 +0000
- Parent:
- 29:fcfcb31a6362
- Child:
- 31:647771325538
- Commit message:
- Ajuste calculo vm com sinal. Testes para verificar novo vm proximo de 0.; Incompleto ainda.
Changed in this revision
--- a/Codes/EventDetector.cpp Tue Apr 28 14:19:03 2015 +0000 +++ b/Codes/EventDetector.cpp Tue Apr 28 14:38:37 2015 +0000 @@ -102,7 +102,8 @@ if ( ZEROMV ) // verifica se é para retirar o VM { short int buf[NUMBER_OF_SAMPLES]; - int i, newvm = 0; + int i; + float newvm = 0; Capture::CopyBufferSigned(m_Channel,buf); /* Retira o valorMedio de todas as amostras */ @@ -110,9 +111,9 @@ buf[i] -= (int) mv2; newvm += buf[i]; } - if ( m_EventCounter == Settings::get_EventLimit() ){ - newvm /= NUMBER_OF_SAMPLES; - printf("Novo valor medio %d\n", newvm); + if ( m_EventCounter == Settings::get_EventLimit() ){ + newvm = newvm / NUMBER_OF_SAMPLES; + printf("Novo valor medio %.0f\n", newvm); } rmsvalue = SignalProcessor::CalculateRMSSigned(buf, m_Channel);
--- a/Codes/SignalProcessor.cpp Tue Apr 28 14:19:03 2015 +0000 +++ b/Codes/SignalProcessor.cpp Tue Apr 28 14:38:37 2015 +0000 @@ -85,11 +85,11 @@ for(nSample=0;nSample<NUMBER_OF_SAMPLES;nSample++) { - unsigned short int v = buffer[nSample]; + short int v = buffer[nSample]; float val = (float)v; // cada ponto - val -= Settings::get_Offset(nChannel); // diminui o offset - val /= Settings::get_Gain(nChannel); // divide pelo ganhp + //val -= Settings::get_Offset(nChannel); // diminui o offset + val /= Settings::get_Gain(nChannel); // divide pelo ganho val *= val; // eleva ao quadrado result += val; // soma }
--- a/main.cpp Tue Apr 28 14:19:03 2015 +0000 +++ b/main.cpp Tue Apr 28 14:38:37 2015 +0000 @@ -133,7 +133,7 @@ int main() { PmedLog::WriteEntry(PMEDLOG_INITIALIZING); - printf("\r\nNova versao 48 ( 20150327.1 )...\r\n"); + printf("\r\nNova versao 54 ( 20150327.1 )...\r\n"); FILE *f; //Set Highest Priority //osThreadSetPriority(osThreadGetId(),osPriorityHigh);