/[PAMELA software]/rawreader/src/FindRoute.cpp
ViewVC logotype

Contents of /rawreader/src/FindRoute.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Sep 1 10:56:22 2006 UTC (18 years, 3 months ago) by cafagna
Branch: MAIN
CVS Tags: v1r15, v1r14, v1r11, v1r13, v1r12, HEAD
First release in the PAMELA environment, some cleanup in the include
files, module function and Makefile added

1 ///Real route identification///////////////////////////////////////////
2 #include "descript.h"
3 void FindRoute(int buffer3[], int *rr)
4 {
5 int i;
6 int tmp=0, tmp1=0, tmp2=0;
7 int count=0, count1=0, count2=0;
8
9 tmp=buffer3[8];
10 if ((tmp!=0)&&(tmp!=0xFF))
11 {
12 for (i=9;i<72;i++)
13 {if (tmp==buffer3[i]) count+=1;}
14 }
15
16 tmp1=buffer3[9];
17 if ((tmp1!=0)&&(tmp!=0xFF))
18 {
19 for (i=10;i<72;i++)
20 {if (tmp1==buffer3[i]) count1+=1;}
21 }
22
23 tmp2=buffer3[10];
24 if ((tmp2!=0)&&(tmp!=0xFF))
25 {
26 for (i=11;i<72;i++)
27 {if (tmp2==buffer3[i]) count2+=1;}
28 }
29
30 if (count>50)
31 {
32 *rr=tmp;
33 }
34 else if (count1>49)
35 {
36 *rr=tmp1;
37 }
38 else if (count2>48)
39 {
40 *rr=tmp2;
41 }
42 else
43 {
44 *rr=0;
45 }
46 // cout<<count<<" "<<count1<<" "<<count2<<"\n";
47 // cout<<tmp<<" "<<tmp1<<" "<<tmp2<<"\n";
48 // cout<<*rr<<"\n";
49 }
50

  ViewVC Help
Powered by ViewVC 1.1.23