Rev 205 | Rev 208 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 205 | Rev 206 | ||
|---|---|---|---|
| Line 139... | Line 139... | ||
| 139 | 139 | ||
| 140 | iev=0; |
140 | iev=0; |
| 141 | time_t t0,told; |
141 | time_t t0,told; |
| 142 | time(&t0); |
142 | time(&t0); |
| 143 | told=t0-1; |
143 | told=t0-1; |
| 144 |
|
144 | int posrec[9]; |
| 145 | while(!feof(fin)) { |
145 | while(!feof(fin)) { |
| 146 | if (iev>=nev) break; |
146 | if (iev>=nev) break; |
| 147 | stat=fread(recid,1,4,fin); |
147 | stat=fread(recid,1,4,fin); |
| 148 | if (debug) { |
148 | if (debug) { |
| 149 | if (recid[1]=='#') printf("%c%c%u\n",recid[0],recid[1],srecid[1]); |
149 | if (recid[1]=='#') printf("%c%c%u\n",recid[0],recid[1],srecid[1]); |
| Line 151... | Line 151... | ||
| 151 | } |
151 | } |
| 152 | switch (recid[0]) { |
152 | switch (recid[0]) { |
| 153 | 153 | ||
| 154 | case 'P':{ // position record |
154 | case 'P':{ // position record |
| 155 | int len; |
155 | int len; |
| 156 | stat=fread(&len,1,4,fin); |
156 | stat=fread(&len,1,4,fin); |
| 157 |
|
157 | if (len>0 && len<37) { |
| 158 | stat=fread(posrec,1,len,fin); |
158 | stat=fread(posrec,1,len,fin); |
| - | 159 | if (recid[3]=='R') |
|
| - | 160 | printf("Position len=%d x=%d y=%d ix=%d iy=%d\n", len, posrec[0], posrec[1], posrec[3], posrec[4]); |
|
| 159 | else |
161 | else |
| - | 162 | printf("Position record buffer length %d\n", len); |
|
| - | 163 | } else { |
|
| 160 |
|
164 | printf("Wrong buffer length %d\n", len); |
| - | 165 | } |
|
| 161 | break; |
166 | break; |
| 162 | } |
167 | } |
| 163 | case 'D': // DRS |
168 | case 'D': // DRS |
| 164 | version = atoi(&recid[3]); |
169 | version = atoi(&recid[3]); |
| 165 | break; |
170 | break; |