2018-08-01 07:03:35 -06:00
|
|
|
import { TaggedSensorReading, TaggedSensor } from "farmbot";
|
2018-07-19 23:48:32 -06:00
|
|
|
import { AxisInputBoxGroupState } from "../interfaces";
|
2019-04-09 23:17:03 -06:00
|
|
|
import { TimeSettings } from "../../interfaces";
|
2018-07-19 23:48:32 -06:00
|
|
|
|
|
|
|
export interface SensorReadingsProps {
|
|
|
|
sensorReadings: TaggedSensorReading[];
|
|
|
|
sensors: TaggedSensor[];
|
2019-04-09 23:17:03 -06:00
|
|
|
timeSettings: TimeSettings;
|
2018-07-19 23:48:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SensorReadingsState {
|
|
|
|
sensor: TaggedSensor | undefined;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** seconds */
|
2018-07-19 23:48:32 -06:00
|
|
|
timePeriod: number;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** seconds */
|
2018-07-19 23:48:32 -06:00
|
|
|
endDate: number;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** location filter setting */
|
2020-02-28 09:34:28 -07:00
|
|
|
xyzLocation: AxisInputBoxGroupState | undefined;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** Show the previous time period in addition to the current time period. */
|
2018-07-19 23:48:32 -06:00
|
|
|
showPreviousPeriod: boolean;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** mm */
|
2018-07-19 23:48:32 -06:00
|
|
|
deviation: number;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** TaggedSensorReading UUID */
|
|
|
|
hovered: string | undefined;
|
2018-07-19 23:48:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SensorReadingsTableProps {
|
|
|
|
readingsForPeriod: (period: "current" | "previous") => TaggedSensorReading[];
|
|
|
|
sensors: TaggedSensor[];
|
2019-04-09 23:17:03 -06:00
|
|
|
timeSettings: TimeSettings;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** TaggedSensorReading UUID */
|
|
|
|
hovered: string | undefined;
|
|
|
|
hover: (hovered: string | undefined) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TableRowProps {
|
|
|
|
sensorReading: TaggedSensorReading;
|
|
|
|
sensorName: string;
|
2019-04-09 23:17:03 -06:00
|
|
|
timeSettings: TimeSettings;
|
2018-07-24 21:45:38 -06:00
|
|
|
period: "previous" | "current";
|
|
|
|
/** TaggedSensorReading UUID */
|
|
|
|
hovered: string | undefined;
|
|
|
|
hover: (hovered: string | undefined) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SensorSelectionProps {
|
|
|
|
selectedSensor: TaggedSensor | undefined;
|
|
|
|
sensors: TaggedSensor[];
|
|
|
|
setSensor: (sensor: TaggedSensor) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface LocationSelectionProps {
|
2020-02-28 09:34:28 -07:00
|
|
|
xyzLocation: AxisInputBoxGroupState | undefined;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** mm */
|
|
|
|
deviation: number;
|
|
|
|
setDeviation: (deviation: number) => void;
|
2020-02-28 09:34:28 -07:00
|
|
|
setLocation: (xyzLocation: AxisInputBoxGroupState | undefined) => void;
|
2018-07-24 21:45:38 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TimePeriodSelectionProps {
|
|
|
|
/** seconds */
|
|
|
|
timePeriod: number;
|
|
|
|
/** seconds */
|
|
|
|
endDate: number;
|
|
|
|
showPreviousPeriod: boolean;
|
|
|
|
setEndDate: (date: number) => void;
|
|
|
|
setPeriod: (period: number) => void;
|
|
|
|
togglePrevious: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DateDisplayProps {
|
|
|
|
/** seconds */
|
|
|
|
endDate: number;
|
2019-04-09 23:17:03 -06:00
|
|
|
timeSettings: TimeSettings;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** seconds */
|
|
|
|
timePeriod: number;
|
|
|
|
showPreviousPeriod: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SensorReadingPlotProps {
|
|
|
|
readingsForPeriod: (period: "current" | "previous") => TaggedSensorReading[];
|
|
|
|
/** seconds */
|
|
|
|
endDate: number;
|
2019-04-09 23:17:03 -06:00
|
|
|
timeSettings: TimeSettings;
|
2018-07-24 21:45:38 -06:00
|
|
|
/** TaggedSensorReading UUID */
|
|
|
|
hovered: string | undefined;
|
|
|
|
hover: (hovered: string | undefined) => void;
|
|
|
|
showPreviousPeriod: boolean;
|
|
|
|
/** seconds */
|
|
|
|
timePeriod: number;
|
2018-07-19 23:48:32 -06:00
|
|
|
}
|