Conditions

nodes/conditions.py

DefectFound:

Checks if Report.DefectType is set “None”. If a defect exists, the cell is marked for disposal and cellsDisposed (int) is incremented by 1. Output

Feedback: Displays the type of defect found, or indicates no defect.
Failure: Report.DefectType is “None”.
Success: A defect was detected, and cellsDisposed is incremented.

QueuedCell:

Checks whether there are any cells currently queued on the conveyor for inspection robot 1.

Output
Feedback: Number of cells queued, or confirmation that none are queued.
Failure: cellsQueued is 0.
Success: cellsQueued is greater than 0.

VoltageTester1Free:

Checks if Voltage Tester 1 is available for use based on FreeTesters.

Output
Feedback: Indicates whether Voltage Tester 1 is free or busy.
Failure: Voltage Tester 1 is busy.
Success: Voltage Tester 1 is free.

VoltageTester2Free:

Checks if Voltage Tester 2 is available for use based on FreeTesters.

Output
Feedback: Indicates whether Voltage Tester 2 is free or busy.
Failure: Voltage Tester 2 is busy.
Success: Voltage Tester 2 is free.

CurrentCellTolerable:

Checks if the current cell’s voltage reading (voltageReading) is within the acceptable tolerance defined by NORMAL_CELL_VOLTAGE and ALLOWED_VOLTAGE_TOLERANCE.

Output
Feedback: Displays the current voltageReading and whether it is within tolerance.
Failure: voltageReading is outside the allowed tolerance.
Success: voltageReading is within the allowed tolerance.

AGVAtAssembly:

Checks if any AGV’s location (AGVs[x][1]) is “Assembly”.

Output
Feedback: Indicates whether an AGV is present at the Assembly Station.
Failure: No AGV is at the Assembly Station.
Success: At least one AGV is at the Assembly Station.

AssemblyAGVSlotsEmpty:

Checks whether an AGV at the Assembly Station has all slots empty (AGVs[x][0] == 0).

Output
Feedback: Indicates whether the AGV at Assembly is empty, not empty, or if no AGV is present.
Failure: AGV at Assembly has occupied slots, or no AGV is at Assembly.
Success: AGV at Assembly has all slots empty.

CompetitionEnded:

Checks whether the elapsed time (datetime.now() - startTime) exceeds COMPETITION_DURATION.

Output
Feedback: Confirms that the competition has ended.
Failure: Competition still has time remaining.
Success: Competition duration has been reached.