MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / THROWS

Function THROWS

src/Platform/MessageBox.cpp:193–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191
192// MessageBoxLimits members
193void 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
233void MessageBoxLimits::GetFloatLimits(GCodeBuffer& gb) THROWS(GCodeException)
234{

Callers

nothing calls this directly

Calls 5

StringHandleClass · 0.85
SetIntMethod · 0.80
SetStringHandleMethod · 0.80
SeenMethod · 0.45
SetFloatMethod · 0.45

Tested by

no test coverage detected