MCPcopy Create free account
hub / github.com/JSBSim-Team/jsbsim / GetAutoAxisMin

Method GetAutoAxisMin

utils/simplot/datafile.cpp:134–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132
133
134float DataFile::GetAutoAxisMin(int item) {
135 float Mn, order, magnitude;
136 float min = Min[item];
137 float max = Max[item];
138
139 if (max == 0.0 && min == 0.0) return(0.0);
140
141 if (StartIdx != 0 || (EndIdx != GetNumRecords()-1)) {
142 min = Data[StartIdx][item];
143 for (int rec=StartIdx+1; rec<=EndIdx; rec++) {
144 if (Data[rec][item] < min) min = Data[rec][item];
145 }
146 }
147
148 order = (int)(log10(fabs(min)));
149 magnitude = pow((double)10.0, (double)order);
150
151 if (min > 0.0) Mn = ((int)(min / magnitude)) * magnitude;
152 else Mn = ((int)(min / magnitude) - 1) * magnitude;
153
154 return Mn;
155}
156
157

Callers 2

mainFunction · 0.80
plotFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected