Diag: set timeout for diagRequest from config ...
Option: "ATBDeviceControllerPlugin/diagTimeout" Description: Timeout for diagRequest in seconds. Default value: 45s
This commit is contained in:
parent
962cd01eac
commit
492d3a107a
@ -82,6 +82,8 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *eventReceiver, con
|
||||
this->diag = new DeviceControllerDiag(this->persistentData, this);
|
||||
connect(this->diag, &DeviceControllerDiag::newVoltage, this, &ATBDeviceControllerPlugin::onNewVoltage);
|
||||
|
||||
int diagTimeout = settings.value("ATBDeviceControllerPlugin/diagTimeout", "45").toInt();
|
||||
this->diag->setTimeout(diagTimeout);
|
||||
|
||||
// currentSelectedTicketType - number of used "Kombiticket" (deprecated) use TICKET_VARIANT in future
|
||||
this->currentSelectedTicketType = 0;
|
||||
|
@ -20,7 +20,7 @@ DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *paren
|
||||
, pData(pData)
|
||||
{
|
||||
diagRequestTimeoutTimer = new QTimer(this);
|
||||
diagRequestTimeoutTimer->setInterval(1000*20); // 20s
|
||||
diagRequestTimeoutTimer->setInterval(1000*45);
|
||||
diagRequestTimeoutTimer->setSingleShot(true);
|
||||
connect(diagRequestTimeoutTimer, &QTimer::timeout, this, &DeviceControllerDiag::onDiagRequestTimeoutTimerTimeout);
|
||||
}
|
||||
@ -42,6 +42,11 @@ void DeviceControllerDiag::diagReInit()
|
||||
this->_isErrorState = false;
|
||||
}
|
||||
|
||||
void DeviceControllerDiag::setTimeout(int timeout)
|
||||
{
|
||||
this->diagRequestTimeoutTimer->setInterval(1000 * timeout);
|
||||
}
|
||||
|
||||
void DeviceControllerDiag::diagRequest()
|
||||
{
|
||||
qCritical() << "DeviceControllerDiag::diagRequest()";
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
bool isOperatingState();
|
||||
QSet<DeviceController::State> getCurrentMachineState();
|
||||
|
||||
|
||||
void setTimeout(int timeout);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user