Skip to content

Commit

Permalink
update eez-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Dec 24, 2024
1 parent 8ae9653 commit bf3d91c
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 34 deletions.
46 changes: 32 additions & 14 deletions packages/project-editor/flow/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2933,11 +2933,20 @@ export class Widget extends Component {
)) {
const eventDef = classInfo.widgetEvents[eventName];
if (eventDef.oldName == "action") {
jsObject.eventHandlers.push({
eventName,
handlerType: "action",
action: jsObject.action
});
if (
!jsObject.eventHandlers.find(
(eventHandler: EventHandler) =>
eventHandler.eventName == eventName &&
eventHandler.handlerType == "action" &&
eventHandler.action == jsObject.action
)
) {
jsObject.eventHandlers.push({
eventName,
handlerType: "action",
action: jsObject.action
});
}
break;
}
}
Expand All @@ -2952,15 +2961,24 @@ export class Widget extends Component {
)) {
const eventDef = classInfo.widgetEvents[eventName];
if (eventDef.oldName == asOutputProperty) {
jsObject.eventHandlers.push({
eventName,
handlerType: "flow"
});
wireSourceChanged(
object,
asOutputProperty,
eventName
);
if (
!jsObject.eventHandlers.find(
(eventHandler: EventHandler) =>
eventHandler.eventName ==
eventName &&
eventHandler.handlerType == "flow"
)
) {
jsObject.eventHandlers.push({
eventName,
handlerType: "flow"
});
wireSourceChanged(
object,
asOutputProperty,
eventName
);
}
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ interface InputData {

export class PlotlyLineChartExecutionState {
updated: number = 0;
valuesMap: Map<number, number[]>;
values: InputData[] = [];
maxPoints: number = 0;
labels: string[] = [];
Expand Down Expand Up @@ -1417,11 +1416,6 @@ export class LineChartWidget extends Widget {

if (resetInputValue !== undefined) {
context.clearInputValue("reset");

if (executionState.valuesMap) {
executionState.valuesMap.clear();
}

executionState!.values = [];
} else {
let maxPoints = context.evalProperty("maxPoints");
Expand All @@ -1430,24 +1424,44 @@ export class LineChartWidget extends Widget {
if (xValue != undefined) {
const lineValues = context.getExpressionListParam(8);

if (!executionState.valuesMap) {
executionState!.valuesMap = new Map();
if (!executionState.values) {
executionState.values = [];
}

let inserted = false;

for (let i = 0; i < executionState.values.length; i++) {
if (xValue < executionState.values[i].xValue) {
executionState.values.splice(i, 0, {
xValue,
lineValues
});
inserted = true;
break;
}

if (xValue == executionState.values[i].xValue) {
if (i < executionState.values.length - 1) {
executionState.values[i].lineValues =
lineValues;
inserted = true;
}
break;
}
}
executionState.valuesMap.set(xValue, lineValues);

let xValues = [...executionState.valuesMap.keys()];
xValues.sort((a, b) => a - b);
while (xValues.length > 0 && xValues.length > maxPoints) {
executionState.valuesMap.delete(xValues.shift()!);
if (!inserted) {
executionState.values.push({
xValue,
lineValues
});
}

let values = xValues.map(xValue => ({
xValue,
lineValues: executionState!.valuesMap.get(xValue)!
}));
while (executionState.values.length > maxPoints) {
executionState.values.splice(0, 1);
}

executionState!.maxPoints = maxPoints;
executionState!.values = values;
}
}

Expand Down
Binary file modified packages/project-editor/flow/runtime/eez_runtime.wasm
Binary file not shown.
Binary file modified packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm
Binary file not shown.
Binary file modified packages/project-editor/flow/runtime/lvgl_runtime_v9.0.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion wasm/eez-framework
2 changes: 1 addition & 1 deletion wasm/lvgl-runtime/v8.3/lvgl
Submodule lvgl updated from b277c4 to d30df3

0 comments on commit bf3d91c

Please sign in to comment.