-
-
Notifications
You must be signed in to change notification settings - Fork 276
Expand file tree
/
Copy pathsidepanel_replay.h
More file actions
98 lines (61 loc) · 2.03 KB
/
Copy pathsidepanel_replay.h
File metadata and controls
98 lines (61 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef SIDEPANEL_REPLAY_H
#define SIDEPANEL_REPLAY_H
#include <chrono>
#include <QFrame>
#include <QTableWidgetItem>
#include <QStandardItemModel>
#include "bt_editor_base.h"
#include "behavior_tree_editor_export.h"
namespace Ui {
class SidepanelReplay;
}
class BEHAVIOR_TREE_EDITOR_EXPORT SidepanelReplay : public QFrame
{
Q_OBJECT
public:
explicit SidepanelReplay(QWidget *parent = 0);
~SidepanelReplay() override;
void clear();
void loadLog(const QByteArray& content);
size_t transitionsCount() const { return _transitions.size(); }
public slots:
void on_LoadLog();
private slots:
void on_pushButtonPlay_toggled(bool checked);
void on_spinBox_valueChanged(int arg1);
void on_timeSlider_valueChanged(int value);
void on_tableView_clicked(const QModelIndex &index);
void onTimerUpdate();
void onPlayUpdate();
void on_lineEditFilter_textChanged(const QString &filter_text);
signals:
void loadBehaviorTree(const AbsBehaviorTree& tree, const QString& name );
void changeNodeStyle(const QString& bt_name,
const std::vector<std::pair<int, NodeStatus>>& node_status);
void addNewModel(const NodeModel &new_model);
private:
bool eventFilter(QObject *object, QEvent *event) override;
void loadFromFlatbuffers(const std::vector<int8_t>& serialized_description);
void onRowChanged(int value);
Ui::SidepanelReplay *ui;
struct Transition{
int16_t index;
double timestamp;
NodeStatus prev_status;
NodeStatus status;
bool is_tree_restart;
int nearest_restart_transition_index;
};
std::vector<Transition> _transitions;
std::vector< std::pair<double,int>> _timepoint;
int _prev_row;
int _next_row;
void updatedSpinAndSlider(int row);
QStandardItemModel* _table_model;
QTimer *_layout_update_timer;
QTimer *_play_timer;
AbsBehaviorTree _loaded_tree;
void updateTableModel(const AbsBehaviorTree &tree);
QWidget *_parent;
};
#endif // SIDEPANEL_REPLAY_H