commented out unused parts of the new bin page, dont know if they will be used in the future so that is why they are commented and not removed
This commit is contained in:
parent
cd5fbb29b7
commit
964af32ec0
1 changed files with 21 additions and 21 deletions
|
|
@ -94,18 +94,18 @@ export default function BinV2(){
|
|||
const [bin, setBin] = useState<IBin>(IBin.create());
|
||||
const [devices, setDevices] = useState<Device[]>([]);
|
||||
const [components, setComponents] = useState<Map<string, Component>>(new Map());
|
||||
const [interactions, setInteractions] = useState<Interaction[]>([]);
|
||||
// const [interactions, setInteractions] = useState<Interaction[]>([]);
|
||||
const [permissions, setPermissions] = useState<pond.Permission[]>([]);
|
||||
const [preferences, setPreferences] = useState<Map<string, pond.BinComponentPreferences>>();
|
||||
const [plenums, setPlenums] = useState<Plenum[]>([]);
|
||||
const [ambients, setAmbients] = useState<Ambient[]>([]);
|
||||
// const [ambients, setAmbients] = useState<Ambient[]>([]);
|
||||
const [grainCables, setGrainCables] = useState<GrainCable[]>([]);
|
||||
const [pressures, setPressures] = useState<Pressure[]>([]);
|
||||
const [headspaceCO2, setHeadspaceCO2] = useState<CO2[]>([]);
|
||||
// const [pressures, setPressures] = useState<Pressure[]>([]);
|
||||
// const [headspaceCO2, setHeadspaceCO2] = useState<CO2[]>([]);
|
||||
const [heaters, setHeaters] = useState<Controller[]>([]);
|
||||
const {openSnack} = useSnackbar()
|
||||
const [fans, setFans] = useState<Controller[]>([]);
|
||||
const [compositionNameMap, setCompositionNameMap] = useState<Map<string, string>>(new Map());
|
||||
// const [compositionNameMap, setCompositionNameMap] = useState<Map<string, string>>(new Map());
|
||||
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
||||
const [noteTab, setNoteTab] = useState(0)
|
||||
|
||||
|
|
@ -133,14 +133,14 @@ export default function BinV2(){
|
|||
binAPI
|
||||
.getBinPageData(binID, user.id(), showErrors, as)
|
||||
.then(resp => {
|
||||
if (resp.data.grainCompositionNames) {
|
||||
let tempMap: Map<string, string> = new Map();
|
||||
Object.keys(resp.data.grainCompositionNames).forEach(key => {
|
||||
tempMap.set(key, resp.data.grainCompositionNames[key]);
|
||||
});
|
||||
tempMap.set("correction", "Unknown Source");
|
||||
setCompositionNameMap(tempMap);
|
||||
}
|
||||
// if (resp.data.grainCompositionNames) {
|
||||
// let tempMap: Map<string, string> = new Map();
|
||||
// Object.keys(resp.data.grainCompositionNames).forEach(key => {
|
||||
// tempMap.set(key, resp.data.grainCompositionNames[key]);
|
||||
// });
|
||||
// tempMap.set("correction", "Unknown Source");
|
||||
// setCompositionNameMap(tempMap);
|
||||
// }
|
||||
|
||||
let devs: Device[] = [];
|
||||
let p = new Map<string, pond.BinComponentPreferences>();
|
||||
|
|
@ -171,11 +171,11 @@ export default function BinV2(){
|
|||
});
|
||||
setInteractionDevices(newInteractionDevices);
|
||||
|
||||
if (resp.data.interactions) {
|
||||
setInteractions(resp.data.interactions.map((i: pond.Interaction) => Interaction.any(i)));
|
||||
} else {
|
||||
setInteractions([]);
|
||||
}
|
||||
// if (resp.data.interactions) {
|
||||
// setInteractions(resp.data.interactions.map((i: pond.Interaction) => Interaction.any(i)));
|
||||
// } else {
|
||||
// setInteractions([]);
|
||||
// }
|
||||
//go through the devices and if the device has an attached component include it in the device list
|
||||
if (resp.data.devices && resp.data.devices[0]) {
|
||||
resp.data.devices.forEach((dev: any) => {
|
||||
|
|
@ -278,11 +278,11 @@ export default function BinV2(){
|
|||
setMissedReadings(mostMissed);
|
||||
setPlenums(plenums);
|
||||
setGrainCables(grainCables);
|
||||
setPressures(pressures);
|
||||
setAmbients(ambients);
|
||||
// setPressures(pressures);
|
||||
// setAmbients(ambients);
|
||||
setHeaters(heaters);
|
||||
setFans(fans);
|
||||
setHeadspaceCO2(headspaceCo2);
|
||||
// setHeadspaceCO2(headspaceCo2);
|
||||
}, [components, preferences]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue