Commit 77987ca2 authored by Julio_Cesar's avatar Julio_Cesar
Browse files

Modificada a forma de transmitir os dados

Os sinais sao armazenados no vetor histograma e este e transmitido com 8192 valores
parent 8deeb86f
......@@ -100,6 +100,14 @@ long get_time()
int main(int argc, char **argv)
{
int w;
unsigned long int histograma[8192];
for(w=0; w<8191; w++)
{
histograma[w] = 0;
}
N957_UINT32 data32;
int ret_val= 0; // procedure exit value
......@@ -372,6 +380,19 @@ int main(int argc, char **argv)
case 'P':
paused= !paused;
break;
case 'i':
fflush(stdout);
for(w=0; w<8191; w++)
{
TRACE1("%li\n",histograma[w]);
}
for(w=0; w<8191; w++)
{
histograma[w] = 0;
}
default:
do_exit= TRUE;
break;
......@@ -381,9 +402,11 @@ int main(int argc, char **argv)
// Calculate the histogram
++histo_buff[ data_buff[ i]& ( N957_MAX_HISTO_SAMPLES- 1)];
// Log to file (if enabled)
if( out_file) {
if( out_file) {
sprintf( aux_string, "%04d\n", data_buff[ i]);
histograma[atoi(aux_string)+1] = histograma[atoi(aux_string)+1] +1;
TRACE1("%d \n", atoi(aux_string));
/*if(fwrite( aux_string, 1, strlen( aux_string), out_file)!= strlen( aux_string)) {
// out file write error
......@@ -394,10 +417,20 @@ int main(int argc, char **argv)
}
}
/*if( get_time()>= next_refresh) {
/*if( get_time()>= next_refresh+1000) {
FILE* histo_file= NULL;
next_refresh= get_time()+ user_setting.m_gnu_plot_refresh;
for(w=0; w<8191; w++)
{
TRACE1("%li ",histograma[w]);
}
TRACE("\n \n \n \n");
}
if(( histo_file= fopen( HISTO_FILENAME, "wt"))== NULL){
// out file write error
TRACE1( "N957 output file creation failure '%s'", HISTO_FILENAME);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment