updated as in the terminal and gate api's

This commit is contained in:
csawatzky 2025-04-17 15:42:19 -06:00
parent 76744c1b6f
commit 74c8ed661c
13 changed files with 109 additions and 75 deletions

View file

@ -60,6 +60,7 @@ const useStyles = makeStyles((theme: Theme) => ({
export default function GateGraphs(props: Props) {
const { gate, display, compMap, device, pressure, ambient, setPCAState } = props;
const [{ as }] = useGlobalState();
const [xDomain, setXDomain] = useState<string[] | number[]>(["dataMin", "dataMax"]);
const [zoomed, setZoomed] = useState(false);
const defaultDateRange = GetDefaultDateRange();
@ -79,7 +80,7 @@ export default function GateGraphs(props: Props) {
setLoading(true);
let measurementMap: Map<string, UnitMeasurement[]> = new Map<string, UnitMeasurement[]>();
gateAPI
.listGateMeasurements(gate.key, startDate.toISOString(), endDate.toISOString())
.listGateMeasurements(gate.key, startDate.toISOString(), endDate.toISOString(), as)
.then(resp => {
resp.data.measurements.forEach(um => {
let unitMeasurement = UnitMeasurement.any(um, user);
@ -93,7 +94,7 @@ export default function GateGraphs(props: Props) {
setLoading(false);
setCompMeasurements(measurementMap);
});
}, [gate, endDate, gateAPI, startDate]); // eslint-disable-line react-hooks/exhaustive-deps
}, [gate, endDate, gateAPI, startDate, as]); // eslint-disable-line react-hooks/exhaustive-deps
const updateDateRange = (newStartDate: any, newEndDate: any) => {
let range = GetDefaultDateRange();