@@ -27,6 +27,7 @@ EngineConfiguration::EngineConfiguration()
2727 m_whiteEvalPov(false ),
2828 m_pondering(false ),
2929 m_validateClaims(true ),
30+ m_timeoutScale(1.0 ),
3031 m_restartMode(RestartAuto)
3132{
3233}
@@ -41,6 +42,7 @@ EngineConfiguration::EngineConfiguration(const QString& name,
4142 m_whiteEvalPov(false ),
4243 m_pondering(false ),
4344 m_validateClaims(true ),
45+ m_timeoutScale(1.0 ),
4446 m_restartMode(RestartAuto)
4547{
4648}
@@ -50,6 +52,7 @@ EngineConfiguration::EngineConfiguration(const QVariant& variant)
5052 m_whiteEvalPov(false ),
5153 m_pondering(false ),
5254 m_validateClaims(true ),
55+ m_timeoutScale(1.0 ),
5356 m_restartMode(RestartAuto)
5457{
5558 const QVariantMap map = variant.toMap ();
@@ -60,6 +63,13 @@ EngineConfiguration::EngineConfiguration(const QVariant& variant)
6063 setStderrFile (map[" stderrFile" ].toString ());
6164 setProtocol (map[" protocol" ].toString ());
6265
66+ bool ok = true ;
67+ if (map.contains (" timeoutScaleFactor" ))
68+ {
69+ double tscale = map[" timeoutScaleFactor" ].toDouble (&ok);
70+ setTimeoutScale (ok ? tscale : 1.0 );
71+ }
72+
6373 if (map.contains (" initStrings" ))
6474 setInitStrings (map[" initStrings" ].toStringList ());
6575 if (map.contains (" whitepov" ))
@@ -109,6 +119,7 @@ EngineConfiguration::EngineConfiguration(const EngineConfiguration& other)
109119 m_whiteEvalPov(other.m_whiteEvalPov),
110120 m_pondering(other.m_pondering),
111121 m_validateClaims(other.m_validateClaims),
122+ m_timeoutScale(other.m_timeoutScale),
112123 m_restartMode(other.m_restartMode)
113124{
114125 const auto options = other.options ();
@@ -133,6 +144,7 @@ EngineConfiguration& EngineConfiguration::operator=(EngineConfiguration&& other)
133144 m_whiteEvalPov = other.m_whiteEvalPov ;
134145 m_pondering = other.m_pondering ;
135146 m_validateClaims = other.m_validateClaims ;
147+ m_timeoutScale = other.m_timeoutScale ;
136148 m_restartMode = other.m_restartMode ;
137149 m_options = other.m_options ;
138150
@@ -155,6 +167,7 @@ QVariant EngineConfiguration::toVariant() const
155167 map.insert (" workingDirectory" , m_workingDirectory);
156168 map.insert (" stderrFile" , m_stderrFile);
157169 map.insert (" protocol" , m_protocol);
170+ map.insert (" timeoutScaleFactor" , m_timeoutScale);
158171
159172 if (!m_initStrings.isEmpty ())
160173 map.insert (" initStrings" , m_initStrings);
@@ -361,6 +374,16 @@ void EngineConfiguration::setClaimsValidated(bool validate)
361374 m_validateClaims = validate;
362375}
363376
377+ double EngineConfiguration::timeoutScale () const
378+ {
379+ return m_timeoutScale;
380+ }
381+
382+ void EngineConfiguration::setTimeoutScale (double value)
383+ {
384+ m_timeoutScale = qBound (timeoutScaleMin, value, timeoutScaleMax);
385+ }
386+
364387EngineConfiguration& EngineConfiguration::operator =(const EngineConfiguration& other)
365388{
366389 if (this != &other)
@@ -370,6 +393,7 @@ EngineConfiguration& EngineConfiguration::operator=(const EngineConfiguration& o
370393 m_workingDirectory = other.m_workingDirectory ;
371394 m_stderrFile = other.m_stderrFile ;
372395 m_protocol = other.m_protocol ;
396+ m_timeoutScale = other.m_timeoutScale ;
373397 m_arguments = other.m_arguments ;
374398 m_initStrings = other.m_initStrings ;
375399 m_variants = other.m_variants ;
0 commit comments