Versão limpa em 04/09/2014. Telnet funcionando.

Dependencies:   EthernetInterface mbed-rtos mbed NTPClient

Revision:
33:3abe9d906312
Parent:
32:8b108d8089e8
Child:
34:f1927c94cf8f
diff -r 8b108d8089e8 -r 3abe9d906312 Codes/EventDetector.cpp
--- a/Codes/EventDetector.cpp	Fri May 01 21:52:57 2015 +0000
+++ b/Codes/EventDetector.cpp	Sun May 03 22:31:53 2015 +0000
@@ -103,12 +103,29 @@
             //pega os dados da captura atual
             newvm = 0;
             Capture::CopyBufferFloat(m_Channel,buf);
-            
-            /* Retira o valorMedio de todas as amostras */
+            /*                        
+            if ( m_EventCounter == Settings::get_EventLimit() ){                    
+                printf("Valores originais\n");
+                for(i=0; i < NUMBER_OF_SAMPLES; i++){
+                    printf("%.2f,", buf[i]);
+                }
+            } 
+            */               
+            /* Retira o valorMedio de todas as amostras */                                    
             for(i=0; i < NUMBER_OF_SAMPLES; i++){
                 buf[i] -= mv2;
                 newvm += buf[i];
             }
+            /*
+            if ( m_EventCounter == Settings::get_EventLimit() ){                    
+                printf("\nSem valor medio\n");
+                for(i=0; i < NUMBER_OF_SAMPLES; i++){
+                    printf("%.2f,", buf[i]);
+                }
+                printf("\n");
+            }
+            */
+            
             if ( m_EventCounter == Settings::get_EventLimit() ){                    
                 mv2 = newvm / NUMBER_OF_SAMPLES;
                 //printf("Novo valor medio %f RMS original %f\n", mv2, rmsvalue);
@@ -176,7 +193,7 @@
             else
                 m_EventCounter = 0;
         }
-    } // Final gerafuga
+    } // Final gerafuga    
 }
             
 void EventDetector::ShowValues(CaptureEvent* e)
@@ -332,10 +349,10 @@
     event->Setup(rfid,type,outlet_number,mv,mv2, rmsvalue,under, over, Settings::get_Gain(m_Channel),Settings::get_Offset(m_Channel),duration, seno,coss);
                 
     //printf("\n\nDuration: %d\n\n", duration);
-   // ShowValues(event);       
+    //ShowValues(event);       
            
     //and finally place the object in the mailbox queue.
-   // GetMailbox().put(event);
+    GetMailbox().put(event);
     //printf("Deu put no evento no mailBox\n");
 }