Minsky
|
#include <variable.h>
Public Types | |
typedef VariableType::Type | Type |
![]() | |
enum | Type { undefined, constant, parameter, flow, integral, stock, tempFlow, numVarTypes } |
Public Member Functions | |
virtual std::size_t | numPorts () const =0 |
virtual Type | type () const =0 |
void | retype (VariableType::Type type) |
attempt to replace this variable with variable of type. More... | |
bool | visible () const override |
whether this item is visible on the canvas. More... | |
const VariableBase * | variableCast () const override |
VariableBase * | variableCast () override |
float | zoomFactor () const override |
bool | local () const |
void | toggleLocal () |
toggle local status More... | |
const std::string & | rawName () const |
accessor for the name member (may differ from name() with top level variables) More... | |
bool | ioVar () const override |
indicates this is a group I/O variable More... | |
void | ensureValueExists (VariableValue *vv, const std::string &name) const |
ensure an associated variableValue exists More... | |
virtual std::string | valueId () const |
string used to link to the VariableValue associated with this More... | |
std::string | valueIdInCurrentScope (const std::string &nm) const |
returns valueId for nm. If nm is not qualified, this variable's scope is used More... | |
std::shared_ptr< VariableValue > | vValue () const |
variableValue associated with this. nullptr if not associated with a variableValue More... | |
std::vector< unsigned > | dims () const |
variable's tensor shape More... | |
std::vector< std::string > | dimLabels () const |
labels along each axis More... | |
std::pair< std::string, std::string > | getDimLabelsPicked () const |
std::pair< std::string, std::string > | setDimLabelsPicked (const std::string &dimLabel1, const std::string &dimLabel2) |
const std::string & | detailedText () const override |
const std::string & | detailedText (const std::string &x) override |
const std::string & | tooltip () const override |
const std::string & | tooltip (const std::string &x) override |
bool | sliderVisible () const |
returns true if slider is to be drawn More... | |
Units | units (bool check) const override |
sets/gets the units associated with this type More... | |
Units | units () const |
void | setUnits (const std::string &) const |
std::string | unitsStr () const |
bool | onKeyPress (int, const std::string &, int) override |
respond to key press events More... | |
bool | lhs () const |
variable is on left hand side of flow calculation More... | |
bool | temp () const |
variable is temporary More... | |
virtual VariableBase * | clone () const override=0 |
bool | isStock () const |
std::string | definition () const |
formula defining this variable More... | |
void | draw (cairo_t *) const override |
void | resize (const LassoBox &b) override |
resize this item on the canvas More... | |
ClickType::Type | clickType (float x, float y) const override |
returns the clicktype given a mouse click at x, y. More... | |
bool | defined () const |
bool | inputWired () const |
std::vector< std::string > | accessibleVars () const |
return a list of existing variables this could be connected to More... | |
EngNotation | engExp () const |
return formatted mantissa and exponent in engineering format More... | |
std::string | mantissa (const EngNotation &e, int digits=3) const |
void | exportAsCSV (const std::string &filename, bool tabular) const |
export this variable as a CSV file More... | |
void | importFromCSV (const std::vector< std::string > &filenames, const DataSpecSchema &spec) const |
import CSV files, using spec More... | |
void | destroyFrame () override |
clean up popup window structures on window close More... | |
bool | miniPlotEnabled () const |
bool | miniPlotEnabled (bool) |
void | resetMiniPlot () |
bool | onMouseMotion (float x, float y) override |
respond to mouse motion events with button pressed More... | |
void | adjustSliderBounds () |
virtual std::string | name () const |
variable displayed name More... | |
virtual std::string | name (const std::string &nm) |
variable displayed name More... | |
const std::string & | canonicalName () const |
variable displayed name More... | |
std::string | init () const |
the initial value of this variable More... | |
std::string | init (const std::string &) |
< return initial value for this variable More... | |
virtual double | value (const double &) |
< set the initial value for this variable More... | |
virtual double | value () const override |
< set the initial value for this variable More... | |
double | sliderMin () const |
slider parameters More... | |
double | sliderMin (double) const |
slider parameters More... | |
double | sliderMax () const |
slider parameters More... | |
double | sliderMax (double) const |
slider parameters More... | |
double | sliderStep () const |
slider parameters More... | |
double | sliderStep (double) const |
slider parameters More... | |
bool | sliderStepRel () const |
slider parameters More... | |
bool | sliderStepRel (bool) const |
slider parameters More... | |
bool | enableSlider () const |
slider parameters More... | |
bool | enableSlider (bool) |
slider parameters More... | |
![]() | |
bool | onResizeHandle (float x, float y) const override |
void | drawResizeHandles (cairo_t *cairo) const override |
virtual Point | resizeHandleCoords () const |
returns coordinates of the resizer handle More... | |
![]() | |
Item () | |
virtual std::weak_ptr< Port > | ports (std::size_t i) const |
callback to be run when item deleted from group More... | |
std::size_t | portsSize () const |
number of ports More... | |
float | portX (std::size_t i) |
float | portY (std::size_t i) |
virtual bool | contains (float xx, float yy) const |
bool | contains (const Point &p) const |
void | updateBoundingBox () override |
void | throw_error (const std::string &) const |
mark item on canvas, then throw More... | |
double | rotation () const |
double | rotation (const double &r) |
std::pair< double, bool > | rotationAsRadians () const |
return the rotation as radians, and whether rotation should have additional straight angle added for text that stays upright. More... | |
float | iWidth () const |
float | iWidth (const float &w) |
float | iHeight () const |
float | iHeight (const float &h) |
virtual void | flip () |
rotate icon though 180∘ More... | |
virtual std::string | classType () const |
std::string | id () const |
return an id uniquely identifying this item More... | |
virtual float | x () const |
virtual float | y () const |
void | ensureBBValid () const |
float | width () const |
float | height () const |
virtual std::vector< Point > | corners () const |
float | left () const |
float | right () const |
float | top () const |
float | bottom () const |
std::string | bookmarkId () const |
Id of bookmark associated with this. More... | |
void | adjustBookmark () const override |
adjust bookmark list to reflect current configuration More... | |
float | resizeHandleSize () const |
resize handles should be at least a percentage if the icon size (#1025) More... | |
virtual bool | inItem (float x, float y) const |
virtual bool | onItem (float x, float y) const |
returns true if (x,y) is on the icon More... | |
virtual void | onMouseDown (float x, float y) |
respond to mouse down events More... | |
virtual void | onMouseUp (float x, float y) |
respond to mouse up events More... | |
virtual bool | onMouseOver (float x, float y) |
respond to mouse motion events (hover) without button pressed More... | |
virtual void | onMouseLeave () |
respond to mouse leave events (when mouse leaves item) More... | |
virtual void | deleteAttachedWires () |
delete all attached wires More... | |
void | moveTo (float x, float y) |
virtual float | scaleFactor () const |
factor by which item has been resized More... | |
virtual float | scaleFactor (const float &sf) |
void | dummyDraw () const |
draw into a dummy cairo context, for purposes of calculating port positions More... | |
virtual void | displayTooltip (cairo_t *, const std::string &) const |
display tooltip text, eg on mouseover More... | |
virtual void | updateIcon (double t) |
update display after a step() More... | |
Item (const Item &)=default | |
Item & | operator= (const Item &)=default |
virtual | ~Item () |
void | drawPorts (cairo_t *cairo) const |
virtual std::shared_ptr< Port > | closestOutPort (float x, float y) const |
returns closest output port to x,y More... | |
virtual std::shared_ptr< Port > | closestInPort (float x, float y) const |
virtual std::shared_ptr< Item > | select (float x, float y) const |
returns the variable if point (x,y) is within a visible variable icon, null otherwise. More... | |
virtual void | TCL_obj (classdesc::TCL_obj_t &t, const std::string &d) |
runs the TCL_obj descriptor suitable for this type More... | |
void | RESTProcess (classdesc::RESTProcess_t &rp, const std::string &d) override |
runs the RESTProcess descriptor suitable for this type More... | |
void | RESTProcess (classdesc::RESTProcess_t &rp, const std::string &d) const override |
virtual void | json_pack (classdesc::json_pack_t &j) const |
virtual void | displayDelayedTooltip (float x, float y) |
enable extended tooltip help message appropriate for mouse at (x,y) More... | |
virtual void | disableDelayedTooltip () |
virtual bool | editorMode () const |
some items have an editor mode attribute More... | |
virtual void | toggleEditorMode () |
Units | checkUnits () const |
perform units consistency checks More... | |
ItemPtr | itemPtrFromThis () const |
return a shared_ptr to this More... | |
![]() | |
virtual | ~NoteBase ()=default |
![]() | |
NameAccessor () | |
![]() | |
InitAccessor () | |
![]() | |
ValueAccessor () | |
![]() | |
VariableCaches ()=default | |
VariableCaches (const VariableCaches &) | |
VariableCaches & | operator= (const VariableCaches &) |
Static Public Member Functions | |
static VariableBase * | create (Type type) |
![]() | |
static void | drawSelected (cairo_t *cairo) |
![]() | |
static std::string | typeName (int t) |
Public Attributes | |
classdesc::Exclude< std::weak_ptr< Item > > | controller |
reference to a controlling item - eg GodleyIcon, IntOp or a Group if an IOVar. More... | |
![]() | |
float | m_x =0 |
float | m_y =0 |
position in canvas, or within group More... | |
float | m_sf =1 |
scale factor of item on canvas, or within group More... | |
bool | onResizeHandles =false |
set to true to indicate mouse is ovcaler resize handles More... | |
bool | onBorder =false |
true to indicate mouse hovering over border More... | |
std::string | deleteCallback |
BoundingBox | bb |
canvas bounding box. More... | |
![]() | |
bool | mouseFocus =false |
true if target of a mouseover More... | |
bool | selected =false |
true if selected for cut, copy or group operation More... | |
bool | bookmark =false |
Is this item also a bookmark? More... | |
Static Public Attributes | |
static int | varsPassed =0 |
for caching units calculation factory method More... | |
Protected Member Functions | |
void | addPorts () |
Private Member Functions | |
CLASSDESC_ACCESS (VariableBase) | |
void | insertControlled (Selection &selection) override |
Private Attributes | |
std::string | m_name |
std::string | m_canonicalName |
latex processed and active stripped version of name More... | |
std::pair< std::string, std::string > | m_dimLabelsPicked |
int | unitsCtr =0 |
for detecting reentrancy in units() More... | |
classdesc::Exclude< std::shared_ptr< ecolab::Plot > > | miniPlot |
miniature plot feature More... | |
Static Private Attributes | |
static int | stockVarsPassed =0 |
for detecting reentrancy in units() More... | |
Friends | |
struct | minsky::SchemaHelper |
Additional Inherited Members | |
![]() | |
static void | drawResizeHandle (cairo_t *cairo, double x, double y, double sf, double angle) |
![]() | |
double | m_width =10 |
double | m_height =10 |
ItemPortVector | m_ports |
minsky::Item::MemoisedRotator | memoisedRotator |
![]() | |
classdesc::Exclude< std::shared_ptr< RenderVariable > > | cachedNameRender |
cached Pango objects More... | |
classdesc::Exclude< std::shared_ptr< ecolab::Pango > > | cachedMantissa |
classdesc::Exclude< std::shared_ptr< ecolab::Pango > > | cachedExponent |
double | cachedValue |
double | cachedTime |
Definition at line 87 of file variable.h.
Definition at line 96 of file variable.h.
std::vector< std::string > VariableBase::accessibleVars | ( | ) | const |
return a list of existing variables this could be connected to
Definition at line 89 of file variable.cc.
|
protected |
Definition at line 69 of file variable.cc.
References minsky::Item::m_ports, and numPorts().
Referenced by minsky::Variable< VariableType::constant >::operator=(), minsky::PhillipsStock::PhillipsStock(), and minsky::Variable< VariableType::constant >::Variable().
void VariableBase::adjustSliderBounds | ( | ) |
Definition at line 555 of file variable.cc.
References vValue().
|
inline |
variable displayed name
Definition at line 145 of file variable.h.
References m_canonicalName.
|
private |
|
overridevirtual |
returns the clicktype given a mouse click at x, y.
Reimplemented from minsky::Item.
Definition at line 97 of file variable.cc.
References minsky::Item::clickType(), minsky::VariableType::constant, minsky::flipped(), minsky::RenderVariable::handlePos(), minsky::RenderVariable::height(), minsky::Item::iHeight(), minsky::ClickType::inItem, minsky::Item::rotation(), type(), minsky::Rotate::x(), minsky::Item::x(), minsky::Rotate::y(), minsky::Item::y(), and zoomFactor().
|
overridepure virtual |
Reimplemented from minsky::Item.
Implemented in minsky::VarConstant, minsky::Variable< T >, minsky::Variable< VariableType::constant >, and minsky::ItemT< Variable< T >, VariableBase >.
|
static |
Definition at line 116 of file variable.cc.
References minsky::VariableType::constant, minsky::VariableType::flow, minsky::VariableType::integral, minsky::VariableType::parameter, minsky::VariableType::stock, minsky::VariableType::tempFlow, type(), minsky::VariableType::typeName(), and minsky::VariableType::undefined.
Referenced by schema3::MinskyItemFactory::create(), and minsky::VariablePtr::retype().
|
inline |
Definition at line 219 of file variable.h.
References controller, inputWired(), and isStock().
std::string VariableBase::definition | ( | ) | const |
formula defining this variable
Definition at line 578 of file variable.cc.
References minsky::cminsky(), minsky::VariableType::constant, MathDAG::SystemOfEquations::getDefFromIntVar(), MathDAG::SystemOfEquations::getNodeFromVar(), minsky::VariableType::integral, minsky::VariableType::parameter, and type().
|
overridevirtual |
clean up popup window structures on window close
Reimplemented from minsky::Item.
Definition at line 492 of file variable.cc.
References vValue().
|
overridevirtual |
Reimplemented from minsky::NoteBase.
Definition at line 353 of file variable.cc.
References emptyString, and vValue().
|
overridevirtual |
Reimplemented from minsky::NoteBase.
Definition at line 360 of file variable.cc.
References emptyString, vValue(), and minsky::Item::x().
vector< string > VariableBase::dimLabels | ( | ) | const |
labels along each axis
Definition at line 179 of file variable.cc.
References vValue().
vector< unsigned > VariableBase::dims | ( | ) | const |
variable's tensor shape
Definition at line 169 of file variable.cc.
References vValue().
|
overridevirtual |
draws the icon onto the given cairo context
Reimplemented from minsky::Item.
Definition at line 704 of file variable.cc.
References minsky::VariableCaches::cachedExponent, minsky::VariableCaches::cachedMantissa, minsky::VariableCaches::cachedNameRender, minsky::VariableCaches::cachedTime, minsky::VariableCaches::cachedValue, minsky::cminsky(), minsky::VariableType::constant, MathDAG::cos(), minsky::Item::displayTooltip(), minsky::Item::drawPorts(), minsky::BottomRightResizerItem::drawResizeHandles(), minsky::Item::drawSelected(), engExp(), minsky::expMultiplier(), minsky::flipped(), minsky::Item::iHeight(), ioVar(), minsky::anonymous_namespace{userFunction.cc}::isinf(), minsky::anonymous_namespace{userFunction.cc}::isnan(), minsky::Item::iWidth(), lhs(), local(), M_PI, minsky::Item::m_ports, mantissa(), miniPlot, minsky::NoteBase::mouseFocus, minsky::Item::moveTo(), minsky::Item::onResizeHandles, minsky::VariableType::parameter, minsky::Item::rotation(), minsky::Item::rotationAsRadians(), minsky::NoteBase::selected, MathDAG::sin(), minsky::sliderHandleRadius, sliderVisible(), minsky::RungeKutta::t, tooltip(), type(), value(), vValue(), minsky::Rotate::x(), minsky::Item::x(), minsky::Rotate::y(), minsky::Item::y(), and zoomFactor().
Referenced by minsky::RenderVariable::draw(), minsky::PhillipsStock::draw(), and minsky::anonymous_namespace{godleyIcon.cc}::DrawVars::operator()().
bool VariableBase::enableSlider | ( | ) | const |
slider parameters
Definition at line 689 of file variable.cc.
References vValue().
Referenced by schema3::Item::Item(), and sliderVisible().
bool VariableBase::enableSlider | ( | bool | x | ) |
slider parameters
Definition at line 696 of file variable.cc.
References vValue(), and minsky::Item::x().
|
inline |
return formatted mantissa and exponent in engineering format
Definition at line 227 of file variable.h.
References minsky::engExp(), and value().
Referenced by draw(), and minsky::RenderVariable::RenderVariable().
void VariableBase::ensureValueExists | ( | VariableValue * | vv, |
const std::string & | name | ||
) | const |
ensure an associated variableValue exists
Definition at line 262 of file variable.cc.
References minsky::isValueId(), m_name, minsky::minsky(), minsky::scope(), type(), valueId(), and minsky::Minsky::variableValues.
Referenced by init(), MathDAG::SystemOfEquations::makeDAG(), name(), minsky::VarConstant::name(), and minsky::VarConstant::VarConstant().
void VariableBase::exportAsCSV | ( | const std::string & | filename, |
bool | tabular | ||
) | const |
export this variable as a CSV file
tabular | - if true, the longest dimension is split across columns as a horizontal dimension |
Definition at line 472 of file variable.cc.
References minsky::minsky(), name(), value(), valueId(), and minsky::Minsky::variableValues.
|
inline |
Definition at line 169 of file variable.h.
References m_dimLabelsPicked.
void VariableBase::importFromCSV | ( | const std::vector< std::string > & | filenames, |
const DataSpecSchema & | spec | ||
) | const |
import CSV files, using spec
Definition at line 479 of file variable.cc.
References minsky::loadValueFromCSVFile(), minsky::minsky(), minsky::Minsky::populateMissingDimensionsFromVariable(), minsky::Item::throw_error(), and vValue().
string VariableBase::init | ( | ) | const |
the initial value of this variable
Definition at line 285 of file variable.cc.
References controller, minsky::VariableType::integral, minsky::Item::m_ports, minsky::minsky(), type(), value(), valueId(), minsky::Minsky::variableValues, and vValue().
Referenced by minsky::VarConstant::name(), units(), and minsky::VarConstant::value().
string VariableBase::init | ( | const std::string & | x | ) |
< return initial value for this variable
Definition at line 308 of file variable.cc.
References minsky::VariableCaches::cachedNameRender, minsky::cminsky(), minsky::VariableType::constant, ensureValueExists(), minsky::VariableType::flow, minsky::VariableValue::init(), minsky::isValueId(), minsky::minsky(), minsky::VariableType::parameter, minsky::VariableValues::resetValue(), type(), minsky::Item::updateBoundingBox(), valueId(), minsky::Minsky::variableValues, and minsky::Item::x().
bool VariableBase::inputWired | ( | ) | const |
Definition at line 82 of file variable.cc.
References minsky::Item::ports().
Referenced by defined(), and sliderVisible().
|
overrideprivate |
Definition at line 498 of file variable.cc.
References controller, and minsky::Selection::ensureItemInserted().
|
overridevirtual |
indicates this is a group I/O variable
Reimplemented from minsky::Item.
Definition at line 258 of file variable.cc.
References controller.
Referenced by draw(), minsky::RenderVariable::RenderVariable(), and zoomFactor().
|
inline |
Definition at line 206 of file variable.h.
References minsky::VariableType::integral, minsky::VariableType::stock, and type().
Referenced by defined(), and units().
|
inline |
variable is on left hand side of flow calculation
Definition at line 202 of file variable.h.
References minsky::VariableType::flow, minsky::VariableType::tempFlow, and type().
Referenced by draw().
bool VariableBase::local | ( | ) | const |
Definition at line 196 of file variable.cc.
References minsky::Minsky::canvas, minsky::cminsky(), m_name, and minsky::Canvas::model.
Referenced by draw().
|
inline |
Definition at line 229 of file variable.h.
References minsky::mantissa(), and value().
Referenced by draw(), and minsky::RenderVariable::RenderVariable().
|
inline |
Definition at line 242 of file variable.h.
References miniPlot.
Referenced by resetMiniPlot().
bool VariableBase::miniPlotEnabled | ( | bool | enabled | ) |
Definition at line 595 of file variable.cc.
References miniPlot.
|
virtual |
variable displayed name
Reimplemented in minsky::VarConstant.
Definition at line 201 of file variable.cc.
References m_name.
Referenced by exportAsCSV(), MathDAG::SystemOfEquations::makeDAG(), name(), minsky::GroupItems::renameVar(), minsky::RenderVariable::RenderVariable(), toggleLocal(), units(), and minsky::Variable< VariableType::constant >::Variable().
|
virtual |
variable displayed name
Reimplemented in minsky::VarConstant.
Definition at line 233 of file variable.cc.
References minsky::Item::bb, minsky::VariableCaches::cachedNameRender, minsky::canonicalName(), controller, ensureValueExists(), m_canonicalName, m_name, name(), anonymous_namespace{variable.cc}::quoteLaTeX(), anonymous_namespace{variable.cc}::specialLatex, minsky::BoundingBox::update(), valueId(), and vValue().
|
pure virtual |
Implemented in minsky::Variable< T >, minsky::Variable< VariableType::constant >, minsky::Variable< T >, minsky::Variable< VariableType::constant >, minsky::Variable< T >, minsky::Variable< VariableType::constant >, minsky::Variable< T >, minsky::Variable< VariableType::constant >, minsky::Variable< T >, minsky::Variable< VariableType::constant >, minsky::Variable< T >, minsky::Variable< VariableType::constant >, minsky::Variable< T >, minsky::Variable< VariableType::constant >, minsky::Variable< T >, minsky::Variable< VariableType::constant >, and minsky::PhillipsStock.
Referenced by addPorts().
|
overridevirtual |
respond to key press events
Reimplemented from minsky::Item.
Definition at line 561 of file variable.cc.
References minsky::minsky(), minsky::Minsky::requestReset(), and vValue().
|
overridevirtual |
respond to mouse motion events with button pressed
Reimplemented from minsky::Item.
Definition at line 613 of file variable.cc.
References MathDAG::cos(), minsky::RungeKutta::evalEquations(), minsky::Item::iWidth(), M_PI, minsky::minsky(), minsky::Minsky::pushHistory(), minsky::Minsky::requestReset(), minsky::Item::rotation(), vValue(), minsky::RenderVariable::width(), minsky::Item::x(), and zoomFactor().
|
inline |
accessor for the name member (may differ from name() with top level variables)
Definition at line 150 of file variable.h.
References m_name.
Referenced by schema3::Item::Item(), and minsky::GroupItems::renameVar().
void VariableBase::resetMiniPlot | ( | ) |
Definition at line 607 of file variable.cc.
References miniPlot, and miniPlotEnabled().
|
overridevirtual |
resize this item on the canvas
Reimplemented from minsky::Item.
Definition at line 875 of file variable.cc.
References minsky::Item::iHeight(), minsky::Item::iWidth(), minsky::Item::moveTo(), minsky::LassoBox::x0, minsky::LassoBox::x1, minsky::LassoBox::y0, minsky::LassoBox::y1, and zoomFactor().
void VariableBase::retype | ( | VariableType::Type | type | ) |
attempt to replace this variable with variable of type.
if | not possible |
Definition at line 132 of file variable.cc.
References minsky::Minsky::convertVarType(), minsky::minsky(), minsky::VariablePtr::retype(), type(), valueId(), and vValue().
|
inline |
Definition at line 170 of file variable.h.
References m_dimLabelsPicked.
void VariableBase::setUnits | ( | const std::string & | x | ) | const |
Definition at line 464 of file variable.cc.
References minsky::isValueId(), minsky::minsky(), valueId(), minsky::Minsky::variableValues, and minsky::Item::x().
double VariableBase::sliderMax | ( | ) | const |
slider parameters
Definition at line 647 of file variable.cc.
References vValue().
Referenced by schema3::Item::Item().
double VariableBase::sliderMax | ( | double | x | ) | const |
slider parameters
Definition at line 654 of file variable.cc.
References vValue(), and minsky::Item::x().
double VariableBase::sliderMin | ( | ) | const |
slider parameters
Definition at line 632 of file variable.cc.
References vValue().
Referenced by schema3::Item::Item().
double VariableBase::sliderMin | ( | double | x | ) | const |
slider parameters
Definition at line 640 of file variable.cc.
References vValue(), and minsky::Item::x().
double VariableBase::sliderStep | ( | ) | const |
slider parameters
Definition at line 661 of file variable.cc.
References vValue().
Referenced by schema3::Item::Item().
double VariableBase::sliderStep | ( | double | x | ) | const |
slider parameters
Definition at line 668 of file variable.cc.
References vValue(), and minsky::Item::x().
bool VariableBase::sliderStepRel | ( | ) | const |
slider parameters
Definition at line 675 of file variable.cc.
References vValue().
Referenced by schema3::Item::Item().
bool VariableBase::sliderStepRel | ( | bool | x | ) | const |
slider parameters
Definition at line 682 of file variable.cc.
References vValue(), and minsky::Item::x().
bool VariableBase::sliderVisible | ( | ) | const |
returns true if slider is to be drawn
Definition at line 544 of file variable.cc.
References minsky::cminsky(), minsky::Minsky::definingVar(), enableSlider(), minsky::VariableType::flow, inputWired(), minsky::VariableType::parameter, type(), valueId(), and vValue().
Referenced by draw().
|
inline |
variable is temporary
Definition at line 204 of file variable.h.
References minsky::VariableType::tempFlow, type(), and minsky::VariableType::undefined.
|
inline |
toggle local status
Definition at line 140 of file variable.h.
References m_name, and name().
|
overridevirtual |
Reimplemented from minsky::NoteBase.
Definition at line 367 of file variable.cc.
References emptyString, and vValue().
Referenced by draw().
|
overridevirtual |
Reimplemented from minsky::NoteBase.
Definition at line 374 of file variable.cc.
References emptyString, vValue(), and minsky::Item::x().
|
pure virtual |
Implemented in minsky::Variable< T >, and minsky::Variable< VariableType::constant >.
Referenced by clickType(), create(), definition(), draw(), ensureValueExists(), init(), isStock(), lhs(), MathDAG::SystemOfEquations::makeDAG(), minsky::RenderVariable::RenderVariable(), retype(), sliderVisible(), temp(), and value().
|
overridevirtual |
sets/gets the units associated with this type
Reimplemented from minsky::Item.
Definition at line 384 of file variable.cc.
References minsky::cminsky(), controller, init(), isStock(), minsky::GroupItems::items, minsky::Item::m_ports, minsky::minsky(), minsky::Minsky::model, minsky::FlowCoef::name, name(), minsky::VariableValues::resetUnitsCache(), stockVarsPassed, minsky::Units::str(), minsky::Item::throw_error(), units(), unitsCtr, minsky::valueId(), valueId(), minsky::Minsky::variableValues, and varsPassed.
|
inline |
Definition at line 195 of file variable.h.
References units().
Referenced by minsky::PhillipsStock::draw(), units(), and unitsStr().
|
inline |
Definition at line 197 of file variable.h.
References minsky::Units::str(), and units().
|
virtual |
< set the initial value for this variable
current value associated with this variable
Reimplemented in minsky::VarConstant.
Definition at line 340 of file variable.cc.
References minsky::VariableCaches::cachedNameRender, minsky::VariableType::constant, minsky::isValueId(), m_name, minsky::minsky(), type(), valueId(), minsky::Minsky::variableValues, and minsky::Item::x().
|
overridevirtual |
< set the initial value for this variable
current value associated with this variable
Reimplemented from minsky::Item.
Definition at line 332 of file variable.cc.
References minsky::cminsky(), valueId(), and minsky::Minsky::variableValues.
Referenced by minsky::PhillipsStock::draw(), draw(), engExp(), exportAsCSV(), init(), and mantissa().
|
virtual |
string used to link to the VariableValue associated with this
Reimplemented in minsky::VarConstant.
Definition at line 186 of file variable.cc.
References m_name, and minsky::valueId().
Referenced by ensureValueExists(), exportAsCSV(), MathDAG::SystemOfEquations::getDefFromIntVar(), init(), MathDAG::SubexpressionCache::key(), MathDAG::SystemOfEquations::makeDAG(), name(), schema3::PhillipsDiagram::populatePhillipsDiagram(), retype(), setUnits(), sliderVisible(), units(), value(), and vValue().
std::string VariableBase::valueIdInCurrentScope | ( | const std::string & | nm | ) | const |
returns valueId for nm. If nm is not qualified, this variable's scope is used
Definition at line 191 of file variable.cc.
References minsky::valueId().
|
inlineoverride |
Definition at line 132 of file variable.h.
|
inlineoverride |
Definition at line 133 of file variable.h.
|
overridevirtual |
whether this item is visible on the canvas.
Reimplemented from minsky::Item.
Definition at line 535 of file variable.cc.
References controller, and minsky::Item::visible().
shared_ptr< VariableValue > VariableBase::vValue | ( | ) | const |
variableValue associated with this. nullptr if not associated with a variableValue
Definition at line 161 of file variable.cc.
References minsky::cminsky(), minsky::minsky(), valueId(), and minsky::Minsky::variableValues.
Referenced by adjustSliderBounds(), destroyFrame(), detailedText(), dimLabels(), dims(), draw(), enableSlider(), minsky::RenderVariable::handlePos(), importFromCSV(), init(), schema3::Item::Item(), MathDAG::SystemOfEquations::makeDAG(), name(), onKeyPress(), onMouseMotion(), schema3::Item::packTensorInit(), retype(), sliderMax(), sliderMin(), sliderStep(), sliderStepRel(), sliderVisible(), and tooltip().
|
overridevirtual |
Reimplemented from minsky::Item.
Definition at line 150 of file variable.cc.
References controller, ioVar(), and minsky::Item::zoomFactor().
Referenced by clickType(), minsky::PhillipsStock::draw(), draw(), onMouseMotion(), and resize().
|
friend |
Definition at line 97 of file variable.h.
classdesc::Exclude<std::weak_ptr<Item> > minsky::VariableBase::controller |
reference to a controlling item - eg GodleyIcon, IntOp or a Group if an IOVar.
Definition at line 129 of file variable.h.
Referenced by defined(), init(), insertControlled(), ioVar(), name(), minsky::Variable< VariableType::constant >::operator=(), minsky::GroupItems::removeItem(), units(), visible(), and zoomFactor().
|
private |
latex processed and active stripped version of name
Definition at line 102 of file variable.h.
Referenced by canonicalName(), and name().
|
private |
Definition at line 103 of file variable.h.
Referenced by getDimLabelsPicked(), and setDimLabelsPicked().
|
private |
Definition at line 101 of file variable.h.
Referenced by ensureValueExists(), local(), name(), rawName(), toggleLocal(), value(), and valueId().
|
private |
miniature plot feature
Definition at line 110 of file variable.h.
Referenced by draw(), miniPlotEnabled(), and resetMiniPlot().
|
staticprivate |
for detecting reentrancy in units()
Definition at line 105 of file variable.h.
Referenced by units().
|
mutableprivate |
for detecting reentrancy in units()
Definition at line 104 of file variable.h.
Referenced by units().
|
static |
for caching units calculation factory method
Definition at line 116 of file variable.h.
Referenced by units().