(),
selectHistoryItems: (specification: any) => {
console.log("selectHistoryItems", specification);
},
oids: [],
instrument: undefined as any,
instrumentListStore: undefined,
instrumentLists: [],
undoManager: undefined,
navigationStore: {
navigateToHistory: () => {
console.log("navigateToHistory");
},
navigateToDeletedHistoryItems: () => {
console.log("navigateToDeletedHistoryItems");
},
navigateToSessionsList: () => {
console.log("navigateToSessionsList");
},
mainHistoryView: undefined,
selectedListId: undefined,
changeSelectedListId: async (
listId: string | undefined
) => {
console.log("changeSelectedListId", listId);
}
},
filters: undefined as any,
findListIdByName: (listName: any) => undefined
};
}
get eezChart(): EEZChart {
const { widget, flowContext } = this.props;
if (widget.chartType === "single") {
return new SingleEEZChart(
flowContext,
widget,
evalProperty(flowContext, widget, "chartData") ??
(!flowContext.flowState
? EEZChart.genData(1000, Math.sin)
: undefined),
evalProperty(flowContext, widget, "format") ??
(!flowContext.flowState ? "double" : undefined),
evalProperty(flowContext, widget, "samplingRate") ??
(!flowContext.flowState ? 1000 : undefined),
evalProperty(flowContext, widget, "unitName") ??
(!flowContext.flowState ? "voltage" : undefined),
evalProperty(flowContext, widget, "color") ??
(!flowContext.flowState ? "#bb8100" : undefined),
evalProperty(flowContext, widget, "label") ??
(!flowContext.flowState
? "Channel 1 Voltage"
: undefined),
evalProperty(flowContext, widget, "offset") ??
(!flowContext.flowState ? 0 : undefined),
evalProperty(flowContext, widget, "scale") ??
(!flowContext.flowState ? 1 : undefined)
);
}
if (widget.chartType === "multi") {
return new MultiEEZChart(
flowContext,
widget,
widget.charts.map((chart, i) => ({
data:
evalProperty(
flowContext,
widget,
`charts[${i}].chartData`
) ??
(!flowContext.flowState
? EEZChart.genData(1000, Math.sin)
: undefined),
format:
evalProperty(
flowContext,
widget,
`charts[${i}].format`
) ??
(!flowContext.flowState ? "double" : undefined),
samplingRate:
evalProperty(
flowContext,
widget,
`charts[${i}].samplingRate`
) ?? (!flowContext.flowState ? 1000 : undefined),
unitName: evalProperty(
flowContext,
widget,
`charts[${i}].unitName`
),
color:
evalProperty(
flowContext,
widget,
`charts[${i}].color`
) ??
(!flowContext.flowState ? "#bb8100" : undefined),
label:
evalProperty(
flowContext,
widget,
`charts[${i}].label`
) ??
(!flowContext.flowState
? "Channel 1 Voltage"
: undefined),
offset:
evalProperty(
flowContext,
widget,
`charts[${i}].offset`
) ?? (!flowContext.flowState ? 0 : undefined),
scale:
evalProperty(
flowContext,
widget,
`charts[${i}].scale`
) ?? (!flowContext.flowState ? 1 : undefined)
}))
);
}
if (widget.chartType === "history-item") {
if (flowContext.flowState) {
const historyItemID = evalProperty(
flowContext,
widget,
"historyItemID"
);
if (
historyItemID != undefined &&
historyItemID == this.cacheHistoryItemID
) {
return this.cacheChart;
}
this.cacheHistoryItemID = historyItemID;
this.cacheChart = new HistoryItemEEZChart(
flowContext,
widget,
historyItemID
);
return this.cacheChart;
}
return new SingleEEZChart(
flowContext,
widget,
EEZChart.genData(1000, Math.sin),
"double",
1000,
"voltage",
"#bb8100",
"Channel 1 Voltage",
0,
1
);
}
const data = evalProperty(flowContext, widget, "chartData");
return new DLOGEEZChart(
flowContext,
widget,
flowContext.flowState
? data
: EEZChart.genDlogData(
"45455a2d444c4f4702000200f8000000030001070002472691640b0003000000000000f03f04000400070005330000000700060000000004000a0807000b0ad7a33c04000f0007000c0000000007000d0000803f03000e05001e010105001f0113080020010000000008002101000020420f002201444350343035202331205505002301010c00250100000000000000000c002601000000000000f03f05001e020305001f02130800200200000000080021020100a0400f002202444350343035202331204905002302010c00250200000000000000000c002602000000000000f03f040024000600320195010600330103030000370000295c0d4101002040295c0d4101002040295c0d41010020407b14d640ad1cfa3fcdcca040518db73f48e10441c1ca1140295c0d4101002040295c0d4101002040295c0d41010020407b14a24090c2b53f1f85f740f2d21140295c0d4101002040295c0d4101002040295c0d419eef1f40713da640ea26b93f713de640806afc3f295c0d4101002040295c0d41cff71f40295c0d41518d1f407b14a240ea26b93f1f85f740e4a50740295c0d4101002040295c0d4101002040295c0d41010020406666a640c74bbf3f713de640806afc3f295c0d4101002040295c0d4101002040295c0d419eef1f4085eba140ea26b93f6666e640b39d0740295c0d41cff71f40295c0d4101002040295c0d410100204085eba140f2d2b53f1f85f740f2d21140295c0d4101002040295c0d4101002040295c0d419eef1f406666a640ea26b93f6666e6401e5afc3f295c0d41cff71f40295c0d4101002040295c0d41ee7c1f407b14a240ea26b93f1f85f740e4a50740295c0d4101002040295c0d41cff71f40295c0d41cff71f406666a6402a5cbf3f713de640806afc3f"
)
);
}
render() {
const { flowContext } = this.props;
const { ChartPreview } =
require("instrument/window/chart-preview") as typeof ChartPreviewModule;
return (
{this.eezChart.chart && (
)}
);
}
}
);