Rev 146 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 146 | Rev 172 | ||
|---|---|---|---|
| Line 161... | Line 161... | ||
| 161 | 161 | ||
| 162 | clkt1 = clock() - stopw0;  | 
            162 | clkt1 = clock() - stopw0;  | 
          
| 163 | if(DBGSIG) printf("TimeEstimate(): Startclock = %d, Midclock (%f) = %f (%d), starttime = %d, curtime = %d\n", (int)stopw0, progress, (float)clkt1/CLOCKS_PER_SEC, (int)clkt1, (int)time0, (int)time(NULL));  | 
            163 | if(DBGSIG) printf("TimeEstimate(): Startclock = %d, Midclock (%f) = %f (%d), starttime = %d, curtime = %d\n", (int)stopw0, progress, (float)clkt1/CLOCKS_PER_SEC, (int)clkt1, (int)time0, (int)time(NULL));  | 
          
| 164 | GetTime((int)(100.*((float)clkt1/CLOCKS_PER_SEC)/progress+(int)time0+offset), ctemp);  | 
            164 | GetTime((int)(100.*((float)clkt1/CLOCKS_PER_SEC)/progress+(int)time0+offset), ctemp);  | 
          
| 165 | sprintf(retEstim, "Estimated end time: %s", ctemp);  | 
            165 | sprintf(retEstim, "Estimated end time: %s", ctemp);  | 
          
| - | 166 | } | 
          |
| - | 167 | ||
| - | 168 | void TimeEstimateNew(int nr, clock_t stopw0, time_t time0, int rX, int rY, int rZ, int xWait, int yWait, int zWait, char *retEstim)  | 
          |
| - | 169 | { | 
          |
| - | 170 | clock_t clkt1;  | 
          |
| - | 171 | char ctemp[512];  | 
          |
| - | 172 | double timeSec;  | 
          |
| - | 173 | double averMeasTime;  | 
          |
| - | 174 | ||
| - | 175 | clkt1 = clock() - stopw0;  | 
          |
| - | 176 | if(nr == -1)  | 
          |
| - | 177 | return;  | 
          |
| - | 178 | else if(nr == 0)  | 
          |
| - | 179 | averMeasTime = (double)clkt1/CLOCKS_PER_SEC;  | 
          |
| - | 180 |    else | 
          |
| - | 181 | averMeasTime = (averMeasTime + (double)clkt1/CLOCKS_PER_SEC)/2.0;  | 
          |
| - | 182 | ||
| - | 183 |    // calculate the time of one row | 
          |
| - | 184 | timeSec = rX*(xWait + averMeasTime);  | 
          |
| - | 185 |    // calculate the time of a surface scan | 
          |
| - | 186 | timeSec = timeSec + rY*(timeSec + yWait);  | 
          |
| - | 187 |    // calculate the time of a zscan | 
          |
| - | 188 | if(rZ == 1)  | 
          |
| - | 189 | timeSec = timeSec + zWait;  | 
          |
| - | 190 |    else | 
          |
| - | 191 | timeSec = timeSec + rZ*(timeSec + zWait);  | 
          |
| - | 192 | ||
| - | 193 | GetTime((int)timeSec+(int)time0, ctemp);  | 
          |
| - | 194 | sprintf(retEstim, "Estimated end time: %s", ctemp);  | 
          |
| - | 195 | ||
| - | 196 | printf("TimeEstimateNew(): Average time of measurement = %lf, Measurement time = %lf, Finishing time = %s\n", averMeasTime, timeSec, ctemp);  | 
          |
| 166 | } | 
            197 | } | 
          
| 167 | 198 | ||
| 168 | void NormateSet(int file, int nrpoint, double *min, double *max, double *setCount, double *setAcc)  | 
            199 | void NormateSet(int file, int nrpoint, double *min, double *max, double *setCount, double *setAcc)  | 
          
| 169 | { | 
            200 | { | 
          
| 170 | int count = 0;  | 
            201 | int count = 0;  |