Merge branch 'master' into onewire_detect
This commit is contained in:
commit
6b0dd9ff41
9 changed files with 48 additions and 6 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -10953,7 +10953,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#53e313b9d0a3b0c081be17f9a599abed80259c6c",
|
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#9dcc83dddad31d4a4d8a002ec31475cbb83f0689",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protobufjs": "^6.8.8"
|
"protobufjs": "^6.8.8"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ import { pond } from "protobuf-ts/pond";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { getSignatureAccentColour } from "services/whiteLabel";
|
import { getSignatureAccentColour } from "services/whiteLabel";
|
||||||
import NotificationDrawer from "./NotificationDrawer";
|
import NotificationDrawer from "./NotificationDrawer";
|
||||||
|
import { useTeamAPI } from "providers";
|
||||||
|
import { cloneDeep } from "lodash";
|
||||||
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
|
|
@ -55,7 +57,9 @@ export default function HeaderButtons(props: Props) {
|
||||||
const [hasNewNotifications, setHasNewNotifications] = useState(false);
|
const [hasNewNotifications, setHasNewNotifications] = useState(false);
|
||||||
const [chatDrawerOpen, setChatDrawerOpen] = useState(false);
|
const [chatDrawerOpen, setChatDrawerOpen] = useState(false);
|
||||||
const [notificationDrawerOpen, setNotificationDrawerOpen] = useState<boolean>(false);
|
const [notificationDrawerOpen, setNotificationDrawerOpen] = useState<boolean>(false);
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
const teamAPI = useTeamAPI();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!team) return;
|
if (!team) return;
|
||||||
|
|
@ -66,6 +70,8 @@ export default function HeaderButtons(props: Props) {
|
||||||
setHasNewChats(true);
|
setHasNewChats(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log(team.preferences.chatViewedTimestamp)
|
||||||
|
console.log(team.settings.lastChatTimestamp)
|
||||||
let viewMoment = moment(team.preferences.chatViewedTimestamp);
|
let viewMoment = moment(team.preferences.chatViewedTimestamp);
|
||||||
let chatMoment = moment(team.settings.lastChatTimestamp);
|
let chatMoment = moment(team.settings.lastChatTimestamp);
|
||||||
if (viewMoment.diff(chatMoment) < 0) {
|
if (viewMoment.diff(chatMoment) < 0) {
|
||||||
|
|
@ -154,13 +160,29 @@ export default function HeaderButtons(props: Props) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onChatClose = () => {
|
||||||
|
setChatDrawerOpen(false)
|
||||||
|
let newTeamPrefs = cloneDeep(team.preferences)
|
||||||
|
newTeamPrefs.chatViewedTimestamp = new Date().toISOString();
|
||||||
|
teamAPI
|
||||||
|
.updatePreferences(
|
||||||
|
team.key(),
|
||||||
|
newTeamPrefs,
|
||||||
|
// getContextKeys(),
|
||||||
|
// getContextTypes()
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
// setTeamPrefs(newTeamPrefs);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{chatButton()}
|
{chatButton()}
|
||||||
{team && team.settings && team.settings.key && (
|
{team && team.settings && team.settings.key && (
|
||||||
<ChatDrawer
|
<ChatDrawer
|
||||||
open={chatDrawerOpen}
|
open={chatDrawerOpen}
|
||||||
onClose={() => setChatDrawerOpen(false)}
|
onClose={onChatClose}
|
||||||
team={team}
|
team={team}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ export default function ChatMessage(props: Props) {
|
||||||
return mappedPerm; // Return null for invalid keys
|
return mappedPerm; // Return null for invalid keys
|
||||||
}).filter(Boolean); // Optionally filter out any null values
|
}).filter(Boolean); // Optionally filter out any null values
|
||||||
} else {
|
} else {
|
||||||
console.error("data.permissions is not an array or does not exist");
|
// console.error("data.permissions is not an array or does not exist");
|
||||||
perms = [];
|
perms = [];
|
||||||
}
|
}
|
||||||
return perms
|
return perms
|
||||||
|
|
|
||||||
|
|
@ -518,7 +518,8 @@ export default function ComponentSettings(props: Props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const supportsExpansion = () => {
|
const supportsExpansion = () => {
|
||||||
return (formComponent.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE &&
|
return ((formComponent.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE ||
|
||||||
|
formComponent.settings.type === quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE) &&
|
||||||
formComponent.settings.addressType === quack.AddressType.ADDRESS_TYPE_I2C)
|
formComponent.settings.addressType === quack.AddressType.ADDRESS_TYPE_I2C)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,9 @@ export default function DevicePage() {
|
||||||
let id: quack.IComponentID = quack.ComponentID.fromObject({
|
let id: quack.IComponentID = quack.ComponentID.fromObject({
|
||||||
type: c.settings.type,
|
type: c.settings.type,
|
||||||
addressType: c.settings.addressType,
|
addressType: c.settings.addressType,
|
||||||
address: c.settings.address
|
address: c.settings.address,
|
||||||
|
expansionLine: c.settings.expansionLine,
|
||||||
|
muxLine: c.settings.muxLine
|
||||||
});
|
});
|
||||||
let filteredInteractions = interactions.filter(interaction => {
|
let filteredInteractions = interactions.filter(interaction => {
|
||||||
let isSource = false;
|
let isSource = false;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@ export function sameComponentID(
|
||||||
const sameType: boolean = id1.type === id2.type;
|
const sameType: boolean = id1.type === id2.type;
|
||||||
const sameAddressType: boolean = id1.addressType === id2.addressType;
|
const sameAddressType: boolean = id1.addressType === id2.addressType;
|
||||||
const sameAddress: boolean = (!id1.address && !id2.address) || id1.address === id2.address;
|
const sameAddress: boolean = (!id1.address && !id2.address) || id1.address === id2.address;
|
||||||
return sameType && sameAddressType && sameAddress;
|
const sameExpansion: boolean = (!id1.expansionLine && !id2.expansionLine) || id1.expansionLine === id2.expansionLine;
|
||||||
|
const sameMux: boolean = (!id1.muxLine && !id2.muxLine) || id1.muxLine === id2.muxLine;
|
||||||
|
return sameType && sameAddressType && sameAddress && sameExpansion && sameMux;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getComponentIDString(component?: Component): string {
|
export function getComponentIDString(component?: Component): string {
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,7 @@ export function dragerGasDongle(subtype: number = 0): ComponentTypeExtension {
|
||||||
let firstTime: Moment | undefined;
|
let firstTime: Moment | undefined;
|
||||||
let lastTime: Moment | undefined;
|
let lastTime: Moment | undefined;
|
||||||
let valMap: Map<number, number[]> = new Map<number, number[]>();
|
let valMap: Map<number, number[]> = new Map<number, number[]>();
|
||||||
|
if(measurement.type === quack.MeasurementType.MEASUREMENT_TYPE_PPM){
|
||||||
measurement.values.forEach((vals, i) => {
|
measurement.values.forEach((vals, i) => {
|
||||||
let avgVals: Point[] = [];
|
let avgVals: Point[] = [];
|
||||||
let newLineData: LineData = {
|
let newLineData: LineData = {
|
||||||
|
|
@ -213,6 +214,14 @@ export function dragerGasDongle(subtype: number = 0): ComponentTypeExtension {
|
||||||
filters
|
filters
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
chartData = simpleLineChartData(
|
||||||
|
quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE,
|
||||||
|
measurement,
|
||||||
|
smoothingAverages,
|
||||||
|
filters
|
||||||
|
);
|
||||||
|
}
|
||||||
return chartData;
|
return chartData;
|
||||||
},
|
},
|
||||||
minMeasurementPeriodMs: 1000
|
minMeasurementPeriodMs: 1000
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,11 @@ const subtypes = [
|
||||||
key: quack.BooleanOutputSubtype.BOOLEAN_OUTPUT_SUBTYPE_EXHAUST_FAN,
|
key: quack.BooleanOutputSubtype.BOOLEAN_OUTPUT_SUBTYPE_EXHAUST_FAN,
|
||||||
value: "BOOLEAN_OUTPUT_SUBTYPE_FAN",
|
value: "BOOLEAN_OUTPUT_SUBTYPE_FAN",
|
||||||
friendlyName: "Exhaust Fan"
|
friendlyName: "Exhaust Fan"
|
||||||
|
} as Subtype,
|
||||||
|
{
|
||||||
|
key: quack.BooleanOutputSubtype.BOOLEAN_OUTPUT_SUBTYPE_ALARM,
|
||||||
|
value: "BOOLEAN_OUTPUT_SUBTYPE_ALARM",
|
||||||
|
friendlyName: "Alarm"
|
||||||
} as Subtype
|
} as Subtype
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ export class MeasurementDescriber {
|
||||||
this.details.unit = "mV";
|
this.details.unit = "mV";
|
||||||
this.details.graph = GraphType.MULTILINE;
|
this.details.graph = GraphType.MULTILINE;
|
||||||
this.details.unit = "mV";
|
this.details.unit = "mV";
|
||||||
|
this.details.decimals = 0
|
||||||
// this.details.nodeDetails = {
|
// this.details.nodeDetails = {
|
||||||
// colours: ["white", "black", "red", "blue"],
|
// colours: ["white", "black", "red", "blue"],
|
||||||
// labels: ["millivolt1", "millivolt2", "millivolt3", "millivolt4"]
|
// labels: ["millivolt1", "millivolt2", "millivolt3", "millivolt4"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue