mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 12:02:09 +08:00
replay: support old, pre-pandaStates routes (#22525)
* replay: support old, pre-pandaStates routes * cleanup old-commit-hash: f1fcf17c4cde07c07cea7b6be68a5f845ce039e9
This commit is contained in:
@@ -236,6 +236,15 @@ void Replay::stream() {
|
||||
}
|
||||
setCurrentSegment(current_ts / 60);
|
||||
|
||||
// migration for pandaState -> pandaStates to keep UI working for old segments
|
||||
if (cur_which == cereal::Event::Which::PANDA_STATE_D_E_P_R_E_C_A_T_E_D) {
|
||||
MessageBuilder msg;
|
||||
auto ps = msg.initEvent().initPandaStates(1);
|
||||
ps[0].setIgnitionLine(true);
|
||||
ps[0].setPandaType(cereal::PandaState::PandaType::DOS);
|
||||
pm->send(sockets_[cereal::Event::Which::PANDA_STATES], msg);
|
||||
}
|
||||
|
||||
if (cur_which < sockets_.size() && sockets_[cur_which] != nullptr) {
|
||||
// keep time
|
||||
long etime = cur_mono_time_ - evt_start_ts;
|
||||
@@ -251,8 +260,9 @@ void Replay::stream() {
|
||||
// publish msg
|
||||
if (sm == nullptr) {
|
||||
auto bytes = evt->bytes();
|
||||
if (-1 == pm->send(sockets_[cur_which], (capnp::byte *)bytes.begin(), bytes.size())) {
|
||||
qDebug() << "stop publish" << sockets_[cur_which] << "due to multiple publishers error";
|
||||
int ret = pm->send(sockets_[cur_which], (capnp::byte *)bytes.begin(), bytes.size());
|
||||
if (ret == -1) {
|
||||
qDebug() << "stop publishing" << sockets_[cur_which] << "due to multiple publishers error";
|
||||
sockets_[cur_which] = nullptr;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user