Skip to content

Commit bf3d91c

Browse files
committed
update eez-framework
1 parent 8ae9653 commit bf3d91c

File tree

7 files changed

+66
-34
lines changed

7 files changed

+66
-34
lines changed

packages/project-editor/flow/component.tsx

+32-14
Original file line numberDiff line numberDiff line change
@@ -2933,11 +2933,20 @@ export class Widget extends Component {
29332933
)) {
29342934
const eventDef = classInfo.widgetEvents[eventName];
29352935
if (eventDef.oldName == "action") {
2936-
jsObject.eventHandlers.push({
2937-
eventName,
2938-
handlerType: "action",
2939-
action: jsObject.action
2940-
});
2936+
if (
2937+
!jsObject.eventHandlers.find(
2938+
(eventHandler: EventHandler) =>
2939+
eventHandler.eventName == eventName &&
2940+
eventHandler.handlerType == "action" &&
2941+
eventHandler.action == jsObject.action
2942+
)
2943+
) {
2944+
jsObject.eventHandlers.push({
2945+
eventName,
2946+
handlerType: "action",
2947+
action: jsObject.action
2948+
});
2949+
}
29412950
break;
29422951
}
29432952
}
@@ -2952,15 +2961,24 @@ export class Widget extends Component {
29522961
)) {
29532962
const eventDef = classInfo.widgetEvents[eventName];
29542963
if (eventDef.oldName == asOutputProperty) {
2955-
jsObject.eventHandlers.push({
2956-
eventName,
2957-
handlerType: "flow"
2958-
});
2959-
wireSourceChanged(
2960-
object,
2961-
asOutputProperty,
2962-
eventName
2963-
);
2964+
if (
2965+
!jsObject.eventHandlers.find(
2966+
(eventHandler: EventHandler) =>
2967+
eventHandler.eventName ==
2968+
eventName &&
2969+
eventHandler.handlerType == "flow"
2970+
)
2971+
) {
2972+
jsObject.eventHandlers.push({
2973+
eventName,
2974+
handlerType: "flow"
2975+
});
2976+
wireSourceChanged(
2977+
object,
2978+
asOutputProperty,
2979+
eventName
2980+
);
2981+
}
29642982
break;
29652983
}
29662984
}

packages/project-editor/flow/components/widgets/dashboard/plotly.tsx

+32-18
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ interface InputData {
489489

490490
export class PlotlyLineChartExecutionState {
491491
updated: number = 0;
492-
valuesMap: Map<number, number[]>;
493492
values: InputData[] = [];
494493
maxPoints: number = 0;
495494
labels: string[] = [];
@@ -1417,11 +1416,6 @@ export class LineChartWidget extends Widget {
14171416

14181417
if (resetInputValue !== undefined) {
14191418
context.clearInputValue("reset");
1420-
1421-
if (executionState.valuesMap) {
1422-
executionState.valuesMap.clear();
1423-
}
1424-
14251419
executionState!.values = [];
14261420
} else {
14271421
let maxPoints = context.evalProperty("maxPoints");
@@ -1430,24 +1424,44 @@ export class LineChartWidget extends Widget {
14301424
if (xValue != undefined) {
14311425
const lineValues = context.getExpressionListParam(8);
14321426

1433-
if (!executionState.valuesMap) {
1434-
executionState!.valuesMap = new Map();
1427+
if (!executionState.values) {
1428+
executionState.values = [];
1429+
}
1430+
1431+
let inserted = false;
1432+
1433+
for (let i = 0; i < executionState.values.length; i++) {
1434+
if (xValue < executionState.values[i].xValue) {
1435+
executionState.values.splice(i, 0, {
1436+
xValue,
1437+
lineValues
1438+
});
1439+
inserted = true;
1440+
break;
1441+
}
1442+
1443+
if (xValue == executionState.values[i].xValue) {
1444+
if (i < executionState.values.length - 1) {
1445+
executionState.values[i].lineValues =
1446+
lineValues;
1447+
inserted = true;
1448+
}
1449+
break;
1450+
}
14351451
}
1436-
executionState.valuesMap.set(xValue, lineValues);
14371452

1438-
let xValues = [...executionState.valuesMap.keys()];
1439-
xValues.sort((a, b) => a - b);
1440-
while (xValues.length > 0 && xValues.length > maxPoints) {
1441-
executionState.valuesMap.delete(xValues.shift()!);
1453+
if (!inserted) {
1454+
executionState.values.push({
1455+
xValue,
1456+
lineValues
1457+
});
14421458
}
14431459

1444-
let values = xValues.map(xValue => ({
1445-
xValue,
1446-
lineValues: executionState!.valuesMap.get(xValue)!
1447-
}));
1460+
while (executionState.values.length > maxPoints) {
1461+
executionState.values.splice(0, 1);
1462+
}
14481463

14491464
executionState!.maxPoints = maxPoints;
1450-
executionState!.values = values;
14511465
}
14521466
}
14531467

Binary file not shown.
Binary file not shown.
Binary file not shown.

wasm/eez-framework

wasm/lvgl-runtime/v8.3/lvgl

Submodule lvgl updated from b277c49 to d30df36

0 commit comments

Comments
 (0)