From 6996ab0e77b302f3b908613b9e984d65f78a26ec Mon Sep 17 00:00:00 2001 From: Carter Date: Tue, 22 Jul 2025 15:55:16 -0600 Subject: [PATCH 01/10] made the bins page use url context, added bins link to team page --- src/pages/Bins.tsx | 13 ++++++++++++- src/pages/Team.tsx | 20 ++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/pages/Bins.tsx b/src/pages/Bins.tsx index 476b66f..5bda174 100644 --- a/src/pages/Bins.tsx +++ b/src/pages/Bins.tsx @@ -81,6 +81,7 @@ import GrainBagList from "grainBag/grainBagList"; import BinYards from "bin/BinYards"; import ButtonGroup from "common/ButtonGroup"; import TeamDialog from "teams/TeamDialog"; +import { getContextKeys, getContextTypes } from "pbHelpers/Context"; // import { useHistory } from "react-router"; const useStyles = makeStyles((theme: Theme) => { @@ -311,6 +312,16 @@ export default function Bins(props: Props) { } }, [props.yardFilter]); + const getKeys = () => { + if (as) return undefined + return getContextKeys() + } + + const getTypes = () => { + if (as) return undefined + return getContextTypes() + } + const loadBins = useCallback(() => { //let filter = grainFilter; let filter = yardFilter; @@ -325,7 +336,7 @@ export default function Bins(props: Props) { setDisplayFert(false); binAPI - .listBinsAndData(binsLimit, 0, order, orderBy, filter, as, false) + .listBinsAndData(binsLimit, 0, order, orderBy, filter, as, false, getKeys(), getTypes()) .then(resp => { let grain: Bin[] = []; let empty: Bin[] = []; diff --git a/src/pages/Team.tsx b/src/pages/Team.tsx index dd88fdd..1cf19c9 100644 --- a/src/pages/Team.tsx +++ b/src/pages/Team.tsx @@ -12,10 +12,10 @@ import { appendToUrl } from "navigation/Router"; import PageContainer from "pages/PageContainer"; import { getContextKeys, getContextTypes } from "pbHelpers/Context"; import { pond } from "protobuf-ts/pond"; -import { useSnackbar, useTeamAPI, useUserAPI } from "providers"; +import { useGlobalState, useSnackbar, useTeamAPI, useUserAPI } from "providers"; import { useEffect, useState } from "react"; import { useLocation, useNavigate, useParams } from 'react-router-dom'; -import { getSignatureAccentColour } from "services/whiteLabel"; +import { getSignatureAccentColour, IsAdaptiveAgriculture, IsStreamline } from "services/whiteLabel"; import TeamActions from "teams/TeamActions"; import TeamKeyManager from "teams/TeamKeyManager"; import ObjectUsers from "user/ObjectUsers"; @@ -88,6 +88,7 @@ export default function TeamPage() { const [loadingUsers, setLoadingUsers] = useState(false) const [userDialog, setUserDialog] = useState(false) const teamKey = teamID ? teamID : ""; + const [{ user }] = useGlobalState() const getTeam = () => { @@ -212,6 +213,13 @@ export default function TeamPage() { const toGroups = () => { navigate(appendToUrl("groups")) } + + const toBins = () => { + navigate(appendToUrl("bins")) + } + + const isAg = IsAdaptiveAgriculture() + const isStreamline = IsStreamline() return ( @@ -255,6 +263,14 @@ export default function TeamPage() { Groups + {((isAg || isStreamline) || user.hasFeature("admin")) && + <> + + + Bins + + + } From e5d4aee4a1f6181f756c929bcbee46abccb6ec55 Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 23 Jul 2025 09:54:42 -0600 Subject: [PATCH 02/10] relative pathing for bins page --- src/bin/BinsList.tsx | 2 +- src/pages/Bins.tsx | 5 +++-- src/pages/Team.tsx | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bin/BinsList.tsx b/src/bin/BinsList.tsx index 6779258..540877a 100644 --- a/src/bin/BinsList.tsx +++ b/src/bin/BinsList.tsx @@ -49,7 +49,7 @@ export default function BinsList(props: Props) { //const scrollRef = useRef(null); const goToBin = (i: number) => { - let path = "/bins/" + bins[i].key(); + let path = bins[i].key(); navigate(path, { state: {bin: bins[i]} }); }; diff --git a/src/pages/Bins.tsx b/src/pages/Bins.tsx index 5bda174..71675f8 100644 --- a/src/pages/Bins.tsx +++ b/src/pages/Bins.tsx @@ -634,8 +634,9 @@ export default function Bins(props: Props) { preLoadedData={paginatedBins.bins} rowClickFunction={data => { let bin = data as Bin; - let path = "/bins/" + bin.key(); - navigate(path, { state: { bin: bin }}); + // let path = "bins/" + bin.key(); + // navigate(path, { state: { bin: bin }}); + navigate(bin.key(), { state: { bin: bin }, relative: "path"}); }} customButtons={[ { diff --git a/src/pages/Team.tsx b/src/pages/Team.tsx index 1cf19c9..329c95d 100644 --- a/src/pages/Team.tsx +++ b/src/pages/Team.tsx @@ -215,7 +215,8 @@ export default function TeamPage() { } const toBins = () => { - navigate(appendToUrl("bins")) + // navigate(appendToUrl("bins")) + navigate("bins") } const isAg = IsAdaptiveAgriculture() From c677e8ec40133123c3677dc88646279c67272c9f Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 23 Jul 2025 11:34:32 -0600 Subject: [PATCH 03/10] disabled imitation on team page to prevent share error while viewing as team --- src/pages/Team.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Team.tsx b/src/pages/Team.tsx index 329c95d..5d2d7ad 100644 --- a/src/pages/Team.tsx +++ b/src/pages/Team.tsx @@ -246,6 +246,7 @@ export default function TeamPage() { isDialogOpen={userDialog} closeDialogCallback={() => setUserDialog(false)} refreshCallback={() => {}} + useImitation={false} /> From e806633a8dfa9f0f05af640ad1feb689fe3d5eda Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 23 Jul 2025 12:10:01 -0600 Subject: [PATCH 04/10] using url.origin in the redirect uri to be more consistent --- src/providers/auth.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/providers/auth.tsx b/src/providers/auth.tsx index bc116ff..0a7a619 100644 --- a/src/providers/auth.tsx +++ b/src/providers/auth.tsx @@ -38,7 +38,8 @@ export default function AuthWrapper(props: Props) { options.authorizationParams.login_hint = parsed.email.toString(); // prefill email } - options.authorizationParams.redirect_uri = "https://" + url.hostname + "/signupCallback" + console.log(url) + options.authorizationParams.redirect_uri = url.origin + "/signupCallback" console.log(options.authorizationParams.redirect_uri) loginWithRedirect(options) From 8d97d27097c724df5f5f281ab5df65d512303c1f Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 23 Jul 2025 14:11:07 -0600 Subject: [PATCH 05/10] merged staging and updated master proto --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 222fcf3..97cf2f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#beans", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", @@ -10911,7 +10911,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#f09196cbc38911bab69fb35c16b1c8f691a4413f", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#ea5c01a80b896e8a22e7930780b1b3479e449c90", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index 5a27ce1..ee0e9b7 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#beans", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", From 38ae04f40caa512150041bc0c80a0669aee5d0b0 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Thu, 24 Jul 2025 15:56:23 -0600 Subject: [PATCH 06/10] added the airlfow subtypes --- src/pbHelpers/ComponentTypes/Airflow.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pbHelpers/ComponentTypes/Airflow.ts b/src/pbHelpers/ComponentTypes/Airflow.ts index fde83e2..2e46725 100644 --- a/src/pbHelpers/ComponentTypes/Airflow.ts +++ b/src/pbHelpers/ComponentTypes/Airflow.ts @@ -25,7 +25,18 @@ export function Airflow(subtype: number = 0): ComponentTypeExtension { ); return { type: quack.ComponentType.COMPONENT_TYPE_AIRFLOW, - subtypes: [], + subtypes: [ + { + key: quack.AirFlowSubtype.AIR_FLOW_SUBTYPE_PROSENSE, + value: "AIR_FLOW_SUBTYPE_PROSENSE", + friendlyName: "Prosense" + }, + { + key: quack.AirFlowSubtype.AIR_FLOW_SUBTYPE_ULTRASONIC, + value: "AIR_FLOW_SUBTYPE_ULTRASONIC", + friendlyName: "Ultrasonic" + }, + ], friendlyName: "Airflow", description: "Measure the flow of air though a specified area", isController: false, From 8a53f9689af227fd03557b70bb25ae66417f98c9 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Fri, 25 Jul 2025 09:45:32 -0600 Subject: [PATCH 07/10] changed the speed to be m/s in metric rather than km/h and ft/m in imperial and added the measurement type for speed/velocity to the airflow component --- package.json | 2 +- src/models/UnitMeasurement.ts | 10 +++++++ src/pbHelpers/ComponentType.tsx | 5 ++-- src/pbHelpers/ComponentTypes/Airflow.ts | 38 +++++++++++++++++++------ src/pbHelpers/MeasurementDescriber.ts | 3 +- 5 files changed, 46 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index ee0e9b7..59e639d 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#airflow", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", diff --git a/src/models/UnitMeasurement.ts b/src/models/UnitMeasurement.ts index 966b545..344abe0 100644 --- a/src/models/UnitMeasurement.ts +++ b/src/models/UnitMeasurement.ts @@ -256,5 +256,15 @@ function unitConversion( }); } } + if (type === quack.MeasurementType.MEASUREMENT_TYPE_SPEED) { + if (user.settings.distanceUnit === pond.DistanceUnit.DISTANCE_UNIT_FEET) { + newVals.forEach((val, i) => { + val.values.forEach((v, j) => { + //convert m/s to ft/m by multiplying by 196.9 + newVals[i].values[j] = v * 196.9 + }); + }); + } + } return newVals; } diff --git a/src/pbHelpers/ComponentType.tsx b/src/pbHelpers/ComponentType.tsx index 2d66c9d..e03a1ce 100644 --- a/src/pbHelpers/ComponentType.tsx +++ b/src/pbHelpers/ComponentType.tsx @@ -146,7 +146,7 @@ export interface ComponentTypeExtension { interactionResultTypes: Array; states: Array; measurements: Array; - measurementSummary: Function; //Deprecated: this summary used the old measurement structure + measurementSummary?: Function; //Deprecated: this summary used the old measurement structure unitMeasurementSummary: ( measurements: convertedUnitMeasurement, excludedNodes?: number[] @@ -382,7 +382,8 @@ export async function getMeasurementSummary( measurement: quack.IMeasurement, filters: GraphFilters ): Promise> { - return extension(type, subtype).measurementSummary(measurement, filters); + let sumFunc = extension(type, subtype).measurementSummary + return sumFunc ? sumFunc(measurement, filters) : []; } const validNodes = (nodeVals: number[], filters?: GraphFilters) => { diff --git a/src/pbHelpers/ComponentTypes/Airflow.ts b/src/pbHelpers/ComponentTypes/Airflow.ts index 2e46725..acc52fe 100644 --- a/src/pbHelpers/ComponentTypes/Airflow.ts +++ b/src/pbHelpers/ComponentTypes/Airflow.ts @@ -1,14 +1,15 @@ import { ComponentTypeExtension, Summary, - simpleMeasurements, - simpleSummaries, + // simpleMeasurements, + // simpleSummaries, unitMeasurementSummaries, AreaChartData, GraphFilters, simpleAreaChartData, LineChartData, - simpleLineChartData + simpleLineChartData, + ComponentMeasurement } from "pbHelpers/ComponentType"; import PressureDarkIcon from "assets/components/pressureDark.png"; import PressureLightIcon from "assets/components/pressureLight.png"; @@ -18,11 +19,32 @@ import { convertedUnitMeasurement } from "models/UnitMeasurement"; import { pond } from "protobuf-ts/pond"; export function Airflow(subtype: number = 0): ComponentTypeExtension { - let airflow = describeMeasurement( + let cfm = describeMeasurement( quack.MeasurementType.MEASUREMENT_TYPE_CFM, quack.ComponentType.COMPONENT_TYPE_AIRFLOW, subtype ); + + let velocity = describeMeasurement( + quack.MeasurementType.MEASUREMENT_TYPE_CFM, + quack.ComponentType.COMPONENT_TYPE_AIRFLOW, + subtype + ); + + let measurementTypes = [ + { + measurementType: quack.MeasurementType.MEASUREMENT_TYPE_PPM, + label: cfm.label(), + colour: cfm.colour(), + graphType: cfm.graph() + } as ComponentMeasurement, + { + measurementType: quack.MeasurementType.MEASUREMENT_TYPE_VOLTAGE, + label: velocity.label(), + colour: velocity.colour(), + graphType: velocity.graph() + } as ComponentMeasurement + ]; return { type: quack.ComponentType.COMPONENT_TYPE_AIRFLOW, subtypes: [ @@ -47,10 +69,10 @@ export function Airflow(subtype: number = 0): ComponentTypeExtension { addressTypes: [quack.AddressType.ADDRESS_TYPE_I2C], interactionResultTypes: [], states: [], - measurements: simpleMeasurements(airflow), - measurementSummary: async function(measurement: quack.Measurement): Promise> { - return simpleSummaries(measurement, airflow); - }, + measurements: measurementTypes, + // measurementSummary: async function(measurement: quack.Measurement): Promise> { + // return simpleSummaries(measurement, airflow); + // }, unitMeasurementSummary: ( measurements: convertedUnitMeasurement, excludedNodes?: number[] diff --git a/src/pbHelpers/MeasurementDescriber.ts b/src/pbHelpers/MeasurementDescriber.ts index a364b77..1fc2751 100644 --- a/src/pbHelpers/MeasurementDescriber.ts +++ b/src/pbHelpers/MeasurementDescriber.ts @@ -450,8 +450,9 @@ export class MeasurementDescriber { this.details.max = 100000; break; case quack.MeasurementType.MEASUREMENT_TYPE_SPEED: + let speedUnit = getDistanceUnit() this.details.label = "Speed"; - this.details.unit = "km/h"; + this.details.unit = speedUnit === pond.DistanceUnit.DISTANCE_UNIT_METERS ? "m/s" : "ft/m"; this.details.colour = green["500"]; this.details.path = "edgeTriggered.rises"; this.details.max = 500; From 7d24cb7df41dc2f2afc28d54105496ce4f3b832b Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 28 Jul 2025 12:04:20 -0600 Subject: [PATCH 08/10] updating the address for airflow --- src/pbHelpers/AddressTypes/I2C.ts | 2 +- src/pbHelpers/DeviceAvailability.ts | 2 +- src/products/MiVent/MiVentAvailability.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pbHelpers/AddressTypes/I2C.ts b/src/pbHelpers/AddressTypes/I2C.ts index c17c743..3c15ced 100644 --- a/src/pbHelpers/AddressTypes/I2C.ts +++ b/src/pbHelpers/AddressTypes/I2C.ts @@ -16,7 +16,7 @@ export const I2C: AddressTypeExtension = { [quack.ComponentType.COMPONENT_TYPE_CAPACITANCE, 0x4f], [quack.ComponentType.COMPONENT_TYPE_CAPACITOR_CABLE, 0x4f], [quack.ComponentType.COMPONENT_TYPE_SEN5X, 0x68], - [quack.ComponentType.COMPONENT_TYPE_AIRFLOW, 0x29] + [quack.ComponentType.COMPONENT_TYPE_AIRFLOW, 0x6b] ]); const offset = offsets.get(componentType); diff --git a/src/pbHelpers/DeviceAvailability.ts b/src/pbHelpers/DeviceAvailability.ts index c50a2a4..3d09a7f 100644 --- a/src/pbHelpers/DeviceAvailability.ts +++ b/src/pbHelpers/DeviceAvailability.ts @@ -60,7 +60,7 @@ const DefaultAvailability: DeviceAvailabilityMap = new Map Date: Mon, 28 Jul 2025 15:12:45 -0600 Subject: [PATCH 09/10] fixed errors from moving the calibration definition to the quack --- package-lock.json | 4 ++-- package.json | 2 +- src/component/ComponentForm.tsx | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 222fcf3..2c64e83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#beans", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#component_quack", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", @@ -10911,7 +10911,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#f09196cbc38911bab69fb35c16b1c8f691a4413f", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#4e16c7a754503111aad27eeaef98069f95451e59", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index 5a27ce1..1a32f62 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#beans", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#component_quack", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", diff --git a/src/component/ComponentForm.tsx b/src/component/ComponentForm.tsx index ef61681..08d6117 100644 --- a/src/component/ComponentForm.tsx +++ b/src/component/ComponentForm.tsx @@ -482,7 +482,7 @@ export default function ComponentForm(props: Props) { const updateCalibrationTypes = (event: any, index: number) => { let f = cloneDeep(form); - f.component.settings.calibrations[index].type = event.target.value as quack.MeasurementType; + f.component.settings.calibrations[index].measurementType = event.target.value as quack.MeasurementType; setForm(f); }; @@ -508,7 +508,7 @@ export default function ComponentForm(props: Props) { if (dimensions !== undefined && dimensions !== null) { dimensions.lengthCm = value; } else { - dimensions = pond.Dimensions.create({ + dimensions = quack.Dimensions.create({ heightCm: 0, lengthCm: value, widthCm: 0 @@ -537,7 +537,7 @@ export default function ComponentForm(props: Props) { if (dimensions !== undefined && dimensions !== null) { dimensions.heightCm = value; } else { - dimensions = pond.Dimensions.create({ + dimensions = quack.Dimensions.create({ heightCm: value, lengthCm: 0, widthCm: 0 @@ -566,7 +566,7 @@ export default function ComponentForm(props: Props) { if (dimensions !== undefined && dimensions !== null) { dimensions.widthCm = value; } else { - dimensions = pond.Dimensions.create({ + dimensions = quack.Dimensions.create({ heightCm: 0, lengthCm: 0, widthCm: value @@ -788,7 +788,7 @@ export default function ComponentForm(props: Props) { // !isMeasurementTypeValid(interaction.settings.conditions[index].measurementType) // } disabled={!component.settings.calibrate} - value={calibration.type ?? quack.MeasurementType.MEASUREMENT_TYPE_INVALID} + value={calibration.measurementType ?? quack.MeasurementType.MEASUREMENT_TYPE_INVALID} onChange={event => updateCalibrationTypes(event, i)} autoFocus={false} margin="normal" @@ -814,8 +814,8 @@ export default function ComponentForm(props: Props) { f.coefficients.push("0"); f.offsets.push("0"); f.component.settings.calibrations.push( - pond.Calibration.create({ - type: quack.MeasurementType.MEASUREMENT_TYPE_INVALID, + quack.Calibration.create({ + measurementType: quack.MeasurementType.MEASUREMENT_TYPE_INVALID, calibrationOffset: 0, calibrationCoefficient: 0 }) From e662645fa2eca72cf193f96067305d38d961819c Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 28 Jul 2025 15:23:49 -0600 Subject: [PATCH 10/10] rounding the ft/m conversion --- src/models/UnitMeasurement.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/UnitMeasurement.ts b/src/models/UnitMeasurement.ts index 344abe0..46e67ef 100644 --- a/src/models/UnitMeasurement.ts +++ b/src/models/UnitMeasurement.ts @@ -261,7 +261,7 @@ function unitConversion( newVals.forEach((val, i) => { val.values.forEach((v, j) => { //convert m/s to ft/m by multiplying by 196.9 - newVals[i].values[j] = v * 196.9 + newVals[i].values[j] = Math.round(v * 196.9) }); }); }