| 1 | #include "manip.h"
 | 
|---|
| 2 | #include "choix_acquisition.h"
 | 
|---|
| 3 | #include "archeops.h"
 | 
|---|
| 4 | #include "choix_param.h"
 | 
|---|
| 5 | #include "structure.h"
 | 
|---|
| 6 | #include "tm.h"
 | 
|---|
| 7 | #include "simulmission.h"
 | 
|---|
| 8 | #include "simulstate.h"
 | 
|---|
| 9 | 
 | 
|---|
| 10 | void ReadSimulDC()
 | 
|---|
| 11 | {
 | 
|---|
| 12 |   char buf[200];
 | 
|---|
| 13 |   char* p;
 | 
|---|
| 14 |   short frefnum;
 | 
|---|
| 15 |   long count;
 | 
|---|
| 16 |   short dummy;
 | 
|---|
| 17 |   if (FSOpen("\psimul.datacard", 0, &frefnum)) return;
 | 
|---|
| 18 |   while (1) {
 | 
|---|
| 19 |     count = 200;
 | 
|---|
| 20 |     FSRead(frefnum, &count, buf);
 | 
|---|
| 21 |     buf[count] = 0;
 | 
|---|
| 22 |     if (count == 0) break;
 | 
|---|
| 23 |     p = strchr(buf, '\r');
 | 
|---|
| 24 |     if (!p) break;
 | 
|---|
| 25 |     SetFPos(frefnum, fsFromMark, -count + (p-buf) +1);
 | 
|---|
| 26 |     if (buf[0] != '@') continue;
 | 
|---|
| 27 |     p = strchr(buf, ' ');
 | 
|---|
| 28 |     if (!p) continue;
 | 
|---|
| 29 |     *p = 0; p++;
 | 
|---|
| 30 |     if (!strcmp(buf, "@SPEED"))
 | 
|---|
| 31 |       sscanf(p, "%lg", &overSpeed);
 | 
|---|
| 32 |     else if (!strcmp(buf, "@WNOISE")) {
 | 
|---|
| 33 |       sscanf(p, "%lg %lg %lg %lg %lg %lg", whiteNoise, whiteNoise+1, whiteNoise+2,
 | 
|---|
| 34 |           whiteNoise+3, whiteNoise+4, whiteNoise+5);
 | 
|---|
| 35 |     } else if (!strcmp(buf, "@FREQ")) {
 | 
|---|
| 36 |       sscanf(p, "%lg %lg %lg %lg %lg %lg", bolfreq, bolfreq+1, bolfreq+2,
 | 
|---|
| 37 |           bolfreq+3, bolfreq+4, bolfreq+5);
 | 
|---|
| 38 |     } else if (!strcmp(buf, "@GLITCH")) {
 | 
|---|
| 39 |       sscanf(p, "%lg %lg", &glitchFreq, &glitchMaxAmpl);
 | 
|---|
| 40 |     } else if (!strcmp(buf, "@BOLOTCONST")) {
 | 
|---|
| 41 |       sscanf(p, "%lg", &boloTimeCst);
 | 
|---|
| 42 |     } else if (!strcmp(buf, "@SST2BARS")) {
 | 
|---|
| 43 |       sscanf(p, "%lg", &dummy);
 | 
|---|
| 44 |       sst2Bars = (dummy != 0);
 | 
|---|
| 45 |     }
 | 
|---|
| 46 |   }
 | 
|---|
| 47 |   FSClose(frefnum);
 | 
|---|
| 48 | }
 | 
|---|