57 lines
1.7 KiB
C++
57 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include <Scenario/Process/ScenarioModel.hpp>
|
|
|
|
#include <widgets/container_widget.hpp>
|
|
|
|
namespace Hardware
|
|
{
|
|
struct StateWidget;
|
|
|
|
class ScenarioWidget final : public bugui::container_widget
|
|
, public Nano::Observer
|
|
{
|
|
public:
|
|
explicit ScenarioWidget(Scenario::ProcessModel* scenario,
|
|
bugui::container_widget* parent);
|
|
|
|
int x() const override
|
|
{ return bugui::base_widget::parent->x(); }
|
|
int y() const override
|
|
{ return bugui::base_widget::parent->y(); }
|
|
int width() const override
|
|
{ return std::numeric_limits<int>::max(); }
|
|
int height() const override { return 15; }
|
|
|
|
Scenario::ProcessModel* get_model() const { return model; }
|
|
|
|
void add_proxy(StateWidget* sw);
|
|
void remove_proxy(StateWidget* sw);
|
|
|
|
void recursive_change(const Scenario::StateModel& state);
|
|
void recursive_change(const Scenario::IntervalModel& interval);
|
|
|
|
void change_previous(const Scenario::IntervalModel& interval);
|
|
void change_next(const Scenario::IntervalModel& interval);
|
|
void change_previous(const Scenario::StateModel& state);
|
|
void change_next(const Scenario::StateModel& state);
|
|
|
|
void time_propagate(const Scenario::StateModel& state, const TimeVal& t);
|
|
void time_propagate(const Scenario::IntervalModel& interval, const TimeVal& t);
|
|
|
|
bool changing{false};
|
|
|
|
private:
|
|
void on_interval_added(Scenario::IntervalModel& interval);
|
|
void on_interval_removed(const Scenario::IntervalModel& interval);
|
|
|
|
void on_time_sync_added(Scenario::TimeSyncModel& timeSync);
|
|
void on_time_sync_removed(const Scenario::TimeSyncModel& timeSync);
|
|
|
|
std::vector<StateWidget*> states_proxy;
|
|
|
|
Scenario::ProcessModel* model{nullptr};
|
|
// const Process::Style& skin;
|
|
};
|
|
|
|
} // namespace Hardware
|