- Preview
- A fictional tank with a measured level and a reported receipt. The finite sample illustrates a rising liquid surface.
- Inputs
- Supply levelM and positive gaugeSpanM in metres using the same zero datum. Supply volumeM3 independently from the provider or tank calibration. netFlowM3h is positive into the tank, negative out and zero when balanced. Optional configured limits use metres above the same datum and keys lowLow, low, high, highHigh and criticalHigh. Supply measuredAt in Unix milliseconds and set stale for an old report. Optional alarm contains a label and active or acknowledged state. Use alarm: null for no reported alarm or omit when unknown.
- Source options
- Map the authorised tank telemetry and its site-configured levels. The source owns alarms, level-to-volume calibration and the estimated time to its configured high-high limit. Publish timeToHighHighSeconds from that source and refresh the snapshot when readings arrive.
- Actions
- Open Details to view the timestamp, net flow, configured limits and reported alarm. Choose US or SI in the same panel.
- Integration requirements
- Missing or invalid readings stay unavailable. Configured limits must increase strictly in their listed order and fit the calibrated span when it is known. The drawing uses level divided by span and clips at the top, while the numeric reading can still show a level beyond the span. The ratio is a height fraction. The high-high comparison uses the unrounded measured level. The estimated time appears only with a fresh report, valid high-high limit, known level below it, positive net inflow and a nonnegative supplied estimate. Stale reports retain their readings and suppress the estimate. Feet use the international foot and bbl means a petroleum barrel.
{
"tankId": "TK-27",
"product": "Recovered oil",
"measuredAt": 1795777200000,
"gaugeSpanM": 10,
"levelM": 7.52,
"volumeM3": 3730,
"netFlowM3h": 600,
"limitsM": {
"high": 8.5,
"highHigh": 9.1
},
"timeToHighHighSeconds": 4740,
"alarm": null
}
import { TankGaugeWidget, type TankGaugeSnapshot } from "@lumo/widgets/catalog/oil-gas/tank-gauge";
type TankReport = Omit<TankGaugeSnapshot, "measuredAt" | "levelM" | "gaugeSpanM"> & {
recordedAt: string;
levelMm: number | null;
gaugeSpanMm: number | null;
};
export function TankTelemetry({ report }: { report: TankReport | null }) {
const snapshot = report && {
...report,
measuredAt: Date.parse(report.recordedAt),
levelM: report.levelMm === null ? null : report.levelMm / 1000,
gaugeSpanM: report.gaugeSpanMm === null ? null : report.gaugeSpanMm / 1000,
};
return <TankGaugeWidget snapshot={snapshot} initialUnit="si" />;
}