| 84 | } |
| 85 | |
| 86 | int |
| 87 | PatternRecorder::record(int commitTag, double timeStamp) |
| 88 | { |
| 89 | double value = 0.0; |
| 90 | |
| 91 | // where relDeltaTTol is the maximum reliable ratio between analysis time step and deltaT |
| 92 | // and provides tolerance for floating point precision (see floating-point-tolerance-for-recorder-time-step.md) |
| 93 | if (deltaT == 0.0 || timeStamp - nextTimeStampToRecord >= -deltaT * relDeltaTTol) { |
| 94 | |
| 95 | if (deltaT != 0.0) |
| 96 | nextTimeStampToRecord = timeStamp + deltaT; |
| 97 | |
| 98 | LoadPattern *pattern = theDomain->getLoadPattern(thePattern); |
| 99 | if (pattern != 0) { |
| 100 | value = pattern->getLoadFactor(); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // write them to the file |
| 105 | if (flag == 1) |
| 106 | theFile << timeStamp << " "; |
| 107 | else if (flag == 2) |
| 108 | theFile << timeStamp << " "; |
| 109 | |
| 110 | theFile << value << " "; |
| 111 | |
| 112 | theFile << endln; |
| 113 | theFile.flush(); |
| 114 | |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | int |
| 119 | PatternRecorder::playback(int commitTag) |
nothing calls this directly
no test coverage detected