linny-r 1.1.19 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linny-r",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "Executable graphical language with WYSIWYG editor for MILP models",
5
5
  "main": "server.js",
6
6
  "scripts": {
@@ -5825,7 +5825,7 @@ class GUIMonitor {
5825
5825
  this.equations_text.value = VM.equations[b - 1];
5826
5826
  }
5827
5827
  // Legend to variables is not block-dependent
5828
- this.variables_text.value = VM.variablesLegend;
5828
+ this.variables_text.value = VM.variablesLegend(b);
5829
5829
  // Show the text area for the selected tab
5830
5830
  if(this.tab !== tab) {
5831
5831
  let mt = 'monitor-' + this.tab;
@@ -2631,7 +2631,7 @@ class LinnyRModel {
2631
2631
  // NOTE: peak increase also applies to products
2632
2632
  p.b_peak_inc = [p.level[0]];
2633
2633
  p.la_peak_inc = [p.level[0]];
2634
-
2634
+ p.b_peak = [p.level[0]];
2635
2635
  }
2636
2636
  for(obj in this.links) if(this.links.hasOwnProperty(obj)) {
2637
2637
  l = this.links[obj];
@@ -4226,7 +4226,8 @@ class Note extends ObjectWithXYWH {
4226
4226
  if(obj instanceof DatasetModifier) {
4227
4227
  this.fields.push(new NoteField(tag, obj.expression));
4228
4228
  } else if(obj) {
4229
- const attr = (ena.length > 1 ? ena[1].trim() : '');
4229
+ // If attribute omitted, use default attribute of entity type
4230
+ const attr = (ena.length > 1 ? ena[1].trim() : obj.defaultAttribute);
4230
4231
  // Variable may specify a vector-type attribute
4231
4232
  let val = obj.attributeValue(attr);
4232
4233
  // If not, it may be a cluster unit balance
@@ -130,10 +130,12 @@ class Expression {
130
130
  this.code = null;
131
131
  const xp = new ExpressionParser(this.text, this.object, this.attribute);
132
132
  if(xp.error === '') {
133
- // NOTE: except for dataset modifiers, expressions should not be based
134
- // on levels-still-to-be-computed-by-the-solver, so caution the modeler
135
- // when this appears to be the case
136
- if(xp.is_level_based &&
133
+ // NOTE: except for dataset modifiers and note colors, expressions
134
+ // should not be based on levels-still-to-be-computed-by-the-solver,
135
+ // so caution the modeler when this appears to be the case
136
+ // NOTE: when note color expressions are edited, they are compiled
137
+ // to check their syntax; then their object is null
138
+ if(xp.is_level_based && this.object &&
137
139
  !(this.object instanceof Dataset || this.object instanceof Note)) {
138
140
  // NOTE: this should not occur, so log more details
139
141
  console.log('Level-based issue:',