Skip to content

Commit

Permalink
Merge branch 'master' into bugfix-1681-export-io-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
highperformancecoder committed Jan 18, 2024
2 parents a39a4bc + 0d2d81a commit 4b7a9f9
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/Reference.tex
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ \subsection{copy}\label{Operation:copy} This just copies its input to its output
\subsection{integrate $\int dt$}\label{IntOp} Creates an integration (or stock)
variable. Editable attributes include the variable's name and its
initial value at $t=0$. The function to be integrated needs to be
connected to the top port. The bottom port can optionally be connected
connected to the top port, labelled `$f$'. The bottom port, labelled `0', can optionally be connected
to a constant, parameter or variable, which is used to specify the
initial value of the integral.

Expand Down
10 changes: 8 additions & 2 deletions model/intOp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ namespace minsky
if (textFlipped) cairo_rotate(cairo, M_PI);
double sf = scaleFactor();
cairo_scale(cairo,sf,sf);
cairo_move_to(cairo,-7,4.5);
cairo_move_to(cairo,-7,3.5);
cairo_show_text(cairo,"\xE2\x88\xAB");
cairo_show_text(cairo,"dt");
cairo_show_text(cairo,"dt");
// label the initial condition port
cairo_scale(cairo,0.5,0.5);
cairo_move_to(cairo,-19,19);
cairo_show_text(cairo,"0");
cairo_move_to(cairo,-19,-15);
cairo_show_text(cairo,"f");
cairo_restore(cairo);

int intVarWidth=0;
Expand Down
10 changes: 5 additions & 5 deletions model/variable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ bool VariableBase::ioVar() const
{return dynamic_cast<Group*>(controller.lock().get());}


void VariableBase::ensureValueExists(VariableValue* vv, const std::string& nm) const
void VariableBase::ensureValueExists(VariableValue* vv, const std::string&/* nm*/) const
{
string valueId=this->valueId();
// disallow blank names
Expand All @@ -267,14 +267,14 @@ void VariableBase::ensureValueExists(VariableValue* vv, const std::string& nm) c
assert(isValueId(valueId));
// Ensure value of variable is preserved after rename.
if (vv==nullptr)
minsky().variableValues.emplace(valueId,VariableValuePtr(type(), name(),"")).
first->second->m_scope=minsky::scope(group.lock(),name());
minsky().variableValues.emplace(valueId,VariableValuePtr(type(), m_name,"")).
first->second->m_scope=minsky::scope(group.lock(),m_name);
// Ensure variable names are updated correctly everywhere they appear.
else
{
auto iter=minsky().variableValues.emplace(valueId,VariableValuePtr(type(),*vv)).first->second;
iter->name=nm;
iter->m_scope=minsky::scope(group.lock(),nm);
iter->name=m_name;
iter->m_scope=minsky::scope(group.lock(),m_name);
}

}
Expand Down
4 changes: 2 additions & 2 deletions schema/schema3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ namespace schema3
if (y.name) x1->table.title=*y.name;
if (y.editorMode && *y.editorMode!=x1->editorMode())
x1->toggleEditorMode();
if (y.variableDisplay && *y.variableDisplay!=x1->variableDisplay())
x1->toggleVariableDisplay();
if (y.variableDisplay)
SchemaHelper::setVariableDisplay(*x1, *y.variableDisplay);
if (y.buttonDisplay && *y.buttonDisplay!=x1->buttonDisplay())
x1->toggleButtons();
if (y.currency) x1->currency=*y.currency;
Expand Down
5 changes: 5 additions & 0 deletions schema/schemaHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ namespace minsky
{
setPrivates(g.table, data, assetClass);
}

static void setVariableDisplay(minsky::GodleyIcon& g, bool variableDisplay)
{
g.m_variableDisplay=variableDisplay;
}

static void setStockAndFlow(minsky::GodleyIcon& g,
const minsky::GodleyIcon::Variables& flowVars,
Expand Down
Binary file modified test/renderedEquations/EndogenousMoney.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/LoanableFunds.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/MinskyGovernmentNonlinear.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/MinskyNonLinear.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/MinskyPricesFinal.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/MonetaryMinskyNeoPrices.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/SteveTest028.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/data-example.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/math-examples.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/plotWidget.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/rand-gather-interpolation.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/renderedEquations/tensor-switch.mky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4b7a9f9

Please sign in to comment.