Compare commits
No commits in common. "dev_environment" and "master" have entirely different histories.
dev_enviro
...
master
16 changed files with 31 additions and 357 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
# Used in the build stage of the pipeline to create a frontend docker image
|
# Used in the build stage of the pipeline to create a frontend docker image
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
RUN rm /etc/nginx/conf.d/default.conf
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY /build /usr/share/nginx/html
|
COPY /build /usr/share/nginx/html
|
||||||
20
indexV2.html
Normal file
20
indexV2.html
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/x-icon" id="favicon-link" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title id="title-id">Adaptive Dashboard</title>
|
||||||
|
<link rel="manifest" id="manifest-link" />
|
||||||
|
</head>
|
||||||
|
<script>
|
||||||
|
window.CRISP_RUNTIME_CONFIG = {
|
||||||
|
session_merge: true
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="80170383-b426-43c0-8f66-8e20a05bcdce";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/app/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -46,7 +46,7 @@
|
||||||
"mui-tel-input": "^7.0.0",
|
"mui-tel-input": "^7.0.0",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
"openweathermap-ts": "^1.2.10",
|
"openweathermap-ts": "^1.2.10",
|
||||||
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#dev",
|
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master",
|
||||||
"query-string": "^9.2.1",
|
"query-string": "^9.2.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-beautiful-dnd": "^13.1.1",
|
"react-beautiful-dnd": "^13.1.1",
|
||||||
|
|
@ -11830,7 +11830,7 @@
|
||||||
},
|
},
|
||||||
"node_modules/protobuf-ts": {
|
"node_modules/protobuf-ts": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#e61049af5dd297179d5a88650cf40edb2eef8b4d",
|
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#d6a992e46192a8ab8195235357318dc297738064",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protobufjs": "^6.8.8"
|
"protobufjs": "^6.8.8"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
"mui-tel-input": "^7.0.0",
|
"mui-tel-input": "^7.0.0",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
"openweathermap-ts": "^1.2.10",
|
"openweathermap-ts": "^1.2.10",
|
||||||
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#dev",
|
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master",
|
||||||
"query-string": "^9.2.1",
|
"query-string": "^9.2.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-beautiful-dnd": "^13.1.1",
|
"react-beautiful-dnd": "^13.1.1",
|
||||||
|
|
|
||||||
|
|
@ -1539,7 +1539,7 @@ export default function BinVisualizer(props: Props) {
|
||||||
<InfoOutlined />
|
<InfoOutlined />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
) : (
|
) : (
|
||||||
<IconButton size="small" onClick={() => {fullScreenHandler.enter()}}>
|
<IconButton size="small" onClick={() => fullScreenHandler.enter()}>
|
||||||
<FullscreenIcon />
|
<FullscreenIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,7 @@ export const I2C: AddressTypeExtension = {
|
||||||
[quack.ComponentType.COMPONENT_TYPE_SEN5X, 0x68],
|
[quack.ComponentType.COMPONENT_TYPE_SEN5X, 0x68],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_AIRFLOW, 0x6b],
|
[quack.ComponentType.COMPONENT_TYPE_AIRFLOW, 0x6b],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE, 0x70],
|
[quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE, 0x70],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE, 0x6c],
|
[quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE, 0x6c]
|
||||||
[quack.ComponentType.COMPONENT_TYPE_TEMP_HUMIDITY, 0x43]
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const offset = offsets.get(componentType);
|
const offset = offsets.get(componentType);
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,7 @@ import {
|
||||||
VPD,
|
VPD,
|
||||||
Weight,
|
Weight,
|
||||||
CapacitorCable,
|
CapacitorCable,
|
||||||
AnalogPressure,
|
AnalogPressure
|
||||||
Plenum,
|
|
||||||
AmbientOnewire,
|
|
||||||
AmbientI2C
|
|
||||||
} from "pbHelpers/ComponentTypes";
|
} from "pbHelpers/ComponentTypes";
|
||||||
//import { multilineGrainCableData } from "pbHelpers/ComponentTypes/GrainCable";
|
//import { multilineGrainCableData } from "pbHelpers/ComponentTypes/GrainCable";
|
||||||
//import { multilineCapCableData } from "./ComponentTypes/CapacitorCable";
|
//import { multilineCapCableData } from "./ComponentTypes/CapacitorCable";
|
||||||
|
|
@ -64,7 +61,6 @@ import { LineData, Point } from "charts/measurementCharts/MultiLineGraph";
|
||||||
import moment, { Moment } from "moment";
|
import moment, { Moment } from "moment";
|
||||||
import { avg } from "utils";
|
import { avg } from "utils";
|
||||||
import { Airflow } from "./ComponentTypes/Airflow";
|
import { Airflow } from "./ComponentTypes/Airflow";
|
||||||
import { TempHumidity } from "./ComponentTypes/TempHumidity";
|
|
||||||
|
|
||||||
const COMPONENT_TYPE_MAP = new Map<quack.ComponentType, Function>([
|
const COMPONENT_TYPE_MAP = new Map<quack.ComponentType, Function>([
|
||||||
[quack.ComponentType.COMPONENT_TYPE_INVALID, Invalid],
|
[quack.ComponentType.COMPONENT_TYPE_INVALID, Invalid],
|
||||||
|
|
@ -102,12 +98,7 @@ const COMPONENT_TYPE_MAP = new Map<quack.ComponentType, Function>([
|
||||||
[quack.ComponentType.COMPONENT_TYPE_VIBRATION_CHAIN, VibrationCable],
|
[quack.ComponentType.COMPONENT_TYPE_VIBRATION_CHAIN, VibrationCable],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE, dragerGasDongle],
|
[quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE, dragerGasDongle],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_AIRFLOW, Airflow],
|
[quack.ComponentType.COMPONENT_TYPE_AIRFLOW, Airflow],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_TEMP_HUMIDITY, TempHumidity],
|
[quack.ComponentType.COMPONENT_TYPE_ANALOG_PRESSURE, AnalogPressure]
|
||||||
[quack.ComponentType.COMPONENT_TYPE_ANALOG_PRESSURE, AnalogPressure],
|
|
||||||
[quack.ComponentType.COMPONENT_TYPE_PLENUM, Plenum],
|
|
||||||
[quack.ComponentType.COMPONENT_TYPE_AMBIENT_ONEWIRE, AmbientOnewire],
|
|
||||||
[quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C, AmbientI2C],
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export interface Subtype {
|
export interface Subtype {
|
||||||
|
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
import TemperatureHumidityDarkIcon from "assets/components/temperatureHumidityDark.png";
|
|
||||||
import TemperatureHumidityLightIcon from "assets/components/temperatureHumidityLight.png";
|
|
||||||
import { convertedUnitMeasurement } from "models/UnitMeasurement";
|
|
||||||
import {
|
|
||||||
AreaChartData,
|
|
||||||
ComponentTypeExtension,
|
|
||||||
GraphFilters,
|
|
||||||
LineChartData,
|
|
||||||
simpleAreaChartData,
|
|
||||||
simpleLineChartData,
|
|
||||||
simpleMeasurements,
|
|
||||||
simpleSummaries,
|
|
||||||
Summary,
|
|
||||||
unitMeasurementSummaries
|
|
||||||
} from "pbHelpers/ComponentType";
|
|
||||||
import { describeMeasurement } from "pbHelpers/MeasurementDescriber";
|
|
||||||
import { pond } from "protobuf-ts/pond";
|
|
||||||
import { quack } from "protobuf-ts/quack";
|
|
||||||
|
|
||||||
export function AmbientI2C(subtype: number = 0): ComponentTypeExtension {
|
|
||||||
let temperature = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_TEMPERATURE,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
let humidity = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_PERCENT,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
return {
|
|
||||||
type: quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C,
|
|
||||||
subtypes: [],
|
|
||||||
friendlyName: "Ambient I2C",
|
|
||||||
description: "Measures temperature and humidity",
|
|
||||||
isController: false,
|
|
||||||
isSource: true,
|
|
||||||
isCalibratable: true,
|
|
||||||
addressTypes: [quack.AddressType.ADDRESS_TYPE_I2C],
|
|
||||||
interactionResultTypes: [],
|
|
||||||
states: [],
|
|
||||||
measurements: simpleMeasurements(temperature, humidity),
|
|
||||||
measurementSummary: async function(measurement: quack.Measurement): Promise<Array<Summary>> {
|
|
||||||
return simpleSummaries(measurement, temperature, humidity);
|
|
||||||
},
|
|
||||||
unitMeasurementSummary: (
|
|
||||||
measurements: convertedUnitMeasurement
|
|
||||||
): Summary[] => {
|
|
||||||
return unitMeasurementSummaries(
|
|
||||||
measurements,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
},
|
|
||||||
areaChartData: (
|
|
||||||
measurement: pond.UnitMeasurementsForComponent,
|
|
||||||
smoothingAverages?: number,
|
|
||||||
filters?: GraphFilters
|
|
||||||
): AreaChartData => {
|
|
||||||
return simpleAreaChartData(measurement, smoothingAverages, filters);
|
|
||||||
},
|
|
||||||
lineChartData: (
|
|
||||||
measurement: pond.UnitMeasurementsForComponent,
|
|
||||||
smoothingAverages?: number,
|
|
||||||
filters?: GraphFilters
|
|
||||||
): LineChartData => {
|
|
||||||
return simpleLineChartData(
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C,
|
|
||||||
measurement,
|
|
||||||
smoothingAverages,
|
|
||||||
filters
|
|
||||||
);
|
|
||||||
},
|
|
||||||
minMeasurementPeriodMs: 1000,
|
|
||||||
icon: (theme?: "light" | "dark"): string | undefined => {
|
|
||||||
return theme === "light" ? TemperatureHumidityDarkIcon : TemperatureHumidityLightIcon;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
import TemperatureHumidityDarkIcon from "assets/components/temperatureHumidityDark.png";
|
|
||||||
import TemperatureHumidityLightIcon from "assets/components/temperatureHumidityLight.png";
|
|
||||||
import { convertedUnitMeasurement } from "models/UnitMeasurement";
|
|
||||||
import {
|
|
||||||
AreaChartData,
|
|
||||||
ComponentTypeExtension,
|
|
||||||
GraphFilters,
|
|
||||||
LineChartData,
|
|
||||||
simpleAreaChartData,
|
|
||||||
simpleLineChartData,
|
|
||||||
simpleMeasurements,
|
|
||||||
simpleSummaries,
|
|
||||||
Summary,
|
|
||||||
unitMeasurementSummaries
|
|
||||||
} from "pbHelpers/ComponentType";
|
|
||||||
import { describeMeasurement } from "pbHelpers/MeasurementDescriber";
|
|
||||||
import { pond } from "protobuf-ts/pond";
|
|
||||||
import { quack } from "protobuf-ts/quack";
|
|
||||||
|
|
||||||
export function AmbientOnewire(subtype: number = 0): ComponentTypeExtension {
|
|
||||||
let temperature = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_TEMPERATURE,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_AMBIENT_ONEWIRE,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
let humidity = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_PERCENT,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_AMBIENT_ONEWIRE,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
return {
|
|
||||||
type: quack.ComponentType.COMPONENT_TYPE_AMBIENT_ONEWIRE,
|
|
||||||
subtypes: [],
|
|
||||||
friendlyName: "Onewire Ambient",
|
|
||||||
description: "Measures temperature and humidity",
|
|
||||||
isController: false,
|
|
||||||
isSource: true,
|
|
||||||
isCalibratable: true,
|
|
||||||
addressTypes: [quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY],
|
|
||||||
interactionResultTypes: [],
|
|
||||||
states: [],
|
|
||||||
measurements: simpleMeasurements(temperature, humidity),
|
|
||||||
measurementSummary: async function(measurement: quack.Measurement): Promise<Array<Summary>> {
|
|
||||||
return simpleSummaries(measurement, temperature, humidity);
|
|
||||||
},
|
|
||||||
unitMeasurementSummary: (
|
|
||||||
measurements: convertedUnitMeasurement
|
|
||||||
): Summary[] => {
|
|
||||||
return unitMeasurementSummaries(
|
|
||||||
measurements,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_AMBIENT_ONEWIRE,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
},
|
|
||||||
areaChartData: (
|
|
||||||
measurement: pond.UnitMeasurementsForComponent,
|
|
||||||
smoothingAverages?: number,
|
|
||||||
filters?: GraphFilters
|
|
||||||
): AreaChartData => {
|
|
||||||
return simpleAreaChartData(measurement, smoothingAverages, filters);
|
|
||||||
},
|
|
||||||
lineChartData: (
|
|
||||||
measurement: pond.UnitMeasurementsForComponent,
|
|
||||||
smoothingAverages?: number,
|
|
||||||
filters?: GraphFilters
|
|
||||||
): LineChartData => {
|
|
||||||
return simpleLineChartData(
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_AMBIENT_ONEWIRE,
|
|
||||||
measurement,
|
|
||||||
smoothingAverages,
|
|
||||||
filters
|
|
||||||
);
|
|
||||||
},
|
|
||||||
minMeasurementPeriodMs: 1000,
|
|
||||||
icon: (theme?: "light" | "dark"): string | undefined => {
|
|
||||||
return theme === "light" ? TemperatureHumidityDarkIcon : TemperatureHumidityLightIcon;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -226,7 +226,6 @@ export function dragerGasDongle(subtype: number = 0): ComponentTypeExtension {
|
||||||
smoothingAverages,
|
smoothingAverages,
|
||||||
filters
|
filters
|
||||||
);
|
);
|
||||||
console.log(chartData)
|
|
||||||
}
|
}
|
||||||
return chartData;
|
return chartData;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
import TemperatureHumidityDarkIcon from "assets/components/temperatureHumidityDark.png";
|
|
||||||
import TemperatureHumidityLightIcon from "assets/components/temperatureHumidityLight.png";
|
|
||||||
import { convertedUnitMeasurement } from "models/UnitMeasurement";
|
|
||||||
import {
|
|
||||||
AreaChartData,
|
|
||||||
ComponentTypeExtension,
|
|
||||||
GraphFilters,
|
|
||||||
LineChartData,
|
|
||||||
simpleAreaChartData,
|
|
||||||
simpleLineChartData,
|
|
||||||
simpleMeasurements,
|
|
||||||
simpleSummaries,
|
|
||||||
Summary,
|
|
||||||
unitMeasurementSummaries
|
|
||||||
} from "pbHelpers/ComponentType";
|
|
||||||
import { describeMeasurement } from "pbHelpers/MeasurementDescriber";
|
|
||||||
import { pond } from "protobuf-ts/pond";
|
|
||||||
import { quack } from "protobuf-ts/quack";
|
|
||||||
|
|
||||||
export function Plenum(subtype: number = 0): ComponentTypeExtension {
|
|
||||||
let temperature = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_TEMPERATURE,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_PLENUM,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
let humidity = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_PERCENT,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_PLENUM,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
let pressure = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_PRESSURE,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_PLENUM,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
return {
|
|
||||||
type: quack.ComponentType.COMPONENT_TYPE_PLENUM,
|
|
||||||
subtypes: [],
|
|
||||||
friendlyName: "Plenum",
|
|
||||||
description: "Measures temperature, humidity and pressure",
|
|
||||||
isController: false,
|
|
||||||
isSource: true,
|
|
||||||
isCalibratable: true,
|
|
||||||
addressTypes: [quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY],
|
|
||||||
interactionResultTypes: [],
|
|
||||||
states: [],
|
|
||||||
measurements: simpleMeasurements(temperature, humidity, pressure),
|
|
||||||
measurementSummary: async function(measurement: quack.Measurement): Promise<Array<Summary>> {
|
|
||||||
return simpleSummaries(measurement, temperature, humidity, pressure);
|
|
||||||
},
|
|
||||||
unitMeasurementSummary: (
|
|
||||||
measurements: convertedUnitMeasurement
|
|
||||||
): Summary[] => {
|
|
||||||
return unitMeasurementSummaries(
|
|
||||||
measurements,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_PLENUM,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
},
|
|
||||||
areaChartData: (
|
|
||||||
measurement: pond.UnitMeasurementsForComponent,
|
|
||||||
smoothingAverages?: number,
|
|
||||||
filters?: GraphFilters
|
|
||||||
): AreaChartData => {
|
|
||||||
return simpleAreaChartData(measurement, smoothingAverages, filters);
|
|
||||||
},
|
|
||||||
lineChartData: (
|
|
||||||
measurement: pond.UnitMeasurementsForComponent,
|
|
||||||
smoothingAverages?: number,
|
|
||||||
filters?: GraphFilters
|
|
||||||
): LineChartData => {
|
|
||||||
return simpleLineChartData(
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_PLENUM,
|
|
||||||
measurement,
|
|
||||||
smoothingAverages,
|
|
||||||
filters
|
|
||||||
);
|
|
||||||
},
|
|
||||||
minMeasurementPeriodMs: 1000,
|
|
||||||
icon: (theme?: "light" | "dark"): string | undefined => {
|
|
||||||
return theme === "light" ? TemperatureHumidityDarkIcon : TemperatureHumidityLightIcon;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
import TemperatureHumidityDarkIcon from "assets/components/temperatureHumidityDark.png";
|
|
||||||
import TemperatureHumidityLightIcon from "assets/components/temperatureHumidityLight.png";
|
|
||||||
import { convertedUnitMeasurement } from "models/UnitMeasurement";
|
|
||||||
import {
|
|
||||||
AreaChartData,
|
|
||||||
ComponentTypeExtension,
|
|
||||||
GraphFilters,
|
|
||||||
LineChartData,
|
|
||||||
simpleAreaChartData,
|
|
||||||
simpleLineChartData,
|
|
||||||
simpleMeasurements,
|
|
||||||
simpleSummaries,
|
|
||||||
Summary,
|
|
||||||
unitMeasurementSummaries
|
|
||||||
} from "pbHelpers/ComponentType";
|
|
||||||
import { describeMeasurement } from "pbHelpers/MeasurementDescriber";
|
|
||||||
import { pond } from "protobuf-ts/pond";
|
|
||||||
import { quack } from "protobuf-ts/quack";
|
|
||||||
|
|
||||||
export function TempHumidity(subtype: number = 0): ComponentTypeExtension {
|
|
||||||
let temperature = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_TEMPERATURE,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_TEMP_HUMIDITY,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
let humidity = describeMeasurement(
|
|
||||||
quack.MeasurementType.MEASUREMENT_TYPE_PERCENT,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_TEMP_HUMIDITY,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
return {
|
|
||||||
type: quack.ComponentType.COMPONENT_TYPE_TEMP_HUMIDITY,
|
|
||||||
subtypes: [
|
|
||||||
{
|
|
||||||
key: quack.TempHumiditySubtype.TEMP_HUMIDITY_SUBTYPE_HDC302,
|
|
||||||
value: "TEMP_HUMIDITY_SUBTYPE_HDC302",
|
|
||||||
friendlyName: "HDC302"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
friendlyName: "Temperature/Humidity",
|
|
||||||
description: "Measures the temperature and humidity",
|
|
||||||
isController: false,
|
|
||||||
isSource: true,
|
|
||||||
isCalibratable: true,
|
|
||||||
addressTypes: [quack.AddressType.ADDRESS_TYPE_I2C],
|
|
||||||
interactionResultTypes: [],
|
|
||||||
states: [],
|
|
||||||
measurements: simpleMeasurements(temperature, humidity),
|
|
||||||
measurementSummary: async function(measurement: quack.Measurement): Promise<Array<Summary>> {
|
|
||||||
return simpleSummaries(measurement, temperature, humidity);
|
|
||||||
},
|
|
||||||
unitMeasurementSummary: (
|
|
||||||
measurements: convertedUnitMeasurement
|
|
||||||
): Summary[] => {
|
|
||||||
return unitMeasurementSummaries(
|
|
||||||
measurements,
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_TEMP_HUMIDITY,
|
|
||||||
subtype
|
|
||||||
);
|
|
||||||
},
|
|
||||||
areaChartData: (
|
|
||||||
measurement: pond.UnitMeasurementsForComponent,
|
|
||||||
smoothingAverages?: number,
|
|
||||||
filters?: GraphFilters
|
|
||||||
): AreaChartData => {
|
|
||||||
return simpleAreaChartData(measurement, smoothingAverages, filters);
|
|
||||||
},
|
|
||||||
lineChartData: (
|
|
||||||
measurement: pond.UnitMeasurementsForComponent,
|
|
||||||
smoothingAverages?: number,
|
|
||||||
filters?: GraphFilters
|
|
||||||
): LineChartData => {
|
|
||||||
return simpleLineChartData(
|
|
||||||
quack.ComponentType.COMPONENT_TYPE_TEMP_HUMIDITY,
|
|
||||||
measurement,
|
|
||||||
smoothingAverages,
|
|
||||||
filters
|
|
||||||
);
|
|
||||||
},
|
|
||||||
minMeasurementPeriodMs: 1000,
|
|
||||||
icon: (theme?: "light" | "dark"): string | undefined => {
|
|
||||||
return theme === "light" ? TemperatureHumidityDarkIcon : TemperatureHumidityLightIcon;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -30,6 +30,3 @@ export * from "./VPD";
|
||||||
export * from "./Weight";
|
export * from "./Weight";
|
||||||
export * from "./CapacitorCable";
|
export * from "./CapacitorCable";
|
||||||
export * from "./AnalogPressure";
|
export * from "./AnalogPressure";
|
||||||
export * from "./Plenum";
|
|
||||||
export * from "./AmbientOnewire";
|
|
||||||
export * from "./AmbientI2C";
|
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,7 @@ const DefaultAvailability: DeviceAvailabilityMap = new Map<quack.AddressType, De
|
||||||
[quack.ComponentType.COMPONENT_TYPE_AIRFLOW, [0x6c]],
|
[quack.ComponentType.COMPONENT_TYPE_AIRFLOW, [0x6c]],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE, [0x71]], // the address cables will use when they are plugged into the expander with V2 device only
|
[quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE, [0x71]], // the address cables will use when they are plugged into the expander with V2 device only
|
||||||
[quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE, [0x6d]],
|
[quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE, [0x6d]],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_ANALOG_PRESSURE, [0x6e]],
|
[quack.ComponentType.COMPONENT_TYPE_ANALOG_PRESSURE, [0x6e]]
|
||||||
[quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C, [0x44]]
|
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
[quack.AddressType.ADDRESS_TYPE_DAC, [0, 1]],
|
[quack.AddressType.ADDRESS_TYPE_DAC, [0, 1]],
|
||||||
|
|
|
||||||
|
|
@ -252,8 +252,7 @@ export const BindaptV2MonitorAvailability: DeviceAvailabilityMap = new Map<
|
||||||
[quack.ComponentType.COMPONENT_TYPE_LIDAR, [0x62, 0x66, 0x10]],
|
[quack.ComponentType.COMPONENT_TYPE_LIDAR, [0x62, 0x66, 0x10]],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_CO2, [0x61]],
|
[quack.ComponentType.COMPONENT_TYPE_CO2, [0x61]],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_SEN5X, [0x69]],
|
[quack.ComponentType.COMPONENT_TYPE_SEN5X, [0x69]],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE, [0x71]],
|
[quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE, [0x71]]
|
||||||
[quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C, [0x44]]
|
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
[quack.AddressType.ADDRESS_TYPE_POWER, [0]],
|
[quack.AddressType.ADDRESS_TYPE_POWER, [0]],
|
||||||
|
|
@ -286,8 +285,7 @@ export const BindaptV2AutomateAvailability: DeviceAvailabilityMap = new Map<
|
||||||
[quack.ComponentType.COMPONENT_TYPE_LIDAR, [0x62, 0x66, 0x10]],
|
[quack.ComponentType.COMPONENT_TYPE_LIDAR, [0x62, 0x66, 0x10]],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_CO2, [0x61]],
|
[quack.ComponentType.COMPONENT_TYPE_CO2, [0x61]],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_SEN5X, [0x69]],
|
[quack.ComponentType.COMPONENT_TYPE_SEN5X, [0x69]],
|
||||||
[quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE, [0x71]],
|
[quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE, [0x71]]
|
||||||
[quack.ComponentType.COMPONENT_TYPE_AMBIENT_I2C, [0x44]]
|
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
[quack.AddressType.ADDRESS_TYPE_POWER, [0]],
|
[quack.AddressType.ADDRESS_TYPE_POWER, [0]],
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,6 @@ export default function ObjectUsers(props: Props) {
|
||||||
userAPI
|
userAPI
|
||||||
.listObjectUsers(scope)
|
.listObjectUsers(scope)
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
console.log(response)
|
|
||||||
let rUsers: User[] = [];
|
let rUsers: User[] = [];
|
||||||
or(response.data, { users: [] }).users.forEach((user: any) => {
|
or(response.data, { users: [] }).users.forEach((user: any) => {
|
||||||
rUsers.push(User.any(user));
|
rUsers.push(User.any(user));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue