diff --git a/frontend/src/components/production/ocp/OcpPage.tsx b/frontend/src/components/production/ocp/OcpPage.tsx index fbc57cc..6f85d4a 100644 --- a/frontend/src/components/production/ocp/OcpPage.tsx +++ b/frontend/src/components/production/ocp/OcpPage.tsx @@ -11,14 +11,14 @@ export default function OCPPage() { const server = settings.filter((n) => n.plantToken === "usday1"); return ( -
+
-
+
diff --git a/frontend/src/components/ui/resizable-panels.tsx b/frontend/src/components/ui/resizable-panels.tsx new file mode 100644 index 0000000..f6a6687 --- /dev/null +++ b/frontend/src/components/ui/resizable-panels.tsx @@ -0,0 +1,45 @@ +"use client"; + +import { GripVertical } from "lucide-react"; +import * as ResizablePrimitive from "react-resizable-panels"; + +import { cn } from "@/lib/utils"; + +const ResizablePanelGroup = ({ + className, + ...props +}: React.ComponentProps) => ( + +); + +const ResizablePanel = ResizablePrimitive.Panel; + +const ResizableHandle = ({ + withHandle, + className, + ...props +}: React.ComponentProps & { + withHandle?: boolean; +}) => ( + div]:rotate-90", + className + )} + {...props} + > + {withHandle && ( +
+ +
+ )} +
+); + +export { ResizablePanelGroup, ResizablePanel, ResizableHandle }; diff --git a/frontend/src/utils/formStuff/debugButton.tsx b/frontend/src/utils/formStuff/debugButton.tsx new file mode 100644 index 0000000..9796d94 --- /dev/null +++ b/frontend/src/utils/formStuff/debugButton.tsx @@ -0,0 +1,5 @@ +import { Button } from "@/components/ui/button"; + +export const DebugButton = (data: any) => { + return ; +}; diff --git a/server/services/ocp/controller/labeling/labelProcess.ts b/server/services/ocp/controller/labeling/labelProcess.ts index 5c5f848..62bb5e5 100644 --- a/server/services/ocp/controller/labeling/labelProcess.ts +++ b/server/services/ocp/controller/labeling/labelProcess.ts @@ -52,7 +52,7 @@ export const labelingProcess = async ({ const macId = await getMac(line); // filter out the lot for the line filteredLot = lots.data.filter( - (l: any) => l.MachineID === macId[0].HumanReadableId + (l: any) => l.MachineID === macId[0]?.HumanReadableId ); if (filteredLot.length === 0) { diff --git a/server/services/ocp/controller/specialProcesses/dyco/plcConnection.ts b/server/services/ocp/controller/specialProcesses/dyco/plcConnection.ts index 5a14403..b0bf5f5 100644 --- a/server/services/ocp/controller/specialProcesses/dyco/plcConnection.ts +++ b/server/services/ocp/controller/specialProcesses/dyco/plcConnection.ts @@ -36,7 +36,7 @@ export const dycoConnect = async () => { plcCycle = setInterval(async () => { if (isReading) { createLog( - "warn", + "debug", "dyco", "ocp", "Skipping cycle: previous read still in progress." diff --git a/server/services/ocp/controller/specialProcesses/dyco/plcTags/strapperFault.ts b/server/services/ocp/controller/specialProcesses/dyco/plcTags/strapperFault.ts index 74ae031..45716e2 100644 --- a/server/services/ocp/controller/specialProcesses/dyco/plcTags/strapperFault.ts +++ b/server/services/ocp/controller/specialProcesses/dyco/plcTags/strapperFault.ts @@ -7,6 +7,7 @@ import { createLog } from "../../../../../logger/logger.js"; export let strapperActive = true; export let stapperFaulted = false; export let strapperFaultCount = 3; // move to db so we can control it outside the app +let alreadyAlerted = false; export const strapperFaults = async (tagData: any) => { const { data, error } = await tryCatch(db.select().from(settings)); @@ -15,27 +16,6 @@ export const strapperFaults = async (tagData: any) => { return { success: false, message: "Failed to get settings." }; } - if (strapperActive) { - // monitor strapper - //console.log(`Strapper fault is ${strapperError.value}`); - if (tagData.value && strapperFaultCount > 0) { - // strapper faulted we want to start the trigger to force the check - if (!stapperFaulted) { - createLog( - "error", - "dyco", - "ocp", - `Strapper errored triggering manual checks will be required for the next ${strapperFaultCount}` - ); - } - - stapperFaulted = true; - - // change move fault count to db.... - strapperFaultCount = 3; - } - } - const strapperCheckSetting = data.filter((n) => n.name === "strapperCheck"); if (strapperCheckSetting[0]?.value === "1") { @@ -46,6 +26,7 @@ export const strapperFaults = async (tagData: any) => { "ocp", `There was a strapper error, remaining pallets to check ${strapperFaultCount}.` ); + alreadyAlerted = true; strapperFaultCount = strapperFaultCount - 1; return { success: false, @@ -69,4 +50,25 @@ export const strapperFaults = async (tagData: any) => { }; } } + + if (strapperActive) { + // monitor strapper + //console.log(`Strapper fault is ${strapperError.value}`); + if (tagData.value && strapperFaultCount > 0) { + // strapper faulted we want to start the trigger to force the check + if (!stapperFaulted) { + createLog( + "error", + "dyco", + "ocp", + `Strapper errored triggering manual checks will be required for the next ${strapperFaultCount}` + ); + } + + stapperFaulted = true; + alreadyAlerted = true; + // change move fault count to db.... + strapperFaultCount = 3; + } + } }; diff --git a/server/services/rfid/route/mgtEvents.ts b/server/services/rfid/route/mgtEvents.ts index 36f5426..ef3d31a 100644 --- a/server/services/rfid/route/mgtEvents.ts +++ b/server/services/rfid/route/mgtEvents.ts @@ -59,7 +59,7 @@ app.openapi( await readTags(reader); } else { createLog( - "info", + "debug", "rfid", "rfid", `A new trigger from ${reader} was to soon`