20 #ifndef PHILLIPS_DIAGRAM_H 21 #define PHILLIPS_DIAGRAM_H 43 classdesc::Exclude<std::vector<std::pair<double, FlowVar>>>
terms;
46 if (
terms.empty())
return {};
47 return terms.front().second.units();
49 void addTerm(
double coef,
const std::string& name) {
terms.emplace_back(coef, name);}
53 r+=i.first*i.second.value();
71 std::size_t
numPorts()
const override {
return 2;}
72 void draw(cairo_t* cairo)
const override;
77 bool redraw(
int,
int,
int width,
int height)
override;
86 std::map<std::string, PhillipsStock>
stocks;
106 #include "phillipsDiagram.cd"
std::size_t numPorts() const override
PhillipsFlow * flowBeingEdited
std::shared_ptr< Port > from() const
std::shared_ptr< Port > to() const
PhillipsFlow(const std::weak_ptr< Port > &from, const std::weak_ptr< Port > &to)
std::vector< float > position() const override
current centre coordinates
void draw(cairo_t *cairo) const override
draw this item into a cairo context
PhillipsStock * stockBeingRotated
static std::map< Units, double > maxFlow
void addTerm(double coef, const std::string &name)
static std::map< Units, double > maxStock
void mouseMove(float x, float y) override
CLASSDESC_ACCESS(PhillipsDiagram)
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
bool redraw(int, int, int width, int height) override
PhillipsStock(const StockVar &x)
void mouseDown(float x, float y) override
CLASSDESC_ACCESS(PhillipsFlow)
represents the units (in sense of dimensional analysis) of a variable.
std::map< std::pair< std::string, std::string >, PhillipsFlow > flows
std::map< std::string, PhillipsStock > stocks
void init() override
populate phillips diagram from Godley tables in model
PhillipsStock * stockBeingMoved
bool hasScrollBars() const override
return whether this window has scrollbars (needed for MacOSX).
void startRotatingItem(float x, float y)
classdesc::Exclude< std::vector< std::pair< double, FlowVar > > > terms
Exclude< Point > rotateOrigin
void updateBoundingBox() override
void mouseUp(float x, float y) override
void moveTo(float x, float y) override
move this so that (x,y) is centred
float y
position for panning