Skip to content

Commit

Permalink
Merge pull request #15 from oxedom/fix/6_
Browse files Browse the repository at this point in the history
Fixed issue with autodetect setting its on occupied status
  • Loading branch information
oxedom authored Jul 8, 2023
2 parents cc8ab5e + 451b446 commit 72fa3d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
11 changes: 3 additions & 8 deletions client/components/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
firstDetect,
calculateTimeDiff,
supressedRoisProcess,
convertRoisSelected,
convertSuppressedRoisToSelected,
SnapshotFactory,
} from "../libs/states_utility";
import { renderAllOverlaps, drawTextOnCanvas } from "../libs/canvas_utility";
Expand Down Expand Up @@ -264,20 +264,15 @@ const selectedRoiState = selector({
minimumAttendance
);

const convertedToSelected = convertRoisSelected(suppresedRois);
const convertedToSelected = convertSuppressedRoisToSelected(suppresedRois);

set(selectedRoi, convertedToSelected);
set(autoDetectState, false);
set(autoDetectArrState, []);
set(autoCheckedState, 0);
}
} else {
// selectedRoisClone.forEach(clone =>
// {
// console.table(clone['events'])
// })
// console.log(selectedRoisClone[0]);
// console.table(selectedRoisClone[0]['events']);

set(selectedRoi, selectedRoisClone);
}
let stop = performance.now();
Expand Down
5 changes: 1 addition & 4 deletions client/libs/states_utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,10 @@ export function supressedRoisProcess(roiMatrix, threshold) {
return filtered;
}

export function convertRoisSelected(arr) {
export function convertSuppressedRoisToSelected(arr) {
return arr.map((a) => {
return {
...selectedFactory(a.cords),
evaluating: false,
occupied: true,
cycleCount: 1,
};
});
}
Expand Down

0 comments on commit 72fa3d1

Please sign in to comment.