void NetMobile::update(double delta, double time) { if (NetMobile::interp) { updateInterp(delta, time); } else { updateNoInterp(delta, time); } }
void QApplicationStatus::statusMessageReceived(const QList<QByteArray> &messageList) { QByteArray topic; topic = messageList.at(0); m_rx.ParseFromArray(messageList.at(1).data(), messageList.at(1).size()); #ifdef QT_DEBUG std::string s; gpb::TextFormat::PrintToString(m_rx, &s); DEBUG_TAG(3, "status", "update" << topic << QString::fromStdString(s)) #endif if ((m_rx.type() == pb::MT_EMCSTAT_FULL_UPDATE) || (m_rx.type() == pb::MT_EMCSTAT_INCREMENTAL_UPDATE)) { if ((topic == "motion") && m_rx.has_emc_status_motion()) { updateMotion(m_rx.emc_status_motion()); if (m_rx.type() == pb::MT_EMCSTAT_FULL_UPDATE) { updateSync(MotionChannel); } } if ((topic == "config") && m_rx.has_emc_status_config()) { updateConfig(m_rx.emc_status_config()); if (m_rx.type() == pb::MT_EMCSTAT_FULL_UPDATE) { updateSync(ConfigChannel); } } if ((topic == "io") && m_rx.has_emc_status_io()) { updateIo(m_rx.emc_status_io()); if (m_rx.type() == pb::MT_EMCSTAT_FULL_UPDATE) { updateSync(IoChannel); } } if ((topic == "task") && m_rx.has_emc_status_task()) { updateTask(m_rx.emc_status_task()); if (m_rx.type() == pb::MT_EMCSTAT_FULL_UPDATE) { updateSync(TaskChannel); } } if ((topic == "interp") && m_rx.has_emc_status_interp()) { updateInterp(m_rx.emc_status_interp()); if (m_rx.type() == pb::MT_EMCSTAT_FULL_UPDATE) { updateSync(InterpChannel); } } if (m_rx.type() == pb::MT_EMCSTAT_FULL_UPDATE) { if (m_statusSocketState != Up) { m_statusSocketState = Up; updateState(Connected); } if (m_rx.has_pparams()) { pb::ProtocolParameters pparams = m_rx.pparams(); startStatusHeartbeat(pparams.keepalive_timer() * 2); // wait double the time of the hearbeat interval } } else { refreshStatusHeartbeat(); } return; } else if (m_rx.type() == pb::MT_PING) { if (m_statusSocketState == Up) { refreshStatusHeartbeat(); } else { updateState(Connecting); unsubscribe(); // clean up previous subscription subscribe(); // trigger a fresh subscribe } return; } #ifdef QT_DEBUG gpb::TextFormat::PrintToString(m_rx, &s); DEBUG_TAG(1, "status", "update: unknown message type: " << QString::fromStdString(s)) #endif }