| 191 | |
| 192 | // MessageBoxLimits members |
| 193 | void MessageBoxLimits::GetIntegerLimits(GCodeBuffer& gb, bool defaultIsString) THROWS(GCodeException) |
| 194 | { |
| 195 | int32_t iLow, iHigh; |
| 196 | bool dummy; |
| 197 | const bool gotLowerLimit = gb.TryGetIValue('L', iLow, dummy); |
| 198 | const bool gotUpperLimit = gb.TryGetIValue('H', iHigh, dummy); |
| 199 | if (gotLowerLimit) |
| 200 | { |
| 201 | if (gotUpperLimit && iLow > iHigh) |
| 202 | { |
| 203 | gb.ThrowGCodeException("H value must not be less than L value"); |
| 204 | } |
| 205 | minVal.SetInt(iLow); |
| 206 | } |
| 207 | if (gotUpperLimit) |
| 208 | { |
| 209 | maxVal.SetInt(iHigh); |
| 210 | } |
| 211 | if (gb.Seen('F')) |
| 212 | { |
| 213 | int32_t iDefault; |
| 214 | if (defaultIsString) |
| 215 | { |
| 216 | String<StringLength100> sDefault; |
| 217 | gb.GetQuotedString(sDefault.GetRef(), true); |
| 218 | iDefault = (int32_t)sDefault.strlen(); |
| 219 | defaultVal.SetStringHandle(StringHandle(sDefault.c_str())); |
| 220 | } |
| 221 | else |
| 222 | { |
| 223 | iDefault = gb.GetIValue(); |
| 224 | defaultVal.SetInt(iDefault); |
| 225 | } |
| 226 | if ((gotLowerLimit && iDefault < iLow) || (gotUpperLimit && iDefault > iHigh)) |
| 227 | { |
| 228 | gb.ThrowGCodeException("default value is outside limits"); |
| 229 | } |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | void MessageBoxLimits::GetFloatLimits(GCodeBuffer& gb) THROWS(GCodeException) |
| 234 | { |
nothing calls this directly
no test coverage detected