Improve logging and control flow in NetworkService and EventHandler; fix tapped assignment in GetLastTransactionsScript.
This commit is contained in:
parent
db88cf373e
commit
e5e8500534
@ -329,7 +329,6 @@ void GetLastTransactionsScript::searchTransaction(const DeviceInfo &device, int
|
|||||||
// Тапаем и ждём деталей
|
// Тапаем и ждём деталей
|
||||||
AdbUtils::makeTap(m_deviceId, visibleBtn.x(), visibleBtn.y());
|
AdbUtils::makeTap(m_deviceId, visibleBtn.x(), visibleBtn.y());
|
||||||
QThread::msleep(2000);
|
QThread::msleep(2000);
|
||||||
tapped = true;
|
|
||||||
|
|
||||||
TransactionInfo detail;
|
TransactionInfo detail;
|
||||||
for (int da = 0; da < 10; ++da) {
|
for (int da = 0; da < 10; ++da) {
|
||||||
@ -371,6 +370,7 @@ void GetLastTransactionsScript::searchTransaction(const DeviceInfo &device, int
|
|||||||
continue; // пробуем следующую кнопку
|
continue; // пробуем следующую кнопку
|
||||||
}
|
}
|
||||||
checkedDetails.insert(dtStr);
|
checkedDetails.insert(dtStr);
|
||||||
|
tapped = true;
|
||||||
|
|
||||||
// Проверяем дату
|
// Проверяем дату
|
||||||
if (txTime.isValid() && txTime.date() != searchDate) {
|
if (txTime.isValid() && txTime.date() != searchDate) {
|
||||||
|
|||||||
@ -58,6 +58,10 @@ void EventHandler::start() {
|
|||||||
const QStringList materialIds = MaterialDAO::getActiveMaterialIdsExcludingDevices(busyDevices);
|
const QStringList materialIds = MaterialDAO::getActiveMaterialIdsExcludingDevices(busyDevices);
|
||||||
if (!materialIds.isEmpty()) {
|
if (!materialIds.isEmpty()) {
|
||||||
m_network->getTasks(materialIds);
|
m_network->getTasks(materialIds);
|
||||||
|
} else {
|
||||||
|
qDebug() << "[EventHandler] No free materials to poll."
|
||||||
|
<< "busyDevices:" << busyDevices
|
||||||
|
<< "onlineDevices:" << onlineDevices;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m_pollTimer->start();
|
m_pollTimer->start();
|
||||||
|
|||||||
@ -1234,7 +1234,10 @@ void NetworkService::scheduleNextRefresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NetworkService::getTasks(const QStringList &materialIds) {
|
void NetworkService::getTasks(const QStringList &materialIds) {
|
||||||
if (m_fetchingTasks) return;
|
if (m_fetchingTasks) {
|
||||||
|
qDebug() << "[NetworkService] getTasks skipped: already fetching";
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_fetchingTasks = true;
|
m_fetchingTasks = true;
|
||||||
|
|
||||||
if (!ensureValidToken()) {
|
if (!ensureValidToken()) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user